test-driven-development

Enforce test-first development with a minimal Red-Green-Refactor cycle.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/jr2804/prompts --skill test-driven-development-jr2804
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/jr2804/prompts/tree/main/skills/development/test-driven-development
Command: npx skills add https://github.com/jr2804/prompts --skill test-driven-development-jr2804

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development (TDD) enforces writing a failing test before implementing production code to guide design and catch regressions early.

Core Features & Use Cases

  • Red-Green-Refactor cycle to drive incremental, reliable implementation.
  • Improves code quality by validating behavior with real tests rather than ad-hoc checks.
  • Use Case: When adding a feature or fixing a bug, write the failing test first, implement the minimal code to pass, then refactor.

Quick Start

Write a failing test for the desired behavior, add the minimal production code to pass, and then refactor for readability and maintainability.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the test-first development workflow for building reliable features?

The Red-Green-Refactor cycle drives incremental implementation by having you write a failing test, add minimal production code to pass it, and then refactor. This test-first workflow improves software quality by validating behavior with real tests.

How do I apply test-driven development when fixing bugs or adding features?

When fixing bugs or adding features, write a failing test that captures the desired behavior, implement the minimal production code to make it pass, and then refactor for readability. This validates behavior with real tests rather than ad-hoc checks.

Does test-driven development require using mocks to validate behavior?

No, this test-driven development approach emphasizes using real tests rather than mocks to validate behavior. This ensures your Red-Green-Refactor cycle accurately verifies production code functionality and catches regressions early.

Can I use test-first development for refactoring existing code?

Yes, test-driven development applies to refactoring across any project. You write a failing test to verify the desired behavior, implement the minimal code to pass, and then refactor for readability and maintainability within the Red-Green-Refactor cycle.

What is the difference between test-driven development and ad-hoc code checking?

Test-driven development replaces ad-hoc checks with a structured Red-Green-Refactor cycle that validates behavior using real tests. This test-first workflow enforces writing failing tests before production code to guide design and catch regressions early.