test-driven-development

Drive implementation with a failing test before writing production code.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/gleeb/ai-registry --skill test-driven-development-gleeb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/gleeb/ai-registry/tree/main/common-skills/test-driven-development
Command: npx skills add https://github.com/gleeb/ai-registry --skill test-driven-development-gleeb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Test-Driven Development prevents shipping broken or unverified code by forcing you to prove behavior with a failing test before writing production logic.

Core Features & Use Cases

  • Write a failing test first so the test demonstrates the missing behavior rather than validating your current implementation.
  • Follow the red-green-refactor cycle to keep changes minimal, verify correctness twice (fail then pass), and only improve structure after tests are green.
  • Use it for new features, bug fixes, and refactoring to reduce regressions and make behavior changes explicit.

Quick Start

Use test-driven-development when you’re about to implement a feature or bugfix and want an AI to outline the red-green-refactor steps starting from the single failing 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 it prevent shipping broken code?▼

Test-driven development requires writing a failing test first to prove desired behavior before writing any production logic. This prevents shipping unverified code by establishing correctness through the red-green-refactor cycle, verifying each behavior twice.

How do I use the red-green-refactor cycle for a new feature?▼

To use the red-green-refactor cycle, write one failing test per behavior to demonstrate the missing functionality. Then write minimal code to make it pass, re-verify the green state, and refactor only after confirming the tests remain green.

Can I use test-first development for bug fixes and refactoring?▼

Yes, test-first development applies to bug fixes and refactoring by making behavior changes explicit and reducing regressions. You start by writing a failing test that captures the bug or desired behavior before modifying the production code.

What is the best way to structure tests for behavior changes?▼

The best way to structure tests for behavior changes is to require one clear test per behavior. You must confirm a failing state before coding, write minimal code to pass, and mandate re-verification after reaching green to ensure correctness.

Why do I need to confirm a failing test state before writing implementation code?▼

You need to confirm a failing test state before writing implementation code to ensure the test actually validates the missing behavior. This prevents false positives and proves that your production code is what drives the test to pass.

When should I not use the test-driven development approach?▼

You should not use the test-driven development approach when you cannot establish one clear test per behavior or when exploring highly experimental prototypes where desired behavior remains undefined and unverified changes are acceptable.