<quick_start>
- •Run
/code-review-pipelineafter making code changes - •Reviewers dispatch automatically based on file types
- •Critical/high findings are fixed inline; medium/low reported as suggestions </quick_start>
<when_to_use> Use when:
- •You've implemented a feature and want to catch issues before committing
- •Before finalizing a branch or PR
- •After a significant refactor
- •User asks for a code review
Don't use when:
- •Only config/docs changed (no code to review)
- •Single-line trivial fix </when_to_use>
| File pattern | Categories |
|---|---|
.svelte, .tsx, .jsx, .vue, .html, .css | implementation, test, tech-practices, ui |
.ts, .js, .py, .rs, .go | implementation, test, architecture, tech-practices |
| New files, moved files, changed exports | architecture |
- •The
implementationreviewer is ALWAYS dispatched - •Deduplicate categories into a set of reviewers to dispatch </phase>
For EACH reviewer, construct a prompt that includes:
- •The full git diff
- •The list of files relevant to that reviewer
- •Instructions to return JSON in the standard output format
Dispatch map:
| Category | Agent | Condition |
|---|---|---|
| implementation | implementation-reviewer | Always |
| test | test-reviewer | Source files (not just tests) changed |
| architecture | architecture-reviewer | New/moved files, or changed exports detected |
| tech-practices | tech-practices-reviewer | Framework-specific files in diff |
| ui | ui-reviewer | UI component files in diff |
Launch all applicable reviewers as parallel Task calls in a single message. Use model: sonnet for each.
Prompt template for each reviewer:
code
Review the following code changes. Return your findings as JSON.
## Changed files
{file_list}
## Diff
{diff_content}
- •Compile missing tests list from all reviewers </phase>
Critical and High findings
For each critical/high finding:
- •Read the file at the specified line
- •Apply the recommendation to fix the issue
- •Report what was fixed
Medium and Low findings
Report as suggestions in a summary table:
code
## Review Summary **Reviewers:** implementation, test, ui **Files reviewed:** 5 **Findings:** 2 critical, 1 high, 3 medium, 1 low ### Fixed (Critical/High) - [critical] src/auth.ts:42 — SQL injection via string interpolation → switched to parameterized query - [high] src/api.ts:15 — Uncaught promise rejection → added try/catch ### Suggestions (Medium/Low) | Severity | File | Line | Issue | Recommendation | |---|---|---|---|---| | medium | src/utils.ts | 23 | Potential null dereference | Add null check before access | | low | src/config.ts | 8 | Magic number | Extract to named constant | ### Missing Tests - Test error path when fetchUser throws in src/auth.ts:42 - Test empty array input in src/utils.ts:23
If no findings above confidence threshold: report "Review complete — no issues found." </phase>
</workflow><error_handling>
| Error | Action |
|---|---|
| Reviewer returns malformed JSON | Log warning, continue with other reviewers |
| Reviewer times out | Log warning, continue with other reviewers |
| No git diff available | Report "No changes to review" and stop |
| All reviewers fail | Report error, suggest running individual reviewer manually |
| </error_handling> |