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
- 1Red
Write one small test with a clear name that describes a single behavior.
- 2Verify red
Run it and confirm it fails because the feature is missing, not because of a typo or error.
- 3Green
Write the minimum code needed to pass, without extra options or unrelated changes.
- 4Verify green
Run the test and the whole project suite, and report any failures by name.
- 5Refactor
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-officialClaude Code (Superpowers marketplace)Alternative marketplace that also lists related plugins.
/plugin marketplace add obra/superpowers-marketplace
/plugin install superpowers@superpowers-marketplaceCodex CLISearch for superpowers in the plugin list and choose Install Plugin; the Codex app has the same entry under Plugins.
/pluginsCursorRun in Cursor Agent chat, or search the plugin marketplace.
/add-plugin superpowersGemini CLIUpdate later with gemini extensions update superpowers.
gemini extensions install https://github.com/obra/superpowersGitHub Copilot CLIRegisters the marketplace, then installs the plugin.
copilot plugin marketplace add obra/superpowers-marketplace
copilot plugin install superpowers@superpowers-marketplaceDevin CLIUpdate with devin plugins update superpowers.
devin plugins install obra/superpowersQwen CodePick superpowers when prompted.
qwen extensions install obra/superpowersPiLoads the skills plus a small extension that injects the bootstrap at session start.
pi install git:github.com/obra/superpowersAntigravityRun the same command again to update.
agy plugin install https://github.com/obra/superpowersCommands 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
/brainstormingDesign-first brainstorming before any buildClarifies what you want and why, then gets a design approved before building.Read the guide →/subagent-driven-developmentSubagent-driven plan execution with per-task reviewRuns a plan by sending each task to a fresh subagent, reviewing each result.Read the guide →
Also in this pack
/diagnosing-superpowersAnalyzes a session transcript to explain what went wrong, with optional bug report.↗/dispatching-parallel-agentsSplits independent tasks across several subagents that work at the same time.↗/executing-plansCarries out an implementation plan inline in one session, with a final review.↗/finishing-a-development-branchChecks tests, then offers to merge, open a PR, keep or discard the branch.↗/receiving-code-reviewEvaluates review feedback critically and verifies it before changing any code.↗/requesting-code-reviewAsks a reviewer to check finished work against the plan and requirements.↗/using-git-worktreesCreates an isolated branch workspace, runs setup and confirms tests pass first.↗/using-superpowersTeaches the agent to look for and load matching skills before responding.↗/writing-skillsGuides creating, editing and testing new skills before they are used.↗
Summary by trendhub. The skill itself lives in obra/superpowers/skills/test-driven-development by Jesse Vincent (MIT); read the full, current text there.