tdd · rohitg00 — Claude Code skill: what it does, how to install
tdd guides Claude Code through a strict test-driven development loop: write a failing test, pass it with minimal code, and clean up.
MIT ★ 2,966 updated 2026-09-29
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflowWhat tdd does
This skill directs the assistant into a tight Red-Green-Refactor sequence. The model first writes a single test for an observable behavior slice, then runs it to confirm it fails on the assertion rather than a setup error. Only after verifying the failure does it implement the simplest code that passes the test, followed by cleanup while keeping tests green.
The skill mandates showing each transition between red and green states instead of jumping directly to the final result. Mocking is restricted to external system boundaries like network calls, clocks, and filesystems. It explicitly skips layout-only interfaces, throwaway spikes, and exploratory code where tests cannot pin down concrete logic.
What it helps with
- pin business logic with a failing test before writing implementation
- reproduce a reported bug through a test case before patching it
- refactor complex code safely with immediate test verification
- build parsers and state machines in incremental slices
Example prompts for the agent
- Implement the discount calculator using TDD, starting with a failing test
- Fix this bug using a red-green-refactor loop
- Write the test first for edge cases in the parser, then implement the handler
How to install tdd
1Plugin marketplace
/plugin marketplace add rohitg00/pro-workflow/plugin install pro-workflow@pro-workflowThis installs the whole pro-workflow plugin with all its skills
2Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a claude-code3Manually: put the files in place
~/.claude/skills/tdd/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tdd/
1Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a codex2Manually: put the files in place
.agents/skills/tdd/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a cursor2Manually: put the files in place
.cursor/skills/tdd/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install rohitg00/pro-workflow skills/tdd2Manually: put the files in place
.github/skills/tdd/SKILL.md1Skills CLI (Vercel)
npx skills add rohitg00/pro-workflow --skill tdd -a gemini-cli2Platform CLI
gemini skills install https://github.com/rohitg00/pro-workflow --path skills/tddManually: put the files in place
.devin/skills/tdd/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tdd
How do I install tdd in Claude Code?
Run /plugin marketplace add rohitg00/pro-workflow, then install the bundle with /plugin install pro-workflow@pro-workflow.
What does the tdd skill enforce?
It forces the agent to write a failing test first, make it pass with the simplest solution, and refactor only while all tests remain green.
When should this skill be skipped?
The instructions advise skipping TDD during exploratory spikes and layout-focused UI work where visual inspection is required.
Source text
SKILL.md · MIT
--- name: tdd description: Drive a change through a red-green-refactor loop - failing test first, minimal code to pass, then clean up. Use when implementing a feature or fixing a bug where correctness matters and a test can pin the behavior. Says "TDD", "test first", "red green refactor", "write the test first". user-invocable: true --- # tdd The agent codes better with a tight feedback loop than with a long specification. A failing test is the tightest loop there is: it states the target, and the target either goes green or it does not. ## The loop 1. **Red.** Write one failing test that states the next slice of behavior. Run it. Confirm it fails for the right reason - a test that passes before you write the code is testing nothing. If it errors instead of failing on the assertion, fix the test setup first. 2. **Green.** Write the least code that makes the test pass. Not the general solution, not the abstraction - the minimal move. Run the test. Green. 3. **Refactor.** Now clean up with the test as a net: remove duplication, name things, simplify. Re-run after every edit. Behavior is frozen; only the shape changes. 4. Repeat for the next slice. Small slices. The rate of feedback is the speed limit - never take on a step too big to hold a single test. ## What makes a test worth writing - **Tests behavior, not implementation.** Assert on the observable result, not on which private method got called. A test that breaks on every refactor is a liability. - **One reason to fail.** Each test pins one behavior. When it goes red you should know what broke without reading the body. - **Real seams, minimal mocks.** Mock at the system boundary (network, clock, filesystem), not internal collaborators. A test that mocks the thing under test asserts nothing. - **No tautologies.** A test that restates the implementation (`expect(x).toBe(x)` after setting `x`) verifies nothing. Assert the value the behavior should produce. ## When to reach for it Reach for TDD when the behavior is specifiable and a test can pin it: business logic, parsers, state machines, bug fixes (write the failing case first, then fix). Skip it for pure exploration, throwaway spikes, and layout-only UI where a test asserts nothing a human would not eyeball. ## Output contract Show each red-green transition, not just the final green. If a test is hard to write, say what the difficulty reveals about the design - untestable code is usually badly-seamed code, and that is a finding, not an obstacle.
© Rohit Ghumare · MIT · rohitg00/pro-workflow
Similar skills
All skills for Testing and QA →tdd by other authors comes first.