# Tdd Cycle

> Red-Green-Refactor test-driven development cycle

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

---


# TDD Cycle

## Description
Enforces the Red-Green-Refactor TDD cycle: write a failing test, make it pass, then refactor. No code is written before a test exists.

## When to Use
- When implementing any new feature
- When fixing a bug
- When refactoring existing code

## Process
1. **RED**: Write a failing test for the desired behavior
2. Verify test fails (confirm test is valid)
3. **GREEN**: Write minimal code to make the test pass
4. Verify test passes
5. **REFACTOR**: Clean up code while keeping tests green
6. Commit with message format: `RED|GREEN|REFACTOR: description`

## Rules
- Production code is only written to make a failing test pass
- Delete any code written before tests
- Never skip the RED phase

## Agent Assignment
- Primary: opencode

