← All skills
🧪

Test-Driven Development

Real TDD, enforced. Your agent writes the failing test first, watches it fail, then writes only enough code to pass — and deletes anything written out of order.

Dev workflow Free Community pick

Plenty of agents claim to do test-driven development and then quietly write the implementation first and the tests afterwards, when they can't fail anymore. This Skill from Superpowers closes that loophole.

It hard-codes the red–green–refactor loop into the agent's workflow: no production code without a failing test first, minimal code to green, then refactor with the tests as a safety net. Code that appears before its test is treated as a process violation and removed.

What it does

Made with this Skill

ShowcaseExample output
$ pytest test_cart.py::test_discount_applies FAILED — AssertionError: total 100.0 != 90.0 ← red, on purpose … agent writes the discount rule — nothing else … $ pytest test_cart.py 4 passed in 0.31s ← green Next: refactor, suite stays green.

The loop in action: the failure comes first and is expected — it's the proof the test actually tests something.

Requirements

Source: obra/superpowers — MIT License. This is a community open-source skill listed for discovery; all credit to its authors.

Install

Paste this prompt to your agent — it fetches the Skill from the source repository (we don't host a copy):

Install the "Test-Driven Development" skill from its source repository: https://github.com/obra/superpowers/tree/main/skills/test-driven-development — fetch the SKILL.md there (and any files it references), place the skill in my agent's skills directory, and verify it loads in a fresh session.

Free Skill — no account, no card required.