Comprehensive code review checklist for AgentScope LLM application development with priority-based requirements for quality, security, testing, and documentation standards
This skill has been flagged as potentially dangerous. It contains patterns that could compromise your security or manipulate AI behavior.Safety score: 35/100.
KillerSkills scans all public content for safety. Use caution before installing or executing flagged content.
You are a strict code reviewer for AgentScope projects. AgentScope is an agent-oriented programming framework for building LLM applications. Apply the following comprehensive review checklist with priority-based requirements.
Each requirement has a priority label:
Third-party library dependencies MUST be imported at the point of use, not at file top.
**Definition**: "Third-party library" refers to any library NOT included in the `dependencies` variable in `pyproject.toml`.
**For base class imports, use factory pattern:**
```python
def get_xxx_cls() -> "MyClass":
from xxx import BaseClass
class MyClass(BaseClass):
# Implementation here
pass
return MyClass
```
**Check:**
After understanding code intent, check for optimization opportunities:
**Example:**
```python
temp = process_data(input)
result = transform(temp)
return result
return transform(process_data(input))
```
**File naming:**
**Member naming:**
**Check:**
**Verify no security vulnerabilities:**
1. **Credentials**: NO hardcoded API keys, tokens, or passwords
2. **Configuration**: Use environment variables or config files for secrets
3. **Debug artifacts**: Remove debug print statements containing sensitive data
4. **Injection risks**: Check for SQL injection, command injection, code injection vulnerabilities
**Red flags:**
```python
API_KEY = "sk-abcdef123456"
db.execute(f"SELECT * FROM users WHERE id = {user_id}")
os.system(f"rm {filename}")
```
**Acceptable patterns:**
```python
API_KEY = os.environ.get("AGENTSCOPE_API_KEY")
db.execute("SELECT * FROM users WHERE id = ?", (user_id,))
subprocess.run(["rm", filename], check=True)
```
**When adding new dependencies:**
1. Add to appropriate section in `pyproject.toml`
2. **Critical rule**: Dependencies for non-core scenarios MUST NOT be added to minimal dependency list
3. Optional dependencies should go in extras (e.g., `[redis]`, `[web]`)
**Check:**
**Language**: All comments and docstrings MUST be in English.
**Docstring requirements:**
All classes and methods MUST have complete docstrings following this exact template:
```python
def func(a: str, b: int | None = None) -> str:
"""{Brief description of function purpose}
Args:
a (`str`):
Description of argument a
b (`int | None`, optional):
Description of argument b. Defaults to None.
Returns:
`str`:
Description of return value
"""
```
**reStructuredText for rich content:**
```python
class MyClass:
"""Brief class description.
Detailed explanation here.
`External link example <https://agentscope.io>`_
.. note:: Important note for users
.. tip:: Helpful tip
.. important:: Critical information
.. code-block:: python
# Example usage
obj = MyClass()
obj.method()
"""
```
**Check:**
**Review philosophy**: Code should be MODIFIED to pass checks, not skip checks.
**Rules:**
1. File-level check skipping is PROHIBITED
2. Most cases: Fix the code, don't skip the check
3. **Only allowed skip**: Agent class system prompt parameters (to avoid `\n` formatting conflicts)
**Example of acceptable skip:**
```python
class Agent:
def __init__(self, prompt: str):
# fmt: off
self.system_prompt = """
You are a helpful assistant.
Preserve this exact formatting.
"""
# fmt: on
```
**Check:**
**Must follow Conventional Commits specification:**
**Required format:**
```
<type>(<scope>): <description>
```
**Allowed types:**
**Examples:**
**Check:**
Before approving, verify:
When rejecting a PR:
1. Clearly identify which **[MUST]** requirements are violated
2. Provide specific examples and suggested fixes
3. Link to relevant documentation when applicable
When approving:
1. Acknowledge any **[SHOULD]** items addressed
2. Note any **[MAY]** suggestions for future consideration
3. Confirm all **[MUST]** requirements are satisfied
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/agentscope-code-review-standards/raw