test-driven-development Skill for Claude: What It Does and How to Install It
Makes Claude write a failing test first, watch it fail, then write only enough code to pass it, for every feature and bug fix.
- Installs
- 266.9K
- on skills.sh
- Stars
- 310.6K
- on GitHub
- Files
- 1
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
test-driven-development makes Claude follow red-green-refactor on features, bug fixes, refactors and behavior changes. It writes one minimal test, runs it to confirm it fails for the right reason, writes the simplest code that passes, then cleans up with the tests still green. The rule is stated flatly: no production code without a failing test first.
If Claude wrote code before the test, the skill says to delete it and start again. Listed exceptions are throwaway prototypes, generated code and configuration files, and Claude is told to ask you first. It runs whatever test command your repo uses, and expects the full project suite to pass before it calls the work done, not just the new test. It bundles one guide, writing-good-tests.md.
Good for
- Developers who want Claude to test before it builds
- Teams fixing bugs with a regression test first
Install test-driven-development
Claude Code
- 1
Copy this prompt.
Install the test-driven-development skill in Claude Code. Run this command: npx skills add https://github.com/obra/superpowers --skill test-driven-development Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Use when implementing any feature or bugfix, before writing implementation code
Sections in SKILL.md
- Overview
- When to Use
- The Iron Law
- Red-Green-Refactor
- RED - Write Failing Test
- Verify RED - Watch It Fail
- GREEN - Minimal Code
- Verify GREEN - Watch It Pass
- REFACTOR - Clean Up
- Repeat
- Good Tests
- Common Rationalizations
- Red Flags - STOP and Start Over
- Example: Bug Fix
- Verification Checklist
- When Stuck
Key facts
- Author
- obra
- Installs on skills.sh
- 266,920 (Nov 2026)
- GitHub stars
- 310,635 (Nov 2026)
- License
- MIT
- Last repo commit
- Oct 29, 2026
- Files in the skill folder
- 2 including SKILL.md
- skills.sh audits
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
What it includes
Writes one minimal test for one behavior with a clear name
Write ·
REDRuns the test and confirms it fails because the feature is missing, not because of a typo
Runs code ·
Verify REDWrites the simplest code that passes the test, nothing extra
Write ·
GREENRuns the test and the whole project suite and reports any failure by name
Runs code ·
Verify GREENRemoves duplication and improves names while the tests stay green
Write ·
REFACTORRules for honest tests: assert real behavior, not mocks
writing-good-tests.mdA table of excuses such as "I'll test after" with the skill's answer to each
Common rationalizations
From the official docs
Permissions
Low risk
It runs your test commands and tells Claude to delete code that was written before its test.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It tells Claude to delete code written before the test
Commit or stash your work first, so anything deleted can be recovered.
It runs your test command
Claude runs whatever your repo uses, including the full suite. Check that the command has no side effects you care about.
Questions
How do I install the TDD skill?
Use the install box above. It is one skill from the obra/superpowers repo.
When does Claude use it?
Its description says: use it when implementing any feature or bugfix, before writing implementation code. The When to Use list also names refactoring and behavior changes.
Does it work with any language or test runner?
SKILL.md shows TypeScript examples and tells Claude to run the project's own test command, for example pytest, npm test or cargo test. It does not tie the skill to one framework.
Will it really delete my code?
The skill says code written before its test should be deleted and redone from the test. Commit or stash first so nothing is lost, and tell Claude if the work falls under one of the listed exceptions.
How is it different from verification-before-completion?
TDD controls the order of work: test first, then code. verification-before-completion controls what Claude may claim: it must show fresh command output before it says something passes.
Information
updated Nov 2, 2026
- Repository
- obra/superpowers
- Folder
skills/test-driven-development
Sources
Docs, issue trackers and discussions this page is built from.
Show all 2Hide
- test-driven-development SKILL.md · github.com
- verification-before-completion SKILL.md · github.com