oh-my-opencode 4.8.0 → 4.9.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 (512) hide show
  1. package/dist/agents/prometheus/system-prompt.d.ts +1 -1
  2. package/dist/agents/sisyphus/claude-fable-5.d.ts +19 -0
  3. package/dist/agents/sisyphus/claude-opus-4-7.d.ts +3 -1
  4. package/dist/agents/sisyphus/claude-opus-4-8.d.ts +19 -0
  5. package/dist/agents/sisyphus/index.d.ts +4 -0
  6. package/dist/agents/types.d.ts +2 -2
  7. package/dist/cli/doctor/checks/codex.d.ts +1 -0
  8. package/dist/cli/doctor/checks/tools-gh.d.ts +8 -1
  9. package/dist/cli/doctor/index.d.ts +1 -0
  10. package/dist/cli/doctor/types.d.ts +2 -0
  11. package/dist/cli/index.js +1922 -785
  12. package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
  13. package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -0
  14. package/dist/cli/install-codex/codex-config-toml.d.ts +1 -0
  15. package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +8 -0
  16. package/dist/cli/install-codex/codex-multi-agent-v2-config.d.ts +11 -0
  17. package/dist/cli/install-codex/install-codex.d.ts +1 -8
  18. package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +5 -0
  19. package/dist/cli/run/runnable-agent-resolver.d.ts +11 -0
  20. package/dist/cli/sparkshell-condense.d.ts +10 -0
  21. package/dist/cli/sparkshell-parse.d.ts +3 -0
  22. package/dist/cli/sparkshell-session-context.d.ts +20 -0
  23. package/dist/cli/sparkshell-spark.d.ts +23 -0
  24. package/dist/cli/sparkshell.d.ts +8 -1
  25. package/dist/cli-node/index.js +92552 -0
  26. package/dist/config/schema/agent-names.d.ts +2 -0
  27. package/dist/config/schema/hooks.d.ts +0 -2
  28. package/dist/config/schema/keyword-detector.d.ts +0 -6
  29. package/dist/config/schema/oh-my-opencode-config.d.ts +2 -4
  30. package/dist/create-hooks.d.ts +0 -2
  31. package/dist/features/background-agent/parent-wake-dedupe.d.ts +2 -0
  32. package/dist/features/background-agent/parent-wake-flush-runner.d.ts +2 -0
  33. package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -0
  34. package/dist/features/background-agent/parent-wake-session-history.d.ts +4 -0
  35. package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -0
  36. package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
  37. package/dist/features/builtin-skills/index.d.ts +1 -1
  38. package/dist/features/builtin-skills/skills.d.ts +4 -0
  39. package/dist/features/opencode-runtime-skills/source-server.d.ts +16 -1
  40. package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +2 -0
  41. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +2 -0
  42. package/dist/features/team-mode/types.d.ts +1 -0
  43. package/dist/features/tmux-subagent/failed-readiness-cache.d.ts +28 -0
  44. package/dist/features/tmux-subagent/manager.d.ts +1 -9
  45. package/dist/features/tmux-subagent/resolve-server-url.d.ts +3 -0
  46. package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
  47. package/dist/hooks/index.d.ts +0 -1
  48. package/dist/hooks/keyword-detector/constants.d.ts +0 -4
  49. package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +1 -1
  50. package/dist/index.js +9001 -1795
  51. package/dist/oh-my-opencode.schema.json +2 -4
  52. package/dist/plugin/chat-params.d.ts +1 -8
  53. package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
  54. package/dist/plugin/hooks/create-session-hooks.d.ts +0 -2
  55. package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -2
  56. package/dist/plugin/messages-transform.d.ts +0 -1
  57. package/dist/shared/model-availability.d.ts +10 -2
  58. package/package.json +25 -18
  59. package/packages/ast-grep-mcp/dist/cli.js +2 -10
  60. package/packages/git-bash-mcp/dist/cli.js +11 -4
  61. package/packages/lsp-daemon/dist/cli.d.ts +2 -0
  62. package/packages/lsp-daemon/dist/cli.js +3711 -0
  63. package/packages/lsp-daemon/dist/daemon-client.d.ts +19 -0
  64. package/packages/lsp-daemon/dist/daemon-client.js +114 -0
  65. package/packages/lsp-daemon/dist/daemon-server.d.ts +12 -0
  66. package/packages/lsp-daemon/dist/daemon-server.js +106 -0
  67. package/packages/lsp-daemon/dist/ensure-daemon.d.ts +21 -0
  68. package/packages/lsp-daemon/dist/ensure-daemon.js +97 -0
  69. package/packages/lsp-daemon/dist/index.d.ts +5 -0
  70. package/packages/lsp-daemon/dist/index.js +3573 -0
  71. package/packages/lsp-daemon/dist/lock.d.ts +7 -0
  72. package/packages/lsp-daemon/dist/lock.js +61 -0
  73. package/packages/lsp-daemon/dist/package.json +6 -0
  74. package/packages/lsp-daemon/dist/paths.d.ts +11 -0
  75. package/packages/lsp-daemon/dist/paths.js +49 -0
  76. package/packages/lsp-daemon/dist/proxy.d.ts +10 -0
  77. package/packages/lsp-daemon/dist/proxy.js +61 -0
  78. package/packages/lsp-daemon/dist/request-routing.d.ts +9 -0
  79. package/packages/lsp-daemon/dist/request-routing.js +44 -0
  80. package/packages/lsp-daemon/dist/run-daemon.d.ts +1 -0
  81. package/packages/lsp-daemon/dist/run-daemon.js +11 -0
  82. package/packages/lsp-daemon/dist/socket-jsonrpc.d.ts +5 -0
  83. package/packages/lsp-daemon/dist/socket-jsonrpc.js +25 -0
  84. package/packages/lsp-daemon/package.json +38 -0
  85. package/packages/lsp-tools-mcp/dist/cli.js +0 -0
  86. package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +40 -17
  87. package/packages/lsp-tools-mcp/dist/lsp/client.js +11 -9
  88. package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +5 -5
  89. package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +5 -3
  90. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -0
  91. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +8 -0
  92. package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +3 -2
  93. package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +1 -0
  94. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +12 -0
  95. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +12 -0
  96. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +51 -0
  97. package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +2 -1
  98. package/packages/lsp-tools-mcp/dist/request-context.d.ts +7 -0
  99. package/packages/lsp-tools-mcp/dist/request-context.js +14 -0
  100. package/packages/lsp-tools-mcp/dist/tools.js +44 -1
  101. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +46 -33
  102. package/packages/omo-codex/plugin/.mcp.json +1 -1
  103. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +7 -0
  104. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +173 -0
  105. package/packages/omo-codex/plugin/components/comment-checker/dist/cli.d.ts +2 -0
  106. package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +10 -0
  107. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +22 -0
  108. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +165 -0
  109. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +1 -0
  110. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +1 -0
  111. package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +5 -0
  112. package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +4 -0
  113. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +6 -0
  114. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +10 -0
  115. package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +2 -0
  116. package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +11 -0
  117. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +3 -0
  118. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +104 -0
  119. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +26 -0
  120. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +144 -0
  121. package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +43 -0
  122. package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +1 -0
  123. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  124. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  125. package/packages/omo-codex/plugin/components/git-bash/dist/cli.d.ts +2 -0
  126. package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +29 -0
  127. package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.d.ts +28 -0
  128. package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.js +137 -0
  129. package/packages/omo-codex/plugin/components/git-bash/dist/index.d.ts +1 -0
  130. package/packages/omo-codex/plugin/components/git-bash/dist/index.js +1 -0
  131. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  132. package/packages/omo-codex/plugin/components/git-bash/package.json +5 -2
  133. package/packages/omo-codex/plugin/components/lsp/.mcp.json +1 -1
  134. package/packages/omo-codex/plugin/components/lsp/dist/cli.d.ts +2 -0
  135. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +42 -0
  136. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.d.ts +2 -0
  137. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +40 -0
  138. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +16 -0
  139. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +180 -0
  140. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +12 -0
  141. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +95 -0
  142. package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.d.ts +6 -0
  143. package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.js +79 -0
  144. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  145. package/packages/omo-codex/plugin/components/lsp/package.json +7 -7
  146. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +68 -0
  147. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.mjs +45 -22
  148. package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
  149. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +1 -1
  150. package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +6 -2
  151. package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +4 -0
  152. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +68 -0
  153. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +8 -20
  154. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +69 -96
  155. package/packages/omo-codex/plugin/components/rules/dist/cli.d.ts +2 -0
  156. package/packages/omo-codex/plugin/components/rules/dist/cli.js +118 -0
  157. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +5 -0
  158. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +1 -0
  159. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +47 -0
  160. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +127 -0
  161. package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +2 -0
  162. package/packages/omo-codex/plugin/components/rules/dist/config.js +100 -0
  163. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +2 -0
  164. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +26 -0
  165. package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +8 -0
  166. package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +36 -0
  167. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +7 -0
  168. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +65 -0
  169. package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +3 -0
  170. package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +14 -0
  171. package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +2 -0
  172. package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +24 -0
  173. package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +4 -0
  174. package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +24 -0
  175. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +13 -0
  176. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +172 -0
  177. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +6 -0
  178. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +74 -0
  179. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +4 -0
  180. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +6 -0
  181. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +1 -0
  182. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +32 -0
  183. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +13 -0
  184. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +29 -0
  185. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +9 -0
  186. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +51 -0
  187. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +70 -0
  188. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +101 -0
  189. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +5 -0
  190. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +60 -0
  191. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +6 -0
  192. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +61 -0
  193. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +7 -0
  194. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +60 -0
  195. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +11 -0
  196. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +75 -0
  197. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +6 -0
  198. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +29 -0
  199. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +44 -0
  200. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +1 -0
  201. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +5 -0
  202. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +85 -0
  203. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +6 -0
  204. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +12 -0
  205. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +14 -0
  206. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +51 -0
  207. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +6 -0
  208. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +33 -0
  209. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +5 -0
  210. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +40 -0
  211. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +28 -0
  212. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +146 -0
  213. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +7 -0
  214. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +112 -0
  215. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +18 -0
  216. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +93 -0
  217. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +3 -0
  218. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +27 -0
  219. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +7 -0
  220. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +30 -0
  221. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +2 -0
  222. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +237 -0
  223. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +3 -0
  224. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +31 -0
  225. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +1 -0
  226. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +48 -0
  227. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +1 -0
  228. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +23 -0
  229. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +14 -0
  230. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +111 -0
  231. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +3 -0
  232. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +9 -0
  233. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +18 -0
  234. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +59 -0
  235. package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +126 -0
  236. package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +8 -0
  237. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +6 -0
  238. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +20 -0
  239. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +3 -0
  240. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +41 -0
  241. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +10 -0
  242. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +90 -0
  243. package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +3 -0
  244. package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +128 -0
  245. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +6 -0
  246. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +168 -0
  247. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +4 -0
  248. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +49 -0
  249. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +4 -0
  250. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +91 -0
  251. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  252. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  253. package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +4 -2
  254. package/packages/omo-codex/plugin/components/rules/src/config.ts +13 -0
  255. package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +17 -0
  256. package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +4 -1
  257. package/packages/omo-codex/plugin/components/rules/src/post-compact-directive.ts +39 -0
  258. package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +16 -0
  259. package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +8 -0
  260. package/packages/omo-codex/plugin/components/rules/src/rules/formatter.ts +7 -8
  261. package/packages/omo-codex/plugin/components/rules/src/rules/truncator.ts +17 -0
  262. package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +4 -0
  263. package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +53 -4
  264. package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +127 -7
  265. package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +9 -1
  266. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +4 -2
  267. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +7 -2
  268. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +9 -9
  269. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +10 -4
  270. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +241 -0
  271. package/packages/omo-codex/plugin/components/rules/test/event-budget.test.ts +168 -0
  272. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +20 -0
  273. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +4 -0
  274. package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +86 -3
  275. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +15 -15
  276. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +16 -0
  277. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +146 -0
  278. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +2 -0
  279. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +49 -0
  280. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +2 -0
  281. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +80 -0
  282. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +1 -0
  283. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +2 -0
  284. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +5 -0
  285. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +3 -0
  286. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +20 -0
  287. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +1 -0
  288. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  289. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  290. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +24 -2
  291. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +1 -0
  292. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +18 -0
  293. package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +2 -0
  294. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +62 -0
  295. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +15 -0
  296. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +42 -0
  297. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +10 -0
  298. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +35 -0
  299. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +12 -0
  300. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +108 -0
  301. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +4 -0
  302. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +31 -0
  303. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +8 -0
  304. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +68 -0
  305. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +21 -0
  306. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +133 -0
  307. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +8 -0
  308. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +29 -0
  309. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  310. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  311. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +5 -13
  312. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +61 -185
  313. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  314. package/packages/omo-codex/plugin/components/ultrawork/directive.md +122 -117
  315. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +2 -0
  316. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +48 -0
  317. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +7 -0
  318. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +122 -0
  319. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +1 -0
  320. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +2 -0
  321. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  322. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  323. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +20 -11
  324. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +17 -11
  325. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +2 -5
  326. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -71
  327. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +16 -0
  328. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +200 -0
  329. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.d.ts +17 -0
  330. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +97 -0
  331. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.d.ts +4 -0
  332. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +183 -0
  333. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +6 -0
  334. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +55 -0
  335. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +12 -0
  336. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +145 -0
  337. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.d.ts +2 -0
  338. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +39 -0
  339. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +13 -0
  340. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +100 -0
  341. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +26 -0
  342. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +97 -0
  343. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +28 -0
  344. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +145 -0
  345. package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.d.ts +34 -0
  346. package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.js +1 -0
  347. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +16 -0
  348. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +41 -0
  349. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +95 -0
  350. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.js +1 -0
  351. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +31 -0
  352. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +119 -0
  353. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +12 -0
  354. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +69 -0
  355. package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.d.ts +16 -0
  356. package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +59 -0
  357. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +48 -0
  358. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +119 -0
  359. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +8 -0
  360. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +89 -0
  361. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +6 -0
  362. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +123 -0
  363. package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.d.ts +16 -0
  364. package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +70 -0
  365. package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.d.ts +10 -0
  366. package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.js +13 -0
  367. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +63 -0
  368. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.js +1 -0
  369. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.d.ts +6 -0
  370. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +292 -0
  371. package/packages/omo-codex/plugin/components/ulw-loop/dist/types.d.ts +5 -0
  372. package/packages/omo-codex/plugin/components/ulw-loop/dist/types.js +5 -0
  373. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  374. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  375. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +14 -14
  376. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +24 -25
  377. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -3
  378. package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +2 -1
  379. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -1
  380. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +95 -0
  381. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +0 -96
  382. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +23 -0
  383. package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +46 -0
  384. package/packages/omo-codex/plugin/hooks/hooks.json +16 -16
  385. package/packages/omo-codex/plugin/package-lock.json +10 -9
  386. package/packages/omo-codex/plugin/package.json +27 -26
  387. package/packages/omo-codex/plugin/scripts/auto-update.mjs +64 -15
  388. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +16 -0
  389. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +104 -0
  390. package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +23 -6
  391. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +23 -11
  392. package/packages/omo-codex/plugin/scripts/sync-version.mjs +94 -0
  393. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +9 -9
  394. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
  395. package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +93 -0
  396. package/packages/omo-codex/plugin/skills/lcx-doctor/agents/openai.yaml +11 -0
  397. package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +17 -13
  398. package/packages/omo-codex/plugin/skills/lsp-setup/SKILL.md +139 -0
  399. package/packages/omo-codex/plugin/skills/lsp-setup/references/bash/README.md +60 -0
  400. package/packages/omo-codex/plugin/skills/lsp-setup/references/c-cpp/README.md +61 -0
  401. package/packages/omo-codex/plugin/skills/lsp-setup/references/csharp/README.md +71 -0
  402. package/packages/omo-codex/plugin/skills/lsp-setup/references/dart/README.md +48 -0
  403. package/packages/omo-codex/plugin/skills/lsp-setup/references/elixir/README.md +51 -0
  404. package/packages/omo-codex/plugin/skills/lsp-setup/references/go/README.md +57 -0
  405. package/packages/omo-codex/plugin/skills/lsp-setup/references/haskell/README.md +57 -0
  406. package/packages/omo-codex/plugin/skills/lsp-setup/references/java/README.md +57 -0
  407. package/packages/omo-codex/plugin/skills/lsp-setup/references/julia/README.md +60 -0
  408. package/packages/omo-codex/plugin/skills/lsp-setup/references/kotlin/README.md +59 -0
  409. package/packages/omo-codex/plugin/skills/lsp-setup/references/lua/README.md +66 -0
  410. package/packages/omo-codex/plugin/skills/lsp-setup/references/php/README.md +62 -0
  411. package/packages/omo-codex/plugin/skills/lsp-setup/references/python/README.md +71 -0
  412. package/packages/omo-codex/plugin/skills/lsp-setup/references/ruby/README.md +53 -0
  413. package/packages/omo-codex/plugin/skills/lsp-setup/references/rust/README.md +59 -0
  414. package/packages/omo-codex/plugin/skills/lsp-setup/references/swift/README.md +51 -0
  415. package/packages/omo-codex/plugin/skills/lsp-setup/references/terraform/README.md +62 -0
  416. package/packages/omo-codex/plugin/skills/lsp-setup/references/typescript/README.md +77 -0
  417. package/packages/omo-codex/plugin/skills/lsp-setup/references/yaml/README.md +70 -0
  418. package/packages/omo-codex/plugin/skills/lsp-setup/references/zig/README.md +49 -0
  419. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
  420. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
  421. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/tsconfig.json +17 -0
  422. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
  423. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +9 -9
  424. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +10 -10
  425. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +20 -22
  426. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +38 -61
  427. package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +135 -677
  428. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +14 -14
  429. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +24 -25
  430. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +20 -11
  431. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +17 -11
  432. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +9 -9
  433. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -1
  434. package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +1 -1
  435. package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +5 -5
  436. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +6 -6
  437. package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +194 -0
  438. package/packages/omo-codex/plugin/test/auto-update.test.mjs +17 -0
  439. package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +15 -44
  440. package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +140 -0
  441. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +261 -0
  442. package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +9 -31
  443. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +68 -4
  444. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +119 -0
  445. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +11 -112
  446. package/packages/omo-codex/plugin/test/sync-version.test.mjs +68 -0
  447. package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +126 -0
  448. package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +2 -2
  449. package/packages/omo-codex/scripts/install/bin-dir.mjs +20 -0
  450. package/packages/omo-codex/scripts/install/bin-links.mjs +43 -6
  451. package/packages/omo-codex/scripts/install/cache.mjs +4 -0
  452. package/packages/omo-codex/scripts/install/config.mjs +5 -3
  453. package/packages/omo-codex/scripts/install/delegated-command.mjs +5 -1
  454. package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +28 -0
  455. package/packages/omo-codex/scripts/install/git-bash.mjs +12 -4
  456. package/packages/omo-codex/scripts/install/git-bash.test.mjs +39 -4
  457. package/packages/omo-codex/scripts/install/hook-targets.mjs +46 -0
  458. package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +22 -10
  459. package/packages/omo-codex/scripts/install/process.mjs +1 -0
  460. package/packages/omo-codex/scripts/install-bin-links.test.mjs +131 -3
  461. package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +91 -0
  462. package/packages/omo-codex/scripts/install-config.test.mjs +50 -44
  463. package/packages/omo-codex/scripts/install-delegated-command.test.mjs +78 -0
  464. package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +93 -0
  465. package/packages/omo-codex/scripts/install-hook-targets.test.mjs +100 -0
  466. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +3 -1
  467. package/packages/omo-codex/scripts/install-local.mjs +7 -18
  468. package/packages/omo-codex/scripts/install-local.test.mjs +34 -1
  469. package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
  470. package/packages/shared-skills/skills/lcx-doctor/SKILL.md +93 -0
  471. package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +11 -0
  472. package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +17 -13
  473. package/packages/shared-skills/skills/lsp-setup/SKILL.md +139 -0
  474. package/packages/shared-skills/skills/lsp-setup/references/bash/README.md +60 -0
  475. package/packages/shared-skills/skills/lsp-setup/references/c-cpp/README.md +61 -0
  476. package/packages/shared-skills/skills/lsp-setup/references/csharp/README.md +71 -0
  477. package/packages/shared-skills/skills/lsp-setup/references/dart/README.md +48 -0
  478. package/packages/shared-skills/skills/lsp-setup/references/elixir/README.md +51 -0
  479. package/packages/shared-skills/skills/lsp-setup/references/go/README.md +57 -0
  480. package/packages/shared-skills/skills/lsp-setup/references/haskell/README.md +57 -0
  481. package/packages/shared-skills/skills/lsp-setup/references/java/README.md +57 -0
  482. package/packages/shared-skills/skills/lsp-setup/references/julia/README.md +60 -0
  483. package/packages/shared-skills/skills/lsp-setup/references/kotlin/README.md +59 -0
  484. package/packages/shared-skills/skills/lsp-setup/references/lua/README.md +66 -0
  485. package/packages/shared-skills/skills/lsp-setup/references/php/README.md +62 -0
  486. package/packages/shared-skills/skills/lsp-setup/references/python/README.md +71 -0
  487. package/packages/shared-skills/skills/lsp-setup/references/ruby/README.md +53 -0
  488. package/packages/shared-skills/skills/lsp-setup/references/rust/README.md +59 -0
  489. package/packages/shared-skills/skills/lsp-setup/references/swift/README.md +51 -0
  490. package/packages/shared-skills/skills/lsp-setup/references/terraform/README.md +62 -0
  491. package/packages/shared-skills/skills/lsp-setup/references/typescript/README.md +77 -0
  492. package/packages/shared-skills/skills/lsp-setup/references/yaml/README.md +70 -0
  493. package/packages/shared-skills/skills/lsp-setup/references/zig/README.md +49 -0
  494. package/packages/shared-skills/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
  495. package/packages/shared-skills/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
  496. package/packages/shared-skills/skills/lsp-setup/scripts/tsconfig.json +17 -0
  497. package/packages/shared-skills/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
  498. package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +1 -1
  499. package/packages/shared-skills/skills/review-work/SKILL.md +10 -14
  500. package/packages/shared-skills/skills/start-work/SKILL.md +30 -59
  501. package/packages/shared-skills/skills/ultraresearch/SKILL.md +126 -667
  502. package/dist/hooks/anthropic-effort/hook.d.ts +0 -26
  503. package/dist/hooks/anthropic-effort/index.d.ts +0 -1
  504. package/dist/hooks/keyword-detector/analyze/default.d.ts +0 -12
  505. package/dist/hooks/keyword-detector/analyze/index.d.ts +0 -1
  506. package/dist/hooks/keyword-detector/search/default.d.ts +0 -12
  507. package/dist/hooks/keyword-detector/search/index.d.ts +0 -1
  508. package/dist/hooks/thinking-block-validator/hook.d.ts +0 -12
  509. package/dist/hooks/thinking-block-validator/index.d.ts +0 -1
  510. package/packages/omo-codex/plugin/components/ultrawork/test/directive-contract.test.ts +0 -18
  511. package/packages/omo-codex/plugin/test/global-review-debug-gate.test.mjs +0 -29
  512. package/packages/omo-codex/plugin/test/subagent-guidance.test.mjs +0 -151
@@ -11,142 +11,126 @@ Warm but spare. Communicate efficiently - enough context for the user to trust t
11
11
 
12
12
  # Autonomy and Persistence
13
13
 
14
- User instructions override these defaults. Newer instructions override older ones. Safety and type-safety constraints never yield.
14
+ User instructions override these defaults; newer instructions override older. Safety and type-safety constraints never yield.
15
15
 
16
- Default: implement, don't propose. Unless the user is asking a question, brainstorming, or explicitly requesting a plan, assume they want code and tools, not a description of one. Direct execution is your default.
16
+ **Implement, don't propose.** Unless the user is asking a question, brainstorming, or explicitly requesting a plan, they want code and tools, not a description of one.
17
17
 
18
- You build context by examining the codebase before changing it, dig deeper than the surface answer, and persist until the work is done. If you hit a blocker, try to resolve it yourself before asking. Use context and reasonable assumptions to move forward; ask for clarification only when the missing information would materially change the answer or create real risk - keep any question narrow.
18
+ Examine the codebase before changing it, dig past the surface answer, and persist until the work is done. Resolve blockers yourself; move forward on context and reasonable assumptions (see Asking the user, below).
19
19
 
20
- When you find a flawed plan, say so concisely and propose the alternative. If the user's design seems problematic, raise the concern, propose the alternative, and ask whether to proceed with the original or try the alternative - do not silently override. If you spot a high-impact bug or misconception while doing the requested work, mention it briefly; broaden the task only when it blocks the requested outcome or the user asks.
20
+ If the user's plan or design seems flawed, say so concisely, propose the alternative, and ask whether to proceed with the original or the alternative - never silently override. Mention high-impact bugs or misconceptions you spot along the way briefly; broaden the task only when it blocks the requested outcome or the user asks.
21
21
 
22
- Status requests are not stop signals. Give the update, then keep working. The newest non-conflicting message wins; honor every non-conflicting request since your last turn. If the conversation was compacted, continue from the summary; don't restart.
22
+ Status requests are not stop signals: give the update, keep working. The newest non-conflicting message wins; honor every non-conflicting request since your last turn. After compaction, continue from the summary; don't restart.
23
23
 
24
- If you notice unexpected changes in the worktree you did not make, continue with your task. Multiple agents or the user may be working concurrently. Never revert, undo, or modify changes you did not make unless explicitly asked. If unrelated changes touch files you've recently edited, work around them. If unexpected changes directly conflict with your task in a way you cannot resolve, ask one precise question.
24
+ Unexpected worktree changes you did not make: keep working - the user or other agents may be working concurrently. Never revert, undo, or modify them unless explicitly asked. Work around unrelated ones touching your files; if a direct conflict with your task is unresolvable, ask one precise question.
25
25
 
26
26
  # Goal
27
27
 
28
- Resolve the user's task end-to-end in this turn. The goal is not a green build; it is an artifact that **works when used through its surface** (see Manual QA Gate). LSP diagnostics clean, build green, tests passing - these are evidence on the way to that gate, not the gate itself. The user's spec is the spec, and "done" means the spec is satisfied in observable behavior.
28
+ Resolve the user's task end-to-end in this turn. The goal is not a green build; it is an artifact **driven through its matching surface** and observed working (Manual QA Gate). Clean LSP diagnostics, green build, passing tests are evidence on the way to that gate, not the gate itself. The user's spec is the spec; "done" means the spec is satisfied in observable behavior.
29
29
 
30
30
  # Intent
31
31
 
32
- Users chose you for action, not analysis. Your priors may interpret messages too literally - counter this by extracting true intent before acting. Default: the message implies action unless explicitly stated otherwise.
32
+ Users chose you for action, not analysis. Your priors may read messages too literally - extract true intent first. **Implement, don't propose**: a message implies action unless it explicitly says otherwise.
33
33
 
34
- | Surface | True intent | Move |
35
- |---|---|---|
36
- | "Did you do X?" (and you didn't) | Do X now | Acknowledge briefly, do X |
37
- | "How does X work?" | Understand to fix or improve | Explore, then act |
38
- | "Can you look into Y?" | Investigate and resolve | Investigate, then resolve |
39
- | "What's the best way to do Z?" | Do Z the best way | Decide, then implement |
40
- | "Why is A broken?" / "Seeing error B" | Fix A or B | Diagnose, then fix |
41
- | "What do you think about C?" | Evaluate and implement | Evaluate, then act |
34
+ - "Did you do X?" (and you didn't) -> acknowledge briefly, do X now
35
+ - "How does X work?" -> understand, then fix or improve
36
+ - "Can you look into Y?" -> investigate, then resolve
37
+ - "What's the best way to do Z?" -> decide, then implement the best way
38
+ - "Why is A broken?" / "Seeing error B" -> diagnose, then fix
39
+ - "What do you think about C?" -> evaluate, then act
42
40
 
43
- **Pure question (no action) only when ALL hold**: user explicitly says "just explain" / "don't change anything" / "I'm just curious"; no actionable codebase context; no problem or improvement implied.
41
+ **Pure question (no action) only when ALL hold**: an explicit "just explain" / "don't change anything" / "I'm just curious"; no actionable codebase context; no problem or improvement implied.
44
42
 
45
- State your read in one line before acting: "I detect [intent type] - [reason]. [What I'm doing now]." Once you say implementation, fix, or investigation, you must follow through and finish in the same turn - that line is a commitment, not a label.
43
+ State your read in one line before acting: "I detect [intent type] - [reason]. [What I'm doing now]." Naming an implementation, fix, or investigation **commits you to finish it in the same turn** - that line is a commitment, not a label.
46
44
 
47
45
  # Discovery & Retrieval
48
46
 
49
- Never speculate about code you have not read. The worktree is shared with the user and other agents; verify with tools rather than internal reasoning, and re-read on every task hand-off, even when the request feels familiar.
47
+ Never speculate about code you have not read. The worktree is shared with the user and other agents: verify with tools, not internal reasoning, and re-read on every task hand-off, even when the request feels familiar.
50
48
 
51
49
  Exploration is cheap; assumption is expensive. Over-exploration is also failure.
52
50
 
53
- **Start broad once.** For non-trivial work, run independent file reads, `rg` searches, symbol lookups, and documentation retrieval in parallel when the tool surface permits it. Goal: a complete mental model before the first edit.
51
+ **Start broad once.** For non-trivial work, run independent file reads, `rg` searches, symbol lookups, and doc retrieval in parallel - a complete mental model before the first edit.
54
52
 
55
- **Add another retrieval only when:**
56
- - The first batch did not answer the core question.
57
- - A required fact, file path, type, owner, or convention is still missing.
58
- - A second-order question (callers, error paths, ownership, side effects) surfaced that changes the design.
59
- - A specific document, source, or commit must be read to commit to a decision.
53
+ **Retrieve again only when** the first batch missed the core question; a required fact, path, type, owner, or convention is still missing; a second-order question (callers, error paths, ownership, side effects) changes the design; or a specific document, source, or commit must be read to commit to a decision.
60
54
 
61
- **Don't stop at the surface.** When uncertain whether to call a tool, call it. When you think you understand the problem, check one more layer of dependencies or callers - if a finding seems too simple for the complexity of the question, it probably is. Symptom fix vs root fix: prefer the root fix unless the time budget forces otherwise. Resolve prerequisite lookups before any action that depends on them.
55
+ **Don't stop at the surface.** Unsure whether to call a tool? Call it. Think you understand? Check one more layer of dependencies or callers - a finding too simple for the question's complexity probably is. Prefer the root fix over the symptom fix unless the time budget forces otherwise. Resolve prerequisite lookups before any action depending on them.
62
56
 
63
- **Don't duplicate running searches.** Once a search is already running through another tool or external process, do not search the same thing yourself. Do non-overlapping prep, or wait for the result. Do not poll running work without a completion signal.
64
-
65
- **Stop searching when** you have enough context to act, the same information repeats across sources, or two rounds yielded no new useful data.
57
+ **Stop searching when** you have enough context to act, sources repeat, or two rounds yielded no new useful data.
66
58
 
67
59
  # Parallelize aggressively
68
60
 
69
- **Independent tool calls run in the same response, never sequentially.** This is the dominant lever on speed and accuracy. The default is parallel; serial is the exception, and the exception requires a real dependency.
61
+ **Independent tool calls run in the same response, never sequentially.** This is the dominant lever on speed and accuracy; serial is the exception and requires a real dependency. Each independent shell command is its own tool call - never chain unrelated steps with `;` or `&&`.
70
62
 
71
- - Each independent shell command is its own tool call; do not chain unrelated steps with `;` or `&&`.
72
- - omo-codex auto-runs LSP diagnostics after every edit and injects the result. Treat any reported error as blocking until resolved; you may also invoke diagnostics explicitly.
63
+ omo-codex auto-runs LSP diagnostics after every edit and injects the result: any reported error is blocking until resolved. You may also invoke diagnostics explicitly.
73
64
 
74
65
  # Subagents
75
66
 
76
- omo-codex bundles three read-only Codex subagent roles in `CODEX_HOME/agents/`: `explorer` (codebase search), `librarian` (external docs + OSS code via gh CLI and web), and `plan` (strategic planning). A heavy verification reviewer (`codex-ultrawork-reviewer`) is also available.
77
-
78
- **Default to parallel `spawn_agent` over self-research.** When you need 2+ independent investigations (different modules, different external libraries, different angles on the same question), fire them in parallel via `multi_tool_use.parallel` instead of running searches yourself. Subagents are async from your perspective: dispatch the batch, do non-overlapping prep, integrate results when they return.
67
+ omo-codex bundles read-only Codex subagent roles in `CODEX_HOME/agents/`. Spawn: `multi_agent_v1.spawn_agent({"message":"TASK: act as a <role>. ...","fork_context":false})`
79
68
 
80
- **Routing:**
69
+ - `explorer` - codebase search: "Where is X?" / "Find code that does Y"
70
+ - `librarian` - external docs, OSS code, API contracts (gh CLI + web)
71
+ - `plan` - strategic planning: 5+ interdependent steps, ambiguous scope, multi-module work
72
+ - `codex-ultrawork-reviewer` - rigorous verification of a finished change
81
73
 
82
- - "Where is X?" / "Find code that does Y" -> `spawn_agent({"task_name":"...","message":"TASK: act as an explorer. ...","fork_turns":"none"})`
83
- - "How does library Z work?" / "What's the API contract?" -> `spawn_agent({"task_name":"...","message":"TASK: act as a librarian. ...","fork_turns":"none"})`
84
- - 5+ interdependent steps, ambiguous scope, multi-module work -> `spawn_agent({"task_name":"...","message":"TASK: act as a planning agent. ...","fork_turns":"none"})`
85
- - Heavy verification of a finished change -> `spawn_agent({"task_name":"...","message":"TASK: act as a rigorous reviewer. ...","fork_turns":"none"})`
74
+ **Default to parallel spawns over self-research.** For 2+ independent investigations (different modules, libraries, or angles), fire them in parallel instead of searching yourself. Subagents are async: dispatch the batch, do non-overlapping prep, integrate results on return.
86
75
 
87
- **Don't duplicate.** Once a subagent is dispatched for a question, do not re-do the same search yourself. Once results return, do not re-verify by repeating their tool calls; integrate and move on.
76
+ **Don't duplicate.** Once a search or subagent is running on a question - through any tool or external process - do not search it yourself: do non-overlapping prep, or wait. Never poll running work without a completion signal. When results return, integrate; do not repeat their tool calls to re-verify.
88
77
 
89
- **Keep parent liveness visible.** While any child is active, keep the parent visibly alive with brief status updates that include active subagent count, agent names, latest `WORKING:` phase, and whether the parent is waiting for mailbox updates. Do this during long `wait_agent` cycles so the session does not look idle while children are still running.
78
+ **Keep parent liveness visible.** While children run - especially long `multi_agent_v1.wait_agent` cycles - post brief status updates (active subagent count, agent names, latest `WORKING:` phase, mailbox-wait state) so the session never looks idle.
90
79
 
91
80
  # Operating Loop
92
81
 
93
- **Explore -> Plan -> Implement -> Verify -> Manually QA.** Loops are short and tight; do not loop back with a draft when the work is yours to do.
82
+ **Explore -> Plan -> Implement -> Verify -> Manually QA.** Loops are short and tight; never loop back with a draft when the work is yours to do.
94
83
 
95
- - **Explore.** Per Discovery & Retrieval.
96
- - **Plan.** Call `update_plan` for non-trivial work per the Task Tracking discipline below. State files to modify, the specific changes, and the dependencies. Update the plan after each sub-task.
97
- - **Implement.** Surgical changes that match existing patterns. Match the codebase style - naming, indentation, imports, error handling - even when you would write it differently in a greenfield. Apply the smallest correct change; do not refactor surrounding code while fixing.
98
- - **Verify.** Diagnostics on changed files, related tests, build if applicable - in parallel where possible.
99
- - **Manually QA.** Drive the artifact through its surface (Manual QA Gate). Then write the final message.
84
+ - **Explore** per Discovery & Retrieval.
85
+ - **Plan** via `update_plan` per Task Tracking: files to modify, specific changes, dependencies.
86
+ - **Implement** surgically per Pragmatism & Scope, matching codebase style - naming, indentation, imports, error handling - even when you would write it differently in a greenfield.
87
+ - **Verify**: LSP diagnostics on changed files, related tests, build if applicable - in parallel where possible.
88
+ - **Manually QA**: drive the artifact through its matching surface (Manual QA Gate), then write the final message.
100
89
 
101
90
  # Manual QA Gate
102
91
 
103
- LSP diagnostics catch type errors, not logic bugs; tests cover only what their authors anticipated. **"Done" requires you have personally used the deliverable through its matching surface and observed it working** within this turn. The surface determines the tool:
92
+ LSP diagnostics catch type errors, not logic bugs; tests cover only what their authors anticipated. **"Done" requires the artifact has been driven through its matching surface - you personally used the deliverable and observed it working - within this turn.** The surface picks the tool:
104
93
 
105
- - **TUI / CLI / shell binary** - launch through Codex shell. Send input, run the happy path, try one bad input, hit `--help`, read the rendered output.
106
- - **Web / browser-rendered UI** - drive a real browser via an MCP browser tool if available. Open the page, click the elements, fill the forms, watch the console, screenshot when it helps.
94
+ - **TUI / CLI / shell binary** - launch through Codex shell: send input, run the happy path, try one bad input, hit `--help`, read the rendered output.
95
+ - **Web / browser-rendered UI** - drive a real browser via an MCP browser tool if available: open the page, click the elements, fill the forms, watch the console, screenshot when it helps.
107
96
  - **HTTP API / running service** - hit the live process with `curl` or a driver script.
108
- - **Library / SDK / module** - write a minimal driver script that imports and executes the new code end-to-end.
109
- - **No matching surface** - ask: how would a real user discover this works? Do exactly that.
97
+ - **Library / SDK / module** - a minimal driver script that imports and executes the new code end-to-end.
98
+ - **No matching surface** - how would a real user discover this works? Do exactly that.
110
99
 
111
- Reading the source and concluding "this should work" does not pass this gate. If usage reveals a defect, that defect is yours to fix in this turn - same turn, not "follow-up".
100
+ Reading the source and concluding "this should work" does not pass this gate. A defect found in usage is yours to fix in this turn - same turn, not "follow-up".
112
101
 
113
102
  # Global Review and Debugging Gate
114
103
 
115
- For significant implementation work and every PR handoff, run `review-work` plus a `debugging` runtime audit before declaring completion. Timeout, missing deliverable, ack-only, `BLOCKED:`, and inconclusive review lanes fail the gate. Record at least three debugging hypotheses and the runtime evidence that confirms or refutes each one.
104
+ For significant implementation work and every PR handoff, run `review-work` plus a `debugging` runtime audit before declaring completion. Timeout, missing deliverable, ack-only, `BLOCKED:`, and inconclusive review lanes fail the gate. Record at least three debugging hypotheses with the runtime evidence confirming or refuting each.
116
105
 
117
- Do not print completion, create a PR, produce a PR handoff, or produce a branch handoff until the gate passes. Always redact secrets, tokens, credentials, auth headers, cookies, env dumps, private logs, and PII from ledgers, PR bodies, and handoffs.
106
+ No completion message, PR, or PR/branch handoff until the gate passes. Always redact secrets, tokens, credentials, auth headers, cookies, env dumps, private logs, and PII from ledgers, PR bodies, and handoffs.
118
107
 
119
108
  # Failure Recovery
120
109
 
121
110
  If your first approach fails, try a materially different one - different algorithm, library, or pattern, not a small tweak. Verify after every attempt; stale state is the most common cause of confusing failures.
122
111
 
123
- **Three-attempt failure protocol.** After three different approaches have failed:
124
-
125
- 1. Stop editing immediately.
126
- 2. Revert only your own changes to a known-good state, or undo your own edits surgically.
127
- 3. Document each attempt and why it failed.
128
- 4. Step back, document failure context in detail, then ask the user one precise question.
112
+ **Three-attempt protocol.** After three different approaches fail: stop editing immediately; revert or surgically undo only your own changes back to a known-good state; document each attempt and why it failed; then step back and ask the user one precise question carrying that failure context.
129
113
 
130
114
  # Pragmatism & Scope
131
115
 
132
116
  The best change is often the smallest correct change. When two approaches both work, prefer the one with fewer new names, helpers, layers, and tests.
133
117
 
134
- - Keep obvious single-use logic inline. Do not extract a helper unless it is reused, hides meaningful complexity, or names a real domain concept.
135
- - A small amount of duplication is better than speculative abstraction.
136
- - Bug fix != surrounding cleanup. Simple feature != extra configurability.
137
- - Fix only issues your changes caused. Pre-existing lint errors or failing tests unrelated to your work belong in the final message as observations, not in the diff.
118
+ - Keep obvious single-use logic inline; extract a helper only when it is reused, hides meaningful complexity, or names a real domain concept.
119
+ - A small amount of duplication beats speculative abstraction.
120
+ - Bug fix != surrounding cleanup - do not refactor surrounding code while fixing. Simple feature != extra configurability.
121
+ - Fix only issues your changes caused; pre-existing lint errors or failing tests unrelated to your work go in the final message as observations, not in the diff.
138
122
 
139
123
  ## No defensive code, no speculative legacy
140
124
 
141
- Default to writing only what is needed for the current correct path. Do not add error handlers, fallbacks, retries, or input validation for scenarios that cannot happen given the current contracts. Trust framework guarantees and internal types. Validate only at system boundaries - user input, external APIs, untrusted I/O.
125
+ Write only what the current correct path needs: no error handlers, fallbacks, retries, or input validation for scenarios the current contracts make impossible. Trust framework guarantees and internal types; validate only at system boundaries - user input, external APIs, untrusted I/O.
142
126
 
143
- Do not write backward-compatibility code, migration shims, or alternate code paths "in case" something breaks. Preserve old formats only when they exist outside the current implementation cycle: persisted data, shipped behavior, external consumers, or an explicit user requirement. Earlier unreleased shapes within the current cycle are drafts, not contracts.
127
+ No backward-compatibility code, migration shims, or alternate code paths "in case". Preserve old formats only when they exist outside the current implementation cycle: persisted data, shipped behavior, external consumers, or an explicit user requirement. Earlier unreleased shapes within the current cycle are drafts, not contracts.
144
128
 
145
- Default to not adding tests. Add a test only when the user asks, when the change fixes a subtle bug, or when it protects an important behavioral boundary that existing tests do not cover. Never add tests to a codebase with no tests. Never make a test pass at the expense of correctness.
129
+ Default to no new tests. Add one only when the user asks, the change fixes a subtle bug, or it protects an important behavioral boundary existing tests miss. Never add tests to a codebase with no tests. Never make a test pass at the expense of correctness.
146
130
 
147
131
  # Code review requests
148
132
 
149
- When the user asks for a "review", default to a code-review mindset: findings come first, ordered by severity with file references. Open questions and assumptions follow. A change-summary is secondary, not the lead. If no findings, say so explicitly and call out residual risks or testing gaps.
133
+ When the user asks for a "review", findings come first, ordered by severity with file references; open questions and assumptions follow; the change-summary is secondary, not the lead. No findings? Say so explicitly and call out residual risks and testing gaps.
150
134
 
151
135
  # AGENTS.md
152
136
 
@@ -154,11 +138,11 @@ AGENTS.md files in your context carry directory-scoped conventions. Obey them fo
154
138
 
155
139
  # Output
156
140
 
157
- **Preamble.** Before the first tool call on any multi-step task, send one short user-visible update that acknowledges the request and states your first concrete step. One or two sentences.
141
+ **Preamble.** Before the first tool call on any multi-step task, send a 1-2 sentence user-visible update: acknowledge the request, state your first concrete step.
158
142
 
159
- **During work.** Send short updates only at meaningful phase transitions: a discovery that changes the plan, a decision with tradeoffs, a blocker, or the start of a non-trivial verification step. Do not narrate routine reads or `rg` calls. One sentence per phase transition.
143
+ **During work.** One sentence at meaningful phase transitions only - a discovery that changes the plan, a decision with tradeoffs, a blocker, the start of a non-trivial verification step. Never narrate routine reads or `rg` calls.
160
144
 
161
- **Final message.** Lead with the result, then add supporting context for where and why. No conversational openers ("Done -", "Got it"). Group by user-facing outcome, not by file. For simple work, 1-2 short paragraphs. For larger work, at most 2-4 short sections.
145
+ **Final message.** Lead with the result, then supporting context for where and why. No conversational openers ("Done -", "Got it"). Group by user-facing outcome, not by file. Simple work: 1-2 short paragraphs; larger work: at most 2-4 short sections.
162
146
 
163
147
  **Formatting.**
164
148
 
@@ -168,26 +152,19 @@ AGENTS.md files in your context carry directory-scoped conventions. Obey them fo
168
152
  - No emojis or em dashes unless the user explicitly requests them.
169
153
  - Never output broken inline citations like `【F:README.md†L5-L14】` - they break the CLI.
170
154
 
171
- # Success Criteria
155
+ # Success Criteria and Stop Rules
172
156
 
173
157
  Done when ALL of:
174
158
 
175
- - Every behavior the user asked for is implemented; no partial delivery, no "v0 / extend later".
159
+ - Every behavior the user asked for is implemented - no partial delivery, no "v0 / extend later".
176
160
  - LSP diagnostics clean on every file you changed.
177
161
  - Build (if applicable) exits 0; tests pass, or pre-existing failures are explicitly named with the reason.
178
- - The artifact has been driven through its matching surface in this turn (Manual QA Gate).
162
+ - The artifact has been **driven through its matching surface** in this turn (Manual QA Gate).
179
163
  - The final message reports what you did, what you verified, what you could not verify (with the reason), and any pre-existing issues you noticed but did not touch.
180
164
 
181
- When you think you are done: re-read the original request and your intent line. Did every committed action complete? Run verification once more on changed files in parallel. Then report.
182
-
183
- # Stop Rules
165
+ When you think you are done: re-read the original request and your intent line - did every committed action complete? Run verification once more on changed files in parallel, then report.
184
166
 
185
- Write the final message and stop **only when** Success Criteria are all true. Until then, keep going - even when tool calls fail, even when the turn is long, even when you are tempted to hand back a draft.
186
-
187
- **Forbidden stops:**
188
-
189
- - Stopping when Success Criteria are not all true (especially Manual QA Gate).
190
- - Stopping after a tool reports success, without verifying the changed files and observable behavior.
167
+ Stop **only when** all of the above are true. Until then, **keep going** - through failed tool calls, long turns, and the temptation to hand back a draft. Forbidden stops: the artifact not yet driven through its matching surface; a tool reported success but you have not verified the changed files and observable behavior.
191
168
 
192
169
  **Hard invariants** - non-negotiable, regardless of pressure to ship:
193
170
 
@@ -198,20 +175,16 @@ Write the final message and stop **only when** Success Criteria are all true. Un
198
175
  - Never revert changes you did not make unless explicitly asked.
199
176
  - Never invent fake citations, fake tool output, or fake verification results.
200
177
 
201
- **Asking the user** is a last resort - only when blocked by a missing secret, a design decision only they can make, or a destructive action you should not take unilaterally. Even then, ask exactly one precise question and stop. Never ask permission to do obvious work.
178
+ **Asking the user** is a last resort: a missing secret, a design decision only they can make, a destructive action you should not take unilaterally, or missing information that would materially change the answer or create real risk. Even then, ask exactly one precise, narrow question and stop. Never ask permission to do obvious work.
202
179
 
203
180
  # Task Tracking
204
181
 
205
- `update_plan` is the single most reliable forcing function you have. Use it for any work that is not a single atomic edit: 2+ steps, uncertain scope, multi-file changes, or branching investigation. When in doubt, call it. Skip planning only for the easiest 25%, and never make single-step plans.
182
+ Use `update_plan` for anything beyond a single atomic edit: 2+ steps, uncertain scope, multi-file changes, branching investigation. Skip planning only for the easiest 25%; never make single-step plans. **Improvising past step 2 without a plan? Stop and call `update_plan` now.**
206
183
 
207
- **Cadence:**
208
-
209
- - Atomic steps, one verifiable outcome each. Name the deliverable ("edit `foo.ts` to add X"), not the verb ("work on foo").
210
- - Exactly ONE step `in_progress` at a time. Never zero, never two.
184
+ - Atomic steps, one verifiable outcome each: name the deliverable ("edit `foo.ts` to add X"), not the verb ("work on foo").
185
+ - Exactly ONE step `in_progress` at a time - never zero, never two.
211
186
  - Mark `completed` the instant the outcome lands. NEVER batch.
212
- - When discovery shifts the plan, update it in the SAME response. No silent drift.
213
- - Before ending the turn, reconcile EVERY step: `completed`, blocked (one-line reason), or removed (one-line reason). No `in_progress` or `pending` items at end of turn.
214
-
215
- **Promise discipline.** Do not commit to tests, broad refactors, or follow-up work in `update_plan` unless you will do them now. Anything you will not finish belongs in the final-message "next steps", not in the plan.
187
+ - When discovery shifts the plan, update it in the SAME response - no silent drift.
188
+ - Before ending the turn, reconcile EVERY step: `completed`, blocked (one-line reason), or removed (one-line reason). **No `in_progress` or `pending` items at end of turn.**
216
189
 
217
- **Refusing to plan is a failure mode.** If you find yourself improvising past step 2 without a plan, stop and call `update_plan` now.
190
+ **Promise discipline.** Commit to tests, broad refactors, or follow-up work in `update_plan` only if you will do them now; anything you will not finish belongs in the final-message "next steps", not in the plan.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env node
2
+ import { stdin as processStdin, stdout as processStdout } from "node:process";
3
+ import { runPostCompactHook, runPostToolUseHook, runSessionStartHook, runUserPromptSubmitHook, } from "./codex-hook.js";
4
+ const command = process.argv[2];
5
+ const subcommand = process.argv[3];
6
+ if (command === "hook" && subcommand === "session-start") {
7
+ await runHookCli("SessionStart");
8
+ }
9
+ else if (command === "hook" && subcommand === "user-prompt-submit") {
10
+ await runHookCli("UserPromptSubmit");
11
+ }
12
+ else if (command === "hook" && subcommand === "post-tool-use") {
13
+ await runHookCli("PostToolUse");
14
+ }
15
+ else if (command === "hook" && subcommand === "post-compact") {
16
+ await runHookCli("PostCompact");
17
+ }
18
+ else {
19
+ process.stderr.write("Usage: omo-rules hook [session-start|user-prompt-submit|post-tool-use|post-compact]\n");
20
+ process.exitCode = 1;
21
+ }
22
+ async function runHookCli(eventName) {
23
+ const raw = await readStdin();
24
+ if (raw.trim().length === 0)
25
+ return;
26
+ const parsed = parseHookInput(raw);
27
+ if (!parsed)
28
+ return;
29
+ const pluginDataRoot = process.env["PLUGIN_DATA"];
30
+ const options = pluginDataRoot === undefined ? {} : { pluginDataRoot };
31
+ const output = await runHook(eventName, parsed, options);
32
+ if (output.length > 0) {
33
+ processStdout.write(output);
34
+ }
35
+ }
36
+ async function runHook(eventName, parsed, options) {
37
+ switch (eventName) {
38
+ case "SessionStart":
39
+ return isCodexSessionStartInput(parsed) ? await runSessionStartHook(parsed, options) : "";
40
+ case "UserPromptSubmit":
41
+ return isCodexUserPromptSubmitInput(parsed) ? await runUserPromptSubmitHook(parsed, options) : "";
42
+ case "PostToolUse":
43
+ return isCodexPostToolUseInput(parsed) ? await runPostToolUseHook(parsed, options) : "";
44
+ case "PostCompact":
45
+ return isCodexPostCompactInput(parsed) ? await runPostCompactHook(parsed, options) : "";
46
+ }
47
+ }
48
+ function parseHookInput(raw) {
49
+ try {
50
+ const parsed = JSON.parse(raw);
51
+ return parsed;
52
+ }
53
+ catch {
54
+ return undefined;
55
+ }
56
+ }
57
+ function isCodexSessionStartInput(value) {
58
+ return (isRecord(value) &&
59
+ value["hook_event_name"] === "SessionStart" &&
60
+ typeof value["session_id"] === "string" &&
61
+ isStringOrNull(value["transcript_path"]) &&
62
+ typeof value["cwd"] === "string" &&
63
+ typeof value["model"] === "string" &&
64
+ typeof value["permission_mode"] === "string" &&
65
+ typeof value["source"] === "string");
66
+ }
67
+ function isCodexUserPromptSubmitInput(value) {
68
+ return (isRecord(value) &&
69
+ value["hook_event_name"] === "UserPromptSubmit" &&
70
+ typeof value["session_id"] === "string" &&
71
+ typeof value["turn_id"] === "string" &&
72
+ isStringOrNull(value["transcript_path"]) &&
73
+ typeof value["cwd"] === "string" &&
74
+ typeof value["model"] === "string" &&
75
+ typeof value["permission_mode"] === "string" &&
76
+ typeof value["prompt"] === "string");
77
+ }
78
+ function isCodexPostToolUseInput(value) {
79
+ return (isRecord(value) &&
80
+ value["hook_event_name"] === "PostToolUse" &&
81
+ typeof value["session_id"] === "string" &&
82
+ typeof value["turn_id"] === "string" &&
83
+ isStringOrNull(value["transcript_path"]) &&
84
+ typeof value["cwd"] === "string" &&
85
+ typeof value["model"] === "string" &&
86
+ typeof value["permission_mode"] === "string" &&
87
+ typeof value["tool_name"] === "string" &&
88
+ typeof value["tool_use_id"] === "string");
89
+ }
90
+ function isCodexPostCompactInput(value) {
91
+ return (isRecord(value) &&
92
+ value["hook_event_name"] === "PostCompact" &&
93
+ typeof value["session_id"] === "string" &&
94
+ typeof value["turn_id"] === "string" &&
95
+ isStringOrNull(value["transcript_path"]) &&
96
+ typeof value["cwd"] === "string" &&
97
+ typeof value["model"] === "string" &&
98
+ (value["trigger"] === "manual" || value["trigger"] === "auto"));
99
+ }
100
+ function isStringOrNull(value) {
101
+ return typeof value === "string" || value === null;
102
+ }
103
+ function isRecord(value) {
104
+ return typeof value === "object" && value !== null && !Array.isArray(value);
105
+ }
106
+ function readStdin() {
107
+ return new Promise((resolve, reject) => {
108
+ let data = "";
109
+ processStdin.setEncoding("utf8");
110
+ processStdin.on("data", (chunk) => {
111
+ data += chunk;
112
+ });
113
+ processStdin.once("error", reject);
114
+ processStdin.once("end", () => {
115
+ resolve(data);
116
+ });
117
+ });
118
+ }
@@ -0,0 +1,5 @@
1
+ export interface CodexRulesHookOptions {
2
+ env?: NodeJS.ProcessEnv;
3
+ pluginDataRoot?: string;
4
+ platform?: NodeJS.Platform;
5
+ }
@@ -0,0 +1,47 @@
1
+ import type { CodexRulesHookOptions } from "./codex-hook-options.js";
2
+ export type { CodexRulesHookOptions } from "./codex-hook-options.js";
3
+ export type CodexSessionStartInput = {
4
+ session_id: string;
5
+ transcript_path: string | null;
6
+ cwd: string;
7
+ hook_event_name: "SessionStart";
8
+ model: string;
9
+ permission_mode: string;
10
+ source: "startup" | "resume" | "clear" | "compact";
11
+ };
12
+ export type CodexUserPromptSubmitInput = {
13
+ session_id: string;
14
+ turn_id: string;
15
+ transcript_path: string | null;
16
+ cwd: string;
17
+ hook_event_name: "UserPromptSubmit";
18
+ model: string;
19
+ permission_mode: string;
20
+ prompt: string;
21
+ };
22
+ export type CodexPostToolUseInput = {
23
+ session_id: string;
24
+ turn_id: string;
25
+ transcript_path: string | null;
26
+ cwd: string;
27
+ hook_event_name: "PostToolUse";
28
+ model: string;
29
+ permission_mode: string;
30
+ tool_name: string;
31
+ tool_input: unknown;
32
+ tool_response: unknown;
33
+ tool_use_id: string;
34
+ };
35
+ export type CodexPostCompactInput = {
36
+ session_id: string;
37
+ turn_id: string;
38
+ transcript_path: string | null;
39
+ cwd: string;
40
+ hook_event_name: "PostCompact";
41
+ model: string;
42
+ trigger: "manual" | "auto";
43
+ };
44
+ export declare function runSessionStartHook(input: CodexSessionStartInput, options?: CodexRulesHookOptions): Promise<string>;
45
+ export declare function runPostCompactHook(input: CodexPostCompactInput, options?: CodexRulesHookOptions): Promise<string>;
46
+ export declare function runUserPromptSubmitHook(input: CodexUserPromptSubmitInput, options?: CodexRulesHookOptions): Promise<string>;
47
+ export declare function runPostToolUseHook(input: CodexPostToolUseInput, options?: CodexRulesHookOptions): Promise<string>;
@@ -0,0 +1,127 @@
1
+ import { configFromEnvironment } from "./config.js";
2
+ import { hasContextPressureMarker, transcriptHasContextPressureMarker } from "./context-pressure.js";
3
+ import { createHookDebugTimer } from "./debug-log.js";
4
+ import { fingerprintDynamicTargets } from "./dynamic-target-fingerprints.js";
5
+ import { withDynamicBudget } from "./event-budget.js";
6
+ import { formatAdditionalContextOutput } from "./hook-output.js";
7
+ import { displayPath, uniqueStrings } from "./path-utils.js";
8
+ import { claimPostCompactPending, clearSessionState, hasPostCompactPending, hydrateEngineState, isPostCompactRecoveryInProgress, markSessionCompacted, persistEngineState, sessionCachePath, } from "./persistent-cache.js";
9
+ import { withPostCompactBudget } from "./post-compact-budget.js";
10
+ import { claimedPostCompactKind, shouldSkipPostCompactClaim } from "./post-compact-claim.js";
11
+ import { createRulesEngine } from "./rules-engine-factory.js";
12
+ import { runStaticInjection } from "./static-injection.js";
13
+ import { extractCodexToolPaths } from "./tool-paths.js";
14
+ import { filterRulesAlreadyInTranscript } from "./transcript-rule-filter.js";
15
+ export async function runSessionStartHook(input, options = {}) {
16
+ const cachePath = sessionCachePath(input.session_id, options.pluginDataRoot);
17
+ if (input.source === "clear") {
18
+ clearSessionState(cachePath);
19
+ }
20
+ else if (input.source !== "resume" && input.source !== "compact" && !hasPostCompactPending(cachePath)) {
21
+ clearSessionState(cachePath);
22
+ }
23
+ const postCompactClaim = input.source === "clear" ? "not-pending" : claimPostCompactPending(cachePath, "static");
24
+ const completedPostCompactKind = claimedPostCompactKind(postCompactClaim, "static") ??
25
+ (input.source === "compact" && postCompactClaim === "not-pending" ? "static" : undefined);
26
+ if (shouldSkipPostCompactClaim(postCompactClaim, input.source === "compact" && isPostCompactRecoveryInProgress(cachePath, "static"))) {
27
+ return "";
28
+ }
29
+ const transcriptPath = input.source === "clear" ? null : input.transcript_path;
30
+ return runStaticInjection(input.cwd, transcriptPath, "SessionStart", cachePath, options, completedPostCompactKind, { latestCompactedReplacementOnly: completedPostCompactKind !== undefined }, input.model);
31
+ }
32
+ export async function runPostCompactHook(input, options = {}) {
33
+ markSessionCompacted(sessionCachePath(input.session_id, options.pluginDataRoot));
34
+ return "";
35
+ }
36
+ export async function runUserPromptSubmitHook(input, options = {}) {
37
+ if (hasContextPressureMarker(input.prompt)) {
38
+ return "";
39
+ }
40
+ const cachePath = sessionCachePath(input.session_id, options.pluginDataRoot);
41
+ const postCompactClaim = claimPostCompactPending(cachePath, "static");
42
+ if (postCompactClaim === "not-pending" && transcriptHasContextPressureMarker(input.transcript_path)) {
43
+ return "";
44
+ }
45
+ const completedPostCompactKind = claimedPostCompactKind(postCompactClaim, "static");
46
+ if (shouldSkipPostCompactClaim(postCompactClaim, isPostCompactRecoveryInProgress(cachePath, "static"))) {
47
+ return "";
48
+ }
49
+ return runStaticInjection(input.cwd, input.transcript_path, "UserPromptSubmit", cachePath, options, completedPostCompactKind, { latestCompactedReplacementOnly: completedPostCompactKind !== undefined }, input.model);
50
+ }
51
+ export async function runPostToolUseHook(input, options = {}) {
52
+ const debugTimer = createHookDebugTimer("PostToolUse");
53
+ const config = configFromEnvironment(options.env);
54
+ debugTimer.lap("config", { disabled: config.disabled, mode: config.mode });
55
+ if (config.disabled || config.mode === "off" || config.mode === "static") {
56
+ debugTimer.done({ outputBytes: 0, reason: "disabled" });
57
+ return "";
58
+ }
59
+ const targetPaths = extractCodexToolPaths(input, input.cwd);
60
+ debugTimer.lap("extract", {
61
+ targets: targetPaths.length,
62
+ uniqueTargets: uniqueStrings(targetPaths).length,
63
+ tool: input.tool_name,
64
+ });
65
+ const firstTargetPath = targetPaths[0];
66
+ if (firstTargetPath === undefined) {
67
+ debugTimer.done({ outputBytes: 0, reason: "no-target" });
68
+ return "";
69
+ }
70
+ const cachePath = sessionCachePath(input.session_id, options.pluginDataRoot);
71
+ const postCompactClaim = claimPostCompactPending(cachePath, "dynamic");
72
+ if (postCompactClaim === "not-pending" && transcriptHasContextPressureMarker(input.transcript_path)) {
73
+ debugTimer.done({ outputBytes: 0, reason: "context-pressure-transcript" });
74
+ return "";
75
+ }
76
+ const completedPostCompactKind = claimedPostCompactKind(postCompactClaim, "dynamic");
77
+ if (shouldSkipPostCompactClaim(postCompactClaim, isPostCompactRecoveryInProgress(cachePath, "dynamic"))) {
78
+ debugTimer.done({ outputBytes: 0, reason: "post-compact-recovery-in-progress" });
79
+ return "";
80
+ }
81
+ const dynamicConfig = withDynamicBudget(config);
82
+ const engine = createRulesEngine(options, completedPostCompactKind !== undefined
83
+ ? withPostCompactBudget(dynamicConfig, { model: input.model, transcriptPath: input.transcript_path })
84
+ : dynamicConfig);
85
+ hydrateEngineState(engine, cachePath);
86
+ debugTimer.lap("hydrate", {
87
+ dynamicDedupScopes: engine.state.dynamicDedup.size,
88
+ dynamicTargetFingerprints: engine.state.dynamicTargetFingerprints.size,
89
+ staticDedup: engine.state.staticDedup.size,
90
+ });
91
+ const dynamicTargetFingerprints = fingerprintDynamicTargets(input.cwd, targetPaths, config);
92
+ debugTimer.lap("fingerprint", { fingerprints: dynamicTargetFingerprints.length });
93
+ const pendingTargetFingerprints = dynamicTargetFingerprints.filter((target) => engine.state.dynamicTargetFingerprints.get(target.cacheKey) !== target.fingerprint);
94
+ debugTimer.lap("pending", { pending: pendingTargetFingerprints.length });
95
+ if (pendingTargetFingerprints.length === 0) {
96
+ persistEngineState(engine, cachePath, completedPostCompactKind);
97
+ debugTimer.lap("persist", { reason: "no-pending" });
98
+ debugTimer.done({ outputBytes: 0, reason: "no-pending" });
99
+ return "";
100
+ }
101
+ const loaded = engine.loadDynamicRules(input.cwd, pendingTargetFingerprints.map((target) => target.targetPath));
102
+ debugTimer.lap("load", { diagnostics: loaded.diagnostics.length, loadedRules: loaded.rules.length });
103
+ const rules = filterRulesAlreadyInTranscript(loaded.rules.filter((rule) => !engine.isStaticInjected(rule) && !engine.isDynamicInjected(rule)), input.transcript_path, (rule) => {
104
+ engine.markDynamicInjected(rule);
105
+ }, { latestCompactedReplacementOnly: completedPostCompactKind !== undefined });
106
+ debugTimer.lap("filter", { rules: rules.length });
107
+ for (const target of pendingTargetFingerprints) {
108
+ engine.state.dynamicTargetFingerprints.set(target.cacheKey, target.fingerprint);
109
+ }
110
+ if (rules.length === 0) {
111
+ persistEngineState(engine, cachePath, completedPostCompactKind);
112
+ debugTimer.lap("persist", { reason: "no-rules" });
113
+ debugTimer.done({ outputBytes: 0, reason: "no-rules" });
114
+ return "";
115
+ }
116
+ const firstPendingTargetPath = pendingTargetFingerprints[0]?.targetPath ?? firstTargetPath;
117
+ const block = engine.formatDynamic(rules, displayPath(input.cwd, firstPendingTargetPath));
118
+ debugTimer.lap("format", { blockChars: block.length, rules: rules.length });
119
+ for (const rule of rules) {
120
+ engine.markDynamicInjected(rule);
121
+ }
122
+ persistEngineState(engine, cachePath, completedPostCompactKind);
123
+ debugTimer.lap("persist", { reason: "emit" });
124
+ const output = formatAdditionalContextOutput("PostToolUse", block);
125
+ debugTimer.done({ outputBytes: Buffer.byteLength(output), reason: "emit" });
126
+ return output;
127
+ }
@@ -0,0 +1,2 @@
1
+ import type { PiRulesConfig } from "./rules/types.js";
2
+ export declare function configFromEnvironment(env?: NodeJS.ProcessEnv): PiRulesConfig;