test-driven-development

Automate the red-green-refactor cycle for test-driven feature implementation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Traditional development often lacks a disciplined testing approach, leading to unclear requirements, brittle changes, and delayed bug detection. This Skill guides teams to adopt a test-driven development workflow, ensuring tests drive design and verification before implementation.

Core Features & Use Cases

  • Red-Green-Refactor cycle: start with a failing test, implement minimal logic to pass, then refactor while preserving behavior.
  • Clear test structure and naming: promotes meaningful coverage and easier maintenance.
  • Use Case: when adding a new feature, fixing a bug, or refactoring, follow a test-first pattern to prevent regressions and improve design.

Quick Start

  • Explain how to apply TDD to a feature: write a failing test, implement minimal code, then refactor while keeping tests green.

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-driven development workflow for new features?

The test-driven development workflow enforces writing a failing test first, implementing minimal code to pass it, and then refactoring while preserving behavior. This prevents regressions and ensures clear requirements before feature implementation.

How do I apply red-green-refactor to fix bugs?

To apply red-green-refactor for bug fixes, write a failing unit test that reproduces the bug, implement the minimal logic to make it pass, and refactor the code while keeping tests green to prevent regressions.

When should I use a test-first approach in software engineering?

Use a test-first approach when adding new features, fixing bugs, or refactoring to drive reliable designs. It ensures tests prove behavior and prevents delayed bug detection common in traditional development.

Does test-driven development require specific unit-testing frameworks?

Test-driven development does not mandate specific unit-testing frameworks. It focuses on the workflow of writing minimal tests that prove behavior and using clear naming to drive design, applicable across any testing framework.

How do I structure unit tests to drive clean software design?

Structure unit tests with clear naming and minimal coverage that proves specific behavior. This meaningful coverage drives reliable designs and makes maintenance easier during the refactoring phase of the development cycle.