autopilot
$ralplan -> $ralph -> $code-review
If $code-review is not clean, Autopilot returns to $ralplan with the review findings as the next planning input, then continues again through $ralph and $code-review until the review is clean or a hard blocker is reported.
<Use_When>
- User wants hands-off execution from a concrete idea, issue, PRD, or requirements artifact to reviewed code
- User says
$autopilot, "autopilot", "auto pilot", "autonomous", "build me", "create me", "make me", "full auto", "handle it all", or "I want a/an..." - Task needs planning, implementation, verification, and code review with automatic follow-up when review is not clean </Use_When>
<Do_Not_Use_When>
- User wants to explore options or brainstorm -- use
$plan/$ralplan - User says "just explain", "draft only", or "what would you suggest" -- respond conversationally
- User wants a single focused code change -- use
$ralphor direct executor work - User wants only review/critique of existing code -- use
$code-review</Do_Not_Use_When>
<Strict_Loop_Contract> Autopilot must not run a separate broad expansion/planning/execution/QA/validation lifecycle as its primary behavior. It delegates those concerns to the three canonical workflow phases below:
-
Phase
ralplan— consensus planning gate- Ground the task with pre-context intake.
- Run or resume
$ralplanto produce/update PRD and test-spec artifacts. - When returning from a non-clean review, include
return_to_ralplan_reasonand the review findings as first-class planning input. - Required handoff artifact: an approved plan/test spec suitable for
$ralph.
-
Phase
ralph— implementation + verification loop- Run
$ralphfrom the approved ralplan artifacts. - Ralph owns implementation, tests, build/lint/typecheck evidence, deslop where applicable, and architect verification.
- Required handoff artifact: implementation evidence and changed-file summary suitable for
$code-review.
- Run
-
Phase
code-review— merge-readiness gate- Run
$code-reviewon the diff/artifacts produced by$ralph. - A clean review means final recommendation
APPROVEwith architectural statusCLEAR. COMMENT,REQUEST CHANGES, any architecturalWATCH/BLOCK, or any unresolved finding is not clean.- If not clean, increment the review cycle, persist
review_verdict, setreturn_to_ralplan_reason, and transition back to Phaseralplan.
- Run
The only normal terminal state is complete after a clean code review. Cancellation, blocked credentials, unrecoverable repeated failures, or explicit user stop may terminate earlier with preserved state.
</Strict_Loop_Contract>
<Execution_Policy>
- Always execute phases in order:
ralplan, thenralph, thencode-review. - Never skip directly from vague/freeform expansion to implementation; unclear input must be clarified or planned through
$ralplan. - A non-clean
$code-reviewalways returns to$ralplan; do not patch findings ad hoc outside the loop. - Each phase must write/update Autopilot state before handing off.
- Use existing hooks,
.omx/state,$ralplan,$ralph,$code-review, and pipeline primitives; do not invent a separate execution framework. - Continue automatically through safe reversible phase transitions. Ask only for destructive, credential-gated, or materially preference-dependent branches.
- Apply the shared workflow guidance pattern: outcome-first framing, concise visible updates for multi-step execution, local overrides for the active workflow branch, validation proportional to risk, explicit stop rules, and automatic continuation for safe reversible steps. Ask only for material, destructive, credentialed, external-production, or preference-dependent branches. </Execution_Policy>
<State_Management>
Use omx_state MCP tools (or omx state ... --json fallback if MCP transport is unavailable) for Autopilot lifecycle state. State must be session-aware when a session id exists.
Required fields:
{
"mode": "autopilot",
"active": true,
"current_phase": "ralplan",
"iteration": 1,
"review_cycle": 0,
"max_iterations": 10,
"phase_cycle": ["ralplan", "ralph", "code-review"],
"handoff_artifacts": {
"context_snapshot_path": ".omx/context/<slug>-<timestamp>.md",
"ralplan": null,
"ralph": null,
"code_review": null
},
"review_verdict": null,
"return_to_ralplan_reason": null
}
- On start:
state_write({mode:"autopilot", active:true, current_phase:"ralplan", iteration:1, review_cycle:0, state:{phase_cycle:["ralplan","ralph","code-review"], handoff_artifacts:{context_snapshot_path, ralplan:null, ralph:null, code_review:null}, review_verdict:null, return_to_ralplan_reason:null}}) - On ralplan -> ralph: set
current_phase:"ralph", persist the plan/test-spec paths underhandoff_artifacts.ralplan. - On ralph -> code-review: set
current_phase:"code-review", persist implementation/test evidence underhandoff_artifacts.ralph. - On clean review: set
active:false,current_phase:"complete", persistreview_verdict:{recommendation:"APPROVE", architectural_status:"CLEAR", clean:true}andcompleted_at. - On non-clean review: increment
iterationandreview_cycle, setcurrent_phase:"ralplan", persistreview_verdict:{..., clean:false}, persisthandoff_artifacts.code_review, and setreturn_to_ralplan_reasonto a concise review-driven reason. - On cancellation: run
$cancel; preserve progress for resume rather than deleting handoff artifacts. </State_Management>
<Continuation_And_Resume>
When the user says continue, resume, or keep going while Autopilot is active, read autopilot-state.json and continue from current_phase:
ralplan: run/update consensus planning from current handoffs and anyreturn_to_ralplan_reason.ralph: execute the approved plan and record verification evidence.code-review: review the current diff and decide clean vs return-to-ralplan.complete: report completion evidence; do not restart.
Do not restart discovery or discard handoff artifacts on continuation. </Continuation_And_Resume>
<Pipeline_Orchestrator>
Autopilot may be represented by the configurable pipeline orchestrator (src/pipeline/) when useful. The Autopilot pipeline contract is:
ralplan -> ralph -> code-review
Pipeline state should use current_phase values that match the same phase names (ralplan, ralph, code-review, complete, failed) and should carry iteration, review_cycle, handoff_artifacts, review_verdict, and return_to_ralplan_reason alongside stage results.
</Pipeline_Orchestrator>
<Escalation_And_Stop_Conditions>
- Stop and report a blocker when required credentials/authority are missing.
- Stop and report when the same review or verification failure recurs across 3 review cycles with no meaningful new plan.
- Stop when the user says "stop", "cancel", or "abort" and run
$cancel. - Otherwise, continue the loop until
$code-reviewis clean. </Escalation_And_Stop_Conditions>
<Final_Checklist>
- Phase
ralplanproduced/updated approved planning artifacts - Phase
ralphimplemented and verified the plan with fresh evidence - Phase
code-reviewreturned a clean verdict (APPROVE+CLEAR) -
review_verdict.cleanis true andreturn_to_ralplan_reasonis null - Tests/build/lint/typecheck evidence from Ralph is available in handoff artifacts
- Autopilot state is marked
completeor cancellation state is preserved coherently - User receives a concise summary with plan, implementation, verification, and review evidence </Final_Checklist>
More from yeachan-heo/oh-my-codex
ralph
Self-referential loop until task completion with architect verification
83review
Deprecated standalone review skill
79worker
Team worker protocol (ACK, mailbox, task lifecycle) for tmux-based OMX teams
77team
N coordinated agents on shared task list using tmux-based orchestration
77swarm
Swarm deprecated shim
76note
Note deprecated shim
76