AgentSkillsCN

Review

代码审查

SKILL.md

/review — Combined Multi-Agent Code Review

Run a comprehensive, multi-dimensional code review using specialized subagents via the Task tool.


Steps

1. Determine Scope

  • /review → review all uncommitted changes (git diff)
  • /review [file or directory] → review specific files
  • /review --staged → review staged changes only

2. Identify Changed Files

Read the files to review. Understand what changed and the context around the changes.

3. Select and Launch Subagents

Based on the nature of the changes, read the appropriate agent definition files from .claude/agents/ and spawn Task tool subagents in parallel:

Agent Definitionsubagent_typeWhen to Spawn
code-reviewer.mdsenior-code-reviewerAlways
test-reviewer.mdsenior-code-reviewerAlways
security-reviewer.mdsecurity-code-auditorIf auth, input handling, config, or deps changed
architecture-reviewer.mdsenior-code-reviewerIf new modules/services created or boundaries changed
performance-reviewer.mdsenior-code-reviewerIf data access, algorithms, or hot-path code changed
doc-reviewer.mdsenior-code-reviewerIf public APIs or README changed

Example — spawn all selected reviewers in the same response:

code
Task(subagent_type="senior-code-reviewer",
     prompt="<content of .claude/agents/code-reviewer.md>\n\nReview: {changed_files}")

Task(subagent_type="senior-code-reviewer",
     prompt="<content of .claude/agents/test-reviewer.md>\n\nReview: {test_files}")

Task(subagent_type="security-code-auditor",
     prompt="<content of .claude/agents/security-reviewer.md>\n\nAudit: {changed_files}")

4. Run Verification

After collecting agent reviews, run make check to confirm build/test/lint pass.

5. Compile Results

Merge all agent reports into a single summary:

markdown
## Combined Code Review

**Files Reviewed:** [list]
**Review Agents Used:** [list]
**Overall Quality:** [Excellent / Good / Needs Work / Significant Issues]
**Quality Score:** [N]/100

### Critical Issues (block commit)
[Merged from all agents, deduplicated]

### Major Issues (block PR)
[Merged from all agents, deduplicated]

### Minor Issues (polish)
[Merged from all agents, deduplicated]

### Verification
| Check | Status |
|-------|--------|
| Build | PASS/FAIL |
| Tests | PASS/FAIL |
| Lint | PASS/FAIL |

### Agent Summaries
- **Code Review:** [one-line summary]
- **Security:** [one-line summary]
- **Tests:** [one-line summary]
- **Architecture:** [one-line summary]

### Recommended Actions
1. [Highest priority action]
2. [Next priority]

6. Score

Apply the quality-gates rubric to compute a score. Report the score with gate status:

  • Score >= 80: "Ready to commit"
  • Score >= 90: "Ready for PR"
  • Score >= 95: "Release quality"