tdd

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

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/NicolaeRotaru/ad-mycity --skill tdd-nicolaerotaru
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/NicolaeRotaru/ad-mycity/tree/main/.cursor/skills/tdd
Command: npx skills add https://github.com/NicolaeRotaru/ad-mycity --skill tdd-nicolaerotaru

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after code often produces brittle, implementation-coupled tests that break on every refactor 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 you agree on public interface boundaries (seams) with the user before any test is written, focusing effort on critical paths. - Anti-Pattern Detection: Flags implementation-coupled, tautological, and horizontally-sliced tests that pass by construction but verify nothing. - Use Case: When adding a checkout feature, define the public seam first, write one failing test for "user can checkout with valid cart", implement the minimal code to pass, then repeat for the next behavior. ## Quick Start Ask the assistant to build the next feature test-first using TDD, 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 on a new feature?▼

Start by agreeing on the public seams to test, then write one failing test for a single behavior, implement only enough code to pass it, and repeat. Work in vertical slices rather than writing all tests before any implementation.

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 interface or API. Tests live at seams and never against internals, so they survive refactors that change implementation but not behavior.

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

Tests break on refactoring when they are implementation-coupled, meaning they mock internal collaborators, test private methods, or verify through side channels like direct database queries. Rewrite them against public interfaces so they verify behavior, not structure.

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

A tautological test recomputes the expected value the same way the code does, such as asserting add(a, b) equals a + b, so it passes by construction and can never catch a bug. Expected values must come from an independent source like a known-good literal or the specification.

Should I write all tests before writing any implementation?▼

No, writing all tests first is horizontal slicing and produces tests for imagined behavior that go insensitive to real changes. Use vertical slices instead: one test, one minimal implementation, then repeat, letting each cycle inform the next.

When should refactoring happen in the TDD cycle?▼

Refactoring is not part of the red-green implementation loop. It belongs to the review stage after the cycle completes, keeping the loop focused on one failing test and one minimal passing implementation at a time.