ralph
/ouroboros:ralph
MCP-owned Ralph loop around background evolve_step jobs. "The boulder never stops."
Usage
ooo ralph --lineage-id <lineage_id>
/ouroboros:ralph --lineage-id <lineage_id>
# For a plain natural-language request, run `ooo interview` + `ooo seed` first,
# then call the MCP tool with a fresh lineage_id and the validated Seed YAML.
Trigger keywords: "ralph", "don't stop", "must complete", "until it works", "keep going"
How It Works
Ralph is owned by the ouroboros_ralph MCP tool. In non-plugin runtimes, the
tool starts one background Ralph job, runs repeated evolve_step generations
inside that job, and stops only when QA passes, convergence is reached, a
terminal evolution action occurs, cancellation is requested, or
max_generations is reached. In OpenCode plugin mode, the MCP tool returns a
delegated_to_plugin envelope with job_id=None; the bridge plugin dispatches
a child Task session that owns the loop instead of creating a local JobManager
job.
The client skill should not reimplement the loop. Deterministic frontmatter
dispatch is limited to the router's named --lineage-id option so raw trailing
text is never treated as lineage identity. Raw natural-language
ooo ralph "<request>" input must flow through the validated Seed path before
any mutating Ralph loop starts. Until a lineage id and optional Seed YAML are
prepared, ouroboros_ralph returns structured input guidance instead of
starting a job. Once the inputs are prepared, start the MCP-owned Ralph surface
once, then follow either the returned job tools path or the OpenCode Task widget
path.
Instructions
When the user invokes this skill:
Load MCP Tools (Required first)
The Ouroboros MCP tools are often registered as deferred tools that must be explicitly loaded before use. Do this before preparing input or calling Ralph:
- Use the
ToolSearchtool to find and load the Ralph/job MCP tools:ToolSearch query: "+ouroboros ralph job" - The loaded tools may be exposed under plugin-prefixed names such as
mcp__plugin_ouroboros_ouroboros__ouroboros_ralph. Use the actual tool names returned byToolSearch; the bare names below are the canonical MCP tool names for documentation. - Confirm that
ouroboros_ralphand the job tools (ouroboros_job_wait,ouroboros_job_status,ouroboros_job_result, andouroboros_cancel_job) are callable. If the tools are unavailable, stop and tell the user that Ralph requires the Ouroboros MCP runtime.
Ralph Flow
-
Prepare lineage input:
- If the user provides an existing
lineage_idand explicitly wants to continue it, reuse thatlineage_idand omitseed_contentunless they explicitly provide an updated Seed. - If the user provides Seed YAML for a new Ralph run, use it as
seed_contentand generate a freshlineage_idfor this run. Keeplineage_idseparate from Seed, interview, and session IDs so separate Ralph runs over the same Seed do not collide. - If the user provides only a plain natural-language request, do not treat
it as a direct
ooo ralph "<request>"command, do not freehand Seed YAML, and do not pass raw text asseed_content. Route through the authoritative Seed path first:ooo interviewto capture requirements, thenooo seed/ouroboros_generate_seedto produce validated Seed YAML with the normal ambiguity gate. After Seed generation, call the MCP tool with a freshlineage_idand that validated Seed YAML asseed_content; do not use the raw request text. If an interview/seed session already exists in context, reuse that validated Seed output instead of regenerating it.
- If the user provides an existing
-
Start Ralph by calling
ouroboros_ralphwith:lineage_id: existing lineage id for an explicit continuation, otherwise a freshly generated stable id for this Ralph run, such asralph-<short-slug>-<uuid>; do not use a Seed/interview id by itselfseed_content: valid Seed YAML for generation 1 when starting a new lineageexecute: defaulttrueparallel: defaulttrueskip_qa: defaultfalseproject_dir: explicit target project directory when knownmax_generations: default10unless the user requests a tighter bound
-
Handle the start response:
-
If
response.meta.job_idis present, report it concisely and retain the job cursor fromresponse.meta.cursor:[Ralph] Started background loop: <job_id> Lineage: <lineage_id> -
If
response.meta.status == "delegated_to_plugin"andresponse.meta.job_id is None, report that OpenCode plugin mode delegated the loop to a child Task session. Do not callouroboros_job_wait,ouroboros_job_result, orouroboros_cancel_jobwithout a job id; follow the host Task widget/session lifecycle instead.
-
-
Monitor non-plugin job progress with job tooling when a
job_idexists:ouroboros_job_wait(job_id, cursor, timeout_seconds=120)for long polling; after every wait/status response, updatecursor = response.meta.cursorouroboros_job_status(job_id)for a quick status checkouroboros_job_result(job_id)when the job is terminalouroboros_cancel_job(job_id)if the user says stop/cancel
-
On non-plugin job termination, fetch
ouroboros_job_result(job_id)and summarize the final job result and next step:- Success / convergence: summarize the final generation output, QA verdict,
and any
worktree_path/worktree_branchreturned in job metadata. Do not presentooo evaluateas an automatic next step for Ralph results: the Ralph job contract preserves the evolutionlineage_id, but it does not reliably preserve a separate executionsession_idfor the evaluate workflow. If a valid executionsession_idis explicitly available from a separate run result, keep it distinct from the Ralphlineage_idand follow theooo evaluate <session_id>contract; otherwise state that formal evaluation needs a real execution session and should not be invoked from the Ralph lineage id alone. - Max generations / failure: summarize the stop reason and suggest
ooo unstuck,ooo interview, or a narrower Ralph retry - Cancelled: confirm cancellation and preserve the job id for later inspection
- Success / convergence: summarize the final generation output, QA verdict,
and any
-
On OpenCode plugin delegation, rely on the child Task result as the terminal surface. Summarize the Task completion/error state and lineage id; do not claim a local Ralph job can be polled or cancelled.
Tool Mapping
| Skill action | MCP tool |
|---|---|
| Start Ralph loop | ouroboros_ralph |
| Wait for progress | ouroboros_job_wait |
| Fetch final result | ouroboros_job_result |
| Cancel loop | ouroboros_cancel_job |
| Inspect current status | ouroboros_job_status |
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 success, convergence, terminal failure, cancellation, or max-generation limits stop it.
More from q00/ouroboros
evolve
Start or monitor an evolutionary development loop
19welcome
First-touch experience for new Ouroboros users
19status
Check session status and measure goal drift
19seed
Generate validated Seed specifications from interview results
19evaluate
Evaluate execution with three-stage verification pipeline
18interview
Socratic interview to crystallize vague requirements
18