Tooluck logoTooluck
SKILL.md

tdd

Agent skill fromcodeaholicguy/ai-devkit

AI DevKit · Test-driven development — write a failing test before writing production code. Use when implementing new functionality, adding behavior, or fixing bugs during active development.

How to install tdd

install tdd
# install the ai-devkit pack with the skills CLI
npx skills add codeaholicguy/ai-devkit

# or add only this skill to Claude Code: copy the folder

skills/tdd/

# into

~/.claude/skills/tdd/ (all projects)

.claude/skills/tdd/ (one project)

skills/tdd/SKILL.md

Apache-2.0Full file
1# TDD
2
3Red. Green. Refactor. In that order, every time.
4
5## Hard Rules
6
7- No production code without a failing test first.
8- If production code was written before its test, delete it and start over with a failing test.
9- Never skip the red step. A test that has never failed proves nothing.
10
11## Cycle
12
13For each unit of behavior:
14
151. **Red** — Write a test for the next behavior. Run it. It must fail. Read the failure message — it should describe the missing behavior.
162. **Green** — Write the minimum production code to make the test pass. Nothing more. Run the test. Apply the `verify` skill.
173. **Refactor** — Clean up both test and production code. Run the test again. Still green? Done. Apply the `verify` skill.
18
19Then pick the next behavior and repeat.
20
21## Rules for Each Step
22
23**Red:**
24- Test one behavior, not one function. Name the test after what the system should do, not what the function is called.
25- The test must fail for the right reason — a missing method, wrong return value, unmet condition. Not a syntax error or import failure.
26- If the test passes immediately, it's not testing new behavior. Delete it or pick a different behavior.
27
28**Green:**
29- Write the simplest code that passes. Hardcode if needed — the next test will force generalization.
30- Do not add code "while you're in there." If it's not required by a failing test, it doesn't exist yet.
31- Do not refactor during green. Pass first, clean second.
32
33**Refactor:**
34- Remove duplication between test and production code.
35…

Excerpt shown under the repository's Apache-2.0 license.

More skills in ai-devkit

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates