tdd

Enforce test-first development with red-green-refactor cycles for implementation tasks.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/heymishy/2x2-v3-28-03-20216 --skill tdd-heymishy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/heymishy/2x2-v3-28-03-20216/tree/main/.github/skills/tdd
Command: npx skills add https://github.com/heymishy/2x2-v3-28-03-20216 --skill tdd-heymishy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a disciplined, test-first approach to software tasks, ensuring no production code is written before a failing test is in place. It codifies the RED-GREEN-REFACTOR loop and pairs well with systematic debugging when stuck on a failing task.

Core Features & Use Cases

  • Red-Green-Refactor cycle as the standard workflow for every task
  • Mandatory failing test before implementation
  • Clear pass/fail verification and disciplined refactor

Quick Start

Write a failing test first, run it to observe the failure, then implement the minimal production code to pass.

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 minimal code to pass it, then refactor. The red-green-refactor cycle enforces this discipline for new features, bug fixes, and refactors across software projects.

How do I implement a new feature using test-first development?

To implement a feature with test-first development, write a failing test for the desired behavior first, run it to verify the failure, then write the minimal production code required to satisfy the test suite and pass the test.

Can I use test-driven development for bug fixes and refactoring existing code?

Yes, test-driven development applies to bug fixes and refactoring existing code. You write a failing test that reproduces the bug or verifies the refactored behavior, then implement minimal production code to make the test suite pass.

When should I not use a strict test-first development approach?

A strict test-first approach may not suit exploratory prototyping or throwaway scripts where writing failing tests beforehand adds overhead without yielding long-term software engineering discipline or behavior verification.

Why do my tests need to fail before writing production code in TDD?

Tests must fail first in TDD to prove they actually validate the target behavior and detect the missing implementation. Observing the failure ensures the test suite is meaningful before writing minimal production code to pass it.