Get the FREE Ultimate OpenClaw Setup Guide →

ralph

Scanned
npx machina-cli add skill Q00/ouroboros/ralph --openclaw
Files (1)
SKILL.md
3.9 KB

/ouroboros:ralph

Persistent self-referential loop until verification passes. "The boulder never stops."

Usage

ooo ralph "<your request>"
/ouroboros:ralph "<your request>"

Trigger keywords: "ralph", "don't stop", "must complete", "until it works", "keep going"

How It Works

Ralph mode includes parallel execution + automatic verification + persistence:

  1. Execute (parallel where possible)

    • Independent tasks run concurrently
    • Dependency-aware scheduling
  2. Verify (verifier)

    • Check completion
    • Validate tests pass
    • Measure drift
  3. Loop (if failed)

    • Analyze failure
    • Fix issues
    • Repeat from step 1
  4. Persist (checkpoint)

    • Save state after each iteration
    • Resume capability if interrupted
    • Full audit trail

Instructions

When the user invokes this skill:

  1. Parse the request: Extract what needs to be done

  2. Initialize state: Create .omc/state/ralph-state.json:

    {
      "mode": "ralph",
      "session_id": "<uuid>",
      "request": "<user request>",
      "status": "running",
      "iteration": 0,
      "max_iterations": 10,
      "last_checkpoint": null,
      "verification_history": []
    }
    
  3. Enter the loop:

    while iteration < max_iterations:
        # Execute with parallel agents
        result = await execute_parallel(request, context)
    
        # Verify the result
        verification = await verify_result(result, acceptance_criteria)
    
        # Record in history
        state.verification_history.append({
            "iteration": iteration,
            "passed": verification.passed,
            "score": verification.score,
            "timestamp": <now>
        })
    
        if verification.passed:
            # SUCCESS - persist final checkpoint
            await save_checkpoint("complete")
            break
    
        # Failed - analyze and continue
        iteration += 1
        await save_checkpoint("iteration_{iteration}")
    
        if iteration >= max_iterations:
            # Max iterations reached
            break
    
  4. Report progress each iteration:

    [Ralph Iteration <i>/<max>]
    Execution complete. Verifying...
    
    Verification: <FAILED/PASSED>
    Score: <score>
    Issues: <list of issues>
    
    The boulder never stops. Continuing...
    
  5. Handle interruption:

    • If user says "stop": save checkpoint, exit gracefully
    • If user says "continue": reload from last checkpoint
    • State persists across session resets

Persistence

State includes:

  • Current iteration number
  • Verification history for all iterations
  • Last successful checkpoint
  • Issues found in each iteration
  • Execution context for resume

Resume command: "continue ralph" or "ralph continue"

The Boulder Never Stops

This is the key phrase. Ralph does not give up:

  • Each failure is data for the next attempt
  • Verification drives the loop
  • Only complete success or max iterations stops it

Example

User: ooo ralph fix all failing tests

[Ralph Iteration 1/10]
Executing in parallel...
Fixing test failures...

Verification: FAILED
Score: 0.65
Issues:
- 3 tests still failing
- Type errors in src/api.py

The boulder never stops. Continuing...

[Ralph Iteration 2/10]
Executing in parallel...
Fixing remaining issues...

Verification: FAILED
Score: 0.85
Issues:
- 1 test edge case failing

The boulder never stops. Continuing...

[Ralph Iteration 3/10]
Executing in parallel...
Fixing edge case...

Verification: PASSED
Score: 1.0

Ralph COMPLETE
==============
Request: Fix all failing tests
Duration: 8m 32s
Iterations: 3

Verification History:
- Iteration 1: FAILED (0.65)
- Iteration 2: FAILED (0.85)
- Iteration 3: PASSED (1.0)

All tests passing. Build successful.

Cancellation

Cancel with /ouroboros:cancel --force to clear state.

Standard /ouroboros:cancel saves checkpoint for resume.

Source

git clone https://github.com/Q00/ouroboros/blob/main/skills/ralph/SKILL.mdView on GitHub

Overview

Ralph runs parallel tasks with automatic verification, looping until all checks pass. It persists state after every iteration to enable resume and auditing, embodying 'The Boulder Never Stops.' This makes long-running, verification-driven work reliable and auditable.

How This Skill Works

Ralph executes tasks in parallel where possible, then invokes a verifier to assess completion and test success. If verification fails, it analyzes the issues, fixes them, and repeats from the start, saving a checkpoint after each iteration for resume and audit purposes.

When to Use It

  • When complex tasks require iterative refinement until tests or criteria pass
  • When long-running work must resume after an interruption
  • When you need an auditable history of iterations and results
  • When progress should be reported per iteration with clear failure reasons
  • When you want verification-driven progress with no premature termination

Quick Start

  1. Step 1: Parse the request and initialize state in .omc/state/ralph-state.json
  2. Step 2: Enter the loop: execute in parallel, verify, persist checkpoint, and repeat on failure
  3. Step 3: Report progress each iteration and handle stop/continue to resume later

Best Practices

  • Enable and review persistence after each iteration to support resume
  • Set a sensible max_iterations to avoid infinite loops
  • Use dependency-aware scheduling to maximize parallelism
  • Define clear acceptance criteria for the verifier to reduce drift
  • Regularly inspect verification_history to identify recurring issues

Example Use Cases

  • Iteratively fix failing tests by running parallel test-fix tasks and verifying results until PASSED
  • Process large data pipelines with concurrent stages, validating data quality at each iteration
  • Resume long-running experiments after interruptions using saved ralph-state.json checkpoints
  • Maintain an audit trail of iteration results and scores for compliance or review
  • CI pipelines that stabilize flaky builds by driving automatic, verified iterations

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers