Deep interview

From Yeachan-Heo/oh-my-codex · View interactive version

Deep interview is an AI agent skill from the GitHub repository Yeachan-Heo/oh-my-codex. Socratic deep interview with mathematical ambiguity gating before execution

How to use this skill

Skill file

<Purpose>

Deep 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.

</Purpose>

<Use_When>

</Use_When>

<Do_Not_Use_When>

</Do_Not_Use_When>

<Why_This_Exists>

Execution 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.

</Why_This_Exists>

<Depth_Profiles>

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.

<Mode_Flags>

</Mode_Flags>

</Depth_Profiles>

<Execution_Policy>

</Execution_Policy>

<Steps>

Phase 0: Preflight Context Intake

  1. Parse {{ARGUMENTS}} and derive a short task slug.
  2. Attempt to load the latest relevant context snapshot from .omx/context/{slug}-*.md.
  3. 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.
  4. If no snapshot exists, create a minimum context snapshot with:
  1. For brownfield tasks, inspect the applicable documentation/rule surface before the first user-facing round. Prefer exact, nearby sources over broad scans:
  1. Save snapshot to .omx/context/{slug}-{timestamp}.md (UTC YYYYMMDDTHHMMSSZ) and reference it in mode state.

Phase 1: Initialize

  1. Parse {{ARGUMENTS}} and depth profile (--quick|--standard|--deep).
  2. Detect project context:
  1. 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"
  }
}
  1. 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, or $team until that summary answer is captured.

Use:

Target the lowest-scoring dimension, but respect stage priority:

Follow-up pressure ladder after each answer:

  1. Ask for a concrete example, counterexample, or evidence signal behind the latest claim
  2. Probe the hidden assumption, dependency, or belief that makes the claim true
  3. Force a boundary or tradeoff: what would you explicitly not do, defer, or reject?
  4. Challenge fuzzy or conflicting terms against the repo's documented language and current code behavior
  5. Stress-test the boundary with one concrete scenario or edge case when a relationship or handoff remains ambiguous
  6. 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:

Detailed dimensions:

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:

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:

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

Phase 3: Challenge Modes (assumption stress tests)

Use each mode once when applicable. These are normal escalation tools, not rare rescue moves:

Track used modes in state to prevent repetition.

Phase 4: Crystallize Artifacts

When threshold is met (or user exits with warning / hard cap):

  1. Write interview transcript summary to:

(kept for ralph PRD compatibility)

  1. Write execution-ready spec to:

Spec should include:

Final-spec quality gates

Before declaring the final spec ready or entering Phase 5, inspect .omx-config.json qualityGates."deep-interview" with omx quality-gates list --stage deep-interview --json. Gate entries can be plain skill-name strings (blocking mode) or objects with explicit mode and optional model override: {"skill": "name", "mode": "blocking|advisory", "model": "claude-opus"}.

Spawn each configured gate skill as a separate subagent with the crystallized spec, context snapshot, and relevant interview evidence. Use its optional model override only for that gate, and await every result before progressing. Record the skill, mode, verdict, findings, and evidence in the spec/handoff receipt. Advisory findings or unavailable advisory reviews are recorded as residual risks without blocking handoff. A blocking gate that does not approve or cannot return evidence prevents final-spec readiness and downstream handoff: refine the spec, ask only the necessary clarification question, then re-run gates on the revised artifact. If the interview hard cap is reached with a blocking gate unresolved, persist a blocked outcome rather than bypassing the gate with a residual-risk warning. With no configured gates, retain the existing readiness checks and handoff behavior. Custom gates do not replace ambiguity, non-goals, or decision-boundary checks.

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.

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:

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, and $team handoff options:

Recommend $ultragoal as the default durable goal-mode follow-up because it supersedes Ralph for goal tracking. Preserve $team for coordinated parallel implementation.

1. **`$ultragoal` (Default durable execution follow-up)**

2. **`$ralplan` (Recommended when architecture/test-shape review is still needed)**

3. **`$autopilot`**

4. **`$team`**

5. **Refine further**

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.

</Steps>

<Tool_Usage>

</Tool_Usage>

<Escalation_And_Stop_Conditions>

</Escalation_And_Stop_Conditions>

<Final_Checklist>

</Final_Checklist>

<Advanced>

Suggested Config (optional)

Deep-interview reads runtime defaults from the first existing config source in this order:

  1. Repository-local .omx/config.toml
  2. Repository-root omx.toml
  3. User-global ~/.omx/config.toml

This section is currently a deep-interview-specific runtime override surface, not a general replacement for Codex config.toml or .omx-config.json model/env routing.

Malformed config files are ignored fail-soft so $deep-interview activation can continue with built-in defaults.

Explicit --quick, --standard, or --deep invocation flags override defaultProfile.

[omx.deepInterview]
defaultProfile = "standard"
quickThreshold = 0.30
standardThreshold = 0.20
deepThreshold = 0.15
quickMaxRounds = 5
standardMaxRounds = 12
deepMaxRounds = 20
enableChallengeModes = true

Resume

If interrupted, rerun $deep-interview. Resume from persisted mode state via omx state read --input '{"mode":"deep-interview"}' --json.

Canonical Autopilot Entry Pipeline

autopilot -> deep-interview -> ralplan -> ultragoal

Quality Gates

Custom quality gates can be configured for the deep-interview final-spec stage via .omx-config.json under qualityGates."deep-interview". Gate entries support both plain strings (blocking mode) and objects with explicit mode and optional model override. See Custom Quality Gates Configuration for complete details, mode behavior, and configuration examples.

</Advanced>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.