Skip to main content
SECTION · WORKFLOW COMMANDS

Workflow Commands

Info
Belongs to: Agentic Harness

SPEC 3-phase pipeline

A set of commands that run the SPEC-based 3-Phase lifecycle (plan → run → sync).

The Center of the Agentic Harness — the 3-Phase Lifecycle

One of the core values of MoAI-ADK v3 is the Agentic Harness. Instead of writing code directly, you design the environment where agents work well — SPEC documents, quality gates, and feedback loops. The workflow commands run the plan → run → sync pipeline, the central axis of this harness.

Each phase is handled by a specialized agent, and planning and auditing are separated so that whoever produced an artifact never inspects it. The plan-phase output is independently audited by plan-auditor, and the sync-phase result is evaluated by sync-auditor across 4 dimensions (Functionality, Security, Craft, Consistency). Right before entering the run phase, the Implementation Kickoff Approval (a human gate) always returns to the user.

flowchart TD
    A["/moai project
Generate project docs"] --> B["/moai plan
Create SPEC document"] B --> D["/moai run
DDD/TDD implementation"] D --> E["/moai sync
Doc sync and PR"] E -.-> B D -.-> B F["/moai harness
Harness learning system"] -.-> D

Command Summary

CommandPhaseResponsible agentToken budgetPurpose
/moai projectPhase 0manager-docs-Auto-generate project documentation
/moai planPhase 1manager-spec30KCreate SPEC documents
/moai runPhase 2manager-develop180KDDD/TDD implementation
/moai syncPhase 3manager-docs40KDoc synchronization and PR creation
/moai harnessAuxiliarybuilder-harness-Harness creation and learning lifecycle management

The differing per-phase token budgets are also part of v3’s Token Economics design. Planning needs deep reasoning but produces small artifacts (30K), implementation involves a lot of code and needs a generous budget (180K), and doc synchronization sits in between (40K). The practice of clearing context with /clear between phases comes from the same reasoning — by not carrying the previous phase’s conversation into the next, each phase gets its full budget.

Info

If you are new, start with /moai project. Project documentation must exist for the AI to accurately understand and work on your project in later phases.

/moai harness is an auxiliary command for managing the harness learning subsystem — it monitors CLAUDE.md changes and proposes tier-based automatic updates.

All subcommands (16)

The /moai orchestrator routes 16 subcommands. This (workflow) section covers the SPEC 3-Phase lifecycle commands, and the utility commands section covers automation, fix-loop, code-management, and feedback commands.

Workflow commands (this section):

SubcommandPurpose
/moai planSPEC document creation
/moai runDDD/TDD implementation
/moai syncDoc synchronization and PR
/moai projectProject documentation generation
/moai designDesign-phase collaboration (manager-design D1-D5)
/moai harnessHarness creation and learning lifecycle

Utility commands (utility section):

SubcommandPurpose
/moai fixOne-shot auto-fix
/moai loopIterative fix loop
/moai mx@MX code annotations
/moai feedbackGitHub issue feedback
/moai reviewMulti-lens code review (security · @MX)
/moai cleanDead-code removal
/moai codemapsArchitecture codemap generation
/moai gatePre-commit quality gate
/moai e2eMulti-platform E2E testing
/moai goalCondition-declared autonomous loop

Quick Start

bash
# Phase 0: Generate project docs (once, at first)
> /moai project

# Phase 1: Create SPEC
> /moai plan "Implement user authentication"
> /clear

# Phase 2: DDD implementation
> /moai run SPEC-AUTH-001
> /clear

# Phase 3: Doc sync and PR
> /moai sync SPEC-AUTH-001

# Auxiliary: harness learning management (optional)
> /moai harness status
> /moai harness apply

You can also make requests in plain natural language. If you type something like /moai "fix the login bug" without a subcommand, Analyze-First routing analyzes your intent and automatically connects it to the right workflow.