moai-workflow-tdd

Implements test-driven development using the RED-GREEN-REFACTOR cycle for new features.

2|Updated May 27, 2026
One-click install
npx skills add https://github.com/yekinya/moai-novel --skill moai-workflow-tdd-yekinya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-workflow-tdd
Source: https://github.com/yekinya/moai-novel/tree/main/moai-novel/.claude/skills/moai-workflow-tdd
Command: npx skills add https://github.com/yekinya/moai-novel --skill moai-workflow-tdd-yekinya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It enforces test-first development so new features are built from behavior specifications rather than post-hoc tests, catching design problems early and preventing regressions. ## Core Features & Use Cases - RED-GREEN-REFACTOR Cycle: Guides writing a failing test, minimal implementation, then safe refactoring with tests as a safety net. - TDD vs DDD Mode Selection: Chooses TDD for greenfield work or DDD for existing codebases based on the development_mode setting in quality.yaml. - Quality Gates: Enforces 80% minimum coverage per commit, TRUST 5 validation, and verification checklists for test discipline. - Use Case: When building a new API endpoint, write a failing test defining the expected response, implement the minimal handler to pass it, then refactor while keeping the suite green. ## Quick Start Ask the agent to implement a new feature using the TDD workflow with a failing test first, then minimal code to pass it.

Frequently Asked Questions about moai-workflow-tdd

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

FAQPage Schema
How do I practice test-driven development with the RED-GREEN-REFACTOR cycle?

Write one failing test that defines the desired behavior (RED), implement the minimal code to make it pass (GREEN), then improve structure while keeping tests green (REFACTOR). Repeat the cycle for each test case until all acceptance criteria pass.

What is the difference between TDD and DDD workflows?

TDD uses RED-GREEN-REFACTOR to create new functionality from specification tests, starting from no code. DDD uses ANALYZE-PRESERVE-IMPROVE with characterization tests to refactor existing code without changing behavior.

When should I not use test-driven development?

Avoid TDD when refactoring existing code, when behavior preservation is the primary goal, or when working with legacy code lacking test coverage. Use the DDD workflow or Hybrid mode for those scenarios instead.

What test coverage is required for TDD commits?

A minimum of 80% coverage per commit is required, with 90% recommended for new code and 100% for critical paths. All public interfaces must have corresponding tests.

Why do all my new tests pass on the first run?

Tests passing immediately means no RED phase occurred, so the tests may not actually verify new behavior. Write the test before implementation and confirm it fails for the right reason first.