---
title: "Test-Driven Development (TDD)"
type: skill
id: "superpowers/dev-workflow/test-driven-development"
category: "Engineering"
publisher: "Jesse Vincent"
license: "MIT"
source: "https://github.com/obra/superpowers/tree/22f0b46"
canonical: "https://labs.pho.chat/en/skills/superpowers/dev-workflow/test-driven-development"
open_in_pho: "https://pho.chat/customize?item=superpowers%2Fdev-workflow%2Ftest-driven-development&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library"
---

# Test-Driven Development (TDD)

Use when implementing any feature or bugfix, before writing implementation code

Source: Jesse Vincent (MIT), copied at a pinned commit. Free to use. Part of the Phở Skills library (https://labs.pho.chat/en/skills).
Skill set: Dev workflow (https://labs.pho.chat/en/skills/superpowers/dev-workflow.md).

## What it covers
- Overview
- When to Use
- The Iron Law
- Red-Green-Refactor
  - RED - Write Failing Test
  - Verify RED - Watch It Fail
  - GREEN - Minimal Code
  - Verify GREEN - Watch It Pass
  - REFACTOR - Clean Up
  - Repeat
- Good Tests
- Common Rationalizations
- Red Flags - STOP and Start Over
- Example: Bug Fix
- Verification Checklist
- When Stuck
- Debugging Integration
- Final Rule

## Other skills in this set
- [Verification Before Completion](https://labs.pho.chat/en/skills/superpowers/dev-workflow/verification-before-completion.md): Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims…
- [Code Review Reception](https://labs.pho.chat/en/skills/superpowers/dev-workflow/receiving-code-review.md): Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not…

## Use it
- In Phở: open https://pho.chat/customize?item=superpowers%2Fdev-workflow%2Ftest-driven-development&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library and press Try, or add it so Phở loads it whenever a request matches. Phở works with your own API key (OpenAI, Anthropic, Google and others).
- Full instructions (original SKILL.md, unchanged): https://labs.pho.chat/skills/raw/superpowers/dev-workflow/skills/test-driven-development/SKILL.md
- Original files: https://github.com/obra/superpowers/tree/22f0b46 (MIT).
- Full machine-readable index: https://labs.pho.chat/skills.json
