tdd-workflow

Guide developers through the RED-GREEN-REFACTOR cycle for Test-Driven Development.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/raccioly/coach-gravity --skill tdd-workflow-raccioly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/raccioly/coach-gravity/tree/main/content/starter-kit/skills/tdd-workflow
Command: npx skills add https://github.com/raccioly/coach-gravity --skill tdd-workflow-raccioly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD improves software quality by ensuring tests define expected behavior before implementation, preventing regression and guiding design choices.

Core Features & Use Cases

  • RED phase: write failing tests to specify required behavior.
  • GREEN phase: implement minimal production code to pass tests.
  • REFACTOR phase: improve structure and maintain maintainability without introducing new failures.
  • AAA pattern: organize tests with Arrange, Act, Assert for clarity.
  • When to use: for new features, bug fixes, and refactors to ensure robust, maintainable code.

Quick Start

Run a small feature through a complete RED-GREEN-REFACTOR cycle, starting with a failing test and ending with a refactored passing implementation.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I implement test-driven development using the red-green-refactor cycle?

Test-driven development using the red-green-refactor cycle involves writing a failing test first to specify behavior, implementing minimal production code to pass it, and then improving the structure incrementally while keeping tests green.

What is the best way to structure tests for TDD?

The best way to structure tests for TDD is using the AAA pattern, which organizes tests into Arrange, Act, and Assert sections for clarity, ensuring you keep tests small with one behavior per test.

When should I use test-driven development for software development?

You should use test-driven development for software development when working on new features, bug fixes, or refactors, as it ensures tests define expected behavior before implementation and prevents regression.

How does the TDD workflow enforce minimal production code during the green phase?

The TDD workflow enforces minimal production code during the green phase by prompting developers to implement only what is necessary to pass the failing test, ensuring robust and maintainable software design.

How do I perform refactoring without introducing new test failures?

To perform refactoring without introducing new test failures, you improve the code structure during the refactor phase while strictly preserving the green tests, making small incremental refactors to maintain robustness.