core/skills/sw-verify/SKILL.md
Orchestrates quality gates for the current work unit. Runs enabled gates in dependency order, produces an aggregate evidence report with gate handoff.
npx skillsauth add obsidian-owl/specwright sw-verifyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run quality gates against the work unit. Continue through all gates
regardless of failures and present the report at handoff
per protocols/decision.md.
{worktreeStateRoot}/session.json -- selected work{repoStateRoot}/work/{selectedWork.id}/workflow.json -- work state and gate results{projectArtifactsRoot}/config.json -- gate configuration{workDir}/spec.md -- for spec compliance gate{workDir}/implementation-rationale.md -- curated build rationale when present{workArtifactsRoot}/{selectedWork.id}/integration-criteria.md -- behavioral IC list when presentskills/gate-*/SKILL.md{repoStateRoot}/work/{selectedWork.id}/units/{selectedWork.unitId}/stage-report.md -- verify handoff digest{workDir}/evidence/, one per gate{workDir}/review-packet.md -- reviewer synthesis from approvals, rationale, proof, and gate outcomesworkflow.json updated with gate results; status verifyingStage boundary (LOW freedom):
Follow protocols/stage-boundary.md. Run quality gates and show findings. NEVER fix
code, create PRs, or ship. After gate handoff, STOP.
Ownership check (LOW freedom):
Resolve the selected work from the current worktree session. If another live
top-level worktree owns that work, STOP with explicit /sw-adopt guidance and
do not rely on generic adopt/takeover behavior.
Assumption re-validation (LOW freedom) — before gate execution: Scan the design assumptions artifact from the design-level directory. Check ACCEPTED/VERIFIED assumptions against current code. Invalid → WARN in the aggregate report. Runs silently.
Approval lineage check (LOW freedom) — before gate execution:
Use protocols/approvals.md and the shared helper to validate the recorded
design and current unit-spec approval hashes. Missing, STALE, or
SUPERSEDED lineage becomes a distinct approval finding; headless verify may
report it but never create APPROVED entries.
Accepted-mutant lineage and mutation disclosure (LOW freedom):
When /sw-verify --accept-mutant {id} --reason "{prose}" is present, use
protocols/approvals.md plus the shared helper to record or refresh the
accepted-mutant approval entry before gate execution. Persist the config linkage
at config.gates.tests.mutation.acceptedMutants[], require a reason, and set
expiry to 90 days from approval unless a later explicit expiry is being
refreshed. Ordinary verify runs validate and report accepted-mutant lineage;
they never fabricate approval state or silently waive survivors. Mutation
analysis stays inside gate-tests, not a seventh gate. When gate-tests emits
mutation evidence, surface the tier (T1, T2, or T3), any
accepted-mutant approval lineage, and only the restricted survivor record:
operator, location, before/after, defect category, and action. No test bodies
and no assertion literals. Missing-tool or fallback paths may degrade through
T2/T3, but never to a silent skip.
Freshness checkpoint (LOW freedom) — before any gate runs:
Use protocols/git-freshness.md to assess the selected work's verify
checkpoint from the recorded target and policy. For branch-head validation,
branch-head require blocks stale, diverged, and blocked freshness results.
Queue-managed mode remains a distinct validation path and does not prescribe a
local rebase before verification. When branch-head validation is blocked and
rebase or merge reconcile is configured, run protocols/git-reconcile.md
in the owning worktree and continue gate execution in that same verify run
after a successful reconcile. manual remains an explicit fallback: stop with
manual reconcile guidance, reconcile the current branch against the recorded
target in the owning worktree, or run /sw-adopt first if a linked-worktree
ownership conflict exists, then rerun /sw-verify. Do not redirect to
/sw-build solely to clear freshness, and do not silently rewrite targetRef
or freshness metadata. In headless mode, follow protocols/headless.md: skip freshness blocking, continue gate execution, and report the freshness result with the gate findings.
Gate execution order (LOW freedom): Determine enabled gates from config. Support both formats:
config.gates.{gateName} exists and .enabled === trueconfig.gates.enabled arrayAll six gates are eligible when enabled in config: build, tests, security,
wiring, semantic, spec.
Execute enabled gates in dependency order: gate-build → gate-tests →
gate-security, gate-wiring → gate-semantic → gate-spec.
If --gate=<name> argument, run only that gate.
Load calibration notes per protocols/evidence.md#verdict-rendering.
Freshness is a prerequisite checkpoint, and gate-build plus gate-tests remain
the ordered prerequisites before any parallel or read-only lane begins. When
parallel verify execution is enabled under the same protocols/parallel-build.md
prerequisites (config.experimental.agentTeams.enabled=true,
SPECWRIGHT_AGENT_TEAMS=1, and a selected work unit with 4 or more tasks),
only gate-security, gate-wiring, gate-semantic, and gate-spec may run as
read-only evidence producers after the freshness, build, and tests steps
complete.
Parallel lanes never become independent workflow owners. The parent or
top-level verify execution remains the only authority that aggregates lane
results into shared work state, including the selected work's workflow.json
gates section.
Missing evidence, lane failure, or skipped prerequisite state must keep the aggregate verify result fail-closed. Parallel lanes may speed up evidence collection, but they must not upgrade the overall outcome to an aggregate PASS when prerequisite or lane evidence is incomplete. Verify must never report a soft success or soft PASS when required evidence is missing.
Gate invocation (MEDIUM freedom): Gates are internal skills — load SKILL.md and execute inline. Pass work unit context.
Gate Re-Run Policy (LOW freedom): Always re-run all gates regardless of existing results or age.
Review packet synthesis (LOW freedom) — after gate execution, before
handoff: Use protocols/review-packet.md to assemble
{workDir}/review-packet.md from approval lineage, implementation-rationale.md,
gate evidence, and the canonical gate-spec compliance matrix. This is
synthesis, not a second gate engine: do not rerun gates, recreate proof logic,
or backfill rationale from transcripts. In clone-local work-artifact mode,
keep the packet reviewer-usable without local-only file links.
Failure handling (MEDIUM freedom):
Gate FAIL or ERROR: continue. Run remaining gates and record results.
No fix/skip/abort decisions — the handoff presents everything for human review.
Headless: write headless-result.json.
Aggregate report (MEDIUM freedom):
After all gates, present three tiers. When approval findings exist, prepend an
Approval Lineage subsection before tier 1.
Per-finding detail (first): every BLOCK/WARN grouped by gate with what, why, and recommended action.
Summary table (after): | Gate | Status | Findings (B/W/I) |
Actionable Findings (after summary): only shown when WARN or BLOCK findings exist; omit when all gates PASS. Populate from gate evidence and include only WARN and BLOCK severity rows, not INFO.
| # | Gate | Severity | File | Finding | Recommended Fix | |---|------|----------|------|---------|-----------------|
N of M) and whether any
require human judgment. Keep it informational — do not imply the skill
will perform fixes.SKIP gates prominently marked. Check escalation heuristics per
protocols/evidence.md#verdict-rendering. Handoff posture remains three-tiered:
BLOCKs → "Fix and re-run /sw-verify." WARN-only results → "Review, then fix or /sw-ship." All PASS → "Ready for /sw-ship."
Evidence completeness (LOW freedom):
Skip when --gate=<name> was used. In full mode, check every enabled gate has
a status in the selected work's workflow.json gates.{name}. No status and
no evidence file → ERROR: "Gate {name} was enabled but produced no evidence —
gate was not executed." A partial run may omit evidence for gates that were not
invoked.
Deliverable verification (MEDIUM freedom) — inline phase, not a gate:
Activates on the final work unit of a multi-WU design. Activation conditions:
workflow.workUnits has >1 entry, current unit is last in the sequence, all
prior units are shipped or verified, and all six standard gates completed
with PASS or WARN (not FAIL or ERROR; failed gates skip deliverable verification
because the proof surface is already broken). Runs after the six standard gates.
When activated:
integration-criteria.md from the design-level directory
({workArtifactsRoot}/{selectedWork.id}/). If the file does not exist → SKIP
with INFO note ("No integration-criteria.md found"). Identify behavioral ICs
(IC-B{n} entries).commands.test:integration and commands.test:e2e from config.json if
configured. Failing commands → BLOCK. Unconfigured commands → WARN.Include deliverable verification findings (BLOCKs, WARNs) in the aggregate report and gate handoff recommendation.
Gate handoff (LOW freedom):
On completion, emit the three-line handoff per the protocols/decision.md
Gate Handoff section. The one-line outcome reflects the aggregate gate
verdict (e.g., "all gates PASS", "2 WARN, 0 BLOCK", "gate-spec FAIL").
Detail lives in the per-gate evidence files under {workDir}/evidence/.
Write {repoStateRoot}/work/{selectedWork.id}/units/{selectedWork.unitId}/stage-report.md
before the handoff, and point the Artifacts line at
Artifacts: {repoStateRoot}/work/{selectedWork.id}/units/{selectedWork.unitId}/stage-report.md.
The Next: line points to /sw-build for ordinary implementation BLOCKs, to
/sw-verify after a freshness-only pre-gate stop, or to /sw-ship on PASS or
WARN. Example: Next: /sw-ship.
State updates (LOW freedom):
Follow protocols/state.md. Mutate only the selected work's workflow.json
and the current worktree session. Set status to verifying at start. Update
the selected work's gates section after each gate completes. Do NOT set
shipped.
protocols/stage-boundary.md -- stage boundaryprotocols/decision.md -- autonomous decision framework and gate handoffprotocols/state.md -- workflow stateprotocols/git-freshness.md -- pre-gate freshness checkpointprotocols/git-reconcile.md -- lifecycle-owned branch reconcileprotocols/approvals.md -- approval lineage validationprotocols/review-packet.md -- packet synthesisprotocols/evidence.md -- evidence storageprotocols/evidence.md#verdict-rendering -- verdict renderingprotocols/headless.md -- headless defaultsprotocols/context.md -- config and anchor docs| Condition | Action |
|-----------|--------|
| No active work unit | STOP: "Run /sw-design, /sw-plan, and /sw-build first." |
| Selected work owned by another live top-level worktree | STOP with explicit /sw-adopt guidance |
| Verify freshness reconcile under branch-head require + rebase or merge fails | STOP with the reconcile failure and rerun /sw-verify after fixing the blocked worktree state. |
| Verify freshness checkpoint is blocked under branch-head require + manual | STOP with manual reconcile guidance and rerun /sw-verify, not /sw-build. |
| No gates enabled / all skipped | WARN, proceed to ready-to-ship |
| Gate skill file not found | ERROR for that gate, continue remaining |
| Compaction during verification | Read the selected work's workflow.json, resume from next gate without fresh results |
testing
Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency.
tools
Syncs the local repository by fetching all remotes, updating the base branch, and removing stale local branches that are not protected by live sessions or helper worktrees.
data-ai
Shows current Specwright state for this worktree, the attached work, repo-wide active works, gate results, and lock status. Supports --reset, --cleanup, and --repair {unitId}.
tools
Ships the current work unit. Verifies all gates passed, creates a PR with evidence-mapped body, updates workflow state to shipped.