code-review
Review a diff or a plan's implementation for correctness, quality and plan adherence, bucketing findings by severity into specs/NNN-<slug>/review.md. Trigger on:- review this, check my code, does this
SKILL.mdskills/code-review/SKILL.md
GitHubCode Review
Reviews on two axes together: does it do what the plan said, and is it good code (bugs, security, tests, style). Findings are bucketed by severity, not dumped as a flat list. This skill reports and re-verifies only — it never fixes anything and never creates mcp-erp tasks.
When to use this
- Before landing or merging, or to check an implementation against its plan doc.
- Before
/implementstarts, to check a plan's premises against the code on disk (plan-review). - Not for architecture questions with no diff in hand — that's
/improve. - To fix what this finds, run
/resolve-review. To apply routine quality cleanups directly without a report, use/simplify.
Assumptions (flag if any are wrong)
projectresolves to a path on disk. Accept a path directly, or a name — if a name, look under the common project roots and ask once rather than guessing.- Plans live at
specs/NNN-<slug>/plan.md(the output of/designit→/plan-doc). If that path doesn't exist, search the project before asking.
Read .specify/memory/constitution.md first — it holds the pipeline map and the review
status vocabulary (open → worked-on → closed).
Arguments
project— path or name of the project to review.scope— if omitted, ask. Don't default silently between "everything", "one plan" and "re-check fixes".full— the whole codebase, cross-checked against everyspecs/*/plan.md.plan <name...>— only the code the named plan(s) describe.plan-review <name...>— the named plan(s) before execution starts. Reviews the plan itself, not code written from it.running-review [report]— re-check fixes against an existing report. Ifreportis omitted, take the most recent one withStatus: worked-on; if none exists, say so and stop rather than guessing which report or scope was meant.
Status lifecycle
A review thread lives in one file for its whole life (specs/NNN-<slug>/review.md),
reused across rounds rather than recreated. The status: header drives the handoff with
resolve-review; the vocabulary and who-writes-what is in the constitution. In short:
this skill writes open and (terminal) closed; resolve-review writes worked-on;
closed forwards to finalize.
Steps
Resolve the project. Confirm it's a git repo (
git rev-parse --is-inside-work-tree). If not, say diff-based scoping is unavailable and review files directly.Load context for the scope.
full—Globeveryspecs/*/plan.md, read each, then survey the codebase (structure viaGlob/Grep, key files viaRead).plan <name...>— read the plan doc(s) in full first: decisions, architecture, locked-in details. Then find the code, preferringgit log/git diffagainst the base branch; fall back toGrep/Globfor the files the plan names.plan-review— read the plan doc(s) in full, then read the code each premise is about. Load what the plan claims exists, not what it says about it.running-review— read the existing report in full, includingresolve-review's## Resolutionsection. Re-check each item marked Fixed against the current code rather than trusting the note, and re-examine anything Skipped or Deferred to confirm that's still the right call.
For
plan-review, verify each premise against the code on disk — never against the plan's own account of it. A plan that describes a function, a signature, a config key or a call site is making a claim; open that file and check it. Flag, in order: (a) premises the repository contradicts, (b) steps whose sequencing can't work — a step consuming what a later step creates, (c) steps with no acceptance check, (d) work the plan doesn't cover that its own goal requires. Then skip to step 4.Catching a wrong premise here costs one review; catching it during
/implementcosts every step already built on it.Review both axes together, per file for
full/plan, per finding forrunning-review:- Plan adherence (only with a plan doc in hand) — flag both deviations and plan gaps. Don't assume a deviation is wrong or that it's fine; let severity reflect your confidence.
- Quality — correctness, security (injection, secrets, auth gaps, unsafe deserialization), test coverage for the changed logic, and consistency with the codebase's conventions, not your own preferences.
Bucket every finding. Blocking (bugs, security, plan deviations that must be fixed before landing) / Should-fix (real but not launch-blocking) / Nit (style, naming, preference). Don't inflate severity to look thorough, and don't bury real issues under nits.
Write or update the report at
specs/NNN-<slug>/review.md(from.specify/templates/review-template.md) — created once per thread;running-reviewedits it in place.status:+updated:header, scope at the top, then a summary of counts by severity.- Findings grouped by severity, each with file:line, what's wrong, why it matters, and a suggested fix.
running-reviewappends a## Re-review — <date>section listing which prior findings are confirmed resolved and which remain — it doesn't rewrite history.- Set
status: closedif no Blocking or Should-fix remain and forward to/finalize; otherwiseopen. plan-reviewroutes backward, not forward: it's a constitution kickback to/plan-doc, never a/resolve-reviewqueue and never a forward to/finalize. On any Blocking finding, stop and take it to the user before execution begins — a plan wrong at launch is cheaper to fix now than after. Should-fix and Nit are recorded and named in the summary; the human decides whether to proceed.- Give a concise inline summary in chat too: the counts, then the Blocking items in full. Don't just say "see the report."
What not to do
- Don't fix anything, and don't create mcp-erp tasks from findings.
plan-review: don't amend the plan file. Editing it and reverting its status is/plan-doc's job under the kickback rule — this skill reports the findings.plan-reviewon a plan already implemented is the wrong scope: useplan <name>.- Don't write
worked-on— that status belongs toresolve-review. - No plan doc found for scope
plan <name>: say so and stop; don't guess at what the plan said. (Forfullwith no plans anywhere, proceed as a pure quality review and say so.) - Nothing changed since the plan started: say so plainly rather than manufacturing findings.