Code Review
Review only the requested change scope. Anchor every finding to that change. Prefer behavior-preserving simplification: smaller, clearer, more direct code over cleverness or incidental complexity.
When to use
- Review a pull request before merge
- Review a branch, work-in-progress changes, staged or unstaged changes, recent commits, or AI-generated code
- Review since a fixed point such as a commit, branch, tag,
main, or HEAD~N
- Compare changes against repo standards or a spec / issue / PRD
- Request a thermo-nuclear / thermonuclear / deep code quality / especially harsh maintainability review
- Produce machine-readable findings for another model or script
Scope
Review for:
- correctness
- readability
- architecture
- security
- performance
- standards adherence
- spec adherence, if a spec exists
- maintainability
Report only issues introduced by, exposed by, or clearly reachable through the reviewed change.
Required-agent rule
If this skill requires a dedicated agent, run it. Do not merge, combine, substitute, skip, or manually emulate required agents.
Process
- Invoke
subagent-model-router and addy-code-review-and-quality.
- Make a todo list.
- Set the review target only; do not read PR or issue content directly in this step.
- PR review: target the PR.
- Fixed-point review: use exactly the user-provided target.
- If the user says "review since X" but X is not a fixed point, ask:
Review against what — a branch, a commit, or main? Stop until answered.
- Main-agent GitHub intake rule:
- The main agent must not read PR or GitHub issue content directly.
- All GitHub PR/issue intake must be done by a fast-tier subagent using
gh, not web fetch.
- The main agent may use only the subagent summary unless a later required agent needs more detail.
- Capture inputs via fast-tier subagents:
- Fixed-point reviews:
git diff <fixed-point>...HEAD
git log <fixed-point>..HEAD --oneline
- PR reviews: fetch and summarize:
- PR status and early-stop recommendation: open / closed / draft / review not needed / already reviewed by you
- title, body summary, branch info, changed files, linked issues, referenced specs, notable metadata
- compact summary of linked or referenced GitHub issues relevant to scope or spec
- likely spec-source candidates in priority order
- If not reviewing a PR but GitHub issues are referenced, fetch and summarize them.
- Stop early if intake says a PR is closed, draft, does not need review, or already has a review from you.
- Gather only relevant standards/context files via a fast-tier subagent, checking repo root and touched paths as applicable:
AGENTS.md, CLAUDE.md, GEMINI.md, CONTRIBUTING.md, CONTEXT.md, CONTEXT-MAP.md, STYLE.md, STANDARDS.md, STYLEGUIDE.md, docs/adr/*, .editorconfig, eslint.config.*, biome.json, prettier.config.*, tsconfig.json
- Identify the spec source in this order:
- issue references from commit messages or PR metadata
- user-supplied path
- matching spec / PRD under
docs/, specs/, .scratch/, or .agents/scratchpad/**
- if none is found, ask where the spec is; if there is no spec, record
no spec available and skip the Spec agent
- Preflight required agents. Hard stop if any required agent is missing.
- Always required:
addy-code-reviewer
addy-security-auditor
addy-test-engineer
- Maintainability agent
- Standards agent
- Required only if a spec exists:
- Required only for PR reviews:
- History agent
- Related-PR agent
- Code-comment agent
- Spawn required agents in parallel.
- PR-only:
- History agent: use
git blame and modified-code history to identify historically supported issues.
- Related-PR agent: review prior PRs touching the same files for comments that still apply.
- Code-comment agent: check whether the change violates guidance in comments within modified files.
- All reviews:
addy-code-reviewer: correctness, readability, architecture, security, performance
addy-security-auditor: OWASP Top 10, secrets, auth/authz, threat model, dependency CVEs
addy-test-engineer: test gaps in happy path, edge cases, error paths, concurrency
- Spec agent if a spec exists: missing or partial requirements, scope creep, incorrect implementation
- Maintainability agent: do a strict maintainability review. Prefer deleting complexity over rearranging it. Aggressively flag:
- file growth from under 1000 lines to over 1000 without strong justification
- new ad-hoc conditionals, spaghetti growth, one-off booleans, nullable modes, or flags that complicate control flow
- unnecessary wrappers, casts, optionality, indirection,
any, unknown, ad-hoc object shapes, or cast-heavy contracts that obscure invariants
- hacky or magical behavior, generic mechanisms hiding simple data-shape assumptions
- logic in the wrong layer, duplication of canonical helpers, copy-pasted logic instead of extracted helpers
- narrow edge-case handling inserted into an already busy function
- sequential orchestration or non-atomic updates when a cleaner structure is obvious
- Treat unjustified file-size explosions, spaghetti growth, unnecessary abstraction layers, wrong-layer logic, and obvious duplication of canonical helpers as presumptive blockers unless clearly justified. Prefer a small number of high-conviction structural findings over cosmetic notes.
- Standards agent: report only documented standards violations; cite file and rule; skip anything tooling enforces.
- Filter false positives.
- For each issue, spawn a parallel fast-tier subagent to score whether it is real or a false positive using the issue, reviewed change, and relevant standards files.
- Use this rubric verbatim:
- 0: Not confident at all. This is a false positive that doesn't stand up to light scrutiny.
- 25: Somewhat confident. This might be a real issue, but may also be a false positive. The agent wasn't able to verify that it's a real issue. If the issue is stylistic, it is one that was not explicitly called out in the relevant standards file.
- 50: Moderately confident. The agent verified this is real, but it may be minor or uncommon.
- 75: Highly confident. The agent verified it is very likely real and important, will be hit in practice, or is directly mentioned in the relevant standards file.
- 100: Absolutely certain. The agent confirmed it is definitely real and will happen frequently in practice; the evidence directly confirms this.
- For standards findings, confirm the standards file explicitly supports the finding.
- Filter out issues with score below 75.
Exclusions
- Do not report speculative bugs that do not survive light scrutiny.
- Do not report pedantic nitpicks.
- Do not report issues tooling should catch.
- Do not make generic requests for more tests, docs, or security review unless explicitly required by a standards file or clearly broken in the change.
- Do not report likely intentional functional changes tied to the broader change.
- Do not report issues on unchanged lines unless the change clearly exposes or activates them.
- Do not run builds, typechecks, linters, or benchmarks unless the user explicitly asks.
Primary review questions
- Is there a code-judo move that would make this dramatically simpler?
- Did the diff add branching complexity where a better abstraction should exist?
- Is this logic in the right file and layer?
- Is this abstraction earning its keep, or is it just a wrapper?
- Did the diff introduce casts, optionality, or ad-hoc object shapes that obscure the real invariant?
Output modes
A. PR comment mode
If reviewing a PR, repeat the PR eligibility check before commenting. If still eligible, post with gh pr comment.
If qualifying findings remain, use this format exactly:
### Code review
Found <N> issues:
1. <brief description>
<link to file and line with full sha and line range>
2. <brief description>
<link to file and line with full sha and line range>
3. <brief description>
<link to file and line with full sha and line range>
<sub>- If this code review was useful, please react with 👍. Otherwise, react with 👎.</sub>
...
If no qualifying findings remain, use:
### Code review
## No issues found. Checked for bugs, standards compliance, and maintainability.
PR comment requirements:
- keep it brief
- no emojis except the required footer line
- cite and link relevant files, code, standards, and URLs
- for code links, use full Git SHA and line ranges
- provide at least 1 line of context before and after when possible
Link format must be exactly:
https://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.ext#L10-L15
Requirements:
- full git sha only
- repository name must match the reviewed repo
- line format
#L[start]-L[end]
B. Machine-readable mode
Categorize findings as Critical, Important, or Suggestion. Output a structured review with specific file:line references and fix recommendations.
Review priorities
- correctness bugs
- documented repo standards violations
- spec mismatches
- structural maintainability regressions
- missed opportunities for dramatic simplification when a clear path is visible
- architecture boundary problems
- security and performance issues supported by the change
- readability issues that materially affect comprehension
Tone
Be direct, serious, and brief. Do not be rude. Do not soften major maintainability or correctness problems into mild suggestions. Do not treat a change as no-issue merely because behavior seems correct if it clearly makes the codebase structurally worse.
Final checks
Before returning or commenting, verify:
Source: japurcell/skills — distributed by TomeVault.
1---2name: code-review-633description: Review a pull request, branch, recent commits, staged or unstaged changes, or AI-generated code for correctness, readability, architecture, security, performance, standards/spec adherence, and maintainability. Use when reviewing a PR before merge, reviewing changes since a fixed point, reviewing work-in-progress changes, reviewing another agent's code, asking to "review since X", requesting a thermo-nuclear / thermonuclear / deep code quality / especially harsh maintainability review, or when machine-readable output is needed. Use when this capability is needed.4---56# Code Review78Review only the requested change scope. Anchor every finding to that change. Prefer behavior-preserving simplification: smaller, clearer, more direct code over cleverness or incidental complexity.910## When to use1112- Review a pull request before merge13- Review a branch, work-in-progress changes, staged or unstaged changes, recent commits, or AI-generated code14- Review since a fixed point such as a commit, branch, tag, `main`, or `HEAD~N`15- Compare changes against repo standards or a spec / issue / PRD16- Request a thermo-nuclear / thermonuclear / deep code quality / especially harsh maintainability review17- Produce machine-readable findings for another model or script1819## Scope2021Review for:2223- correctness24- readability25- architecture26- security27- performance28- standards adherence29- spec adherence, if a spec exists30- maintainability3132Report only issues introduced by, exposed by, or clearly reachable through the reviewed change.3334## Required-agent rule3536If this skill requires a dedicated agent, run it. Do not merge, combine, substitute, skip, or manually emulate required agents.3738## Process39401. Invoke `subagent-model-router` and `addy-code-review-and-quality`.412. Make a todo list.423. Set the review target only; do not read PR or issue content directly in this step.43 - PR review: target the PR.44 - Fixed-point review: use exactly the user-provided target.45 - If the user says "review since X" but X is not a fixed point, ask: `Review against what — a branch, a commit, or main?` Stop until answered.464. Main-agent GitHub intake rule:47 - The main agent must not read PR or GitHub issue content directly.48 - All GitHub PR/issue intake must be done by a fast-tier subagent using `gh`, not web fetch.49 - The main agent may use only the subagent summary unless a later required agent needs more detail.505. Capture inputs via fast-tier subagents:51 - Fixed-point reviews:52 - `git diff <fixed-point>...HEAD`53 - `git log <fixed-point>..HEAD --oneline`54 - PR reviews: fetch and summarize:55 - PR status and early-stop recommendation: open / closed / draft / review not needed / already reviewed by you56 - title, body summary, branch info, changed files, linked issues, referenced specs, notable metadata57 - compact summary of linked or referenced GitHub issues relevant to scope or spec58 - likely spec-source candidates in priority order59 - If not reviewing a PR but GitHub issues are referenced, fetch and summarize them.606. Stop early if intake says a PR is closed, draft, does not need review, or already has a review from you.617. Gather only relevant standards/context files via a fast-tier subagent, checking repo root and touched paths as applicable:62 - `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `CONTRIBUTING.md`, `CONTEXT.md`, `CONTEXT-MAP.md`, `STYLE.md`, `STANDARDS.md`, `STYLEGUIDE.md`, `docs/adr/*`, `.editorconfig`, `eslint.config.*`, `biome.json`, `prettier.config.*`, `tsconfig.json`638. Identify the spec source in this order:64 1. issue references from commit messages or PR metadata65 2. user-supplied path66 3. matching spec / PRD under `docs/`, `specs/`, `.scratch/`, or `.agents/scratchpad/**`67 4. if none is found, ask where the spec is; if there is no spec, record `no spec available` and skip the Spec agent689. Preflight required agents. Hard stop if any required agent is missing.69 - Always required:70 - `addy-code-reviewer`71 - `addy-security-auditor`72 - `addy-test-engineer`73 - Maintainability agent74 - Standards agent75 - Required only if a spec exists:76 - Spec agent77 - Required only for PR reviews:78 - History agent79 - Related-PR agent80 - Code-comment agent8110. Spawn required agents in parallel.8283- PR-only:84 - History agent: use `git blame` and modified-code history to identify historically supported issues.85 - Related-PR agent: review prior PRs touching the same files for comments that still apply.86 - Code-comment agent: check whether the change violates guidance in comments within modified files.87- All reviews:88 - `addy-code-reviewer`: correctness, readability, architecture, security, performance89 - `addy-security-auditor`: OWASP Top 10, secrets, auth/authz, threat model, dependency CVEs90 - `addy-test-engineer`: test gaps in happy path, edge cases, error paths, concurrency91 - Spec agent if a spec exists: missing or partial requirements, scope creep, incorrect implementation92 - Maintainability agent: do a strict maintainability review. Prefer deleting complexity over rearranging it. Aggressively flag:93 - file growth from under 1000 lines to over 1000 without strong justification94 - new ad-hoc conditionals, spaghetti growth, one-off booleans, nullable modes, or flags that complicate control flow95 - unnecessary wrappers, casts, optionality, indirection, `any`, `unknown`, ad-hoc object shapes, or cast-heavy contracts that obscure invariants96 - hacky or magical behavior, generic mechanisms hiding simple data-shape assumptions97 - logic in the wrong layer, duplication of canonical helpers, copy-pasted logic instead of extracted helpers98 - narrow edge-case handling inserted into an already busy function99 - sequential orchestration or non-atomic updates when a cleaner structure is obvious100 - Treat unjustified file-size explosions, spaghetti growth, unnecessary abstraction layers, wrong-layer logic, and obvious duplication of canonical helpers as presumptive blockers unless clearly justified. Prefer a small number of high-conviction structural findings over cosmetic notes.101 - Standards agent: report only documented standards violations; cite file and rule; skip anything tooling enforces.10210311. Filter false positives.104105- For each issue, spawn a parallel fast-tier subagent to score whether it is real or a false positive using the issue, reviewed change, and relevant standards files.106- Use this rubric verbatim:107 - 0: Not confident at all. This is a false positive that doesn't stand up to light scrutiny.108 - 25: Somewhat confident. This might be a real issue, but may also be a false positive. The agent wasn't able to verify that it's a real issue. If the issue is stylistic, it is one that was not explicitly called out in the relevant standards file.109 - 50: Moderately confident. The agent verified this is real, but it may be minor or uncommon.110 - 75: Highly confident. The agent verified it is very likely real and important, will be hit in practice, or is directly mentioned in the relevant standards file.111 - 100: Absolutely certain. The agent confirmed it is definitely real and will happen frequently in practice; the evidence directly confirms this.112- For standards findings, confirm the standards file explicitly supports the finding.113- Filter out issues with score below 75.114115## Exclusions116117- Do not report speculative bugs that do not survive light scrutiny.118- Do not report pedantic nitpicks.119- Do not report issues tooling should catch.120- Do not make generic requests for more tests, docs, or security review unless explicitly required by a standards file or clearly broken in the change.121- Do not report likely intentional functional changes tied to the broader change.122- Do not report issues on unchanged lines unless the change clearly exposes or activates them.123- Do not run builds, typechecks, linters, or benchmarks unless the user explicitly asks.124125## Primary review questions126127- Is there a code-judo move that would make this dramatically simpler?128- Did the diff add branching complexity where a better abstraction should exist?129- Is this logic in the right file and layer?130- Is this abstraction earning its keep, or is it just a wrapper?131- Did the diff introduce casts, optionality, or ad-hoc object shapes that obscure the real invariant?132133## Output modes134135### A. PR comment mode136137If reviewing a PR, repeat the PR eligibility check before commenting. If still eligible, post with `gh pr comment`.138139If qualifying findings remain, use this format exactly:140141```text142### Code review143Found <N> issues:1441. <brief description>145 <link to file and line with full sha and line range>1462. <brief description>147 <link to file and line with full sha and line range>1483. <brief description>149 <link to file and line with full sha and line range>150 <sub>- If this code review was useful, please react with 👍. Otherwise, react with 👎.</sub>151...152```153154If no qualifying findings remain, use:155156```text157### Code review158## No issues found. Checked for bugs, standards compliance, and maintainability.159```160161PR comment requirements:162163- keep it brief164- no emojis except the required footer line165- cite and link relevant files, code, standards, and URLs166- for code links, use full Git SHA and line ranges167- provide at least 1 line of context before and after when possible168169Link format must be exactly:170`https://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.ext#L10-L15`171172Requirements:173174- full git sha only175- repository name must match the reviewed repo176- line format `#L[start]-L[end]`177178### B. Machine-readable mode179180Categorize findings as Critical, Important, or Suggestion. Output a structured review with specific file:line references and fix recommendations.181182## Review priorities1831841. correctness bugs1852. documented repo standards violations1863. spec mismatches1874. structural maintainability regressions1885. missed opportunities for dramatic simplification when a clear path is visible1896. architecture boundary problems1907. security and performance issues supported by the change1918. readability issues that materially affect comprehension192193## Tone194195Be direct, serious, and brief. Do not be rude. Do not soften major maintainability or correctness problems into mild suggestions. Do not treat a change as no-issue merely because behavior seems correct if it clearly makes the codebase structurally worse.196197## Final checks198199Before returning or commenting, verify:200201- [ ] every required dedicated agent for this review type was run202- [ ] no required agent was merged, combined, substituted, skipped, or manually emulated203- [ ] every finding is tied to the reviewed change204- [ ] every finding has a concrete file reference205- [ ] every standards-based finding is explicitly supported by a standards file206- [ ] no excluded false positives are included207- [ ] if a plausible restructuring would delete substantial incidental complexity, call it out208- [ ] if a major maintainability problem is present, do not hide it behind minor wording209- [ ] output matches the requested mode exactly210211---212> Source: [japurcell/skills](https://github.com/japurcell/skills) — distributed by [TomeVault](https://tomevault.io).213<!-- tomevault:4.0:skill_md:2026-06-16 -->