Agent Skills: Ralph Loop Mechanics

Technical mechanics for autonomous AI coding loops

UncategorizedID: majesticlabs-dev/majestic-marketplace/ralph-methodology

Install this agent skill to your local

pnpm dlx add-skill https://github.com/majesticlabs-dev/majestic-marketplace/tree/HEAD/plugins/majestic-ralph/skills/ralph-methodology

Skill Files

Browse the full folder contents for ralph-methodology.

Download Skill

Loading file tree…

plugins/majestic-ralph/skills/ralph-methodology/SKILL.md

Skill Metadata

Name
ralph-methodology
Description
Technical mechanics for autonomous AI coding loops

Ralph Loop Mechanics

How It Works

  1. Start: User runs /majestic-ralph:start "<prompt>" --max-iterations N --completion-promise "WORD"
  2. Loop: Stop hook intercepts session exit, re-feeds same prompt
  3. Exit: Output <promise>WORD</promise> to signal genuine completion

State File

Location: .claude/ralph-loop.local.yml

iteration: 1
max_iterations: 50
completion_promise: DONE
started_at: 2024-01-15T10:30:00Z
prompt: |
  Your prompt here.
  Can be multiline.

Completion Signal

Output exactly: <promise>YOUR_PHRASE</promise>

  • Only output when genuinely complete
  • Lying restarts the loop
  • Max iterations is a hard stop

Safety Rules

| Rule | Reason | |------|--------| | Idempotent operations | Migrations with IF NOT EXISTS, etc. | | Non-interactive commands | No -i flags, no prompts | | Clear exit criteria | Vague goals loop forever |

Monitoring

# Check iteration
grep '^iteration:' .claude/ralph-loop.local.yml

# Cancel loop
/majestic-ralph:cancel