tdd

Enforce a red-green-refactor cycle for behavior-focused integration tests.

1|Updated Jan 6, 2026
One-click install
npx skills add https://github.com/Levezze/devkit --skill tdd-levezze
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/Levezze/devkit/tree/main/skills/tdd
Command: npx skills add https://github.com/Levezze/devkit --skill tdd-levezze

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you avoid brittle, implementation-coupled tests by teaching a disciplined test-driven development loop.

Core Features & Use Cases

  • Red-Green-Refactor TDD loop: Use tracer-bullet cycles to turn one behavior at a time from failing tests into passing code.
  • Behavior-focused integration testing: Write tests that exercise public interfaces so they survive refactors.
  • Mocking at boundaries: Prefer mocking only system boundaries (e.g., external APIs, databases, time) to keep tests meaningful.

Use case: When fixing a production bug, write an integration-style test that reproduces the behavior through the public API, implement the minimal change to go green, then refactor with confidence.

Quick Start

Ask your AI to apply the tdd loop to implement the next behavior by writing one integration-style red test against the public interface, implementing the smallest green change, and only then refactoring.

Frequently Asked Questions about tdd

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

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

Behavior-focused testing avoids brittle failures by mocking only external system boundaries like databases or APIs. This keeps integration tests meaningful and resilient against internal structural refactoring while verifying public interfaces.

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

The red-green-refactor cycle is a test-driven development loop where you write a failing test, implement the minimal code to pass it, and then refactor safely. It uses vertical-slice tracer bullets to build behavior incrementally.

How do I apply TDD when fixing a production bug?

When fixing a production bug, write an integration-style test reproducing the behavior through the public API, implement the minimal change to make it pass, and then refactor safely. This ensures the fix is verified and prevents regressions.

When should I use mocking in integration tests?

Mocking should be applied only at system boundaries like external APIs, databases, or time. Avoiding internal mocking keeps tests behavior-focused and resilient against refactoring.

Why are my unit tests brittle and coupled to implementation details?

Brittle tests occur when they are coupled to internal implementation details. Writing behavior-focused integration tests that verify public interfaces and mocking only system boundaries prevents these brittle failures during refactoring.