claudecode-omc 4.8.1 → 4.8.3

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 (667) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +3 -3
  3. package/README.de.md +60 -0
  4. package/README.es.md +60 -0
  5. package/README.fr.md +60 -0
  6. package/README.it.md +60 -0
  7. package/README.ja.md +60 -0
  8. package/README.ko.md +60 -0
  9. package/README.md +101 -16
  10. package/README.pt.md +60 -0
  11. package/README.ru.md +60 -0
  12. package/README.tr.md +60 -0
  13. package/README.vi.md +60 -0
  14. package/README.zh.md +60 -0
  15. package/agents/code-reviewer.md +107 -6
  16. package/agents/critic.md +212 -42
  17. package/agents/debugger.md +52 -4
  18. package/agents/document-specialist.md +39 -60
  19. package/agents/executor.md +29 -9
  20. package/agents/explore.md +3 -1
  21. package/agents/security-reviewer.md +57 -0
  22. package/agents/test-engineer.md +21 -0
  23. package/agents/verifier.md +2 -0
  24. package/agents/writer.md +2 -0
  25. package/bridge/cli.cjs +7412 -3577
  26. package/bridge/mcp-server.cjs +558 -43
  27. package/bridge/runtime-cli.cjs +3034 -1801
  28. package/bridge/team-bridge.cjs +25 -1
  29. package/bridge/team-mcp.cjs +257 -88
  30. package/bridge/team.js +5226 -413
  31. package/dist/__tests__/agent-boundary-guidance.test.d.ts +2 -0
  32. package/dist/__tests__/agent-boundary-guidance.test.d.ts.map +1 -0
  33. package/dist/__tests__/agent-boundary-guidance.test.js +48 -0
  34. package/dist/__tests__/agent-boundary-guidance.test.js.map +1 -0
  35. package/dist/__tests__/agent-registry.test.js +48 -11
  36. package/dist/__tests__/agent-registry.test.js.map +1 -1
  37. package/dist/__tests__/auto-slash-aliases.test.js +25 -0
  38. package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
  39. package/dist/__tests__/bedrock-model-routing.test.d.ts +21 -0
  40. package/dist/__tests__/bedrock-model-routing.test.d.ts.map +1 -0
  41. package/dist/__tests__/bedrock-model-routing.test.js +397 -0
  42. package/dist/__tests__/bedrock-model-routing.test.js.map +1 -0
  43. package/dist/__tests__/cleanup-validation.test.js +7 -3
  44. package/dist/__tests__/cleanup-validation.test.js.map +1 -1
  45. package/dist/__tests__/cli-win32-warning.test.js +15 -2
  46. package/dist/__tests__/cli-win32-warning.test.js.map +1 -1
  47. package/dist/__tests__/consolidation-contracts.test.js +28 -3
  48. package/dist/__tests__/consolidation-contracts.test.js.map +1 -1
  49. package/dist/__tests__/context-guard-stop.test.d.ts +2 -0
  50. package/dist/__tests__/context-guard-stop.test.d.ts.map +1 -0
  51. package/dist/__tests__/context-guard-stop.test.js +58 -0
  52. package/dist/__tests__/context-guard-stop.test.js.map +1 -0
  53. package/dist/__tests__/delegation-enforcer.test.js +76 -11
  54. package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
  55. package/dist/__tests__/doctor-conflicts.test.js +62 -1
  56. package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
  57. package/dist/__tests__/hooks.test.js +165 -4
  58. package/dist/__tests__/hooks.test.js.map +1 -1
  59. package/dist/__tests__/hud/defaults.test.js +4 -0
  60. package/dist/__tests__/hud/defaults.test.js.map +1 -1
  61. package/dist/__tests__/hud/limits-error.test.js +2 -4
  62. package/dist/__tests__/hud/limits-error.test.js.map +1 -1
  63. package/dist/__tests__/hud/mission-board-state.test.d.ts +2 -0
  64. package/dist/__tests__/hud/mission-board-state.test.d.ts.map +1 -0
  65. package/dist/__tests__/hud/mission-board-state.test.js +170 -0
  66. package/dist/__tests__/hud/mission-board-state.test.js.map +1 -0
  67. package/dist/__tests__/hud/mission-board.test.d.ts +2 -0
  68. package/dist/__tests__/hud/mission-board.test.d.ts.map +1 -0
  69. package/dist/__tests__/hud/mission-board.test.js +143 -0
  70. package/dist/__tests__/hud/mission-board.test.js.map +1 -0
  71. package/dist/__tests__/hud/rate-limits-error.test.js +13 -0
  72. package/dist/__tests__/hud/rate-limits-error.test.js.map +1 -1
  73. package/dist/__tests__/hud/render-rate-limits-priority.test.d.ts +8 -0
  74. package/dist/__tests__/hud/render-rate-limits-priority.test.d.ts.map +1 -0
  75. package/dist/__tests__/hud/render-rate-limits-priority.test.js +145 -0
  76. package/dist/__tests__/hud/render-rate-limits-priority.test.js.map +1 -0
  77. package/dist/__tests__/hud/render.test.js +22 -0
  78. package/dist/__tests__/hud/render.test.js.map +1 -1
  79. package/dist/__tests__/hud/stale-indicator.test.d.ts +9 -0
  80. package/dist/__tests__/hud/stale-indicator.test.d.ts.map +1 -0
  81. package/dist/__tests__/hud/stale-indicator.test.js +81 -0
  82. package/dist/__tests__/hud/stale-indicator.test.js.map +1 -0
  83. package/dist/__tests__/hud/state.test.js +30 -0
  84. package/dist/__tests__/hud/state.test.js.map +1 -1
  85. package/dist/__tests__/hud/usage-api-lock.test.d.ts +2 -0
  86. package/dist/__tests__/hud/usage-api-lock.test.d.ts.map +1 -0
  87. package/dist/__tests__/hud/usage-api-lock.test.js +245 -0
  88. package/dist/__tests__/hud/usage-api-lock.test.js.map +1 -0
  89. package/dist/__tests__/hud/usage-api-stale.test.d.ts +9 -0
  90. package/dist/__tests__/hud/usage-api-stale.test.d.ts.map +1 -0
  91. package/dist/__tests__/hud/usage-api-stale.test.js +297 -0
  92. package/dist/__tests__/hud/usage-api-stale.test.js.map +1 -0
  93. package/dist/__tests__/hud/usage-api.test.js +223 -0
  94. package/dist/__tests__/hud/usage-api.test.js.map +1 -1
  95. package/dist/__tests__/hud/watch-mode-init.test.d.ts +2 -0
  96. package/dist/__tests__/hud/watch-mode-init.test.d.ts.map +1 -0
  97. package/dist/__tests__/hud/watch-mode-init.test.js +133 -0
  98. package/dist/__tests__/hud/watch-mode-init.test.js.map +1 -0
  99. package/dist/__tests__/hud-agents.test.js +12 -10
  100. package/dist/__tests__/hud-agents.test.js.map +1 -1
  101. package/dist/__tests__/hud-build-guidance.test.js +6 -2
  102. package/dist/__tests__/hud-build-guidance.test.js.map +1 -1
  103. package/dist/__tests__/hud-marketplace-resolution.test.d.ts +2 -0
  104. package/dist/__tests__/hud-marketplace-resolution.test.d.ts.map +1 -0
  105. package/dist/__tests__/hud-marketplace-resolution.test.js +53 -0
  106. package/dist/__tests__/hud-marketplace-resolution.test.js.map +1 -0
  107. package/dist/__tests__/installer-hud-skip.test.js +12 -0
  108. package/dist/__tests__/installer-hud-skip.test.js.map +1 -1
  109. package/dist/__tests__/installer-plugin-agents.test.d.ts +2 -0
  110. package/dist/__tests__/installer-plugin-agents.test.d.ts.map +1 -0
  111. package/dist/__tests__/installer-plugin-agents.test.js +111 -0
  112. package/dist/__tests__/installer-plugin-agents.test.js.map +1 -0
  113. package/dist/__tests__/installer-version-guard.test.d.ts +2 -0
  114. package/dist/__tests__/installer-version-guard.test.d.ts.map +1 -0
  115. package/dist/__tests__/installer-version-guard.test.js +75 -0
  116. package/dist/__tests__/installer-version-guard.test.js.map +1 -0
  117. package/dist/__tests__/installer.test.js +58 -4
  118. package/dist/__tests__/installer.test.js.map +1 -1
  119. package/dist/__tests__/omc-tools-server.test.js +8 -5
  120. package/dist/__tests__/omc-tools-server.test.js.map +1 -1
  121. package/dist/__tests__/pre-tool-enforcer.test.js +38 -0
  122. package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
  123. package/dist/__tests__/prompt-injection.test.js +3 -3
  124. package/dist/__tests__/prompt-injection.test.js.map +1 -1
  125. package/dist/__tests__/ralph-prd-mandatory.test.js +53 -2
  126. package/dist/__tests__/ralph-prd-mandatory.test.js.map +1 -1
  127. package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js +42 -0
  128. package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js.map +1 -1
  129. package/dist/__tests__/rate-limit-wait/tmux-detector.test.js +1 -1
  130. package/dist/__tests__/session-history-search.test.d.ts +2 -0
  131. package/dist/__tests__/session-history-search.test.d.ts.map +1 -0
  132. package/dist/__tests__/session-history-search.test.js +115 -0
  133. package/dist/__tests__/session-history-search.test.js.map +1 -0
  134. package/dist/__tests__/session-start-script-context.test.d.ts +2 -0
  135. package/dist/__tests__/session-start-script-context.test.d.ts.map +1 -0
  136. package/dist/__tests__/session-start-script-context.test.js +49 -0
  137. package/dist/__tests__/session-start-script-context.test.js.map +1 -0
  138. package/dist/__tests__/skills.test.js +71 -24
  139. package/dist/__tests__/skills.test.js.map +1 -1
  140. package/dist/__tests__/standalone-server.test.js +8 -4
  141. package/dist/__tests__/standalone-server.test.js.map +1 -1
  142. package/dist/__tests__/tier0-docs-consistency.test.js +10 -2
  143. package/dist/__tests__/tier0-docs-consistency.test.js.map +1 -1
  144. package/dist/agents/definitions.d.ts +5 -15
  145. package/dist/agents/definitions.d.ts.map +1 -1
  146. package/dist/agents/definitions.js +48 -49
  147. package/dist/agents/definitions.js.map +1 -1
  148. package/dist/agents/document-specialist.d.ts +1 -1
  149. package/dist/agents/document-specialist.d.ts.map +1 -1
  150. package/dist/agents/document-specialist.js +46 -21
  151. package/dist/agents/document-specialist.js.map +1 -1
  152. package/dist/agents/explore.d.ts.map +1 -1
  153. package/dist/agents/explore.js +3 -2
  154. package/dist/agents/explore.js.map +1 -1
  155. package/dist/agents/index.d.ts +2 -4
  156. package/dist/agents/index.d.ts.map +1 -1
  157. package/dist/agents/index.js +3 -6
  158. package/dist/agents/index.js.map +1 -1
  159. package/dist/agents/types.d.ts +2 -2
  160. package/dist/agents/types.d.ts.map +1 -1
  161. package/dist/cli/__tests__/ask.test.js +255 -8
  162. package/dist/cli/__tests__/ask.test.js.map +1 -1
  163. package/dist/cli/__tests__/session-search-help.test.d.ts +2 -0
  164. package/dist/cli/__tests__/session-search-help.test.d.ts.map +1 -0
  165. package/dist/cli/__tests__/session-search-help.test.js +13 -0
  166. package/dist/cli/__tests__/session-search-help.test.js.map +1 -0
  167. package/dist/cli/__tests__/session-search.test.d.ts +2 -0
  168. package/dist/cli/__tests__/session-search.test.d.ts.map +1 -0
  169. package/dist/cli/__tests__/session-search.test.js +72 -0
  170. package/dist/cli/__tests__/session-search.test.js.map +1 -0
  171. package/dist/cli/__tests__/team-help.test.js +1 -1
  172. package/dist/cli/__tests__/team-help.test.js.map +1 -1
  173. package/dist/cli/__tests__/team.test.js +256 -4
  174. package/dist/cli/__tests__/team.test.js.map +1 -1
  175. package/dist/cli/commands/__tests__/team.test.js +52 -2
  176. package/dist/cli/commands/__tests__/team.test.js.map +1 -1
  177. package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
  178. package/dist/cli/commands/doctor-conflicts.js +15 -1
  179. package/dist/cli/commands/doctor-conflicts.js.map +1 -1
  180. package/dist/cli/commands/session-search.d.ts +18 -0
  181. package/dist/cli/commands/session-search.d.ts.map +1 -0
  182. package/dist/cli/commands/session-search.js +47 -0
  183. package/dist/cli/commands/session-search.js.map +1 -0
  184. package/dist/cli/commands/team.d.ts +11 -0
  185. package/dist/cli/commands/team.d.ts.map +1 -1
  186. package/dist/cli/commands/team.js +94 -24
  187. package/dist/cli/commands/team.js.map +1 -1
  188. package/dist/cli/commands/wait.d.ts.map +1 -1
  189. package/dist/cli/commands/wait.js +12 -1
  190. package/dist/cli/commands/wait.js.map +1 -1
  191. package/dist/cli/index.js +70 -2
  192. package/dist/cli/index.js.map +1 -1
  193. package/dist/cli/team.d.ts +1 -0
  194. package/dist/cli/team.d.ts.map +1 -1
  195. package/dist/cli/team.js +100 -214
  196. package/dist/cli/team.js.map +1 -1
  197. package/dist/cli/win32-warning.d.ts +2 -1
  198. package/dist/cli/win32-warning.d.ts.map +1 -1
  199. package/dist/cli/win32-warning.js +20 -6
  200. package/dist/cli/win32-warning.js.map +1 -1
  201. package/dist/config/__tests__/loader.test.d.ts +2 -0
  202. package/dist/config/__tests__/loader.test.d.ts.map +1 -0
  203. package/dist/config/__tests__/loader.test.js +145 -0
  204. package/dist/config/__tests__/loader.test.js.map +1 -0
  205. package/dist/config/__tests__/models.test.d.ts +2 -0
  206. package/dist/config/__tests__/models.test.d.ts.map +1 -0
  207. package/dist/config/__tests__/models.test.js +147 -0
  208. package/dist/config/__tests__/models.test.js.map +1 -0
  209. package/dist/config/__tests__/test-helpers.d.ts +3 -0
  210. package/dist/config/__tests__/test-helpers.d.ts.map +1 -0
  211. package/dist/config/__tests__/test-helpers.js +19 -0
  212. package/dist/config/__tests__/test-helpers.js.map +1 -0
  213. package/dist/config/loader.d.ts +3 -1
  214. package/dist/config/loader.d.ts.map +1 -1
  215. package/dist/config/loader.js +140 -126
  216. package/dist/config/loader.js.map +1 -1
  217. package/dist/config/models.d.ts +29 -10
  218. package/dist/config/models.d.ts.map +1 -1
  219. package/dist/config/models.js +96 -10
  220. package/dist/config/models.js.map +1 -1
  221. package/dist/features/builtin-skills/skills.d.ts.map +1 -1
  222. package/dist/features/builtin-skills/skills.js +8 -1
  223. package/dist/features/builtin-skills/skills.js.map +1 -1
  224. package/dist/features/builtin-skills/types.d.ts +3 -0
  225. package/dist/features/builtin-skills/types.d.ts.map +1 -1
  226. package/dist/features/delegation-enforcer.d.ts +5 -12
  227. package/dist/features/delegation-enforcer.d.ts.map +1 -1
  228. package/dist/features/delegation-enforcer.js +48 -54
  229. package/dist/features/delegation-enforcer.js.map +1 -1
  230. package/dist/features/delegation-routing/__tests__/resolver.test.js +4 -3
  231. package/dist/features/delegation-routing/__tests__/resolver.test.js.map +1 -1
  232. package/dist/features/delegation-routing/types.d.ts.map +1 -1
  233. package/dist/features/delegation-routing/types.js +7 -4
  234. package/dist/features/delegation-routing/types.js.map +1 -1
  235. package/dist/features/index.d.ts +1 -0
  236. package/dist/features/index.d.ts.map +1 -1
  237. package/dist/features/index.js +2 -0
  238. package/dist/features/index.js.map +1 -1
  239. package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
  240. package/dist/features/rate-limit-wait/daemon.js +8 -5
  241. package/dist/features/rate-limit-wait/daemon.js.map +1 -1
  242. package/dist/features/rate-limit-wait/index.d.ts +1 -1
  243. package/dist/features/rate-limit-wait/index.d.ts.map +1 -1
  244. package/dist/features/rate-limit-wait/index.js +1 -1
  245. package/dist/features/rate-limit-wait/index.js.map +1 -1
  246. package/dist/features/rate-limit-wait/rate-limit-monitor.d.ts +9 -0
  247. package/dist/features/rate-limit-wait/rate-limit-monitor.d.ts.map +1 -1
  248. package/dist/features/rate-limit-wait/rate-limit-monitor.js +38 -0
  249. package/dist/features/rate-limit-wait/rate-limit-monitor.js.map +1 -1
  250. package/dist/features/rate-limit-wait/tmux-detector.d.ts +2 -1
  251. package/dist/features/rate-limit-wait/tmux-detector.d.ts.map +1 -1
  252. package/dist/features/rate-limit-wait/tmux-detector.js +8 -9
  253. package/dist/features/rate-limit-wait/tmux-detector.js.map +1 -1
  254. package/dist/features/rate-limit-wait/types.d.ts +11 -0
  255. package/dist/features/rate-limit-wait/types.d.ts.map +1 -1
  256. package/dist/features/session-history-search/index.d.ts +6 -0
  257. package/dist/features/session-history-search/index.d.ts.map +1 -0
  258. package/dist/features/session-history-search/index.js +480 -0
  259. package/dist/features/session-history-search/index.js.map +1 -0
  260. package/dist/features/session-history-search/types.d.ts +36 -0
  261. package/dist/features/session-history-search/types.d.ts.map +1 -0
  262. package/dist/features/session-history-search/types.js +2 -0
  263. package/dist/features/session-history-search/types.js.map +1 -0
  264. package/dist/hooks/__tests__/background-process-guard.test.js +101 -5
  265. package/dist/hooks/__tests__/background-process-guard.test.js.map +1 -1
  266. package/dist/hooks/__tests__/bridge-openclaw.test.js +16 -5
  267. package/dist/hooks/__tests__/bridge-openclaw.test.js.map +1 -1
  268. package/dist/hooks/__tests__/bridge-routing.test.js +48 -1
  269. package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
  270. package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -1
  271. package/dist/hooks/auto-slash-command/executor.js +9 -1
  272. package/dist/hooks/auto-slash-command/executor.js.map +1 -1
  273. package/dist/hooks/auto-slash-command/types.d.ts +2 -0
  274. package/dist/hooks/auto-slash-command/types.d.ts.map +1 -1
  275. package/dist/hooks/auto-slash-command/types.js +0 -7
  276. package/dist/hooks/auto-slash-command/types.js.map +1 -1
  277. package/dist/hooks/autopilot/adapters/execution-adapter.js +3 -3
  278. package/dist/hooks/autopilot/prompts.js +1 -1
  279. package/dist/hooks/bridge-normalize.d.ts.map +1 -1
  280. package/dist/hooks/bridge-normalize.js +2 -0
  281. package/dist/hooks/bridge-normalize.js.map +1 -1
  282. package/dist/hooks/bridge.d.ts.map +1 -1
  283. package/dist/hooks/bridge.js +248 -39
  284. package/dist/hooks/bridge.js.map +1 -1
  285. package/dist/hooks/keyword-detector/__tests__/index.test.js +41 -0
  286. package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -1
  287. package/dist/hooks/keyword-detector/index.d.ts +1 -1
  288. package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
  289. package/dist/hooks/keyword-detector/index.js +3 -1
  290. package/dist/hooks/keyword-detector/index.js.map +1 -1
  291. package/dist/hooks/permission-handler/index.d.ts +8 -0
  292. package/dist/hooks/permission-handler/index.d.ts.map +1 -1
  293. package/dist/hooks/permission-handler/index.js +76 -0
  294. package/dist/hooks/permission-handler/index.js.map +1 -1
  295. package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.d.ts +2 -0
  296. package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.d.ts.map +1 -0
  297. package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js +90 -0
  298. package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js.map +1 -0
  299. package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.d.ts +2 -0
  300. package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.d.ts.map +1 -0
  301. package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js +535 -0
  302. package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js.map +1 -0
  303. package/dist/hooks/persistent-mode/index.d.ts +1 -1
  304. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  305. package/dist/hooks/persistent-mode/index.js +296 -21
  306. package/dist/hooks/persistent-mode/index.js.map +1 -1
  307. package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +156 -0
  308. package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
  309. package/dist/hooks/project-memory/__tests__/integration.test.js +27 -2
  310. package/dist/hooks/project-memory/__tests__/integration.test.js.map +1 -1
  311. package/dist/hooks/project-memory/__tests__/storage.test.js +37 -0
  312. package/dist/hooks/project-memory/__tests__/storage.test.js.map +1 -1
  313. package/dist/hooks/project-memory/storage.d.ts +1 -1
  314. package/dist/hooks/project-memory/storage.d.ts.map +1 -1
  315. package/dist/hooks/project-memory/storage.js +5 -4
  316. package/dist/hooks/project-memory/storage.js.map +1 -1
  317. package/dist/hooks/ralph/index.d.ts +1 -1
  318. package/dist/hooks/ralph/index.d.ts.map +1 -1
  319. package/dist/hooks/ralph/index.js +1 -1
  320. package/dist/hooks/ralph/index.js.map +1 -1
  321. package/dist/hooks/ralph/loop.d.ts +18 -0
  322. package/dist/hooks/ralph/loop.d.ts.map +1 -1
  323. package/dist/hooks/ralph/loop.js +31 -0
  324. package/dist/hooks/ralph/loop.js.map +1 -1
  325. package/dist/hooks/ralph/verifier.d.ts +4 -1
  326. package/dist/hooks/ralph/verifier.d.ts.map +1 -1
  327. package/dist/hooks/ralph/verifier.js +56 -21
  328. package/dist/hooks/ralph/verifier.js.map +1 -1
  329. package/dist/hooks/recovery/__tests__/storage.test.d.ts +2 -0
  330. package/dist/hooks/recovery/__tests__/storage.test.d.ts.map +1 -0
  331. package/dist/hooks/recovery/__tests__/storage.test.js +65 -0
  332. package/dist/hooks/recovery/__tests__/storage.test.js.map +1 -0
  333. package/dist/hooks/recovery/storage.d.ts +5 -1
  334. package/dist/hooks/recovery/storage.d.ts.map +1 -1
  335. package/dist/hooks/recovery/storage.js +7 -29
  336. package/dist/hooks/recovery/storage.js.map +1 -1
  337. package/dist/hooks/recovery/types.d.ts +1 -1
  338. package/dist/hooks/recovery/types.d.ts.map +1 -1
  339. package/dist/hooks/session-end/__tests__/duplicate-notifications.test.d.ts +2 -0
  340. package/dist/hooks/session-end/__tests__/duplicate-notifications.test.d.ts.map +1 -0
  341. package/dist/hooks/session-end/__tests__/duplicate-notifications.test.js +140 -0
  342. package/dist/hooks/session-end/__tests__/duplicate-notifications.test.js.map +1 -0
  343. package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.d.ts +2 -0
  344. package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.d.ts.map +1 -0
  345. package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js +122 -0
  346. package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js.map +1 -0
  347. package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js +38 -12
  348. package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js.map +1 -1
  349. package/dist/hooks/session-end/callbacks.d.ts +4 -1
  350. package/dist/hooks/session-end/callbacks.d.ts.map +1 -1
  351. package/dist/hooks/session-end/callbacks.js +5 -4
  352. package/dist/hooks/session-end/callbacks.js.map +1 -1
  353. package/dist/hooks/session-end/index.d.ts.map +1 -1
  354. package/dist/hooks/session-end/index.js +162 -36
  355. package/dist/hooks/session-end/index.js.map +1 -1
  356. package/dist/hooks/skill-state/__tests__/skill-state.test.js +35 -33
  357. package/dist/hooks/skill-state/__tests__/skill-state.test.js.map +1 -1
  358. package/dist/hooks/skill-state/index.d.ts +3 -3
  359. package/dist/hooks/skill-state/index.d.ts.map +1 -1
  360. package/dist/hooks/skill-state/index.js +7 -11
  361. package/dist/hooks/skill-state/index.js.map +1 -1
  362. package/dist/hooks/subagent-tracker/index.d.ts.map +1 -1
  363. package/dist/hooks/subagent-tracker/index.js +22 -0
  364. package/dist/hooks/subagent-tracker/index.js.map +1 -1
  365. package/dist/hooks/think-mode/__tests__/index.test.js +20 -20
  366. package/dist/hooks/think-mode/__tests__/index.test.js.map +1 -1
  367. package/dist/hooks/think-mode/switcher.d.ts.map +1 -1
  368. package/dist/hooks/think-mode/switcher.js +13 -10
  369. package/dist/hooks/think-mode/switcher.js.map +1 -1
  370. package/dist/hooks/thinking-block-validator/__tests__/index.test.d.ts +2 -0
  371. package/dist/hooks/thinking-block-validator/__tests__/index.test.d.ts.map +1 -0
  372. package/dist/hooks/thinking-block-validator/__tests__/index.test.js +56 -0
  373. package/dist/hooks/thinking-block-validator/__tests__/index.test.js.map +1 -0
  374. package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -1
  375. package/dist/hooks/thinking-block-validator/index.js +7 -6
  376. package/dist/hooks/thinking-block-validator/index.js.map +1 -1
  377. package/dist/hooks/todo-continuation/index.d.ts +6 -0
  378. package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
  379. package/dist/hooks/todo-continuation/index.js +14 -5
  380. package/dist/hooks/todo-continuation/index.js.map +1 -1
  381. package/dist/hud/elements/agents.d.ts.map +1 -1
  382. package/dist/hud/elements/agents.js +8 -14
  383. package/dist/hud/elements/agents.js.map +1 -1
  384. package/dist/hud/elements/index.d.ts +1 -0
  385. package/dist/hud/elements/index.d.ts.map +1 -1
  386. package/dist/hud/elements/index.js +1 -0
  387. package/dist/hud/elements/index.js.map +1 -1
  388. package/dist/hud/elements/limits.d.ts +3 -3
  389. package/dist/hud/elements/limits.d.ts.map +1 -1
  390. package/dist/hud/elements/limits.js +26 -18
  391. package/dist/hud/elements/limits.js.map +1 -1
  392. package/dist/hud/elements/mission-board.d.ts +2 -0
  393. package/dist/hud/elements/mission-board.d.ts.map +1 -0
  394. package/dist/hud/elements/mission-board.js +2 -0
  395. package/dist/hud/elements/mission-board.js.map +1 -0
  396. package/dist/hud/index.d.ts +1 -1
  397. package/dist/hud/index.d.ts.map +1 -1
  398. package/dist/hud/index.js +10 -2
  399. package/dist/hud/index.js.map +1 -1
  400. package/dist/hud/mission-board.d.ts +75 -0
  401. package/dist/hud/mission-board.d.ts.map +1 -0
  402. package/dist/hud/mission-board.js +420 -0
  403. package/dist/hud/mission-board.js.map +1 -0
  404. package/dist/hud/render.d.ts.map +1 -1
  405. package/dist/hud/render.js +16 -8
  406. package/dist/hud/render.js.map +1 -1
  407. package/dist/hud/state.d.ts.map +1 -1
  408. package/dist/hud/state.js +13 -0
  409. package/dist/hud/state.js.map +1 -1
  410. package/dist/hud/types.d.ts +11 -0
  411. package/dist/hud/types.d.ts.map +1 -1
  412. package/dist/hud/types.js +10 -0
  413. package/dist/hud/types.js.map +1 -1
  414. package/dist/hud/usage-api.d.ts +2 -1
  415. package/dist/hud/usage-api.d.ts.map +1 -1
  416. package/dist/hud/usage-api.js +219 -103
  417. package/dist/hud/usage-api.js.map +1 -1
  418. package/dist/index.d.ts +1 -0
  419. package/dist/index.d.ts.map +1 -1
  420. package/dist/index.js +2 -3
  421. package/dist/index.js.map +1 -1
  422. package/dist/installer/__tests__/claude-md-merge.test.js +53 -9
  423. package/dist/installer/__tests__/claude-md-merge.test.js.map +1 -1
  424. package/dist/installer/__tests__/hook-templates.test.d.ts +2 -0
  425. package/dist/installer/__tests__/hook-templates.test.d.ts.map +1 -0
  426. package/dist/installer/__tests__/hook-templates.test.js +76 -0
  427. package/dist/installer/__tests__/hook-templates.test.js.map +1 -0
  428. package/dist/installer/hooks.d.ts +15 -0
  429. package/dist/installer/hooks.d.ts.map +1 -1
  430. package/dist/installer/hooks.js +51 -0
  431. package/dist/installer/hooks.js.map +1 -1
  432. package/dist/installer/index.d.ts +25 -0
  433. package/dist/installer/index.d.ts.map +1 -1
  434. package/dist/installer/index.js +273 -64
  435. package/dist/installer/index.js.map +1 -1
  436. package/dist/lib/mode-names.d.ts.map +1 -1
  437. package/dist/lib/mode-names.js +2 -0
  438. package/dist/lib/mode-names.js.map +1 -1
  439. package/dist/mcp/__tests__/team-server-artifact-convergence.test.js +30 -3
  440. package/dist/mcp/__tests__/team-server-artifact-convergence.test.js.map +1 -1
  441. package/dist/mcp/__tests__/team-server-deprecation.test.js +2 -0
  442. package/dist/mcp/__tests__/team-server-deprecation.test.js.map +1 -1
  443. package/dist/mcp/team-job-convergence.d.ts.map +1 -1
  444. package/dist/mcp/team-job-convergence.js +12 -3
  445. package/dist/mcp/team-job-convergence.js.map +1 -1
  446. package/dist/mcp/team-server.d.ts.map +1 -1
  447. package/dist/mcp/team-server.js +18 -4
  448. package/dist/mcp/team-server.js.map +1 -1
  449. package/dist/notifications/__tests__/config-merge.test.js +36 -1
  450. package/dist/notifications/__tests__/config-merge.test.js.map +1 -1
  451. package/dist/notifications/__tests__/formatter.test.js +13 -5
  452. package/dist/notifications/__tests__/formatter.test.js.map +1 -1
  453. package/dist/notifications/__tests__/notify-registry-integration.test.js +27 -1
  454. package/dist/notifications/__tests__/notify-registry-integration.test.js.map +1 -1
  455. package/dist/notifications/__tests__/verbosity.test.js +33 -1
  456. package/dist/notifications/__tests__/verbosity.test.js.map +1 -1
  457. package/dist/notifications/config.d.ts +7 -0
  458. package/dist/notifications/config.d.ts.map +1 -1
  459. package/dist/notifications/config.js +18 -0
  460. package/dist/notifications/config.js.map +1 -1
  461. package/dist/notifications/formatter.d.ts +2 -2
  462. package/dist/notifications/formatter.d.ts.map +1 -1
  463. package/dist/notifications/formatter.js +7 -6
  464. package/dist/notifications/formatter.js.map +1 -1
  465. package/dist/notifications/index.d.ts +1 -1
  466. package/dist/notifications/index.d.ts.map +1 -1
  467. package/dist/notifications/index.js +5 -3
  468. package/dist/notifications/index.js.map +1 -1
  469. package/dist/notifications/template-engine.js +1 -1
  470. package/dist/notifications/template-engine.js.map +1 -1
  471. package/dist/notifications/types.d.ts +4 -0
  472. package/dist/notifications/types.d.ts.map +1 -1
  473. package/dist/openclaw/__tests__/dispatcher.test.js +26 -0
  474. package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
  475. package/dist/openclaw/__tests__/index.test.js +42 -0
  476. package/dist/openclaw/__tests__/index.test.js.map +1 -1
  477. package/dist/openclaw/__tests__/signal.test.d.ts +2 -0
  478. package/dist/openclaw/__tests__/signal.test.d.ts.map +1 -0
  479. package/dist/openclaw/__tests__/signal.test.js +69 -0
  480. package/dist/openclaw/__tests__/signal.test.js.map +1 -0
  481. package/dist/openclaw/dispatcher.d.ts +5 -1
  482. package/dist/openclaw/dispatcher.d.ts.map +1 -1
  483. package/dist/openclaw/dispatcher.js +13 -2
  484. package/dist/openclaw/dispatcher.js.map +1 -1
  485. package/dist/openclaw/index.d.ts +2 -1
  486. package/dist/openclaw/index.d.ts.map +1 -1
  487. package/dist/openclaw/index.js +29 -15
  488. package/dist/openclaw/index.js.map +1 -1
  489. package/dist/openclaw/signal.d.ts +3 -0
  490. package/dist/openclaw/signal.d.ts.map +1 -0
  491. package/dist/openclaw/signal.js +215 -0
  492. package/dist/openclaw/signal.js.map +1 -0
  493. package/dist/openclaw/types.d.ts +35 -0
  494. package/dist/openclaw/types.d.ts.map +1 -1
  495. package/dist/shared/types.d.ts +2 -12
  496. package/dist/shared/types.d.ts.map +1 -1
  497. package/dist/skills/__tests__/mingw-escape.test.js +41 -11
  498. package/dist/skills/__tests__/mingw-escape.test.js.map +1 -1
  499. package/dist/team/__tests__/api-interop.cwd-resolution.test.d.ts +2 -0
  500. package/dist/team/__tests__/api-interop.cwd-resolution.test.d.ts.map +1 -0
  501. package/dist/team/__tests__/api-interop.cwd-resolution.test.js +78 -0
  502. package/dist/team/__tests__/api-interop.cwd-resolution.test.js.map +1 -0
  503. package/dist/team/__tests__/api-interop.dispatch.test.d.ts +2 -0
  504. package/dist/team/__tests__/api-interop.dispatch.test.d.ts.map +1 -0
  505. package/dist/team/__tests__/api-interop.dispatch.test.js +125 -0
  506. package/dist/team/__tests__/api-interop.dispatch.test.js.map +1 -0
  507. package/dist/team/__tests__/cli-detection.test.d.ts +2 -0
  508. package/dist/team/__tests__/cli-detection.test.d.ts.map +1 -0
  509. package/dist/team/__tests__/cli-detection.test.js +36 -0
  510. package/dist/team/__tests__/cli-detection.test.js.map +1 -0
  511. package/dist/team/__tests__/model-contract.test.js +79 -2
  512. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  513. package/dist/team/__tests__/runtime-done-recovery.test.js +1 -0
  514. package/dist/team/__tests__/runtime-done-recovery.test.js.map +1 -1
  515. package/dist/team/__tests__/runtime-prompt-mode.test.js +84 -8
  516. package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -1
  517. package/dist/team/__tests__/runtime-v2.dispatch.test.d.ts +2 -0
  518. package/dist/team/__tests__/runtime-v2.dispatch.test.d.ts.map +1 -0
  519. package/dist/team/__tests__/runtime-v2.dispatch.test.js +237 -0
  520. package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -0
  521. package/dist/team/__tests__/runtime-v2.monitor.test.d.ts +2 -0
  522. package/dist/team/__tests__/runtime-v2.monitor.test.d.ts.map +1 -0
  523. package/dist/team/__tests__/runtime-v2.monitor.test.js +103 -0
  524. package/dist/team/__tests__/runtime-v2.monitor.test.js.map +1 -0
  525. package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts +2 -0
  526. package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts.map +1 -0
  527. package/dist/team/__tests__/runtime-v2.shutdown.test.js +49 -0
  528. package/dist/team/__tests__/runtime-v2.shutdown.test.js.map +1 -0
  529. package/dist/team/__tests__/runtime-watchdog-retry.test.js +3 -0
  530. package/dist/team/__tests__/runtime-watchdog-retry.test.js.map +1 -1
  531. package/dist/team/__tests__/tmux-session.create-team.test.js +29 -12
  532. package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -1
  533. package/dist/team/__tests__/tmux-session.kill-team-session.test.js +6 -0
  534. package/dist/team/__tests__/tmux-session.kill-team-session.test.js.map +1 -1
  535. package/dist/team/__tests__/tmux-session.test.js +9 -0
  536. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  537. package/dist/team/__tests__/worker-bootstrap.test.js +32 -3
  538. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  539. package/dist/team/api-interop.d.ts.map +1 -1
  540. package/dist/team/api-interop.js +153 -2
  541. package/dist/team/api-interop.js.map +1 -1
  542. package/dist/team/cli-detection.d.ts.map +1 -1
  543. package/dist/team/cli-detection.js +6 -2
  544. package/dist/team/cli-detection.js.map +1 -1
  545. package/dist/team/idle-nudge.js +1 -1
  546. package/dist/team/idle-nudge.js.map +1 -1
  547. package/dist/team/mcp-team-bridge.d.ts.map +1 -1
  548. package/dist/team/mcp-team-bridge.js +2 -1
  549. package/dist/team/mcp-team-bridge.js.map +1 -1
  550. package/dist/team/model-contract.d.ts +1 -1
  551. package/dist/team/model-contract.d.ts.map +1 -1
  552. package/dist/team/model-contract.js +35 -4
  553. package/dist/team/model-contract.js.map +1 -1
  554. package/dist/team/runtime-cli.d.ts.map +1 -1
  555. package/dist/team/runtime-cli.js +10 -7
  556. package/dist/team/runtime-cli.js.map +1 -1
  557. package/dist/team/runtime-v2.d.ts +4 -0
  558. package/dist/team/runtime-v2.d.ts.map +1 -1
  559. package/dist/team/runtime-v2.js +231 -59
  560. package/dist/team/runtime-v2.js.map +1 -1
  561. package/dist/team/runtime.d.ts +6 -1
  562. package/dist/team/runtime.d.ts.map +1 -1
  563. package/dist/team/runtime.js +39 -14
  564. package/dist/team/runtime.js.map +1 -1
  565. package/dist/team/tmux-session.d.ts +20 -11
  566. package/dist/team/tmux-session.d.ts.map +1 -1
  567. package/dist/team/tmux-session.js +108 -51
  568. package/dist/team/tmux-session.js.map +1 -1
  569. package/dist/team/types.d.ts +1 -0
  570. package/dist/team/types.d.ts.map +1 -1
  571. package/dist/team/types.js.map +1 -1
  572. package/dist/team/worker-bootstrap.d.ts +2 -0
  573. package/dist/team/worker-bootstrap.d.ts.map +1 -1
  574. package/dist/team/worker-bootstrap.js +46 -12
  575. package/dist/team/worker-bootstrap.js.map +1 -1
  576. package/dist/tools/__tests__/memory-tools.test.js +29 -1
  577. package/dist/tools/__tests__/memory-tools.test.js.map +1 -1
  578. package/dist/tools/lsp/client.d.ts +11 -0
  579. package/dist/tools/lsp/client.d.ts.map +1 -1
  580. package/dist/tools/lsp/client.js +46 -0
  581. package/dist/tools/lsp/client.js.map +1 -1
  582. package/dist/tools/session-history-tools.d.ts +23 -0
  583. package/dist/tools/session-history-tools.d.ts.map +1 -0
  584. package/dist/tools/session-history-tools.js +41 -0
  585. package/dist/tools/session-history-tools.js.map +1 -0
  586. package/dist/tools/trace-tools.d.ts +9 -0
  587. package/dist/tools/trace-tools.d.ts.map +1 -1
  588. package/dist/tools/trace-tools.js +2 -1
  589. package/dist/tools/trace-tools.js.map +1 -1
  590. package/dist/utils/frontmatter.d.ts +5 -0
  591. package/dist/utils/frontmatter.d.ts.map +1 -1
  592. package/dist/utils/frontmatter.js +22 -0
  593. package/dist/utils/frontmatter.js.map +1 -1
  594. package/dist/utils/skill-pipeline.d.ts +9 -0
  595. package/dist/utils/skill-pipeline.d.ts.map +1 -0
  596. package/dist/utils/skill-pipeline.js +97 -0
  597. package/dist/utils/skill-pipeline.js.map +1 -0
  598. package/docs/AGENTS.md +1 -1
  599. package/docs/ANALYTICS-SYSTEM.md +23 -132
  600. package/docs/CLAUDE.md +40 -139
  601. package/docs/MIGRATION.md +4 -4
  602. package/docs/OPENCLAW-ROUTING.md +102 -0
  603. package/docs/PERFORMANCE-MONITORING.md +30 -55
  604. package/docs/REFERENCE.md +62 -35
  605. package/docs/TIERED_AGENTS_V2.md +3 -2
  606. package/docs/design/SKILL_AUDIT_1445.md +75 -0
  607. package/docs/ko/MIGRATION.md +2 -2
  608. package/docs/ko/REFERENCE.md +14 -22
  609. package/docs/partials/agent-tiers.md +11 -15
  610. package/docs/partials/features.md +2 -2
  611. package/docs/partials/mode-selection-guide.md +2 -2
  612. package/docs/shared/agent-tiers.md +11 -15
  613. package/docs/shared/features.md +2 -2
  614. package/docs/shared/mode-selection-guide.md +2 -2
  615. package/package.json +4 -1
  616. package/scripts/code-simplifier.mjs +1 -1
  617. package/scripts/context-guard-stop.mjs +26 -10
  618. package/scripts/keyword-detector.mjs +99 -39
  619. package/scripts/persistent-mode.cjs +295 -34
  620. package/scripts/persistent-mode.mjs +79 -21
  621. package/scripts/plugin-setup.mjs +10 -1
  622. package/scripts/post-tool-verifier.mjs +57 -3
  623. package/scripts/pre-tool-enforcer.mjs +207 -2
  624. package/scripts/run-provider-advisor.js +30 -3
  625. package/scripts/session-start.mjs +3 -3
  626. package/scripts/setup-claude-md.sh +159 -0
  627. package/scripts/setup-progress.sh +123 -0
  628. package/scripts/sync-metadata.ts +11 -1
  629. package/skills/AGENTS.md +13 -17
  630. package/skills/ai-slop-cleaner/SKILL.md +130 -0
  631. package/skills/ask/SKILL.md +51 -0
  632. package/skills/ccg/SKILL.md +6 -6
  633. package/skills/deep-interview/SKILL.md +4 -0
  634. package/skills/omc-doctor/SKILL.md +2 -2
  635. package/skills/omc-setup/SKILL.md +75 -1206
  636. package/skills/omc-setup/phases/01-install-claude-md.md +76 -0
  637. package/skills/omc-setup/phases/02-configure.md +211 -0
  638. package/skills/omc-setup/phases/03-integrations.md +192 -0
  639. package/skills/omc-setup/phases/04-welcome.md +192 -0
  640. package/skills/omc-teams/SKILL.md +35 -2
  641. package/skills/plan/SKILL.md +3 -0
  642. package/skills/ralph/SKILL.md +16 -10
  643. package/skills/release/SKILL.md +4 -0
  644. package/skills/setup/SKILL.md +40 -0
  645. package/skills/team/SKILL.md +6 -6
  646. package/templates/hooks/code-simplifier.mjs +1 -1
  647. package/templates/hooks/keyword-detector.mjs +100 -32
  648. package/templates/hooks/persistent-mode.mjs +43 -4
  649. package/templates/hooks/pre-tool-use.mjs +115 -1
  650. package/templates/hooks/session-start.mjs +1 -1
  651. package/agents/build-fixer.md +0 -90
  652. package/agents/deep-executor.md +0 -112
  653. package/agents/harsh-critic.md +0 -254
  654. package/agents/quality-reviewer.md +0 -151
  655. package/skills/analyze/SKILL.md +0 -87
  656. package/skills/ask-codex/SKILL.md +0 -47
  657. package/skills/ask-gemini/SKILL.md +0 -47
  658. package/skills/build-fix/SKILL.md +0 -123
  659. package/skills/code-review/SKILL.md +0 -573
  660. package/skills/configure-openclaw/SKILL.md +0 -383
  661. package/skills/learn-about-omc/SKILL.md +0 -37
  662. package/skills/note/SKILL.md +0 -62
  663. package/skills/omc-help/SKILL.md +0 -192
  664. package/skills/ralph-init/SKILL.md +0 -40
  665. package/skills/security-review/SKILL.md +0 -282
  666. package/skills/tdd/SKILL.md +0 -104
  667. package/skills/trace/SKILL.md +0 -33
@@ -34,14 +34,31 @@ Spawn N CLI worker processes in tmux panes to execute tasks in parallel. Support
34
34
 
35
35
  ## Requirements
36
36
 
37
- - **tmux** must be running (`$TMUX` set in the current shell)
37
+ - **tmux binary** must be installed and discoverable (`command -v tmux`)
38
+ - **Active tmux session** required to launch worker panes (`$TMUX` set, or start/attach tmux first)
38
39
  - **claude** CLI: `npm install -g @anthropic-ai/claude-code`
39
40
  - **codex** CLI: `npm install -g @openai/codex`
40
41
  - **gemini** CLI: `npm install -g @google/gemini-cli`
41
42
 
42
43
  ## Workflow
43
44
 
44
- ### Phase 1: Parse input
45
+ ### Phase 0: Verify prerequisites
46
+
47
+ Check tmux explicitly before claiming it is missing:
48
+
49
+ ```bash
50
+ command -v tmux >/dev/null 2>&1
51
+ ```
52
+
53
+ - If this fails, report that **tmux is not installed** and stop.
54
+ - If `tmux` exists but `$TMUX` is empty, report that the user is **not currently inside an active tmux session**. Do **not** say tmux is missing; tell them to start or attach tmux, then rerun.
55
+ - If you need to confirm the active session, use:
56
+
57
+ ```bash
58
+ tmux display-message -p '#S'
59
+ ```
60
+
61
+ ### Phase 1: Parse + validate input
45
62
 
46
63
  Extract:
47
64
 
@@ -49,6 +66,12 @@ Extract:
49
66
  - `agent-type` — `claude|codex|gemini`
50
67
  - `task` — task description
51
68
 
69
+ Validate before decomposing or running anything:
70
+
71
+ - Reject unsupported agent types up front. `/omc-teams` only supports **`claude`**, **`codex`**, and **`gemini`**.
72
+ - If the user asks for an unsupported type such as `expert`, explain that `/omc-teams` launches external CLI workers only.
73
+ - For native Claude Code team agents/roles, direct them to **`/oh-my-claudecode:team`** instead.
74
+
52
75
  ### Phase 2: Decompose task
53
76
 
54
77
  Break work into N independent subtasks (file- or concern-scoped) to avoid write conflicts.
@@ -69,6 +92,15 @@ omc team <N>:<claude|codex|gemini> "<task>"
69
92
 
70
93
  Team name defaults to a slug from the task text (example: `review-auth-flow`).
71
94
 
95
+ After launch, verify the command actually executed instead of assuming Enter fired. Check pane output and confirm the command or worker bootstrap text appears in pane history:
96
+
97
+ ```bash
98
+ tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} #{pane_id} #{pane_current_command}'
99
+ tmux capture-pane -pt <pane-id> -S -20
100
+ ```
101
+
102
+ Do not claim the team started successfully unless pane output shows the command was submitted.
103
+
72
104
  ### Phase 4: Monitor + lifecycle API
73
105
 
74
106
  ```bash
@@ -111,6 +143,7 @@ If encountered, switch to `omc team ...` CLI commands.
111
143
  | Error | Cause | Fix |
112
144
  | ---------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------- |
113
145
  | `not inside tmux` | Shell not running inside tmux | Start tmux and rerun |
146
+ | `Unsupported agent type` | Requested agent is not claude/codex/gemini | Use `claude`, `codex`, or `gemini`; for native Claude Code agents use `/oh-my-claudecode:team` |
114
147
  | `codex: command not found` | Codex CLI not installed | `npm install -g @openai/codex` |
115
148
  | `gemini: command not found` | Gemini CLI not installed | `npm install -g @google/gemini-cli` |
116
149
  | `Team <name> is not running` | stale or missing runtime state | `omc team status <team-name>` then `omc team shutdown <team-name> --force` if stale |
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: omc-plan
3
3
  description: Strategic planning with optional interview workflow
4
+ pipeline: [deep-interview, omc-plan, autopilot]
5
+ next-skill: autopilot
6
+ handoff: .omc/plans/ralplan-*.md
4
7
  ---
5
8
 
6
9
  <Purpose>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ralph
3
- description: Self-referential loop until task completion with architect verification
3
+ description: Self-referential loop until task completion with configurable verification reviewer
4
4
  ---
5
5
 
6
6
  [RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]
@@ -8,14 +8,14 @@ description: Self-referential loop until task completion with architect verifica
8
8
  Your previous attempt did not output the completion promise. Continue working on the task.
9
9
 
10
10
  <Purpose>
11
- Ralph is a PRD-driven persistence loop that keeps working on a task until ALL user stories in prd.json have passes: true and are architect-verified. It wraps ultrawork's parallel execution with session persistence, automatic retry on failure, structured story tracking, and mandatory verification before completion.
11
+ Ralph is a PRD-driven persistence loop that keeps working on a task until ALL user stories in prd.json have passes: true and are reviewer-verified. It wraps ultrawork's parallel execution with session persistence, automatic retry on failure, structured story tracking, and mandatory verification before completion.
12
12
  </Purpose>
13
13
 
14
14
  <Use_When>
15
15
  - Task requires guaranteed completion with verification (not just "do your best")
16
16
  - User says "ralph", "don't stop", "must complete", "finish this", or "keep going until done"
17
17
  - Work may span multiple iterations and needs persistence across retries
18
- - Task benefits from structured PRD-driven execution with architect sign-off
18
+ - Task benefits from structured PRD-driven execution with reviewer sign-off
19
19
  </Use_When>
20
20
 
21
21
  <Do_Not_Use_When>
@@ -30,13 +30,15 @@ Complex tasks often fail silently: partial implementations get declared "done",
30
30
  1. Structuring work into discrete user stories with testable acceptance criteria (prd.json)
31
31
  2. Iterating story-by-story until each one passes
32
32
  3. Tracking progress and learnings across iterations (progress.txt)
33
- 4. Requiring fresh architect verification against specific acceptance criteria before completion
33
+ 4. Requiring fresh reviewer verification against specific acceptance criteria before completion
34
34
  </Why_This_Exists>
35
35
 
36
36
  <PRD_Mode>
37
37
  By default, ralph operates in PRD mode. A scaffold `prd.json` is auto-generated when ralph starts if none exists.
38
38
 
39
39
  **Opt-out:** If `{{PROMPT}}` contains `--no-prd`, skip PRD generation and work in legacy mode (no story tracking, generic verification). Use this for trivial quick fixes.
40
+
41
+ **Reviewer selection:** Pass `--critic=architect`, `--critic=critic`, or `--critic=codex` in the Ralph prompt to choose the completion reviewer for that run. `architect` remains the default.
40
42
  </PRD_Mode>
41
43
 
42
44
  <Execution_Policy>
@@ -84,20 +86,24 @@ By default, ralph operates in PRD mode. A scaffold `prd.json` is auto-generated
84
86
  b. If NOT all complete, loop back to Step 2 (pick next story)
85
87
  c. If ALL complete, proceed to Step 7 (architect verification)
86
88
 
87
- 7. **Architect verification** (tiered, against acceptance criteria):
89
+ 7. **Reviewer verification** (tiered, against acceptance criteria):
88
90
  - <5 files, <100 lines with full tests: STANDARD tier minimum (architect-medium / Sonnet)
89
91
  - Standard changes: STANDARD tier (architect-medium / Sonnet)
90
92
  - >20 files or security/architectural changes: THOROUGH tier (architect / Opus)
93
+ - If `--critic=critic`, use the Claude `critic` agent for the approval pass
94
+ - If `--critic=codex`, run `omc ask codex --agent-prompt critic "..."` for the approval pass
91
95
  - Ralph floor: always at least STANDARD, even for small changes
92
- - The architect verifies against the SPECIFIC acceptance criteria from prd.json, not vague "is it done?"
96
+ - The selected reviewer verifies against the SPECIFIC acceptance criteria from prd.json, not vague "is it done?"
93
97
 
94
98
  8. **On approval**: Run `/oh-my-claudecode:cancel` to cleanly exit and clean up all state files
95
99
 
96
- 9. **On rejection**: Fix the issues raised, re-verify at the same tier, then loop back to check if the story needs to be marked incomplete
100
+ 9. **On rejection**: Fix the issues raised, re-verify with the same reviewer, then loop back to check if the story needs to be marked incomplete
97
101
  </Steps>
98
102
 
99
103
  <Tool_Usage>
100
- - Use `Task(subagent_type="oh-my-claudecode:architect", ...)` for verification cross-checks when changes are security-sensitive, architectural, or involve complex multi-system integration
104
+ - Use `Task(subagent_type="oh-my-claudecode:architect", ...)` for architect verification cross-checks when changes are security-sensitive, architectural, or involve complex multi-system integration
105
+ - Use `Task(subagent_type="oh-my-claudecode:critic", ...)` when `--critic=critic`
106
+ - Use `omc ask codex --agent-prompt critic "..."` when `--critic=codex`
101
107
  - Skip architect consultation for simple feature additions, well-tested changes, or time-critical verification
102
108
  - Proceed with architect agent verification alone -- never block on unavailable tools
103
109
  - Use `state_write` / `state_read` for ralph mode state persistence between iterations
@@ -171,7 +177,7 @@ Why bad: Did not refine scaffold criteria into task-specific ones. This is PRD t
171
177
  - Stop and report when a fundamental blocker requires user input (missing credentials, unclear requirements, external service down)
172
178
  - Stop when the user says "stop", "cancel", or "abort" -- run `/oh-my-claudecode:cancel`
173
179
  - Continue working when the hook system sends "The boulder never stops" -- this means the iteration continues
174
- - If architect rejects verification, fix the issues and re-verify (do not stop)
180
+ - If the selected reviewer rejects verification, fix the issues and re-verify (do not stop)
175
181
  - If the same issue recurs across 3+ iterations, report it as a potential fundamental problem
176
182
  </Escalation_And_Stop_Conditions>
177
183
 
@@ -184,7 +190,7 @@ Why bad: Did not refine scaffold criteria into task-specific ones. This is PRD t
184
190
  - [ ] Fresh build output shows success
185
191
  - [ ] lsp_diagnostics shows 0 errors on affected files
186
192
  - [ ] progress.txt records implementation details and learnings
187
- - [ ] Architect verification passed (STANDARD tier minimum) against specific acceptance criteria
193
+ - [ ] Selected reviewer verification passed against specific acceptance criteria
188
194
  - [ ] `/oh-my-claudecode:cancel` run for clean state cleanup
189
195
  </Final_Checklist>
190
196
 
@@ -25,6 +25,8 @@ Update version in all locations:
25
25
  - `src/installer/index.ts` (VERSION constant)
26
26
  - `src/__tests__/installer.test.ts` (expected version)
27
27
  - `.claude-plugin/plugin.json`
28
+ - `.claude-plugin/marketplace.json` (both `plugins[0].version` and root `version`)
29
+ - `docs/CLAUDE.md` (`<!-- OMC:VERSION:X.Y.Z -->` marker)
28
30
  - `README.md` (version badge and title)
29
31
 
30
32
  ### 2. Run Tests
@@ -68,6 +70,8 @@ gh release create v<version> --title "v<version> - <title>" --notes "<release no
68
70
  | `src/installer/index.ts` | `export const VERSION = 'X.Y.Z'` |
69
71
  | `src/__tests__/installer.test.ts` | `expect(VERSION).toBe('X.Y.Z')` |
70
72
  | `.claude-plugin/plugin.json` | `"version": "X.Y.Z"` |
73
+ | `.claude-plugin/marketplace.json` | `plugins[0].version` + root `version` |
74
+ | `docs/CLAUDE.md` | `<!-- OMC:VERSION:X.Y.Z -->` |
71
75
  | `README.md` | Title + version badge |
72
76
 
73
77
  ## Semantic Versioning
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: setup
3
+ description: Unified setup entrypoint for install, diagnostics, and MCP configuration
4
+ ---
5
+
6
+ # Setup
7
+
8
+ Use `/oh-my-claudecode:setup` as the unified setup/configuration entrypoint.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ /oh-my-claudecode:setup # full setup wizard
14
+ /oh-my-claudecode:setup doctor # installation diagnostics
15
+ /oh-my-claudecode:setup mcp # MCP server configuration
16
+ /oh-my-claudecode:setup wizard --local # explicit wizard path
17
+ ```
18
+
19
+ ## Routing
20
+
21
+ Route by the first argument:
22
+
23
+ - No argument, `wizard`, `local`, `global`, or `--force` -> run `/oh-my-claudecode:omc-setup {{ARGUMENTS}}`
24
+ - `doctor` -> run `/oh-my-claudecode:omc-doctor {{ARGUMENTS_AFTER_DOCTOR}}`
25
+ - `mcp` -> run `/oh-my-claudecode:mcp-setup {{ARGUMENTS_AFTER_MCP}}`
26
+
27
+ Examples:
28
+
29
+ ```bash
30
+ /oh-my-claudecode:omc-setup {{ARGUMENTS}}
31
+ /oh-my-claudecode:omc-doctor {{ARGUMENTS_AFTER_DOCTOR}}
32
+ /oh-my-claudecode:mcp-setup {{ARGUMENTS_AFTER_MCP}}
33
+ ```
34
+
35
+ ## Notes
36
+
37
+ - `/oh-my-claudecode:omc-setup`, `/oh-my-claudecode:omc-doctor`, and `/oh-my-claudecode:mcp-setup` remain valid compatibility entrypoints.
38
+ - Prefer `/oh-my-claudecode:setup` in new documentation and user guidance.
39
+
40
+ Task: {{ARGUMENTS}}
@@ -21,7 +21,7 @@ The `swarm` compatibility alias was removed in #1131.
21
21
  ### Parameters
22
22
 
23
23
  - **N** - Number of teammate agents (1-20). Optional; defaults to auto-sizing based on task decomposition.
24
- - **agent-type** - OMC agent to spawn for the `team-exec` stage (e.g., executor, build-fixer, designer, codex, gemini). Optional; defaults to stage-aware routing. Use `codex` to spawn Codex CLI workers or `gemini` for Gemini CLI workers (requires respective CLIs installed). See Stage Agent Routing below.
24
+ - **agent-type** - OMC agent to spawn for the `team-exec` stage (e.g., executor, debugger, designer, codex, gemini). Optional; defaults to stage-aware routing. Use `codex` to spawn Codex CLI workers or `gemini` for Gemini CLI workers (requires respective CLIs installed). See Stage Agent Routing below.
25
25
  - **task** - High-level task to decompose and distribute among teammates
26
26
  - **ralph** - Optional modifier. When present, wraps the team pipeline in Ralph's persistence loop (retry on failure, architect verification before completion). See Team + Ralph Composition below.
27
27
 
@@ -29,7 +29,7 @@ The `swarm` compatibility alias was removed in #1131.
29
29
 
30
30
  ```bash
31
31
  /team 5:executor "fix all TypeScript errors across the project"
32
- /team 3:build-fixer "fix build errors in src/"
32
+ /team 3:debugger "fix build errors in src/"
33
33
  /team 4:designer "implement responsive layouts for all page components"
34
34
  /team "refactor the auth module with security review"
35
35
  /team ralph "build a complete REST API for user management"
@@ -102,9 +102,9 @@ Each pipeline stage uses **specialized agents** -- not just executors. The lead
102
102
  |-------|----------------|-----------------|-------------------|
103
103
  | **team-plan** | `explore` (haiku), `planner` (opus) | `analyst` (opus), `architect` (opus) | Use `analyst` for unclear requirements. Use `architect` for systems with complex boundaries. |
104
104
  | **team-prd** | `analyst` (opus) | `critic` (opus) | Use `critic` to challenge scope. |
105
- | **team-exec** | `executor` (sonnet) | `deep-executor` (opus), `build-fixer` (sonnet), `designer` (sonnet), `writer` (haiku), `test-engineer` (sonnet) | Match agent to subtask type. Use `deep-executor` for complex autonomous work, `designer` for UI, `build-fixer` for compilation issues, `writer` for docs, `test-engineer` for test creation. |
106
- | **team-verify** | `verifier` (sonnet) | `test-engineer` (sonnet), `security-reviewer` (sonnet), `code-reviewer` (opus), `quality-reviewer` (sonnet) | Always run `verifier`. Add `security-reviewer` for auth/crypto changes. Add `code-reviewer` for >20 files or architectural changes. Add `quality-reviewer` (model=haiku) for style/formatting checks. |
107
- | **team-fix** | `executor` (sonnet) | `build-fixer` (sonnet), `debugger` (sonnet), `deep-executor` (opus) | Use `build-fixer` for type/build errors. Use `debugger` for regression isolation. Use `deep-executor` for complex multi-file fixes. |
105
+ | **team-exec** | `executor` (sonnet) | `executor` (opus), `debugger` (sonnet), `designer` (sonnet), `writer` (haiku), `test-engineer` (sonnet) | Match agent to subtask type. Use `executor` (model=opus) for complex autonomous work, `designer` for UI, `debugger` for compilation issues, `writer` for docs, `test-engineer` for test creation. |
106
+ | **team-verify** | `verifier` (sonnet) | `test-engineer` (sonnet), `security-reviewer` (sonnet), `code-reviewer` (opus) | Always run `verifier`. Add `security-reviewer` for auth/crypto changes. Add `code-reviewer` for >20 files or architectural changes. `code-reviewer` also covers style/formatting checks. |
107
+ | **team-fix** | `executor` (sonnet) | `debugger` (sonnet), `executor` (opus) | Use `debugger` for type/build errors and regression isolation. Use `executor` (model=opus) for complex multi-file fixes. |
108
108
 
109
109
  **Routing rules:**
110
110
 
@@ -134,7 +134,7 @@ Each pipeline stage uses **specialized agents** -- not just executors. The lead
134
134
  - Exit (fail): fix tasks are generated and control moves to `team-fix`.
135
135
  - **team-fix**
136
136
  - Entry: verification found defects/regressions/incomplete criteria.
137
- - Agents: `executor`/`build-fixer`/`debugger` depending on defect type.
137
+ - Agents: `executor`/`debugger` depending on defect type.
138
138
  - Exit: fixes are complete and flow returns to `team-exec` then `team-verify`.
139
139
 
140
140
  ### Verify/Fix Loop and Stop Conditions
@@ -136,7 +136,7 @@ async function main() {
136
136
  }
137
137
 
138
138
  process.stdout.write(
139
- JSON.stringify({ decision: 'block', reason: buildMessage(files) }) + '\n',
139
+ JSON.stringify({ continue: false, decision: 'block', reason: buildMessage(files) }) + '\n',
140
140
  );
141
141
  } catch (error) {
142
142
  try {
@@ -9,16 +9,18 @@
9
9
  * 1. cancelomc/stopomc: Stop active modes
10
10
  * 2. ralph: Persistence mode until task completion
11
11
  * 3. autopilot: Full autonomous execution
12
- * 4. team: Coordinated team execution
12
+ * 4. team: Explicit-only via /team (not auto-triggered)
13
13
  * 5. ultrawork/ulw: Maximum parallel execution
14
- * 6. pipeline: Sequential agent chaining
14
+ * 6. ccg: Claude-Codex-Gemini tri-model orchestration
15
15
  * 7. ralplan: Iterative planning with consensus
16
- * 8. plan: Planning interview mode
17
- * 9. tdd: Test-driven development
18
- * 10. ultrathink: Extended reasoning
19
- * 11. deepsearch: Codebase search (restricted patterns)
20
- * 12. analyze: Analysis mode (restricted patterns)
21
- * 13. ccg: Claude-Codex-Gemini tri-model orchestration
16
+ * 8. deep interview: Socratic interview workflow
17
+ * 9. ai-slop-cleaner: Cleanup/deslop anti-slop workflow
18
+ * 10. tdd: Test-driven development
19
+ * 11. code review: Comprehensive review mode
20
+ * 12. security review: Security-focused review mode
21
+ * 13. ultrathink: Extended reasoning
22
+ * 14. deepsearch: Codebase search (restricted patterns)
23
+ * 15. analyze: Analysis mode (restricted patterns)
22
24
  */
23
25
 
24
26
  import { writeFileSync, mkdirSync, existsSync, unlinkSync, readFileSync } from 'fs';
@@ -49,6 +51,40 @@ Use your extended thinking capabilities to provide the most thorough and well-re
49
51
  ---
50
52
  `;
51
53
 
54
+ const ANALYZE_MESSAGE = `<analyze-mode>
55
+ ANALYSIS MODE. Gather context before diving deep:
56
+ - Search relevant code paths first
57
+ - Compare working vs broken behavior
58
+ - Synthesize findings before proposing changes
59
+ </analyze-mode>
60
+
61
+ ---
62
+ `;
63
+
64
+ const TDD_MESSAGE = `<tdd-mode>
65
+ [TDD MODE ACTIVATED]
66
+ Write or update tests first when practical, confirm they fail for the right reason, then implement the minimal fix and re-run verification.
67
+ </tdd-mode>
68
+
69
+ ---
70
+ `;
71
+
72
+ const CODE_REVIEW_MESSAGE = `<code-review-mode>
73
+ [CODE REVIEW MODE ACTIVATED]
74
+ Perform a comprehensive code review of the relevant changes or target area. Focus on correctness, maintainability, edge cases, regressions, and test adequacy before recommending changes.
75
+ </code-review-mode>
76
+
77
+ ---
78
+ `;
79
+
80
+ const SECURITY_REVIEW_MESSAGE = `<security-review-mode>
81
+ [SECURITY REVIEW MODE ACTIVATED]
82
+ Perform a focused security review of the relevant changes or target area. Check trust boundaries, auth/authz, data exposure, input validation, command/file access, secrets handling, and escalation risks before recommending changes.
83
+ </security-review-mode>
84
+
85
+ ---
86
+ `;
87
+
52
88
  // Extract prompt from various JSON structures
53
89
  function extractPrompt(input) {
54
90
  try {
@@ -69,6 +105,15 @@ function extractPrompt(input) {
69
105
  }
70
106
 
71
107
  // Sanitize text to prevent false positives from code blocks, XML tags, URLs, and file paths
108
+ const ANTI_SLOP_EXPLICIT_PATTERN = /\b(ai[\s-]?slop|anti[\s-]?slop|deslop|de[\s-]?slop)\b/i;
109
+ const ANTI_SLOP_ACTION_PATTERN = /\b(clean(?:\s*up)?|cleanup|refactor|simplify|dedupe|de-duplicate|prune)\b/i;
110
+ const ANTI_SLOP_SMELL_PATTERN = /\b(slop|duplicate(?:d|s)?|duplication|dead\s+code|unused\s+code|over[\s-]?abstract(?:ion|ed)?|wrapper\s+layers?|boundary\s+violations?|needless\s+abstractions?|unnecessary\s+abstractions?|ai[\s-]?generated|generated\s+code|tech\s+debt)\b/i;
111
+
112
+ function isAntiSlopCleanupRequest(text) {
113
+ return ANTI_SLOP_EXPLICIT_PATTERN.test(text) ||
114
+ (ANTI_SLOP_ACTION_PATTERN.test(text) && ANTI_SLOP_SMELL_PATTERN.test(text));
115
+ }
116
+
72
117
  function sanitizeForKeywordDetection(text) {
73
118
  return text
74
119
  // 1. Strip XML-style tag blocks: <tag-name ...>...</tag-name> (multi-line, greedy on tag name)
@@ -229,8 +274,8 @@ function resolveConflicts(matches) {
229
274
  // Team keyword detection removed — team is now explicit-only via /team skill.
230
275
 
231
276
  // Sort by priority order
232
- const priorityOrder = ['cancel','ralph','autopilot','ultrawork',
233
- 'pipeline','ccg','ralplan','plan','tdd','research','ultrathink','deepsearch','analyze'];
277
+ const priorityOrder = ['cancel','ralph','autopilot','ultrawork',
278
+ 'ccg','ralplan','deep-interview','ai-slop-cleaner','tdd','code-review','security-review','ultrathink','deepsearch','analyze'];
234
279
  resolved.sort((a, b) => priorityOrder.indexOf(a.name) - priorityOrder.indexOf(b.name));
235
280
 
236
281
  return resolved;
@@ -337,10 +382,6 @@ async function main() {
337
382
  matches.push({ name: 'ultrawork', args: '' });
338
383
  }
339
384
 
340
- // Pipeline keywords
341
- if (/\bagent\s+pipeline\b/i.test(cleanPrompt) || /\bchain\s+agents\b/i.test(cleanPrompt)) {
342
- matches.push({ name: 'pipeline', args: '' });
343
- }
344
385
 
345
386
  // CCG keywords (Claude-Codex-Gemini tri-model orchestration)
346
387
  if (/\b(ccg|claude-codex-gemini)\b/i.test(cleanPrompt)) {
@@ -352,12 +393,33 @@ async function main() {
352
393
  matches.push({ name: 'ralplan', args: '' });
353
394
  }
354
395
 
396
+ // Deep interview keywords
397
+ if (/\b(deep[\s-]interview|ouroboros)\b/i.test(cleanPrompt)) {
398
+ matches.push({ name: 'deep-interview', args: '' });
399
+ }
400
+
401
+ // AI slop cleanup keywords
402
+ if (isAntiSlopCleanupRequest(cleanPrompt)) {
403
+ matches.push({ name: 'ai-slop-cleaner', args: '' });
404
+ }
405
+
355
406
  // TDD keywords
356
407
  if (/\b(tdd)\b/i.test(cleanPrompt) ||
357
- /\btest\s+first\b/i.test(cleanPrompt)) {
408
+ /\btest\s+first\b/i.test(cleanPrompt) ||
409
+ /\bred\s+green\b/i.test(cleanPrompt)) {
358
410
  matches.push({ name: 'tdd', args: '' });
359
411
  }
360
412
 
413
+ // Code review keywords
414
+ if (/\b(code\s+review|review\s+code)\b/i.test(cleanPrompt)) {
415
+ matches.push({ name: 'code-review', args: '' });
416
+ }
417
+
418
+ // Security review keywords
419
+ if (/\b(security\s+review|review\s+security)\b/i.test(cleanPrompt)) {
420
+ matches.push({ name: 'security-review', args: '' });
421
+ }
422
+
361
423
  // Ultrathink keywords
362
424
  if (/\b(ultrathink)\b/i.test(cleanPrompt)) {
363
425
  matches.push({ name: 'ultrathink', args: '' });
@@ -396,7 +458,7 @@ async function main() {
396
458
 
397
459
  // Handle cancel specially - clear states and emit
398
460
  if (resolved.length > 0 && resolved[0].name === 'cancel') {
399
- clearStateFiles(directory, ['ralph', 'autopilot', 'ultrawork', 'pipeline']);
461
+ clearStateFiles(directory, ['ralph', 'autopilot', 'ultrawork']);
400
462
  console.log(JSON.stringify(createHookOutput(createSkillInvocation('cancel', prompt))));
401
463
  return;
402
464
  }
@@ -415,27 +477,33 @@ async function main() {
415
477
  activateState(directory, prompt, 'ultrawork', sessionId);
416
478
  }
417
479
 
418
- // Handle ultrathink specially - prepend message instead of skill invocation
419
- const ultrathinkIndex = resolved.findIndex(m => m.name === 'ultrathink');
420
- if (ultrathinkIndex !== -1) {
421
- // Remove ultrathink from skill list
422
- resolved.splice(ultrathinkIndex, 1);
423
-
424
- // If ultrathink was the only match, emit message
425
- if (resolved.length === 0) {
426
- console.log(JSON.stringify(createHookOutput(ULTRATHINK_MESSAGE)));
427
- return;
480
+ const additionalContextParts = [];
481
+ for (const [keywordName, message] of [
482
+ ['ultrathink', ULTRATHINK_MESSAGE],
483
+ ['analyze', ANALYZE_MESSAGE],
484
+ ['tdd', TDD_MESSAGE],
485
+ ['code-review', CODE_REVIEW_MESSAGE],
486
+ ['security-review', SECURITY_REVIEW_MESSAGE],
487
+ ]) {
488
+ const index = resolved.findIndex(m => m.name === keywordName);
489
+ if (index !== -1) {
490
+ resolved.splice(index, 1);
491
+ additionalContextParts.push(message);
428
492
  }
493
+ }
429
494
 
430
- // Otherwise, prepend ultrathink message to skill invocation
431
- const skillMessage = createMultiSkillInvocation(resolved, prompt);
432
- console.log(JSON.stringify(createHookOutput(ULTRATHINK_MESSAGE + skillMessage)));
495
+ if (resolved.length === 0 && additionalContextParts.length > 0) {
496
+ console.log(JSON.stringify(createHookOutput(additionalContextParts.join(''))));
433
497
  return;
434
498
  }
435
499
 
436
- const skillMatches = resolved;
437
- if (skillMatches.length > 0) {
438
- console.log(JSON.stringify(createHookOutput(createMultiSkillInvocation(skillMatches, prompt))));
500
+ if (resolved.length > 0) {
501
+ additionalContextParts.push(createMultiSkillInvocation(resolved, prompt));
502
+ }
503
+
504
+ if (additionalContextParts.length > 0) {
505
+ console.log(JSON.stringify(createHookOutput(additionalContextParts.join(''))));
506
+ return;
439
507
  }
440
508
  } catch (error) {
441
509
  // On any error, allow continuation
@@ -132,6 +132,29 @@ Do NOT skip this step. Do NOT move on without fixing the error.
132
132
  * from causing the stop hook to malfunction in new sessions.
133
133
  */
134
134
  const STALE_STATE_THRESHOLD_MS = 2 * 60 * 60 * 1000; // 2 hours
135
+ const TEAM_TERMINAL_PHASES = new Set([
136
+ "completed",
137
+ "complete",
138
+ "failed",
139
+ "cancelled",
140
+ "canceled",
141
+ "aborted",
142
+ "terminated",
143
+ "done",
144
+ ]);
145
+ const TEAM_ACTIVE_PHASES = new Set([
146
+ "team-plan",
147
+ "team-prd",
148
+ "team-exec",
149
+ "team-verify",
150
+ "team-fix",
151
+ "planning",
152
+ "executing",
153
+ "verify",
154
+ "verification",
155
+ "fix",
156
+ "fixing",
157
+ ]);
135
158
 
136
159
  /**
137
160
  * Check if a state is stale based on its timestamps.
@@ -153,6 +176,23 @@ function isStaleState(state) {
153
176
  return age > STALE_STATE_THRESHOLD_MS;
154
177
  }
155
178
 
179
+ function normalizeTeamPhase(state) {
180
+ if (!state || typeof state !== "object") return null;
181
+
182
+ const rawPhase = state.current_phase ?? state.phase ?? state.stage;
183
+ if (typeof rawPhase !== "string") return null;
184
+
185
+ const phase = rawPhase.trim().toLowerCase();
186
+ if (!phase || TEAM_TERMINAL_PHASES.has(phase)) return null;
187
+ return TEAM_ACTIVE_PHASES.has(phase) ? phase : null;
188
+ }
189
+
190
+ function getSafeReinforcementCount(value) {
191
+ return typeof value === "number" && Number.isFinite(value) && value >= 0
192
+ ? Math.floor(value)
193
+ : 0;
194
+ }
195
+
156
196
  /**
157
197
  * Check if a skill active state is stale based on its per-skill TTL.
158
198
  * Unlike mode states (which use the global 2-hour threshold), skill states
@@ -803,10 +843,9 @@ async function main() {
803
843
  ? team.state.session_id === sessionId
804
844
  : !team.state.session_id || team.state.session_id === sessionId;
805
845
  if (sessionMatches) {
806
- const phase = team.state.current_phase || "executing";
807
- const terminalPhases = ["completed", "complete", "failed", "cancelled"];
808
- if (!terminalPhases.includes(phase)) {
809
- const newCount = (team.state.reinforcement_count || 0) + 1;
846
+ const phase = normalizeTeamPhase(team.state);
847
+ if (phase) {
848
+ const newCount = getSafeReinforcementCount(team.state.reinforcement_count) + 1;
810
849
  if (newCount <= 20) {
811
850
  const toolError = readLastToolError(stateDir);
812
851
  const errorGuidance = getToolErrorRetryGuidance(toolError);