ralph
Self-referential loop until task completion with architect verification
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
Self-referential loop until task completion with architect verification
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
N coordinated agents on shared task list using tmux-based orchestration
Alias for $plan --consensus
Setup and configure oh-my-codex using current CLI behavior
Run an anti-slop cleanup/refactor/deslop workflow
Run a comprehensive code review
[OMX] Clean-room interview-driven planner: Metis clarifies, Momus challenges, Oracle synthesizes, then hands off to $ultragoal/$team.
| name | ralph |
| description | Self-referential loop until task completion with architect verification |
[RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]
Your previous attempt did not output the completion promise. Continue working on the task.
Ralph is a persistence loop that keeps working on a task until it is fully complete and architect-verified. It wraps ultrawork's parallel execution with session persistence, automatic retry on failure, and mandatory verification before completion.<Use_When>
<Do_Not_Use_When>
autopilot insteadplan skill insteadultrawork directly
</Do_Not_Use_When><Why_This_Exists> Complex tasks often fail silently: partial implementations get declared "done", tests get skipped, edge cases get forgotten. Ralph prevents this by looping until work is genuinely complete, requiring fresh verification evidence before allowing completion, and using explicit architect native-subagent verification to confirm quality. </Why_This_Exists>
<Execution_Policy>
run_in_background: true for long operations (installs, builds, test suites)agent_type, use typed routing. When it reports role_routing_unavailable, run omx ralplan preflight --json; on unsupported_documented_leader_proof, stop before planner/reviewer work or adapted authority and use a Codex surface with documented root proof or a reviewed alternative workflow. Do not infer root authority from session_id, undocumented thread_id, session/pointer/transcript/cwd state, absent child data, or prompt labels.agent_type role routing, set agent_type to an installed OMX role and never omit it for OMX work; use reasoning_effort for per-dispatch intensity when needed.role_routing_unavailable, do not fabricate agent_type. On documented Codex 0.144.5 the adapted path is unavailable: run omx ralplan preflight --json, stop on unsupported_documented_leader_proof, and do not use prompt labels, task-name carriers, pending intents, markers, or omx ralplan role-intent write as substitutes.low, STANDARD -> medium, THOROUGH -> xhighget_goal, preserve it as the top-level stop condition, and only call update_goal({status: "complete"}) after a Ralph completion audit proves the objective is actually achieved.
</Execution_Policy><Tool_Usage>
ask_codex with agent_role: "architect" for verification cross-checks when changes are security-sensitive, architectural, or involve complex multi-system integrationomx state write/read --input '<json>' --json for ralph mode state persistence between iterationsget_goal to discover or re-check the active objective, create_goal only when the user/system explicitly requested a new goal and no active goal exists, and update_goal only after the audited objective is fully achieved.omx_state call reports that its stdio transport is unavailable/closed, do not retry the same MCP call. Retry once through the supported CLI parity surface with the same payload, preserving workingDirectory and session_id: omx state write --input '<json>' --json, omx state read --input '<json>' --json, or omx state clear --input '<json>' --json. If the CLI path also fails, continue with .omx/context / .omx/plans file-backed artifacts and report the state persistence blocker.
</Tool_Usage>Codex goal mode is the thread-level completion contract for long-running Ralph work. Ralph state tracks workflow mechanics; goal mode tracks whether the user objective is truly done. When the goal tools are available:
get_goal during intake or before the first execution loop when the prompt/hook says an active thread goal exists.create_goal only when the user or system explicitly asked for goal tracking; otherwise continue with Ralph state alone.goal.objective as binding acceptance scope. Newer user updates can refine the current branch, but do not silently narrow the goal.$ralplan, $ralph), file, command, test, gate, and deliverable to evidenceupdate_goal({status: "complete"}) only when the audit shows no required work remains. Do not use passing tests, Ralph state, or architect approval as proxy proof unless they cover the whole goal.Use the CLI-first state surface for Ralph lifecycle state (omx state write/read/clear --input '<json>' --json). Explicit MCP compatibility tools (state_write, state_read, state_clear) remain acceptable only when already enabled.
omx state write --input '{"mode":"ralph","active":true,"iteration":1,"max_iterations":10,"current_phase":"executing","started_at":"<now>","state":{"context_snapshot_path":"<snapshot-path>"}}' --jsonomx state write --input '{"mode":"ralph","iteration":<current>,"current_phase":"executing"}' --jsonomx state write --input '{"mode":"ralph","current_phase":"verifying"}' --json or omx state write --input '{"mode":"ralph","current_phase":"fixing"}' --jsonomx state write --input '{"mode":"ralph","active":false,"current_phase":"complete","completed_at":"<now>","completion_audit":{"passed":true,"prompt_to_artifact_checklist":["<requirement mapped to artifact/evidence>"],"verification_evidence":["<fresh test/build/lint command and result>"]}}' --jsonprompt_to_artifact_checklist entries that map every user requirement, workflow gate, named file, command, PR/delivery requirement, and stop condition to a concrete artifact or evidence item.verification_evidence entries with concrete commands, exit status, files inspected, PR URLs, or other machine-checkable evidence.completion_audit field on the Ralph state object. Do not write bare top-level prompt_to_artifact_checklist or verification_evidence fields by themselves; the Stop gate will reject them.omx state read --input '{"mode":"ralph"}' --json and verify completion_audit.passed === true, a non-empty checklist, and non-empty verification evidence before producing the final answer.update_goal({status:"complete"}) only after this Ralph audit read-back succeeds.$cancel (which should call omx state clear --input '{"mode":"ralph"}' --json)Good: The user says continue after the workflow already has a clear next step. Continue the current branch of work instead of restarting or re-asking the same question.
Good: The user changes only the output shape or downstream delivery step (for example make a PR). Preserve earlier non-conflicting workflow constraints and apply the update locally.
Bad: The user says continue, and the workflow restarts discovery or stops before the missing verification/evidence is gathered.
<Escalation_And_Stop_Conditions>
/cancel<Final_Checklist>
task(agent_type="architect", reasoning_effort="medium"...) minimum. On documented Codex 0.144.5 role-routing-unavailable surfaces, no adapted Architect pass is valid; Ralplan-originated work must have stopped with the leader-proof diagnostic.update_goal({status: "complete"}) was called when an active goal exists/cancel run for clean state cleanup
</Final_Checklist>When the user provides the --prd flag, initialize a Product Requirements Document before starting the ralph loop.
Check if {{PROMPT}} contains --prd or --PRD.
Prompt-side $ralph workflow activation is lighter-weight than omx ralph --prd ....
It seeds Ralph workflow state and guidance, but it does not implicitly launch the
CLI entrypoint or apply the PRD startup gate. Treat omx ralph --prd ... as the
explicit PRD-gated path.
--no-deslopCheck if {{PROMPT}} contains --no-deslop.
If --no-deslop is present, skip the deslop pass entirely after Step 7 and continue using the latest successful pre-deslop verification evidence.
Ralph execution supports visual reference flags for screenshot tasks:
-i <image-path> (can be used multiple times)--images-dir <directory>Example:
ralph -i refs/hn.png -i refs/hn-item.png --images-dir ./screenshots "match HackerNews layout"
$deep-interview --quick <task>.omx/interviews/{slug}-{timestamp}.md.omx/plans/prd-{slug}.md.omx/state/{scope}/ralph-progress.json (session scope when available, else root scope)--prd flag){
"project": "[Project Name]",
"branchName": "ralph/[feature-name]",
"description": "[Feature description]",
"userStories": [
{
"id": "US-001",
"title": "[Short title]",
"description": "As a [user], I want to [action] so that [benefit].",
"acceptanceCriteria": ["Criterion 1", "Typecheck passes"],
"priority": 1,
"passes": false
}
]
}
.omx/state/{scope}/ralph-progress.jsonUser input: --prd build a todo app with React and TypeScript
Workflow: Detect flag, extract task, create .omx/plans/prd-{slug}.md, create .omx/state/{scope}/ralph-progress.json, begin ralph loop.
--prd startup still validates machine-readable story state from .omx/prd.json..omx/plans/prd-{slug}.md remains the canonical storage/documentation artifact, but it is not yet the startup validation source..omx/prd.json exists and canonical PRD is absent, migrate one-way into .omx/plans/prd-{slug}.md..omx/progress.txt exists and canonical progress ledger is absent, import one-way into .omx/state/{scope}/ralph-progress.json.Run in background (run_in_background: true):
Run blocking (foreground):
Original task: {{PROMPT}}