tdd

Guides test-driven development through red-green cycles with seam-based test design.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/AliJ021/labelmod-core --skill tdd-alij021
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/AliJ021/labelmod-core/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/AliJ021/labelmod-core --skill tdd-alij021

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after code often produces brittle, implementation-coupled tests that break on refactors and fail to verify real behavior. This Skill enforces a disciplined red-green loop so every test verifies observable behavior through public interfaces. ## Core Features & Use Cases - Seam-Based Test Design: Identifies public interface boundaries before writing tests, ensuring tests survive refactors and target critical paths. - Anti-Pattern Detection: Flags implementation-coupled, tautological, and horizontally-sliced tests that pass by construction or break without behavior changes. - Mocking Guidelines: Defines when to mock (system boundaries only) and how to design mockable interfaces via dependency injection and SDK-style APIs. - Use Case: When adding a checkout feature, use this Skill to write one failing test at the checkout seam, implement the minimal code to pass it, then repeat in vertical slices instead of writing all tests upfront. ## Quick Start Ask the assistant to build the next feature using test-driven development with one failing test at a confirmed public seam before any implementation.

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 on a new feature?

Write one failing test at a confirmed public seam, then implement only enough code to make it pass, and repeat in vertical slices. Each test acts as a tracer bullet informed by the previous cycle rather than a batch written upfront.

What is a seam in test-driven development?

A seam is the public boundary where you observe behavior without reaching inside the code. Tests live at seams and never against internals, so they survive refactors that change implementation but not behavior.

When should I use mocks in unit tests?

Mock only at system boundaries such as external APIs, time, randomness, and sometimes databases or file systems. Never mock your own classes or internal collaborators, since that couples tests to implementation details.

Why do my tests break every time I refactor code?

Tests break on refactor when they are coupled to implementation details, such as mocking internal collaborators, testing private methods, or asserting call counts. Rewrite them to verify observable behavior through public interfaces instead.

What is a tautological test and why is it bad?

A tautological test recomputes the expected value the same way the code does, so it passes by construction and can never catch a bug. Expected values must come from an independent source such as a known literal or worked example.