tdd

Drive test-first development through red-green-refactor workflows with behavior-focused tests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use this Skill when you need to build features or fix bugs with confidence while keeping tests aligned to real user behavior. It helps you avoid brittle, implementation-coupled test suites and keeps each change moving in small, verifiable steps.

Core Features & Use Cases

  • Planning the interface: Clarifies what public API and behaviors should exist before coding.
  • Tracer-bullet delivery: Guides one test → one implementation → repeat, so progress stays visible and controlled.
  • Refactor-safe testing: Encourages integration-style tests, limited mocking at boundaries, and refactoring only after green.
  • Use cases: Adding a checkout flow, fixing a bug in a service, or hardening a module with behavior-focused tests.

Quick Start

Ask the AI to help you plan the first behavior to test, write one failing test, implement the minimum code to pass it, and then refactor safely after the suite is green.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I start writing behavior-focused tests for a new feature?

Behavior-focused tests target public APIs to verify user-facing functionality, ensuring tests remain robust during refactoring. They help avoid brittle suites by validating actual system behavior rather than internal implementation details.

What's the best way to structure test-first development to avoid implementation-coupled suites?

The best way to structure test-first development is applying red-green-refactor: write one failing test, implement minimal code to pass it, then refactor only after the suite is green. This keeps changes small and verifiable.

When should I use mocking in integration testing workflows?

Use mocking in integration testing only at external boundaries to maintain behavior-focused validation. Limiting mocking prevents implementation coupling and ensures tests verify real interactions across modules rather than isolated internal logic.

Can I use incremental refactoring to fix bugs without breaking existing behavior?

Yes, you can use incremental refactoring to fix bugs safely by first writing a failing test that reproduces the bug, implementing the minimal fix to make it pass, and refactoring only after the entire test suite is green.

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

Your test suite breaks during refactoring because tests are likely coupled to implementation details rather than public API behavior. Writing integration-style tests through public APIs prevents this brittleness and allows safe internal refactoring.