@ai-content-space/loopx 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/AGENTS.md +7 -8
  2. package/README.md +22 -10
  3. package/README.zh-CN.md +22 -10
  4. package/docs/loopx/design/loopx-skill-suite-v1-design.md +14 -7
  5. package/docs/loopx/plans/loopx-skill-suite-v1-implementation.md +7 -3
  6. package/package.json +3 -2
  7. package/plugins/loopx/.codex-plugin/plugin.json +1 -1
  8. package/plugins/loopx/skills/clarify/SKILL.md +4 -4
  9. package/plugins/loopx/skills/debug/SKILL.md +1 -1
  10. package/plugins/loopx/skills/exec/SKILL.md +1 -1
  11. package/plugins/loopx/skills/finish/SKILL.md +103 -8
  12. package/plugins/loopx/skills/fix-review/SKILL.md +1 -1
  13. package/plugins/loopx/skills/go-style/SKILL.md +2 -2
  14. package/plugins/loopx/skills/kratos/SKILL.md +1 -1
  15. package/plugins/loopx/skills/plan/SKILL.md +2 -2
  16. package/plugins/loopx/skills/refactor-plan/SKILL.md +1 -1
  17. package/plugins/loopx/skills/review/SKILL.md +1 -1
  18. package/plugins/loopx/skills/spec/DESIGN_SPEC_TEMPLATE.md +2 -2
  19. package/plugins/loopx/skills/spec/SKILL.md +2 -2
  20. package/plugins/loopx/skills/subagent-exec/SKILL.md +1 -1
  21. package/plugins/loopx/skills/tdd/SKILL.md +1 -1
  22. package/plugins/loopx/skills/verify/SKILL.md +1 -1
  23. package/scripts/verify-skills.mjs +2 -1
  24. package/skills/RESOLVER.md +0 -4
  25. package/skills/clarify/SKILL.md +4 -4
  26. package/skills/debug/SKILL.md +1 -1
  27. package/skills/exec/SKILL.md +1 -1
  28. package/skills/finish/SKILL.md +103 -8
  29. package/skills/fix-review/SKILL.md +1 -1
  30. package/skills/go-style/SKILL.md +2 -2
  31. package/skills/kratos/SKILL.md +1 -1
  32. package/skills/plan/SKILL.md +2 -2
  33. package/skills/refactor-plan/SKILL.md +1 -1
  34. package/skills/review/SKILL.md +1 -1
  35. package/skills/spec/DESIGN_SPEC_TEMPLATE.md +2 -2
  36. package/skills/spec/SKILL.md +2 -2
  37. package/skills/subagent-exec/SKILL.md +1 -1
  38. package/skills/tdd/SKILL.md +1 -1
  39. package/skills/verify/SKILL.md +1 -1
  40. package/src/cli.mjs +1 -2
  41. package/src/plan-runtime.mjs +0 -352
  42. package/src/workflow.mjs +5 -124
  43. package/plugins/loopx/scripts/plugin-install.test.mjs +0 -125
  44. package/skills/ai-slop-cleaner/SKILL.md +0 -114
  45. package/skills/autoresearch/SKILL.md +0 -68
  46. package/skills/deep-interview/SKILL.md +0 -461
  47. package/skills/ralph/SKILL.md +0 -271
  48. package/skills/ralplan/SKILL.md +0 -49
@@ -1,461 +0,0 @@
1
- ---
2
- name: deep-interview
3
- description: Socratic deep interview with mathematical ambiguity gating before execution
4
- argument-hint: "[--quick|--standard|--deep] [--autoresearch] <idea or vague description>"
5
- ---
6
-
7
- <Purpose>
8
- 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.
9
- </Purpose>
10
-
11
- <Use_When>
12
- - The request is broad, ambiguous, or missing concrete acceptance criteria
13
- - The user says "deep interview", "interview me", "ask me everything", "don't assume", or "ouroboros"
14
- - The user wants to avoid misaligned implementation from underspecified requirements
15
- - You need a requirements artifact before handing off to `ralplan`, `autopilot`, `ralph`, or `team`
16
- </Use_When>
17
-
18
- <Do_Not_Use_When>
19
- - The request already has concrete file/symbol targets and clear acceptance criteria
20
- - The user explicitly asks to skip planning/interview and execute immediately
21
- - The user asks for lightweight brainstorming only (use `plan` instead)
22
- - A complete PRD/plan already exists and execution should start
23
- </Do_Not_Use_When>
24
-
25
- <Why_This_Exists>
26
- 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.
27
- </Why_This_Exists>
28
-
29
- <Depth_Profiles>
30
- - **Quick (`--quick`)**: fast pre-PRD pass; target threshold `<= 0.30`; max rounds 5
31
- - **Standard (`--standard`, default)**: full requirement interview; target threshold `<= 0.20`; max rounds 12
32
- - **Deep (`--deep`)**: high-rigor exploration; target threshold `<= 0.15`; max rounds 20
33
- - **Autoresearch (`--autoresearch`)**: same interview rigor as Standard, but specialized for `$autoresearch` mission readiness and `.omx/specs/` artifact handoff
34
-
35
- If no flag is provided, use **Standard**.
36
-
37
- <Mode_Flags>
38
- - **`--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.
39
- </Mode_Flags>
40
- </Depth_Profiles>
41
-
42
- <Execution_Policy>
43
- - Ask ONE question per round (never batch)
44
- - Ask about intent and boundaries before implementation detail
45
- - Target the weakest clarity dimension each round after applying the stage-priority rules below
46
- - 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 symptom
47
- - 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 tighter
48
- - Before crystallizing, complete at least one explicit pressure pass that revisits an earlier answer with a deeper, assumption-focused, or tradeoff-focused follow-up
49
- - Gather codebase facts via `explore` before asking user about internals
50
- - When session guidance enables `USE_OMX_EXPLORE_CMD`, prefer `omx explore` for simple read-only brownfield fact gathering; keep prompts narrow and concrete, and keep ambiguous or non-shell-only investigation on the richer normal path and fall back normally if `omx explore` is unavailable.
51
- - Always run a preflight context intake before the first interview question
52
- - 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 first
53
- - The oversized initial-context summary gate is blocking: wait for the concise summary before ambiguity scoring, crystallizing artifacts, or any downstream execution handoff
54
- - 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 context
55
- - 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 question
56
- - Reduce user effort: ask only the highest-leverage unresolved question, and never ask the user for codebase facts that can be discovered directly
57
- - For brownfield work, prefer evidence-backed confirmation questions such as "I found X in Y. Should this change follow that pattern?"
58
- - In Codex CLI, deep-interview uses `omx question` as the required OMX-owned structured questioning path for every interview round
59
- - 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 off
60
- - If `omx question` is unavailable in the current runtime, treat that as a blocker/error for deep-interview rather than falling back to `request_user_input` or plain-text questioning
61
- - Re-score ambiguity after each answer and show progress transparently
62
- - Do not hand off to execution while ambiguity remains above threshold unless user explicitly opts to proceed with warning
63
- - Do not crystallize or hand off while `Non-goals` or `Decision Boundaries` remain unresolved, even if the weighted ambiguity threshold is met
64
- - Treat early exit as a safety valve, not the default success path
65
- - Persist mode state for resume safety (`state_write` / `state_read`)
66
- </Execution_Policy>
67
-
68
- <Steps>
69
-
70
- ## Phase 0: Preflight Context Intake
71
-
72
- 1. Parse `{{ARGUMENTS}}` and derive a short task slug.
73
- 2. Attempt to load the latest relevant context snapshot from `.omx/context/{slug}-*.md`.
74
- 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.
75
- 4. If no snapshot exists, create a minimum context snapshot with:
76
- - Task statement
77
- - Desired outcome
78
- - Stated solution (what the user asked for)
79
- - Probable intent hypothesis (why they likely want it)
80
- - Known facts/evidence
81
- - Constraints
82
- - Unknowns/open questions
83
- - Decision-boundary unknowns
84
- - Likely codebase touchpoints
85
- - Prompt-safe initial-context summary status (`not_needed`, `needed`, or `recorded`)
86
- 5. Save snapshot to `.omx/context/{slug}-{timestamp}.md` (UTC `YYYYMMDDTHHMMSSZ`) and reference it in mode state.
87
-
88
- ## Phase 1: Initialize
89
-
90
- 1. Parse `{{ARGUMENTS}}` and depth profile (`--quick|--standard|--deep`).
91
- 2. Detect project context:
92
- - Run `explore` to classify **brownfield** (existing codebase target) vs **greenfield**.
93
- - For brownfield, collect relevant codebase context before questioning.
94
- 3. Initialize state via `state_write(mode="deep-interview")`:
95
-
96
- ```json
97
- {
98
- "active": true,
99
- "current_phase": "deep-interview",
100
- "state": {
101
- "interview_id": "<uuid>",
102
- "profile": "quick|standard|deep",
103
- "type": "greenfield|brownfield",
104
- "initial_idea": "<user input>",
105
- "rounds": [],
106
- "current_ambiguity": 1.0,
107
- "threshold": 0.3,
108
- "max_rounds": 5,
109
- "challenge_modes_used": [],
110
- "codebase_context": null,
111
- "current_stage": "intent-first",
112
- "current_focus": "intent",
113
- "context_snapshot_path": ".omx/context/<slug>-<timestamp>.md"
114
- }
115
- }
116
- ```
117
-
118
- 4. Announce kickoff with profile, threshold, and current ambiguity.
119
-
120
- ## Phase 2: Socratic Interview Loop
121
-
122
- Repeat until ambiguity `<= threshold`, the pressure pass is complete, the readiness gates are explicit, the user exits with warning, or max rounds are reached.
123
-
124
- ### 2a) Generate next question
125
- 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 `$ralplan`, `$autopilot`, `$ralph`, or `$team` until that summary answer is captured.
126
-
127
- Use:
128
- - Original idea
129
- - Prior Q&A rounds
130
- - Current dimension scores
131
- - Brownfield context (if any)
132
- - Activated challenge mode injection (Phase 3)
133
-
134
- Target the lowest-scoring dimension, but respect stage priority:
135
- - **Stage 1 — Intent-first:** Intent, Outcome, Scope, Non-goals, Decision Boundaries
136
- - **Stage 2 — Feasibility:** Constraints, Success Criteria
137
- - **Stage 3 — Brownfield grounding:** Context Clarity (brownfield only)
138
-
139
- Follow-up pressure ladder after each answer:
140
- 1. Ask for a concrete example, counterexample, or evidence signal behind the latest claim
141
- 2. Probe the hidden assumption, dependency, or belief that makes the claim true
142
- 3. Force a boundary or tradeoff: what would you explicitly not do, defer, or reject?
143
- 4. If the answer still describes symptoms, reframe toward essence / root cause before moving on
144
-
145
- Prefer staying on the same thread for multiple rounds when it has the highest leverage. Breadth without pressure is not progress.
146
-
147
- Detailed dimensions:
148
- - Intent Clarity — why the user wants this
149
- - Outcome Clarity — what end state they want
150
- - Scope Clarity — how far the change should go
151
- - Constraint Clarity — technical or business limits that must hold
152
- - Success Criteria Clarity — how completion will be judged
153
- - Context Clarity — existing codebase understanding (brownfield only)
154
-
155
- `Non-goals` and `Decision Boundaries` are mandatory readiness gates. Ask about them early and keep revisiting them until they are explicit.
156
-
157
- ### 2b) Ask the question
158
- Use OMX-owned structured questioning via `omx question` for every interview round (this is the required `AskUserQuestion` equivalent for deep-interview) and present:
159
-
160
- ```
161
- Round {n} | Target: {weakest_dimension} | Ambiguity: {score}%
162
-
163
- {question}
164
- ```
165
-
166
- `omx question` payload guidance for interview rounds:
167
- - 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`.
168
- - 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.
169
- - 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.
170
- - 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.
171
- - 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.
172
- - Read answers structurally. For `single-answerable`, expect one decisive selection in `answer.value` plus `answer.selected_values`. For `multi-answerable`, treat `answer.selected_values` as the source of truth for all chosen constraints/non-goals and preserve the full set in the transcript/spec.
173
-
174
- Canonical bounded single-choice payload:
175
-
176
- ```json
177
- {
178
- "question": "Which execution lane should own this once the interview is complete?",
179
- "type": "single-answerable",
180
- "options": [
181
- {
182
- "label": "Plan first",
183
- "value": "ralplan",
184
- "description": "Need architecture and test-shape review before execution"
185
- },
186
- {
187
- "label": "Execute directly",
188
- "value": "autopilot",
189
- "description": "Requirements are already explicit enough for planning plus execution"
190
- },
191
- {
192
- "label": "Refine further",
193
- "value": "refine",
194
- "description": "Clarification is still needed before any handoff"
195
- }
196
- ],
197
- "allow_other": false,
198
- "other_label": "Other",
199
- "source": "deep-interview"
200
- }
201
- ```
202
-
203
- Canonical bounded multi-select payload:
204
-
205
- ```json
206
- {
207
- "question": "Which non-goals must stay out of scope for the first pass?",
208
- "type": "multi-answerable",
209
- "options": [
210
- {
211
- "label": "No UI redesign",
212
- "value": "no-ui-redesign",
213
- "description": "Keep layout and styling unchanged"
214
- },
215
- {
216
- "label": "No new dependencies",
217
- "value": "no-new-dependencies",
218
- "description": "Work within the existing toolchain"
219
- },
220
- {
221
- "label": "No API contract changes",
222
- "value": "no-api-contract-changes",
223
- "description": "Preserve external request and response shapes"
224
- }
225
- ],
226
- "allow_other": false,
227
- "other_label": "Other",
228
- "source": "deep-interview"
229
- }
230
- ```
231
-
232
- Canonical answer-shape reminders:
233
-
234
- ```json
235
- {
236
- "answer": {
237
- "kind": "option",
238
- "value": "ralplan",
239
- "selected_labels": ["Plan first"],
240
- "selected_values": ["ralplan"]
241
- }
242
- }
243
- ```
244
-
245
- ```json
246
- {
247
- "answer": {
248
- "kind": "multi",
249
- "value": ["no-new-dependencies", "no-api-contract-changes"],
250
- "selected_labels": ["No new dependencies", "No API contract changes"],
251
- "selected_values": ["no-new-dependencies", "no-api-contract-changes"]
252
- }
253
- }
254
- ```
255
-
256
- ### 2c) Score ambiguity
257
- Score each weighted dimension in `[0.0, 1.0]` with justification + gap.
258
-
259
- Greenfield: `ambiguity = 1 - (intent × 0.30 + outcome × 0.25 + scope × 0.20 + constraints × 0.15 + success × 0.10)`
260
-
261
- Brownfield: `ambiguity = 1 - (intent × 0.25 + outcome × 0.20 + scope × 0.20 + constraints × 0.15 + success × 0.10 + context × 0.10)`
262
-
263
- Readiness gate:
264
- - `Non-goals` must be explicit
265
- - `Decision Boundaries` must be explicit
266
- - A pressure pass must be complete: at least one earlier answer has been revisited with an evidence, assumption, or tradeoff follow-up
267
- - If either gate is unresolved, or the pressure pass is incomplete, continue interviewing even when weighted ambiguity is below threshold
268
-
269
- ### 2d) Report progress
270
- Show weighted breakdown table, readiness-gate status (`Non-goals`, `Decision Boundaries`), and the next focus dimension.
271
-
272
- ### 2e) Persist state
273
- Append round result and updated scores via `state_write`.
274
-
275
- ### 2f) Round controls
276
- - Do not offer early exit before the first explicit assumption probe and one persistent follow-up have happened
277
- - Round 4+: allow explicit early exit with risk warning
278
- - Soft warning at profile midpoint (e.g., round 3/6/10 depending on profile)
279
- - Hard cap at profile `max_rounds`
280
-
281
- ## Phase 3: Challenge Modes (assumption stress tests)
282
-
283
- Use each mode once when applicable. These are normal escalation tools, not rare rescue moves:
284
-
285
- - **Contrarian** (round 2+ or immediately when an answer rests on an untested assumption): challenge core assumptions
286
- - **Simplifier** (round 4+ or when scope expands faster than outcome clarity): probe minimal viable scope
287
- - **Ontologist** (round 5+ and ambiguity > 0.25, or when the user keeps describing symptoms): ask for essence-level reframing
288
-
289
- Track used modes in state to prevent repetition.
290
-
291
- ## Phase 4: Crystallize Artifacts
292
-
293
- When threshold is met (or user exits with warning / hard cap):
294
-
295
- 1. Write interview transcript summary to:
296
- - `.omx/interviews/{slug}-{timestamp}.md`
297
- (kept for ralph PRD compatibility)
298
- 2. Write execution-ready spec to:
299
- - `.omx/specs/deep-interview-{slug}.md`
300
-
301
- Spec should include:
302
- - Metadata (profile, rounds, final ambiguity, threshold, context type)
303
- - Context snapshot reference/path (for ralplan/team reuse)
304
- - Prompt-safe initial-context summary when oversized context was provided, plus references to any full source documents
305
- - Clarity breakdown table
306
- - Intent (why the user wants this)
307
- - Desired Outcome
308
- - In-Scope
309
- - Out-of-Scope / Non-goals
310
- - Decision Boundaries (what OMX may decide without confirmation)
311
- - Constraints
312
- - Testable acceptance criteria
313
- - Assumptions exposed + resolutions
314
- - Pressure-pass findings (which answer was revisited, and what changed)
315
- - Brownfield evidence vs inference notes for any repository-grounded confirmation questions
316
- - Technical context findings
317
- - Full or condensed transcript
318
-
319
- ### Autoresearch specialization
320
-
321
- 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.
322
-
323
- - **Accepted seed inputs:** `topic`, `evaluator`, `keep-policy`, `slug`, existing mission draft text, and prior evaluator examples/templates
324
- - **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
325
- - **Canonical artifact path:** `.omx/specs/deep-interview-autoresearch-{slug}.md`
326
- - **Launch artifact bundle:** `.omx/specs/autoresearch-{slug}/mission.md`, `.omx/specs/autoresearch-{slug}/sandbox.md`, and `.omx/specs/autoresearch-{slug}/result.json`
327
- - **Launch artifact directory:** `.omx/specs/autoresearch-{slug}/`
328
- - **Required artifact sections:**
329
- - `Mission Draft`
330
- - `Evaluator Draft`
331
- - `Launch Readiness`
332
- - `Seed Inputs`
333
- - `Confirmation Bridge`
334
- - **Required launch artifacts under `.omx/specs/autoresearch-{slug}/`:**
335
- - `mission.md`
336
- - `sandbox.md`
337
- - `result.json`
338
- - **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`
339
- - **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
340
- - **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
341
- - **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
342
-
343
- ## Phase 5: Execution Bridge
344
-
345
- 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, and any residual-risk warnings across the handoff.
346
-
347
- ### 1. **`$ralplan` (Recommended)**
348
- - **Input Artifact:** `.omx/specs/deep-interview-{slug}.md` (optionally accompanied by the transcript/context snapshot for traceability)
349
- - **Invocation:** `$plan --consensus --direct <spec-path>`
350
- - **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.
351
- - **Skipped / Already-Satisfied Stages:** Requirements discovery, ambiguity clarification, and early intent-boundary elicitation
352
- - **Expected Output:** Canonical planning artifacts under `.omx/plans/`, especially `prd-*.md` and `test-spec-*.md`
353
- - **Best When:** Requirements are clear enough to stop interviewing, but architectural validation / consensus planning is still desirable
354
- - **Next Recommended Step:** Use the approved planning artifacts with `$autopilot`, `$ralph`, or `$team` depending on the desired execution style
355
-
356
- ### 2. **`$autopilot`**
357
- - **Input Artifact:** `.omx/specs/deep-interview-{slug}.md`
358
- - **Invocation:** `$autopilot <spec-path>`
359
- - **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.
360
- - **Skipped / Already-Satisfied Stages:** Initial requirement discovery and ambiguity reduction
361
- - **Expected Output:** Planning/execution progress, QA evidence, and validation artifacts produced by autopilot
362
- - **Best When:** The clarified spec is already strong enough for direct planning + execution without an additional consensus gate
363
- - **Next Recommended Step:** Continue through autopilot's execution/QA/validation flow; if coordination-heavy execution emerges, prefer a follow-up `$team` or `$ralph` lane as appropriate
364
-
365
- ### 3. **`$ralph`**
366
- - **Input Artifact:** `.omx/specs/deep-interview-{slug}.md`
367
- - **Invocation:** `$ralph <spec-path>`
368
- - **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.
369
- - **Skipped / Already-Satisfied Stages:** Requirement interview, ambiguity clarification, and initial scope-definition work
370
- - **Expected Output:** Iterative execution progress and verification evidence tracked against the clarified criteria
371
- - **Best When:** The task benefits from persistent sequential completion pressure and the user wants execution to keep moving until the criteria are satisfied or a real blocker exists
372
- - **Next Recommended Step:** Continue Ralph's persistence loop; if work expands into coordination-heavy lanes, hand off to `$team` and keep Ralph for verification continuity
373
-
374
- ### 4. **`$team`**
375
- - **Input Artifact:** `.omx/specs/deep-interview-{slug}.md`
376
- - **Invocation:** `$team <spec-path>`
377
- - **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.
378
- - **Skipped / Already-Satisfied Stages:** Requirement clarification and early ambiguity reduction
379
- - **Expected Output:** Coordinated multi-agent execution against the shared spec, with evidence that can later feed a Ralph verification pass when appropriate
380
- - **Best When:** The task is large, multi-lane, or blocker-sensitive enough to justify coordinated parallel execution instead of a single persistent loop
381
- - **Next Recommended Step:** Follow the team verification path when the coordinated execution phase finishes; escalate to a separate Ralph loop only when a later persistent verification/fix owner is still needed
382
-
383
- ### 5. **Refine further**
384
- - **Input Artifact:** Existing transcript, context snapshot, and current spec draft
385
- - **Invocation:** Continue the interview loop
386
- - **Consumer Behavior:** Re-enter questioning to resolve the highest-leverage remaining uncertainty
387
- - **Skipped / Already-Satisfied Stages:** None beyond already-captured context
388
- - **Expected Output:** A lower-ambiguity spec with tighter boundaries and fewer unresolved assumptions
389
- - **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
390
- - **Next Recommended Step:** Return to one of the execution handoff contracts above once the spec is sufficiently clarified
391
-
392
- **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.
393
-
394
- **IMPORTANT:** Deep-interview is a requirements mode. On handoff, invoke the selected skill using the contract above. **Do NOT implement directly** inside deep-interview.
395
-
396
- </Steps>
397
-
398
- <Tool_Usage>
399
- - Use `explore` for codebase fact gathering
400
- - Use `omx question` as the OMX-native structured user-input tool for each interview round
401
- - If `omx question` is unavailable in the current runtime, stop and surface that deep-interview requires the OMX question tool rather than falling back to another questioning path
402
- - Use `state_write` / `state_read` for resumable mode state
403
- - Read/write context snapshots under `.omx/context/`
404
- - Record whether the oversized-context summary gate is not needed, pending, or satisfied before any scoring or handoff step
405
- - Save transcript/spec artifacts under `.omx/interviews/` and `.omx/specs/`
406
- </Tool_Usage>
407
-
408
- <Escalation_And_Stop_Conditions>
409
- - User says stop/cancel/abort -> persist state and stop
410
- - Ambiguity stalls for 3 rounds (+/- 0.05) -> force Ontologist mode once
411
- - Max rounds reached -> proceed with explicit residual-risk warning
412
- - All dimensions >= 0.9 -> allow early crystallization even before max rounds
413
- </Escalation_And_Stop_Conditions>
414
-
415
- <Final_Checklist>
416
- - [ ] Preflight context snapshot exists under `.omx/context/{slug}-{timestamp}.md`
417
- - [ ] Oversized initial context, if present, has a prompt-safe summary recorded before ambiguity scoring or downstream handoff
418
- - [ ] Ambiguity score shown each round
419
- - [ ] Intent-first stage priority used before implementation detail
420
- - [ ] Weakest-dimension targeting used within the active stage
421
- - [ ] At least one explicit assumption probe happened before crystallization
422
- - [ ] At least one persistent follow-up / pressure pass deepened a prior answer
423
- - [ ] Challenge modes triggered at thresholds (when applicable)
424
- - [ ] Transcript written to `.omx/interviews/{slug}-{timestamp}.md`
425
- - [ ] Spec written to `.omx/specs/deep-interview-{slug}.md`
426
- - [ ] Brownfield questions use evidence-backed confirmation when applicable
427
- - [ ] Handoff options provided (`$ralplan`, `$autopilot`, `$ralph`, `$team`)
428
- - [ ] No direct implementation performed in this mode
429
- </Final_Checklist>
430
-
431
- <Advanced>
432
- ## Suggested Config (optional)
433
-
434
- ```toml
435
- [omx.deepInterview]
436
- defaultProfile = "standard"
437
- quickThreshold = 0.30
438
- standardThreshold = 0.20
439
- deepThreshold = 0.15
440
- quickMaxRounds = 5
441
- standardMaxRounds = 12
442
- deepMaxRounds = 20
443
- enableChallengeModes = true
444
- ```
445
-
446
- ## Resume
447
-
448
- If interrupted, rerun `$deep-interview`. Resume from persisted mode state via `state_read(mode="deep-interview")`.
449
-
450
- ## Recommended 3-Stage Pipeline
451
-
452
- ```
453
- deep-interview -> ralplan -> autopilot
454
- ```
455
-
456
- - Stage 1 (deep-interview): clarity gate
457
- - Stage 2 (ralplan): feasibility + architecture gate
458
- - Stage 3 (autopilot): execution + QA + validation gate
459
- </Advanced>
460
-
461
- Task: {{ARGUMENTS}}