superpowers-tdd
Skill2 starsChanged 6 months agoMITView on GitHub
RED-GREEN-REFACTOR enforcement. Write failing test first, watch it fail, write minimal code to pass. This skill should be used when implementing any feature, bugfix, or behavior change that involves writing code.
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- ErrorNotFound808/claude-skillsedited, first seen Oct 8, 2026
- karim-embarek/superpowers-antigravitytheir own version, first seen Aug 17, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- ErrorNotFound808/claude-skills★ 045% same
Wrote their own version · 1
- karim-embarek/superpowers-antigravity★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- superpowers-debuggingSkill
- superpowers-planSkill
- superpowers-verifySkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Write the test first. Watch it fail.
- Distinctive: line 14
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
- Distinctive: line 22
Write code before the test?
- Distinctive: line 28
Write one minimal test showing what should happen.
- Distinctive: line 32
MANDATORY. Never skip: Run the test. Confirm: test fails (not errors), failure message is expected, fails because feature missing (not …
- Distinctive: line 36
Write simplest code to pass the test.
- Distinctive: line 40
MANDATORY: Run the test. Confirm: test passes, other tests still pass, output pristine.
- Distinctive: line 44
After green only: remove duplication, improve names, extract helpers.
- Distinctive: line 64
Before marking work complete:
- Distinctive: line 66
Every new function/method has a test
- Distinctive: line 70
All tests pass, output pristine
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test-Driven Development (TDD)
Overview
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRSTWrite code before the test? Delete it. Start over. Don't keep it as "reference", don't "adapt" it — delete means delete. Implement fresh from tests.
Red-Green-Refactor
RED — Write Failing Test
Write one minimal test showing what should happen. One behavior, clear name, real code (no mocks unless unavoidable).
Verify RED — Watch It Fail
MANDATORY. Never skip. Run the test. Confirm: test fails (not errors), failure message is expected, fails because feature missing (not typos).
GREEN — Minimal Code
Write simplest code to pass the test. Don't add features, refactor other code, or improve beyond the test.
Verify GREEN — Watch It Pass
MANDATORY. Run the test. Confirm: test passes, other tests still pass, output pristine.
REFACTOR — Clean Up
After green only: remove duplication, improve names, extract helpers. Keep tests green. Don't add behavior.
Common Rationalizations
| Excuse | Reality |
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Already manually tested" | Ad-hoc is not systematic. No record, can't re-run. |
| "Deleting hours is wasteful" | Sunk cost fallacy. Unverified code is technical debt. |
| "TDD will slow me down" | TDD is faster than debugging. |
Red Flags — STOP and Start Over
Code before test. Test after implementation. Test passes immediately. Tests added "later". Rationalizing "just this once". "Keep as reference" or "adapt existing code". "This is different because..."
All of these mean: Delete code. Start over with TDD.
Verification Checklist
Before marking work complete:
- Every new function/method has a test
- Watched each test fail before implementing
- Each test failed for expected reason (feature missing, not typo)
- Wrote minimal code to pass each test
- All tests pass, output pristine
Final Rule
Production code must have a test that existed and failed first. Otherwise it is not TDD.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

