Test-first development guide covering the RED-GREEN-REFACTOR cycle, minimal-code rules, and test prioritization.

CCM score
45 of 100
skills.sh installs
1.1K
GitHub stars
50.3K
last updated
Jul 14, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the RED, GREEN, and REFACTOR phases with rules for failing tests, minimal implementation, and green-only refactoring
  • Includes the Three Laws of TDD, the AAA test structure, and a priority order of happy path, errors, edges, and performance
  • Lists anti-patterns such as skipping the RED phase, writing tests after code, and testing implementation over behavior
  • Designed for new features, bug fixes, and complex logic, with guidance to skip TDD for exploratory or UI layout work

Install

$ npx -y skills add sickn33/agentic-awesome-skills --skill tdd-workflow -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

TDD Workflow

Write tests first, code second.


1. The TDD Cycle

πŸ”΄ RED β†’ Write failing test
    ↓
🟒 GREEN β†’ Write minimal code to pass
    ↓
πŸ”΅ REFACTOR β†’ Improve code quality
    ↓
   Repeat...

2. The Three Laws of TDD

  1. Write production code only to make a failing test pass
  2. Write only enough test to demonstrate failure
  3. Write only enough code to make the test pass

3. RED Phase Principles

What to Write

FocusExample
Behavior"should add two numbers"
Edge cases"should handle empty input"
Error states"should throw for invalid data"

RED Phase Rules

  • Test must fail first
  • Test name describes expected behavior
  • One assertion per test (ideally)

4. GREEN Phase Principles

Minimum Code

PrincipleMeaning
YAGNIYou Aren't Gonna Need It
Simplest thingWrite the minimum to pass
No optimizationJust make it work

GREEN Phase Rules

  • Don't write unneeded code
  • Don't optimize yet
  • Pass the test, nothing more

5. REFACTOR Phase Principles

What to Improve

Details

Repository
github.com/sickn33/agentic-awesome-skills
Category
Testing & QA
First seen
May 16, 2026

More from sickn33/agentic-awesome-skills

All 682

Similar to Tdd Workflow

More Testing & QA