/spec:verifyfrom spec
Dispatches an independent spec-verifier agent to audit changes across four dimensions (Completeness, Correctness, Coherence, Reuse & Conformance). Supports --codex for peer review, --fix for auto-fixes, and --diff for diff-only mode.
Ships in spec. Installing the plugin adds it to Claude Code.
| Command | Behavior | Modifies code |
|---|---|---|
/spec:verify | independent spec-verifier review: four dimensions | ❌ |
/spec:verify --codex | + Codex heterogeneous peer review, produces findings | ❌ report only |
/spec:verify --codex --fix | Codex review + applies fixes + Claude second-pass sign-off | ✅ |
/spec:verify --diff [range] | diff mode (§ Diff mode) — forced even when a change exists | ❌ |
--view (combinable) | after the run, /spec:view verify renders the ledger page (diff mode: the record dir) | ❌ |
--fix MUST be paired with --codex — standalone --fix outputs exactly --fix requires --codex; run /spec:verify --codex --fix and stops. Default (no flags) performs the independent review only, maintaining a read-only reporter stance. Any other token in the arguments matches no flag and is flagged to the user as a possible typo (same contract as /spec:apply's parsing) — nothing is silently ignored.
This section is change mode. Diff mode picks its executor by SKILL § Independent audit and briefs the verifier with the claim list and scope (§ Diff mode step 4).
The conversation that just ran /spec:apply cannot audit its own output — same context, same blind spots, and "be objective" instructions have near-zero measured effect on self-preference. /spec:verify therefore dispatches the spec-verifier agent (fresh context: it reads only proposal + design + charter + the diff) and keeps the bookkeeping for itself. The same rule binds /spec:apply's closing verification: the review is ALWAYS performed by a dispatched spec-verifier, whoever initiates it — the implementing conversation only ever does bookkeeping:
spec-verifier with the change name and nothing else — its ignorance of the implementation process is the mechanism, don't "helpfully" brief itconclusion is authoritative and may never be upgraded fail → pass. Disagreement is recorded as a note next to the row, never by deletion[ruling] — a fact line in the rulings subdoc under spec/knowledge/ with its index line maintained (format → references/knowledge-spec.md; never a flat line into the index) — so later rounds and later changes stop repeating it## What implemented? Check each item against its verify: clause — that clause is the falsifiable acceptance check; a What item with no verify: clause → flag it explicitly, don't improvise a pass## How?index.md present, every behavioral addition in the diff (validation / required field / value range / permission / endpoint / schema element) must trace to a refs: R-N whose quoted text entails it — no citation or a mismatched one = unsourced addition; index absent (legacy change) → declare it and hunt additions against ## What onlyNot in this change = exclusion zones: code changes inside that scope → scope violation, flag it; conversely NEVER flag excluded scope as "missing work" — it is out of scope by decisionskills/core/references/<stack>.md?## How / ## Risk decisionNew creations field carry the A-N gap citation?Models rate defensive fallbacks as "robust"; the charter (code-charter.md) rates them as the number-one source of dirty data. This audit therefore never asks "is this fallback well-written?" — it asks "which gate decision authorized it?". Untraceable = finding, zero judgment calls.
Machine pass first: ast-grep scan --config ${CLAUDE_PLUGIN_ROOT}/rules/sgconfig.yml <changed files> — the shipped rule pack (rules/dirty-data/, validated: catches "return default in catch" even when a log line disguises it; never flags a proper throw) produces AST-level Evidence with no regex false positives. ast-grep not installed (scoop install main/ast-grep / npm i -g @ast-grep/cli) → declare not run: ast-grep not installed in Evidence and fall back to the manual patterns below. Java projects with a JVM can additionally run PMD's built-in EmptyCatchBlock (pmd check --file-list changed.txt -R category/java/errorprone.xml) with zero project changes.
Manual patterns (fallback, Grep the changed files — patterns, not vibes):
|| defaultValue / ternary fallback chains that mask a failed lookup as a normal resultDEVLOG: tags in the diff (charter clause 8 — process markers not swept to function comments at wrap-up)Verdict rules:
| Situation | Verdict |
|---|---|
Pattern hit traces to an explicit ## How / ## Risk decision (quote it in the finding check) | Not a finding — but confirm it degrades loudly (log/alert per charter); silent even when authorized → finding |
| Pattern hit with no decision behind it | Finding, severity major |
| Same, on a data-write path (INSERT / UPDATE / message produce / file write) | Severity critical — this is how dirty data is born |
The fix direction is replacement or a gate decision (/spec:revise how to authorize it deliberately) — never "keep the fallback but add a log line".
When --codex is specified, after the independent review, invoke Codex (a heterogeneous model) to review the same set of changes — a heterogeneous reviewer fills in the systematic blind spots of a single Claude pass (in practice the two finding sets barely overlap).
All invocation mechanics are encapsulated in ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.ps1 — Windows workarounds (#336 bypass sandbox / #337 avoid node spawn), effort=low for cost control, timeout to prevent hangs, residual-process cleanup, session parsing. The "why this exact invocation is required" constraints are in the script header comments (single source of truth).
Session reuse: if spec/changes/<name>/.codex-session exists (left by /spec:propose --codex), pass -ResumeSession <id> to resume — Codex remembers the proposal it reviewed and can judge "does the code faithfully implement the proposal?". Omit the parameter if no session file exists.
Executed by Claude inside the session (
${CLAUDE_PLUGIN_ROOT}resolves only there) — not a command for you to run in a terminal.
$prompt = @"
Review the following code changes. Focus: <key focus of this change + proposal ## Risk>
Scope: <files touched in git diff>
"@
pwsh -File ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.ps1 -Prompt $prompt -TimeoutSec 300 -ProjectDir "<project directory>" -ResumeSession "<id; omit this parameter if none>"
Default (no --fix): Codex produces findings only, does not modify code — it reports issues; you decide whether to address them via /spec:apply or by adding --fix.
Enabled only with --codex --fix. Uses the same codex-exec.ps1, but the prompt is switched to "review and fix" — sandbox bypass allows Codex to modify working-tree files directly. Claude then performs a second-pass sign-off (do not blindly trust):
git diff to see what Codex changed, and judge each change:| Codex change | Verdict | Action |
|---|---|---|
| Real problem, correctly fixed | ✅ | Keep |
| Changed something it shouldn't / introduced a new problem | ❌ noise | Revert (Edit / git checkout -p) |
| Rewrote unrelated code | ❌ scope creep | Revert |
| Real problem Codex missed | ➕ | Claude fixes it |
Community-validated warning, hardcoded here: Codex changes contain noise; Claude MUST filter every change individually. Blindly trusting "it changed it, so it's right" is NEVER acceptable.
=== Verify ===
[independent] Completeness: <pass/fail/partial> - <explanation>
Correctness: <pass/fail/partial> - <explanation>
Coherence: <pass/fail/partial> - <explanation> (incl. charter sub-audit)
Reuse&Conf: <pass/fail/partial> - <explanation>
Evidence (mandatory in all modes — one line per check actually executed):
<command / action> → <exit code or the key output line>
not run: <check> — <reason> ← declaring a skip is legal; hiding it is not
pending live check: <item> ← the live-acceptance list — checks that need the running
app or human eyes; one line each, handed to the user.
These are a handover, not findings: they NEVER hold
`conclusion: pass` hostage and never block archiving —
the machine-verifiable set must be green, the live set
belongs to the user's own acceptance run, and anything
that fails there comes back through /spec:fix
[--codex] Codex peer review findings: <N items>
[--fix] Codex changed <M> locations → kept X / reverted Y / supplemented Z; tokens ≈ <from output>
Overall: <pass / fail>
Without flags, only the [independent] section (plus Evidence) is output. Correctness may be marked pass only when at least one Evidence line supports it; nothing runnable in this environment → write Correctness: not verifiable - <why>, never pass.
Trigger: zero active changes → diff mode runs automatically; --diff [range] forces it even when a change exists; more than one active change and none selected → list them and ask which one to verify, offering diff mode as one option — never pick by guess, because a just-applied change silently skipped would lose its closing round.
git rev-parse --show-toplevel succeeds → git: changed set = git diff --name-only --relative HEAD plus untracked git ls-files --others --exclude-standard (plain diff misses new files; both list paths relative to the launch root, so the drop rule below and the batch comparison in step 7 compare like with like); hunks git diff --relative HEAD -- <kept files> (same base, flow paths stay out; an untracked kept file has no hunk — read it whole); changes outside the launch root are not in scope — the scope line counts them when git diff --name-only HEAD shows any; a given range is used as written (A..B compares the two trees, A...B diffs since the merge base)svn info --show-item=wc-root prints a non-empty path (judge by stdout — the exit code outside a working copy is undocumented) → svn: changed set = svn status (M A D R, plus ? unversioned — svn diff never shows those); hunks svn diff / svn diff -r N:M; X externals are listed as out of scope (svn diff does not descend into them)spec/changes/, spec/archive/, spec/knowledge/, spec/knowledge.md under the launch root, and nothing else under spec/ (RSpec and Jasmine keep real tests there): earlier records, fix ledgers and views are not the code under audit, and leaving them in makes step 7's batch comparison never match. The scope line names how many paths were droppedgit log <range> / svn log -r N:M) → none. None = diff-only: Completeness is not assessed and the record says so (SKILL § Independent audit)--findRelatedTests <files>, vitest related <files> --run; elsewhere the naming conventions (pytest test_<mod>.py / <mod>_test.py, Maven surefire *Test.java with -Dtest=, Gradle --tests); then each touched stack's full suite once as the regression net (static selection misses dynamic imports and reflection) — cannot run it → not run: full suite — <reason>. Checks follow /spec:apply's three-tier order: tests → seam mocks → live items handed over, never waited onscreens/ + screens.md, or screens: pending live check — <page list> when the app is not runningspec/archive/<YYYY-MM-DD>-verify-<slug>/verify.md (+ screens/); an existing dir gets a counter suffix (-2, -3, …), never an overwrite. Never under spec/changes/ — a dir there counts as an active change and trips the gates. Same ledger format below, with mode: diff in place of change: and two lines before ## Findings: scope: <git|svn|conversation> <range or working tree> — <files> and intent: <user words|commits|none> — <one line>/spec:ship instead: one diff gets one auditDiff mode audits and records only — it never archives, ships, or edits a fix batch.
spec/changes/<name>/verify.md (written every run; diff mode: the record's verify.md, § Diff mode step 6)A stateless verify can pass the same broken change twice. Every run therefore writes/updates a ledger in the change directory (diff mode: in its record dir) — findings carry stable IDs, and the next round must face every still-open one before it may conclude.
The ledger has two writers, one table: /spec:propose's critique panel opens it with round 0 (stage: propose, pre-code findings), and /spec:verify owns every round after — so the round narrative runs unbroken from before the gate to acceptance, and /spec:status derives the milestone view from it without any extra file.
Format (YAML frontmatter + findings table):
---
change: <name>
round: <N> # increments each run
date: YYYY-MM-DD
conclusion: pass | fail
issues: { critical: <N>, major: <N>, minor: <N>, open: <N> }
---
# Verify: <name>
## Findings
| ID | Severity | Location | Finding | Status | Rounds |
|----|----------|----------|---------|--------|--------|
| V-1 | critical | file:line | <one line> | open / fixed(rN) / wontfix: <reason> | r1→r2 |
## Evidence (round N)
<command> → <exit code / key output>
not run: <check> — <reason>
Round rules:
round = previous + 1. Round 0 is legal: /spec:propose's critique panel writes its surviving findings as round 0 (stage: propose) before any code exists — the first verify run is then round 1, and it re-checks round 0's open findings like any others
fixed(rN); still open → stays open and escalates: a critical/major finding open for 2+ rounds forces conclusion: fail and leads the user-facing outputwontfix requires a written reason (inside Not in this change / explicit user decision) — silence is not a statussource: user noted in the Finding column; an item applied over your refutation is additionally marked user-override. They then drive the next fix round exactly like verifier findings. A user-overruled false positive still follows rule 4 (distill the lesson into the knowledge base)The user-facing output ends with the round summary:
Ledger: verify.md round <N> — fixed <X> · still open <Y> (escalated: <IDs>) · new <Z>
When the review fails, report the specific failure point:
| Failing dimension | Report content |
|---|---|
| Completeness | List unimplemented items from proposal ## What; list interfaces in design.md that are not aligned |
| Correctness | Paste the exact error + file / line number; failing test case + expected vs. actual |
| Coherence | Where the change diverges from ## How; scope creep; violations of references/<stack> conventions |
| Reuse & Conformance | The new creation + the existing equivalent it duplicates (file:line), or the E-N exemplar / nearest-neighbor convention dropped (dual citation), or the missing A-N gap citation |
Guiding principle: describe the problem; do not prescribe the fix — the remediation path is for the user / main conversation to decide.
--fix causes the same change to cycle through review and re-fix without converging → stop and report; NEVER loop endlessly through codex → fix → codex/spec:status's job; verify only reports--fix is absent (the one file it always writes is the verification ledger spec/changes/<name>/verify.md — diff mode: spec/archive/<date>-verify-<slug>/verify.md; source modification is /spec:apply's job)/spec:revise's job)/spec:archive's job)Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
2 plugins ship this exact command · first indexed Nov 13, 2026
18 commands in this plugin
/apply/spec:applyImplement the code, advancing by proposal/tasks. A pre-command hook checks that proposal.md carries the APPROVED marker. Verification model: cheap self-run working checks per node while implementing; ONE independent spec-verifier pass at the end (never dispatch verification subagents mid-implementation)/archive/spec:archiveArchives the current change to spec/archive/YYYY-MM-DD-<name>/. Only invoked when the user explicitly says "archive". Writes an archive-stage retrospect, mines the change for recurring lessons (fresh-context spec-reflector agent) and applies the ones the user selects to project skills / rules files, sediments the knowledge base, checks for uncommitted code, and is guarded by the check-archive hook./npx claudepluginhub kamioj/spec-workflow --plugin specOther plugins' commands for the same job