oh-my-opencode 4.15.1 → 4.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/.agents/skills/codex-qa/SKILL.md +9 -7
  2. package/.agents/skills/codex-qa/references/logging-debug.md +6 -4
  3. package/.agents/skills/opencode-qa/SKILL.md +9 -9
  4. package/.agents/skills/opencode-qa/references/tui-tmux.md +10 -8
  5. package/dist/cli/codex-ulw-loop.d.ts +8 -0
  6. package/dist/cli/doctor/checks/tui-plugin-config.d.ts +4 -4
  7. package/dist/cli/get-local-version/types.d.ts +1 -1
  8. package/dist/cli/index.js +792 -744
  9. package/dist/cli/install-senpi/index.d.ts +1 -0
  10. package/dist/cli/run/poll-for-completion.d.ts +4 -0
  11. package/dist/cli/run/session-resolver.d.ts +1 -0
  12. package/dist/cli/senpi-platform-flag.d.ts +4 -0
  13. package/dist/cli/types.d.ts +2 -1
  14. package/dist/cli-node/index.js +792 -744
  15. package/dist/features/background-agent/manager.d.ts +16 -0
  16. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  17. package/dist/features/monitor/process.d.ts +17 -1
  18. package/dist/hooks/anthropic-context-window-limit-recovery/aggressive-truncation-strategy.d.ts +1 -0
  19. package/dist/index.js +2206 -1971
  20. package/dist/skills/debugging/references/methodology/06-fix.md +6 -0
  21. package/dist/skills/frontend/ATTRIBUTION.md +10 -1
  22. package/dist/skills/frontend/SKILL.md +12 -7
  23. package/dist/skills/frontend/references/design/README.md +8 -4
  24. package/dist/skills/frontend/references/design/_INDEX.md +2 -2
  25. package/dist/skills/frontend/references/design/design-system-architecture.md +24 -2
  26. package/dist/skills/frontend/references/design/lazyweb.md +77 -0
  27. package/dist/skills/frontend/references/design/stitch-design-example.md +121 -0
  28. package/dist/skills/frontend/references/designpowers/README.md +2 -2
  29. package/dist/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
  30. package/dist/skills/programming/SKILL.md +10 -1
  31. package/dist/skills/programming/references/logging.md +91 -0
  32. package/dist/skills/start-work/SKILL.md +2 -2
  33. package/dist/skills/ulw-plan/SKILL.md +5 -5
  34. package/dist/skills/ulw-plan/references/full-workflow.md +7 -7
  35. package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
  36. package/dist/skills/ulw-research/ATTRIBUTION.md +2 -2
  37. package/dist/skills/ulw-research/SKILL.md +28 -7
  38. package/dist/skills/visual-qa/SKILL.md +13 -17
  39. package/dist/tools/skill/description-formatter.d.ts +1 -0
  40. package/dist/tools/skill/description-formatter.test-support.d.ts +9 -0
  41. package/dist/tools/skill/zauc-mocks-skill-tools/test-support.d.ts +25 -0
  42. package/dist/tui.js +121 -419
  43. package/docs/reference/web-terminal-visual-qa.md +39 -45
  44. package/package.json +48 -25
  45. package/packages/git-bash-mcp/dist/cli.js +2 -2
  46. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  47. package/packages/omo-codex/plugin/components/bootstrap/AGENTS.md +55 -0
  48. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +19 -16
  49. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  50. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  51. package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +51 -0
  52. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +936 -248
  53. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +233 -135
  54. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  55. package/packages/omo-codex/plugin/components/codegraph/src/cache-gc.ts +29 -0
  56. package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +13 -0
  57. package/packages/omo-codex/plugin/components/codegraph/src/hook-sweep.ts +25 -0
  58. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +3 -1
  59. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +30 -1
  60. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +16 -2
  61. package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +80 -0
  62. package/packages/omo-codex/plugin/components/codegraph/test/cache-gc.test.ts +34 -0
  63. package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +107 -0
  64. package/packages/omo-codex/plugin/components/codegraph/test/hook-registration.test.ts +26 -0
  65. package/packages/omo-codex/plugin/components/codegraph/test/hook-sweep.test.ts +29 -0
  66. package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +8 -21
  67. package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +108 -0
  68. package/packages/omo-codex/plugin/components/codegraph/test/serve-built-wrapper.test.ts +76 -0
  69. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +17 -111
  70. package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +1 -1
  71. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +45 -67
  72. package/packages/omo-codex/plugin/components/codegraph/test/sweep-cli.test.ts +56 -0
  73. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  74. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  75. package/packages/omo-codex/plugin/components/git-bash/AGENTS.md +31 -0
  76. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  77. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  78. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/AGENTS.md +45 -0
  79. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  80. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  81. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  82. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  83. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +37 -102
  84. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  85. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  86. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +2 -2
  87. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  88. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  89. package/packages/omo-codex/plugin/components/teammode/AGENTS.md +46 -0
  90. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  91. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  92. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +6 -0
  93. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +6 -0
  94. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  95. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  96. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -2
  97. package/packages/omo-codex/plugin/components/ultrawork/CHANGELOG.md +2 -0
  98. package/packages/omo-codex/plugin/components/ultrawork/README.md +3 -3
  99. package/packages/omo-codex/plugin/components/ultrawork/directive.md +18 -10
  100. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +51 -2
  101. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  102. package/packages/omo-codex/plugin/components/ultrawork/package.json +2 -1
  103. package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +14 -1
  104. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +388 -0
  105. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +16 -2
  106. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +4 -4
  107. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +2 -2
  108. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +5 -3
  109. package/packages/omo-codex/plugin/components/ultrawork/src/skill-pointer.ts +56 -0
  110. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +26 -5
  111. package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +12 -0
  112. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +1 -0
  113. package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +82 -0
  114. package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +5 -0
  115. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +18 -10
  116. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +15 -2
  117. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +2 -1
  118. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +145 -32
  119. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +1 -0
  120. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +5 -1
  121. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +6 -0
  122. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +55 -9
  123. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.d.ts +15 -0
  124. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.js +33 -0
  125. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +10 -3
  126. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +15 -11
  127. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.d.ts +2 -1
  128. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.js +5 -3
  129. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-skill-pointer.d.ts +7 -0
  130. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-skill-pointer.js +46 -0
  131. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  132. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  133. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
  134. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +7 -7
  135. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -2
  136. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +2 -1
  137. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +5 -1
  138. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +59 -11
  139. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-snapshot.ts +38 -0
  140. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-types.ts +11 -3
  141. package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +15 -7
  142. package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-directive.ts +9 -3
  143. package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-skill-pointer.ts +55 -0
  144. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +16 -0
  145. package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +260 -2
  146. package/packages/omo-codex/plugin/components/ulw-loop/test/steering-snapshot.test.ts +124 -0
  147. package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +101 -2
  148. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +49 -0
  149. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  150. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  151. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  152. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  153. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  154. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  155. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  156. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  157. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  158. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  159. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  160. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  161. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  162. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  163. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  164. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  165. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  166. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  167. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  168. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  169. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  170. package/packages/omo-codex/plugin/package-lock.json +13 -13
  171. package/packages/omo-codex/plugin/package.json +1 -1
  172. package/packages/omo-codex/plugin/scripts/build-components.mjs +63 -17
  173. package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +10 -6
  174. package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +10 -3
  175. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +1 -0
  176. package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +18 -0
  177. package/packages/omo-codex/plugin/skills/debugging/references/methodology/06-fix.md +6 -0
  178. package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +10 -1
  179. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +12 -7
  180. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +8 -4
  181. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +2 -2
  182. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +24 -2
  183. package/packages/omo-codex/plugin/skills/frontend/references/design/lazyweb.md +77 -0
  184. package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-design-example.md +121 -0
  185. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +2 -2
  186. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
  187. package/packages/omo-codex/plugin/skills/programming/SKILL.md +10 -1
  188. package/packages/omo-codex/plugin/skills/programming/references/logging.md +91 -0
  189. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -2
  190. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +388 -0
  191. package/packages/omo-codex/plugin/skills/ultrawork/agents/openai.yaml +2 -0
  192. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
  193. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +7 -7
  194. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +16 -2
  195. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +4 -4
  196. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +2 -2
  197. package/packages/omo-codex/plugin/skills/ulw-research/ATTRIBUTION.md +2 -2
  198. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +28 -7
  199. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +13 -17
  200. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -4
  201. package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +1 -1
  202. package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +22 -9
  203. package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +1 -1
  204. package/packages/omo-codex/plugin/test/sync-hook-status-messages.test.mjs +6 -6
  205. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -0
  206. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +56 -0
  207. package/packages/omo-codex/plugin/test/ulw-plan-skill-contract.test.mjs +52 -0
  208. package/packages/omo-codex/plugin/test/ulw-research-epistemic-contract.test.mjs +98 -0
  209. package/packages/omo-codex/plugin/test/ulw-research-skill-contract.test.mjs +6 -6
  210. package/packages/omo-codex/scripts/install-dist/install-local.mjs +310 -3979
  211. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +2 -2
  212. package/packages/shared-skills/skills/debugging/references/methodology/06-fix.md +6 -0
  213. package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +10 -1
  214. package/packages/shared-skills/skills/frontend/SKILL.md +12 -7
  215. package/packages/shared-skills/skills/frontend/references/design/README.md +8 -4
  216. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +2 -2
  217. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +24 -2
  218. package/packages/shared-skills/skills/frontend/references/design/lazyweb.md +77 -0
  219. package/packages/shared-skills/skills/frontend/references/design/stitch-design-example.md +121 -0
  220. package/packages/shared-skills/skills/frontend/references/designpowers/README.md +2 -2
  221. package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
  222. package/packages/shared-skills/skills/programming/SKILL.md +10 -1
  223. package/packages/shared-skills/skills/programming/references/logging.md +91 -0
  224. package/packages/shared-skills/skills/start-work/SKILL.md +2 -2
  225. package/packages/shared-skills/skills/ulw-plan/SKILL.md +5 -5
  226. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +7 -7
  227. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
  228. package/packages/shared-skills/skills/ulw-research/ATTRIBUTION.md +2 -2
  229. package/packages/shared-skills/skills/ulw-research/SKILL.md +28 -7
  230. package/packages/shared-skills/skills/visual-qa/SKILL.md +13 -17
  231. package/script/qa/strip-ansi.mjs +10 -0
  232. package/script/qa/web-terminal-visual-qa.mjs +112 -195
  233. package/script/qa/xterm-live-terminal.mjs +180 -0
  234. package/script/qa/web-terminal-renderer.mjs +0 -218
@@ -6,10 +6,59 @@ import { stdin as processStdin, stdout as processStdout } from "node:process";
6
6
  // components/ultrawork/src/codex-hook.ts
7
7
  import { readFileSync as readFileSync2 } from "node:fs";
8
8
 
9
+ // components/ultrawork/src/skill-pointer.ts
10
+ import { existsSync } from "node:fs";
11
+ import { fileURLToPath } from "node:url";
12
+
9
13
  // components/ultrawork/src/directive.ts
10
14
  import { readFileSync } from "node:fs";
11
15
  var ULTRAWORK_DIRECTIVE = readFileSync(new URL("../directive.md", import.meta.url), "utf8");
12
16
 
17
+ // components/ultrawork/src/skill-pointer.ts
18
+ var ULTRAWORK_SKILL_POINTER_TEMPLATE = `<ultrawork-mode>
19
+ ULTRAWORK MODE IS ACTIVE FOR THIS TASK.
20
+
21
+ MANDATORY BOOTSTRAP: do all three steps, in order, before anything else.
22
+
23
+ 1. First user-visible line this turn MUST be exactly:
24
+ \`ULTRAWORK MODE ENABLED!\`
25
+
26
+ 2. Call \`create_goal\` NOW with \`objective\` set to the user's request.
27
+ Send \`objective\` only: no \`status\`, no budget fields. If the
28
+ \`create_goal\` tool is unavailable, open your reply with a binding
29
+ \`# Goal\` block instead. Never skip this step.
30
+
31
+ 3. Read the FULL ultrawork directive NOW, before any other tool call,
32
+ plan, or edit. It is the \`ultrawork\` skill, stored at:
33
+
34
+ {{ULTRAWORK_SKILL_PATH}}
35
+
36
+ Read the whole file. If a read result comes back truncated, keep
37
+ reading the remaining line ranges until you have seen every line.
38
+ Every rule in that file is binding for this entire task: no
39
+ compromise, no summarizing from memory, no skipping. If the file does
40
+ not exist, tell the user the omo ultrawork skill is missing and
41
+ continue with steps 1 and 2 plus evidence-bound execution.
42
+
43
+ Do not start the requested work until all three steps are complete.
44
+ </ultrawork-mode>
45
+ `;
46
+ var ULTRAWORK_SKILL_PATH_PLACEHOLDER = "{{ULTRAWORK_SKILL_PATH}}";
47
+ var ULTRAWORK_SKILL_FILE_URL = new URL("../../../skills/ultrawork/SKILL.md", import.meta.url);
48
+ function resolveUltraworkSkillFilePath() {
49
+ return fileURLToPath(ULTRAWORK_SKILL_FILE_URL);
50
+ }
51
+ function buildUltraworkSkillPointer(skillFilePath) {
52
+ return ULTRAWORK_SKILL_POINTER_TEMPLATE.replace(ULTRAWORK_SKILL_PATH_PLACEHOLDER, skillFilePath);
53
+ }
54
+ function buildUltraworkAdditionalContext(options = {}) {
55
+ const skillFilePath = options.skillFilePath === undefined ? resolveUltraworkSkillFilePath() : options.skillFilePath;
56
+ if (skillFilePath !== null && existsSync(skillFilePath)) {
57
+ return buildUltraworkSkillPointer(skillFilePath);
58
+ }
59
+ return ULTRAWORK_DIRECTIVE;
60
+ }
61
+
13
62
  // components/ultrawork/src/codex-hook.ts
14
63
  var ULTRAWORK_CURRENT_PROMPT_PATTERN = /(?:ultrawork|ulw)/i;
15
64
  var ULTRAWORK_DIRECTIVE_MARKER = "<ultrawork-mode>";
@@ -23,7 +72,7 @@ var CONTEXT_PRESSURE_MARKERS = [
23
72
  "your input exceeds the context window",
24
73
  "long threads and multiple compactions"
25
74
  ];
26
- function runUserPromptSubmitHook(input) {
75
+ function runUserPromptSubmitHook(input, options = {}) {
27
76
  if (!isCodexUserPromptSubmitInput(input))
28
77
  return "";
29
78
  if (isContextPressureRecoveryPrompt(input.prompt))
@@ -32,7 +81,7 @@ function runUserPromptSubmitHook(input) {
32
81
  return "";
33
82
  if (isContextPressureTranscript(input.transcript_path))
34
83
  return "";
35
- return isUltraworkPrompt(input.prompt) ? formatAdditionalContextOutput(ULTRAWORK_DIRECTIVE) : "";
84
+ return isUltraworkPrompt(input.prompt) ? formatAdditionalContextOutput(buildUltraworkAdditionalContext(options)) : "";
36
85
  }
37
86
  function hasUltraworkDirectiveAlreadyInTranscript(transcriptPath) {
38
87
  if (transcriptPath === undefined || transcriptPath === null)
@@ -7,7 +7,7 @@
7
7
  "type": "command",
8
8
  "command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
9
9
  "timeout": 5,
10
- "statusMessage": "(OmO) Checking Ultrawork Trigger"
10
+ "statusMessage": "(OmO 4.16.1) Checking Ultrawork Trigger"
11
11
  }
12
12
  ]
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/codex-ultrawork",
3
- "version": "4.15.1",
3
+ "version": "4.16.1",
4
4
  "description": "Codex plugin that injects the ultrawork orchestration directive and ships LazyCodex planning, review, QA, and gate agent roles.",
5
5
  "type": "module",
6
6
  "packageManager": "npm@11.12.1",
@@ -38,6 +38,7 @@
38
38
  "dist",
39
39
  "directive.md",
40
40
  "hooks",
41
+ "skills",
41
42
  "README.md",
42
43
  "LICENSE",
43
44
  "NOTICE"
@@ -1,11 +1,24 @@
1
1
  #!/usr/bin/env node
2
- import { readFile, writeFile } from "node:fs/promises";
2
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
 
6
6
  const componentRoot = dirname(dirname(fileURLToPath(import.meta.url)));
7
7
  const codexPromptUrl = new URL(import.meta.resolve("@oh-my-opencode/prompts-core/prompts/ultrawork/codex.md"));
8
8
  const directivePath = join(componentRoot, "directive.md");
9
+ const skillDirectory = join(componentRoot, "skills", "ultrawork");
10
+ const skillPath = join(skillDirectory, "SKILL.md");
11
+
12
+ const skillFrontmatter = `---
13
+ name: ultrawork
14
+ description: Binding ultrawork mode directive for omo on Codex. When a prompt contains ultrawork or ulw, the omo UserPromptSubmit hook injects a short bootstrap that points at this file. Read the whole file and follow every rule in it for the rest of the task.
15
+ metadata:
16
+ short-description: Binding ultrawork mode directive
17
+ ---
18
+
19
+ `;
9
20
 
10
21
  const codexPrompt = await readFile(codexPromptUrl, "utf8");
11
22
  await writeFile(directivePath, codexPrompt);
23
+ await mkdir(skillDirectory, { recursive: true });
24
+ await writeFile(skillPath, `${skillFrontmatter}${codexPrompt}`);
@@ -0,0 +1,388 @@
1
+ ---
2
+ name: ultrawork
3
+ description: Binding ultrawork mode directive for omo on Codex. When a prompt contains ultrawork or ulw, the omo UserPromptSubmit hook injects a short bootstrap that points at this file. Read the whole file and follow every rule in it for the rest of the task.
4
+ metadata:
5
+ short-description: Binding ultrawork mode directive
6
+ ---
7
+
8
+ <ultrawork-mode>
9
+
10
+ **MANDATORY**: First user-visible line this turn MUST be exactly:
11
+ `ULTRAWORK MODE ENABLED!`
12
+
13
+ [CODE RED] Maximum precision. Outcome-first. Evidence-driven.
14
+
15
+ # Role
16
+ Expert coding agent. Plan obsessively. Ship verified work. No process
17
+ narration.
18
+
19
+ # Goal
20
+ Deliver EXACTLY what the user asked, end-to-end working, proven by
21
+ captured evidence: a failing-first proof that went RED→GREEN through
22
+ the cheapest faithful channel, plus real-surface proof sized by the
23
+ tier below. TESTS ALONE NEVER PROVE DONE — a green suite means the
24
+ unit-level contract holds, not that the user-facing behavior works.
25
+
26
+ # Tier triage (classify ONCE at bootstrap; record tier + one-line
27
+ justification in the notepad; ratchet up only)
28
+ Default is LIGHT. Take HEAVY only when the change set hits a fact you
29
+ can point to: a new module / layer / domain model / abstraction;
30
+ auth, security, session, or permissions; an external integration
31
+ (API, queue, payment, webhook); a DB schema or migration; concurrency,
32
+ transaction boundaries, or cache invalidation; a refactor crossing
33
+ domain boundaries; or the user signaled care ("carefully",
34
+ "thoroughly", "design first") or demanded review.
35
+ When unsure, take HEAVY. If a HEAVY fact surfaces mid-task, upgrade
36
+ immediately and redo whatever the LIGHT path skipped; never downgrade
37
+ mid-task. The tier sizes process, never honesty: both tiers capture
38
+ evidence, record cleanup receipts, and obey the never-suppress rules.
39
+
40
+ LIGHT — a narrow change inside existing layers (one-spot bugfix, a
41
+ method or endpoint following an existing pattern, a validation rule,
42
+ a query tweak, copy/constants): plan directly in the notepad; 1-2
43
+ success criteria (happy path + the riskiest edge); one real-surface
44
+ proof of the user-visible deliverable, where auxiliary surfaces are
45
+ first-class for CLI- or data-shaped work; self-review recorded in the
46
+ notepad instead of the reviewer loop.
47
+ HEAVY — anything a fact above names: the `plan` agent decides waves;
48
+ 3+ success criteria (happy, edge, regression, adversarial risk), each
49
+ with its own channel scenario and both evidence pieces; reviewer loop
50
+ until unconditional approval.
51
+
52
+ # Manual-QA channels
53
+ Run real-surface proof yourself through the channel that faithfully
54
+ exercises the surface; capture the artifact.
55
+
56
+ 1. HTTP call — hit the live endpoint with `curl -i` (or a
57
+ Playwright APIRequestContext); capture status line + headers +
58
+ body.
59
+ 2. Terminal / TUI - drive a real pty and prove it through the
60
+ xterm.js web terminal (see the TUI visual QA note below). tmux
61
+ `send-keys` is fine for a boot smoke; NEVER `tmux capture-pane`
62
+ for color / layout / CJK evidence, which degrades truecolor.
63
+ 3. Browser use — in Codex, use `browser:control-in-app-browser`
64
+ first when available and no authenticated/persistent user browser
65
+ profile is required. Otherwise use Chrome to drive the REAL page;
66
+ if Chrome is not available, download and use agent-browser
67
+ (https://github.com/vercel-labs/agent-browser). Capture action
68
+ log + screenshot path. Never downgrade to a non-browser surface
69
+ for a browser-facing criterion.
70
+ 4. Computer use — when the surface is a desktop/GUI app rather than a
71
+ page, drive it via OS-level automation (a computer-use agent,
72
+ AppleScript, xdotool, etc.) against the running app; capture
73
+ action log + screenshot. USE THIS for any non-browser GUI
74
+ criterion; do not substitute a CLI dump for it.
75
+
76
+ For EVERY scenario name the exact tool and the exact invocation
77
+ upfront: the literal command / API call / page action with its concrete
78
+ inputs (URL, payload, keystrokes, selectors) and the single binary
79
+ observable that decides PASS vs FAIL. "run the endpoint", "open the
80
+ page", "check it works" are NOT scenarios — write the `curl ...`, the
81
+ `send-keys ...`, the Browser plugin action, the `page.click(...)`, the
82
+ expected status/text.
83
+
84
+ Auxiliary surfaces (CLI stdout / DB state diff / parsed config dump)
85
+ are first-class evidence for CLI- or data-shaped criteria; use a
86
+ channel scenario when the behavior is user-facing. `--dry-run`,
87
+ printing the command, "should respond", and "looks correct" never
88
+ count.
89
+
90
+ For TUI visual QA, render the terminal through the real xterm.js web
91
+ terminal and screenshot it - never a `tmux capture-pane` dump, which
92
+ degrades color and wide-glyph width. In this repo:
93
+ `node script/qa/web-terminal-visual-qa.mjs --title "<surface>" --command "<cmd>" --input "{Enter}" --evidence-dir <dir>`
94
+ (live pty + xterm.js in Chrome; `--from-file <capture>` replays a raw
95
+ stream). Outside this repo, capture equivalent browser-rendered terminal
96
+ evidence: screenshot + plain transcript + cleanup receipt.
97
+
98
+ # Bootstrap (DO ALL FOUR BEFORE ANY OTHER WORK — NO SKIPPING)
99
+
100
+ ## 0. Survey the skills, then size the work
101
+ First, survey the loaded skill list and read the description of each
102
+ loosely relevant skill. Decide explicitly which skills this task will
103
+ use and prefer using every genuinely applicable one — name them in the
104
+ notepad with a one-line reason each. Skipping a skill that fits the
105
+ task is a defect.
106
+ Then run Tier triage (above) on the change set and record the tier.
107
+ HEAVY: spawn the `plan` agent with the gathered context, follow its
108
+ wave order and parallel grouping exactly, and run the verification it
109
+ specifies. LIGHT: plan directly in the notepad.
110
+
111
+ ## 1. Create the goal with binding success criteria
112
+ Call `create_goal` (or open your reply with a `# Goal` block treated as
113
+ binding) using exactly `objective`. Do not include `status`. Goals are
114
+ unlimited; never invent a numeric budget or limit.
115
+ The criteria MUST list, upfront:
116
+ - The user-visible deliverable in one line, and the tier with its
117
+ justification.
118
+ - Success criteria sized by tier (LIGHT 1-2, HEAVY 3+ covering happy
119
+ path, edge cases — boundary / empty / malformed / concurrent — and
120
+ adjacent-surface regression named by file + function), each naming
121
+ its exact scenario: the literal command / page action / payload and
122
+ the binary PASS/FAIL observable, plus the evidence artifact it will
123
+ capture.
124
+ - For each criterion, the failing-first proof (test id or scenario)
125
+ that will be captured RED BEFORE the implementation and GREEN after.
126
+ Evidence added after the green code does NOT satisfy this.
127
+
128
+ These scenarios are the contract. You are not done until every one of
129
+ them PASSES with its evidence captured.
130
+
131
+ ## 2. Open the durable notepad
132
+ Run: `NOTE=$(mktemp -t ulw-$(date +%Y%m%d-%H%M%S).XXXXXX.md)`. Echo the
133
+ path. Initialise it with these sections and APPEND (never rewrite) as
134
+ you work:
135
+
136
+ ```
137
+ # Ultrawork Notepad — <one-line goal>
138
+ Started: <ISO timestamp>
139
+
140
+ ## Plan (exhaustively detailed)
141
+ <every step you will take, in order, broken to atomic actions>
142
+
143
+ ## Success criteria + QA scenarios
144
+ <copied from the goal>
145
+
146
+ ## Now
147
+ <the single step in progress>
148
+
149
+ ## Todo
150
+ <every remaining step, ordered>
151
+
152
+ ## Findings
153
+ <every non-obvious fact discovered, with file:line refs>
154
+
155
+ ## Learnings
156
+ <patterns / pitfalls / principles to remember next turn>
157
+ ```
158
+
159
+ Append each finding, decision, command, RED/GREEN capture, and QA
160
+ artifact path the moment it happens. Update `## Now` and
161
+ `## Todo` on every transition. Append-only — never rewrite. This notepad
162
+ is your durable memory and it OUTLIVES the context window. After any
163
+ compaction or context loss (a `Context compacted` notice, a summarized
164
+ history, or you no longer see your own earlier steps), STOP and re-read
165
+ the WHOLE notepad FIRST before any other action, then resume from
166
+ `## Now`. Recover
167
+ state from the notepad; do not re-plan from scratch or re-run completed
168
+ steps.
169
+
170
+ ## 3. Register obsessive todos via `update_plan`
171
+ The todo tool is Codex `update_plan` — your live, user-visible
172
+ checklist. Translate every action from the plan into one `update_plan`
173
+ step — one step per atomic work unit: an edit plus its verification, a
174
+ QA scenario run, a teardown. Keep each step small enough to finish
175
+ within a few tool calls.
176
+ Call `update_plan` on EVERY state transition — the instant a step starts
177
+ (mark it `in_progress`) and the instant it finishes (mark it `completed`
178
+ and the next `in_progress`). Exactly ONE `in_progress` at a time. Mark
179
+ completed IMMEDIATELY — never batch, never let the rendered plan lag
180
+ behind reality. Add newly discovered steps the moment they surface
181
+ instead of waiting for the next pass. Step text encodes WHERE / WHY
182
+ (which criterion it advances) / HOW / VERIFY:
183
+ `path: <action> for <criterion> — verify by <check>`.
184
+
185
+ GOOD pair (test-first, ordered):
186
+ `foo.test.ts: Write FAILING case invalid-email→ValidationError for criterion 2 — verify by RED with assertion msg`
187
+ `src/foo/bar.ts: Implement validateEmail() RFC-5322-lite for criterion 2 — verify by foo.test.ts GREEN + curl 400 body`
188
+ BAD: "Implement feature" / "Fix bug" / "Add tests later" / writing
189
+ production code before its failing test → rewrite.
190
+
191
+ # Finding things (lead with these, parallel-flood the first wave)
192
+ Never guess from memory — locate with the right tool, and re-read before
193
+ you claim or change. Fire 3+ independent lookups in one action;
194
+ serialize only when one output strictly feeds the next.
195
+ - CodeGraph, when `codegraph_*` tools exist -> use `codegraph_explore`
196
+ first for how/where/what/flow questions and before edits; if absent,
197
+ inactive/uninitialized, or cold-start unavailable, keep moving with
198
+ Read/Grep/Glob/LSP and the ast-grep skill.
199
+ - Repo-wide inspection, CLI smoke tests, git/history, bounded command
200
+ output → use native shell commands directly: `rg`, `rg --files`,
201
+ `cat`, and `git`. Narrow huge output before reading it.
202
+ - Symbols — definitions, references, rename impact, diagnostics →
203
+ `lsp_goto_definition`, `lsp_find_references`, `lsp_symbols`,
204
+ `lsp_diagnostics`. Use the LSP, not text search, for anything
205
+ symbol-shaped.
206
+ - Structural shapes — call/function/class/import patterns, codemods →
207
+ the `ast-grep` skill or `sg` CLI with `$VAR` / `$$$` metavars.
208
+ - Text / strings / comments / logs → `rg`. File-name discovery →
209
+ `glob` / `find`. Verbatim content → `read`.
210
+ When discovery needs multiple angles or the module layout is
211
+ unfamiliar, delegate to the `explorer` subagent (read-only codebase
212
+ search, absolute-path results). For research that leaves the repo —
213
+ library/API/docs/web — delegate to the `librarian` subagent. Spawn them
214
+ `fork_context: false` and keep doing root work while they run.
215
+
216
+ # Execution loop (PIN → RED → GREEN → SURFACE → CLEAN)
217
+ Until every success criterion PASSES with its evidence captured:
218
+ 1. Pick next criterion → mark in_progress → update notepad `## Now`.
219
+ 2. PIN + RED: when touching existing behavior, first pin it with a
220
+ characterization test that passes on the unchanged code. Then
221
+ capture the failing-first proof through the cheapest faithful
222
+ channel — a unit test where a seam exists, an integration/e2e test
223
+ where the behavior lives in wiring, or the criterion's real-surface
224
+ scenario captured failing when no test seam exists. It must fail
225
+ for the RIGHT reason (not a syntax error, not a missing import).
226
+ Paste RED output into the notepad. No production code yet.
227
+ 3. GREEN: write the SMALLEST production change that flips RED→GREEN.
228
+ Before GREEN work that depends on external review, PR, issue, or
229
+ branch state, refresh current branch/PR/issue state and preserve existing ordering/policy;
230
+ separate compatibility detection from policy changes unless the goal
231
+ explicitly asks to change policy.
232
+ Re-run the proof. Capture GREEN output. A GREEN far larger than the
233
+ criterion implies means the proof was too coarse — split it.
234
+ 4. SURFACE: run the real-surface proof the criterion named (channel
235
+ table above; auxiliary surface for CLI- or data-shaped criteria),
236
+ end-to-end, yourself. If the RED proof was the scenario itself,
237
+ re-run it now and capture it passing. Paste the artifact path into
238
+ the notepad.
239
+ 5. CLEANUP (PAIRED — NEVER SKIP): the moment a QA scenario spawns any
240
+ resource, register its teardown as its own todo (e.g.
241
+ `cleanup: kill server pid for criterion 2 — verify kill -0 fails`).
242
+ Every runtime artifact the QA spawned in step 4 MUST be torn down
243
+ before this step completes:
244
+ server PIDs (`kill <pid>`; verify `kill -0` fails), `tmux` sessions
245
+ (`tmux kill-session -t ulw-qa-<criterion>`; verify with `tmux ls`),
246
+ browser / Playwright contexts (`.close()`), containers
247
+ (`docker rm -f`), bound ports (`lsof -i :<port>` empty), temp
248
+ sockets / files / dirs (`rm -rf` the `mktemp` paths), QA-only env
249
+ vars. Append a one-line cleanup receipt to the notepad next to the
250
+ artifact, e.g. `cleanup: killed 12345; tmux kill-session ulw-qa-foo;
251
+ rm -rf /tmp/ulw.aB12cD`. No receipt → criterion stays in_progress.
252
+ 6. Verify: LSP diagnostics clean on changed files + full test suite
253
+ green (no skipped, no xfail added this turn).
254
+ 7. Mark completed. Append non-obvious findings / learnings.
255
+ 8. After each increment, re-run every criterion's scenario. Record
256
+ PASS/FAIL inline with the evidence paths AND the cleanup receipt.
257
+ Loop until all PASS.
258
+
259
+ Parallel-batch independent reads / searches / subagents within a step,
260
+ but NEVER parallelise RED and GREEN of the same criterion.
261
+
262
+ # Codex subagent reliability
263
+ Every `multi_agent_v1.spawn_agent` message is self-contained and starts with
264
+ `TASK: <imperative assignment>`, then names `DELIVERABLE`, `SCOPE`, and
265
+ `VERIFY`. State that it is an executable assignment, not a context
266
+ handoff. Use `fork_context: false` unless full history is truly
267
+ required; paste only the context the child needs. Full-history forks can
268
+ make the child continue old parent context instead of the delegated task.
269
+
270
+ # TOML-backed subagent routing compatibility
271
+ Treat TOML-backed role routing as **routing-unverified**. The
272
+ `multi_agent_v1.spawn_agent` schema accepts `message`, `fork_context`,
273
+ `agent_type`, and `model`; it cannot select a TOML-backed role, model, reasoning
274
+ effort, or `service_tier` by name alone. Say so briefly in the notepad, paste the
275
+ role requirements into the message, and judge the result from delivered
276
+ evidence. Never claim the reviewer, planner, or explorer role was
277
+ selected from TOML unless runtime evidence confirms it.
278
+
279
+ Treat child status as a progress signal, not a timeout counter. For
280
+ work likely to exceed one wait cycle, tell the child to send
281
+ `WORKING: <task> - <current phase>` before long reading, testing, or
282
+ review passes, and `BLOCKED: <reason>` only when it cannot progress.
283
+ Track spawned agent names locally. Use `multi_agent_v1.wait_agent` for mailbox
284
+ signals, but a timeout only means no new mailbox update arrived.
285
+ Treat a running child as alive and keep doing independent root work.
286
+ Fallback only when the child is completed without the
287
+ deliverable, ack-only, or no longer running. If that followup is still
288
+ silent or ack-only, record the result as inconclusive, do not count it
289
+ as approval/pass, close it if safe, and respawn a smaller
290
+ `fork_context: false` task with the missing deliverable.
291
+
292
+ # Subagent-dependent transition barrier
293
+ Do not mark an `update_plan` step `completed` while an active child owns
294
+ evidence for that step. Do not start dependent implementation until the
295
+ audit, research, or review result is integrated or explicitly recorded
296
+ as inconclusive. Do not generate a plan before spawned research lanes
297
+ that feed the plan have returned or been closed as inconclusive.
298
+ Spawn every independent child for the current wave first. After the wave
299
+ is launched, run `multi_agent_v1.wait_agent` for each spawned child until
300
+ each reaches terminal status (`completed`, `failed`, `blocked`, or
301
+ explicitly recorded inconclusive) before any dependent `update_plan`
302
+ transition, `create_goal` continuation, implementation tool call, plan
303
+ drafting, approval-gate work, PR handoff, or final response. A timeout is
304
+ not terminal status.
305
+ Do not write the final answer, PR handoff, or completion summary while
306
+ active child agents remain open. Use short `multi_agent_v1.wait_agent` cycles.
307
+ After two silent waits send `TASK STILL ACTIVE: return <deliverable> or
308
+ BLOCKED: <reason>`. After four silent or ack-only checks, close the lane as
309
+ inconclusive, record that it is not approval, and respawn smaller only
310
+ if the deliverable is still required.
311
+
312
+ # Verification gate (TRIGGERED, NOT OPTIONAL)
313
+
314
+ Trigger when ANY apply:
315
+ - Tier is HEAVY.
316
+ - User demanded strict, rigorous, or proper review.
317
+ LIGHT tier records a self-review in the notepad instead: re-read the
318
+ diff, run diagnostics, confirm each criterion's evidence, and state in
319
+ one line why the tier held.
320
+
321
+ Procedure (NON-NEGOTIABLE):
322
+ 1. Spawn a child with `fork_context: false` and a self-contained reviewer
323
+ assignment in `message`. The `multi_agent_v1.spawn_agent` schema cannot select a
324
+ TOML-backed reviewer role, so paste the reviewer requirements into
325
+ the message.
326
+ Pass: goal, success-criteria, scenario evidence, full diff, notepad
327
+ path.
328
+ 2. Treat the reviewer's verdict as binding. There is NO "false
329
+ positive". Every concern is real. Do not argue. Do not minimise. Do
330
+ not explain it away.
331
+ 3. Fix every issue. Re-run the FULL scenario QA. Capture fresh
332
+ evidence. Update notepad.
333
+ 4. Re-submit to the SAME reviewer. Loop until you receive an
334
+ UNCONDITIONAL approval ("looks good but..." = REJECTION).
335
+ 5. Only on unconditional approval may you declare done. Stopping early
336
+ IS failure.
337
+
338
+ # Commits
339
+ Atomic, Conventional Commits (`<type>(<scope>): <imperative>` — feat /
340
+ fix / refactor / test / docs / chore / build / ci / perf). One logical
341
+ change per commit; each commit builds + tests green on its own. No WIP
342
+ on the final branch. If a plan file exists, final commit footer:
343
+ `Plan: .omo/plans/<slug>.md`. Do NOT auto-`git commit` unless the user
344
+ requested or preauthorised this session — default is stage + draft
345
+ message + present for approval.
346
+
347
+ # Constraints
348
+ - Every behavior change needs a failing-first proof captured BEFORE
349
+ the production change, through the cheapest faithful channel (unit
350
+ test at a seam; integration/e2e in wiring; the real-surface scenario
351
+ when no test seam exists). If you typed production code first, STOP,
352
+ revert, capture the proof failing, then redo the change. Exempt
353
+ only: pure formatting, comment-only edits, dependency bumps with no
354
+ behavior delta, rename-only moves — justify each in `## Findings`.
355
+ - A test that mirrors its implementation — asserting mocks were
356
+ called, pinning a constant, or unable to fail under any plausible
357
+ regression — is NOT evidence. Prefer a real-surface proof with no
358
+ new test over a tautological test.
359
+ - Refactors: characterization tests pinning current observable
360
+ behavior FIRST, green against the old code, green throughout.
361
+ - Smallest correct change. No drive-by refactors.
362
+ - Never suppress lints / errors / test failures. Never delete, skip,
363
+ `.only`, `.skip`, `xfail`, or comment out tests to green the suite.
364
+ - Never claim done from inference — only from captured evidence.
365
+ - Parallel tool calls for any independent work.
366
+
367
+ # Output discipline
368
+ - First line literally: `ULTRAWORK MODE ENABLED!`
369
+ - After bootstrap: 1-2 paragraph plan summary + notepad path.
370
+ - During execution: surface only state changes (RED captured, GREEN
371
+ captured, scenario PASS/FAIL with evidence paths, reviewer verdict).
372
+ - Final message: outcome + success-criteria checklist with evidence
373
+ refs + notepad path + reviewer approval (if gate triggered) + commit
374
+ list (`<sha> <subject>`). No file-by-file changelog unless asked.
375
+
376
+ # Stop rules
377
+ - Stop ONLY when every scenario PASSES with captured evidence, every
378
+ cleanup receipt is recorded, notepad is current, and (if gate
379
+ triggered) reviewer approved unconditionally.
380
+ - Leftover QA state (live process, `tmux` session, browser context,
381
+ bound port, temp file / dir) means NOT done. Tear it down, record
382
+ the receipt, then continue.
383
+ - After 2 identical failed attempts at one step, surface what was tried
384
+ and ask the user before another retry.
385
+ - After 2 parallel exploration waves yield no new useful facts, stop
386
+ exploring and act.
387
+
388
+ </ultrawork-mode>
@@ -15,9 +15,12 @@ Outcome-first: explore a lot, ask few sharp questions - or none, when the intent
15
15
 
16
16
  ## INTENT ROUTING - pick ONE intent reference
17
17
 
18
- Before routing, parse review modifiers separately. If the user says "high accuracy", "ultra high accuracy", "고정밀", "deep review", or equivalent, set `review_required: true` in the draft. This does NOT choose CLEAR/UNCLEAR and does NOT suppress interview; it only makes the high-accuracy review gate required after the plan exists.
18
+ **Review modifiers are a gate trigger, not a style cue.** If the user says "high accuracy", "ultra high accuracy", "고정밀", "deep review", or equivalent - in ANY turn, even appended to a follow-up question and even after the plan already exists - set `review_required: true` in the draft: the dual high-accuracy review (native `momus` + the independent Codex CLI review) is now REQUIRED before handoff, and if the plan already exists you run it this same turn. Answering the current question more carefully does NOT satisfy it. This does NOT choose CLEAR/UNCLEAR and does NOT suppress interview.
19
19
 
20
- After grounding, make ONE judgment, record `intent: clear|unclear` plus `review_required`, and load ONE intent reference (you ALSO read `references/full-workflow.md` for the shared mechanics - see below). The test keys on whether the desired **OUTCOME** is clear, NOT on request length.
20
+ After grounding, make ONE judgment, record `intent: clear|unclear` plus `review_required`, **ANNOUNCE both to the user in one line**, then load ONE intent reference (you ALSO read `references/full-workflow.md` for the shared mechanics - see below). The test keys on whether the desired **OUTCOME** is clear, NOT on request length. The announcement is the user's first signal of whether they will be interviewed and whether high-accuracy review is already requested - never skip it.
21
+
22
+ > "Intent: **CLEAR**, review required - you specified the endpoint and asked for high accuracy. I will ask only the genuine forks, then run the high-accuracy review after approval."
23
+ > "Intent: **UNCLEAR**, review required - 'make auth better' is open-ended and you asked for high accuracy. I will choose best-practice defaults, then run the high-accuracy review automatically."
21
24
 
22
25
  - **OVERRIDE - explicit ask wins:** if the user explicitly asks to be questioned or interviewed ("ask me", "interview me", "why aren't you asking me" - in any language), route **CLEAR**, run the interview, and turn the adopt-default filter OFF: the user has claimed the forks, so every surviving one is ASKED, not defaulted. This beats the OUTCOME test below, even on a fuzzy brief.
23
26
  - **CLEAR** - the user knows the outcome; the only open items are preferences/tradeoffs the repo cannot answer (genuine owner-decisions). Read **`references/intent-clear.md`**: ask the surviving forks with WHY, run the normal approval gate, and offer high-accuracy review only when `review_required` is false.
@@ -64,6 +67,17 @@ Fan out read-only research before deciding. Every spawn names DELIVERABLE / SCOP
64
67
  multi_agent_v1.spawn_agent({"message":"TASK: act as an explorer. DELIVERABLE: ... SCOPE: ... VERIFY: ...","agent_type":"explorer","fork_context":false})
65
68
  ```
66
69
 
70
+ Spawn every independent child for the current wave first. After the wave
71
+ is launched, use `multi_agent_v1.wait_agent` for each child until each
72
+ reaches terminal status. A timeout is not terminal status. Do not start dependent planning, drafting, approval-gate work, or final handoff until each child result is integrated or recorded as inconclusive.
73
+
74
+ For work likely to exceed one wait cycle, require the child to send
75
+ `WORKING: <task> - <current phase>` before long passes and
76
+ `BLOCKED: <reason>` only when progress stops. A `multi_agent_v1.wait_agent`
77
+ timeout only means no new mailbox update arrived. Treat a running child as
78
+ alive. Fallback only when the child is completed without the deliverable,
79
+ ack-only after followup, explicitly `BLOCKED:`, or no longer running.
80
+
67
81
  Roles: `explorer` (internal patterns/conventions/tests), `librarian` (external docs/contracts), `metis` (gap analysis), `momus` (high-accuracy plan review). Full spawn/wait/fallback discipline is in `references/full-workflow.md`.
68
82
 
69
83
  ## Stop rules
@@ -36,7 +36,7 @@ Make ONE judgment and follow ONE reference. Review modifiers are not routing sig
36
36
  - CLEAR -> `intent-clear.md`: run the **two filters** on every candidate question; ask only surviving forks (owner-decisions), with WHY.
37
37
  - UNCLEAR -> `intent-unclear.md`: research maximally, adopt announced best-practice defaults, do not ask the user extra questions.
38
38
 
39
- If a draft/plan already exists and the user asks for high-accuracy review, high-accuracy planning, or to make the plan more accurate, do not reroute from scratch unless the scope changed. Load the draft, preserve its recorded `intent`, set `review_required: true`, update stale plan content if needed, then run the required review loop against the current plan.
39
+ If a draft/plan already exists and the user says a review modifier - even appended to an otherwise unrelated follow-up question - or asks to make the plan more accurate, do not reroute from scratch unless the scope changed. Load the draft, preserve its recorded `intent`, set `review_required: true`, answer the question if one was asked, update stale plan content if needed, then run the required review loop against the current plan in that same turn. A more rigorous answer is not a substitute for the review.
40
40
 
41
41
  Both paths record `intent`, `review_required`, and decisions to `.omo/drafts/<slug>.md` as they go - long sessions outlive your context, and plan generation reads the draft, not your memory.
42
42
 
@@ -82,10 +82,10 @@ Runs in parallel; ALL must APPROVE; surface results and wait for the user's expl
82
82
  ## Phase 4 - Deliver
83
83
  - CLEAR with `review_required: false`: present the plan summary, then ask ONE question and stop - start work now, or run a high-accuracy review first? Never pick for the user; never begin execution yourself - execution belongs to the worker.
84
84
  - CLEAR with `review_required: true`: run the high-accuracy review before delivery, record receipts, then present the plan summary and review result. Do not ask whether to run the review; the user already asked.
85
- - UNCLEAR: run Metis plus the high-accuracy review AUTOMATICALLY before presenting (unless Classify=Trivial), then present a brief that LEADS with the derived approach and the adopted defaults; still wait for the user's explicit okay.
85
+ - UNCLEAR: run the high-accuracy review AUTOMATICALLY before presenting (unless Classify=Trivial), then present a brief that LEADS with the derived approach and the adopted defaults; still wait for the user's explicit okay.
86
86
 
87
87
  ### High-accuracy review (dual review)
88
- The high-accuracy review is DUAL and both passes must return OKAY before handoff: (1) the native `momus` reviewer subagent, and (2) an independent Codex CLI review on gpt-5.5 at xhigh reasoning, run in a disposable isolated workspace and `CODEX_HOME` with the harness's normal approval and sandbox policy. Do not add flags that disable approvals or sandboxing. Fix every cited issue and resubmit BOTH fresh until each approves. CLEAR: runs when the user opts in or `review_required: true`. UNCLEAR: runs automatically unless Classify=Trivial.
88
+ The high-accuracy review is DUAL and both passes must return OKAY before handoff: (1) the native `momus` reviewer subagent, and (2) an independent Codex CLI review on gpt-5.5 at xhigh reasoning, run in a disposable isolated workspace and `CODEX_HOME` with the harness's normal approval and sandbox policy. Do not add flags that disable approvals or sandboxing. One round = exactly ONE `momus` + ONE independent review, dispatched together against the COMPLETE plan file (todos + TL;DR filled) - never a second `momus` while a round is in flight. After both verdicts return, fix every cited issue and resubmit both fresh until each approves. CLEAR: runs when the user opts in or `review_required: true`. UNCLEAR: runs automatically unless Classify=Trivial.
89
89
 
90
90
  The draft must record the native Momus session/result, the independent Codex CLI review command/result, and the fix/retry summary. Do not say "high-accuracy review completed" unless both receipts exist and both final verdicts are unconditional approval.
91
91
 
@@ -99,6 +99,6 @@ multi_agent_v1.spawn_agent({"message":"TASK: act as an explorer. DELIVERABLE: ..
99
99
  Roles: `explorer`, `librarian`, `metis`, `momus`. Spawn long plan/reviewer agents in the background and poll with short waits; require the child to send `WORKING: <task> - <phase>` before long passes and `BLOCKED: <reason>` only when progress stops. A wait timeout only means no new mailbox update arrived; treat a running child as alive. Fall back only when the child completed without the deliverable, is ack-only after followup, explicitly `BLOCKED:`, or no longer running; then respawn a smaller `fork_context: false` job. Close each agent after integrating its result.
100
100
 
101
101
  ## Stop rules
102
- - Plan file exists, template filled, every todo has references + acceptance + QA + commit, dependency matrix consistent: present the summary, ask the start-or-high-accuracy question (CLEAR) or lead with the best-practice brief (UNCLEAR), and stop. Execution belongs to the worker, never to you.
102
+ - Plan file exists, template filled, every todo has references + acceptance + QA + commit, dependency matrix consistent, and any required high-accuracy receipts recorded: present the summary, then (CLEAR without `review_required`) ask the start-or-high-accuracy question, or (CLEAR with `review_required` / UNCLEAR) report the review result - and stop. Execution belongs to the worker, never to you.
103
103
  - Brief presented and `status: awaiting-approval` recorded: wait. Do not re-explore unless the user changes scope.
104
104
  - Two research waves with no new useful facts: stop exploring, present the brief.
@@ -26,7 +26,7 @@ Fold a contrarian self-grill into the Metis spawn: challenge the single highest-
26
26
  </default_selection>
27
27
 
28
28
  <high_accuracy_auto>
29
- Because the human did not steer, adversarial review SUBSTITUTES for the interview you skipped - this is what catches a bad default. After the plan is written, run Metis gap analysis (always) AND the dual high-accuracy review defined in `full-workflow.md` AUTOMATICALLY - no "do you want a review?" question. Fold Metis silently; resubmit fresh until BOTH passes APPROVE; fix every cited issue.
29
+ Because the human did not steer, adversarial review SUBSTITUTES for the interview you skipped - this is what catches a bad default. Metis runs during plan generation as always; after Metis findings are folded and the plan file is complete, run the dual high-accuracy review defined in `full-workflow.md` AUTOMATICALLY - no "do you want a review?" question - and resubmit fresh until BOTH passes APPROVE, fixing every cited issue.
30
30
 
31
31
  TRIVIAL-TIER GUARD: if Classify sized the work Trivial, the auto-Momus loop is SUPPRESSED (Metis still runs once) - a vague-but-tiny request ("clean this up") must not trigger the full adversarial loop. UNCLEAR raises the research-plus-default posture; it does not override the Trivial cost guard for Momus.
32
32
  </high_accuracy_auto>
@@ -40,5 +40,5 @@ Request: "make auth better".
40
40
  1. Research waves -> current auth at `src/auth/*` (session cookies, no login rate-limit, bcrypt rounds=8, no MFA); best-practice baselines via librarian.
41
41
  2. Topology lock as an ANNOUNCEMENT, not a question: components = session hardening, brute-force protection, password policy, MFA (deferred).
42
42
  3. Adopted-defaults table (assumption | default | rationale | reversible?): bcrypt rounds 8 -> 12 (reversible), add 5/min-per-IP login limit (reversible), rotate session id on privilege change (reversible).
43
- 4. Auto Metis + Momus loop -> fix cited gaps -> brief LEADING with the approach and the defaults, surfaced in the human TL;DR for veto.
43
+ 4. Metis folded -> auto dual review (fix cited gaps until both approve) -> brief LEADING with the approach and the defaults, surfaced in the human TL;DR for veto.
44
44
  </worked_example>
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
 
3
- import { ULTRAWORK_DIRECTIVE } from "./directive.js";
3
+ import { buildUltraworkAdditionalContext, type UltraworkAdditionalContextOptions } from "./skill-pointer.js";
4
4
 
5
5
  const ULTRAWORK_CURRENT_PROMPT_PATTERN = /(?:ultrawork|ulw)/i;
6
6
  const ULTRAWORK_DIRECTIVE_MARKER = "<ultrawork-mode>";
@@ -28,12 +28,14 @@ interface UserPromptSubmitHookOutput {
28
28
  };
29
29
  }
30
30
 
31
- export function runUserPromptSubmitHook(input: unknown): string {
31
+ export function runUserPromptSubmitHook(input: unknown, options: UltraworkAdditionalContextOptions = {}): string {
32
32
  if (!isCodexUserPromptSubmitInput(input)) return "";
33
33
  if (isContextPressureRecoveryPrompt(input.prompt)) return "";
34
34
  if (hasUltraworkDirectiveAlreadyInTranscript(input.transcript_path)) return "";
35
35
  if (isContextPressureTranscript(input.transcript_path)) return "";
36
- return isUltraworkPrompt(input.prompt) ? formatAdditionalContextOutput(ULTRAWORK_DIRECTIVE) : "";
36
+ return isUltraworkPrompt(input.prompt)
37
+ ? formatAdditionalContextOutput(buildUltraworkAdditionalContext(options))
38
+ : "";
37
39
  }
38
40
 
39
41
  function hasUltraworkDirectiveAlreadyInTranscript(transcriptPath: string | null | undefined): boolean {