tdd

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

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill tdd-kunj-sharma03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/Kunj-Sharma03/agent-contextify/tree/main/skills-main/skills/engineering/tdd
Command: npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill tdd-kunj-sharma03

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 every test verifies observable behavior through public interfaces. ## 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 Identification: Helps you define and confirm 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, with reference guides on good test structure and mocking at system boundaries only. - Use Case: When adding a checkout feature, use this Skill to agree on the public seams first, then drive the implementation one failing test at a time, mocking only external boundaries like payment APIs. ## Quick Start Ask the AI to build a new feature using test-driven development with the red-green-refactor loop, 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 with the red-green-refactor loop?

Write one failing test against a public interface first, then write only enough code to make it pass, and repeat one slice at a time. Refactoring happens separately in the review stage, not inside the red-green cycle.

What is a seam in test-driven development?

A seam is the public boundary where you observe behavior without reaching inside the code. Tests live only at pre-agreed seams confirmed with the user, never against private methods or internal collaborators.

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 with SDK-style interfaces for mockability.

Why do my tests break every time I refactor code?

Tests break during refactors when they are coupled to implementation details, such as mocking internal collaborators, testing private methods, or asserting on call counts. Behavior-focused tests through public interfaces survive internal restructuring.

What is a tautological test and why is it bad?

A tautological test recomputes the expected value the same way the implementation does, so it passes by construction and can never catch a bug. Expected values must come from an independent source like a known literal or worked example.