test-driven-development

Enforces test-first RED-GREEN-REFACTOR discipline for features, bugfixes, and refactors.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/pgoell/pgoell-claude-tools --skill test-driven-development-pgoell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/pgoell/pgoell-claude-tools/tree/main/plugins/workbench/skills/test-driven-development
Command: npx skills add https://github.com/pgoell/pgoell-claude-tools --skill test-driven-development-pgoell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Implementation code written before tests often ships without regression coverage, and tests written afterward can pass without proving the intended behavior. This Skill enforces a strict test-first workflow so every behavior change is proven by a failing test before any production code exists. ## Core Features & Use Cases - RED-GREEN-REFACTOR Enforcement: Requires writing one failing test, verifying it fails for the expected reason, writing minimal code to pass, then refactoring while keeping tests green. - Outer and Inner Loops: Drives acceptance-test-level slices from outside the unit boundary, with inner unit-level cycles running until each acceptance test passes. - Rationalization and Red-Flag Detection: Lists common excuses for skipping tests and stop conditions that force restarting a chunk test-first. - Use Case: When fixing a bug in a Workbench implementation plan, write the failing acceptance test for the chunk first, run inner red-green-refactor cycles until it passes, and only then mark the chunk complete. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first, then the minimal code to pass it, then refactoring.

Frequently Asked Questions about test-driven-development

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?

Write the smallest failing test expressing one expected behavior, confirm it fails for the right reason, then write only the minimal code to pass it. After green, refactor names and duplication while keeping tests green, then repeat for the next behavior.

What is the difference between the outer loop and inner loop in TDD?

The outer loop is acceptance-test driven: a failing test exercises a feature slice from outside the unit boundary. The inner loop runs many red-green-refactor cycles at the unit level until that acceptance test passes.

When is it acceptable to skip test-driven development?

Exceptions require an explicit user decision and are limited to throwaway prototypes, generated code, and pure configuration changes. Everything else, including bug fixes and behavior-changing refactors, follows the test-first rule.

What should I do if implementation code was written before the test?

Delete the implementation and restart from the test rather than keeping it as reference, since reference code biases the test. Write the failing test first, then reimplement only what the test requires.

Why did my new test pass immediately without any implementation?

A test that passes immediately does not prove the new behavior and must be fixed before writing implementation code. Check that the test actually exercises the missing behavior and fails for the expected assertion, not a setup or syntax issue.