/claude-dev-kit:review [ISSUE-number]from claude-dev-kit
Performs senior-level PR review with correctness, security, design, accessibility, and tech-debt checks. Delegates to runtime code-review and security-review skills or falls back to a degraded agent.
Ships in claude-dev-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Kit root: ${CLAUDE_PLUGIN_ROOT}
scripts/ dir): prefix every kit script command with it, e.g.
bash <kit-root>/scripts/checkpoint.sh …. Absolute paths also work from worktrees.${…} placeholder above → standalone layout: run commands as written.Run these checks silently at the start. Use results to adapt behavior:
[ -f issues.md ] — if true, this project uses the sprint system. Respect issue numbering and STATUS.md.[ -f docs/sprint_state.md ] — if true and Status shows running, a sprint is active. Be aware of parallel work in worktrees.[ -f docs/prd_digest.md ] — if true, read it for quick project context before starting.gh auth status before any GitHub operation.Every phase has a checkpoint. Run the verification command and check the exit code.
ADVISORY: line (advisory gate): report the gap, self-correct, continue.
Standard prefix:bash scripts/checkpoint.sh
Append --skill <name> --phase <phase> --issue <ID> for the specific check.
checkpoint.sh resolves the main repo root internally, so the command stays
a single prefix-matchable form (safe to allowlist as Bash(bash scripts/checkpoint.sh *)).
Pipeline skills operate in git worktrees to isolate changes from main.
WT="$(bash scripts/wt_setup.sh <branch>)" — creates the
worktree via scripts/worktree.sh create and writes .claude-kit/freeze-dir.txt
inside it in a single step.bash scripts/worktree.sh rootbash scripts/wt_cleanup.sh <branch> — cd's to main root
inside a subshell, then removes the worktree (never leaves CWD dangling).
All file operations happen inside $WT/. Shared files live on main only.Shared files (issues.md, STATUS.md, CHANGELOG.md) are managed on main only.
Always use registry_edit.sh for concurrent-safe writes — it resolves the
main repo root internally and delegates to flock_edit.sh:
bash scripts/registry_edit.sh issues.md -- bash -c '<update command>'
Never commit these files to feature branches. Steps:
gh pr status.BRANCH="$(gh pr view <pr_number> --json headRefName -q .headRefName)"
WT="$(bash scripts/wt_setup.sh "$BRANCH")"
wt_setup.sh creates the worktree and writes the freeze marker inside
.claude-kit/freeze-dir.txt atomically. All subsequent file operations
happen inside $WT/.CHECKPOINT — ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill review --phase checkout --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line — report the gap, self-correct, then continue.
docs/review_lessons.md is retired, ISSUE-033).docs/architecture.md — if exists (for conformance checks)docs/design_system.md (or design_system_mobile.md), docs/copy_guide.md, docs/interactions.md (or interactions_mobile.md), docs/wireframes.md (or wireframes_mobile.md).3.1) Review execution-context decision (per SPEC-019 platform-first delegation; SPEC-066 decides the context ONCE):
First determine ONCE whether a runtime skill-invocation tool is in your CURRENT tool list. The token to look for first is Skill — its listing should name code-review / security-review. A SlashCommand tool counts too if your context has one: it was absent from every probed Task sub-agent context on CC 2.1.224 (not loaded and not even deferred), but the main-session path was never probed, so do not rule it out interactively (ISSUE-072; see the sub-agent skill-invocation row in docs/cc_feature_matrix.md). Inside a Task sub-task you have such a tool only if the dispatching agent's tools: grants one — and on this runtime a grant does not imply provisioning, so answer from your own observed tool list and nothing else. Report what you actually observe as present or absent (validated data, not a directive — both misreport directions still end in a review that runs). Then run the decision script EXACTLY ONCE for both dimensions:
python3 scripts/review_context.py decide --invocation-tools <present|absent> --issue $ARGUMENTS
The JSON output carries one decision per dimension (code → runtime /code-review, security → runtime /security-review). Follow it per dimension:
"path": "degraded" → invoke the reviewer agent (--dimension code / --dimension security) with NO inline runtime-skill attempt and NO retry — decide already recorded the decision with its reason (capability-absent or context-unreachable).
"path": "delegated" → bind the subject first, then invoke the runtime skill, then accept the verdict only through the echo gate. A delegated reviewer that collects its own subject reviews the wrong thing: that happened on five PRs across four sprints, and uncorrected each would have returned a clean bill on something other than the PR (ISSUE-096; the dated measurements are the review-target row of docs/cc_feature_matrix.md). Note which check catches the worst shape: the wrong subject was not empty, so a byte count greater than zero passes it — only the sha256 comparison rejects it.
First make sure the run has an id, because the echo gate's verification is written to the run file and step 5.3 reads it back (the kit has no other producer for KIT_RUN_ID; use the same literal value in every command of this review):
mkdir -p "$WT/.claude/runs"
(a) Collect the subject — run this command once, before any runtime invocation:
SUBJ="$(python3 scripts/review_context.py collect --pr <pr_number> --issue $ARGUMENTS)"
Exit 0 prints one JSON object: range (<base-oid>...<head-oid>), worktree_path, diff_command, diff_bytes, diff_headers, diff_sha256, head_oid, base_ref. A non-zero exit is a REFUSAL: stdout is empty and stderr names reason= and its remedy. Do NOT invoke the runtime skill on a refusal — report the reason and treat the dimension as unreviewed. Exit 1 with an empty-diff-* reason means the subject was computed and is genuinely empty (a no-op PR, or a change and its revert); any other reason, at exit 2, means the subject could not be computed — that is NOT an empty diff, so fix the named cause and re-run.
The collection is re-run inside delegate and record-subject too — four git collections per review run, each re-establishing the subject rather than trusting an artifact that was measured not to survive the hand-off.
(b) Hand the subject over explicitly. Put range, worktree_path, diff_bytes and diff_sha256 verbatim into the runtime skill's prompt, tell it to run the payload's diff_command exactly as printed (it already carries -C <worktree_path>, --no-ext-diff and --no-textconv; a differently-flagged diff produces a different digest and an honest review would be rejected), and require it to echo back the byte count and sha256 it measured before stating its verdict. Do not let it auto-collect its own subject, and do not hand it a file path as the only carrier — a materialised diff file was measured "not present" from the code reviewer's own context on PR #145, and only the byte-count echo caught it. Do not fabricate an echo, and do not copy the digest from (a) on the reviewer's behalf: a pasted digest is the one remaining way past this gate, and using it means recording a verdict on a diff nobody read.
Measured constraint (2026-10-31, ISSUE-096 / PR #147 review) — the runtime
/security-reviewaccepts no review target. Its harness discarded the pinned subject arguments (they appeared nowhere in the prompt it produced) and auto-collected instead: from the main checkout it arrived withGIT STATUS: On branch mainand 48.5KB of the wrong subject; from the worktree it collects nothing at all ((Bash completed with no output)). Neither CWD works, so step (b) cannot be executed for the security dimension on this runtime. Its echo can never match,delegatewill refuse withreason=echo-mismatch, and the security dimension therefore degrades to therevieweragent through theinline-attempt-failedtoken below — report it as degraded, do not fabricate an echo to get past it. The code dimension is unmeasured in this shape and is attempted normally. Recorded as a dated row indocs/cc_feature_matrix.md; re-probe it when the runtime changes.
(c) Record the delegation through the echo gate (it re-collects and compares; it emits review_delegated_to_code_review / review_delegated_to_security_review only on a match, and that event is the receipt step 5.3 consumes):
KIT_RUN_ID=review-$ARGUMENTS python3 scripts/review_context.py delegate --dimension <code|security> --pr <pr_number> --issue $ARGUMENTS \
--head-oid <the head_oid from (a)> \
--echoed-bytes <the number the reviewer reported> --echoed-sha256 <the sha256 the reviewer reported>
A non-zero exit means the verdict is not usable:
reason=echo-mismatch — the reviewer's verdict is about something other than this PR: discard the verdict and do not use its findings.reason=head-moved — the branch advanced while the reviewer was reading. The verdict is about the older head; re-run (a) and re-review rather than discarding the reviewer's work as dishonest.reason=verification-unconfigured — the receipt had nowhere to go; create $WT/.claude/runs and set KIT_RUN_ID as above, then re-run.On echo-mismatch (and for the security dimension per the measurement above), fall back to the degraded reviewer agent for that dimension and record the fallback with the existing token (this issue added no fourth reason). Run it from $WT/, with the run id: emit anchors its append on the CWD, so from $WT/ the event lands in the SAME run file as the receipts, and without KIT_RUN_ID an unset run id is a silent no-op at exit 0 — which would drop the one event that records WHY this dimension degraded:
KIT_RUN_ID=review-$ARGUMENTS python3 scripts/review_context.py emit --event review_degraded_path_used --dimension <code|security> --reason inline-attempt-failed --issue $ARGUMENTS
The same emit call covers an inline invocation that fails outright despite the decision (probe-2 ambiguity).
Mixed mode (one runtime + one degraded) is supported. Run code-quality and security in parallel where possible; capture outputs to docs/.review/code-review.md and docs/.review/security-review.md (the synthesizer expects these paths). Decide-time degradations are emitted by decide itself — do not re-emit review_degraded_path_used for them.
3.2) Over-engineering audit (minimality axis) — kit-distinctive, runs on BOTH paths:
Scan the diff for unnecessary complexity only — not correctness (that is the code dimension above). Tag each finding delete / stdlib / native / yagni / shrink, one line per finding (path:line: <tag> <what to cut> → <replacement>), ending with net removable lines — or Lean already. Ship. if nothing to cut. This axis never overrides safety (validation, error handling, security, a11y, explicitly-requested work).
reviewer agent invocation (the agent's Over-Engineering section covers it) — do not run it twice.reviewer subagent to run ONLY this axis; capture output to docs/.review/minimality.md.docs/.review/findings.json (step 3.14), put each minimality finding into the minimality_findings array with its tag prefixed in the title (e.g. [yagni] …); the synthesizer renders these under the always-on Over-Engineering section (the kit's SSOT review-notes contract).(Synthesis + merge-audit happen AFTER all kit-distinctive checks 3.5–3.13 complete — see steps 3.14 and 3.15 below. This sequencing lets the synthesizer merge runtime findings, kit-distinctive findings, and any degraded-path findings in a single pass.)
3.5) Figma compliance check (auto-skips if no Figma data) — runs BEFORE UI review to ensure Figma fidelity first:
CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase figma-compliance --issue $ARGUMENTSCompares ALL implementation style properties (24 categories) againstfigma-export/design_data.json. Auto-passes when no Figma data exists. Fails if implementation deviates from Figma design tokens. If exit code ≠ 0: STOP immediately. Fix all violations before proceeding. Figma is the absolute source of truth. Any deviation is a blocking violation.
3.6) Computed style verification (auto-skips if no Figma data):
CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase computed-styles --issue $ARGUMENTSRenders the implementation in Chromium, extracts ACTUAL computed CSS values from every visible element, and compares against Figma tokens. Catches CSS cascade conflicts, specificity overrides, and inheritance issues that static source analysis (figma-compliance) misses. If exit code ≠ 0: STOP immediately. Fix the rendered style mismatches.
3.7) Structural match (auto-skips if no Figma data):
CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase structural-match --issue $ARGUMENTSVerifies all Figma elements exist per viewport, with responsive CSS. If exit code ≠ 0: STOP immediately. Add the missing elements.
3.8) Layout verification (auto-skips if no Figma data):
CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase layout --issue $ARGUMENTSVerifies element spatial relationships (row/column, sibling ordering). If exit code ≠ 0: STOP immediately. Fix layout.
3.9) Same-renderer visual diff (blocking — prototype HTML vs implementation, both Chromium):
CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase visual-diff --issue $ARGUMENTSRenders both prototype HTML and implementation in the SAME Chromium engine — eliminates font hinting and anti-aliasing differences. Threshold: 1%. Falls back to Figma render PNG comparison (5% threshold) if no prototype HTML. If exit code ≠ 0: STOP immediately. Fix visual discrepancies.
3.10) Visual diff debug images (for reviewer reference):
Diff images saved to figma-export/visual-diff/ — red = real diff, yellow = AA.
Reviewer should inspect these alongside the diff percentage.
Run: python3 scripts/verify_visual_diff.py --project-path $WT --threshold 5
This is a non-blocking advisory signal, NOT a gate. Pixel comparison across different renderers (Figma vs Chromium) inherently produces false positives due to font hinting, anti-aliasing, and sub-pixel rendering differences.
figma-export/visual-diff/ (red = real diff, yellow = AA)docs/review_notes/$ARGUMENTS.md for the reviewer to assess3.11) IF the issue involves UI/frontend work (check UI: true field first; fall back to Track/title keywords: "UI", "screen", "component", "prototype"):
Ask ui-reviewer subagent to perform UI state review:
docs/ui_review_notes/$ARGUMENTS.md with severity-classified findings.CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase ui-review --issue $ARGUMENTSThe script auto-detects UI issues via Track field/title keywords. Non-UI issues pass automatically. If exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.
3.12) IF UI issue AND design system docs exist (docs/design_system.md, design_system_mobile.md, or design_system_desktop.md):
Ask design-auditor subagent to audit the design system:
figma-export/design_data.json (if exists) so auditor can verify design system covers all Figma tokens.docs/design_audit.md with severity-classified findings.3.13) IF UI issue: Ask a11y-auditor subagent to perform WCAG 2.1 AA accessibility audit:
docs/a11y_audit.md with findings and fix suggestions.3.14) Synthesize runtime code/security outputs (from step 3.1) + kit-distinctive findings (Figma 3.5–3.10, UI review 3.11, design audit 3.12, a11y audit 3.13) into docs/review_notes/$ARGUMENTS.md:
docs/.review/findings.json with code_findings and security_findings (extracted verbatim from runtime outputs or the degraded reviewer agent), plus optional ui_findings / design_findings / a11y_findings / figma_findings arrays from whichever kit-distinctive checks ran.python3 scripts/synthesize_review_notes.py --input docs/.review/findings.json --out docs/review_notes/$ARGUMENTS.md_No findings._ literal. Kit-distinctive sections appear only when they ran.$WT/.CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase test --issue $ARGUMENTSIf exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.
4.5) Test quality verification: Validate that all test files in the branch contain real assertions (no hollow tests). This catches test files that exist to satisfy checkpoints but don't actually verify behavior.
CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase test-quality --issue $ARGUMENTSIf exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.
4.7) Tech-debt ledger (advisory — harvests KIT-DEBT markers):
CHECKPOINT — advisory (non-blocking) Run:
bash scripts/checkpoint.sh --skill review --phase debt --issue $ARGUMENTSAlways exits 0. Lists everyKIT-DEBT(ceiling=…, trigger=…)marker; flags markers missing atrigger=as silent-rot risk. Record anyno-triggermarkers as Low-severitycode_findingsentries (title prefixed[debt]) indocs/.review/findings.jsonso deferrals don't become permanent. Does NOT block the review.
docs/review_notes/$ARGUMENTS.md is already produced by step 3.14 (synthesizer) with the canonical 2-section format (Code Review + Security Findings, minimality/debt findings folded into Code Review with their tags) plus any kit-distinctive sections (UI Review / Design Audit / Accessibility Audit / Figma Compliance) that ran. If fixes applied in step 4 changed the underlying findings, or step 4.7 added [debt] entries, re-run python3 scripts/synthesize_review_notes.py with the updated docs/.review/findings.json. Do not edit docs/review_notes/$ARGUMENTS.md by hand — the kit's SSOT contract (/ship, /sprint consumers) depends on the synthesizer-produced shape.5.3) Record the review subject in the notes (ISSUE-096 counter-evidence). This runs HERE, downstream of the synthesizer at step 3.14 and of any re-synthesis in step 5, because those rewrite the very file it checks — placed upstream it would gate a surface that is overwritten afterwards, and pass anyway:
KIT_RUN_ID=review-$ARGUMENTS python3 scripts/review_context.py record-subject --pr <pr_number> --issue $ARGUMENTS
It writes the byte count, head oid, range and verified dimensions into <worktree>/docs/review_notes/$ARGUMENTS.md — copied from the receipt the passing echo gate in step 3.1(c) wrote, not recomputed here. That is the point: a block the command computes for itself is byte-identical whether the echo gate passed, was rejected, or never ran. An existing block is replaced in place, so a second review cycle (step 6 commits and pushes these notes, which moves the head) does not wedge. A non-zero exit means:
reason=verification-missing / reason=verification-unconfigured — no passing delegation to attest to. Either no dimension delegated (then skip this step), or the echo gate was never run / was rejected / had no run id.reason=review-notes-missing — run the synthesizer first.reason=subject-duplicate-block / reason=subject-unparseable — the notes carry two blocks or an unreadable one; delete the stale block and re-run.reason=subject-incomplete — the block could not be read back. Usually an unterminated code fence earlier in the notes (a finding whose multi-line evidence puts a ``` at column 0) hiding the heading from the detector; the message names which cause it found. Nothing was written, so fix the cause and re-run — retries do not accumulate blocks.Fix the cause before shipping, so "reviewed nothing" can never render identically to "reviewed and found nothing". Skip only when no dimension delegated.
5.5) Learning Extraction → native memory (kit-distinctive, not duplicated by runtime). Identify findings in docs/review_notes/$ARGUMENTS.md that could have been prevented earlier (at kickoff or implementation time), and record each preventable pattern as a review lesson in Claude Code's native persistent memory so it auto-recalls into future sessions — replacing the retired docs/review_lessons.md registry (ISSUE-033).
review-lessons.md (in the native auto-memory directory — ${autoMemoryDirectory} if set, else ~/.claude/projects/<project>/memory/; use your memory capability rather than a hard-coded path). Add a one-line pointer under a ## Review Lessons heading in MEMORY.md so the index surfaces it at session start.MEMORY.md index and review-lessons.md; if the pattern already exists, update that entry (append the new observed issue) instead of creating a duplicate. No numeric lesson IDs, no Frequency counter — the native convention is one fact per entry, updated in place.[record] class: it widens what future reviews check, and each new drift becomes triage work. Record the lesson one level up instead: don't state the derived fact, or generate it from its source. Same test as the triage gate — if the pattern never recurring would break nothing for a user, it is not a lesson.docs/review_lessons.md or use registry_edit.sh for lessons; native memory is the store now.
5.7) Update test plan (if docs/test_plan.md exists):docs/test_plan.md based on the PR changes.docs/test_plan.md content.bash scripts/registry_edit.sh docs/test_plan.md -- bash -c '<update command>' for safe concurrent modification.CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill review --phase review --issue $ARGUMENTSIf exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.
$WT/.CHECKPOINT — ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill review --phase push --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line — report the gap, self-correct, then continue.
gh pr ready.IMPORTANT: Never commit issues.md, STATUS.md, or CHANGELOG.md to the feature branch.
These are registry files managed only on main. Always use bash scripts/registry_edit.sh <file> -- bash -c '<update command>' — the wrapper resolves the main repo root internally.
gh pr status returns nothing): stop and report; suggest running /implement first.git checkout -- <files> for unstaged or git revert HEAD for committed changes (inside $WT/).gh pr ready fails: report the error but do not block — the PR can be manually marked ready.git revert the review commits (do not force-push).bash scripts/wt_cleanup.sh "$BRANCH".What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub pillip/claude-dev-kit --plugin claude-dev-kit23 skills in this plugin
/bizanalysisAnalyzes and critiques business viability. Use after /brainstorm and before /prd./brainstormExplores ideas and defines problems through free-form conversation. Use before /prd when direction is unclear./carefulActivates destructive command warnings for the current session. Use when working in sensitive environments./desktop-uiuxEstablishes a desktop design philosophy based on kickoff outputs, and generates a desktop design system/wireframes/Electron prototype. Recommended flow — /prd → /kickoff → /desktop-uiuxOther plugins' skills for the same job