Test-Driven Development Skill logo

Test-Driven Development Skill

Visit

Superpowers' TDD skill makes coding agents write a failing test first, watch it fail, then write minimal code: red-green-refactor with no exceptions.

Share:
View alternatives

Test-Driven Development is a skill from Superpowers, Jesse Vincent's open-source methodology for coding agents (skill source). It activates whenever an agent implements a feature or fixes a bug, before any implementation code is written, and holds the agent to strict red-green-refactor.

Its core claim: if you did not watch the test fail, you do not know whether it tests the right thing.

Key Features

  • The iron law: "No production code without a failing test first." Code written before its test is deleted and rewritten from the test, not kept "as reference".
  • Verify red: the agent runs the test and confirms it fails for the expected reason (missing feature, not a typo). A test that passes immediately is testing existing behavior.
  • Minimal green: only enough code to pass. The skill shows an over-engineered retry function with unrequested options as the thing to avoid.
  • Whole-suite check: a green run of the new test file is not a green suite; the agent runs the project's full test command and reports any failure by name.
  • Rationalization table: rebuttals to "too simple to test", "I'll test after" and "already manually tested".
  • Companion file writing-good-tests.md on test quality.

Use Cases

  • New features, bug fixes, refactors and behavior changes.
  • Exceptions the skill allows only with your approval: throwaway prototypes, generated code and configuration files.

Pricing

Free and open source under the MIT license. Prime Radiant, the company behind Superpowers, sells commercial support to enterprises. The practical cost is tokens: process skills add questions, reviews and subagent runs.

Getting Started

Superpowers installs as one plugin, so this skill arrives with the rest of the library (15 skills in v6.4.1). In Claude Code run /plugin install superpowers@claude-plugins-official. Cursor uses /add-plugin superpowers, Gemini CLI uses gemini extensions install https://github.com/obra/superpowers, and the README lists commands for Codex, GitHub Copilot CLI, OpenCode, Pi and other harnesses. Skills trigger on their own; you can also ask for one by name. Then ask for a feature normally and watch for the failing test before the implementation.

Limitation: the rules are strict by design. Deleting pre-written code can feel wasteful, and projects without a fast test runner will slow the loop down.

FAQ

Does it work outside JavaScript?

Yes. Examples use TypeScript, but the process is language-agnostic and names pytest and cargo test too.

Can I skip it for a spike?

Ask for a throwaway prototype explicitly; that is a listed exception.

Alternatives

Conclusion

The skill that most changes how an agent writes code. Pair it with Systematic Debugging for bug work. More in the skills hub.

Comments

No comments yet. Be the first to comment!