monomind 1.19.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (883) hide show
  1. package/README.md +13 -17
  2. package/package.json +16 -35
  3. package/packages/@monomind/cli/.claude/agents/github/issue-tracker.md +0 -2
  4. package/packages/@monomind/cli/.claude/agents/github/pr-manager.md +0 -2
  5. package/packages/@monomind/cli/.claude/agents/github/repo-architect.md +3 -11
  6. package/packages/@monomind/cli/.claude/agents/goal/goal-planner.md +0 -1
  7. package/packages/@monomind/cli/.claude/commands/github/issue-tracker.md +0 -2
  8. package/packages/@monomind/cli/.claude/commands/github/pr-manager.md +0 -2
  9. package/packages/@monomind/cli/.claude/commands/github/repo-architect.md +3 -10
  10. package/packages/@monomind/cli/.claude/commands/mastermind/help.md +3 -3
  11. package/packages/@monomind/cli/.claude/commands/workflows/README.md +0 -1
  12. package/packages/@monomind/cli/.claude/commands/workflows/workflow-create.md +0 -1
  13. package/packages/@monomind/cli/.claude/commands/workflows/workflow-execute.md +1 -3
  14. package/packages/@monomind/cli/.claude/commands/workflows/workflow-export.md +0 -2
  15. package/packages/@monomind/cli/.claude/helpers/handlers/agent-start-handler.cjs +18 -1
  16. package/packages/@monomind/cli/.claude/helpers/handlers/edit-handler.cjs +15 -0
  17. package/packages/@monomind/cli/.claude/helpers/handlers/gates-handler.cjs +2 -8
  18. package/packages/@monomind/cli/.claude/helpers/handlers/route-handler.cjs +149 -7
  19. package/packages/@monomind/cli/.claude/helpers/handlers/session-handler.cjs +47 -25
  20. package/packages/@monomind/cli/.claude/helpers/handlers/session-restore-handler.cjs +80 -43
  21. package/packages/@monomind/cli/.claude/helpers/handlers/task-handler.cjs +8 -4
  22. package/packages/@monomind/cli/.claude/helpers/hook-handler.cjs +69 -16
  23. package/packages/@monomind/cli/.claude/helpers/intelligence.cjs +100 -9
  24. package/packages/@monomind/cli/.claude/helpers/router.cjs +78 -5
  25. package/packages/@monomind/cli/.claude/helpers/skill-registry.json +0 -189
  26. package/packages/@monomind/cli/.claude/helpers/token-tracker.cjs +10 -0
  27. package/packages/@monomind/cli/.claude/skills/github-toolkit/SKILL.md +60 -0
  28. package/packages/@monomind/cli/.claude/skills/hive-mind-advanced/SKILL.md +0 -15
  29. package/packages/@monomind/cli/.claude/skills/hooks-automation/SKILL.md +0 -1
  30. package/packages/@monomind/cli/.claude/skills/mastermind-skills/_protocol.md +1 -1
  31. package/packages/@monomind/cli/.claude/skills/mastermind-skills/build.md +1 -2
  32. package/packages/@monomind/cli/.claude/skills/memory-toolkit/SKILL.md +75 -0
  33. package/packages/@monomind/cli/.claude/skills/specialagent/SKILL.md +2 -4
  34. package/packages/@monomind/cli/.claude/skills/swarm-advanced/SKILL.md +0 -1
  35. package/packages/@monomind/cli/README.md +13 -17
  36. package/packages/@monomind/cli/dist/src/autopilot-state.js +4 -5
  37. package/packages/@monomind/cli/dist/src/browser/dashboard/server.js +129 -2
  38. package/packages/@monomind/cli/dist/src/browser/dashboard/ui.html +214 -1764
  39. package/packages/@monomind/cli/dist/src/capabilities/index.d.ts +0 -2
  40. package/packages/@monomind/cli/dist/src/capabilities/index.js +0 -1
  41. package/packages/@monomind/cli/dist/src/commands/agent-lifecycle.js +2 -6
  42. package/packages/@monomind/cli/dist/src/commands/analyze.d.ts +0 -4
  43. package/packages/@monomind/cli/dist/src/commands/analyze.js +1 -29
  44. package/packages/@monomind/cli/dist/src/commands/browse-workflow.js +2 -2
  45. package/packages/@monomind/cli/dist/src/commands/completions.js +3 -22
  46. package/packages/@monomind/cli/dist/src/commands/config.js +0 -6
  47. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +12 -2
  48. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +130 -22
  49. package/packages/@monomind/cli/dist/src/commands/doctor.js +6 -5
  50. package/packages/@monomind/cli/dist/src/commands/guidance.d.ts +5 -1
  51. package/packages/@monomind/cli/dist/src/commands/guidance.js +11 -556
  52. package/packages/@monomind/cli/dist/src/commands/hive-mind-comms.js +11 -4
  53. package/packages/@monomind/cli/dist/src/commands/hive-mind.d.ts +4 -4
  54. package/packages/@monomind/cli/dist/src/commands/hive-mind.js +9 -6
  55. package/packages/@monomind/cli/dist/src/commands/hooks-formatting.d.ts +1 -5
  56. package/packages/@monomind/cli/dist/src/commands/hooks-formatting.js +1 -18
  57. package/packages/@monomind/cli/dist/src/commands/hooks-workers.d.ts +1 -1
  58. package/packages/@monomind/cli/dist/src/commands/hooks-workers.js +82 -330
  59. package/packages/@monomind/cli/dist/src/commands/index.d.ts +0 -5
  60. package/packages/@monomind/cli/dist/src/commands/index.js +0 -45
  61. package/packages/@monomind/cli/dist/src/commands/init-wizard.js +1 -1
  62. package/packages/@monomind/cli/dist/src/commands/init.js +4 -24
  63. package/packages/@monomind/cli/dist/src/commands/neural-core.js +11 -11
  64. package/packages/@monomind/cli/dist/src/commands/neural-optimize.js +9 -11
  65. package/packages/@monomind/cli/dist/src/commands/neural-registry.js +10 -10
  66. package/packages/@monomind/cli/dist/src/commands/providers.js +90 -1
  67. package/packages/@monomind/cli/dist/src/commands/search-universal.d.ts +7 -1
  68. package/packages/@monomind/cli/dist/src/commands/search-universal.js +59 -5
  69. package/packages/@monomind/cli/dist/src/commands/security-cve.js +3 -5
  70. package/packages/@monomind/cli/dist/src/commands/session.js +143 -3
  71. package/packages/@monomind/cli/dist/src/commands/start.js +0 -18
  72. package/packages/@monomind/cli/dist/src/commands/swarm.js +112 -65
  73. package/packages/@monomind/cli/dist/src/consensus/audit-writer.js +43 -1
  74. package/packages/@monomind/cli/dist/src/consensus/tally.d.ts +19 -0
  75. package/packages/@monomind/cli/dist/src/consensus/tally.js +34 -0
  76. package/packages/@monomind/cli/dist/src/index.d.ts +3 -2
  77. package/packages/@monomind/cli/dist/src/index.js +9 -12
  78. package/packages/@monomind/cli/dist/src/init/claudemd-generator.js +10 -14
  79. package/packages/@monomind/cli/dist/src/init/executor.js +39 -86
  80. package/packages/@monomind/cli/dist/src/init/settings-generator.js +0 -12
  81. package/packages/@monomind/cli/dist/src/init/statusline-generator.js +62 -0
  82. package/packages/@monomind/cli/dist/src/init/types.d.ts +2 -6
  83. package/packages/@monomind/cli/dist/src/init/types.js +0 -3
  84. package/packages/@monomind/cli/dist/src/knowledge/document-pipeline.js +18 -8
  85. package/packages/@monomind/cli/dist/src/mcp-client.js +0 -2
  86. package/packages/@monomind/cli/dist/src/mcp-server.js +12 -14
  87. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/coherence-check.js +1 -19
  88. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/types.d.ts +21 -20
  89. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/types.js +3 -18
  90. package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.js +1 -7
  91. package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.js +2 -2
  92. package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +7 -17
  93. package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -1
  94. package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +174 -38
  95. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-advanced.d.ts +18 -0
  96. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-advanced.js +25 -0
  97. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-intelligence.d.ts +4 -8
  98. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-intelligence.js +33 -482
  99. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.d.ts +1 -0
  100. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.js +51 -43
  101. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-synthesis.d.ts +31 -0
  102. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-synthesis.js +196 -0
  103. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +10 -8
  104. package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -1
  105. package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -1
  106. package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +20 -29
  107. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.d.ts +6 -0
  108. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +78 -220
  109. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +9 -4
  110. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +242 -506
  111. package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.d.ts +12 -12
  112. package/packages/@monomind/cli/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +4 -4
  113. package/packages/@monomind/cli/dist/src/mcp-tools/security-tools.js +103 -0
  114. package/packages/@monomind/cli/dist/src/memory/intelligence.d.ts +2 -1
  115. package/packages/@monomind/cli/dist/src/memory/intelligence.js +56 -43
  116. package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +14 -9
  117. package/packages/@monomind/cli/dist/src/memory/memory-read.js +1 -19
  118. package/packages/@monomind/cli/dist/src/orgrt/types.d.ts +847 -0
  119. package/packages/@monomind/cli/dist/src/orgrt/types.js +51 -0
  120. package/packages/@monomind/cli/dist/src/parser.js +31 -5
  121. package/packages/@monomind/cli/dist/src/suggest.js +1 -7
  122. package/packages/@monomind/cli/dist/src/transfer/store/discovery.d.ts +3 -2
  123. package/packages/@monomind/cli/dist/src/transfer/store/discovery.js +22 -70
  124. package/packages/@monomind/cli/dist/src/ui/collector.mjs +69 -44
  125. package/packages/@monomind/cli/dist/src/ui/dashboard.html +112 -25
  126. package/packages/@monomind/cli/dist/src/ui/orgs.html +54 -0
  127. package/packages/@monomind/cli/dist/src/ui/server.mjs +87 -12
  128. package/packages/@monomind/cli/dist/src/update/checker.js +0 -1
  129. package/packages/@monomind/cli/dist/src/utils/cosine-similarity.d.ts +22 -0
  130. package/packages/@monomind/cli/dist/src/utils/cosine-similarity.js +38 -0
  131. package/packages/@monomind/cli/dist/src/utils/input-guards.d.ts +51 -0
  132. package/packages/@monomind/cli/dist/src/utils/input-guards.js +223 -0
  133. package/packages/@monomind/cli/dist/src/utils/json-file.d.ts +33 -0
  134. package/packages/@monomind/cli/dist/src/utils/json-file.js +57 -0
  135. package/packages/@monomind/cli/package.json +11 -7
  136. package/packages/@monomind/cli/scripts/sync-claude-assets.sh +16 -20
  137. package/scripts/generate-agent-avatars.mjs +0 -8
  138. package/.claude/agents/architecture/system-design/arch-system-design.md +0 -54
  139. package/.claude/agents/consensus/crdt-synchronizer.md +0 -977
  140. package/.claude/agents/consensus/quorum-manager.md +0 -803
  141. package/.claude/agents/consensus/security-manager.md +0 -602
  142. package/.claude/agents/core/coder.md +0 -262
  143. package/.claude/agents/core/coordinator.md +0 -71
  144. package/.claude/agents/core/planner.md +0 -170
  145. package/.claude/agents/core/researcher.md +0 -197
  146. package/.claude/agents/core/reviewer.md +0 -327
  147. package/.claude/agents/core/tester.md +0 -318
  148. package/.claude/agents/design/design-monodesign.md +0 -121
  149. package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +0 -212
  150. package/.claude/agents/engineering/engineering-ai-engineer.md +0 -165
  151. package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -108
  152. package/.claude/agents/engineering/engineering-backend-architect.md +0 -254
  153. package/.claude/agents/engineering/engineering-code-reviewer.md +0 -95
  154. package/.claude/agents/engineering/engineering-data-engineer.md +0 -307
  155. package/.claude/agents/engineering/engineering-database-optimizer.md +0 -200
  156. package/.claude/agents/engineering/engineering-devops-automator.md +0 -430
  157. package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +0 -174
  158. package/.claude/agents/engineering/engineering-feishu-integration-developer.md +0 -607
  159. package/.claude/agents/engineering/engineering-frontend-developer.md +0 -249
  160. package/.claude/agents/engineering/engineering-git-workflow-master.md +0 -108
  161. package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -482
  162. package/.claude/agents/engineering/engineering-mobile-app-builder.md +0 -499
  163. package/.claude/agents/engineering/engineering-rapid-prototyper.md +0 -463
  164. package/.claude/agents/engineering/engineering-security-engineer.md +0 -303
  165. package/.claude/agents/engineering/engineering-senior-developer.md +0 -195
  166. package/.claude/agents/engineering/engineering-software-architect.md +0 -100
  167. package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +0 -528
  168. package/.claude/agents/engineering/engineering-sre.md +0 -114
  169. package/.claude/agents/engineering/engineering-technical-writer.md +0 -412
  170. package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -540
  171. package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +0 -351
  172. package/.claude/agents/generated/case-analyst.md +0 -50
  173. package/.claude/agents/generated/channel-intelligence-director.md +0 -87
  174. package/.claude/agents/generated/chief-growth-officer.md +0 -88
  175. package/.claude/agents/generated/churn-analyst.md +0 -53
  176. package/.claude/agents/generated/code-reviewer.md +0 -55
  177. package/.claude/agents/generated/code-validator.md +0 -57
  178. package/.claude/agents/generated/complexity-scanner.md +0 -56
  179. package/.claude/agents/generated/content-seo-strategist.md +0 -90
  180. package/.claude/agents/generated/copy-editor.md +0 -45
  181. package/.claude/agents/generated/court-reporter.md +0 -50
  182. package/.claude/agents/generated/defender.md +0 -51
  183. package/.claude/agents/generated/devbot-orchestrator.md +0 -58
  184. package/.claude/agents/generated/devbot-planner.md +0 -63
  185. package/.claude/agents/generated/developer-community-strategist.md +0 -91
  186. package/.claude/agents/generated/editor-in-chief.md +0 -45
  187. package/.claude/agents/generated/fact-checker.md +0 -45
  188. package/.claude/agents/generated/impact-assessor.md +0 -54
  189. package/.claude/agents/generated/judge.md +0 -51
  190. package/.claude/agents/generated/outreach-partnership-strategist.md +0 -90
  191. package/.claude/agents/generated/prosecutor.md +0 -51
  192. package/.claude/agents/generated/reporter.md +0 -45
  193. package/.claude/agents/generated/social-media-strategist.md +0 -91
  194. package/.claude/agents/generated/video-visual-strategist.md +0 -90
  195. package/.claude/agents/github/code-review-swarm.md +0 -557
  196. package/.claude/agents/github/github-modes.md +0 -154
  197. package/.claude/agents/github/issue-tracker.md +0 -299
  198. package/.claude/agents/github/multi-repo-swarm.md +0 -525
  199. package/.claude/agents/github/pr-manager.md +0 -163
  200. package/.claude/agents/github/project-board-sync.md +0 -478
  201. package/.claude/agents/github/release-manager.md +0 -296
  202. package/.claude/agents/github/repo-architect.md +0 -359
  203. package/.claude/agents/github/swarm-issue.md +0 -548
  204. package/.claude/agents/github/swarm-pr.md +0 -427
  205. package/.claude/agents/github/sync-coordinator.md +0 -355
  206. package/.claude/agents/github/workflow-automation.md +0 -640
  207. package/.claude/agents/goal/goal-planner.md +0 -168
  208. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -129
  209. package/.claude/agents/hive-mind/queen-coordinator.md +0 -202
  210. package/.claude/agents/hive-mind/scout-explorer.md +0 -241
  211. package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -192
  212. package/.claude/agents/hive-mind/worker-specialist.md +0 -216
  213. package/.claude/agents/marketing/marketing-competitive-content.md +0 -155
  214. package/.claude/agents/marketing/marketing-cro-specialist.md +0 -147
  215. package/.claude/agents/marketing/marketing-email-specialist.md +0 -90
  216. package/.claude/agents/marketing/marketing-launch-strategist.md +0 -129
  217. package/.claude/agents/marketing/marketing-pricing-strategist.md +0 -127
  218. package/.claude/agents/optimization/benchmark-suite.md +0 -665
  219. package/.claude/agents/optimization/load-balancer.md +0 -431
  220. package/.claude/agents/optimization/performance-monitor.md +0 -672
  221. package/.claude/agents/optimization/resource-allocator.md +0 -674
  222. package/.claude/agents/optimization/topology-optimizer.md +0 -808
  223. package/.claude/agents/reengineer-squad/boss.md +0 -113
  224. package/.claude/agents/reengineer-squad/critic-architect.md +0 -132
  225. package/.claude/agents/reengineer-squad/git-manager.md +0 -145
  226. package/.claude/agents/reengineer-squad/idea-generator.md +0 -95
  227. package/.claude/agents/reengineer-squad/implementer.md +0 -112
  228. package/.claude/agents/reengineer-squad/integration-planner.md +0 -112
  229. package/.claude/agents/reengineer-squad/source-analyst.md +0 -103
  230. package/.claude/agents/reengineer-squad/target-analyst.md +0 -118
  231. package/.claude/agents/reengineer-squad/tester.md +0 -105
  232. package/.claude/agents/schemas/architecture-output.json +0 -43
  233. package/.claude/agents/schemas/code-review-output.json +0 -28
  234. package/.claude/agents/schemas/generic-task-input.json +0 -12
  235. package/.claude/agents/schemas/implementation-output.json +0 -18
  236. package/.claude/agents/schemas/research-output.json +0 -31
  237. package/.claude/agents/schemas/security-audit-output.json +0 -29
  238. package/.claude/agents/schemas/test-report-output.json +0 -29
  239. package/.claude/agents/sparc/architecture.md +0 -453
  240. package/.claude/agents/sparc/pseudocode.md +0 -299
  241. package/.claude/agents/sparc/refinement.md +0 -504
  242. package/.claude/agents/sparc/specification.md +0 -258
  243. package/.claude/agents/specialists/integration-architect.md +0 -94
  244. package/.claude/agents/specialized/agentic-identity-trust.md +0 -388
  245. package/.claude/agents/specialized/agents-orchestrator.md +0 -368
  246. package/.claude/agents/specialized/automation-governance-architect.md +0 -217
  247. package/.claude/agents/specialized/blockchain-security-auditor.md +0 -497
  248. package/.claude/agents/specialized/compliance-auditor.md +0 -159
  249. package/.claude/agents/specialized/identity-graph-operator.md +0 -261
  250. package/.claude/agents/specialized/lsp-index-engineer.md +0 -315
  251. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -89
  252. package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -89
  253. package/.claude/agents/specialized/specialized-developer-advocate.md +0 -318
  254. package/.claude/agents/specialized/specialized-document-generator.md +0 -56
  255. package/.claude/agents/specialized/specialized-mcp-builder.md +0 -64
  256. package/.claude/agents/specialized/specialized-model-qa.md +0 -489
  257. package/.claude/agents/specialized/specialized-workflow-architect.md +0 -595
  258. package/.claude/agents/specialized/zk-steward.md +0 -212
  259. package/.claude/agents/swarm/mesh-coordinator.md +0 -363
  260. package/.claude/agents/templates/automation-smart-agent.md +0 -185
  261. package/.claude/agents/templates/coordinator-swarm-init.md +0 -83
  262. package/.claude/agents/templates/implementer-sparc-coder.md +0 -231
  263. package/.claude/agents/testing/production-validator.md +0 -375
  264. package/.claude/agents/testing/tdd-london-swarm.md +0 -241
  265. package/.claude/agents/testing/testing-accessibility-auditor.md +0 -322
  266. package/.claude/agents/testing/testing-api-tester.md +0 -307
  267. package/.claude/agents/testing/testing-evidence-collector.md +0 -213
  268. package/.claude/agents/testing/testing-performance-benchmarker.md +0 -269
  269. package/.claude/agents/testing/testing-test-results-analyzer.md +0 -306
  270. package/.claude/agents/testing/testing-tool-evaluator.md +0 -395
  271. package/.claude/agents/testing/testing-workflow-optimizer.md +0 -451
  272. package/.claude/commands/agents/README.md +0 -14
  273. package/.claude/commands/agents/agent-capabilities.md +0 -25
  274. package/.claude/commands/agents/agent-coordination.md +0 -32
  275. package/.claude/commands/agents/agent-spawning.md +0 -32
  276. package/.claude/commands/agents/agent-types.md +0 -30
  277. package/.claude/commands/analysis/README.md +0 -18
  278. package/.claude/commands/analysis/bottleneck-detect.md +0 -69
  279. package/.claude/commands/analysis/performance-bottlenecks.md +0 -59
  280. package/.claude/commands/analysis/performance-report.md +0 -52
  281. package/.claude/commands/analysis/token-usage.md +0 -47
  282. package/.claude/commands/automation/README.md +0 -19
  283. package/.claude/commands/automation/auto-agent.md +0 -86
  284. package/.claude/commands/automation/self-healing.md +0 -108
  285. package/.claude/commands/automation/session-memory.md +0 -89
  286. package/.claude/commands/automation/smart-agents.md +0 -81
  287. package/.claude/commands/automation/smart-spawn.md +0 -66
  288. package/.claude/commands/automation/workflow-select.md +0 -60
  289. package/.claude/commands/coordination/README.md +0 -13
  290. package/.claude/commands/coordination/agent-spawn.md +0 -69
  291. package/.claude/commands/coordination/swarm-init.md +0 -82
  292. package/.claude/commands/coordination/task-orchestrate.md +0 -79
  293. package/.claude/commands/github/README.md +0 -24
  294. package/.claude/commands/github/github-modes.md +0 -151
  295. package/.claude/commands/github/issue-tracker.md +0 -293
  296. package/.claude/commands/github/pr-manager.md +0 -173
  297. package/.claude/commands/github/release-manager.md +0 -343
  298. package/.claude/commands/github/repo-architect.md +0 -379
  299. package/.claude/commands/github/sync-coordinator.md +0 -297
  300. package/.claude/commands/hive-mind/README.md +0 -42
  301. package/.claude/commands/hive-mind/hive-mind-consensus.md +0 -72
  302. package/.claude/commands/hive-mind/hive-mind-init.md +0 -68
  303. package/.claude/commands/hive-mind/hive-mind-memory.md +0 -73
  304. package/.claude/commands/hive-mind/hive-mind-spawn.md +0 -82
  305. package/.claude/commands/hive-mind/hive-mind-status.md +0 -56
  306. package/.claude/commands/hive-mind/hive-mind-stop.md +0 -55
  307. package/.claude/commands/hive-mind/hive-mind.md +0 -87
  308. package/.claude/commands/hooks/README.md +0 -66
  309. package/.claude/commands/hooks/overview.md +0 -112
  310. package/.claude/commands/hooks/post-edit.md +0 -78
  311. package/.claude/commands/hooks/post-task.md +0 -62
  312. package/.claude/commands/hooks/pre-edit.md +0 -81
  313. package/.claude/commands/hooks/pre-task.md +0 -73
  314. package/.claude/commands/hooks/session-end.md +0 -82
  315. package/.claude/commands/hooks/setup.md +0 -132
  316. package/.claude/commands/mastermind/_repeat.md +0 -492
  317. package/.claude/commands/mastermind/_taskfile.md +0 -232
  318. package/.claude/commands/mastermind/adr.md +0 -9
  319. package/.claude/commands/mastermind/approve.md +0 -91
  320. package/.claude/commands/mastermind/architect.md +0 -52
  321. package/.claude/commands/mastermind/autodev.md +0 -28
  322. package/.claude/commands/mastermind/brain.md +0 -99
  323. package/.claude/commands/mastermind/budget.md +0 -5
  324. package/.claude/commands/mastermind/build.md +0 -23
  325. package/.claude/commands/mastermind/code-review.md +0 -314
  326. package/.claude/commands/mastermind/content.md +0 -23
  327. package/.claude/commands/mastermind/createorg.md +0 -136
  328. package/.claude/commands/mastermind/createtask.md +0 -372
  329. package/.claude/commands/mastermind/debug.md +0 -19
  330. package/.claude/commands/mastermind/design.md +0 -17
  331. package/.claude/commands/mastermind/do.md +0 -525
  332. package/.claude/commands/mastermind/execute.md +0 -17
  333. package/.claude/commands/mastermind/finance.md +0 -23
  334. package/.claude/commands/mastermind/finish.md +0 -17
  335. package/.claude/commands/mastermind/graph-status.md +0 -5
  336. package/.claude/commands/mastermind/help.md +0 -115
  337. package/.claude/commands/mastermind/idea.md +0 -23
  338. package/.claude/commands/mastermind/ideate.md +0 -258
  339. package/.claude/commands/mastermind/improve.md +0 -342
  340. package/.claude/commands/mastermind/loops.md +0 -5
  341. package/.claude/commands/mastermind/marketing.md +0 -23
  342. package/.claude/commands/mastermind/master.md +0 -1124
  343. package/.claude/commands/mastermind/memory.md +0 -227
  344. package/.claude/commands/mastermind/okf-export.md +0 -14
  345. package/.claude/commands/mastermind/okf-import.md +0 -15
  346. package/.claude/commands/mastermind/ops.md +0 -23
  347. package/.claude/commands/mastermind/orgs.md +0 -18
  348. package/.claude/commands/mastermind/orgstatus.md +0 -56
  349. package/.claude/commands/mastermind/plan.md +0 -23
  350. package/.claude/commands/mastermind/receive-review.md +0 -17
  351. package/.claude/commands/mastermind/references/antigravity-tools.md +0 -60
  352. package/.claude/commands/mastermind/references/claude-code-tools.md +0 -50
  353. package/.claude/commands/mastermind/references/codex-tools.md +0 -64
  354. package/.claude/commands/mastermind/references/copilot-tools.md +0 -49
  355. package/.claude/commands/mastermind/references/gemini-tools.md +0 -63
  356. package/.claude/commands/mastermind/references/pi-tools.md +0 -28
  357. package/.claude/commands/mastermind/release.md +0 -23
  358. package/.claude/commands/mastermind/repeat.md +0 -254
  359. package/.claude/commands/mastermind/research.md +0 -23
  360. package/.claude/commands/mastermind/review.md +0 -34
  361. package/.claude/commands/mastermind/runorg.md +0 -153
  362. package/.claude/commands/mastermind/sales.md +0 -23
  363. package/.claude/commands/mastermind/skill-builder.md +0 -17
  364. package/.claude/commands/mastermind/specialagents.md +0 -122
  365. package/.claude/commands/mastermind/stoporg.md +0 -75
  366. package/.claude/commands/mastermind/swarm.md +0 -158
  367. package/.claude/commands/mastermind/taskdev.md +0 -23
  368. package/.claude/commands/mastermind/tdd.md +0 -19
  369. package/.claude/commands/mastermind/techport.md +0 -27
  370. package/.claude/commands/mastermind/understand.md +0 -136
  371. package/.claude/commands/mastermind/verify.md +0 -19
  372. package/.claude/commands/mastermind/worktree.md +0 -17
  373. package/.claude/commands/mastermind.md +0 -121
  374. package/.claude/commands/memory/README.md +0 -79
  375. package/.claude/commands/memory/memory-search.md +0 -77
  376. package/.claude/commands/monitoring/README.md +0 -69
  377. package/.claude/commands/monitoring/agent-metrics.md +0 -65
  378. package/.claude/commands/monitoring/agents.md +0 -71
  379. package/.claude/commands/monitoring/status.md +0 -108
  380. package/.claude/commands/monobrowse.md +0 -21
  381. package/.claude/commands/monoes/README.md +0 -30
  382. package/.claude/commands/monoes/install.md +0 -163
  383. package/.claude/commands/monoes/monoagent.md +0 -148
  384. package/.claude/commands/monoes/monoclip.md +0 -64
  385. package/.claude/commands/monoes/monotask.md +0 -137
  386. package/.claude/commands/monograph/README.md +0 -102
  387. package/.claude/commands/monograph/monograph-build.md +0 -79
  388. package/.claude/commands/monograph/monograph-search.md +0 -96
  389. package/.claude/commands/monograph/monograph-stats.md +0 -53
  390. package/.claude/commands/monograph/monograph-watch.md +0 -63
  391. package/.claude/commands/monograph/monograph-wiki.md +0 -91
  392. package/.claude/commands/optimization/auto-topology.md +0 -85
  393. package/.claude/commands/optimization/performance-optimize.md +0 -79
  394. package/.claude/commands/pair/README.md +0 -79
  395. package/.claude/commands/pair/examples.md +0 -156
  396. package/.claude/commands/pair/modes.md +0 -122
  397. package/.claude/commands/pair/session.md +0 -124
  398. package/.claude/commands/sparc/analyzer.md +0 -35
  399. package/.claude/commands/sparc/architect.md +0 -36
  400. package/.claude/commands/sparc/ask.md +0 -56
  401. package/.claude/commands/sparc/batch-executor.md +0 -37
  402. package/.claude/commands/sparc/code.md +0 -48
  403. package/.claude/commands/sparc/coder.md +0 -37
  404. package/.claude/commands/sparc/debug.md +0 -42
  405. package/.claude/commands/sparc/debugger.md +0 -37
  406. package/.claude/commands/sparc/designer.md +0 -36
  407. package/.claude/commands/sparc/devops.md +0 -68
  408. package/.claude/commands/sparc/docs-writer.md +0 -39
  409. package/.claude/commands/sparc/documenter.md +0 -37
  410. package/.claude/commands/sparc/innovator.md +0 -37
  411. package/.claude/commands/sparc/integration.md +0 -42
  412. package/.claude/commands/sparc/mcp.md +0 -76
  413. package/.claude/commands/sparc/memory-manager.md +0 -57
  414. package/.claude/commands/sparc/optimizer.md +0 -37
  415. package/.claude/commands/sparc/orchestrator.md +0 -70
  416. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -42
  417. package/.claude/commands/sparc/refinement-optimization-mode.md +0 -42
  418. package/.claude/commands/sparc/researcher.md +0 -37
  419. package/.claude/commands/sparc/reviewer.md +0 -37
  420. package/.claude/commands/sparc/security-review.md +0 -39
  421. package/.claude/commands/sparc/sparc-modes.md +0 -120
  422. package/.claude/commands/sparc/sparc.md +0 -71
  423. package/.claude/commands/sparc/spec-pseudocode.md +0 -39
  424. package/.claude/commands/sparc/supabase-admin.md +0 -301
  425. package/.claude/commands/sparc/swarm-coordinator.md +0 -50
  426. package/.claude/commands/sparc/tdd.md +0 -37
  427. package/.claude/commands/sparc/tester.md +0 -37
  428. package/.claude/commands/sparc/tutorial.md +0 -38
  429. package/.claude/commands/sparc/workflow-manager.md +0 -37
  430. package/.claude/commands/sparc.md +0 -112
  431. package/.claude/commands/stream-chain/pipeline.md +0 -116
  432. package/.claude/commands/stream-chain/run.md +0 -156
  433. package/.claude/commands/swarm/README.md +0 -40
  434. package/.claude/commands/swarm/analysis.md +0 -73
  435. package/.claude/commands/swarm/development.md +0 -72
  436. package/.claude/commands/swarm/examples.md +0 -103
  437. package/.claude/commands/swarm/maintenance.md +0 -75
  438. package/.claude/commands/swarm/optimization.md +0 -84
  439. package/.claude/commands/swarm/research.md +0 -76
  440. package/.claude/commands/swarm/swarm.md +0 -79
  441. package/.claude/commands/swarm/testing.md +0 -80
  442. package/.claude/commands/tokens.md +0 -18
  443. package/.claude/commands/truth/start.md +0 -121
  444. package/.claude/commands/ts.md +0 -14
  445. package/.claude/commands/workflows/README.md +0 -65
  446. package/.claude/commands/workflows/development.md +0 -86
  447. package/.claude/commands/workflows/research.md +0 -89
  448. package/.claude/commands/workflows/workflow-create.md +0 -84
  449. package/.claude/commands/workflows/workflow-execute.md +0 -103
  450. package/.claude/commands/workflows/workflow-export.md +0 -90
  451. package/.claude/helpers/control-start.cjs +0 -184
  452. package/.claude/helpers/event-logger.cjs +0 -155
  453. package/.claude/helpers/extras-registry.json +0 -5141
  454. package/.claude/helpers/graphify-freshen.cjs +0 -140
  455. package/.claude/helpers/handlers/adr-draft-handler.cjs +0 -78
  456. package/.claude/helpers/handlers/agent-start-handler.cjs +0 -83
  457. package/.claude/helpers/handlers/budget-status-handler.cjs +0 -14
  458. package/.claude/helpers/handlers/capture-handler.cjs +0 -583
  459. package/.claude/helpers/handlers/compact-handler.cjs +0 -35
  460. package/.claude/helpers/handlers/edit-handler.cjs +0 -145
  461. package/.claude/helpers/handlers/gates-handler.cjs +0 -138
  462. package/.claude/helpers/handlers/graph-status-handler.cjs +0 -45
  463. package/.claude/helpers/handlers/loops-status-handler.cjs +0 -48
  464. package/.claude/helpers/handlers/route-handler.cjs +0 -381
  465. package/.claude/helpers/handlers/session-handler.cjs +0 -234
  466. package/.claude/helpers/handlers/session-restore-handler.cjs +0 -375
  467. package/.claude/helpers/handlers/stats-handler.cjs +0 -14
  468. package/.claude/helpers/handlers/task-handler.cjs +0 -206
  469. package/.claude/helpers/hook-handler.cjs +0 -765
  470. package/.claude/helpers/intelligence.cjs +0 -338
  471. package/.claude/helpers/learning-service.mjs +0 -61
  472. package/.claude/helpers/loop-tracker.cjs +0 -119
  473. package/.claude/helpers/mastermind-activate.cjs +0 -35
  474. package/.claude/helpers/memory-palace.cjs +0 -461
  475. package/.claude/helpers/memory.cjs +0 -193
  476. package/.claude/helpers/metrics-db.mjs +0 -87
  477. package/.claude/helpers/monolean-activate.cjs +0 -30
  478. package/.claude/helpers/monolean-config.cjs +0 -76
  479. package/.claude/helpers/monolean-instructions.cjs +0 -109
  480. package/.claude/helpers/monolean-propagate.cjs +0 -13
  481. package/.claude/helpers/monolean-tracker.cjs +0 -18
  482. package/.claude/helpers/router.cjs +0 -364
  483. package/.claude/helpers/session.cjs +0 -140
  484. package/.claude/helpers/skill-registry.json +0 -1043
  485. package/.claude/helpers/statusline.cjs +0 -1344
  486. package/.claude/helpers/toggle-statusline.cjs +0 -73
  487. package/.claude/helpers/token-tracker.cjs +0 -934
  488. package/.claude/helpers/utils/micro-agents.cjs +0 -354
  489. package/.claude/helpers/utils/monograph.cjs +0 -480
  490. package/.claude/helpers/utils/telemetry.cjs +0 -146
  491. package/.claude/mcp.json +0 -3
  492. package/.claude/scheduled_tasks.lock +0 -1
  493. package/.claude/settings.json +0 -475
  494. package/.claude/skills/.monomind/data/ranked-context.json +0 -5
  495. package/.claude/skills/.monomind/sessions/current.json +0 -13
  496. package/.claude/skills/.monomind/sessions/session-1777829336455.json +0 -15
  497. package/.claude/skills/.monomind/sessions/session-1777831614725.json +0 -15
  498. package/.claude/skills/.monomind/sessions/session-1777832095857.json +0 -15
  499. package/.claude/skills/.monomind/sessions/session-1777839814183.json +0 -15
  500. package/.claude/skills/.monomind/sessions/session-1777841847131.json +0 -15
  501. package/.claude/skills/.monomind/sessions/session-1777843309463.json +0 -15
  502. package/.claude/skills/.monomind/sessions/session-1777880867159.json +0 -15
  503. package/.claude/skills/.monomind/sessions/session-1777881884593.json +0 -15
  504. package/.claude/skills/.monomind/sessions/session-1777884090471.json +0 -15
  505. package/.claude/skills/.monomind/sessions/session-1777884808221.json +0 -15
  506. package/.claude/skills/.monomind/sessions/session-1777885672155.json +0 -15
  507. package/.claude/skills/.monomind/sessions/session-1777886852818.json +0 -15
  508. package/.claude/skills/.monomind/sessions/session-1777896532690.json +0 -15
  509. package/.claude/skills/agent-browser-testing/SKILL.md +0 -964
  510. package/.claude/skills/agentic-jujutsu/SKILL.md +0 -645
  511. package/.claude/skills/github-issue-triage/SKILL.md +0 -354
  512. package/.claude/skills/github-repo-recap/SKILL.md +0 -207
  513. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -709
  514. package/.claude/skills/hooks-automation/SKILL.md +0 -1193
  515. package/.claude/skills/mastermind-skills/_agent-select.md +0 -132
  516. package/.claude/skills/mastermind-skills/_delegation.md +0 -83
  517. package/.claude/skills/mastermind-skills/_intake.md +0 -83
  518. package/.claude/skills/mastermind-skills/_protocol.md +0 -404
  519. package/.claude/skills/mastermind-skills/_repeat.md +0 -171
  520. package/.claude/skills/mastermind-skills/access.md +0 -236
  521. package/.claude/skills/mastermind-skills/activity.md +0 -191
  522. package/.claude/skills/mastermind-skills/adapter-manager.md +0 -259
  523. package/.claude/skills/mastermind-skills/adapters.md +0 -204
  524. package/.claude/skills/mastermind-skills/agent-detail.md +0 -242
  525. package/.claude/skills/mastermind-skills/agents.md +0 -178
  526. package/.claude/skills/mastermind-skills/approval-detail.md +0 -259
  527. package/.claude/skills/mastermind-skills/approve.md +0 -188
  528. package/.claude/skills/mastermind-skills/architect.md +0 -862
  529. package/.claude/skills/mastermind-skills/autodev.md +0 -360
  530. package/.claude/skills/mastermind-skills/backup.md +0 -197
  531. package/.claude/skills/mastermind-skills/bootstrap.md +0 -190
  532. package/.claude/skills/mastermind-skills/budgets.md +0 -237
  533. package/.claude/skills/mastermind-skills/build.md +0 -170
  534. package/.claude/skills/mastermind-skills/code-quality-reviewer-prompt.md +0 -60
  535. package/.claude/skills/mastermind-skills/companies.md +0 -256
  536. package/.claude/skills/mastermind-skills/content.md +0 -197
  537. package/.claude/skills/mastermind-skills/costs.md +0 -151
  538. package/.claude/skills/mastermind-skills/createorg.md +0 -862
  539. package/.claude/skills/mastermind-skills/debug.md +0 -232
  540. package/.claude/skills/mastermind-skills/design.md +0 -189
  541. package/.claude/skills/mastermind-skills/diagnose.md +0 -249
  542. package/.claude/skills/mastermind-skills/env.md +0 -198
  543. package/.claude/skills/mastermind-skills/environments.md +0 -250
  544. package/.claude/skills/mastermind-skills/execute.md +0 -104
  545. package/.claude/skills/mastermind-skills/export.md +0 -333
  546. package/.claude/skills/mastermind-skills/finance.md +0 -166
  547. package/.claude/skills/mastermind-skills/finish.md +0 -251
  548. package/.claude/skills/mastermind-skills/goal-detail.md +0 -255
  549. package/.claude/skills/mastermind-skills/goals.md +0 -149
  550. package/.claude/skills/mastermind-skills/heartbeat.md +0 -164
  551. package/.claude/skills/mastermind-skills/idea.md +0 -1142
  552. package/.claude/skills/mastermind-skills/implementer-prompt.md +0 -109
  553. package/.claude/skills/mastermind-skills/import.md +0 -281
  554. package/.claude/skills/mastermind-skills/inbox.md +0 -214
  555. package/.claude/skills/mastermind-skills/instance-settings.md +0 -315
  556. package/.claude/skills/mastermind-skills/instance.md +0 -233
  557. package/.claude/skills/mastermind-skills/invite-landing.md +0 -227
  558. package/.claude/skills/mastermind-skills/invites.md +0 -254
  559. package/.claude/skills/mastermind-skills/issue-detail.md +0 -291
  560. package/.claude/skills/mastermind-skills/issues.md +0 -235
  561. package/.claude/skills/mastermind-skills/join-queue.md +0 -170
  562. package/.claude/skills/mastermind-skills/liveness.md +0 -392
  563. package/.claude/skills/mastermind-skills/marketing.md +0 -228
  564. package/.claude/skills/mastermind-skills/memory.md +0 -321
  565. package/.claude/skills/mastermind-skills/monitor.md +0 -1284
  566. package/.claude/skills/mastermind-skills/monotask.md +0 -350
  567. package/.claude/skills/mastermind-skills/my-issues.md +0 -146
  568. package/.claude/skills/mastermind-skills/new-agent.md +0 -241
  569. package/.claude/skills/mastermind-skills/ops.md +0 -168
  570. package/.claude/skills/mastermind-skills/org-chart.md +0 -209
  571. package/.claude/skills/mastermind-skills/org-settings.md +0 -254
  572. package/.claude/skills/mastermind-skills/orgs.md +0 -98
  573. package/.claude/skills/mastermind-skills/orgstatus.md +0 -194
  574. package/.claude/skills/mastermind-skills/plan-to-tasks.md +0 -136
  575. package/.claude/skills/mastermind-skills/plan.md +0 -198
  576. package/.claude/skills/mastermind-skills/plugin-manager.md +0 -241
  577. package/.claude/skills/mastermind-skills/plugin-settings.md +0 -273
  578. package/.claude/skills/mastermind-skills/plugins.md +0 -190
  579. package/.claude/skills/mastermind-skills/profile.md +0 -187
  580. package/.claude/skills/mastermind-skills/project-detail.md +0 -249
  581. package/.claude/skills/mastermind-skills/project-workspace.md +0 -244
  582. package/.claude/skills/mastermind-skills/projects.md +0 -164
  583. package/.claude/skills/mastermind-skills/receive-review.md +0 -213
  584. package/.claude/skills/mastermind-skills/references/copywriting-frameworks.md +0 -181
  585. package/.claude/skills/mastermind-skills/references/persuasion-psychology.md +0 -158
  586. package/.claude/skills/mastermind-skills/release.md +0 -168
  587. package/.claude/skills/mastermind-skills/research.md +0 -168
  588. package/.claude/skills/mastermind-skills/review.md +0 -233
  589. package/.claude/skills/mastermind-skills/routine-detail.md +0 -253
  590. package/.claude/skills/mastermind-skills/routines.md +0 -203
  591. package/.claude/skills/mastermind-skills/runorg.md +0 -714
  592. package/.claude/skills/mastermind-skills/sales.md +0 -170
  593. package/.claude/skills/mastermind-skills/search.md +0 -186
  594. package/.claude/skills/mastermind-skills/secrets.md +0 -199
  595. package/.claude/skills/mastermind-skills/skill-builder.md +0 -274
  596. package/.claude/skills/mastermind-skills/skills.md +0 -156
  597. package/.claude/skills/mastermind-skills/spec-reviewer-prompt.md +0 -63
  598. package/.claude/skills/mastermind-skills/stoporg.md +0 -138
  599. package/.claude/skills/mastermind-skills/taskdev.md +0 -307
  600. package/.claude/skills/mastermind-skills/tasks.md +0 -149
  601. package/.claude/skills/mastermind-skills/tdd.md +0 -394
  602. package/.claude/skills/mastermind-skills/techport.md +0 -777
  603. package/.claude/skills/mastermind-skills/threads.md +0 -259
  604. package/.claude/skills/mastermind-skills/tree-control.md +0 -250
  605. package/.claude/skills/mastermind-skills/verify.md +0 -196
  606. package/.claude/skills/mastermind-skills/wiki.md +0 -314
  607. package/.claude/skills/mastermind-skills/workspace-detail.md +0 -317
  608. package/.claude/skills/mastermind-skills/workspaces.md +0 -261
  609. package/.claude/skills/mastermind-skills/worktree.md +0 -215
  610. package/.claude/skills/monodesign/SKILL.md +0 -333
  611. package/.claude/skills/monodesign/adapt.md +0 -53
  612. package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +0 -100
  613. package/.claude/skills/monodesign/animate.md +0 -65
  614. package/.claude/skills/monodesign/audit.md +0 -89
  615. package/.claude/skills/monodesign/bolder.md +0 -50
  616. package/.claude/skills/monodesign/clarify.md +0 -64
  617. package/.claude/skills/monodesign/colorize.md +0 -68
  618. package/.claude/skills/monodesign/craft.md +0 -51
  619. package/.claude/skills/monodesign/critique.md +0 -66
  620. package/.claude/skills/monodesign/delight.md +0 -47
  621. package/.claude/skills/monodesign/distill.md +0 -56
  622. package/.claude/skills/monodesign/document.md +0 -83
  623. package/.claude/skills/monodesign/extract.md +0 -74
  624. package/.claude/skills/monodesign/harden.md +0 -65
  625. package/.claude/skills/monodesign/live.md +0 -59
  626. package/.claude/skills/monodesign/onboard.md +0 -50
  627. package/.claude/skills/monodesign/optimize.md +0 -64
  628. package/.claude/skills/monodesign/overdrive.md +0 -56
  629. package/.claude/skills/monodesign/polish.md +0 -68
  630. package/.claude/skills/monodesign/quieter.md +0 -57
  631. package/.claude/skills/monodesign/reference/adapt.md +0 -190
  632. package/.claude/skills/monodesign/reference/animate.md +0 -175
  633. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +0 -359
  634. package/.claude/skills/monodesign/reference/audit.md +0 -133
  635. package/.claude/skills/monodesign/reference/bolder.md +0 -113
  636. package/.claude/skills/monodesign/reference/brand-workflow.md +0 -180
  637. package/.claude/skills/monodesign/reference/brand.md +0 -114
  638. package/.claude/skills/monodesign/reference/clarify.md +0 -174
  639. package/.claude/skills/monodesign/reference/codex.md +0 -107
  640. package/.claude/skills/monodesign/reference/cognitive-load.md +0 -106
  641. package/.claude/skills/monodesign/reference/color-and-contrast.md +0 -105
  642. package/.claude/skills/monodesign/reference/colorize.md +0 -154
  643. package/.claude/skills/monodesign/reference/component-specs.md +0 -260
  644. package/.claude/skills/monodesign/reference/component-states.md +0 -274
  645. package/.claude/skills/monodesign/reference/component-system.md +0 -358
  646. package/.claude/skills/monodesign/reference/copy-formulas.md +0 -160
  647. package/.claude/skills/monodesign/reference/craft.md +0 -196
  648. package/.claude/skills/monodesign/reference/critique.md +0 -213
  649. package/.claude/skills/monodesign/reference/delight.md +0 -302
  650. package/.claude/skills/monodesign/reference/design-principles.md +0 -246
  651. package/.claude/skills/monodesign/reference/distill.md +0 -111
  652. package/.claude/skills/monodesign/reference/document.md +0 -427
  653. package/.claude/skills/monodesign/reference/extract.md +0 -69
  654. package/.claude/skills/monodesign/reference/harden.md +0 -347
  655. package/.claude/skills/monodesign/reference/heuristics-scoring.md +0 -234
  656. package/.claude/skills/monodesign/reference/hooks.md +0 -99
  657. package/.claude/skills/monodesign/reference/image-prompts.md +0 -130
  658. package/.claude/skills/monodesign/reference/interaction-design.md +0 -195
  659. package/.claude/skills/monodesign/reference/layout.md +0 -141
  660. package/.claude/skills/monodesign/reference/live.md +0 -622
  661. package/.claude/skills/monodesign/reference/motion-design.md +0 -109
  662. package/.claude/skills/monodesign/reference/onboard.md +0 -234
  663. package/.claude/skills/monodesign/reference/optimize.md +0 -258
  664. package/.claude/skills/monodesign/reference/overdrive.md +0 -130
  665. package/.claude/skills/monodesign/reference/personas.md +0 -179
  666. package/.claude/skills/monodesign/reference/polish.md +0 -233
  667. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +0 -108
  668. package/.claude/skills/monodesign/reference/product.md +0 -62
  669. package/.claude/skills/monodesign/reference/quieter.md +0 -99
  670. package/.claude/skills/monodesign/reference/responsive-design.md +0 -114
  671. package/.claude/skills/monodesign/reference/shape.md +0 -151
  672. package/.claude/skills/monodesign/reference/spatial-design.md +0 -100
  673. package/.claude/skills/monodesign/reference/teach.md +0 -156
  674. package/.claude/skills/monodesign/reference/token-architecture.md +0 -222
  675. package/.claude/skills/monodesign/reference/typeset.md +0 -124
  676. package/.claude/skills/monodesign/reference/typography.md +0 -159
  677. package/.claude/skills/monodesign/reference/ux-research.md +0 -143
  678. package/.claude/skills/monodesign/reference/ux-rules.md +0 -211
  679. package/.claude/skills/monodesign/reference/ux-writing.md +0 -107
  680. package/.claude/skills/monodesign/shape.md +0 -71
  681. package/.claude/skills/monodesign/teach.md +0 -69
  682. package/.claude/skills/monodesign/typeset.md +0 -59
  683. package/.claude/skills/monolean/SKILL.md +0 -118
  684. package/.claude/skills/monolean-audit/SKILL.md +0 -41
  685. package/.claude/skills/monolean-debt/SKILL.md +0 -46
  686. package/.claude/skills/monolean-help/SKILL.md +0 -60
  687. package/.claude/skills/monolean-review/SKILL.md +0 -57
  688. package/.claude/skills/monomind/.monomind/registry.json +0 -6
  689. package/.claude/skills/monomind/browse-agentcore.md +0 -115
  690. package/.claude/skills/monomind/browse-electron.md +0 -188
  691. package/.claude/skills/monomind/browse-qa.md +0 -228
  692. package/.claude/skills/monomind/browse-references/authentication.md +0 -161
  693. package/.claude/skills/monomind/browse-references/trust-boundaries.md +0 -40
  694. package/.claude/skills/monomind/browse-references/video-recording.md +0 -83
  695. package/.claude/skills/monomind/browse-slack.md +0 -188
  696. package/.claude/skills/monomind/browse-vercel.md +0 -239
  697. package/.claude/skills/monomind/browse.md +0 -724
  698. package/.claude/skills/monomotion/SKILL.md +0 -145
  699. package/.claude/skills/monomotion/rules/api-control.md +0 -139
  700. package/.claude/skills/monomotion/rules/effects.md +0 -109
  701. package/.claude/skills/monomotion/rules/integration.md +0 -140
  702. package/.claude/skills/monomotion/rules/scroll.md +0 -131
  703. package/.claude/skills/monomotion/rules/sequencing.md +0 -105
  704. package/.claude/skills/monomotion/rules/svg.md +0 -101
  705. package/.claude/skills/monomotion/rules/text.md +0 -119
  706. package/.claude/skills/pair-programming/SKILL.md +0 -1202
  707. package/.claude/skills/performance-analysis/SKILL.md +0 -560
  708. package/.claude/skills/skill-builder/SKILL.md +0 -910
  709. package/.claude/skills/sparc-methodology/SKILL.md +0 -950
  710. package/.claude/skills/specialagent/SKILL.md +0 -208
  711. package/.claude/skills/stop-slop/SKILL.md +0 -67
  712. package/.claude/skills/stop-slop/references/examples.md +0 -61
  713. package/.claude/skills/stop-slop/references/phrases.md +0 -130
  714. package/.claude/skills/stop-slop/references/structures.md +0 -136
  715. package/.claude/skills/swarm-advanced/SKILL.md +0 -937
  716. package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
  717. package/.claude/skills/verification-quality/SKILL.md +0 -674
  718. package/.claude/workflows/feature-dev.yaml +0 -18
  719. package/.claude/workflows/security-audit.yaml +0 -10
  720. package/packages/@monomind/cli/.claude/agents/generated/case-analyst.md +0 -50
  721. package/packages/@monomind/cli/.claude/agents/generated/channel-intelligence-director.md +0 -87
  722. package/packages/@monomind/cli/.claude/agents/generated/chief-growth-officer.md +0 -88
  723. package/packages/@monomind/cli/.claude/agents/generated/churn-analyst.md +0 -53
  724. package/packages/@monomind/cli/.claude/agents/generated/code-reviewer.md +0 -55
  725. package/packages/@monomind/cli/.claude/agents/generated/code-validator.md +0 -57
  726. package/packages/@monomind/cli/.claude/agents/generated/complexity-scanner.md +0 -56
  727. package/packages/@monomind/cli/.claude/agents/generated/content-seo-strategist.md +0 -90
  728. package/packages/@monomind/cli/.claude/agents/generated/copy-editor.md +0 -45
  729. package/packages/@monomind/cli/.claude/agents/generated/court-reporter.md +0 -50
  730. package/packages/@monomind/cli/.claude/agents/generated/defender.md +0 -51
  731. package/packages/@monomind/cli/.claude/agents/generated/devbot-orchestrator.md +0 -58
  732. package/packages/@monomind/cli/.claude/agents/generated/devbot-planner.md +0 -63
  733. package/packages/@monomind/cli/.claude/agents/generated/developer-community-strategist.md +0 -91
  734. package/packages/@monomind/cli/.claude/agents/generated/editor-in-chief.md +0 -45
  735. package/packages/@monomind/cli/.claude/agents/generated/fact-checker.md +0 -45
  736. package/packages/@monomind/cli/.claude/agents/generated/impact-assessor.md +0 -54
  737. package/packages/@monomind/cli/.claude/agents/generated/judge.md +0 -51
  738. package/packages/@monomind/cli/.claude/agents/generated/outreach-partnership-strategist.md +0 -90
  739. package/packages/@monomind/cli/.claude/agents/generated/prosecutor.md +0 -51
  740. package/packages/@monomind/cli/.claude/agents/generated/reporter.md +0 -45
  741. package/packages/@monomind/cli/.claude/agents/generated/social-media-strategist.md +0 -91
  742. package/packages/@monomind/cli/.claude/agents/generated/video-visual-strategist.md +0 -90
  743. package/packages/@monomind/cli/.claude/agents/reengineer-squad/boss.md +0 -113
  744. package/packages/@monomind/cli/.claude/agents/reengineer-squad/critic-architect.md +0 -132
  745. package/packages/@monomind/cli/.claude/agents/reengineer-squad/git-manager.md +0 -145
  746. package/packages/@monomind/cli/.claude/agents/reengineer-squad/idea-generator.md +0 -95
  747. package/packages/@monomind/cli/.claude/agents/reengineer-squad/implementer.md +0 -112
  748. package/packages/@monomind/cli/.claude/agents/reengineer-squad/integration-planner.md +0 -112
  749. package/packages/@monomind/cli/.claude/agents/reengineer-squad/source-analyst.md +0 -103
  750. package/packages/@monomind/cli/.claude/agents/reengineer-squad/target-analyst.md +0 -118
  751. package/packages/@monomind/cli/.claude/agents/reengineer-squad/tester.md +0 -105
  752. package/packages/@monomind/cli/.claude/agents/sparc/architecture.md +0 -453
  753. package/packages/@monomind/cli/.claude/agents/sparc/pseudocode.md +0 -299
  754. package/packages/@monomind/cli/.claude/agents/sparc/refinement.md +0 -504
  755. package/packages/@monomind/cli/.claude/agents/sparc/specification.md +0 -258
  756. package/packages/@monomind/cli/.claude/agents/templates/implementer-sparc-coder.md +0 -231
  757. package/packages/@monomind/cli/.claude/commands/sparc/analyzer.md +0 -35
  758. package/packages/@monomind/cli/.claude/commands/sparc/architect.md +0 -36
  759. package/packages/@monomind/cli/.claude/commands/sparc/ask.md +0 -56
  760. package/packages/@monomind/cli/.claude/commands/sparc/batch-executor.md +0 -37
  761. package/packages/@monomind/cli/.claude/commands/sparc/code.md +0 -48
  762. package/packages/@monomind/cli/.claude/commands/sparc/coder.md +0 -37
  763. package/packages/@monomind/cli/.claude/commands/sparc/debug.md +0 -42
  764. package/packages/@monomind/cli/.claude/commands/sparc/debugger.md +0 -37
  765. package/packages/@monomind/cli/.claude/commands/sparc/designer.md +0 -36
  766. package/packages/@monomind/cli/.claude/commands/sparc/devops.md +0 -68
  767. package/packages/@monomind/cli/.claude/commands/sparc/docs-writer.md +0 -39
  768. package/packages/@monomind/cli/.claude/commands/sparc/documenter.md +0 -37
  769. package/packages/@monomind/cli/.claude/commands/sparc/innovator.md +0 -37
  770. package/packages/@monomind/cli/.claude/commands/sparc/integration.md +0 -42
  771. package/packages/@monomind/cli/.claude/commands/sparc/mcp.md +0 -76
  772. package/packages/@monomind/cli/.claude/commands/sparc/memory-manager.md +0 -57
  773. package/packages/@monomind/cli/.claude/commands/sparc/optimizer.md +0 -37
  774. package/packages/@monomind/cli/.claude/commands/sparc/orchestrator.md +0 -70
  775. package/packages/@monomind/cli/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -42
  776. package/packages/@monomind/cli/.claude/commands/sparc/refinement-optimization-mode.md +0 -42
  777. package/packages/@monomind/cli/.claude/commands/sparc/researcher.md +0 -37
  778. package/packages/@monomind/cli/.claude/commands/sparc/reviewer.md +0 -37
  779. package/packages/@monomind/cli/.claude/commands/sparc/security-review.md +0 -39
  780. package/packages/@monomind/cli/.claude/commands/sparc/sparc-modes.md +0 -120
  781. package/packages/@monomind/cli/.claude/commands/sparc/sparc.md +0 -71
  782. package/packages/@monomind/cli/.claude/commands/sparc/spec-pseudocode.md +0 -39
  783. package/packages/@monomind/cli/.claude/commands/sparc/supabase-admin.md +0 -301
  784. package/packages/@monomind/cli/.claude/commands/sparc/swarm-coordinator.md +0 -50
  785. package/packages/@monomind/cli/.claude/commands/sparc/tdd.md +0 -37
  786. package/packages/@monomind/cli/.claude/commands/sparc/tester.md +0 -37
  787. package/packages/@monomind/cli/.claude/commands/sparc/tutorial.md +0 -38
  788. package/packages/@monomind/cli/.claude/commands/sparc/workflow-manager.md +0 -37
  789. package/packages/@monomind/cli/.claude/commands/sparc.md +0 -112
  790. package/packages/@monomind/cli/.claude/skills/sparc-methodology/SKILL.md +0 -950
  791. package/packages/@monomind/cli/dist/src/capabilities/enrichment.d.ts +0 -44
  792. package/packages/@monomind/cli/dist/src/capabilities/enrichment.js +0 -141
  793. package/packages/@monomind/cli/dist/src/commands/analyze-boundaries.d.ts +0 -14
  794. package/packages/@monomind/cli/dist/src/commands/analyze-boundaries.js +0 -295
  795. package/packages/@monomind/cli/dist/src/commands/analyze-graph.d.ts +0 -14
  796. package/packages/@monomind/cli/dist/src/commands/analyze-graph.js +0 -304
  797. package/packages/@monomind/cli/dist/src/commands/claims.d.ts +0 -10
  798. package/packages/@monomind/cli/dist/src/commands/claims.js +0 -650
  799. package/packages/@monomind/cli/dist/src/commands/daemon.d.ts +0 -8
  800. package/packages/@monomind/cli/dist/src/commands/daemon.js +0 -681
  801. package/packages/@monomind/cli/dist/src/commands/enrich.d.ts +0 -10
  802. package/packages/@monomind/cli/dist/src/commands/enrich.js +0 -58
  803. package/packages/@monomind/cli/dist/src/commands/issues.d.ts +0 -21
  804. package/packages/@monomind/cli/dist/src/commands/issues.js +0 -575
  805. package/packages/@monomind/cli/dist/src/commands/workflow.d.ts +0 -8
  806. package/packages/@monomind/cli/dist/src/commands/workflow.js +0 -575
  807. package/packages/@monomind/cli/dist/src/consensus/vote-signer.d.ts +0 -36
  808. package/packages/@monomind/cli/dist/src/consensus/vote-signer.js +0 -88
  809. package/packages/@monomind/cli/dist/src/mcp-tools/workflow-tools.d.ts +0 -8
  810. package/packages/@monomind/cli/dist/src/mcp-tools/workflow-tools.js +0 -717
  811. package/packages/@monomind/cli/dist/src/services/claim-service.d.ts +0 -198
  812. package/packages/@monomind/cli/dist/src/services/claim-service.js +0 -890
  813. package/packages/@monomind/cli/dist/src/services/headless-worker-executor.d.ts +0 -311
  814. package/packages/@monomind/cli/dist/src/services/headless-worker-executor.js +0 -1183
  815. package/packages/@monomind/cli/dist/src/services/worker-daemon.d.ts +0 -230
  816. package/packages/@monomind/cli/dist/src/services/worker-daemon.js +0 -1350
  817. package/packages/@monomind/cli/dist/src/ui/.monomind/capture/active-run.json +0 -1
  818. package/packages/@monomind/guidance/README.md +0 -87
  819. package/packages/@monomind/guidance/dist/adversarial.d.ts +0 -284
  820. package/packages/@monomind/guidance/dist/adversarial.js +0 -572
  821. package/packages/@monomind/guidance/dist/analyzer.d.ts +0 -530
  822. package/packages/@monomind/guidance/dist/analyzer.js +0 -2518
  823. package/packages/@monomind/guidance/dist/artifacts.d.ts +0 -283
  824. package/packages/@monomind/guidance/dist/artifacts.js +0 -356
  825. package/packages/@monomind/guidance/dist/authority.d.ts +0 -290
  826. package/packages/@monomind/guidance/dist/authority.js +0 -558
  827. package/packages/@monomind/guidance/dist/capabilities.d.ts +0 -209
  828. package/packages/@monomind/guidance/dist/capabilities.js +0 -485
  829. package/packages/@monomind/guidance/dist/coherence.d.ts +0 -233
  830. package/packages/@monomind/guidance/dist/coherence.js +0 -378
  831. package/packages/@monomind/guidance/dist/compiler.d.ts +0 -87
  832. package/packages/@monomind/guidance/dist/compiler.js +0 -425
  833. package/packages/@monomind/guidance/dist/conformance-kit.d.ts +0 -225
  834. package/packages/@monomind/guidance/dist/conformance-kit.js +0 -629
  835. package/packages/@monomind/guidance/dist/continue-gate.d.ts +0 -214
  836. package/packages/@monomind/guidance/dist/continue-gate.js +0 -353
  837. package/packages/@monomind/guidance/dist/crypto-utils.d.ts +0 -17
  838. package/packages/@monomind/guidance/dist/crypto-utils.js +0 -24
  839. package/packages/@monomind/guidance/dist/evolution.d.ts +0 -282
  840. package/packages/@monomind/guidance/dist/evolution.js +0 -500
  841. package/packages/@monomind/guidance/dist/gates.d.ts +0 -79
  842. package/packages/@monomind/guidance/dist/gates.js +0 -302
  843. package/packages/@monomind/guidance/dist/gateway.d.ts +0 -206
  844. package/packages/@monomind/guidance/dist/gateway.js +0 -452
  845. package/packages/@monomind/guidance/dist/generators.d.ts +0 -153
  846. package/packages/@monomind/guidance/dist/generators.js +0 -682
  847. package/packages/@monomind/guidance/dist/headless.d.ts +0 -177
  848. package/packages/@monomind/guidance/dist/headless.js +0 -342
  849. package/packages/@monomind/guidance/dist/hooks.d.ts +0 -109
  850. package/packages/@monomind/guidance/dist/hooks.js +0 -347
  851. package/packages/@monomind/guidance/dist/index.d.ts +0 -203
  852. package/packages/@monomind/guidance/dist/index.js +0 -320
  853. package/packages/@monomind/guidance/dist/ledger.d.ts +0 -162
  854. package/packages/@monomind/guidance/dist/ledger.js +0 -375
  855. package/packages/@monomind/guidance/dist/manifest-validator.d.ts +0 -289
  856. package/packages/@monomind/guidance/dist/manifest-validator.js +0 -838
  857. package/packages/@monomind/guidance/dist/memory-gate.d.ts +0 -222
  858. package/packages/@monomind/guidance/dist/memory-gate.js +0 -382
  859. package/packages/@monomind/guidance/dist/meta-governance.d.ts +0 -265
  860. package/packages/@monomind/guidance/dist/meta-governance.js +0 -348
  861. package/packages/@monomind/guidance/dist/optimizer.d.ts +0 -104
  862. package/packages/@monomind/guidance/dist/optimizer.js +0 -329
  863. package/packages/@monomind/guidance/dist/persistence.d.ts +0 -189
  864. package/packages/@monomind/guidance/dist/persistence.js +0 -464
  865. package/packages/@monomind/guidance/dist/proof.d.ts +0 -185
  866. package/packages/@monomind/guidance/dist/proof.js +0 -238
  867. package/packages/@monomind/guidance/dist/retriever.d.ts +0 -116
  868. package/packages/@monomind/guidance/dist/retriever.js +0 -394
  869. package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +0 -370
  870. package/packages/@monomind/guidance/dist/ruvbot-integration.js +0 -738
  871. package/packages/@monomind/guidance/dist/temporal.d.ts +0 -428
  872. package/packages/@monomind/guidance/dist/temporal.js +0 -660
  873. package/packages/@monomind/guidance/dist/trust.d.ts +0 -283
  874. package/packages/@monomind/guidance/dist/trust.js +0 -474
  875. package/packages/@monomind/guidance/dist/truth-anchors.d.ts +0 -276
  876. package/packages/@monomind/guidance/dist/truth-anchors.js +0 -488
  877. package/packages/@monomind/guidance/dist/types.d.ts +0 -378
  878. package/packages/@monomind/guidance/dist/types.js +0 -10
  879. package/packages/@monomind/guidance/dist/uncertainty.d.ts +0 -372
  880. package/packages/@monomind/guidance/dist/uncertainty.js +0 -619
  881. package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +0 -48
  882. package/packages/@monomind/guidance/dist/wasm-kernel.js +0 -158
  883. package/packages/@monomind/guidance/package.json +0 -119
@@ -1,1124 +0,0 @@
1
- <!-- Use when starting any conversation or receiving any user request — loads the brain, routes to the right mastermind skill, enforces anti-drift discipline, and spawns domain managers for complex multi-domain work. Single entry point for all mastermind capabilities. -->
2
-
3
- <SUBAGENT-STOP>
4
- If you were dispatched as a subagent to execute a specific task, skip the MASTERMIND PROTOCOL section below and proceed directly to execution.
5
- </SUBAGENT-STOP>
6
-
7
- ---
8
-
9
- ## MASTERMIND PROTOCOL
10
-
11
- <EXTREMELY-IMPORTANT>
12
- If you think there is even a 1% chance a mastermind skill applies to what you are about to do, you ABSOLUTELY MUST invoke the skill — including before any clarifying questions or other action.
13
-
14
- IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST INVOKE IT.
15
-
16
- This is not negotiable. This is not optional. You cannot rationalize your way out of this.
17
- </EXTREMELY-IMPORTANT>
18
-
19
- ### Instruction Priority
20
-
21
- Mastermind skills override default system prompt behavior, but **user instructions always take precedence**:
22
-
23
- 1. **User's explicit instructions** (CLAUDE.md, GEMINI.md, AGENTS.md, direct requests, `$ARGUMENTS`) — highest priority
24
- 2. **Mastermind skills** — override default behavior where they conflict
25
- 3. **Default system prompt** — lowest priority
26
-
27
- If CLAUDE.md, GEMINI.md, or AGENTS.md says "skip review" and the skill says "always review," follow the user's instructions.
28
-
29
- ### How to Access Mastermind Skills
30
-
31
- > **Never read skill files manually with file tools.** Always use your platform's skill-loading mechanism so the skill is properly activated with its full harness context.
32
-
33
- **In Claude Code:** Use the `Skill` tool. When you invoke a skill, its content is loaded and presented to you — follow it directly.
34
-
35
- **In Copilot CLI:** Use the `skill` tool. Skills are auto-discovered from installed plugins and work the same as Claude Code's `Skill` tool.
36
-
37
- **In Gemini CLI:** Skills activate via the `activate_skill` tool. Gemini loads skill metadata at session start and activates the full content on demand.
38
-
39
- **In Codex:** Skills load natively. Follow the instructions presented when a skill activates.
40
-
41
- **In other environments:** Check your platform's documentation for how skills are loaded.
42
-
43
- ### Platform Adaptation
44
-
45
- Mastermind skills speak in actions ("dispatch a subagent", "invoke the skill tool", "create a todo") rather than naming any one runtime's tools. For per-platform tool equivalents and instructions-file conventions, see [claude-code-tools.md](references/claude-code-tools.md), [codex-tools.md](references/codex-tools.md), [copilot-tools.md](references/copilot-tools.md), [gemini-tools.md](references/gemini-tools.md), [pi-tools.md](references/pi-tools.md), and [antigravity-tools.md](references/antigravity-tools.md). Gemini CLI users get the tool mapping loaded automatically via GEMINI.md.
46
-
47
- ### User Instructions vs. Skill Workflows
48
-
49
- User instructions say **WHAT** to do, not **HOW** to do it. "Build X" or "Fix Y" is a goal statement — it does not mean skip Brain Load, skip review, or bypass the domain decomposition flow. The skills define the how. Always apply the workflow unless the user explicitly opts out.
50
-
51
- ### The Rule
52
-
53
- **Invoke the matching mastermind skill BEFORE any response or action.** Even a 1% chance a skill applies means you must check. If you invoke a skill and it turns out not to fit the situation, you don't need to follow it — but you must check first.
54
-
55
- ### Command-to-Skill Routing
56
-
57
- ```dot
58
- digraph mastermind_routing {
59
- "User command / prompt received" [shape=doublecircle];
60
- "About to EnterPlanMode?" [shape=doublecircle];
61
- "Already ran mastermind:design?" [shape=diamond];
62
- "Invoke mastermind:design first" [shape=box];
63
- "Brain already loaded?" [shape=diamond];
64
- "Load brain (Brain Load Procedure)" [shape=box];
65
- "Might a mastermind skill apply?" [shape=diamond];
66
- "Invoke Skill() tool" [shape=box];
67
- "Announce: Using [skill] for [purpose]" [shape=box];
68
- "Has checklist?" [shape=diamond];
69
- "Execute skill exactly" [shape=box];
70
- "Respond or act (including clarifications)" [shape=doublecircle];
71
-
72
- "About to EnterPlanMode?" -> "Already ran mastermind:design?";
73
- "Already ran mastermind:design?" -> "Invoke mastermind:design first" [label="no"];
74
- "Already ran mastermind:design?" -> "Brain already loaded?" [label="yes"];
75
- "Invoke mastermind:design first" -> "Brain already loaded?";
76
-
77
- "User command / prompt received" -> "Brain already loaded?";
78
- "Brain already loaded?" -> "Load brain (Brain Load Procedure)" [label="no"];
79
- "Brain already loaded?" -> "Might a mastermind skill apply?" [label="yes"];
80
- "Load brain (Brain Load Procedure)" -> "Might a mastermind skill apply?";
81
- "Might a mastermind skill apply?" -> "Invoke Skill() tool" [label="yes, even 1%"];
82
- "Might a mastermind skill apply?" -> "Respond or act (including clarifications)" [label="definitely not"];
83
- "Invoke Skill() tool" -> "Announce: Using [skill] for [purpose]";
84
- "Announce: Using [skill] for [purpose]" -> "Has checklist?";
85
- "Has checklist?" -> "Create TodoWrite item per checklist step" [label="yes"];
86
- "Has checklist?" -> "Execute skill exactly" [label="no"];
87
- "Create TodoWrite item per checklist step" -> "Execute skill exactly";
88
- }
89
- ```
90
-
91
- | Situation | Skill to invoke |
92
- |---|---|
93
- | Debug a bug, test failure, unexpected behavior | `Skill("mastermind-skills:debug")` |
94
- | Verify a claim — tests pass, feature works, fix resolved | `Skill("mastermind-skills:verify")` |
95
- | Write tests first, enforce Red-Green-Refactor | `Skill("mastermind-skills:tdd")` |
96
- | Write a structured implementation plan (no placeholders) | `Skill("mastermind-skills:plan")` |
97
- | Execute a written plan step-by-step with stop-on-blocker | `Skill("mastermind-skills:execute")` |
98
- | Execute a plan via fresh subagents with 2-stage review | `Skill("mastermind-skills:taskdev")` |
99
- | Fix or investigate 2+ independent problems concurrently (different files, subsystems, or bugs) | dispatch parallel subagents in one message — one per independent domain; use `Skill("mastermind-skills:taskdev")` for plan-driven parallel work |
100
- | Ingest a prompt/spec/folder and generate agent-optimized tasks | `Skill("mastermind-skills:createtask")` |
101
- | Execute tasks from a task file or monotask board (parallel/sequential/minimal modes, review cycles, loop) | `Skill("mastermind-skills:do")` |
102
- | Design first — spec, approaches, approval gate before code | `Skill("mastermind-skills:design")` |
103
- | Build a feature, fix a bug, implement anything | `Skill("mastermind-skills:build")` |
104
- | Code review, content critique, strategy audit | `Skill("mastermind-skills:review")` |
105
- | Receive a code review and apply it correctly | `Skill("mastermind-skills:receive-review")` |
106
- | System architecture, DDD, technical design | `Skill("mastermind-skills:architect")` |
107
- | Market research, competitive analysis, user insights | `Skill("mastermind-skills:research")` |
108
- | Ideas, feature generation, opportunity framing | `Skill("mastermind-skills:idea")` |
109
- | Research ideas, evaluate with PM lens, decompose into subtasks | `Skill("mastermind-skills:ideate")` |
110
- | Analyze a component, research improvements, generate improvement tasks | `Skill("mastermind-skills:improve")` |
111
- | Marketing campaign, copy, SEO | `Skill("mastermind-skills:marketing")` |
112
- | Sales outreach, proposals, pipeline | `Skill("mastermind-skills:sales")` |
113
- | Blog, docs, newsletters, threads | `Skill("mastermind-skills:content")` |
114
- | Versioning, changelogs, deployment | `Skill("mastermind-skills:release")` |
115
- | Finish a branch — tests, options menu, merge/PR/discard | `Skill("mastermind-skills:finish")` |
116
- | Workflow, process, reporting | `Skill("mastermind-skills:ops")` |
117
- | Invoicing, forecasting, cost | `Skill("mastermind-skills:finance")` |
118
- | Inspect or manage brain memory | `Skill("mastermind-skills:brain")` |
119
- | Technical portfolio, project state assessment | `Skill("mastermind-skills:techport")` |
120
- | Define/run an agent organization | `Skill("mastermind-skills:createorg")` / `Skill("mastermind-skills:runorg")` |
121
- | Review and action pending agent approval requests | `Skill("mastermind-skills:approve")` |
122
- | Autonomous build + review until clean | `Skill("mastermind-skills:autodev")` |
123
- | Isolate work in a git worktree | `Skill("mastermind-skills:worktree")` |
124
- | Write or improve a mastermind skill | `Skill("mastermind-skills:skill-builder")` |
125
-
126
- ### Skill Execution Order
127
-
128
- When multiple skills could apply to a **single-skill invocation** (not a full mastermind:master multi-domain run):
129
-
130
- 1. **Process skills first** — debug (`mastermind:debug`), brainstorming (`mastermind:idea`), architecture (`mastermind:architect`), research (`mastermind:research`) determine HOW to approach the work
131
- 2. **Execution skills second** — build, review, release execute the approach
132
-
133
- "Let's build X" → `mastermind:architect` first if approach is unclear, then `mastermind:build`.
134
- "Fix this" → `mastermind:debug` to find root cause first, then `mastermind:build` to fix.
135
- "Ship it" → `mastermind:review` to verify clean, then `mastermind:release`.
136
-
137
- **Multi-domain runs (Steps 4–7 of this command):** Domain manager agents for different domains run concurrently — there is no enforced serial order between `build` and `architect` domain managers when both are active. The order above applies when you (the master) are choosing which single skill to invoke directly.
138
-
139
- ### Skill Types
140
-
141
- **Rigid** (tdd, debug, autodev, review with `--tillend`): Follow exactly. Don't adapt away the discipline — it exists to catch the failures that "one quick look" misses.
142
-
143
- **Flexible** (idea, research, content, architect): Adapt principles to context. Use judgment on scope.
144
-
145
- The skill itself tells you which it is.
146
-
147
- ### Anti-Drift Guards
148
-
149
- These thoughts mean **STOP** — you are rationalizing. Check for a skill first.
150
-
151
- | Thought | Reality |
152
- |---|---|
153
- | "This is just a simple question" | Questions are tasks. Check for skills. |
154
- | "This is just a simple task" | Simple tasks define the floor. Check for skills. |
155
- | "I need more context first" | Skill check comes BEFORE gathering context. |
156
- | "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. |
157
- | "I can check git/files quickly before invoking a skill" | Files lack conversation context. Brain Load + skill check come first. |
158
- | "Let me gather information first, then I'll check" | Skills tell you HOW to gather information. Check first. |
159
- | "The brain isn't loaded yet — let me just answer" | Brain Load is the first step. Load it. |
160
- | "This doesn't need a formal skill" | If a skill exists for this domain, use it. |
161
- | "This doesn't count as a real task" | Action = task. Check for skills. |
162
- | "I remember how this works" | Skills evolve. Read current version. Always. |
163
- | "I know what that command does" | Knowing the concept ≠ invoking the skill. Invoke it. |
164
- | "The skill is overkill for this" | Small tasks become complex. Use it. |
165
- | "I'll just do this one thing first" | Check BEFORE doing anything. |
166
- | "This feels productive" | Undisciplined action creates drift. Skills prevent this. |
167
- | "Auto mode means I should move fast" | Speed without discipline creates drift. Use skills. |
168
- | "The user said --auto, so I skip confirmation" | --auto skips user confirmation. It does NOT skip skill invocation. |
169
- | "Spawned agents don't need to check skills" | Subagents that have Skill access MUST use it. Only subagents with the `<SUBAGENT-STOP>` gate may skip. |
170
- | "Agent said success" / "should work now" | Agent reports ≠ evidence. Run `mastermind:verify` independently — fresh and complete. |
171
- | "I'll just make a quick change on main" | No changes on main/master without explicit user consent. `mastermind:worktree` first. |
172
- | "Should I continue?" (in auto mode) | Never ask. Auto mode means execute continuously until blocked or all tasks complete. |
173
- | "TBD / TODO / implement later" (in a plan) | Placeholder = plan failure. Every step needs exact paths, complete code, runnable commands. |
174
- | "Code quality review first, then spec" | Wrong order every time. Spec compliance FIRST, code quality SECOND. Never reversed. |
175
- | "The subagent can read the plan file itself" | Controller provides full task text to each implementer. Subagents never read plan files. |
176
-
177
- ### Mandatory Patterns
178
-
179
- These sequences are non-negotiable in all modes:
180
-
181
- - **Before building**: Load brain → `mastermind:design` if approach is unclear → `mastermind:plan` for complex work → then build
182
- - **When fixing bugs**: `mastermind:debug` first (root cause) → write failing test via `mastermind:tdd` → fix → `mastermind:verify`
183
- - **After building**: `mastermind:review` — at minimum one pass before reporting complete
184
- - **Consuming a review**: `mastermind:receive-review` — verify before implementing, clarify unclear items first
185
- - **After any run**: Brain Write Procedure — score decisions, append to LanceDB
186
- - **Before releasing**: `mastermind:review --tillend --auto` → `mastermind:verify` → `mastermind:finish`
187
- - **Isolated work**: `mastermind:worktree` before making changes to avoid contaminating main
188
- - **Before claiming complete**: Run `mastermind:verify` — never claim completion based on agent reports, linter passes, or partial checks
189
- - **When writing a plan**: Map file structure first → write tasks with exact paths + complete code (no placeholders) → self-review (spec coverage, placeholder scan, type consistency) → offer execution mode choice (subagent-driven vs inline)
190
- - **When executing with subagents**: Provide full task text to each implementer (never make them read the plan file) → spec compliance review FIRST → code quality review SECOND → re-review until both ✅ → dispatch final reviewer after all tasks complete → then `mastermind:finish`
191
- - **When blocked during execution**: Stop immediately — do not guess or force through. Diagnose, provide context, re-dispatch with more capable model, or escalate to user
192
-
193
- ### Iron Laws
194
-
195
- These are inviolable regardless of mode, pressure, or context. Violating the letter of any law is violating its spirit — "I ran verify but only checked one file" or "I found the root cause but skipped the failing test" are not exceptions.
196
-
197
- | Law | Rule |
198
- |---|---|
199
- | **TDD** | No production code without a failing test first. Entry point: `mastermind:tdd`. |
200
- | **Debug** | No fix without root cause investigation first. Entry point: `mastermind:debug`. |
201
- | **Verify** | No completion claim without fresh verification evidence. Entry point: `mastermind:verify`. |
202
- | **Isolation** | No changes on main/master without explicit user consent. Entry point: `mastermind:worktree`. |
203
- | **Plans** | No placeholders: every plan step has exact file paths, complete code, and runnable commands. Entry point: `mastermind:plan`. |
204
-
205
- ### Platform Note
206
-
207
- Mastermind is designed for **Claude Code** but runs on any platform that supports the skill-loading mechanism described in "How to Access Mastermind Skills" above. On all platforms: never use file-reading tools to load skills — always use the platform's skill invocation mechanism. Skill content is loaded and injected by the harness when you call the skill tool with `"mastermind:<name>"`.
208
-
209
- ---
210
-
211
- **If $ARGUMENTS is empty:** Output the capability menu below and wait.
212
-
213
- ---
214
-
215
- **MASTERMIND** — autonomous business execution across specialist domains.
216
-
217
- Describe your goal. Mastermind identifies the relevant domains, spawns specialist agents in parallel, and synthesizes results. Or invoke a domain directly.
218
-
219
- ---
220
-
221
- **Debug & quality**
222
- `/mastermind:debug` — systematic root-cause investigation before any fix attempt
223
- `/mastermind:verify` — confirm claims with evidence: tests pass, feature works, fix resolved
224
- `/mastermind:tdd` — enforce Red-Green-Refactor; no production code before failing test
225
-
226
- **Plan & execute**
227
- `/mastermind:design` — brainstorm, propose approaches, write approved spec before building
228
- `/mastermind:plan` — write a complete implementation plan (no placeholders, exact file paths)
229
- `/mastermind:execute` — run a written plan step-by-step with stop-on-blocker discipline
230
- `/mastermind:taskdev` — execute a plan via fresh subagents with two-stage per-task review
231
- `/mastermind:finish` — complete a branch: verify tests → options menu → merge/PR/keep/discard
232
-
233
- **Build & ship**
234
- `/mastermind:build` — code, features, bug fixes, test suites
235
- `/mastermind:architect` — system structure, DDD, deduplication, migration (`--scope review|design|deduplicate|migrate|all`)
236
- `/mastermind:idea` — products, features, pivots, opportunity framing
237
- `/mastermind:content` — blog, threads, documentation, newsletters
238
-
239
- **Review & improve**
240
- `/mastermind:review` — code quality, content critique, strategy audit
241
- `/mastermind:receive-review` — consume a code review correctly: verify, clarify, push back with evidence
242
-
243
- **Understand & decide**
244
- `/mastermind:research` — market intelligence, competitors, user insights
245
- `/mastermind:brain` — inspect and manage business memory
246
-
247
- **Go to market & operate**
248
- `/mastermind:marketing` — campaigns, copy, SEO, social strategy
249
- `/mastermind:sales` — outreach, proposals, pipeline management
250
- `/mastermind:release` — versioning, changelogs, deployment
251
- `/mastermind:ops` — workflow automation, process reporting
252
- `/mastermind:finance` — invoicing, forecasting, cost tracking
253
-
254
- **Persistent agent orgs** — named teams that coordinate across sessions
255
- `/mastermind:createorg` — define an org: roles, hierarchy, goal
256
- `/mastermind:runorg` — start a saved org; boss agent assigns work to all roles
257
- `/mastermind:approve` — review and action pending approval requests from running org agents
258
-
259
- **Autonomous & advanced**
260
- `/mastermind:autodev` — research → build → review loop until clean (`--tillend` supported)
261
- `/mastermind:techport` — technical portfolio assessment; port capabilities from other projects
262
- `/mastermind:worktree` — isolate work in a git worktree safely
263
- `/mastermind:skill-builder` — write or improve a mastermind skill with TDD discipline
264
-
265
- ---
266
- Flags: `--auto` · `--confirm` · `--project <name>` · `--iterate <N>` · `--monotask`
267
-
268
- ---
269
-
270
- **If $ARGUMENTS is non-empty:** Execute the full flow below.
271
-
272
- ---
273
-
274
- ## Execution Flow
275
-
276
- ### Step 1 — Parse flags
277
-
278
- Extract from `$ARGUMENTS`:
279
- - `--auto` → mode = auto
280
- - `--confirm` → mode = confirm
281
- - `--project <name>` → project_name = <name>
282
- - `--iterate <N>` → iterate = N (integer ≥ 1; when flag is absent, no iteration runs)
283
- - `--monotask` → use_monotask = true (default: false — domain tracking writes to session files only)
284
- - Remaining text = prompt
285
-
286
- If `--project` was not provided, default `project_name` to the current directory name:
287
- ```bash
288
- project_name="${project_name:-$(basename "$PWD")}"
289
- ```
290
-
291
- ### Step 2 — Brain Load
292
-
293
- Follow the Brain Load Procedure from `_protocol.md`:
294
-
295
- 1. Call `mcp__monomind__lancedb_hierarchical-recall` namespace `mastermind:principles` (limit 20)
296
- 2. For each domain that appears relevant to the prompt, call `mcp__monomind__lancedb_context-synthesize` namespace `mastermind:<domain>:weekly`
297
- 3. Call `mcp__monomind__monograph_query` with 3-5 keywords from the prompt
298
-
299
- Assemble the BRAIN CONTEXT block from results.
300
-
301
- ### Step 3 — Intake
302
-
303
- Invoke the intake logic from `_intake.md`:
304
-
305
- - Check if prompt is rich (≥20 words + domain signals + goal phrase)
306
- - If vague: ask intake questions one at a time (Q1–Q5, stop when enough context)
307
- - If user says "decide yourself": make explicit LLM decision, state it, log it with confidence 0.7
308
- - Resolve: mode (auto/confirm), project_name, domains_needed
309
-
310
- **After intake resolves:** Assign shell variables from the intake outputs (these are LLM-resolved values that must be echoed into the bash environment before the curl block runs):
311
- - `resolved_prompt` = the full cleaned prompt string
312
- - `mode` = `"auto"` or `"confirm"`
313
-
314
- Then generate `SESSION_ID` and persist it so iteration cycles can retrieve it across separate Bash calls:
315
-
316
- ```bash
317
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
318
- # Resolve git-safe monomind data root — shared across worktrees and branch-agnostic.
319
- # In a worktree .git is a pointer file; we navigate to the common .git directory.
320
- _get_mono_dir() {
321
- local w="${1:-$(pwd)}"
322
- if [ -d "$w/.git" ]; then echo "$w/.git/monomind"; return; fi
323
- if [ -f "$w/.git" ]; then
324
- local m; m=$(grep '^gitdir:' "$w/.git" | sed 's/gitdir: *//')
325
- [ -z "$m" ] && { echo "$w/.monomind"; return; }
326
- [[ "$m" != /* ]] && m="$w/$m"
327
- echo "$(dirname "$(dirname "$m")")/monomind"; return
328
- fi
329
- echo "$w/.monomind"
330
- }
331
- MONO_DIR=$(_get_mono_dir "$REPO_ROOT")
332
- SESSION_ID="mm-$(date -u +%Y%m%dT%H%M%S)"
333
- mkdir -p "$MONO_DIR/sessions"
334
- # Persist SESSION_ID and project context so Step 12 can restore it in a new shell
335
- jq -n --arg sid "$SESSION_ID" --arg proj "$project_name" --arg prompt "$resolved_prompt" \
336
- '{sessionId:$sid,project_name:$proj,prompt:$prompt}' \
337
- > "$MONO_DIR/sessions/current.json.tmp" \
338
- && mv "$MONO_DIR/sessions/current.json.tmp" \
339
- "$MONO_DIR/sessions/current.json"
340
- CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
341
- curl -s -o /dev/null -X POST "${CTRL_URL}/api/mastermind/event" \
342
- -H "Content-Type: application/json" \
343
- -d "$(jq -cn --arg sid "$SESSION_ID" --arg prompt "$resolved_prompt" --arg mode "$mode" --arg proj "$REPO_ROOT" \
344
- '{type:"session:start",session:$sid,prompt:$prompt,mode:$mode,project:$proj,ts:(now*1000|floor)}')" || true
345
- ```
346
-
347
- ### Step 3.5 — Design Gate
348
-
349
- <HARD-GATE>
350
- STOP before Step 4. If `domains_needed` includes `build` (or any code/feature/fix work):
351
-
352
- 1. Invoke `Skill("mastermind-skills:design")` NOW — pass `resolved_prompt` as the task description
353
- 2. Do NOT write any code, do NOT spawn any domain managers, do NOT proceed to Step 4 until the design skill returns with an approved spec
354
- 3. When design returns: save the approved spec as `build_spec` in `current.json`
355
- 4. Only then continue to Step 4
356
-
357
- If `domains_needed` contains ONLY non-build domains (marketing, sales, research, content, ops, finance, idea): skip this gate and go directly to Step 4.
358
-
359
- Rationale: without a design gate, master spawns agents before the user has confirmed what to build. The design gate replicates the superpowers workflow: questions → approaches → spec approval → plan → execute.
360
- </HARD-GATE>
361
-
362
- ### Step 4 — Decompose
363
-
364
- For each domain in `domains_needed`, assess complexity:
365
- - **Simple** (skill-only): single task, single agent, < 30 minutes estimated — invoke skill directly
366
- - **Complex** (manager agent): multi-step, multi-file, multi-day, or multi-agent — spawn a Task agent
367
-
368
- Complexity threshold for manager agent: any of these is true:
369
- - Requires 3+ files to be created/modified
370
- - Requires 2+ specialized agent types
371
- - Has external dependencies (APIs, services)
372
- - Is estimated to take more than one conversation turn
373
-
374
- **DOMAIN EXCEPTION — `idea`:** The `idea` domain MUST always be handled by the master invoking `Skill("mastermind-skills:idea")` directly — NEVER by spawning a Task agent. Spawned agents do not have Skill tool access, so delegating `idea` to a Task agent silently degrades to raw analysis with no pipeline execution. After `mastermind:idea` returns, treat its output as the `idea` domain's unified output schema and proceed to the next domain.
375
-
376
- **Per-domain goal extraction:** For each activated domain, extract a one-sentence goal from the prompt describing what that domain must accomplish. Then **run the following Bash block**, substituting `<domain_goals_json>` with a JSON object mapping each domain name to its one-sentence goal (use the full `resolved_prompt` as the value for any domain where no specific goal is extractable):
377
-
378
- ```bash
379
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
380
- _get_mono_dir() {
381
- local w="${1:-$(pwd)}"
382
- if [ -d "$w/.git" ]; then echo "$w/.git/monomind"; return; fi
383
- if [ -f "$w/.git" ]; then
384
- local m; m=$(grep '^gitdir:' "$w/.git" | sed 's/gitdir: *//')
385
- [ -z "$m" ] && { echo "$w/.monomind"; return; }
386
- [[ "$m" != /* ]] && m="$w/$m"
387
- echo "$(dirname "$(dirname "$m")")/monomind"; return
388
- fi
389
- echo "$w/.monomind"
390
- }
391
- MONO_DIR=$(_get_mono_dir "$REPO_ROOT")
392
- SESSION_STATE="$MONO_DIR/sessions/current.json"
393
- [ -f "$SESSION_STATE" ] || { echo "ERROR: current.json not found"; exit 1; }
394
-
395
- # LLM: write the extracted goals JSON object to the temp file below.
396
- # Use a file (not a shell variable) to avoid quoting issues with apostrophes in goal text.
397
- # Example content: {"build":"Ship the auth module","marketing":"Draft launch email series"}
398
- # One JSON object, keys = domain names, values = one-sentence goals.
399
- SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
400
- [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID missing in current.json — run Step 3 first"; exit 1; }
401
- GOALS_FILE="$MONO_DIR/sessions/${SESSION_ID}_goals.json"
402
- cat > "$GOALS_FILE" << 'GOALS_EOF'
403
- <domain_goals_json>
404
- GOALS_EOF
405
-
406
- # Validate it's real JSON before merging
407
- jq . "$GOALS_FILE" > /dev/null 2>&1 || { echo "ERROR: domain_goals_json is not valid JSON — check LLM substitution"; exit 1; }
408
-
409
- jq --slurpfile goals "$GOALS_FILE" '. + {domain_goals:$goals[0]}' \
410
- "$SESSION_STATE" > "$SESSION_STATE.tmp" && mv "$SESSION_STATE.tmp" "$SESSION_STATE"
411
- echo "Domain goals written to current.json"
412
- ```
413
-
414
- ### Step 5 — Plan Output
415
-
416
- Build a plan summary:
417
-
418
- ```
419
- MASTERMIND PLAN — <project_name>
420
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
421
- Prompt: <prompt>
422
- Mode: <auto|confirm>
423
-
424
- Domains activated:
425
- ✦ build → Development Manager agent → board: <project>/development (will be created in Step 6)
426
- ✦ marketing → Marketing Manager agent → board: <project>/marketing (will be created in Step 6)
427
-
428
- Monotask space: <project_name>
429
- Brain loaded: <N> principles, <M> domain summaries
430
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
431
- ```
432
-
433
- If mode = confirm: show plan and wait for user response. Valid responses:
434
- - "go" or "proceed" — continue immediately
435
- - Any modification (e.g. "add sales domain", "remove marketing") — apply the change, re-show the plan, wait again
436
- - "cancel" or "stop" — emit `session:complete` with `status: blocked`, reason "cancelled by user", then STOP
437
-
438
- After the user says "go" (and `build` is in `domains_needed`), ask once:
439
- > "For the build work: **subagents** (recommended — fresh agent per task with 2-stage review, like mastermind:taskdev) or **inline** (direct execution, mastermind:execute)?"
440
-
441
- - "subagents" → `build_exec_mode = "taskdev"`
442
- - "inline" → `build_exec_mode = "execute"`
443
- - No answer / skipped → `build_exec_mode = "taskdev"` (default)
444
-
445
- If mode = auto: `build_exec_mode = "taskdev"` (default).
446
-
447
- **Persist `build_exec_mode` to `current.json`** (required — Phase C reads it from there):
448
-
449
- ```bash
450
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
451
- _get_mono_dir() {
452
- local w="${1:-$(pwd)}"
453
- if [ -d "$w/.git" ]; then echo "$w/.git/monomind"; return; fi
454
- if [ -f "$w/.git" ]; then
455
- local m; m=$(grep '^gitdir:' "$w/.git" | sed 's/gitdir: *//')
456
- [ -z "$m" ] && { echo "$w/.monomind"; return; }
457
- [[ "$m" != /* ]] && m="$w/$m"
458
- echo "$(dirname "$(dirname "$m")")/monomind"; return
459
- fi
460
- echo "$w/.monomind"
461
- }
462
- MONO_DIR=$(_get_mono_dir "$REPO_ROOT")
463
- SESSION_STATE="$MONO_DIR/sessions/current.json"
464
- # LLM: replace EXEC_MODE_VALUE with the resolved value: taskdev or execute
465
- build_exec_mode="EXEC_MODE_VALUE"
466
- [ "$build_exec_mode" = "EXEC_MODE_VALUE" ] && build_exec_mode="taskdev"
467
- jq --arg m "$build_exec_mode" '. + {build_exec_mode: $m}' \
468
- "$SESSION_STATE" > "$SESSION_STATE.tmp" && mv "$SESSION_STATE.tmp" "$SESSION_STATE"
469
- echo "build_exec_mode=$build_exec_mode written to current.json"
470
- ```
471
-
472
- ### Step 6 — Monotask Setup
473
-
474
- **Skip this step entirely if `use_monotask` is false** (the default). Domain tracking uses session JSON files only — no boards are created. Set `monotask_available: false` in `current.json` so Step 7 runs without board IDs.
475
-
476
- If `use_monotask` is true: follow the Monotask Space+Board Setup Procedure from `_protocol.md`. Resolve the space **once**, then create one board per active domain. Use `project_name` as the space name so all boards across repos and domains share the same space.
477
-
478
- **Board naming convention:** Every board is named `<project_name>-<domain>` (e.g. `factory-idea`, `factory-build`). This canonical name is stable across runs — mastermind finds the existing board instead of creating a new one every time.
479
-
480
- ```bash
481
- # Compatible with macOS bash 3.2 — no associative arrays, uses jq accumulation instead
482
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
483
- SESSION_STATE="$MONO_DIR/sessions/current.json"
484
-
485
- # monotask availability guard — all card/board operations below require it
486
- if ! command -v monotask >/dev/null 2>&1; then
487
- echo "WARN: monotask CLI not found — board and card creation will be skipped."
488
- echo "Install via: npm install -g monotask"
489
- echo "Domain managers will run without board IDs (text-only output)."
490
- # Write marker to current.json so Step 7 Phase C skips Task spawning with empty boards
491
- jq '. + {monotask_available: false}' "$SESSION_STATE" > "$SESSION_STATE.tmp" \
492
- && mv "$SESSION_STATE.tmp" "$SESSION_STATE" 2>/dev/null || true
493
- exit 0
494
- fi
495
-
496
- SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
497
- [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID missing in current.json — run Step 3 first"; exit 1; }
498
- project_name=$(jq -r '.project_name // ""' "$SESSION_STATE")
499
- [ -z "$project_name" ] && { echo "ERROR: project_name is empty in current.json — run Step 3 first"; exit 1; }
500
- resolved_prompt=$(jq -r '.prompt // ""' "$SESSION_STATE")
501
-
502
- # LLM: replace DOMAINS_LIST_HERE with space-separated domain names, e.g.: build marketing sales
503
- domains_needed="DOMAINS_LIST_HERE"
504
- [ "$domains_needed" = "DOMAINS_LIST_HERE" ] && { echo "ERROR: LLM did not substitute DOMAINS_LIST_HERE"; exit 1; }
505
- [ -z "$domains_needed" ] && { echo "ERROR: domains_needed is empty — nothing to do"; exit 1; }
506
-
507
- # Resolve space once — find existing by exact name or create
508
- space_id=$(monotask space list 2>/dev/null | awk -F'|' '{gsub(/^ +| +$/,"",$1);gsub(/^ +| +$/,"",$2);if($2==n)print $1}' n="$project_name" | head -1)
509
- [ -z "$space_id" ] && space_id=$(monotask space create "$project_name" 2>/dev/null | grep -oE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')
510
- [ -z "$space_id" ] && { echo "ERROR: Could not find or create space '$project_name'"; exit 1; }
511
- echo "Space: $space_id ($project_name)"
512
-
513
- # jq accumulation state (replaces bash 4.3+ associative arrays)
514
- state_patch='{}'
515
-
516
- for domain in $domains_needed; do
517
- canonical="${project_name}-${domain}"
518
-
519
- # Find existing board by canonical name — reuse across runs
520
- # board list format is "uuid: name" (colon-space separator, NOT pipe)
521
- board_id=$(monotask board list 2>/dev/null | awk -F': ' '{gsub(/^ +| +$/,"",$1);gsub(/^ +| +$/,"",$2);if($2==n)print $1}' n="$canonical" | head -1)
522
-
523
- # Domain-specific column schema:
524
- # idea → New | Evaluated | Elaborated | Tasked | Iced | Rejected (intake = "New")
525
- # all others → Todo | In Progress | Human in Loop | Review | Done | Cancelled (intake = "Todo")
526
- if [ "$domain" = "idea" ]; then
527
- intake_col_name="New"
528
- else
529
- intake_col_name="Todo"
530
- fi
531
-
532
- if [ -n "$board_id" ]; then
533
- echo "Reusing board: $board_id ($canonical)"
534
- cols_json=$(monotask column list "$board_id" --json 2>/dev/null || echo '[]')
535
- todo_col=$(echo "$cols_json" | jq -r --arg n "$intake_col_name" '[.[] | select(.title==$n)] | .[0].id // empty')
536
- doing_col=$(echo "$cols_json" | jq -r '[.[] | select(.title=="In Progress" or .title=="Doing")] | .[0].id // empty')
537
- done_col=$(echo "$cols_json" | jq -r '[.[] | select(.title=="Done")] | .[0].id // empty')
538
- else
539
- echo "Creating board: $canonical"
540
- board_id=$(monotask board create --space "$space_id" "$canonical" --json 2>/dev/null | jq -r '.id // empty')
541
- [ -z "$board_id" ] && echo "[mastermind] monotask board unavailable — board tracking skipped."
542
- monotask space boards add "$space_id" "$board_id" >/dev/null 2>&1 || true
543
- if [ "$domain" = "idea" ]; then
544
- todo_col=$(monotask column create "$board_id" "New" --json | jq -r '.id // empty')
545
- doing_col=$(monotask column create "$board_id" "Evaluated" --json | jq -r '.id // empty')
546
- monotask column create "$board_id" "Elaborated" --json >/dev/null
547
- monotask column create "$board_id" "Tasked" --json >/dev/null
548
- monotask column create "$board_id" "Iced" --json >/dev/null
549
- done_col=$(monotask column create "$board_id" "Rejected" --json | jq -r '.id // empty')
550
- else
551
- todo_col=$(monotask column create "$board_id" "Todo" --json | jq -r '.id // empty')
552
- doing_col=$(monotask column create "$board_id" "In Progress" --json | jq -r '.id // empty')
553
- monotask column create "$board_id" "Human in Loop" --json >/dev/null
554
- monotask column create "$board_id" "Review" --json >/dev/null
555
- done_col=$(monotask column create "$board_id" "Done" --json | jq -r '.id // empty')
556
- monotask column create "$board_id" "Cancelled" --json >/dev/null
557
- fi
558
- [ -z "$todo_col" ] && { echo "ERROR: Failed to create intake column for $domain"; exit 1; }
559
- fi
560
-
561
- domain_goal=$(jq -r --arg d "$domain" '.domain_goals[$d] // empty' "$SESSION_STATE")
562
- [ -z "$domain_goal" ] && domain_goal="$resolved_prompt"
563
-
564
- state_patch=$(echo "$state_patch" | jq \
565
- --arg d "$domain" --arg b "$board_id" \
566
- --arg t "$todo_col" --arg g "$doing_col" --arg e "$done_col" \
567
- --arg goal "$domain_goal" \
568
- '.board_ids[$d]=$b | .todo_cols[$d]=$t | .doing_cols[$d]=$g | .done_cols[$d]=$e | .domain_goals[$d]=$goal')
569
-
570
- echo "DOMAIN=$domain BOARD=$board_id TODO=$todo_col DOING=$doing_col DONE=$done_col"
571
- done
572
-
573
- # Persist to current.json — one atomic merge
574
- jq --arg domains "$domains_needed" \
575
- --argjson patch "$state_patch" \
576
- '. + $patch + {domains_needed:($domains | split(" ") | map(select(length>0)))}' \
577
- "$SESSION_STATE" > "$SESSION_STATE.tmp" && mv "$SESSION_STATE.tmp" "$SESSION_STATE"
578
- echo "Session state saved to current.json"
579
- ```
580
-
581
- ### Step 7 — Spawn Domain Managers
582
-
583
- **BEFORE THIS STEP:** If `idea` is in `domains_needed`, invoke `Skill("mastermind-skills:idea")` directly now (master context has Skill tool access). Pass the resolved prompt, project path, and mode. The idea skill's Step 7 writes its output to `$MONO_DIR/sessions/<SESSION_ID>/idea.json` automatically — do not write it again. Mark the `idea` domain as handled. Do NOT include `idea` in the Task spawning below.
584
-
585
- **IDEA PIPELINE REQUIREMENT:** `mastermind:idea` runs a multi-step pipeline (Steps 3–6 inside idea.md). You MUST follow all of those steps — do NOT shortcut to manually creating cards. The full pipeline is:
586
- - Step 3: Board setup — find-or-create `<project_name>-idea` board (master's Step 6 already created it with correct columns: New → Evaluated → Elaborated → Tasked → Iced → Rejected). Load column IDs from existing board.
587
- - Step 4: Spawn Idea Manager agent (coordinator) with specialist sub-agents per angle — generates ideas as cards in the `New` column.
588
- - Step 5: Spawn PM agent for validation — moves each card to `Evaluated`, `Iced`, or `Rejected`, sets impact/effort.
589
- - Step 6a: Elaboration agents enrich each `Evaluated` card and move it to `Elaborated`.
590
- - Step 6b: User gate (skip in auto mode).
591
- - Step 6c: Task decomposition — creates subtask cards on `<project_name>-tasks-dev` and `<project_name>-tasks-ops` boards, linked as subtasks of their parent idea card. Moves parent idea cards to `Tasked`.
592
-
593
- Skipping any of these steps produces an incomplete pipeline run — card content is generated but no evaluation, elaboration, or task breakdown occurs.
594
-
595
- **Before spawning**, select the best domain manager agent type from the registry for each active domain. Do not hardcode `coordinator` — pick the agent whose expertise best fits the domain goal.
596
-
597
- **BASH TOOL REQUIREMENT:** Domain managers must run `monotask` CLI commands. Only use subagent_types that include Bash in their tool list. If the registry returns an agent without Bash (e.g. `Product Manager`, `Backend Architect`), override it with `general-purpose` (which has all tools). Agents without Bash cannot create cards, emit curl events, or write session files — they will silently produce degraded output.
598
-
599
- **Phase A — Registry selection** (run as one Bash call; must complete before Phase C):
600
-
601
- ```bash
602
- # Compatible with macOS bash 3.2 — uses jq accumulation instead of declare -A
603
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
604
- REGISTRY="$REPO_ROOT/.monomind/registry.json"
605
-
606
- # Reload state from current.json — this is a new shell; no inherited variables
607
- SESSION_STATE="$MONO_DIR/sessions/current.json"
608
- [ -f "$SESSION_STATE" ] || { echo "ERROR: current.json not found — run from Step 3"; exit 1; }
609
- # If Step 6 skipped due to missing monotask, board_ids are empty — skip Task agent spawning
610
- if [ "$(jq -r '.monotask_available // true' "$SESSION_STATE")" = "false" ]; then
611
- echo "INFO: monotask_available=false — domain managers will be spawned in text-only mode (no board IDs)"
612
- echo " Install monotask (npm install -g monotask) and re-run to enable board tracking."
613
- fi
614
- domains_needed=$(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | grep -v '^idea$' | tr '\n' ' ')
615
- [ -z "$domains_needed" ] && { echo "INFO: no non-idea domains to spawn as Task agents"; } # idea-only runs are valid
616
-
617
- # Returns: best agent name from registry for the given domain+goal
618
- pick_domain_manager() {
619
- local domain="$1"
620
- local goal="$2"
621
- local kw cats result
622
- kw=$(echo "$goal" | tr '[:upper:]' '[:lower:]' | grep -oE '[a-z]{5,}' | sort -u | tr '\n' ' ')
623
- case "$domain" in
624
- build) cats="engineering development architecture" ;;
625
- marketing) cats="marketing paid-media strategy" ;;
626
- sales) cats="sales strategy" ;;
627
- research) cats="academic specialized strategy" ;;
628
- content) cats="marketing specialized" ;;
629
- ops) cats="project-management strategy support" ;;
630
- release) cats="devops github engineering" ;;
631
- review) cats="engineering testing analysis" ;;
632
- finance) cats="strategy specialized" ;;
633
- architect) cats="architecture engineering" ;;
634
- idea) cats="product strategy marketing" ;;
635
- *) cats="core strategy" ;;
636
- esac
637
- result=$(jq -r \
638
- --arg cats "$cats" \
639
- --arg kw "$kw" \
640
- '[ .agents[] | select(.deprecated != true)
641
- | select(.category as $c | ($cats | split(" ") | any(. == $c)))
642
- | {name: .name,
643
- score: (
644
- (.name | ascii_downcase) as $n |
645
- # Score on ANY keyword match, not just the first
646
- (if ($kw | length) > 0
647
- then ([$kw | split(" ")[] | select(length > 0) | if ($n | contains(.)) then 1 else 0 end] | add // 0)
648
- else 0 end) +
649
- (if $n | test("manager|director|coordinator") then 1 else 0 end)
650
- )}
651
- ] | sort_by(-.score) | .[0].name // empty' \
652
- "$REGISTRY" 2>/dev/null)
653
- if [ -z "$result" ]; then
654
- echo "WARN: registry lookup failed for domain=$domain, using coordinator fallback" >&2
655
- echo "coordinator"
656
- else
657
- echo "$result"
658
- fi
659
- }
660
-
661
- # jq accumulation (replaces bash 4.3+ declare -A — compatible with macOS bash 3.2)
662
- domain_managers_json='{}'
663
- for domain in $domains_needed; do
664
- goal=$(jq -r --arg d "$domain" '.domain_goals[$d] // empty' "$SESSION_STATE")
665
- [ -z "$goal" ] && goal=$(jq -r '.prompt // ""' "$SESSION_STATE")
666
- manager=$(pick_domain_manager "$domain" "$goal")
667
- domain_managers_json=$(echo "$domain_managers_json" | jq --arg d "$domain" --arg m "$manager" '. + {($d): $m}')
668
- echo "Domain manager for $domain: $manager"
669
- done
670
-
671
- # Persist domain_managers so Phase C can reload them without stdout parsing
672
- [ -z "$domain_managers_json" ] && domain_managers_json="{}"
673
- jq --argjson mgrs "$domain_managers_json" '. + {domain_managers:$mgrs}' \
674
- "$SESSION_STATE" > "$SESSION_STATE.tmp" && mv "$SESSION_STATE.tmp" "$SESSION_STATE"
675
-
676
- # Emit board/column lookup for LLM use in Phase C Task construction:
677
- echo "--- Phase C board/col IDs (loaded from current.json) ---"
678
- for domain in $domains_needed; do
679
- board=$(jq -r --arg d "$domain" '.board_ids[$d] // ""' "$SESSION_STATE")
680
- todo=$(jq -r --arg d "$domain" '.todo_cols[$d] // ""' "$SESSION_STATE")
681
- doing=$(jq -r --arg d "$domain" '.doing_cols[$d] // ""' "$SESSION_STATE")
682
- done_c=$(jq -r --arg d "$domain" '.done_cols[$d] // ""' "$SESSION_STATE")
683
- mgr=$(jq -r --arg d "$domain" '.domain_managers[$d] // "coordinator"' "$SESSION_STATE")
684
- echo "DOMAIN=$domain MANAGER=$mgr BOARD=$board TODO=$todo DOING=$doing DONE=$done_c"
685
- done
686
- ```
687
-
688
- **Phase B — Dashboard dispatch** + **Phase C — Task spawning** (run in one message — B is a Bash call, C is the Task tool calls; they are independent of each other):
689
-
690
- Phase B:
691
- ```bash
692
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
693
- SESSION_STATE="$MONO_DIR/sessions/current.json"
694
- SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
695
- [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID not found in current.json"; exit 1; }
696
- CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
697
- # Filter idea — it was already handled by Skill tool before Phase A, not dispatched as a Task agent
698
- domains_needed=$(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | grep -v '^idea$' | tr '\n' ' ')
699
- for domain in $domains_needed; do
700
- goal=$(jq -r --arg d "$domain" '.domain_goals[$d] // empty' "$SESSION_STATE")
701
- [ -z "$goal" ] && goal=$(jq -r '.prompt // ""' "$SESSION_STATE")
702
- curl -s -o /dev/null -X POST "${CTRL_URL}/api/mastermind/event" \
703
- -H "Content-Type: application/json" \
704
- -d "$(jq -cn --arg sid "$SESSION_ID" --arg d "$domain" --arg cmd "$goal" \
705
- '{type:"domain:dispatch",session:$sid,domain:$d,cmd:$cmd,ts:(now*1000|floor)}')" || true
706
- done
707
- ```
708
-
709
- Spawn ALL domain manager agents in ONE message using the Task tool (parallel execution).
710
-
711
- **Before constructing the Task calls:** load board/column UUIDs and domain manager names from `current.json` — that is the authoritative source. The Phase A echo lines are a human-readable diagnostic only; do not parse them as the primary data source.
712
-
713
- ```bash
714
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
715
- SESSION_STATE="$MONO_DIR/sessions/current.json"
716
- SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
717
- [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID missing"; exit 1; }
718
-
719
- # Emit one line per domain for LLM to read before constructing Task calls
720
- for domain in $(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | grep -v '^idea$'); do
721
- board_id=$(jq -r --arg d "$domain" '.board_ids[$d] // ""' "$SESSION_STATE")
722
- if [ -z "$board_id" ]; then
723
- echo "WARN: DOMAIN=$domain has no board_id — Step 6 may not have run or monotask is missing. Task agent will run without board tracking."
724
- fi
725
- exec_mode=""
726
- [ "$domain" = "build" ] && exec_mode=$(jq -r '.build_exec_mode // "taskdev"' "$SESSION_STATE")
727
- echo "DOMAIN=$domain \
728
- MANAGER=$(jq -r --arg d "$domain" '.domain_managers[$d] // "coordinator"' "$SESSION_STATE") \
729
- BOARD=$board_id \
730
- TODO=$(jq -r --arg d "$domain" '.todo_cols[$d] // ""' "$SESSION_STATE") \
731
- DOING=$(jq -r --arg d "$domain" '.doing_cols[$d] // ""' "$SESSION_STATE") \
732
- DONE=$(jq -r --arg d "$domain" '.done_cols[$d] // ""' "$SESSION_STATE") \
733
- EXEC_MODE=$exec_mode \
734
- GOAL=$(jq -r --arg d "$domain" '.domain_goals[$d] // .prompt' "$SESSION_STATE" | tr -d '\n')"
735
- done
736
- ```
737
-
738
- Use each `MANAGER` value as `subagent_type`, `BOARD`/`TODO`/`DOING`/`DONE` as board and column IDs. Do NOT use placeholder strings.
739
-
740
- Each Task call must include a complete briefing following the Monotask Task Briefing Standard from `_protocol.md`. Include:
741
- - The full BRAIN CONTEXT block
742
- - The board ID (from `current.json` above)
743
- - The specific goal for this domain
744
- - The project name and run context
745
- - Instruction to create monotask cards directly using `monotask card create $BOARD_ID $COL_TODO_ID "<title>" --json` for all sub-tasks
746
- - Instruction to use `Skill("mastermind-skills:do")` to execute tasks (Task agents have Skill tool access — do NOT use slash command syntax)
747
- - Instruction to spawn specialized agents using the domain-appropriate swarm topology
748
- - **For the `build` domain only:** include `build_exec_mode` (value: `"taskdev"` or `"execute"`) and instruct the manager: "Use `Skill("mastermind-skills:taskdev")` if build_exec_mode is `taskdev`, or `Skill("mastermind-skills:execute")` if `execute`. This was chosen by the user in Step 5."
749
- - Instruction to return the unified output schema when done
750
-
751
- Example Task call for Development Manager. Substitute all **pre-known** `<…>` placeholders (project_name, SESSION_ID, board/col IDs, goals, manager name) before calling Task. Placeholders like `<status>`, `<path1>`, `<action1>` are filled at runtime by the spawned agent — do not attempt to substitute them. `subagent_type` is the **string value** of `$domain_manager_build` (e.g. `"Backend Architect"`), not a variable reference.
752
-
753
- **IMPORTANT — `<SESSION_ID>` appears 6 times in the template below. ALL must be replaced with the resolved value:**
754
- 1. `SESSION ID: <SESSION_ID>` — the header line in the prompt
755
- 2. `--arg sid '<SESSION_ID>'` in the agent:spawn curl call
756
- 3. `--arg sid '<SESSION_ID>'` in the intercom curl call
757
- 4. `mkdir -p "…/sessions/<SESSION_ID>"` — the output directory
758
- 5. `> "…/sessions/<SESSION_ID>/build.json"` — the output file path
759
- 6. `--arg sid '<SESSION_ID>'` in the domain:complete curl call
760
-
761
- Missing any one causes silent failures (output files written to a literal `<SESSION_ID>` directory that doesn't exist; Step 9 finds nothing and reports `complete` with zero domains).
762
-
763
- ```javascript
764
- Task({
765
- subagent_type: "<value of domain_manager_build, e.g. Backend Architect>",
766
- description: "Development Manager for project <project_name>",
767
- run_in_background: false, // foreground so Step 8 can collect output synchronously
768
- prompt: "You are the Development Manager for project <project_name>.\n\n" +
769
- "CONTEXT: Mastermind run <date> | Project: <project_name> | Master spawned you.\n\n" +
770
- "SESSION ID: <SESSION_ID> — use in all dashboard events below.\n\n" +
771
- "BRAIN CONTEXT:\n<paste brain context here>\n\n" +
772
- "YOUR BOARD: <board_build> (monotask://<project_name>/build)\n" +
773
- "TODO COL: <todo_col_build> | DOING COL: <doing_col_build> | DONE COL: <done_col_build>\n\n" +
774
- "GOAL: <build_goal>\n\n" +
775
- "YOUR RESPONSIBILITIES:\n" +
776
- "1. Break this goal into discrete tasks using:\n" +
777
- " monotask card create <board_build> <todo_col_build> '<title>' --json\n" +
778
- " Each card description MUST include: context, goal, scope, constraints, success criteria, agent, dependencies.\n\n" +
779
- "2. Spawn specialized agents for each task using the Task tool:\n" +
780
- " - Backend work: subagent_type 'backend-dev'\n" +
781
- " - Frontend work: subagent_type 'frontend-dev'\n" +
782
- " - Testing: subagent_type 'tester'\n" +
783
- " - Code review: subagent_type 'reviewer'\n" +
784
- " Default swarm: hierarchical 6 agents raft\n\n" +
785
- "3. BEFORE spawning each agent, emit agent:spawn via curl (NOT WebFetch — use jq for correct ms timestamps):\n" +
786
- " REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)\n" +
787
- " CTRL_URL=$(jq -r '.url // \"http://localhost:4242\"' \"$REPO_ROOT/.monomind/control.json\" 2>/dev/null || echo \"http://localhost:4242\")\n" +
788
- " curl -s -o /dev/null -X POST ${CTRL_URL}/api/mastermind/event \\\n" +
789
- " -H 'Content-Type: application/json' \\\n" +
790
- " -d \"$(jq -cn --arg sid '<SESSION_ID>' --arg agent '<slug>' --arg task '<title>' \\\n" +
791
- " '{type:\"agent:spawn\",session:$sid,domain:\"build\",agent:$agent,task:$task,ts:(now*1000|floor)}')\" || true\n\n" +
792
- "4. If handing off artifacts to another domain, emit intercom via curl:\n" +
793
- " curl -s -o /dev/null -X POST ${CTRL_URL}/api/mastermind/event \\\n" +
794
- " -H 'Content-Type: application/json' \\\n" +
795
- " -d \"$(jq -cn --arg sid '<SESSION_ID>' --arg to '<domain>' --arg msg '<summary>' \\\n" +
796
- " '{type:\"intercom\",session:$sid,from:\"build\",to:$to,msg:$msg,ts:(now*1000|floor)}')\" || true\n\n" +
797
- "5. Execute tasks via Skill(\"mastermind:do\") --board <board_build> (use Skill tool — slash command syntax does not work inside a Task agent)\n" +
798
- "6. Collect all agent outputs\n\n" +
799
- "7. BEFORE returning, write your output schema to disk AND emit domain:complete:\n" +
800
- " REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)\n" +
801
- " _mm() { local w=\"$1\"; if [ -d \"$w/.git\" ]; then echo \"$w/.git/monomind\"; elif [ -f \"$w/.git\" ]; then local m; m=$(grep '^gitdir:' \"$w/.git\" | sed 's/gitdir: *//'); [ -z \"$m\" ] && { echo \"$w/.monomind\"; return; }; [[ \"$m\" != /* ]] && m=\"$w/$m\"; echo \"$(dirname \"$(dirname \"$m\")\")/monomind\"; else echo \"$w/.monomind\"; fi; }\n" +
802
- " MONO_DIR=$(_mm \"$REPO_ROOT\")\n" +
803
- " CTRL_URL=$(jq -r '.url // \"http://localhost:4242\"' \"$REPO_ROOT/.monomind/control.json\" 2>/dev/null || echo \"http://localhost:4242\")\n" +
804
- " mkdir -p \"$MONO_DIR/sessions/<SESSION_ID>\"\n" +
805
- " jq -n --arg domain 'build' --arg status '<status>' \\\n" +
806
- " --argjson artifacts '[\"<path1>\",\"<path2>\"]' \\\n" +
807
- " --argjson next_actions '[\"<action1>\"]' \\\n" +
808
- " '{domain:$domain,status:$status,artifacts:$artifacts,next_actions:$next_actions}' \\\n" +
809
- " > \"$MONO_DIR/sessions/<SESSION_ID>/build.json\"\n" +
810
- " curl -s -o /dev/null -X POST ${CTRL_URL}/api/mastermind/event \\\n" +
811
- " -H 'Content-Type: application/json' \\\n" +
812
- " -d \"$(jq -cn --arg sid '<SESSION_ID>' --arg status '<status>' \\\n" +
813
- " '{type:\"domain:complete\",session:$sid,domain:\"build\",status:$status,ts:(now*1000|floor)}')\" || true\n\n" +
814
- "8. Return unified output schema:\n" +
815
- " domain: build\n" +
816
- " status: complete|partial|blocked\n" +
817
- " artifacts: [...]\n" +
818
- " decisions: [...]\n" +
819
- " lessons: [...]\n" +
820
- " next_actions: [...]\n" +
821
- " board_url: monotask://<project_name>/build\n" +
822
- " run_id: <ISO8601-timestamp>"
823
- })
824
- ```
825
-
826
- ### Step 8 — Collect Reports
827
-
828
- Domain managers run in foreground (no `run_in_background`), so their unified output schemas are returned synchronously as each Task call completes. Each domain manager writes its canonical output schema to `$MONO_DIR/sessions/<SESSION_ID>/<domain>.json` before returning — that file is the source of truth for Step 9 aggregation. The Task tool's text return value is informational only; do not attempt to parse it as JSON. If a manager reports `status: blocked`, record it but continue collecting from all others — do not abort the run.
829
-
830
- ### Step 9 — Synthesize
831
-
832
- 1. Collect all domain output schemas from Step 8
833
- 2. Compute aggregate status — read from per-domain output files (precedence: blocked > partial > complete):
834
-
835
- ```bash
836
- # Single bash block: aggregate status + emit dashboard event
837
- # (variables don't persist between Bash tool calls — keep aggregation and curl together)
838
- # Compatible with macOS bash 3.2 — only uses indexed arrays
839
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
840
- _get_mono_dir() {
841
- local w="${1:-$(pwd)}"
842
- if [ -d "$w/.git" ]; then echo "$w/.git/monomind"; return; fi
843
- if [ -f "$w/.git" ]; then
844
- local m; m=$(grep '^gitdir:' "$w/.git" | sed 's/gitdir: *//')
845
- [ -z "$m" ] && { echo "$w/.monomind"; return; }
846
- [[ "$m" != /* ]] && m="$w/$m"
847
- echo "$(dirname "$(dirname "$m")")/monomind"; return
848
- fi
849
- echo "$w/.monomind"
850
- }
851
- MONO_DIR=$(_get_mono_dir "$REPO_ROOT")
852
- SESSION_ID=$(jq -r '.sessionId // empty' "$MONO_DIR/sessions/current.json" 2>/dev/null)
853
- [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID missing"; exit 1; }
854
- CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
855
-
856
- overall_status="complete"
857
- completed_domains=()
858
- found_domain_files=0
859
- for domain_file in "$MONO_DIR/sessions/${SESSION_ID}"/*.json; do
860
- [ -f "$domain_file" ] || continue
861
- domain=$(jq -r '.domain // ""' "$domain_file")
862
- [ -z "$domain" ] && continue # skip auxiliary files that aren't domain output schemas
863
- found_domain_files=$(( found_domain_files + 1 ))
864
- status=$(jq -r '.status // "blocked"' "$domain_file")
865
- case "$status" in
866
- blocked) overall_status="blocked" ;;
867
- partial) [ "$overall_status" != "blocked" ] && overall_status="partial" ;;
868
- esac
869
- [ "$status" = "complete" ] && completed_domains+=("$domain")
870
- done
871
- (( found_domain_files == 0 )) && { overall_status="blocked"; echo "WARN: no domain output files found for session $SESSION_ID — all domain managers may have failed"; }
872
- echo "overall_status=$overall_status completed_domains=${completed_domains[*]}"
873
-
874
- completed_domains_json=$(jq -n '$ARGS.positional' --args "${completed_domains[@]}")
875
-
876
- curl -s -o /dev/null -X POST "${CTRL_URL}/api/mastermind/event" \
877
- -H "Content-Type: application/json" \
878
- -d "$(jq -cn \
879
- --arg sid "$SESSION_ID" \
880
- --arg status "$overall_status" \
881
- --argjson domains "$completed_domains_json" \
882
- '{type:"session:complete",session:$sid,status:$status,domains:$domains,ts:(now*1000|floor)}')" || true
883
- ```
884
-
885
- 3. Identify any cross-domain artifacts needed (e.g. a release that requires both build and review)
886
- 4. Write cross-domain artifacts to disk if needed
887
- 5. Compose the action summary for the user:
888
-
889
- ```
890
- MASTERMIND RUN COMPLETE — <project_name>
891
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
892
- Status: complete | partial | blocked
893
-
894
- Domains completed: build ✓ | marketing ✓
895
- Domains blocked: (none)
896
-
897
- Artifacts produced:
898
- /path/to/file1 (code)
899
- /path/to/file2 (copy)
900
-
901
- Key decisions made:
902
- • [what] — [why] (confidence: X)
903
-
904
- Next actions suggested:
905
- • /mastermind:review --project <project_name>
906
- • /mastermind:release --project <project_name>
907
-
908
- Monotask boards:
909
- → monotask://<project_name>/development
910
- → monotask://<project_name>/marketing
911
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
912
- ```
913
-
914
- ### Step 10 — Brain Write
915
-
916
- Follow the Brain Write Procedure from `_protocol.md` for each domain that ran:
917
- 1. Score all decisions from this run
918
- 2. Append to Tier 1 raw log (LanceDB)
919
- 3. Check and trigger weekly compaction if threshold met
920
- 4. Check and trigger graph consolidation if cluster detected
921
-
922
- ### Step 11 — Output to User
923
-
924
- Show the action summary (Step 9). If any compaction ran during Step 10, append:
925
- > "Brain updated: compacted <N> entries into <M> summaries."
926
-
927
- **Persist session state for iteration cycles:** Aggregate artifacts from per-domain output files written by each domain manager, then persist to disk so Step 12 can load it:
928
-
929
- ```bash
930
- # Compatible with macOS bash 3.2 — only uses indexed arrays
931
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
932
- _get_mono_dir() {
933
- local w="${1:-$(pwd)}"
934
- if [ -d "$w/.git" ]; then echo "$w/.git/monomind"; return; fi
935
- if [ -f "$w/.git" ]; then
936
- local m; m=$(grep '^gitdir:' "$w/.git" | sed 's/gitdir: *//')
937
- [ -z "$m" ] && { echo "$w/.monomind"; return; }
938
- [[ "$m" != /* ]] && m="$w/$m"
939
- echo "$(dirname "$(dirname "$m")")/monomind"; return
940
- fi
941
- echo "$w/.monomind"
942
- }
943
- MONO_DIR=$(_get_mono_dir "$REPO_ROOT")
944
- SESSION_STATE="$MONO_DIR/sessions/current.json"
945
-
946
- # Restore variables from current.json (this is a fresh shell)
947
- SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
948
- [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID not found"; exit 1; }
949
- resolved_prompt=$(jq -r '.prompt // ""' "$SESSION_STATE")
950
- project_name=$(jq -r '.project_name // ""' "$SESSION_STATE")
951
-
952
- # Aggregate artifacts, next_actions, completed_domains, and overall_status
953
- # from per-domain output files (single source of truth — Step 9 shell is gone)
954
- all_artifacts=()
955
- all_next_actions=()
956
- completed_domains=()
957
- overall_status="complete"
958
- found_domain_files=0
959
- for domain_file in "$MONO_DIR/sessions/${SESSION_ID}"/*.json; do
960
- [ -f "$domain_file" ] || continue
961
- domain=$(jq -r '.domain // ""' "$domain_file")
962
- [ -z "$domain" ] && continue # skip auxiliary files that aren't domain output schemas
963
- found_domain_files=$(( found_domain_files + 1 ))
964
- status=$(jq -r '.status // "blocked"' "$domain_file")
965
- case "$status" in
966
- blocked) overall_status="blocked" ;;
967
- partial) [ "$overall_status" != "blocked" ] && overall_status="partial" ;;
968
- esac
969
- [ "$status" = "complete" ] && completed_domains+=("$domain")
970
- while IFS= read -r art; do all_artifacts+=("$art"); done \
971
- < <(jq -r '.artifacts[]? // empty' "$domain_file" 2>/dev/null)
972
- while IFS= read -r act; do all_next_actions+=("$act"); done \
973
- < <(jq -r '.next_actions[]? // empty' "$domain_file" 2>/dev/null)
974
- done
975
- (( found_domain_files == 0 )) && { overall_status="blocked"; echo "WARN: no domain output files found for session $SESSION_ID"; }
976
-
977
- artifacts_json=$(jq -n '$ARGS.positional' --args "${all_artifacts[@]}")
978
- next_actions_json=$(jq -n '$ARGS.positional' --args "${all_next_actions[@]}")
979
- completed_domains_json=$(jq -n '$ARGS.positional' --args "${completed_domains[@]}")
980
-
981
- jq -n \
982
- --arg sessionId "$SESSION_ID" \
983
- --arg prompt "$resolved_prompt" \
984
- --arg project_name "$project_name" \
985
- --arg status "$overall_status" \
986
- --argjson completed_domains "$completed_domains_json" \
987
- --argjson artifacts "$artifacts_json" \
988
- --argjson next_actions "$next_actions_json" \
989
- --arg run_id "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
990
- '{sessionId:$sessionId,prompt:$prompt,project_name:$project_name,status:$status,
991
- completed_domains:$completed_domains,artifacts:$artifacts,next_actions:$next_actions,
992
- run_id:$run_id}' \
993
- > "$MONO_DIR/sessions/${SESSION_ID}.json.tmp" \
994
- && mv "$MONO_DIR/sessions/${SESSION_ID}.json.tmp" \
995
- "$MONO_DIR/sessions/${SESSION_ID}.json"
996
- ```
997
-
998
- ---
999
-
1000
- ### Step 12 — Iteration Loop (only if `--iterate <N>` was set and N ≥ 1)
1001
-
1002
- After Step 11, run N autonomous improvement cycles. Each cycle is a full self-directed run — no user input required.
1003
-
1004
- **For each cycle i = 1 … N:**
1005
-
1006
- #### 12a — Assess Current State
1007
-
1008
- Load fresh brain context (repeat Brain Load Procedure from `_protocol.md`). Load the persisted session state:
1009
-
1010
- ```bash
1011
- REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
1012
- _get_mono_dir() {
1013
- local w="${1:-$(pwd)}"
1014
- if [ -d "$w/.git" ]; then echo "$w/.git/monomind"; return; fi
1015
- if [ -f "$w/.git" ]; then
1016
- local m; m=$(grep '^gitdir:' "$w/.git" | sed 's/gitdir: *//')
1017
- [ -z "$m" ] && { echo "$w/.monomind"; return; }
1018
- [[ "$m" != /* ]] && m="$w/$m"
1019
- echo "$(dirname "$(dirname "$m")")/monomind"; return
1020
- fi
1021
- echo "$w/.monomind"
1022
- }
1023
- MONO_DIR=$(_get_mono_dir "$REPO_ROOT")
1024
- # Restore SESSION_ID — may be in a new shell context
1025
- SESSION_ID=$(jq -r '.sessionId // empty' "$MONO_DIR/sessions/current.json" 2>/dev/null)
1026
- [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID not found in current.json — cannot continue iteration."; exit 1; }
1027
-
1028
- SESSION_FILE="$MONO_DIR/sessions/${SESSION_ID}.json"
1029
- SESSION_STATE="$MONO_DIR/sessions/current.json"
1030
- # Echo to stdout — bash variables don't survive tool call boundaries; only stdout is visible to the LLM
1031
- # Emit run summary (artifacts, next_actions, project_name) from the session file
1032
- jq '{artifacts:.artifacts,next_actions:.next_actions,project_name:.project_name}' "$SESSION_FILE" 2>/dev/null \
1033
- || echo '{"artifacts":[],"next_actions":[],"project_name":""}'
1034
-
1035
- # Emit board_ids from current.json (not carried in SESSION_FILE) so Step 12c can look up board UUIDs
1036
- echo "--- board_ids (from current.json) ---"
1037
- jq '{board_ids:(.board_ids // {})}' "$SESSION_STATE" 2>/dev/null \
1038
- || echo '{"board_ids":{}}'
1039
- ```
1040
-
1041
- Then evaluate the project's current state by examining:
1042
- - What was just completed (artifacts from the `artifacts` array printed above)
1043
- - What `next_actions` entries printed above suggest
1044
- - What the `next_actions` from all domain outputs say
1045
- - What the git diff shows (if applicable) — any test failures, TODOs, or incomplete work
1046
- - What gaps exist relative to the original prompt's success criteria
1047
-
1048
- #### 12b — Decide Next Activity
1049
-
1050
- Choose the single highest-value activity for this cycle. Rank candidates by this priority:
1051
-
1052
- | Priority | Activity | Choose when |
1053
- |---|---|---|
1054
- | 1 | **Test** | New code exists with no test coverage, or tests failed |
1055
- | 2 | **Debug / Fix** | Tests are failing or artifacts have known errors |
1056
- | 3 | **Review** | Significant new code exists with no review pass |
1057
- | 4 | **Improve / Refactor** | Code works but has quality issues surfaced by review or brain |
1058
- | 5 | **Add feature** | Core is stable; next_actions suggest new capability aligned with project goal |
1059
- | 6 | **Research** | Significant unknowns remain before next feature can be decided |
1060
- | 7 | **Content / Docs** | Feature is complete and undocumented |
1061
- | 8 | **Release** | Project is stable, tested, reviewed — ready to ship |
1062
-
1063
- State the decision explicitly:
1064
- > "Cycle <i>/<N>: I'm choosing to **<activity>** because <one-sentence reason>. Confidence: <0.0–1.0>"
1065
-
1066
- Log this as a decision in the cycle's output schema with `confidence` set accordingly.
1067
-
1068
- #### 12c — Execute
1069
-
1070
- Execute the chosen activity by invoking the appropriate domain skill via the `Skill` tool (Steps 4–10 of the main flow, condensed). Use `Skill("mastermind-skills:<domain>")` — do NOT use slash command syntax (`/<name>`), which only works when typed interactively in the Claude Code CLI, not within an executing command or skill:
1071
-
1072
- - Test → `Skill("mastermind-skills:tdd")` with the untested artifacts as prompt (enforce Red-Green-Refactor)
1073
- - Debug/Fix → `Skill("mastermind-skills:debug")` with the failing test or error as prompt (root-cause first, then fix)
1074
- - Review → `Skill("mastermind-skills:review")` with scope = artifacts from last run
1075
- - Improve/Refactor → `Skill("mastermind-skills:build")` with refactor prompt
1076
- - Add feature → `Skill("mastermind-skills:build")` with the next feature from the `next_actions` array printed by the Step 12a output above
1077
- - Research → `Skill("mastermind-skills:research")` with the open question as prompt
1078
- - Content/Docs → `Skill("mastermind-skills:content")` with scope = new artifacts
1079
- - Release → `Skill("mastermind-skills:release")` with project scope
1080
-
1081
- Always pass: the current brain_context, project_name (from the `project_name` field above), the relevant board_id, and mode = auto (iteration cycles never pause for confirmation).
1082
-
1083
- **Board ID lookup per activity:**
1084
- - `tdd`, `debug`, `Improve/Refactor`, `Add feature` → use `board_ids['build']` (these are build-domain activities)
1085
- - `review` → use `board_ids['review']`; fallback to `board_ids['build']` if not present
1086
- - `research` → use `board_ids['research']`; fallback to `board_ids['build']`
1087
- - `content` → use `board_ids['content']`; fallback to `board_ids['build']`
1088
- - `release` → use `board_ids['release']`; fallback to `board_ids['build']`
1089
-
1090
- **Constraint:** Only invoke a skill whose domain board_id exists in the `board_ids` map. If `board_ids['build']` is missing (rare), skip to the next activity whose board IS present. `build` is almost always present.
1091
-
1092
- #### 12d — Brain Write
1093
-
1094
- Follow Brain Write Procedure from `_protocol.md` for this cycle's domain. Score and append.
1095
-
1096
- #### 12e — Cycle Summary
1097
-
1098
- Output a compact progress line:
1099
-
1100
- ```
1101
- ITERATION <i>/<N> — <activity> — <status: complete|partial|blocked>
1102
- → <one-line summary of what was done>
1103
- → Next cycle will: <predicted next activity based on current state>
1104
- ```
1105
-
1106
- If the cycle returns `status: blocked`, skip remaining cycles and report:
1107
- > "Iteration halted at cycle <i>: blocked on <reason>. Remaining <N-i> cycles skipped."
1108
-
1109
- ---
1110
-
1111
- After all N cycles complete, output a final iteration summary:
1112
-
1113
- ```
1114
- ITERATION COMPLETE — <N> cycles — <project_name>
1115
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1116
- Cycle 1: test → 12 tests added, all passing
1117
- Cycle 2: review → 3 issues found, 2 fixed inline
1118
- Cycle 3: improve → auth module refactored, 15% complexity reduction
1119
- ...
1120
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1121
- Brain updated: <total decisions scored and logged>
1122
- Project state: <one-sentence assessment of where things stand>
1123
- Suggested next: <what a human should do or approve next>
1124
- ```