obra avatar

Test Driven Development

Forces strict test-driven development by requiring tests before any implementation code. Won't let you write production code without a failing test first, and actually makes you delete existing code if you wrote it before the test. Walks through the red-green-refactor cycle with mandatory verification steps at each phase. Catches all the common rationalizations like "I'll test after" or "keep it as reference" and shuts them down. Good for breaking the habit of testing after implementation, since it's surprisingly hard to stick to true TDD without external enforcement of the discipline.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
24
skills.sh installs
274.8K
GitHub stars
315.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add obra/superpowers --skill test-driven-development --agent claude-code

Installs into .claude/skills of the current project.

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.

Violating the letter of the rules is violating the spirit of the rules.

When to Use

Always:

  • New features
  • Bug fixes
  • Refactoring
  • Behavior changes

Exceptions (ask your human partner):

  • Throwaway prototypes
  • Generated code
  • Configuration files

Thinking "skip TDD just this once"? Stop. That's rationalization.

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write code before the test? Delete it. Start over.

No exceptions:

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete

Implement fresh from tests. Period.

Red-Green-Refactor

Sponsors

Details

Repository
github.com/obra/superpowers
Categories
Testing & QA, Documentation

More from obra/superpowers

All 14
1addyosmani avatartest-driven-developmentaddyosmani/agent-skillsDrives development with tests. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug71.3Kskills.sh installs
2convex avatarconvex-testconvex/agent-skillsGenerate convex-test tests for the app's Convex functions.41.1Kskills.sh installs
3openai avatarplaywrightopenai/skillsUse when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) vi9.3Kskills.sh installs
4github avatarbreakdown-testgithub/awesome-copilotTest Planning and Quality Assurance prompt that generates comprehensive test strategies, task breakdowns, and quality validation plans for GitHub projects.9.3Kskills.sh installs
5affaan-m avatargolang-testingaffaan-m/everything-claude-codegolang testing8.4Kskills.sh installs
6affaan-m avatartdd-workflowaffaan-m/everything-claude-codetdd workflow6.9Kskills.sh installs