Best for
- Use when developing new features from scratch or when behavior specification drives implementation.
modu-ai/moai-adk/.claude/skills/moai-workflow-tdd/SKILL.md
Test-Driven Development workflow specialist using RED-GREEN-REFACTOR cycle for test-first software development. Use when developing new features from scratch or when behavior specification drives implementation.
Decision brief
Test-Driven Development workflow specialist using RED-GREEN-REFACTOR cycle for test-first software development.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Declared | Source record | Install path and trigger |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/modu-ai/moai-adk --skill ".claude/skills/moai-workflow-tdd"Inspect the Agent Skill "moai-workflow-tdd" from https://github.com/modu-ai/moai-adk/blob/48239c7dc7428c8751a04f6321887c2d36123884/.claude/skills/moai-workflow-tdd/SKILL.md at commit 48239c7dc7428c8751a04f6321887c2d36123884. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
The RED phase focuses on defining the desired behavior through a failing test.
The RED phase focuses on defining the desired behavior through a failing test.
The test must fail initially:
The GREEN phase focuses on writing minimal code to satisfy the test.
Write only enough code to make the test pass:
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 1,191 | Source | Repository attention, not individual Skill quality |
| Compatibility | 1 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
[NOTE] This workflow is selected based on .moai/config/sections/quality.yaml:
constitution:
development_mode: tdd # or ddd
When to use this workflow:
development_mode: tdd → Use TDD (this workflow, default)development_mode: ddd → Use DDD instead (moai-workflow-ddd)Key distinction:
Test-Driven Development provides a disciplined approach for creating new functionality where tests define the expected behavior before implementation.
Core Cycle - RED-GREEN-REFACTOR:
When to Use TDD:
When NOT to Use TDD:
TDD Approach:
DDD Approach:
The golden rule of TDD is that tests must be written before implementation code:
The RED phase focuses on defining the desired behavior through a failing test.
Before writing any implementation code:
Follow the Arrange-Act-Assert pattern:
The test must fail initially:
The GREEN phase focuses on writing minimal code to satisfy the test.
Write only enough code to make the test pass:
Run the test to confirm it passes:
The REFACTOR phase focuses on improving code quality while maintaining behavior.
With passing tests as a safety net:
After each refactoring step:
When executing TDD through manager-develop:
Step 1 - Understand Requirements:
Step 2 - RED Phase:
Step 3 - GREEN Phase:
Step 4 - REFACTOR Phase:
Step 5 - Repeat:
For features requiring multiple test cases:
Test Coverage (Required):
Code Quality (Goals):
Apply TRUST 5 framework with TDD focus:
TDD and DDD are complementary:
TDD integrates with testing workflow:
TDD outputs feed into quality assessment:
Test is Too Complex:
Implementation Grows Too Fast:
Refactoring Breaks Tests:
When TDD discipline breaks down:
Version: 1.0.0 Status: Active
| Rationalization | Reality |
|---|---|
| "I'll add tests after the implementation works" | Post-hoc tests verify what the code does, not what it should do. They miss the bugs RED phase catches. |
| "The existing tests cover this case" | Existing tests verify old behavior. New behavior needs its own failing test first. |
| "This function is too simple to test" | Simple functions accumulate complexity. The test documents expected behavior before drift. |
| "I tested it manually in the terminal" | Manual checks do not persist. Tomorrow's change breaks the contract with no signal. |
| "The test requires complex mocking" | If the test is hard to write, the code is hard to reason about. Refactor the design first. |
| "Tests slow me down" | Test-first surfaces design problems early, when they are cheapest to fix. |
| "I'll skip REFACTOR this cycle to keep moving" | Skipped refactors compound. The next cycle starts from a worse baseline. |
DAMP over DRY: In test code, prefer Descriptive And Meaningful Phrases over Don't Repeat Yourself. Duplication inside a test that makes the intent obvious is better than an abstraction that hides it.
Beyonce Rule: If you liked it, you should have put a test on it. Any behavior CI does not verify will eventually break without warning.
skip, xit, or disabled tests were added in this change[ZONE:Evolvable] [HARD] The Red Flags and Verification checklists above sit in advisory (evolvable) blocks and are consumed by no completion gate. This section promotes them into two enforced invariants that make test-first falsifiable in the completion matrix.
These two invariants close the falsifiability gap: before them, a fully-passing self-verification matrix was producible with NO RED evidence, so test-first could not be distinguished from test-after by the completion report. After them, the matrix requires the verbatim pre-GREEN RED output, so a run that skipped RED has no such output to supply and the matrix is structurally incomplete.
Frequently asked questions
Test-Driven Development workflow specialist using RED-GREEN-REFACTOR cycle for test-first software development.
The source record exposes this install command: npx skills add https://github.com/modu-ai/moai-adk --skill ".claude/skills/moai-workflow-tdd". Inspect the command and pinned source before running it.
The pinned source record declares support for: claude code.
Alternatives
modu-ai/moai-adk
Test-Driven Development workflow specialist using RED-GREEN-REFACTOR cycle for test-first software development. Use when developing new features from scratch or when behavior specification drives implementation.
vasilyu1983/AI-Agents-public
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
yonatangross/orchestkit
Grade work that already exists and decide whether it can merge. Runs the project's current unit, integration, and E2E suites plus security scanning and type checking, scores every dimension 0-10, and returns a merge verdict with a VERIFIED-vs-CLAIMED evidence manifest. Writes no test files and edits no source. Use when verifying changes are ready to merge. Use /ork:cover instead when the tests still have to be written.
PramodDutta/qaskills
Gate RAG pipelines in CI with versioned golden eval sets, per-metric thresholds, baseline drift detection, and a build that fails when retrieval or answer quality regresses.