tdd

Enforce the red-green-refactor cycle and define stable testing seams.

2|Updated Jul 13, 2026
One-click install
npx skills add https://github.com/chichex/skills --skill tdd-chichex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/chichex/skills/tree/main/claude/tdd
Command: npx skills add https://github.com/chichex/skills --skill tdd-chichex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the common pitfalls of testing, such as coupling tests to implementation details or writing tautological tests, ensuring that your test suite acts as a reliable specification rather than a maintenance burden.

Core Features & Use Cases

  • Seam Identification: Provides a framework for defining public interfaces where tests should be anchored to ensure they remain stable during refactoring.
  • Mocking Strategy: Offers clear rules on when to mock (system boundaries) and when to avoid it (internal collaborators), promoting better architectural design.
  • Loop Discipline: Enforces the red-green-refactor cycle, ensuring tests are written as tracer bullets that verify observable behavior.

Quick Start

Ask the tdd skill to help you identify the appropriate seams for the current module before writing your first failing test.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I write unit tests that don't break during refactoring?

To write refactoring-resilient unit tests, anchor them to stable public interfaces instead of internal implementation details. This approach defines clear testing seams, ensuring your suite specifies observable behavior without becoming a maintenance burden.

What is the red-green-refactor cycle in test-driven development?

The test-driven development red-green-refactor cycle enforces writing a failing test first, making it pass with minimal code, then refining. This loop discipline ensures tests act as tracer bullets verifying actual observable behavior.

When should I use mocking in unit testing?

Use mocking in unit testing exclusively at system boundaries to isolate external dependencies. Avoid mocking internal collaborators, as this practice promotes better architectural design and prevents tests from coupling to implementation details.

How do I identify testing seams before writing a failing test?

Identify testing seams by defining the public interfaces where tests should anchor before writing any failing test. This framework ensures your tests target stable boundaries, keeping the test suite reliable during subsequent code refactoring.

Why do my tests break when I refactor internal code?

Tests break during refactoring when they are coupled to internal implementation details rather than observable behavior. TDD practices prevent this by enforcing strict seam identification and avoiding implementation-coupled anti-patterns in your test suite.

Can test-driven development help with dependency injection?

Test-driven development supports dependency injection by defining clear boundaries for mocking at system edges. This strategy clarifies when to inject dependencies for external collaborators while keeping internal module interactions unmocked for better software quality.