Library / Build

Scaffold with TDD

Lock behavior with tests before writing the implementation.

Build testing tdd workflow Claude Code
The prompt
Write failing tests for <behavior> first and show them to me. Once I confirm, implement until they pass. Don't modify the tests without asking.

Why it works

Tests-first gives the model an executable definition of “done” and a tight feedback loop. The “don’t modify the tests” rule stops it from quietly weakening the spec to make things pass.

Fill in

  • <behavior> — the behavior to specify, with example inputs/outputs.

Follow-ups

  • “All green — now refactor the implementation, keeping tests untouched.”