test-driven-development

Guide test-first development with failing tests before code changes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams enforce a disciplined development process by ensuring tests drive every change, reducing bugs and regressions.

Core Features & Use Cases

  • Write a failing test before writing the code that makes it pass (RED).
  • Follow GREEN and REFACTOR steps to keep implementation minimal and tests green.
  • Use the Prove-It pattern to reproduce and verify bug fixes before changing production code.
  • Maintain lean documentation and a clear test pyramid to guide ongoing development.

Quick Start

Write a failing test first for a bug scenario, then implement the smallest change to make the test pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce test-driven development when fixing bugs?

Test-driven development for bug fixes uses the Prove-It pattern to reproduce the bug with a failing test before changing production code. You write a deterministic test that validates the expected behavior, then implement the smallest change to make it pass.

What is the TDD workflow for writing new features?

The TDD workflow follows RED, GREEN, and REFACTOR steps. You write a failing test first, implement minimal code to make the test pass, then refactor while keeping tests green to ensure robust behavior and traceable design decisions.

How do I start unit and integration testing for a new feature?

Start unit and integration testing by writing a failing test for the specific feature scenario. Maintain a clear test pyramid to guide ongoing development, ensuring deterministic validation and minimal changes that guard against regressions.

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

Yes, test-first development applies to refactors by ensuring robust tests guard against regressions. You write deterministic tests to validate existing behavior before making minimal changes, keeping the implementation lean and traceable throughout the process.

Why does test-driven development require writing a failing test first?

Test-driven development requires a failing test first to enforce concrete requirements and validate behavior. This RED step ensures the test actually checks the feature or bug fix, preventing false positives and driving minimal, traceable design decisions.

What's the best way to validate behavior during test-driven development?

The best way to validate behavior is through deterministic unit and integration tests. By maintaining a clear test pyramid and following the GREEN and REFACTOR steps, you ensure tests stay green and continuously validate the expected behavior.