tdd

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

1|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/SevWren/Daily-Motivation-Brain-Helper --skill tdd-sevwren
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/SevWren/Daily-Motivation-Brain-Helper/tree/main/CLAUDE/skills/engineering/tdd
Command: npx skills add https://github.com/SevWren/Daily-Motivation-Brain-Helper --skill tdd-sevwren

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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 test-first workflow so every test verifies observable behavior through public interfaces. ## Core Features & Use Cases - Red-Green Loop Discipline: Enforces writing a failing test before any implementation code, one vertical slice at a time. - Seam Identification: Defines tests only at pre-agreed public boundaries, confirmed with the user before any test is written. - 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 adding a checkout feature, use this Skill to agree on the public seams first, then write one failing behavior test, implement the minimal code to pass it, and repeat. ## 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 on a new feature?▼

Start by agreeing on the public seams to test, then write one failing test that describes user-facing behavior. Implement only enough code to make it pass, then repeat with the next slice rather than writing all tests upfront.

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 public API or interface. Tests live only at pre-agreed seams, never against private methods or internal collaborators.

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, and use dependency injection to make boundaries mockable.

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 or asserting on call counts. Rewrite them to verify behavior through public interfaces so they survive internal changes.

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. Avoid it by deriving expected values from independent sources like known literals, worked examples, or the specification.