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
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- speckit-tdd-plan
- metadata
- { "author": "github-spec-kit", "source": "tdd:commands/speckit.tdd.plan.md" }
- description
- 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
- compatibility
- Requires spec-kit project structure with .specify/ directory
03 SKILL.md 正文
TDD Plan (zfa-delegating)
Turn this feature's specification into a test list. When this project is
zuraffa-wired, derivation is deterministic — dispatch to zfa tdd plan.
The LLM never re-derives what zfa already derives.
User Input
$ARGUMENTS
Step 0 — Engine detection
Check whether zfa can drive this project:
zfa --version 2>/dev/null && test -f .zfa.json && echo "ZFA_OK" || echo "ZFA_MISSING"
ZFA_OK→ Step 1 (deterministic dispatch)ZFA_MISSING→ this project is not zuraffa-wired; fall back to the LLM-guided derivation in "Fallback Path" below.
Step 1 — Resolve the feature
Follow the standard feature resolution:
- Feature directory from input argument, or
.specify/feature.json→feature_directory, orcheck-prerequisites.sh --json --paths-only
Set FEATURE_SLUG to the resolved directory name (e.g. 003-user-auth).
Write it to .specify/feature.json if not already pinned.
Step 2 — Dispatch to zfa
zfa tdd plan "$FEATURE_SLUG" 2>&1
Interpret the exit code:
| Exit | Meaning | Action |
|---|---|---|
| 0 | Plan written | Read the emitted test-list, report counts, proceed to tasks.md sync (Step 3) |
| 1 | Derivation stopped honestly (gap found) | Report the gap verbatim; do NOT paper over it |
| 2 | Grammar/parse error in the spec | Report the offending line; suggest spec fix |
| 3 | Template version drift | Report the fix line; suggest extension install/upgrade |
| other | Runner error | Report verbatim; do not retry blindly |
Step 3 — Sync tasks.md
After zfa emits the test list, update tasks.md so every behavior has its
test task before its implementation task, and mark test tasks mandatory.
This is bookkeeping around zfa's output — the LLM does this part:
- Read
FEATURE_DIR/tdd/test-list.md(zfa's output). - For each PENDING behavior, ensure a task exists in
tasks.mdwith a[behavior: <id>]marker; insert before the corresponding implementation task if missing. - Mark behavior tasks as mandatory (never skippable).
- Preserve existing task ids, checkbox states, and format.
Step 4 — Report
Report: test-list path, acceptance/unit/widget behavior counts, how many trace to FRs vs ACs, tasks inserted/reordered in tasks.md, and any zfa verdict worth the user's attention.
Fallback Path (LLM-guided, non-zuraffa projects only)
When zfa is unavailable, derive the test list yourself following the
original LLM-guided workflow: read spec.md and plan.md, extract acceptance
criteria as outer-loop behaviors and functional requirements as inner-loop
unit behaviors, trace each to its criterion, write
FEATURE_DIR/tdd/test-list.md, seed FEATURE_DIR/tdd/cycle-log.md with a
baseline entry, and reorder tasks.md as in Step 3.
Never use the fallback when zfa is available — deterministic derivation is the contract.
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-spec-stats-runs
On-demand execution — reads verified suite command from .specify/memory/tdd-profile.md, runs it for selected specs (--all, spec id/slug, or default active feature), captures pass/fail + duration + tail, appends run record to .specify/stats/runs.json, refreshes dashboard health column
speckit-spec-stats-report
Main generator — scans all specs/*/, derives per-feature stage, task progress, health, last updated; when the TDD extension is installed, adds a deep TDD table (acceptance/unit/characterization counts, DONE, loop mode, tasks.md state); renders dashboard to configurable output path and writes .specify/stats/stats.json snapshot
speckit-spec-stats-reconcile
Reconcile tasks.md checkboxes against actual implementation — cross-references TDD test-list.md DONE behaviors and file existence to mark tasks that were implemented but never checked