tdd-discipline

Enforce a RED-GREEN-REFACTOR workflow requiring a failing test before production code.

1|1|Updated Oct 8, 2025
One-click install
npx skills add https://github.com/gvarela/prompts --skill tdd-discipline-gvarela
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-discipline
Source: https://github.com/gvarela/prompts/tree/main/claude-code/skills/tdd-discipline
Command: npx skills add https://github.com/gvarela/prompts --skill tdd-discipline-gvarela

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces a strict RED-GREEN-REFACTOR workflow so tests must fail before production code is written, reducing defects and rework.

Core Features & Use Cases

  • Enforce TDD cycle: Ensure a failing test is written before any implementation.
  • Guided workflow: Provides a clear path from RED to GREEN to REFACTOR for maintainable code.
  • Use Case: A developer writes a failing unit test for a new feature, then implements only enough code to make the test pass, followed by refactoring.

Quick Start

Use the tdd-discipline skill to start a test-first workflow on a new feature.

Frequently Asked Questions about tdd-discipline

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

FAQPage Schema
How do I enforce a test-first workflow for writing unit tests?

To enforce a test-first workflow, you require a failing unit test before implementing any production code, following a strict RED-GREEN-REFACTOR cycle to reduce defects and rework.

What is the RED-GREEN-REFACTOR cycle in test-driven development?

The RED-GREEN-REFACTOR cycle in test-driven development is a workflow where you write a failing test, implement the minimal production code to pass it, then refactor to improve structure while preserving behavior.

How do I start TDD for a new feature or bug fix?

To start TDD for a new feature or bug fix, write a failing unit test that defines the desired behavior, then write only enough production code to make the test pass before refactoring.

Can I use test-driven development across different programming languages and projects?

Yes, test-driven development can be applied across projects and languages, guiding developers through structured cycles to ensure tests drive design decisions regardless of the specific tech stack.

Why do I need a failing test before writing production code?

You need a failing test before writing production code to ensure the test actually validates the new behavior, reducing defects and preventing rework by enforcing a strict test-first development discipline.

When should I not use a strict test-driven development workflow?

A strict test-driven development workflow may not suit exploratory prototyping where behavior is undefined, as it requires a clear failing test to drive design decisions before any production code implementation.