@monoes/monomindcli 2.16.4 → 2.16.6

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 (430) hide show
  1. package/.claude/agents/github/repo-architect.md +1 -1
  2. package/.claude/agents/specialists/integration-architect.md +9 -13
  3. package/.claude/commands/agents/agent-capabilities.md +1 -0
  4. package/.claude/commands/agents/agent-coordination.md +1 -0
  5. package/.claude/commands/agents/agent-spawning.md +1 -0
  6. package/.claude/commands/agents/agent-types.md +1 -0
  7. package/.claude/commands/analysis/bottleneck-detect.md +1 -0
  8. package/.claude/commands/analysis/performance-bottlenecks.md +1 -0
  9. package/.claude/commands/analysis/performance-report.md +1 -0
  10. package/.claude/commands/analysis/token-usage.md +1 -0
  11. package/.claude/commands/automation/README.md +1 -1
  12. package/.claude/commands/automation/auto-agent.md +1 -0
  13. package/.claude/commands/automation/self-healing.md +1 -0
  14. package/.claude/commands/automation/session-memory.md +1 -0
  15. package/.claude/commands/automation/smart-agents.md +1 -0
  16. package/.claude/commands/automation/smart-spawn.md +1 -0
  17. package/.claude/commands/automation/workflow-select.md +22 -27
  18. package/.claude/commands/coordination/README.md +2 -2
  19. package/.claude/commands/coordination/agent-spawn.md +1 -0
  20. package/.claude/commands/coordination/monoswarm-init.md +9 -8
  21. package/.claude/commands/coordination/task-orchestrate.md +6 -5
  22. package/.claude/commands/github/README.md +1 -1
  23. package/.claude/commands/github/github-modes.md +1 -0
  24. package/.claude/commands/github/issue-tracker.md +1 -0
  25. package/.claude/commands/github/pr-manager.md +1 -0
  26. package/.claude/commands/github/release-manager.md +1 -2
  27. package/.claude/commands/github/repo-architect.md +1 -0
  28. package/.claude/commands/github/sync-coordinator.md +1 -0
  29. package/.claude/commands/hooks/overview.md +1 -0
  30. package/.claude/commands/hooks/post-edit.md +1 -0
  31. package/.claude/commands/hooks/post-task.md +1 -0
  32. package/.claude/commands/hooks/pre-edit.md +1 -0
  33. package/.claude/commands/hooks/pre-task.md +1 -0
  34. package/.claude/commands/hooks/session-end.md +1 -0
  35. package/.claude/commands/hooks/setup.md +1 -0
  36. package/.claude/commands/mastermind/adr.md +3 -1
  37. package/.claude/commands/mastermind/brain.md +3 -1
  38. package/.claude/commands/mastermind/budget.md +3 -1
  39. package/.claude/commands/mastermind/code-review.md +3 -1
  40. package/.claude/commands/mastermind/content.md +3 -1
  41. package/.claude/commands/mastermind/createorg.md +3 -1
  42. package/.claude/commands/mastermind/createtask.md +6 -4
  43. package/.claude/commands/mastermind/debug.md +3 -1
  44. package/.claude/commands/mastermind/design.md +3 -1
  45. package/.claude/commands/mastermind/do.md +5 -3
  46. package/.claude/commands/mastermind/execute.md +3 -1
  47. package/.claude/commands/mastermind/finance.md +3 -1
  48. package/.claude/commands/mastermind/graph-status.md +3 -1
  49. package/.claude/commands/mastermind/help.md +12 -9
  50. package/.claude/commands/mastermind/idea.md +3 -1
  51. package/.claude/commands/mastermind/ideate.md +4 -2
  52. package/.claude/commands/mastermind/improve.md +4 -2
  53. package/.claude/commands/mastermind/loops.md +3 -1
  54. package/.claude/commands/mastermind/marketing.md +3 -1
  55. package/.claude/commands/mastermind/master.md +3 -1
  56. package/.claude/commands/mastermind/memory.md +8 -36
  57. package/.claude/commands/mastermind/monoswarm.md +3 -2
  58. package/.claude/commands/mastermind/okf-export.md +3 -1
  59. package/.claude/commands/mastermind/okf-import.md +3 -1
  60. package/.claude/commands/mastermind/ops.md +3 -1
  61. package/.claude/commands/mastermind/orgs.md +3 -1
  62. package/.claude/commands/mastermind/orgstatus.md +3 -1
  63. package/.claude/commands/mastermind/plan.md +3 -1
  64. package/.claude/commands/mastermind/receive-review.md +3 -1
  65. package/.claude/commands/mastermind/release.md +3 -1
  66. package/.claude/commands/mastermind/repeat.md +3 -1
  67. package/.claude/commands/mastermind/research.md +3 -1
  68. package/.claude/commands/mastermind/review.md +3 -1
  69. package/.claude/commands/mastermind/runorg.md +3 -1
  70. package/.claude/commands/mastermind/sales.md +3 -1
  71. package/.claude/commands/mastermind/skill-builder.md +3 -1
  72. package/.claude/commands/mastermind/specialagents.md +3 -1
  73. package/.claude/commands/mastermind/stoporg.md +3 -1
  74. package/.claude/commands/mastermind/techport.md +3 -1
  75. package/.claude/commands/mastermind/topology.md +4 -3
  76. package/.claude/commands/mastermind/understand.md +3 -1
  77. package/.claude/commands/mastermind/worktree.md +3 -1
  78. package/.claude/commands/memory/memory-search.md +1 -0
  79. package/.claude/commands/monitoring/README.md +1 -1
  80. package/.claude/commands/monitoring/agent-metrics.md +1 -0
  81. package/.claude/commands/monitoring/agents.md +1 -0
  82. package/.claude/commands/monitoring/status.md +1 -0
  83. package/.claude/commands/monoswarm/README.md +3 -3
  84. package/.claude/commands/monoswarm/analysis.md +2 -2
  85. package/.claude/commands/monoswarm/consensus.md +1 -0
  86. package/.claude/commands/monoswarm/development.md +3 -3
  87. package/.claude/commands/monoswarm/examples.md +4 -4
  88. package/.claude/commands/monoswarm/init.md +2 -1
  89. package/.claude/commands/monoswarm/maintenance.md +2 -2
  90. package/.claude/commands/monoswarm/memory.md +1 -0
  91. package/.claude/commands/monoswarm/monoswarm.md +5 -5
  92. package/.claude/commands/monoswarm/optimization.md +2 -2
  93. package/.claude/commands/monoswarm/research.md +2 -2
  94. package/.claude/commands/monoswarm/spawn.md +1 -0
  95. package/.claude/commands/monoswarm/status.md +2 -1
  96. package/.claude/commands/monoswarm/stop.md +2 -1
  97. package/.claude/commands/monoswarm/testing.md +2 -2
  98. package/.claude/commands/pair/README.md +8 -9
  99. package/.claude/commands/pair/examples.md +3 -4
  100. package/.claude/commands/pair/session.md +1 -1
  101. package/.claude/commands/workflows/README.md +45 -40
  102. package/.claude/commands/workflows/development.md +42 -55
  103. package/.claude/commands/workflows/research.md +41 -57
  104. package/.claude/commands/workflows/workflow-create.md +43 -45
  105. package/.claude/commands/workflows/workflow-execute.md +58 -68
  106. package/.claude/commands/workflows/workflow-export.md +37 -63
  107. package/.claude/helpers/build-skill-registry.cjs +10 -6
  108. package/.claude/helpers/handlers/pick-core.cjs +35 -24
  109. package/.claude/helpers/handlers/route-handler.cjs +11 -3
  110. package/.claude/helpers/hook-handler.cjs +4 -2
  111. package/.claude/helpers/jev-catalog.cjs +7 -3
  112. package/.claude/helpers/jev-picker.cjs +49 -7
  113. package/.claude/helpers/pick-rank.cjs +95 -3
  114. package/.claude/helpers/pick-stats.cjs +86 -2
  115. package/.claude/skills/agentic-jujutsu/SKILL.md +2 -3
  116. package/.claude/skills/github-toolkit/SKILL.md +1 -1
  117. package/.claude/skills/hooks-automation/SKILL.md +243 -938
  118. package/.claude/skills/mastermind-agent-detail/SKILL.md +1 -1
  119. package/.claude/skills/mastermind-agent-select/SKILL.md +16 -1
  120. package/.claude/skills/mastermind-inbox/SKILL.md +1 -1
  121. package/.claude/skills/mastermind-plugins/SKILL.md +1 -1
  122. package/.claude/skills/mastermind-release/SKILL.md +9 -1
  123. package/.claude/skills/mastermind-research/SKILL.md +9 -1
  124. package/.claude/skills/mastermind-review/SKILL.md +9 -1
  125. package/.claude/skills/mastermind-routine-detail/SKILL.md +1 -1
  126. package/.claude/skills/monodesign/SKILL.md +257 -0
  127. package/.claude/skills/monodesign/adapt.md +53 -0
  128. package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +100 -0
  129. package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +103 -0
  130. package/.claude/skills/monodesign/animate.md +65 -0
  131. package/.claude/skills/monodesign/audit.md +89 -0
  132. package/.claude/skills/monodesign/bolder.md +50 -0
  133. package/.claude/skills/monodesign/clarify.md +64 -0
  134. package/.claude/skills/monodesign/colorize.md +68 -0
  135. package/.claude/skills/monodesign/craft.md +51 -0
  136. package/.claude/skills/monodesign/critique.md +66 -0
  137. package/.claude/skills/monodesign/delight.md +47 -0
  138. package/.claude/skills/monodesign/distill.md +56 -0
  139. package/.claude/skills/monodesign/document.md +83 -0
  140. package/.claude/skills/monodesign/extract.md +74 -0
  141. package/.claude/skills/monodesign/harden.md +65 -0
  142. package/.claude/skills/monodesign/init.md +30 -0
  143. package/.claude/skills/monodesign/layout.md +36 -0
  144. package/.claude/skills/monodesign/live.md +34 -0
  145. package/.claude/skills/monodesign/onboard.md +50 -0
  146. package/.claude/skills/monodesign/optimize.md +64 -0
  147. package/.claude/skills/monodesign/overdrive.md +56 -0
  148. package/.claude/skills/monodesign/polish.md +68 -0
  149. package/.claude/skills/monodesign/quieter.md +57 -0
  150. package/.claude/skills/monodesign/reference/adapt.md +312 -0
  151. package/.claude/skills/monodesign/reference/adapt.native.md +58 -0
  152. package/.claude/skills/monodesign/reference/android.md +40 -0
  153. package/.claude/skills/monodesign/reference/animate.md +203 -0
  154. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +410 -0
  155. package/.claude/skills/monodesign/reference/audit.md +135 -0
  156. package/.claude/skills/monodesign/reference/audit.native.md +139 -0
  157. package/.claude/skills/monodesign/reference/bolder.md +120 -0
  158. package/.claude/skills/monodesign/reference/brand-workflow.md +180 -0
  159. package/.claude/skills/monodesign/reference/brand.md +108 -0
  160. package/.claude/skills/monodesign/reference/clarify.md +288 -0
  161. package/.claude/skills/monodesign/reference/codex.md +105 -0
  162. package/.claude/skills/monodesign/reference/cognitive-load.md +106 -0
  163. package/.claude/skills/monodesign/reference/color-and-contrast.md +105 -0
  164. package/.claude/skills/monodesign/reference/colorize.md +257 -0
  165. package/.claude/skills/monodesign/reference/component-specs.md +260 -0
  166. package/.claude/skills/monodesign/reference/component-states.md +274 -0
  167. package/.claude/skills/monodesign/reference/component-system.md +358 -0
  168. package/.claude/skills/monodesign/reference/copy-formulas.md +160 -0
  169. package/.claude/skills/monodesign/reference/craft.md +123 -0
  170. package/.claude/skills/monodesign/reference/critique.md +780 -0
  171. package/.claude/skills/monodesign/reference/delight.md +302 -0
  172. package/.claude/skills/monodesign/reference/design-principles.md +246 -0
  173. package/.claude/skills/monodesign/reference/distill.md +111 -0
  174. package/.claude/skills/monodesign/reference/document.md +429 -0
  175. package/.claude/skills/monodesign/reference/extract.md +69 -0
  176. package/.claude/skills/monodesign/reference/harden.md +347 -0
  177. package/.claude/skills/monodesign/reference/heuristics-scoring.md +234 -0
  178. package/.claude/skills/monodesign/reference/hooks.md +92 -0
  179. package/.claude/skills/monodesign/reference/image-prompts.md +130 -0
  180. package/.claude/skills/monodesign/reference/init.md +221 -0
  181. package/.claude/skills/monodesign/reference/interaction-design.md +189 -0
  182. package/.claude/skills/monodesign/reference/ios.md +45 -0
  183. package/.claude/skills/monodesign/reference/layout.md +185 -0
  184. package/.claude/skills/monodesign/reference/live.md +710 -0
  185. package/.claude/skills/monodesign/reference/motion-design.md +109 -0
  186. package/.claude/skills/monodesign/reference/onboard.md +234 -0
  187. package/.claude/skills/monodesign/reference/optimize.md +258 -0
  188. package/.claude/skills/monodesign/reference/overdrive.md +130 -0
  189. package/.claude/skills/monodesign/reference/personas.md +179 -0
  190. package/.claude/skills/monodesign/reference/polish.md +241 -0
  191. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +108 -0
  192. package/.claude/skills/monodesign/reference/product.md +60 -0
  193. package/.claude/skills/monodesign/reference/quieter.md +99 -0
  194. package/.claude/skills/monodesign/reference/responsive-design.md +114 -0
  195. package/.claude/skills/monodesign/reference/shape.md +165 -0
  196. package/.claude/skills/monodesign/reference/spatial-design.md +100 -0
  197. package/.claude/skills/monodesign/reference/teach.md +10 -0
  198. package/.claude/skills/monodesign/reference/token-architecture.md +222 -0
  199. package/.claude/skills/monodesign/reference/typeset.md +301 -0
  200. package/.claude/skills/monodesign/reference/typography.md +159 -0
  201. package/.claude/skills/monodesign/reference/ux-research.md +143 -0
  202. package/.claude/skills/monodesign/reference/ux-rules.md +211 -0
  203. package/.claude/skills/monodesign/reference/ux-writing.md +107 -0
  204. package/.claude/skills/monodesign/scripts/command-metadata.json +94 -0
  205. package/.claude/skills/monodesign/scripts/context-signals.mjs +260 -0
  206. package/.claude/skills/monodesign/scripts/context.mjs +1065 -0
  207. package/.claude/skills/monodesign/scripts/critique-storage.mjs +416 -0
  208. package/.claude/skills/monodesign/scripts/detect-csp.mjs +193 -0
  209. package/.claude/skills/monodesign/scripts/detect.mjs +33 -0
  210. package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +1960 -0
  211. package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +321 -0
  212. package/.claude/skills/monodesign/scripts/detector/design-system.mjs +814 -0
  213. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +5628 -0
  214. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +50 -0
  215. package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +259 -0
  216. package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +339 -0
  217. package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +636 -0
  218. package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +1016 -0
  219. package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +253 -0
  220. package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +198 -0
  221. package/.claude/skills/monodesign/scripts/detector/findings.mjs +12 -0
  222. package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +181 -0
  223. package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +373 -0
  224. package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +426 -0
  225. package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +198 -0
  226. package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +166 -0
  227. package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +563 -0
  228. package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +3024 -0
  229. package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +124 -0
  230. package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +101 -0
  231. package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +30 -0
  232. package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +148 -0
  233. package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +7 -0
  234. package/.claude/skills/monodesign/scripts/hook-admin.mjs +694 -0
  235. package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +516 -0
  236. package/.claude/skills/monodesign/scripts/hook-lib.mjs +1785 -0
  237. package/.claude/skills/monodesign/scripts/hook.mjs +61 -0
  238. package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +809 -0
  239. package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +69 -0
  240. package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +640 -0
  241. package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +129 -0
  242. package/.claude/skills/monodesign/scripts/lib/provider.mjs +4 -0
  243. package/.claude/skills/monodesign/scripts/lib/target-args.mjs +42 -0
  244. package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +50 -0
  245. package/.claude/skills/monodesign/scripts/live/completion.mjs +19 -0
  246. package/.claude/skills/monodesign/scripts/live/event-validation.mjs +137 -0
  247. package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +458 -0
  248. package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +939 -0
  249. package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +357 -0
  250. package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +152 -0
  251. package/.claude/skills/monodesign/scripts/live/session-store.mjs +293 -0
  252. package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +826 -0
  253. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +279 -0
  254. package/.claude/skills/monodesign/scripts/live/ui-core.mjs +180 -0
  255. package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +36 -0
  256. package/.claude/skills/monodesign/scripts/live-accept.mjs +812 -0
  257. package/.claude/skills/monodesign/scripts/live-browser-dom.js +147 -0
  258. package/.claude/skills/monodesign/scripts/live-browser-session.js +124 -0
  259. package/.claude/skills/monodesign/scripts/live-browser.js +11213 -0
  260. package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +1241 -0
  261. package/.claude/skills/monodesign/scripts/live-complete.mjs +75 -0
  262. package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +683 -0
  263. package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +51 -0
  264. package/.claude/skills/monodesign/scripts/live-inject.mjs +596 -0
  265. package/.claude/skills/monodesign/scripts/live-insert.mjs +272 -0
  266. package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +363 -0
  267. package/.claude/skills/monodesign/scripts/live-poll.mjs +384 -0
  268. package/.claude/skills/monodesign/scripts/live-resume.mjs +94 -0
  269. package/.claude/skills/monodesign/scripts/live-server.mjs +1210 -0
  270. package/.claude/skills/monodesign/scripts/live-status.mjs +61 -0
  271. package/.claude/skills/monodesign/scripts/live-target.mjs +30 -0
  272. package/.claude/skills/monodesign/scripts/live-wrap.mjs +884 -0
  273. package/.claude/skills/monodesign/scripts/live.mjs +297 -0
  274. package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +14 -0
  275. package/.claude/skills/monodesign/scripts/palette.mjs +635 -0
  276. package/.claude/skills/monodesign/scripts/pin.mjs +221 -0
  277. package/.claude/skills/monodesign/shape.md +71 -0
  278. package/.claude/skills/monodesign/teach.md +18 -0
  279. package/.claude/skills/monodesign/typeset.md +59 -0
  280. package/.claude/skills/monolean-audit/SKILL.md +4 -6
  281. package/.claude/skills/monolean-help/SKILL.md +0 -1
  282. package/.claude/skills/monoswarm/SKILL.md +17 -17
  283. package/.claude/skills/pair-programming/SKILL.md +127 -1100
  284. package/README.md +1 -1
  285. package/dist/src/agents/registry-builder.d.ts +1 -1
  286. package/dist/src/commands/cleanup-plan.d.ts +3 -2
  287. package/dist/src/commands/cleanup-plan.d.ts.map +1 -1
  288. package/dist/src/commands/cleanup-plan.js +24 -4
  289. package/dist/src/commands/cleanup-plan.js.map +1 -1
  290. package/dist/src/commands/doctor-pick-checks.d.ts +20 -3
  291. package/dist/src/commands/doctor-pick-checks.d.ts.map +1 -1
  292. package/dist/src/commands/doctor-pick-checks.js +132 -7
  293. package/dist/src/commands/doctor-pick-checks.js.map +1 -1
  294. package/dist/src/commands/doctor-project-checks.d.ts +2 -2
  295. package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
  296. package/dist/src/commands/doctor-project-checks.js +14 -12
  297. package/dist/src/commands/doctor-project-checks.js.map +1 -1
  298. package/dist/src/commands/doctor.d.ts.map +1 -1
  299. package/dist/src/commands/doctor.js +6 -4
  300. package/dist/src/commands/doctor.js.map +1 -1
  301. package/dist/src/commands/init-upgrade.d.ts.map +1 -1
  302. package/dist/src/commands/init-upgrade.js +6 -0
  303. package/dist/src/commands/init-upgrade.js.map +1 -1
  304. package/dist/src/commands/init.d.ts.map +1 -1
  305. package/dist/src/commands/init.js +11 -0
  306. package/dist/src/commands/init.js.map +1 -1
  307. package/dist/src/commands/pick.d.ts.map +1 -1
  308. package/dist/src/commands/pick.js +4 -3
  309. package/dist/src/commands/pick.js.map +1 -1
  310. package/dist/src/decision/jev.d.ts +16 -0
  311. package/dist/src/decision/jev.d.ts.map +1 -1
  312. package/dist/src/decision/jev.js +12 -0
  313. package/dist/src/decision/jev.js.map +1 -1
  314. package/dist/src/decision/pick-eval.d.ts +23 -0
  315. package/dist/src/decision/pick-eval.d.ts.map +1 -1
  316. package/dist/src/decision/pick-eval.js +24 -1
  317. package/dist/src/decision/pick-eval.js.map +1 -1
  318. package/dist/src/decision/picks.d.ts +5 -0
  319. package/dist/src/decision/picks.d.ts.map +1 -1
  320. package/dist/src/decision/picks.js +33 -11
  321. package/dist/src/decision/picks.js.map +1 -1
  322. package/dist/src/init/claudemd-generator.d.ts.map +1 -1
  323. package/dist/src/init/claudemd-generator.js +1 -0
  324. package/dist/src/init/claudemd-generator.js.map +1 -1
  325. package/dist/src/init/copy-assets.d.ts.map +1 -1
  326. package/dist/src/init/copy-assets.js +17 -9
  327. package/dist/src/init/copy-assets.js.map +1 -1
  328. package/dist/src/init/executor.d.ts.map +1 -1
  329. package/dist/src/init/executor.js +27 -4
  330. package/dist/src/init/executor.js.map +1 -1
  331. package/dist/src/init/file-guard.d.ts +93 -0
  332. package/dist/src/init/file-guard.d.ts.map +1 -0
  333. package/dist/src/init/file-guard.js +241 -0
  334. package/dist/src/init/file-guard.js.map +1 -0
  335. package/dist/src/init/helpers-generator.d.ts +7 -0
  336. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  337. package/dist/src/init/helpers-generator.js +9 -0
  338. package/dist/src/init/helpers-generator.js.map +1 -1
  339. package/dist/src/init/init-memory.d.ts +10 -0
  340. package/dist/src/init/init-memory.d.ts.map +1 -1
  341. package/dist/src/init/init-memory.js +44 -1
  342. package/dist/src/init/init-memory.js.map +1 -1
  343. package/dist/src/init/managed-block.d.ts +3 -1
  344. package/dist/src/init/managed-block.d.ts.map +1 -1
  345. package/dist/src/init/managed-block.js +9 -2
  346. package/dist/src/init/managed-block.js.map +1 -1
  347. package/dist/src/init/mcp-generator.d.ts +9 -0
  348. package/dist/src/init/mcp-generator.d.ts.map +1 -1
  349. package/dist/src/init/mcp-generator.js +28 -0
  350. package/dist/src/init/mcp-generator.js.map +1 -1
  351. package/dist/src/init/runtime-config-merge.d.ts +21 -0
  352. package/dist/src/init/runtime-config-merge.d.ts.map +1 -0
  353. package/dist/src/init/runtime-config-merge.js +88 -0
  354. package/dist/src/init/runtime-config-merge.js.map +1 -0
  355. package/dist/src/init/settings-generator.js +1 -1
  356. package/dist/src/init/settings-generator.js.map +1 -1
  357. package/dist/src/init/shared-instructions-generator.d.ts +3 -1
  358. package/dist/src/init/shared-instructions-generator.d.ts.map +1 -1
  359. package/dist/src/init/shared-instructions-generator.js +14 -39
  360. package/dist/src/init/shared-instructions-generator.js.map +1 -1
  361. package/dist/src/init/shared.d.ts +10 -0
  362. package/dist/src/init/shared.d.ts.map +1 -1
  363. package/dist/src/init/shared.js +32 -1
  364. package/dist/src/init/shared.js.map +1 -1
  365. package/dist/src/init/types.d.ts +9 -0
  366. package/dist/src/init/types.d.ts.map +1 -1
  367. package/dist/src/init/types.js.map +1 -1
  368. package/dist/src/init/upgrade.d.ts +4 -0
  369. package/dist/src/init/upgrade.d.ts.map +1 -1
  370. package/dist/src/init/upgrade.js +40 -43
  371. package/dist/src/init/upgrade.js.map +1 -1
  372. package/dist/src/init/write-antigravity.d.ts.map +1 -1
  373. package/dist/src/init/write-antigravity.js +9 -3
  374. package/dist/src/init/write-antigravity.js.map +1 -1
  375. package/dist/src/init/write-claude.d.ts.map +1 -1
  376. package/dist/src/init/write-claude.js +40 -19
  377. package/dist/src/init/write-claude.js.map +1 -1
  378. package/dist/src/init/write-kimicode.d.ts +27 -0
  379. package/dist/src/init/write-kimicode.d.ts.map +1 -1
  380. package/dist/src/init/write-kimicode.js +119 -92
  381. package/dist/src/init/write-kimicode.js.map +1 -1
  382. package/dist/src/init/write-opencode.d.ts.map +1 -1
  383. package/dist/src/init/write-opencode.js +45 -6
  384. package/dist/src/init/write-opencode.js.map +1 -1
  385. package/dist/src/init/write-runtime-config.d.ts.map +1 -1
  386. package/dist/src/init/write-runtime-config.js +108 -81
  387. package/dist/src/init/write-runtime-config.js.map +1 -1
  388. package/dist/src/knowledge/eval/golden-set.js +0 -15
  389. package/dist/src/knowledge/eval/golden-set.js.map +1 -1
  390. package/dist/src/mcp-tools/org-skill-tools.d.ts.map +1 -1
  391. package/dist/src/mcp-tools/org-skill-tools.js +6 -2
  392. package/dist/src/mcp-tools/org-skill-tools.js.map +1 -1
  393. package/dist/src/mcp-tools/pick-tools.d.ts.map +1 -1
  394. package/dist/src/mcp-tools/pick-tools.js +13 -4
  395. package/dist/src/mcp-tools/pick-tools.js.map +1 -1
  396. package/dist/src/platform-adapters/merge.d.ts +15 -3
  397. package/dist/src/platform-adapters/merge.d.ts.map +1 -1
  398. package/dist/src/platform-adapters/merge.js +44 -9
  399. package/dist/src/platform-adapters/merge.js.map +1 -1
  400. package/dist/src/platform-adapters/migration.d.ts.map +1 -1
  401. package/dist/src/platform-adapters/migration.js +10 -5
  402. package/dist/src/platform-adapters/migration.js.map +1 -1
  403. package/dist/src/platform-adapters/mutation.d.ts +6 -1
  404. package/dist/src/platform-adapters/mutation.d.ts.map +1 -1
  405. package/dist/src/platform-adapters/mutation.js +9 -3
  406. package/dist/src/platform-adapters/mutation.js.map +1 -1
  407. package/dist/src/platform-adapters/operations.d.ts.map +1 -1
  408. package/dist/src/platform-adapters/operations.js +45 -18
  409. package/dist/src/platform-adapters/operations.js.map +1 -1
  410. package/dist/src/platform-adapters/owned-files.d.ts +23 -0
  411. package/dist/src/platform-adapters/owned-files.d.ts.map +1 -0
  412. package/dist/src/platform-adapters/owned-files.js +64 -0
  413. package/dist/src/platform-adapters/owned-files.js.map +1 -0
  414. package/dist/src/platform-adapters/renderers/skills.d.ts.map +1 -1
  415. package/dist/src/platform-adapters/renderers/skills.js +5 -2
  416. package/dist/src/platform-adapters/renderers/skills.js.map +1 -1
  417. package/dist/src/platform-adapters/shared-surface.d.ts +7 -4
  418. package/dist/src/platform-adapters/shared-surface.d.ts.map +1 -1
  419. package/dist/src/platform-adapters/shared-surface.js +7 -4
  420. package/dist/src/platform-adapters/shared-surface.js.map +1 -1
  421. package/dist/src/platform-adapters/types.d.ts +16 -1
  422. package/dist/src/platform-adapters/types.d.ts.map +1 -1
  423. package/dist/src/routing/agent-pick.d.ts +9 -7
  424. package/dist/src/routing/agent-pick.d.ts.map +1 -1
  425. package/dist/src/routing/agent-pick.js +17 -17
  426. package/dist/src/routing/agent-pick.js.map +1 -1
  427. package/dist/tsconfig.tsbuildinfo +1 -1
  428. package/package.json +5 -5
  429. package/.claude/skills/github-issue-triage/SKILL.md +0 -354
  430. package/.claude/skills/github-repo-recap/SKILL.md +0 -207
@@ -1,61 +1,58 @@
1
1
  ---
2
2
  name: hooks-automation
3
- description: Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows.
3
+ description: Automated coordination and learning from Claude Code operations using the monomind hooks system. Covers pre/post edit, command and task hooks, session persistence, routing, pattern logging, background workers, Claude Code settings.json wiring, and Git hook integration.
4
4
  ---
5
5
 
6
6
  # Hooks Automation
7
7
 
8
- Intelligent automation system that coordinates, validates, and learns from Claude Code operations through hooks integrated with MCP tools and neural pattern training.
8
+ Coordinate, validate, and learn from Claude Code operations through the `monomind hooks` command group and the hook handlers that `monomind init` installs into `.claude/settings.json`.
9
9
 
10
10
  ## What This Skill Does
11
11
 
12
- This skill provides a comprehensive hook system that automatically manages development operations, coordinates swarm agents, maintains session state, and continuously learns from coding patterns. It enables automated agent assignment, code formatting, performance tracking, and cross-session memory persistence.
12
+ The hooks system records what happens during a session (edits, commands, tasks) and uses that history to suggest agents, assess command risk, and persist session state. It enables:
13
13
 
14
- **Key Capabilities:**
15
- - **Pre-Operation Hooks**: Validate, prepare, and auto-assign agents before operations
16
- - **Post-Operation Hooks**: Format, analyze, and train patterns after operations
17
- - **Session Management**: Persist state, restore context, generate summaries
18
- - **Memory Coordination**: Synchronize knowledge across swarm agents
19
- - **Git Integration**: Automated commit hooks with quality verification
20
- - **Neural Training**: Continuous learning from successful patterns
21
- - **MCP Integration**: Seamless coordination with swarm tools
14
+ - **Pre-operation hooks**: context and agent suggestions before an edit, risk assessment before a command, agent suggestions before a task
15
+ - **Post-operation hooks**: record edit, command, and task outcomes so routing can learn from them
16
+ - **Session management**: persist state at session end and restore it later
17
+ - **Routing**: route a task to the best agent (or model) and explain the decision
18
+ - **Pattern store**: log trajectories and search stored patterns (`hooks intelligence`); `hooks pretrain` consolidates hook activity into JSON state — no model is trained
19
+ - **Background workers**: run `@monoes/hooks` workers in-process
22
20
 
23
21
  ## Prerequisites
24
22
 
25
23
  **Required:**
26
- - Monomind CLI installed (`npm install -g monomind@latest`)
27
- - Claude Code with hooks enabled
28
- - `.claude/settings.json` with hook configurations
24
+ - Monomind CLI (`npm install -g monomind@latest`, or use `npx monomind`)
25
+ - Claude Code with hooks enabled in `.claude/settings.json`
29
26
 
30
27
  **Optional:**
31
- - Git repository for version control
32
- - Testing framework for quality verification
28
+ - Git repository (for the Git hook examples)
29
+ - A test framework (for quality gates)
33
30
 
34
31
  ## Quick Start
35
32
 
36
- ### Initialize Hooks System
33
+ ### Initialize Hooks
37
34
 
38
35
  ```bash
39
- # Initialize with default hooks configuration
40
- npx monomind init --hooks
36
+ # Write the hooks configuration into .claude/settings.json
37
+ npx monomind init hooks
38
+
39
+ # Only the essential hooks
40
+ npx monomind init hooks --minimal
41
41
  ```
42
42
 
43
- This creates:
44
- - `.claude/settings.json` with pre-configured hooks
45
- - Hook command documentation in `.claude/commands/hooks/`
46
- - Default hook handlers for common operations
43
+ This wires Claude Code's `PreToolUse`, `PostToolUse`, and session events to the helper `.claude/helpers/hook-handler.cjs` (installed by `monomind init`), which handles pre-bash, pre-search (Grep/Glob), pre-agent, post-edit, session-restore, session-end, and related events.
47
44
 
48
45
  ### Basic Hook Usage
49
46
 
50
47
  ```bash
51
- # Pre-task hook (auto-spawns agents)
52
- npx monomind hook pre-task --description "Implement authentication"
48
+ # Record task start and get agent suggestions
49
+ npx monomind hooks pre-task --description "Implement authentication"
53
50
 
54
- # Post-edit hook (auto-formats and stores in memory)
55
- npx monomind hook post-edit --file "src/auth.js" --memory-key "auth/login"
51
+ # Record an edit outcome
52
+ npx monomind hooks post-edit --file "src/auth.js" --success true
56
53
 
57
- # Session end hook (saves state and metrics)
58
- npx monomind hook session-end --session-id "dev-session" --export-metrics
54
+ # End the session and persist state
55
+ npx monomind hooks session-end
59
56
  ```
60
57
 
61
58
  ---
@@ -64,379 +61,210 @@ npx monomind hook session-end --session-id "dev-session" --export-metrics
64
61
 
65
62
  ### Available Hooks
66
63
 
67
- #### Pre-Operation Hooks
68
-
69
- Hooks that execute BEFORE operations to prepare and validate:
70
-
71
- **pre-edit** - Validate and assign agents before file modifications
72
- ```bash
73
- npx monomind hook pre-edit [options]
74
-
75
- Options:
76
- --file, -f <path> File path to be edited
77
- --auto-assign-agent Automatically assign best agent (default: true)
78
- --validate-syntax Pre-validate syntax before edit
79
- --check-conflicts Check for merge conflicts
80
- --backup-file Create backup before editing
64
+ Run `npx monomind hooks --help` for the full list and `npx monomind hooks <sub> --help` for each subcommand's flags.
81
65
 
82
- Examples:
83
- npx monomind hook pre-edit --file "src/auth/login.js"
84
- npx monomind hook pre-edit -f "config/db.js" --validate-syntax
85
- npx monomind hook pre-edit -f "production.env" --backup-file --check-conflicts
86
- ```
87
-
88
- **Features:**
89
- - Auto agent assignment based on file type
90
- - Syntax validation to prevent broken code
91
- - Conflict detection for concurrent edits
92
- - Automatic file backups for safety
66
+ #### Pre-Operation Hooks
93
67
 
94
- **pre-bash** - Check command safety and resource requirements
68
+ **pre-edit** - Get context and agent suggestions before editing a file
95
69
  ```bash
96
- npx monomind hook pre-bash --command <cmd>
70
+ npx monomind hooks pre-edit [options]
97
71
 
98
72
  Options:
99
- --command, -c <cmd> Command to validate
100
- --check-safety Verify command safety (default: true)
101
- --estimate-resources Estimate resource usage
102
- --require-confirmation Request user confirmation for risky commands
73
+ -f, --file <path> File path to edit
74
+ -o, --operation <type> create | update | delete | refactor (default: update)
75
+ -c, --context <text> Additional context about the edit
103
76
 
104
77
  Examples:
105
- npx monomind hook pre-bash -c "rm -rf /tmp/cache"
106
- npx monomind hook pre-bash --command "docker build ." --estimate-resources
78
+ npx monomind hooks pre-edit --file "src/auth/login.js"
79
+ npx monomind hooks pre-edit -f "src/db.ts" -o refactor -c "split connection pool"
107
80
  ```
108
81
 
109
- **Features:**
110
- - Command safety validation
111
- - Resource requirement estimation
112
- - Destructive command confirmation
113
- - Permission checks
114
-
115
- **pre-task** - Auto-spawn agents and prepare for complex tasks
82
+ **pre-command** (alias: `pre-bash`) - Assess risk before executing a command
116
83
  ```bash
117
- npx monomind hook pre-task [options]
84
+ npx monomind hooks pre-command --command <cmd>
118
85
 
119
86
  Options:
120
- --description, -d <text> Task description for context
121
- --auto-spawn-agents Automatically spawn required agents (default: true)
122
- --load-memory Load relevant memory from previous sessions
123
- --optimize-topology Select optimal swarm topology
124
- --estimate-complexity Analyze task complexity
87
+ -c, --command <cmd> Command to execute (required)
88
+ -d, --dry-run Only analyze, do not execute (default: true)
125
89
 
126
90
  Examples:
127
- npx monomind hook pre-task --description "Implement user authentication"
128
- npx monomind hook pre-task -d "Continue API dev" --load-memory
129
- npx monomind hook pre-task -d "Refactor codebase" --optimize-topology
91
+ npx monomind hooks pre-command -c "rm -rf ./build"
92
+ npx monomind hooks pre-bash --command "docker build ."
130
93
  ```
131
94
 
132
- **Features:**
133
- - Automatic agent spawning based on task analysis
134
- - Memory loading for context continuity
135
- - Topology optimization for task structure
136
- - Complexity estimation and time prediction
137
-
138
- **pre-search** - Prepare and optimize search operations
95
+ **pre-task** - Record task start and get agent suggestions
139
96
  ```bash
140
- npx monomind hook pre-search --query <query>
97
+ npx monomind hooks pre-task [options]
141
98
 
142
99
  Options:
143
- --query, -q <text> Search query
144
- --check-cache Check cache first (default: true)
145
- --optimize-query Optimize search pattern
100
+ -d, --description <text> Task description (required)
101
+ -i, --task-id <id> Task identifier (auto-generated if omitted)
102
+ -a, --auto-spawn Auto-spawn suggested agents (default: false)
146
103
 
147
104
  Examples:
148
- npx monomind hook pre-search -q "authentication middleware"
105
+ npx monomind hooks pre-task --description "Implement user authentication"
106
+ npx monomind hooks pre-task -d "Refactor codebase" -i refactor-1
149
107
  ```
150
108
 
151
- **Features:**
152
- - Cache checking for faster results
153
- - Query optimization
154
- - Search pattern improvement
109
+ There is no `pre-search` CLI subcommand. Search-time context (for Grep/Glob) is handled by the installed helper (`hook-handler.cjs pre-search`) that `monomind init hooks` wires up.
155
110
 
156
111
  #### Post-Operation Hooks
157
112
 
158
- Hooks that execute AFTER operations to process and learn:
159
-
160
- **post-edit** - Auto-format, validate, and update memory
113
+ **post-edit** - Record editing outcome for learning
161
114
  ```bash
162
- npx monomind hook post-edit [options]
115
+ npx monomind hooks post-edit [options]
163
116
 
164
117
  Options:
165
- --file, -f <path> File path that was edited
166
- --auto-format Automatically format code (default: true)
167
- --memory-key, -m <key> Store edit context in memory
168
- --train-patterns Train neural patterns from edit
169
- --validate-output Validate edited file
118
+ -f, --file <path> File path that was edited
119
+ -s, --success Whether the edit was successful
120
+ -o, --outcome <text> Outcome description
121
+ -m, --metrics <list> Performance metrics (e.g. "time:500ms,quality:0.95")
170
122
 
171
123
  Examples:
172
- npx monomind hook post-edit --file "src/components/Button.jsx"
173
- npx monomind hook post-edit -f "api/auth.js" --memory-key "auth/login"
174
- npx monomind hook post-edit -f "utils/helpers.ts" --train-patterns
124
+ npx monomind hooks post-edit --file "src/components/Button.jsx" --success true
125
+ npx monomind hooks post-edit -f "api/auth.js" -s true -o "added token refresh"
175
126
  ```
176
127
 
177
- **Features:**
178
- - Language-specific auto-formatting (Prettier, Black, gofmt)
179
- - Memory storage for edit context and decisions
180
- - Neural pattern training for continuous improvement
181
- - Output validation with linting
128
+ The hook records the outcome; it does not format code. Run your formatter (Prettier, Black, gofmt) as its own hook command if you want auto-formatting.
182
129
 
183
- **post-bash** - Log execution and update metrics
130
+ **post-command** (alias: `post-bash`) - Record command execution outcome
184
131
  ```bash
185
- npx monomind hook post-bash --command <cmd>
132
+ npx monomind hooks post-command --command <cmd>
186
133
 
187
134
  Options:
188
- --command, -c <cmd> Command that was executed
189
- --log-output Log command output (default: true)
190
- --update-metrics Update performance metrics
191
- --store-result Store result in memory
135
+ -c, --command <cmd> Command that was executed (required)
136
+ -s, --success Whether the command succeeded
137
+ -e, --exit-code <n> Command exit code (default: 0)
138
+ -d, --duration <ms> Execution duration in milliseconds
192
139
 
193
140
  Examples:
194
- npx monomind hook post-bash -c "npm test" --update-metrics
141
+ npx monomind hooks post-command -c "npm test" --success true --duration 4200
195
142
  ```
196
143
 
197
- **Features:**
198
- - Command execution logging
199
- - Performance metric tracking
200
- - Result storage for analysis
201
- - Error pattern detection
202
-
203
- **post-task** - Performance analysis and decision storage
144
+ **post-task** - Record task completion for learning
204
145
  ```bash
205
- npx monomind hook post-task [options]
146
+ npx monomind hooks post-task [options]
206
147
 
207
148
  Options:
208
- --task-id, -t <id> Task identifier for tracking
209
- --analyze-performance Generate performance metrics (default: true)
210
- --store-decisions Save task decisions to memory
211
- --export-learnings Export neural pattern learnings
212
- --generate-report Create task completion report
149
+ -i, --task-id <id> Task identifier (required)
150
+ -s, --success Whether the task succeeded
151
+ -d, --duration <ms> Task duration in milliseconds
152
+ -o, --outcome <text> Outcome description
153
+ -r, --route-id <id> Route ID from a prior `hooks route` call (joins recommendation to outcome)
213
154
 
214
155
  Examples:
215
- npx monomind hook post-task --task-id "auth-implementation"
216
- npx monomind hook post-task -t "api-refactor" --analyze-performance
217
- npx monomind hook post-task -t "bug-fix-123" --store-decisions
156
+ npx monomind hooks post-task --task-id "auth-implementation" --success true
157
+ npx monomind hooks post-task -i "bug-fix-123" -s false -o "flaky test, needs follow-up"
218
158
  ```
219
159
 
220
- **Features:**
221
- - Execution time and token usage measurement
222
- - Decision and implementation choice recording
223
- - Neural learning pattern export
224
- - Completion report generation
160
+ #### Session Hooks
225
161
 
226
- **post-search** - Cache results and improve patterns
162
+ **session-restore** - Restore a previous session
227
163
  ```bash
228
- npx monomind hook post-search --query <query> --results <path>
164
+ npx monomind hooks session-restore [options]
229
165
 
230
166
  Options:
231
- --query, -q <text> Original search query
232
- --results, -r <path> Results file path
233
- --cache-results Cache for future use (default: true)
234
- --train-patterns Improve search patterns
167
+ -i, --session-id <id> Session to restore ("latest" for most recent; default: latest)
168
+ -a, --restore-agents Restore spawned agents (default: true)
169
+ -t, --restore-tasks Restore active tasks (default: true)
235
170
 
236
171
  Examples:
237
- npx monomind hook post-search -q "auth" -r "results.json" --train-patterns
172
+ npx monomind hooks session-restore
173
+ npx monomind hooks session-restore --session-id "feature-auth"
238
174
  ```
239
175
 
240
- **Features:**
241
- - Result caching for faster subsequent searches
242
- - Search pattern improvement
243
- - Relevance scoring
244
-
245
- #### MCP Integration Hooks
246
-
247
- Hooks that coordinate with MCP swarm tools:
248
-
249
- **mcp-initialized** - Persist swarm configuration
250
- ```bash
251
- npx monomind hook mcp-initialized --swarm-id <id>
252
-
253
- Features:
254
- - Save swarm topology and configuration
255
- - Store agent roster in memory
256
- - Initialize coordination namespace
257
- ```
176
+ `session-start` still exists but is deprecated in favor of `session-restore`.
258
177
 
259
- **agent-spawned** - Update agent roster and memory
178
+ **session-end** - End current session and persist state
260
179
  ```bash
261
- npx monomind hook agent-spawned --agent-id <id> --type <type>
180
+ npx monomind hooks session-end [options]
262
181
 
263
- Features:
264
- - Register agent in coordination memory
265
- - Update agent roster
266
- - Initialize agent-specific memory namespace
267
- ```
268
-
269
- **task-orchestrated** - Monitor task progress
270
- ```bash
271
- npx monomind hook task-orchestrated --task-id <id>
272
-
273
- Features:
274
- - Track task progress through memory
275
- - Monitor agent assignments
276
- - Update coordination state
277
- ```
278
-
279
- **neural-trained** - Save pattern improvements
280
- ```bash
281
- npx monomind hook neural-trained --pattern <name>
282
-
283
- Features:
284
- - Export trained neural patterns
285
- - Update coordination models
286
- - Share learning across agents
182
+ Options:
183
+ -s, --save-state Save session state for later restoration (default: true)
287
184
  ```
288
185
 
289
- #### Memory Coordination Hooks
186
+ For named checkpoints, use the `session` command group: `npx monomind session save --name "feature-auth"`, `npx monomind session list`, `npx monomind session restore <id>`.
290
187
 
291
- **memory-write** - Triggered when agents write to coordination memory
188
+ **notify** - Send a notification message (logged to the session)
292
189
  ```bash
293
- Features:
294
- - Validate memory key format
295
- - Update cross-agent indexes
296
- - Trigger dependent hooks
297
- - Notify subscribed agents
298
- ```
299
-
300
- **memory-read** - Triggered when agents read from coordination memory
301
- ```bash
302
- Features:
303
- - Log access patterns
304
- - Update popularity metrics
305
- - Preload related data
306
- - Track usage statistics
307
- ```
190
+ npx monomind hooks notify --message <msg>
308
191
 
309
- **memory-sync** - Synchronize memory across swarm agents
310
- ```bash
311
- npx monomind hook memory-sync --namespace <ns>
192
+ Options:
193
+ -m, --message <text> Notification message (required)
194
+ -l, --level <level> info | warn | error (default: info)
195
+ -c, --channel <name> Only "console" is implemented (default: console)
312
196
 
313
- Features:
314
- - Sync memory state across agents
315
- - Resolve conflicts
316
- - Propagate updates
317
- - Maintain consistency
197
+ Examples:
198
+ npx monomind hooks notify -m "Task completed" --level info
318
199
  ```
319
200
 
320
- #### Session Hooks
201
+ #### Routing and Learning
321
202
 
322
- **session-start** - Initialize new session
323
203
  ```bash
324
- npx monomind hook session-start --session-id <id>
325
-
326
- Options:
327
- --session-id, -s <id> Session identifier
328
- --load-context Load context from previous session
329
- --init-agents Initialize required agents
330
-
331
- Features:
332
- - Create session directory
333
- - Initialize metrics tracking
334
- - Load previous context
335
- - Set up coordination namespace
336
- ```
204
+ # Route a task to the best agent (top 3 suggestions by default)
205
+ npx monomind hooks route --task "Fix authentication bug" --top-k 3
337
206
 
338
- **session-restore** - Load previous session state
339
- ```bash
340
- npx monomind hook session-restore --session-id <id>
207
+ # Explain a routing decision
208
+ npx monomind hooks explain --task "Fix authentication bug" --verbose
341
209
 
342
- Options:
343
- --session-id, -s <id> Session to restore
344
- --restore-memory Restore memory state (default: true)
345
- --restore-agents Restore agent configurations
210
+ # Route to a Claude model (haiku/sonnet/opus) by complexity
211
+ npx monomind hooks model-route --task "Rename a variable" --prefer-cost
212
+ npx monomind hooks model-stats
346
213
 
347
- Examples:
348
- npx monomind hook session-restore --session-id "swarm-20241019"
349
- npx monomind hook session-restore -s "feature-auth" --restore-memory
350
- ```
214
+ # Route based on test coverage gaps
215
+ npx monomind hooks coverage-gaps --critical-only
351
216
 
352
- **Features:**
353
- - Load previous session context
354
- - Restore memory state and decisions
355
- - Reconfigure agents to previous state
356
- - Resume in-progress tasks
217
+ # Consolidate hook activity into JSON state (no model is trained)
218
+ npx monomind hooks pretrain --depth shallow
357
219
 
358
- **session-end** - Cleanup and persist session state
359
- ```bash
360
- npx monomind hook session-end [options]
220
+ # Pattern store: ingest history, list/search patterns
221
+ npx monomind hooks intelligence train
222
+ npx monomind hooks intelligence patterns --query "auth" --limit 5
223
+ npx monomind hooks intelligence status
361
224
 
362
- Options:
363
- --session-id, -s <id> Session identifier to end
364
- --save-state Save current session state (default: true)
365
- --export-metrics Export session metrics
366
- --generate-summary Create session summary
367
- --cleanup-temp Remove temporary files
225
+ # Copy learned patterns from another local project
226
+ npx monomind hooks transfer from-project --source ../other-project
368
227
 
369
- Examples:
370
- npx monomind hook session-end --session-id "dev-session-2024"
371
- npx monomind hook session-end -s "feature-auth" --export-metrics --generate-summary
372
- npx monomind hook session-end -s "quick-fix" --cleanup-temp
228
+ # Metrics dashboard
229
+ npx monomind hooks metrics --period 7d
230
+ npx monomind hooks metrics --v1-dashboard
373
231
  ```
374
232
 
375
- **Features:**
376
- - Save current context and progress
377
- - Export session metrics (duration, commands, tokens, files)
378
- - Generate work summary with decisions and next steps
379
- - Cleanup temporary files and optimize storage
233
+ #### Background Workers and Utilities
380
234
 
381
- **notify** - Custom notifications with swarm status
382
235
  ```bash
383
- npx monomind hook notify --message <msg>
384
-
385
- Options:
386
- --message, -m <text> Notification message
387
- --level <level> Notification level (info|warning|error)
388
- --swarm-status Include swarm status (default: true)
389
- --broadcast Send to all agents
390
-
391
- Examples:
392
- npx monomind hook notify -m "Task completed" --level info
393
- npx monomind hook notify -m "Critical error" --level error --broadcast
236
+ npx monomind hooks list # registered hooks
237
+ npx monomind hooks worker list # available background workers
238
+ npx monomind hooks worker run --name <worker>
239
+ npx monomind hooks statusline --compact
394
240
  ```
395
241
 
396
- **Features:**
397
- - Send notifications to coordination system
398
- - Include swarm status and metrics
399
- - Broadcast to all agents
400
- - Log important events
401
-
402
242
  ### Configuration
403
243
 
404
- #### Basic Configuration
244
+ #### Generated Configuration
405
245
 
406
- Edit `.claude/settings.json` to configure hooks:
246
+ `npx monomind init hooks` writes the recommended configuration. Each entry runs the installed helper, which reads Claude Code's hook input JSON from stdin:
407
247
 
408
248
  ```json
409
249
  {
410
250
  "hooks": {
411
251
  "PreToolUse": [
412
252
  {
413
- "matcher": "^(Write|Edit|MultiEdit)$",
253
+ "matcher": "Bash",
414
254
  "hooks": [{
415
255
  "type": "command",
416
- "command": "npx monomind hook pre-edit --file '${tool.params.file_path}' --memory-key 'swarm/editor/current'"
417
- }]
418
- },
419
- {
420
- "matcher": "^Bash$",
421
- "hooks": [{
422
- "type": "command",
423
- "command": "npx monomind hook pre-bash --command '${tool.params.command}'"
256
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" pre-bash",
257
+ "timeout": 5
424
258
  }]
425
259
  }
426
260
  ],
427
261
  "PostToolUse": [
428
262
  {
429
- "matcher": "^(Write|Edit|MultiEdit)$",
263
+ "matcher": "Write|Edit|MultiEdit",
430
264
  "hooks": [{
431
265
  "type": "command",
432
- "command": "npx monomind hook post-edit --file '${tool.params.file_path}' --memory-key 'swarm/editor/complete' --auto-format --train-patterns"
433
- }]
434
- },
435
- {
436
- "matcher": "^Bash$",
437
- "hooks": [{
438
- "type": "command",
439
- "command": "npx monomind hook post-bash --command '${tool.params.command}' --update-metrics"
266
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" post-edit",
267
+ "timeout": 10
440
268
  }]
441
269
  }
442
270
  ]
@@ -444,749 +272,226 @@ Edit `.claude/settings.json` to configure hooks:
444
272
  }
445
273
  ```
446
274
 
447
- #### Advanced Configuration
275
+ (The generated commands also walk up the directory tree to find `.claude/helpers`; the version above is simplified.)
276
+
277
+ #### Calling the CLI Directly
448
278
 
449
- Complete hook configuration with all features:
279
+ Claude Code passes hook input as JSON on stdin (for example `tool_input.file_path`, `tool_input.command`). To call `monomind hooks` subcommands directly, extract the fields with `jq`:
450
280
 
451
281
  ```json
452
282
  {
453
283
  "hooks": {
454
- "enabled": true,
455
- "debug": false,
456
- "timeout": 5000,
457
-
458
284
  "PreToolUse": [
459
285
  {
460
- "matcher": "^(Write|Edit|MultiEdit)$",
461
- "hooks": [
462
- {
463
- "type": "command",
464
- "command": "npx monomind hook pre-edit --file '${tool.params.file_path}' --auto-assign-agent --validate-syntax",
465
- "timeout": 3000,
466
- "continueOnError": true
467
- }
468
- ]
469
- },
470
- {
471
- "matcher": "^Task$",
472
- "hooks": [
473
- {
474
- "type": "command",
475
- "command": "npx monomind hook pre-task --description '${tool.params.task}' --auto-spawn-agents --load-memory",
476
- "async": true
477
- }
478
- ]
286
+ "matcher": "Write|Edit|MultiEdit",
287
+ "hooks": [{
288
+ "type": "command",
289
+ "command": "sh -c 'f=$(jq -r .tool_input.file_path); npx monomind hooks pre-edit --file \"$f\"'",
290
+ "timeout": 10
291
+ }]
479
292
  },
480
293
  {
481
- "matcher": "^Grep$",
482
- "hooks": [
483
- {
484
- "type": "command",
485
- "command": "npx monomind hook pre-search --query '${tool.params.pattern}' --check-cache"
486
- }
487
- ]
294
+ "matcher": "Bash",
295
+ "hooks": [{
296
+ "type": "command",
297
+ "command": "sh -c 'c=$(jq -r .tool_input.command); npx monomind hooks pre-command --command \"$c\"'",
298
+ "timeout": 10
299
+ }]
488
300
  }
489
301
  ],
490
-
491
302
  "PostToolUse": [
492
303
  {
493
- "matcher": "^(Write|Edit|MultiEdit)$",
494
- "hooks": [
495
- {
496
- "type": "command",
497
- "command": "npx monomind hook post-edit --file '${tool.params.file_path}' --memory-key 'edits/${tool.params.file_path}' --auto-format --train-patterns",
498
- "async": true
499
- }
500
- ]
501
- },
502
- {
503
- "matcher": "^Task$",
504
- "hooks": [
505
- {
506
- "type": "command",
507
- "command": "npx monomind hook post-task --task-id '${result.task_id}' --analyze-performance --store-decisions --export-learnings",
508
- "async": true
509
- }
510
- ]
511
- },
512
- {
513
- "matcher": "^Grep$",
514
- "hooks": [
515
- {
516
- "type": "command",
517
- "command": "npx monomind hook post-search --query '${tool.params.pattern}' --cache-results --train-patterns"
518
- }
519
- ]
520
- }
521
- ],
522
-
523
- "SessionStart": [
524
- {
525
- "hooks": [
526
- {
527
- "type": "command",
528
- "command": "npx monomind hook session-start --session-id '${session.id}' --load-context"
529
- }
530
- ]
304
+ "matcher": "Write|Edit|MultiEdit",
305
+ "hooks": [{
306
+ "type": "command",
307
+ "command": "sh -c 'f=$(jq -r .tool_input.file_path); npx monomind hooks post-edit --file \"$f\" --success true'",
308
+ "timeout": 10
309
+ }]
531
310
  }
532
311
  ],
533
-
534
312
  "SessionEnd": [
535
313
  {
536
- "hooks": [
537
- {
538
- "type": "command",
539
- "command": "npx monomind hook session-end --session-id '${session.id}' --export-metrics --generate-summary --cleanup-temp"
540
- }
541
- ]
314
+ "hooks": [{
315
+ "type": "command",
316
+ "command": "npx monomind hooks session-end"
317
+ }]
542
318
  }
543
319
  ]
544
320
  }
545
321
  }
546
322
  ```
547
323
 
548
- #### Protected File Patterns
324
+ `npx` startup adds latency to every tool call; the helper-based configuration is faster.
549
325
 
550
- Add protection for sensitive files:
326
+ #### Enforcement Gates
551
327
 
552
- ```json
553
- {
554
- "hooks": {
555
- "PreToolUse": [
556
- {
557
- "matcher": "^(Write|Edit|MultiEdit)$",
558
- "hooks": [
559
- {
560
- "type": "command",
561
- "command": "npx monomind hook check-protected --file '${tool.params.file_path}'"
562
- }
563
- ]
564
- }
565
- ]
566
- }
567
- }
328
+ To block destructive commands and secret leaks, wire the guidance gates into the same hooks:
329
+
330
+ ```bash
331
+ npx monomind guidance setup
568
332
  ```
569
333
 
570
334
  #### Automatic Testing
571
335
 
572
- Run tests after file modifications:
336
+ Run tests after file modifications (plain shell, no monomind command needed):
573
337
 
574
338
  ```json
575
339
  {
576
340
  "hooks": {
577
341
  "PostToolUse": [
578
342
  {
579
- "matcher": "^Write$",
580
- "hooks": [
581
- {
582
- "type": "command",
583
- "command": "test -f '${tool.params.file_path%.js}.test.js' && npm test '${tool.params.file_path%.js}.test.js'",
584
- "continueOnError": true
585
- }
586
- ]
343
+ "matcher": "Write",
344
+ "hooks": [{
345
+ "type": "command",
346
+ "command": "sh -c 'f=$(jq -r .tool_input.file_path); t=\"${f%.js}.test.js\"; [ -f \"$t\" ] && npm test -- \"$t\" || true'"
347
+ }]
587
348
  }
588
349
  ]
589
350
  }
590
351
  }
591
352
  ```
592
353
 
593
- ### MCP Tool Integration
594
-
595
- Hooks automatically integrate with MCP tools for coordination:
596
-
597
- #### Pre-Task Hook with Agent Spawning
598
-
599
- ```javascript
600
- // Hook command
601
- npx monomind hook pre-task --description "Build REST API"
602
-
603
- // Internally calls MCP tools:
604
- mcp__monomind__agent_spawn {
605
- type: "Backend Architect",
606
- capabilities: ["api", "database", "testing"]
607
- }
608
-
609
- mcp__monomind__memory_pattern-store {
610
- action: "store",
611
- key: "swarm/task/api-build/context",
612
- namespace: "coordination",
613
- value: JSON.stringify({
614
- description: "Build REST API",
615
- agents: ["Backend Architect"],
616
- started: Date.now()
617
- })
618
- }
619
- ```
620
-
621
- #### Post-Edit Hook with Memory Storage
622
-
623
- ```javascript
624
- // Hook command
625
- npx monomind hook post-edit --file "api/auth.js"
626
-
627
- // Internally calls MCP tools:
628
- mcp__monomind__memory_pattern-store {
629
- action: "store",
630
- key: "swarm/edits/api/auth.js",
631
- namespace: "coordination",
632
- value: JSON.stringify({
633
- file: "api/auth.js",
634
- timestamp: Date.now(),
635
- changes: { added: 45, removed: 12 },
636
- formatted: true,
637
- linted: true
638
- })
639
- }
640
- ```
641
-
642
- #### Session End Hook with State Persistence
643
-
644
- ```javascript
645
- // Hook command
646
- npx monomind hook session-end --session-id "dev-2024"
647
-
648
- // Internally calls MCP tools:
649
- // npx monomind session save --session-id "dev-2024"
650
-
651
- mcp__monomind__swarm_status {
652
- swarmId: "current"
653
- }
654
-
655
- // Generates metrics and summary
656
- ```
657
-
658
- ### Memory Coordination Protocol
354
+ ### MCP Tool Equivalents
659
355
 
660
- All hooks follow a standardized memory coordination pattern:
356
+ The core hooks are also exposed as MCP tools, so agents can call them without a shell: `mcp__monomind__hooks_pre-task`, `mcp__monomind__hooks_post-task`, `mcp__monomind__hooks_pre-edit`, `mcp__monomind__hooks_post-edit`, `mcp__monomind__hooks_pre-command`, `mcp__monomind__hooks_post-command`, `mcp__monomind__hooks_route`, `mcp__monomind__hooks_explain`.
661
357
 
662
- #### Three-Phase Memory Protocol
358
+ To share context between agents, store it explicitly in memory:
663
359
 
664
- **Phase 1: STATUS** - Hook starts
665
- ```javascript
666
- mcp__monomind__memory_pattern-store {
667
- action: "store",
668
- key: "swarm/hooks/pre-edit/status",
669
- namespace: "coordination",
670
- value: JSON.stringify({
671
- status: "running",
672
- hook: "pre-edit",
673
- file: "src/auth.js",
674
- timestamp: Date.now()
675
- })
676
- }
677
- ```
678
-
679
- **Phase 2: PROGRESS** - Hook processes
680
- ```javascript
681
- mcp__monomind__memory_pattern-store {
682
- action: "store",
683
- key: "swarm/hooks/pre-edit/progress",
684
- namespace: "coordination",
685
- value: JSON.stringify({
686
- progress: 50,
687
- action: "validating syntax",
688
- file: "src/auth.js"
689
- })
690
- }
691
- ```
692
-
693
- **Phase 3: COMPLETE** - Hook finishes
694
- ```javascript
695
- mcp__monomind__memory_pattern-store {
696
- action: "store",
697
- key: "swarm/hooks/pre-edit/complete",
698
- namespace: "coordination",
699
- value: JSON.stringify({
700
- status: "complete",
701
- result: "success",
702
- agent_assigned: "Backend Architect",
703
- syntax_valid: true,
704
- backup_created: true
705
- })
706
- }
707
- ```
708
-
709
- ### Hook Response Format
710
-
711
- Hooks return JSON responses to control operation flow:
712
-
713
- #### Continue Response
714
- ```json
715
- {
716
- "continue": true,
717
- "reason": "All validations passed",
718
- "metadata": {
719
- "agent_assigned": "Backend Architect",
720
- "syntax_valid": true,
721
- "file": "src/auth.js"
722
- }
723
- }
724
- ```
725
-
726
- #### Block Response
727
- ```json
728
- {
729
- "continue": false,
730
- "reason": "Protected file - manual review required",
731
- "metadata": {
732
- "file": ".env.production",
733
- "protection_level": "high",
734
- "requires": "manual_approval"
735
- }
736
- }
737
- ```
738
-
739
- #### Warning Response
740
- ```json
741
- {
742
- "continue": true,
743
- "reason": "Syntax valid but complexity high",
744
- "warnings": [
745
- "Cyclomatic complexity: 15 (threshold: 10)",
746
- "Consider refactoring for better maintainability"
747
- ],
748
- "metadata": {
749
- "complexity": 15,
750
- "threshold": 10
751
- }
752
- }
360
+ ```bash
361
+ npx monomind memory store --key "swarm/backend/auth-api" --value "JWT, refresh via /auth/refresh" --namespace coordination
362
+ npx monomind memory search --query "auth api" --namespace coordination
753
363
  ```
754
364
 
755
365
  ### Git Integration
756
366
 
757
- Hooks can integrate with Git operations for quality control:
758
-
759
367
  #### Pre-Commit Hook
760
368
  ```bash
761
- # Add to .git/hooks/pre-commit or use husky
762
-
763
369
  #!/bin/bash
764
- # Run quality checks before commit
370
+ # .git/hooks/pre-commit (or via husky)
765
371
 
766
- # Get staged files
767
- FILES=$(git diff --cached --name-only --diff-filter=ACM)
768
-
769
- for FILE in $FILES; do
770
- # Run pre-edit hook for validation
771
- npx monomind hook pre-edit --file "$FILE" --validate-syntax
772
-
773
- if [ $? -ne 0 ]; then
774
- echo "Validation failed for $FILE"
775
- exit 1
776
- fi
777
-
778
- # Run post-edit hook for formatting
779
- npx monomind hook post-edit --file "$FILE" --auto-format
780
- done
372
+ # Risk assessment of the working-tree change against HEAD (informational)
373
+ npx monomind analyze diff --risk --classify
781
374
 
782
375
  # Run tests
783
- npm test
784
-
785
- exit $?
376
+ npm test || exit 1
786
377
  ```
787
378
 
788
379
  #### Post-Commit Hook
789
380
  ```bash
790
- # Add to .git/hooks/post-commit
791
-
792
381
  #!/bin/bash
793
- # Track commit metrics
794
-
795
- COMMIT_HASH=$(git rev-parse HEAD)
796
- COMMIT_MSG=$(git log -1 --pretty=%B)
797
-
798
- npx monomind hook notify \
799
- --message "Commit completed: $COMMIT_MSG" \
800
- --level info \
801
- --swarm-status
382
+ # .git/hooks/post-commit
383
+ COMMIT_MSG=$(git log -1 --pretty=%s)
384
+ npx monomind hooks notify --message "Commit completed: $COMMIT_MSG" --level info
802
385
  ```
803
386
 
804
387
  #### Pre-Push Hook
805
388
  ```bash
806
- # Add to .git/hooks/pre-push
807
-
808
389
  #!/bin/bash
809
- # Quality gate before push
810
-
811
- # Run full test suite
812
- npm run test:all
813
-
814
- # Run quality checks
815
- npx monomind hook session-end \
816
- --generate-report \
817
- --export-metrics
818
-
819
- # Verify quality thresholds
820
- TRUTH_SCORE=$(npx monomind metrics score --format json | jq -r '.truth_score')
821
-
822
- if (( $(echo "$TRUTH_SCORE < 0.95" | bc -l) )); then
823
- echo "Truth score below threshold: $TRUTH_SCORE < 0.95"
824
- exit 1
825
- fi
826
-
827
- exit 0
390
+ # .git/hooks/pre-push
391
+ npm test || exit 1
392
+ npx monomind hooks session-end
828
393
  ```
829
394
 
830
395
  ### Agent Coordination Workflow
831
396
 
832
- How agents use hooks for coordination:
833
-
834
- #### Agent Workflow Example
835
-
836
397
  ```bash
837
398
  # Agent 1: Backend Developer
838
- # STEP 1: Pre-task preparation
839
- npx monomind hook pre-task \
840
- --description "Implement user authentication API" \
841
- --auto-spawn-agents \
842
- --load-memory
843
-
844
- # STEP 2: Work begins - pre-edit validation
845
- npx monomind hook pre-edit \
846
- --file "api/auth.js" \
847
- --auto-assign-agent \
848
- --validate-syntax
849
-
850
- # STEP 3: Edit file (via Claude Code Edit tool)
851
- # ... code changes ...
852
-
853
- # STEP 4: Post-edit processing
854
- npx monomind hook post-edit \
855
- --file "api/auth.js" \
856
- --memory-key "swarm/backend/auth-api" \
857
- --auto-format \
858
- --train-patterns
859
-
860
- # STEP 5: Notify coordination system
861
- npx monomind hook notify \
862
- --message "Auth API implementation complete" \
863
- --swarm-status \
864
- --broadcast
865
-
866
- # STEP 6: Task completion
867
- npx monomind hook post-task \
868
- --task-id "auth-api" \
869
- --analyze-performance \
870
- --store-decisions \
871
- --export-learnings
872
- ```
873
-
874
- ```bash
875
- # Agent 2: Test Engineer (receives notification)
876
- # STEP 1: Check memory for API details
877
- npx monomind hook session-restore \
878
- --session-id "swarm-current" \
879
- --restore-memory
880
-
881
- # Memory contains: swarm/backend/auth-api with implementation details
882
-
883
- # STEP 2: Generate tests
884
- npx monomind hook pre-task \
885
- --description "Write tests for auth API" \
886
- --load-memory
887
-
888
- # STEP 3: Create test file
889
- npx monomind hook post-edit \
890
- --file "api/auth.test.js" \
891
- --memory-key "swarm/testing/auth-api-tests" \
892
- --train-patterns
893
-
894
- # STEP 4: Share test results
895
- npx monomind hook notify \
896
- --message "Auth API tests complete - 100% coverage" \
897
- --broadcast
898
- ```
899
-
900
- ### Custom Hook Creation
901
-
902
- Create custom hooks for specific workflows:
903
-
904
- #### Custom Hook Template
905
-
906
- ```javascript
907
- // .claude/hooks/custom-quality-check.js
908
-
909
- module.exports = {
910
- name: 'custom-quality-check',
911
- type: 'pre',
912
- matcher: /\.(ts|js)$/,
913
-
914
- async execute(context) {
915
- const { file, content } = context;
916
-
917
- // Custom validation logic
918
- const complexity = await analyzeComplexity(content);
919
- const securityIssues = await scanSecurity(content);
920
-
921
- // Store in memory
922
- await storeInMemory({
923
- key: `quality/${file}`,
924
- value: { complexity, securityIssues }
925
- });
926
-
927
- // Return decision
928
- if (complexity > 15 || securityIssues.length > 0) {
929
- return {
930
- continue: false,
931
- reason: 'Quality checks failed',
932
- warnings: [
933
- `Complexity: ${complexity} (max: 15)`,
934
- `Security issues: ${securityIssues.length}`
935
- ]
936
- };
937
- }
938
-
939
- return {
940
- continue: true,
941
- reason: 'Quality checks passed',
942
- metadata: { complexity, securityIssues: 0 }
943
- };
944
- }
945
- };
946
- ```
947
-
948
- #### Register Custom Hook
399
+ npx monomind hooks pre-task --description "Implement user authentication API" --task-id auth-api
400
+ npx monomind hooks pre-edit --file "api/auth.js"
401
+ # ... edit via Claude Code Edit tool ...
402
+ npx monomind hooks post-edit --file "api/auth.js" --success true
403
+ npx monomind memory store --key "swarm/backend/auth-api" --value "endpoints: /login, /refresh" --namespace coordination
404
+ npx monomind hooks post-task --task-id auth-api --success true
949
405
 
950
- ```json
951
- {
952
- "hooks": {
953
- "PreToolUse": [
954
- {
955
- "matcher": "^(Write|Edit)$",
956
- "hooks": [
957
- {
958
- "type": "script",
959
- "script": ".claude/hooks/custom-quality-check.js"
960
- }
961
- ]
962
- }
963
- ]
964
- }
965
- }
406
+ # Agent 2: Test Engineer
407
+ npx monomind memory retrieve --key "swarm/backend/auth-api" --namespace coordination
408
+ npx monomind hooks pre-task --description "Write tests for auth API" --task-id auth-tests
409
+ npx monomind hooks post-edit --file "api/auth.test.js" --success true
410
+ npx monomind hooks post-task --task-id auth-tests --success true
966
411
  ```
967
412
 
968
413
  ### Real-World Examples
969
414
 
970
- #### Example 1: Full-Stack Development Workflow
415
+ #### Example 1: Full-Stack Feature
971
416
 
972
417
  ```bash
973
- # Session start - initialize coordination
974
- npx monomind hook session-start --session-id "fullstack-feature"
975
-
976
- # Pre-task planning
977
- npx monomind hook pre-task \
978
- --description "Build user profile feature - frontend + backend + tests" \
979
- --auto-spawn-agents \
980
- --optimize-topology
418
+ npx monomind hooks session-restore
419
+ npx monomind hooks route --task "Build user profile feature - frontend + backend + tests"
420
+ npx monomind hooks pre-task --description "Build user profile feature" --task-id profile
981
421
 
982
- # Backend work
983
- npx monomind hook pre-edit --file "api/profile.js"
422
+ npx monomind hooks pre-edit --file "api/profile.js"
984
423
  # ... implement backend ...
985
- npx monomind hook post-edit \
986
- --file "api/profile.js" \
987
- --memory-key "profile/backend" \
988
- --train-patterns
424
+ npx monomind hooks post-edit --file "api/profile.js" --success true
989
425
 
990
- # Frontend work (reads backend details from memory)
991
- npx monomind hook pre-edit --file "components/Profile.jsx"
426
+ npx monomind hooks pre-edit --file "components/Profile.jsx"
992
427
  # ... implement frontend ...
993
- npx monomind hook post-edit \
994
- --file "components/Profile.jsx" \
995
- --memory-key "profile/frontend" \
996
- --train-patterns
997
-
998
- # Testing (reads both backend and frontend from memory)
999
- npx monomind hook pre-task \
1000
- --description "Test profile feature" \
1001
- --load-memory
1002
-
1003
- # Session end - export everything
1004
- npx monomind hook session-end \
1005
- --session-id "fullstack-feature" \
1006
- --export-metrics \
1007
- --generate-summary
1008
- ```
1009
-
1010
- #### Example 2: Debugging with Hooks
428
+ npx monomind hooks post-edit --file "components/Profile.jsx" --success true
1011
429
 
1012
- ```bash
1013
- # Start debugging session
1014
- npx monomind hook session-start --session-id "debug-memory-leak"
1015
-
1016
- # Pre-task: analyze issue
1017
- npx monomind hook pre-task \
1018
- --description "Debug memory leak in event handlers" \
1019
- --load-memory \
1020
- --estimate-complexity
1021
-
1022
- # Search for event emitters
1023
- npx monomind hook pre-search --query "EventEmitter"
1024
- # ... search executes ...
1025
- npx monomind hook post-search \
1026
- --query "EventEmitter" \
1027
- --cache-results
1028
-
1029
- # Fix the issue
1030
- npx monomind hook pre-edit \
1031
- --file "services/events.js" \
1032
- --backup-file
1033
- # ... fix code ...
1034
- npx monomind hook post-edit \
1035
- --file "services/events.js" \
1036
- --memory-key "debug/memory-leak-fix" \
1037
- --validate-output
1038
-
1039
- # Verify fix
1040
- npx monomind hook post-task \
1041
- --task-id "memory-leak-fix" \
1042
- --analyze-performance \
1043
- --generate-report
1044
-
1045
- # End session
1046
- npx monomind hook session-end \
1047
- --session-id "debug-memory-leak" \
1048
- --export-metrics
430
+ npx monomind hooks post-task --task-id profile --success true
431
+ npx monomind hooks session-end
1049
432
  ```
1050
433
 
1051
- #### Example 3: Multi-Agent Refactoring
434
+ #### Example 2: Debugging
1052
435
 
1053
436
  ```bash
1054
- # Initialize swarm for refactoring
1055
- npx monomind hook pre-task \
1056
- --description "Refactor legacy codebase to modern patterns" \
1057
- --auto-spawn-agents \
1058
- --optimize-topology
1059
-
1060
- # Agent 1: Code Analyzer
1061
- npx monomind hook pre-task --description "Analyze code complexity"
1062
- # ... analysis ...
1063
- npx monomind hook post-task \
1064
- --task-id "analysis" \
1065
- --store-decisions
1066
-
1067
- # Agent 2: Refactoring (reads analysis from memory)
1068
- npx monomind hook session-restore \
1069
- --session-id "swarm-refactor" \
1070
- --restore-memory
1071
-
1072
- for file in src/**/*.js; do
1073
- npx monomind hook pre-edit --file "$file" --backup-file
1074
- # ... refactor ...
1075
- npx monomind hook post-edit \
1076
- --file "$file" \
1077
- --memory-key "refactor/$file" \
1078
- --auto-format \
1079
- --train-patterns
1080
- done
1081
-
1082
- # Agent 3: Testing (reads refactored code from memory)
1083
- npx monomind hook pre-task \
1084
- --description "Generate tests for refactored code" \
1085
- --load-memory
1086
-
1087
- # Broadcast completion
1088
- npx monomind hook notify \
1089
- --message "Refactoring complete - all tests passing" \
1090
- --broadcast
437
+ npx monomind hooks pre-task --description "Debug memory leak in event handlers" --task-id leak
438
+ npx monomind hooks pre-edit --file "services/events.js" --operation update -c "remove listener leak"
439
+ # ... fix code ...
440
+ npx monomind hooks post-edit --file "services/events.js" --success true -o "listeners removed on dispose"
441
+ npx monomind hooks post-command --command "npm test" --success true
442
+ npx monomind hooks post-task --task-id leak --success true
1091
443
  ```
1092
444
 
1093
- ### Performance Tips
1094
-
1095
- 1. **Keep Hooks Lightweight** - Target < 100ms execution time
1096
- 2. **Use Async for Heavy Operations** - Don't block the main flow
1097
- 3. **Cache Aggressively** - Store frequently accessed data
1098
- 4. **Batch Related Operations** - Combine multiple actions
1099
- 5. **Use Memory Wisely** - Set appropriate TTLs
1100
- 6. **Monitor Hook Performance** - Track execution times
1101
- 7. **Parallelize When Possible** - Run independent hooks concurrently
1102
-
1103
445
  ### Debugging Hooks
1104
446
 
1105
- Enable debug mode for troubleshooting:
1106
-
1107
447
  ```bash
1108
- # Enable debug output
1109
- export MONOMIND_DEBUG=true
1110
-
1111
- # Test specific hook with verbose output
1112
- npx monomind hook pre-edit --file "test.js" --debug
448
+ # Verbose output
449
+ npx monomind hooks pre-edit --file "test.js" --verbose
1113
450
 
1114
- # Check hook execution logs
1115
- cat .monomind/logs/hooks-$(date +%Y-%m-%d).log
451
+ # Registered hooks and learning state
452
+ npx monomind hooks list
453
+ npx monomind hooks metrics
1116
454
 
1117
- # Validate configuration
1118
- npx monomind hook validate-config
455
+ # Overall health, including hook configuration
456
+ npx monomind doctor
1119
457
  ```
1120
458
 
1121
- ### Benefits
1122
-
1123
- - **Automatic Agent Assignment**: Right agent for every file type
1124
- - **Consistent Code Formatting**: Language-specific formatters
1125
- - **Continuous Learning**: Neural patterns improve over time
1126
- - **Cross-Session Memory**: Context persists between sessions
1127
- - **Performance Tracking**: Comprehensive metrics and analytics
1128
- - **Automatic Coordination**: Agents sync via memory
1129
- - **Smart Agent Spawning**: Task-based agent selection
1130
- - **Quality Gates**: Pre-commit validation and verification
1131
- - **Error Prevention**: Syntax validation before edits
1132
- - **Knowledge Sharing**: Decisions stored and shared
1133
- - **Reduced Manual Work**: Automation of repetitive tasks
1134
- - **Better Collaboration**: Seamless multi-agent coordination
459
+ `MONOMIND_HOOK_QUIET=1` (set in `.claude/settings.json` `env`) silences hook output in Claude Code.
1135
460
 
1136
461
  ### Best Practices
1137
462
 
1138
- 1. **Configure Hooks Early** - Set up during project initialization
1139
- 2. **Use Memory Keys Strategically** - Organize with clear namespaces
1140
- 3. **Enable Auto-Formatting** - Maintain code consistency
1141
- 4. **Train Patterns Continuously** - Learn from successful operations
1142
- 5. **Monitor Performance** - Track hook execution times
1143
- 6. **Validate Configuration** - Test hooks before production use
1144
- 7. **Document Custom Hooks** - Maintain hook documentation
1145
- 8. **Set Appropriate Timeouts** - Prevent hanging operations
1146
- 9. **Handle Errors Gracefully** - Use continueOnError when appropriate
1147
- 10. **Review Metrics Regularly** - Optimize based on usage patterns
463
+ 1. **Initialize early** - run `monomind init hooks` when setting up a project
464
+ 2. **Keep hooks lightweight** - prefer the helper over `npx` in hot paths; set `timeout`
465
+ 3. **Record outcomes** - `post-edit`, `post-command`, and `post-task` feed routing
466
+ 4. **Join routes to outcomes** - pass `--route-id` from `hooks route` to `hooks post-task`
467
+ 5. **Use clear memory namespaces** - e.g. `coordination`, `swarm/<role>/<topic>`
468
+ 6. **Review metrics** - `hooks metrics` and `hooks model-stats`
1148
469
 
1149
470
  ### Troubleshooting
1150
471
 
1151
472
  #### Hooks Not Executing
1152
- - Verify `.claude/settings.json` syntax
1153
- - Check hook matcher patterns
1154
- - Enable debug mode
1155
- - Review permission settings
1156
- - Ensure monomind CLI is in PATH
473
+ - Verify `.claude/settings.json` syntax and matcher patterns
474
+ - Check that `.claude/helpers/hook-handler.cjs` exists (`monomind init hooks` / `monomind init upgrade`)
475
+ - Ensure `monomind` is resolvable via `npx`
476
+ - Run `npx monomind doctor`
1157
477
 
1158
478
  #### Hook Timeouts
1159
- - Increase timeout values in configuration
1160
- - Make hooks asynchronous for heavy operations
1161
- - Optimize hook logic
1162
- - Check network connectivity for MCP tools
1163
-
1164
- #### Memory Issues
1165
- - Set appropriate TTLs for memory keys
1166
- - Clean up old memory entries
1167
- - Use memory namespaces effectively
1168
- - Monitor memory usage
1169
-
1170
- #### Performance Problems
1171
- - Profile hook execution times
1172
- - Use caching for repeated operations
1173
- - Batch operations when possible
1174
- - Reduce hook complexity
479
+ - Increase `timeout` for the hook entry
480
+ - Use the helper instead of `npx` for frequent events
1175
481
 
1176
482
  ### Related Commands
1177
483
 
1178
- - `npx monomind init --hooks` - Initialize hooks system
1179
- - `npx monomind hook --list` - List available hooks
1180
- - `npx monomind hook --test <hook>` - Test specific hook
1181
- - `npx monomind memory usage` - Manage memory
1182
- - `npx monomind agent spawn` - Spawn agents
1183
- - `npx monomind swarm init` - Initialize swarm
484
+ - `npx monomind init hooks` - Initialize hooks configuration
485
+ - `npx monomind hooks list` - List registered hooks
486
+ - `npx monomind hooks <sub> --help` - Flags for a specific hook
487
+ - `npx monomind memory store|search|retrieve` - Shared memory
488
+ - `npx monomind session save|list|restore` - Session checkpoints
489
+ - `npx monomind agent spawn -t <type>` - Spawn agents
490
+ - `npx monomind monoswarm init` - Initialize a monoswarm
1184
491
 
1185
492
  ### Integration with Other Skills
1186
493
 
1187
- This skill works seamlessly with:
1188
- - **Pair Programming** - Automated quality in pairing sessions
1189
- - **Verification Quality** - Truth-score validation in hooks
1190
- - **GitHub Workflows** - Git integration for commits/PRs
1191
- - **Performance Analysis** - Metrics collection in hooks
1192
- - **Swarm Advanced** - Multi-agent coordination via hooks
494
+ - **Pair Programming** - record outcomes during pairing sessions
495
+ - **Verification Quality** - quality gates alongside hooks
496
+ - **GitHub Toolkit** - Git and PR workflows
497
+ - **Performance Analysis** - metrics collection