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.

Checked by CookiesForAI on : license and last change of the skill re-read from GitHub.

Written by

Install Test-Driven Development

Install only this skill with the skills CLI

Terminal
npx skills add obra/superpowers --skill test-driven-development

Or, in Claude Code, install the whole Superpowers plugin from Anthropic's official marketplace

Agent chat
/plugin install superpowers@claude-plugins-official

Or paste this into your coding agent: Install the agent skill test-driven-development from github.com/obra/superpowers. Checked by CookiesForAI on : license and last change of the skill re-read from GitHub. 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 ). 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.

More from Jesse Vincent

Lists that include test-driven-development