test-driven-development

Guide software development through the Red-Green-Refactor cycle with failing tests first.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures code quality and robustness by enforcing a disciplined approach to writing tests before implementation, preventing bugs and regressions.

Core Features & Use Cases

  • Test-First Development: Mandates writing failing tests before any production code.
  • Red-Green-Refactor Cycle: Guides developers through the iterative process of writing tests, implementing minimal code, and refactoring.
  • Use Case: When developing a new API endpoint, use this Skill to first write a test that defines the expected input and output. Then, write just enough code to make that test pass, ensuring the endpoint functions correctly from the start.

Quick Start

Follow the Red-Green-Refactor cycle to implement new features or fix bugs.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent bugs and regressions in software development?

Test-driven development prevents bugs by enforcing the Iron Law: no production code is written without a failing test first. This disciplined approach ensures code quality and robustness throughout the Red-Green-Refactor cycle.

What is the Red-Green-Refactor cycle for writing tests?

The Red-Green-Refactor cycle is an iterative testing process where you write a failing test, implement minimal code to make it pass, and then refactor the code for quality while maintaining passing tests.

How do I implement a new API endpoint using test-first development?

To implement an API endpoint with test-first development, write a test defining the expected input and output first, then write just enough production code to make that test pass, ensuring correct functionality from the start.

Does test-driven development work in both standalone and embedded modes?

Yes, test-driven development principles can be applied in both standalone and embedded modes, utilizing risk-scaled enforcement levels to guide agents through the required Red-Green-Refactor cycle.

When should I not use strict TDD enforcement for debugging?

Strict TDD enforcement may be adjusted using risk-scaled enforcement levels, allowing flexibility when debugging or addressing specific software development scenarios where a rigid test-first approach might be less applicable.