moai-workflow-loop

moai-workflow-loop is a skill for Claude Code from modu-ai/moai-adk. It costs 44 tokens per session (2,696 once invoked), scanned A, original, Apache-2.0.

An automated code-quality feedback loop that combines language-server diagnostics, structural code searches, security checks, tests, and coverage checks.

In plain words
What is it for?
Use it for error-driven development, automated fix cycles, continuous quality checks, and reviewing code for structural or security problems.
Why use it?
It helps developers repeatedly find and fix issues until the remaining queue is cleared and diagnostics are clean.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

About the project

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.

modu-ai/moai-adk · 1,200 stars · on GitHub · adk.mo.ai.kr

Install

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.

agentmods
npx agentmods add skills/modu-ai/moai-adk/moai-workflow-loop
Any agent
npx skills add modu-ai/moai-adk --skill moai-workflow-loop
Clone the repo
git clone --depth 1 https://github.com/modu-ai/moai-adk

Made for: Claude Code.

Wrote 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.

agentmods badge for moai-workflow-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/modu-ai/moai-adk/moai-workflow-loop.svg)](https://agentmods.dev/skills/modu-ai/moai-adk/moai-workflow-loop)
Your own site
<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>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 7d ago against content hash c313738f274f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

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.

.claude/skills/moai-workflow-loop/SKILL.md · 240 lines

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.

Read the full file on GitHub · 240 lines

Files

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.

Changes

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.

  1. 7d ago First seen · 240 lines · 44 tokens per session scan A c313738f274f

Subscribe to this mod's changes

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.

Related

Other skills, from other repositories

qa

Systematic QA testing of a web application: diff-aware, tiered, with fix-and-verify loop.

FlorianBruniaux/claude-code-ultimate-guide · 23 tokens

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…

Kanevry/session-orchestrator · 124 tokens

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…

taipt1504/claudehut · 73 tokens

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.

a5c-ai/babysitter · 53 tokens

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…

FlorianBruniaux/claude-code-ultimate-guide · 78 tokens

check-cache-bugs

Audit Claude Code setup for cache bugs (CC#40524): sentinel, --resume/--continue, attribution header + ArkNill B3/B4/B5.

FlorianBruniaux/claude-code-ultimate-guide · 38 tokens