test-driven-development

Write failing tests before implementing behavioral changes across codebases.

9|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/klh/speedy-claude --skill test-driven-development-klh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/klh/speedy-claude/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/klh/speedy-claude --skill test-driven-development-klh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents regressions and uncertainty by requiring reproducible failing tests before implementing or changing behavior, ensuring every change is verified and documented by the test suite.

Core Features & Use Cases

  • Red‑Green‑Refactor cycle: Drive development by writing a failing test, implementing the minimal fix, then refactoring while keeping tests green.
  • Prove‑It Pattern for bug fixes: Always reproduce reported bugs with a failing test before applying a fix to guarantee the issue is resolved and guarded against regressions.
  • Test Pyramid guidance: Focus on fast, small unit tests supplemented by integration and E2E tests where appropriate; classify tests by size and resource usage.
  • Browser testing advice: Combine TDD with runtime verification (DevTools inspection, screenshots, network checks) for UI bugs and end-to-end flows.

Quick Start

Write a failing reproduction test, run the test suite to confirm it fails, implement the minimal change until the test passes, then refactor while keeping tests green.

Frequently Asked Questions about test-driven-development

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

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

Bug fixing in test-driven development uses the Prove-It Pattern: write a reproducible failing test that captures the reported bug, implement the minimal code change to make it pass, then refactor while keeping the test suite green.

What is the Red-Green-Refactor cycle for unit testing?

The Red-Green-Refactor cycle is a core test-driven development process: write a failing unit test, implement the minimal code required to make that test pass, then refactor the implementation while continuously verifying all tests remain green.

How should I balance unit tests and integration tests in my test suite?

Test pyramid guidance recommends focusing on fast, small unit tests as the foundation, supplemented by integration and end-to-end tests where appropriate. Classify tests by size and resource usage to maintain fast isolated verification.

Can I use test-driven development for browser-based UI testing?

Yes, test-driven development applies to browser testing by combining TDD with runtime verification. Use DevTools inspection, screenshots, and network checks to drive end-to-end UI bug fixes and verify complex browser workflows.

Do I need to run the full test suite every time I change code?

You should use fast isolated tests for continuous verification during development, then run a full-suite regression check to ensure every behavioral change is verified and documented, preventing regressions across the codebase.

When should I not use test-driven development for refactoring?

Test-driven development is less effective for pure refactoring when no behavioral change is intended, because its core mechanism requires specifying every behavioral change as a reproducible failing test before implementation.