speckit-bug-test
Validate that a previously fixed bug is resolved and record the verification report
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- speckit-bug-test
- metadata
- { "author": "github-spec-kit", "source": "bug:commands/speckit.bug.test.md" }
- description
- Validate that a previously fixed bug is resolved and record the verification report
- compatibility
- Requires spec-kit project structure with .specify/ directory
03 SKILL.md 正文
Test Bug Fix
Validate that the fix recorded by /speckit-bug-fix actually resolves the bug described by /speckit-bug-assess. The output is a verification report at .specify/bugs/<slug>/test.md.
User Input
$ARGUMENTS
The user input should identify the bug to validate. Accept any of:
slug=<bug-slug>or--slug <bug-slug>or a bare slug-like token.- A path that contains the slug (e.g.
.specify/bugs/login-timeout/). - Nothing — fall back to context (see below).
Slug Resolution
Resolve BUG_SLUG in this order, stopping at the first match:
- Explicit user input — a slug passed in
$ARGUMENTS(any of the forms above). - Conversation context — if the current session has just run
/speckit-bug-assessor/speckit-bug-fix, the slug it reported is the working slug. Reuse it without re-prompting. Confirm it by checking that.specify/bugs/<slug>/fix.mdexists; if it does not, fall through. - Single candidate on disk — list
.specify/bugs/*/fix.md. If exactly one bug has afix.md, use it. - Disambiguate:
- Interactive mode: ask the user which bug to validate and list the candidates.
- Automated mode: stop with an error listing the candidates. Do not guess.
Once resolved, set BUG_SLUG and BUG_DIR = .specify/bugs/<BUG_SLUG>, and briefly state in your reply which resolution path was used (explicit / from context / single candidate / asked).
Prerequisites
BUG_DIR/assessment.mdMUST exist.BUG_DIR/fix.mdMUST exist. If not, stop and instruct the user to run/speckit-bug-fixfirst.- If
BUG_DIR/test.mdalready exists, ask the user whether to overwrite it (interactive mode) or refuse (automated mode). - Read both
assessment.mdandfix.mdin full so you know:- The original symptom and reproduction steps (from
assessment.md). - The actual code changes and tests added (from
fix.md).
- The original symptom and reproduction steps (from
TDD mode (when tdd_enabled: true in bug-config.yml)
When tdd_enabled is true (the default), validation is driven by the TDD
extension's auditor rather than the manual check table:
- Pin the bug as the TDD feature — set
.specify/feature.jsonsofeature_directorypoints atBUG_DIR(e.g..specify/bugs/<slug>). This is wherebug.fix(TDD mode) wrotetdd/test-list.md,tdd/cycle-log.md, and the fix itself. - Audit — run
/speckit.tdd.verifyagainstBUG_DIR. It reads the TDD artifacts from cold context (test-first evidence, red-phase evidence, test smells, mutation results, acceptance-criteria coverage) and writesBUG_DIR/tdd/verification.mdwith a verdict (PASS/PASS_WITH_GAPS/FAIL/BLOCKED). - Fold the verdict into this report — in step 4, record the
tdd/verification.mdpath and map its verdict to this command's result:PASS/PASS_WITH_GAPS→verified,FAIL→failed,BLOCKED→ report and stop. The manual check table (step 2) may still be run for extra confidence but is not the source of truth in TDD mode.
Execution
-
Plan the validation
- Decide which checks prove the bug is gone:
- Re-run the reproduction steps from the assessment (or their automated equivalent).
- Run the tests added or updated in the fix.
- Run any broader regression suite that touches the changed files.
- Decide which checks prove nothing was broken:
- Existing test suites for the changed modules.
- Lint / type-check if the project uses them.
- Decide which checks prove the bug is gone:
-
Run the checks
- Execute each planned check. Capture command, exit status, and a short excerpt of relevant output (last few lines, or the failing assertion).
- If a check is destructive, network-dependent, or expensive, skip it and record it as
skippedwith a reason; do not run it without explicit user consent. - If you cannot run a check at all (missing tooling, no test framework configured), record it as
not-runwith a reason instead of fabricating a result.
-
Judge the outcome
- Mark the fix as:
- verified — all critical checks pass and the original symptom no longer reproduces.
- partial — the original symptom is gone but unrelated regressions appeared, or some checks are inconclusive.
- failed — the symptom still reproduces or the regression suite is broken by the fix.
- Do not over-claim. If reproduction was not actually performed (e.g., the bug required a production environment), say so explicitly.
- Mark the fix as:
-
Write the verification report
Write to
BUG_DIR/test.mdusing this structure:# Bug Verification: <short title> - **Slug**: <BUG_SLUG> - **Tested**: <ISO 8601 date> - **Assessment**: ./assessment.md - **Fix**: ./fix.md - **Result**: verified | partial | failed - **TDD verification**: ./tdd/verification.md (present only when validation ran in TDD mode) ## Summary <One or two sentences: does the bug reproduce, did the fix hold, were any regressions found.> ## Checks Performed | Check | Command / Action | Result | Notes | |-------|------------------|--------|-------| | Reproduction (post-fix) | <command or manual steps> | pass / fail / skipped / not-run | <short note> | | New / updated tests | `<command>` | pass / fail | <short note> | | Regression suite | `<command>` | pass / fail / skipped | <short note> | | Lint / type-check | `<command>` | pass / fail / skipped | <short note> | ## Output Excerpts <Short snippets of relevant output (e.g., final summary line of a test run, the failing assertion). Keep it tight — no full logs.> ## Residual Risks - <known limitation, environment not covered, etc.> ## Recommendation <One paragraph. Examples:> - "Close the bug — verified end-to-end." - "Hold — reproduction inconclusive; needs verification in staging." - "Reopen — symptom still reproduces; rerun `/speckit-bug-assess`." -
Report back with:
- The slug and
BUG_DIR/test.mdpath. - The result (
verified,partial,failed). - If the result is
failed, recommend re-running/speckit-bug-assesswith the new evidence captured intest.md.
- The slug and
Guardrails
- This command MUST NOT modify source code. It only runs checks and writes inside
.specify/bugs/<slug>/. - Never overwrite an existing
test.mdwithout confirmation. - Never mark a fix as
verifiedbased on tests alone if the original assessment listed a reproduction that you did not actually exercise — downgrade topartialand say so.
04 同仓库更多 Skills
speckit-tdd-verify
Audit TDD discipline by delegating to zfa tdd verify (mutation testing, evidence integrity); the LLM interprets the verdict and drives remediation
speckit-tdd-setup
Detect the test stack and write .specify/memory/tdd-profile.md; zuraffa-wired projects record zfa commands as the engine
speckit-tdd-run
Drive the red-green-refactor loop by delegating to zfa tdd run (deterministic engine); the LLM handles only honest stops — fixing genuine reds and remediation — never re-driving what zfa drives
speckit-tdd-plan
Derive the feature's test list by delegating to zfa tdd plan (deterministic engine); falls back to LLM-guided derivation only when zfa is unavailable
speckit-tdd-verify
Audit TDD discipline by delegating to zfa tdd verify (mutation testing, evidence integrity); the LLM interprets the verdict and drives remediation
speckit-tdd-setup
Detect the test stack and write .specify/memory/tdd-profile.md; zuraffa-wired projects record zfa commands as the engine