test-driven-development
Test-Driven Development
Test-Driven Development is an agent skill from Superpowers: your agent writes a failing test first, watches it fail, then writes only the code needed to make it pass.
Install Test-Driven Development
In Claude Code, install the whole Superpowers plugin from Anthropic's official marketplace
/plugin install superpowers@claude-plugins-officialOr install only this skill with the skills CLI
npx skills add obra/superpowers --skill test-driven-developmentOr paste this into your coding agent: Install the agent skill test-driven-development from github.com/obra/superpowers.
A skill can include scripts that run on your computer, so read its source first.
What Test-Driven Development does
Test-Driven Development is one of the skills in Superpowers, Jesse Vincent's open-source method for AI coding agents. It loads when the agent implements any feature or bug fix, before it writes implementation code. The rule is strict: "No production code without a failing test first." If code was written before its test, the agent deletes it and starts over, and does not keep it as a reference.
Under Test-Driven Development, each change follows red, green, refactor. The agent writes one small test for one behavior, runs it and confirms it fails for the expected reason, and writes the simplest code that passes. It then runs the project's whole test suite, not just the new file, and reports any failure by name. Cleanup comes only after the tests pass. Exceptions such as throwaway prototypes, generated code or configuration files need your permission.
A guide bundled with Test-Driven Development, writing-good-tests.md, covers the tests themselves: name the break each test should catch, assert on real behavior instead of mocks, keep test-only code out of production classes, and learn what a dependency does before replacing it with a mock. The skill also lists the excuses agents give for skipping tests, such as "too simple to test" or "I'll test after", with an answer to each.
When to use Test-Driven Development
- Your agent writes code first and adds tests afterwards, if at all.
- You are fixing a bug and want a test that proves it is gone and stays gone.
- Your agent's tests pass but only check mocks, not real behavior.
When to pick something else
- You have a bug and do not know its cause yet: start with Systematic Debugging, which hands the fix to this skill.
Which agents Test-Driven Development works in
Jesse Vincent documents Test-Driven Development for Claude Code, Codex (app and CLI), Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Antigravity, Devin CLI, Factory Droid, Grok Build CLI, Kimi Code, Pi, Qwen Code, Hermes Agent, Muse. The open skills CLI also installs it into 78 agents, including Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode (we listed it with the CLI on October 1, 2026). See where each agent looks for skills.
Superpowers is written in Claude Code's vocabulary (subagent dispatch, todos, the Skill tool) and ships tool mappings for Codex, Gemini CLI, Pi, Antigravity, Hermes Agent and Muse. Installed as the full plugin, a session-start hook loads Using Superpowers so the agent reaches for skills on its own; one skill installed with the skills CLI gets no hook and may point to sibling skills you do not have.
Test-Driven Development license
Test-Driven Development is published under MIT.
Questions people ask
What does the TDD skill do if the agent already wrote the code?
It tells the agent to delete that code and start over from a failing test, not keep it as a reference. Exceptions such as throwaway prototypes, generated code or configuration files need your permission.
Can I install only the TDD skill without the rest of Superpowers?
Yes: npx skills add obra/superpowers --skill test-driven-development installs just this folder. It still refers to sibling skills such as Systematic Debugging, and without the full plugin no session-start hook reminds the agent to use it.
Related skills for testing and debugging
- Mutation testing: mutation-testing is Trail of Bits' agent skill for configuring mutation testing campaigns with its mewt or muton tools, reading surviving mutants, telling equivalent mutants from real test gaps, and hunting bugs they expose.
- Playwright CLI: playwright-cli is Microsoft's agent skill for driving a real browser from the terminal: open pages, click and fill by element reference, take snapshots and screenshots, mock requests and generate Playwright tests.
- TDD: tdd is Matt Pocock's agent skill for test-driven development: the agent agrees which public interfaces to test with you, then works one failing test and one minimal fix at a time.
- Webapp Testing: Webapp Testing is Anthropic's open-source agent skill for testing local web apps: the agent writes Python Playwright scripts that click through your app, take screenshots and read console logs.
More from Jesse Vincent
- Brainstorming: Brainstorming is an agent skill from Superpowers that makes your coding agent work out what you want and agree a design with you before it writes any code.
- Diagnosing Superpowers: Diagnosing Superpowers is an agent skill from Superpowers that reads a session's transcripts when work went wrong and reports what happened, with every finding tied to a file and line.
- Dispatching Parallel Agents: Dispatching Parallel Agents is an agent skill from Superpowers: when several problems are independent, your agent sends a focused subagent to each at once, then checks the results together.
- Executing Plans: Executing Plans is an agent skill from Superpowers in which your agent works through a written plan itself, task by task with tests, then gets one fresh review of the whole branch.