tdd

Enforces vertical-slicing, behavior-driven tests with red-green-refactor workflow for software engineering tasks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the common pitfalls of test-driven development, such as horizontal slicing and testing implementation details rather than behavior, ensuring your test suite remains a reliable asset rather than a maintenance burden.

Core Features & Use Cases

  • Vertical Slicing Workflow: Guides you through the tracer bullet approach, ensuring each test verifies a single, user-facing behavior.
  • Interface Design Principles: Provides actionable advice on creating testable, deep modules with minimal interfaces.
  • Refactoring Guardrails: Establishes clear rules for when to refactor, ensuring you only do so when the system is in a green state.

Quick Start

Apply the tdd skill to help me implement a new feature using the red-green-refactor cycle while ensuring my tests focus on public behavior.

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 focus on behavior instead of implementation details?

Behavior-driven testing verifies public interfaces through vertical slicing, ensuring each test checks a single user-facing action. This approach avoids implementation-coupled mocking, keeping your test suite refactor-resilient and preventing tests from breaking during internal code changes.

What is the best way to implement the red-green-refactor cycle for new software features?

The red-green-refactor cycle is implemented by writing a failing behavior test, making it pass with minimal code, then refactoring while green. This workflow enforces clean interface design and uses vertical slicing to guide development tracer-bullet style from start to finish.

How does vertical slicing improve test-driven development workflows?

Vertical slicing improves TDD by guiding the tracer bullet approach, ensuring each test verifies a single, user-facing behavior through the entire stack. This prevents horizontal slicing pitfalls, keeping tests focused on public behavior rather than internal implementation details.

When should I refactor my code during test-driven development?

You should only refactor during test-driven development when the system is in a green state, meaning all tests are passing. Establishing clear refactoring guardrails ensures you never refactor against failing tests, preventing unstable code and maintaining a reliable test suite.

Why do my unit tests break every time I refactor my code?

Tests break during refactoring when they are coupled to implementation details rather than public behavior. By applying behavior-driven testing patterns, dependency injection, and SOLID principles, you create deep modules with minimal interfaces that remain refactor-resilient.

Can I apply TDD principles to existing codebases that need clean code refactoring?

Yes, TDD principles apply to refactoring existing code by establishing clear guardrails for when the system is green. You can use behavior-driven testing patterns and SOLID principles to redesign interfaces into deep modules, ensuring robust, refactor-resilient test suites.