Profile max rounds is a hard cap, not a target. Do not continue only to reach a numbered round count. Extra Socratic rigor does not override the active threshold unless the profile/config changes.
If no flag is provided, use Standard.
Phase 0: Preflight Context Intake
- Parse
{{ARGUMENTS}} and derive a short task slug.
- Attempt to load the latest relevant context snapshot from
.omx/context/{slug}-*.md.
- Check whether the provided initial context or loaded snapshot is too large for safe prompt use. If it is oversized, the first interview round must ask for a concise prompt-safe summary instead of scoring ambiguity or continuing to downstream handoff.
- If no snapshot exists, create a minimum context snapshot with:
- Task statement
- Desired outcome
- Stated solution (what the user asked for)
- Probable intent hypothesis (why they likely want it)
- Known facts/evidence
- Constraints
- Unknowns/open questions
- Decision-boundary unknowns
- Likely codebase touchpoints
- Relevant repo docs/rules/context inspected
- Terminology or doc/code conflicts found
- Prompt-safe initial-context summary status (
not_needed, needed, or recorded)
- For brownfield tasks, inspect the applicable documentation/rule surface before the first user-facing round. Prefer exact, nearby sources over broad scans:
- governing
AGENTS.md files and template/runtime instruction surfaces that apply to the touched paths
- README/getting-started docs and relevant docs under
docs/, especially contracts, plans, ADR-like records, and workflow docs
- existing
.omx/context/ snapshots, .omx/specs/, and planning artifacts relevant to the slug
- project-local glossary/context files such as
CONTEXT.md, CONTEXT-MAP.md, or context-specific docs when they exist
- Save snapshot to
.omx/context/{slug}-{timestamp}.md (UTC YYYYMMDDTHHMMSSZ) and reference it in mode state.
Phase 1: Initialize
- Parse
{{ARGUMENTS}} and depth profile (--quick|--standard|--deep).
- Detect project context:
- Run
explore to classify brownfield (existing codebase target) vs greenfield.
- For brownfield, collect relevant codebase context before questioning.
- Initialize state via
omx state write --input '{"mode":"deep-interview","active":true}' --json:
{
"active": true,
"current_phase": "deep-interview",
"state": {
"interview_id": "<uuid>",
"profile": "quick|standard|deep",
"type": "greenfield|brownfield",
"initial_idea": "<user input>",
"rounds": [],
"current_ambiguity": 1.0,
"threshold": 0.3,
"max_rounds": 5,
"challenge_modes_used": [],
"codebase_context": null,
"current_stage": "intent-first",
"current_focus": "intent",
"context_snapshot_path": ".omx/context/<slug>-<timestamp>.md"
}
}
- Announce kickoff with profile, threshold, and current ambiguity.
Phase 2: Socratic Interview Loop
Repeat until ambiguity <= threshold, the pressure pass is complete, the readiness gates are explicit, the user exits with warning, or max rounds are reached. This is a stop condition: below threshold, do not open a new ordinary interview branch.
2a) Generate next question
If the initial context is oversized and no prompt-safe summary has been recorded yet, the next question must be only a summary request. Do not score ambiguity, do not run readiness gates, and do not hand off to $ultragoal, $ralplan, $autopilot, $ralph, or $team until that summary answer is captured.
Use:
- Original idea
- Prior Q&A rounds
- Current dimension scores
- Brownfield context (if any)
- Doc/context grounding notes, including existing terminology, governing rules, and any doc/code mismatch
- Activated challenge mode injection (Phase 3)
Target the lowest-scoring dimension, but respect stage priority:
- Stage 1 — Intent-first: Intent, Outcome, Scope, Non-goals, Decision Boundaries
- Stage 2 — Feasibility: Constraints, Success Criteria
- Stage 3 — Brownfield grounding: Context Clarity (brownfield only)
Follow-up pressure ladder after each answer:
- Ask for a concrete example, counterexample, or evidence signal behind the latest claim
- Probe the hidden assumption, dependency, or belief that makes the claim true
- Force a boundary or tradeoff: what would you explicitly not do, defer, or reject?
- Challenge fuzzy or conflicting terms against the repo's documented language and current code behavior
- Stress-test the boundary with one concrete scenario or edge case when a relationship or handoff remains ambiguous
- If the answer still describes symptoms, reframe toward essence / root cause before moving on
Prefer staying on the same thread for multiple rounds when it has the highest leverage. Breadth without pressure is not progress.
Maintain a Breadth Ledger across independent ambiguity tracks: scope, constraints, outputs, verification, brownfield integration, and any user-mentioned deliverable tracks. The ledger is a guard, not a mandatory rotation rule: stay deep on the current thread until it has been pressure-tested, then zoom out only when another material track remains unresolved and would change execution.
Maintain a Docs/Terminology Ledger for brownfield interviews:
- repo docs/rules/context sources inspected, with path references
- canonical terms already used by the repo and terms to avoid or disambiguate
- user terms that conflict with docs or current code behavior
- doc/code mismatches that require a human decision before implementation
- optional durable-doc follow-ups that are safe to propose but not auto-apply
Detailed dimensions:
- Intent Clarity — why the user wants this
- Outcome Clarity — what end state they want
- Scope Clarity — how far the change should go
- Constraint Clarity — technical or business limits that must hold
- Success Criteria Clarity — how completion will be judged
- Context Clarity — existing codebase understanding (brownfield only)
Non-goals and Decision Boundaries are mandatory readiness gates. Ask about them early and keep revisiting them until they are explicit.
2b) Ask the question
Use the surface-appropriate structured questioning path for every interview round. In attached-tmux sessions, use OMX-owned structured questioning via omx question (this is the required structured-question equivalent and required AskUserQuestion equivalent for deep-interview). Outside tmux, use native structured input when available; otherwise ask exactly one concise plain-text question and wait for the answer. Present:
Round {n} | Target: {weakest_dimension} | Ambiguity: {score}%
{question}
omx question payload guidance for interview rounds:
- Deep-interview is Socratic: ask one focused round at a time. Do not use batch
questions[] to combine multiple interview rounds, even though omx question supports batch forms for other workflows.
- Use canonical
type values instead of authoring raw multi_select flags by hand. type: "single-answerable" is the default for one-path decisions; type: "multi-answerable" is the canonical shape for bounded multi-select rounds. The runtime will keep multi_select aligned with type.
- Use
single-answerable when exactly one answer should drive the next branch, the options are mutually exclusive, or selecting more than one answer would blur the decision boundary. Typical cases: handoff lane selection, choosing the primary failure mode, or confirming which of several competing interpretations is correct.
- Use
multi-answerable when multiple options may all be true at once and you need to capture a bounded set of coexisting constraints, non-goals, risks, or acceptance checks in one round. Typical cases: selecting all out-of-scope items, all success metrics that must hold, or all deployment constraints that apply together.
- If one selected option would immediately require a follow-up question to disambiguate the others, prefer a
single-answerable round now and ask the follow-up next. Do not hide a branching interview tree inside one overloaded multi-select prompt.
- Keep interview options bounded and concrete. If the valid answers are already known, set
allow_other: false; only leave allow_other: true when the interview genuinely needs one user-supplied option that cannot be enumerated in advance.
- Read answers structurally from the primary
answers[] array. For a normal single-round interview response, use answers[0].answer as the source of truth; the top-level answer field is a legacy single-question projection/fallback only.
- For
single-answerable, expect one decisive selection in the value field of answers[0].answer plus its selected-values metadata. For multi-answerable, treat the selected-values field inside answers[0].answer as the source of truth for all chosen constraints/non-goals and preserve the full set in the transcript/spec. In legacy single-question projections, this is equivalent to: For multi-answerable, treat answer.selected_values as the source of truth.
Canonical bounded single-choice payload:
{
"question": "Which execution lane should own this once the interview is complete?",
"type": "single-answerable",
"options": [
{
"label": "Plan first",
"value": "ralplan",
"description": "Need architecture and test-shape review before execution"
},
{
"label": "Execute directly",
"value": "autopilot",
"description": "Requirements are already explicit enough for planning plus execution"
},
{
"label": "Refine further",
"value": "refine",
"description": "Clarification is still needed before any handoff"
}
],
"allow_other": false,
"other_label": "Other",
"source": "deep-interview"
}
Canonical bounded multi-select payload:
{
"question": "Which non-goals must stay out of scope for the first pass?",
"type": "multi-answerable",
"options": [
{
"label": "No UI redesign",
"value": "no-ui-redesign",
"description": "Keep layout and styling unchanged"
},
{
"label": "No new dependencies",
"value": "no-new-dependencies",
"description": "Work within the existing toolchain"
},
{
"label": "No API contract changes",
"value": "no-api-contract-changes",
"description": "Preserve external request and response shapes"
}
],
"allow_other": false,
"other_label": "Other",
"source": "deep-interview"
}
Canonical answer-shape reminders:
{
"answer": {
"kind": "option",
"value": "ralplan",
"selected_labels": ["Plan first"],
"selected_values": ["ralplan"]
}
}
{
"answer": {
"kind": "multi",
"value": ["no-new-dependencies", "no-api-contract-changes"],
"selected_labels": ["No new dependencies", "No API contract changes"],
"selected_values": ["no-new-dependencies", "no-api-contract-changes"]
}
}
2c) Score ambiguity
Score each weighted dimension in [0.0, 1.0] with justification + gap.
Greenfield: ambiguity = 1 - (intent × 0.30 + outcome × 0.25 + scope × 0.20 + constraints × 0.15 + success × 0.10)
Brownfield: ambiguity = 1 - (intent × 0.25 + outcome × 0.20 + scope × 0.20 + constraints × 0.15 + success × 0.10 + context × 0.10)
Readiness gate:
Non-goals must be explicit
Decision Boundaries must be explicit
- A pressure pass must be complete: at least one earlier answer has been revisited with an evidence, assumption, or tradeoff follow-up
- A practical closure audit must pass: another question would change execution materially, not merely polish wording or chase a narrow edge case
- If either gate is unresolved, or the pressure pass is incomplete, continue below threshold only with a final closure question that names the unresolved gate and would materially change execution.
- Treat a low ambiguity score as permission to audit closure, not permission to keep drilling indefinitely. If remaining uncertainty would not change implementation, crystallize the spec instead of opening a new branch.
- If ambiguity is
<= 0.10, another user-facing question is allowed only as that final closure question; otherwise crystallize immediately.
2d) Report progress
Show weighted breakdown table, readiness-gate status (Non-goals, Decision Boundaries), and the next focus dimension.
2e) Persist state
Append round result and updated scores via omx state write --input '<json>' --json. Do not write {mode}-state.json directly and do not use the read-only MCP state projection as a writer.
2f) Round controls
- Do not offer early exit before the first explicit assumption probe and one persistent follow-up have happened
- Apply a Dialectic Rhythm Guard: track consecutive non-user fact discoveries and confirmation-style answers (
[from-code][auto-confirmed], [from-code], or [from-research]). After 3 consecutive non-user or confirmation answers, the next material user-facing round must solicit direct human judgment ([from-user]) unless the closure audit says the interview is ready to crystallize.
- Round 4+: allow explicit early exit with risk warning
- Soft warning at profile midpoint (e.g., round 3/6/10 depending on profile)
- Hard cap at profile
max_rounds; never treat this cap as a desired interview length or quota
Phase 3: Challenge Modes (assumption stress tests)
Use each mode once when applicable. These are normal escalation tools, not rare rescue moves:
- Contrarian (round 2+ or immediately when an answer rests on an untested assumption): challenge core assumptions
- Terminologist (brownfield, whenever a key term is fuzzy, overloaded, or conflicts with repo docs/code): force a canonical meaning against existing project language before implementation
- Simplifier (round 4+ or when scope expands faster than outcome clarity): probe minimal viable scope
- Ontologist (round 5+ and ambiguity > 0.25, or when the user keeps describing symptoms): ask for essence-level reframing
Track used modes in state to prevent repetition.
Phase 4: Crystallize Artifacts
When threshold is met (or user exits with warning / hard cap):
- Write interview transcript summary to:
.omx/interviews/{slug}-{timestamp}.md
(kept for ralph PRD compatibility)
- Write execution-ready spec to:
.omx/specs/deep-interview-{slug}.md
Spec should include:
- Metadata (profile, rounds, final ambiguity, threshold, context type)
- Context snapshot reference/path (for ralplan/team reuse)
- Prompt-safe initial-context summary when oversized context was provided, plus references to any full source documents
- Clarity breakdown table
- Intent (why the user wants this)
- Desired Outcome
- In-Scope
- Out-of-Scope / Non-goals
- Decision Boundaries (what OMX may decide without confirmation)
- Constraints
- Testable acceptance criteria
- Assumptions exposed + resolutions
- Pressure-pass findings (which answer was revisited, and what changed)
- Brownfield evidence vs inference notes for any repository-grounded confirmation questions
- Docs/Terminology Ledger with inspected repo docs/rules/context, term conflicts, and any doc/code mismatch decisions
- Scenario/edge-case pressure findings that materially shaped scope or acceptance criteria
- Optional durable documentation recommendations, explicitly marked opt-in and public-safe; do not include raw private transcript dumps
- Technical context findings
- Full or condensed transcript
Autoresearch specialization
When the clarified task is specifically about $autoresearch, or the skill is invoked with --autoresearch, keep the interview domain-specific and emit skill-consumable artifacts without skipping clarification.
- Accepted seed inputs:
topic, evaluator, keep-policy, slug, existing mission draft text, and prior evaluator examples/templates
- Required interview focus: mission clarity, evaluator readiness, keep policy, slug/session naming, and whether the draft is ready to launch now or should refine further
- Canonical artifact path:
.omx/specs/deep-interview-autoresearch-{slug}.md
- Launch artifact bundle:
.omx/specs/autoresearch-{slug}/mission.md, .omx/specs/autoresearch-{slug}/sandbox.md, and .omx/specs/autoresearch-{slug}/result.json
- Launch artifact directory:
.omx/specs/autoresearch-{slug}/
- Required artifact sections:
Mission Draft
Evaluator Draft
Launch Readiness
Seed Inputs
Confirmation Bridge
- Required launch artifacts under
.omx/specs/autoresearch-{slug}/:
mission.md
sandbox.md
result.json
- Launch-readiness rule: mark the draft as not launch-ready while the evaluator command still contains placeholder markers such as
<...>, TODO, TBD, REPLACE_ME, CHANGEME, or your-command-here
- Structured result contract:
result.json should point to the draft + mission/sandbox artifacts and carry the finalized topic, evaluatorCommand, keepPolicy, slug, launchReady, and blockedReasons fields so $autoresearch can consume it directly
- Confirmation bridge: after artifact generation, offer at least
refine further and launch; do not run direct CLI launch or detached/split tmux launch, and only hand off to $autoresearch after explicit confirmation
- Handoff rule: downstream execution must preserve the clarified mission intent, evaluator expectations, decision boundaries, and launch-readiness status from this artifact rather than bypassing the draft review step
Phase 5: Execution Bridge
Present execution options after artifact generation using explicit handoff contracts. Treat the deep-interview spec as the current requirements source of truth and preserve intent, non-goals, decision boundaries, acceptance criteria, docs/terminology grounding, and any residual-risk warnings across the handoff.
Optional execution contract foundation
When an Autopilot/deep-interview handoff explicitly requires a stride contract, emit it as structured data rather than prose. This is a validation foundation, not a broadness-inference feature: do not infer stride from task length, phase labels, snapshots, or freeform wording.
Canonical location under Autopilot state:
{
"handoff_artifacts": {
"deep_interview": {
"execution_contract_required": true,
"execution_contract": {
"version": 1,
"execution_stride": "task",
"source": "deep-interview",
"selected_by": "user",
"allow_task_shrink": true,
"completion_unit": "One focused task",
"stop_condition": "Stop after that task is implemented and verified",
"acceptance_coverage_scope": "task",
"shrink_policy": "allowed"
}
}
}
}
Stride meanings:
task: conservative, small-step execution; allow_task_shrink:true, acceptance_coverage_scope:"task", shrink_policy:"allowed".
deliverable: finish the named deliverable before stopping; allow_task_shrink:false, acceptance_coverage_scope:"deliverable", shrink_policy:"ask_before_shrink".
milestone: finish the larger approved milestone unless blocked; allow_task_shrink:false, acceptance_coverage_scope:"milestone", shrink_policy:"deny_unless_blocked".
Only set execution_contract_required:true when the selected downstream workflow needs this explicit stride/stop-condition guard. New artifacts must write the canonical snake_case schema shown above under handoff_artifacts.deep_interview; runtime readers may accept legacy camelCase field/marker aliases and direct/nested execution_contract locations only as compatibility input. If execution_contract_required is absent or false, downstream Autopilot compatibility behavior is unchanged.
Goal-mode follow-ups
Include these product-facing suggestions when they fit the clarified spec, without removing the existing $ultragoal, $ralplan, $autopilot, $ralph, and $team handoff options:
$ultragoal — default goal-mode follow-up for implementation or general goal-oriented follow-up specs that should be converted into durable Codex/OMX goals with sequential completion tracking.
$autoresearch-goal — use when the clarified context is a research project: a research question, reference/literature gathering, evaluator-backed analysis, or professor/critic-style deliverable.
$performance-goal — use when the clarified context is an optimization or performance project with measurable speed, latency, throughput, memory, benchmark, or evaluator criteria.
Recommend $ultragoal as the default durable goal-mode follow-up because it supersedes Ralph for goal tracking. Preserve $team for coordinated parallel implementation and keep $ralph only as an explicit fallback for persistent single-owner execution/verification when the user specifically selects it.
1. $ultragoal (Default durable execution follow-up)
- Input Artifact:
.omx/specs/deep-interview-{slug}.md (optionally accompanied by the transcript/context snapshot for traceability)
- Invocation:
$ultragoal create-goals --brief-file <spec-path> followed by $ultragoal complete-goals in the active execution lane
- Consumer Behavior: Convert the clarified spec into durable goal-mode work. Preserve intent, non-goals, decision boundaries, acceptance criteria, docs/terminology grounding, scenario-pressure findings, and residual-risk warnings as binding story constraints.
- Skipped / Already-Satisfied Stages: Requirement interview, ambiguity clarification, doc/context preflight, and early intent-boundary elicitation
- Expected Output:
.omx/ultragoal/brief.md, .omx/ultragoal/goals.json, .omx/ultragoal/ledger.jsonl, implementation evidence, verification evidence, and final cleanup/review-gate evidence
- Best When: The clarified spec is execution-ready or the user explicitly wants durable goal tracking as the next step
- Next Recommended Step: Run the Ultragoal completion loop; launch
$team only inside an active Ultragoal story when parallel lanes are warranted, and use $ralph only as an explicit fallback when the user asks for that legacy persistence mode
2. $ralplan (Recommended when architecture/test-shape review is still needed)
- Input Artifact:
.omx/specs/deep-interview-{slug}.md (optionally accompanied by the transcript/context snapshot for traceability)
- Invocation:
$ralplan <spec-path>
- Consumer Behavior: Treat the deep-interview spec as the requirements source of truth. Do not repeat the interview by default; refine architecture/feasibility around the clarified intent and boundaries instead.
- Skipped / Already-Satisfied Stages: Requirements discovery, ambiguity clarification, and early intent-boundary elicitation
- Expected Output: Canonical planning artifacts under
.omx/plans/, especially prd-*.md and test-spec-*.md
- Best When: Requirements are clear enough to stop interviewing, but architectural validation / consensus planning is still desirable
- Next Recommended Step: Use the approved planning artifacts with
$ultragoal as the default durable goal-mode follow-up (optionally with $team for parallel lanes); choose $autoresearch-goal for research validation or $performance-goal for measurable optimization, and use $ralph only as an explicit fallback when a narrow single-owner persistence loop is requested
3. $autopilot
- Input Artifact:
.omx/specs/deep-interview-{slug}.md
- Invocation:
$autopilot <spec-path>
- Consumer Behavior: Use the deep-interview spec as the clarified execution brief. Preserve intent, non-goals, decision boundaries, and acceptance criteria as binding context for planning/execution.
- Skipped / Already-Satisfied Stages: Initial requirement discovery and ambiguity reduction
- Expected Output: Planning/execution progress, QA evidence, and validation artifacts produced by autopilot
- Best When: The clarified spec is already strong enough for direct planning + execution without an additional consensus gate
- Next Recommended Step: Continue through autopilot's execution/QA/validation flow; if coordination-heavy execution emerges, prefer
$team under a leader-owned $ultragoal ledger, using $ralph only as an explicit fallback when a narrow single-owner persistence loop is requested
4. $ralph (Explicit fallback only)
- Input Artifact:
.omx/specs/deep-interview-{slug}.md
- Invocation:
$ralph <spec-path>
- Consumer Behavior: Use the spec's acceptance criteria and boundary constraints as the persistence target. Do not reopen requirements discovery unless the user explicitly asks to refine further.
- Skipped / Already-Satisfied Stages: Requirement interview, ambiguity clarification, and initial scope-definition work
- Expected Output: Iterative execution progress and verification evidence tracked against the clarified criteria
- Best When: The user explicitly asks for Ralph's persistent sequential completion pressure; otherwise use
$ultragoal for durable goal tracking and completion checkpoints
- Next Recommended Step: If this explicit fallback is selected, continue Ralph's persistence loop; if work expands into coordination-heavy lanes, hand off to
$team under $ultragoal checkpointing rather than promoting Ralph as the next default
5. $team
- Input Artifact:
.omx/specs/deep-interview-{slug}.md
- Invocation:
$team <spec-path>
- Consumer Behavior: Treat the spec as shared execution context for coordinated parallel work. Preserve the clarified intent, non-goals, decision boundaries, and acceptance criteria as common lane constraints.
- Skipped / Already-Satisfied Stages: Requirement clarification and early ambiguity reduction
- Expected Output: Coordinated multi-agent execution against the shared spec, with evidence that can later feed Ultragoal checkpoints by default, or an explicit Ralph verification pass only when requested
- Best When: The task is large, multi-lane, or blocker-sensitive enough to justify coordinated parallel execution instead of a single persistent loop
- Next Recommended Step: Follow the team verification path when the coordinated execution phase finishes; checkpoint completion through
$ultragoal by default, escalating to a separate Ralph loop only when the user explicitly asks for that persistent verification/fix owner
6. Refine further
- Input Artifact: Existing transcript, context snapshot, and current spec draft
- Invocation: Continue the interview loop
- Consumer Behavior: Re-enter questioning to resolve the highest-leverage remaining uncertainty
- Skipped / Already-Satisfied Stages: None beyond already-captured context
- Expected Output: A lower-ambiguity spec with tighter boundaries and fewer unresolved assumptions
- Best When: Residual ambiguity is still too high, the user wants stronger clarity, or the above-threshold / early-exit warning indicates too much risk to proceed cleanly
- Next Recommended Step: Return to one of the execution handoff contracts above once the spec is sufficiently clarified
Residual-Risk Rule: If the interview ended via early exit, hard-cap completion, or above-threshold proceed-with-warning, explicitly preserve that residual-risk state in the handoff so the downstream skill knows it inherited a partially clarified brief.
IMPORTANT: Deep-interview is a requirements mode. On handoff, invoke the selected skill using the contract above. Do NOT implement directly inside deep-interview.
…(truncated)
1---2name: deep-interview3description: Socratic deep interview with mathematical ambiguity gating before execution4---56<Purpose>7Deep Interview is an intent-first Socratic clarification loop before planning or implementation. It turns vague ideas into execution-ready specifications by asking targeted questions about why the user wants a change, how far it should go, what should stay out of scope, and what OMX may decide without confirmation.8</Purpose>910<Use_When>11- The request is broad, ambiguous, or missing concrete acceptance criteria12- The user says "deep interview", "interview me", "ask me everything", "don't assume", or "ouroboros"13- The user wants to avoid misaligned implementation from underspecified requirements14- You need a requirements artifact before handing off to `ralplan`, `autopilot`, `ralph`, or `team`15</Use_When>1617<Do_Not_Use_When>18- The request already has concrete file/symbol targets and clear acceptance criteria19- The user explicitly asks to skip planning/interview and execute immediately20- The user asks for lightweight brainstorming only (use `plan` instead)21- A complete PRD/plan already exists and execution should start22</Do_Not_Use_When>2324<Why_This_Exists>25Execution quality is usually bottlenecked by intent clarity, not just missing implementation detail. A single expansion pass often misses why the user wants a change, where the scope should stop, which tradeoffs are unacceptable, and which decisions still require user approval. This workflow applies Socratic pressure + quantitative ambiguity scoring so orchestration modes begin with an explicit, testable, intent-aligned spec.26</Why_This_Exists>2728<Depth_Profiles>29- **Quick (`--quick`)**: fast pre-PRD pass; target threshold `<= 0.30`; max rounds 530- **Standard (`--standard`, default)**: full requirement interview; target threshold `<= 0.20`; max rounds 1231- **Deep (`--deep`)**: high-rigor exploration; target threshold `<= 0.15`; max rounds 2032- **Autoresearch (`--autoresearch`)**: same interview rigor as Standard, but specialized for `$autoresearch` mission readiness and `.omx/specs/` artifact handoff3334Profile `max rounds` is a hard cap, not a target. Do not continue only to reach a numbered round count. Extra Socratic rigor does not override the active threshold unless the profile/config changes.3536If no flag is provided, use **Standard**.3738<Mode_Flags>39- **`--autoresearch`**: switch the interview into autoresearch-intake mode for `$autoresearch` handoff. In this mode, the interview should converge on a validator-ready research mission, write canonical artifacts under `.omx/specs/`, and preserve the explicit `refine further` vs `launch` boundary for downstream skill intake.40</Mode_Flags>41</Depth_Profiles>4243<Execution_Policy>44- Ask ONE question per round (never batch multiple interview rounds into one `questions[]` form)45- Ask about intent and boundaries before implementation detail46- Target the weakest clarity dimension each round after applying the stage-priority rules below47- Treat every answer as a claim to pressure-test before moving on: the next question should usually demand evidence or examples, expose a hidden assumption, force a tradeoff or boundary, or reframe root cause vs symptom48- Do not rotate to a new clarity dimension just for coverage when the current answer is still vague; stay on the same thread until one layer deeper, one assumption clearer, or one boundary tighter49- Before crystallizing, complete at least one explicit pressure pass that revisits an earlier answer with a deeper, assumption-focused, or tradeoff-focused follow-up50- Gather codebase facts via `explore` before asking user about internals51- `omx explore` is deprecated. Use normal repository inspection tools/subagents for simple read-only brownfield fact gathering; use `omx sparkshell` only for explicit shell-native read-only evidence, and keep ambiguous or non-shell-only investigation on the richer normal path.52- Always run a preflight context intake before the first interview question53- For brownfield work, preflight must include doc/context grounding before user-facing questions: inspect applicable `AGENTS.md` files, README/getting-started docs, relevant `docs/` contracts/plans/ADRs, existing `.omx/context/` snapshots, and any project-local glossary/context files such as `CONTEXT.md` or `CONTEXT-MAP.md` when present.54- Treat existing repo language as evidence, not authority: if the user uses a fuzzy, overloaded, or conflicting term, surface the specific doc/code wording and ask which meaning should govern before implementation.55- Cross-check user claims about current behavior against code or documented contracts when discoverable. If docs and code disagree, ask a confirmation question that names both sources instead of silently choosing one.56- Use scenario-based edge-case grilling when relationships, boundaries, or handoff behavior are unclear: invent one concrete scenario that stresses the ambiguous boundary, then ask one focused question about the expected outcome.57- Durable docs, glossary, ADR, or memory updates are opt-in and public-safe only. Deep-interview may recommend such updates in the handoff summary, but must not automatically create or dump public docs from interview transcripts unless the user explicitly chooses that as in-scope.58- If initial context is oversized or would exceed the prompt budget, do not paste or forward the raw payload into interview prompts; request and record a prompt-safe initial-context summary first59- The oversized initial-context summary gate is blocking: wait for the concise summary before ambiguity scoring, crystallizing artifacts, or any downstream execution handoff60- The summary must preserve goals, constraints, success criteria, non-goals, decision boundaries, and references to any full source documents so downstream consumers receive a prompt-safe but faithful context61- Keep total prompt payloads within a safe budget by summarizing or trimming retained history; preserve newest/highest-signal answers and never let raw oversized context crowd out the current question62- Reduce user effort: ask only the highest-leverage unresolved question, and never ask the user for codebase facts that can be discovered directly63- For brownfield work, prefer evidence-backed confirmation questions such as "I found X in Y. Should this change follow that pattern?"64- Route facts before judgment in the Ouroboros style: before presenting a user-facing interview round, classify whether the needed information is a discoverable fact, a fact needing confirmation, or a human decision. The interview is with the human for judgment, not for facts the agent can inspect.65- When unresolved ambiguity depends on current external best practices, official/upstream guidance, standards, or version-aware behavior, use `$best-practice-research` as the bounded evidence wrapper before crystallizing requirements or handing off to planning/execution.66- Use these transcript/spec labels only; never use them as `omx question` `source` values, and never replace the runtime `source: "deep-interview"` contract for user-facing deep-interview questions:67 - `[from-code][auto-confirmed]` — exact, high-confidence codebase facts from manifests/configs or direct source evidence, with no prescription attached.68 - `[from-code]` — codebase findings that are useful but inferred, pattern-based, or low/medium confidence and therefore need a confirmation-style user-facing round before being treated as settled.69 - `[from-research]` — externally sourced facts such as API limits, compatibility, or public documentation; facts only, not decisions.70 - `[from-user]` — goals, preferences, business logic, scope, non-goals, acceptance criteria, tradeoffs, and any decision-bearing interpretation.71- Treat `[from-code][auto-confirmed]` and other non-user fact discoveries as context/transcript updates, not interview rounds: do not call `omx question`, do not create a pending deep-interview question obligation, and do not increment the user-facing round number for facts the agent can safely establish.72- Auto-confirm only descriptive facts. If a finding implies what the new feature should do, which pattern it should follow, which tradeoff to accept, or what should stay in/out of scope, route the entire decision-bearing question to the user as `[from-user]` even when code or research facts are available.73- In attached-tmux Codex CLI, deep-interview uses `omx question` as the required OMX-owned structured questioning path for every interview round74- When invoking `omx question` through attached-tmux Bash/tool paths, preserve the leader-pane return target by prefixing the command with `OMX_QUESTION_RETURN_PANE=$TMUX_PANE` (or a concrete `%pane` value)75- If you launch `omx question` in a background terminal, immediately wait for that background terminal to finish and read its JSON answer before scoring ambiguity, asking another round, or handing off76- Treat `answers[]` as the primary `omx question` success contract. For a single interview round, read `answers[0].answer`; use legacy top-level `answer` only as a compatibility fallback when needed.77- If the current runtime is outside tmux and cannot render `omx question`, use the native structured question tool when available; otherwise ask exactly one concise plain-text question and wait for the answer78- Re-score ambiguity after each answer and show progress transparently79- Once ambiguity is at or below the active profile threshold, stop ordinary questioning. Run the practical closure audit: crystallize/handoff when readiness gates pass; otherwise ask only the final closure question needed to satisfy a named gate.80- Treat `max_rounds` as a stop cap, not evidence that more rounds are needed.81- Do not hand off to execution while ambiguity remains above threshold unless user explicitly opts to proceed with warning82- Do not crystallize or hand off while `Non-goals` or `Decision Boundaries` remain unresolved, even if the weighted ambiguity threshold is met83- Treat early exit as a safety valve, not the default success path84- Persist mode state for resume safety only through the CLI/programmatic single-writer authority (`omx state write/read --input '<json>' --json`, backed by `src/state/operations.ts`). The MCP state server is a read-only projection and must never become a second writer.85</Execution_Policy>8687<Steps>8889## Phase 0: Preflight Context Intake90911. Parse `{{ARGUMENTS}}` and derive a short task slug.922. Attempt to load the latest relevant context snapshot from `.omx/context/{slug}-*.md`.933. Check whether the provided initial context or loaded snapshot is too large for safe prompt use. If it is oversized, the first interview round must ask for a concise prompt-safe summary instead of scoring ambiguity or continuing to downstream handoff.944. If no snapshot exists, create a minimum context snapshot with:95 - Task statement96 - Desired outcome97 - Stated solution (what the user asked for)98 - Probable intent hypothesis (why they likely want it)99 - Known facts/evidence100 - Constraints101 - Unknowns/open questions102 - Decision-boundary unknowns103 - Likely codebase touchpoints104 - Relevant repo docs/rules/context inspected105 - Terminology or doc/code conflicts found106 - Prompt-safe initial-context summary status (`not_needed`, `needed`, or `recorded`)1075. For brownfield tasks, inspect the applicable documentation/rule surface before the first user-facing round. Prefer exact, nearby sources over broad scans:108 - governing `AGENTS.md` files and template/runtime instruction surfaces that apply to the touched paths109 - README/getting-started docs and relevant docs under `docs/`, especially contracts, plans, ADR-like records, and workflow docs110 - existing `.omx/context/` snapshots, `.omx/specs/`, and planning artifacts relevant to the slug111 - project-local glossary/context files such as `CONTEXT.md`, `CONTEXT-MAP.md`, or context-specific docs when they exist1126. Save snapshot to `.omx/context/{slug}-{timestamp}.md` (UTC `YYYYMMDDTHHMMSSZ`) and reference it in mode state.113114## Phase 1: Initialize1151161. Parse `{{ARGUMENTS}}` and depth profile (`--quick|--standard|--deep`).1172. Detect project context:118 - Run `explore` to classify **brownfield** (existing codebase target) vs **greenfield**.119 - For brownfield, collect relevant codebase context before questioning.1203. Initialize state via `omx state write --input '{"mode":"deep-interview","active":true}' --json`:121122```json123{124 "active": true,125 "current_phase": "deep-interview",126 "state": {127 "interview_id": "<uuid>",128 "profile": "quick|standard|deep",129 "type": "greenfield|brownfield",130 "initial_idea": "<user input>",131 "rounds": [],132 "current_ambiguity": 1.0,133 "threshold": 0.3,134 "max_rounds": 5,135 "challenge_modes_used": [],136 "codebase_context": null,137 "current_stage": "intent-first",138 "current_focus": "intent",139 "context_snapshot_path": ".omx/context/<slug>-<timestamp>.md"140 }141}142```1431444. Announce kickoff with profile, threshold, and current ambiguity.145146## Phase 2: Socratic Interview Loop147148Repeat until ambiguity `<= threshold`, the pressure pass is complete, the readiness gates are explicit, the user exits with warning, or max rounds are reached. This is a stop condition: below threshold, do not open a new ordinary interview branch.149150### 2a) Generate next question151If the initial context is oversized and no prompt-safe summary has been recorded yet, the next question must be only a summary request. Do not score ambiguity, do not run readiness gates, and do not hand off to `$ultragoal`, `$ralplan`, `$autopilot`, `$ralph`, or `$team` until that summary answer is captured.152153Use:154- Original idea155- Prior Q&A rounds156- Current dimension scores157- Brownfield context (if any)158- Doc/context grounding notes, including existing terminology, governing rules, and any doc/code mismatch159- Activated challenge mode injection (Phase 3)160161Target the lowest-scoring dimension, but respect stage priority:162- **Stage 1 — Intent-first:** Intent, Outcome, Scope, Non-goals, Decision Boundaries163- **Stage 2 — Feasibility:** Constraints, Success Criteria164- **Stage 3 — Brownfield grounding:** Context Clarity (brownfield only)165166Follow-up pressure ladder after each answer:1671. Ask for a concrete example, counterexample, or evidence signal behind the latest claim1682. Probe the hidden assumption, dependency, or belief that makes the claim true1693. Force a boundary or tradeoff: what would you explicitly not do, defer, or reject?1704. Challenge fuzzy or conflicting terms against the repo's documented language and current code behavior1715. Stress-test the boundary with one concrete scenario or edge case when a relationship or handoff remains ambiguous1726. If the answer still describes symptoms, reframe toward essence / root cause before moving on173174Prefer staying on the same thread for multiple rounds when it has the highest leverage. Breadth without pressure is not progress.175176Maintain a **Breadth Ledger** across independent ambiguity tracks: scope, constraints, outputs, verification, brownfield integration, and any user-mentioned deliverable tracks. The ledger is a guard, not a mandatory rotation rule: stay deep on the current thread until it has been pressure-tested, then zoom out only when another material track remains unresolved and would change execution.177178Maintain a **Docs/Terminology Ledger** for brownfield interviews:179- repo docs/rules/context sources inspected, with path references180- canonical terms already used by the repo and terms to avoid or disambiguate181- user terms that conflict with docs or current code behavior182- doc/code mismatches that require a human decision before implementation183- optional durable-doc follow-ups that are safe to propose but not auto-apply184185Detailed dimensions:186- Intent Clarity — why the user wants this187- Outcome Clarity — what end state they want188- Scope Clarity — how far the change should go189- Constraint Clarity — technical or business limits that must hold190- Success Criteria Clarity — how completion will be judged191- Context Clarity — existing codebase understanding (brownfield only)192193`Non-goals` and `Decision Boundaries` are mandatory readiness gates. Ask about them early and keep revisiting them until they are explicit.194195### 2b) Ask the question196Use the surface-appropriate structured questioning path for every interview round. In attached-tmux sessions, use OMX-owned structured questioning via `omx question` (this is the required structured-question equivalent and required `AskUserQuestion` equivalent for deep-interview). Outside tmux, use native structured input when available; otherwise ask exactly one concise plain-text question and wait for the answer. Present:197198```199Round {n} | Target: {weakest_dimension} | Ambiguity: {score}%200201{question}202```203204`omx question` payload guidance for interview rounds:205- Deep-interview is Socratic: ask one focused round at a time. Do not use batch `questions[]` to combine multiple interview rounds, even though `omx question` supports batch forms for other workflows.206- Use canonical `type` values instead of authoring raw `multi_select` flags by hand. `type: "single-answerable"` is the default for one-path decisions; `type: "multi-answerable"` is the canonical shape for bounded multi-select rounds. The runtime will keep `multi_select` aligned with `type`.207- Use `single-answerable` when exactly one answer should drive the next branch, the options are mutually exclusive, or selecting more than one answer would blur the decision boundary. Typical cases: handoff lane selection, choosing the primary failure mode, or confirming which of several competing interpretations is correct.208- Use `multi-answerable` when multiple options may all be true at once and you need to capture a bounded set of coexisting constraints, non-goals, risks, or acceptance checks in one round. Typical cases: selecting all out-of-scope items, all success metrics that must hold, or all deployment constraints that apply together.209- If one selected option would immediately require a follow-up question to disambiguate the others, prefer a `single-answerable` round now and ask the follow-up next. Do not hide a branching interview tree inside one overloaded multi-select prompt.210- Keep interview options bounded and concrete. If the valid answers are already known, set `allow_other: false`; only leave `allow_other: true` when the interview genuinely needs one user-supplied option that cannot be enumerated in advance.211- Read answers structurally from the primary `answers[]` array. For a normal single-round interview response, use `answers[0].answer` as the source of truth; the top-level `answer` field is a legacy single-question projection/fallback only.212- For `single-answerable`, expect one decisive selection in the `value` field of `answers[0].answer` plus its selected-values metadata. For `multi-answerable`, treat the selected-values field inside `answers[0].answer` as the source of truth for all chosen constraints/non-goals and preserve the full set in the transcript/spec. In legacy single-question projections, this is equivalent to: For `multi-answerable`, treat `answer.selected_values` as the source of truth.213214Canonical bounded single-choice payload:215216```json217{218 "question": "Which execution lane should own this once the interview is complete?",219 "type": "single-answerable",220 "options": [221 {222 "label": "Plan first",223 "value": "ralplan",224 "description": "Need architecture and test-shape review before execution"225 },226 {227 "label": "Execute directly",228 "value": "autopilot",229 "description": "Requirements are already explicit enough for planning plus execution"230 },231 {232 "label": "Refine further",233 "value": "refine",234 "description": "Clarification is still needed before any handoff"235 }236 ],237 "allow_other": false,238 "other_label": "Other",239 "source": "deep-interview"240}241```242243Canonical bounded multi-select payload:244245```json246{247 "question": "Which non-goals must stay out of scope for the first pass?",248 "type": "multi-answerable",249 "options": [250 {251 "label": "No UI redesign",252 "value": "no-ui-redesign",253 "description": "Keep layout and styling unchanged"254 },255 {256 "label": "No new dependencies",257 "value": "no-new-dependencies",258 "description": "Work within the existing toolchain"259 },260 {261 "label": "No API contract changes",262 "value": "no-api-contract-changes",263 "description": "Preserve external request and response shapes"264 }265 ],266 "allow_other": false,267 "other_label": "Other",268 "source": "deep-interview"269}270```271272Canonical answer-shape reminders:273274```json275{276 "answer": {277 "kind": "option",278 "value": "ralplan",279 "selected_labels": ["Plan first"],280 "selected_values": ["ralplan"]281 }282}283```284285```json286{287 "answer": {288 "kind": "multi",289 "value": ["no-new-dependencies", "no-api-contract-changes"],290 "selected_labels": ["No new dependencies", "No API contract changes"],291 "selected_values": ["no-new-dependencies", "no-api-contract-changes"]292 }293}294```295296### 2c) Score ambiguity297Score each weighted dimension in `[0.0, 1.0]` with justification + gap.298299Greenfield: `ambiguity = 1 - (intent × 0.30 + outcome × 0.25 + scope × 0.20 + constraints × 0.15 + success × 0.10)`300301Brownfield: `ambiguity = 1 - (intent × 0.25 + outcome × 0.20 + scope × 0.20 + constraints × 0.15 + success × 0.10 + context × 0.10)`302303Readiness gate:304- `Non-goals` must be explicit305- `Decision Boundaries` must be explicit306- A pressure pass must be complete: at least one earlier answer has been revisited with an evidence, assumption, or tradeoff follow-up307- A practical closure audit must pass: another question would change execution materially, not merely polish wording or chase a narrow edge case308- If either gate is unresolved, or the pressure pass is incomplete, continue below threshold only with a final closure question that names the unresolved gate and would materially change execution.309- Treat a low ambiguity score as permission to audit closure, not permission to keep drilling indefinitely. If remaining uncertainty would not change implementation, crystallize the spec instead of opening a new branch.310- If ambiguity is `<= 0.10`, another user-facing question is allowed only as that final closure question; otherwise crystallize immediately.311312### 2d) Report progress313Show weighted breakdown table, readiness-gate status (`Non-goals`, `Decision Boundaries`), and the next focus dimension.314315### 2e) Persist state316Append round result and updated scores via `omx state write --input '<json>' --json`. Do not write `{mode}-state.json` directly and do not use the read-only MCP state projection as a writer.317318### 2f) Round controls319- Do not offer early exit before the first explicit assumption probe and one persistent follow-up have happened320- Apply a **Dialectic Rhythm Guard**: track consecutive non-user fact discoveries and confirmation-style answers (`[from-code][auto-confirmed]`, `[from-code]`, or `[from-research]`). After 3 consecutive non-user or confirmation answers, the next material user-facing round must solicit direct human judgment (`[from-user]`) unless the closure audit says the interview is ready to crystallize.321- Round 4+: allow explicit early exit with risk warning322- Soft warning at profile midpoint (e.g., round 3/6/10 depending on profile)323- Hard cap at profile `max_rounds`; never treat this cap as a desired interview length or quota324325## Phase 3: Challenge Modes (assumption stress tests)326327Use each mode once when applicable. These are normal escalation tools, not rare rescue moves:328329- **Contrarian** (round 2+ or immediately when an answer rests on an untested assumption): challenge core assumptions330- **Terminologist** (brownfield, whenever a key term is fuzzy, overloaded, or conflicts with repo docs/code): force a canonical meaning against existing project language before implementation331- **Simplifier** (round 4+ or when scope expands faster than outcome clarity): probe minimal viable scope332- **Ontologist** (round 5+ and ambiguity > 0.25, or when the user keeps describing symptoms): ask for essence-level reframing333334Track used modes in state to prevent repetition.335336## Phase 4: Crystallize Artifacts337338When threshold is met (or user exits with warning / hard cap):3393401. Write interview transcript summary to:341 - `.omx/interviews/{slug}-{timestamp}.md`342 (kept for ralph PRD compatibility)3432. Write execution-ready spec to:344 - `.omx/specs/deep-interview-{slug}.md`345346Spec should include:347- Metadata (profile, rounds, final ambiguity, threshold, context type)348- Context snapshot reference/path (for ralplan/team reuse)349- Prompt-safe initial-context summary when oversized context was provided, plus references to any full source documents350- Clarity breakdown table351- Intent (why the user wants this)352- Desired Outcome353- In-Scope354- Out-of-Scope / Non-goals355- Decision Boundaries (what OMX may decide without confirmation)356- Constraints357- Testable acceptance criteria358- Assumptions exposed + resolutions359- Pressure-pass findings (which answer was revisited, and what changed)360- Brownfield evidence vs inference notes for any repository-grounded confirmation questions361- Docs/Terminology Ledger with inspected repo docs/rules/context, term conflicts, and any doc/code mismatch decisions362- Scenario/edge-case pressure findings that materially shaped scope or acceptance criteria363- Optional durable documentation recommendations, explicitly marked opt-in and public-safe; do not include raw private transcript dumps364- Technical context findings365- Full or condensed transcript366367### Autoresearch specialization368369When the clarified task is specifically about `$autoresearch`, or the skill is invoked with `--autoresearch`, keep the interview domain-specific and emit skill-consumable artifacts without skipping clarification.370371- **Accepted seed inputs:** `topic`, `evaluator`, `keep-policy`, `slug`, existing mission draft text, and prior evaluator examples/templates372- **Required interview focus:** mission clarity, evaluator readiness, keep policy, slug/session naming, and whether the draft is ready to launch now or should refine further373- **Canonical artifact path:** `.omx/specs/deep-interview-autoresearch-{slug}.md`374- **Launch artifact bundle:** `.omx/specs/autoresearch-{slug}/mission.md`, `.omx/specs/autoresearch-{slug}/sandbox.md`, and `.omx/specs/autoresearch-{slug}/result.json`375- **Launch artifact directory:** `.omx/specs/autoresearch-{slug}/`376- **Required artifact sections:**377 - `Mission Draft`378 - `Evaluator Draft`379 - `Launch Readiness`380 - `Seed Inputs`381 - `Confirmation Bridge`382- **Required launch artifacts under `.omx/specs/autoresearch-{slug}/`:**383 - `mission.md`384 - `sandbox.md`385 - `result.json`386- **Launch-readiness rule:** mark the draft as **not launch-ready** while the evaluator command still contains placeholder markers such as `<...>`, `TODO`, `TBD`, `REPLACE_ME`, `CHANGEME`, or `your-command-here`387- **Structured result contract:** `result.json` should point to the draft + mission/sandbox artifacts and carry the finalized `topic`, `evaluatorCommand`, `keepPolicy`, `slug`, `launchReady`, and `blockedReasons` fields so `$autoresearch` can consume it directly388- **Confirmation bridge:** after artifact generation, offer at least `refine further` and `launch`; do not run direct CLI launch or detached/split tmux launch, and only hand off to `$autoresearch` after explicit confirmation389- **Handoff rule:** downstream execution must preserve the clarified mission intent, evaluator expectations, decision boundaries, and launch-readiness status from this artifact rather than bypassing the draft review step390391## Phase 5: Execution Bridge392393Present execution options after artifact generation using explicit handoff contracts. Treat the deep-interview spec as the current requirements source of truth and preserve intent, non-goals, decision boundaries, acceptance criteria, docs/terminology grounding, and any residual-risk warnings across the handoff.394395### Optional execution contract foundation396397When an Autopilot/deep-interview handoff explicitly requires a stride contract, emit it as structured data rather than prose. This is a validation foundation, not a broadness-inference feature: do not infer stride from task length, phase labels, snapshots, or freeform wording.398399Canonical location under Autopilot state:400401```json402{403 "handoff_artifacts": {404 "deep_interview": {405 "execution_contract_required": true,406 "execution_contract": {407 "version": 1,408 "execution_stride": "task",409 "source": "deep-interview",410 "selected_by": "user",411 "allow_task_shrink": true,412 "completion_unit": "One focused task",413 "stop_condition": "Stop after that task is implemented and verified",414 "acceptance_coverage_scope": "task",415 "shrink_policy": "allowed"416 }417 }418 }419}420```421422Stride meanings:423- `task`: conservative, small-step execution; `allow_task_shrink:true`, `acceptance_coverage_scope:"task"`, `shrink_policy:"allowed"`.424- `deliverable`: finish the named deliverable before stopping; `allow_task_shrink:false`, `acceptance_coverage_scope:"deliverable"`, `shrink_policy:"ask_before_shrink"`.425- `milestone`: finish the larger approved milestone unless blocked; `allow_task_shrink:false`, `acceptance_coverage_scope:"milestone"`, `shrink_policy:"deny_unless_blocked"`.426427Only set `execution_contract_required:true` when the selected downstream workflow needs this explicit stride/stop-condition guard. New artifacts must write the canonical snake_case schema shown above under `handoff_artifacts.deep_interview`; runtime readers may accept legacy camelCase field/marker aliases and direct/nested `execution_contract` locations only as compatibility input. If `execution_contract_required` is absent or false, downstream Autopilot compatibility behavior is unchanged.428429### Goal-mode follow-ups430431Include these product-facing suggestions when they fit the clarified spec, without removing the existing `$ultragoal`, `$ralplan`, `$autopilot`, `$ralph`, and `$team` handoff options:432433- **`$ultragoal`** — default goal-mode follow-up for implementation or general goal-oriented follow-up specs that should be converted into durable Codex/OMX goals with sequential completion tracking.434- **`$autoresearch-goal`** — use when the clarified context is a research project: a research question, reference/literature gathering, evaluator-backed analysis, or professor/critic-style deliverable.435- **`$performance-goal`** — use when the clarified context is an optimization or performance project with measurable speed, latency, throughput, memory, benchmark, or evaluator criteria.436437Recommend `$ultragoal` as the default durable goal-mode follow-up because it supersedes Ralph for goal tracking. Preserve `$team` for coordinated parallel implementation and keep `$ralph` only as an explicit fallback for persistent single-owner execution/verification when the user specifically selects it.438439### 1. **`$ultragoal` (Default durable execution follow-up)**440- **Input Artifact:** `.omx/specs/deep-interview-{slug}.md` (optionally accompanied by the transcript/context snapshot for traceability)441- **Invocation:** `$ultragoal create-goals --brief-file <spec-path>` followed by `$ultragoal complete-goals` in the active execution lane442- **Consumer Behavior:** Convert the clarified spec into durable goal-mode work. Preserve intent, non-goals, decision boundaries, acceptance criteria, docs/terminology grounding, scenario-pressure findings, and residual-risk warnings as binding story constraints.443- **Skipped / Already-Satisfied Stages:** Requirement interview, ambiguity clarification, doc/context preflight, and early intent-boundary elicitation444- **Expected Output:** `.omx/ultragoal/brief.md`, `.omx/ultragoal/goals.json`, `.omx/ultragoal/ledger.jsonl`, implementation evidence, verification evidence, and final cleanup/review-gate evidence445- **Best When:** The clarified spec is execution-ready or the user explicitly wants durable goal tracking as the next step446- **Next Recommended Step:** Run the Ultragoal completion loop; launch `$team` only inside an active Ultragoal story when parallel lanes are warranted, and use `$ralph` only as an explicit fallback when the user asks for that legacy persistence mode447448### 2. **`$ralplan` (Recommended when architecture/test-shape review is still needed)**449- **Input Artifact:** `.omx/specs/deep-interview-{slug}.md` (optionally accompanied by the transcript/context snapshot for traceability)450- **Invocation:** `$ralplan <spec-path>`451- **Consumer Behavior:** Treat the deep-interview spec as the requirements source of truth. Do not repeat the interview by default; refine architecture/feasibility around the clarified intent and boundaries instead.452- **Skipped / Already-Satisfied Stages:** Requirements discovery, ambiguity clarification, and early intent-boundary elicitation453- **Expected Output:** Canonical planning artifacts under `.omx/plans/`, especially `prd-*.md` and `test-spec-*.md`454- **Best When:** Requirements are clear enough to stop interviewing, but architectural validation / consensus planning is still desirable455- **Next Recommended Step:** Use the approved planning artifacts with `$ultragoal` as the default durable goal-mode follow-up (optionally with `$team` for parallel lanes); choose `$autoresearch-goal` for research validation or `$performance-goal` for measurable optimization, and use `$ralph` only as an explicit fallback when a narrow single-owner persistence loop is requested456457### 3. **`$autopilot`**458- **Input Artifact:** `.omx/specs/deep-interview-{slug}.md`459- **Invocation:** `$autopilot <spec-path>`460- **Consumer Behavior:** Use the deep-interview spec as the clarified execution brief. Preserve intent, non-goals, decision boundaries, and acceptance criteria as binding context for planning/execution.461- **Skipped / Already-Satisfied Stages:** Initial requirement discovery and ambiguity reduction462- **Expected Output:** Planning/execution progress, QA evidence, and validation artifacts produced by autopilot463- **Best When:** The clarified spec is already strong enough for direct planning + execution without an additional consensus gate464- **Next Recommended Step:** Continue through autopilot's execution/QA/validation flow; if coordination-heavy execution emerges, prefer `$team` under a leader-owned `$ultragoal` ledger, using `$ralph` only as an explicit fallback when a narrow single-owner persistence loop is requested465466### 4. **`$ralph` (Explicit fallback only)**467- **Input Artifact:** `.omx/specs/deep-interview-{slug}.md`468- **Invocation:** `$ralph <spec-path>`469- **Consumer Behavior:** Use the spec's acceptance criteria and boundary constraints as the persistence target. Do not reopen requirements discovery unless the user explicitly asks to refine further.470- **Skipped / Already-Satisfied Stages:** Requirement interview, ambiguity clarification, and initial scope-definition work471- **Expected Output:** Iterative execution progress and verification evidence tracked against the clarified criteria472- **Best When:** The user explicitly asks for Ralph's persistent sequential completion pressure; otherwise use `$ultragoal` for durable goal tracking and completion checkpoints473- **Next Recommended Step:** If this explicit fallback is selected, continue Ralph's persistence loop; if work expands into coordination-heavy lanes, hand off to `$team` under `$ultragoal` checkpointing rather than promoting Ralph as the next default474475### 5. **`$team`**476- **Input Artifact:** `.omx/specs/deep-interview-{slug}.md`477- **Invocation:** `$team <spec-path>`478- **Consumer Behavior:** Treat the spec as shared execution context for coordinated parallel work. Preserve the clarified intent, non-goals, decision boundaries, and acceptance criteria as common lane constraints.479- **Skipped / Already-Satisfied Stages:** Requirement clarification and early ambiguity reduction480- **Expected Output:** Coordinated multi-agent execution against the shared spec, with evidence that can later feed Ultragoal checkpoints by default, or an explicit Ralph verification pass only when requested481- **Best When:** The task is large, multi-lane, or blocker-sensitive enough to justify coordinated parallel execution instead of a single persistent loop482- **Next Recommended Step:** Follow the team verification path when the coordinated execution phase finishes; checkpoint completion through `$ultragoal` by default, escalating to a separate Ralph loop only when the user explicitly asks for that persistent verification/fix owner483484### 6. **Refine further**485- **Input Artifact:** Existing transcript, context snapshot, and current spec draft486- **Invocation:** Continue the interview loop487- **Consumer Behavior:** Re-enter questioning to resolve the highest-leverage remaining uncertainty488- **Skipped / Already-Satisfied Stages:** None beyond already-captured context489- **Expected Output:** A lower-ambiguity spec with tighter boundaries and fewer unresolved assumptions490- **Best When:** Residual ambiguity is still too high, the user wants stronger clarity, or the above-threshold / early-exit warning indicates too much risk to proceed cleanly491- **Next Recommended Step:** Return to one of the execution handoff contracts above once the spec is sufficiently clarified492493**Residual-Risk Rule:** If the interview ended via early exit, hard-cap completion, or above-threshold proceed-with-warning, explicitly preserve that residual-risk state in the handoff so the downstream skill knows it inherited a partially clarified brief.494495**IMPORTANT:** Deep-interview is a requirements mode. On handoff, invoke the selected skill using the contract above. **Do NOT implement directly** inside deep-interview.496497</Steps>498499<Tool_Usage>500- Use `explore` for codebase fact gathering501- Use `omx question` as the OMX-native structured user-input tool for each interview round when an attached tmux renderer is available502- From attached-tmux Bash/tool paths, call it as `OMX_QUESTION_RETURN_PANE=$TMUX_PANE omx question ...` unless an explicit `%pane` return target is already known503- If the current runtime is outside tmux and cannot render `omx question`, use native structured input when available; otherwise ask exactly one concise plain-text question and wait for the answer504- After `omx question` returns JSON, prefer `answers[0].answer` / `answers[]`; use legacy `answer` only as a fallback for older records505- Use `omx state write/read --input '<json>' --json` for resumable mode state through the sole-writer state operations path; the MCP state server is read-only and is not a fallback writer506- If the interview cannot ask a required `omx question` round, persist the blocker as terminal state with `active: false` and `current_phase: "blocked"`; do not write a terminal blocked phase with `active: true`507- Read/write context snapshots under `.omx/context/`508- Read applicable repo docs/rules/context during preflight; write durable docs, glossary, ADR, or memory updates only when the user explicitly opts in and the content is public-safe509- Record whether the oversized-context summary gate is not needed, pending, or satisfied before any scoring or handoff step510- Save transcript/spec artifacts under `.omx/interviews/` and `.omx/specs/`511</Tool_Usage>512513<Escalation_And_Stop_Conditions>514- User says stop/cancel/abort -> persist state and stop515- Ambiguity stalls for 3 rounds (+/- 0.05) -> force Ontologist mode once516- Max rounds reached -> proceed with explicit residual-risk warning517- All dimensions >= 0.9 -> allow early crystallization even before max rounds518</Escalation_And_Stop_Conditions>519520<Final_Checklist>521- [ ] Preflight context snapshot exists under `.omx/context/{slug}-{timestamp}.md`522- [ ] Oversized initial context, if present, has a prompt-safe summary recorded before ambiguity scoring or downstream handoff523- [ ] Ambiguity score shown each round524- [ ] Intent-first stage priority used before implementation detail525- [ ] Weakest-dimension targeting used with526527…(truncated)