Dispatch a code-reviewer subagent to catch issues before they spread.
Core principles: Review early and often.
At the start, announce:"I am using the spec-requesting-code-review skill to request code review and dispatch a review subagent."
When to Request Review
Must:
- after every task in subagent-driven development
- after completing a major feature
- before merging to main
Optional but valuable:
- when stuck (fresh perspective)
- before refactoring (baseline check)
- after fixing a complex bug
How to Request
1. Get git SHAs:
BASE_SHA=$(git rev-parse HEAD~1) # 或 origin/main
HEAD_SHA=$(git rev-parse HEAD)
2. Dispatch the code-reviewer subagent:
Use the Task tool with type code-reviewer and fill in the template in references/code-reviewer.md template in
Placeholders:
{WHAT_WAS_IMPLEMENTED}- what you just implemented{PLAN_OR_REQUIREMENTS}- what should be implemented{BASE_SHA}- starting commit{HEAD_SHA}- ending commit{DESCRIPTION}- brief summary
3. Act on feedback:
- Fix Critical issues immediately
- Fix Important issues before continuing
- Note Minor issues for later
- If the reviewer is wrong, push back (with reasons)
Examples
[刚完成 Task 2:添加验证函数]
你:先请求代码审查再继续。
BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
HEAD_SHA=$(git rev-parse HEAD)
[派发 code-reviewer 子智能体]
WHAT_WAS_IMPLEMENTED: 会话索引的验证和修复函数
PLAN_OR_REQUIREMENTS: docs/plans/deployment-plan.md 的 Task 2
BASE_SHA: a7981ec
HEAD_SHA: 3df7661
DESCRIPTION: 添加 verifyIndex() 和 repairIndex(),含 4 种问题类型
[子智能体返回]:
优点:架构清晰、有真实测试
问题:
Important:缺少进度指示
Minor:报告间隔的魔法数字 (100)
评估:可以继续
你:[修复进度指示]
[继续 Task 3]
Integration with Workflow
Subagent-Driven Development:
- Review after each task
- Catch issues before they accumulate
- Fix before moving to the next task
Executing Plans:
- Review after each batch (3 tasks)
- Get feedback, apply, continue
Ad-hoc development:
- Review before merging
- Review when stuck
Red Flags
Never:
- Skip review because it's "too simple"
- Ignore Critical issues
- Continue with unfixed Important issues
- Argue with valid technical feedback
If the reviewer is wrong:
- Push back with technical reasoning
- Show code/tests proving it works
- Ask for clarification
See template at:skills/requesting-code-review/references/code-reviewer.md