Skip to main content
SECTION · UTILITY COMMANDS

Utility Commands

Info
Belongs to: Agentic Loop Engineering · Agentic Harness

A collection of commands for autonomous automation, iterative fix loops, code management, and feedback.

Info
Unlike the workflow commands (/moai plan, /moai run, /moai sync), the utility commands specialize in fast automation and problem solving.

The Execution Surface of Agentic Loop Engineering

This section is where v3’s second pillar, agentic loop engineering, actually runs. /moai loop is a diagnostic loop that iterates until the issue queue found by diagnostic tools is empty, and /moai goal is a condition-declared loop where you declare a completion condition and the session works on its own until the condition holds. /moai fix is the one-shot (single-pass) preset in the same family. The observations left behind as the loop runs become raw material for harness learning — the entrance to the recursive cycle where loops accumulate observations, the harness learns, and the guidance evolves.

Command Comparison

CommandPurposeExecution styleWhen to use
/moaiFully autonomous automationThe whole pipeline from SPEC creation to documentationWhen you want to hand over a new feature end to end
/moai goalCondition-declared autonomous loopKeeps taking turns until the completion condition holdsWhen you want to declare an end state like “until all tests pass”
/moai loopIterative fix loopRepeats diagnose → fix → verifyWhen you want to knock out many errors at once
/moai fixOne-shot auto-fixDiagnose → fix → done (once)When you want to fix lint or type errors quickly
/moai gatePre-commit quality gateLint · format · type · test in parallel (<30s)When you want a fast pass/fail check before committing
/moai mx@MX code annotationsCodebase scan → @MX tag insertionWhen you want to plant AI-context code anchors and danger markers
/moai cleanDead-code removalStatic analysis → usage graph → safe removalWhen you want to clean up unused code
/moai codemapsArchitecture doc generationCodebase scan → auto-generated structure docsWhen you want to produce project architecture docs
/moai reviewMulti-lens code reviewSecurity · performance · quality · UX verdict + @MX compliance checkWhen you want a multi-lens review of a PR/changeset
/moai e2eE2E testingweb/mobile/desktop auto-detection + CLI-first runsWhen you want to create and run user-journey E2E tests
/moai feedbackSubmit feedbackAuto-creates a GitHub issueWhen sending a bug report or improvement proposal to MoAI-ADK

Command Relationship Map

flowchart TD
    A[Utility commands] --> B[Automation commands]
    A --> C[Code management commands]
    A --> D[Feedback commands]

    B --> E["/moai
fully autonomous automation"] B --> F["/moai loop
iterative fix loop"] B --> G["/moai fix
one-shot auto-fix"] C --> H["/moai clean
dead-code removal"] C --> I["/moai codemaps
architecture doc generation"] C --> K["/moai gate
pre-commit quality gate"] C --> L["/moai mx
@MX code annotations"] C --> M["/moai review
multi-lens code review"] C --> N["/moai e2e
E2E testing"] D --> J["/moai feedback
submit feedback"] E -->|used internally| F F -->|run just once| G H -->|regenerate after cleanup| I
Info
For the SPEC 3-Phase lifecycle commands (/moai plan, run, sync, project, design, harness), see the workflow commands section. The full list of 16 subcommands the /moai orchestrator routes is also there.
Info

Not sure which command to use?

  • Want to build a whole feature at once → /moai
  • “Work on your own until this condition is met” → /moai goal
  • Lots of errors in the code you want fixed iteratively → /moai loop
  • Just want simple lint errors fixed fast → /moai fix
  • Just want a fast pass/fail check before committing → /moai gate
  • Want to plant AI-context code annotations (@MX) → /moai mx
  • Want to clean up unused code → /moai clean
  • Want to produce project architecture docs → /moai codemaps
  • A problem with MoAI-ADK itself → /moai feedback