Core Philosophy
Code review should be:
- Convention-aware - Follows project-specific rules from CLAUDE.md
- Actionable - Every comment includes a specific fix
- Prioritized - Critical issues first, style last
- Contextual - Understands the change's purpose
Review Categories (Priority Order)
- 🔴 Critical - Security vulnerabilities, data loss risks, crashes
- 🟠 Bugs - Logic errors, edge cases, race conditions
- 🟡 Performance - N+1 queries, memory leaks, inefficient algorithms
- 🔵 Maintainability - Code clarity, naming, documentation
- ⚪ Style - Formatting, conventions, nitpicks
Key Rules
- NEVER approve code you haven't read
- ALWAYS read CLAUDE.md first if it exists
- Spawn fresh context for large reviews to avoid bias
- Be specific - line numbers, code snippets, fixes
- Stay focused - review what changed, not the whole file
Code Review
What would you like to review?
- Current diff - Review uncommitted changes (
git diff)
- Staged changes - Review staged changes (
git diff --staged)
- PR by number - Review a specific pull request
- Specific file - Review a single file in depth
- Branch comparison - Compare two branches
Enter your choice or describe what you want reviewed:
| Response Pattern |
Workflow |
| "1", "current", "diff", "changes" |
workflows/review-diff.md |
| "2", "staged" |
workflows/review-staged.md |
| "3", "pr", "#\d+", "pull request" |
workflows/review-pr.md |
| "4", "file", specific filepath |
workflows/review-file.md |
| "5", "branch", "compare" |
workflows/review-branch.md |
References
- references/review-checklist.md - Comprehensive checklist by category
- references/common-issues.md - Frequently found problems and fixes
- references/security-patterns.md - Security vulnerabilities to watch for
Available Workflows
- review-diff.md - Review current uncommitted changes
- review-staged.md - Review staged changes before commit
- review-pr.md - Review a pull request by number
- review-file.md - Deep review of a specific file
- review-branch.md - Compare branches
Automation Scripts
Optional helper scripts for code review tasks:
- scripts/get-diff.sh - Get formatted git diff (unstaged/staged/branch)
- scripts/check-tests.sh - Verify test coverage for changed files
- scripts/format-report.sh - Generate review report template
Usage:
# Get diff
./scripts/get-diff.sh [unstaged|staged|branch] [branch-name]
# Check test coverage
./scripts/check-tests.sh [unstaged|staged]
# Generate report template
./scripts/format-report.sh "Feature Name"
1---2name: code-review3description: Automated code review against project conventions (CLAUDE.md) and best practices4---56<essential_principles>78## Core Philosophy910Code review should be:111. **Convention-aware** - Follows project-specific rules from CLAUDE.md122. **Actionable** - Every comment includes a specific fix133. **Prioritized** - Critical issues first, style last144. **Contextual** - Understands the change's purpose1516## Review Categories (Priority Order)17181. **🔴 Critical** - Security vulnerabilities, data loss risks, crashes192. **🟠 Bugs** - Logic errors, edge cases, race conditions203. **🟡 Performance** - N+1 queries, memory leaks, inefficient algorithms214. **🔵 Maintainability** - Code clarity, naming, documentation225. **⚪ Style** - Formatting, conventions, nitpicks2324## Key Rules2526- **NEVER approve code you haven't read**27- **ALWAYS read CLAUDE.md first** if it exists28- **Spawn fresh context** for large reviews to avoid bias29- **Be specific** - line numbers, code snippets, fixes30- **Stay focused** - review what changed, not the whole file3132</essential_principles>3334<intake>3536# Code Review3738What would you like to review?39401. **Current diff** - Review uncommitted changes (`git diff`)412. **Staged changes** - Review staged changes (`git diff --staged`)423. **PR by number** - Review a specific pull request434. **Specific file** - Review a single file in depth445. **Branch comparison** - Compare two branches4546**Enter your choice or describe what you want reviewed:**4748</intake>4950<routing>5152| Response Pattern | Workflow |53|------------------|----------|54| "1", "current", "diff", "changes" | workflows/review-diff.md |55| "2", "staged" | workflows/review-staged.md |56| "3", "pr", "#\d+", "pull request" | workflows/review-pr.md |57| "4", "file", specific filepath | workflows/review-file.md |58| "5", "branch", "compare" | workflows/review-branch.md |5960</routing>6162<reference_index>6364## References6566- **references/review-checklist.md** - Comprehensive checklist by category67- **references/common-issues.md** - Frequently found problems and fixes68- **references/security-patterns.md** - Security vulnerabilities to watch for6970</reference_index>7172<workflows_index>7374## Available Workflows75761. **review-diff.md** - Review current uncommitted changes772. **review-staged.md** - Review staged changes before commit783. **review-pr.md** - Review a pull request by number794. **review-file.md** - Deep review of a specific file805. **review-branch.md** - Compare branches8182</workflows_index>8384<scripts_index>8586## Automation Scripts8788Optional helper scripts for code review tasks:8990- **scripts/get-diff.sh** - Get formatted git diff (unstaged/staged/branch)91- **scripts/check-tests.sh** - Verify test coverage for changed files92- **scripts/format-report.sh** - Generate review report template9394Usage:95```bash96# Get diff97./scripts/get-diff.sh [unstaged|staged|branch] [branch-name]9899# Check test coverage100./scripts/check-tests.sh [unstaged|staged]101102# Generate report template103./scripts/format-report.sh "Feature Name"104```105106</scripts_index>