Don't use when:
- Only config/docs changed (no code to review)
- Single-line trivial fix
| File pattern |
Categories |
.svelte, .tsx, .jsx, .vue, .html, .css |
implementation, test, tech-practices, ui |
.ts, .js, .py, .rs, .go |
implementation, test, architecture, tech-practices, docs |
| New files, moved files, changed exports |
architecture |
| Changed public API, config, env vars, CLI flags |
docs |
- The
implementation reviewer is ALWAYS dispatched
- Check for a plan: Look for plan context to pass to the plan-adherence reviewer. Repos accumulate multiple plans over time, so disambiguation matters — using the wrong plan produces bogus findings. Check these sources in priority order:
- Explicit argument (highest priority): If the user passed plan context as an argument (e.g.,
/code-review-pipeline "plan: ..." or a plan slug/path), use that directly. Read the file if a path was given.
- Branch-matched plan: List all
plans/*/state.json with "phase": "SELECTED". If the current git branch name contains a plan slug (e.g., branch feat/user-auth matches plans/user-auth/), use that plan. This is the most common case — branches are usually named after the feature they implement.
- Diff-matched plan: If no branch match, compare changed file paths against each selected plan's scope (read
approaches.json to understand what each plan covers). Pick the plan whose scope best overlaps with the changed files.
plan.md or PLAN.md in the repo root — use as fallback only if no plans/ directory exists.
- If multiple plans match equally or no plan is found, do NOT guess. Skip the plan-adherence reviewer and note "Multiple plans found, pass a plan slug to disambiguate" or "No matching plan found".
If plan context is found, add
plan-adherence to the category set and store the plan content to pass to the reviewer.
- Deduplicate categories into a set of reviewers to dispatch
Dispatch map:
| Category |
Teammate role |
Condition |
| implementation |
core:review-implementation |
Always |
| test |
core:review-tests |
Source files (not just tests) changed |
| architecture |
core:review-architecture |
New/moved files, or changed exports detected |
| tech-practices |
core:review-tech-practices |
Framework-specific files in diff |
| ui |
core:review-ui |
UI component files in diff |
| docs |
core:review-docs |
Source files changed (not just tests/docs) |
| plan-adherence |
core:review-plan-adherence |
Plan context found (from plans/, plan.md, or arguments) |
Announce: "Dispatching reviewers: {list}. Each reviewer will cross-validate with Codex via codex MCP tool."
Spawn all applicable reviewers as teammates in a single request. Use Opus for each teammate.
For EACH teammate, provide:
- The reviewer role name (from the dispatch map)
- The full git diff
- The list of files relevant to that reviewer
- The repository root path (from
git rev-parse --show-toplevel)
- Instructions to return JSON in the standard output format
Instructions for each teammate:
You are a {reviewer-role} teammate. Review the following code changes. Return your findings as JSON.
## Repository root
{repo_root}
## Changed files
{file_list}
## Diff
{diff_content}
When calling the codex tool, pass `cwd: "{repo_root}"` and use repo-relative @ file references.
For the plan-adherence reviewer only, also include:
## Plan context
{plan_content}
Where {plan_content} is the plan text discovered in the DIFF phase (the selected approach JSON, markdown plan, or user-provided plan text).
Each teammate will:
- Perform their Claude-based domain review
- Call
codex MCP tool for Codex cross-validation (with cwd set to the repo root)
- Validate the Codex response before merging — empty, non-JSON, or error-text responses mean Codex-unavailable
- Merge findings with classification (AGREE/CHALLENGE/COMPLEMENT) only if Codex returned valid JSON
- Return unified JSON with engine tags
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:
## Review Summary
**Reviewers dispatched:** implementation, test, ui (Opus, dual-engine)
**Files reviewed:** 5
**Findings:** 2 critical, 1 high, 3 medium, 1 low
**Cross-validated:** 2 findings confirmed by both Claude and Codex
### Cross-Validated (flagged by both Claude and Codex)
- [critical] src/auth.ts:42 — SQL injection via string interpolation (AGREE)
- [high] src/api.ts:15 — Uncaught promise rejection (AGREE)
### 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 | Agent | File | Line | Issue | Recommendation | Engines |
|---|---|---|---|---|---|---|
| medium | implementation | src/utils.ts | 23 | Potential null dereference | Add null check | claude |
| medium | implementation | src/utils.ts | 25 | Missing boundary check | Validate input range | codex |
| low | architecture | src/config.ts | 8 | Magic number | Extract to named constant | claude, codex |
### Plan Adherence
**Plan:** plans/feature-slug (Approach 1: "Name")
**Completeness:** 4/5 items implemented
- [x] JWT authentication middleware
- [x] Route protection
- [ ] Token refresh endpoint (**missing**)
**Deviations:** 1 justified (middleware instead of decorator)
**Scope creep:** None
### Stale Documentation
- [high] README.md:42 — `AUTH_SECRET` env var renamed to `JWT_SECRET`
- [medium] docs/api.md:15 — Missing `/auth/refresh` endpoint from API reference
### 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."
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: review-503description: Creates an agent team of parallel dual-engine code reviewers on your git diff, aggregates findings by severity, and fixes critical/high issues. Each reviewer cross-validates with Codex via MCP. Run after implementing a feature or before committing.4---56<objective>7Orchestrate parallel code review using an agent team of specialist reviewers. Each reviewer performs its own Claude analysis and calls `codex` for cross-validation. Read the git diff, determine which reviewers to spawn as teammates based on file types, run them concurrently, aggregate findings, filter low-confidence noise, and act on results.8</objective>910<quick_start>111. Run `/code-review-pipeline` after making code changes122. Reviewers dispatch automatically based on file types133. Each reviewer cross-validates findings with Codex via `codex` MCP tool144. Critical/high findings are fixed inline; medium/low reported as suggestions15</quick_start>1617<when_to_use>18Use when:19- You've implemented a feature and want to catch issues before committing20- Before finalizing a branch or PR21- After a significant refactor22- User asks for a code review2324Don't use when:25- Only config/docs changed (no code to review)26- Single-line trivial fix27</when_to_use>2829<workflow>3031<phase name="DIFF">321. Run `git diff HEAD` to get the full diff (staged + unstaged)332. Run `git diff --name-only HEAD` to get the list of changed files343. Determine the repository root: run `git rev-parse --show-toplevel` to get the absolute path. This is required context for all teammates.354. If no code files changed, report "No code changes to review" and stop365. Classify changed files into categories:3738| File pattern | Categories |39|---|---|40| `.svelte, .tsx, .jsx, .vue, .html, .css` | implementation, test, tech-practices, ui |41| `.ts, .js, .py, .rs, .go` | implementation, test, architecture, tech-practices, docs |42| New files, moved files, changed exports | architecture |43| Changed public API, config, env vars, CLI flags | docs |44455. The `implementation` reviewer is ALWAYS dispatched466. **Check for a plan:** Look for plan context to pass to the plan-adherence reviewer. Repos accumulate multiple plans over time, so disambiguation matters — using the wrong plan produces bogus findings. Check these sources in priority order:47 - **Explicit argument** (highest priority): If the user passed plan context as an argument (e.g., `/code-review-pipeline "plan: ..."` or a plan slug/path), use that directly. Read the file if a path was given.48 - **Branch-matched plan**: List all `plans/*/state.json` with `"phase": "SELECTED"`. If the current git branch name contains a plan slug (e.g., branch `feat/user-auth` matches `plans/user-auth/`), use that plan. This is the most common case — branches are usually named after the feature they implement.49 - **Diff-matched plan**: If no branch match, compare changed file paths against each selected plan's scope (read `approaches.json` to understand what each plan covers). Pick the plan whose scope best overlaps with the changed files.50 - **`plan.md` or `PLAN.md`** in the repo root — use as fallback only if no `plans/` directory exists.51 - If multiple plans match equally or no plan is found, do NOT guess. Skip the plan-adherence reviewer and note "Multiple plans found, pass a plan slug to disambiguate" or "No matching plan found".52 If plan context is found, add `plan-adherence` to the category set and store the plan content to pass to the reviewer.537. Deduplicate categories into a set of reviewers to dispatch54</phase>5556<phase name="DISPATCH">57Create an agent team to run specialist reviewers in parallel. Each reviewer runs as an independent teammate with its own context window. Each reviewer independently calls `codex` for Codex cross-validation.5859**Dispatch map:**6061| Category | Teammate role | Condition |62|---|---|---|63| implementation | `core:review-implementation` | Always |64| test | `core:review-tests` | Source files (not just tests) changed |65| architecture | `core:review-architecture` | New/moved files, or changed exports detected |66| tech-practices | `core:review-tech-practices` | Framework-specific files in diff |67| ui | `core:review-ui` | UI component files in diff |68| docs | `core:review-docs` | Source files changed (not just tests/docs) |69| plan-adherence | `core:review-plan-adherence` | Plan context found (from `plans/`, `plan.md`, or arguments) |7071**Announce:** `"Dispatching reviewers: {list}. Each reviewer will cross-validate with Codex via codex MCP tool."`7273Spawn all applicable reviewers as teammates in a single request. Use Opus for each teammate.7475For EACH teammate, provide:761. The reviewer role name (from the dispatch map)772. The full git diff783. The list of files relevant to that reviewer794. The **repository root path** (from `git rev-parse --show-toplevel`)805. Instructions to return JSON in the standard output format8182**Instructions for each teammate:**8384```85You are a {reviewer-role} teammate. Review the following code changes. Return your findings as JSON.8687## Repository root88{repo_root}8990## Changed files91{file_list}9293## Diff94{diff_content}9596When calling the codex tool, pass `cwd: "{repo_root}"` and use repo-relative @ file references.97```9899**For the plan-adherence reviewer only**, also include:100```101## Plan context102{plan_content}103```104Where `{plan_content}` is the plan text discovered in the DIFF phase (the selected approach JSON, markdown plan, or user-provided plan text).105106Each teammate will:1071. Perform their Claude-based domain review1082. Call `codex` MCP tool for Codex cross-validation (with `cwd` set to the repo root)1093. Validate the Codex response before merging — empty, non-JSON, or error-text responses mean Codex-unavailable1104. Merge findings with classification (AGREE/CHALLENGE/COMPLEMENT) only if Codex returned valid JSON1115. Return unified JSON with engine tags112</phase>113114<phase name="AGGREGATE">1151. Collect JSON responses from all reviewer teammates1162. Parse each response (if malformed, skip with warning)1173. **Filter:** Remove findings with `confidence < 80`1184. **Group by severity** from teammate outputs:119 - **Critical** — Must fix before proceeding120 - **High** — Should fix now121 - **Medium** — Suggestions worth considering122 - **Low** — Minor improvements1235. **Highlight cross-validated findings** — findings with `crossValidated: true` are high-signal (confirmed by both Claude and Codex)1246. **Compile missing tests** list from all teammates1257. **Compile stale docs** from docs reviewer findings — list doc files with staleness issues1268. **Surface plan adherence** — if the plan-adherence reviewer returned `planAdherence`, include completeness score, deviation summary, and scope creep items in the report127</phase>128129<phase name="ACT">130Based on aggregated findings:131132### Critical and High findings133For each critical/high finding:1341. Read the file at the specified line1352. Apply the recommendation to fix the issue1363. Report what was fixed137138### Medium and Low findings139Report as suggestions in a summary table:140141```142## Review Summary143144**Reviewers dispatched:** implementation, test, ui (Opus, dual-engine)145**Files reviewed:** 5146**Findings:** 2 critical, 1 high, 3 medium, 1 low147**Cross-validated:** 2 findings confirmed by both Claude and Codex148149### Cross-Validated (flagged by both Claude and Codex)150- [critical] src/auth.ts:42 — SQL injection via string interpolation (AGREE)151- [high] src/api.ts:15 — Uncaught promise rejection (AGREE)152153### Fixed (Critical/High)154- [critical] src/auth.ts:42 — SQL injection via string interpolation -> switched to parameterized query155- [high] src/api.ts:15 — Uncaught promise rejection -> added try/catch156157### Suggestions (Medium/Low)158| Severity | Agent | File | Line | Issue | Recommendation | Engines |159|---|---|---|---|---|---|---|160| medium | implementation | src/utils.ts | 23 | Potential null dereference | Add null check | claude |161| medium | implementation | src/utils.ts | 25 | Missing boundary check | Validate input range | codex |162| low | architecture | src/config.ts | 8 | Magic number | Extract to named constant | claude, codex |163164### Plan Adherence165**Plan:** plans/feature-slug (Approach 1: "Name")166**Completeness:** 4/5 items implemented167- [x] JWT authentication middleware168- [x] Route protection169- [ ] Token refresh endpoint (**missing**)170**Deviations:** 1 justified (middleware instead of decorator)171**Scope creep:** None172173### Stale Documentation174- [high] README.md:42 — `AUTH_SECRET` env var renamed to `JWT_SECRET`175- [medium] docs/api.md:15 — Missing `/auth/refresh` endpoint from API reference176177### Missing Tests178- Test error path when fetchUser throws in src/auth.ts:42179- Test empty array input in src/utils.ts:23180```181182If no findings above confidence threshold: report "Review complete — no issues found."183</phase>184185</workflow>186187<error_handling>188| Error | Action |189|---|---|190| Teammate returns malformed JSON | Log warning, continue with other teammates |191| Teammate times out | Log warning, continue with other teammates |192| No git diff available | Report "No changes to review" and stop |193| All teammates fail | Report error, suggest running individual reviewer manually |194| `codex` unavailable in teammate | Teammate returns Claude-only findings (`"engines": ["claude"]`), pipeline continues |195| `codex` returns empty or error text | Same as unavailable — teammate returns Claude-only findings, pipeline continues |196</error_handling>197198---199> Converted and distributed by [TomeVault](https://tomevault.io/claim/guyathomas) — claim your Tome and manage your conversions.200<!-- tomevault:4.0:skill_md:2026-04-14 -->