requesting-code-review
obra/superpowers
在完成任务、实现主要功能或合并之前使用,以验证工作是否符合要求
...展开全部关于requesting-code-review
“requesting-code-review ”技能旨在促进开发工作流中的代码审查流程,确保代码在集成前符合既定要求和质量标准。 通过鼓励开发人员尽早且频繁地寻求反馈,该技能解决了开发周期中常见的问题——即未被发现的缺陷可能随着开发进程不断恶化。它通过在团队成员间倡导协作与持续改进的文化,有助于维持高代码质量和项目完整性。
常见问题
我应该在什么情况下请求代码审查?
在基于子代理的开发中,您应在每个任务完成后、完成主要功能后以及合并到主分支之前申请代码审查。
使用此技能需要哪些工具?
您需要使用 Git 进行版本控制,并使用“任务”工具来调度代码审查子代理。
对于简单的修改,我可以跳过请求代码审查吗?
不可以,即使只是简单的修改,也绝不能跳过代码审查,否则可能会导致关键问题被忽视。
如果我不同意评审者的反馈,该怎么办?
你可以通过技术论证进行反驳,提供来自代码或测试的证据,并在必要时请求进一步说明。
该技能是否兼容所有开发环境?
该技能专为可使用 Git 和 Task 工具的环境设计,因此与现代开发实践具有广泛的兼容性。
Requesting Code Review
Dispatch a code reviewer subagent to catch issues before they cascade. The reviewer gets precisely crafted context for evaluation — never your session's history. This keeps the reviewer focused on the work product, not your thought process, and preserves your own context for continued work.
Core principle: Review early, review often.
When to Request Review
Mandatory:
- After each task in subagent-driven development
- After completing major feature
- Before merge to main
Optional but valuable:
- When stuck (fresh perspective)
- Before refactoring (baseline check)
- After fixing complex bug
How to Request
1. Get git SHAs:
BASE_SHA=$(git rev-parse HEAD~1) # or origin/mainHEAD_SHA=$(git rev-parse HEAD)
2. Dispatch code reviewer subagent:
Dispatch a general-purpose subagent, filling the template at code-reviewer.md
Placeholders:
{DESCRIPTION}- Brief summary of what you built{PLAN_OR_REQUIREMENTS}- What it should do{BASE_SHA}- Starting commit{HEAD_SHA}- Ending commit
3. Act on feedback:
- Fix Critical issues immediately
- Fix Important issues before proceeding
- Note Minor issues for later
- Push back if reviewer is wrong (with reasoning)
Example
[Just completed Task 2: Add verification function]You: Let me request code review before proceeding.BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')HEAD_SHA=$(git rev-parse HEAD)[Dispatch code reviewer subagent] DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md BASE_SHA: a7981ec HEAD_SHA: 3df7661[Subagent returns]: Strengths: Clean architecture, real tests Issues: Important: Missing progress indicators Minor: Magic number (100) for reporting interval Assessment: Ready to proceedYou: [Fix progress indicators][Continue to Task 3]Integration with Workflows
Subagent-Driven Development:
- Review after EACH task
- Catch issues before they compound
- Fix before moving to next task
Executing Plans:
- Review after each task or at natural checkpoints
- Get feedback, apply, continue
Ad-Hoc Development:
- Review before merge
- Review when stuck
Red Flags
Never:
- Skip review because "it's simple"
- Ignore Critical issues
- Proceed with unfixed Important issues
- Argue with valid technical feedback
If reviewer wrong:
- Push back with technical reasoning
- Show code/tests that prove it works
- Request clarification
See template at: code-reviewer.md





首页
