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,33 @@
1
+ ---
2
+ name: trace
3
+ description: Show agent flow trace timeline and summary
4
+ ---
5
+
6
+ # Agent Flow Trace
7
+
8
+ [TRACE MODE ACTIVATED]
9
+
10
+ ## Objective
11
+
12
+ Display the flow trace showing how hooks, keywords, skills, agents, and tools interacted during this session.
13
+
14
+ ## Instructions
15
+
16
+ 1. **Use `trace_timeline` MCP tool** to show the chronological event timeline
17
+ - Call with no arguments to show the latest session
18
+ - Use `filter` parameter to focus on specific event types (hooks, skills, agents, keywords, tools, modes)
19
+ - Use `last` parameter to limit output
20
+
21
+ 2. **Use `trace_summary` MCP tool** to show aggregate statistics
22
+ - Hook fire counts
23
+ - Keywords detected
24
+ - Skills activated
25
+ - Mode transitions
26
+ - Tool performance and bottlenecks
27
+
28
+ ## Output Format
29
+
30
+ Present the timeline first, then the summary. Highlight:
31
+ - **Mode transitions** (how execution modes changed)
32
+ - **Bottlenecks** (slow tools or agents)
33
+ - **Flow patterns** (keyword -> skill -> agent chains)
@@ -0,0 +1,632 @@
1
+ ---
2
+ name: ultrapilot
3
+ description: Parallel autopilot with file ownership partitioning
4
+ ---
5
+
6
+ # Ultrapilot Skill
7
+
8
+ Parallel autopilot that spawns multiple workers with file ownership partitioning for maximum speed.
9
+
10
+ ## Overview
11
+
12
+ Ultrapilot is the parallel evolution of autopilot. It decomposes your task into independent parallelizable subtasks, assigns non-overlapping file sets to each worker, and runs them simultaneously.
13
+
14
+ **Key Capabilities:**
15
+ 1. **Decomposes** task into parallel-safe components
16
+ 2. **Partitions** files with exclusive ownership (no conflicts)
17
+ 3. **Spawns** up to 20 parallel workers
18
+ 4. **Coordinates** progress via TaskOutput
19
+ 5. **Integrates** changes with sequential handling of shared files
20
+ 6. **Validates** full system integrity
21
+
22
+ **Speed Multiplier:** Up to 5x faster than sequential autopilot for suitable tasks.
23
+
24
+ ## Usage
25
+
26
+ ```
27
+ /ultrapilot <your task>
28
+ /up "Build a full-stack todo app"
29
+ /ultrapilot Refactor the entire backend
30
+ ```
31
+
32
+ ## Magic Keywords
33
+
34
+ These phrases auto-activate ultrapilot:
35
+ - "ultrapilot", "ultra pilot"
36
+ - "parallel build", "parallel autopilot"
37
+ - "swarm build", "swarm mode"
38
+ - "fast parallel", "ultra fast"
39
+
40
+ ## When to Use
41
+
42
+ **Ultrapilot Excels At:**
43
+ - Multi-component systems (frontend + backend + database)
44
+ - Independent feature additions across different modules
45
+ - Large refactorings with clear module boundaries
46
+ - Parallel test file generation
47
+ - Multi-service architectures
48
+
49
+ **Autopilot Better For:**
50
+ - Single-threaded sequential tasks
51
+ - Heavy interdependencies between components
52
+ - Tasks requiring constant integration checks
53
+ - Small focused features in a single module
54
+
55
+ ## Architecture
56
+
57
+ ```
58
+ User Input: "Build a full-stack todo app"
59
+ |
60
+ v
61
+ [ULTRAPILOT COORDINATOR]
62
+ |
63
+ Decomposition + File Partitioning
64
+ |
65
+ +-------+-------+-------+-------+
66
+ | | | | |
67
+ v v v v v
68
+ [W-1] [W-2] [W-3] [W-4] [W-5]
69
+ backend frontend database api-docs tests
70
+ (src/ (src/ (src/ (docs/) (tests/)
71
+ api/) ui/) db/)
72
+ | | | | |
73
+ +---+---+---+---+---+---+---+---+
74
+ |
75
+ v
76
+ [INTEGRATION PHASE]
77
+ (shared files: package.json, tsconfig.json, etc.)
78
+ |
79
+ v
80
+ [VALIDATION PHASE]
81
+ (full system test)
82
+ ```
83
+
84
+ ## Phases
85
+
86
+ ### Phase 0: Task Analysis
87
+
88
+ **Goal:** Determine if task is parallelizable
89
+
90
+ **Checks:**
91
+ - Can task be split into 2+ independent subtasks?
92
+ - Are file boundaries clear?
93
+ - Are dependencies minimal?
94
+
95
+ **Output:** Go/No-Go decision (falls back to autopilot if unsuitable)
96
+
97
+ ### Phase 1: Decomposition
98
+
99
+ **Goal:** Break task into parallel-safe subtasks
100
+
101
+ **Agent:** Architect (Opus)
102
+
103
+ **Method:** AI-Powered Task Decomposition
104
+
105
+ Ultrapilot uses the `decomposer` module to generate intelligent task breakdowns:
106
+
107
+ ```typescript
108
+ import {
109
+ generateDecompositionPrompt,
110
+ parseDecompositionResult,
111
+ validateFileOwnership,
112
+ extractSharedFiles
113
+ } from 'src/hooks/ultrapilot/decomposer';
114
+
115
+ // 1. Generate prompt for Architect
116
+ const prompt = generateDecompositionPrompt(task, codebaseContext, {
117
+ maxSubtasks: 5,
118
+ preferredModel: 'sonnet'
119
+ });
120
+
121
+ // 2. Call Architect agent
122
+ const response = await spawn_sub_agent({
123
+ subagent_type: 'oh-my-codex:architect',
124
+ model: 'opus',
125
+ prompt
126
+ });
127
+
128
+ // 3. Parse structured result
129
+ const result = parseDecompositionResult(response);
130
+
131
+ // 4. Validate no file conflicts
132
+ const { isValid, conflicts } = validateFileOwnership(result.subtasks);
133
+
134
+ // 5. Extract shared files from subtasks
135
+ const finalResult = extractSharedFiles(result);
136
+ ```
137
+
138
+ **Process:**
139
+ 1. Analyze task requirements via Architect agent
140
+ 2. Identify independent components with file boundaries
141
+ 3. Assign agent type (executor-low/executor/executor-high) per complexity
142
+ 4. Map dependencies between subtasks (blockedBy)
143
+ 5. Generate parallel execution groups
144
+ 6. Identify shared files (handled by coordinator)
145
+
146
+ **Output:** Structured `DecompositionResult`:
147
+
148
+ ```json
149
+ {
150
+ "subtasks": [
151
+ {
152
+ "id": "1",
153
+ "description": "Backend API routes",
154
+ "files": ["src/api/routes.ts", "src/api/handlers.ts"],
155
+ "blockedBy": [],
156
+ "agentType": "executor",
157
+ "model": "sonnet"
158
+ },
159
+ {
160
+ "id": "2",
161
+ "description": "Frontend components",
162
+ "files": ["src/ui/App.tsx", "src/ui/TodoList.tsx"],
163
+ "blockedBy": [],
164
+ "agentType": "executor",
165
+ "model": "sonnet"
166
+ },
167
+ {
168
+ "id": "3",
169
+ "description": "Wire frontend to backend",
170
+ "files": ["src/client/api.ts"],
171
+ "blockedBy": ["1", "2"],
172
+ "agentType": "executor-low",
173
+ "model": "haiku"
174
+ }
175
+ ],
176
+ "sharedFiles": [
177
+ "package.json",
178
+ "tsconfig.json",
179
+ "README.md"
180
+ ],
181
+ "parallelGroups": [["1", "2"], ["3"]]
182
+ }
183
+ ```
184
+
185
+ **Decomposition Types:**
186
+
187
+ | Type | Description | Use Case |
188
+ |------|-------------|----------|
189
+ | `DecomposedTask` | Full task with id, files, blockedBy, agentType, model | Intelligent worker spawning |
190
+ | `DecompositionResult` | Complete result with subtasks, sharedFiles, parallelGroups | Full decomposition output |
191
+ | `toSimpleSubtasks()` | Convert to string[] for legacy compatibility | Simple task lists |
192
+
193
+ ### Phase 2: File Ownership Partitioning
194
+
195
+ **Goal:** Assign exclusive file sets to workers
196
+
197
+ **Rules:**
198
+ 1. **Exclusive ownership** - No file in multiple worker sets
199
+ 2. **Shared files deferred** - Handled sequentially in integration
200
+ 3. **Boundary files tracked** - Files that import across boundaries
201
+
202
+ **Data Structure:** `.omx/state/ultrapilot-ownership.json`
203
+
204
+ ```json
205
+ {
206
+ "sessionId": "ultrapilot-20260123-1234",
207
+ "workers": {
208
+ "worker-1": {
209
+ "ownedFiles": ["src/api/routes.ts", "src/api/handlers.ts"],
210
+ "ownedGlobs": ["src/api/**"],
211
+ "boundaryImports": ["src/types.ts"]
212
+ },
213
+ "worker-2": {
214
+ "ownedFiles": ["src/ui/App.tsx", "src/ui/TodoList.tsx"],
215
+ "ownedGlobs": ["src/ui/**"],
216
+ "boundaryImports": ["src/types.ts"]
217
+ }
218
+ },
219
+ "sharedFiles": ["package.json", "tsconfig.json", "src/types.ts"],
220
+ "conflictPolicy": "coordinator-handles"
221
+ }
222
+ ```
223
+
224
+ ### Phase 3: Parallel Execution
225
+
226
+ **Goal:** Run all workers simultaneously
227
+
228
+ **Spawn Workers:**
229
+ ```javascript
230
+ // Pseudocode
231
+ workers = [];
232
+ for (subtask in decomposition.subtasks) {
233
+ workers.push(
234
+ spawn_sub_agent(
235
+ subagent_type: "oh-my-codex:executor",
236
+ model: "sonnet",
237
+ prompt: `ULTRAPILOT WORKER ${subtask.id}
238
+
239
+ Your exclusive file ownership: ${subtask.files}
240
+
241
+ Task: ${subtask.description}
242
+
243
+ CRITICAL RULES:
244
+ 1. ONLY modify files in your ownership set
245
+ 2. If you need to modify a shared file, document the change in your output
246
+ 3. Do NOT create new files outside your ownership
247
+ 4. Track all imports from boundary files
248
+
249
+ Deliver: Code changes + list of boundary dependencies`,
250
+ run_in_background: true
251
+ )
252
+ );
253
+ }
254
+ ```
255
+
256
+ **Monitoring:**
257
+ - Poll TaskOutput for each worker
258
+ - Track completion status
259
+ - Detect conflicts early
260
+ - Accumulate boundary dependencies
261
+
262
+ **Max Workers:** 5 (Codex CLI limit)
263
+
264
+ ### Phase 4: Integration
265
+
266
+ **Goal:** Merge all worker changes and handle shared files
267
+
268
+ **Process:**
269
+ 1. **Collect outputs** - Gather all worker deliverables
270
+ 2. **Detect conflicts** - Check for unexpected overlaps
271
+ 3. **Handle shared files** - Sequential updates to package.json, etc.
272
+ 4. **Integrate boundary files** - Merge type definitions, shared utilities
273
+ 5. **Resolve imports** - Ensure cross-boundary imports are valid
274
+
275
+ **Agent:** Executor (Sonnet) - sequential processing
276
+
277
+ **Conflict Resolution:**
278
+ - If workers unexpectedly touched same file → manual merge
279
+ - If shared file needs multiple changes → sequential apply
280
+ - If boundary file changed → validate all dependent workers
281
+
282
+ ### Phase 5: Validation
283
+
284
+ **Goal:** Verify integrated system works
285
+
286
+ **Checks (parallel):**
287
+ 1. **Build** - Run the project's build command
288
+ 2. **Lint** - Run the project's lint command
289
+ 3. **Type check** - Run the project's type check command
290
+ 4. **Unit tests** - All tests pass
291
+ 5. **Integration tests** - Cross-component tests
292
+
293
+ **Agents (parallel):**
294
+ - Build-fixer (Sonnet) - Fix build errors
295
+ - Architect (Opus) - Functional completeness
296
+ - Security-reviewer (Opus) - Cross-component vulnerabilities
297
+
298
+ **Retry Policy:** Up to 3 validation rounds. If failures persist, detailed error report to user.
299
+
300
+ ## State Management
301
+
302
+ ### Session State
303
+
304
+ **Location:** `.omx/ultrapilot-state.json`
305
+
306
+ ```json
307
+ {
308
+ "sessionId": "ultrapilot-20260123-1234",
309
+ "taskDescription": "Build a full-stack todo app",
310
+ "phase": "execution",
311
+ "startTime": "2026-01-23T10:30:00Z",
312
+ "decomposition": { /* from Phase 1 */ },
313
+ "workers": {
314
+ "worker-1": {
315
+ "status": "running",
316
+ "taskId": "task-abc123",
317
+ "startTime": "2026-01-23T10:31:00Z",
318
+ "estimatedDuration": "5m"
319
+ }
320
+ },
321
+ "conflicts": [],
322
+ "validationAttempts": 0
323
+ }
324
+ ```
325
+
326
+ ### File Ownership Map
327
+
328
+ **Location:** `.omx/state/ultrapilot-ownership.json`
329
+
330
+ Tracks which worker owns which files (see Phase 2 example above).
331
+
332
+ ### Progress Tracking
333
+
334
+ **Location:** `.omx/ultrapilot/progress.json`
335
+
336
+ ```json
337
+ {
338
+ "totalWorkers": 5,
339
+ "completedWorkers": 3,
340
+ "activeWorkers": 2,
341
+ "failedWorkers": 0,
342
+ "estimatedTimeRemaining": "2m30s"
343
+ }
344
+ ```
345
+
346
+ ## Configuration
347
+
348
+ Optional settings in `.claude/settings.json`:
349
+
350
+ ```json
351
+ {
352
+ "omc": {
353
+ "ultrapilot": {
354
+ "maxWorkers": 5,
355
+ "maxValidationRounds": 3,
356
+ "conflictPolicy": "coordinator-handles",
357
+ "fallbackToAutopilot": true,
358
+ "parallelThreshold": 2,
359
+ "pauseAfterDecomposition": false,
360
+ "verboseProgress": true
361
+ }
362
+ }
363
+ }
364
+ ```
365
+
366
+ **Settings Explained:**
367
+ - `maxWorkers` - Max parallel workers (5 is Codex CLI limit)
368
+ - `maxValidationRounds` - Validation retry attempts
369
+ - `conflictPolicy` - "coordinator-handles" or "abort-on-conflict"
370
+ - `fallbackToAutopilot` - Auto-switch if task not parallelizable
371
+ - `parallelThreshold` - Min subtasks to use ultrapilot (else fallback)
372
+ - `pauseAfterDecomposition` - Confirm with user before execution
373
+ - `verboseProgress` - Show detailed worker progress
374
+
375
+ ## Cancellation
376
+
377
+ ```
378
+ /cancel
379
+ ```
380
+
381
+ Or say: "stop", "cancel ultrapilot", "abort"
382
+
383
+ **Behavior:**
384
+ - All active workers gracefully terminated
385
+ - Partial progress saved to state file
386
+ - Session can be resumed
387
+
388
+ ## Resume
389
+
390
+ If ultrapilot was cancelled or a worker failed:
391
+
392
+ ```
393
+ /ultrapilot resume
394
+ ```
395
+
396
+ **Resume Logic:**
397
+ - Restart failed workers only
398
+ - Re-use completed worker outputs
399
+ - Continue from last phase
400
+
401
+ ## Examples
402
+
403
+ ### Example 1: Full-Stack App
404
+
405
+ ```
406
+ /ultrapilot Build a todo app with React frontend, Express backend, and PostgreSQL database
407
+ ```
408
+
409
+ **Workers:**
410
+ 1. Frontend (src/client/)
411
+ 2. Backend (src/server/)
412
+ 3. Database (src/db/)
413
+ 4. Tests (tests/)
414
+ 5. Docs (docs/)
415
+
416
+ **Shared Files:** package.json, docker-compose.yml, README.md
417
+
418
+ **Duration:** ~15 minutes (vs ~75 minutes sequential)
419
+
420
+ ### Example 2: Multi-Service Refactor
421
+
422
+ ```
423
+ /up Refactor all services to use dependency injection
424
+ ```
425
+
426
+ **Workers:**
427
+ 1. Auth service
428
+ 2. User service
429
+ 3. Payment service
430
+ 4. Notification service
431
+
432
+ **Shared Files:** src/types/services.ts, tsconfig.json
433
+
434
+ **Duration:** ~8 minutes (vs ~32 minutes sequential)
435
+
436
+ ### Example 3: Test Coverage
437
+
438
+ ```
439
+ /ultrapilot Generate tests for all untested modules
440
+ ```
441
+
442
+ **Workers:**
443
+ 1. API tests
444
+ 2. UI component tests
445
+ 3. Database tests
446
+ 4. Utility tests
447
+ 5. Integration tests
448
+
449
+ **Shared Files:** jest.config.js, test-utils.ts
450
+
451
+ **Duration:** ~10 minutes (vs ~50 minutes sequential)
452
+
453
+ ## Best Practices
454
+
455
+ 1. **Clear module boundaries** - Works best with well-separated code
456
+ 2. **Minimal shared state** - Reduces integration complexity
457
+ 3. **Trust the decomposition** - Architect knows what's parallel-safe
458
+ 4. **Monitor progress** - Check `.omx/ultrapilot/progress.json`
459
+ 5. **Review conflicts early** - Don't wait until integration
460
+
461
+ ## File Ownership Strategy
462
+
463
+ ### Ownership Types
464
+
465
+ **Exclusive Ownership:**
466
+ - Worker has sole write access
467
+ - No other worker can touch these files
468
+ - Worker can create new files in owned directories
469
+
470
+ **Shared Files:**
471
+ - No worker has exclusive access
472
+ - Handled sequentially in integration phase
473
+ - Includes: package.json, tsconfig.json, config files, root README
474
+
475
+ **Boundary Files:**
476
+ - Can be read by all workers
477
+ - Write access determined by usage analysis
478
+ - Typically: type definitions, shared utilities, interfaces
479
+
480
+ ### Ownership Detection Algorithm
481
+
482
+ ```
483
+ For each file in codebase:
484
+ If file in shared_patterns (package.json, *.config.js):
485
+ → sharedFiles
486
+
487
+ Else if file imported by 2+ subtask modules:
488
+ → boundaryFiles
489
+ → Assign to most relevant worker OR defer to shared
490
+
491
+ Else if file in subtask directory:
492
+ → Assign to subtask worker
493
+
494
+ Else:
495
+ → sharedFiles (safe default)
496
+ ```
497
+
498
+ ### Shared File Patterns
499
+
500
+ Automatically classified as shared:
501
+ - `package.json`, `package-lock.json`
502
+ - `tsconfig.json`, `*.config.js`, `*.config.ts`
503
+ - `.eslintrc.*`, `.prettierrc.*`
504
+ - `README.md`, `CONTRIBUTING.md`, `LICENSE`
505
+ - Docker files: `Dockerfile`, `docker-compose.yml`
506
+ - CI files: `.github/**`, `.gitlab-ci.yml`
507
+
508
+ ## Conflict Handling
509
+
510
+ ### Conflict Types
511
+
512
+ **Unexpected Overlap:**
513
+ - Two workers modified the same file
514
+ - **Resolution:** Coordinator merges with human confirmation
515
+
516
+ **Shared File Contention:**
517
+ - Multiple workers need to update package.json
518
+ - **Resolution:** Sequential application in integration phase
519
+
520
+ **Boundary File Conflict:**
521
+ - Type definition needed by multiple workers
522
+ - **Resolution:** First worker creates, others import
523
+
524
+ ### Conflict Policy
525
+
526
+ **coordinator-handles (default):**
527
+ - Coordinator attempts automatic merge
528
+ - Falls back to user if complex
529
+
530
+ **abort-on-conflict:**
531
+ - Any conflict immediately cancels ultrapilot
532
+ - User reviews conflict report
533
+ - Can resume after manual fix
534
+
535
+ ## Troubleshooting
536
+
537
+ **Decomposition fails?**
538
+ - Task may be too coupled
539
+ - Fallback to autopilot triggered automatically
540
+ - Review `.omx/ultrapilot/decomposition.json` for details
541
+
542
+ **Worker hangs?**
543
+ - Check worker logs in `.omx/logs/ultrapilot-worker-N.log`
544
+ - Cancel and restart that worker
545
+ - May indicate file ownership issue
546
+
547
+ **Integration conflicts?**
548
+ - Review `.omx/ultrapilot-state.json` conflicts array
549
+ - Check if shared files were unexpectedly modified
550
+ - Adjust ownership rules if needed
551
+
552
+ **Validation loops?**
553
+ - Cross-component integration issue
554
+ - Review boundary imports
555
+ - May need sequential retry with full context
556
+
557
+ **Too slow?**
558
+ - Check if workers are truly independent
559
+ - Review decomposition quality
560
+ - Consider if autopilot would be faster (high interdependency)
561
+
562
+ ## Differences from Autopilot
563
+
564
+ | Feature | Autopilot | Ultrapilot |
565
+ |---------|-----------|------------|
566
+ | Execution | Sequential | Parallel (up to 5x) |
567
+ | Best For | Single-threaded tasks | Multi-component systems |
568
+ | Complexity | Lower | Higher |
569
+ | Speed | Standard | 3-5x faster (suitable tasks) |
570
+ | File Conflicts | N/A | Ownership partitioning |
571
+ | Fallback | N/A | Can fallback to autopilot |
572
+ | Setup | Instant | Decomposition phase (~1-2 min) |
573
+
574
+ **Rule of Thumb:** If task has 3+ independent components, use ultrapilot. Otherwise, use autopilot.
575
+
576
+ ## Advanced: Custom Decomposition
577
+
578
+ You can provide a custom decomposition file to skip Phase 1:
579
+
580
+ **Location:** `.omx/ultrapilot/custom-decomposition.json`
581
+
582
+ ```json
583
+ {
584
+ "subtasks": [
585
+ {
586
+ "id": "worker-auth",
587
+ "description": "Add OAuth2 authentication",
588
+ "files": ["src/auth/**", "src/middleware/auth.ts"],
589
+ "dependencies": ["src/types/user.ts"]
590
+ },
591
+ {
592
+ "id": "worker-db",
593
+ "description": "Add user table and migrations",
594
+ "files": ["src/db/migrations/**", "src/db/models/user.ts"],
595
+ "dependencies": []
596
+ }
597
+ ],
598
+ "sharedFiles": ["package.json", "src/types/user.ts"]
599
+ }
600
+ ```
601
+
602
+ Then run:
603
+ ```
604
+ /ultrapilot --custom-decomposition
605
+ ```
606
+
607
+ ## STATE CLEANUP ON COMPLETION
608
+
609
+ **IMPORTANT: Delete state files on completion - do NOT just set `active: false`**
610
+
611
+ When all workers complete successfully:
612
+
613
+ ```bash
614
+ # Delete ultrapilot state files
615
+ rm -f .omx/state/ultrapilot-state.json
616
+ rm -f .omx/state/ultrapilot-ownership.json
617
+ ```
618
+
619
+ ## Future Enhancements
620
+
621
+ **Planned for v4.1:**
622
+ - Dynamic worker scaling (start with 2, spawn more if needed)
623
+ - Predictive conflict detection (pre-integration analysis)
624
+ - Worker-to-worker communication (for rare dependencies)
625
+ - Speculative execution (optimistic parallelism)
626
+ - Resume from integration phase (if validation fails)
627
+
628
+ **Planned for v4.2:**
629
+ - Multi-machine distribution (if Codex CLI supports)
630
+ - Real-time progress dashboard
631
+ - Worker performance analytics
632
+ - Auto-tuning of decomposition strategy