Code Review
Review changed code for security, quality, test coverage, and architecture. Ground every finding in concrete evidence: a file:line reference or tool output.
If a task-tracking facility is available, track these phases as tasks.
Workflow
- Determine review scope.
- Detect languages from changed files.
- Delegate to reviewer agents (one per detected language for a standard review; the thorough set per language for deep coverage).
- Aggregate findings by severity and report.
Track progress through the workflow phases using TaskCreate / TaskUpdate.
If $ARGUMENTS is passed, the keywords below tune the workflow:
deep — use the thorough-review agent set (full dimension coverage per language).
team — run the reviewers as an agent team that challenges each other's findings and converges on consensus.
external — additionally spawn external AI reviewers. Only when explicitly requested; never run by default.
architecture — pass the Architecture vocabulary into every reviewer's prompt.
Without external, run only the language reviewers from this skill. Never spawn external reviewers implicitly.
Determine scope
Ask the user which scope to review, with these options:
- Uncommitted changes
- Branch compared to the default branch
- Specific files (user provides paths)
Resolve to the appropriate git invocation and use it consistently across phases. If the user already named a scope in their request, use it without asking.
Use AskUserQuestion with header "Review scope" and the three options spelled out above.
Detect languages
Scan the changed-file extensions and identify which language reviewers are needed.
Delegate to reviewer agents
For each detected language, delegate to the agent(s) below in parallel if the runtime supports parallel sub-agents. Pass each agent: the scope, the project conventions (read CONTEXT.md/docs/adr/ first), and whether architecture focus is requested.
Spawn each agent via Task(subagent_type="<name>", prompt=...). Each agent's model is set in its own metadata; do not pin a model from the skill.
When team is set, spawn the reviewers as an agent team so they challenge each other's findings; report format prefixes findings with [Flagged by: agent1, agent2].
When external is set, additionally spawn in parallel:
Task(subagent_type="codex-assistant", prompt="review: code from <git_command>") — security, quality, architecture from a second model.
Task(subagent_type="gemini-consultant", prompt="review: architecture of <git_command>") — architecture alternatives and trade-offs.
Standard review — one agent per language
- Go →
go-engineer
- Python →
python-engineer
- TypeScript →
typescript-engineer
- Web (HTML / CSS / JS) →
web-engineer
Thorough review — full dimension coverage per language
- Go:
go-qa, go-idioms, go-tests, go-impl, go-docs, go-simplify
- Python:
py-qa, py-idioms, py-tests, py-impl, py-docs, py-simplify
- TypeScript:
ts-qa, ts-idioms, ts-tests, ts-impl, ts-docs, ts-simplify
- Web:
web-qa, web-idioms, web-tests, web-impl, web-docs, web-simplify
Dimension meanings (same across languages):
*-qa — logic, security, OWASP, race conditions, unchecked errors, resource leaks
*-idioms — patterns, conventions, stdlib usage, error handling
*-tests — coverage, edge cases, mocking discipline
*-impl — requirements match, dependency injection, edge cases
*-docs — comments, docstrings, API docs (ARIA labels for web)
*-simplify — over-abstraction, dead code, pass-throughs
If the runtime cannot spawn subagents, walk the dimensions sequentially as the main agent.
Review rules (passed to every reviewer)
- Cite concrete
file:line evidence or tool output for every finding. No evidence, no finding.
- Findings include severity and a concrete fix.
- For security findings, remind the user: keep private code local; do not paste private diffs into web tools. Use web only for external facts (CVE, library docs); cite separately.
- Read relevant
CONTEXT.md, CONTEXT-MAP.md, and docs/adr/ before naming architecture findings. If a candidate contradicts an ADR, flag only when the friction justifies reopening the decision.
- Ask one clarifying question at a time; do not batch.
Architecture vocabulary
Apply when the user asks for architecture focus. Pass these terms into reviewer prompts so findings use shared vocabulary:
- Module — anything with an interface and an implementation: function, class, package, slice.
- Interface — everything callers must know: types, invariants, ordering, error modes, config, performance.
- Seam — where an interface lives; a place behavior can change without editing in place.
- Adapter — a concrete thing satisfying an interface at a seam.
- Depth — leverage at the interface: lots of behavior behind a small interface.
- Leverage — caller value from depth.
- Locality — change, bugs, and verification concentrated in one place.
Deletion test: if deleting a module makes complexity vanish, it was a pass-through. If complexity reappears across callers, the module was earning its keep.
Seam rule: one adapter means a hypothetical seam; two adapters means a real seam. Do not propose ports without real variation.
Historical context (optional)
If cross-session memory tooling is available, query for prior observations on the files about to be reviewed. Forward relevant findings into reviewer prompts so old issues are not re-litigated. Skip silently if no such tooling is configured.
If mcp__plugin_claude-mem_mcp-search__search is available, query for past findings on the files being reviewed:
search({ query: "<file paths from git diff --name-only HEAD>", limit: 10 })
Fetch full observations via get_observations for relevant hits. Forward key findings into reviewer prompts. Skip silently if the MCP is not installed.
Report format
## Code Review Summary
**Scope**: <description>
**Languages**: <list>
**Reviewers**: <agents that ran>
### CRITICAL (must fix)
- [<agent>] `file:line` — issue. Fix.
### IMPORTANT (should fix)
- [<agent>] `file:line` — issue. Fix.
### SUGGESTIONS
- [<agent>] `file:line` — issue. Fix.
### Architecture opportunities (if requested)
- Candidate: `module`. Problem: shallow / pass-through / fake seam. Deepening move: <how>. Test benefit: <how>.
### Recommended actions
1. <prioritized list>
Writing style
- One sentence per finding. No preamble, no "I noticed that…".
- Cut hedging: "potential", "might", "consider". State what is wrong.
- Direct: "This leaks memory" not "This could potentially lead to memory issues".
- Technical precision: include type names, function signatures, line numbers.
Edge cases
- No changes in scope → "Nothing to review."
- Linters missing → say so explicitly; still review by reading.
- Tests missing → flag as a finding under the
*-tests dimension.
- Runtime has no subagents → main agent performs the review sequentially using the same rubric.
1---2name: reviewing-code3description: Code review covering security, quality, tests, implementation, documentation, and architecture / module-depth. Use when the user asks to review code, check changes, audit a PR or diff, find refactoring opportunities, or look for shallow modules and over-abstraction. NOT for fixing the issues found (use fixing-code) or applying refactors (use refactoring-code).4---5
6# Code Review
7
8Review changed code for security, quality, test coverage, and architecture. Ground every finding in concrete evidence: a `file:line` reference or tool output.
9
10If a task-tracking facility is available, track these phases as tasks.
11
12## Workflow
13
141. Determine review scope.
152. Detect languages from changed files.
163. Delegate to reviewer agents (one per detected language for a standard review; the thorough set per language for deep coverage).
174. Aggregate findings by severity and report.
18
19Track progress through the workflow phases using `TaskCreate` / `TaskUpdate`.
20
21If `$ARGUMENTS` is passed, the keywords below tune the workflow:
22
23- `deep` — use the thorough-review agent set (full dimension coverage per language).
24- `team` — run the reviewers as an agent team that challenges each other's findings and converges on consensus.
25- `external` — additionally spawn external AI reviewers. Only when explicitly requested; never run by default.
26- `architecture` — pass the Architecture vocabulary into every reviewer's prompt.
27
28Without `external`, run only the language reviewers from this skill. Never spawn external reviewers implicitly.
29
30## Determine scope
31
32Ask the user which scope to review, with these options:
33
34- Uncommitted changes
35- Branch compared to the default branch
36- Specific files (user provides paths)
37
38Resolve to the appropriate git invocation and use it consistently across phases. If the user already named a scope in their request, use it without asking.
39
40Use `AskUserQuestion` with header "Review scope" and the three options spelled out above.
41
42## Detect languages
43
44Scan the changed-file extensions and identify which language reviewers are needed.
45
46## Delegate to reviewer agents
47
48For each detected language, delegate to the agent(s) below in parallel if the runtime supports parallel sub-agents. Pass each agent: the scope, the project conventions (read `CONTEXT.md`/`docs/adr/` first), and whether architecture focus is requested.
49
50Spawn each agent via `Task(subagent_type="<name>", prompt=...)`. Each agent's model is set in its own metadata; do not pin a model from the skill.
51
52When `team` is set, spawn the reviewers as an agent team so they challenge each other's findings; report format prefixes findings with `[Flagged by: agent1, agent2]`.
53
54When `external` is set, additionally spawn in parallel:
55
56- `Task(subagent_type="codex-assistant", prompt="review: code from <git_command>")` — security, quality, architecture from a second model.
57- `Task(subagent_type="gemini-consultant", prompt="review: architecture of <git_command>")` — architecture alternatives and trade-offs.
58
59### Standard review — one agent per language
60
61- Go → `go-engineer`
62- Python → `python-engineer`
63- TypeScript → `typescript-engineer`
64- Web (HTML / CSS / JS) → `web-engineer`
65
66### Thorough review — full dimension coverage per language
67
68- Go: `go-qa`, `go-idioms`, `go-tests`, `go-impl`, `go-docs`, `go-simplify`
69- Python: `py-qa`, `py-idioms`, `py-tests`, `py-impl`, `py-docs`, `py-simplify`
70- TypeScript: `ts-qa`, `ts-idioms`, `ts-tests`, `ts-impl`, `ts-docs`, `ts-simplify`
71- Web: `web-qa`, `web-idioms`, `web-tests`, `web-impl`, `web-docs`, `web-simplify`
72
73Dimension meanings (same across languages):
74
75- `*-qa` — logic, security, OWASP, race conditions, unchecked errors, resource leaks
76- `*-idioms` — patterns, conventions, stdlib usage, error handling
77- `*-tests` — coverage, edge cases, mocking discipline
78- `*-impl` — requirements match, dependency injection, edge cases
79- `*-docs` — comments, docstrings, API docs (ARIA labels for web)
80- `*-simplify` — over-abstraction, dead code, pass-throughs
81
82If the runtime cannot spawn subagents, walk the dimensions sequentially as the main agent.
83
84## Review rules (passed to every reviewer)
85
86- Cite concrete `file:line` evidence or tool output for every finding. No evidence, no finding.
87- Findings include severity and a concrete fix.
88- For security findings, remind the user: keep private code local; do not paste private diffs into web tools. Use web only for external facts (CVE, library docs); cite separately.
89- Read relevant `CONTEXT.md`, `CONTEXT-MAP.md`, and `docs/adr/` before naming architecture findings. If a candidate contradicts an ADR, flag only when the friction justifies reopening the decision.
90- Ask one clarifying question at a time; do not batch.
91
92## Architecture vocabulary
93
94Apply when the user asks for architecture focus. Pass these terms into reviewer prompts so findings use shared vocabulary:
95
96- **Module** — anything with an interface and an implementation: function, class, package, slice.
97- **Interface** — everything callers must know: types, invariants, ordering, error modes, config, performance.
98- **Seam** — where an interface lives; a place behavior can change without editing in place.
99- **Adapter** — a concrete thing satisfying an interface at a seam.
100- **Depth** — leverage at the interface: lots of behavior behind a small interface.
101- **Leverage** — caller value from depth.
102- **Locality** — change, bugs, and verification concentrated in one place.
103
104Deletion test: if deleting a module makes complexity vanish, it was a pass-through. If complexity reappears across callers, the module was earning its keep.
105
106Seam rule: one adapter means a hypothetical seam; two adapters means a real seam. Do not propose ports without real variation.
107
108## Historical context (optional)
109
110If cross-session memory tooling is available, query for prior observations on the files about to be reviewed. Forward relevant findings into reviewer prompts so old issues are not re-litigated. Skip silently if no such tooling is configured.
111
112If `mcp__plugin_claude-mem_mcp-search__search` is available, query for past findings on the files being reviewed:
113
114```text
115search({ query: "<file paths from git diff --name-only HEAD>", limit: 10 })
116```
117
118Fetch full observations via `get_observations` for relevant hits. Forward key findings into reviewer prompts. Skip silently if the MCP is not installed.
119## Report format
120
121```markdown
122## Code Review Summary
123
124**Scope**: <description>
125**Languages**: <list>
126**Reviewers**: <agents that ran>
127
128### CRITICAL (must fix)
129
130- [<agent>] `file:line` — issue. Fix.
131
132### IMPORTANT (should fix)
133
134- [<agent>] `file:line` — issue. Fix.
135
136### SUGGESTIONS
137
138- [<agent>] `file:line` — issue. Fix.
139
140### Architecture opportunities (if requested)
141
142- Candidate: `module`. Problem: shallow / pass-through / fake seam. Deepening move: <how>. Test benefit: <how>.
143
144### Recommended actions
145
1461. <prioritized list>
147```
148
149## Writing style
150
151- One sentence per finding. No preamble, no "I noticed that…".
152- Cut hedging: "potential", "might", "consider". State what is wrong.
153- Direct: "This leaks memory" not "This could potentially lead to memory issues".
154- Technical precision: include type names, function signatures, line numbers.
155
156## Edge cases
157
158- No changes in scope → "Nothing to review."
159- Linters missing → say so explicitly; still review by reading.
160- Tests missing → flag as a finding under the `*-tests` dimension.
161- Runtime has no subagents → main agent performs the review sequentially using the same rubric.