TDD Workflow

Guides step-by-step implementation of features using the Red-Green-Refactor cycle.

Updated Jan 11, 2026
One-click install
npx skills add https://github.com/kaneshin/incubator --skill tdd-workflow-kaneshin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TDD Workflow
Source: https://github.com/kaneshin/incubator/tree/main/plugins/dev-methodology/skills/tdd-workflow
Command: npx skills add https://github.com/kaneshin/incubator --skill tdd-workflow-kaneshin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams often struggle to start feature work without a clear, repeatable process. This skill provides a disciplined framework to practice Test-Driven Development (TDD) so that Red, Green, and Refactor stages guide implementation and uphold code quality.

Core Features & Use Cases

  • Red-Green-Refactor cycle: enforce writing a failing test first, then minimal implementation, followed by refactoring while all tests pass.
  • Test-first discipline: helps prevent defects by validating behavior before code exists.
  • Use Case: starting new features, changing requirements, or improving legacy code through iterative tests.

Quick Start

Use this skill to guide the implementation of a new feature by writing a failing test first, then implementing minimally to pass, and finally refactoring while keeping tests green.

Frequently Asked Questions about TDD Workflow

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

FAQPage Schema
How do I implement a feature using test-driven development?

Test-driven development implements features by writing a failing test first, then writing minimal code to pass it, and finally refactoring while keeping tests green. This Red-Green-Refactor cycle ensures behavior is validated before implementation and prevents defects.

What is the Red-Green-Refactor cycle and why does it matter?

The Red-Green-Refactor cycle is a TDD workflow: write a failing test (Red), implement minimal code to pass it (Green), then improve the code without breaking tests (Refactor). It enforces test-first discipline, catches defects early, and maintains code quality throughout development.

When should I use TDD for new features versus bug fixes?

TDD applies to starting new features, adding functionality, and fixing defects. Writing a failing test before code ensures the expected behavior is clear and prevents regression. It works for any scenario where you want strict test discipline guiding implementation.

Can I use TDD to improve legacy code?

Yes. TDD supports iterative improvement of legacy code through test-first changes. By writing failing tests before modifying existing code and refactoring while tests pass, you validate behavior and reduce the risk of introducing new defects.

Does test-first development prevent defects?

Test-first development prevents defects by validating expected behavior before code exists and enforcing minimal implementation. Writing tests first ensures requirements are clear and implementation covers only what's needed, reducing gaps and unintended behavior.