tdd

Guide developers through Red-Green-Refactor cycles with failing tests.

1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/bcmcpher/my-skills --skill tdd-bcmcpher
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/bcmcpher/my-skills/tree/main/plugins/programming-tools/skills/tdd
Command: npx skills add https://github.com/bcmcpher/my-skills --skill tdd-bcmcpher

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write code using strict test-first workflows to ensure tests define and constrain behavior before implementation, reducing wasted effort.

Core Features & Use Cases

  • Enforces Red → Green → Refactor cycles to drive incremental design.
  • Provides contract-driven test scaffolding for API or feature development.
  • Useful when starting from a spec to design APIs through tests and validation.

Quick Start

Start by drafting a failing test for the target feature, then implement only enough code to pass that test.

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 (TDD) is a test-first workflow where you write a failing test, implement only enough code to pass it, and then refactor. This red-green-refactor cycle drives incremental design and constrains behavior before implementation.

How do I start implementing a new API feature using test-first development?

To start test-first development for a new API, draft an initial failing test that defines the target behavior, then implement the minimum code required to pass that test. This provides contract-driven test scaffolding to validate your design.

When should I use test-driven development for my software engineering projects?

Use test-driven development when starting new features, APIs, or modules from a spec. It is most useful for designing APIs through tests and validation, ensuring tests define behavior and drive design before you write implementation code.

Does strict test-first development work when starting from a project specification?

Yes, test-first development works directly from a project specification by translating spec requirements into an initial failing test. This approach designs APIs through tests and validation, reducing wasted effort by constraining behavior upfront.

Why write a failing test before implementing the code to make it pass?

Writing a failing test before implementation ensures tests define and constrain behavior before code is written. This reduces wasted effort, drives incremental design across project contexts, and provides clear workflow guidance for new features.