tdd

Drive minimal implementation with integration-style regression tests in red-green-refactor cycles.

5|Updated May 21, 2026
One-click install
npx skills add https://github.com/TrebuchetDynamics/pi-package-goal --skill tdd-trebuchetdynamics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/TrebuchetDynamics/pi-package-goal/tree/main/skills/tdd
Command: npx skills add https://github.com/TrebuchetDynamics/pi-package-goal --skill tdd-trebuchetdynamics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The tdd skill prevents fragile development by turning feature work and bug fixes into a sequence of behavior-focused tests, so you only change code when evidence shows the public behavior works.

Core Features & Use Cases

  • Integration-style, public-interface tests: Write tests that verify what the system does (not how it does it) using real code paths through public APIs.
  • Red-green-refactor loop with tracer bullets: Use one test at a time to drive minimal implementation, then refactor only after the suite is green.
  • Workflow guidance and handoffs: Start with repo study, escalate to architecture/testing helpers when seams are unclear, and pass passing evidence to delivery steps.

Use this when you are adding a feature, fixing a regression, or improving design and you want test-first discipline with clear evidence at each cycle.

Quick Start

Ask for a tdd plan and then guide the agent to produce the first failing tracer-bullet test from the smallest public behavior you want, followed by the minimal code to make it pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor loop work?

Test-driven development (TDD) is a technique that turns feature work into behavior-focused tests. You write a failing integration test first, implement minimal code to pass it, and then refactor safely, ensuring changes are backed by passing evidence.

How do I fix bugs using test-driven development with integration tests?

To fix bugs with TDD, write an integration-style regression test against the public interface that reproduces the issue. Drive the minimal implementation fix until the test passes, verifying the actual code paths and preventing future regressions.

How do I start adding a new feature using vertical slices in TDD?

Start adding a feature with TDD by studying the repository, then create a failing tracer-bullet test targeting the smallest public behavior. Drive one test at a time through real code paths to build the feature vertically rather than horizontally.

Should I refactor my code while a test is still failing?

You should not refactor code while a test is failing. TDD requires strict red-green-refactor discipline, meaning you only refactor after the test suite is green and the public behavior is verified by passing evidence.

What should I do if I cannot find clear seams to write a public-interface test?

If public-interface seams are unclear during TDD, escalate to architecture and testing helpers. This workflow guidance ensures you correctly identify public APIs before writing integration-style regression tests and driving implementation.

Does test-driven development work for refactoring existing code safely?

TDD works for refactoring by generating integration-style regression tests that verify current public behavior before you change internal code. You can then safely improve the design while ensuring the test suite remains green and behavior stays consistent.