norbertsuski/sdd-toolkit/sdd-tdd
Claude Code and agent skill by norbertsuski/sdd-toolkit
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Drive an approved plan from CONTEXT_ROOT/changes/<change-id>/plan.md phase by phase, test-first, through red→green→refactor — only for TDD'able phases not yet implemented; everything else routes to /sdd-implement. Use when the user says "tdd", "test-first", "red green refactor", or wants to execute a plan via TDD.
Install
npx vskill@latest install norbertsuski/sdd-toolkit/sdd-tddSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as norbertsuski/sdd-toolkit/sdd-tdd.
SDD TDD — Test-First Plan Execution
You drive an approved technical plan from $CONTEXT_ROOT/changes/<change-id>/plan.md (legacy: context/changes/<change-id>/plan.md) to completion one phase at a time, test-first. This skill operates under the CONTEXT_ROOT handed to it (the resolved base) — it does not run its own discovery; app: may be absent for flat roots. This skill only applies when the phase's production implementation is still absent. For each eligible phase you run the classic loop:
This skill is the test-first sibling of `/sdd-implement`. It reads the same plan, mutates the same canonical ## Progress section, and uses the same phase-end commit ritual and clipboard handoffs. The only difference is ordering: here the failing test is written before the production code. Because that order is the point, do not use this skill to add tests after the implementation already exists. Because the two skills share ## Progress, you can interleave them freely — TDD a phase here, hand the next phase to /sdd-implement, come back, and state is never lost.
Plan path: $ARGUMENTS
What this skill assumes — and what it will not do
- Test infrastructure already exists. A runner (Vitest / Playwright / Jest / pytest / …), a way to run a single file, and the project's test conventions are assumed to be in place. This skill discovers them; it does not install a runner, scaffold configs, create fixtures, or wire up CI. If no runner exists at all, stop and tell the user to set one up first (point them at
/sdd-test-planfor a phased test rollout, or/sdd-bootstrapperfor scaffolding). - Production implementation is not there yet. TDD only works when the failing test can lead the implementation. If the phase's relevant behavior, endpoint, component, migration, wiring, or other production change already exists, stop immediately; do not write retroactive tests and do not continue the phase under a TDD label. Tell the user to use
/sdd-implement <change-id> phase Nto proceed with the already-started phase. - It drives implementation, not just test scaffolding. Unlike the old "write all the tests up front" flow, this skill writes a small failing test, then immediately makes it green, phase by phase. There is no separate batch of orphaned failing tests.
- It gates every phase on whether test-first actually fits and whether implementation is absent. Some phases (config, scaffolding, visual polish, infra wiring) cannot be meaningfully driven by a failing test. Already-started implementation also cannot be recovered into true TDD. Those cases are redirected or stopped as described below.
Phase overview
Each phase ends with a user checkpoint. Never silently skip a phase or merge two phases into one commit.
Setup
When this skill is invoked:
- Resolve the plan:
/sdd-tdd <change-id> [phase N]→$CONTEXT_ROOT/changes/<change-id>/plan.md.@$CONTEXT_ROOT/changes/<change-id>/plan.md(legacy:@context/changes/<change-id>/plan.md) or a full path → accept as-is.- Refuse if the resolved path starts with `$CONTEXT_ROOT/archive/` (legacy:
context/archive/) — print "This change is archived. Open a new change with/sdd-newinstead." and STOP. - If nothing was provided, print the message below and STOP and wait:
- Read the plan completely — every phase, every Changes Required block, every Success Criteria item. Never use limit/offset; you need full context. The
## Progresssection at the bottom is authoritative for execution state — checkmarks (- [x]) live ONLY there (seereferences/progress-format.md). Phase blocks carry plain-bullets, no checkboxes.
- Read `$CONTEXT_ROOT/foundation/lessons.md` if present and internalize each entry before starting any phase — these are the team's accepted recurring rules and must shape every implementation choice in this run.
- Confirm test infrastructure exists (light check — do not research the world):
- If
$CONTEXT_ROOT/foundation/test-stack.mdexists, read it — it records the runner, environment, conventions, and run commands. Use it and skip the scan. If it looks stale (references tools/configs that no longer exist), note that to the user and fall back to a quick scan. - Otherwise do a quick conventions scan (this is not the heavy infra-research phase): find the test config and 1–2 representative existing test files to learn the import style, describe/it nesting, mock patterns, and the command to run a single test file. A single
Globfor*.test.*/*.spec.*plus reading one example is enough. - If there is no runner and no test config at all, STOP:
- Update `change.md`: with pending executable work, apply
../sdd-run/references/verification-freshness.md— setstatus: implementingfrom{planned, plan_reviewed, implemented, impl_reviewed}and bumpupdatedbefore editing. This invalidates any older snapshot.
- Create one task per phase (these surface in the user's status bar): for each
## Phase N:header, create a task withsubject: "Phase N: [Phase Name]"andactiveForm: "TDD Phase N". Mark the current phasein_progressbefore starting; mark itcompletedwhen its success criteria pass.
- Find the starting point: scan
## Progress— the first- [ ]in document order is where you start. If aphase Nargument was passed, jump to the first- [ ]under### Phase N:.
Clipboard convention. Wherever this skill says copy `X` to the clipboard, pipe the exact stringXto the platform clipboard — trypbcopy(macOS), thenclip.exe(Windows/WSL), thenxclip -selection clipboard(Linux), and fall back silently if none exist. Then display the copied command on its own line suffixed with(✓ copied).
The TDD eligibility gate — run before every phase
Before you write a single test for a phase, decide two things in this order:
- Implementation absence — the phase's production implementation is not already present.
- TDD-ability — the phase can be meaningfully driven by a failing test.
A phase is eligible for this skill only when both are true.
Existing-implementation stop
First, inspect the phase's Changes Required, Success Criteria, and pending ## Progress rows, then do a focused code search for the files, symbols, endpoints, migrations, commands, UI surfaces, or config entries the phase is supposed to add or change. This is a quick reality check, not a broad research pass.
If the core implementation for the phase is already present or partially present, STOP immediately. Do not add tests after the fact, do not refactor the existing code, do not mark Progress rows, and do not offer to continue inline. TDD does not work for already existing code because the failing test no longer leads the implementation.
Print this block, filling in the concrete evidence:
Copy /sdd-implement <change-id> phase [N] to the clipboard per the clipboard convention, display it with (✓ copied) when successful, and STOP. /sdd-implement can continue the phase from the existing code and plan state.
If the implementation is absent, continue to the TDD-ability check.
TDD-ability check
After confirming the implementation is absent, decide whether the phase can be meaningly driven by a failing test. A phase is TDD'able when there is an observable outcome you can assert before the code exists.
| TDD'able — drive it here | Not TDD'able — redirect to /sdd-implement | |
|---|---|---|
| Pure functions, data transforms, parsers, validators | Pure scaffolding: creating dirs, config files, package.json/manifest edits | |
| State machines / reducers / flag computation | Wiring & infra: CI files, Dockerfiles, env setup, deploy config | |
| API request → response contracts (status, shape, auth, gating) | Visual / styling polish with no automated assertion path in the stack | |
| Business logic with clear inputs/outputs | Exploratory spikes where the contract isn't known yet | |
| Integration flows across mockable boundaries (DB/KV/HTTP) | Documentation, comments, content-only edits | |
| Bug fixes (write the failing repro first) | Thin glue where a test would only restate the implementation (tautological) |
How to apply the TDD-ability check:
- If the implementation is absent and the phase is clearly TDD'able, state that in one line and proceed to the red-green-refactor loop.
- If the phase is clearly not TDD'able, run the redirect (below).
- If it's mixed or ambiguous (e.g., a phase that scaffolds a config and adds a validator with real logic), ask the user: "Phase [N] is partly scaffolding, partly logic. How should I drive it?" with options:
- "TDD the testable part (Recommended)": "I'll red-green-refactor the [logic] and implement the scaffolding inline as plain steps."
- "Redirect whole phase to /sdd-implement": "Hand the entire phase off — copy the resume command to the clipboard."
- "TDD the whole phase anyway": "Force test-first even for the thin parts. May produce low-value tests."
Redirect a non-TDD'able phase to /sdd-implement
State why the phase isn't a fit (one or two sentences, grounded in the table above), then ask the user: "Phase [N] isn't a good test-first fit. How do you want to handle it?" with options:
- "Hand off to /sdd-implement (Recommended)": "Copy
/sdd-implement <change-id> phase Nto the clipboard. Clear context, run it, then resume TDD on the next phase." - "Implement inline here (no test-first)": "I'll build this phase directly from the plan and run its success criteria — then continue to the next phase's gate."
- "Skip — already done": "Mark the phase's Progress rows and move to the next phase."
On "Hand off": copy /sdd-implement <change-id> phase [N] to the clipboard (per the clipboard convention), print the block below, and STOP — /sdd-implement will flip this phase's Progress rows and run its own commit ritual. Tell the user to resume TDD afterward.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sdd-tdd/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/norbertsuski/sdd-toolkit/sdd-tdd)