test-driven-development

Enforce a red-green-refactor cycle for writing tests before implementation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces writing tests before implementation to prevent untested production code, reduce regressions, and make intended behavior explicit.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Guide for writing a failing test, implementing minimal code to pass, and refactoring while keeping tests green.
  • Verification Gates: Checklists for confirming tests fail for the right reason, verifying passing behavior, and ensuring other tests remain unaffected.
  • Use Case: Apply when adding new features, fixing bugs, refactoring, or changing behavior to ensure changes are validated by tests and documented by examples.

Quick Start

Start by writing a minimal failing test that demonstrates the desired behavior, run the test to confirm it fails, implement the smallest change to make it pass, and then refactor while keeping all tests green.

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 test-first workflow enforcing the red-green-refactor cycle: writing a failing test, implementing minimal code to pass it, and refactoring while keeping tests green to prevent untested production code.

How do I start writing unit tests before implementation for a new feature?

Start writing unit tests before implementation by creating a minimal failing test demonstrating the desired behavior, verifying the failure for the right reason, implementing the smallest code change to pass, and refactoring safely.

When should I apply test-first development workflows in software engineering?

Apply test-first development workflows when adding new features, fixing bugs, refactoring, or changing behavior to ensure changes are explicitly validated by tests and documented by executable examples.

How do I verify tests fail for the right reason during the red-green-refactor cycle?

Verifying tests fail for the right reason during the red-green-refactor cycle requires using verification gates, which are checklists confirming the failing test targets the intended behavior before implementing minimal passing code.

Does test-driven development work for refactoring existing code without breaking behavior?

Test-driven development works for refactoring by keeping all tests green after implementing the smallest change to pass, ensuring existing behavior remains validated and unaffected while improving code structure.