test-driven-development

Write failing tests first to drive implementation and verify expected behavior.

3|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/martin-janci/claude-marketplace --skill test-driven-development-martin-janci
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/martin-janci/claude-marketplace/tree/main/plugins/dev-agents/skills/test-driven-development
Command: npx skills add https://github.com/martin-janci/claude-marketplace --skill test-driven-development-martin-janci

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing tests before code establishes a contract for expected behavior, reducing ambiguity and catching regressions early.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement the minimal code to pass, and refactor for clarity.
  • Behavior-first design: codifies expectations upfront, ensuring changes stay aligned with requirements.
  • Risk reduction: incremental development with immediate feedback from the test suite.

Quick Start

Describe a small feature, write a failing test for it, then implement the minimal code to pass the test.

Frequently Asked Questions about test-driven-development

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 cycle work?

Test-driven development is a coding workflow where you write a failing test first, implement the minimal code to pass it, then refactor for clarity. This red-green-refactor cycle establishes a contract for expected behavior and catches regressions early.

How do I write unit tests before implementing new features?

Describe the small feature, write a failing unit test that codifies expected behavior, then implement the minimal production code required to pass the test. This behavior-first approach ensures changes stay aligned with requirements before you write the implementation.

Can I apply test-driven development to bug fixes and refactoring?

Yes, test-driven development applies to bug fixes and refactors across projects. Write a failing test that reproduces the bug or verifies the refactor, implement minimal code to pass, and guard against future regressions using the updated test suite.

What's the best way to reduce regressions when writing code without tests first?

Adopt test-driven development to reduce regressions by establishing a behavior contract upfront. Writing tests before code provides immediate feedback through incremental development, ensuring the test suite validates requirements before production code is written.

Why write failing tests first instead of writing tests after implementation?

Writing failing tests first establishes a contract for expected behavior, reducing ambiguity in your code. It enforces a red-green-refactor workflow with minimal, focused code that passes tests, ensuring the test suite validates requirements before writing production code.