tdd

Implements features and fixes bugs using red-green-refactor TDD workflows with integration-style tests.

Updated May 26, 2026
One-click install
npx skills add https://github.com/XWIlluDelu/agent-share --skill tdd-xwilludelu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/XWIlluDelu/agent-share/tree/main/lib/tdd
Command: npx skills add https://github.com/XWIlluDelu/agent-share --skill tdd-xwilludelu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TDD helps you build or fix features with confidence by using tests to drive the correct behavior through a repeatable red-green-refactor workflow.

Core Features & Use Cases

  • Vertical-slice TDD workflow: Use tracer bullets (one test at a time) to implement the behavior needed next, avoiding horizontal slicing that produces brittle or misguided tests.
  • Integration-style test emphasis: Prefer tests that verify observable behavior through public interfaces, so tests survive refactors.
  • Guided design for testability: Plan interface changes, design boundaries for mockability, and limit mocking to system boundaries.

Use case: When you need to fix a bug or add a feature, you can iterate behavior-by-behavior: write a failing integration-style test for the next user-facing capability, implement the minimal code to make it pass, then refactor safely without breaking the verified behavior.

Quick Start

Use the tdd skill to plan, write one failing integration-style test, implement the minimal behavior to go red-to-green, and refactor while keeping tests green.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development using a red-green-refactor loop?

Test-driven development applies a red-green-refactor loop by writing one failing integration-style test, implementing minimal behavior to pass it, then refactoring while keeping tests green.

What is vertical-slice TDD and how does it differ from horizontal slicing?

Vertical-slice TDD uses tracer bullets to implement one behavior at a time, delivering user-facing capabilities end-to-end. It avoids horizontal slicing, which builds layers separately and produces brittle or misguided tests.

When should I use integration-style tests instead of unit tests for feature construction?

Use integration-style tests when you need to verify observable behavior through public interfaces. These tests survive refactors better than unit tests and drive design by focusing on user-facing capabilities rather than internal implementation details.

How do I apply mocking at boundaries without creating brittle tests?

Limit mocking to system boundaries and external dependencies. Design interfaces for mockability at these edges, and prefer testing observable behavior through public interfaces so tests remain resilient during internal refactoring.

Can I use test-driven development to fix bugs or does it only work for new features?

Test-driven development supports both feature construction and bug fixing. For bugs, write a failing integration test that reproduces the issue, implement the fix to go red-to-green, then refactor safely without breaking verified behavior.

What are the limitations of test-first workflows for interface design?

Test-first workflows require vertical-slice iteration and clear behavior-focused test naming. Without proper interface planning and boundary design for mockability, tests can become brittle or fail to guide effective implementation.