moai-workflow-loop

Automates iterative code fixing using LSP diagnostics, AST-grep scanning, and test validation loops.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/taewook486/Masters_degree --skill moai-workflow-loop-taewook486
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-workflow-loop
Source: https://github.com/taewook486/Masters_degree/tree/main/.claude/skills/moai-workflow-loop
Command: npx skills add https://github.com/taewook486/Masters_degree --skill moai-workflow-loop-taewook486

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Manually chasing compiler errors, linter warnings, and security issues after every code edit is slow and error-prone. This Skill runs an automated feedback loop that collects LSP diagnostics and AST-grep scan results after each Write/Edit operation, then iterates until errors reach zero, tests pass, and coverage thresholds are met. ## Core Features & Use Cases - LSP Diagnostic Feedback Loop: PostToolUse hooks capture real-time diagnostics from language servers across 16 supported languages after every file edit. - AST-grep Security and Quality Scanning: Detects structural issues such as SQL injection, XSS, and hardcoded secrets using configurable AST-grep rules. - Configurable Completion Conditions: Loop terminates on zero errors, passing tests, and coverage thresholds, with graceful degradation to linters when LSP servers are unavailable. - Use Case: While implementing a new authentication module, the loop automatically reports type errors after each edit, guides fixes across iterations, and stops only when all diagnostics are clear and tests pass. ## Quick Start Ask the AI to start the feedback loop with /moai loop so it iteratively fixes LSP errors until the codebase is clean.

Frequently Asked Questions about moai-workflow-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up an automated error-fixing loop with LSP diagnostics?▼

Enable the loop in ralph.yaml with ralph.enabled set to true, then run /moai loop. PostToolUse hooks collect LSP diagnostics after each Write or Edit, and a Stop hook checks completion conditions until errors reach zero or max iterations is hit.

What languages does LSP-based diagnostic feedback support?▼

The loop supports 16 languages including Python, TypeScript, Go, Rust, Java, C++, C#, Ruby, PHP, Kotlin, Swift, Scala, Elixir, R, JavaScript, and Flutter. It detects the project language via marker files like go.mod or pyproject.toml and spawns the matching language server.

Can I use AST-grep security scanning without the full feedback loop?▼

Yes, AST-grep scanning can run independently via moai ast-grep scan with security rules for SQL injection, XSS, and hardcoded secrets. The loop simply integrates these scans into its iterative quality checks.

What happens when the LSP server is unavailable during the loop?▼

When graceful_degradation is enabled, the system falls back to linter-based diagnostics such as ruff or eslint, then to compiler error detection, and finally to test failure detection. Missing servers trigger a warn-and-skip with an install hint rather than a hard failure.

Why is the feedback loop stuck and never completing?▼

The loop stalls when max_iterations is too low, completion conditions are unachievable, or error counts stop decreasing. Check ralph.yaml settings, review the state file at .moai/cache/.moai_loop_state.json, or delete the state file to reset the loop.

How do I integrate the quality loop into GitHub Actions CI?▼

Add a workflow step that runs claude with the /moai loop command and a max-iterations flag, setting MOAI_LOOP_ACTIVE to true. The loop executes headlessly and results can be checked with a follow-up script step.