MoAI-ADK is a Go-based harness that organizes and verifies Claude Code work across planning, implementation, synchronization, and review stages. Developers use it to structure agentic coding tasks, apply quality gates, and route work across language models, while the catalogue entries extend its workflow with skills, hooks, commands, MCP servers, instructions, and settings.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/modu-ai/moai-adk/moai-workflow-loopnpx skills add modu-ai/moai-adk --skill moai-workflow-loopgit clone --depth 1 https://github.com/modu-ai/moai-adkWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/modu-ai/moai-adk/moai-workflow-loop)<a href="https://agentmods.dev/skills/modu-ai/moai-adk/moai-workflow-loop"><img src="https://agentmods.dev/badge/skills/modu-ai/moai-adk/moai-workflow-loop.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.02696 |
| Opus 5 | $0.00022 | $0.01348 |
| Sonnet 5 | $0.00009 | $0.00539 |
| Haiku 4.5 | $0.00004 | $0.00270 |
Grade A, and why
moai-workflow-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ralph Engine
Automated feedback loop system integrating LSP diagnostics, AST-grep security scanning, and test validation for continuous code quality improvement.
Preset Architecture — the Ralph Engine as a goal preset
The /moai loop skill (.claude/skills/moai/workflows/loop.md) re-expresses this Ralph engine as a goal preset built ON the goal engine: a scan stage builds a finite issue queue, and the iterate-until-done decision is delegated to the goal engine (stop-goal) with the pre-filled condition "queue drained + diagnostics clean". In this preset architecture, this SKILL.md documents the underlying LSP / AST-grep / test / coverage diagnostic machinery that the goal-preset sweep drives; the preset layers the goal-engine composition on top of that machinery WITHOUT changing it. The four loop quadrants (goal-based sweep, turn-based /moai fix, time-based cadence, proactive CI-watch) are presets on the one goal engine, not independent engines.
Quick Reference
Core Capabilities:
- LSP Integration: Real-time diagnostics from language servers
- AST-grep Scanning: Structural code analysis and security checks
- Feedback Loop: Iterative error correction until completion conditions met
- Hook System: PostToolUse and Stop hooks for seamless Claude Code integration
Key Components:
- post_tool__lsp_diagnostic: LSP diagnostics after Write/Edit operations
- stop__loop_controller: Loop iteration control
- ralph.yaml: Configuration settings
Commands:
- /moai: One-click Plan-Run-Sync automation (default)
- /moai loop: Start feedback loop
- /moai fix: One-time auto-fix
When to Use:
- Implementing features with zero-error goal
- Automated code quality improvement
- Continuous integration workflows
- Error-driven development patterns
Implementation Guide
Architecture Overview
The Ralph Engine follows a layered architecture. User commands such as /moai:loop, /moai:fix, and /moai enter the Command Layer. The Command Layer invokes the Hook System, which contains the PostToolUse Hook for LSP diagnostics and the Stop Hook for loop control. The Hook System connects to Backend Services including the LSP Client (MoAILSPClient), AST-grep Scanner, and Test Runner. Backend Services feed into Completion Check which evaluates whether errors are zero, tests pass, and coverage is met. Based on the Completion Check result, the system either continues the loop or completes.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 240 lines · 44 tokens per session scan A c313738f274f
moai-workflow-loop is a skill published in the GitHub repository modu-ai/moai-adk (1,200 stars, last pushed 3d ago), licensed Apache-2.0. It adds 44 tokens to every session and 2,696 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
qa
Systematic QA testing of a web application: diff-aware, tiered, with fix-and-verify loop.
test-runner
Use this skill when orchestrating agentic end-to-end tests. Resolves target + profile, dispatches the right driver(s) (playwright for web today, peekaboo for macOS (issue #381)), invokes the ux-evaluator agent (opus, read-only) against driver artifacts, reconciles findings with the open issue tracker via…
implement
Use in the Implement phase whenever writing or editing production Java code, or fixing a bug, in a Spring/Spring Boot project. Enforces test-first (red-green-refactor), executes the approved plan step by step, and honors the project's path-scoped tech-stack rules and the task's enforcement set. Preloaded into…
quality-hooks
Language-specific auto-lint/format/typecheck pipeline. Supports Python (ruff+pyright), TypeScript (prettier+eslint+tsc), Go (gofmt+golangci-lint). Auto-fix and convergence loops.
eval-hooks
Audit Claude Code hooks defined in settings.json files for validity, performance safety, and correctness. Resolves each command against the filesystem, checks exit-code strategy for blocking hooks, flags missing timeouts, and reviews interactive vs async patterns. Use when setting up hooks for the first time…
check-cache-bugs
Audit Claude Code setup for cache bugs (CC#40524): sentinel, --resume/--continue, attribution header + ArkNill B3/B4/B5.