skills/woostack-tdd/SKILL.md
woostack's canonical test-driven-development home and on-demand test-adder. The single source for the TDD kernel — Red→Green→Refactor, test-first, cover happy/error/edge/success+failure, framework-aware, no-runner→concrete verification — that woostack-plan, woostack-execute, woostack-debug, and bootstrap patterns.md §7 should link to instead of restating. Also the 14th public command: /woostack-tdd <target> adds appropriate tests to an existing code block, PR, spec, or plan — one verb, target-routed (code→colocated *.test files, PR→tests for the gh pr diff surface, spec→strengthen §7 acceptance criteria, plan→fill failing-test steps) — with a characterization carve-out for existing code (new code is red-first; existing code pins current behavior). Writes tests to the working tree and hands to woostack-commit; never commits, merges, or authors status:/branch:; owns no approval gate.
npx skillsauth add howarewoo/woo-stack woostack-tddInstall 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.
Two roles in one skill. (1) The canonical TDD doctrine home — the kernel below is stated
once here and linked, never restated, by woostack-plan,
woostack-execute, woostack-debug,
and bootstrap patterns.md §7, honoring the repo's
"cross-link, do not duplicate" rule. (2) The 14th public command — /woostack-tdd <target>
adds the appropriate tests to an existing block of code, a PR, a spec, or a plan. It writes tests
to the working tree and hands to woostack-commit; it never commits,
merges, or touches a spec's status:/branch:, and owns no approval gate.
The canonical test-driven-development discipline for all of woostack. Other skills link this section; they do not restate it.
Red → Green → Refactor. For code woostack is authoring, the test comes first:
Coverage classes. Appropriate tests span, per behavior: the happy path, every error path, edge/boundary conditions, and both success and failure outcomes — exactly what a spec's §7 Acceptance-criteria slots enumerate.
No-runner substitution. In a target with no test runner (a docs/skills repo), "the failing
test" becomes a concrete verification command — a grep, a bash -n, a link check, or an
existing script's test — with exact expected output. Never a vague "verify it works."
Framework-aware. Follow the project's runner and file conventions — Vitest everywhere except
React Native (Jest via jest-expo), Playwright for E2E, tests colocated as *.test.ts(x) or in
__tests__/. The project-specific standard lives in
patterns.md §7.
Clarify before writing when inputs, outputs, error contracts, or integration points are unclear — don't guess them.
/woostack-tdd <target> — add appropriate testsOne verb — add the appropriate tests — applied to whatever the argument resolves to. Auto-detect the target by argument shape:
| Target | Detected by | What it produces |
|---|---|---|
| code | a source path, or pasted code | colocated *.test.ts(x) per the project runner; characterization tests for existing code (see the carve-out) |
| PR | a PR number or URL | tests covering the diff surface only — read it with gh pr diff <n> (read-only inspection; git diff <base>...HEAD for a local branch) |
| spec | a path under .woostack/specs/ | strengthen the testable §7 Acceptance criteria in place (happy/error/edge per behavior) |
| plan | a path under .woostack/plans/ | fill each task's failing-test-first step with the actual test and exact expected output |
| (none) | no argument | ask what to test; never guess (mirrors woostack-debug) |
Apply the kernel to whichever target: real tests for code/PR, the artifact's test-equivalent for spec/plan. In a no-runner target, substitute the concrete verification command per the kernel. If the argument is ambiguous, ask — don't guess the target type.
Recall testing gotcha/pattern notes for the target's working set before adding tests; distill
at most one durable testing pattern at the end through the reject-by-default gate. The note
schema, recall procedure, and distill gate are defined once in
memory.md — link, never restate.
woostack-execute/woostack-harden). For a
spec/plan edit, show the before/after diff; do not block.status:/branch:. Spec/plan enrichment is content-only; never author a phase
transition or fork a second plan. The spec : plan : PRs = 1 : 1 : N invariant — defined in
conventions.md — is untouched. When the target's
status: is ≥ planning (a plan already exists), surface that the plan may need re-derivation;
still edit content only.woostack-execute and woostack-debug write their tests inline and
link this kernel for the "how"; they do not invoke this skill at runtime.pattern per run; never
feature-specific trivia.testing
Use to curate the .woostack/ knowledge store. Reflects over the static memory store + docs (no session mining), then proposes a gated changeset that merges duplicate notes, replaces stale/contradicted ones, drops dead/orphaned notes, resolves conflicts, surfaces consolidated insights, and recommends evidence-guarded documentation edits. Nothing mutates before explicit approval; ends on a summary + iterate loop. Local-only memory (no commit); doc edits land in the working tree. Never commits or merges. Invoke via /woostack-dream [instructions].
development
Use to resolve small technical issues (bugs, hotfixes, refactors) through a unified execution loop — diagnose root cause with woostack-debug, author a fix plan under .woostack/fixes/, harden, get explicit user approval, then delegate execution to woostack-execute (TDD per task, task review, commit via woostack-commit, distill).
development
Use to execute an approved woostack plan UNATTENDED overnight — one autonomous run with no user input after launch that drives every increment to a reviewed stack, swapping woostack-execute's stop-and-ask gates for resolve-or-log-and-continue (woostack-debug on stuck verifications; bounded auto-address on a blocking review; halt-the-track on anything unsafe or ambiguous), honoring optional `## Track:` grouping in the plan (independent, fault-isolated tracks run sequentially), and writing a morning report under .woostack/overnight/ for a human to test in the morning. It is the third choice at woostack-build's execution-handoff gate (Go / Hand off / Run overnight); also usable standalone via /woostack-execute-overnight <plan-path> [--inline|--subagent]. One plan per spec, multiple PRs per plan. Never merges; never relaxes safety for autonomy.
testing
Use to show the derived woostack feature board — for every spec in .woostack/specs/ and fix in .woostack/fixes/, its reconciled phase, plan progress, increment-PR state, owner, age, and the single next action, plus flags for any drift between the authored status field and the artifacts on disk. Read-only; never fetches, commits, or pushes. Use for /woostack-status, "what's in flight", or "what should I do next".