tdd-red-green-refactor

Enforce red/green/refactor discipline with failing tests and minimal production code.

50|7|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill tdd-red-green-refactor-loiane
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-red-green-refactor
Source: https://github.com/loiane/specs-driven-development-spring-angular/tree/main/.windsurf/skills/tdd-red-green-refactor
Command: npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill tdd-red-green-refactor-loiane

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces strict test-driven development discipline for Phase 4, ensuring a failing test exists before any production code is written and guiding structured validation through the harness and logs.

Core Features & Use Cases

  • Red/Green/Refactor discipline that requires a failing test, minimal production code, and a clean refactor to simplify implementation.
  • State tracking and logging via .tdd-state.json and 05-implementation-log.md to maintain an auditable progress history.
  • Phase-4 readiness across tasks to prevent guesswork and ensure verifiable progress.

Quick Start

Begin by writing a failing RED test, then implement the minimum production code to pass, and log the results per the implementation log template.

Frequently Asked Questions about tdd-red-green-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce strict test-driven development discipline for my implementation tasks?

To enforce strict test-driven development discipline, you must maintain a failing test in .tdd-state.json before writing any production code. This ensures verifiable, test-first progress across implementation tasks by guiding structured validation through logs.

What is the red green refactor workflow in TDD?

The red green refactor workflow in TDD requires writing a failing test first, implementing minimal production code to pass it, and then cleaning up the design. This structured cycle prevents over-engineering and ensures verifiable progress tracking.

How do I track TDD state and log implementation results?

You track TDD state and log implementation results by updating .tdd-state.json and the 05-implementation-log.md file. This maintains an auditable progress history and documents the outcomes of each development phase.

Do I need a failing test before writing production code in Phase 4?

Yes, you need a failing test before writing production code in Phase 4. The workflow requires maintaining a failing test state to prevent guesswork and ensure strict test-first development readiness across all tasks.

What are the four phases of TDD implementation?

The four phases of TDD implementation are red, green, refactor, and simplify. You begin by writing a failing red test, implement minimal code to pass it, clean up the design, and log the results.

How do I prevent guesswork during Phase 4 task implementation?

You prevent guesswork during Phase 4 task implementation by enforcing red/green/refactor discipline and tracking state in .tdd-state.json. This structured validation ensures verifiable progress and test-first readiness for every task.