tdd

Guides test-driven development using the red-green loop with behavior-focused tests.

1|1|Updated May 11, 2026
One-click install
npx skills add https://github.com/taxmaxi/taxmaxi --skill tdd-taxmaxi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/taxmaxi/taxmaxi/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/taxmaxi/taxmaxi --skill tdd-taxmaxi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after implementation often produces brittle tests coupled to internal structure that break during refactors and fail to verify real behavior. This Skill enforces a disciplined test-first workflow so tests act as durable specifications of public behavior. ## Core Features & Use Cases - Red-Green Loop Discipline: Enforces writing a failing test before any implementation, one vertical slice at a time, with no speculative features. - Seam-Based Test Placement: Defines tests only at pre-agreed public interfaces (seams), confirmed with the user before any test is written. - Anti-Pattern Detection: Identifies implementation-coupled, tautological, and horizontally-sliced tests, with mocking guidelines restricted to system boundaries. - Use Case: When adding a checkout feature, agree on the public seam with the user, write one failing test like "user can checkout with valid cart", implement the minimal code to pass it, then repeat for the next slice. ## Quick Start Ask the assistant to build the next feature using test-driven development, starting by agreeing on the seams to test and writing one failing test first.

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 vertical slice instead of writing all tests upfront.

What makes a good unit test versus a bad one?▼

Good tests verify behavior through public interfaces and survive refactors, like "user can checkout with valid cart". Bad tests mock internal collaborators, test private methods, or recompute expected values the same way the implementation does.

When should I use mocks in tests?▼

Mock only at system boundaries such as external APIs, time, randomness, and sometimes databases or the file system. Never mock your own classes or internal collaborators, and prefer dependency injection with SDK-style interfaces for mockability.

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

Tests break during refactoring when they are coupled to implementation details, such as asserting on internal method calls or verifying through side channels like direct database queries. Rewrite them to verify outcomes through the public interface instead.

What is a tautological test and why is it a problem?▼

A tautological test computes its expected value the same way the code under test 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.