tdd

Enforce test-driven development by requiring a failing test before production code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-Driven Development enforces writing tests before production code to ensure correct behavior, catch regressions early, and guide design.

Core Features & Use Cases

  • Red-Green-Refactor: write a failing test, verify failure, implement minimal code to pass, then refactor.
  • MANDATORY verification: run tests to confirm failure and success, ensuring the feature is truly implemented.
  • Debugging & Quality Assurance: use TDD to drive robust APIs, algorithms, and data transformations by clarifying requirements first.

Quick Start

Start by writing a failing test, then implement only enough code to make it pass, and 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 do I start writing unit tests before production code?

To start writing unit tests before production code, follow the red-green-refactor method: write a failing test, implement minimal code to pass, then refactor while keeping tests green. This test-first workflow ensures correct behavior and catches regressions early.

What is the red-green-refactor workflow in software engineering?

The red-green-refactor workflow is a test-driven development cycle where you write a failing test, verify the failure, implement minimal code to make it pass, and then refactor the code while keeping all tests green.

How do I apply test-driven development to API handlers and data transformations?

Apply test-driven development to API handlers and data transformations by writing explicit failing tests that clarify requirements first. Run mandatory verifications to confirm test failure before implementing the minimal logic needed to pass.

Why do I need to verify a test failure before implementing the feature?

Verifying a test failure before implementing the feature is a mandatory step in test-driven development to ensure the test itself is valid and that the production code actually causes it to pass, preventing false positives.

Does test-driven development work for algorithms and business logic?

Yes, test-driven development is specifically recommended for tasks involving algorithms, business logic, data transformations, and API handlers, using stage gating and refactoring to drive reliable code design and robust quality assurance.

When should I not use test-first development for a new feature?

Test-first development may not suit exploratory prototyping where requirements are undefined, as the methodology requires explicit failing tests and clear requirements before any production code implementation can begin.