tdd

Guide developers through a red-green-refactor test-driven loop with interface confirmation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a test-driven development workflow that ensures features begin from failing tests and contracts, helping teams ship reliable code faster and with clearer interfaces.

Core Features & Use Cases

  • Interface-first design: specify inputs, outputs, and behavior via failing tests before implementation.
  • Red-Green-Refactor discipline: drive development by writing minimal code to satisfy tests after a failure.
  • Safe incremental integration: incrementally build features with guardrails that catch regressions early, suitable for frontend and backend tasks.

Quick Start

Start by describing the feature's contract, write a failing test for it, then implement only enough code to pass the 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 loop work?

Test-driven development is a workflow requiring a failing test before implementation. The red-green-refactor loop means writing a failing test, implementing minimal code to pass it, then refactoring to ensure robust test coverage and prevent regressions.

How do I implement features using test-first design with explicit contracts?

To implement features using test-first design, define the feature's contract by specifying inputs, outputs, and behavior. Write a failing test for this interface, then implement only enough code to pass the test to ensure safe incremental integration.

Can I use test-driven development for both frontend and backend tasks?

Yes, test-driven development applies to both frontend and backend tasks. It enforces a disciplined workflow by requiring explicit contracts and failing tests before coding, which validates behavior and prevents regressions across the entire stack.

What is the best way to prevent regressions during code refactoring?

The best way to prevent regressions during code refactoring is to enforce a test-first development loop. By requiring a failing test before implementation and maintaining robust test coverage, you catch regressions early during incremental integration.

How do I start a feature with interface-first design in a test-driven workflow?

Start a feature with interface-first design by describing the feature's contract, specifying its inputs and outputs. Write a failing test for this contract, then implement only enough code to satisfy the test, ensuring safe incremental integration.