tdd

Guides test-driven development through red-green cycles with seam-based test design.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after implementation often produces brittle, implementation-coupled tests that break on refactors and fail to verify real behavior. This Skill enforces a disciplined red-green loop so every test verifies observable behavior through public interfaces before any code is written. ## Core Features & Use Cases - Red-Green Loop Rules: Enforces writing a failing test first, then only the minimal code to pass it, one vertical slice at a time. - Seam-Based Test Design: Requires agreeing on public interface seams with the user before any test is written, keeping tests at boundaries rather than internals. - Anti-Pattern Detection: Identifies implementation-coupled, tautological, and horizontally-sliced tests, with mocking guidance limited to system boundaries like external APIs, time, and file systems. - Use Case: When adding a new feature to a TypeScript library, use this Skill to write one failing integration test against the exported function, implement just enough to pass, and repeat until the feature is complete. ## Quick Start Ask the assistant to build the next feature test-first using the tdd skill, starting by agreeing which public 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 with the red-green loop?▼

Write one failing test against a public interface first, then implement only enough code to make it pass, and repeat one slice at a time. Never write all tests upfront or add speculative features beyond what the current failing test demands.

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 an exported function of a module. Tests should live only at pre-agreed seams confirmed with the user, never against internal helpers or private methods.

When should I mock dependencies in unit tests?▼

Mock only at system boundaries: external APIs, databases, time, randomness, and sometimes the file system. 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 on 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 so they survive internal changes.

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

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