Phase 0 - Expansion: Turn the user's idea into a detailed spec
- If
.omx/specs/deep-interview-*.md exists for this task: reuse it and skip redundant expansion work
- If prompt is highly vague: route to
$deep-interview for Socratic ambiguity-gated clarification
- Analyst (THOROUGH tier): Extract requirements
- Architect (THOROUGH tier): Create technical specification
- Output:
.omx/plans/autopilot-spec.md
Phase 1 - Planning: Create an implementation plan from the spec
- Architect (THOROUGH tier): Create plan (direct mode, no interview)
- Critic (THOROUGH tier): Validate plan
- Output:
.omx/plans/autopilot-impl.md
Phase 2 - Execution: Implement the plan using Ralph + Ultrawork
- LOW-tier executor/search roles: Simple tasks
- STANDARD-tier executor roles: Standard tasks
- THOROUGH-tier executor/architect roles: Complex tasks
- Run independent tasks in parallel
Phase 3 - QA: Cycle until all tests pass (UltraQA mode)
- Build, lint, test, fix failures
- Repeat up to 5 cycles
- Stop early if the same error repeats 3 times (indicates a fundamental issue)
Phase 4 - Validation: Multi-perspective review in parallel
- Architect: Functional completeness
- Security-reviewer: Vulnerability check
- Code-reviewer: Quality review
- All must approve; fix and re-validate on rejection
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"})
- Or run
/cancel for clean exit
State Management
Use omx_state MCP tools for autopilot lifecycle state.
- On start:
state_write({mode: "autopilot", active: true, current_phase: "expansion", started_at: "<now>", state: {context_snapshot_path: "<snapshot-path>"}})
- On phase transitions:
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"})
- On completion:
state_write({mode: "autopilot", active: false, current_phase: "complete", completed_at: "<now>"})
- On cancellation/cleanup:
run
$cancel (which should call state_clear(mode="autopilot"))
Scenario Examples
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.
Optional settings in ~/.codex/config.toml:
[omx.autopilot]
maxIterations = 10
maxQaCycles = 5
maxValidationRounds = 3
pauseAfterExpansion = false
pauseAfterPlanning = false
skipQa = false
skipValidation = false
Resume
If autopilot was cancelled or failed, run /autopilot again to resume from where it stopped.
Recommended Clarity Pipeline
For ambiguous requests, prefer:
deep-interview -> ralplan -> autopilot
deep-interview: ambiguity-gated Socratic requirements
ralplan: consensus planning (planner/architect/critic)
autopilot: execution + QA + validation
Best Practices for Input
- Be specific about the domain -- "bookstore" not "store"
- Mention key features -- "with CRUD", "with authentication"
- Specify constraints -- "using TypeScript", "with PostgreSQL"
- Let it run -- avoid interrupting unless truly needed
Pipeline Orchestrator (v0.8+)
Autopilot 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.
Troubleshooting
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.
1---2name: autopilot3description: [OMX] Full autonomous execution from idea to working code4---56<Purpose>7Autopilot takes a brief product idea and autonomously handles the full lifecycle: requirements analysis, technical design, planning, parallel implementation, QA cycling, and multi-perspective validation. It produces working, verified code from a 2-3 line description.8</Purpose>910<Use_When>11- User wants end-to-end autonomous execution from an idea to working code12- User says "autopilot", "auto pilot", "autonomous", "build me", "create me", "make me", "full auto", "handle it all", or "I want a/an..."13- Task requires multiple phases: planning, coding, testing, and validation14- User wants hands-off execution and is willing to let the system run to completion15</Use_When>1617<Do_Not_Use_When>18- User wants to explore options or brainstorm -- use `plan` skill instead19- User says "just explain", "draft only", or "what would you suggest" -- respond conversationally20- User wants a single focused code change -- use `ralph` or delegate to an executor agent21- User wants to review or critique an existing plan -- use `plan --review`22- Task is a quick fix or small bug -- use direct executor delegation23</Do_Not_Use_When>2425<Why_This_Exists>26Most 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.27</Why_This_Exists>2829<Execution_Policy>30- Each phase must complete before the next begins31- Parallel execution is used within phases where possible (Phase 2 and Phase 4)32- QA cycles repeat up to 5 times; if the same error persists 3 times, stop and report the fundamental issue33- Validation requires approval from all reviewers; rejected items get fixed and re-validated34- Cancel with `/cancel` at any time; progress is preserved for resume35- If a deep-interview spec exists, use it as high-clarity phase input instead of re-expanding from scratch36- If input is too vague for reliable expansion, offer/trigger `$deep-interview` first37- Do not enter expansion/planning/execution-heavy phases until pre-context grounding exists; if fast execution is forced, proceed only with explicit risk notes38- Default to concise, evidence-dense progress and completion reporting unless the user or risk level requires more detail39- Treat newer user task updates as local overrides for the active workflow branch while preserving earlier non-conflicting constraints40- If correctness depends on additional inspection, retrieval, execution, or verification, keep using the relevant tools until the workflow is grounded41- Continue through clear, low-risk, reversible next steps automatically; ask only when the next step is materially branching, destructive, or preference-dependent42</Execution_Policy>4344<Steps>450. **Pre-context Intake (required before Phase 0 starts)**:46 - Derive a task slug from the request.47 - Load the latest relevant snapshot from `.omx/context/{slug}-*.md` when available.48 - If no snapshot exists, create `.omx/context/{slug}-{timestamp}.md` (UTC `YYYYMMDDTHHMMSSZ`) with:49 - Task statement50 - Desired outcome51 - Known facts/evidence52 - Constraints53 - Unknowns/open questions54 - Likely codebase touchpoints55 - If ambiguity remains high, run `explore` first for brownfield facts, then run `$deep-interview --quick <task>` before proceeding.56 - Carry the snapshot path into autopilot artifacts/state so all phases share grounded context.57581. **Phase 0 - Expansion**: Turn the user's idea into a detailed spec59 - If `.omx/specs/deep-interview-*.md` exists for this task: reuse it and skip redundant expansion work60 - If prompt is highly vague: route to `$deep-interview` for Socratic ambiguity-gated clarification61 - Analyst (THOROUGH tier): Extract requirements62 - Architect (THOROUGH tier): Create technical specification63 - Output: `.omx/plans/autopilot-spec.md`64652. **Phase 1 - Planning**: Create an implementation plan from the spec66 - Architect (THOROUGH tier): Create plan (direct mode, no interview)67 - Critic (THOROUGH tier): Validate plan68 - Output: `.omx/plans/autopilot-impl.md`69703. **Phase 2 - Execution**: Implement the plan using Ralph + Ultrawork71 - LOW-tier executor/search roles: Simple tasks72 - STANDARD-tier executor roles: Standard tasks73 - THOROUGH-tier executor/architect roles: Complex tasks74 - Run independent tasks in parallel75764. **Phase 3 - QA**: Cycle until all tests pass (UltraQA mode)77 - Build, lint, test, fix failures78 - Repeat up to 5 cycles79 - Stop early if the same error repeats 3 times (indicates a fundamental issue)80815. **Phase 4 - Validation**: Multi-perspective review in parallel82 - Architect: Functional completeness83 - Security-reviewer: Vulnerability check84 - Code-reviewer: Quality review85 - All must approve; fix and re-validate on rejection86876. **Phase 5 - Cleanup**: Clear all mode state via OMX MCP tools on successful completion88 - `state_clear({mode: "autopilot"})`89 - `state_clear({mode: "ralph"})`90 - `state_clear({mode: "ultrawork"})`91 - `state_clear({mode: "ultraqa"})`92 - Or run `/cancel` for clean exit93</Steps>9495<Tool_Usage>96- Before first MCP tool use, call `ToolSearch("mcp")` to discover deferred MCP tools97- Use `ask_codex` with `agent_role: "architect"` for Phase 4 architecture validation98- Use `ask_codex` with `agent_role: "security-reviewer"` for Phase 4 security review99- Use `ask_codex` with `agent_role: "code-reviewer"` for Phase 4 quality review100- Agents form their own analysis first, then consult Codex for cross-validation101- If ToolSearch finds no MCP tools or Codex is unavailable, proceed without it -- never block on external tools102</Tool_Usage>103104## State Management105106Use `omx_state` MCP tools for autopilot lifecycle state.107108- **On start**:109 `state_write({mode: "autopilot", active: true, current_phase: "expansion", started_at: "<now>", state: {context_snapshot_path: "<snapshot-path>"}})`110- **On phase transitions**:111 `state_write({mode: "autopilot", current_phase: "planning"})`112 `state_write({mode: "autopilot", current_phase: "execution"})`113 `state_write({mode: "autopilot", current_phase: "qa"})`114 `state_write({mode: "autopilot", current_phase: "validation"})`115- **On completion**:116 `state_write({mode: "autopilot", active: false, current_phase: "complete", completed_at: "<now>"})`117- **On cancellation/cleanup**:118 run `$cancel` (which should call `state_clear(mode="autopilot")`)119120121## Scenario Examples122123**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.124125**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.126127**Bad:** The user says `continue`, and the workflow restarts discovery or stops before the missing verification/evidence is gathered.128129<Examples>130<Good>131User: "autopilot A REST API for a bookstore inventory with CRUD operations using TypeScript"132Why good: Specific domain (bookstore), clear features (CRUD), technology constraint (TypeScript). Autopilot has enough context to expand into a full spec.133</Good>134135<Good>136User: "build me a CLI tool that tracks daily habits with streak counting"137Why good: Clear product concept with a specific feature. The "build me" trigger activates autopilot.138</Good>139140<Bad>141User: "fix the bug in the login page"142Why bad: This is a single focused fix, not a multi-phase project. Use direct executor delegation or ralph instead.143</Bad>144145<Bad>146User: "what are some good approaches for adding caching?"147Why bad: This is an exploration/brainstorming request. Respond conversationally or use the plan skill.148</Bad>149</Examples>150151<Escalation_And_Stop_Conditions>152- Stop and report when the same QA error persists across 3 cycles (fundamental issue requiring human input)153- Stop and report when validation keeps failing after 3 re-validation rounds154- Stop when the user says "stop", "cancel", or "abort"155- If requirements were too vague and expansion produces an unclear spec, pause and redirect to `$deep-interview` before proceeding156</Escalation_And_Stop_Conditions>157158<Final_Checklist>159- [ ] All 5 phases completed (Expansion, Planning, Execution, QA, Validation)160- [ ] All validators approved in Phase 4161- [ ] Tests pass (verified with fresh test run output)162- [ ] Build succeeds (verified with fresh build output)163- [ ] State files cleaned up164- [ ] User informed of completion with summary of what was built165</Final_Checklist>166167<Advanced>168## Configuration169170Optional settings in `~/.codex/config.toml`:171172```toml173[omx.autopilot]174maxIterations = 10175maxQaCycles = 5176maxValidationRounds = 3177pauseAfterExpansion = false178pauseAfterPlanning = false179skipQa = false180skipValidation = false181```182183## Resume184185If autopilot was cancelled or failed, run `/autopilot` again to resume from where it stopped.186187## Recommended Clarity Pipeline188189For ambiguous requests, prefer:190191```192deep-interview -> ralplan -> autopilot193```194195- `deep-interview`: ambiguity-gated Socratic requirements196- `ralplan`: consensus planning (planner/architect/critic)197- `autopilot`: execution + QA + validation198199## Best Practices for Input2002011. Be specific about the domain -- "bookstore" not "store"2022. Mention key features -- "with CRUD", "with authentication"2033. Specify constraints -- "using TypeScript", "with PostgreSQL"2044. Let it run -- avoid interrupting unless truly needed205206## Pipeline Orchestrator (v0.8+)207208Autopilot can be driven by the configurable pipeline orchestrator (`src/pipeline/`), which209sequences stages through a uniform `PipelineStage` interface:210211```212RALPLAN (consensus planning) -> team-exec (Codex CLI workers) -> ralph-verify (architect verification)213```214215Pipeline configuration options:216217```toml218[omx.autopilot.pipeline]219maxRalphIterations = 10 # Ralph verification iteration ceiling220workerCount = 2 # Number of Codex CLI team workers221agentType = "executor" # Agent type for team workers222```223224The pipeline persists state via `pipeline-state.json` and supports resume from the last225incomplete stage. See `src/pipeline/orchestrator.ts` for the full API.226227## Troubleshooting228229**Stuck in a phase?** Check TODO list for blocked tasks, run `state_read({mode: "autopilot"})`, or cancel and resume.230231**QA cycles exhausted?** The same error 3 times indicates a fundamental issue. Review the error pattern; manual intervention may be needed.232233**Validation keeps failing?** Review the specific issues. Requirements may have been too vague -- cancel and provide more detail.234</Advanced>