# Tdd

> Use before writing any implementation code — enforces RED-GREEN-REFACTOR cycle.

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

---



# Test-Driven Development

## The Cycle

**RED → GREEN → REFACTOR**

Never skip RED. Never write code before a failing test exists.

## Steps

1. **Write the failing test** — specific, tests one behavior
2. **Run it and confirm it fails** — with the right error message
3. **Write minimal code to make it pass** — no more than needed
4. **Run it and confirm it passes**
5. **Refactor if needed** — tests still pass after refactor
6. **Commit** — small, frequent commits

## Anti-Patterns to Avoid

- Writing implementation before tests
- Tests that pass without any implementation (false green)
- Testing implementation details instead of behavior
- One giant test instead of small focused tests
- Skipping the refactor step

## Verification Command

Always show the exact command to run tests and expected output at each RED/GREEN step.

---

**Source:** [`hashgraph-online/awesome-codex-plugins`](https://github.com/hashgraph-online/awesome-codex-plugins) → `plugins/yimwoo/hotl-plugin/skills/tdd/SKILL.md`

