autopilot
GitHubAutopilot是一个严格的自主交付循环,通过深度访谈澄清需求、规划、执行代码、审查及QA的闭环流程。适用于用户希望从需求到高质量代码的全自动、免干预式开发任务。
Trigger Scenarios
Install
npx skills add Yeachan-Heo/oh-my-codex --skill autopilot -g -y
SKILL.md
Frontmatter
{
"name": "autopilot",
"description": "[OMX] Strict autonomous loop: $deep-interview -> $ralplan -> $ultragoal (+ $team if needed) -> $code-review -> $ultraqa"
}
$deep-interview -> $ralplan -> $ultragoal (+ $team if needed) -> $code-review -> $ultraqa
If $code-review or $ultraqa is not clean, Autopilot returns to $ralplan with the findings as the next planning input, then continues again through $ultragoal, $code-review, and $ultraqa until the gates are clean or a hard blocker is reported. Ralph is a legacy/explicit alternate execution loop only; do not advertise Ralph as the default Autopilot path.
</Purpose>
<Use_When>
- User wants hands-off execution from a concrete idea, issue, PRD, or requirements artifact to reviewed and QA-checked 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 clarification, planning, durable execution, verification, code review, and QA with automatic follow-up when gates are 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
$ultragoal,$ralphonly when explicitly requested, or 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 canonical workflow phases below:
-
Phase
deep-interview— Socratic requirements clarification gate- Run or resume
$deep-interviewto clarify intent, scope, non-goals, constraints, and decision boundaries. - Deep-interview is a structured question chain, not a one-question gate;
max_roundsis a cap, not a target. - After a user answers an
omx question, re-score ambiguity against the active profile threshold. Ask another question only when a readiness gate is still unresolved and the answer would materially change execution; otherwise crystallize the spec and hand off. - Required handoff artifact: a clarified spec or concise requirements summary suitable for
$ralplan, including an explicit interview-complete rationale when leaving deep-interview.
- Run or resume
-
Phase
ralplan— consensus planning gate- Ground the task with pre-context intake and the deep-interview artifact.
- Current ownership rule: Autopilot records
planning_routingin state before heavy planning. When the Autopilot/main model resolves to a cheap/mini lane (for exampleo4-mini,*-mini,*spark*, or an explicitly cheap/economy/lite model name), the initial planning/decomposition owner is dedicated[planner]; otherwise[main]may keep ownership for backward compatibility. A configuredagentModels.planneris an explicit opt-in that forces dedicated[planner]ownership even when[main]is not cheap/mini. - Run or resume
$ralplanto produce/update PRD and test-spec artifacts. Ifplanning_routing.ownerisplanner, use the dedicated[planner]role for the initial Planner draft/decomposition before the Architect→Critic consensus gates. - PRD/test-spec files alone are not completion evidence. Local Architect→Critic approvals are lifecycle evidence, not handoff authority. Ralplan may hand off only after an official host-issued receipt is verified through a documented non-user-mintable host surface; until then retain the reviews with
ralplan_consensus_gate.complete:falseandblocked_reason:"documented_host_consensus_receipt_unavailable". - On every revised planning pass, require subsequent
Architectapproval first and subsequentCriticapproval second. These ordered reviews remain lifecycle evidence only and never replace the official host receipt. - When returning from a non-clean review or QA pass, include
return_to_ralplan_reasonand the findings as first-class planning input. - If either review is missing, blocked, out of order, or non-approving, remain in
ralplanor report an explicit blocker/max-iteration outcome; do not progress to$ultragoal,$team,$ralph, or implementation. - Required handoff artifact: planning artifacts, lifecycle-only Architect→Critic reviews, and a verified official host receipt authorizing
ralplan_consensus_gate.complete:true. Without that receipt, remain inralplanand report the host blocker.
-
Phase
ultragoal— durable implementation + verification loop- Run
$ultragoalonly from ralplan artifacts whose consensus gate is authorized by a verified official host receipt. - Ultragoal owns durable Codex goal handoffs,
.omx/ultragoalledger checkpoints, implementation, tests, build/lint/typecheck evidence, cleanup, and final review gate discipline. - Use
$teamonly inside an active Ultragoal story when the story clearly benefits from coordinated parallel execution (for example independent file/module lanes, broad test matrix work, or multi-domain implementation). Team remains explicit and leader-owned; Ultragoal keeps the goal/ledger state. - Required handoff artifact: implementation evidence, changed-file summary, verification evidence, and Ultragoal ledger/checkpoint references suitable for
$code-review.
- Run
-
Phase
code-review— merge-readiness gate- Run
$code-reviewon the diff/artifacts produced by$ultragoal. - 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 because the implementation must be repaired, increment the review cycle, persist
review_verdict, setcurrent_phase:"rework", and carry the findings as the sanctioned execution-fix input. Return to Phaseralplanonly when the review shows the plan/requirements are wrong or incomplete.
- Run
-
Phase
ultraqa— adversarial QA gate- Run
$ultraqaafter a clean code review when user-facing behavior, workflows, CLI/runtime behavior, integration surfaces, or regression risk warrant adversarial QA. - For docs-only or trivially non-runtime changes, record
ultraqaas skipped with an explicit condition and evidence. - If UltraQA finds issues, persist the QA verdict/evidence, set
return_to_ralplan_reason, and transition back to Phaseralplan.
- Run
The only normal terminal state is complete after clean code review and a passed or explicitly skipped UltraQA gate. Cancellation, blocked credentials, unrecoverable repeated failures, or explicit user stop may terminate earlier with preserved state.
</Strict_Loop_Contract>
<Execution_Policy>
- Always execute the recommended phases in order:
deep-interview, thenralplan, thenultragoal, thencode-review, thenultraqa. $teamis conditional and explicit: use it only within an Ultragoal story when parallel execution materially improves throughput, quality, or safety.- Never skip directly from vague/freeform expansion to implementation; unclear input must be clarified and planned through
$deep-interviewand$ralplan. - A non-clean
$code-reviewthat requires implementation repair enters Phaserework; a non-clean review that changes the plan/requirements, or failed$ultraqa, returns to$ralplan. - Each phase must write/update Autopilot state before handing off.
- Use existing hooks,
.omx/state,$deep-interview,$ralplan,$ultragoal, optional$team,$code-review,$ultraqa, and pipeline primitives; do not invent a separate execution framework. - Preserve legacy compatibility: if a user explicitly requests the old Ralph execution lane, use
$ralphas an intentional alternate execution phase, but do not present it as Autopilot's default recommended loop. - 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 the CLI-first state surface (omx state ... --json) for Autopilot lifecycle state. State must be session-aware when a session id exists. If the explicit MCP compatibility surface is already available, equivalent omx_state tool calls remain acceptable but are not required.
Inside active Autopilot, named child phases such as $ralplan are supervised phases, not peer workflow activations: keep mode:"autopilot" active and update current_phase:"ralplan" rather than starting standalone mode:"ralplan" over Autopilot.
Required fields:
{
"mode": "autopilot",
"active": true,
"current_phase": "deep-interview",
"iteration": 1,
"review_cycle": 0,
"max_iterations": 10,
"phase_cycle": ["deep-interview", "ralplan", "ultragoal", "code-review", "ultraqa"],
"handoff_artifacts": {
"context_snapshot_path": ".omx/context/<slug>-<timestamp>.md",
"deep_interview": null,
"ralplan": null,
"ralplan_consensus_gate": {
"required": true,
"sequence": ["architect-review", "critic-review"],
"planning_artifacts_are_not_consensus": true,
"required_review_roles": ["architect", "critic"],
"ralplan_architect_review": null,
"ralplan_critic_review": null,
"complete": false
},
"ultragoal": null,
"code_review": null,
"ultraqa": null
},
"review_verdict": null,
"qa_verdict": null,
"return_to_ralplan_reason": null
}
- On start:
omx state write --input '{"mode":"autopilot","active":true,"current_phase":"deep-interview","iteration":1,"review_cycle":0,"state":{"phase_cycle":["deep-interview","ralplan","ultragoal","code-review","ultraqa"],"handoff_artifacts":{"context_snapshot_path":"<snapshot-path>","deep_interview":null,"ralplan":null,"ralplan_consensus_gate":{"required":true,"sequence":["architect-review","critic-review"],"planning_artifacts_are_not_consensus":true,"required_review_roles":["architect","critic"],"ralplan_architect_review":null,"ralplan_critic_review":null,"complete":false},"ultragoal":null,"code_review":null,"ultraqa":null},"review_verdict":null,"qa_verdict":null,"return_to_ralplan_reason":null}}' --json - On deep-interview -> ralplan: only after a separate gate proves the interview chain is explicitly complete or the user explicitly authorized a skip. For completion, persist
deep_interview_gate:{"status":"complete","rationale":"<why requirements are complete>","handoff_summary":"<summary>"}(or equivalent non-empty rationale/summary) plus the clarified spec/requirements underhandoff_artifacts.deep_interview; if a finalomx questionwas involved, keep its same-session answered record linked byquestion_id/satisfied_at. For skip, persistdeep_interview_gate:{"status":"skipped","skip_authorized_by_user":true,"skip_reason":"<user-authorized reason>","skipped_at":"<timestamp>","source":"user","session_id":"<session>"}. Do not leave deep-interview merely because the firstomx questionwas answered or cleared.- The stable
<!-- OMX:AUTOPILOT:DEEP-INTERVIEW-RALPLAN-HANDOFF:v1 -->marker immediately precedes the executable completion handoff fence; automation may locate exactly that fence.
- The stable
omx state write --input '{"mode":"autopilot","active":true,"current_phase":"ralplan","session_id":"'"${OMX_SESSION_ID:?authoritative OMX session required}"'","workingDirectory":"'"${PWD:?working directory required}"'","state":{"deep_interview_gate":{"status":"complete","rationale":"requirements are clarified and ready for planning","handoff_summary":"durable deep-interview handoff recorded for ralplan"},"handoff_artifacts":{"deep_interview":".omx/specs/deep-interview-handoff.md"}}}' --json
- The artifact path above must already contain the durable clarified requirements/specification before this command runs. Omit session aliases unless needed; if emitted,
owner_omx_session_id,codex_session_id, andowner_codex_session_idmust each equalsession_id. - Optional execution contract foundation: when a downstream handoff explicitly sets
execution_contract_required:true, persist a complete structuredexecution_contractunderhandoff_artifacts.deep_interviewbefore leaving deep-interview. The canonical schema isversion:1,execution_stride:"task"|"deliverable"|"milestone",source:"deep-interview",selected_by:"user"|"default",allow_task_shrink:<boolean>, non-emptycompletion_unit, non-emptystop_condition,acceptance_coverage_scope:"task"|"deliverable"|"milestone", andshrink_policy:"allowed"|"ask_before_shrink"|"deny_unless_blocked". - Stride semantics are binding only when
execution_contract_required:true:taskmeansallow_task_shrink:true,acceptance_coverage_scope:"task",shrink_policy:"allowed";deliverablemeansallow_task_shrink:false,acceptance_coverage_scope:"deliverable",shrink_policy:"ask_before_shrink";milestonemeansallow_task_shrink:false,acceptance_coverage_scope:"milestone",shrink_policy:"deny_unless_blocked". - Preserve legacy behavior when
execution_contract_requiredis absent or false. Do not infer stride from prose, broadness, phase names, snapshots, or task size; this foundation only validates an explicit structured contract and deliberately usesmilestonerather thanphase. New artifacts must write canonical snake_case keys underhandoff_artifacts.deep_interview; the runtime may read legacy camelCase field/marker aliases and direct/nestedexecution_contractlocations only as compatibility input. - On ralplan -> ultragoal: only after
ralplan_consensus_gate.complete:truefrom an official host-issued receipt verified through a documented non-user-mintable host surface. Native-subagent Architect/Critic lanes, tracker records,codex_exec, and artifact approvals are lifecycle or trace evidence only. Until that verifier exists, keepcurrent_phase:"ralplan"and persistblocked_reason:"documented_host_consensus_receipt_unavailable". - On missing ralplan consensus evidence: keep
current_phase:"ralplan", persistralplan_consensus_gate.complete:falsewithblocked_reason, and report an explicit blocker or max-iteration outcome instead of handing off to execution. - On ultragoal -> code-review: set
current_phase:"code-review", persist implementation/test/ledger evidence underhandoff_artifacts.ultragoal. - On code-review -> ultraqa: set
current_phase:"ultraqa"only after a real$code-reviewstage/subagent has produced durable evidence; persist the clean review underhandoff_artifacts.code_reviewwith its source thread/tool/stage reference. Do not authorreview_verdict:{clean:true}from the leader's own summary. - On non-clean code-review requiring implementation repair: increment
review_cycle, setcurrent_phase:"rework", persistreview_verdict, persist the phase handoff underhandoff_artifacts.code_review, and keep the fix scoped to the review findings before returning tocode-review. - On clean review + passed/skipped QA: set
active:false,current_phase:"complete", persistreview_verdict:{recommendation:"APPROVE", architectural_status:"CLEAR", clean:true},qa_verdict:{clean:true, skipped:<boolean>, reason:<string|null>}, andcompleted_atonly when both gates have durable source evidence. Required evidence is either (a) actual$code-review/$ultraqastage or native-subagent/thread/tool records, or (b) for QA only, an explicit persisted skip reason for a documented docs-only/trivially non-runtime condition. If that evidence is missing, keep the active phase atcode-revieworultraqaand record a blocker instead of self-attesting a clean gate. - On non-clean review requiring plan changes or failed QA: increment
iterationandreview_cycle, setcurrent_phase:"ralplan", persistreview_verdictorqa_verdict, persist the phase handoff, and setreturn_to_ralplan_reasonto a concise findings-driven reason. - Legacy Ralph state: if a user explicitly selected the legacy Ralph execution lane, phase names and handoff keys may include
ralph; preserve and resume them rather than rewriting history to Ultragoal. - 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:
deep-interview: clarify requirements and record the handoff artifact.ralplan: run/update consensus planning from current handoffs and anyreturn_to_ralplan_reason.ultragoal: execute the approved plan durably and record verification/ledger evidence.rework: perform only the implementation fixes required by the current code-review findings, record fresh implementation/verification evidence, and return tocode-review.team: continue explicit team work only when it is nested under the active Ultragoal story and report evidence back to the leader.code-review: review the current diff and decide clean vs return-to-ralplan.ultraqa: run or explicitly skip adversarial QA based on the documented condition, then finish if clean or transition toralplanwith findings if not clean.ralph: resume only for explicit legacy Ralph-path Autopilot state.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 default Autopilot pipeline contract is:
deep-interview -> ralplan -> ultragoal -> code-review -> ultraqa
Pipeline state should use current_phase values that match the same phase names (deep-interview, ralplan, ultragoal, rework, code-review, ultraqa, complete, failed) and should carry iteration, review_cycle, handoff_artifacts, review_verdict, qa_verdict, and return_to_ralplan_reason alongside stage results. $team is not a default pipeline stage; it is an explicit conditional execution engine inside an Ultragoal story.
</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 QA 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 and$ultraqahas passed or been explicitly skipped with evidence. </Escalation_And_Stop_Conditions>
<Final_Checklist>
- Phase
deep-interviewproduced/updated clarified requirements or a concise spec - Phase
ralplanproduced/updated planning artifacts and preserved subsequent Architect→Critic approvals as lifecycle-only evidence; it advanced only with a verified official host receipt, or remained inralplanwithcomplete:falseandblocked_reason:"documented_host_consensus_receipt_unavailable". - Phase
ultragoalimplemented and verified the plan with fresh evidence and durable ledger/checkpoint references - Phase
reworkwas used for implementation-only review fixes when applicable, with findings scoped to a fresh code-review cycle -
$teamwas used only if the active Ultragoal story needed coordinated parallel work, or explicitly recorded as not needed - Phase
code-reviewreturned a clean verdict (APPROVE+CLEAR) - Phase
ultraqapassed, or was explicitly skipped because the change was docs-only/trivially non-runtime with evidence - Clean
review_verdictcites durable source evidence from a real$code-reviewstage/subagent/thread/tool record;qa_verdictcites durable$ultraqaevidence or an explicit persisted low-risk skip reason; leader-authored summaries alone are not gate evidence -
review_verdict.cleanis true,qa_verdict.cleanis true, andreturn_to_ralplan_reasonis null - Tests/build/lint/typecheck evidence from Ultragoal is available in handoff artifacts
- Autopilot state is marked
completeor cancellation state is preserved coherently - User receives a concise summary with clarification, plan, implementation, verification, review, and QA evidence </Final_Checklist>
Version History
- e94437f Current 2026-08-20 07:18


