principle-tdd

Guide developers through red-green-refactor TDD with F.I.R.S.T. test quality.

2|8|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/lugassawan/swe-workbench --skill principle-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: principle-tdd
Source: https://github.com/lugassawan/swe-workbench/tree/main/skills/principle-tdd
Command: npx skills add https://github.com/lugassawan/swe-workbench --skill principle-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the risk of building software without fast feedback by enforcing a Test-Driven Development loop that makes behavior precise, regressions obvious, and design seams explicit.

Core Features & Use Cases

  • Red-Green-Refactor loop: Write a failing test first, implement the smallest passing code, then refactor only when all tests are green.
  • F.I.R.S.T. test quality: Ensure tests are fast, isolated, repeatable, self-validating, and timely.
  • Pragmatic test doubles: Choose fakes, stubs, spies, or mocks based on the cheapest double that proves the behavior.
  • Design feedback from mocking: Treat difficult mocks as signals of bad seams, leaky abstractions, or missing interfaces.
  • Outside-in vs inside-out TDD: Select the direction that has fewer unknowns for your specific task.

Quick Start

Ask your AI to walk through the next TDD cycle by writing the Red test, then the minimal Green implementation, then the Refactor steps while keeping all tests green.

Frequently Asked Questions about principle-tdd

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

FAQPage Schema
What is the red-green-refactor loop in test-driven development?

The red-green-refactor loop in test-driven development means writing a failing test first, implementing the smallest code to pass it, then refactoring while keeping tests green. This enforces fast feedback and makes behavior precise.

How do I choose the right test doubles for unit testing?

Choose the cheapest test double that proves the behavior when unit testing. Select fakes, stubs, spies, or mocks based on the specific need, and treat difficult mocks as signals of bad seams or leaky abstractions.

How do I fix a bug using test-driven development?

Fix a bug using test-driven development by writing a reproducing test first. This failing test confirms the bug, and your subsequent implementation ensures the exact behavior is fixed without introducing regressions.

What is the difference between outside-in and inside-out TDD?

Outside-in and inside-out TDD differ by direction. Select outside-in TDD when starting from external behavior, or inside-out when building from core components, choosing the direction with fewer unknowns for your specific task.

Why do my mocks indicate bad design in test-driven development?

Mocks indicate bad design in test-driven development when they are difficult to set up. This difficulty signals missing interfaces, bad seams, or leaky abstractions, providing design feedback to refactor your code.

How do I ensure my unit tests follow F.I.R.S.T. quality principles?

Ensure unit tests follow F.I.R.S.T. quality principles by verifying tests are fast, isolated, repeatable, self-validating, and timely. This keeps regressions obvious and design seams explicit.