tdd

Guides test-driven development using the red-green loop with seam-based testing.

Updated Sep 13, 2026
One-click install
npx skills add https://github.com/U1traVeno/skills --skill tdd-u1traveno
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/U1traVeno/skills/tree/main/profiles/matt/tdd
Command: npx skills add https://github.com/U1traVeno/skills --skill tdd-u1traveno

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after implementation often produces brittle, implementation-coupled tests that break during refactors and fail to verify real behavior. This Skill enforces a disciplined red-green TDD loop so every test verifies observable behavior through public interfaces. ## Core Features & Use Cases - Red-Green Loop Rules: Enforces writing a failing test first, then only enough code to pass it, one vertical slice at a time. - Seam Identification: Requires agreeing on public interface seams with the user before any test is written, focusing effort on critical paths. - Anti-Pattern Detection: Flags implementation-coupled, tautological, and horizontally-sliced tests with concrete good/bad examples. - Mocking Guidelines: Restricts mocks to system boundaries like external APIs, time, and file systems, with dependency injection patterns. - Use Case: When building a checkout feature, use this Skill to write a failing integration test like "user can checkout with valid cart" first, then implement the minimal code to make it pass. ## Quick Start Use the tdd skill to build this feature test-first, starting by agreeing on the seams we should test.

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 with the red-green loop?▼

Write one failing test at a public interface seam first, then write only enough code to make it pass, and repeat one vertical slice at a time. Do not write all tests upfront or add speculative features beyond the current failing test.

What is a seam in test-driven development?▼

A seam is the public boundary where you observe behavior without reaching inside the code, such as a module's public interface. 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: external APIs, time, randomness, and sometimes databases or file systems. Never mock your own classes or internal collaborators, and prefer dependency injection plus SDK-style interfaces to make boundary mocking straightforward.

Why do my tests break every time I refactor code?▼

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

What is a tautological test and how do I avoid it?▼

A tautological test recomputes the expected value the same way the implementation does, so it passes by construction and can never catch a bug. Use independent expected values such as known literals, worked examples, or specification outputs.