test-driven-developmentlisted
Install: claude install-skill StielChancellor/VibeGod-Tech-Team
<!-- Adapted from superpowers (https://github.com/obra/superpowers), MIT (c) Jesse Vincent. -->
# Test-Driven Development (TDD)
## Overview
Write the test first. Watch it fail. Write minimal code to pass.
**Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
**Violating the letter of the rules is violating the spirit of the rules.**
## Fits in the pipeline
TDD is the spine of **Stage 6 (Build)** and the **Stage 5 build plan** is written in TDD steps. The Stage 7 per-feature QA gate and Stage 8 ship gate refuse to advance without green tests. Priority: **user > skills > default**; `_shared/vibegod-principles.md` apply (#8 quality bar: no merge/ship without green; evidence-based completion only).
## When to Use
**Always:** new features, bug fixes, refactoring, behavior changes.
**Exceptions (ask the user):** throwaway prototypes, generated code, configuration files.
Thinking "skip TDD just this once"? Stop. That's rationalization.
## The Iron Law
```
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
```
Wrote code before the test? Delete it. Start over.
**No exceptions:** don't keep it as "reference", don't "adapt" it while writing tests, don't look at it. Delete means delete. Implement fresh from tests.
## Red-Green-Refactor
```dot
digraph tdd_cycle {
rankdir=LR;
red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
verify_red [label="Verify fails\ncorrectly", shape=diamond];