Tdd
Drive implementation via TDD against a feature's PRD.md (acceptance criteria) and ARCH.md (the technical design). Extracts test cases from the PRD scenarios, runs red-green-refactor per case, and commits every cycle. Tests verify behavior only. Triggered by: "tdd", "implement with tdd", "/tdd".From its SKILL.md
npx -y skills add CodeMachine0121/SDD-Skill --skill tddAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.5 KB, as published. Nobody here has run it
Pre-flight
The design contract for this skill is exactly two documents: PRD.md (what to build + acceptance criteria) and ARCH.md (how it is structured). Read them and nothing else drives the implementation.
- Locate the feature folder
.sdd/{yyyy-MM-dd}-{feature-slug}/. None → stop ("Run/prdfirst"). Multiple candidates → ask which feature. Then read:PRD.md— the Section 3 acceptance-criteria scenarios (Gherkin) are the behavior contract.ARCH.md— the change scope and the new/modified classes and modules with their responsibilities. Implement to this design; do not invent a different structure. Missing → warn ("Run/architecturefirst for a design to follow") and continue only if the user insists.
- Find
.sdd/UL-MAP.md(fallback: root,docs/). Missing → warn, continue. Use its vocabulary for names. - Load the
commitskill — it owns the commit convention for this workflow (English Conventional Commits, one commit per cycle, no SDD identifiers). Follow it for every commit made in this run. - Check SQL
test_casesfor existing rows matching this PRD → if found, ask to resume (skip to Cycle) or reset.
Phase 1 — Test Plan
- Parse the PRD Section 3 acceptance-criteria scenarios (Gherkin) into atomic test cases — one behavior per scenario, preserving the happy / boundary / exception coverage. Skip empty/TBD rows. Also propose derived cases from Sections 4 & 6 edge cases/business rules. Map each case to the component in
ARCH.mdthat owns it, so each test lands at the right boundary. - SQL schema:
test_cases(id TEXT PK, prd_file TEXT, user_story TEXT, description TEXT, status TEXT DEFAULT 'pending')— theidis for internal tracking only and never appears in a commit message. - Present plan to user for confirmation (add/remove/reword). Apply edits to SQL, then start Cycle.
Cycle — RED 🔴 → GREEN 🟢 → REFACTOR 🔵 → COMMIT ✅
For each pending test case:
RED — Write one failing test per test-design.md.
- Run this test only. Must fail because behavior doesn't exist yet (not due to setup errors).
GREEN — Write minimum code to pass.
- Run this test only. Must pass before proceeding.
REFACTOR — Apply moves from refactor.md without changing behavior.
- Run all module tests after each change. All must stay green.
- Mark test case
donein SQL.
COMMIT — Commit this cycle before starting the next test case, per the commit skill.
- One commit per completed TDD cycle — the test and its implementation together. An app integration (wiring a component into the composition root / DI / an endpoint / config) gets its own commit, separate from behavior cycles.
- Stage only the files for this cycle, not unrelated changes.
- English Conventional Commits, describing the behavior — never a test-case id or document number.
- Every commit must be green and self-contained.
Repeat until no pending rows remain. Mark unresolvable cases blocked with reason.
Done
Run full suite. Report: "TDD complete. N done, M blocked. All tests passing."