Guides test-first development through the red-green loop, establishing public seams before writing tests. Supports any test runner and language.
Ships in tdd. 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.
The red → green loop, run so it produces tests worth keeping. A good test verifies behavior through a public interface and reads like a specification: "user can checkout with valid cart" names a capability. The implementation can change entirely; the test should not.
Arguments are passed in the user invocation message or via /skill tdd:
/skill tdd [--runner command] [--file path] [--test-file path] <task description>
/skill tdd implement parseDuration in parse-duration.js/skill tdd --runner "node --test" reproduce and fix token expiration bug/skill tdd --test-file tests/cart.test.ts checkout cart calculation--runner <command>: The test runner command to execute (e.g., node --test, npm test, pytest, cargo test). If omitted, inspects package.json, project configuration, or existing test files.--file <path>: The target implementation source file to create or update.--test-file <path>: The target test file to create or update.The two steps below are the plan; do not open a task list for them.
A seam is the public boundary you test at, observing behavior without reaching inside (e.g. exported functions, class methods, or CLI interfaces). Before writing any test:
package.json, Makefile, etc.) so naming, test runner, and test conventions match the host project.Seam agreed: parseDuration(str) -> number | null) and proceed immediately to Step 2 without waiting for an interactive prompt. When interacting with an operator, confirm the proposed seam before writing code.No test is written at an unconfirmed or unstated seam. Agreeing seams up front keeps the effort focused on critical public paths rather than internal details.
Execute one vertical slice per cycle: exactly one test behavior → minimal implementation → verify.
test(...) or it(...)) for the thinnest unverified slice of behavior.bash (e.g. node --test test/parse-duration.test.js).$(...) or backticks ` in bash commands; execute commands in discrete, direct steps.cmd 2>&1 | head -40; echo EXIT: ${PIPESTATUS[0]}). Run the test runner directly:
node --test <test-file>
or
npm test
git commit or git add between cycles. TDD is complete when the suite passes green; repository shipping is handled separately by ship.expect(add(a,b)).toBe(a+b)), so it passes by construction. Expected values must come from independent literals or specification examples.references/mocking.md. For worked examples, consult references/tests.md.Every agreed seam has its behaviors covered by tests that were each observed red before green, the full suite passes, and no test trips the anti-patterns above. Output a concise summary naming:
$(...) that trigger approval modals.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/tdd:tddfrom tdd
npx claudepluginhub panstudio/pancode --plugin tddOther plugins' skills for the same job