tdd-workflow

Explain the RED-GREEN-REFACTOR cycle and TDD best practices.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/Andrejr82/Caculinha_BI --skill tdd-workflow-andrejr82
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/Andrejr82/Caculinha_BI/tree/main/.agent/skills/tdd-workflow
Command: npx skills add https://github.com/Andrejr82/Caculinha_BI --skill tdd-workflow-andrejr82

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides users through the Test-Driven Development (TDD) methodology, ensuring robust and well-tested code by emphasizing writing tests before implementation.

Core Features & Use Cases

  • TDD Cycle Explanation: Details the RED (write failing test), GREEN (write minimal code to pass), and REFACTOR (improve code quality) stages.
  • Core Principles: Outlines the three laws of TDD and best practices for each phase.
  • Use Case: A developer new to TDD can use this Skill to understand the workflow and apply it to their next coding task, ensuring higher code quality and fewer bugs from the outset.

Quick Start

Explain the RED phase of the TDD cycle.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
What is the RED-GREEN-REFACTOR cycle in Test-Driven Development?

The RED-GREEN-REFACTOR cycle in Test-Driven Development involves writing a failing test (RED), implementing minimal code to pass it (GREEN), and improving code quality (REFACTOR). This methodology ensures robust software by writing tests before implementation.

How do I start writing tests using the TDD workflow?

To start writing tests using the TDD workflow, you begin with the RED phase by writing a failing test. You then write minimal production code to pass the test in the GREEN phase, followed by the REFACTOR phase to improve code quality.

What are the three laws of TDD and how do they apply to software development?

The three laws of TDD dictate the strict workflow for software development: writing no production code without a failing test, writing only enough test code to fail, and writing only enough production code to pass. This ensures high code quality and fewer bugs.

Can I use the AAA pattern with Test-Driven Development?

Yes, you can use the AAA pattern alongside Test-Driven Development. The Skill covers best practices for the AAA (Arrange-Act-Assert) pattern and highlights common TDD anti-patterns to avoid during the RED-GREEN-REFACTOR cycle.

Does Test-Driven Development support multi-agent AI patterns?

Yes, Test-Driven Development supports AI-augmented workflows with multi-agent patterns. This allows developers to integrate artificial intelligence into the RED-GREEN-REFACTOR cycle while maintaining robust tests and minimal production code.

What are common TDD anti-patterns I should avoid during refactoring?

Common TDD anti-patterns occur when developers write excessive production code or skip the failing test phase. Avoid these by adhering to the three laws of TDD, using the AAA pattern, and ensuring the REFACTOR phase only improves code quality without altering behavior.