This enforces strict TDD discipline: red, green, refactor, in that order, every time. It won't let you write production code without a failing test first. If you already wrote the code, it tells you to delete it and start over. The cycle is rigid but the guidance is practical: test one behavior at a time, write the minimum code to pass, refactor only when green. It includes a table of anti-patterns like test-after and gold-plating, plus a list of common rationalizations and why they're wrong. Use this when you want guardrails against skipping steps or when you're teaching TDD and need something more prescriptive than a style guide.
- GitHub stars
- 1.3K
- last updated
- Jun 11, 2026
Install
$ npx -y skills add codeaholicguy/ai-devkit --skill tdd --agent claude-codeInstalls into .claude/skills of the current project.
Files
TDD
Red. Green. Refactor. In that order, every time.
Hard Rules
- No production code without a failing test first.
- If production code was written before its test, delete it and start over with a failing test.
- Never skip the red step. A test that has never failed proves nothing.
Cycle
For each unit of behavior:
- Red — Write a test for the next behavior. Run it. It must fail. Read the failure message — it should describe the missing behavior.
- Green — Write the minimum production code to make the test pass. Nothing more. Run the test. Apply the
verifyskill. - Refactor — Clean up both test and production code. Run the test again. Still green? Done. Apply the
verifyskill.
Then pick the next behavior and repeat.
Rules for Each Step
Red:
- Test one behavior, not one function. Name the test after what the system should do, not what the function is called.
- The test must fail for the right reason — a missing method, wrong return value, unmet condition. Not a syntax error or import failure.
- If the test passes immediately, it's not testing new behavior. Delete it or pick a different behavior.
Sponsors
Details
- Repository
- github.com/codeaholicguy/ai-devkit
- Categories
- Testing & QA, Documentation, AI & Agent Building
- First seen
- Jun 11, 2026
