tdd

Apply test-driven development with integration-style red-green-refactor workflows.

3|Updated May 11, 2026
One-click install
npx skills add https://github.com/JeromyJSmith/lattice-platform --skill tdd-jeromyjsmith
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/JeromyJSmith/lattice-platform/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/JeromyJSmith/lattice-platform --skill tdd-jeromyjsmith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TDD reduces the risk of building the wrong thing by forcing you to define expected behavior up front, then implementing only what the tests require.

Core Features & Use Cases

  • Integration-style behavior verification: Write tests that exercise real code paths through public interfaces (not implementation details), so refactors don’t break tests unnecessarily.
  • Red-green-refactor loop: Use a disciplined cycle to create a failing test, make the smallest change to pass, and then refactor for clarity.
  • Vertical slicing with tracer bullets: Avoid “horizontal slices” (writing all tests before code) by implementing incrementally one behavior at a time.

Use cases include fixing bugs, building new features, and improving testability by designing small interfaces and mocking only system boundaries.

Quick Start

Start by writing one integration-style test for the first behavior you want to exist, then implement the minimal code needed to make that test pass before moving to the next behavior.

Frequently Asked Questions about tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write integration-style tests that survive refactoring?

Write integration-style tests that exercise real code paths through public interfaces rather than implementation details, ensuring refactors don’t break tests unnecessarily. This approach verifies system behavior without coupling tests to internal code structure.

What's the best way to apply red-green-refactor for feature development?

Apply red-green-refactor by creating a failing test, making the smallest code change to pass it, then refactoring for clarity. This disciplined cycle ensures you implement only what the tests require, one behavior at a time.

Why do my tests break when I refactor my code?

Tests break during refactoring when they are coupled to implementation details instead of public interfaces. Testing through public interfaces verifies system behavior without breaking when internal code structures change.

How do I fix bugs using test-driven development?

Fix bugs using test-driven development by writing a test that specifies the expected behavior and fails due to the bug, then implementing the minimal code change to make that test pass, verifying the fix and preventing regressions.

Should I mock internal components or only system boundaries for testability?

Mock only system boundaries to improve testability. Designing small interfaces and mocking exclusively at boundaries allows integration-style tests to exercise real code paths without coupling to internal implementation details.

When should I use vertical tracer bullets instead of horizontal slicing in TDD?

Use vertical tracer bullets instead of horizontal slicing when building features incrementally. Implement one behavior at a time through the red-green-refactor loop, avoiding the anti-pattern of writing all tests before any implementation code.