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