- skills/{code-review,gitea-plan,gitea-pr,reconcile-docs,tdd}/SKILL.md: fix relative skeleton link from ../../build-skill/... to ../build-skill/references/skeleton.md (CR-01)
- tests/fixtures/test_skills_behavioral_contracts.py: split multi-behavior test into 6 focused single-behavior tests (CR-02), remove unused tdd_refs (CR-03), and assert Mode B gates, one-sided BVA bounds, fenced-block non-duplication, skeleton suppression, and on-disk relative link resolution (CR-04)
4.4 KiB
4.4 KiB
name, description
| name | description |
|---|---|
| tdd | Guides test-driven development through public interface seams (Mode A: write-time Red-Green vertical slices) and standalone test-suite audit and hardening (Mode B) across Python, TypeScript, Bash, Rust, and Java. Use when the user types /tdd, asks for test-first implementation or bug reproduction, or requests hardening an existing test file, branch, or PR suite. Do not use for trivial fixes, styling, copy, declarative configuration, or read-only multi-axis diff review (code-review). |
Test-Driven Development
Use when
/tddfor Mode A (test-first implementation, red-green vertical slices, or failing bug reproduction)./tdd <test-path|branch|PR>for Mode B (active audit and hardening of existing tests against seams-and-mocking and test-quality).- Not for trivial two-line fixes, copy, styling, declarative config, or pure wiring: edit directly instead.
- Not for read-only pre-merge multi-axis diff inspection (
code-review) or live runtime/browser QA (verify-slice).
Steps
- Check applicability and select mode. Confirm the task tests observable logic at a testable boundary (skip and edit directly for trivial config/copy when
/tddwas not requested). Read project domain docs (GLOSSARY.mdor local ADRs) if present. Select Mode A when adding new behavior, reproducing a bug, or writing a new test; select Mode B when asked to audit/harden existing tests or fixcode-reviewAxis 3 findings, and follow the Mode B checklist in test-quality. - Establish the public seam. Identify the public interface where callers observe behavior without reaching into internals (see seams-and-mocking). If the seam already exists and is unambiguous, proceed directly. Pause to confirm with the human owner when introducing a new public interface, changing a production signature, or introducing test doubles.
- Write one failing tracer bullet (Red). Write a focused test at the agreed seam describing what capability or invariant holds, not how internals work (see test-quality). Derive expected values from independent spec literals, never by importing production value constants or mirroring implementation logic.
- Verify observable failure. Run the targeted test command and confirm the test fails for the expected behavioral reason, not a syntax, import, or fixture setup error.
- Write the minimal implementation (Green). Write only enough production code to make the failing test pass. Avoid speculative abstractions or untested branches.
- Cover negative, conflict, and boundary cases. Once the happy-path slice passes, run red-to-green cycles for material failure modes, two-sided/one-sided boundary edges, and deterministic async/teardown behavior per test-quality.
- Clean up and hand off. Remove duplication and clarify test names while keeping the suite green.
Your call
- New seams, signatures, and mock boundaries: approve proposed public seams, external doubles vs. real lightweight fixtures, and any Mode B production signature widening (such as adding an injected timing/clock callable) before editing production interfaces.
- Coverage depth: decide when edge-case and negative-path slices are sufficient for the risk level of the change.
Done when
- Mode A: Every targeted test was observed failing for the expected reason before passing, all tests verify public seams without tautologies, and the suite passes cleanly.
- Mode B: Every rewritten/hardened test is verified sensitive to its target invariant (observed failing under fault/boundary check before passing green) and the suite passes cleanly.
Hands off to
code-review: to inspect the resulting diff, smells, invariants, and Axis 3 test integrity (Suggested Next Step: /code-review <base>..HEAD).verify-slice: when the slice also needs live runtime, browser DOM, or multi-service verification (Suggested Next Step: /verify-slice).diagnose: when an unexpected test or fixture failure needs root-cause investigation (Suggested Next Step: /diagnose <failing-test>).git-manager: for branch isolation or committing cohesive vertical slices.- Emit one outcome-matched
Suggested Next Stepon standalone turns; suppress when delegated (per skeleton).