$npx -y skills add obra/superpowers --skill requesting-code-reviewUse when completing tasks, implementing major features, or before merging to verify work meets requirements
| 1 | # Requesting Code Review |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | **Core principle:** Review early, review often. |
| 6 | |
| 7 | ## When to Request Review |
| 8 | |
| 9 | **Mandatory:** |
| 10 | - After each task in subagent-driven development |
| 11 | - After completing major feature |
| 12 | - Before merge to main |
| 13 | |
| 14 | **Optional but valuable:** |
| 15 | - When stuck (fresh perspective) |
| 16 | - Before refactoring (baseline check) |
| 17 | - After fixing complex bug |
| 18 | |
| 19 | ## How to Request |
| 20 | |
| 21 | **1. Get git SHAs:** |
| 22 | ```bash |
| 23 | BASE_SHA=$(git rev-parse HEAD~1) # or origin/main |
| 24 | HEAD_SHA=$(git rev-parse HEAD) |
| 25 | ``` |
| 26 | |
| 27 | **2. Dispatch code reviewer subagent:** |
| 28 | |
| 29 | Dispatch a `general-purpose` subagent, filling the template at [code-reviewer.md](code-reviewer.md) |
| 30 | |
| 31 | **Placeholders:** |
| 32 | - `{DESCRIPTION}` - Brief summary of what you built |
| 33 | - `{PLAN_OR_REQUIREMENTS}` - What it should do |
| 34 | - `{BASE_SHA}` - Starting commit |
| 35 | - `{HEAD_SHA}` - Ending commit |
| 36 | |
| 37 | **3. Act on feedback:** |
| 38 | - Fix Critical issues immediately |
| 39 | - Fix Important issues before proceeding |
| 40 | - Note Minor issues for later |
| 41 | - Push back if reviewer is wrong (with reasoning) |
| 42 | |
| 43 | ## Example |
| 44 | |
| 45 | ``` |
| 46 | [Just completed Task 2: Add verification function] |
| 47 | |
| 48 | You: Let me request code review before proceeding. |
| 49 | |
| 50 | BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}') |
| 51 | HEAD_SHA=$(git rev-parse HEAD) |
| 52 | |
| 53 | [Dispatch code reviewer subagent] |
| 54 | DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types |
| 55 | PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md |
| 56 | BASE_SHA: a7981ec |
| 57 | HEAD_SHA: 3df7661 |
| 58 | |
| 59 | [Subagent returns]: |
| 60 | Strengths: Clean architecture, real tests |
| 61 | Issues: |
| 62 | Important: Missing progress indicators |
| 63 | Minor: Magic number (100) for reporting interval |
| 64 | Assessment: Ready to proceed |
| 65 | |
| 66 | You: [Fix progress indicators] |
| 67 | [Continue to Task 3] |
| 68 | ``` |
| 69 | |
| 70 | ## Integration with Workflows |
| 71 | |
| 72 | **Subagent-Driven Development:** |
| 73 | - Review after EACH task |
| 74 | - Catch issues before they compound |
| 75 | - Fix before moving to next task |
| 76 | |
| 77 | **Executing Plans:** |
| 78 | - Review after each task or at natural checkpoints |
| 79 | - Get feedback, apply, continue |
| 80 | |
| 81 | **Ad-Hoc Development:** |
| 82 | - Review before merge |
| 83 | - Review when stuck |
| 84 | |
| 85 | ## Red Flags |
| 86 | |
| 87 | **Never:** |
| 88 | - Skip review because "it's simple" |
| 89 | - Ignore Critical issues |
| 90 | - Proceed with unfixed Important issues |
| 91 | - Argue with valid technical feedback |
| 92 | |
| 93 | **If reviewer wrong:** |
| 94 | - Push back with technical reasoning |
| 95 | - Show code/tests that prove it works |
| 96 | - Request clarification |
| 97 | |
| 98 | See template at: [code-reviewer.md](code-reviewer.md) |