The Four Phases
You MUST complete each phase before proceeding to the next.
Phase 1: Context & Pre-Flight
BEFORE looking at a single line of code:
Verify the "Why"
- Read the PR description and linked ticket/issue.
- Does this solve the stated problem?
- Is the solution proportionate to the problem? (e.g., don't re-architect the DB for a typo fix).
Check the Automated Gates
- STOP if CI is failing. Do not review code that doesn't build/pass tests.
- Check linting results and static analysis.
- Verify code coverage hasn't dropped.
Assess the Scope
- Is the PR too large (>400 lines)?
- Does it mix refactoring with feature work? (Violates "Single Responsibility Principle" of PRs).
- Is it consistent with the existing patterns in the codebase?
- CRITICAL: This review MUST be a 'fine-toothed comb' pass. Surface-level checks are forbidden.
- Action: If too big, request a split immediately. Do not attempt to review "spaghetti PRs".
Phase 2: The Architectural Pass (The "Macro" View)
Look at the shape, not the syntax:
Architecture & Design
- Does this code belong in this file/module?
- Does it introduce circular dependencies?
- Is it consistent with the existing patterns in the codebase?
- Action: If the architecture is wrong, stop reviewing details. Reject the approach first.
Security & Safety
- Are user inputs sanitized?
- Are permissions/authorizations checked?
- Are secrets hardcoded?
- Is there PII (Personal Identifiable Information) exposure?
Performance & Scale
- Look for N+1 queries.
- Loops inside loops or expensive operations on the main thread.
- Unbounded list rendering (missing pagination).
Phase 3: The Logic & Implementation Pass (The "Micro" View)
Now inspect the lines:
Correctness & Edge Cases
- Don't just verify the Happy Path.
- What happens if the array is empty? If the API returns 500? If the value is null?
- Check for "Off-by-one" errors.
Readability & Maintainability
- Are variable names descriptive? (
data vs userProfilePayload).
- Are functions short and single-purpose?
- The "Six Month Rule": Will we understand this code in 6 months?
Test Quality
- Do the tests actually fail if the logic breaks? (Look for
assert(true) or weak expectations).
- Are they testing implementation details (bad) or behavior (good)?
- Is the test code clean, or is it a mess of mocks?
Phase 4: Feedback & Delivery
How you say it matters as much as what you say:
Categorize Your Comments
- [BLOCKER]: Bug, security risk, spec violation. PR cannot merge.
- [IMPORTANT]: Technical debt, strong architectural preference. Discuss before merge.
- [NIT]: Formatting, renaming, minor polish. Optional/Non-blocking.
- [QUESTION]: "I don't understand this part, can you explain?"
Critique the Code, Not the Person
- Bad: "You didn't handle the error here."
- Good: "This block might throw an exception; should we add a try/catch?"
- Use "We" instead of "You" (e.g., "We should handle...")
Explicit Approval Status
- Don't leave them guessing. Explicitly "Request Changes" or "Approve".
- If you left comments but they are non-blocking, Approve with comments.
Red Flags - STOP and Request Changes
If you see these patterns:
- PR > 500 Lines: "Please split this into smaller, logical PRs."
- No Description/Screenshots: "Please add context/proof of work."
- "WIP" or "Draft" status: Do not review until ready.
- Commented out code: "Delete it or use a feature flag."
- Console logs left in: "Remove debug logging."
- Refactoring mixed with Logic: "Please separate the rename/refactor into a separate PR to make this diff readable."
- Magic Numbers/Strings: "Extract this to a constant."
ALL of these mean: STOP. Do not offer a full review until fixed.
Your Human Partner's Signals You're Doing It Wrong
Watch for these complaints:
- "You're just nitpicking style." - You missed Phase 2 (Architecture).
- "Why did this break production? You approved it!" - You skipped Phase 3 (Edge cases).
- "I didn't know that was a blocker." - You failed Phase 4 (Categorization).
- "This review took 3 days." - You are blocking the pipeline. Review is a high-priority task.
When you see these: STOP. Re-evaluate your review priorities.
Common Rationalizations
| Excuse |
Reality |
| "It's a hotfix, just merge it" |
Hotfixes bypass safety and cause the next outage. |
| "I trust them, they are a senior dev" |
Seniors make complex bugs. Everyone needs review. |
| "I'll fix the style in my next PR" |
Technical debt accrues instantly. Fix it now. |
| "It works on my machine" |
But does it work in the CI/Production environment? |
| "The PR is too big to split now" |
It is too big to review safely. Sunk cost fallacy. |
| "LGTM" (Looks Good To Me) after 1 min |
You didn't read it. You are rubber-stamping. |
| "It's a small change" |
Small changes need 'fine-toothed comb' reviews too. |
Quick Reference
| Phase |
Key Activities |
Success Criteria |
| 1. Context |
Check CI, Description, Scope |
Understanding of goal, clean CI |
| 2. Architecture |
Design patterns, Security, Perf |
Safe, scalable, consistent design |
| 3. Logic |
Edge cases, Naming, Tests |
Correct logic, clean code, strong tests |
| 4. Delivery |
Tag comments (NIT vs BLOCKER) |
Clear, actionable, kind feedback |
When The PR is "Unreviewable"
If the code is a mess, the logic is impossible to follow, or the architecture is fundamentally flawed:
- Stop reviewing individual lines.
- Write a high-level summary comment explaining the fundamental issue.
- Offer a synchronous call (Zoom/Huddle) to discuss the approach.
- Mark as "Request Changes".
Do not waste time nitpicking syntax on code that needs to be deleted.
Supporting Techniques
superpowers:clean-code - Reference for what "Good" looks like.
superpowers:security-audit - Checklist for Phase 2.
superpowers:empathetic-communication - For delivering Phase 4 effectively.
Real-World Impact
- Rubber Stamp Reviews: 30% production bug rate, knowledge silos.
- Phased Reviews: <5% production bug rate, shared ownership, team mentorship.
- Catching a bug in Review: 10x cheaper than catching it in QA, 100x cheaper than Production.
AI-Assisted Code Review (2026)
AI Tooling
- GitHub Copilot: Code review suggestions
- Qodo: Auto-generated tests
- SonarQube: Static analysis + AI
What AI Can Do
- Better naming, complexity detection
- Security pattern recognition
What Only Humans Can Do
-Business logic correctness
Automated Security
Tools
- Snyk (dependencies), Semgrep (SAST)
- Trivy (containers), GitGuardian (secrets)
1---2name: code-review3description: Code Review Skill4---5## The Four Phases67You MUST complete each phase before proceeding to the next.89### Phase 1: Context & Pre-Flight1011**BEFORE looking at a single line of code:**12131. **Verify the "Why"**14 - Read the PR description and linked ticket/issue.15 - Does this solve the stated problem?16 - Is the solution proportionate to the problem? (e.g., don't re-architect the DB for a typo fix).17182. **Check the Automated Gates**19 - **STOP if CI is failing.** Do not review code that doesn't build/pass tests.20 - Check linting results and static analysis.21 - Verify code coverage hasn't dropped.22233. **Assess the Scope**24 - Is the PR too large (>400 lines)?25 - Does it mix refactoring with feature work? (Violates "Single Responsibility Principle" of PRs).26 - Is it consistent with the existing patterns in the codebase?27- **CRITICAL: This review MUST be a 'fine-toothed comb' pass. Surface-level checks are forbidden.**28- **Action:** If too big, request a split immediately. Do not attempt to review "spaghetti PRs".2930### Phase 2: The Architectural Pass (The "Macro" View)3132**Look at the shape, not the syntax:**33341. **Architecture & Design**35 - Does this code belong in this file/module?36 - Does it introduce circular dependencies?37 - Is it consistent with the existing patterns in the codebase?38 - **Action:** If the architecture is wrong, stop reviewing details. Reject the approach first.39402. **Security & Safety**41 - Are user inputs sanitized?42 - Are permissions/authorizations checked?43 - Are secrets hardcoded?44 - Is there PII (Personal Identifiable Information) exposure?45463. **Performance & Scale**47 - Look for N+1 queries.48 - Loops inside loops or expensive operations on the main thread.49 - Unbounded list rendering (missing pagination).5051### Phase 3: The Logic & Implementation Pass (The "Micro" View)5253**Now inspect the lines:**54551. **Correctness & Edge Cases**56 - **Don't just verify the Happy Path.**57 - What happens if the array is empty? If the API returns 500? If the value is null?58 - Check for "Off-by-one" errors.59602. **Readability & Maintainability**61 - Are variable names descriptive? (`data` vs `userProfilePayload`).62 - Are functions short and single-purpose?63 - *The "Six Month Rule":* Will we understand this code in 6 months?64653. **Test Quality**66 - Do the tests actually fail if the logic breaks? (Look for `assert(true)` or weak expectations).67 - Are they testing implementation details (bad) or behavior (good)?68 - Is the test code clean, or is it a mess of mocks?6970### Phase 4: Feedback & Delivery7172**How you say it matters as much as what you say:**73741. **Categorize Your Comments**75 - **[BLOCKER]:** Bug, security risk, spec violation. PR cannot merge.76 - **[IMPORTANT]:** Technical debt, strong architectural preference. Discuss before merge.77 - **[NIT]:** Formatting, renaming, minor polish. Optional/Non-blocking.78 - **[QUESTION]:** "I don't understand this part, can you explain?"79802. **Critique the Code, Not the Person**81 - Bad: "You didn't handle the error here."82 - Good: "This block might throw an exception; should we add a try/catch?"83 - Use "We" instead of "You" (e.g., "We should handle...")84853. **Explicit Approval Status**86 - Don't leave them guessing. Explicitly "Request Changes" or "Approve".87 - If you left comments but they are non-blocking, Approve with comments.8889## Red Flags - STOP and Request Changes9091If you see these patterns:92- **PR > 500 Lines:** "Please split this into smaller, logical PRs."93- **No Description/Screenshots:** "Please add context/proof of work."94- **"WIP" or "Draft" status:** Do not review until ready.95- **Commented out code:** "Delete it or use a feature flag."96- **Console logs left in:** "Remove debug logging."97- **Refactoring mixed with Logic:** "Please separate the rename/refactor into a separate PR to make this diff readable."98- **Magic Numbers/Strings:** "Extract this to a constant."99100**ALL of these mean: STOP. Do not offer a full review until fixed.**101102## Your Human Partner's Signals You're Doing It Wrong103104**Watch for these complaints:**105- "You're just nitpicking style." - You missed Phase 2 (Architecture).106- "Why did this break production? You approved it!" - You skipped Phase 3 (Edge cases).107- "I didn't know that was a blocker." - You failed Phase 4 (Categorization).108- "This review took 3 days." - You are blocking the pipeline. Review is a high-priority task.109110**When you see these:** STOP. Re-evaluate your review priorities.111112## Common Rationalizations113114| Excuse | Reality |115|--------|---------|116| "It's a hotfix, just merge it" | Hotfixes bypass safety and cause the *next* outage. |117| "I trust them, they are a senior dev" | Seniors make complex bugs. Everyone needs review. |118| "I'll fix the style in my next PR" | Technical debt accrues instantly. Fix it now. |119| "It works on my machine" | But does it work in the CI/Production environment? |120| "The PR is too big to split now" | It is too big to review safely. Sunk cost fallacy. |121| "LGTM" (Looks Good To Me) after 1 min | You didn't read it. You are rubber-stamping. |122| "It's a small change" | Small changes need 'fine-toothed comb' reviews too. |123124## Quick Reference125126| Phase | Key Activities | Success Criteria |127|-------|---------------|------------------|128| **1. Context** | Check CI, Description, Scope | Understanding of goal, clean CI |129| **2. Architecture** | Design patterns, Security, Perf | Safe, scalable, consistent design |130| **3. Logic** | Edge cases, Naming, Tests | Correct logic, clean code, strong tests |131| **4. Delivery** | Tag comments (NIT vs BLOCKER) | Clear, actionable, kind feedback |132133## When The PR is "Unreviewable"134135If the code is a mess, the logic is impossible to follow, or the architecture is fundamentally flawed:1361371. **Stop reviewing individual lines.**1382. Write a high-level summary comment explaining the fundamental issue.1393. Offer a synchronous call (Zoom/Huddle) to discuss the approach.1404. **Mark as "Request Changes".**141142**Do not waste time nitpicking syntax on code that needs to be deleted.**143144## Supporting Techniques145146- **`superpowers:clean-code`** - Reference for what "Good" looks like.147- **`superpowers:security-audit`** - Checklist for Phase 2.148- **`superpowers:empathetic-communication`** - For delivering Phase 4 effectively.149150## Real-World Impact151152- **Rubber Stamp Reviews:** 30% production bug rate, knowledge silos.153- **Phased Reviews:** <5% production bug rate, shared ownership, team mentorship.154- **Catching a bug in Review:** 10x cheaper than catching it in QA, 100x cheaper than Production.155156## AI-Assisted Code Review (2026)157158### AI Tooling159- **GitHub Copilot:** Code review suggestions160- **Qodo:** Auto-generated tests161- **SonarQube:** Static analysis + AI162163### What AI Can Do164- Better naming, complexity detection165- Security pattern recognition166167### What Only Humans Can Do168-Business logic correctness169- Architectural coherence170171## Automated Security172173### Tools174- **Snyk** (dependencies), **Semgrep** (SAST)175- **Trivy** (containers), **GitGuardian** (secrets)