tdd

Guide developers through a RED-GREEN-REFACTOR cycle for test-driven development.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/Saturate/agents --skill tdd-saturate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/Saturate/agents/tree/main/skills/tdd
Command: npx skills add https://github.com/Saturate/agents --skill tdd-saturate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD provides a disciplined workflow that reduces defects by writing tests before implementation, guiding developers toward clearer requirements and safer changes.

Core Features & Use Cases

  • RED-GREEN-REFACTOR cycle for designing and validating code.
  • Prove-It pattern to reproduce and fix bugs with tests.
  • Consumer-driven interface testing to design usable APIs from the consumer's perspective.

Quick Start

Write a failing test that expresses the desired behavior, then implement the minimal code to make it pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a workflow where you write a failing test first, implement minimal code to pass it, then refactor safely. The red-green-refactor cycle enforces this discipline to reduce defects and guide incremental feature development.

How do I fix a bug using the prove-it pattern in test-driven development?

The prove-it pattern fixes bugs by first writing a test that reproduces the exact bug, confirming it fails, then implementing the code change to make that test pass, proving the defect is resolved.

How do I start writing tests before implementation in my software project?

Start test-driven development by writing a failing test that expresses the desired behavior, then write the minimal implementation code required to make that test pass, and finally refactor the code while keeping tests green.

Should I use mocks or real implementations when practicing test-driven development?

Test-driven development favors real implementations over mocks to ensure tests validate actual behavior and integration, reducing false positives while maintaining reliable test suites for safer code changes.

Can I apply test-driven development for both feature development and bug fixes?

Yes, test-driven development applies across software projects for both feature development and bug fixes, using the red-green-refactor cycle to design code and the prove-it pattern to reproduce and resolve defects.

When should I not use test-driven development for refactoring?

Test-driven development requires a reliable test suite before refactoring. If your project lacks existing test coverage or cannot express desired behavior as a test, this disciplined cycle may not be suitable.