tdd

Enforce test-first development by writing failing tests before implementing code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents untested code, regressions, and design drift by forcing requirements to be specified as failing tests before implementation. It ensures behavior is documented, reproducible, and protected by automated checks so changes are safer and easier to reason about.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Drive small, verifiable steps by writing a failing test, implementing the minimal fix, and refactoring while keeping tests green.
  • Bug Reproduction and Fixes: Capture bugs with failing tests before fixing to guarantee the problem is fixed and prevented from regressing.
  • Design Guidance: Use tests to define APIs and expected behavior, aiding refactors, integration work, and clearer collaboration across teams.

Quick Start

Write a failing test that reproduces the desired behavior, run it to confirm the failure, implement the minimal change to make it pass, and then refactor while keeping all tests green.

Frequently Asked Questions about tdd

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

FAQPage Schema
How does test-driven development prevent regressions during refactoring?

Test-driven development prevents regressions by enforcing a failing test before implementation. You write a test, verify the failure, implement the minimal code to pass, and refactor while keeping the test suite green.

What is the red-green-refactor cycle for writing unit tests first?

The red-green-refactor cycle is a test-first workflow: write a failing test (red), implement the minimal code to pass (green), and refactor safely while keeping tests green to drive verifiable feature development.

How do I capture and reproduce a bug fix with a failing test?

To capture a bug fix with a failing test, write a test that reproduces the exact bug, run it to confirm the failure, implement the minimal fix to make it pass, and prevent future regressions automatically.

Can I use test-first development to guide API design and expected behavior?

Yes, test-first development guides API design and expected behavior by defining interfaces and requirements through failing tests before implementation, which aids refactors, integration work, and clearer team collaboration.

When should I not write tests first during feature development?

The metadata does not specify explicit limitations on when to avoid test-first development. The core focus is applying the red-green-refactor cycle to enforce behavior documentation and prevent design drift.

Do I need specific unit-testing frameworks to start writing failing tests?

No specific external dependencies or unit-testing frameworks are required. You need to define desired behavior as a failing test, confirm the failure, implement the minimal change to pass, and refactor safely.