/tdd
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
One skill from pro-workflow.
shell
$ npx -y skills add rohitg00/pro-workflow --skill tdd --agent claude-codeInstalls just this skill. Get the whole plugin for auto-invocation.
How it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/tdd
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
Stats
Stars2,638
Forks255
LanguageJavaScript
SKILL.md
tdd.SKILL.md
--- 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
