/dev-flow:spec-reviewfrom dev-flow
Reviews a diff against the project's spec (PRD.md + tasks.md), contract (golden rules, meta.json#stack), and risk (alignment, impact, verification, rollback cost, error detection). Three parallel sub-agents produce verdicts and an intervention level. Requires .workflow/ directory.
Ships in dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Three-axis review of the diff between HEAD and a fixed point:
.workflow/PRD.md / tasks.md asked for?Both run as parallel sub-agents so neither pollutes the other's context, then this skill reports them side by side.
Credit. The two-axis structure, the parallel-sub-agent split, the refusal to merge verdicts and the Fowler smell baseline are adapted from Matt Pocock's
code-reviewskill (mattpocock/skills, MIT — the skill now lives atdocs/engineering/code-review.md; both paths checked 2026-08-26, re-checked 2026-11-05) and the essay behind it. What's ours is the half his skill has to search for: in a dev-flow project the spec and the standards are at known paths.
/code-reviewClaude Code ships a built-in /code-review, and Pocock's own write-up lists the name collision as a
known problem. This skill is deliberately not that, in name or in remit:
Built-in /code-review | spec-review | |
|---|---|---|
| Reviews | the code, generically | the code against this project's spec and contract |
| Knows | the diff | .workflow/PRD.md, tasks.md, meta.json#stack, #artifacts, #history |
| Answers | "is this good code?" | "is this the thing we said we'd build, built our way?" |
Run both if you like — they don't overlap. Without a .workflow/, this skill refuses and points
at the built-in: with no spec and no declared stack, both of its axes are guesswork.
Whatever the user names is the fixed point (a SHA, main, a tag, HEAD~5). If they didn't say, ask.
git rev-parse <fixed-point> # must resolve
git diff <fixed-point>...HEAD --stat # three-dot: compare against the merge-base
git log <fixed-point>..HEAD --oneline # the commits under review
A bad ref or an empty diff must fail right here — discovering it inside two parallel sub-agents
wastes both. Three dots, not two: you want the merge-base, not everything that landed on main
meanwhile. And the diff excludes uncommitted work, so commit (or stash) before asking for a review,
or the change you most want looked at is the one nobody sees.
This is where the contract earns its keep. In order:
.workflow/tasks.md — the tasks this branch claims to close. Match by branch name, by the task
ids in the commit messages, or ask which ones are in scope..workflow/PRD.md — the requirement behind those tasks; the tasks are the decomposition, the PRD
is the intent. A diff can satisfy every task and still miss what the PRD asked for.meta.json#artifacts — what was produced and by which skill, so the reviewer knows whether a file
is hand-written or generated (holding generated scaffolding to hand-written standards is noise).scrum — the issue on the tracker is the live spec; meta.json#tracker names the tracker and maps each task to its issue.If .workflow/PRD.md is absent (a project adopted mid-flight), say so and run the Spec axis against
tasks.md alone, or skip it and report that the axis was not run — never invent the spec from the
diff. A review that infers the requirements from the code it is reviewing always passes.
A dev-flow project's documented standards are not a CONTRIBUTING.md someone may have written. They are:
| Source | What it binds |
|---|---|
Golden rules (references/contracts.md) | ① identifiers, constants and comments in English; ② i18n from day one — no hardcoded user-facing copy, en + it minimum; ③ UI only from the declared library's primitives — checked on the diff as below |
meta.json#stack | the declared choices: forms (every form through lib/forms/), ui / ui_base, i18n, db, deploy — a diff that reaches for a different library than the one declared is a finding |
| The discipline skills | state-discipline (useState is the last resort), data-fetching (Server Components first; Server Actions never for reads), transitions (every transition ships a prefers-reduced-motion path), composition-patterns-guide (no boolean-prop pile-ups) |
| The repo's own docs | CONTRIBUTING.md, CODING_STANDARDS.md, AGENTS.md/CLAUDE.md if present — these override everything above where they conflict, including this skill |
| Fowler baseline | the floor, below — applies even when nothing above says anything |
Skip anything tooling already enforces. biome/eslint, tsc, and the five pre-deploy gates
(shadscan, vercel-doctor, compliance-audit, launch-audit) have their own runs; repeating them here produces a
long report that says nothing new. If the project has a lint gate, a review finding about formatting is
noise.
The design-system lint already refuses the import half (imports of an undeclared component library,
imports of radix-ui / @base-ui/react / cmdk / vaul… outside components/ui/) — don't repeat it.
A green lint is not evidence for the rest: a raw element imports nothing, and on smart-travel
(2026-10-12) 238 hand-made elements sat behind a green lint and screenshots that matched the boards.
The Standards sub-agent checks:
A file outside components/ui/ that re-implements a pattern an installed primitive covers. List
components/ui/ (shadcn monorepo: packages/ui/src/components/) first, then read each new or changed
component for the pattern it renders: a positioned floating panel is Popover/Tooltip/DropdownMenu,
an overlay with a focus trap is Dialog/Sheet, a filterable list is Combobox/Command, a
pulsing placeholder is Skeleton, a "nothing here" block is Empty, a tab strip is Tabs.
Imports from a component library meta.json#stack does not declare — including one the lint does
not know about yet (the lint list is finite; the rule is not).
Behaviour changes inside components/ui/ beyond cva variants and token classes — new props that
change markup, handlers, state, focus or ARIA wiring. That is a fork of the primitive.
Hand-made UI: raw elements and classes that redraw a primitive («the primitive renders the design»). A violation
with no import at all. Run the lint rule on the files of the diff — it reports raw <button>, <label>,
<input>, <select>, <textarea>, <hr>, <details>, <summary>, <dialog>, <progress>,
<meter>, <table>, <img>, <a>, hand-written roles (tab, radio, menu, switch…), and
div/span classes that redraw a Card, Badge, Alert or Separator, each with the primitive to use:
git diff --name-only --diff-filter=AM <base>... -- '*.tsx' '*.jsx' \
| xargs pnpm exec eslint --no-warn-ignored --rule '{"design/no-handmade-ui":"error"}' 2>&1 \
| grep -E 'design/no-(handmade-ui|card-in-card)'
Without the rule in the project (a preset older than 2026-10-12 — itself a finding: the retrofit is
design-md-to-app/scripts/setup_design_lint.py <root>), fall back to a grep on the added lines:
git diff <base>... -U0 -- '*.tsx' '*.jsx' | grep -nE \
'^\+.*(<(button|label|input|select|textarea|hr|details|summary|dialog|progress|meter|table|img|a)[ >/]|role="(tab|tablist|radio|radiogroup|checkbox|switch|menu|menuitem|listbox|option|dialog|tooltip|progressbar|separator)"|className="[^"]*rounded-(lg|xl|2xl|3xl)[^"]*\b(border|ring-1)\b)'
Then drop the allowed cases by reading each hit: an element passed as a primitive's render (or under
asChild), an <a> styled by buttonVariants (download, tel:, mailto:), a hidden or file input,
an sr-only table, a file that renders no DOM (next/og, react-email, react-pdf), a file in the
preset's designExceptions. "The board looked different" and "the primitive has no variant for it"
are not exceptions — both are fixed in the primitive: its cva variant tuned to the board, a new
variant recorded first in DESIGN.md. Never by correcting the board, never by classes at the call site.
Report a missing variant as a finding and name the variant to add. Also report, under the same check,
call-site classes that override a primitive's own look (radius, ring/border, selected or hover
background, weight, padding) — the look belongs in the variant — and, when the diff converts an existing
screen, the absence of a before/after pixel diff (design-md-to-app/references/primitives-first.md
§Converting existing screens). Also read the diff and the agent's report for the words
that give it away («no variant», «wrong on hover», «custom because») — the smart-travel evidence was
in exactly such a comment and such a report.
Each is a finding unless meta.json#stack_config.primitive_exceptions (or an ADR in docs/adr/)
records that component with a reason — then it is not a finding, and say that you checked.
Example finding, in the report's shape:
Standards · golden rule 3 · high —
app/(app)/bookings/_components/guest-picker.tsx:12-88renders an absolutely positioned list under an<input>with its own open state, outside-click handler and arrow-key navigation.components/ui/combobox.tsxis installed and covers this pattern (filtering, keyboard navigation, portal, ARIA). No entry instack_config.primitive_exceptions. → Replace withCombobox; the guest-specific row becomes the item renderer.
Standards · golden rule 3 · high —
components/checkout/review-form.tsx:41writes<button className="text-sm font-medium underline">Modifica</button>and:58<span className="rounded-full bg-success-soft px-2 text-xs">Pagato</span>;design/no-handmade-uireports both (hand-written<button>; classes that redraw a badge). Neither is passed as arender, and no exception is recorded. The comment at:40says the ghost Button «turns grey on hover, wrong here» — the primitive renders the design: tune it, not the call site. →Button variant="link"(its hover tuned inbutton.tsxif the board wants it) andBadge variant="success"; ifbadge.tsxhas no success variant, add it — DESIGN.md first, then thecva— not a span.
The chapter catalogues more than these; the twelve below are the ones that show up in a diff, which is all this skill ever sees. Each is a labelled heuristic — "possible Feature Envy" — never a hard violation, and any documented standard above overrides it.
a.b().c().d() the caller shouldn't depend on. → hide the walk.Each gets the diff command, the commit list, its own sources pasted in full (a sub-agent has no access to what you read), and an explicit "do not spawn further agents" — Pocock's write-up records recursive spawning as a real failure mode when the brief doesn't forbid it.
Spec brief — "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff nobody asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the PRD or task line for each finding. Under 400 words."
Standards brief — "Report, per file/hunk: (a) every place the diff breaks a documented standard — cite it (which rule, which file); (b) any baseline smell — name it and quote the hunk. Documented breaches can be hard findings; baseline smells are always judgement calls; a documented standard overrides the baseline. Skip anything lint/tsc/the gates enforce. Under 400 words."
Risk brief — paste spec-review/references/risk.md in full, then: "Give each of the five
categories a verdict (⚠️/👀/✅) and, for anything but ✅, one line saying what would move it up. Then
answer the sixth question. No score, no arithmetic. Name the one-way doors explicitly. Under 400
words." The risk axis runs on every diff, including one with no PRD — it needs the change, not
the spec.
Present under ## Spec, ## Standards and ## Risk, verbatim or lightly cleaned. Never merge or
re-rank across axes. Close with the count per axis and the worst issue within each, then the
intervention level (contracts.md, "Intervention levels") — which is derived from who can check a
finding, never from how clean the diff looks.
That separation is the whole point: a change can follow every convention and implement the wrong feature (Standards pass, Spec fail), or do exactly what the PRD asked while ignoring the stack the project declared (Spec pass, Standards fail). One combined verdict lets either hide behind the other.
The third axis is there because the first two can both pass on a change that should not be merged. Every commit of the 2026-10-20 ask-gate work passed Spec and Standards — it answered a real finding, with tests, green — while asking on a fifth of all commands. Nothing in the first two axes asks what a change costs when it is wrong.
Findings are hypotheses. Verify before acting. This repo's own [VERIFY] discipline exists for the
same reason, and the 2026-08-26 sweep proved the point: of ~55 markers closed across the skill set, a
handful turned out to be confidently wrong rather than merely unchecked — a removed module path
still documented as current, a dead source-of-truth link, a package namespace that does not exist, an
upstream issue described as open that had been closed won't fix. A report that reads well is not a
report that is right.
meta.json#spec_review block"spec_review": {
"last_run_at": "<ISO>",
"fixed_point": "main", // what HEAD was compared against
"commits": 7,
"spec_sources": ["tasks.md#T12-T15", "PRD.md#3.2"],
"spec_findings": { "missing": 1, "scope_creep": 2, "wrong": 0 },
"standards_findings": { "hard": 1, "judgement": 4 },
"risk": { // the third axis; `verdicts` are ⚠️/👀/✅, never a score
"verdicts": { "alignment": "✅", "impact": "👀", "verification": "⚠️",
"rollback": "⚠️", "error_detection": "✅" },
"one_way_doors": ["migration drops client_choice", "vendored into 7 projects"],
"sixth_question": "<the answer, or the sentence saying it is empty>",
"accepted": { "verification": "12 orphan rows a year, accepted by luca on the PR" }
},
"level": 3, // contracts.md, "Intervention levels" — who can check, not how clean
"axes_not_run": [], // e.g. ["spec"] when there is no PRD — say so, never infer it
// Only on an iterated review; written by scripts/findings.py. Full shape in the contract.
"profile": "standard", "max_iterations": 3, "iteration": 2, "reopened": 1,
"rounds": [{ "round": 1, "closed_at": "<ISO>", "found": 4, "resolved": 3, "open_at_close": 1 }],
"findings": [{ "id": "F3", "axis": "risk", "severity": "high", "needs_human": true,
"resolution": "open", "…": "…" }]
}
Horizontal capability — run it on any diff. dev-flow proposes it when a chunk of work lands — a page,
a module, a PR, a batch of parallel agent branches — whatever phase meta.json records (a phase left
behind the code must not switch the review off; smart-travel built for three days at design_extracted
and this skill was never proposed), rather than only before shipping. In a parallel build the orchestrator
runs the Standards axis on every agent diff before accepting it: a spec finding is cheapest while
the branch is still open. It is not a sixth pre-deploy gate — the five gates (compliance-audit, vercel-doctor, shadscan,
launch-audit, app-security) read the finished artefact, this reads the change. Records meta.json#spec_review +
history; never bumps phase; never blocks anything. Every scope_creep finding is routed to a choice the user makes, never the reviewer: change the PRD (the request passes prd-from-idea/references/scope-check.md and is recorded) or remove the code. A change whose behaviour nobody proved on the
running app is proved with the project's verification manual (.claude/skills/verify-<app>/, from
app-verification), not by reading the diff harder.
.workflow/, no run; use the built-in /code-review.forms, data-fetching, …).references/risk.md — the third axis: the five categories, the sixth question, the one-way doors
in our stack by name, and the two departures from the original (no score; stricter verification).
Pasted into the Risk sub-agent's brief in full.references/review-cycle.md — iterating without looping: the implementer/reviewer split, the
structured findings, the three refusals (a round cannot close while a finding needs a human; the
iteration cap is real; a finding that comes back is counted, not re-filed), and what reaches GitHub.references/pr-documentation.md — the twelve PR sections, which ones may be left out, and the rule
that "not assessed" is a legitimate final answer while an empty section is not.references/self-improvement.md — the measure → propose → test → human approves cycle, and why
nothing promotes itself.references/contracts.md — the .workflow/ dev-flow contract (vendored).Three axes in one pass is the default and the right one. When the first pass finds something worth a
second look, the loop lives in references/review-cycle.md and its state in
meta.json#spec_review, written through scripts/findings.py:
python3 spec-review/scripts/findings.py <root> open --fixed-point main --profile standard
python3 spec-review/scripts/findings.py <root> add --axis risk --severity high --file lib/db/schema.ts \
--line 42 --summary "the migration drops client_choice with no backfill" --needs-human
python3 spec-review/scripts/findings.py <root> iterate # refuses while anything needs a human
python3 spec-review/scripts/findings.py <root> close --level 3
The profile sets depth, never subtraction — light 1 round, standard 3, strict 5 — and it does
not drop an axis or lower a severity because a diff is small. close --level 1|2 refuses while a
critical or high finding is open, because levels 1 and 2 mean the agent merges.
A clean first pass closes and stops. Running a second round on a review with nothing open is how a cycle becomes a ritual.
docs/engineering/, where code-review.md still lives.merge-risk
(MIT, credits Matt Pocock's pr) — the five risk categories of the third axis. Its weighted
score is deliberately not adopted; references/risk.md §Two departures says why, with the
measurement that settled it.references/contracts.md (opens in a new tab)references/pr-documentation.md (opens in a new tab)references/review-cycle.md (opens in a new tab)references/risk.md (opens in a new tab)references/self-improvement.md (opens in a new tab)scripts/findings.py (opens in a new tab)scripts/meta_io.py (opens in a new tab)scripts/test_findings.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
spec-review, diff-review, prd-alignment, merge-risk, contract-check
57 skills in this plugin
/animated-iconsAdd a Motion-animated icon to a Next.js app from a shadcn registry instead of hand-animating an SVG. Two registries, picked from the project's icon set: **heroicons-animated** (316 icons, `shadcn add @heroicons-animated/<name>`) and **hugeicons-animated** (165 icons, `shadcn add @hugeicons-animated/<name>`, which also installs a shared `lib/use-icon-animation.ts`). Both MIT, both on the `motion` runtime, both copied into your repo as source. This skill owns the install plus the two things the raw components lack: a `prefers-reduced-motion` guard and timing aligned to the project motion tokens (`lib/motion/`). Use when the user says "animated icon", "animate this icon", "make the bell/heart/menu icon animate on hover", "aggiungi un'icona animata", or wants an icon micro-interaction. Refuses outside Next.js web — for React Native use `rn-animations-gestures`. Not for: static icons, a whole motion system (`transitions`), or installing the runtime itself (`module-add motion`)./app-securityCheck whether an app's own code can be attacked before it ships — vulnerable dependencies, secrets in the code and in git history, Next.js authorization gaps (Server Actions and route handlers without a session check, queries by id with no owner filter — IDOR), data over-exposure, secrets in public env vars, raw SQL — then read the flagged code against an OWASP checklist, with an opt-in dynamic level (Strix) that proves exploits against the app running locally. The fifth pre-deploy gate, beside compliance-audit, vercel-doctor, shadscan and launch-audit; reports and routes, never blocks. Triggers: "security review", "è sicura l'app?", "controllo di sicurezza prima del deploy", "IDOR", "secrets in the repo", "pentest". Not for: GDPR and legal (compliance-audit), UI quality (shadscan), cost (vercel-doctor), launch readiness (launch-audit), a review of one branch diff (Claude Code's /security-review), third-party registry code (registry-intake).npx claudepluginhub lukedj78/dev-flow --plugin dev-flow