tdd

Guide red-green-refactor cycles for vertical-slice feature development.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/henrycashe26/my_skills --skill tdd-henrycashe26
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/henrycashe26/my_skills/tree/main/coding/tdd
Command: npx skills add https://github.com/henrycashe26/my_skills --skill tdd-henrycashe26

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the common pitfalls of software development, such as fragile tests, implementation-coupled code, and horizontal slicing, by enforcing a disciplined vertical-slice TDD workflow.

Core Features & Use Cases

  • Vertical Slicing: Guides the user to build features one test at a time, ensuring code is always verified by behavior rather than implementation.
  • Interface Design: Provides clear guidelines on creating deep modules and testable interfaces to ensure long-term maintainability.
  • Mocking Strategy: Offers a clear framework for when to mock (system boundaries) and when to avoid it, preventing brittle test suites.

Quick Start

Use the tdd skill to guide me through a red-green-refactor cycle for the new user authentication feature.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I practice test-driven development without creating fragile tests?

Test-driven development prevents fragile tests by enforcing a vertical-slice workflow that verifies code through public interface testing rather than implementation details. This approach maintains behavior-driven validation throughout the red-green-refactor cycle.

What is the best way to structure features using a red-green-refactor cycle?

The red-green-refactor cycle structures features by building one test at a time using vertical slices. This disciplined workflow ensures code remains continuously verified by behavior, prioritizing testable interfaces over horizontal slicing.

When should I mock dependencies during unit testing?

Mocking during unit testing should be strictly limited to system boundaries to prevent brittle test suites. Avoid mocking internal modules to maintain deep module design and ensure architectural integrity within your test-driven workflow.

Does test-driven development work for fixing bugs as well as new features?

Test-driven development applies to both feature development and bug fixing by enforcing the same red-green-refactor cycle. It prioritizes vertical slices and SOLID principles to ensure high-quality, behavior-driven code across all scenarios.

Why does my test suite break when I refactor my code?

Test suites break during refactoring when tests are coupled to implementation details rather than public interfaces. Applying deep module design and testing behavior through vertical slices prevents this brittleness and maintains architectural integrity.