/specflow:specflow-auditfrom specflow
Audits a Specflow story/ticket for spec-compliance and adds missing executable contract sections (SQL/RLS, TypeScript interfaces, Gherkin, acceptance criteria, DoD, data-testid) with a pre-flight gate that blocks while critical/P1 findings remain.
Ships in specflow. 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.
When loaded as a native Claude plugin, framework assets are at ${CLAUDE_PLUGIN_ROOT} and project state is at ${CLAUDE_PROJECT_DIR}. Resolve framework node scripts/... examples at that installed root, with quoted paths; do not require PATH specflow or copied project scripts. Use this skill's shipped references at ${CLAUDE_PLUGIN_ROOT}/skills/specflow-audit/references before any user-scope fallback. Outside native plugin loading, preserve the existing npm/Codex context and fallback rules below. Host identity and approved model routing remain authoritative; Recommended Model prose is advisory and grants no override. This path context grants no acceptance or release permission.
Read SPECIFICATION.md (source kit: templates/SPECIFICATION.md). Before
using the detailed procedure below, run
node scripts/specflow-tier.cjs inspect <record.json> specflow-audit inspect.
Stop on exit 2 and report the returned blocker. Production work repeats the
check with resume at re-entry and finish before claiming completion.
A missing record cannot prove readiness; retrieve the current issue and scoped
evidence. Labels alone never grant build-ready status.
The detailed artifact/pre-flight requirements below apply to the selected build-ready slice and its relevant seams. Thin work reports planning state and the next justified decision without generating full schemas, fixture packages or simulations. Contracted work reviews applicable irreversible decisions and includes a paper persona walkthrough for UI flows. Reuse shared decisions; leave future siblings thin. Required privacy, permission, execution and release gates remain in force. Reconcile contradictory custom legacy instructions explicitly using the shared policy; do not claim they passed.
Take a partially-compliant Specflow story (some sections present, others missing) and bring it to compliance through a fixed three-phase process. The quality comes from the process, not improvisation — never freelance the uplift inline.
Trigger on: "make specflow compliant", "specflow audit", "uplift this story / ticket", "run specflow auditor", "is this story compliant", or /specflow-audit <file-or-issue>.
Do NOT trigger on generic "make this PR/code compliant" that has nothing to do with Specflow specs.
The target is a story/ticket — a GitHub issue body, a docs/specs/*.md file, or pasted spec text. Not source code.
Run these three phases in order. Do not skip phase 3.
Read the target and diff it against the full Specflow template. Produce an explicit list of which sections are PRESENT and which are MISSING. The template sections are in references/uplift-process.md. Identify the ticket type (feature / bug / journey) — bug tickets legitimately N/A some sections; record the justification.
Add only the missing sections — never rewrite or duplicate existing content. Generate executable artifacts, not prose:
CREATE TABLE / CREATE FUNCTION / RLS CREATE POLICY (use the join-through RLS pattern for tables without a direct org/owner column).I-<DOMAIN>-NNN codes; reuse existing codes, take the next free number for new ones — never invent a code that already exists.data-testid coverage.Section templates and the RLS/invariant patterns are in references/uplift-process.md. Post the additions as one clearly-labelled uplift comment (GitHub) or appended block (file) — supplementing, not replacing.
After uplift, simulate the combined ticket and assign findings a severity: CRITICAL / P1 / P2. The severity model and the ## Pre-flight Findings section format are in references/preflight-gate.md.
The gate: a ticket is compliant ONLY when pre-flight returns no CRITICAL and no P1.
## Pre-flight Findings section with the appropriate simulation_status and mark compliant.Uplift does not grandfather prior failures. The auditor (this skill) never declares compliance on its own — pre-flight findings decide it.
For a UI story, the executable Playwright journey IS the Definition of Done — not a side artifact. A story is not done because the code exists; it is done when a journey walks the user's steps and asserts the intended outcome was reached.
A compliant UI journey must have:
data-testid / visible text / URL.J-<NAME> id, encoding those steps and assertions.The audit therefore treats, for a UI story, as CRITICAL (blocks compliance):
J-id, orThis is the single most common real-world failure ("journeys missing or not executed"); the gate exists to stop it.
gh issue view <n> --json title,body,comments, or the file).<specflow-repo>/agents/{board-auditor,specflow-uplifter,pre-flight-simulator,specflow-writer}.md and CONTRACT-SCHEMA.md, SPEC-FORMAT.md, USER-JOURNEY-CONTRACTS.md. Find the repo: it is the dir containing CONTRACT-SCHEMA.md (commonly tooling/Specflow/ or a Specflow/ subdir). If absent, the condensed references/ files here are sufficient.references/uplift-process.md, but always perform Phase 3 yourself.node scripts/specflow-publication.cjs <request.json>), not just chat.references/uplift-process.md — template sections, the surgical-additions templates (SQL/RLS/TS/invariants/Gherkin/AC/DoD/testid), and the RLS join-through + invariant-domain patterns.references/preflight-gate.md — CRITICAL/P1/P2 severity model, the compliance gate rule, and the ## Pre-flight Findings section format.Scoped grading uses the shared specflow-reviews.cjs issue/tier ledger through Duo preparation (specification.targetTier). Continue while first-time verified evidence advances. Two no-progress reviews or three invalid responses require diagnosis. Further materially different recoveries need fresh stable executed observations not already used in the episode; a fixed recovery count does not end subscription work. Repeated facts, renamed notes or missing evidence retain their concrete diagnostic blocker. Do not reset history via host/run names. An ungraded fix remains ungraded until an independent current regrade passes. See duo-build for recover-review and optional execution checkpoints.
Publication: save the sanitized proposed comment in bodyFile, then write a request JSON with repo, issue, bodyFile, and all linkedFiles. Run node scripts/specflow-publication.cjs <request.json> and stop on non-zero exit. It requires the project mechanical scanner and private-baseline canary where applicable. Never publish private sources or raw provider records. Preserve concurrent issue-body edits: publish proposals instead of replacing a fetched body.
For the selected slice, preserve create/refine → specflow-simulate →
specflow-audit → pre-flight gate. Apply the shared tier policy: thin backlog
capture does not demand the full build-ready ceremony. Loop selection remains
with specflow-loop-selector; audit never becomes a second router.
Story/ticket compliance is distinct from feature-build readiness and release
readiness. A passing audit does not grant either. For an existing spec-build or
feature-build run, inspect its canonical run contract and specflow run status --contract <run-contract.yaml>, then continue its required rails. Do not create
an alternate run or advance a gate from an audit comment.
Fresh simulation must cover current ticket scope, contracts and referenced issue
bodies/artifacts. Any covered ticket, contract or referenced-issue-body change
after simulated_at makes the status stale and blocks feature-build until
re-simulation, audit and pre-flight pass. Compare actual covered scope as well as
its recorded update times; an ordinary comment/updatedAt change alone is not a
covered scope change. Matching timestamps never prove unchanged content.
The existing scripts/specflow-runner.cjs isSimulationFresh check compares
local input mtimes with the simulation file mtime when simulationPath is
configured. It is not a complete content-hash binding for simulation; an
unconfigured check is not freshness evidence. The agent must additionally compare
recorded canonical scope/content hashes with current inputs, using the existing
specflow-tier.cjs issueHash/referenceErrors helpers and the current-source
checks in specflow-specification.cjs. Those helpers do not automatically bind
all simulation inputs. Record the covered input hashes with the walkthrough and
check their presence/current contents explicitly. Missing/unavailable bindings
block; do not infer freshness from a timestamp or an old passing status.
After code, feature-build requires actual source-provenance and independent correctness evidence for value-bearing calculations: no hard-coded literals, fake mocks or made-up API inputs without cited real source/oracle evidence. Provenance alone is not correctness. Preserve applicable Gate C replay/rollback/ pgTAP and CI migration-replay, plus Gate D outcome acceptance; UI/server-state journeys must run against their real seeded backend. A compliant ticket, green unit test or model verdict does not replace these gates. Use their existing run-contract paths; this skill implements no new verifier.
The installer refreshes this canonical skill and references into project-local
.claude/skills, .codex/skills and .agents/skills. In Codex the installed skill
is the prompt equivalent; any legacy user /specflow-audit prompt must point to
these current references. Do not overwrite unrelated global prompts or custom
permissions. Installed native plugins resolve references from their plugin root.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/duo-buildBuild an issue or feature interactively toward an indexed shared goal, with automatic read-only peer review; resume the same run across Claude Code and Codex./specflow-loop-selectorChoose the lightest Specflow workflow that covers an ask’s size, uncertainty and risk, then select a loop only when needed. Use for work triage, proportionate verification, loop selection, or explicit spec-build, feature-build and Gate D requests. A lightweight decision does not start a loop./specflow-simulateSimulates end-to-end usage of a Specflow story across multiple personas and divergent routes to discover gaps, edge cases, and unhandled branches BEFORE the story is built — then proposes each finding as a concrete story addition (new REQ, negative-path AC, Gherkin branch, or journey step). This is the high-value exploratory step run right after a story is created, distinct from the pre-flight compliance gate. This skill should be used when the user asks to "simulate this story", "simulate usage end to end", "find gaps and edges", "run personas through this", "stress-test this story", or invokes /specflow-simulate on a story file or GitHub issue. Scope is Specflow story exploration — it is generative (surfaces and proposes), not a build or a verification gate.Generated from the plugin's indexed repository (hulupeep/specflow) — no native marketplace selected
npx claudepluginhub p/hulupeep-specflowOther plugins' skills for the same job