PlugWiki

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. 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. 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

  1. Overview
  2. When to Use
  3. The Iron Law
  4. Red-Green-Refactor
  5. RED - Write Failing Test
  6. Verify RED - Watch It Fail
  7. GREEN - Minimal Code
  8. Verify GREEN - Watch It Pass
  9. REFACTOR - Clean Up
  10. Repeat
  11. Good Tests
  12. Common Rationalizations
  13. Red Flags - STOP and Start Over
  14. Example: Bug Fix
  15. Verification Checklist
  16. 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

What it includes

  • Writes one minimal test for one behavior with a clear name

    Write · RED

  • Runs the test and confirms it fails because the feature is missing, not because of a typo

    Runs code · Verify RED

  • Writes the simplest code that passes the test, nothing extra

    Write · GREEN

  • Runs the test and the whole project suite and reports any failure by name

    Runs code · Verify GREEN

  • Removes duplication and improves names while the tests stay green

    Write · REFACTOR

  • Rules for honest tests: assert real behavior, not mocks

    writing-good-tests.md

  • A 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

Folder
skills/test-driven-development

obra/superpowersskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. test-driven-development SKILL.md · github.com
  2. verification-before-completion SKILL.md · github.com

Updated Nov 2, 2026.