@monoes/monomindcli 2.16.4 → 2.16.5

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 (412) 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/doctor-pick-checks.d.ts +20 -3
  287. package/dist/src/commands/doctor-pick-checks.d.ts.map +1 -1
  288. package/dist/src/commands/doctor-pick-checks.js +132 -7
  289. package/dist/src/commands/doctor-pick-checks.js.map +1 -1
  290. package/dist/src/commands/doctor-project-checks.d.ts +2 -2
  291. package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
  292. package/dist/src/commands/doctor-project-checks.js +14 -12
  293. package/dist/src/commands/doctor-project-checks.js.map +1 -1
  294. package/dist/src/commands/doctor.d.ts.map +1 -1
  295. package/dist/src/commands/doctor.js +6 -4
  296. package/dist/src/commands/doctor.js.map +1 -1
  297. package/dist/src/commands/init-upgrade.d.ts.map +1 -1
  298. package/dist/src/commands/init-upgrade.js +6 -0
  299. package/dist/src/commands/init-upgrade.js.map +1 -1
  300. package/dist/src/commands/init.d.ts.map +1 -1
  301. package/dist/src/commands/init.js +11 -0
  302. package/dist/src/commands/init.js.map +1 -1
  303. package/dist/src/commands/pick.d.ts.map +1 -1
  304. package/dist/src/commands/pick.js +4 -3
  305. package/dist/src/commands/pick.js.map +1 -1
  306. package/dist/src/decision/jev.d.ts +16 -0
  307. package/dist/src/decision/jev.d.ts.map +1 -1
  308. package/dist/src/decision/jev.js +12 -0
  309. package/dist/src/decision/jev.js.map +1 -1
  310. package/dist/src/decision/pick-eval.d.ts +23 -0
  311. package/dist/src/decision/pick-eval.d.ts.map +1 -1
  312. package/dist/src/decision/pick-eval.js +24 -1
  313. package/dist/src/decision/pick-eval.js.map +1 -1
  314. package/dist/src/decision/picks.d.ts +5 -0
  315. package/dist/src/decision/picks.d.ts.map +1 -1
  316. package/dist/src/decision/picks.js +33 -11
  317. package/dist/src/decision/picks.js.map +1 -1
  318. package/dist/src/init/claudemd-generator.d.ts.map +1 -1
  319. package/dist/src/init/claudemd-generator.js +1 -0
  320. package/dist/src/init/claudemd-generator.js.map +1 -1
  321. package/dist/src/init/copy-assets.d.ts.map +1 -1
  322. package/dist/src/init/copy-assets.js +17 -9
  323. package/dist/src/init/copy-assets.js.map +1 -1
  324. package/dist/src/init/executor.d.ts.map +1 -1
  325. package/dist/src/init/executor.js +26 -4
  326. package/dist/src/init/executor.js.map +1 -1
  327. package/dist/src/init/file-guard.d.ts +93 -0
  328. package/dist/src/init/file-guard.d.ts.map +1 -0
  329. package/dist/src/init/file-guard.js +239 -0
  330. package/dist/src/init/file-guard.js.map +1 -0
  331. package/dist/src/init/helpers-generator.d.ts +7 -0
  332. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  333. package/dist/src/init/helpers-generator.js +9 -0
  334. package/dist/src/init/helpers-generator.js.map +1 -1
  335. package/dist/src/init/init-memory.d.ts +10 -0
  336. package/dist/src/init/init-memory.d.ts.map +1 -1
  337. package/dist/src/init/init-memory.js +44 -1
  338. package/dist/src/init/init-memory.js.map +1 -1
  339. package/dist/src/init/managed-block.d.ts +3 -1
  340. package/dist/src/init/managed-block.d.ts.map +1 -1
  341. package/dist/src/init/managed-block.js +9 -2
  342. package/dist/src/init/managed-block.js.map +1 -1
  343. package/dist/src/init/mcp-generator.d.ts +9 -0
  344. package/dist/src/init/mcp-generator.d.ts.map +1 -1
  345. package/dist/src/init/mcp-generator.js +28 -0
  346. package/dist/src/init/mcp-generator.js.map +1 -1
  347. package/dist/src/init/runtime-config-merge.d.ts +21 -0
  348. package/dist/src/init/runtime-config-merge.d.ts.map +1 -0
  349. package/dist/src/init/runtime-config-merge.js +88 -0
  350. package/dist/src/init/runtime-config-merge.js.map +1 -0
  351. package/dist/src/init/settings-generator.js +1 -1
  352. package/dist/src/init/settings-generator.js.map +1 -1
  353. package/dist/src/init/shared-instructions-generator.d.ts +3 -1
  354. package/dist/src/init/shared-instructions-generator.d.ts.map +1 -1
  355. package/dist/src/init/shared-instructions-generator.js +14 -39
  356. package/dist/src/init/shared-instructions-generator.js.map +1 -1
  357. package/dist/src/init/shared.d.ts +10 -0
  358. package/dist/src/init/shared.d.ts.map +1 -1
  359. package/dist/src/init/shared.js +32 -1
  360. package/dist/src/init/shared.js.map +1 -1
  361. package/dist/src/init/types.d.ts +9 -0
  362. package/dist/src/init/types.d.ts.map +1 -1
  363. package/dist/src/init/types.js.map +1 -1
  364. package/dist/src/init/upgrade.d.ts +4 -0
  365. package/dist/src/init/upgrade.d.ts.map +1 -1
  366. package/dist/src/init/upgrade.js +39 -42
  367. package/dist/src/init/upgrade.js.map +1 -1
  368. package/dist/src/init/write-antigravity.d.ts.map +1 -1
  369. package/dist/src/init/write-antigravity.js +9 -3
  370. package/dist/src/init/write-antigravity.js.map +1 -1
  371. package/dist/src/init/write-claude.d.ts.map +1 -1
  372. package/dist/src/init/write-claude.js +40 -19
  373. package/dist/src/init/write-claude.js.map +1 -1
  374. package/dist/src/init/write-kimicode.d.ts +27 -0
  375. package/dist/src/init/write-kimicode.d.ts.map +1 -1
  376. package/dist/src/init/write-kimicode.js +119 -92
  377. package/dist/src/init/write-kimicode.js.map +1 -1
  378. package/dist/src/init/write-opencode.d.ts.map +1 -1
  379. package/dist/src/init/write-opencode.js +45 -6
  380. package/dist/src/init/write-opencode.js.map +1 -1
  381. package/dist/src/init/write-runtime-config.d.ts.map +1 -1
  382. package/dist/src/init/write-runtime-config.js +108 -81
  383. package/dist/src/init/write-runtime-config.js.map +1 -1
  384. package/dist/src/knowledge/eval/golden-set.js +0 -15
  385. package/dist/src/knowledge/eval/golden-set.js.map +1 -1
  386. package/dist/src/mcp-tools/org-skill-tools.d.ts.map +1 -1
  387. package/dist/src/mcp-tools/org-skill-tools.js +6 -2
  388. package/dist/src/mcp-tools/org-skill-tools.js.map +1 -1
  389. package/dist/src/mcp-tools/pick-tools.d.ts.map +1 -1
  390. package/dist/src/mcp-tools/pick-tools.js +13 -4
  391. package/dist/src/mcp-tools/pick-tools.js.map +1 -1
  392. package/dist/src/platform-adapters/merge.d.ts +4 -3
  393. package/dist/src/platform-adapters/merge.d.ts.map +1 -1
  394. package/dist/src/platform-adapters/merge.js +18 -8
  395. package/dist/src/platform-adapters/merge.js.map +1 -1
  396. package/dist/src/platform-adapters/mutation.d.ts +6 -1
  397. package/dist/src/platform-adapters/mutation.d.ts.map +1 -1
  398. package/dist/src/platform-adapters/mutation.js +9 -3
  399. package/dist/src/platform-adapters/mutation.js.map +1 -1
  400. package/dist/src/platform-adapters/operations.d.ts.map +1 -1
  401. package/dist/src/platform-adapters/operations.js +14 -6
  402. package/dist/src/platform-adapters/operations.js.map +1 -1
  403. package/dist/src/platform-adapters/types.d.ts +5 -0
  404. package/dist/src/platform-adapters/types.d.ts.map +1 -1
  405. package/dist/src/routing/agent-pick.d.ts +9 -7
  406. package/dist/src/routing/agent-pick.d.ts.map +1 -1
  407. package/dist/src/routing/agent-pick.js +17 -17
  408. package/dist/src/routing/agent-pick.js.map +1 -1
  409. package/dist/tsconfig.tsbuildinfo +1 -1
  410. package/package.json +6 -6
  411. package/.claude/skills/github-issue-triage/SKILL.md +0 -354
  412. package/.claude/skills/github-repo-recap/SKILL.md +0 -207
@@ -38,7 +38,10 @@ var NONE_ID = '__none__';
38
38
  var OFF_VALUES = ['0', 'off', 'false', 'no'];
39
39
  var ON_VALUES = ['1', 'on', 'true', 'yes'];
40
40
  var DEFAULT_HOOK_TIMEOUT_MS = 1500;
41
- var MAX_HOOK_TIMEOUT_MS = 10000;
41
+ // Every prompt waits on the hook window, so a larger value is capped here
42
+ // whatever MONOMIND_JEV_HOOK_TIMEOUT_MS asks: a dead endpoint once held each
43
+ // prompt 10 s. Hosted Jev answers well inside it.
44
+ var MAX_HOOK_TIMEOUT_MS = 3000;
42
45
 
43
46
  class JevError extends Error {
44
47
  constructor(message, provider, status) {
@@ -83,10 +86,11 @@ function resolveTimeoutMs(env) {
83
86
  return Number.isInteger(n) && n >= MIN_TIMEOUT_MS && n <= MAX_TIMEOUT_MS ? n : DEFAULT_TIMEOUT_MS;
84
87
  }
85
88
 
86
- /** The per-prompt hook's window: short, because every prompt waits on it. */
89
+ /** The per-prompt hook's window: short, because every prompt waits on it.
90
+ * Values above MAX_HOOK_TIMEOUT_MS are capped to it. */
87
91
  function resolveHookTimeoutMs(env) {
88
92
  var n = Number((env || process.env).MONOMIND_JEV_HOOK_TIMEOUT_MS);
89
- return Number.isInteger(n) && n >= MIN_TIMEOUT_MS && n <= MAX_HOOK_TIMEOUT_MS ? n : DEFAULT_HOOK_TIMEOUT_MS;
93
+ return Number.isInteger(n) && n >= MIN_TIMEOUT_MS ? Math.min(n, MAX_HOOK_TIMEOUT_MS) : DEFAULT_HOOK_TIMEOUT_MS;
90
94
  }
91
95
 
92
96
  function resolveMinConfidence(env) {
@@ -282,6 +286,39 @@ function toAnswer(answer, criteria) {
282
286
  return { choice: answer.choice, confidence: answer.confidence, ranked: rankedFrom(answer, criteria) };
283
287
  }
284
288
 
289
+ /** The options sent for one question: the keyword-ranked items that share a
290
+ * word with the task (forced `include` ids first), then the rest round-robin
291
+ * across categories (an agent's category, else an id's first segment) — so
292
+ * a task that matches few or no words (a non-English prompt) is not judged
293
+ * over the first `max` entries of one category. */
294
+ function candidatesFor(text, items, max, include) {
295
+ var forced = new Set(include || []);
296
+ var out = shortlist(text, items, max, include).filter(function (item) {
297
+ return item.score > 0 || forced.has(item.id);
298
+ });
299
+ if (out.length >= max) return out;
300
+ var taken = new Set(out.map(function (item) { return item.id; }));
301
+ var groups = new Map();
302
+ items.forEach(function (item) {
303
+ if (taken.has(item.id)) return;
304
+ var key = item.category || String(item.id).toLowerCase().split(/[-:_/]/)[0];
305
+ if (!groups.has(key)) groups.set(key, []);
306
+ groups.get(key).push(item);
307
+ });
308
+ var lists = Array.from(groups.values());
309
+ for (var round = 0; out.length < max; round++) {
310
+ var added = false;
311
+ for (var g = 0; g < lists.length && out.length < max; g++) {
312
+ if (round < lists[g].length) {
313
+ out.push(lists[g][round]);
314
+ added = true;
315
+ }
316
+ }
317
+ if (!added) break;
318
+ }
319
+ return out;
320
+ }
321
+
285
322
  /** Pick an agent and/or a skill for `task` in ONE request. null = no decision. */
286
323
  async function pick(task, catalogs, opts) {
287
324
  opts = opts || {};
@@ -296,14 +333,16 @@ async function pick(task, catalogs, opts) {
296
333
  var skills = catalogs && Array.isArray(catalogs.skills) ? catalogs.skills : [];
297
334
  var questions = {};
298
335
  if (agents.length >= 2) {
336
+ var agentCriteria = criteriaFor(candidatesFor(text, agents, max, include.agents));
337
+ agentCriteria[NONE_ID] = 'None of these agents fits the task';
299
338
  questions.agent = {
300
339
  type: 'choice',
301
340
  instructions: opts.agentInstructions || 'Which specialist agent should handle this task?',
302
- criteria: criteriaFor(shortlist(text, agents, max, include.agents)),
341
+ criteria: agentCriteria,
303
342
  };
304
343
  }
305
344
  if (skills.length >= 1) {
306
- var skillCriteria = criteriaFor(shortlist(text, skills, max, include.skills));
345
+ var skillCriteria = criteriaFor(candidatesFor(text, skills, max, include.skills));
307
346
  skillCriteria[NONE_ID] = 'None of these skills fits the task';
308
347
  questions.skill = {
309
348
  type: 'choice',
@@ -326,9 +365,10 @@ async function pick(task, catalogs, opts) {
326
365
  return out;
327
366
  }
328
367
 
329
- /** `minConfidence` overrides the automatic-decision floor for this call. */
368
+ /** `minConfidence` overrides the automatic-decision floor for this call.
369
+ * "None fits" is never an agent. */
330
370
  function acceptAgent(answer, env, minConfidence) {
331
- if (!answer) return null;
371
+ if (!answer || answer.choice === NONE_ID) return null;
332
372
  return answer.confidence >= floorFor(env, minConfidence) ? answer.choice : null;
333
373
  }
334
374
 
@@ -382,6 +422,8 @@ module.exports = {
382
422
  probe: probe,
383
423
  shortlist: shortlist,
384
424
  withoutExclusions: pickRank.withoutExclusions,
425
+ KEYWORD_GATE: pickRank.KEYWORD_GATE,
426
+ leads: pickRank.leads,
385
427
  pick: pick,
386
428
  acceptAgent: acceptAgent,
387
429
  acceptSkills: acceptSkills,
@@ -14,7 +14,7 @@
14
14
  * `pick: low` frontmatter) keeps LOW_PICK_FACTOR of its score, so it surfaces
15
15
  * only when the task names it. Equal scores keep catalog order.
16
16
  *
17
- * Exclusions (English only, query side only): words the task explicitly
17
+ * Exclusions in the task (English only): words the task explicitly
18
18
  * rules out do not count ("anything pending rather than release" must not
19
19
  * pick release-manager). withoutExclusions() drops each cue and the words in
20
20
  * its scope before tokenizing. Cues: "rather than", "other than", "instead
@@ -25,6 +25,14 @@
25
25
  * staging"), or after SCOPE_WORDS content words. Problem descriptions are not
26
26
  * exclusions: "not"/"no" after a copula or auxiliary ("is not loading",
27
27
  * "are no tests", "does not"), "not only", and "don't know/see/get/..." stay.
28
+ *
29
+ * Exclusions on the document side (English only): a description's own
30
+ * "not for X" / "never for X" / "do not use for X" clause names work the item
31
+ * is NOT for. Its words leave the item's index unless the rest of the
32
+ * description uses them too, so "Not for pull requests" no longer matches
33
+ * "pull request". A task that names what a "not for" clause rules out (more
34
+ * than half the words of one of its alternatives, at least one of them a word
35
+ * the item does not otherwise carry) keeps EXCLUDED_FACTOR of its score.
28
36
  */
29
37
 
30
38
  var K1 = 1.2;
@@ -35,6 +43,8 @@ var STRONG_WEIGHT = 2;
35
43
  var PREFIX_MIN_SHARED = 3;
36
44
  // Share of its score a `pick: 'low'` item keeps.
37
45
  var LOW_PICK_FACTOR = 0.35;
46
+ // Share of its score an item keeps when the task names what it is not for.
47
+ var EXCLUDED_FACTOR = 0.2;
38
48
 
39
49
  var STOPWORDS = new Set(
40
50
  (
@@ -195,6 +205,39 @@ function queryTokens(text) {
195
205
  return tokens(withoutExclusions(text));
196
206
  }
197
207
 
208
+ // A description clause: sentence punctuation, brackets or dashes end it.
209
+ var DOC_CLAUSE_SPLIT = /[.;:!?()[\]{}<>|\n\r\u2013\u2014]+|\s-+\s/;
210
+ var DOC_NOT_FOR = /\b(?:not|never)\s+(?:intended\s+|meant\s+)?for\s+(.+)$|\b(?:do\s+not|don't|dont|never)\s+use\s+(?:it\s+|this\s+)?for\s+(.+)$/;
211
+ var DOC_ALTERNATIVES = /,|\s(?:or|and|nor)\s/;
212
+
213
+ /** A description's own exclusions (see the file header): `kept` is the text
214
+ * without its "not for" clauses, `ruledOut` the word lists of each
215
+ * alternative a "not for" clause names, `dropped` every word those clauses
216
+ * hold. */
217
+ function docExclusions(description) {
218
+ var kept = [];
219
+ var ruledOut = [];
220
+ var dropped = [];
221
+ String(description || '')
222
+ .toLowerCase()
223
+ .replace(/\u2019/g, "'")
224
+ .split(DOC_CLAUSE_SPLIT)
225
+ .forEach(function (clause) {
226
+ var m = DOC_NOT_FOR.exec(clause);
227
+ if (m) {
228
+ kept.push(clause.slice(0, m.index));
229
+ (m[1] || m[2]).split(DOC_ALTERNATIVES).forEach(function (alt) {
230
+ var t = tokens(alt);
231
+ if (t.length) ruledOut.push(t);
232
+ });
233
+ dropped.push(m[1] || m[2]);
234
+ return;
235
+ }
236
+ kept.push(clause);
237
+ });
238
+ return { kept: kept.join(' . '), ruledOut: ruledOut, dropped: new Set(tokens(dropped.join(' '))) };
239
+ }
240
+
198
241
  /** Leading id segments ("engineering-", "mastermind:", "analysis:") that are
199
242
  * shared by >= PREFIX_MIN_SHARED ids or equal the item's category. */
200
243
  function categoryPrefixes(items) {
@@ -234,13 +277,26 @@ function indexFor(items) {
234
277
  var total = 0;
235
278
  var docs = items.map(function (item) {
236
279
  var strong = strongTerms(item, isPrefix);
237
- var weakList = tokens((item.description || '') + ' ' + (item.text || ''));
280
+ var ex = docExclusions(item.description);
281
+ var keptList = tokens(ex.kept);
282
+ var own = new Set(keptList);
283
+ // `text` repeats description words (derived keywords): a word only an
284
+ // exclusion clause holds leaves it too.
285
+ var weakList = keptList.concat(tokens(item.text || '').filter(function (t) {
286
+ return own.has(t) || !ex.dropped.has(t);
287
+ }));
238
288
  var weak = termCounts(weakList);
239
289
  new Set(Array.from(strong).concat(Array.from(weak.keys()))).forEach(function (t) {
240
290
  df.set(t, (df.get(t) || 0) + 1);
241
291
  });
242
292
  total += weakList.length;
243
- return { strong: strong, weak: weak, len: weakList.length, low: item.pick === 'low' };
293
+ // Each "not for" alternative, with the words it names beyond the item's own.
294
+ var ruledOut = ex.ruledOut
295
+ .map(function (alt) {
296
+ return { all: alt, own: alt.filter(function (t) { return strong.has(t) || weak.has(t); }) };
297
+ })
298
+ .filter(function (alt) { return alt.own.length < alt.all.length; });
299
+ return { strong: strong, weak: weak, len: weakList.length, low: item.pick === 'low', ruledOut: ruledOut };
244
300
  });
245
301
  return { size: items.length, docs: docs, df: df, avg: total / items.length || 1 };
246
302
  }
@@ -250,6 +306,16 @@ function idf(index, term) {
250
306
  return Math.log(1 + (index.size - n + 0.5) / (n + 0.5));
251
307
  }
252
308
 
309
+ /** True when the task names more than half of the words of one of the
310
+ * item's "not for" alternatives, one of them a word the item does not
311
+ * otherwise carry. */
312
+ function namesRuledOut(doc, query) {
313
+ return doc.ruledOut.some(function (alt) {
314
+ var hits = alt.all.filter(function (t) { return query.indexOf(t) !== -1; });
315
+ return hits.length * 2 > alt.all.length && hits.some(function (t) { return alt.own.indexOf(t) === -1; });
316
+ });
317
+ }
318
+
253
319
  function scoreDoc(index, doc, query) {
254
320
  var score = 0;
255
321
  var matched = 0;
@@ -266,6 +332,7 @@ function scoreDoc(index, doc, query) {
266
332
  // Coordination: an item matching more of the task's words ranks higher.
267
333
  if (query.length) score *= matched / query.length;
268
334
  if (doc.low) score *= LOW_PICK_FACTOR;
335
+ if (namesRuledOut(doc, query)) score *= EXCLUDED_FACTOR;
269
336
  return Math.round(score * 1000) / 1000;
270
337
  }
271
338
 
@@ -298,10 +365,35 @@ function shortlist(query, items, limit, include) {
298
365
  return out;
299
366
  }
300
367
 
368
+ // The bar a keyword pick must clear before anything acts on it (the prompt
369
+ // hook's [PICK] line, `pick`'s summary and `confident` flag): a minimum
370
+ // relevance AND a lead over the runner-up. Ties and weak overlap are no
371
+ // decision — a wrong pick in Claude's context costs more than none. Agents
372
+ // were tuned on the 40-task pick benchmark (25/40 shown, 23 correct), skills
373
+ // on tests/pick-eval (59 tasks, 514 skills: 34 shown, 31 correct).
374
+ var KEYWORD_GATE = {
375
+ agents: { min: 2, lead: 1.5 },
376
+ skills: { min: 3, lead: 1.25 },
377
+ };
378
+
379
+ /** The top of a ranked list when it clears `min` and leads the runner-up by
380
+ * `ratio`, else null. The floor is on keyword relevance alone (`baseScore`
381
+ * when an outcome prior re-ranked). */
382
+ function leads(list, min, ratio) {
383
+ var top = list && list[0];
384
+ if (!top || !((top.baseScore !== undefined ? top.baseScore : top.score) >= min)) return null;
385
+ var second = list[1];
386
+ if (!second || !(second.score > 0)) return top;
387
+ return top.score >= second.score * (ratio || 1) && top.score > second.score ? top : null;
388
+ }
389
+
301
390
  module.exports = {
391
+ KEYWORD_GATE: KEYWORD_GATE,
392
+ leads: leads,
302
393
  stem: stem,
303
394
  tokens: tokens,
304
395
  queryTokens: queryTokens,
305
396
  withoutExclusions: withoutExclusions,
397
+ docExclusions: docExclusions,
306
398
  shortlist: shortlist,
307
399
  };
@@ -17,6 +17,13 @@
17
17
  * watermark beyond the ones already counted there. Nothing here
18
18
  * throws to a hook: update() returns null on any failure.
19
19
  *
20
+ * Adherence is a route's, not a spawn's: a route counts as followed once, at
21
+ * its first spawn of the picked agent (an override counted for an earlier
22
+ * spawn of that route is taken back), and as overridden once otherwise.
23
+ * Slash-command routes are not picks. When .monomind/registry.json is
24
+ * readable only its agents are tracked (other subagent_types, e.g. "issue-337",
25
+ * never enter the stats, and stored ones are dropped).
26
+ *
20
27
  * The prior: an agent with >= MIN_OBS observations gets a factor in
21
28
  * [1 - SPAN, 1 + SPAN] from Beta(1,1)-smoothed success and adoption rates. It
22
29
  * multiplies a keyword score, so a zero-overlap item stays at zero, and the
@@ -41,6 +48,10 @@ var MAX_ENTRIES = 300;
41
48
  var MAX_EDGE_KEYS = 50;
42
49
  var MIN_OBS = 5;
43
50
  var SPAN = 0.15;
51
+ // Routes whose adherence is remembered (followed / overridden / a command).
52
+ var MAX_ROUTE_STATES = 500;
53
+ // A prompt that is a slash command (the route hook's rule): not a pick.
54
+ var COMMAND_PROMPT = /^\/[a-z0-9_-]+(:[a-z0-9_-]+)*(\s|$)/i;
44
55
 
45
56
  function emptyStats() {
46
57
  return {
@@ -61,6 +72,7 @@ function emptyStats() {
61
72
  },
62
73
  agents: {},
63
74
  skills: {},
75
+ routeStates: {},
64
76
  };
65
77
  }
66
78
 
@@ -109,6 +121,17 @@ function load(root) {
109
121
  if (isObject(s.skills[k])) out.skills[k] = { recommended: count(s.skills[k].recommended) };
110
122
  });
111
123
  }
124
+ if (isObject(s.routeStates)) {
125
+ Object.keys(s.routeStates).slice(-MAX_ROUTE_STATES).forEach(function (k) {
126
+ var r = s.routeStates[k];
127
+ if (!isObject(r)) return;
128
+ var st = {};
129
+ if (r.c === 1) st.c = 1;
130
+ if (r.f === 1) st.f = 1;
131
+ if (typeof r.o === 'string') st.o = r.o.slice(0, 128);
132
+ out.routeStates[String(k).slice(0, 128)] = st;
133
+ });
134
+ }
112
135
  return out;
113
136
  } catch (e) {
114
137
  return emptyStats();
@@ -230,9 +253,30 @@ function readNew(file, cursor) {
230
253
 
231
254
  // ── Aggregation ─────────────────────────────────────────────────────────────
232
255
 
256
+ /** normName()s of every agent name and slug in .monomind/registry.json, or
257
+ * null when it cannot be read (then nothing is filtered). */
258
+ function registryNames(root) {
259
+ try {
260
+ var file = path.join(root, '.monomind', 'registry.json');
261
+ if (fs.statSync(file).size > 5 * 1024 * 1024) return null;
262
+ var reg = JSON.parse(fs.readFileSync(file, 'utf-8'));
263
+ if (!reg || !Array.isArray(reg.agents)) return null;
264
+ var names = new Set();
265
+ reg.agents.forEach(function (a) {
266
+ if (!a) return;
267
+ if (typeof a.name === 'string') names.add(normName(a.name));
268
+ if (typeof a.slug === 'string') names.add(normName(a.slug));
269
+ });
270
+ return names;
271
+ } catch (e) {
272
+ return null;
273
+ }
274
+ }
275
+
233
276
  function agentEntry(stats, name) {
234
277
  var key = normName(name);
235
278
  if (!key) return null;
279
+ if (stats._known && !stats._known.has(key)) return null;
236
280
  if (!stats.agents[key]) {
237
281
  stats.agents[key] = { name: String(name).slice(0, 128), recommended: 0, followed: 0, overridden: 0, chosen: 0, success: 0, failure: 0 };
238
282
  }
@@ -246,7 +290,26 @@ function skillEntry(stats, invoke) {
246
290
  return stats.skills[key];
247
291
  }
248
292
 
293
+ /** This route's remembered adherence (created on demand; oldest dropped). */
294
+ function routeState(stats, routeId) {
295
+ var id = String(routeId).slice(0, 128);
296
+ var st = stats.routeStates[id];
297
+ if (st) return st;
298
+ st = stats.routeStates[id] = {};
299
+ var ids = Object.keys(stats.routeStates);
300
+ for (var i = 0; i < ids.length - MAX_ROUTE_STATES; i++) delete stats.routeStates[ids[i]];
301
+ return st;
302
+ }
303
+
304
+ function dec(obj, key) {
305
+ if (obj && obj[key] > 0) obj[key]--;
306
+ }
307
+
249
308
  function addRoute(stats, rec) {
309
+ if (COMMAND_PROMPT.test(String(rec.promptPreview || rec.task || '').trim())) {
310
+ if (rec.routeId) routeState(stats, rec.routeId).c = 1;
311
+ return;
312
+ }
250
313
  stats.totals.routes++;
251
314
  if (!rec.shown) return;
252
315
  stats.totals.shown++;
@@ -258,16 +321,30 @@ function addRoute(stats, rec) {
258
321
 
259
322
  function addAdherence(stats, rec) {
260
323
  stats.totals.spawns++;
261
- if (!rec.recommended) { stats.totals.unpicked++; return; }
324
+ var st = rec.routeId ? routeState(stats, rec.routeId) : null;
325
+ if (!rec.recommended || (st && st.c)) { stats.totals.unpicked++; return; }
262
326
  var rec1 = agentEntry(stats, rec.recommended);
263
327
  if (rec.followed === true) {
328
+ if (st && st.f) return;
329
+ if (st && st.o !== undefined) {
330
+ // An earlier spawn of this route was counted as an override: the
331
+ // route was followed after all.
332
+ dec(stats.totals, 'overridden');
333
+ dec(rec1, 'overridden');
334
+ if (st.o) dec(stats.agents[st.o], 'chosen');
335
+ delete st.o;
336
+ }
264
337
  stats.totals.followed++;
265
338
  if (rec1) rec1.followed++;
339
+ if (st) st.f = 1;
266
340
  } else if (rec.followed === false) {
341
+ if (st && (st.f || st.o !== undefined)) return;
267
342
  stats.totals.overridden++;
268
343
  if (rec1) rec1.overridden++;
269
344
  var actual = rec.actual ? agentEntry(stats, rec.actual) : null;
270
- if (actual && actual !== rec1) actual.chosen++;
345
+ var chosen = actual && actual !== rec1;
346
+ if (chosen) actual.chosen++;
347
+ if (st) st.o = chosen ? normName(rec.actual) : '';
271
348
  }
272
349
  }
273
350
 
@@ -303,6 +380,13 @@ function update(root, opts) {
303
380
  var persist = !opts || opts.persist !== false;
304
381
  var stats = load(root);
305
382
  var dir = path.join(root, '.monomind');
383
+ var known = registryNames(root);
384
+ Object.defineProperty(stats, '_known', { value: known, enumerable: false });
385
+ if (known) {
386
+ Object.keys(stats.agents).forEach(function (k) {
387
+ if (!known.has(k)) delete stats.agents[k];
388
+ });
389
+ }
306
390
  var adders = { routes: addRoute, adherence: addAdherence, feedback: addFeedback };
307
391
  Object.keys(SOURCES).forEach(function (src) {
308
392
  var got = readNew(path.join(dir, SOURCES[src]), stats.cursors[src]);
@@ -165,7 +165,7 @@ const key = crypto.randomBytes(32).toString('base64');
165
165
  jj.enableEncryption(key);
166
166
  ```
167
167
 
168
- ### 6. Operation Tracking with LanceDB
168
+ ### 6. Operation Tracking
169
169
 
170
170
  Automatic tracking of all operations:
171
171
 
@@ -396,7 +396,7 @@ for (let i = 1; i <= 10; i++) {
396
396
  | `queryTrajectories(task, limit)` | Find similar trajectories | JSON: Trajectory[] |
397
397
  | `resetLearning()` | Clear learned data | void |
398
398
 
399
- ### LanceDB Methods
399
+ ### Operation Log Methods
400
400
 
401
401
  | Method | Description | Returns |
402
402
  |--------|-------------|---------|
@@ -630,7 +630,6 @@ async function agentSwarm(taskList) {
630
630
  - **GitHub**: https://github.com/monoes/monomind
631
631
  - **Full README**: See package README.md
632
632
  - **Validation Guide**: docs/VALIDATION_FIXES_v2.3.1.md
633
- - **LanceDB Guide**: docs/LANCEDB_GUIDE.md
634
633
 
635
634
  ## Version History
636
635
 
@@ -5,7 +5,7 @@ description: >
5
5
  repo structure, and multi-package sync. Trigger on "open a PR", "manage
6
6
  issues", "cut a release", "sync packages", or any GitHub Actions/repo
7
7
  automation request. All GitHub operations use the `gh` CLI plus monomind's
8
- MCP GitHub tools — there is no `monomind github` CLI command group.
8
+ MCP GitHub tools — the `monomind` CLI has no `github` command group.
9
9
  ---
10
10
 
11
11
  # GitHub Toolkit