oh-my-codex 0.15.0 → 0.15.2

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 (533) hide show
  1. package/Cargo.lock +5 -5
  2. package/Cargo.toml +1 -1
  3. package/README.md +36 -5
  4. package/crates/omx-explore/src/main.rs +222 -12
  5. package/dist/agents/__tests__/native-config.test.js +40 -0
  6. package/dist/agents/__tests__/native-config.test.js.map +1 -1
  7. package/dist/agents/native-config.d.ts +1 -0
  8. package/dist/agents/native-config.d.ts.map +1 -1
  9. package/dist/agents/native-config.js +6 -1
  10. package/dist/agents/native-config.js.map +1 -1
  11. package/dist/agents/policy.d.ts +1 -0
  12. package/dist/agents/policy.d.ts.map +1 -1
  13. package/dist/agents/policy.js +4 -0
  14. package/dist/agents/policy.js.map +1 -1
  15. package/dist/cli/__tests__/autoresearch-guided.test.js +37 -13
  16. package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -1
  17. package/dist/cli/__tests__/codex-plugin-layout.test.js +1 -1
  18. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
  19. package/dist/cli/__tests__/doctor-team.test.js +46 -1
  20. package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
  21. package/dist/cli/__tests__/doctor-warning-copy.test.js +225 -111
  22. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  23. package/dist/cli/__tests__/exec.test.js +96 -1
  24. package/dist/cli/__tests__/exec.test.js.map +1 -1
  25. package/dist/cli/__tests__/explore.test.js +15 -2
  26. package/dist/cli/__tests__/explore.test.js.map +1 -1
  27. package/dist/cli/__tests__/index.test.js +292 -3
  28. package/dist/cli/__tests__/index.test.js.map +1 -1
  29. package/dist/cli/__tests__/launch-fallback.test.js +223 -0
  30. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  31. package/dist/cli/__tests__/mcp-parity.test.js +86 -0
  32. package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
  33. package/dist/cli/__tests__/package-bin-contract.test.js +23 -0
  34. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
  35. package/dist/cli/__tests__/question.test.js +76 -11
  36. package/dist/cli/__tests__/question.test.js.map +1 -1
  37. package/dist/cli/__tests__/setup-agents-overwrite.test.js +140 -1
  38. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
  39. package/dist/cli/__tests__/setup-install-mode.test.js +310 -4
  40. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
  41. package/dist/cli/__tests__/setup-prompts-overwrite.test.js +78 -19
  42. package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
  43. package/dist/cli/__tests__/setup-refresh.test.js +79 -2
  44. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
  45. package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
  46. package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
  47. package/dist/cli/__tests__/sidecar.test.js +24 -0
  48. package/dist/cli/__tests__/sidecar.test.js.map +1 -0
  49. package/dist/cli/__tests__/team.test.js +54 -7
  50. package/dist/cli/__tests__/team.test.js.map +1 -1
  51. package/dist/cli/autoresearch-guided.d.ts.map +1 -1
  52. package/dist/cli/autoresearch-guided.js +12 -4
  53. package/dist/cli/autoresearch-guided.js.map +1 -1
  54. package/dist/cli/codex-home.d.ts +4 -6
  55. package/dist/cli/codex-home.d.ts.map +1 -1
  56. package/dist/cli/codex-home.js +9 -41
  57. package/dist/cli/codex-home.js.map +1 -1
  58. package/dist/cli/doctor.d.ts +1 -1
  59. package/dist/cli/doctor.d.ts.map +1 -1
  60. package/dist/cli/doctor.js +509 -279
  61. package/dist/cli/doctor.js.map +1 -1
  62. package/dist/cli/index.d.ts +6 -4
  63. package/dist/cli/index.d.ts.map +1 -1
  64. package/dist/cli/index.js +284 -25
  65. package/dist/cli/index.js.map +1 -1
  66. package/dist/cli/omx.js +3 -1
  67. package/dist/cli/omx.js.map +1 -1
  68. package/dist/cli/plugin-marketplace.d.ts +13 -0
  69. package/dist/cli/plugin-marketplace.d.ts.map +1 -0
  70. package/dist/cli/plugin-marketplace.js +77 -0
  71. package/dist/cli/plugin-marketplace.js.map +1 -0
  72. package/dist/cli/question.d.ts +1 -1
  73. package/dist/cli/question.d.ts.map +1 -1
  74. package/dist/cli/question.js +26 -12
  75. package/dist/cli/question.js.map +1 -1
  76. package/dist/cli/setup-preferences.d.ts +20 -0
  77. package/dist/cli/setup-preferences.d.ts.map +1 -0
  78. package/dist/cli/setup-preferences.js +71 -0
  79. package/dist/cli/setup-preferences.js.map +1 -0
  80. package/dist/cli/setup.d.ts +7 -5
  81. package/dist/cli/setup.d.ts.map +1 -1
  82. package/dist/cli/setup.js +271 -152
  83. package/dist/cli/setup.js.map +1 -1
  84. package/dist/cli/team.d.ts +1 -0
  85. package/dist/cli/team.d.ts.map +1 -1
  86. package/dist/cli/team.js +70 -15
  87. package/dist/cli/team.js.map +1 -1
  88. package/dist/config/__tests__/generator-idempotent.test.js +100 -3
  89. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  90. package/dist/config/__tests__/generator-notify.test.js +6 -5
  91. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  92. package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
  93. package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
  94. package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
  95. package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
  96. package/dist/config/__tests__/models.test.js +23 -1
  97. package/dist/config/__tests__/models.test.js.map +1 -1
  98. package/dist/config/generator.d.ts +9 -1
  99. package/dist/config/generator.d.ts.map +1 -1
  100. package/dist/config/generator.js +184 -16
  101. package/dist/config/generator.js.map +1 -1
  102. package/dist/config/models.d.ts +5 -1
  103. package/dist/config/models.d.ts.map +1 -1
  104. package/dist/config/models.js +12 -2
  105. package/dist/config/models.js.map +1 -1
  106. package/dist/exec/followup.d.ts +44 -0
  107. package/dist/exec/followup.d.ts.map +1 -0
  108. package/dist/exec/followup.js +349 -0
  109. package/dist/exec/followup.js.map +1 -0
  110. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts +2 -0
  111. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts.map +1 -0
  112. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +37 -0
  113. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -0
  114. package/dist/hooks/__tests__/codebase-map.test.js +63 -1
  115. package/dist/hooks/__tests__/codebase-map.test.js.map +1 -1
  116. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +1 -1
  117. package/dist/hooks/__tests__/consensus-execution-handoff.test.js +5 -5
  118. package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
  119. package/dist/hooks/__tests__/deep-interview-contract.test.js +12 -9
  120. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
  121. package/dist/hooks/__tests__/keyword-detector.test.js +25 -18
  122. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  123. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +23 -2
  124. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
  125. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +45 -2
  126. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
  127. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +17 -0
  128. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
  129. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +121 -0
  130. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
  131. package/dist/hooks/__tests__/notify-hook-regression-205.test.js +4 -4
  132. package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
  133. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +103 -0
  134. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
  135. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +2 -2
  136. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
  137. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +27 -13
  138. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
  139. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
  140. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
  141. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
  142. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
  143. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +215 -0
  144. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
  145. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +70 -3
  146. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
  147. package/dist/hooks/__tests__/pre-context-gate-skills.test.js +5 -0
  148. package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
  149. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +3 -2
  150. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -1
  151. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +9 -0
  152. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
  153. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
  154. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
  155. package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
  156. package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
  157. package/dist/hooks/codebase-map.d.ts.map +1 -1
  158. package/dist/hooks/codebase-map.js +83 -6
  159. package/dist/hooks/codebase-map.js.map +1 -1
  160. package/dist/hooks/keyword-detector.d.ts +1 -1
  161. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  162. package/dist/hooks/keyword-detector.js +35 -4
  163. package/dist/hooks/keyword-detector.js.map +1 -1
  164. package/dist/hooks/prompt-guidance-contract.d.ts +6 -0
  165. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  166. package/dist/hooks/prompt-guidance-contract.js +117 -13
  167. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  168. package/dist/hooks/session.d.ts +2 -0
  169. package/dist/hooks/session.d.ts.map +1 -1
  170. package/dist/hooks/session.js +6 -0
  171. package/dist/hooks/session.js.map +1 -1
  172. package/dist/hud/__tests__/index.test.js +4 -4
  173. package/dist/hud/__tests__/index.test.js.map +1 -1
  174. package/dist/hud/__tests__/state.test.js +4 -0
  175. package/dist/hud/__tests__/state.test.js.map +1 -1
  176. package/dist/hud/__tests__/types.test.js +27 -0
  177. package/dist/hud/__tests__/types.test.js.map +1 -1
  178. package/dist/hud/state.d.ts.map +1 -1
  179. package/dist/hud/state.js +8 -0
  180. package/dist/hud/state.js.map +1 -1
  181. package/dist/hud/types.d.ts +9 -0
  182. package/dist/hud/types.d.ts.map +1 -1
  183. package/dist/hud/types.js +3 -0
  184. package/dist/hud/types.js.map +1 -1
  185. package/dist/mcp/__tests__/bootstrap.test.js +23 -5
  186. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
  187. package/dist/mcp/__tests__/server-lifecycle.test.js +50 -7
  188. package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
  189. package/dist/mcp/__tests__/state-server.test.js +70 -12
  190. package/dist/mcp/__tests__/state-server.test.js.map +1 -1
  191. package/dist/mcp/bootstrap.d.ts +10 -1
  192. package/dist/mcp/bootstrap.d.ts.map +1 -1
  193. package/dist/mcp/bootstrap.js +71 -26
  194. package/dist/mcp/bootstrap.js.map +1 -1
  195. package/dist/mcp/state-server.d.ts +5 -11
  196. package/dist/mcp/state-server.d.ts.map +1 -1
  197. package/dist/mcp/state-server.js +16 -432
  198. package/dist/mcp/state-server.js.map +1 -1
  199. package/dist/modes/__tests__/base-autoresearch-contract.test.js +1 -1
  200. package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -1
  201. package/dist/pipeline/__tests__/orchestrator.test.js +89 -5
  202. package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
  203. package/dist/pipeline/__tests__/stages.test.js +98 -1
  204. package/dist/pipeline/__tests__/stages.test.js.map +1 -1
  205. package/dist/pipeline/index.d.ts +5 -3
  206. package/dist/pipeline/index.d.ts.map +1 -1
  207. package/dist/pipeline/index.js +4 -3
  208. package/dist/pipeline/index.js.map +1 -1
  209. package/dist/pipeline/orchestrator.d.ts +7 -6
  210. package/dist/pipeline/orchestrator.d.ts.map +1 -1
  211. package/dist/pipeline/orchestrator.js +90 -11
  212. package/dist/pipeline/orchestrator.js.map +1 -1
  213. package/dist/pipeline/review-verdict.d.ts +3 -0
  214. package/dist/pipeline/review-verdict.d.ts.map +1 -0
  215. package/dist/pipeline/review-verdict.js +14 -0
  216. package/dist/pipeline/review-verdict.js.map +1 -0
  217. package/dist/pipeline/stages/code-review.d.ts +33 -0
  218. package/dist/pipeline/stages/code-review.d.ts.map +1 -0
  219. package/dist/pipeline/stages/code-review.js +51 -0
  220. package/dist/pipeline/stages/code-review.js.map +1 -0
  221. package/dist/pipeline/stages/ralph-verify.d.ts +12 -2
  222. package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -1
  223. package/dist/pipeline/stages/ralph-verify.js +24 -6
  224. package/dist/pipeline/stages/ralph-verify.js.map +1 -1
  225. package/dist/pipeline/stages/ralplan.d.ts +1 -1
  226. package/dist/pipeline/stages/ralplan.d.ts.map +1 -1
  227. package/dist/pipeline/stages/ralplan.js +21 -1
  228. package/dist/pipeline/stages/ralplan.js.map +1 -1
  229. package/dist/pipeline/types.d.ts +14 -7
  230. package/dist/pipeline/types.d.ts.map +1 -1
  231. package/dist/pipeline/types.js +2 -2
  232. package/dist/planning/__tests__/artifacts.test.js +152 -1
  233. package/dist/planning/__tests__/artifacts.test.js.map +1 -1
  234. package/dist/planning/artifacts.d.ts +9 -0
  235. package/dist/planning/artifacts.d.ts.map +1 -1
  236. package/dist/planning/artifacts.js +60 -1
  237. package/dist/planning/artifacts.js.map +1 -1
  238. package/dist/question/__tests__/client.test.js +23 -3
  239. package/dist/question/__tests__/client.test.js.map +1 -1
  240. package/dist/question/__tests__/renderer.test.js +148 -37
  241. package/dist/question/__tests__/renderer.test.js.map +1 -1
  242. package/dist/question/__tests__/types.test.js +21 -0
  243. package/dist/question/__tests__/types.test.js.map +1 -1
  244. package/dist/question/__tests__/ui.test.js +155 -7
  245. package/dist/question/__tests__/ui.test.js.map +1 -1
  246. package/dist/question/client.d.ts +14 -4
  247. package/dist/question/client.d.ts.map +1 -1
  248. package/dist/question/client.js.map +1 -1
  249. package/dist/question/renderer.d.ts +11 -1
  250. package/dist/question/renderer.d.ts.map +1 -1
  251. package/dist/question/renderer.js +102 -7
  252. package/dist/question/renderer.js.map +1 -1
  253. package/dist/question/state.d.ts +2 -2
  254. package/dist/question/state.d.ts.map +1 -1
  255. package/dist/question/state.js +26 -17
  256. package/dist/question/state.js.map +1 -1
  257. package/dist/question/types.d.ts +25 -1
  258. package/dist/question/types.d.ts.map +1 -1
  259. package/dist/question/types.js +48 -13
  260. package/dist/question/types.js.map +1 -1
  261. package/dist/question/ui.d.ts +15 -2
  262. package/dist/question/ui.d.ts.map +1 -1
  263. package/dist/question/ui.js +268 -162
  264. package/dist/question/ui.js.map +1 -1
  265. package/dist/scripts/__tests__/codex-native-hook.test.js +415 -94
  266. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  267. package/dist/scripts/__tests__/generate-release-body.test.js +36 -0
  268. package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -1
  269. package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
  270. package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
  271. package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
  272. package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
  273. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  274. package/dist/scripts/codex-native-hook.js +232 -54
  275. package/dist/scripts/codex-native-hook.js.map +1 -1
  276. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
  277. package/dist/scripts/codex-native-pre-post.js +12 -9
  278. package/dist/scripts/codex-native-pre-post.js.map +1 -1
  279. package/dist/scripts/generate-release-body.d.ts.map +1 -1
  280. package/dist/scripts/generate-release-body.js +12 -3
  281. package/dist/scripts/generate-release-body.js.map +1 -1
  282. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
  283. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
  284. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
  285. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
  286. package/dist/scripts/notify-hook/managed-tmux.d.ts +4 -2
  287. package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
  288. package/dist/scripts/notify-hook/managed-tmux.js +188 -6
  289. package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
  290. package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
  291. package/dist/scripts/notify-hook/process-runner.js +7 -3
  292. package/dist/scripts/notify-hook/process-runner.js.map +1 -1
  293. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
  294. package/dist/scripts/notify-hook/team-dispatch.js +96 -11
  295. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
  296. package/dist/scripts/notify-hook/team-tmux-guard.js +3 -3
  297. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
  298. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
  299. package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
  300. package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
  301. package/dist/scripts/notify-hook/team-worker.d.ts +1 -1
  302. package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
  303. package/dist/scripts/notify-hook/team-worker.js +3 -43
  304. package/dist/scripts/notify-hook/team-worker.js.map +1 -1
  305. package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -1
  306. package/dist/scripts/notify-hook/tmux-injection.js +25 -4
  307. package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
  308. package/dist/scripts/notify-hook.js +36 -5
  309. package/dist/scripts/notify-hook.js.map +1 -1
  310. package/dist/scripts/prompt-inventory.d.ts +29 -0
  311. package/dist/scripts/prompt-inventory.d.ts.map +1 -0
  312. package/dist/scripts/prompt-inventory.js +178 -0
  313. package/dist/scripts/prompt-inventory.js.map +1 -0
  314. package/dist/scripts/run-test-files.js +1 -0
  315. package/dist/scripts/run-test-files.js.map +1 -1
  316. package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
  317. package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
  318. package/dist/sidecar/__tests__/boundary.test.js +48 -0
  319. package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
  320. package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
  321. package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
  322. package/dist/sidecar/__tests__/collector.test.js +162 -0
  323. package/dist/sidecar/__tests__/collector.test.js.map +1 -0
  324. package/dist/sidecar/__tests__/render.test.d.ts +2 -0
  325. package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
  326. package/dist/sidecar/__tests__/render.test.js +67 -0
  327. package/dist/sidecar/__tests__/render.test.js.map +1 -0
  328. package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
  329. package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
  330. package/dist/sidecar/__tests__/tmux.test.js +30 -0
  331. package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
  332. package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
  333. package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
  334. package/dist/sidecar/__tests__/watch.test.js +42 -0
  335. package/dist/sidecar/__tests__/watch.test.js.map +1 -0
  336. package/dist/sidecar/collector.d.ts +4 -0
  337. package/dist/sidecar/collector.d.ts.map +1 -0
  338. package/dist/sidecar/collector.js +377 -0
  339. package/dist/sidecar/collector.js.map +1 -0
  340. package/dist/sidecar/index.d.ts +25 -0
  341. package/dist/sidecar/index.d.ts.map +1 -0
  342. package/dist/sidecar/index.js +165 -0
  343. package/dist/sidecar/index.js.map +1 -0
  344. package/dist/sidecar/render.d.ts +3 -0
  345. package/dist/sidecar/render.d.ts.map +1 -0
  346. package/dist/sidecar/render.js +72 -0
  347. package/dist/sidecar/render.js.map +1 -0
  348. package/dist/sidecar/tmux.d.ts +13 -0
  349. package/dist/sidecar/tmux.d.ts.map +1 -0
  350. package/dist/sidecar/tmux.js +44 -0
  351. package/dist/sidecar/tmux.js.map +1 -0
  352. package/dist/sidecar/types.d.ts +125 -0
  353. package/dist/sidecar/types.d.ts.map +1 -0
  354. package/dist/sidecar/types.js +2 -0
  355. package/dist/sidecar/types.js.map +1 -0
  356. package/dist/state/__tests__/operations.test.js +50 -22
  357. package/dist/state/__tests__/operations.test.js.map +1 -1
  358. package/dist/state/__tests__/workflow-transition.test.js +9 -1
  359. package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
  360. package/dist/state/operations.d.ts +1 -1
  361. package/dist/state/operations.d.ts.map +1 -1
  362. package/dist/state/operations.js +19 -7
  363. package/dist/state/operations.js.map +1 -1
  364. package/dist/state/workflow-transition.d.ts.map +1 -1
  365. package/dist/state/workflow-transition.js +1 -0
  366. package/dist/state/workflow-transition.js.map +1 -1
  367. package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
  368. package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
  369. package/dist/team/__tests__/commit-hygiene.test.js +93 -0
  370. package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
  371. package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
  372. package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
  373. package/dist/team/__tests__/delegation-policy.test.js +69 -0
  374. package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
  375. package/dist/team/__tests__/events.test.js +54 -4
  376. package/dist/team/__tests__/events.test.js.map +1 -1
  377. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
  378. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
  379. package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
  380. package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
  381. package/dist/team/__tests__/model-contract.test.js +16 -0
  382. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  383. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
  384. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
  385. package/dist/team/__tests__/repo-aware-decomposition.test.js +95 -0
  386. package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -0
  387. package/dist/team/__tests__/runtime.test.js +623 -14
  388. package/dist/team/__tests__/runtime.test.js.map +1 -1
  389. package/dist/team/__tests__/state-root.test.js +177 -1
  390. package/dist/team/__tests__/state-root.test.js.map +1 -1
  391. package/dist/team/__tests__/state.test.js +110 -0
  392. package/dist/team/__tests__/state.test.js.map +1 -1
  393. package/dist/team/__tests__/tmux-session.test.js +399 -2
  394. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  395. package/dist/team/__tests__/worker-bootstrap.test.js +94 -0
  396. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  397. package/dist/team/commit-hygiene.d.ts +22 -3
  398. package/dist/team/commit-hygiene.d.ts.map +1 -1
  399. package/dist/team/commit-hygiene.js +134 -2
  400. package/dist/team/commit-hygiene.js.map +1 -1
  401. package/dist/team/contracts.d.ts +1 -1
  402. package/dist/team/contracts.d.ts.map +1 -1
  403. package/dist/team/contracts.js +2 -0
  404. package/dist/team/contracts.js.map +1 -1
  405. package/dist/team/dag-schema.d.ts +38 -0
  406. package/dist/team/dag-schema.d.ts.map +1 -0
  407. package/dist/team/dag-schema.js +221 -0
  408. package/dist/team/dag-schema.js.map +1 -0
  409. package/dist/team/delegation-policy.d.ts +3 -0
  410. package/dist/team/delegation-policy.d.ts.map +1 -0
  411. package/dist/team/delegation-policy.js +82 -0
  412. package/dist/team/delegation-policy.js.map +1 -0
  413. package/dist/team/model-contract.d.ts +3 -1
  414. package/dist/team/model-contract.d.ts.map +1 -1
  415. package/dist/team/model-contract.js +44 -5
  416. package/dist/team/model-contract.js.map +1 -1
  417. package/dist/team/repo-aware-decomposition.d.ts +60 -0
  418. package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
  419. package/dist/team/repo-aware-decomposition.js +229 -0
  420. package/dist/team/repo-aware-decomposition.js.map +1 -0
  421. package/dist/team/runtime.d.ts +27 -0
  422. package/dist/team/runtime.d.ts.map +1 -1
  423. package/dist/team/runtime.js +172 -52
  424. package/dist/team/runtime.js.map +1 -1
  425. package/dist/team/state/tasks.d.ts.map +1 -1
  426. package/dist/team/state/tasks.js +33 -0
  427. package/dist/team/state/tasks.js.map +1 -1
  428. package/dist/team/state/types.d.ts +23 -1
  429. package/dist/team/state/types.d.ts.map +1 -1
  430. package/dist/team/state/types.js.map +1 -1
  431. package/dist/team/state-root.d.ts +35 -0
  432. package/dist/team/state-root.d.ts.map +1 -1
  433. package/dist/team/state-root.js +281 -1
  434. package/dist/team/state-root.js.map +1 -1
  435. package/dist/team/state.d.ts +27 -1
  436. package/dist/team/state.d.ts.map +1 -1
  437. package/dist/team/state.js +6 -0
  438. package/dist/team/state.js.map +1 -1
  439. package/dist/team/tmux-session.d.ts +1 -0
  440. package/dist/team/tmux-session.d.ts.map +1 -1
  441. package/dist/team/tmux-session.js +105 -6
  442. package/dist/team/tmux-session.js.map +1 -1
  443. package/dist/team/worker-bootstrap.d.ts +3 -0
  444. package/dist/team/worker-bootstrap.d.ts.map +1 -1
  445. package/dist/team/worker-bootstrap.js +77 -4
  446. package/dist/team/worker-bootstrap.js.map +1 -1
  447. package/dist/utils/agents-md.d.ts +3 -0
  448. package/dist/utils/agents-md.d.ts.map +1 -1
  449. package/dist/utils/agents-md.js +25 -0
  450. package/dist/utils/agents-md.js.map +1 -1
  451. package/package.json +3 -2
  452. package/plugins/oh-my-codex/.codex-plugin/plugin.json +2 -2
  453. package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +1 -1
  454. package/plugins/oh-my-codex/skills/analyze/SKILL.md +1 -1
  455. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +134 -205
  456. package/plugins/oh-my-codex/skills/code-review/SKILL.md +4 -4
  457. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +14 -7
  458. package/plugins/oh-my-codex/skills/doctor/SKILL.md +1 -1
  459. package/plugins/oh-my-codex/skills/help/SKILL.md +1 -1
  460. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +41 -10
  461. package/plugins/oh-my-codex/skills/plan/SKILL.md +12 -14
  462. package/plugins/oh-my-codex/skills/ralph/SKILL.md +2 -4
  463. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +5 -9
  464. package/plugins/oh-my-codex/skills/security-review/SKILL.md +4 -4
  465. package/plugins/oh-my-codex/skills/team/SKILL.md +2 -5
  466. package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +2 -5
  467. package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +2 -3
  468. package/prompts/analyst.md +2 -2
  469. package/prompts/api-reviewer.md +2 -2
  470. package/prompts/architect.md +2 -2
  471. package/prompts/build-fixer.md +2 -2
  472. package/prompts/code-reviewer.md +15 -5
  473. package/prompts/code-simplifier.md +1 -1
  474. package/prompts/critic.md +35 -83
  475. package/prompts/debugger.md +2 -2
  476. package/prompts/dependency-expert.md +2 -2
  477. package/prompts/designer.md +2 -2
  478. package/prompts/executor.md +40 -114
  479. package/prompts/explore-harness.md +1 -1
  480. package/prompts/explore.md +37 -90
  481. package/prompts/git-master.md +2 -2
  482. package/prompts/information-architect.md +1 -1
  483. package/prompts/performance-reviewer.md +2 -2
  484. package/prompts/planner.md +35 -62
  485. package/prompts/product-analyst.md +2 -2
  486. package/prompts/product-manager.md +2 -2
  487. package/prompts/qa-tester.md +2 -2
  488. package/prompts/quality-reviewer.md +2 -2
  489. package/prompts/quality-strategist.md +2 -2
  490. package/prompts/researcher.md +46 -78
  491. package/prompts/security-reviewer.md +2 -2
  492. package/prompts/sisyphus-lite.md +2 -2
  493. package/prompts/style-reviewer.md +2 -2
  494. package/prompts/team-executor.md +1 -1
  495. package/prompts/test-engineer.md +2 -2
  496. package/prompts/ux-researcher.md +2 -2
  497. package/prompts/verifier.md +29 -34
  498. package/prompts/vision.md +2 -2
  499. package/prompts/writer.md +2 -2
  500. package/skills/ai-slop-cleaner/SKILL.md +1 -1
  501. package/skills/analyze/SKILL.md +1 -1
  502. package/skills/autopilot/SKILL.md +134 -205
  503. package/skills/build-fix/SKILL.md +4 -4
  504. package/skills/code-review/SKILL.md +4 -4
  505. package/skills/deep-interview/SKILL.md +14 -7
  506. package/skills/doctor/SKILL.md +1 -1
  507. package/skills/help/SKILL.md +1 -1
  508. package/skills/omx-setup/SKILL.md +41 -10
  509. package/skills/plan/SKILL.md +12 -14
  510. package/skills/ralph/SKILL.md +2 -4
  511. package/skills/ralplan/SKILL.md +5 -9
  512. package/skills/security-review/SKILL.md +4 -4
  513. package/skills/team/SKILL.md +2 -5
  514. package/skills/ultraqa/SKILL.md +2 -5
  515. package/skills/ultrawork/SKILL.md +2 -3
  516. package/src/scripts/__tests__/codex-native-hook.test.ts +502 -94
  517. package/src/scripts/__tests__/generate-release-body.test.ts +41 -0
  518. package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
  519. package/src/scripts/codex-native-hook.ts +293 -61
  520. package/src/scripts/codex-native-pre-post.ts +10 -8
  521. package/src/scripts/generate-release-body.ts +13 -2
  522. package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
  523. package/src/scripts/notify-hook/managed-tmux.ts +196 -9
  524. package/src/scripts/notify-hook/process-runner.ts +7 -3
  525. package/src/scripts/notify-hook/team-dispatch.ts +103 -11
  526. package/src/scripts/notify-hook/team-tmux-guard.ts +3 -3
  527. package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
  528. package/src/scripts/notify-hook/team-worker.ts +4 -48
  529. package/src/scripts/notify-hook/tmux-injection.ts +24 -6
  530. package/src/scripts/notify-hook.ts +36 -5
  531. package/src/scripts/prompt-inventory.ts +218 -0
  532. package/src/scripts/run-test-files.ts +1 -0
  533. package/templates/AGENTS.md +34 -95
@@ -20,7 +20,7 @@
20
20
 
21
21
  import { writeFile, appendFile, mkdir, readFile } from 'fs/promises';
22
22
  import { existsSync } from 'fs';
23
- import { dirname, join } from 'path';
23
+ import { dirname, join, resolve } from 'path';
24
24
 
25
25
  import { safeString, asNumber } from './notify-hook/utils.js';
26
26
  import {
@@ -183,9 +183,11 @@ async function main() {
183
183
  const parsedTeamWorker = parseTeamWorkerEnv(teamWorkerEnv);
184
184
  const isTeamWorker = !!parsedTeamWorker;
185
185
 
186
- const stateDir = (isTeamWorker && parsedTeamWorker)
186
+ const resolvedWorkerStateDir = (isTeamWorker && parsedTeamWorker)
187
187
  ? await resolveTeamStateDirForWorker(cwd, parsedTeamWorker)
188
- : join(cwd, '.omx', 'state');
188
+ : null;
189
+ const workerStateRootResolved = !isTeamWorker || !!resolvedWorkerStateDir;
190
+ const stateDir = resolvedWorkerStateDir || join(cwd, '.omx', 'state');
189
191
  const logsDir = join(cwd, '.omx', 'logs');
190
192
  const omxDir = join(cwd, '.omx');
191
193
  let currentOmxSessionId = '';
@@ -193,12 +195,15 @@ async function main() {
193
195
 
194
196
  // Ensure directories exist
195
197
  await mkdir(logsDir, { recursive: true }).catch(() => {});
196
- await mkdir(stateDir, { recursive: true }).catch(() => {});
197
- currentOmxSessionId = await readCurrentSessionId(stateDir).catch(() => '') || '';
198
+ if (workerStateRootResolved) {
199
+ await mkdir(stateDir, { recursive: true }).catch(() => {});
200
+ currentOmxSessionId = await readCurrentSessionId(stateDir).catch(() => '') || '';
201
+ }
198
202
 
199
203
  // Turn-level dedupe prevents double-processing when native notify and fallback
200
204
  // watcher both emit the same completed turn.
201
205
  try {
206
+ if (!workerStateRootResolved) throw new Error('worker_state_root_unresolved');
202
207
  const turnId = safeString(payload['turn-id'] || payload.turn_id || '');
203
208
  if (turnId) {
204
209
  const now = Date.now();
@@ -268,6 +273,32 @@ async function main() {
268
273
  return;
269
274
  }
270
275
 
276
+ if (isTeamWorker && !workerStateRootResolved) {
277
+ await logNotifyHookEvent(logsDir, {
278
+ timestamp: new Date().toISOString(),
279
+ level: 'warn',
280
+ type: 'team_worker_state_root_unresolved',
281
+ team_worker: teamWorkerEnv || null,
282
+ reason: 'skip_team_worker_state_mutations',
283
+ }).catch(() => {});
284
+
285
+ // Keep the fail-closed worker state-root behavior for normal team-worker
286
+ // mutations, but allow the narrow auto-nudge path to use an explicitly
287
+ // supplied, already-existing worker state root. Auto-nudge only needs the
288
+ // worker-scoped state files/pane anchor and should not fall back to creating
289
+ // local `.omx/state` when identity resolution failed.
290
+ const explicitWorkerStateRoot = safeString(process.env.OMX_TEAM_STATE_ROOT || '').trim();
291
+ const autoNudgeStateDir = explicitWorkerStateRoot ? resolve(cwd, explicitWorkerStateRoot) : '';
292
+ if (autoNudgeStateDir && existsSync(autoNudgeStateDir)) {
293
+ try {
294
+ await maybeAutoNudge({ cwd, stateDir: autoNudgeStateDir, logsDir, payload });
295
+ } catch {
296
+ // Non-critical
297
+ }
298
+ }
299
+ return;
300
+ }
301
+
271
302
  // Reconcile Ralph ownership for same-Codex-session continuation before
272
303
  // lifecycle counters or injection read the active scope.
273
304
  if (!isTeamWorker) {
@@ -0,0 +1,218 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
3
+ import { join, relative } from 'node:path';
4
+
5
+ export interface PromptSurfaceInventory {
6
+ path: string;
7
+ lines: number;
8
+ approximateTokens: number;
9
+ absoluteDirectiveCount: number;
10
+ markers: Record<string, number>;
11
+ }
12
+
13
+ export interface DuplicateFragmentFamily {
14
+ text: string;
15
+ count: number;
16
+ paths: string[];
17
+ }
18
+
19
+ export interface PromptInventoryReport {
20
+ generatedAt: string;
21
+ root: string;
22
+ totals: {
23
+ files: number;
24
+ lines: number;
25
+ approximateTokens: number;
26
+ absoluteDirectiveCount: number;
27
+ };
28
+ surfaces: PromptSurfaceInventory[];
29
+ duplicateFragmentFamilies: DuplicateFragmentFamily[];
30
+ }
31
+
32
+ const PROMPT_SURFACE_FILES = [
33
+ 'AGENTS.md',
34
+ 'templates/AGENTS.md',
35
+ 'docs/prompt-guidance-contract.md',
36
+ 'docs/guidance-schema.md',
37
+ 'src/hooks/prompt-guidance-contract.ts',
38
+ 'src/config/generator.ts',
39
+ 'src/cli/setup.ts',
40
+ ];
41
+
42
+ const PROMPT_SURFACE_DIRS = [
43
+ 'prompts',
44
+ 'skills',
45
+ 'templates/model-instructions',
46
+ 'docs/prompt-guidance-fragments',
47
+ ];
48
+
49
+ const MARKERS = [
50
+ '<!-- OMX:RUNTIME:START -->',
51
+ '<!-- OMX:RUNTIME:END -->',
52
+ '<!-- OMX:TEAM:WORKER:START -->',
53
+ '<!-- OMX:TEAM:WORKER:END -->',
54
+ '<!-- OMX:MODELS:START -->',
55
+ '<!-- OMX:MODELS:END -->',
56
+ '<!-- omx:generated:agents-md -->',
57
+ ];
58
+
59
+ const ABSOLUTE_DIRECTIVE_PATTERN = /\b(MUST(?:\s+NOT)?|DO NOT|DON'T|NEVER|ALWAYS|REQUIRED|REQUIRE|ONLY|STOP|ASK only|AUTO-CONTINUE|KEEP GOING)\b/i;
60
+
61
+ function walkFiles(root: string, dir: string, out: string[]): void {
62
+ const absoluteDir = join(root, dir);
63
+ if (!existsSync(absoluteDir)) return;
64
+ for (const entry of readdirSync(absoluteDir)) {
65
+ const rel = join(dir, entry);
66
+ const absolute = join(root, rel);
67
+ const stats = statSync(absolute);
68
+ if (stats.isDirectory()) {
69
+ walkFiles(root, rel, out);
70
+ continue;
71
+ }
72
+ if (stats.isFile() && /\.(md|ts)$/.test(entry)) {
73
+ out.push(rel);
74
+ }
75
+ }
76
+ }
77
+
78
+ export function listPromptSurfacePaths(root = process.cwd()): string[] {
79
+ const paths = new Set<string>();
80
+ for (const file of PROMPT_SURFACE_FILES) {
81
+ if (existsSync(join(root, file))) paths.add(file);
82
+ }
83
+
84
+ const walked: string[] = [];
85
+ for (const dir of PROMPT_SURFACE_DIRS) walkFiles(root, dir, walked);
86
+ for (const path of walked) paths.add(path);
87
+
88
+ return [...paths].sort();
89
+ }
90
+
91
+ function countOccurrences(text: string, needle: string): number {
92
+ let count = 0;
93
+ let index = text.indexOf(needle);
94
+ while (index !== -1) {
95
+ count += 1;
96
+ index = text.indexOf(needle, index + needle.length);
97
+ }
98
+ return count;
99
+ }
100
+
101
+ function approximateTokenCount(text: string): number {
102
+ return text.match(/[\p{L}\p{N}_'-]+|[^\s]/gu)?.length ?? 0;
103
+ }
104
+
105
+ function countAbsoluteDirectives(text: string): number {
106
+ return text
107
+ .split(/\r?\n/)
108
+ .filter((line) => ABSOLUTE_DIRECTIVE_PATTERN.test(line))
109
+ .length;
110
+ }
111
+
112
+ function inventorySurface(root: string, path: string): PromptSurfaceInventory {
113
+ const text = readFileSync(join(root, path), 'utf-8');
114
+ const markers = Object.fromEntries(MARKERS.map((marker) => [marker, countOccurrences(text, marker)]));
115
+ return {
116
+ path,
117
+ lines: text.length === 0 ? 0 : text.split(/\r?\n/).length,
118
+ approximateTokens: approximateTokenCount(text),
119
+ absoluteDirectiveCount: countAbsoluteDirectives(text),
120
+ markers,
121
+ };
122
+ }
123
+
124
+ function normalizeFragmentLine(line: string): string | null {
125
+ const normalized = line.replace(/\s+/g, ' ').trim();
126
+ if (normalized.length < 60) return null;
127
+ if (/^[-*#>|`]+$/.test(normalized)) return null;
128
+ return normalized;
129
+ }
130
+
131
+ function duplicateFragmentFamilies(root: string, paths: string[]): DuplicateFragmentFamily[] {
132
+ const occurrences = new Map<string, Set<string>>();
133
+ for (const path of paths) {
134
+ const text = readFileSync(join(root, path), 'utf-8');
135
+ for (const line of text.split(/\r?\n/)) {
136
+ const normalized = normalizeFragmentLine(line);
137
+ if (!normalized) continue;
138
+ const pathsWithLine = occurrences.get(normalized) ?? new Set<string>();
139
+ pathsWithLine.add(path);
140
+ occurrences.set(normalized, pathsWithLine);
141
+ }
142
+ }
143
+
144
+ return [...occurrences.entries()]
145
+ .map(([text, pathSet]) => ({ text, count: pathSet.size, paths: [...pathSet].sort() }))
146
+ .filter((family) => family.count > 1)
147
+ .sort((a, b) => b.count - a.count || a.text.localeCompare(b.text))
148
+ .slice(0, 50);
149
+ }
150
+
151
+ export function buildPromptInventory(root = process.cwd(), generatedAt = new Date().toISOString()): PromptInventoryReport {
152
+ const resolvedRoot = root;
153
+ const paths = listPromptSurfacePaths(resolvedRoot);
154
+ const surfaces = paths.map((path) => inventorySurface(resolvedRoot, path));
155
+ return {
156
+ generatedAt,
157
+ root: resolvedRoot,
158
+ totals: {
159
+ files: surfaces.length,
160
+ lines: surfaces.reduce((sum, surface) => sum + surface.lines, 0),
161
+ approximateTokens: surfaces.reduce((sum, surface) => sum + surface.approximateTokens, 0),
162
+ absoluteDirectiveCount: surfaces.reduce((sum, surface) => sum + surface.absoluteDirectiveCount, 0),
163
+ },
164
+ surfaces,
165
+ duplicateFragmentFamilies: duplicateFragmentFamilies(resolvedRoot, paths),
166
+ };
167
+ }
168
+
169
+ export function renderPromptInventoryMarkdown(report: PromptInventoryReport): string {
170
+ const rows = report.surfaces.map((surface) => {
171
+ const markerHits = Object.entries(surface.markers)
172
+ .filter(([, count]) => count > 0)
173
+ .map(([marker, count]) => `${marker} (${count})`)
174
+ .join('<br>');
175
+ return `| ${surface.path} | ${surface.lines} | ${surface.approximateTokens} | ${surface.absoluteDirectiveCount} | ${markerHits || '—'} |`;
176
+ });
177
+
178
+ const duplicates = report.duplicateFragmentFamilies.length === 0
179
+ ? ['- None detected.']
180
+ : report.duplicateFragmentFamilies.map(
181
+ (family) => `- ${family.count} files: ${family.text}\n - ${family.paths.join(', ')}`,
182
+ );
183
+
184
+ return [
185
+ '# Prompt Inventory',
186
+ '',
187
+ `Generated: ${report.generatedAt}`,
188
+ `Root: ${relative(process.cwd(), report.root) || '.'}`,
189
+ '',
190
+ '## Totals',
191
+ '',
192
+ `- Files: ${report.totals.files}`,
193
+ `- Lines: ${report.totals.lines}`,
194
+ `- Approximate tokens: ${report.totals.approximateTokens}`,
195
+ `- Absolute directive lines: ${report.totals.absoluteDirectiveCount}`,
196
+ '',
197
+ '## Surfaces',
198
+ '',
199
+ '| Path | Lines | Approx. tokens | Absolute directive lines | Markers |',
200
+ '| --- | ---: | ---: | ---: | --- |',
201
+ ...rows,
202
+ '',
203
+ '## Duplicated fragment families',
204
+ '',
205
+ ...duplicates,
206
+ '',
207
+ ].join('\n');
208
+ }
209
+
210
+ if (import.meta.url === `file://${process.argv[1]}`) {
211
+ const root = process.argv.includes('--root') ? process.argv[process.argv.indexOf('--root') + 1] : process.cwd();
212
+ const report = buildPromptInventory(root);
213
+ if (process.argv.includes('--json')) {
214
+ console.log(JSON.stringify(report, null, 2));
215
+ } else {
216
+ console.log(renderPromptInventoryMarkdown(report));
217
+ }
218
+ }
@@ -62,6 +62,7 @@ console.error(
62
62
 
63
63
  const childEnv = { ...process.env };
64
64
  delete childEnv.NODE_TEST_CONTEXT;
65
+ childEnv.OMX_TEST_RELAX_TMUX_TIMEOUT = '1';
65
66
 
66
67
  const result = spawnSync(process.execPath, testArgs, {
67
68
  stdio: 'inherit',
@@ -37,99 +37,59 @@ Keep runtime marker contracts stable and non-destructive when overlays are appli
37
37
  - Check official documentation before implementing with unfamiliar SDKs, frameworks, or APIs.
38
38
  - Within a single Codex session or team pane, use Codex native subagents for independent, bounded parallel subtasks when that improves throughput.
39
39
  <!-- OMX:GUIDANCE:OPERATING:START -->
40
- - Default to quality-first, intent-deepening responses; think one more step before replying or asking for clarification, and use as much detail as needed for a strong result without empty verbosity.
41
- - Proceed automatically on clear, low-risk, reversible next steps; ask only for irreversible, side-effectful, or materially branching actions.
40
+ - Default to outcome-first, quality-focused responses: identify the user's target result, success criteria, constraints, available evidence, expected output, and stop condition before adding process detail.
41
+ - Keep collaboration style short and direct. Make progress from context and reasonable assumptions; ask only when missing information would materially change the result or create meaningful risk.
42
+ - Start multi-step or tool-heavy work with a concise visible preamble that acknowledges the request and names the first step; keep later updates brief and evidence-based.
43
+ - Proceed automatically on clear, low-risk, reversible next steps; ask only for irreversible, credential-gated, external-production, destructive, or materially scope-changing actions.
42
44
  - AUTO-CONTINUE for clear, already-requested, low-risk, reversible, local edit-test-verify work; keep inspecting, editing, testing, and verifying without permission handoff.
43
45
  - ASK only for destructive, irreversible, credential-gated, external-production, or materially scope-changing actions, or when missing authority blocks progress.
44
46
  - On AUTO-CONTINUE branches, do not use permission-handoff phrasing; state the next action or evidence-backed result.
45
47
  - Keep going unless blocked; finish the current safe branch before asking for confirmation or handoff.
46
48
  - Ask only when blocked by missing information, missing authority, or an irreversible/destructive branch.
49
+ - Use absolute language only for true invariants: safety, security, side-effect boundaries, required output fields, workflow state transitions, and product contracts.
47
50
  - Do not ask or instruct humans to perform ordinary non-destructive, reversible actions; execute those safe reversible OMX/runtime operations and ordinary commands yourself.
48
51
  - Treat OMX runtime manipulation, state transitions, and ordinary command execution as agent responsibilities when they are safe and reversible.
49
52
  - Treat newer user task updates as local overrides for the active task while preserving earlier non-conflicting instructions.
50
53
  - When the user provides newer same-thread evidence (for example logs, stack traces, or test output), treat it as the current source of truth, re-evaluate earlier hypotheses against it, and do not anchor on older evidence unless the user reaffirms it.
51
- - Persist with tool use when correctness depends on retrieval, inspection, execution, or verification; do not skip prerequisites just because the likely answer seems obvious.
52
- - More effort does not mean reflexive web/tool escalation; browse or use tools when the task materially benefits, not as a default show of effort.
54
+ - Persist with retrieval, inspection, diagnostics, tests, or tool use only while they materially improve correctness, required citations, validation, or safe execution; stop once the core request is answerable with sufficient evidence.
55
+ - More effort does not mean reflexive web/tool escalation; re-evaluate low/medium effort and the smallest useful tool loop before escalating reasoning or retrieval.
53
56
  <!-- OMX:GUIDANCE:OPERATING:END -->
54
57
  </operating_principles>
55
58
 
56
59
  ## Working agreements
57
- - Write a cleanup plan before modifying code for cleanup/refactor/deslop work.
58
- - Lock existing behavior with regression tests before cleanup edits when behavior is not already protected.
59
- - Prefer deletion over addition.
60
- - Reuse existing utils and patterns before introducing new abstractions.
61
- - No new dependencies without explicit request.
60
+ - For cleanup/refactor/deslop work, write a cleanup plan and lock behavior with regression tests before editing when coverage is missing.
61
+ - Prefer deletion, existing utilities, and existing patterns before new abstractions; add dependencies only when explicitly requested.
62
62
  - Keep diffs small, reviewable, and reversible.
63
- - Run lint, typecheck, tests, and static analysis after changes.
64
- - Final reports must include changed files, simplifications made, and remaining risks.
63
+ - Verify with lint, typecheck, tests, and static analysis after changes; final reports include changed files, simplifications, and remaining risks.
65
64
 
66
65
  <lore_commit_protocol>
67
66
  ## Lore Commit Protocol
68
67
 
69
- Every commit message must follow the Lore protocol structured decision records using native git trailers.
70
- Commits are not just labels on diffs; they are the atomic unit of institutional knowledge.
68
+ Every commit message must follow the Lore protocol: a concise decision record using git-native trailers.
71
69
 
72
70
  ### Format
73
71
 
74
72
  ```
75
73
  <intent line: why the change was made, not what changed>
76
74
 
77
- <body: narrative context — constraints, approach rationale>
75
+ <optional concise body: constraints and approach rationale>
78
76
 
79
77
  Constraint: <external constraint that shaped the decision>
80
78
  Rejected: <alternative considered> | <reason for rejection>
81
79
  Confidence: <low|medium|high>
82
80
  Scope-risk: <narrow|moderate|broad>
83
81
  Directive: <forward-looking warning for future modifiers>
84
- Tested: <what was verified (unit, integration, manual)>
82
+ Tested: <what was verified>
85
83
  Not-tested: <known gaps in verification>
86
84
  ```
87
85
 
88
86
  ### Rules
89
87
 
90
- 1. **Intent line first.** The first line describes *why*, not *what*. The diff already shows what changed.
91
- 2. **Trailers are optional but encouraged.** Use the ones that add value; skip the ones that don't.
92
- 3. **`Rejected:` prevents re-exploration.** If you considered and rejected an alternative, record it so future agents don't waste cycles re-discovering the same dead end.
93
- 4. **`Directive:` is a message to the future.** Use it for "do not change X without checking Y" warnings.
94
- 5. **`Constraint:` captures external forces.** API limitations, policy requirements, upstream bugs — things not visible in the code.
95
- 6. **`Not-tested:` is honest.** Declaring known verification gaps is more valuable than pretending everything is covered.
96
- 7. **All trailers use git-native trailer format** (key-value after a blank line). No custom parsing required.
97
-
98
- ### Example
99
-
100
- ```
101
- Prevent silent session drops during long-running operations
102
-
103
- The auth service returns inconsistent status codes on token
104
- expiry, so the interceptor catches all 4xx responses and
105
- triggers an inline refresh.
106
-
107
- Constraint: Auth service does not support token introspection
108
- Constraint: Must not add latency to non-expired-token paths
109
- Rejected: Extend token TTL to 24h | security policy violation
110
- Rejected: Background refresh on timer | race condition with concurrent requests
111
- Confidence: high
112
- Scope-risk: narrow
113
- Directive: Error handling is intentionally broad (all 4xx) — do not narrow without verifying upstream behavior
114
- Tested: Single expired token refresh (unit)
115
- Not-tested: Auth service cold-start > 500ms behavior
116
- ```
117
-
118
- ### Trailer Vocabulary
119
-
120
- | Trailer | Purpose |
121
- |---------|---------|
122
- | `Constraint:` | External constraint that shaped the decision |
123
- | `Rejected:` | Alternative considered and why it was rejected |
124
- | `Confidence:` | Author's confidence level (low/medium/high) |
125
- | `Scope-risk:` | How broadly the change affects the system (narrow/moderate/broad) |
126
- | `Reversibility:` | How easily the change can be undone (clean/messy/irreversible) |
127
- | `Directive:` | Forward-looking instruction for future modifiers |
128
- | `Tested:` | What verification was performed |
129
- | `Not-tested:` | Known gaps in verification |
130
- | `Related:` | Links to related commits, issues, or decisions |
131
-
132
- Teams may introduce domain-specific trailers without breaking compatibility.
88
+ - Intent line first; describe why, not what.
89
+ - Use trailers only when they add decision context.
90
+ - Use `Rejected:` for alternatives future agents should not re-explore.
91
+ - Use `Directive:` for warnings, `Constraint:` for external forces, and `Not-tested:` for known verification gaps.
92
+ - Teams may introduce domain-specific trailers without breaking compatibility.
133
93
  </lore_commit_protocol>
134
94
 
135
95
  ---
@@ -204,13 +164,7 @@ Leader/workflow routing contract:
204
164
  ---
205
165
 
206
166
  <agent_catalog>
207
- Key roles:
208
- - `explore` — fast codebase search and mapping
209
- - `planner` — work plans and sequencing
210
- - `architect` — read-only analysis, diagnosis, tradeoffs
211
- - `debugger` — root-cause analysis
212
- - `executor` — implementation and refactoring
213
- - `verifier` — completion evidence and validation
167
+ Key roles: `explore` (repo search/mapping), `planner` (plans/sequencing), `architect` (read-only design/diagnosis), `debugger` (root cause), `executor` (implementation/refactoring), and `verifier` (completion evidence).
214
168
 
215
169
  Research/discovery specialists:
216
170
  - `explore` — first-stop repository lookup and symbol/file mapping
@@ -227,14 +181,14 @@ Keyword routing is implemented primarily by native `UserPromptSubmit` hooks and
227
181
 
228
182
  Fallback behavior when hook context is unavailable:
229
183
  - Explicit `$name` invocations run left-to-right and override implicit keywords.
230
- - Bare skill names do not activate skills by themselves; skill-name activation requires explicit `$skill` invocation. Natural-language routing phrases may still map to a workflow when they are not just the bare skill name. Examples: `analyze` / `investigate` → `$analyze` for read-only deep analysis with ranked synthesis, explicit confidence, and concrete file references; `deep interview`, `interview`, `don't assume`, or `ouroboros` → `$deep-interview`; `ralplan` / `consensus plan` → `$ralplan`; `cancel`, `stop`, or `abort` → `$cancel`.
184
+ - Bare skill names do not activate skills by themselves; skill-name activation requires explicit `$skill` invocation. Natural-language routing phrases may still map to a workflow when they are not just the bare skill name. Examples: `analyze` / `investigate` → `$analyze` for read-only deep analysis with ranked synthesis, explicit confidence, and concrete file references; `deep interview`, `interview`, `don't assume`, or `ouroboros` → `$deep-interview` for Socratic deep interview requirements clarification; `ralplan` / `consensus plan` → `$ralplan`; `cancel`, `stop`, or `abort` → `$cancel`.
231
185
  - Keep the detailed keyword list in `src/hooks/keyword-registry.ts`; do not duplicate that table here.
232
186
 
233
187
  Runtime availability gate:
234
188
  - Treat `autopilot`, `ralph`, `ultrawork`, `ultraqa`, `team`/`swarm`, and `ecomode` as **OMX runtime workflows**, not generic prompt aliases.
235
189
  - Auto-activate runtime workflows only when the current session is actually running under OMX CLI/runtime (for example, launched via `omx`, with OMX session overlay/runtime state available, or when the user explicitly asks to run `omx ...` in the shell).
236
190
  - In Codex App or plain Codex sessions without OMX runtime, do **not** treat those keywords alone as activation. Explain that they require OMX CLI runtime support and are not directly available there, and continue with the nearest App-safe surface (`deep-interview`, `ralplan`, `plan`, or native subagents) unless the user explicitly wants you to launch OMX CLI from shell first.
237
- - When deep-interview is active in OMX CLI/runtime, ask interview rounds via `omx question`; after launching `omx question` in a background terminal, wait for that terminal to finish and read the JSON answer before continuing; do not substitute `request_user_input` or ad hoc plain-text questioning, and respect Stop-hook blocking while a deep-interview question obligation is pending.
191
+ - When deep-interview is active in attached-tmux OMX CLI/runtime, ask each interview round via `omx question` as a temporary popup-style renderer over the leader pane; after launching `omx question` in a background terminal, wait for that terminal to finish and read the JSON answer before continuing; preserve the leader pane with `OMX_QUESTION_RETURN_PANE=$TMUX_PANE` (or an explicit `%pane` value) when invoking it through Bash/tool paths, prefer `answers[0].answer` / `answers[]` from the response and use legacy `answer` only as fallback, and respect Stop-hook blocking while a deep-interview question obligation is pending. Deep-interview remains one question per round; do not batch multiple interview rounds into one `questions[]` form. Outside tmux or native surfaces that cannot render `omx question` should use the native structured question path when available, otherwise ask exactly one concise plain-text question and wait for the answer.
238
192
 
239
193
  <triage_routing>
240
194
  ## Triage: advisory prompt-routing context
@@ -259,15 +213,13 @@ Ralph / Ralplan execution gate:
259
213
  ---
260
214
 
261
215
  <skills>
262
- Skills are workflow commands.
263
- Core workflows include `autopilot`, `ralph`, `ultrawork`, `visual-verdict`, `visual-ralph`, `ecomode`, `team`, `swarm`, `ultraqa`, `plan`, `deep-interview` (Socratic deep interview, Ouroboros-inspired), and `ralplan`.
264
- Utilities include `cancel`, `note`, `doctor`, `help`, and `trace`.
216
+ Skills are workflow commands. Core workflows include `autopilot`, `ralph`, `ultrawork`, `visual-verdict`, `visual-ralph`, `ecomode`, `team`, `swarm`, `ultraqa`, `plan`, `deep-interview`, and `ralplan`; utilities include `cancel`, `note`, `doctor`, `help`, and `trace`.
265
217
  </skills>
266
218
 
267
219
  ---
268
220
 
269
221
  <team_compositions>
270
- Common team compositions remain available when explicit team orchestration is warranted, for example feature development, bug investigation, code review, and UX audit.
222
+ Use explicit team orchestration for feature development, bug investigation, code review, UX audit, and similar multi-lane work when coordination value outweighs overhead.
271
223
  </team_compositions>
272
224
 
273
225
  ---
@@ -309,33 +261,23 @@ Sizing guidance:
309
261
  - Large or security/architectural changes: thorough verification
310
262
 
311
263
  <!-- OMX:GUIDANCE:VERIFYSEQ:START -->
312
- Verification loop: identify what proves the claim, run the verification, read the output, then report with evidence. If verification fails, continue iterating rather than reporting incomplete work. Default to quality-first evidence summaries: think one more step before declaring completion, and include enough detail to make the proof actionable without padding.
264
+ Verification loop: define the claim and success criteria, run the smallest validation that can prove it, read the output, then report with evidence. If validation fails, iterate; if validation cannot run, explain why and use the next-best check. Keep evidence summaries concise but sufficient.
313
265
 
314
266
  - Run dependent tasks sequentially; verify prerequisites before starting downstream actions.
315
267
  - If a task update changes only the current branch of work, apply it locally and continue without reinterpreting unrelated standing instructions.
316
- - When correctness depends on retrieval, diagnostics, tests, or other tools, continue using them until the task is grounded and verified.
268
+ - For coding work, prefer targeted tests for changed behavior, then typecheck/lint/build/smoke checks when applicable; do not claim completion without fresh evidence or an explicit validation gap.
269
+ - When correctness depends on retrieval, diagnostics, tests, or other tools, continue only until the task is grounded and verified; avoid extra loops that only improve phrasing or gather nonessential evidence.
317
270
  <!-- OMX:GUIDANCE:VERIFYSEQ:END -->
318
271
  </verification>
319
272
 
320
273
  <execution_protocols>
321
- Mode selection:
322
- - Use `$deep-interview` first when the request is broad, intent/boundaries are unclear, or the user says not to assume.
323
- - Use `$ralplan` when the requirements are clear enough but architecture, tradeoffs, or test strategy still need consensus.
324
- - Use `$team` when the approved plan has multiple independent lanes, shared blockers, or durable coordination needs.
325
- - Use `$ralph` when the approved plan should stay in a persistent completion / verification loop with one owner.
326
- - Otherwise execute directly in solo mode.
327
- - Do not change modes casually; switch only when evidence shows the current lane is mismatched or blocked.
274
+ Mode selection: use `$deep-interview` for unclear intent/boundaries; `$ralplan` for consensus on architecture, tradeoffs, or tests; `$team` for approved multi-lane work; `$ralph` for persistent single-owner completion/verification loops; otherwise execute directly in solo mode. Switch modes only when evidence shows the current lane is mismatched or blocked.
328
275
 
329
276
  Command routing:
330
277
  - When `USE_OMX_EXPLORE_CMD` enables advisory routing, strongly prefer `omx explore` as the default surface for simple read-only repository lookup tasks (files, symbols, patterns, relationships).
331
278
  - For simple file/symbol lookups, use `omx explore` FIRST before attempting full code analysis.
332
279
 
333
- When to use what:
334
- - Use `omx explore --prompt ...` for simple read-only lookups.
335
- - Use `omx sparkshell` for noisy read-only shell commands, bounded verification runs, repo-wide listing/search, or tmux-pane summaries; `omx sparkshell --tmux-pane ...` is explicit opt-in.
336
- - Keep ambiguous, implementation-heavy, edit-heavy, or non-shell-only work on the richer normal path.
337
- - `omx explore` is a shell-only, allowlisted, read-only path; do not rely on it for edits, tests, diagnostics, MCP/web access, or complex shell composition.
338
- - If `omx explore` or `omx sparkshell` is incomplete or ambiguous, retry narrower and gracefully fall back to the normal path.
280
+ Use `omx explore --prompt ...` for simple read-only lookups through the shell-only, allowlisted, read-only path. Use `omx sparkshell` for noisy read-only shell commands, bounded verification, repo-wide listing/search, or explicit `omx sparkshell --tmux-pane` summaries. Treat sparkshell as explicit opt-in. When to use what: keep ambiguous, implementation-heavy, edit-heavy, diagnostics, tests, MCP/web, and complex shell work on the normal path; if `omx explore` or `omx sparkshell` is incomplete, retry narrower or gracefully fall back to the normal path.
339
281
 
340
282
  Leader vs worker:
341
283
  - The leader chooses the mode, keeps the brief current, delegates bounded work, and owns verification plus stop/escalate calls.
@@ -353,18 +295,15 @@ Output contract:
353
295
  - Keep rationale once; do not restate the full plan every turn.
354
296
  - Expand only for risk, handoff, or explicit user request.
355
297
 
356
- Parallelization:
357
- - Run independent tasks in parallel.
358
- - Run dependent tasks sequentially.
359
- - Use background execution for builds and tests when helpful.
360
- - Prefer Team mode only when its coordination value outweighs its overhead.
361
- - If correctness depends on retrieval, diagnostics, tests, or other tools, continue using them until the task is grounded and verified.
298
+ Parallelization: run independent tasks in parallel, dependent tasks sequentially, and long builds/tests in the background when helpful. Prefer Team mode only when coordination value outweighs overhead. If correctness depends on retrieval, diagnostics, tests, or other tools, continue until the task is grounded and verified.
362
299
 
363
300
  Anti-slop workflow:
364
301
  - Cleanup/refactor/deslop work still follows the same `$deep-interview` -> `$ralplan` -> `$team`/`$ralph` path; use `$ai-slop-cleaner` as a bounded helper inside the chosen execution lane, not as a competing top-level workflow.
365
- - Lock behavior with tests first, then make one smell-focused pass at a time.
366
- - Prefer deletion, reuse, and boundary repair over new layers.
367
- - Keep writer/reviewer pass separation for cleanup plans and approvals.
302
+ - Write a cleanup plan before modifying code; lock existing behavior with regression tests first, then make one smell-focused pass at a time.
303
+ - Prefer deletion over addition, and prefer reuse plus boundary repair over new layers.
304
+ - No new dependencies without explicit request.
305
+ - Run lint, typecheck, tests, and static analysis before claiming completion.
306
+ - Keep writer/reviewer pass separation for cleanup plans and approvals; preserve writer/reviewer pass separation explicitly.
368
307
 
369
308
  Visual iteration gate:
370
309
  - For visual tasks, run `$visual-verdict` every iteration before the next edit.