tdd

Guide developers through red-green-refactor test-driven development cycles.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams and individual developers produce behavior-focused, maintainable tests and avoid brittle implementation-coupled test suites by guiding them through a disciplined red-green-refactor loop.

Core Features & Use Cases

  • Tracer-bullet workflow: Write one failing test, implement the minimal code to pass, then repeat to build features iteratively.
  • Testability-first design: Encourage small public interfaces, dependency injection, and integration-style tests that verify behavior not implementation.
  • Refactor guardrails: Clear checklist and rules (never refactor while red, focus on public APIs) to keep tests resilient during code evolution.
  • Use case: When adding a checkout flow or fixing a complex bug, use this Skill to plan behaviors to test, create a tracer-bullet test, implement the minimal change, and then safely refactor.

Quick Start

Start by writing a single failing test that asserts the desired public behavior, implement the minimal code to make it pass, and then refactor while running tests.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I start test-driven development for a new feature?

Test-driven development guides you through a red-green-refactor loop: write a single failing integration-style test for the desired behavior, implement the minimal code to pass, then refactor safely while tests stay green.

What is the red-green-refactor cycle and how does it prevent brittle tests?

The red-green-refactor cycle requires writing one failing behavior test, implementing minimal code to pass, and refactoring only while tests run green. It prevents brittle tests by focusing on public API behavior rather than implementation coupling.

How do I fix a complex bug using tracer-bullet integration tests?

Use a tracer-bullet workflow to fix complex bugs by planning behaviors to test, creating a single failing integration test for the expected behavior, implementing the minimal change to pass, and then safely refactoring.

Can I refactor code while my test suite is red?

No, you should never refactor while red. Refactor guardrails require tests to pass before refactoring, ensuring code evolution remains safe and behavior verification stays intact throughout the red-green-refactor loop.

How do I design public interfaces for testability in TDD?

Design public interfaces for testability by keeping them small, using dependency injection, and writing integration-style tests that verify behavior rather than implementation, ensuring resilience during code evolution and refactoring.

When should I use integration-style tests over unit tests in test-driven development?

Use integration-style tests in test-driven development when verifying behavior rather than implementation details. This approach encourages small public interfaces and dependency injection to produce maintainable, resilient test suites.