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