oh-my-codex-cli 0.1.0

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