tdd

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

2|Updated May 12, 2026
One-click install
npx skills add https://github.com/tajo9128/BioDockify-Pharma-AI --skill tdd-tajo9128
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/tajo9128/BioDockify-Pharma-AI/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/tajo9128/BioDockify-Pharma-AI --skill tdd-tajo9128

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 test-first workflow so tests act as durable specifications of behavior. ## Core Features & Use Cases - Red-Green Loop Discipline: Enforces writing a failing test before any implementation, one vertical slice at a time. - Seam Identification: Helps define and confirm public interface boundaries where tests should live before any test is written. - Anti-Pattern Detection: Flags implementation-coupled, tautological, and horizontally sliced tests with concrete good/bad examples. - Mocking Guidance: Provides rules for mocking only at system boundaries using dependency injection and SDK-style interfaces. - Use Case: When adding a checkout feature, confirm the public seams with the user, write one failing test for checkout behavior, implement the minimal code to pass it, then repeat for the next slice. ## Quick Start Use the tdd skill to build the new checkout 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 for a single behavior, implement the minimal code to pass it, and repeat. Work in vertical slices rather than writing all tests up front.

What is the red-green-refactor loop in TDD?

Red-green-refactor means writing a failing test first (red), then writing only enough code to make it pass (green). Refactoring is handled separately during code review, not inside the implementation loop.

When should I mock dependencies 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 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 private method calls. Tests should verify behavior through public interfaces so they survive internal changes.

What is a tautological test and why is it bad?

A tautological test computes its expected value the same way the implementation does, so it passes by construction and can never catch a bug. Expected values should come from independent sources like known literals or worked examples.