# Tdd

> Implement a behavior change with a focused failing regression first, the smallest coherent fix, and layered executable evidence.

- Skill: `njs14/tdd` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add njs14/tdd`
- Raw SKILL.md: https://api.skillmd.com/api/skills/njs14/tdd/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: njs14 (https://skillmd.com/u/njs14)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/njs14/tdd

---


# Develop from a failing behavior

Treat the request text that activated this skill as the behavior to add or repair.

Define the externally meaningful contract before editing production code. Locate the closest test
surface and write the smallest regression that fails for the intended reason. Run it and inspect the
failure; a syntax error, bad fixture, or unrelated failure is not a valid red phase.

Implement the smallest coherent production change that makes the contract true. Keep refactoring
separate until the test passes. Then run the focused test, nearby suite, static checks, and an
end-to-end observation proportional to risk. Add boundary cases discovered during implementation,
not speculative combinatorics.

If a failing-first test is impractical because the only surface is destructive, external, or not
locally reproducible, say why and establish the safest executable characterization available before
editing. Return red evidence, change, green evidence, and remaining untested risk.

Read [the public-interface testing method](references/pocock-tdd/README.md) for vertical slices, independent expected values, and meaningful boundary substitutes. Reuse settled testing decisions without repeated approval questions.

