tdd-workflow

Guide the RED-GREEN-REFACTOR cycle for Test-Driven Development.

3|1|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/Harmitx7/tribunal-kit --skill tdd-workflow-harmitx7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/Harmitx7/tribunal-kit/tree/main/.agent/skills/tdd-workflow
Command: npx skills add https://github.com/Harmitx7/tribunal-kit --skill tdd-workflow-harmitx7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides users through the Test-Driven Development (TDD) methodology, ensuring robust and well-designed code by enforcing a structured approach to writing tests before implementation.

Core Features & Use Cases

  • RED Phase: Learn to write failing tests that define desired behavior.
  • GREEN Phase: Understand writing the minimum code to pass tests.
  • REFACTOR Phase: Improve code quality while maintaining test integrity.
  • Triangulation: Avoid premature optimization by writing tests that force real implementation.
  • Use Case: When developing a new authentication module, use TDD to define password validation rules, ensure secure login logic, and refactor the code for clarity and efficiency.

Quick Start

Follow the RED-GREEN-REFACTOR cycle to implement the 'validatePassword' function.

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 is a test-driven development process where you write a failing test (RED), implement the minimum code to pass it (GREEN), and then improve the design while maintaining test integrity (REFACTOR).

How do I start test-driven development for a new authentication module?

Start test-driven development for an authentication module by writing a failing test that defines desired behavior, such as password validation rules, then write the minimum viable code to pass the test before refactoring.

How does triangulation prevent premature optimization in software design?

Triangulation prevents premature optimization in software design by forcing you to write multiple specific tests that drive the real implementation, ensuring code is generalized only when tests demand it rather than guessed upfront.

What is the Verification-Before-Completion protocol in TDD?

The Verification-Before-Completion (VBC) protocol in TDD is a rule ensuring that all tests are verified as passing before considering a development task complete, preventing unverified code from entering the codebase.

When should I refactor code during the test-driven development workflow?

You should refactor code during the test-driven development workflow only after achieving the GREEN phase, ensuring the minimum viable code passes all tests so you can safely improve code quality without altering behavior.

What are common mistakes to avoid when writing failing tests first?

Common mistakes when writing failing tests first include skipping the triangulation step, writing tests that do not clearly define desired behavior, and failing to follow the minimum viable code principle before attempting refactoring.