One-click install
npx skills add https://github.com/thejordanleopold/claude-code-skills-distilled --skill tdd-thejordanleopold
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/thejordanleopold/claude-code-skills-distilled/tree/main/tdd
Command: npx skills add https://github.com/thejordanleopold/claude-code-skills-distilled --skill tdd-thejordanleopold

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development helps teams prevent defects by writing tests before code, reducing debugging time and improving specification clarity.

Core Features & Use Cases

  • Enforces the RED-GREEN-REFACTOR cycle to drive reliable implementations.
  • Promotes the Prove-It Pattern for reproducing bugs and guarding against regressions.
  • Guides test naming, coverage goals, and mutation testing to improve code quality.

Use Case: When adding a new feature, start by writing a failing test, implement the minimal code to pass, and refactor while keeping tests green.

Quick Start

Run a RED-GREEN-REFACTOR cycle by writing a failing unit test first, then implement just enough code to make it pass, and finally refactor.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I start practicing test-driven development to improve software quality?

Test-driven development starts by writing a failing unit test first, implementing minimal code to pass, and refactoring while maintaining green tests. This RED-GREEN-REFACTOR cycle reduces debugging time and clarifies specifications before implementation begins.

What is the RED-GREEN-REFACTOR cycle in unit testing?

The RED-GREEN-REFACTOR cycle enforces writing a failing test (RED), writing minimal code to pass (GREEN), and improving code structure (REFACTOR) while keeping tests green. This cycle drives reliable implementations and prevents defects during feature development.

Does test-driven development work with Jest and other standard testing libraries?

Test-driven development works with standard testing libraries like Jest across various languages and frameworks. The approach requires clear test naming conventions and integrates into CI pipelines that report mutation scores and coverage metrics for comprehensive software quality assurance.

How do I use the Prove-It Pattern to prevent bug regressions?

The Prove-It Pattern reproduces bugs by writing failing tests that verify the defect before fixing code. This test-driven approach guards against regressions by ensuring every bug has corresponding test coverage proving the fix works and preventing future recurrence.

Why should I include mutation testing in my TDD workflow?

Mutation testing improves code quality within test-driven development by measuring test effectiveness through code mutations. A CI pipeline reporting mutation scores validates that tests genuinely catch defects rather than merely achieving superficial coverage metrics.

What's the difference between mocks and stubs in unit testing?

Mocks and stubs serve different roles in test-driven development: stubs provide controlled responses to satisfy code execution, while mocks verify interactions occurred correctly. The test pyramid guides their appropriate usage across unit and integration testing workflows.