一键导入
omh-ralph
execute plan: 1 task/call, verify evidence, iron law
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
execute plan: 1 task/call, verify evidence, iron law
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Drive an omh-ralph run: dispatch, evidence, commit hygiene.
Execute one omh-ralph task: file-scope, commit, report.
Drive omh-ralplan: context package, rounds, distillation.
Drive omh-triage: when to invoke, how to run rounds.
Multi-role consensus triage of an issue backlog.
pipeline: interview→plan→execute→QA→verify (idea→code)
基于 SOC 职业分类
| name | omh-ralph |
| description | execute plan: 1 task/call, verify evidence, iron law |
| version | 2.0.0 |
| metadata | {"hermes":{"requires_toolsets":["terminal","omh"],"tags":["execution","verification","persistence","iron-law","loop"],"category":"omh"}} |
Requires the OMH plugin. Install
plugins/omh/from this repo to~/.hermes/plugins/omh/.
Each ralph invocation does ONE unit of work and exits. The caller re-invokes for the next task. This eliminates context window exhaustion and makes every invocation a clean checkpoint.
Invocation N: read state → pick task → execute → verify → update state → EXIT
Invocation N+1: read state → pick next task → execute → verify → update state → EXIT
...
Final invocation: all tasks pass → architect review → mark complete → EXIT
Ralph and autopilot mutate a shared .omh/plans/ plan. Two sessions
running ralph against the same plan would race on ralph-tasks state
and produce non-deterministic outcomes. Use per-instance state +
advisory lock to make concurrent plans safe.
instance_id from the plan path:
.omh/plans/ralplan-*.md or .omh/plans/ralph-plan.md.instance_id = basename(plan_path) without ".md" (engine slugifies).instance_id="default".lock = omh_state(action="lock", mode="ralph",
lock_key="{instance_id}",
session_id="{HERMES_SESSION_ID or uuid}",
holder_note="ralph executing {plan_path}")
acquired=true: continue.acquired=false: report held_by to the user (pid + session_id +
started_at). Offer: wait / cancel the holder
(omh_state(action="cancel", mode="ralph", instance_id="{instance_id}"),
then on next invocation the dead holder's lock will be released
automatically by stale-pid detection) / pick a different plan.instance_id to every subsequent omh_state call in this
invocation — both the ralph mode and the ralph-tasks mode.omh_state(action="unlock", mode="ralph",
lock_key="{instance_id}",
session_id="{HERMES_SESSION_ID or uuid}")
Wrap the body of the procedure so the unlock fires even on error.Singleton fallback (legacy). If a caller omits
instance_id, the engine writes the legacy.omh/state/ralph-state.jsonand skips locking. Only use this for one-plan-at-a-time setups.
state = omh_state(action="read", mode="ralph", instance_id="{instance_id}")
state.exists=false: Fresh start — go to Step 2 (Planning Gate).state.data.active=true: Resume — go to Step 3.state.data.phase="complete": Report completion. Ask if user wants fresh start.state.data.phase="blocked": Report blockers. Ask if issues are resolved.state.data.active=false, phase="cancelled": Report cancellation. Offer resume.Check for cancel signal:
cancel = omh_state(action="cancel_check", mode="ralph", instance_id="{instance_id}")
If cancel.cancelled=true: set phase="cancelled", write state, exit.
Check staleness: if state.stale=true, warn the user and offer to continue or fresh start.
Increment state.data.iteration. If iteration > max_iterations (default 100):
write phase="blocked", report "Max iterations reached", exit.
Ralph MUST NOT execute without a plan. Check sources in order:
omh_state(action="check", mode="ralph-tasks", instance_id="{instance_id}") → exists=true — already parsed, skip to Step 3.omh/plans/ralplan-*.md — parse into ralph-tasks state: omh_state(action="write", mode="ralph-tasks", instance_id="{instance_id}", data={...}).omh/plans/ralph-plan.md — parse into ralph-tasks stateomh-ralplan first."Plan parsing rules:
passes: falseWrite initial state:
omh_state(action="write", mode="ralph", instance_id="{instance_id}", data={
"active": true, "phase": "execute", "iteration": 0,
"session_id": "<uuid>", "max_iterations": 100,
"task_prompt": "<original user request>",
"current_task_id": null,
"started_at": "<ISO 8601 timestamp>",
"project_path": "<absolute path to project root>",
"files_modified": [],
"error_history": [],
"completed_task_learnings": []
})
Read task list:
tasks = omh_state(action="read", mode="ralph-tasks", instance_id="{instance_id}")
passes: true → go to Step 7 (Final Review)passes=false AND all dependencies metphase="blocked", write state, exitParallel execution: if 2-3 independent tasks are eligible (no shared file
footprint, no dependency between them), batch them into one delegate_task call.
Delegate to an executor subagent:
delegate_task(
goal="[omh-role:executor] Implement this task:\n\n{task.title}\n{task.description}\n\nAcceptance Criteria:\n{task.acceptance_criteria}",
context="Project Context:\n{tech stack, conventions, relevant paths}\n\nPrevious Feedback (if retry):\n{task.verifier_verdict}\n\nLearnings from prior tasks:\n{state.data.completed_task_learnings}"
)
The [omh-role:executor] marker in the goal causes the OMH plugin to automatically
inject the executor role prompt into the subagent's system prompt — no inlining needed.
(Fallback without plugin: replace marker with omh_state(action="load_role", role="executor")
and pass the returned prompt text in context.)
Parse the executor's response: COMPLETE → Step 5, PARTIAL → Step 5, BLOCKED → record blocker, add discovered task if needed, update state, exit.
Part A: Gather evidence
evidence = omh_gather_evidence(commands=[
"{project build command}",
"{project test command}",
"{project lint command}"
])
Use the project's actual build/test/lint commands. The tool captures output,
enforces timeouts, and returns {results, all_pass, summary}.
Part B: Delegate to verifier
delegate_task(
goal="[omh-role:verifier] Verify whether this task's acceptance criteria are met:\n\n{task.title}\n{task.acceptance_criteria}\n\nExecutor Report:\n{task.executor_report}",
context="Evidence:\n{evidence.results}"
)
Parse the verifier's response:
task.passes = true. Append to learnings:
{task_id, summary, files_changed, gotchas}. Append to .omh/logs/ralph-progress.md.task.verifier_verdict. Check 3-strike rule (Step 6).3-Strike Circuit Breaker: Construct error fingerprint {task_id, category, error_key}.
Add to task.error_fingerprints. If 3 fingerprints share the same category + error_key:
mark task blocked, log the error, continue to next eligible task on next invocation.
If ALL remaining tasks are blocked: write phase="blocked", report, exit.
Cancel detection (if user says "stop", "cancel", "abort"):
omh_state(action="cancel", mode="ralph", instance_id="{instance_id}", reason="user request")
Then write phase="cancelled" to state, exit with resume instructions.
When all tasks have passes: true:
evidence = omh_gather_evidence(commands=["{build command}", "{test command}"])
delegate_task(
goal="[omh-role:architect] Review the complete implementation for architectural soundness.\n\nOriginal Plan:\n{source plan text}\n\nTasks Completed:\n{summary of all tasks + learnings}",
context="Evidence:\n{evidence.results}\n\nFiles Changed Across All Tasks:\n{aggregate file list}"
)
{active: false, phase: "complete"}, clear state files, keep progress log.discovered: true, set phase="execute".After every action:
omh_state(action="write", mode="ralph", instance_id="{instance_id}", data={...updated state...})
Exit cleanly. The caller re-invokes for the next iteration.
omh_gather_evidence output.completed_task_learnings in every executor delegation.[omh-role:NAME] markers — the OMH plugin injects role prompts automatically into subagent sessions. Never inline role prompt text manually. Available roles: executor, verifier, architect, planner, critic, analyst, security-reviewer, code-reviewer, test-engineer, debugger. Fallback without plugin: omh_state(action="load_role", role="NAME") and pass returned prompt in context.Other skills detect ralph status:
omh_state(action="check", mode="ralph", instance_id="{instance_id}") → {exists, active, phase, stale}phase="complete" → ralph finished successfullyphase="blocked" → ralph needs intervention