2026-02-27 15:32:58 +01:00
---
name: requesting-code-review
description: Use when completing tasks, implementing major features, or before merging. Validates work meets requirements through systematic review process.
2026-03-03 04:08:56 -08:00
version: 1.1.0
author: Hermes Agent (adapted from obra/superpowers)
2026-02-27 15:32:58 +01:00
license: MIT
metadata:
hermes:
tags: [code-review, quality, validation, workflow, review]
related_skills: [subagent-driven-development, writing-plans, test-driven-development]
---
# Requesting Code Review
## Overview
2026-03-03 04:08:56 -08:00
Dispatch a reviewer subagent to catch issues before they cascade. Review early, review often.
2026-02-27 15:32:58 +01:00
**Core principle:** Fresh perspective finds issues you'll miss.
## When to Request Review
2026-03-03 04:08:56 -08:00
**Mandatory:**
2026-02-27 15:32:58 +01:00
- After each task in subagent-driven development
2026-03-03 04:08:56 -08:00
- After completing a major feature
2026-02-27 15:32:58 +01:00
- Before merge to main
- After bug fixes
2026-03-03 04:08:56 -08:00
**Optional but valuable:**
2026-02-27 15:32:58 +01:00
- When stuck (fresh perspective)
- Before refactoring (baseline check)
- After complex logic implementation
- When touching critical code (auth, payments, data)
2026-03-03 04:08:56 -08:00
**Never skip because:**
- "It's simple" — simple bugs compound
- "I'm in a hurry" — reviews save time
- "I tested it" — you have blind spots
2026-02-27 15:32:58 +01:00
## Review Process
2026-03-03 04:08:56 -08:00
### Step 1: Self-Review First
2026-02-27 15:32:58 +01:00
2026-03-03 04:08:56 -08:00
Before dispatching a reviewer, check yourself:
2026-02-27 15:32:58 +01:00
- [ ] Code follows project conventions
- [ ] All tests pass
2026-03-03 04:08:56 -08:00
- [ ] No debug print statements left
- [ ] No hardcoded secrets or credentials
2026-02-27 15:32:58 +01:00
- [ ] Error handling in place
- [ ] Commit messages are clear
```bash
# Run full test suite
2026-03-03 04:08:56 -08:00
pytest tests/ -q
2026-02-27 15:32:58 +01:00
# Check for debug code
2026-03-03 04:08:56 -08:00
search_files("print(", path="src/", file_glob="*.py")
search_files("console.log", path="src/", file_glob="*.js")
2026-02-27 15:32:58 +01:00
# Check for TODOs
2026-03-03 04:08:56 -08:00
search_files("TODO|FIXME|HACK", path="src/")
2026-02-27 15:32:58 +01:00
```
2026-03-03 04:08:56 -08:00
### Step 2: Gather Context
```bash
# Changed files
git diff --name-only HEAD~1
# Diff summary
git diff --stat HEAD~1
# Recent commits
git log --oneline -5
```
2026-02-27 15:32:58 +01:00
2026-03-03 04:08:56 -08:00
### Step 3: Dispatch Reviewer Subagent
Use `delegate_task` to dispatch a focused reviewer:
2026-02-27 15:32:58 +01:00
```python
delegate_task(
2026-03-03 04:08:56 -08:00
goal="Review implementation for correctness and quality",
2026-02-27 15:32:58 +01:00
context="""
2026-03-03 04:08:56 -08:00
WHAT WAS IMPLEMENTED:
[Brief description of the feature/fix]
ORIGINAL REQUIREMENTS:
[From plan, issue, or user request]
2026-02-27 15:32:58 +01:00
FILES CHANGED:
2026-03-03 04:08:56 -08:00
- src/models/user.py (added User class)
- src/auth/login.py (added login endpoint)
- tests/test_auth.py (added 8 tests)
REVIEW CHECKLIST:
- [ ] Correctness: Does it do what it should?
- [ ] Edge cases: Are they handled?
- [ ] Error handling: Is it adequate?
- [ ] Code quality: Clear names, good structure?
- [ ] Test coverage: Are tests meaningful?
- [ ] Security: Any vulnerabilities?
- [ ] Performance: Any obvious issues?
2026-02-27 15:32:58 +01:00
OUTPUT FORMAT:
- Summary: [brief assessment]
2026-03-03 04:08:56 -08:00
- Critical Issues: [must fix — blocks merge]
- Important Issues: [should fix before merge]
2026-02-27 15:32:58 +01:00
- Minor Issues: [nice to have]
2026-03-03 04:08:56 -08:00
- Strengths: [what was done well]
- Verdict: APPROVE / REQUEST_CHANGES
2026-02-27 15:32:58 +01:00
""",
toolsets=['file']
)
```
### Step 4: Act on Feedback
2026-03-03 04:08:56 -08:00
**Critical Issues (block merge):**
2026-02-27 15:32:58 +01:00
- Security vulnerabilities
- Broken functionality
- Data loss risk
- Test failures
2026-03-03 04:08:56 -08:00
- **Action:** Fix immediately before proceeding
2026-02-27 15:32:58 +01:00
2026-03-03 04:08:56 -08:00
**Important Issues (should fix):**
2026-02-27 15:32:58 +01:00
- Missing edge case handling
- Poor error messages
- Unclear code
- Missing tests
2026-03-03 04:08:56 -08:00
- **Action:** Fix before merge if possible
2026-02-27 15:32:58 +01:00
2026-03-03 04:08:56 -08:00
**Minor Issues (nice to have):**
2026-02-27 15:32:58 +01:00
- Style preferences
- Refactoring suggestions
- Documentation improvements
2026-03-03 04:08:56 -08:00
- **Action:** Note for later or quick fix
2026-02-27 15:32:58 +01:00
2026-03-03 04:08:56 -08:00
**If reviewer is wrong:**
- Push back with technical reasoning
- Show code/tests that prove it works
- Request clarification
2026-02-27 15:32:58 +01:00
## Review Dimensions
### Correctness
- Does it implement the requirements?
- Are there logic errors?
- Do edge cases work?
- Are there race conditions?
### Code Quality
- Is code readable?
2026-03-03 04:08:56 -08:00
- Are names clear and descriptive?
- Is it too complex? (Functions >20 lines = smell)
2026-02-27 15:32:58 +01:00
- Is there duplication?
### Testing
2026-03-03 04:08:56 -08:00
- Are there meaningful tests?
2026-02-27 15:32:58 +01:00
- Do they cover edge cases?
2026-03-03 04:08:56 -08:00
- Do they test behavior, not implementation?
- Do all tests pass?
2026-02-27 15:32:58 +01:00
### Security
- Any injection vulnerabilities?
- Proper input validation?
- Secrets handled correctly?
- Access control in place?
### Performance
- Any N+1 queries?
2026-03-03 04:08:56 -08:00
- Unnecessary computation in loops?
2026-02-27 15:32:58 +01:00
- Memory leaks?
2026-03-03 04:08:56 -08:00
- Missing caching opportunities?
2026-02-27 15:32:58 +01:00
## Review Output Format
2026-03-03 04:08:56 -08:00
Standard format for reviewer subagent output:
2026-02-27 15:32:58 +01:00
```markdown
## Review Summary
**Assessment:** [Brief overall assessment]
2026-03-03 04:08:56 -08:00
**Verdict:** APPROVE / REQUEST_CHANGES
2026-02-27 15:32:58 +01:00
---
## Critical Issues (Fix Required)
1. * * [Issue title]**
- Location: `file.py:45`
- Problem: [Description]
- Suggestion: [How to fix]
## Important Issues (Should Fix)
1. * * [Issue title]**
- Location: `file.py:67`
- Problem: [Description]
- Suggestion: [How to fix]
## Minor Issues (Optional)
1. * * [Issue title]**
- Suggestion: [Improvement idea]
## Strengths
- [What was done well]
```
## Integration with Other Skills
### With subagent-driven-development
2026-03-03 04:08:56 -08:00
Review after EACH task — this is the two-stage review:
1. Spec compliance review (does it match the plan?)
2. Code quality review (is it well-built?)
3. Fix issues from either review
4. Proceed to next task only when both approve
2026-02-27 15:32:58 +01:00
### With test-driven-development
2026-03-03 04:08:56 -08:00
Review verifies:
- Tests were written first (RED-GREEN-REFACTOR followed?)
- Tests are meaningful (not just asserting True)?
2026-02-27 15:32:58 +01:00
- Edge cases covered?
- All tests pass?
### With writing-plans
Review validates:
2026-03-03 04:08:56 -08:00
- Implementation matches the plan?
2026-02-27 15:32:58 +01:00
- All tasks completed?
- Quality standards met?
2026-03-03 04:08:56 -08:00
## Red Flags
2026-02-27 15:32:58 +01:00
2026-03-03 04:08:56 -08:00
**Never:**
- Skip review because "it's simple"
- Ignore Critical issues
- Proceed with unfixed Important issues
- Argue with valid technical feedback without evidence
2026-02-27 15:32:58 +01:00
## Quality Gates
**Must pass before merge:**
- [ ] No critical issues
- [ ] All tests pass
2026-03-03 04:08:56 -08:00
- [ ] Review verdict: APPROVE
2026-02-27 15:32:58 +01:00
- [ ] Requirements met
**Should pass before merge:**
- [ ] No important issues
- [ ] Documentation updated
- [ ] Performance acceptable
## Remember
```
Review early
Review often
Be specific
Fix critical issues first
Quality over speed
```
**A good review catches what you missed.**