/zsl:verify-coveragefrom zsl
Verify every PRD user story is covered by a passing, non-vacuous behavioral test — Tier A maps to an existing test; Tier B generates one, mutation-proves it, and runs it. Auto-files gaps as new sub-issues and writes a coverage receipt. Used as `/tdd-parallel`'s step-4b subroutine in `--auto` mode (the common path), or invoked directly against any PRD whose slices have shipped.
Ships in zsl. 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.
None: SKILL.md is the whole skill.
/to-issues slices a PRD into issues and /tdd builds them, but the
only post-implementation completeness signal is structural: the tracker
auto-closes the parent when every child closes. "All slices shipped" is
not "all user stories covered" — those come apart exactly when slicing
drops or misframes a story.
This skill closes that loop. It uses the PRD's ## User Stories section
as an acceptance oracle (not as implementation context — /tdd
deliberately never sees it) and answers, per story, is there a passing
behavioral test that proves this is built? It does not trust
prose-vs-prose or code-search judgement — a story is covered only when an
executable, non-vacuous test says so.
It is also the termination oracle for /tdd-parallel's auto-loop:
the loop iterates fanout → integration review → verify-coverage until
this skill returns zero gaps (or a circuit breaker fires). Without it,
/tdd-parallel has no semantic completeness signal — only the
structural "all slices merged" one, which is exactly the signal that's
insufficient.
This is a verification primitive, almost always chained by an
orchestrator (/tdd-parallel step 4b, in --auto mode). Direct user
invocation is supported for two cases:
Three human gates that earlier versions of this skill held — story classification, HITL human-attestation, and a matrix-confirmation review — have all moved upstream:
/to-prd: every story carries
one or more AC<n>: acceptance-criteria sub-bullets written at
PRD-authoring time. This skill reads them instead of judging./to-prd time — they don't enter this pipeline.--auto mode. Auto-filed gap
issues land as ready-for-agent so /tdd-parallel can fanout the
remediation directly; the human review surface moves to /triage
(which is where false-positive gaps get caught, no different from any
other triage-able backlog item).What remains is the load-bearing core: Tier A finds an existing passing test; Tier B generates one, mutation-proves it non-vacuous, runs it; gaps get filed and quarantined; a receipt is written.
/zsl:verify-coverage <parent-prd-issue> # default mode
/zsl:verify-coverage <parent-prd-issue> --auto # for orchestrator chaining
/zsl:verify-coverage # no arg → picker of tracking PRDs
Flags:
--auto — orchestrator mode. Skips the matrix-confirmation step (no
user prompt before filing), files gap issues as ready-for-agent
directly (no needs-triage hop), and emits a structured terminal
block the orchestrator parses. Use this when /tdd-parallel chains
the skill; direct user invocations should usually omit it.--no-file — produce the matrix and quarantined failing tests, but
do not auto-file gap issues. Report-only. Still a full run —
writes a gate-satisfying receipt (verification happened; you chose
not to file). No effect on deferred: deferred stories are never
filed in any mode (there's nothing to fix yet), so the deferred
count is identical with or without --no-file.--no-generate — Tier A only. Stories without an existing passing
test are reported as unverified rather than driven through Tier B.
Fast pass for a quick read; no tests are written. Writes a partial
receipt; does not satisfy /tdd-parallel's auto-loop termination
— unverified rows mean those stories weren't actually checked.
Deferral is computed from tracker state before Tier A, so a story
claimed only by open slices is classified deferred, not
unverified, even under --no-generate (deferral takes precedence —
it's a known not-yet, not an unchecked unknown).Refuse with a clear message if any fails:
docs/agents/issue-tracker.md exists (run /setup-zsl-superpowers
if not). docs/agents/triage-labels.md exists.## User Stories
section. No argument → present a numbered picker of issues in the
tracking state. If the resolved issue has no ## User Stories
section it is not a PRD — refuse and say so.AC<n>: acceptance-criterion
sub-bullet. Any story carrying no AC<n>: criterion is invalid —
the PRD must be reworked in /to-prd or split. Refuse with the
offending story numbers and a pointer to /to-prd's story format.
Back-compat: a legacy observable: sub-bullet (PRDs authored
before the AC split) counts as a single acceptance criterion — accept
it in place of an AC<n>: bullet; a legacy acceptance: tag, if
present, is ignored./tdd-parallel run, or wherever the
shipped slices live). Refuse if dirty (git status --porcelain
non-empty) — Tier B writes and runs tests, and a dirty tree makes
the non-vacuity mutation unsafe to revert cleanly.Use the project domain glossary so story vocabulary maps onto the
codebase's and test suite's vocabulary; respect ADRs in the touched
area. See engineering/tdd/tests.md for what a behavioural test is and
engineering/tdd/mocking.md for what disqualifies one.
Parse the PRD's ## User Stories into a numbered list, verbatim. For
each story, capture its AC<n>: acceptance criteria (or, on a legacy
PRD, its single observable: line treated as one criterion) — Tier B
uses them as the test-generation hint. Parse ## Out of Scope: any story (or
behaviour) that ## Out of Scope excludes is marked out-of-scope now
and never verified — record the PRD line that excludes it as the
evidence.
The pre-flight already validated that every story carries at least one
AC<n>: criterion, so there is no classification step at runtime —
every in-scope story goes through Tier A then Tier B.
Fetch the PRD's sub-issues per docs/agents/issue-tracker.md. Read the
## User stories covered section of both shipped and open slices —
the mapping /to-issues persists into each issue body. For each
shipped (closed/done) slice, invert it into story → [shipped slices]. For each open (not-shipped) slice, invert it into
story → [open slices] separately — this is what tells deferred apart
from a real gap.
None — enabling/infrastructure slice
contributes no story coverage; that is expected, not a gap./to-issues persisted this section won't have
it. Fall back to inferring the map from each slice's ## What to build + (for shipped slices) its merged diff, and warn that the
map is inferred and lower-confidence for those slices. Apply the same
inference to open slices so the shipped-vs-open split still holds.[HITL] and
/tdd-parallel deferred it to a partial run). Record the blocking
open slice ref as evidence. Deferred stories are not driven
through Tier B and not filed as gaps (see steps 4–7).This deferral derivation is always on — it's a function of tracker state (shipped vs open slices), not a flag. When every slice is shipped, no story is deferred and the run is identical to before.
Set aside the deferred stories from step 2 (claimed only by still-open
slices) and the out-of-scope stories — neither is verified this run. A
deferred story has no shipped code to test yet; driving it through Tier A
would always miss and Tier B would manufacture a spurious gap. The
remaining in-scope, not-deferred stories go through Tier A then Tier B.
For each such story, search the test suite for the behavioural
test(s) that exercise it (the story → slice map narrows where to look;
the glossary aligns naming; the story's AC<n>: criteria name the
behaviour). A story is covered only when:
tests.md rules apply).Run the mapped tests (scope to the relevant suite/files; a full run is fine if cheap). Record the passing test's path + name as the evidence. Anything not satisfied here falls through to Tier B.
Skip this step entirely under --no-generate (such stories →
unverified).
For each story Tier A did not satisfy:
AC<n>:
lines are the contract — turn each into an assertion against the
public interface (one test may cover several closely-related
criteria, or one test per criterion where they're independent).
Behaviour, not implementation — it must read like the story
(tdd/SKILL.md philosophy).AC<n>: line — it should pin the behaviour precisely).Work one story at a time — write its test(s), prove each non-vacuous,
run them, move on; never batch-write Tier B tests across stories (same
anti-horizontal-slicing reason as tdd/SKILL.md).
Render one row per story:
| State | Meaning | Evidence |
|---|---|---|
covered | Tier A or Tier B GREEN | test path+name |
gap | Tier B RED, or no claiming slice at all (real hole) | failing test path / "no claiming slice" |
deferred | claimed only by still-open slice(s); none shipped yet | the blocking open slice ref |
unverified | --no-generate, no existing test | — |
out-of-scope | excluded by PRD ## Out of Scope | the excluding PRD line |
deferred is distinct from both gap (a hole to fix now) and
out-of-scope (a permanent exclusion): it's a temporary not-yet —
the covering slice is open and will land on a later /tdd-parallel run.
Deferred stories never become gaps and are never filed.
Print aggregate counts.
Default mode (no --auto): before filing anything, confirm with
the user — this matrix is a review surface. The user can override any
row (e.g. accept a gap as out-of-scope, or reclassify).
--auto mode: skip the confirmation; proceed directly to step 6.
The human review surface moves downstream to /triage (for filed gap
issues) — if Tier B misjudged an acceptance criterion and filed a bogus gap, the
triage step is where it's caught and dropped.
A red test cannot land on a green suite. For each gap with a failing
test, quarantine it with the project's skip/xfail marker (infer from
the test framework — @pytest.mark.skip, it.skip, t.Skip,
xit, …), and put the gap issue reference in the skip reason:
skip("gap: PRD story <N> — see <issue-ref>; un-skip when implemented")
Commit the quarantined tests via /commit (never craft commits
yourself). This makes every gap traceable from the suite itself, and
the remediation slice's acceptance criterion becomes literally
"un-skip this test and make it green." Under --no-file there is no
issue ref yet — use gap: PRD story <N> — unfiled and tell the user.
Skip under --no-file. For each gap (Tier B RED), publish one issue
per docs/agents/issue-tracker.md:
Title: Cover PRD story <N>: <short description>. Do not
pre-assign an [AFK]/wave-number prefix — these are un-sliced work
items, not slices. If the auto-loop later re-sliced them, that
prefix would conflict.
Body (issue template below).
Labels:
needs-triage + backlog (same convention
/to-issues uses) so each enters normal triage.--auto mode: ready-for-agent + backlog. The acceptance
criterion is fully specified (the quarantined test is the
contract), the work is definitionally AFK (manual stories were
refused at PRD ingestion), and the orchestrator is about to
fanout these issues in its next loop iteration — going through
/triage first would just stall the loop. Quality risk (a
false-positive gap getting auto-fixed) is bounded: the
remediation slice will write code to make the (potentially
wrong) test green; a subsequent verify-coverage round will either
declare the story covered or surface the inconsistency. The
circuit breakers in /tdd-parallel cap the worst case.Link as a sub-issue of the PRD using the same mechanism
/to-issues uses, so the PRD stays the tracking container and does
not spuriously auto-close while gaps are open:
PARENT_ID=$(gh api graphql -f query='query{repository(owner:"OWNER",name:"REPO"){issue(number:PARENT){id}}}' -q .data.repository.issue.id)
CHILD_ID=$(gh api graphql -f query='query{repository(owner:"OWNER",name:"REPO"){issue(number:CHILD){id}}}' -q .data.repository.issue.id)
gh api graphql -f query='mutation($p:ID!,$c:ID!){addSubIssue(input:{issueId:$p,subIssueId:$c}){subIssue{number}}}' -f p="$PARENT_ID" -f c="$CHILD_ID"
Linear: set parentId. GitLab / local-markdown / unsupported: the
## Parent text reference is the only link.
A reference to the PRD issue on the issue tracker.
The PRD user story this gap leaves uncovered, quoted verbatim
(including its AC<n>: acceptance criteria), plus a one-line
statement of the observed gap (Tier B test RED against
the integrated branch).
<path::name> is un-skipped and passesNone - can start immediately
If docs/agents/project-board.md exists, newly filed issues are
auto-added to the project by the user's existing workflow; do not
move the PRD's own card (it remains a tracking container).
This is the artifact /tdd-parallel's auto-loop consumes — write it
on every completed run (including --no-file and --no-generate),
after the matrix is computed and any filing/disposition is done.
Capture git rev-parse HEAD as the verified-sha — the receipt
asserts "coverage was checked against this tree." Write the receipt
per docs/agents/issue-tracker.md conventions:
## Coverage receipt — verify-coverage so the
orchestrator can find the latest one..scratch/<NNN>-<feature-slug>/verify-coverage-receipt.md and
include it in the same commit as the quarantined tests.Receipt body (stable fields the orchestrator parses):
## Coverage receipt — verify-coverage
- prd: <PRD ref>
- branch: <branch name>
- verified-sha: <full git sha>
- mode: full | partial (--no-generate)
- invocation: auto | manual
- matrix: covered=<n> gap=<n> deferred=<n> unverified=<n> out-of-scope=<n>
- deferred-stories: <story N → blocking open slice ref, … | none>
- gaps-filed: <#a, #b | none (--no-file) | none (no gaps)>
- ts: <ISO-8601 UTC>
mode: partial (a --no-generate run) is recorded honestly and will
not terminate /tdd-parallel's auto-loop — the orchestrator wants
every story actually exercised, not skipped as unverified.
invocation records whether this run was chained by an orchestrator
(auto) or invoked directly by a human (manual) — useful for audit
("when did this story start failing?").
Print the structured terminal block the orchestrator parses:
verify-coverage: matrix covered=<n> gap=<n> deferred=<n> unverified=<n> out-of-scope=<n>
gaps-filed: <#a, #b | none>
deferred-stories: <story N → open slice ref, … | none>
quarantined-tests-commit: <sha | none>
receipt: <comment URL or file path>
verified-sha: <full git sha>
/tdd-parallel's step 4b reads deferred=<n> here: gap=0 deferred>0
is its partial-complete signal (proceed to the [partial] PR, don't
loop), while gap>0 still drives the auto-fix loop. The two counts are
independent — a run can report both (some stories have a real gap to fix
now, others are deferred behind an open [HITL]).
Plus, for direct invocation (no --auto), a one-line next-step hint:
Filed N gap issues as sub-issues of #PRD. Run
/triageto walk them toready-for-agent, then/tdd-parallel <PRD>to clear them — the remediation slices un-skip the quarantined tests.
Under --auto, omit the hint — the orchestrator is the next step.
Do not chain — this skill ends here.
/tdd / /tdd-parallel./triage /
/to-issues. (In --auto mode, the orchestrator fanouts them
directly without a triage hop because the gap is fully specified by
its quarantined test.)## User Stories
section, or whose stories lack an AC<n>: acceptance criterion —
refuse in pre-flight.covered on prose or
code-search judgement alone — only a passing, non-vacuous
behavioural test (Tier A/B).--auto. In default mode, ends in user confirmation. In --auto,
the human review surface moves to /triage (for filed gaps);
/tdd-parallel's circuit breakers (round limit, per-story retry
limit, no-progress halt) cap the worst case of a misjudged
acceptance criterion looping.Do not hand-edit content between the BEGIN/END markers — scripts/sync_book_rules.py overwrites it from vendor/agent-rules-books/.
Use when changing code that is expensive to change safely because behavior is unclear, tests are weak or missing, dependencies are hidden, or runtime/framework setup blocks local feedback.
Gain control before improving design. Understand current behavior, protect what must stay, create the smallest useful seam, break the dependency that blocks feedback, make the requested change, then leave the area more testable.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zunosmartlabs/zsl-superpowers --plugin zsl32 skills in this plugin
/afk-fanoutInteractive local-session scheduler for overnight remote /tdd-parallel runs. Reviews the queue of tracking PRDs with ready-for-agent children, lets the human pick which to run overnight and in what order, then schedules one one-shot remote routine per selected PRD spaced a fixed 2h apart — each fires its own remote claude.ai session running /afk-worker against one PRD. The 2h spacing is a deliberate throttle to stay under the per-5h-window token cap. Places a light scheduled claim on each PRD so a re-run the same evening won't double-book. Morning you walks the results via /morning-review./afk-workerRemote per-PRD executor fired by an /afk-fanout-scheduled one-shot routine. Runs unattended in its own remote claude.ai session — own clone, own working tree, own branch — so it never contends with other PRDs' workers. Flips the PRD's scheduled claim to in-progress, runs /tdd-parallel <num> --on-review-failure=continue --max 2, opens one integration PR, and on halt records the offending slice + RCA. Reports its outcome (claim state, PR URL or halt RCA) as a per-PRD entry on the shared afk-runs git branch that /morning-review reconciles back into the tracker, and fires a best-effort Telegram heads-up. Invoked by the scheduled routine, not by hand.Other plugins' skills for the same job
/ask-zslInteractive router that helps you find the right ZSL skill for what you're doing right now, without leaving your work. Use when you're mid-session and unsure which skill fits — "which ZSL skill should I use", "how do I do X with these skills", or when you want to be routed to the right part of the loop.