/sdd-pipeline:tddfrom sdd-pipeline
Drives feature work and bug fixes through a failing-test-first loop. Trigger when implementing, fixing, or refactoring behavior in a codebase with existing tests.
Ships in sdd-pipeline. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
One small failing test, just enough code to pass, then a look. Repeat.
Drop in ~/.claude/skills/tdd/ (per-user) or <repo>/.claude/skills/tdd/ (per-project).
Spikes, copy/style/visual edits, one-off scripts, generated files. If the codebase has no tests at all, see untested-code.md first.
If either slips, back up.
The name describes a capability, not a method. Read it out loud — it should sound like something a user or caller would care about.
✅ logged_out_user_cannot_publish_a_post
✅ schedule_overlap_returns_409
❌ post_service_calls_repo_save
❌ schedule_returns_object_with_status
The body has three sections in order — set up, do the thing, check what's observed:
test "expired tokens are rejected":
token = issue_token(ttl_seconds: 60)
advance_clock(seconds: 120)
result = verify(token)
assert result.ok == false
assert result.reason == "expired"
If renaming a private function tomorrow would break the test even though no behavior changed, the test was tied to internals. Rewrite or delete it. See test-anatomy.md.
Writing five tests up front and then five implementations produces tests that describe an imagined system. They lock you into the wrong shape and stop pulling their weight once any pair shares a code path.
Each test must exist because of something you learned writing the previous one.
Wrong: RED t1 t2 t3 t4 t5 → GREEN c1 c2 c3 c4 c5
Right: t1→c1, t2→c2, t3→c3, ...
Same mistake in miniature: writing one test and reaching inside to "also handle" something it doesn't cover. Don't.
The Stop hook runs your tests at the end of every turn (green allows the turn to end, red blocks it). It reads the command from .agents/tdd/test-command.txt at the project root.
If that file is missing, set it up before starting the cycle:
CLAUDE.md first — projects often document the canonical test command there.package.json (scripts.test), pyproject.toml / pytest.ini, Makefile (test: target), Cargo.toml, or analogous config files for the project's stack.test:unit vs test:e2e), ask the user which one to use for TDD.Once decided, create .agents/tdd/ if missing and write the command on a single line to .agents/tdd/test-command.txt. Confirm with the user the first time.
The user can edit the file at any time to change the command (e.g. switching from npm test to npm run test:unit).
1. Decide. If a spec/<slug>.md exists for this task, read it — Behaviors + Acceptance criteria are your queue. Otherwise list the behaviors to verify in rough order with whoever cares.
2. Smoke run. Pick the first behavior. Test → fails → minimum code → passes. If this first cycle takes more than 15 minutes, the slice is too big.
3. Each next behavior. Same shape. One test at a time. No speculation. No "while I'm here." If a rule slips, see smells.md.
4. Cleanup. Tests green? Invoke the simplify skill on the recent changes — it reviews code for reuse, quality, and efficiency and applies any improvements found. After simplify, see cleanup.md for additional cleanup. Cleanup only on green; never add behavior during cleanup. (The Stop hook will also remind you to invoke simplify once per session if you forget.)
Stop adding tests when all are true:
100% coverage with bad tests is worse than 70% with good ones.
What SKILL.md sets; muted values are Claude Code's defaults
bash ${CLAUDE_PLUGIN_ROOT}/skills/tdd/hooks/end-green.shnpx claudepluginhub eduwxyz/my-awesome-skills --plugin sdd-pipeline6 skills in this plugin
/diagnoseTurn a bug symptom into a fix with a regression test that locks it down. If the user opens vague ("there's a bug", "/diagnose"), interview them one question at a time until you have enough to attempt a reproduction; if you still cannot reproduce, say so explicitly. Then drive the work through five phases — build a deterministic feedback loop, reproduce, hypothesise, probe, write a spec — and hand off to TDD for the regression test. Trigger when the user reports something broken, slow, wrong, or regressed: "X is failing", "this throws", "something regressed", "diagnose this", "debug this", "investigate why..."./featureKick off the full feature workflow — interview-to-spec, optional spec-approach, tdd, verify, then review — when starting a new feature from scratch. Thin orchestrator: confirms intent in one sentence, then hands off to the first stage and lets each downstream skill activate on its own. Trigger when the user says "new feature", "let's build a feature", "start a feature", "build feature X end-to-end", "kick off a feature", "/feature"./interview-to-specConduct a focused interview to draft a spec.md for an upcoming task (the input step of SDD — spec-driven development). Walks through goal, behaviors, acceptance criteria, edge cases, and out-of-scope one branch at a time, then writes the spec to disk. If during the interview the scope turns out to be multiple independent features, pauses and asks the user to pick one — the chosen one becomes the spec, the rest stay outside the repo. Trigger when the user wants to draft a spec before implementation, mentions "draft the spec", "let's spec this out", "what should we build", or starts an SDD workflow./spec-approachAdd a refined `## Approach` section to an existing feature spec.md before TDD executes it. Reads the spec, explores the codebase to ground the approach in real modules and patterns, proposes 2–3 alternatives when they exist, validates with the user, then appends `## Approach` to the same spec file. Trigger after `interview-to-spec` for non-trivial features when the user says "plan the approach", "spec the implementation", "design the approach", "how are we building this", or before invoking `tdd` on a feature whose HOW is unclear./verifyVerify that a spec.md's Acceptance criteria are observably covered by green tests before opening a PR. Reads the spec, finds the tests that cover each AC, runs the suite to confirm everything green, and reports gaps (uncovered AC, skipped tests, missing edge-case coverage). When gaps exist, automatically iterates with `tdd` until the spec is satisfied — does not stop while gaps remain. Surfaces tests not mapping to any AC as warnings (no auto-fix; user decides). Trigger after `tdd` is green and before sending the work for review, when the user says "verify the spec", "are we done", "check coverage against spec", "ready for review", "is this PR-ready".Other plugins' skills for the same job