moai-workflow-tdd

Automate the RED-GREEN-REFACTOR TDD workflow for new feature development.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/windysky/snake-game --skill moai-workflow-tdd-windysky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-workflow-tdd
Source: https://github.com/windysky/snake-game/tree/main/.claude/skills/moai-workflow-tdd
Command: npx skills add https://github.com/windysky/snake-game --skill moai-workflow-tdd-windysky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides a disciplined, repeatable Test-Driven Development workflow that guides teams to define behavior with tests before implementation, reducing ambiguity and preventing scope creep.

Core Features & Use Cases

  • RED-GREEN-REFACTOR cycle as the default development loop for new features.
  • Phase-guided workflow documentation, with explicit guidance for RED (failing test), GREEN (minimal code), and REFACTOR (improved structure).
  • Integration guidance with DDD for preserving behavior during refactors and characterization tests for existing code.
  • Quality metrics and governance aids, including test coverage expectations and TRUST 5 validation.
  • Collaboration and role-based execution hints for manager-tdd, expert-backend, expert-frontend, and expert-testing.

Quick Start

Begin a standard TDD session by defining the SPEC, writing a failing test (RED), implementing minimal code to pass (GREEN), and refactoring while keeping tests green (REFACTOR).

Frequently Asked Questions about moai-workflow-tdd

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

FAQPage Schema
How do I implement a test-driven development workflow for new features?

A test-driven development workflow is automated through the RED-GREEN-REFACTOR cycle, guiding teams to define behavior with failing tests before writing minimal code to pass and refactoring. This approach reduces ambiguity and prevents scope creep across frontend, backend, and integration work.

What is the RED-GREEN-REFACTOR cycle in test-first software development?

The RED-GREEN-REFACTOR cycle is a test-first development loop where you write a failing test (RED), implement minimal code to pass the test (GREEN), and improve the code structure while keeping tests green (REFACTOR). This disciplined process ensures repeatable quality.

Can I use test-driven development with Domain-Driven Design for existing code?

Yes, test-driven development integrates with Domain-Driven Design (DDD) to preserve behavior during refactors. It also supports characterization tests for existing code, ensuring that structural improvements do not alter core domain logic.

What quality gates are enforced during test-first development?

Test-first development enforces minimum quality gates including specific test coverage expectations and TRUST 5 validation. These governance aids ensure that the software meets defined behavioral specs and quality metrics throughout the development loop.

Does this TDD workflow support role-based execution for different team members?

Yes, the TDD workflow provides collaboration and role-based execution hints tailored for manager-tdd, expert-backend, expert-frontend, and expert-testing roles. This ensures structured coordination across the team during the test-first development phases.

What is the best way to start a TDD session?

The best way to start a TDD session is by defining the SPEC, writing a failing test (RED), implementing minimal code to pass the test (GREEN), and refactoring the implementation while keeping tests green (REFACTOR). This phase-guided workflow ensures structured development.