Strict code review guidelines for AgentScope LLM framework focusing on lazy loading, security, testing, and documentation standards
Conduct strict code reviews for the AgentScope framework following agent-oriented programming principles for LLM applications.
Each requirement is labeled with priority:
Third-party libraries (not in `pyproject.toml` dependencies) must be imported at point of use, never at file top:
```python
from some_optional_lib import Feature
def use_feature():
from some_optional_lib import Feature
return Feature()
```
For base class imports in `src/agentscope`, use factory pattern:
```python
def get_xxx_cls() -> "MyClass":
from xxx import BaseClass
class MyClass(BaseClass):
# implementation
return MyClass
```
After understanding code intent, verify:
Check for:
Require:
Verify:
All classes and methods require complete docstrings in **English** following this template:
```python
def func(a: str, b: int | None = None) -> str:
"""{description}
Args:
a (`str`):
The argument a
b (`int | None`, optional):
The argument b
Returns:
`str`:
The return str
"""
```
For special content, use reStructuredText syntax:
```python
class MyClass:
"""Description
`Example link <https://xxx>`_
.. note:: Important note
.. tip:: Helpful tip
.. code-block:: python
def hello_world():
print("Hello world!")
"""
```
Follow Conventional Commits specification:
**Required format:** `<type>(scope): description`
**Valid types:** `feat`, `fix`, `docs`, `ci`, `refactor`, `test`
**Examples:**
Before approving, verify:
1. ✓ Third-party imports use lazy loading
2. ✓ All files under `src/agentscope` have `_` prefix
3. ✓ No hardcoded credentials
4. ✓ Unit tests included for new features
5. ✓ Dependencies properly declared in `pyproject.toml`
6. ✓ All classes/methods have complete English docstrings
7. ✓ Pre-commit checks pass (no file-level skips)
8. ✓ PR title follows Conventional Commits format
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/agentscope-code-review/raw