# Tdd

> Test-driven development workflows and red-green-refactor loops

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

---


# Test-Driven Development (TDD) Skill

This skill guides the implementation of features using the TDD lifecycle.

## When to use this skill
- When developing new features following strict TDD constraints.
- When refactoring legacy code safely by writing tests first.

## Guidelines
- **Red:** Write a failing test for the next piece of functionality. Ensure it fails for the correct reason.
- **Green:** Write the absolute minimum amount of code necessary to make the test pass.
- **Refactor:** Improve the code quality, remove duplication, and optimize while ensuring tests remain green.
- **Wait on edge cases:** Don't write generalized code until the tests explicitly demand it through diverse test cases.

