tdd

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

Updated Jul 30, 2026
One-click install
npx skills add https://github.com/j172/bid --skill tdd-j172
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/j172/bid/tree/main/agent/skills/tdd
Command: npx skills add https://github.com/j172/bid --skill tdd-j172

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after the fact often produces brittle, implementation-coupled tests that break on every refactor. This Skill enforces a disciplined test-driven development workflow so tests verify real behavior through public interfaces and survive code changes. ## Core Features & Use Cases - Red-Green Loop Discipline: Enforces writing a failing test first, then only the minimal code needed to pass it, one vertical slice at a time. - Seam Identification: Helps you agree on public interface boundaries (seams) before writing any test, focusing effort on critical paths. - Anti-Pattern Detection: Flags implementation-coupled, tautological, and horizontally-sliced tests with concrete good/bad examples in tests.md and mocking guidance in mocking.md. - Use Case: When building a new checkout feature, use this Skill to define the seams with the user, write one failing behavior test like "user can checkout with valid cart", implement just enough code to pass, and repeat. ## Quick Start Ask the AI to build your next feature test-first using the TDD skill, starting by agreeing on the seams to 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 effectively?

Follow the red-green loop: write one failing test that describes behavior through a public interface, then write only enough code to make it pass. Work in vertical slices of one test and one implementation per cycle rather than writing all tests upfront.

What is a seam in testing and where should tests go?

A seam is the public boundary where you observe behavior without reaching inside the code. Tests should live only at pre-agreed seams confirmed with the user, 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 the file system. Never mock your own classes or internal collaborators, and prefer dependency injection with SDK-style interfaces for mockability.

What makes a test tautological or brittle?

A tautological test recomputes the expected value the same way the code does, so it passes by construction. Brittle tests mock internal collaborators or verify through side channels like direct database queries, breaking whenever you refactor without changing behavior.

Should I write all tests before implementing the feature?

No, writing all tests first is horizontal slicing and produces tests of imagined behavior. Instead use vertical slices: one failing test, one minimal implementation, then repeat, letting each cycle inform the next.