Ralph Execute
Resume and advance an already-installed Ralph harness in the current repository until the queue is empty or a documented stop condition occurs.
This skill does not install the harness. It assumes the current repository already contains the Ralph harness scaffold.
In this source repository, the root .ralph/, tasks/, and specs/ paths are dogfood runtime artifacts. The shipped scaffold under src/ stays cleaner than the root runtime, and target runtime records are generated after installation or first run.
Use When
- The current repository already has the Ralph harness installed.
- You want an explicit named way to resume the harness.
- You want Codex to read the current queue state and advance the next orchestrator step or role handoff.
Required Inputs
AGENTS.md.ralph/constitution.md.ralph/runtime-contract.md.ralph/policy/project-policy.md.ralph/state/workflow-state.json.ralph/state/spec-queue.json
Runtime Read Order
AGENTS.md.ralph/constitution.md.ralph/runtime-contract.md.ralph/policy/project-policy.md.ralph/state/workflow-state.json.ralph/state/spec-queue.json- the file at
last_report_path - active spec artifacts under
specs/<spec-id>-<slug>/ - a recent tail of
.ralph/logs/events.jsonl
Workflow
- Verify the Ralph harness exists in the current repository.
- Read the constitution, runtime contract, project policy, workflow state, and spec queue.
- Treat
workflow-state.json,spec-queue.json, andtask-state.jsonas the canonical machine state. Treatworkflow-state.mdandspecs/INDEX.mdas projections only. - Run a preflight consistency check before selecting the next role:
- the runtime must already be on the current interrupt-capable state shape
.ralph/state/workflow-state.mdmust match the canonical JSON projectionspecs/INDEX.mdmust match the canonical queue projectiontasks.mdandtask-state.jsonmust agree semantically- the active git branch must match the active spec branch when a spec is active
- review, verification, release, and completed-task handoffs must not sit on a dirty worktree
- the latest relevant worker report must include
Commit Evidencefor the checkpoint under handoff before work advances past implementation
- If preflight fails or the repo is in mixed-version state, stop and route to
$ralph-upgradebefore continuing. - Read the latest report and active spec artifacts.
- Read a recent tail of the event log rather than the full history.
- Determine the next role from current phase, spec status, task lifecycle state, and PR state.
- Guide Codex to use built-in multi-agent orchestration to:
- allow bounded same-batch
researchworkers only before queue-head planning resumes - spawn exactly one non-research worker role at a time
- wait for the worker to finish
- create an interrupt spec automatically for any failing out-of-scope bug
- pause the current spec and later resume it after the interrupt is released
- validate outputs
- update shared state
- continue dispatching until a runtime-contract stop condition occurs
- allow bounded same-batch
- Stop with a concise summary of:
- what moved
- what artifacts changed
- why execution stopped
- what the next role and next spec are
Guardrails
- Do not install or reinstall the scaffold here.
- If the harness files are missing, stop and tell the user to use
$ralph-install. - Treat the constitution, runtime contract, policy, workflow state, and spec queue as source of truth.
- Do not continue execution from stale projections or mixed-version runtime state.
- Keep all parallelism bounded to same-batch
research;plan,task-gen,plan-check,implement,review,verify, andreleaseremain sequential. - Do not advance review, verification, or release from a dirty worktree or a report that lacks checkpoint traceability.
- Use recent events for normal resume; read older logs only if diagnosing a blocker.
- Do not stop after a single handoff unless the runtime contract says to stop.
Completion
Stop only when the queue is empty or a documented runtime-contract stop condition occurs. Do not loop indefinitely past the orchestration safety cap.