oh-my-codex 0.1.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 (182) hide show
  1. package/README.md +269 -0
  2. package/bin/omx.js +25 -0
  3. package/dist/agents/definitions.d.ts +22 -0
  4. package/dist/agents/definitions.d.ts.map +1 -0
  5. package/dist/agents/definitions.js +235 -0
  6. package/dist/agents/definitions.js.map +1 -0
  7. package/dist/cli/doctor.d.ts +11 -0
  8. package/dist/cli/doctor.d.ts.map +1 -0
  9. package/dist/cli/doctor.js +157 -0
  10. package/dist/cli/doctor.js.map +1 -0
  11. package/dist/cli/index.d.ts +6 -0
  12. package/dist/cli/index.d.ts.map +1 -0
  13. package/dist/cli/index.js +266 -0
  14. package/dist/cli/index.js.map +1 -0
  15. package/dist/cli/setup.d.ts +12 -0
  16. package/dist/cli/setup.d.ts.map +1 -0
  17. package/dist/cli/setup.js +175 -0
  18. package/dist/cli/setup.js.map +1 -0
  19. package/dist/cli/version.d.ts +2 -0
  20. package/dist/cli/version.d.ts.map +1 -0
  21. package/dist/cli/version.js +17 -0
  22. package/dist/cli/version.js.map +1 -0
  23. package/dist/config/generator.d.ts +14 -0
  24. package/dist/config/generator.d.ts.map +1 -0
  25. package/dist/config/generator.js +106 -0
  26. package/dist/config/generator.js.map +1 -0
  27. package/dist/hooks/__tests__/agents-overlay.test.d.ts +8 -0
  28. package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +1 -0
  29. package/dist/hooks/__tests__/agents-overlay.test.js +148 -0
  30. package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -0
  31. package/dist/hooks/agents-overlay.d.ts +34 -0
  32. package/dist/hooks/agents-overlay.d.ts.map +1 -0
  33. package/dist/hooks/agents-overlay.js +265 -0
  34. package/dist/hooks/agents-overlay.js.map +1 -0
  35. package/dist/hooks/emulator.d.ts +44 -0
  36. package/dist/hooks/emulator.d.ts.map +1 -0
  37. package/dist/hooks/emulator.js +108 -0
  38. package/dist/hooks/emulator.js.map +1 -0
  39. package/dist/hooks/keyword-detector.d.ts +27 -0
  40. package/dist/hooks/keyword-detector.d.ts.map +1 -0
  41. package/dist/hooks/keyword-detector.js +63 -0
  42. package/dist/hooks/keyword-detector.js.map +1 -0
  43. package/dist/hooks/session.d.ts +38 -0
  44. package/dist/hooks/session.d.ts.map +1 -0
  45. package/dist/hooks/session.js +135 -0
  46. package/dist/hooks/session.js.map +1 -0
  47. package/dist/hud/colors.d.ts +26 -0
  48. package/dist/hud/colors.d.ts.map +1 -0
  49. package/dist/hud/colors.js +71 -0
  50. package/dist/hud/colors.js.map +1 -0
  51. package/dist/hud/index.d.ts +12 -0
  52. package/dist/hud/index.d.ts.map +1 -0
  53. package/dist/hud/index.js +107 -0
  54. package/dist/hud/index.js.map +1 -0
  55. package/dist/hud/render.d.ts +9 -0
  56. package/dist/hud/render.d.ts.map +1 -0
  57. package/dist/hud/render.js +192 -0
  58. package/dist/hud/render.js.map +1 -0
  59. package/dist/hud/state.d.ts +21 -0
  60. package/dist/hud/state.d.ts.map +1 -0
  61. package/dist/hud/state.js +101 -0
  62. package/dist/hud/state.js.map +1 -0
  63. package/dist/hud/types.d.ts +87 -0
  64. package/dist/hud/types.d.ts.map +1 -0
  65. package/dist/hud/types.js +8 -0
  66. package/dist/hud/types.js.map +1 -0
  67. package/dist/index.d.ts +18 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +18 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/mcp/code-intel-server.d.ts +7 -0
  72. package/dist/mcp/code-intel-server.d.ts.map +1 -0
  73. package/dist/mcp/code-intel-server.js +567 -0
  74. package/dist/mcp/code-intel-server.js.map +1 -0
  75. package/dist/mcp/memory-server.d.ts +7 -0
  76. package/dist/mcp/memory-server.d.ts.map +1 -0
  77. package/dist/mcp/memory-server.js +359 -0
  78. package/dist/mcp/memory-server.js.map +1 -0
  79. package/dist/mcp/state-server.d.ts +7 -0
  80. package/dist/mcp/state-server.d.ts.map +1 -0
  81. package/dist/mcp/state-server.js +181 -0
  82. package/dist/mcp/state-server.js.map +1 -0
  83. package/dist/mcp/trace-server.d.ts +7 -0
  84. package/dist/mcp/trace-server.d.ts.map +1 -0
  85. package/dist/mcp/trace-server.js +205 -0
  86. package/dist/mcp/trace-server.js.map +1 -0
  87. package/dist/modes/base.d.ts +50 -0
  88. package/dist/modes/base.d.ts.map +1 -0
  89. package/dist/modes/base.js +140 -0
  90. package/dist/modes/base.js.map +1 -0
  91. package/dist/notifications/notifier.d.ts +30 -0
  92. package/dist/notifications/notifier.d.ts.map +1 -0
  93. package/dist/notifications/notifier.js +124 -0
  94. package/dist/notifications/notifier.js.map +1 -0
  95. package/dist/team/orchestrator.d.ts +54 -0
  96. package/dist/team/orchestrator.d.ts.map +1 -0
  97. package/dist/team/orchestrator.js +106 -0
  98. package/dist/team/orchestrator.js.map +1 -0
  99. package/dist/utils/package.d.ts +9 -0
  100. package/dist/utils/package.d.ts.map +1 -0
  101. package/dist/utils/package.js +31 -0
  102. package/dist/utils/package.js.map +1 -0
  103. package/dist/utils/paths.d.ts +27 -0
  104. package/dist/utils/paths.d.ts.map +1 -0
  105. package/dist/utils/paths.js +60 -0
  106. package/dist/utils/paths.js.map +1 -0
  107. package/dist/verification/verifier.d.ts +32 -0
  108. package/dist/verification/verifier.d.ts.map +1 -0
  109. package/dist/verification/verifier.js +81 -0
  110. package/dist/verification/verifier.js.map +1 -0
  111. package/package.json +54 -0
  112. package/prompts/analyst.md +110 -0
  113. package/prompts/api-reviewer.md +98 -0
  114. package/prompts/architect.md +109 -0
  115. package/prompts/build-fixer.md +89 -0
  116. package/prompts/code-reviewer.md +105 -0
  117. package/prompts/critic.md +87 -0
  118. package/prompts/debugger.md +93 -0
  119. package/prompts/deep-executor.md +112 -0
  120. package/prompts/dependency-expert.md +99 -0
  121. package/prompts/designer.md +103 -0
  122. package/prompts/executor.md +99 -0
  123. package/prompts/explore.md +112 -0
  124. package/prompts/git-master.md +92 -0
  125. package/prompts/information-architect.md +267 -0
  126. package/prompts/performance-reviewer.md +94 -0
  127. package/prompts/planner.md +116 -0
  128. package/prompts/product-analyst.md +299 -0
  129. package/prompts/product-manager.md +255 -0
  130. package/prompts/qa-tester.md +98 -0
  131. package/prompts/quality-reviewer.md +105 -0
  132. package/prompts/quality-strategist.md +227 -0
  133. package/prompts/researcher.md +96 -0
  134. package/prompts/scientist.md +92 -0
  135. package/prompts/security-reviewer.md +125 -0
  136. package/prompts/style-reviewer.md +87 -0
  137. package/prompts/test-engineer.md +103 -0
  138. package/prompts/ux-researcher.md +282 -0
  139. package/prompts/verifier.md +95 -0
  140. package/prompts/vision.md +75 -0
  141. package/prompts/writer.md +86 -0
  142. package/scripts/notify-hook.js +237 -0
  143. package/skills/analyze/SKILL.md +93 -0
  144. package/skills/autopilot/SKILL.md +175 -0
  145. package/skills/build-fix/SKILL.md +123 -0
  146. package/skills/cancel/SKILL.md +387 -0
  147. package/skills/code-review/SKILL.md +208 -0
  148. package/skills/configure-discord/SKILL.md +256 -0
  149. package/skills/configure-telegram/SKILL.md +232 -0
  150. package/skills/deepinit/SKILL.md +320 -0
  151. package/skills/deepsearch/SKILL.md +38 -0
  152. package/skills/doctor/SKILL.md +193 -0
  153. package/skills/ecomode/SKILL.md +114 -0
  154. package/skills/frontend-ui-ux/SKILL.md +34 -0
  155. package/skills/git-master/SKILL.md +29 -0
  156. package/skills/help/SKILL.md +192 -0
  157. package/skills/hud/SKILL.md +97 -0
  158. package/skills/learn-about-omx/SKILL.md +37 -0
  159. package/skills/learner/SKILL.md +135 -0
  160. package/skills/note/SKILL.md +62 -0
  161. package/skills/omx-setup/SKILL.md +1147 -0
  162. package/skills/pipeline/SKILL.md +407 -0
  163. package/skills/plan/SKILL.md +223 -0
  164. package/skills/project-session-manager/SKILL.md +560 -0
  165. package/skills/psm/SKILL.md +20 -0
  166. package/skills/ralph/SKILL.md +197 -0
  167. package/skills/ralph-init/SKILL.md +38 -0
  168. package/skills/ralplan/SKILL.md +34 -0
  169. package/skills/release/SKILL.md +83 -0
  170. package/skills/research/SKILL.md +510 -0
  171. package/skills/review/SKILL.md +30 -0
  172. package/skills/security-review/SKILL.md +284 -0
  173. package/skills/skill/SKILL.md +837 -0
  174. package/skills/swarm/SKILL.md +25 -0
  175. package/skills/tdd/SKILL.md +106 -0
  176. package/skills/team/SKILL.md +860 -0
  177. package/skills/trace/SKILL.md +33 -0
  178. package/skills/ultrapilot/SKILL.md +632 -0
  179. package/skills/ultraqa/SKILL.md +130 -0
  180. package/skills/ultrawork/SKILL.md +143 -0
  181. package/skills/writer-memory/SKILL.md +443 -0
  182. package/templates/AGENTS.md +326 -0
@@ -0,0 +1,407 @@
1
+ ---
2
+ name: pipeline
3
+ description: Chain agents together in sequential or branching workflows with data passing
4
+ ---
5
+
6
+ # Pipeline Skill
7
+
8
+ ## Overview
9
+
10
+ The pipeline skill enables chaining multiple agents together in defined workflows where the output of one agent becomes the input to the next. This creates powerful agent pipelines similar to Unix pipes but designed for AI agent orchestration.
11
+
12
+ ## Core Concepts
13
+
14
+ ### 1. Sequential Pipelines
15
+
16
+ The simplest form: Agent A's output flows to Agent B, which flows to Agent C.
17
+
18
+ ```
19
+ explore -> architect -> executor
20
+ ```
21
+
22
+ **Flow:**
23
+ 1. Explore agent searches codebase and produces findings
24
+ 2. Architect receives findings and produces analysis/recommendations
25
+ 3. Executor receives recommendations and implements changes
26
+
27
+ ### 2. Branching Pipelines
28
+
29
+ Route to different agents based on output conditions.
30
+
31
+ ```
32
+ explore -> {
33
+ if "complex refactoring" -> architect -> executor-high
34
+ if "simple change" -> executor-low
35
+ if "UI work" -> designer -> executor
36
+ }
37
+ ```
38
+
39
+ ### 3. Parallel-Then-Merge Pipelines
40
+
41
+ Run multiple agents in parallel, merge their outputs.
42
+
43
+ ```
44
+ parallel(explore, researcher) -> architect -> executor
45
+ ```
46
+
47
+ ## Built-in Pipeline Presets
48
+
49
+ ### Review Pipeline
50
+ **Purpose:** Comprehensive code review and implementation
51
+
52
+ ```
53
+ /pipeline review <task>
54
+ ```
55
+
56
+ **Stages:**
57
+ 1. `explore` - Find relevant code and patterns
58
+ 2. `architect` - Analyze architecture and design implications
59
+ 3. `critic` - Review and critique the analysis
60
+ 4. `executor` - Implement with full context
61
+
62
+ **Use for:** Major features, refactorings, complex changes
63
+
64
+ ---
65
+
66
+ ### Implement Pipeline
67
+ **Purpose:** Planned implementation with testing
68
+
69
+ ```
70
+ /pipeline implement <task>
71
+ ```
72
+
73
+ **Stages:**
74
+ 1. `planner` - Create detailed implementation plan
75
+ 2. `executor` - Implement the plan
76
+ 3. `tdd-guide` - Add/verify tests
77
+
78
+ **Use for:** New features with clear requirements
79
+
80
+ ---
81
+
82
+ ### Debug Pipeline
83
+ **Purpose:** Systematic debugging workflow
84
+
85
+ ```
86
+ /pipeline debug <issue>
87
+ ```
88
+
89
+ **Stages:**
90
+ 1. `explore` - Locate error locations and related code
91
+ 2. `architect` - Analyze root cause
92
+ 3. `build-fixer` - Apply fixes and verify
93
+
94
+ **Use for:** Bugs, build errors, test failures
95
+
96
+ ---
97
+
98
+ ### Research Pipeline
99
+ **Purpose:** External research + internal analysis
100
+
101
+ ```
102
+ /pipeline research <topic>
103
+ ```
104
+
105
+ **Stages:**
106
+ 1. `parallel(researcher, explore)` - External docs + internal code
107
+ 2. `architect` - Synthesize findings
108
+ 3. `writer` - Document recommendations
109
+
110
+ **Use for:** Technology decisions, API integrations
111
+
112
+ ---
113
+
114
+ ### Refactor Pipeline
115
+ **Purpose:** Safe, verified refactoring
116
+
117
+ ```
118
+ /pipeline refactor <target>
119
+ ```
120
+
121
+ **Stages:**
122
+ 1. `explore` - Find all usages and dependencies
123
+ 2. `architect-medium` - Design refactoring strategy
124
+ 3. `executor-high` - Execute refactoring
125
+ 4. `qa-tester` - Verify no regressions
126
+
127
+ **Use for:** Architectural changes, API redesigns
128
+
129
+ ---
130
+
131
+ ### Security Pipeline
132
+ **Purpose:** Security audit and fixes
133
+
134
+ ```
135
+ /pipeline security <scope>
136
+ ```
137
+
138
+ **Stages:**
139
+ 1. `explore` - Find potential vulnerabilities
140
+ 2. `security-reviewer` - Audit and identify issues
141
+ 3. `executor` - Implement fixes
142
+ 4. `security-reviewer-low` - Re-verify
143
+
144
+ **Use for:** Security reviews, vulnerability fixes
145
+
146
+ ---
147
+
148
+ ## Custom Pipeline Syntax
149
+
150
+ ### Basic Sequential
151
+
152
+ ```
153
+ /pipeline agent1 -> agent2 -> agent3 "task description"
154
+ ```
155
+
156
+ **Example:**
157
+ ```
158
+ /pipeline explore -> architect -> executor "add authentication"
159
+ ```
160
+
161
+ ### With Model Specification
162
+
163
+ ```
164
+ /pipeline explore:haiku -> architect:opus -> executor:sonnet "optimize performance"
165
+ ```
166
+
167
+ ### With Branching
168
+
169
+ ```
170
+ /pipeline explore -> (
171
+ complexity:high -> architect:opus -> executor-high:opus
172
+ complexity:medium -> executor:sonnet
173
+ complexity:low -> executor-low:haiku
174
+ ) "fix reported issues"
175
+ ```
176
+
177
+ ### With Parallel Stages
178
+
179
+ ```
180
+ /pipeline [explore, researcher] -> architect -> executor "implement OAuth"
181
+ ```
182
+
183
+ ## Data Passing Protocol
184
+
185
+ Each agent in the pipeline receives structured context from the previous stage:
186
+
187
+ ```json
188
+ {
189
+ "pipeline_context": {
190
+ "original_task": "user's original request",
191
+ "previous_stages": [
192
+ {
193
+ "agent": "explore",
194
+ "model": "haiku",
195
+ "findings": "...",
196
+ "files_identified": ["src/auth.ts", "src/user.ts"]
197
+ }
198
+ ],
199
+ "current_stage": "architect",
200
+ "next_stage": "executor"
201
+ },
202
+ "task": "specific task for this agent"
203
+ }
204
+ ```
205
+
206
+ ## Error Handling
207
+
208
+ ### Retry Logic
209
+
210
+ When an agent fails, the pipeline can:
211
+
212
+ 1. **Retry** - Re-run the same agent (up to 3 times)
213
+ 2. **Skip** - Continue to next stage with partial output
214
+ 3. **Abort** - Stop entire pipeline
215
+ 4. **Fallback** - Route to alternative agent
216
+
217
+ **Configuration:**
218
+
219
+ ```
220
+ /pipeline explore -> architect -> executor --retry=3 --on-error=abort
221
+ ```
222
+
223
+ ### Error Recovery Patterns
224
+
225
+ **Pattern 1: Fallback to Higher Tier**
226
+ ```
227
+ executor-low -> on-error -> executor:sonnet
228
+ ```
229
+
230
+ **Pattern 2: Consult Architect**
231
+ ```
232
+ executor -> on-error -> architect -> executor
233
+ ```
234
+
235
+ **Pattern 3: Human-in-the-Loop**
236
+ ```
237
+ any-stage -> on-error -> pause-for-user-input
238
+ ```
239
+
240
+ ## Pipeline State Management
241
+
242
+ Use `omx_state` MCP tools for pipeline lifecycle state.
243
+
244
+ - **On start**:
245
+ `state_write({mode: "pipeline", active: true, current_phase: "plan", started_at: "<now>"})`
246
+ - **On phase transitions**:
247
+ `state_write({mode: "pipeline", current_phase: "execute"})`
248
+ `state_write({mode: "pipeline", current_phase: "verify"})`
249
+ `state_write({mode: "pipeline", current_phase: "fix"})`
250
+ - **On completion**:
251
+ `state_write({mode: "pipeline", active: false, current_phase: "complete", completed_at: "<now>"})`
252
+ - **For resume detection**:
253
+ `state_read({mode: "pipeline"})`
254
+
255
+ ## Verification Rules
256
+
257
+ Before pipeline completion, verify:
258
+
259
+ - [ ] All stages completed successfully
260
+ - [ ] Output from final stage addresses original task
261
+ - [ ] No unhandled errors in any stage
262
+ - [ ] All files modified pass lsp_diagnostics
263
+ - [ ] Tests pass (if applicable)
264
+
265
+ ## Advanced Features
266
+
267
+ ### Conditional Branching
268
+
269
+ Based on agent output, route to different paths:
270
+
271
+ ```
272
+ explore -> {
273
+ if files_found > 5 -> architect:opus -> executor-high:opus
274
+ if files_found <= 5 -> executor:sonnet
275
+ }
276
+ ```
277
+
278
+ ### Loop Constructs
279
+
280
+ Repeat stages until condition met:
281
+
282
+ ```
283
+ repeat_until(tests_pass) {
284
+ executor -> qa-tester
285
+ }
286
+ ```
287
+
288
+ ### Merge Strategies
289
+
290
+ When parallel agents complete:
291
+
292
+ - **concat**: Concatenate all outputs
293
+ - **summarize**: Use architect to summarize findings
294
+ - **vote**: Use critic to choose best output
295
+
296
+ ## Usage Examples
297
+
298
+ ### Example 1: Feature Implementation
299
+ ```
300
+ /pipeline review "add rate limiting to API"
301
+ ```
302
+ → Triggers: explore → architect → critic → executor
303
+
304
+ ### Example 2: Bug Fix
305
+ ```
306
+ /pipeline debug "login fails with OAuth"
307
+ ```
308
+ → Triggers: explore → architect → build-fixer
309
+
310
+ ### Example 3: Custom Chain
311
+ ```
312
+ /pipeline explore:haiku -> architect:opus -> executor:sonnet -> tdd-guide:sonnet "refactor auth module"
313
+ ```
314
+
315
+ ### Example 4: Research-Driven Implementation
316
+ ```
317
+ /pipeline research "implement GraphQL subscriptions"
318
+ ```
319
+ → Triggers: parallel(researcher, explore) → architect → writer
320
+
321
+ ## Cancellation
322
+
323
+ Stop active pipeline:
324
+
325
+ ```
326
+ /pipeline cancel
327
+ ```
328
+
329
+ Or use the general cancel command which detects active pipeline.
330
+
331
+ ## Integration with Other Skills
332
+
333
+ Pipelines can be used within other skills:
334
+
335
+ - **Ralph**: Loop pipelines until verified complete
336
+ - **Ultrawork**: Run multiple pipelines in parallel
337
+ - **Autopilot**: Use pipelines as building blocks
338
+
339
+ ## Best Practices
340
+
341
+ 1. **Start with presets** - Use built-in pipelines before creating custom ones
342
+ 2. **Match model to complexity** - Don't waste opus on simple tasks
343
+ 3. **Keep stages focused** - Each agent should have one clear responsibility
344
+ 4. **Use parallel stages** - Run independent work simultaneously
345
+ 5. **Verify at checkpoints** - Use architect or critic to verify progress
346
+ 6. **Document custom pipelines** - Save successful patterns for reuse
347
+
348
+ ## Troubleshooting
349
+
350
+ ### Pipeline Hangs
351
+
352
+ **Check:** `state_read({mode: "pipeline"})` for current stage
353
+ **Fix:** Resume with `/pipeline resume` or cancel and restart
354
+
355
+ ### Agent Fails Repeatedly
356
+
357
+ **Check:** Retry count and error messages
358
+ **Fix:** Route to higher-tier agent or add architect consultation
359
+
360
+ ### Output Not Flowing
361
+
362
+ **Check:** Data passing structure in agent prompts
363
+ **Fix:** Ensure each agent is prompted with `pipeline_context`
364
+
365
+ ## Technical Implementation
366
+
367
+ The pipeline orchestrator:
368
+
369
+ 1. **Parses pipeline definition** - Validates syntax and agent names
370
+ 2. **Initializes state** - Calls `state_write({mode: "pipeline", active: true, ...})`
371
+ 3. **Executes stages sequentially** - Spawns agents with sub-agent spawning
372
+ 4. **Passes context between stages** - Structures output for next agent
373
+ 5. **Handles branching logic** - Evaluates conditions and routes
374
+ 6. **Manages parallel execution** - Spawns concurrent agents and merges
375
+ 7. **Persists state** - Calls `state_write` after each stage
376
+ 8. **Enforces verification** - Runs checks before completion
377
+
378
+ ## STATE CLEANUP ON COMPLETION
379
+
380
+ **IMPORTANT: Use OMX MCP cleanup on completion**
381
+
382
+ When pipeline completes (all stages done or cancelled):
383
+
384
+ ```text
385
+ state_clear({mode: "pipeline"})
386
+ ```
387
+
388
+ This ensures clean state for future sessions without direct file deletion.
389
+
390
+ ## Skill Invocation
391
+
392
+ This skill activates when:
393
+
394
+ - User types `/pipeline` command
395
+ - User mentions "agent chain", "workflow", "pipe agents"
396
+ - Pattern detected: "X then Y then Z" with agent names
397
+
398
+ **Explicit invocation:**
399
+ ```
400
+ /pipeline review "task"
401
+ ```
402
+
403
+ **Auto-detection:**
404
+ ```
405
+ "First explore the codebase, then architect should analyze it, then executor implements"
406
+ ```
407
+ → Automatically creates pipeline: explore → architect → executor
@@ -0,0 +1,223 @@
1
+ ---
2
+ name: plan
3
+ description: Strategic planning with optional interview workflow
4
+ ---
5
+
6
+ <Purpose>
7
+ Plan creates comprehensive, actionable work plans through intelligent interaction. It auto-detects whether to interview the user (broad requests) or plan directly (detailed requests), and supports consensus mode (iterative Planner/Architect/Critic loop) and review mode (Critic evaluation of existing plans).
8
+ </Purpose>
9
+
10
+ <Use_When>
11
+ - User wants to plan before implementing -- "plan this", "plan the", "let's plan"
12
+ - User wants structured requirements gathering for a vague idea
13
+ - User wants an existing plan reviewed -- "review this plan", `--review`
14
+ - User wants multi-perspective consensus on a plan -- `--consensus`, "ralplan"
15
+ - Task is broad or vague and needs scoping before any code is written
16
+ </Use_When>
17
+
18
+ <Do_Not_Use_When>
19
+ - User wants autonomous end-to-end execution -- use `autopilot` instead
20
+ - User wants to start coding immediately with a clear task -- use `ralph` or delegate to executor
21
+ - User asks a simple question that can be answered directly -- just answer it
22
+ - Task is a single focused fix with obvious scope -- skip planning, just do it
23
+ </Do_Not_Use_When>
24
+
25
+ <Why_This_Exists>
26
+ Jumping into code without understanding requirements leads to rework, scope creep, and missed edge cases. Plan provides structured requirements gathering, expert analysis, and quality-gated plans so that execution starts from a solid foundation. The consensus mode adds multi-perspective validation for high-stakes projects.
27
+ </Why_This_Exists>
28
+
29
+ <Execution_Policy>
30
+ - Auto-detect interview vs direct mode based on request specificity
31
+ - Ask one question at a time during interviews -- never batch multiple questions
32
+ - Gather codebase facts via `explore` agent before asking the user about them
33
+ - Plans must meet quality standards: 80%+ claims cite file/line, 90%+ criteria are testable
34
+ - Consensus mode requires explicit user approval before proceeding to implementation
35
+ </Execution_Policy>
36
+
37
+ <Steps>
38
+
39
+ ### Mode Selection
40
+
41
+ | Mode | Trigger | Behavior |
42
+ |------|---------|----------|
43
+ | Interview | Default for broad requests | Interactive requirements gathering |
44
+ | Direct | `--direct`, or detailed request | Skip interview, generate plan directly |
45
+ | Consensus | `--consensus`, "ralplan" | Planner -> Architect -> Critic loop until agreement |
46
+ | Review | `--review`, "review this plan" | Critic evaluation of existing plan |
47
+
48
+ ### Interview Mode (broad/vague requests)
49
+
50
+ 1. **Classify the request**: Broad (vague verbs, no specific files, touches 3+ areas) triggers interview mode
51
+ 2. **Ask one focused question** using `AskUserQuestion` for preferences, scope, and constraints
52
+ 3. **Gather codebase facts first**: Before asking "what patterns does your code use?", spawn an `explore` agent to find out, then ask informed follow-up questions
53
+ 4. **Build on answers**: Each question builds on the previous answer
54
+ 5. **Consult Analyst** (Opus) for hidden requirements, edge cases, and risks
55
+ 6. **Create plan** when the user signals readiness: "create the plan", "I'm ready", "make it a work plan"
56
+
57
+ ### Direct Mode (detailed requests)
58
+
59
+ 1. **Quick Analysis**: Optional brief Analyst consultation
60
+ 2. **Create plan**: Generate comprehensive work plan immediately
61
+ 3. **Review** (optional): Critic review if requested
62
+
63
+ ### Consensus Mode (`--consensus` / "ralplan")
64
+
65
+ 1. **Planner** creates initial plan
66
+ 2. **User feedback**: **MUST** use `AskUserQuestion` to present the draft plan with these options:
67
+ - **Proceed to review** — send to Architect and Critic for evaluation
68
+ - **Request changes** — return to step 1 with user feedback incorporated
69
+ - **Skip review** — go directly to final approval (step 6)
70
+ 3. **Architect** reviews for architectural soundness (prefer `ask_codex` with `architect` role)
71
+ 4. **Critic** evaluates against quality criteria (prefer `ask_codex` with `critic` role)
72
+ 5. If Critic rejects: iterate with feedback (max 5 iterations)
73
+ 6. On Critic approval: **MUST** use `AskUserQuestion` to present the plan with these options:
74
+ - **Approve and execute** — proceed to implementation via ralph+ultrawork
75
+ - **Request changes** — return to step 1 with user feedback
76
+ - **Reject** — discard the plan entirely
77
+ 7. User chooses via the structured `AskUserQuestion` UI (never ask for approval in plain text)
78
+ 8. On user approval: **MUST** invoke `/ralph` with the approved plan path from `.omx/plans/` as context. Do NOT implement directly. Do NOT edit source code files in the planning agent. The ralph skill handles execution via ultrawork parallel agents.
79
+
80
+ ### Review Mode (`--review`)
81
+
82
+ 1. Read plan file from `.omx/plans/`
83
+ 2. Evaluate via Critic (prefer `ask_codex` with `critic` role)
84
+ 3. Return verdict: APPROVED, REVISE (with specific feedback), or REJECT (replanning required)
85
+
86
+ ### Plan Output Format
87
+
88
+ Every plan includes:
89
+ - Requirements Summary
90
+ - Acceptance Criteria (testable)
91
+ - Implementation Steps (with file references)
92
+ - Risks and Mitigations
93
+ - Verification Steps
94
+
95
+ Plans are saved to `.omx/plans/`. Drafts go to `.omx/drafts/`.
96
+ </Steps>
97
+
98
+ <Tool_Usage>
99
+ - Before first MCP tool use, call `ToolSearch("mcp")` to discover deferred MCP tools
100
+ - Use `AskUserQuestion` for preference questions (scope, priority, timeline, risk tolerance) -- provides clickable UI
101
+ - Use plain text for questions needing specific values (port numbers, names, follow-up clarifications)
102
+ - Use `explore` agent (Haiku, 30s timeout) to gather codebase facts before asking the user
103
+ - Use `ask_codex` with `agent_role: "planner"` for planning validation on large-scope plans
104
+ - Use `ask_codex` with `agent_role: "analyst"` for requirements analysis
105
+ - Use `ask_codex` with `agent_role: "critic"` for plan review in consensus and review modes
106
+ - If ToolSearch finds no MCP tools or Codex is unavailable, fall back to equivalent Claude agents -- never block on external tools
107
+ - In consensus mode, **MUST** use `AskUserQuestion` for the user feedback step (step 2) and the final approval step (step 6) -- never ask for approval in plain text
108
+ - In consensus mode, on user approval **MUST** invoke `/ralph` for execution (step 8) -- never implement directly in the planning agent
109
+ </Tool_Usage>
110
+
111
+ <Examples>
112
+ <Good>
113
+ Adaptive interview (gathering facts before asking):
114
+ ```
115
+ Planner: [spawns explore agent: "find authentication implementation"]
116
+ Planner: [receives: "Auth is in src/auth/ using JWT with passport.js"]
117
+ Planner: "I see you're using JWT authentication with passport.js in src/auth/.
118
+ For this new feature, should we extend the existing auth or add a separate auth flow?"
119
+ ```
120
+ Why good: Answers its own codebase question first, then asks an informed preference question.
121
+ </Good>
122
+
123
+ <Good>
124
+ Single question at a time:
125
+ ```
126
+ Q1: "What's the main goal?"
127
+ A1: "Improve performance"
128
+ Q2: "For performance, what matters more -- latency or throughput?"
129
+ A2: "Latency"
130
+ Q3: "For latency, are we optimizing for p50 or p99?"
131
+ ```
132
+ Why good: Each question builds on the previous answer. Focused and progressive.
133
+ </Good>
134
+
135
+ <Bad>
136
+ Asking about things you could look up:
137
+ ```
138
+ Planner: "Where is authentication implemented in your codebase?"
139
+ User: "Uh, somewhere in src/auth I think?"
140
+ ```
141
+ Why bad: The planner should spawn an explore agent to find this, not ask the user.
142
+ </Bad>
143
+
144
+ <Bad>
145
+ Batching multiple questions:
146
+ ```
147
+ "What's the scope? And the timeline? And who's the audience?"
148
+ ```
149
+ Why bad: Three questions at once causes shallow answers. Ask one at a time.
150
+ </Bad>
151
+
152
+ <Bad>
153
+ Presenting all design options at once:
154
+ ```
155
+ "Here are 4 approaches: Option A... Option B... Option C... Option D... Which do you prefer?"
156
+ ```
157
+ Why bad: Decision fatigue. Present one option with trade-offs, get reaction, then present the next.
158
+ </Bad>
159
+ </Examples>
160
+
161
+ <Escalation_And_Stop_Conditions>
162
+ - Stop interviewing when requirements are clear enough to plan -- do not over-interview
163
+ - In consensus mode, stop after 5 Planner/Architect/Critic iterations and present the best version
164
+ - Consensus mode requires explicit user approval before any implementation begins
165
+ - If the user says "just do it" or "skip planning", **MUST** invoke `/ralph` to transition to execution mode. Do NOT implement directly in the planning agent.
166
+ - Escalate to the user when there are irreconcilable trade-offs that require a business decision
167
+ </Escalation_And_Stop_Conditions>
168
+
169
+ <Final_Checklist>
170
+ - [ ] Plan has testable acceptance criteria (90%+ concrete)
171
+ - [ ] Plan references specific files/lines where applicable (80%+ claims)
172
+ - [ ] All risks have mitigations identified
173
+ - [ ] No vague terms without metrics ("fast" -> "p99 < 200ms")
174
+ - [ ] Plan saved to `.omx/plans/`
175
+ - [ ] In consensus mode: user explicitly approved before any execution
176
+ </Final_Checklist>
177
+
178
+ <Advanced>
179
+ ## Design Option Presentation
180
+
181
+ When presenting design choices during interviews, chunk them:
182
+
183
+ 1. **Overview** (2-3 sentences)
184
+ 2. **Option A** with trade-offs
185
+ 3. [Wait for user reaction]
186
+ 4. **Option B** with trade-offs
187
+ 5. [Wait for user reaction]
188
+ 6. **Recommendation** (only after options discussed)
189
+
190
+ Format for each option:
191
+ ```
192
+ ### Option A: [Name]
193
+ **Approach:** [1 sentence]
194
+ **Pros:** [bullets]
195
+ **Cons:** [bullets]
196
+
197
+ What's your reaction to this approach?
198
+ ```
199
+
200
+ ## Question Classification
201
+
202
+ Before asking any interview question, classify it:
203
+
204
+ | Type | Examples | Action |
205
+ |------|----------|--------|
206
+ | Codebase Fact | "What patterns exist?", "Where is X?" | Explore first, do not ask user |
207
+ | User Preference | "Priority?", "Timeline?" | Ask user via AskUserQuestion |
208
+ | Scope Decision | "Include feature Y?" | Ask user |
209
+ | Requirement | "Performance constraints?" | Ask user |
210
+
211
+ ## Review Quality Criteria
212
+
213
+ | Criterion | Standard |
214
+ |-----------|----------|
215
+ | Clarity | 80%+ claims cite file/line |
216
+ | Testability | 90%+ criteria are concrete |
217
+ | Verification | All file refs exist |
218
+ | Specificity | No vague terms |
219
+
220
+ ## Deprecation Notice
221
+
222
+ The separate `/planner`, `/ralplan`, and `/review` skills have been merged into `/plan`. All workflows (interview, direct, consensus, review) are available through `/plan`.
223
+ </Advanced>