Code Review
Phase 1: Determine Review Scope
Initial request: $ARGUMENTS
Actions:
Create a todo list to track progress through all phases
Determine what code to review. The user may specify the scope explicitly; if not, infer from context or ask:
User says Scope "review my changes" / no specific scope Unstaged changes ( git diff)"review what I'm about to commit" Staged changes ( git diff --cached)"review this branch" / "compare to main" Branch diff ( git diff main...HEAD)"review these files" / specific paths Only those files "review this PR" / PR number Changes in the PR ( git diff main...HEADor the PR's base)Run the appropriate
git diffcommand to get the changeset. If the diff is empty, tell the user and ask them to clarify
Phase 2: Parallel Review
Capture the changeset (diff output or file contents) from Phase 1 as codeContent. Then read references/agent-prompts.md and launch the 3 code-reviewer agents in parallel, substituting <scope-description> and ${codeContent} in each prompt.
The three agents cover: simplicity/DRY, bugs/correctness, conventions/abstractions.
Phase 3: Consolidate & Report
Once all three agents have returned:
- Deduplicate: If multiple agents flagged the same issue, merge them into one finding and note that multiple reviewers caught it (this increases its priority)
- Classify severity:
- Critical — Bugs, security vulnerabilities, data loss risks, or anything that will break in production
- Important — Convention violations, missing tests, DRY issues, or patterns that will cause maintenance pain
- Minor — Style nits, minor simplification opportunities (include only if the list is short)
- Sort by severity (critical first), then by how many reviewers flagged it
- Present the consolidated report using this format:
## Code Review Summary
Reviewed: <scope description>
Reviewers: simplicity/DRY, bugs/correctness, conventions/abstractions
### Critical (X issues)
**1. [Short title]** — `path/to/file.ts:42`
[Description of the issue]
Flagged by: bugs/correctness, conventions
Suggested fix: [concrete suggestion]
### Important (X issues)
...
### Minor (X issues)
...
### What looks good
[Brief note on things the reviewers found well-done — balanced feedback matters]
- If no high-confidence issues were found across any dimension, confirm the code looks good with a brief summary of what was checked