tdd

Automates red-green-refactor cycles for vertical slices with failing tests first.

12|1|Updated May 29, 2026
One-click install
npx skills add https://github.com/qdzsh/gsd-revamp --skill tdd-qdzsh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/qdzsh/gsd-revamp/tree/main/src/resources/skills/tdd
Command: npx skills add https://github.com/qdzsh/gsd-revamp --skill tdd-qdzsh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drives feature implementation through disciplined test-driven development with red-green-refactor cycles around vertical slices. Each cycle pins one observable behavior with a failing test, then adds the minimal code to pass, and finally refactors while green. Never refactor while red.

Core Features & Use Cases

  • Vertical-slice focused TDD: write a single test per task plan that exercises the public contract, then implement minimal code to satisfy it.
  • Public-interface testing: tests verify external behavior rather than internals, enabling safe refactors.
  • Structured workflow: follows the steps of confirming interface, writing a tracer bullet, looping red-green-refactor, and closing the slice.

Quick Start

Start a TDD cycle by pinning a public-interface behavior with a failing test, then implement the minimum code to pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development with red-green-refactor cycles?

Test-driven development with red-green-refactor cycles involves pinning an observable behavior with a failing test, writing minimal code to pass it, then refactoring while green. This workflow automates that disciplined cycle around vertical slices of a feature.

What is vertical slice testing in TDD?

Vertical slice testing in TDD exercises the public contract of a feature end-to-end with a single test per task plan. This approach verifies external behavior at API boundaries or module interfaces rather than internal implementation details.

When should I use TDD for feature development?

Use TDD for feature development when tasks have clear external contracts, such as API boundaries or module interfaces. It requires defining a public interface upfront so tests can pin observable behavior and guide incremental implementation.

How do I start a TDD cycle for a new API boundary?

Start a TDD cycle by defining the public interface, writing a tracer bullet, then pinning one behavior with a failing test. Implement the minimum code to make the test green before refactoring, capturing each step in a task plan.

Why should I never refactor code while tests are red?

You should never refactor while tests are red because failing tests indicate incomplete or incorrect behavior. Refactoring must only occur while green to ensure the external contract remains intact and observable behavior does not break.

Does TDD work for testing internal module implementation details?

TDD with this workflow focuses on public-interface testing rather than internal module details. Tests verify external behavior at API boundaries or module interfaces, which enables safe refactoring without breaking pinned observable contracts.