tdd-red-green-refactor

Enforce a Red-Green-Refactor loop with single-test cycles.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/rahulgupta2018/agent-skills --skill tdd-red-green-refactor-rahulgupta2018
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-red-green-refactor
Source: https://github.com/rahulgupta2018/agent-skills/tree/main/skills/tdd-red-green-refactor
Command: npx skills add https://github.com/rahulgupta2018/agent-skills --skill tdd-red-green-refactor-rahulgupta2018

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates the tendency to write implementation code before verifying requirements, preventing "guess-and-check" development and ensuring high code quality through a strict Red-Green-Refactor loop.

Core Features & Use Cases

  • Disciplined Workflow: Enforces the mandatory sequence of failing a test (Red), passing with minimal code (Green), and cleaning up (Refactor).
  • Language Agnostic: Provides standardized guidance for TypeScript, Java, and Dart environments.
  • Use Case: When starting a new feature, activate this skill to ensure every line of code is backed by a failing test, preventing the accumulation of untested or broken logic.

Quick Start

Activate the tdd-red-green-refactor skill to begin a new feature implementation by writing a single failing test case.

Frequently Asked Questions about tdd-red-green-refactor

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

FAQPage Schema
How do I enforce a strict test-first development workflow for new features?

Test-first development is enforced by following a strict Red-Green-Refactor loop, ensuring you write a single failing test before writing any implementation code. This prevents guess-and-check development and guarantees code verifiability.

What is the Red-Green-Refactor loop in test-driven development?

The Red-Green-Refactor loop is a test-driven development cycle where you first write a failing test (Red), implement minimal code to pass it (Green), and then clean up the implementation (Refactor). This maintains behavioral correctness and test integrity.

Can I use test-driven development for bug fixing and logic migration?

Yes, test-driven development applies to bug fixing and logic migration tasks alongside feature implementation. It ensures high code quality by requiring strict adherence to single-test cycles and minimal implementation passes across these scenarios.

Does this test-driven development workflow support Java and Dart environments?

Yes, this test-driven development workflow provides standardized guidance for TypeScript, Java, and Dart environments. It is language agnostic, allowing you to enforce a disciplined test-first sequence across these specific programming languages.

How do I start implementing a feature using a test-first sequence?

To start implementing a feature using a test-first sequence, begin by writing a single failing test case. This strict single-test cycle ensures every line of code is backed by a failing test before moving to minimal implementation passes.

Why should I use minimal implementation passes in unit testing?

Minimal implementation passes in unit testing maintain test integrity by preventing over-engineering and ensuring the code strictly meets the test requirements. This disciplined approach guarantees high code quality and behavioral correctness.