Skills Prompts

Popular categories

Agent skill · Superpowers

/test-driven-development Strict red-green-refactor test-driven development

This skill makes the agent write a failing test before any production code, confirm it fails for the right reason, add the smallest code that passes, then clean up while staying green. Code written before its test is deleted and redone, and the full project test suite must pass before the work counts as finished.

Works with

  • Claude Code
  • Codex CLI
  • Cursor
  • Gemini CLI
  • GitHub Copilot CLI
  • Devin CLI
  • Qwen Code
  • Pi
  • Antigravity

Used forTesting and TDD

When to use it

  • Adding a new feature or changing existing behavior
  • Fixing a bug, so a test proves the fix
  • Refactoring code that should keep behaving the same

How it works

  1. 1
    Red

    Write one small test with a clear name that describes a single behavior.

  2. 2
    Verify red

    Run it and confirm it fails because the feature is missing, not because of a typo or error.

  3. 3
    Green

    Write the minimum code needed to pass, without extra options or unrelated changes.

  4. 4
    Verify green

    Run the test and the whole project suite, and report any failures by name.

  5. 5
    Refactor

    Remove duplication and improve names while keeping every test passing.

What it steers the agent away from

  • Tests written after the code that pass immediately and prove nothing
  • Tests that check mock behavior instead of real code
  • Over-engineered code built for needs nobody stated

Install this skill

It installs with the Superpowers pack.

Claude CodeFrom Anthropic's official plugin marketplace.
/plugin install superpowers@claude-plugins-official
Claude Code (Superpowers marketplace)Alternative marketplace that also lists related plugins.
/plugin marketplace add obra/superpowers-marketplace
/plugin install superpowers@superpowers-marketplace
Codex CLISearch for superpowers in the plugin list and choose Install Plugin; the Codex app has the same entry under Plugins.
/plugins
CursorRun in Cursor Agent chat, or search the plugin marketplace.
/add-plugin superpowers
Gemini CLIUpdate later with gemini extensions update superpowers.
gemini extensions install https://github.com/obra/superpowers
GitHub Copilot CLIRegisters the marketplace, then installs the plugin.
copilot plugin marketplace add obra/superpowers-marketplace
copilot plugin install superpowers@superpowers-marketplace
Devin CLIUpdate with devin plugins update superpowers.
devin plugins install obra/superpowers
Qwen CodePick superpowers when prompted.
qwen extensions install obra/superpowers
PiLoads the skills plus a small extension that injects the bootstrap at session start.
pi install git:github.com/obra/superpowers
AntigravityRun the same command again to update.
agy plugin install https://github.com/obra/superpowers

Commands come from the author’s README; check it for changes before you run them.

Questions

Are there exceptions to test-first?

The skill lists throwaway prototypes, generated code and configuration files as possible exceptions, but only after asking you.

Is passing the new test enough?

No. It expects the project's whole test suite to run green, and any failing test, even one the agent did not cause, must be reported.

More guides from Superpowers

Also in this pack

All 15 skills →

Summary by trendhub. The skill itself lives in obra/superpowers/skills/test-driven-development by Jesse Vincent (MIT); read the full, current text there.