moai
Moai is an AI development framework that routes user requests through structured workflows (ideation, planning, implementation, and documentation) while enforcing governance rules and agent orchestration from centralized configuration files. Use it when you need systematic, multi-phase project execution with quality gates, token budgets, and coordinated agent teams for complex development tasks.
git clone --depth 1 https://github.com/modu-ai/moai-adk /tmp/moai && cp -r /tmp/moai/.claude/skills/moai ~/.claude/skills/moaiSKILL.md
## Pre-execution Context !`git status --porcelain 2>/dev/null || true` !`git branch --show-current 2>/dev/null || true` ## Essential Files .moai/config/sections/*.yaml --- ## Authority References Rules and constraints governing all workflows are always loaded from these sources. Do NOT duplicate their content here: - Core identity, orchestration principles, agent catalog: CLAUDE.md - Quality gates, security boundaries: .claude/rules/moai/core/moai-constitution.md - SPEC workflow phases, token budgets: .claude/rules/moai/workflow/spec-workflow.md - Development methodologies (DDD/TDD): .claude/rules/moai/workflow/spec-workflow.md (Run Phase section) - Agent definitions: See CLAUDE.md Section 4. For agent creation, use builder-harness subagent (artifact_type=agent). - @MX tag rules and protocol: .claude/rules/moai/workflow/mx-tag-protocol.md --- ## Routing Observation Ledger When dispatching a subcommand or workflow, the orchestrator records the routing decision to the append-only routing-ledger (`.moai/state/routing-ledger.jsonl`) via `moai harness ledger record` at dispatch time — the request text is piped via stdin and only a privacy-preserving digest is stored, never verbatim user text. As the routed pipeline reaches gate points, machine evidence is appended via `moai harness ledger evidence` (gate exits, audit verdicts, verify-log paths). Outcome is never supplied as an input; it is finalized from machine evidence only. This observation is opt-in and fail-open — it never blocks routing. NOTE: recording depends on the orchestrator actually invoking `moai harness ledger record` at dispatch; when the observability opt-in is ON but that record call is not emitted, the ledger stays empty — an un-recorded dispatch, NOT an opt-in-off no-op. Do not read an empty routing-ledger as 'opt-in disabled'. --- ## Intent Router ### Raw User Input $ARGUMENTS ### Routing Instructions [HARD] Route the Raw User Input above using the strict priority order below. Extract the FIRST WORD of the input for subcommand matching. All text after the subcommand keyword is CONTEXT to be passed to the matched workflow — it is NOT a routing signal and MUST NOT influence which workflow is selected. ## Execution Mode Flags (mutually exclusive) - `--team`: Force agent-team of the Phase 4 4-mode catalog (`.claude/rules/moai/workflow/orchestration-mode-selection.md` §A), subject to its capability gate - `--solo`: Force serial (sub-agent — single sequential agent per phase) - No flag: The orchestrator auto-selects from the full 4-mode catalog at Phase 4; the complexity auto-select thresholds are stated once in `orchestration-mode-selection.md` §B.1 (machine source: `workflow.yaml` `auto_selection`) and are not restated here The `--team` / `--solo` flags are forced overrides onto the catalog; the flag-free default resolves through the catalog decision tree (§B) and its capability gates. The `--mode` dispatch axis is a separate axis — see the crosswalk in `orchestration-mode-selection.md` §G.1 (correspondence, not merge). ### Priority 1: Explicit Subcommand Matching [HARD] Extract the FIRST WORD from the Raw User Input section above. If it matches any subcommand below (or its alias), route to that workflow IMMEDIATELY. Do NOT analyze the remaining text for routing — it is context for the matched workflow: [HARD] Mixed-language guard: FIRST-WORD subcommand matching applies only when (a) the input is pure ASCII/Latin, OR (b) the message is prefixed with a literal `/moai ` slash form. When the message contains non-Latin script (Korean/Japanese/Chinese/etc.) beyond the first token, do NOT route immediately on the leading English word — treat it as a possible embedded loanword and fall through to Priority 3 semantic classification of the ENTIRE message. Rationale: CJK technical writing embeds English loanwords such as 'goal', 'run', 'fix', 'plan' at sentence start; immediate first-word routing misfires on them. - **plan** (aliases: spec): SPEC document creation workflow - **run** (aliases: impl): DDD/TDD implementation workflow (per quality.yaml constitution.development_mode) - **sync** (aliases: docs, pr): Documentation synchronization and PR creation - **project** (aliases: init): Project documentation generation - **feedback** (aliases: fb): GitHub issue creation - **fix**: Auto-fix errors in a single pass - **loop**: Iterative auto-fix until completion conditions are satisfied - **mx**: MX tag scan and annotation for codebase - **review** (aliases: code-review): Code review with security and MX tag compliance - **clean** (aliases: dead-code): Identify and safely remove dead code - **codemaps**: Generate architecture documentation in `.moai/project/codemaps/` - **gate** (aliases: check, pre-commit): Lightweight pre-commit quality gate (lint+format+type-check+test) - **e2e** (aliases: e2e-test, end-to-end): Multi-platform end-to-end testing (web/mobile/desktop) with project-type auto-detection and CLI-first toolchain selection - **harness** (aliases: hrn): harness lifecycle management — learning-lifecycle verbs (status / apply / rollback <date> / disable) + v4-lifecycle verbs (list / edit / remove / doctor), all dispatching through the unified `moai harness` Go-binary Cobra subcommand tree; the slash command is the documented user-facing entry point - **goal**: Condition-declared universal agentic loop — arm a completion condition (`/moai goal "<condition>"`), check status, clear, or resume; evaluated each turn-end by the `stop-goal` Stop hook - **todo** (aliases: backlog): Backlog queue — the slash surface covers two acts: add an item (`/moai todo "<description>"`) and list the queue (bare `/moai todo`). Picking the next card and removing one are CLI-only verbs, run as `moai todo next [<n>]` and `moai todo done <n>`; the operator's entry point into the kanban board ### Priority 2: SPEC-ID Detection Only if Priority 1 did not match: Check if the Raw User Input contains a pattern matching SPEC-XXX (s
Claude Code upstream change tracker -> moai-adk update plan + docs sync workflow (dev-only). Tracks new CC release notes, classifies changes by impact tier, cross-references official docs, generates update plan at .moai/research/ or .moai/specs/, and synchronizes docs-site 4-locale + README. NOT distributed to user projects.
GitHub Workflow - Manage issues and review PRs with Agent Teams (dev-only). NOT distributed to user projects.
MoAI-ADK production release via Enhanced GitHub Flow (CLAUDE.local.md §18). Creates release/vX.Y.Z branch, version bump, CHANGELOG (bilingual), PR to main, merge commit (NOT squash), then scripts/release.sh for tag + GoReleaser. Hotfix support via --hotfix flag. All git operations delegated to manager-git. Quality failures escalate to expert-debug. NOT distributed to user projects (dev-only).
Run the 7-phase /moai brain ideation workflow to convert ideas into validated proposals
Identify and safely remove dead code with test verification
Scan codebase and generate architecture documentation in codemaps/
Analyze test coverage, identify gaps, and generate missing tests
Hybrid design workflow — Claude Design import (path A) or code-based brand design (path B)