tdd-quality

Audit unit and integration tests for behavior-first vertical RED-GREEN cycles.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

tdd-quality reduces the risk of writing tests that don’t reflect real behavior by correcting two common TDD failure modes: horizontal slicing and tests coupled to implementation details.

Core Features & Use Cases

  • Vertical tracer-bullet slicing: Ensures each RED→GREEN cycle lands one behavior at a time, so later tests are informed by what the system actually learned.
  • Behavior-first assertions: Guides you to write tests as specifications that exercise public APIs rather than mocks at every internal seam.
  • Refactor resilience check: Uses the “rename an internal function without changing behavior” litmus test to detect and rewrite fragile tests.

Use cases include rebuilding a failing TDD flow, improving the quality of an existing test suite, and preventing refactor pain from tests that verify private implementation rather than user-visible behavior.

Quick Start

Apply the tdd-quality lens while doing TDD by choosing one high-value behavior, writing a tracer-bullet test that exercises the public interface, and iterating until the test proves behavior rather than internal structure.

Frequently Asked Questions about tdd-quality

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

FAQPage Schema
How do I write unit tests that survive refactoring without breaking?

To write unit tests that survive refactoring, validate behavior through public APIs rather than mocking internal seams. Apply a refactor resilience check by renaming internal symbols; if tests break without behavior changes, rewrite them to be behavior-first.

What is horizontal slicing in TDD and how does it affect test quality?

Horizontal slicing in TDD occurs when tests target implementation layers rather than complete behaviors. It reduces test quality by coupling assertions to internal structure, causing tests to fail during refactoring even when user-visible capabilities remain unchanged.

How do I stop my TDD workflow from testing implementation details?

Stop testing implementation details by adopting behavior-first phrasing and vertical RED→GREEN cycles. Write tracer-bullet tests that exercise the public interface for one capability at a time, ensuring later tests are informed by actual system behavior rather than internal mocks.

When should I audit my existing test suite for refactor resilience?

Audit your test suite for refactor resilience when preparing for heavy codebase refactoring or rebuilding a failing TDD flow. Use the litmus check of renaming internal functions; fragile tests that break during this rename indicate dangerous coupling to private implementation.

Can I use behavior driven testing to fix a failing red green refactor cycle?

Yes, behavior driven testing fixes a failing red green refactor cycle by enforcing vertical tracer-bullet slicing. You write one high-value behavior test against the public interface, iterate until it passes, and prevent horizontal slicing that causes future refactor pain.

What's the best way to structure tests for user-visible capabilities in TDD?

Structure tests for user-visible capabilities by writing specifications that exercise public APIs rather than internal seams. Choose one high-value behavior, write a tracer-bullet test, and iterate vertically through the RED→GREEN cycle to ensure tests prove behavior instead of internal structure.