Tooluck logoTooluck
SKILL.md

test-driven-development

Agent skill fromobra/superpowers

Use when implementing any feature or bugfix, before writing implementation code

How to install test-driven-development

install test-driven-development
# install the superpowers pack with the skills CLI
npx skills add obra/superpowers

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

skills/test-driven-development/

# into

~/.claude/skills/test-driven-development/ (all projects)

.claude/skills/test-driven-development/ (one project)

skills/test-driven-development/SKILL.md

MITFull file
1# Test-Driven Development (TDD)
2
3## Overview
4
5Write the test first. Watch it fail. Write minimal code to pass.
6
7**Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
8
9**Violating the letter of the rules is violating the spirit of the rules.**
10
11## When to Use
12
13**Always:**
14- New features
15- Bug fixes
16- Refactoring
17- Behavior changes
18
19**Exceptions (ask your human partner):**
20- Throwaway prototypes
21- Generated code
22- Configuration files
23
24Thinking "skip TDD just this once"? Stop. That's rationalization.
25
26## The Iron Law
27
28```
29NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
30```
31
32Write code before the test? Delete it. Start over.
33
34**No exceptions:**
35- Don't keep it as "reference"
36- Don't "adapt" it while writing tests
37- Don't look at it
38- Delete means delete
39
40Implement fresh from tests. Period.
41
42## Red-Green-Refactor
43
44```dot
45digraph tdd_cycle {
46 rankdir=LR;
47 red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
48 verify_red [label="Verify fails\ncorrectly", shape=diamond];
49 green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
50 verify_green [label="Verify passes\nAll green", shape=diamond];
51 refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
52 next [label="Next", shape=ellipse];
53
54 red -> verify_red;
55 verify_red -> green [label="yes"];
56 verify_red -> red [label="wrong\nfailure"];
57 green -> verify_green;
58…

Excerpt shown under the repository's MIT license.

More skills in superpowers

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates