@monoes/monomindcli 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (849) hide show
  1. package/.claude/agents/design/design-monodesign.md +121 -0
  2. package/.claude/agents/github/issue-tracker.md +12 -12
  3. package/.claude/agents/github/pr-manager.md +10 -10
  4. package/.claude/agents/github/release-manager.md +49 -105
  5. package/.claude/agents/github/repo-architect.md +73 -92
  6. package/.claude/agents/github/sync-coordinator.md +55 -123
  7. package/.claude/agents/marketing/marketing-competitive-content.md +155 -0
  8. package/.claude/agents/marketing/marketing-content-creator.md +13 -0
  9. package/.claude/agents/marketing/marketing-cro-specialist.md +147 -0
  10. package/.claude/agents/marketing/marketing-email-specialist.md +90 -0
  11. package/.claude/agents/marketing/marketing-launch-strategist.md +129 -0
  12. package/.claude/agents/marketing/marketing-pricing-strategist.md +127 -0
  13. package/.claude/agents/specialists/integration-architect.md +94 -0
  14. package/.claude/commands/agents/README.md +4 -0
  15. package/.claude/commands/agents/agent-capabilities.md +6 -2
  16. package/.claude/commands/agents/agent-coordination.md +4 -0
  17. package/.claude/commands/agents/agent-spawning.md +4 -0
  18. package/.claude/commands/agents/agent-types.md +6 -2
  19. package/.claude/commands/analysis/README.md +14 -5
  20. package/.claude/commands/analysis/bottleneck-detect.md +30 -123
  21. package/.claude/commands/analysis/performance-bottlenecks.md +14 -14
  22. package/.claude/commands/analysis/performance-report.md +38 -11
  23. package/.claude/commands/analysis/token-efficiency.md +13 -16
  24. package/.claude/commands/analysis/token-usage.md +34 -12
  25. package/.claude/commands/automation/README.md +15 -5
  26. package/.claude/commands/automation/auto-agent.md +49 -85
  27. package/.claude/commands/automation/self-healing.md +20 -18
  28. package/.claude/commands/automation/session-memory.md +28 -29
  29. package/.claude/commands/automation/smart-agents.md +17 -9
  30. package/.claude/commands/automation/smart-spawn.md +52 -11
  31. package/.claude/commands/automation/workflow-select.md +46 -11
  32. package/.claude/commands/browse.md +5 -0
  33. package/.claude/commands/coordination/README.md +9 -5
  34. package/.claude/commands/coordination/agent-spawn.md +53 -9
  35. package/.claude/commands/coordination/swarm-init.md +39 -42
  36. package/.claude/commands/coordination/task-orchestrate.md +65 -11
  37. package/.claude/commands/github/README.md +21 -8
  38. package/.claude/commands/github/github-modes.md +9 -5
  39. package/.claude/commands/github/issue-tracker.md +34 -33
  40. package/.claude/commands/github/pr-manager.md +20 -17
  41. package/.claude/commands/github/release-manager.md +37 -49
  42. package/.claude/commands/github/repo-architect.md +39 -41
  43. package/.claude/commands/github/sync-coordinator.md +45 -49
  44. package/.claude/commands/hive-mind/README.md +42 -17
  45. package/.claude/commands/hive-mind/hive-mind-consensus.md +68 -4
  46. package/.claude/commands/hive-mind/hive-mind-init.md +55 -5
  47. package/.claude/commands/hive-mind/hive-mind-memory.md +69 -4
  48. package/.claude/commands/hive-mind/hive-mind-spawn.md +71 -10
  49. package/.claude/commands/hive-mind/hive-mind-status.md +52 -4
  50. package/.claude/commands/hive-mind/hive-mind-stop.md +51 -4
  51. package/.claude/commands/hive-mind/hive-mind.md +74 -14
  52. package/.claude/commands/hooks/README.md +62 -7
  53. package/.claude/commands/hooks/overview.md +94 -35
  54. package/.claude/commands/hooks/post-edit.md +48 -87
  55. package/.claude/commands/hooks/post-task.md +37 -87
  56. package/.claude/commands/hooks/pre-edit.md +52 -84
  57. package/.claude/commands/hooks/pre-task.md +46 -81
  58. package/.claude/commands/hooks/session-end.md +49 -85
  59. package/.claude/commands/hooks/setup.md +87 -58
  60. package/.claude/commands/mastermind/_repeat.md +308 -0
  61. package/.claude/commands/mastermind/architect.md +49 -0
  62. package/.claude/commands/mastermind/brain.md +98 -0
  63. package/.claude/commands/mastermind/build.md +22 -0
  64. package/.claude/commands/mastermind/content.md +22 -0
  65. package/.claude/commands/mastermind/createorg.md +94 -0
  66. package/.claude/commands/mastermind/finance.md +22 -0
  67. package/.claude/commands/mastermind/idea.md +22 -0
  68. package/.claude/commands/mastermind/marketing.md +22 -0
  69. package/.claude/commands/mastermind/master.md +379 -0
  70. package/.claude/commands/mastermind/ops.md +22 -0
  71. package/.claude/commands/mastermind/release.md +22 -0
  72. package/.claude/commands/mastermind/research.md +22 -0
  73. package/.claude/commands/mastermind/review.md +22 -0
  74. package/.claude/commands/mastermind/runorg.md +106 -0
  75. package/.claude/commands/mastermind/sales.md +22 -0
  76. package/.claude/commands/mastermind/techport.md +17 -0
  77. package/.claude/commands/memory/README.md +75 -5
  78. package/.claude/commands/memory/memory-search.md +63 -11
  79. package/.claude/commands/monitoring/README.md +64 -4
  80. package/.claude/commands/monitoring/agent-metrics.md +50 -10
  81. package/.claude/commands/monitoring/agents.md +59 -32
  82. package/.claude/commands/monitoring/status.md +96 -34
  83. package/.claude/commands/monograph/README.md +102 -0
  84. package/.claude/commands/monograph/monograph-build.md +79 -0
  85. package/.claude/commands/monograph/monograph-search.md +96 -0
  86. package/.claude/commands/monograph/monograph-stats.md +53 -0
  87. package/.claude/commands/monograph/monograph-watch.md +63 -0
  88. package/.claude/commands/monograph/monograph-wiki.md +91 -0
  89. package/.claude/commands/monomind/createtask.md +277 -0
  90. package/.claude/commands/{monomind-do.md → monomind/do.md} +22 -9
  91. package/.claude/commands/monomind/help.md +118 -0
  92. package/.claude/commands/{monomind-idea.md → monomind/idea.md} +23 -29
  93. package/.claude/commands/{monomind-improve.md → monomind/improve.md} +24 -30
  94. package/.claude/commands/monomind/memory.md +230 -0
  95. package/.claude/commands/monomind/repeat.md +201 -0
  96. package/.claude/commands/monomind/review.md +313 -0
  97. package/.claude/commands/monomind/specialagents.md +125 -0
  98. package/.claude/commands/monomind/swarm.md +161 -0
  99. package/.claude/commands/monomind/understand.md +148 -0
  100. package/.claude/commands/optimization/README.md +69 -5
  101. package/.claude/commands/optimization/auto-topology.md +66 -43
  102. package/.claude/commands/optimization/parallel-execution.md +65 -39
  103. package/.claude/commands/optimization/performance-optimize.md +79 -0
  104. package/.claude/commands/pair/README.md +48 -230
  105. package/.claude/commands/pair/examples.md +85 -441
  106. package/.claude/commands/pair/modes.md +77 -303
  107. package/.claude/commands/pair/session.md +76 -359
  108. package/.claude/commands/sparc/analyzer.md +9 -26
  109. package/.claude/commands/sparc/architect.md +8 -25
  110. package/.claude/commands/sparc/ask.md +27 -68
  111. package/.claude/commands/sparc/batch-executor.md +8 -25
  112. package/.claude/commands/sparc/code.md +12 -53
  113. package/.claude/commands/sparc/coder.md +8 -25
  114. package/.claude/commands/sparc/debug.md +12 -53
  115. package/.claude/commands/sparc/debugger.md +8 -25
  116. package/.claude/commands/sparc/designer.md +8 -25
  117. package/.claude/commands/sparc/devops.md +16 -57
  118. package/.claude/commands/sparc/docs-writer.md +12 -53
  119. package/.claude/commands/sparc/documenter.md +8 -25
  120. package/.claude/commands/sparc/innovator.md +8 -25
  121. package/.claude/commands/sparc/integration.md +12 -53
  122. package/.claude/commands/sparc/mcp.md +12 -53
  123. package/.claude/commands/sparc/memory-manager.md +28 -25
  124. package/.claude/commands/sparc/optimizer.md +8 -25
  125. package/.claude/commands/sparc/orchestrator.md +35 -97
  126. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +13 -54
  127. package/.claude/commands/sparc/refinement-optimization-mode.md +13 -54
  128. package/.claude/commands/sparc/researcher.md +8 -25
  129. package/.claude/commands/sparc/reviewer.md +8 -25
  130. package/.claude/commands/sparc/security-review.md +13 -54
  131. package/.claude/commands/sparc/sparc-modes.md +97 -151
  132. package/.claude/commands/sparc/sparc.md +16 -56
  133. package/.claude/commands/sparc/spec-pseudocode.md +13 -54
  134. package/.claude/commands/sparc/supabase-admin.md +19 -66
  135. package/.claude/commands/sparc/swarm-coordinator.md +21 -25
  136. package/.claude/commands/sparc/tdd.md +8 -25
  137. package/.claude/commands/sparc/tester.md +8 -25
  138. package/.claude/commands/sparc/tutorial.md +12 -53
  139. package/.claude/commands/sparc/workflow-manager.md +8 -25
  140. package/.claude/commands/sparc.md +76 -130
  141. package/.claude/commands/stream-chain/pipeline.md +72 -77
  142. package/.claude/commands/stream-chain/run.md +133 -47
  143. package/.claude/commands/swarm/README.md +37 -12
  144. package/.claude/commands/swarm/analysis.md +47 -69
  145. package/.claude/commands/swarm/development.md +45 -69
  146. package/.claude/commands/swarm/examples.md +77 -142
  147. package/.claude/commands/swarm/maintenance.md +47 -74
  148. package/.claude/commands/swarm/optimization.md +54 -87
  149. package/.claude/commands/swarm/research.md +47 -107
  150. package/.claude/commands/swarm/swarm-analysis.md +58 -4
  151. package/.claude/commands/swarm/swarm-background.md +61 -4
  152. package/.claude/commands/swarm/swarm-modes.md +63 -4
  153. package/.claude/commands/swarm/swarm-monitor.md +50 -4
  154. package/.claude/commands/swarm/swarm-status.md +40 -4
  155. package/.claude/commands/swarm/swarm-strategies.md +73 -5
  156. package/.claude/commands/swarm/swarm.md +70 -18
  157. package/.claude/commands/swarm/testing.md +51 -102
  158. package/.claude/commands/tokens.md +6 -1
  159. package/.claude/commands/training/README.md +36 -6
  160. package/.claude/commands/training/model-update.md +68 -15
  161. package/.claude/commands/training/neural-patterns.md +54 -55
  162. package/.claude/commands/training/neural-train.md +70 -16
  163. package/.claude/commands/training/pattern-learn.md +60 -16
  164. package/.claude/commands/training/specialization.md +78 -49
  165. package/.claude/commands/truth/start.md +87 -109
  166. package/.claude/commands/ts.md +7 -2
  167. package/.claude/commands/verify/check.md +90 -34
  168. package/.claude/commands/verify/start.md +71 -94
  169. package/.claude/commands/workflows/README.md +62 -6
  170. package/.claude/commands/workflows/development.md +69 -61
  171. package/.claude/commands/workflows/research.md +73 -47
  172. package/.claude/commands/workflows/workflow-create.md +75 -16
  173. package/.claude/commands/workflows/workflow-execute.md +94 -16
  174. package/.claude/commands/workflows/workflow-export.md +81 -16
  175. package/.claude/helpers/control-start.cjs +91 -0
  176. package/.claude/helpers/extras-registry.json +4104 -1991
  177. package/.claude/helpers/graphify-freshen.cjs +44 -13
  178. package/.claude/helpers/hook-handler.cjs +256 -1
  179. package/.claude/helpers/loop-tracker.cjs +107 -0
  180. package/.claude/helpers/router.cjs +48 -68
  181. package/.claude/helpers/skill-registry.json +89 -104
  182. package/.claude/helpers/statusline.cjs +33 -2
  183. package/.claude/skills/.monomind/data/ranked-context.json +5 -0
  184. package/.claude/skills/.monomind/sessions/current.json +13 -0
  185. package/.claude/skills/.monomind/sessions/session-1777829336455.json +15 -0
  186. package/.claude/skills/.monomind/sessions/session-1777831614725.json +15 -0
  187. package/.claude/skills/.monomind/sessions/session-1777832095857.json +15 -0
  188. package/.claude/skills/.monomind/sessions/session-1777839814183.json +15 -0
  189. package/.claude/skills/.monomind/sessions/session-1777841847131.json +15 -0
  190. package/.claude/skills/.monomind/sessions/session-1777843309463.json +15 -0
  191. package/.claude/skills/.monomind/sessions/session-1777880867159.json +15 -0
  192. package/.claude/skills/.monomind/sessions/session-1777881884593.json +15 -0
  193. package/.claude/skills/.monomind/sessions/session-1777884090471.json +15 -0
  194. package/.claude/skills/.monomind/sessions/session-1777884808221.json +15 -0
  195. package/.claude/skills/.monomind/sessions/session-1777885672155.json +15 -0
  196. package/.claude/skills/.monomind/sessions/session-1777886852818.json +15 -0
  197. package/.claude/skills/.monomind/sessions/session-1777896532690.json +15 -0
  198. package/.claude/skills/agentdb-advanced/SKILL.md +11 -12
  199. package/.claude/skills/agentdb-learning/SKILL.md +20 -21
  200. package/.claude/skills/agentdb-memory-patterns/SKILL.md +28 -30
  201. package/.claude/skills/agentdb-optimization/SKILL.md +11 -12
  202. package/.claude/skills/agentdb-vector-search/SKILL.md +37 -41
  203. package/.claude/skills/{v3-integration-deep → agentic-integration}/SKILL.md +20 -13
  204. package/.claude/skills/agentic-jujutsu/SKILL.md +22 -22
  205. package/.claude/skills/{v3-cli-modernization → cli-modernization}/SKILL.md +17 -8
  206. package/.claude/skills/{v3-core-implementation → core-implementation}/SKILL.md +33 -8
  207. package/.claude/skills/{v3-ddd-architecture → ddd-architecture}/SKILL.md +18 -25
  208. package/.claude/skills/github-code-review/SKILL.md +82 -83
  209. package/.claude/skills/github-multi-repo/SKILL.md +42 -46
  210. package/.claude/skills/github-project-management/SKILL.md +83 -88
  211. package/.claude/skills/github-release-management/SKILL.md +12 -18
  212. package/.claude/skills/github-workflow-automation/SKILL.md +70 -74
  213. package/.claude/skills/hooks-automation/SKILL.md +9 -13
  214. package/.claude/skills/mastermind/_intake.md +83 -0
  215. package/.claude/skills/mastermind/_protocol.md +275 -0
  216. package/.claude/skills/mastermind/architect.md +847 -0
  217. package/.claude/skills/mastermind/build.md +158 -0
  218. package/.claude/skills/mastermind/content.md +185 -0
  219. package/.claude/skills/mastermind/createorg.md +318 -0
  220. package/.claude/skills/mastermind/finance.md +154 -0
  221. package/.claude/skills/mastermind/idea.md +158 -0
  222. package/.claude/skills/mastermind/marketing.md +216 -0
  223. package/.claude/skills/mastermind/monotask.md +350 -0
  224. package/.claude/skills/mastermind/ops.md +156 -0
  225. package/.claude/skills/mastermind/references/copywriting-frameworks.md +181 -0
  226. package/.claude/skills/mastermind/references/persuasion-psychology.md +158 -0
  227. package/.claude/skills/mastermind/release.md +156 -0
  228. package/.claude/skills/mastermind/research.md +156 -0
  229. package/.claude/skills/mastermind/review.md +157 -0
  230. package/.claude/skills/mastermind/runorg.md +308 -0
  231. package/.claude/skills/mastermind/sales.md +158 -0
  232. package/.claude/skills/mastermind/techport.md +743 -0
  233. package/.claude/skills/{v3-mcp-optimization → mcp-optimization}/SKILL.md +35 -14
  234. package/.claude/skills/{v3-memory-unification → memory-unification}/SKILL.md +20 -4
  235. package/.claude/skills/monodesign/SKILL.md +302 -0
  236. package/.claude/skills/monodesign/reference/adapt.md +190 -0
  237. package/.claude/skills/monodesign/reference/animate.md +175 -0
  238. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +187 -0
  239. package/.claude/skills/monodesign/reference/audit.md +133 -0
  240. package/.claude/skills/monodesign/reference/bolder.md +113 -0
  241. package/.claude/skills/monodesign/reference/brand-workflow.md +180 -0
  242. package/.claude/skills/monodesign/reference/brand.md +114 -0
  243. package/.claude/skills/monodesign/reference/clarify.md +174 -0
  244. package/.claude/skills/monodesign/reference/cognitive-load.md +106 -0
  245. package/.claude/skills/monodesign/reference/color-and-contrast.md +105 -0
  246. package/.claude/skills/monodesign/reference/colorize.md +154 -0
  247. package/.claude/skills/monodesign/reference/component-specs.md +260 -0
  248. package/.claude/skills/monodesign/reference/component-states.md +274 -0
  249. package/.claude/skills/monodesign/reference/component-system.md +358 -0
  250. package/.claude/skills/monodesign/reference/copy-formulas.md +160 -0
  251. package/.claude/skills/monodesign/reference/craft.md +193 -0
  252. package/.claude/skills/monodesign/reference/critique.md +213 -0
  253. package/.claude/skills/monodesign/reference/delight.md +302 -0
  254. package/.claude/skills/monodesign/reference/design-principles.md +246 -0
  255. package/.claude/skills/monodesign/reference/distill.md +111 -0
  256. package/.claude/skills/monodesign/reference/document.md +427 -0
  257. package/.claude/skills/monodesign/reference/extract.md +69 -0
  258. package/.claude/skills/monodesign/reference/harden.md +347 -0
  259. package/.claude/skills/monodesign/reference/heuristics-scoring.md +234 -0
  260. package/.claude/skills/monodesign/reference/image-prompts.md +118 -0
  261. package/.claude/skills/monodesign/reference/interaction-design.md +195 -0
  262. package/.claude/skills/monodesign/reference/layout.md +141 -0
  263. package/.claude/skills/monodesign/reference/live.md +622 -0
  264. package/.claude/skills/monodesign/reference/motion-design.md +109 -0
  265. package/.claude/skills/monodesign/reference/onboard.md +234 -0
  266. package/.claude/skills/monodesign/reference/optimize.md +258 -0
  267. package/.claude/skills/monodesign/reference/overdrive.md +130 -0
  268. package/.claude/skills/monodesign/reference/personas.md +179 -0
  269. package/.claude/skills/monodesign/reference/polish.md +233 -0
  270. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +108 -0
  271. package/.claude/skills/monodesign/reference/product.md +62 -0
  272. package/.claude/skills/monodesign/reference/quieter.md +99 -0
  273. package/.claude/skills/monodesign/reference/responsive-design.md +114 -0
  274. package/.claude/skills/monodesign/reference/shape.md +151 -0
  275. package/.claude/skills/monodesign/reference/spatial-design.md +100 -0
  276. package/.claude/skills/monodesign/reference/teach.md +156 -0
  277. package/.claude/skills/monodesign/reference/token-architecture.md +222 -0
  278. package/.claude/skills/monodesign/reference/typeset.md +124 -0
  279. package/.claude/skills/monodesign/reference/typography.md +159 -0
  280. package/.claude/skills/monodesign/reference/ux-research.md +143 -0
  281. package/.claude/skills/monodesign/reference/ux-rules.md +211 -0
  282. package/.claude/skills/monodesign/reference/ux-writing.md +107 -0
  283. package/.claude/skills/monomotion/SKILL.md +145 -0
  284. package/.claude/skills/monomotion/rules/api-control.md +139 -0
  285. package/.claude/skills/monomotion/rules/effects.md +109 -0
  286. package/.claude/skills/monomotion/rules/integration.md +140 -0
  287. package/.claude/skills/monomotion/rules/scroll.md +131 -0
  288. package/.claude/skills/monomotion/rules/sequencing.md +105 -0
  289. package/.claude/skills/monomotion/rules/svg.md +101 -0
  290. package/.claude/skills/monomotion/rules/text.md +119 -0
  291. package/.claude/skills/pair-programming/SKILL.md +1 -1
  292. package/.claude/skills/performance-analysis/SKILL.md +3 -3
  293. package/.claude/skills/{v3-performance-optimization → performance-optimization}/SKILL.md +16 -8
  294. package/.claude/skills/reasoningbank-agentdb/SKILL.md +17 -19
  295. package/.claude/skills/reasoningbank-intelligence/SKILL.md +4 -6
  296. package/.claude/skills/{v3-security-overhaul → security-hardening}/SKILL.md +13 -3
  297. package/.claude/skills/skill-builder/SKILL.md +19 -19
  298. package/.claude/skills/sparc-methodology/SKILL.md +55 -211
  299. package/.claude/skills/stop-slop/SKILL.md +67 -0
  300. package/.claude/skills/stop-slop/references/examples.md +61 -0
  301. package/.claude/skills/stop-slop/references/phrases.md +130 -0
  302. package/.claude/skills/stop-slop/references/structures.md +136 -0
  303. package/.claude/skills/swarm-advanced/SKILL.md +13 -43
  304. package/.claude/skills/{v3-swarm-coordination → swarm-coordination}/SKILL.md +39 -21
  305. package/.claude/skills/swarm-orchestration/SKILL.md +12 -12
  306. package/.claude/skills/verification-quality/SKILL.md +5 -5
  307. package/README.md +5 -5
  308. package/bin/cli.js +78 -13
  309. package/dist/src/agents/halt-signal.d.ts.map +1 -1
  310. package/dist/src/agents/halt-signal.js +33 -7
  311. package/dist/src/agents/halt-signal.js.map +1 -1
  312. package/dist/src/agents/managed-agent.d.ts.map +1 -1
  313. package/dist/src/agents/managed-agent.js +5 -2
  314. package/dist/src/agents/managed-agent.js.map +1 -1
  315. package/dist/src/agents/prompt-experiment.d.ts +3 -2
  316. package/dist/src/agents/prompt-experiment.d.ts.map +1 -1
  317. package/dist/src/agents/prompt-experiment.js +1 -1
  318. package/dist/src/agents/prompt-experiment.js.map +1 -1
  319. package/dist/src/agents/prompt-version-manager.d.ts +5 -2
  320. package/dist/src/agents/prompt-version-manager.d.ts.map +1 -1
  321. package/dist/src/agents/prompt-version-manager.js +26 -4
  322. package/dist/src/agents/prompt-version-manager.js.map +1 -1
  323. package/dist/src/agents/specialization-scorer.d.ts.map +1 -1
  324. package/dist/src/agents/specialization-scorer.js +17 -9
  325. package/dist/src/agents/specialization-scorer.js.map +1 -1
  326. package/dist/src/agents/trigger-scanner.d.ts +5 -3
  327. package/dist/src/agents/trigger-scanner.d.ts.map +1 -1
  328. package/dist/src/agents/trigger-scanner.js +58 -10
  329. package/dist/src/agents/trigger-scanner.js.map +1 -1
  330. package/dist/src/agents/version-store.d.ts +0 -1
  331. package/dist/src/agents/version-store.d.ts.map +1 -1
  332. package/dist/src/agents/version-store.js +44 -21
  333. package/dist/src/agents/version-store.js.map +1 -1
  334. package/dist/src/autopilot-state.d.ts.map +1 -1
  335. package/dist/src/autopilot-state.js +79 -28
  336. package/dist/src/autopilot-state.js.map +1 -1
  337. package/dist/src/benchmarks/benchmark-runner.d.ts +7 -2
  338. package/dist/src/benchmarks/benchmark-runner.d.ts.map +1 -1
  339. package/dist/src/benchmarks/benchmark-runner.js +20 -8
  340. package/dist/src/benchmarks/benchmark-runner.js.map +1 -1
  341. package/dist/src/benchmarks/metric-evaluators.d.ts +2 -1
  342. package/dist/src/benchmarks/metric-evaluators.d.ts.map +1 -1
  343. package/dist/src/benchmarks/metric-evaluators.js +25 -2
  344. package/dist/src/benchmarks/metric-evaluators.js.map +1 -1
  345. package/dist/src/commands/agent.d.ts.map +1 -1
  346. package/dist/src/commands/agent.js +6 -4
  347. package/dist/src/commands/agent.js.map +1 -1
  348. package/dist/src/commands/appliance-advanced.d.ts.map +1 -1
  349. package/dist/src/commands/appliance-advanced.js +23 -0
  350. package/dist/src/commands/appliance-advanced.js.map +1 -1
  351. package/dist/src/commands/autopilot.d.ts.map +1 -1
  352. package/dist/src/commands/autopilot.js +3 -3
  353. package/dist/src/commands/autopilot.js.map +1 -1
  354. package/dist/src/commands/benchmark.d.ts.map +1 -1
  355. package/dist/src/commands/benchmark.js +119 -8
  356. package/dist/src/commands/benchmark.js.map +1 -1
  357. package/dist/src/commands/claims.d.ts.map +1 -1
  358. package/dist/src/commands/claims.js +22 -14
  359. package/dist/src/commands/claims.js.map +1 -1
  360. package/dist/src/commands/config.d.ts.map +1 -1
  361. package/dist/src/commands/config.js +32 -0
  362. package/dist/src/commands/config.js.map +1 -1
  363. package/dist/src/commands/daemon.d.ts.map +1 -1
  364. package/dist/src/commands/daemon.js +13 -11
  365. package/dist/src/commands/daemon.js.map +1 -1
  366. package/dist/src/commands/deployment.d.ts.map +1 -1
  367. package/dist/src/commands/deployment.js +21 -2
  368. package/dist/src/commands/deployment.js.map +1 -1
  369. package/dist/src/commands/doctor.d.ts.map +1 -1
  370. package/dist/src/commands/doctor.js +28 -62
  371. package/dist/src/commands/doctor.js.map +1 -1
  372. package/dist/src/commands/embeddings.d.ts.map +1 -1
  373. package/dist/src/commands/embeddings.js +124 -48
  374. package/dist/src/commands/embeddings.js.map +1 -1
  375. package/dist/src/commands/hive-mind.d.ts.map +1 -1
  376. package/dist/src/commands/hive-mind.js +15 -14
  377. package/dist/src/commands/hive-mind.js.map +1 -1
  378. package/dist/src/commands/hooks.d.ts.map +1 -1
  379. package/dist/src/commands/hooks.js +45 -41
  380. package/dist/src/commands/hooks.js.map +1 -1
  381. package/dist/src/commands/index.d.ts +2 -0
  382. package/dist/src/commands/index.d.ts.map +1 -1
  383. package/dist/src/commands/index.js +20 -7
  384. package/dist/src/commands/index.js.map +1 -1
  385. package/dist/src/commands/init.d.ts.map +1 -1
  386. package/dist/src/commands/init.js +53 -19
  387. package/dist/src/commands/init.js.map +1 -1
  388. package/dist/src/commands/mcp.d.ts.map +1 -1
  389. package/dist/src/commands/mcp.js +31 -44
  390. package/dist/src/commands/mcp.js.map +1 -1
  391. package/dist/src/commands/memory.d.ts.map +1 -1
  392. package/dist/src/commands/memory.js +47 -15
  393. package/dist/src/commands/memory.js.map +1 -1
  394. package/dist/src/commands/migrate.d.ts.map +1 -1
  395. package/dist/src/commands/migrate.js +156 -108
  396. package/dist/src/commands/migrate.js.map +1 -1
  397. package/dist/src/commands/monograph.d.ts +8 -0
  398. package/dist/src/commands/monograph.d.ts.map +1 -0
  399. package/dist/src/commands/monograph.js +526 -0
  400. package/dist/src/commands/monograph.js.map +1 -0
  401. package/dist/src/commands/neural.d.ts.map +1 -1
  402. package/dist/src/commands/neural.js +96 -56
  403. package/dist/src/commands/neural.js.map +1 -1
  404. package/dist/src/commands/performance.d.ts.map +1 -1
  405. package/dist/src/commands/performance.js +30 -8
  406. package/dist/src/commands/performance.js.map +1 -1
  407. package/dist/src/commands/plugins.d.ts.map +1 -1
  408. package/dist/src/commands/plugins.js +13 -37
  409. package/dist/src/commands/plugins.js.map +1 -1
  410. package/dist/src/commands/process.d.ts.map +1 -1
  411. package/dist/src/commands/process.js +25 -2
  412. package/dist/src/commands/process.js.map +1 -1
  413. package/dist/src/commands/providers.d.ts.map +1 -1
  414. package/dist/src/commands/providers.js +37 -5
  415. package/dist/src/commands/providers.js.map +1 -1
  416. package/dist/src/commands/replay.js +4 -4
  417. package/dist/src/commands/replay.js.map +1 -1
  418. package/dist/src/commands/route.d.ts.map +1 -1
  419. package/dist/src/commands/route.js +37 -5
  420. package/dist/src/commands/route.js.map +1 -1
  421. package/dist/src/commands/ruvector/import.d.ts.map +1 -1
  422. package/dist/src/commands/ruvector/import.js +12 -2
  423. package/dist/src/commands/ruvector/import.js.map +1 -1
  424. package/dist/src/commands/ruvector/init.d.ts.map +1 -1
  425. package/dist/src/commands/ruvector/init.js +15 -0
  426. package/dist/src/commands/ruvector/init.js.map +1 -1
  427. package/dist/src/commands/ruvector/status.d.ts.map +1 -1
  428. package/dist/src/commands/ruvector/status.js +16 -3
  429. package/dist/src/commands/ruvector/status.js.map +1 -1
  430. package/dist/src/commands/security.d.ts.map +1 -1
  431. package/dist/src/commands/security.js +342 -193
  432. package/dist/src/commands/security.js.map +1 -1
  433. package/dist/src/commands/session.d.ts.map +1 -1
  434. package/dist/src/commands/session.js +51 -8
  435. package/dist/src/commands/session.js.map +1 -1
  436. package/dist/src/commands/start.d.ts.map +1 -1
  437. package/dist/src/commands/start.js +18 -4
  438. package/dist/src/commands/start.js.map +1 -1
  439. package/dist/src/commands/swarm.d.ts.map +1 -1
  440. package/dist/src/commands/swarm.js +47 -36
  441. package/dist/src/commands/swarm.js.map +1 -1
  442. package/dist/src/commands/tokens.js +11 -11
  443. package/dist/src/commands/tokens.js.map +1 -1
  444. package/dist/src/commands/transfer-store.js +1 -1
  445. package/dist/src/commands/transfer-store.js.map +1 -1
  446. package/dist/src/commands/workflow.d.ts.map +1 -1
  447. package/dist/src/commands/workflow.js +31 -4
  448. package/dist/src/commands/workflow.js.map +1 -1
  449. package/dist/src/config-adapter.d.ts +2 -1
  450. package/dist/src/config-adapter.d.ts.map +1 -1
  451. package/dist/src/config-adapter.js.map +1 -1
  452. package/dist/src/consensus/audit-writer.d.ts.map +1 -1
  453. package/dist/src/consensus/audit-writer.js +46 -13
  454. package/dist/src/consensus/audit-writer.js.map +1 -1
  455. package/dist/src/consensus/vote-signer.d.ts +0 -3
  456. package/dist/src/consensus/vote-signer.d.ts.map +1 -1
  457. package/dist/src/consensus/vote-signer.js +9 -1
  458. package/dist/src/consensus/vote-signer.js.map +1 -1
  459. package/dist/src/dlq/dlq-reader.d.ts +4 -2
  460. package/dist/src/dlq/dlq-reader.d.ts.map +1 -1
  461. package/dist/src/dlq/dlq-reader.js +25 -8
  462. package/dist/src/dlq/dlq-reader.js.map +1 -1
  463. package/dist/src/dlq/dlq-replayer.d.ts +10 -3
  464. package/dist/src/dlq/dlq-replayer.d.ts.map +1 -1
  465. package/dist/src/dlq/dlq-replayer.js +50 -16
  466. package/dist/src/dlq/dlq-replayer.js.map +1 -1
  467. package/dist/src/dlq/dlq-writer.d.ts.map +1 -1
  468. package/dist/src/dlq/dlq-writer.js +27 -5
  469. package/dist/src/dlq/dlq-writer.js.map +1 -1
  470. package/dist/src/eval/dataset-manager.d.ts +2 -2
  471. package/dist/src/eval/dataset-manager.d.ts.map +1 -1
  472. package/dist/src/eval/dataset-manager.js +26 -16
  473. package/dist/src/eval/dataset-manager.js.map +1 -1
  474. package/dist/src/eval/trace-collector.d.ts.map +1 -1
  475. package/dist/src/eval/trace-collector.js +23 -3
  476. package/dist/src/eval/trace-collector.js.map +1 -1
  477. package/dist/src/index.d.ts.map +1 -1
  478. package/dist/src/index.js +12 -10
  479. package/dist/src/index.js.map +1 -1
  480. package/dist/src/init/claudemd-generator.js +8 -8
  481. package/dist/src/init/claudemd-generator.js.map +1 -1
  482. package/dist/src/init/executor.d.ts.map +1 -1
  483. package/dist/src/init/executor.js +163 -137
  484. package/dist/src/init/executor.js.map +1 -1
  485. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  486. package/dist/src/init/helpers-generator.js +49 -36
  487. package/dist/src/init/helpers-generator.js.map +1 -1
  488. package/dist/src/init/mcp-generator.js +3 -3
  489. package/dist/src/init/mcp-generator.js.map +1 -1
  490. package/dist/src/init/settings-generator.d.ts.map +1 -1
  491. package/dist/src/init/settings-generator.js +10 -3
  492. package/dist/src/init/settings-generator.js.map +1 -1
  493. package/dist/src/init/shared-instructions-generator.d.ts.map +1 -1
  494. package/dist/src/init/shared-instructions-generator.js +18 -3
  495. package/dist/src/init/shared-instructions-generator.js.map +1 -1
  496. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  497. package/dist/src/init/statusline-generator.js +3 -1
  498. package/dist/src/init/statusline-generator.js.map +1 -1
  499. package/dist/src/init/types.d.ts +35 -11
  500. package/dist/src/init/types.d.ts.map +1 -1
  501. package/dist/src/init/types.js +5 -9
  502. package/dist/src/init/types.js.map +1 -1
  503. package/dist/src/interactive/interrupt.d.ts.map +1 -1
  504. package/dist/src/interactive/interrupt.js +8 -3
  505. package/dist/src/interactive/interrupt.js.map +1 -1
  506. package/dist/src/mcp/tool-registry.d.ts.map +1 -1
  507. package/dist/src/mcp/tool-registry.js +38 -4
  508. package/dist/src/mcp/tool-registry.js.map +1 -1
  509. package/dist/src/mcp-client.d.ts.map +1 -1
  510. package/dist/src/mcp-client.js +15 -6
  511. package/dist/src/mcp-client.js.map +1 -1
  512. package/dist/src/mcp-server.d.ts +9 -2
  513. package/dist/src/mcp-server.d.ts.map +1 -1
  514. package/dist/src/mcp-server.js +182 -35
  515. package/dist/src/mcp-server.js.map +1 -1
  516. package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
  517. package/dist/src/mcp-tools/agent-tools.js +66 -34
  518. package/dist/src/mcp-tools/agent-tools.js.map +1 -1
  519. package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -1
  520. package/dist/src/mcp-tools/agentdb-tools.js +34 -7
  521. package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
  522. package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -1
  523. package/dist/src/mcp-tools/analyze-tools.js +25 -16
  524. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  525. package/dist/src/mcp-tools/auto-install.d.ts.map +1 -1
  526. package/dist/src/mcp-tools/auto-install.js +4 -6
  527. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  528. package/dist/src/mcp-tools/autopilot-tools.d.ts.map +1 -1
  529. package/dist/src/mcp-tools/autopilot-tools.js +12 -2
  530. package/dist/src/mcp-tools/autopilot-tools.js.map +1 -1
  531. package/dist/src/mcp-tools/browser-tools.d.ts.map +1 -1
  532. package/dist/src/mcp-tools/browser-tools.js +199 -20
  533. package/dist/src/mcp-tools/browser-tools.js.map +1 -1
  534. package/dist/src/mcp-tools/claims-tools.d.ts.map +1 -1
  535. package/dist/src/mcp-tools/claims-tools.js +68 -18
  536. package/dist/src/mcp-tools/claims-tools.js.map +1 -1
  537. package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
  538. package/dist/src/mcp-tools/config-tools.js +33 -5
  539. package/dist/src/mcp-tools/config-tools.js.map +1 -1
  540. package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -1
  541. package/dist/src/mcp-tools/coordination-tools.js +59 -4
  542. package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
  543. package/dist/src/mcp-tools/daa-tools.d.ts.map +1 -1
  544. package/dist/src/mcp-tools/daa-tools.js +46 -10
  545. package/dist/src/mcp-tools/daa-tools.js.map +1 -1
  546. package/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -1
  547. package/dist/src/mcp-tools/embeddings-tools.js +46 -5
  548. package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
  549. package/dist/src/mcp-tools/github-tools.d.ts.map +1 -1
  550. package/dist/src/mcp-tools/github-tools.js +29 -16
  551. package/dist/src/mcp-tools/github-tools.js.map +1 -1
  552. package/dist/src/mcp-tools/graphify-tools.d.ts +4 -67
  553. package/dist/src/mcp-tools/graphify-tools.d.ts.map +1 -1
  554. package/dist/src/mcp-tools/graphify-tools.js +40 -1250
  555. package/dist/src/mcp-tools/graphify-tools.js.map +1 -1
  556. package/dist/src/mcp-tools/guidance-tools.d.ts.map +1 -1
  557. package/dist/src/mcp-tools/guidance-tools.js +38 -10
  558. package/dist/src/mcp-tools/guidance-tools.js.map +1 -1
  559. package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
  560. package/dist/src/mcp-tools/hive-mind-tools.js +96 -33
  561. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
  562. package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
  563. package/dist/src/mcp-tools/hooks-tools.js +70 -37
  564. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  565. package/dist/src/mcp-tools/index.d.ts +1 -0
  566. package/dist/src/mcp-tools/index.d.ts.map +1 -1
  567. package/dist/src/mcp-tools/index.js +1 -0
  568. package/dist/src/mcp-tools/index.js.map +1 -1
  569. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  570. package/dist/src/mcp-tools/memory-tools.js +29 -13
  571. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  572. package/dist/src/mcp-tools/monograph-tools.d.ts +9 -0
  573. package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -0
  574. package/dist/src/mcp-tools/monograph-tools.js +6306 -0
  575. package/dist/src/mcp-tools/monograph-tools.js.map +1 -0
  576. package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
  577. package/dist/src/mcp-tools/neural-tools.js +121 -37
  578. package/dist/src/mcp-tools/neural-tools.js.map +1 -1
  579. package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -1
  580. package/dist/src/mcp-tools/performance-tools.js +21 -8
  581. package/dist/src/mcp-tools/performance-tools.js.map +1 -1
  582. package/dist/src/mcp-tools/progress-tools.d.ts.map +1 -1
  583. package/dist/src/mcp-tools/progress-tools.js +10 -8
  584. package/dist/src/mcp-tools/progress-tools.js.map +1 -1
  585. package/dist/src/mcp-tools/request-tracker.d.ts.map +1 -1
  586. package/dist/src/mcp-tools/request-tracker.js +4 -1
  587. package/dist/src/mcp-tools/request-tracker.js.map +1 -1
  588. package/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -1
  589. package/dist/src/mcp-tools/ruvllm-tools.js +19 -8
  590. package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
  591. package/dist/src/mcp-tools/session-tools.d.ts.map +1 -1
  592. package/dist/src/mcp-tools/session-tools.js +57 -17
  593. package/dist/src/mcp-tools/session-tools.js.map +1 -1
  594. package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
  595. package/dist/src/mcp-tools/swarm-tools.js +35 -17
  596. package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
  597. package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
  598. package/dist/src/mcp-tools/system-tools.js +4 -3
  599. package/dist/src/mcp-tools/system-tools.js.map +1 -1
  600. package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
  601. package/dist/src/mcp-tools/task-tools.js +53 -13
  602. package/dist/src/mcp-tools/task-tools.js.map +1 -1
  603. package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
  604. package/dist/src/mcp-tools/terminal-tools.js +63 -14
  605. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  606. package/dist/src/mcp-tools/transfer-tools.d.ts.map +1 -1
  607. package/dist/src/mcp-tools/transfer-tools.js +21 -16
  608. package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
  609. package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -1
  610. package/dist/src/mcp-tools/workflow-tools.js +92 -23
  611. package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
  612. package/dist/src/memory/ewc-consolidation.d.ts.map +1 -1
  613. package/dist/src/memory/ewc-consolidation.js +41 -10
  614. package/dist/src/memory/ewc-consolidation.js.map +1 -1
  615. package/dist/src/memory/intelligence.d.ts +2 -2
  616. package/dist/src/memory/intelligence.d.ts.map +1 -1
  617. package/dist/src/memory/intelligence.js +39 -13
  618. package/dist/src/memory/intelligence.js.map +1 -1
  619. package/dist/src/memory/memory-bridge.d.ts +1 -0
  620. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  621. package/dist/src/memory/memory-bridge.js +149 -56
  622. package/dist/src/memory/memory-bridge.js.map +1 -1
  623. package/dist/src/memory/memory-initializer.d.ts.map +1 -1
  624. package/dist/src/memory/memory-initializer.js +107 -45
  625. package/dist/src/memory/memory-initializer.js.map +1 -1
  626. package/dist/src/memory/sona-optimizer.d.ts +8 -1
  627. package/dist/src/memory/sona-optimizer.d.ts.map +1 -1
  628. package/dist/src/memory/sona-optimizer.js +25 -8
  629. package/dist/src/memory/sona-optimizer.js.map +1 -1
  630. package/dist/src/observability/replay-reader.d.ts +40 -0
  631. package/dist/src/observability/replay-reader.d.ts.map +1 -0
  632. package/dist/src/observability/replay-reader.js +138 -0
  633. package/dist/src/observability/replay-reader.js.map +1 -0
  634. package/dist/src/orchestration/routing-modes.d.ts.map +1 -1
  635. package/dist/src/orchestration/routing-modes.js +35 -5
  636. package/dist/src/orchestration/routing-modes.js.map +1 -1
  637. package/dist/src/parser.d.ts +8 -0
  638. package/dist/src/parser.d.ts.map +1 -1
  639. package/dist/src/parser.js +48 -14
  640. package/dist/src/parser.js.map +1 -1
  641. package/dist/src/plugins/manager.d.ts.map +1 -1
  642. package/dist/src/plugins/manager.js +112 -19
  643. package/dist/src/plugins/manager.js.map +1 -1
  644. package/dist/src/plugins/store/discovery.d.ts +1 -1
  645. package/dist/src/plugins/store/discovery.d.ts.map +1 -1
  646. package/dist/src/plugins/store/discovery.js +80 -62
  647. package/dist/src/plugins/store/discovery.js.map +1 -1
  648. package/dist/src/production/circuit-breaker.d.ts.map +1 -1
  649. package/dist/src/production/circuit-breaker.js +8 -1
  650. package/dist/src/production/circuit-breaker.js.map +1 -1
  651. package/dist/src/production/error-handler.d.ts +4 -2
  652. package/dist/src/production/error-handler.d.ts.map +1 -1
  653. package/dist/src/production/error-handler.js +27 -5
  654. package/dist/src/production/error-handler.js.map +1 -1
  655. package/dist/src/production/monitoring.d.ts.map +1 -1
  656. package/dist/src/production/monitoring.js +8 -4
  657. package/dist/src/production/monitoring.js.map +1 -1
  658. package/dist/src/production/rate-limiter.d.ts.map +1 -1
  659. package/dist/src/production/rate-limiter.js +30 -22
  660. package/dist/src/production/rate-limiter.js.map +1 -1
  661. package/dist/src/ruvector/agent-wasm.js +2 -2
  662. package/dist/src/ruvector/agent-wasm.js.map +1 -1
  663. package/dist/src/ruvector/coverage-router.d.ts.map +1 -1
  664. package/dist/src/ruvector/coverage-router.js +19 -9
  665. package/dist/src/ruvector/coverage-router.js.map +1 -1
  666. package/dist/src/ruvector/diff-classifier.d.ts +1 -0
  667. package/dist/src/ruvector/diff-classifier.d.ts.map +1 -1
  668. package/dist/src/ruvector/diff-classifier.js +26 -6
  669. package/dist/src/ruvector/diff-classifier.js.map +1 -1
  670. package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -1
  671. package/dist/src/ruvector/enhanced-model-router.js +24 -2
  672. package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
  673. package/dist/src/ruvector/index.d.ts +1 -2
  674. package/dist/src/ruvector/index.d.ts.map +1 -1
  675. package/dist/src/ruvector/index.js +2 -2
  676. package/dist/src/ruvector/index.js.map +1 -1
  677. package/dist/src/ruvector/model-router.d.ts +4 -2
  678. package/dist/src/ruvector/model-router.d.ts.map +1 -1
  679. package/dist/src/ruvector/model-router.js +30 -6
  680. package/dist/src/ruvector/model-router.js.map +1 -1
  681. package/dist/src/ruvector/moe-router.d.ts +7 -0
  682. package/dist/src/ruvector/moe-router.d.ts.map +1 -1
  683. package/dist/src/ruvector/moe-router.js +35 -12
  684. package/dist/src/ruvector/moe-router.js.map +1 -1
  685. package/dist/src/ruvector/q-learning-router.d.ts +7 -1
  686. package/dist/src/ruvector/q-learning-router.d.ts.map +1 -1
  687. package/dist/src/ruvector/q-learning-router.js +40 -9
  688. package/dist/src/ruvector/q-learning-router.js.map +1 -1
  689. package/dist/src/services/claim-service.d.ts +3 -1
  690. package/dist/src/services/claim-service.d.ts.map +1 -1
  691. package/dist/src/services/claim-service.js +33 -2
  692. package/dist/src/services/claim-service.js.map +1 -1
  693. package/dist/src/services/config-file-manager.d.ts +16 -2
  694. package/dist/src/services/config-file-manager.d.ts.map +1 -1
  695. package/dist/src/services/config-file-manager.js +105 -17
  696. package/dist/src/services/config-file-manager.js.map +1 -1
  697. package/dist/src/services/container-worker-pool.d.ts.map +1 -1
  698. package/dist/src/services/container-worker-pool.js +51 -11
  699. package/dist/src/services/container-worker-pool.js.map +1 -1
  700. package/dist/src/services/headless-worker-executor.d.ts +7 -0
  701. package/dist/src/services/headless-worker-executor.d.ts.map +1 -1
  702. package/dist/src/services/headless-worker-executor.js +188 -45
  703. package/dist/src/services/headless-worker-executor.js.map +1 -1
  704. package/dist/src/services/registry-api.d.ts.map +1 -1
  705. package/dist/src/services/registry-api.js +62 -9
  706. package/dist/src/services/registry-api.js.map +1 -1
  707. package/dist/src/services/ruvector-training.d.ts.map +1 -1
  708. package/dist/src/services/ruvector-training.js +8 -0
  709. package/dist/src/services/ruvector-training.js.map +1 -1
  710. package/dist/src/services/worker-daemon.d.ts +4 -1
  711. package/dist/src/services/worker-daemon.d.ts.map +1 -1
  712. package/dist/src/services/worker-daemon.js +112 -28
  713. package/dist/src/services/worker-daemon.js.map +1 -1
  714. package/dist/src/services/worker-queue.d.ts +9 -2
  715. package/dist/src/services/worker-queue.d.ts.map +1 -1
  716. package/dist/src/services/worker-queue.js +86 -5
  717. package/dist/src/services/worker-queue.js.map +1 -1
  718. package/dist/src/suggest.d.ts.map +1 -1
  719. package/dist/src/suggest.js +9 -0
  720. package/dist/src/suggest.js.map +1 -1
  721. package/dist/src/swarm/flow-enforcer.d.ts +5 -3
  722. package/dist/src/swarm/flow-enforcer.d.ts.map +1 -1
  723. package/dist/src/swarm/flow-enforcer.js +17 -5
  724. package/dist/src/swarm/flow-enforcer.js.map +1 -1
  725. package/dist/src/swarm/flow-visualizer.d.ts +3 -0
  726. package/dist/src/swarm/flow-visualizer.d.ts.map +1 -1
  727. package/dist/src/swarm/flow-visualizer.js +30 -6
  728. package/dist/src/swarm/flow-visualizer.js.map +1 -1
  729. package/dist/src/transfer/anonymization/index.d.ts.map +1 -1
  730. package/dist/src/transfer/anonymization/index.js +5 -3
  731. package/dist/src/transfer/anonymization/index.js.map +1 -1
  732. package/dist/src/transfer/export.d.ts.map +1 -1
  733. package/dist/src/transfer/export.js +5 -3
  734. package/dist/src/transfer/export.js.map +1 -1
  735. package/dist/src/transfer/ipfs/client.d.ts.map +1 -1
  736. package/dist/src/transfer/ipfs/client.js +84 -7
  737. package/dist/src/transfer/ipfs/client.js.map +1 -1
  738. package/dist/src/transfer/ipfs/upload.d.ts.map +1 -1
  739. package/dist/src/transfer/ipfs/upload.js +13 -4
  740. package/dist/src/transfer/ipfs/upload.js.map +1 -1
  741. package/dist/src/transfer/storage/gcs.d.ts.map +1 -1
  742. package/dist/src/transfer/storage/gcs.js +19 -10
  743. package/dist/src/transfer/storage/gcs.js.map +1 -1
  744. package/dist/src/transfer/store/discovery.d.ts +9 -2
  745. package/dist/src/transfer/store/discovery.d.ts.map +1 -1
  746. package/dist/src/transfer/store/discovery.js +68 -13
  747. package/dist/src/transfer/store/discovery.js.map +1 -1
  748. package/dist/src/transfer/store/download.d.ts +15 -6
  749. package/dist/src/transfer/store/download.d.ts.map +1 -1
  750. package/dist/src/transfer/store/download.js +113 -24
  751. package/dist/src/transfer/store/download.js.map +1 -1
  752. package/dist/src/transfer/store/publish.d.ts +1 -1
  753. package/dist/src/transfer/store/publish.d.ts.map +1 -1
  754. package/dist/src/transfer/store/publish.js +13 -14
  755. package/dist/src/transfer/store/publish.js.map +1 -1
  756. package/dist/src/transfer/store/registry.d.ts +3 -3
  757. package/dist/src/transfer/store/registry.d.ts.map +1 -1
  758. package/dist/src/transfer/store/registry.js +32 -16
  759. package/dist/src/transfer/store/registry.js.map +1 -1
  760. package/dist/src/ui/.monomind/sessions/current.json +2 -2
  761. package/dist/src/ui/dashboard.html +2507 -187
  762. package/dist/src/ui/server.mjs +1343 -153
  763. package/dist/src/update/checker.d.ts.map +1 -1
  764. package/dist/src/update/checker.js +17 -4
  765. package/dist/src/update/checker.js.map +1 -1
  766. package/dist/src/update/executor.d.ts.map +1 -1
  767. package/dist/src/update/executor.js +25 -20
  768. package/dist/src/update/executor.js.map +1 -1
  769. package/dist/src/update/rate-limiter.d.ts +11 -0
  770. package/dist/src/update/rate-limiter.d.ts.map +1 -1
  771. package/dist/src/update/rate-limiter.js +23 -3
  772. package/dist/src/update/rate-limiter.js.map +1 -1
  773. package/dist/src/utils/parse-jsonl.d.ts +6 -0
  774. package/dist/src/utils/parse-jsonl.d.ts.map +1 -0
  775. package/dist/src/utils/parse-jsonl.js +22 -0
  776. package/dist/src/utils/parse-jsonl.js.map +1 -0
  777. package/dist/src/workflow/condition-evaluator.d.ts.map +1 -1
  778. package/dist/src/workflow/condition-evaluator.js +37 -3
  779. package/dist/src/workflow/condition-evaluator.js.map +1 -1
  780. package/dist/src/workflow/dag-builder.d.ts.map +1 -1
  781. package/dist/src/workflow/dag-builder.js +27 -11
  782. package/dist/src/workflow/dag-builder.js.map +1 -1
  783. package/dist/src/workflow/dag-executor.d.ts.map +1 -1
  784. package/dist/src/workflow/dag-executor.js +51 -13
  785. package/dist/src/workflow/dag-executor.js.map +1 -1
  786. package/dist/src/workflow/dsl-schema.d.ts +3 -0
  787. package/dist/src/workflow/dsl-schema.d.ts.map +1 -1
  788. package/dist/src/workflow/dsl-schema.js +6 -2
  789. package/dist/src/workflow/dsl-schema.js.map +1 -1
  790. package/dist/src/workflow/template-engine.js +7 -0
  791. package/dist/src/workflow/template-engine.js.map +1 -1
  792. package/dist/src/workflow/workflow-executor.d.ts.map +1 -1
  793. package/dist/src/workflow/workflow-executor.js +95 -14
  794. package/dist/src/workflow/workflow-executor.js.map +1 -1
  795. package/dist/tsconfig.tsbuildinfo +1 -1
  796. package/package.json +5 -2
  797. package/.claude/agents/design/design-brand-guardian.md +0 -323
  798. package/.claude/agents/design/design-image-prompt-engineer.md +0 -237
  799. package/.claude/agents/design/design-inclusive-visuals-specialist.md +0 -72
  800. package/.claude/agents/design/design-ui-designer.md +0 -384
  801. package/.claude/agents/design/design-ux-architect.md +0 -470
  802. package/.claude/agents/design/design-ux-researcher.md +0 -330
  803. package/.claude/agents/design/design-visual-storyteller.md +0 -150
  804. package/.claude/agents/design/design-whimsy-injector.md +0 -439
  805. package/.claude/agents/v3/integration-architect.md +0 -338
  806. package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
  807. package/.claude/commands/coordination/init.md +0 -44
  808. package/.claude/commands/coordination/orchestrate.md +0 -43
  809. package/.claude/commands/coordination/spawn.md +0 -45
  810. package/.claude/commands/github/code-review-swarm.md +0 -550
  811. package/.claude/commands/github/code-review.md +0 -25
  812. package/.claude/commands/github/github-swarm.md +0 -121
  813. package/.claude/commands/github/issue-triage.md +0 -25
  814. package/.claude/commands/github/multi-repo-swarm.md +0 -519
  815. package/.claude/commands/github/pr-enhance.md +0 -26
  816. package/.claude/commands/github/project-board-sync.md +0 -471
  817. package/.claude/commands/github/release-swarm.md +0 -590
  818. package/.claude/commands/github/repo-analyze.md +0 -25
  819. package/.claude/commands/github/swarm-issue.md +0 -482
  820. package/.claude/commands/github/swarm-pr.md +0 -310
  821. package/.claude/commands/github/workflow-automation.md +0 -468
  822. package/.claude/commands/hive-mind/hive-mind-metrics.md +0 -8
  823. package/.claude/commands/hive-mind/hive-mind-resume.md +0 -8
  824. package/.claude/commands/hive-mind/hive-mind-sessions.md +0 -8
  825. package/.claude/commands/hive-mind/hive-mind-wizard.md +0 -8
  826. package/.claude/commands/list-agents.md +0 -17
  827. package/.claude/commands/memory/memory-persist.md +0 -25
  828. package/.claude/commands/memory/memory-usage.md +0 -25
  829. package/.claude/commands/memory/neural.md +0 -47
  830. package/.claude/commands/metrics.md +0 -11
  831. package/.claude/commands/monitoring/real-time-view.md +0 -25
  832. package/.claude/commands/monitoring/swarm-monitor.md +0 -25
  833. package/.claude/commands/monomind-createtask.md +0 -302
  834. package/.claude/commands/monomind-help.md +0 -103
  835. package/.claude/commands/monomind-memory.md +0 -107
  836. package/.claude/commands/monomind-repeat.md +0 -149
  837. package/.claude/commands/monomind-swarm.md +0 -205
  838. package/.claude/commands/optimization/cache-manage.md +0 -25
  839. package/.claude/commands/optimization/topology-optimize.md +0 -25
  840. package/.claude/commands/pair/commands.md +0 -546
  841. package/.claude/commands/pair/config.md +0 -510
  842. package/.claude/commands/pair/start.md +0 -209
  843. package/.claude/commands/use-agent.md +0 -67
  844. package/.claude/skills/monomind-createtask/SKILL.md +0 -269
  845. package/.claude/skills/monomind-task-engine/SKILL.md +0 -358
  846. /package/.claude/agents/{v3 → specialists}/memory-specialist.md +0 -0
  847. /package/.claude/agents/{v3 → specialists}/performance-engineer.md +0 -0
  848. /package/.claude/agents/{v3 → specialists}/queen-coordinator.md +0 -0
  849. /package/.claude/agents/{v3 → specialists}/security-architect.md +0 -0
@@ -0,0 +1,847 @@
1
+ ---
2
+ name: mastermind-architect
3
+ description: Mastermind architect domain — architecture review, file structure deduplication, dependency analysis, coupling detection, design pattern audit, and system design recommendations. Spawns an Architecture Manager coordinating specialist architect agents.
4
+ type: domain-skill
5
+ default_mode: confirm # intentional — architecture changes have high blast radius; always show plan before executing
6
+ ---
7
+
8
+ # Mastermind Architect Domain
9
+
10
+ This skill is invoked by `mastermind:master` or directly via `/mastermind:architect`.
11
+
12
+ ---
13
+
14
+ ## Inputs
15
+
16
+ - `brain_context`: BRAIN CONTEXT block (injected by master, or loaded standalone via _protocol.md brain load)
17
+ - `prompt`: what to architect, review, or redesign
18
+ - `project_name`: monotask space name
19
+ - `board_id`: monotask board ID (set by master, or created standalone)
20
+ - `mode`: auto | confirm
21
+ - `scope`: optional — `review` | `design` | `deduplicate` | `migrate` | `all` | `review+deduplicate` (default: inferred from prompt). `review+deduplicate` is an internal compound scope used by the Iteration Loop — it runs both the review and deduplicate phases (skips design and migrate), equivalent to a partial `all`. It is never set by the user directly.
22
+ - `stack`: optional — detected tech stack hint (e.g. `typescript`, `python`, `react`, `rails`, `go`)
23
+ - `sessionId`: session ID for dashboard events — injected by master as `mm-<YYYYMMDDTHHmmss>`; generated locally for standalone runs (see Standalone Execution)
24
+ - `caller`: optional — `command` | `master` | `standalone` (default: `standalone`) — controls whether the skill runs the Brain Write Procedure at the end
25
+ - `iterate`: optional — integer ≥ 1 (default: 0 = no iteration) — number of autonomous fix+review cycles to run after the initial architect pass
26
+
27
+ ---
28
+
29
+ ## Mode Branching
30
+
31
+ **Before complexity assessment**, check `mode`:
32
+
33
+ - `mode: confirm` (default): After complexity assessment and before spawning any agent, present the architecture plan to the caller — describe the scope inferred, the streams planned, the agents to be spawned, and the phase sequence (for `scope: all`). Wait for the caller to say "go", "proceed", or similar before spawning. If the caller modifies the plan, update accordingly.
34
+ - `mode: auto`: Skip the confirmation step and proceed directly to agent spawning.
35
+
36
+ ---
37
+
38
+ ## Complexity Assessment
39
+
40
+ Assess the prompt to determine execution mode:
41
+
42
+ **Simple (direct execution):** Narrow, single-surface question:
43
+ - "Is this file structure flat enough?"
44
+ - "Should this function be in a service or a repository?"
45
+ - "What pattern fits this use case?"
46
+ → Use a single Software Architect agent. Skip manager delegation.
47
+
48
+ **Complex (spawn Architecture Manager):** Any of these:
49
+ - Full codebase architecture audit
50
+ - File structure deduplication + consolidation plan
51
+ - Cross-module dependency or coupling analysis
52
+ - Multi-layer design (API + domain + infra + data)
53
+ - Migration plan (monolith → microservices, REST → GraphQL, etc.)
54
+ - Greenfield system design from requirements
55
+ - DDD bounded context mapping
56
+ → Spawn Architecture Manager agent with full briefing.
57
+
58
+ **Override:** If `scope == all`, always route to Complex Execution regardless of prompt shape.
59
+
60
+ ---
61
+
62
+ ## Standalone Execution (when called without master)
63
+
64
+ If this skill is invoked directly (not by master):
65
+
66
+ 1. If `sessionId` was not provided by the caller: generate it by taking the current UTC datetime formatted as `YYYYMMDDTHHmmss` and prefixing with `mm-` (e.g. `mm-20260506T142345`). Then emit `session:start` (if `caller` is `standalone` — skip if `command` or `master`, as the caller emits it). Before executing the curl below, substitute the generated sessionId for `<sessionId>`:
67
+ ```bash
68
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
69
+ -H "Content-Type: application/json" \
70
+ -d '{"type":"session:start","session":"<sessionId>","domain":"architect","ts":'"$(date +%s)"'000}' || true
71
+ ```
72
+ 2. Load brain context following _protocol.md Brain Load Procedure (namespace: `architect`)
73
+ 3. Run intake from _intake.md if prompt is vague
74
+ 4. Detect stack from current directory:
75
+ ```bash
76
+ # Detect tech stack
77
+ ls package.json pyproject.toml go.mod Cargo.toml pom.xml build.gradle mix.exs Gemfile 2>/dev/null
78
+ # Count files per extension to determine dominant stack
79
+ find . \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \
80
+ -o -name "*.vue" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \
81
+ -o -name "*.rb" -o -name "*.java" -o -name "*.ex" -o -name "*.exs" \
82
+ -o -name "*.swift" -o -name "*.kt" -o -name "*.cs" -o -name "*.cpp" \
83
+ -o -name "*.gd" \) \
84
+ -not -path "*/node_modules/*" -not -path "*/dist/*" -not -path "*/.git/*" \
85
+ | awk -F. '{print $NF}' | sort | uniq -c | sort -rn | head -10
86
+ ```
87
+ After the bash above completes, apply the 60% classification rule: sum the total file count across all extensions. If any single extension group exceeds 60% of the total, set `<stack>` to that stack's name (e.g. `typescript`, `python`, `go`); otherwise set `<stack>` to `multi-stack`. Use this value for `Stack: <stack>` in all subsequent briefings.
88
+ If `scope` was not provided by the caller, infer it from the prompt: "review"/"audit"/"check"/"assess" → `review`; "deduplicate"/"dedup"/"consolidate" → `deduplicate`; "design"/"architect"/"model"/"bounded context" → `design`; "migrate"/"migration"/"port to"/"convert" → `migrate`; no keyword match or multiple keyword matches → `all`. Use the resolved scope for all subsequent steps.
89
+ 5. If `board_id` was not provided by the caller: find or create monotask space `<project_name>`, then create board `architect` within it. Before executing the bash block below, substitute the resolved `project_name` (or `basename "$PWD"` if not provided) for every `<project_name>` occurrence:
90
+ ```bash
91
+ space_id=$(monotask space list 2>/dev/null | awk -F' \| ' -v n="<project_name>" '$2==n{print $1}' | head -1)
92
+ [ -z "$space_id" ] && space_id=$(monotask space create "<project_name>" 2>&1 | grep -oE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')
93
+ result=$(monotask board create "architect" --json 2>/dev/null)
94
+ board_id=$(echo "$result" | jq -r '.id // empty')
95
+ [ -n "$board_id" ] && [ -n "$space_id" ] && monotask space boards add "$space_id" "$board_id" >/dev/null 2>&1 || true
96
+ [ -z "$board_id" ] && { echo "ERROR: Failed to create monotask board — verify monotask is installed (run: monotask --version)"; exit 1; }
97
+ echo "$board_id"
98
+ ```
99
+ If this block exits with an error (board_id is still empty), stop execution and return an error to the caller — do not proceed to complexity assessment.
100
+ 6. Proceed with complexity assessment below
101
+ 7. At end: emit `session:complete` (if `caller` is `standalone`). Before executing the curl below, substitute the resolved sessionId for `<sessionId>`:
102
+ ```bash
103
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
104
+ -H "Content-Type: application/json" \
105
+ -d '{"type":"session:complete","session":"<sessionId>","domain":"architect","ts":'"$(date +%s)"'000}' || true
106
+ ```
107
+ Then: if `caller` is `standalone` (default), follow _protocol.md Brain Write Procedure (namespace: `architect`). If `caller` is `command` or `master`, skip — the caller handles the brain write.
108
+
109
+ ---
110
+
111
+ ## Stack Detection & Specialist Routing
112
+
113
+ After detecting the stack, route to the appropriate specialist lens. If no single extension group exceeds 60% of total matched files, classify as **Multi-stack / Unknown** and use that row regardless of any individual extension count.
114
+
115
+ | Stack | Primary Architect Agent | Secondary Agents |
116
+ |---|---|---|
117
+ | TypeScript / Node.js | Software Architect | Backend Architect, Database Optimizer |
118
+ | Python / FastAPI / Django | Software Architect | Backend Architect, Database Optimizer |
119
+ | React / Next.js / Vue | Software Architect | Frontend Developer |
120
+ | Go | Software Architect | Backend Architect, SRE (Site Reliability Engineer) |
121
+ | Ruby on Rails | Software Architect | Backend Architect, Database Optimizer |
122
+ | Elixir / Phoenix | Software Architect | Backend Architect |
123
+ | Java / Spring | Software Architect | Backend Architect |
124
+ | Rust | Software Architect | Backend Architect |
125
+ | Mobile (React Native / Swift / Kotlin) | Mobile App Builder | Software Architect |
126
+ | Game (Unity) | Unity Architect | Game Designer |
127
+ | Game (Unreal) | Unreal Systems Engineer | Game Designer |
128
+ | Game (Godot) | Software Architect | Game Designer |
129
+ | Multi-stack / Unknown | Software Architect | Backend Architect, Database Optimizer |
130
+
131
+ ---
132
+
133
+ ## Architecture Review Checklist
134
+
135
+ When `scope` includes `review`, evaluate ALL of the following dimensions:
136
+
137
+ ### 1. File Structure & Organization
138
+ - [ ] Flat vs. deep nesting — flag directories deeper than 4 levels
139
+ - [ ] Duplicate functionality across files (same logic in 2+ places)
140
+ - [ ] Files that should be split (>500 lines, multiple concerns)
141
+ - [ ] Files that should be merged (tiny files <20 lines with trivial single-use exports)
142
+ - [ ] Barrel files (`index.ts`) hiding internals vs. exposing surface
143
+ - [ ] Naming inconsistency (camelCase vs snake_case vs kebab-case mixed)
144
+ - [ ] Test files co-located vs. separate `__tests__` / `spec` directory — flag if placement is inconsistent across the project (mixing both conventions is the issue; either approach alone is acceptable)
145
+
146
+ ### 2. Dependency & Coupling
147
+ - [ ] Circular imports / circular dependencies
148
+ - [ ] God modules (one file imported by >15 others)
149
+ - [ ] High afferent coupling (many dependents → risky to change)
150
+ - [ ] High efferent coupling (depends on many → fragile)
151
+ - [ ] Direct database access outside repository/data layer
152
+ - [ ] Business logic leaking into controllers, routes, or UI
153
+ - [ ] Hardcoded dependencies (no injection, no interface)
154
+
155
+ ### 3. Design Patterns
156
+ - [ ] Repository pattern applied to data access?
157
+ - [ ] Service layer separating business logic from transport?
158
+ - [ ] Factory or Builder for complex object creation?
159
+ - [ ] Strategy pattern where switch/if-else chains appear on type
160
+ - [ ] Observer/Event bus for cross-module communication?
161
+ - [ ] Anti-patterns present: God Object, Anemic Domain Model, Shotgun Surgery, Feature Envy
162
+
163
+ ### 4. Domain-Driven Design
164
+ - [ ] Bounded contexts identified and respected?
165
+ - [ ] Domain models free of infrastructure concerns?
166
+ - [ ] Aggregates enforce invariants?
167
+ - [ ] Domain events for cross-context communication?
168
+ - [ ] Ubiquitous language consistent in naming?
169
+
170
+ ### 5. API Design
171
+ - [ ] REST: resource-based, consistent naming, correct HTTP verbs and status codes
172
+ - [ ] Input validation at boundary (not inside domain)?
173
+ - [ ] Error contracts consistent and typed?
174
+ - [ ] Versioning strategy present?
175
+ - [ ] Auth/authz consistent across endpoints?
176
+
177
+ ### 6. Data Layer
178
+ - [ ] N+1 query risks
179
+ - [ ] Missing indexes on frequently queried fields
180
+ - [ ] Schema migration strategy
181
+ - [ ] Connection pooling configured
182
+ - [ ] Sensitive data in logs or error messages
183
+
184
+ ### 7. Observability & Operations
185
+ - [ ] Structured logging with correlation IDs
186
+ - [ ] Health check endpoints
187
+ - [ ] Metrics instrumentation
188
+ - [ ] Graceful shutdown handling
189
+ - [ ] Error boundaries / recovery paths
190
+
191
+ ### 8. Security Architecture
192
+ - [ ] Input validation at all external boundaries
193
+ - [ ] Secrets in environment variables, not source
194
+ - [ ] Dependency audit (`npm audit`, `pip-audit`, `cargo audit`)
195
+ - [ ] Auth middleware applied consistently
196
+ - [ ] CORS / rate limiting configured
197
+
198
+ ---
199
+
200
+ ## File Structure Deduplication Procedure
201
+
202
+ When `scope` includes `deduplicate`:
203
+
204
+ ```bash
205
+ # Shared extension set used by steps 1-4 (mirrors stack detection list)
206
+ # Outer parens make this a bash array; inner \( \) become a find grouping expression
207
+ _EXTS=( \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \
208
+ -o -name "*.vue" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \
209
+ -o -name "*.rb" -o -name "*.java" -o -name "*.ex" -o -name "*.exs" \
210
+ -o -name "*.swift" -o -name "*.kt" -o -name "*.cs" -o -name "*.cpp" \
211
+ -o -name "*.gd" \) )
212
+
213
+ # 1. Find duplicate file names across the tree (excludes dist, node_modules, .git, test/spec dirs)
214
+ # Uses -not -path for macOS/BSD portability (grep -z is GNU-only)
215
+ find . -type f "${_EXTS[@]}" \
216
+ -not -path "*/node_modules/*" -not -path "*/dist/*" -not -path "*/.git/*" \
217
+ -not -path "*/__tests__/*" -not -path "*/spec/*" \
218
+ | awk -F/ '{print $NF}' \
219
+ | sort | uniq -d | head -30
220
+
221
+ # 2. Find files with identical content (exact duplicates)
222
+ # openssl md5 output: "MD5(path)= hash" — awk groups all lines by hash ($NF) and prints every
223
+ # file in a duplicate group (all occurrences when count > 1, so both files in a pair are shown)
224
+ find . -type f "${_EXTS[@]}" \
225
+ -not -path "*/node_modules/*" -not -path "*/dist/*" -not -path "*/.git/*" \
226
+ -print0 | xargs -0 openssl md5 2>/dev/null \
227
+ | awk '{hash=$NF; files[hash]=files[hash] " " $0; count[hash]++}
228
+ END {for (h in count) if (count[h]>1) print files[h]}' | head -20
229
+
230
+ # 3. Find very small files that may be consolidation candidates
231
+ find . -type f "${_EXTS[@]}" \
232
+ -not -path "*/node_modules/*" -not -path "*/dist/*" -not -path "*/.git/*" \
233
+ -not -path "*/__tests__/*" -not -path "*/spec/*" \
234
+ -print0 | xargs -0 wc -l 2>/dev/null | grep -v ' total$' | sort -n | awk '$1 > 0 && $1 < 20 {print}' | head -20
235
+
236
+ # 4. Find oversized files that need splitting (also excludes test/spec dirs)
237
+ find . -type f "${_EXTS[@]}" \
238
+ -not -path "*/node_modules/*" -not -path "*/dist/*" -not -path "*/.git/*" \
239
+ -not -path "*/__tests__/*" -not -path "*/spec/*" \
240
+ -print0 | xargs -0 wc -l 2>/dev/null | sort -rn | grep -v ' total$' | head -20
241
+
242
+ # 5. Detect circular dependencies (TypeScript/JS)
243
+ # Auto-detect entry dir: prefer src/, app/, lib/ over packages/ (avoid monorepo root scan)
244
+ for _d in src app lib packages; do [ -d "$_d" ] && _entry="$_d" && break; done
245
+ _entry=${_entry:-.}
246
+ { npx --yes madge --circular --ts-config tsconfig.json "$_entry/" 2>/dev/null || \
247
+ npx --yes madge --circular "$_entry/" 2>/dev/null; } | head -20
248
+
249
+ # 6. Find god files (imported by many others)
250
+ # NOTE: This step covers JS/TS/Vue and Python only.
251
+ # For Go, Rust, Java, and other stacks, use mcp__monomind__monograph_god_nodes instead.
252
+ # JS/TS/Vue: skip comment lines; perl extracts module name from from '...' or from "..."
253
+ # --exclude-dir applied at grep level so exclusions work before -h strips filenames
254
+ grep -rh "^[^/]*from ['\"]" . \
255
+ --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" --include="*.vue" \
256
+ --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.git \
257
+ 2>/dev/null \
258
+ | perl -ne 'if (/from\s+['"'"'"]([^'"'"'"\s]+)['"'"'"]/) { print "$1\n" }' \
259
+ | sort | uniq -c | sort -rn | head -20
260
+ # Python: count imports separately (no quotes in Python import syntax)
261
+ grep -rh "^from \|^import " . --include="*.py" \
262
+ --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.git \
263
+ 2>/dev/null \
264
+ | awk '{print $2}' | sed 's/,.*//' | sed 's/\..*//' | grep -v '^$' | sort | uniq -c | sort -rn | head -20
265
+ # Note: if monograph is built, prefer mcp__monomind__monograph_god_nodes — it uses the pre-computed graph index
266
+ ```
267
+
268
+ For each finding, produce a **Deduplication Action Table**:
269
+
270
+ | File | Issue | Action | Risk |
271
+ |---|---|---|---|
272
+ | `src/utils/helpers.ts` | Duplicate of `src/lib/helpers.ts` | Merge into `src/lib/helpers.ts`, update 3 imports | Low |
273
+ | `src/controllers/user.ts` | 847 lines, 3 concerns | Split into UserController + UserQueryController + UserMutationController | Medium |
274
+
275
+ ---
276
+
277
+ ## Complex Execution — Architecture Manager Agent
278
+
279
+ Before spawning, resolve two values:
280
+
281
+ **Manager subagent_type** (based on detected stack):
282
+ - Mobile (React Native / Swift / Kotlin) → `Mobile App Builder`
283
+ - Game (Unity) → `Unity Architect`
284
+ - Game (Unreal) → `Unreal Systems Engineer`
285
+ - All other stacks → `Software Architect`
286
+
287
+ **Current UTC date**: run `date -u +%Y-%m-%d` in Bash and substitute the output for every `<current UTC date YYYY-MM-DD>` placeholder in the briefing below.
288
+
289
+ Then emit `agent:spawn` for the manager and spawn it. Before executing the curl below, substitute the resolved sessionId for `<sessionId>`:
290
+
291
+ ```bash
292
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
293
+ -H "Content-Type: application/json" \
294
+ -d '{"type":"agent:spawn","session":"<sessionId>","domain":"architect","agent":"<manager_agent_type lowercased and hyphenated, e.g. software-architect>","task":"coordinate architecture analysis","ts":'"$(date +%s)"'000}'
295
+ ```
296
+
297
+ Before constructing the Task() string, substitute the following into the template:
298
+ - `<project_name>` → resolved project name
299
+ - `<sessionId>` → the sessionId resolved in Standalone Execution or passed by caller
300
+ - `<current UTC date YYYY-MM-DD>` → output of `date -u +%Y-%m-%d` (already run above)
301
+ - `<mode>` → resolved mode value (`auto` or `confirm`)
302
+ - `<board_id>` → resolved board_id value
303
+ - `<manager_agent_type>` → agent type resolved above (also used in `subagent_type:`)
304
+ - `<scope>` → resolved scope, or fallback text `"inferred from prompt in STEP 2"` if not yet known
305
+ - `<stack>` → resolved stack, or fallback text `"auto-detect in STEP 1"` if not yet known
306
+ - `<prompt>` → caller's prompt — strip double-quotes and backslashes for JSON safety, then escape backtick characters as `` \` `` and replace `${` with `\${` for template-literal safety
307
+ - `<brain_context>` → injected brain context — apply the same backtick and `${` escaping
308
+
309
+ ```javascript
310
+ Task({
311
+ subagent_type: "<manager_agent_type>",
312
+ description: `You are the Architecture Manager for project <project_name>.
313
+
314
+ CONTEXT: <current UTC date YYYY-MM-DD> | Session: <sessionId> | Mode: <mode> | Project: <project_name> | Requested stack hint: <stack if provided by caller, else "auto-detect in STEP 1"> | Scope: <scope if provided, else "inferred from prompt in STEP 2"> | Spawned by: mastermind:architect
315
+
316
+ BRAIN CONTEXT:
317
+ <brain_context>
318
+
319
+ YOUR BOARD: <board_id>
320
+ YOUR GOAL: <prompt>
321
+ SCOPE: <scope>
322
+
323
+ STEP 1 — ORIENT
324
+ Detect the tech stack and project structure:
325
+
326
+ \`\`\`bash
327
+ ls package.json pyproject.toml go.mod Cargo.toml pom.xml build.gradle mix.exs Gemfile 2>/dev/null
328
+ find . -maxdepth 3 -type d | grep -Ev "(^|/)(node_modules|dist|\\.git)(/|$)" | head -40
329
+ find . \\( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \\
330
+ -o -name "*.vue" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \\
331
+ -o -name "*.rb" -o -name "*.java" -o -name "*.ex" -o -name "*.exs" \\
332
+ -o -name "*.swift" -o -name "*.kt" -o -name "*.cs" -o -name "*.cpp" \\
333
+ -o -name "*.gd" \\) -not -path "*/node_modules/*" -not -path "*/dist/*" -not -path "*/.git/*" \\
334
+ | awk -F. '{print $NF}' | sort | uniq -c | sort -rn | head -10
335
+ \`\`\`
336
+
337
+ After STEP 1 completes: sum the total file count across all extensions. If any single extension group accounts for >60% of the total, classify the stack using that extension's row in the Stack Detection table. If no single extension exceeds 60%, classify as Multi-stack / Unknown. Set the `<stack>` placeholder to the resolved value (e.g. "typescript", "python", "go", "multi-stack"). Use this value for every `<stack>` occurrence in all STEP 3 task briefings below.
338
+
339
+ (Duplicate detection and god-file analysis will be delegated to sub-agents in STEP 3 — no further action needed here.)
340
+
341
+ STEP 2 — PLAN
342
+ **If scope was not pre-resolved by the caller:** infer it from the prompt — "review"/"audit"/"check"/"assess" → `review`; "deduplicate"/"dedup"/"consolidate" → `deduplicate`; "design"/"architect"/"model"/"bounded context" → `design`; "migrate"/"migration"/"port to"/"convert" → `migrate`; multi-match or no match → `all`. Set `<scope>` to the resolved value and use it throughout all subsequent STEPs.
343
+
344
+ Decompose the architecture goal into parallel specialist streams based on scope:
345
+
346
+ - **review**: structure, coupling, patterns, DDD, API design, data, observability, security
347
+ - **deduplicate**: exact duplicates, oversized files, undersized files, circular deps, god files
348
+ - **design**: bounded contexts, layer boundaries, interface contracts, data model
349
+ - **migrate**: current-state mapping, target-state design, migration sequence, risk assessment
350
+ - **all**: run all four streams — review first (establishes baseline), then deduplicate, then design for any unaddressed gaps, then migrate if a migration target is identified from the design phase
351
+ - **review+deduplicate**: run only review and deduplicate streams in sequence (same as `all` phases 1–2; skip design and migrate). Used by the Iteration Loop for re-review cycles on `scope: all` runs.
352
+
353
+ For each stream, identify:
354
+ - Which dimension of the checklist it covers
355
+ - Which specialist agent is most suited (see Stack Detection table)
356
+ - What concrete artifacts it must produce (diagram, action table, ADR, etc.)
357
+ - Dependencies between streams (e.g. coupling analysis before deduplication plan)
358
+
359
+ STEP 3 — CREATE TASKS
360
+ For each architecture stream, create a monotask card on the project board. First resolve column IDs (slash commands are not available inside background Task agents — use bash directly):
361
+
362
+ \`\`\`bash
363
+ columns=$(monotask column list "$BOARD_ID" --json)
364
+ COL_TODO_ID=$(echo "$columns" | jq -r '.[] | select(.title == "Todo" or .title == "Backlog") | .id' | head -1)
365
+ COL_DONE_ID=$(echo "$columns" | jq -r '.[] | select(.title == "Done") | .id' | head -1)
366
+ \`\`\`
367
+
368
+ Then create the card:
369
+
370
+ \`\`\`bash
371
+ result=$(monotask card create "$BOARD_ID" "$COL_TODO_ID" "<short summary of architecture stream goal, ≤80 chars>" --json)
372
+ CARD_ID=$(echo "$result" | jq -r '.id // empty')
373
+ monotask card set-description "$BOARD_ID" "$CARD_ID" "[specific architecture dimension to assess or design]"
374
+ monotask card comment add "$BOARD_ID" "$CARD_ID" "CONTEXT: <current UTC date YYYY-MM-DD> | Session: <sessionId> | Project: <project_name> | Stack: <stack> | Created by: Architecture Manager
375
+ BRAIN MEMORY: [paste most relevant 3-5 brain context excerpts]
376
+ SCOPE: [exact files, modules, or surfaces in scope]
377
+ CHECKLIST: [specific items from the architecture review checklist to evaluate]
378
+ CONSTRAINTS: [existing decisions not to revisit, performance budgets, team skill constraints]
379
+ SUCCESS CRITERIA:
380
+ - [ ] [e.g. all circular deps mapped with import paths]
381
+ - [ ] [e.g. deduplication action table with risk ratings]
382
+ - [ ] [e.g. ADR written for each major design decision]
383
+ AGENT: [Software Architect | Backend Architect | Database Optimizer | Frontend Developer | SRE (Site Reliability Engineer)]
384
+ SWARM: [consult Domain Swarm Defaults table — e.g. mesh 3 gossip for coupling analysis, hive-mind byzantine for security]
385
+ DEPENDENCIES: [task IDs or none]
386
+ OUTPUT FORMAT:
387
+ findings:
388
+ - severity: CRITICAL | HIGH | MEDIUM | LOW
389
+ dimension: [checklist dimension, e.g. 2. Dependency & Coupling]
390
+ description: [one-sentence description of the issue]
391
+ affected: [files or modules impacted]
392
+ recommendation: [specific actionable fix]
393
+ summary: [one-paragraph overview of findings for this stream]
394
+ artifacts: [list of files written to disk, or empty list]
395
+ confidence: [0.0-1.0 - how complete the coverage was for this stream]"
396
+ \`\`\`
397
+
398
+ STEP 4 — EXECUTE
399
+ The caller already confirmed the plan before spawning this manager — proceed directly to spawning all specialist agents for the current phase.
400
+
401
+ **For single-scope runs** (`review`, `deduplicate`, `design`, or `migrate`): spawn all relevant agents in parallel.
402
+
403
+ **For `scope: all`**: execute streams sequentially in phases:
404
+ - Phase 1 (parallel): review streams → wait for completion. Phase 1 always runs under `scope: all` — there is no skip condition.
405
+ - After Phase 1 completes: call `mcp__monomind__memory_store` (namespace: `architect:<sessionId>`, key: `phase1_findings`, value: summarized Phase 1 output). Record `review` in `phases_run`.
406
+ - Before starting Phase 2: call `mcp__monomind__memory_retrieve` (namespace: `architect:<sessionId>`, key: `phase1_findings`) to retrieve the stored findings. Inject verbatim into every Phase 2 task briefing under a `PRIOR PHASE FINDINGS:` section. If Phase 1 findings are empty, write "Phase 1 produced no findings — proceed without prior context" under that section rather than leaving it blank.
407
+ - Phase 2 (parallel, uses Phase 1 findings as input): deduplicate streams. Phase 2 always runs under `scope: all` — there is no skip condition.
408
+ - After Phase 2 completes: call `mcp__monomind__memory_store` (namespace: `architect:<sessionId>`, key: `phase2_findings`). Record `deduplicate` in `phases_run`.
409
+ - Before starting Phase 3: call `mcp__monomind__memory_retrieve` (namespace: `architect:<sessionId>`) for `phase1_findings` and `phase2_findings`. Inject both into every Phase 3 briefing under `PRIOR PHASE FINDINGS:`. If a retrieve returns empty, substitute "No findings from Phase N."
410
+ - **Phase 3 runs only if Phase 2 identified gaps** (files flagged for redesign, missing abstractions, or unresolved coupling issues). If no gaps are found, skip Phase 3, record "design — Phase 2 found no gaps" in `phases_skipped`, and proceed to Phase 4 evaluation.
411
+ - Phase 3 (parallel, conditional on Phase 2 gaps): design streams
412
+ - After Phase 3 completes: call `mcp__monomind__memory_store` (namespace: `architect:<sessionId>`, key: `phase3_findings`). If a migration target was identified, also store it (namespace: `architect:<sessionId>`, key: `migration_target`). Record `design` in `phases_run`.
413
+ - Before starting Phase 4: call `mcp__monomind__memory_retrieve` (namespace: `architect:<sessionId>`, key: `migration_target`). If the result is empty or absent, skip Phase 4 and record "migrate — Phase 3 did not run or identified no migration target" in `phases_skipped`. Otherwise also retrieve `phase1_findings`, `phase2_findings`, `phase3_findings` (namespace: `architect:<sessionId>`) and inject all four values into every Phase 4 briefing (prior findings under `PRIOR PHASE FINDINGS:`, migration target under `MIGRATION TARGET:`). Substitute "No findings from Phase N." for any prior-findings retrieves that return empty.
414
+ - **Phase 4 runs only if Phase 3 stored a non-empty `migration_target`**.
415
+ - Phase 4 (spawn ONLY if Phase 3 identifies a migration target): migrate streams
416
+ - After Phase 4 completes: call `mcp__monomind__memory_store` (namespace: `architect:<sessionId>`, key: `phase4_findings`, value: summarized Phase 4 output). Record `migrate` in `phases_run`.
417
+
418
+ Default agent routing (applies to all scopes). **Stack overrides**: for specialized stacks, replace ALL "Software Architect" rows with the primary agent from the Stack Detection table (e.g. Mobile App Builder replaces Software Architect across all streams for React Native/Swift/Kotlin). Keep domain-specific agents (Database Optimizer, Security Engineer, SRE) unchanged regardless of stack.
419
+
420
+ - Structure + dedup: subagent_type "Software Architect"
421
+ - Coupling + god files: subagent_type "Software Architect"
422
+ - Data layer: subagent_type "Database Optimizer"
423
+ - API surface: subagent_type "Backend Architect"
424
+ - Security posture: subagent_type "Security Engineer"
425
+ - Frontend architecture (if applicable): subagent_type "Frontend Developer"
426
+ - Observability: subagent_type "SRE (Site Reliability Engineer)"
427
+
428
+ For each specialist, spawn via the Claude Code Task tool using the full briefing text written in STEP 3 as the description. Spawn all specialists for the current phase in one message with `run_in_background: true`:
429
+ ```javascript
430
+ Task({
431
+ subagent_type: "<agent type from routing table above>",
432
+ description: `<paste the full STEP 3 task briefing verbatim — not a summary>`,
433
+ run_in_background: true
434
+ })
435
+ ```
436
+ The `description` must be the complete briefing, including CONTEXT, BRAIN MEMORY, GOAL, SCOPE, CHECKLIST, CONSTRAINTS, SUCCESS CRITERIA, AGENT, SWARM, DEPENDENCIES, and OUTPUT FORMAT. Do NOT summarize.
437
+
438
+ BEFORE spawning each agent, emit agent:spawn to the live dashboard. Before each of the following curl commands executes, `<sessionId>` must already be substituted with the session ID from the CONTEXT header Session field above. When substituting `<stream-description>` and other free-text fields into the JSON payload, strip any double-quotes and backslashes from the value to keep the JSON well-formed:
439
+ \`\`\`bash
440
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
441
+ -H "Content-Type: application/json" \
442
+ -d '{"type":"agent:spawn","session":"<sessionId>","domain":"architect","agent":"<subagent_type lowercased and hyphenated, e.g. software-architect>","task":"<stream-description>","ts":'"$(date +%s)"'000}'
443
+ \`\`\`
444
+
445
+ If handing off artifacts to another domain (e.g. build for refactoring implementation, review for post-restructure check), emit intercom. When substituting `<msg>` and other free-text fields, strip any double-quotes and backslashes from the value to keep the JSON well-formed:
446
+ \`\`\`bash
447
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
448
+ -H "Content-Type: application/json" \
449
+ -d '{"type":"intercom","session":"<sessionId>","from":"architect","to":"<domain>","msg":"<msg>","ts":'"$(date +%s)"'000}'
450
+ \`\`\`
451
+
452
+ To track task execution, log progress via \`monotask card comment add "$BOARD_ID" "$CARD_ID" "<progress update>"\`. When a task is fully done, move the card to Done: \`monotask card move "$BOARD_ID" "$CARD_ID" "$COL_DONE_ID" --json\`.
453
+
454
+ BEFORE returning, emit domain:complete to the live dashboard:
455
+ \`\`\`bash
456
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
457
+ -H "Content-Type: application/json" \
458
+ -d '{"type":"domain:complete","session":"<sessionId>","domain":"architect","status":"<choose: complete | partial | blocked>","artifacts":[],"decisions":[],"ts":'"$(date +%s)"'000}'
459
+ \`\`\`
460
+
461
+ STEP 5 — SYNTHESIZE
462
+ Collect all findings. Produce:
463
+ 1. **Architecture Health Score** (0–100) by dimension — maps to `decisions` (one entry per dimension: `score` = health score 0–100, `confidence` = how certain the assessment is, e.g. 0.8 if based on full scan, 0.4 if partial)
464
+ 2. **Deduplication Action Table** (if scope includes deduplicate) — maps to `artifacts` (write to disk as `architecture-dedup-action-table.md`; include path)
465
+ 3. **Critical Issues List** (must-fix before next release) — maps to `next_actions` (each critical issue becomes a next_action prefixed with "[CRITICAL]")
466
+ 4. **Recommended ADRs** (Architecture Decision Records for open decisions) — maps to `artifacts` (each ADR written to disk; include path) and `decisions` (one entry per ADR with the decision summary)
467
+ 5. **Refactoring Roadmap** (prioritized by impact/effort matrix) — maps to `next_actions` (each roadmap item becomes a next_action in priority order)
468
+ 6. **Lessons** — maps to `lessons`: set `what_worked` to which analysis streams surfaced the most actionable findings; set `what_didnt` to coverage gaps, streams that returned no findings, or streams blocked by missing tooling.
469
+ 7. **Findings** — aggregate all `findings` arrays from every specialist task output into a top-level `findings` field, preserving the `{severity, dimension, description, affected, recommendation}` structure from the OUTPUT FORMAT. Include all severity levels (CRITICAL, HIGH, MEDIUM, LOW). This field is consumed by the Iteration Loop — do not omit it.
470
+
471
+ Return to caller:
472
+
473
+ domain: architect
474
+ status: <choose: complete | partial | blocked>
475
+ phases_run:
476
+ - review # always included for scope: all
477
+ - deduplicate # always included for scope: all
478
+ - design # include only if Phase 2 identified gaps
479
+ - migrate # include only if Phase 3 stored migration_target
480
+ phases_skipped:
481
+ - [e.g. "design — Phase 2 found no gaps"]
482
+ - [e.g. "migrate — Phase 3 identified no migration target"]
483
+ artifacts:
484
+ - path: [architecture report if written to disk]
485
+ type: report
486
+ - path: [ADR files if written]
487
+ type: adr
488
+ - path: [deduplication action table if written]
489
+ type: table
490
+ decisions:
491
+ - what: [architectural dimension or decision]
492
+ why: [evidence and tradeoffs]
493
+ score: [0–100 health score for dimension entries; null for ADR entries that have no numeric health dimension]
494
+ confidence: [0.0–1.0 — certainty in this assessment or decision]
495
+ outcome: pending
496
+ lessons:
497
+ - what_worked: [which analysis streams surfaced the most value]
498
+ - what_didnt: [gaps in coverage]
499
+ next_actions:
500
+ - [e.g. "[CRITICAL] fix circular dep between src/auth and src/user before next release"]
501
+ - [e.g. "run mastermind:build to implement refactoring plan"]
502
+ - [e.g. "run mastermind:review after restructuring is complete"]
503
+ findings:
504
+ - severity: CRITICAL | HIGH | MEDIUM | LOW
505
+ dimension: [checklist dimension, e.g. "2. Dependency & Coupling"]
506
+ description: [one-sentence description of the issue]
507
+ affected: [files or modules impacted]
508
+ recommendation: [specific actionable fix]
509
+ # ... one entry per finding aggregated from all specialist task outputs
510
+ board_url: monotask://<project_name>/architect # substitute actual project_name before returning
511
+ session_id: <sessionId> # substitute the sessionId value from the CONTEXT header Session field before returning
512
+
513
+ # Note for single-scope runs (review, deduplicate, design, or migrate only):
514
+ # set phases_run: [<scope>]
515
+ # set phases_skipped to the three scopes that were not run, one entry each. Example for scope=review:
516
+ # - "deduplicate — not applicable for single-scope run"
517
+ # - "design — not applicable for single-scope run"
518
+ # - "migrate — not applicable for single-scope run"`,
519
+ run_in_background: true
520
+ })
521
+ ```
522
+
523
+ **If `iterate` ≥ 1:** After the Architecture Manager returns its output schema, the outer skill (not the manager) stores the initial findings and activity tag for the Iteration Loop:
524
+ ```
525
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_0_findings", value: <manager output schema findings serialized as JSON>)
526
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_0_activity", value: "review")
527
+ ```
528
+ Then proceed to the Iteration Loop section.
529
+
530
+ ---
531
+
532
+ ## Simple Execution
533
+
534
+ For simple tasks (single specialist, single question):
535
+
536
+ **Before step 1:** Resolve the specialist agent from the Stack Detection table using the detected stack. For Mobile (React Native / Swift / Kotlin) use `Mobile App Builder`; for Game (Unity) use `Unity Architect`; for Game (Unreal) use `Unreal Systems Engineer`; for all other stacks use `Software Architect`. Use the resolved type for `subagent_type` in step 2 and the lowercased-hyphenated slug for the dashboard `agent:` field in step 1.
537
+
538
+ Before executing the curl blocks below and when constructing the Task() description, substitute the resolved sessionId for `<sessionId>`. When substituting `<prompt>` into the JSON payload below, strip any double-quotes and backslashes from the value to keep the JSON well-formed. When substituting `<prompt>` into the Task description template literal in step 2, additionally escape any backtick characters as `` \` `` and replace any `${` sequences with `\${` to prevent template-literal injection.
539
+
540
+ 1. Emit `agent:spawn` to the dashboard (use the resolved agent slug):
541
+ ```bash
542
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
543
+ -H "Content-Type: application/json" \
544
+ -d '{"type":"agent:spawn","session":"<sessionId>","domain":"architect","agent":"<resolved agent slug, e.g. software-architect>","task":"<prompt>","ts":'"$(date +%s)"'000}'
545
+ ```
546
+ 2. Spawn one Task agent (`subagent_type: "<resolved agent type>"`) with a self-contained briefing. The briefing MUST include:
547
+ ```
548
+ CONTEXT: <current UTC date YYYY-MM-DD> | Session: <sessionId> | Project: <project_name> | Scope: <scope> | Stack: <stack>
549
+ BRAIN CONTEXT: <relevant excerpts from brain_context>
550
+ GOAL: <prompt>
551
+ DIRECTORY STRUCTURE: <output of find below>
552
+ ```
553
+ 3. Include current directory structure context (`find . -maxdepth 3 -type d | grep -Ev "(^|/)(node_modules|dist|\.git)(/|$)"`)
554
+ 4. Collect output, then emit `domain:complete`:
555
+ ```bash
556
+ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
557
+ -H "Content-Type: application/json" \
558
+ -d '{"type":"domain:complete","session":"<sessionId>","domain":"architect","status":"complete","artifacts":[],"decisions":[],"ts":'"$(date +%s)"'000}'
559
+ ```
560
+ 5. Return the full unified output schema (same structure as Complex Execution STEP 5). Set `phases_run: [<scope>]`. Set `phases_skipped` to a separate entry for each of the three non-run scopes, naming each explicitly — e.g. for scope=design:
561
+ ```yaml
562
+ phases_skipped:
563
+ - "review — not applicable for single-scope run"
564
+ - "deduplicate — not applicable for single-scope run"
565
+ - "migrate — not applicable for single-scope run"
566
+ ```
567
+ Set `artifacts: []` (unless the agent produced files), and populate `decisions` and `next_actions` from the single-agent output. Set `status: complete`. Set `lessons.what_worked` to what the single agent was able to assess; set `lessons.what_didnt` to what it was unable to cover (e.g. stacks not detected, missing tooling, phases not run).
568
+
569
+ **If `iterate` ≥ 1:** After returning the output schema, store the initial findings and activity tag for the Iteration Loop:
570
+ ```
571
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_0_findings", value: <output schema findings serialized as JSON>)
572
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_0_activity", value: "review")
573
+ ```
574
+ Then proceed to the Iteration Loop section.
575
+
576
+ ---
577
+
578
+ ## Iteration Loop (only when `iterate` ≥ 1)
579
+
580
+ After the initial architect pass completes and its output schema is available, run up to `iterate` autonomous fix+review cycles. Each cycle alternates between **fix** (implement what the previous review found) and **review** (re-run architect to validate the fixes). Cycles never pause for user confirmation — always use `mode: auto` internally.
581
+
582
+ **Early-stop condition:** After a **review** cycle only, starting from cycle 2 — if `i > 1` AND `last_activity == "review"` AND CRITICAL + HIGH count == 0 (MEDIUM findings do not block early-stop), stop immediately: set `actual_cycles_run = i - 1` (cycle `i-1` was the last cycle that actually ran), skip the post-loop guard and the unresolved-issues checkpoint (count is 0 by definition), and report:
583
+ > "Architecture clean — no CRITICAL or HIGH findings remain. Halting at cycle \<i>/\<iterate>."
584
+ Then output the ITERATION COMPLETE block below using `Status: complete`, listing only the cycles that ran (i = 1 through `actual_cycles_run`), and set "Suggested next: all architecture findings resolved."
585
+ Cycle 1 always runs (never early-stop at i=1). Never early-stop after a fix cycle — always advance to the review that validates it.
586
+
587
+ ### Per-Cycle Procedure
588
+
589
+ For each cycle **i = 1 … iterate**:
590
+
591
+ #### Step A — Assess
592
+
593
+ Retrieve the previous cycle's activity type and findings:
594
+ - Call `mcp__monomind__memory_retrieve` (namespace: `architect:<sessionId>`, key: `cycle_<i-1>_activity`) → `last_activity` (`"review"` or `"fix"`)
595
+ - Call `mcp__monomind__memory_retrieve` (namespace: `architect:<sessionId>`, key: `cycle_<i-1>_findings`) → `last_findings` (JSON findings list from the most recent review cycle)
596
+ - Parse `last_findings` to count CRITICAL and HIGH severity items
597
+ - **Apply early-stop only when ALL of: `i > 1` AND `last_activity == "review"` AND CRITICAL + HIGH count == 0.** Never early-stop at cycle 1 (always run at least one fix cycle) and never early-stop after a fix cycle — always advance to the review cycle that validates the fix.
598
+
599
+ #### Step B — Choose Activity
600
+
601
+ Retrieve `last_activity` from Step A and apply this table:
602
+
603
+ | `last_activity` | CRITICAL+HIGH count | `i` | This cycle activity |
604
+ |---|---|---|---|
605
+ | `review` (or initial pass) | > 0 | any | **fix** — implement all CRITICAL and HIGH recommendations |
606
+ | `review` (or initial pass) | 0 | > 1 | **stop** — early exit (architecture clean) |
607
+ | `review` (or initial pass) | 0 | == 1 | **review** — run a second independent review to confirm the clean result before stopping. Note: when `iterate == 1`, this confirmation review is the only available cycle slot; the loop terminates after it with one re-confirmation and no fix applied. This is intentional — if the goal is to skip iteration entirely on a clean initial pass, use `--iterate 0`. |
608
+ | `fix` | any | any | **review** — re-run architect to validate fixes |
609
+
610
+ State the decision:
611
+ > "Cycle \<i>/\<iterate>: \<fix|review> — \<one-sentence reason>. CRITICAL: \<n>, HIGH: \<n>."
612
+
613
+ #### Step C — Execute
614
+
615
+ **If activity = fix:**
616
+
617
+ Extract all CRITICAL and HIGH items from `last_findings`. Count them and store the count before spawning:
618
+ ```
619
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_<i>_fix_count", value: <count of CRITICAL+HIGH items>)
620
+ ```
621
+
622
+ **Human-in-the-loop checkpoint (fix cycle):** Before spawning the build skill, write a file named `humaninloop-<YYYYMMDD-HHmmss>.md` (use current UTC datetime) in the `docs/` subdirectory of the project (create `docs/` if it does not exist). The file must contain:
623
+ ```markdown
624
+ # Human Review — Cycle <i>/<iterate> Fix Pending
625
+
626
+ **Session:** <sessionId>
627
+ **Project:** <project_name>
628
+ **Cycle:** <i>/<iterate>
629
+ **Trigger:** fix cycle about to execute
630
+
631
+ ## Findings to be Fixed
632
+
633
+ <one bullet per CRITICAL/HIGH item: `- [severity] [dimension]: [recommendation]`>
634
+
635
+ ## Action
636
+
637
+ `mastermind:build` has been spawned to implement the above (execution continues immediately — this file is an async notification only, not a pause). To redirect or override, re-run the iteration after manually reverting any changes.
638
+
639
+ ## Human Comments
640
+
641
+ <!-- Add your comments here -->
642
+ ```
643
+
644
+ Store the filename so the blocked checkpoint can locate it if needed, and append it to the run's humaninloop file list:
645
+ ```
646
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_<i>_fixloop_file", value: "docs/humaninloop-<YYYYMMDD-HHmmss>.md")
647
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "humaninloop_files", value: <append "docs/humaninloop-<YYYYMMDD-HHmmss>.md" to existing list, or start new list if key absent>)
648
+ ```
649
+ (Use the same `<YYYYMMDD-HHmmss>` value used when writing the file above.)
650
+
651
+ Spawn `Skill("mastermind:build")` with:
652
+ - `prompt`: "Implement the following architecture fixes:\n" followed by the CRITICAL and HIGH `recommendation` fields extracted from `last_findings`, one bullet per line (format: `- [severity] [dimension]: [recommendation]`)
653
+ - `project_name`: same project_name
654
+ - `board_id`: same board_id
655
+ - `brain_context`: same brain_context as the initial pass
656
+ - `stack`: same stack as the initial pass
657
+ - `sessionId`: same sessionId
658
+ - `mode`: auto
659
+ - `caller`: master
660
+
661
+ Wait for the build skill to return. Store the activity tag:
662
+ ```
663
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_<i>_activity", value: "fix")
664
+ ```
665
+
666
+ Carry forward the review findings that triggered this fix (so Step A of the next cycle can read a real findings list):
667
+ ```
668
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_<i>_findings", value: <same value as last_findings — the JSON from the prior review cycle>)
669
+ ```
670
+
671
+ **If activity = review:**
672
+
673
+ Re-invoke `Skill("mastermind:architect")` with:
674
+ - `prompt`: if `i == 1` (clean initial pass — second independent review): "Second independent review to confirm initial clean result. Perform a fresh pass with no prior context bias." Otherwise: "Re-review after fixes applied in cycle \<i-1>. Focus on dimensions that had CRITICAL or HIGH findings: \<list dimension names from last_findings>"
675
+ - `project_name`, `board_id`, `brain_context`, `stack`: same as initial pass
676
+ - `scope`: if initial scope was `all`, use `review+deduplicate` (running both review and deduplicate catches structural regressions introduced by fixes without the full cost of design and migrate phases); otherwise use the same scope as the initial pass
677
+ - `mode`: auto
678
+ - `caller`: master
679
+ - `iterate`: 0 (prevents nested iteration)
680
+ - `sessionId`: same sessionId
681
+
682
+ Wait for the architect skill to return its output schema. Store the new findings and activity tag:
683
+ ```
684
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_<i>_findings", value: <output schema findings serialized as JSON>)
685
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "cycle_<i>_activity", value: "review")
686
+ ```
687
+
688
+ #### Step D — Cycle Summary
689
+
690
+ **Human-in-the-loop checkpoint (blocked):** If the cycle returned `status: blocked`, write a file named `humaninloop-<YYYYMMDD-HHmmss>.md` (use current UTC datetime) in the `docs/` subdirectory of the project (create `docs/` if it does not exist) before outputting the summary. Note: if this is a fix cycle and a fix-cycle checkpoint file was already written this cycle (before spawning mastermind:build), do NOT create a second file — instead retrieve `cycle_<i>_fixloop_file` from memory (`mcp__monomind__memory_retrieve(namespace: "architect:<sessionId>", key: "cycle_<i>_fixloop_file")`) to get the exact filename, then append a `## Blocker` section to that file with the blocked status details:
691
+ ```markdown
692
+ # Human Review — Cycle <i>/<iterate> Blocked
693
+
694
+ **Session:** <sessionId>
695
+ **Project:** <project_name>
696
+ **Cycle:** <i>/<iterate>
697
+ **Trigger:** cycle blocked — iteration halted; human intervention required to continue
698
+
699
+ ## Blocker
700
+
701
+ <one-sentence description of what prevented the cycle from completing>
702
+
703
+ ## Last Known Findings
704
+
705
+ <CRITICAL and HIGH items from last_findings, one bullet each>
706
+
707
+ ## Human Comments
708
+
709
+ <!-- Describe how to unblock, then re-run with remaining cycles -->
710
+ ```
711
+
712
+ Append the filename to the run's humaninloop file list:
713
+ ```
714
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "humaninloop_files", value: <append the just-written filename to existing list, or start new list if key absent>)
715
+ ```
716
+
717
+ **After writing the file, stop the iteration loop immediately.** Do not proceed to cycle `i+1`. Set `actual_cycles_run = i`, output the compact summary line below marked `blocked`, then skip directly to ITERATION COMPLETE with `status: blocked`.
718
+
719
+ Output a compact line:
720
+ ```
721
+ ITERATION <i>/<iterate> — <fix|review> — <complete|partial|blocked>
722
+ → <one-line summary of what was done>
723
+ → CRITICAL: <n>, HIGH: <n> [for review cycles: parse cycle_<i>_findings; for fix cycles: show counts from triggering review, labeled "(unvalidated — pending review cycle)"]
724
+ → Next cycle: <predicted activity or "done — architecture clean">
725
+ ```
726
+
727
+ ---
728
+
729
+ ### Iteration Complete Summary
730
+
731
+ **If the loop completed normally (all N cycles ran without early-stop or block): set `actual_cycles_run = iterate` before proceeding.** Otherwise, retain the value already set by the early-stop path (`actual_cycles_run = i - 1`) or the blocked path (`actual_cycles_run = i`) — do NOT overwrite it here. The post-loop guard may add a final validation review, but that review does not increment this count — it is reported separately as the `[Final validation: ...]` line in ITERATION COMPLETE.
732
+
733
+ **Post-loop guard:** After all N cycles complete (not after an early stop):
734
+ 1. Retrieve `cycle_<iterate>_activity` from memory (namespace: `architect:<sessionId>`).
735
+ 2. If its value is `"fix"`, run one additional final review cycle before reporting ITERATION COMPLETE. Use these parameters (do NOT use Step C's template — `i` is undefined at this point):
736
+ - `prompt`: "Final validation review after all \<iterate> cycles complete. Focus on dimensions that had CRITICAL or HIGH findings: \<list dimension names from cycle_\<iterate>_findings> (findings from the pass that triggered this fix — may be the initial architect pass if `iterate == 1`)"
737
+ - `project_name`, `board_id`, `brain_context`, `stack`: same as initial pass
738
+ - `scope`: if initial scope was `all`, use `review+deduplicate`; otherwise same as initial pass
739
+ - `mode`: auto, `caller`: master, `iterate`: 0, `sessionId`: same sessionId
740
+ - Store results: `cycle_final_findings` and `cycle_final_activity = "review"` (namespace: `architect:<sessionId>`)
741
+ - If the final review returns `status: blocked`: set `Status: blocked` in ITERATION COMPLETE, note "post-loop guard review blocked" in Final state, skip the unresolved-issues checkpoint, and go directly to ITERATION COMPLETE.
742
+ 3. If its value is `"review"`, proceed directly to ITERATION COMPLETE.
743
+
744
+ This ensures the loop never terminates with unvalidated fixes regardless of whether N is odd or even.
745
+
746
+ **Human-in-the-loop checkpoint (unresolved issues):** This checkpoint only runs when the loop terminated normally (all N cycles ran) — skip it entirely on early-stop (count is 0 by definition on that path). After the post-loop guard completes, determine the final CRITICAL+HIGH count from the findings for the final review:
747
+ - Use `cycle_final_findings` if the post-loop guard fired (last cycle was a fix)
748
+ - Use `cycle_<iterate>_findings` if all N cycles ran and the last cycle was a review (guard did not fire)
749
+
750
+ If that count > 0, write a file named `humaninloop-<YYYYMMDD-HHmmss>.md` (use current UTC datetime) in the `docs/` subdirectory of the project (create `docs/` if it does not exist):
751
+ ```markdown
752
+ # Human Review — Iteration Complete with Unresolved Issues
753
+
754
+ **Session:** <sessionId>
755
+ **Project:** <project_name>
756
+ **Cycles run:** <actual_cycles_run>/<iterate>
757
+ **Trigger:** all cycles exhausted; CRITICAL/HIGH issues remain
758
+
759
+ ## Remaining Issues
760
+
761
+ <one bullet per CRITICAL/HIGH item from final review findings>
762
+
763
+ ## Suggested Next Steps
764
+
765
+ <from the output schema `next_actions` field>
766
+
767
+ ## Human Comments
768
+
769
+ <!-- Decide whether to re-run with --iterate <N>, fix manually, or accept the remaining findings -->
770
+ ```
771
+
772
+ Append the filename to the run's humaninloop file list:
773
+ ```
774
+ mcp__monomind__memory_store(namespace: "architect:<sessionId>", key: "humaninloop_files", value: <append the just-written filename to existing list, or start new list if key absent>)
775
+ ```
776
+
777
+ After writing the file, continue immediately to ITERATION COMPLETE output — do not halt execution.
778
+
779
+ After all cycles finish (or early stop), output:
780
+
781
+ **List one line per cycle from `i = 1` through `actual_cycles_run` only.** If early-stop fired at cycle `k`, do not emit lines for cycles `k` through `iterate` — those cycles did not execute and have no stored keys. For each fix cycle, retrieve `cycle_<i>_fix_count` from memory. For each review cycle, read `cycle_<i>_findings` for the CRITICAL and HIGH counts.
782
+
783
+ **Determine `Status` before rendering ITERATION COMPLETE:**
784
+ - `blocked` — if the loop was halted by a blocked cycle OR the post-loop guard review returned `status: blocked`
785
+ - `partial` — if the unresolved-issues checkpoint fired (final CRITICAL+HIGH count > 0) and all N cycles ran
786
+ - `complete` — if no CRITICAL or HIGH findings remain in the final review (unresolved-issues checkpoint did not fire)
787
+
788
+ ```
789
+ ITERATION COMPLETE — <actual_cycles_run>/<iterate> — <project_name>
790
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
791
+ Status: complete | partial | blocked
792
+ Cycle 1: fix → <cycle_1_fix_count> fixes requested
793
+ Cycle 2: review → CRITICAL: <n>, HIGH: <n> remaining
794
+ Cycle 3: fix → <cycle_3_fix_count> fixes requested
795
+ ...
796
+ [Final validation: review → CRITICAL: <n>, HIGH: <n>] ← include only if post-loop guard fired; read from cycle_final_findings
797
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
798
+ Final state: <one-sentence assessment>
799
+ Suggested next: <what to do next, e.g. "run mastermind:release" or "all architecture findings resolved">
800
+ Human-in-the-loop files: <retrieve humaninloop_files from memory (namespace: "architect:<sessionId>"); list each filename, or "none" if key absent>
801
+ ```
802
+
803
+ Then, if `caller` is `standalone`, follow _protocol.md Brain Write Procedure (namespace: `architect`) — the iteration results count as additional decisions scored from this run. If `caller` is `command` or `master`, skip — the caller handles the brain write.
804
+
805
+ ---
806
+
807
+ ## Domain Swarm Defaults
808
+
809
+ | Task Type | Agent | Swarm |
810
+ |---|---|---|
811
+ | Full architecture audit | Software Architect + specialists | hierarchical 6 raft specialized |
812
+ | File structure dedup only | Software Architect | hierarchical 3 raft specialized |
813
+ | Coupling + dependency analysis | Software Architect | mesh 3 gossip balanced |
814
+ | API + data layer design | Backend Architect + Database Optimizer | hierarchical 4 raft specialized |
815
+ | Security architecture | Security Engineer + Software Architect | hierarchical-mesh 4 byzantine specialized |
816
+ | Single design question | Software Architect | single agent |
817
+
818
+ ---
819
+
820
+ ## ADR Template
821
+
822
+ When the Architecture Manager produces Architecture Decision Records, use this format.
823
+
824
+ **ADR numbering:** Before writing a new ADR, scan for existing ADR files in common locations (`docs/adr/`, `architecture/decisions/`, `adr/`, `docs/architecture/`). Find the highest existing `ADR-NNN` number and increment by 1. If no ADR files are found, start at `ADR-001`. Write each ADR to the first discovered location (or `docs/adr/` as default).
825
+
826
+ ```markdown
827
+ # ADR-NNN: [Title] <!-- replace NNN with the next sequential number -->
828
+
829
+ **Date:** YYYY-MM-DD <!-- substitute with the resolved UTC date from the CONTEXT header -->
830
+ **Status:** Proposed | Accepted | Deprecated | Superseded
831
+
832
+ ## Context
833
+ [What problem or decision was this addressing?]
834
+
835
+ ## Decision
836
+ [What was decided?]
837
+
838
+ ## Consequences
839
+ **Positive:**
840
+ - [benefit 1]
841
+
842
+ **Negative / Trade-offs:**
843
+ - [cost or constraint 1]
844
+
845
+ **Neutral:**
846
+ - [side effect worth noting]
847
+ ```