tdd

Guide red-green-refactor cycles with integration-style tests through public interfaces.

5|2|Updated Jan 10, 2017
One-click install
npx skills add https://github.com/brujack/dotfiles --skill tdd-brujack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/brujack/dotfiles/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/brujack/dotfiles --skill tdd-brujack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development guidance to keep tests focused on observable behavior rather than implementation details, preventing fragile tests that break during refactors and ensuring development proceeds in small, verifiable steps.

Core Features & Use Cases

  • Red-Green-Refactor workflow guidance: write one failing test, implement the minimal code to pass, then refactor.
  • Tracer-bullet approach for vertical slices: iterate one behavior at a time to avoid horizontal slicing and speculative work.
  • Test design and mocking rules: prefer integration-style tests through public interfaces and mock only system boundaries.
  • Interface and module design advice: deep modules, dependency injection, small surface areas, and refactor candidate checklists.
  • Use cases include implementing new features, fixing bugs with confidence, and establishing a repeatable test-first process for teams.

Quick Start

Use the tdd skill to guide a red-green-refactor cycle by writing one failing integration-style test for the next behavior, implementing the minimal code to pass, and then refactoring.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I do test-driven development without creating fragile tests that break during refactoring?

To practice test-driven development, write one failing integration test for the next behavior, implement the minimal code to make it pass, and then refactor. This red-green-refactor workflow proceeds in small, verifiable steps to ensure reliable feature delivery.

What is the best way to write integration tests for new features and bug fixes?

Vertical slicing in test-driven development means iterating one behavior at a time to build vertical tracer-bullet cycles. This approach avoids horizontal slicing and speculative work by ensuring each cycle limits scope to one failing integration test.

When should I use mocking in test-driven development?

You should use mocking in test-driven development only at system boundaries. Mocking rules prefer integration-style tests through public interfaces to ensure tests remain focused on observable behavior and prevent breaks during refactoring.

How does test-driven development help with interface and module design?

Test-driven development improves interface and module design by promoting deep modules, dependency injection, and small surface areas. It includes refactor candidate checklists to guide structural improvements after passing the minimal implementation code.

How do I avoid horizontal slicing when implementing new features?

To avoid horizontal slicing when implementing new features, apply a test-driven development tracer-bullet approach that drives vertical slices. Iterate one behavior at a time using public interfaces to ensure development proceeds in small, verifiable steps.