Skip to Content
Core ConceptsWhat is MoAI-ADK?

What is MoAI-ADK?

MoAI-ADK is a high-performance AI development environment for Claude Code. 28 specialized AI agents and 52 skills collaborate to produce high-quality code. It automatically applies TDD (default) for new projects and feature development, and DDD for existing projects with low test coverage, while supporting both Sub-Agent and Agent Teams dual execution modes.

Written as a single Go binary — runs instantly on all platforms with zero dependencies.

One-line summary: MoAI-ADK is an AI development framework that “documents conversations with AI as specs (SPEC), safely improves code (DDD/TDD), and automatically validates quality (TRUST 5).”

MoAI-ADK Introduction

MoAI means “Everybody’s AI” (MoAI - Everybody’s AI). ADK stands for Agentic Development Kit, a toolkit where AI agents lead the development process.

MoAI-ADK is an Agentic Development Kit that enables agents to perform agentic coding through interaction within Claude Code. Just like an AI development team collaborating to complete a project, MoAI-ADK’s AI agents perform development work in their respective areas of expertise while collaborating with each other.

AI Development TeamMoAI-ADKRole
Product OwnerUser (Developer)Decides what to build
Team Lead / Tech LeadMoAI OrchestratorCoordinates overall work and delegates to team members
Planner / Spec Writermanager-specDocuments requirements
Developers / Engineersexpert-backend, expert-frontendImplements actual code
QA / Code Reviewermanager-qualityValidates quality standards

Why MoAI-ADK?

Complete Rewrite from Python to Go

The Python-based MoAI-ADK (~73,000 lines) was completely rewritten in Go.

ItemPython EditionGo Edition
Distributionpip + venv + dependenciesSingle binary, zero dependencies
Startup Time~800ms interpreter boot~5ms native execution
Concurrencyasyncio / threadingNative goroutines
Type SafetyRuntime (mypy optional)Compile-time enforcement
Cross-PlatformPython runtime requiredPre-built binaries (macOS, Linux, Windows)
Hook ExecutionShell wrapper + PythonCompiled binary, JSON protocol

Key Numbers

  • 34,220 lines of Go code, 32 packages
  • 85-100% test coverage
  • 28 specialized AI agents + 52 skills
  • 18 programming languages supported
  • 16 Claude Code Hook events

Problems with Vibe Coding

Vibe Coding is a method of writing code while naturally conversing with AI. You say “create this feature” and AI generates code. It’s intuitive and fast, but causes serious problems in practice.

Specific problems encountered in practice:

ProblemSituation ExampleResult
Context LossHave to re-explain the authentication method discussed for 1 hour yesterdayTime waste, reduced consistency
Quality InconsistencyAI sometimes generates good code, sometimes bad codeUnpredictable code quality
Breaking Existing CodeSaid “fix this part” but other features brokeBugs, rollback needed
Repeated ExplanationsHave to re-explain project structure and coding rules every timeReduced productivity
No ValidationNo way to verify if AI-generated code is safeSecurity vulnerabilities, missing tests

MoAI-ADK Solutions

ProblemMoAI-ADK Solution
Context lossPermanently preserve requirements as files with SPEC documents
Quality inconsistencyApply consistent quality standards with TRUST 5 framework
Breaking existing codeProtect existing functionality by writing tests first with DDD/TDD
Repeated explanationsAutomatically load project context with CLAUDE.md and skill system
No validationAutomatically validate code quality with LSP quality gates

System Requirements

PlatformSupported EnvironmentsNotes
macOSTerminal, iTerm2Fully supported
LinuxBash, ZshFully supported
WindowsWSL (recommended), PowerShell 7.x+Native cmd.exe is not supported

Prerequisites:

  • Git must be installed on all platforms
  • Windows users: Git for Windows  is required (includes Git Bash)
    • WSL (Windows Subsystem for Linux) is recommended for the best experience
    • PowerShell 7.x or later is supported as an alternative
    • Legacy Windows PowerShell 5.x and cmd.exe are not supported

Quick Start

1. Installation

macOS / Linux / WSL

curl -fsSL https://raw.githubusercontent.com/modu-ai/moai-adk/main/install.sh | bash

Windows (PowerShell 7.x+)

Recommended: Use WSL with the Linux install command above for the best experience.

irm https://raw.githubusercontent.com/modu-ai/moai-adk/main/install.ps1 | iex

Git for Windows  must be installed first.

Build from Source (Go 1.26+)

git clone https://github.com/modu-ai/moai-adk.git cd moai-adk && make build

Pre-built binaries can be downloaded from the Releases  page.

2. Project Initialization

moai init my-project

An interactive wizard auto-detects your language, framework, and methodology, then generates Claude Code integration files.

3. Start Development in Claude Code

# After launching Claude Code /moai project # Generate project docs (product.md, structure.md, tech.md) /moai plan "Add user authentication" # Create SPEC document /moai run SPEC-AUTH-001 # DDD/TDD implementation /moai sync SPEC-AUTH-001 # Sync documentation and create PR

Core Philosophy

“The purpose of vibe coding is not fast productivity, but code quality.”

MoAI-ADK is not a tool for quickly churning out code. The goal is to create higher quality code than what humans write directly, while leveraging AI. Fast speed is a secondary effect that naturally follows while maintaining quality.

This philosophy is concretized in three principles:

  1. SPEC-First: Before writing code, clearly define what to build in a document
  2. Safe Improvement (DDD/TDD): Incrementally improve while preserving existing code behavior
  3. Auto Quality Validation (TRUST 5): Automatically validate all code with 5 quality principles

MoAI Development Methodology

MoAI-ADK automatically selects the optimal development methodology based on the project state.

TDD Methodology (Default)

The default methodology for new projects and feature development. Write tests first, then implement.

PhaseDescription
REDWrite a failing test that defines the expected behavior
GREENWrite the minimal code to pass the test
REFACTORImprove code quality while keeping tests green. /simplify runs automatically after REFACTOR completes.

For brownfield projects (existing codebases), TDD adds a pre-RED analysis phase: read existing code to understand current behavior before writing tests.

DDD Methodology (Existing Projects, < 10% Coverage)

A methodology for safely refactoring existing projects with low test coverage.

ANALYZE → Analyze existing code and dependencies, identify domain boundaries PRESERVE → Write characterization tests, capture current behavior snapshots IMPROVE → Improve incrementally under test protection. /simplify runs automatically after IMPROVE completes.

The methodology is auto-selected during moai init (--mode <ddd|tdd>, default: tdd) and can be changed in development_mode within .moai/config/sections/quality.yaml.

Note: MoAI-ADK v2.5.0+ uses binary methodology selection (TDD or DDD only). Hybrid mode has been removed for clarity and consistency.

Harness Engineering Architecture

MoAI-ADK implements the Harness Engineering paradigm — designing the environment for AI agents rather than writing code directly.

ComponentDescriptionCommand
Self-Verify LoopAgents write code → test → fail → fix → pass cycle autonomously/moai loop
Context MapCodebase architecture maps and documentation always available to agents/moai codemaps
Session Persistenceprogress.md tracks completed phases across sessions; interrupted runs resume automatically/moai run SPEC-XXX
Failing ChecklistAll acceptance criteria registered as pending tasks at run start; marked complete as implemented/moai run SPEC-XXX
Language-Agnostic18 languages supported: auto-detects language, selects correct LSP/linter/test/coverage toolsAll workflows
Garbage CollectionPeriodic scan and removal of dead code, AI Slop, and unused imports/moai clean
Scaffolding FirstEmpty file stubs created before implementation to prevent entropy/moai run SPEC-XXX

“Human steers, agents execute.” — The engineer’s role shifts from writing code to designing the harness: SPECs, quality gates, and feedback loops.

Auto Quality and Scale-Out Layer

MoAI-ADK v2.6.0+ integrates two Claude Code native skills that MoAI invokes autonomously — no flags or manual commands required.

SkillRoleTrigger
/simplifyQuality enforcementAlways runs after every TDD REFACTOR and DDD IMPROVE phase
/batchScale-out executionAuto-triggered when task complexity exceeds thresholds

/simplify — Automatic Quality Pass

Uses parallel agents to review changed code for reuse opportunities, quality issues, efficiency, and CLAUDE.md compliance, then auto-fixes findings. MoAI calls this directly after every implementation cycle — no configuration needed.

/batch — Parallel Scale-Out

Spawns dozens of agents in isolated git worktrees for large-scale parallel work. Each agent runs tests and reports results; MoAI merges them. Auto-triggered per workflow:

WorkflowTrigger Condition
runtasks >= 5, OR predicted file changes >= 10, OR independent tasks >= 3
mxsource files >= 50
coverageP1+P2 coverage gaps >= 10
cleanconfirmed dead code items >= 20

AI Agent Orchestration

MoAI is a strategic orchestrator. It does not write code directly, but delegates work to 28 specialized agents.

Agent Categories

CategoryCountAgentsRole
Manager8spec, ddd, tdd, docs, quality, project, strategy, gitWorkflow coordination, SPEC creation, quality management
Expert8backend, frontend, security, devops, performance, debug, testing, refactoringDomain-specific implementation, analysis, optimization
Builder3agent, skill, pluginCreate new MoAI components
Team8researcher, analyst, architect, designer, backend-dev, frontend-dev, tester, qualityParallel team-based development

52 Skills (Progressive Disclosure)

Managed token-efficiently with a 3-level Progressive Disclosure system:

CategoryCountExamples
Foundation5core, claude, philosopher, quality, context
Workflow11spec, project, ddd, tdd, testing, worktree, thinking…
Domain5backend, frontend, database, uiux, data-formats
Language18Go, Python, TypeScript, Rust, Java, Kotlin, Swift, C++…
Platform9Vercel, Supabase, Firebase, Auth0, Clerk, Railway…
Library3shadcn, nextra, mermaid
Tool2ast-grep, svg
Specialist10Figma, Flutter, Pencil…

MoAI Workflow

Plan → Run → Sync Pipeline

MoAI’s core workflow consists of 3 phases:

Actual usage example:

# 1. Plan: Define requirements > /moai plan "Implement JWT-based user authentication" # 2. Run: Implement with DDD/TDD > /moai run SPEC-AUTH-001 # 3. Sync: Generate documentation and PR > /moai sync SPEC-AUTH-001

Execution Mode Selection Gate

When transitioning from Plan to Run phase, MoAI automatically detects the current execution environment (cc/glm/cg) and presents a selection UI for the user to confirm or change the mode before implementation begins.

This gate ensures the correct execution mode is used regardless of the environment state, preventing mode mismatches during implementation.

/moai Subcommands

All subcommands are invoked within Claude Code as /moai <subcommand>.

Core Workflow

SubcommandAliasesPurposeKey Flags
planspecCreate SPEC document (EARS format)--worktree, --branch, --resume SPEC-XXX, --team
runimplDDD/TDD implementation of a SPEC--resume SPEC-XXX, --team
syncdocs, prSync documentation, codemaps, and create PR--merge, --skip-mx

Quality and Testing

SubcommandAliasesPurposeKey Flags
fixAuto-fix LSP errors, lint, type errors (single pass)--dry, --seq, --level N, --resume, --team
loopIterative auto-fix until completion (max 100 iterations)--max N, --auto-fix, --seq
reviewcode-reviewCode review with security and @MX tag compliance--staged, --branch, --security
coveragetest-coverageTest coverage analysis and gap filling (16 languages)--target N, --file PATH, --report
e2eE2E testing (Chrome, Playwright, Agent Browser)--record, --url URL, --journey NAME
cleanrefactor-cleanDead code identification and safe removal--dry, --safe-only, --file PATH

Documentation and Codebase

SubcommandAliasesPurposeKey Flags
projectinitGenerate project docs (product.md, structure.md, tech.md, codemaps/)
mxScan codebase and add @MX code-level annotations--all, --dry, --priority P1-P4, --force, --team
codemapsupdate-codemapsGenerate architecture docs--force, --area AREA
feedbackfb, bug, issueCollect feedback and create GitHub issues

Default Workflow

SubcommandPurposeKey Flags
(none)Full autonomous plan → run → sync pipeline. Auto-creates SPEC when complexity score >= 5.--loop, --max N, --branch, --pr, --resume SPEC-XXX, --team, --solo

Execution Mode Flags

Controls how agents are deployed during workflow execution:

FlagModeDescription
--teamAgent TeamsParallel team-based execution. Multiple agents work simultaneously.
--soloSub-AgentSequential single-agent delegation per phase.
(default)AutoComplexity-based auto-selection (domains >= 3, files >= 10, score >= 7).

--team supports 3 execution environments:

EnvironmentCommandLeaderWorkersBest For
Claude Onlymoai ccClaudeClaudeMaximum quality
GLM Onlymoai glmGLMGLMMaximum cost savings
CG (Claude+GLM)moai cgClaudeGLMQuality + cost balance

New in v2.7.1: CG mode is now the default team mode. When using --team, the system runs in CG mode unless explicitly changed with moai cc or moai glm.

moai cg uses tmux session-level env isolation to separate Claude Leader from GLM Workers. If switching from moai glm, moai cg automatically resets GLM settings first.

Autonomous Development Loop (Ralph Engine)

An autonomous error-fixing engine that combines LSP diagnostics with AST-grep:

/moai fix # Single pass: scan → classify → fix → verify /moai loop # Iterative fix: repeat until completion marker detected (max 100)

How Ralph Engine works:

  1. Parallel Scan: Run LSP diagnostics + AST-grep + linters simultaneously
  2. Auto Classification: Classify errors from Level 1 (auto-fix) to Level 4 (user intervention)
  3. Convergence Detection: Apply alternative strategies when the same errors repeat
  4. Completion Criteria: 0 errors, 0 type errors, 85%+ coverage

New feature development:

/moai plan → /moai run SPEC-XXX → /moai sync SPEC-XXX

Bug fix:

/moai fix (or /moai loop) → /moai review → /moai sync

Refactoring:

/moai plan → /moai clean → /moai run SPEC-XXX → /moai review → /moai coverage → /moai codemaps

Documentation update:

/moai codemaps → /moai sync

TRUST 5 Quality Framework

All code changes are validated against 5 quality criteria:

CriterionMeaningValidation
TestedTested85%+ coverage, characterization tests, unit tests passing
ReadableReadableClear naming conventions, consistent code style, 0 lint errors
UnifiedUnifiedConsistent formatting, import sorting, project structure compliance
SecuredSecuredOWASP compliance, input validation, 0 security warnings
TrackableTrackableConventional Commits, issue references, structured logging

@MX Tag System

MoAI-ADK uses the @MX code-level annotation system to communicate context, invariants, and danger zones between AI agents.

Tag TypePurposeWhen Added
@MX:ANCHORImportant contractsFunctions with fan_in >= 3, wide impact on change
@MX:WARNDanger zonesGoroutines, complexity >= 15, global state mutation
@MX:NOTEContext deliveryMagic constants, missing documentation, business rules
@MX:TODOIncomplete workMissing tests, unimplemented features

The @MX tag system is designed to mark only the most dangerous and important code. Most code does not need tags, and this is by design.

# Scan entire codebase /moai mx --all # Preview only (no file modifications) /moai mx --dry # Scan by priority /moai mx --priority P1

Model Policy (Token Optimization)

MoAI-ADK assigns optimal AI models to 28 agents based on your Claude Code subscription plan. It maximizes quality within your plan’s rate limits.

PolicyPlan🟣 Opus🔵 Sonnet🟡 HaikuBest For
HighMax $200/mo2314Maximum quality, highest throughput
MediumMax $100/mo4195Balance of quality and cost
LowPlus $20/mo01216Budget-friendly, no Opus

Configuration

# During project initialization moai init my-project # Select model policy in interactive wizard # Reconfigure existing project moai update # Interactive prompts for each configuration step

The default policy is High. GLM settings are isolated in settings.local.json (not committed to Git).

Dual Execution Modes

MoAI-ADK provides both Sub-Agent and Agent Teams execution modes supported by Claude Code.

Agent Teams Mode (Default)

MoAI-ADK automatically analyzes project complexity to select the optimal execution mode:

ConditionSelected ModeReason
3+ domainsAgent TeamsMulti-domain coordination
10+ affected filesAgent TeamsLarge-scale changes
Complexity score 7+Agent TeamsHigh complexity
OtherwiseSub-AgentSimple, predictable workflow

Agent Teams mode uses parallel team-based development:

  • Multiple agents work simultaneously, collaborating via shared task list
  • Real-time coordination through TeamCreate, SendMessage, and TaskList
  • Ideal for large-scale feature development and multi-domain tasks
/moai plan "large-scale feature" # Auto: researcher + analyst + architect in parallel /moai run SPEC-XXX # Auto: backend-dev + frontend-dev + tester in parallel /moai run SPEC-XXX --team # Force Agent Teams mode

Quality hooks for Agent Teams:

  • TeammateIdle hook: Validates LSP quality gates (errors, type errors, lint errors) before a teammate transitions to idle
  • TaskCompleted hook: Verifies SPEC document existence when a task references a SPEC-XXX pattern
  • All validations use graceful degradation — warnings are logged but work continues

CG Mode (Claude + GLM Hybrid)

CG mode is a hybrid mode where the Leader uses the Claude API and Workers use the GLM API. It is implemented through tmux session-level environment variable isolation.

┌─────────────────────────────────────────────────────────────┐ │ LEADER (current tmux pane, Claude API) │ │ - Orchestrates workflow when /moai --team is executed │ │ - Handles plan, quality, sync phases │ │ - No GLM env → uses Claude API │ └──────────────────────┬──────────────────────────────────────┘ │ Agent Teams (new tmux panes) ┌─────────────────────────────────────────────────────────────┐ │ TEAMMATES (new tmux panes, GLM API) │ │ - Inherits tmux session env → uses GLM API │ │ - Executes implementation tasks in run phase │ │ - Communicates with leader via SendMessage │ └─────────────────────────────────────────────────────────────┘
# 1. Store GLM API key (one-time) moai glm sk-your-glm-api-key # 2. Activate CG mode moai cg # 3. Start Claude Code in the same pane (important!) claude # 4. Execute team workflow /moai --team "task description"
CommandLeaderWorkerstmux RequiredCost SavingsUse Case
moai ccClaudeClaudeNo-Complex tasks, maximum quality
moai glmGLMGLMRecommended~70%Cost optimization
moai cgClaudeGLMRequired~60%Quality + cost balance

Sub-Agent Mode (--solo)

A sequential agent delegation approach using the existing Claude Code Task() API.

  • Delegates work to a single expert agent and receives results
  • Proceeds step by step in Manager → Expert → Quality order
  • Suitable for simple, predictable workflows
/moai run SPEC-AUTH-001 --solo # Force Sub-Agent mode

CLI Commands

CommandDescription
moai initInteractive project setup (auto-detects language/framework/methodology)
moai doctorSystem health check and environment verification
moai statusProject status summary including Git branch and quality metrics
moai updateUpdate to the latest version (with auto-rollback support)
moai update --checkCheck for updates without installing
moai update --projectSync project templates only
moai worktree new <name>Create a new Git worktree (parallel branch development)
moai worktree listList active worktrees
moai worktree switch <name>Switch worktree
moai worktree syncSync with upstream
moai worktree remove <name>Remove a worktree
moai worktree cleanClean up stale worktrees
moai worktree go <name>Navigate to worktree directory in current shell
moai hook <event>Claude Code Hook dispatcher
moai glmStart Claude Code with GLM API (cost-efficient alternative)
moai ccStart Claude Code without GLM settings (Claude-only mode)
moai cgActivate CG mode — Claude Leader + GLM Workers (tmux pane-level isolation)
moai versionDisplay version, commit hash, and build date

Task Metrics Logging

MoAI-ADK automatically captures Task tool metrics during development sessions:

  • Location: .moai/logs/task-metrics.jsonl
  • Captured Metrics: Token usage, tool calls, duration, agent type
  • Purpose: Session analytics, performance optimization, cost tracking

The PostToolUse hook logs metrics when a Task tool completes. Use this data to analyze agent efficiency and optimize token consumption.

Project Structure

When you install MoAI-ADK, the following structure is created in your project.

my-project/ ├── CLAUDE.md # MoAI execution guidelines ├── .claude/ │ ├── agents/moai/ # 28 AI agent definitions │ ├── skills/moai-*/ # 52 skill modules │ ├── hooks/moai/ # Automation hook scripts │ └── rules/moai/ # Coding rules and standards └── .moai/ ├── config/ # MoAI configuration files │ └── sections/ │ └── quality.yaml # TRUST 5 quality settings ├── specs/ # SPEC document storage │ └── SPEC-XXX/ │ └── spec.md └── memory/ # Cross-session context persistence

Key file descriptions:

File/DirectoryRole
CLAUDE.mdExecution guidelines that MoAI reads. Contains project rules, agent catalog, and workflow definitions
.claude/agents/Defines each agent’s area of expertise and tool permissions
.claude/skills/Knowledge modules containing best practices for programming languages and platforms
.moai/specs/Where SPEC documents are stored. Each feature has its own directory
.moai/config/Manages project settings such as TRUST 5 quality standards and DDD/TDD configuration

Multilingual Support

MoAI-ADK supports 4 languages. When users request in Korean, it responds in Korean; when requested in English, it responds in English.

LanguageCodeSupport Range
KoreankoConversation, documentation, commands, error messages
EnglishenConversation, documentation, commands, error messages
JapanesejaConversation, documentation, commands, error messages
ChinesezhConversation, documentation, commands, error messages

Language Settings: In .moai/config/sections/language.yaml, you can set the conversation language, code comment language, and commit message language separately. For example, you can converse in Korean while writing code comments and commit messages in English.

Next Steps

Now that you understand the big picture of MoAI-ADK, it’s time to learn each core concept in detail.

Last updated on