Full autonomous execution from idea to working code
<Use_When>
<Do_Not_Use_When>
plan skill insteadralph or delegate to an executor agentplan --review<Why_This_Exists> Most non-trivial software tasks require coordinated phases: understanding requirements, designing a solution, implementing in parallel, testing, and validating quality. Autopilot orchestrates all of these phases automatically so the user can describe what they want and receive working code without managing each step. </Why_This_Exists>
<Steps> 0. **Pre-context Intake (required before Phase 0 starts)**: - Derive a task slug from the request. - Load the latest relevant snapshot from `.omx/context/{slug}-*.md` when available. - If no snapshot exists, create `.omx/context/{slug}-{timestamp}.md` (UTC `YYYYMMDDTHHMMSSZ`) with: - Task statement - Desired outcome - Known facts/evidence - Constraints - Unknowns/open questions - Likely codebase touchpoints - If ambiguity remains high, run `explore` first for brownfield facts, then run `$deep-interview --quick <task>` before proceeding. - Carry the snapshot path into autopilot artifacts/state so all phases share grounded context. <Examples> <Good> User: "autopilot A REST API for a bookstore inventory with CRUD operations using TypeScript" Why good: Specific domain (bookstore), clear features (CRUD), technology constraint (TypeScript). Autopilot has enough context to expand into a full spec. </Good> <Good> User: "build me a CLI tool that tracks daily habits with streak counting" Why good: Clear product concept with a specific feature. The "build me" trigger activates autopilot. </Good> <Bad> User: "fix the bug in the login page" Why bad: This is a single focused fix, not a multi-phase project. Use direct executor delegation or ralph instead. </Bad> <Bad> User: "what are some good approaches for adding caching?" Why bad: This is an exploration/brainstorming request. Respond conversationally or use the plan skill. </Bad> </Examples> <Advanced> ## Configuration<Execution_Policy>
/cancel at any time; progress is preserved for resume$deep-interview firstPhase 0 - Expansion: Turn the user's idea into a detailed spec
.omx/specs/deep-interview-*.md exists for this task: reuse it and skip redundant expansion work$deep-interview for Socratic ambiguity-gated clarification.omx/plans/autopilot-spec.mdPhase 1 - Planning: Create an implementation plan from the spec
.omx/plans/autopilot-impl.mdPhase 2 - Execution: Implement the plan using Ralph + Ultrawork
Phase 3 - QA: Cycle until all tests pass (UltraQA mode)
Phase 4 - Validation: Multi-perspective review in parallel
Phase 5 - Cleanup: Clear all mode state via OMX MCP tools on successful completion
state_clear({mode: "autopilot"})state_clear({mode: "ralph"})state_clear({mode: "ultrawork"})state_clear({mode: "ultraqa"})/cancel for clean exit
</Steps>
<Tool_Usage>
ToolSearch("mcp") to discover deferred MCP toolsask_codex with agent_role: "architect" for Phase 4 architecture validationask_codex with agent_role: "security-reviewer" for Phase 4 security reviewask_codex with agent_role: "code-reviewer" for Phase 4 quality reviewUse omx_state MCP tools for autopilot lifecycle state.
state_write({mode: "autopilot", active: true, current_phase: "expansion", started_at: "<now>", state: {context_snapshot_path: "<snapshot-path>"}})state_write({mode: "autopilot", current_phase: "planning"})
state_write({mode: "autopilot", current_phase: "execution"})
state_write({mode: "autopilot", current_phase: "qa"})
state_write({mode: "autopilot", current_phase: "validation"})state_write({mode: "autopilot", active: false, current_phase: "complete", completed_at: "<now>"})$cancel (which should call state_clear(mode="autopilot"))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>
$deep-interview before proceeding
</Escalation_And_Stop_Conditions><Final_Checklist>
Optional settings in ~/.codex/config.toml:
[omx.autopilot]
maxIterations = 10
maxQaCycles = 5
maxValidationRounds = 3
pauseAfterExpansion = false
pauseAfterPlanning = false
skipQa = false
skipValidation = false
If autopilot was cancelled or failed, run /autopilot again to resume from where it stopped.
For ambiguous requests, prefer:
deep-interview -> ralplan -> autopilot
deep-interview: ambiguity-gated Socratic requirementsralplan: consensus planning (planner/architect/critic)autopilot: execution + QA + validationAutopilot can be driven by the configurable pipeline orchestrator (src/pipeline/), which
sequences stages through a uniform PipelineStage interface:
RALPLAN (consensus planning) -> team-exec (Codex CLI workers) -> ralph-verify (architect verification)
Pipeline configuration options:
[omx.autopilot.pipeline]
maxRalphIterations = 10 # Ralph verification iteration ceiling
workerCount = 2 # Number of Codex CLI team workers
agentType = "executor" # Agent type for team workers
The pipeline persists state via pipeline-state.json and supports resume from the last
incomplete stage. See src/pipeline/orchestrator.ts for the full API.
Stuck in a phase? Check TODO list for blocked tasks, run state_read({mode: "autopilot"}), or cancel and resume.
QA cycles exhausted? The same error 3 times indicates a fundamental issue. Review the error pattern; manual intervention may be needed.
Validation keeps failing? Review the specific issues. Requirements may have been too vague -- cancel and provide more detail. </Advanced>