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,1350 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Monomind V1 Statusline Generator (Optimized)
|
|
4
|
+
* Displays real-time v1 implementation progress and system status
|
|
5
|
+
*
|
|
6
|
+
* Usage: node statusline.cjs [--json] [--compact]
|
|
7
|
+
*
|
|
8
|
+
* Performance notes:
|
|
9
|
+
* - Single git execSync call (combines branch + status + upstream)
|
|
10
|
+
* - No recursive file reading (only stat/readdir, never read test contents)
|
|
11
|
+
* - No ps aux calls (uses process.memoryUsage() + file-based metrics)
|
|
12
|
+
* - Strict 2s timeout on all execSync calls
|
|
13
|
+
* - Shared settings cache across functions
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
const path = require('path');
|
|
19
|
+
const { execSync, spawnSync } = require('child_process');
|
|
20
|
+
const os = require('os');
|
|
21
|
+
|
|
22
|
+
// Configuration
|
|
23
|
+
const CONFIG = {
|
|
24
|
+
maxAgents: 15,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const CWD = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
28
|
+
|
|
29
|
+
// Read monomind version — check global install first, then CWD package.json
|
|
30
|
+
function getVersion() {
|
|
31
|
+
// 1. Monomind global install: script lives at <install>/packages/@monomind/cli/dist/src/init/
|
|
32
|
+
// or user project: .claude/helpers/statusline.cjs
|
|
33
|
+
// Walk up to find a monomind package.json (has "name":"monomind" or "@monomind/cli")
|
|
34
|
+
const scriptDir = path.dirname(__filename);
|
|
35
|
+
const walkCandidates = [
|
|
36
|
+
path.join(scriptDir, '..', '..', 'package.json'), // dist/src -> @monomind/cli
|
|
37
|
+
path.join(scriptDir, '..', '..', '..', 'package.json'), // -> monomind umbrella
|
|
38
|
+
path.join(scriptDir, '..', '..', '..', '..', 'package.json'),
|
|
39
|
+
];
|
|
40
|
+
for (const p of walkCandidates) {
|
|
41
|
+
try {
|
|
42
|
+
const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
43
|
+
if (pkg.version && (pkg.name === 'monomind' || pkg.name === '@monomind/cli' || (pkg.name || '').startsWith('@monomind'))) {
|
|
44
|
+
return `v${pkg.version}`;
|
|
45
|
+
}
|
|
46
|
+
} catch { /* ignore */ }
|
|
47
|
+
}
|
|
48
|
+
// 2. Fallback: npm global prefix
|
|
49
|
+
try {
|
|
50
|
+
const { execSync } = require('child_process');
|
|
51
|
+
const prefix = execSync('npm config get prefix', { encoding: 'utf-8', timeout: 2000 }).trim();
|
|
52
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(prefix, 'lib', 'node_modules', 'monomind', 'package.json'), 'utf-8'));
|
|
53
|
+
if (pkg.version) return `v${pkg.version}`;
|
|
54
|
+
} catch { /* ignore */ }
|
|
55
|
+
return 'v1.0.6';
|
|
56
|
+
}
|
|
57
|
+
const VERSION = getVersion();
|
|
58
|
+
|
|
59
|
+
// ANSI colors
|
|
60
|
+
const c = {
|
|
61
|
+
reset: '\x1b[0m',
|
|
62
|
+
bold: '\x1b[1m',
|
|
63
|
+
dim: '\x1b[2m',
|
|
64
|
+
red: '\x1b[0;31m',
|
|
65
|
+
green: '\x1b[0;32m',
|
|
66
|
+
yellow: '\x1b[0;33m',
|
|
67
|
+
blue: '\x1b[0;34m',
|
|
68
|
+
purple: '\x1b[0;35m',
|
|
69
|
+
cyan: '\x1b[0;36m',
|
|
70
|
+
brightRed: '\x1b[1;31m',
|
|
71
|
+
brightGreen: '\x1b[1;32m',
|
|
72
|
+
brightYellow: '\x1b[1;33m',
|
|
73
|
+
brightBlue: '\x1b[1;34m',
|
|
74
|
+
brightPurple: '\x1b[1;35m',
|
|
75
|
+
brightCyan: '\x1b[1;36m',
|
|
76
|
+
brightWhite: '\x1b[1;37m',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Safe execSync with strict timeout (returns empty string on failure)
|
|
80
|
+
function safeExec(cmd, timeoutMs = 2000) {
|
|
81
|
+
try {
|
|
82
|
+
return execSync(cmd, {
|
|
83
|
+
encoding: 'utf-8',
|
|
84
|
+
timeout: timeoutMs,
|
|
85
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
86
|
+
}).trim();
|
|
87
|
+
} catch {
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Safe JSON file reader (returns null on failure)
|
|
93
|
+
function readJSON(filePath) {
|
|
94
|
+
try {
|
|
95
|
+
if (fs.existsSync(filePath)) {
|
|
96
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
97
|
+
}
|
|
98
|
+
} catch { /* ignore */ }
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Safe file stat (returns null on failure)
|
|
103
|
+
function safeStat(filePath) {
|
|
104
|
+
try {
|
|
105
|
+
return fs.statSync(filePath);
|
|
106
|
+
} catch { /* ignore */ }
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Shared settings cache — read once, used by multiple functions
|
|
111
|
+
let _settingsCache = undefined;
|
|
112
|
+
function getSettings() {
|
|
113
|
+
if (_settingsCache !== undefined) return _settingsCache;
|
|
114
|
+
_settingsCache = readJSON(path.join(CWD, '.claude', 'settings.json'))
|
|
115
|
+
|| readJSON(path.join(CWD, '.claude', 'settings.local.json'))
|
|
116
|
+
|| null;
|
|
117
|
+
return _settingsCache;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Project identifier — github owner/repo from git remote, else folder name
|
|
121
|
+
function getProjectName() {
|
|
122
|
+
try {
|
|
123
|
+
const remote = safeExec('git remote get-url origin 2>/dev/null', 2000).trim();
|
|
124
|
+
if (remote) {
|
|
125
|
+
const m = remote.match(/[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?$/);
|
|
126
|
+
if (m) return `${m[1]}/${m[2]}`;
|
|
127
|
+
}
|
|
128
|
+
} catch { /* ignore */ }
|
|
129
|
+
return path.basename(CWD);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ─── Data Collection (all pure-Node.js or single-exec) ──────────
|
|
133
|
+
|
|
134
|
+
// Get all git info in ONE shell call
|
|
135
|
+
function getGitInfo() {
|
|
136
|
+
const result = {
|
|
137
|
+
name: 'user', gitBranch: '', modified: 0, untracked: 0,
|
|
138
|
+
staged: 0, ahead: 0, behind: 0,
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Single shell: get user.name, branch, porcelain status, and upstream diff
|
|
142
|
+
const script = [
|
|
143
|
+
'git config user.name 2>/dev/null || echo user',
|
|
144
|
+
'echo "---SEP---"',
|
|
145
|
+
'git branch --show-current 2>/dev/null',
|
|
146
|
+
'echo "---SEP---"',
|
|
147
|
+
'git status --porcelain 2>/dev/null',
|
|
148
|
+
'echo "---SEP---"',
|
|
149
|
+
'git rev-list --left-right --count HEAD...@{upstream} 2>/dev/null || echo "0 0"',
|
|
150
|
+
].join('; ');
|
|
151
|
+
|
|
152
|
+
const raw = safeExec(`sh -c '${script}'`, 3000);
|
|
153
|
+
if (!raw) return result;
|
|
154
|
+
|
|
155
|
+
const parts = raw.split('---SEP---').map(s => s.trim());
|
|
156
|
+
if (parts.length >= 4) {
|
|
157
|
+
result.name = parts[0] || 'user';
|
|
158
|
+
result.gitBranch = parts[1] || '';
|
|
159
|
+
|
|
160
|
+
// Parse porcelain status
|
|
161
|
+
if (parts[2]) {
|
|
162
|
+
for (const line of parts[2].split('\n')) {
|
|
163
|
+
if (!line || line.length < 2) continue;
|
|
164
|
+
const x = line[0], y = line[1];
|
|
165
|
+
if (x === '?' && y === '?') { result.untracked++; continue; }
|
|
166
|
+
if (x !== ' ' && x !== '?') result.staged++;
|
|
167
|
+
if (y !== ' ' && y !== '?') result.modified++;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Parse ahead/behind
|
|
172
|
+
const ab = (parts[3] || '0 0').split(/\s+/);
|
|
173
|
+
result.ahead = parseInt(ab[0]) || 0;
|
|
174
|
+
result.behind = parseInt(ab[1]) || 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Normalise a model ID string to a short display name
|
|
181
|
+
function modelLabel(id) {
|
|
182
|
+
if (id.includes('opus')) return 'Opus 4.6';
|
|
183
|
+
if (id.includes('sonnet')) return 'Sonnet 4.6';
|
|
184
|
+
if (id.includes('haiku')) return 'Haiku 4.5';
|
|
185
|
+
return id.split('-').slice(1, 3).join(' ');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Read the last assistant model from the most recent session JSONL.
|
|
189
|
+
// Claude Code writes each assistant turn to ~/.claude/projects/<escaped-cwd>/<uuid>.jsonl
|
|
190
|
+
// with a "message.model" field — this is the most accurate live source and
|
|
191
|
+
// correctly reflects /model session overrides.
|
|
192
|
+
function getModelFromSessionJSONL() {
|
|
193
|
+
try {
|
|
194
|
+
// Escape CWD the same way Claude Code does: replace '/' with '-'
|
|
195
|
+
const escaped = CWD.replace(/\//g, '-');
|
|
196
|
+
const projectsDir = path.join(os.homedir(), '.claude', 'projects', escaped);
|
|
197
|
+
if (!fs.existsSync(projectsDir)) return null;
|
|
198
|
+
|
|
199
|
+
// Most recently modified JSONL = current (or latest) session
|
|
200
|
+
const files = fs.readdirSync(projectsDir)
|
|
201
|
+
.filter(f => f.endsWith('.jsonl'))
|
|
202
|
+
.map(f => ({ f, mt: (() => { try { return fs.statSync(path.join(projectsDir, f)).mtimeMs; } catch { return 0; } })() }))
|
|
203
|
+
.sort((a, b) => b.mt - a.mt);
|
|
204
|
+
if (files.length === 0) return null;
|
|
205
|
+
|
|
206
|
+
const sessionFile = path.join(projectsDir, files[0].f);
|
|
207
|
+
// Guard against OOM: skip session files larger than 10 MB
|
|
208
|
+
try { if (fs.statSync(sessionFile).size > 10 * 1024 * 1024) return null; } catch { return null; }
|
|
209
|
+
const raw = fs.readFileSync(sessionFile, 'utf-8');
|
|
210
|
+
const lines = raw.split('\n').filter(Boolean);
|
|
211
|
+
|
|
212
|
+
// Scan from the end to find the most recent assistant model
|
|
213
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
214
|
+
try {
|
|
215
|
+
const entry = JSON.parse(lines[i]);
|
|
216
|
+
const model = entry?.message?.model || entry?.model;
|
|
217
|
+
if (model && typeof model === 'string' && model.startsWith('claude')) {
|
|
218
|
+
return model;
|
|
219
|
+
}
|
|
220
|
+
} catch { /* skip malformed line */ }
|
|
221
|
+
}
|
|
222
|
+
} catch { /* ignore */ }
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Detect model name from Claude config (pure file reads, no exec)
|
|
227
|
+
function getModelName() {
|
|
228
|
+
// PRIMARY: scan the live session JSONL — reflects /model overrides in real time
|
|
229
|
+
const sessionModel = getModelFromSessionJSONL();
|
|
230
|
+
if (sessionModel) return modelLabel(sessionModel);
|
|
231
|
+
|
|
232
|
+
// SECONDARY: ~/.claude.json lastModelUsage for this exact project path
|
|
233
|
+
// (longest-prefix match to avoid short paths like /Users matching first)
|
|
234
|
+
try {
|
|
235
|
+
const claudeConfig = readJSON(path.join(os.homedir(), '.claude.json'));
|
|
236
|
+
if (claudeConfig?.projects) {
|
|
237
|
+
let bestMatch = null;
|
|
238
|
+
let bestLen = -1;
|
|
239
|
+
for (const [projectPath, projectConfig] of Object.entries(claudeConfig.projects)) {
|
|
240
|
+
if (CWD === projectPath || CWD.startsWith(projectPath + '/')) {
|
|
241
|
+
if (projectPath.length > bestLen) {
|
|
242
|
+
bestLen = projectPath.length;
|
|
243
|
+
bestMatch = projectConfig;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (bestMatch?.lastModelUsage) {
|
|
248
|
+
const usage = bestMatch.lastModelUsage;
|
|
249
|
+
const ids = Object.keys(usage);
|
|
250
|
+
if (ids.length > 0) {
|
|
251
|
+
let bestId = ids[ids.length - 1];
|
|
252
|
+
let bestTokens = -1;
|
|
253
|
+
for (const id of ids) {
|
|
254
|
+
const e = usage[id] || {};
|
|
255
|
+
const tokens = (e.inputTokens || 0) + (e.outputTokens || 0);
|
|
256
|
+
if (tokens > bestTokens) { bestTokens = tokens; bestId = id; }
|
|
257
|
+
}
|
|
258
|
+
return modelLabel(bestId);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
} catch { /* ignore */ }
|
|
263
|
+
|
|
264
|
+
// TERTIARY: settings.json model field (configured default, not live session).
|
|
265
|
+
const settings = getSettings();
|
|
266
|
+
if (settings?.model) return modelLabel(settings.model);
|
|
267
|
+
|
|
268
|
+
// QUATERNARY: read ANTHROPIC_MODEL or CLAUDE_MODEL env var (set by the CLI at launch)
|
|
269
|
+
const envModel = process.env.ANTHROPIC_MODEL || process.env.CLAUDE_MODEL || process.env.MODEL;
|
|
270
|
+
if (envModel && envModel.startsWith('claude')) return modelLabel(envModel);
|
|
271
|
+
|
|
272
|
+
// QUINARY: current model from the model ID in the env injected by Claude Code itself
|
|
273
|
+
const claudeModel = process.env.CLAUDE_CODE_MODEL;
|
|
274
|
+
if (claudeModel) return modelLabel(claudeModel);
|
|
275
|
+
|
|
276
|
+
return 'Sonnet 4.6'; // known current default rather than the generic "Claude Code"
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Get learning stats from memory database (pure stat calls)
|
|
280
|
+
function getLearningStats() {
|
|
281
|
+
const memoryPaths = [
|
|
282
|
+
path.join(CWD, '.swarm', 'memory.db'),
|
|
283
|
+
path.join(CWD, '.monomind', 'memory.db'),
|
|
284
|
+
path.join(CWD, '.claude', 'memory.db'),
|
|
285
|
+
path.join(CWD, 'data', 'memory.db'),
|
|
286
|
+
path.join(CWD, '.lancedb', 'memory.db'),
|
|
287
|
+
];
|
|
288
|
+
|
|
289
|
+
for (const dbPath of memoryPaths) {
|
|
290
|
+
const stat = safeStat(dbPath);
|
|
291
|
+
if (stat) {
|
|
292
|
+
const sizeKB = stat.size / 1024;
|
|
293
|
+
const patterns = Math.floor(sizeKB / 2);
|
|
294
|
+
return {
|
|
295
|
+
patterns,
|
|
296
|
+
sessions: Math.max(1, Math.floor(patterns / 10)),
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Check session files count
|
|
302
|
+
let sessions = 0;
|
|
303
|
+
try {
|
|
304
|
+
const sessDir = path.join(CWD, '.claude', 'sessions');
|
|
305
|
+
if (fs.existsSync(sessDir)) {
|
|
306
|
+
sessions = fs.readdirSync(sessDir).filter(f => f.endsWith('.json')).length;
|
|
307
|
+
}
|
|
308
|
+
} catch { /* ignore */ }
|
|
309
|
+
|
|
310
|
+
return { patterns: 0, sessions };
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// progress from metrics files (pure file reads)
|
|
314
|
+
function getv1Progress() {
|
|
315
|
+
const learning = getLearningStats();
|
|
316
|
+
const totalDomains = 5;
|
|
317
|
+
|
|
318
|
+
const dddData = readJSON(path.join(CWD, '.monomind', 'metrics', 'ddd-progress.json'));
|
|
319
|
+
let dddProgress = dddData?.progress || 0;
|
|
320
|
+
let domainsCompleted = Math.min(5, Math.floor(dddProgress / 20));
|
|
321
|
+
|
|
322
|
+
if (dddProgress === 0 && learning.patterns > 0) {
|
|
323
|
+
if (learning.patterns >= 500) domainsCompleted = 5;
|
|
324
|
+
else if (learning.patterns >= 200) domainsCompleted = 4;
|
|
325
|
+
else if (learning.patterns >= 100) domainsCompleted = 3;
|
|
326
|
+
else if (learning.patterns >= 50) domainsCompleted = 2;
|
|
327
|
+
else if (learning.patterns >= 10) domainsCompleted = 1;
|
|
328
|
+
dddProgress = Math.floor((domainsCompleted / totalDomains) * 100);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
domainsCompleted, totalDomains, dddProgress,
|
|
333
|
+
patternsLearned: learning.patterns,
|
|
334
|
+
sessionsCompleted: learning.sessions,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Security status (pure file reads)
|
|
339
|
+
function getSecurityStatus() {
|
|
340
|
+
const auditData = readJSON(path.join(CWD, '.monomind', 'security', 'audit-status.json'));
|
|
341
|
+
if (auditData) {
|
|
342
|
+
const auditDate = auditData.lastAudit || auditData.lastScan;
|
|
343
|
+
if (!auditDate) {
|
|
344
|
+
// No audit has ever run — show as pending, not stale
|
|
345
|
+
return { status: 'PENDING', cvesFixed: 0, totalCves: 0 };
|
|
346
|
+
}
|
|
347
|
+
const auditAge = Date.now() - new Date(auditDate).getTime();
|
|
348
|
+
const isStale = auditAge > 7 * 24 * 60 * 60 * 1000;
|
|
349
|
+
return {
|
|
350
|
+
status: isStale ? 'STALE' : (auditData.status || 'PENDING'),
|
|
351
|
+
cvesFixed: auditData.cvesFixed || 0,
|
|
352
|
+
totalCves: auditData.totalCves || 0,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
let scanCount = 0;
|
|
357
|
+
try {
|
|
358
|
+
const scanDir = path.join(CWD, '.claude', 'security-scans');
|
|
359
|
+
if (fs.existsSync(scanDir)) {
|
|
360
|
+
scanCount = fs.readdirSync(scanDir).filter(f => f.endsWith('.json')).length;
|
|
361
|
+
}
|
|
362
|
+
} catch { /* ignore */ }
|
|
363
|
+
|
|
364
|
+
return {
|
|
365
|
+
status: scanCount > 0 ? 'SCANNED' : 'NONE',
|
|
366
|
+
cvesFixed: 0,
|
|
367
|
+
totalCves: 0,
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Swarm status (pure file reads, NO ps aux)
|
|
372
|
+
function getSwarmStatus() {
|
|
373
|
+
const staleThresholdMs = 5 * 60 * 1000;
|
|
374
|
+
const agentRegTtlMs = 30 * 60 * 1000; // registration files expire after 30 min
|
|
375
|
+
const now = Date.now();
|
|
376
|
+
|
|
377
|
+
// PRIMARY: count live registration files written by SubagentStart hook
|
|
378
|
+
// Each file = one active sub-agent. Stale files (>30 min) are ignored.
|
|
379
|
+
const regDir = path.join(CWD, '.monomind', 'agents', 'registrations');
|
|
380
|
+
if (fs.existsSync(regDir)) {
|
|
381
|
+
try {
|
|
382
|
+
const files = fs.readdirSync(regDir).filter(f => f.endsWith('.json'));
|
|
383
|
+
const liveCount = files.filter(f => {
|
|
384
|
+
try {
|
|
385
|
+
return (now - fs.statSync(path.join(regDir, f)).mtimeMs) < agentRegTtlMs;
|
|
386
|
+
} catch { return false; }
|
|
387
|
+
}).length;
|
|
388
|
+
if (liveCount > 0) {
|
|
389
|
+
return {
|
|
390
|
+
activeAgents: liveCount,
|
|
391
|
+
maxAgents: CONFIG.maxAgents,
|
|
392
|
+
coordinationActive: true,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
} catch { /* fall through */ }
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// SECONDARY: swarm-state.json written by MCP swarm_init — trust if fresh
|
|
399
|
+
const swarmStatePath = path.join(CWD, '.monomind', 'swarm', 'swarm-state.json');
|
|
400
|
+
const swarmState = readJSON(swarmStatePath);
|
|
401
|
+
if (swarmState) {
|
|
402
|
+
const updatedAt = swarmState.updatedAt || swarmState.startedAt;
|
|
403
|
+
const age = updatedAt ? now - new Date(updatedAt).getTime() : Infinity;
|
|
404
|
+
if (age < staleThresholdMs) {
|
|
405
|
+
return {
|
|
406
|
+
activeAgents: swarmState.agents?.length || swarmState.agentCount || 0,
|
|
407
|
+
maxAgents: swarmState.maxAgents || CONFIG.maxAgents,
|
|
408
|
+
coordinationActive: true,
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// TERTIARY: swarm-activity.json refreshed by post-task hook
|
|
414
|
+
const activityData = readJSON(path.join(CWD, '.monomind', 'metrics', 'swarm-activity.json'));
|
|
415
|
+
if (activityData?.swarm) {
|
|
416
|
+
const updatedAt = activityData.timestamp || activityData.swarm.timestamp;
|
|
417
|
+
const age = updatedAt ? now - new Date(updatedAt).getTime() : Infinity;
|
|
418
|
+
if (age < staleThresholdMs) {
|
|
419
|
+
return {
|
|
420
|
+
activeAgents: activityData.swarm.agent_count || 0,
|
|
421
|
+
maxAgents: CONFIG.maxAgents,
|
|
422
|
+
coordinationActive: activityData.swarm.coordination_active || activityData.swarm.active || false,
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return { activeAgents: 0, maxAgents: CONFIG.maxAgents, coordinationActive: false };
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// System metrics (uses process.memoryUsage() — no shell spawn)
|
|
431
|
+
function getSystemMetrics() {
|
|
432
|
+
const memoryMB = Math.floor(process.memoryUsage().heapUsed / 1024 / 1024);
|
|
433
|
+
const learning = getLearningStats();
|
|
434
|
+
const lancedb = getLanceDBStats();
|
|
435
|
+
|
|
436
|
+
// Intelligence from learning.json
|
|
437
|
+
const learningData = readJSON(path.join(CWD, '.monomind', 'metrics', 'learning.json'));
|
|
438
|
+
let intelligencePct = 0;
|
|
439
|
+
let contextPct = 0;
|
|
440
|
+
|
|
441
|
+
if (learningData?.intelligence?.score !== undefined) {
|
|
442
|
+
intelligencePct = Math.min(100, Math.floor(learningData.intelligence.score));
|
|
443
|
+
} else {
|
|
444
|
+
// Use actual vector/entry counts — 2000 entries = 100%
|
|
445
|
+
const fromPatterns = learning.patterns > 0 ? Math.min(100, Math.floor(learning.patterns / 20)) : 0;
|
|
446
|
+
const fromVectors = lancedb.vectorCount > 0 ? Math.min(100, Math.floor(lancedb.vectorCount / 20)) : 0;
|
|
447
|
+
intelligencePct = Math.max(fromPatterns, fromVectors);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Maturity fallback (pure fs checks, no git exec)
|
|
451
|
+
if (intelligencePct === 0) {
|
|
452
|
+
let score = 0;
|
|
453
|
+
if (fs.existsSync(path.join(CWD, '.claude'))) score += 15;
|
|
454
|
+
const srcDirs = ['src', 'lib', 'app', 'packages', 'v1'];
|
|
455
|
+
for (const d of srcDirs) { if (fs.existsSync(path.join(CWD, d))) { score += 15; break; } }
|
|
456
|
+
const testDirs = ['tests', 'test', '__tests__', 'spec'];
|
|
457
|
+
for (const d of testDirs) { if (fs.existsSync(path.join(CWD, d))) { score += 10; break; } }
|
|
458
|
+
const cfgFiles = ['package.json', 'tsconfig.json', 'pyproject.toml', 'Cargo.toml', 'go.mod'];
|
|
459
|
+
for (const f of cfgFiles) { if (fs.existsSync(path.join(CWD, f))) { score += 5; break; } }
|
|
460
|
+
intelligencePct = Math.min(100, score);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (learningData?.sessions?.total !== undefined) {
|
|
464
|
+
contextPct = Math.min(100, learningData.sessions.total * 5);
|
|
465
|
+
} else {
|
|
466
|
+
contextPct = Math.min(100, Math.floor(learning.sessions * 5));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// Sub-agents from file metrics (no ps aux)
|
|
470
|
+
let subAgents = 0;
|
|
471
|
+
const activityData = readJSON(path.join(CWD, '.monomind', 'metrics', 'swarm-activity.json'));
|
|
472
|
+
if (activityData?.processes?.estimated_agents) {
|
|
473
|
+
subAgents = activityData.processes.estimated_agents;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return { memoryMB, contextPct, intelligencePct, subAgents };
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// ADR status (count files only — don't read contents)
|
|
480
|
+
function getADRStatus() {
|
|
481
|
+
// Count actual ADR files first — compliance JSON may be stale
|
|
482
|
+
const adrPaths = [
|
|
483
|
+
path.join(CWD, 'packages', 'implementation', 'adrs'),
|
|
484
|
+
path.join(CWD, 'docs', 'adrs'),
|
|
485
|
+
path.join(CWD, '.monomind', 'adrs'),
|
|
486
|
+
];
|
|
487
|
+
|
|
488
|
+
for (const adrPath of adrPaths) {
|
|
489
|
+
try {
|
|
490
|
+
if (fs.existsSync(adrPath)) {
|
|
491
|
+
const files = fs.readdirSync(adrPath).filter(f =>
|
|
492
|
+
f.endsWith('.md') && (f.startsWith('ADR-') || f.startsWith('adr-') || /^\d{4}-/.test(f))
|
|
493
|
+
);
|
|
494
|
+
// Report actual count — don't guess compliance without reading files
|
|
495
|
+
return { count: files.length, implemented: files.length, compliance: 0 };
|
|
496
|
+
}
|
|
497
|
+
} catch { /* ignore */ }
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return { count: 0, implemented: 0, compliance: 0 };
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// Hooks status (shared settings cache)
|
|
504
|
+
function getHooksStatus() {
|
|
505
|
+
let enabled = 0;
|
|
506
|
+
let total = 0;
|
|
507
|
+
const settings = getSettings();
|
|
508
|
+
|
|
509
|
+
if (settings?.hooks) {
|
|
510
|
+
for (const category of Object.keys(settings.hooks)) {
|
|
511
|
+
const matchers = settings.hooks[category];
|
|
512
|
+
if (!Array.isArray(matchers)) continue;
|
|
513
|
+
for (const matcher of matchers) {
|
|
514
|
+
const hooks = matcher?.hooks;
|
|
515
|
+
if (Array.isArray(hooks)) {
|
|
516
|
+
total += hooks.length;
|
|
517
|
+
enabled += hooks.length;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
try {
|
|
524
|
+
const hooksDir = path.join(CWD, '.claude', 'hooks');
|
|
525
|
+
if (fs.existsSync(hooksDir)) {
|
|
526
|
+
const hookFiles = fs.readdirSync(hooksDir).filter(f => f.endsWith('.js') || f.endsWith('.sh')).length;
|
|
527
|
+
total = Math.max(total, hookFiles);
|
|
528
|
+
enabled = Math.max(enabled, hookFiles);
|
|
529
|
+
}
|
|
530
|
+
} catch { /* ignore */ }
|
|
531
|
+
|
|
532
|
+
return { enabled, total };
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// Active agent — reads last routing result persisted by hook-handler
|
|
536
|
+
function getActiveAgent() {
|
|
537
|
+
const routeFile = path.join(CWD, '.monomind', 'last-route.json');
|
|
538
|
+
try {
|
|
539
|
+
if (!fs.existsSync(routeFile)) return null;
|
|
540
|
+
const data = JSON.parse(fs.readFileSync(routeFile, 'utf-8'));
|
|
541
|
+
if (!data || !data.agent) return null;
|
|
542
|
+
|
|
543
|
+
// Stale after 30 minutes (session likely changed)
|
|
544
|
+
const age = Date.now() - new Date(data.updatedAt || 0).getTime();
|
|
545
|
+
if (age > 30 * 60 * 1000) return null;
|
|
546
|
+
|
|
547
|
+
// Prefer display name if set (from load-agent), else format the slug
|
|
548
|
+
const displayName = data.name || data.agent
|
|
549
|
+
.replace(/-/g, ' ')
|
|
550
|
+
.replace(/\b\w/g, c => c.toUpperCase());
|
|
551
|
+
|
|
552
|
+
return {
|
|
553
|
+
slug: data.agent,
|
|
554
|
+
name: displayName,
|
|
555
|
+
category: data.category || null,
|
|
556
|
+
confidence: data.confidence || 0,
|
|
557
|
+
activated: data.activated || false, // true = manually loaded extras agent
|
|
558
|
+
};
|
|
559
|
+
} catch { return null; }
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// LanceDB stats — count real entries, not file-size heuristics
|
|
563
|
+
function getLanceDBStats() {
|
|
564
|
+
let vectorCount = 0;
|
|
565
|
+
let dbSizeKB = 0;
|
|
566
|
+
let namespaces = 0;
|
|
567
|
+
let hasHnsw = false;
|
|
568
|
+
|
|
569
|
+
// 1. Count real entries from auto-memory-store.json
|
|
570
|
+
const storePath = path.join(CWD, '.monomind', 'data', 'auto-memory-store.json');
|
|
571
|
+
const storeStat = safeStat(storePath);
|
|
572
|
+
if (storeStat) {
|
|
573
|
+
dbSizeKB += storeStat.size / 1024;
|
|
574
|
+
try {
|
|
575
|
+
const store = JSON.parse(fs.readFileSync(storePath, 'utf-8'));
|
|
576
|
+
if (Array.isArray(store)) vectorCount += store.length;
|
|
577
|
+
else if (store?.entries) vectorCount += store.entries.length;
|
|
578
|
+
} catch { /* fall back to size estimate */ }
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// 2. Count entries from ranked-context.json
|
|
582
|
+
const rankedPath = path.join(CWD, '.monomind', 'data', 'ranked-context.json');
|
|
583
|
+
try {
|
|
584
|
+
const ranked = readJSON(rankedPath);
|
|
585
|
+
if (ranked?.entries?.length > vectorCount) vectorCount = ranked.entries.length;
|
|
586
|
+
} catch { /* ignore */ }
|
|
587
|
+
|
|
588
|
+
// 3. Add DB file sizes
|
|
589
|
+
const dbFiles = [
|
|
590
|
+
path.join(CWD, 'data', 'memory.db'),
|
|
591
|
+
path.join(CWD, '.monomind', 'memory.db'),
|
|
592
|
+
path.join(CWD, '.swarm', 'memory.db'),
|
|
593
|
+
];
|
|
594
|
+
for (const f of dbFiles) {
|
|
595
|
+
const stat = safeStat(f);
|
|
596
|
+
if (stat) {
|
|
597
|
+
dbSizeKB += stat.size / 1024;
|
|
598
|
+
namespaces++;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// 4. Check for graph data
|
|
603
|
+
const graphPath = path.join(CWD, 'data', 'memory.graph');
|
|
604
|
+
const graphStat = safeStat(graphPath);
|
|
605
|
+
if (graphStat) dbSizeKB += graphStat.size / 1024;
|
|
606
|
+
|
|
607
|
+
// 5. HNSW index
|
|
608
|
+
const hnswPaths = [
|
|
609
|
+
path.join(CWD, '.swarm', 'hnsw.index'),
|
|
610
|
+
path.join(CWD, '.monomind', 'hnsw.index'),
|
|
611
|
+
];
|
|
612
|
+
for (const p of hnswPaths) {
|
|
613
|
+
const stat = safeStat(p);
|
|
614
|
+
if (stat) {
|
|
615
|
+
hasHnsw = true;
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// HNSW is available if memory package is present
|
|
621
|
+
if (!hasHnsw) {
|
|
622
|
+
const memPkgPaths = [
|
|
623
|
+
path.join(CWD, 'packages', '@monomind', 'memory', 'dist'),
|
|
624
|
+
path.join(CWD, 'node_modules', '@monomind', 'memory'),
|
|
625
|
+
];
|
|
626
|
+
for (const p of memPkgPaths) {
|
|
627
|
+
if (fs.existsSync(p)) { hasHnsw = true; break; }
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
return { vectorCount, dbSizeKB: Math.floor(dbSizeKB), namespaces, hasHnsw };
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// Test stats (count files only — NO reading file contents)
|
|
635
|
+
function getTestStats() {
|
|
636
|
+
let testFiles = 0;
|
|
637
|
+
|
|
638
|
+
function countTestFiles(dir, depth = 0) {
|
|
639
|
+
if (depth > 6) return;
|
|
640
|
+
try {
|
|
641
|
+
if (!fs.existsSync(dir)) return;
|
|
642
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
643
|
+
for (const entry of entries) {
|
|
644
|
+
if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
|
|
645
|
+
countTestFiles(path.join(dir, entry.name), depth + 1);
|
|
646
|
+
} else if (entry.isFile()) {
|
|
647
|
+
const n = entry.name;
|
|
648
|
+
if (n.includes('.test.') || n.includes('.spec.') || n.includes('_test.') || n.includes('_spec.')) {
|
|
649
|
+
testFiles++;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
} catch { /* ignore */ }
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// Scan all source directories
|
|
657
|
+
for (const d of ['tests', 'test', '__tests__', 'src', 'v1']) {
|
|
658
|
+
countTestFiles(path.join(CWD, d));
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// Estimate ~4 test cases per file (avoids reading every file)
|
|
662
|
+
return { testFiles, testCases: testFiles * 4 };
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// Integration status (shared settings + file checks)
|
|
666
|
+
function getIntegrationStatus() {
|
|
667
|
+
const mcpServers = { total: 0, enabled: 0 };
|
|
668
|
+
const settings = getSettings();
|
|
669
|
+
|
|
670
|
+
if (settings?.mcpServers && typeof settings.mcpServers === 'object') {
|
|
671
|
+
const servers = Object.keys(settings.mcpServers);
|
|
672
|
+
mcpServers.total = servers.length;
|
|
673
|
+
mcpServers.enabled = settings.enabledMcpjsonServers
|
|
674
|
+
? settings.enabledMcpjsonServers.filter(s => servers.includes(s)).length
|
|
675
|
+
: servers.length;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// Fallback: .mcp.json
|
|
679
|
+
if (mcpServers.total === 0) {
|
|
680
|
+
const mcpConfig = readJSON(path.join(CWD, '.mcp.json'))
|
|
681
|
+
|| readJSON(path.join(os.homedir(), '.claude', 'mcp.json'));
|
|
682
|
+
if (mcpConfig?.mcpServers) {
|
|
683
|
+
const s = Object.keys(mcpConfig.mcpServers);
|
|
684
|
+
mcpServers.total = s.length;
|
|
685
|
+
mcpServers.enabled = s.length;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const hasDatabase = ['.swarm/memory.db', '.monomind/memory.db', 'data/memory.db']
|
|
690
|
+
.some(p => fs.existsSync(path.join(CWD, p)));
|
|
691
|
+
const hasApi = !!(process.env.ANTHROPIC_API_KEY || process.env.OPENAI_API_KEY);
|
|
692
|
+
|
|
693
|
+
return { mcpServers, hasDatabase, hasApi };
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
// Session stats (pure file reads)
|
|
697
|
+
function getSessionStats() {
|
|
698
|
+
for (const p of ['.monomind/session.json', '.claude/session.json']) {
|
|
699
|
+
const data = readJSON(path.join(CWD, p));
|
|
700
|
+
if (data?.startTime) {
|
|
701
|
+
const diffMs = Date.now() - new Date(data.startTime).getTime();
|
|
702
|
+
const mins = Math.floor(diffMs / 60000);
|
|
703
|
+
const duration = mins < 60 ? `${mins}m` : `${Math.floor(mins / 60)}h${mins % 60}m`;
|
|
704
|
+
return { duration };
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
return { duration: '' };
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// ─── Extended 256-color palette ─────────────────────────────────
|
|
711
|
+
const x = {
|
|
712
|
+
// Backgrounds (used sparingly for labels)
|
|
713
|
+
bgPurple: '\x1b[48;5;55m',
|
|
714
|
+
bgTeal: '\x1b[48;5;23m',
|
|
715
|
+
bgReset: '\x1b[49m',
|
|
716
|
+
// Foregrounds
|
|
717
|
+
purple: '\x1b[38;5;141m', // soft lavender-purple (brand)
|
|
718
|
+
violet: '\x1b[38;5;99m', // deeper purple
|
|
719
|
+
teal: '\x1b[38;5;51m', // bright teal
|
|
720
|
+
mint: '\x1b[38;5;120m', // soft green
|
|
721
|
+
gold: '\x1b[38;5;220m', // warm gold
|
|
722
|
+
orange: '\x1b[38;5;208m', // alert orange
|
|
723
|
+
coral: '\x1b[38;5;203m', // error red-pink
|
|
724
|
+
sky: '\x1b[38;5;117m', // soft blue
|
|
725
|
+
rose: '\x1b[38;5;218m', // warm pink
|
|
726
|
+
slate: '\x1b[38;5;245m', // neutral grey
|
|
727
|
+
white: '\x1b[38;5;255m', // bright white
|
|
728
|
+
green: '\x1b[38;5;82m', // vivid green
|
|
729
|
+
red: '\x1b[38;5;196m', // vivid red
|
|
730
|
+
yellow: '\x1b[38;5;226m', // vivid yellow
|
|
731
|
+
// Shared
|
|
732
|
+
bold: '\x1b[1m',
|
|
733
|
+
dim: '\x1b[2m',
|
|
734
|
+
reset: '\x1b[0m',
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
// ── Helpers ──────────────────────────────────────────────────────
|
|
738
|
+
|
|
739
|
+
// Block progress bar: ▰▰▰▱▱ (5 blocks)
|
|
740
|
+
function blockBar(current, total, width = 5) {
|
|
741
|
+
const filled = Math.min(width, Math.round((current / Math.max(total, 1)) * width));
|
|
742
|
+
return '\u25B0'.repeat(filled) + `${x.slate}\u25B1${x.reset}`.repeat(width - filled);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// Health dot: ● colored by status
|
|
746
|
+
function dot(ok) {
|
|
747
|
+
if (ok === 'good') return `${x.green}●${x.reset}`;
|
|
748
|
+
if (ok === 'warn') return `${x.gold}●${x.reset}`;
|
|
749
|
+
if (ok === 'error') return `${x.coral}●${x.reset}`;
|
|
750
|
+
return `${x.slate}●${x.reset}`; // 'none'
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// Pill badge: [ LABEL ] with background
|
|
754
|
+
function badge(label, color) {
|
|
755
|
+
return `${color}[${label}]${x.reset}`;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
// Divider character
|
|
759
|
+
const DIV = `${x.slate}│${x.reset}`;
|
|
760
|
+
const SEP = `${x.slate}──────────────────────────────────────────────────────${x.reset}`;
|
|
761
|
+
|
|
762
|
+
// Pct → color
|
|
763
|
+
function pctColor(pct) {
|
|
764
|
+
if (pct >= 75) return x.green;
|
|
765
|
+
if (pct >= 40) return x.gold;
|
|
766
|
+
if (pct > 0) return x.orange;
|
|
767
|
+
return x.slate;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// Security status → label + color
|
|
771
|
+
function secBadge(status) {
|
|
772
|
+
if (status === 'CLEAN') return { label: '✔ CLEAN', col: x.green };
|
|
773
|
+
if (status === 'STALE') return { label: '⟳ STALE', col: x.gold };
|
|
774
|
+
if (status === 'IN_PROGRESS') return { label: '⟳ RUNNING', col: x.sky };
|
|
775
|
+
if (status === 'SCANNED') return { label: '✔ SCANNED', col: x.mint };
|
|
776
|
+
if (status === 'PENDING') return { label: '⏸ PENDING', col: x.gold };
|
|
777
|
+
return { label: '✖ NONE', col: x.slate };
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// ── Knowledge & trigger stats (Tasks 28 + 32) ────────────────────
|
|
781
|
+
function getKnowledgeStats() {
|
|
782
|
+
const chunksPath = path.join(CWD, '.monomind', 'knowledge', 'chunks.jsonl');
|
|
783
|
+
const skillsPath = path.join(CWD, '.monomind', 'skills.jsonl');
|
|
784
|
+
let chunks = 0, skills = 0;
|
|
785
|
+
try {
|
|
786
|
+
if (fs.existsSync(chunksPath)) {
|
|
787
|
+
chunks = fs.readFileSync(chunksPath, 'utf-8').split('\n').filter(Boolean).length;
|
|
788
|
+
}
|
|
789
|
+
} catch { /* ignore */ }
|
|
790
|
+
try {
|
|
791
|
+
if (fs.existsSync(skillsPath)) {
|
|
792
|
+
skills = fs.readFileSync(skillsPath, 'utf-8').split('\n').filter(Boolean).length;
|
|
793
|
+
}
|
|
794
|
+
} catch { /* ignore */ }
|
|
795
|
+
return { chunks, skills };
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function getTriggerStats() {
|
|
799
|
+
const indexPath = path.join(CWD, '.monomind', 'trigger-index.json');
|
|
800
|
+
try {
|
|
801
|
+
if (!fs.existsSync(indexPath)) return { triggers: 0, agents: 0 };
|
|
802
|
+
const raw = JSON.parse(fs.readFileSync(indexPath, 'utf-8'));
|
|
803
|
+
const idx = raw.index || raw;
|
|
804
|
+
const triggers = Object.keys(idx).length;
|
|
805
|
+
const agents = Object.values(idx).flat().length;
|
|
806
|
+
return { triggers, agents };
|
|
807
|
+
} catch { return { triggers: 0, agents: 0 }; }
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
// Hook latency — surface slow per-prompt hooks in the statusline.
|
|
811
|
+
function getHookLatency() {
|
|
812
|
+
const p = path.join(CWD, '.monomind', 'metrics', 'hook-latency.json');
|
|
813
|
+
try {
|
|
814
|
+
if (!fs.existsSync(p)) return null;
|
|
815
|
+
const d = JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
816
|
+
const perPrompt = ['route'];
|
|
817
|
+
let totalMs = 0; let count = 0;
|
|
818
|
+
for (const h of perPrompt) {
|
|
819
|
+
if (d[h] && d[h].mean) { totalMs += d[h].mean; count++; }
|
|
820
|
+
}
|
|
821
|
+
if (count === 0) return null;
|
|
822
|
+
let slowest = null;
|
|
823
|
+
for (const k of Object.keys(d)) {
|
|
824
|
+
if (k === 'lastUpdated' || !d[k] || typeof d[k] !== 'object') continue;
|
|
825
|
+
if (!slowest || d[k].mean > slowest.mean) slowest = { name: k, mean: d[k].mean };
|
|
826
|
+
}
|
|
827
|
+
return { perPromptMs: totalMs, slowest: slowest };
|
|
828
|
+
} catch { return null; }
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
// Graph usage telemetry — counts ALL graph wins (MCP calls + silent assists)
|
|
832
|
+
// vs greps that got no graph help.
|
|
833
|
+
function getGraphUsage() {
|
|
834
|
+
const usagePath = path.join(CWD, '.monomind', 'metrics', 'graph-usage.json');
|
|
835
|
+
try {
|
|
836
|
+
if (!fs.existsSync(usagePath)) return null;
|
|
837
|
+
const d = JSON.parse(fs.readFileSync(usagePath, 'utf-8'));
|
|
838
|
+
const graphWins = (d.monograph_call || 0) + (d.preresolve_hit || 0)
|
|
839
|
+
+ (d.graph_assist_search || 0) + (d.graph_assist_neighbors || 0);
|
|
840
|
+
const searches = (d.grep_call || 0) + (d.glob_call || 0)
|
|
841
|
+
+ (d.bash_grep_call || 0) + (d.bash_find_call || 0);
|
|
842
|
+
const total = graphWins + searches + (d.preresolve_miss || 0);
|
|
843
|
+
if (total === 0) return null;
|
|
844
|
+
return { graphWins: graphWins, searches: searches, pct: Math.round((graphWins / total) * 100), dollarsSaved: d.dollars_saved || 0 };
|
|
845
|
+
} catch { return null; }
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// Graph freshness — compare last build time vs commits since
|
|
849
|
+
function getGraphFreshness() {
|
|
850
|
+
const lockPath = path.join(CWD, '.monomind', 'graph', '.rebuild-lock');
|
|
851
|
+
const dbPath = path.join(CWD, '.monomind', 'monograph.db');
|
|
852
|
+
let buildMs = 0;
|
|
853
|
+
try {
|
|
854
|
+
const lockStat = safeStat(lockPath);
|
|
855
|
+
const dbStat = safeStat(dbPath);
|
|
856
|
+
buildMs = Math.max(lockStat?.mtimeMs || 0, dbStat?.mtimeMs || 0);
|
|
857
|
+
} catch { /* ignore */ }
|
|
858
|
+
if (!buildMs) return { commitsBehind: -1, stale: true, fresh: false };
|
|
859
|
+
const buildIso = new Date(buildMs).toISOString();
|
|
860
|
+
const out = safeExec(`git rev-list --count --since='${buildIso}' HEAD 2>/dev/null`, 1500);
|
|
861
|
+
const commitsBehind = parseInt(out, 10) || 0;
|
|
862
|
+
return { commitsBehind, stale: commitsBehind > 5, fresh: commitsBehind === 0 };
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// Active loops — scan .monomind/loops/*.json, skip stale (>6h)
|
|
866
|
+
function getLoopStatus() {
|
|
867
|
+
const loopsDir = path.join(CWD, '.monomind', 'loops');
|
|
868
|
+
if (!fs.existsSync(loopsDir)) return { count: 0, loops: [] };
|
|
869
|
+
const STALE_MS = 6 * 60 * 60 * 1000;
|
|
870
|
+
const now = Date.now();
|
|
871
|
+
const loops = [];
|
|
872
|
+
try {
|
|
873
|
+
const files = fs.readdirSync(loopsDir).filter(f =>
|
|
874
|
+
f.endsWith('.json') && !f.includes('-hil') && !f.endsWith('.stop'));
|
|
875
|
+
for (const f of files) {
|
|
876
|
+
const d = readJSON(path.join(loopsDir, f));
|
|
877
|
+
if (!d || !d.command) continue;
|
|
878
|
+
const last = d.lastRunAt || d.nextRunAt || d.startedAt || 0;
|
|
879
|
+
if (last && (now - last) > STALE_MS) continue;
|
|
880
|
+
loops.push({
|
|
881
|
+
cmd: String(d.command).replace(/^\//,''),
|
|
882
|
+
type: d.type || 'repeat',
|
|
883
|
+
rep: d.currentRep || 0,
|
|
884
|
+
max: d.maxReps || 0,
|
|
885
|
+
status: d.status || 'running',
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
} catch { /* ignore */ }
|
|
889
|
+
return { count: loops.length, loops };
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// HIL pending — count <id>-hil.md files with no human response yet
|
|
893
|
+
function getHILPending() {
|
|
894
|
+
const loopsDir = path.join(CWD, '.monomind', 'loops');
|
|
895
|
+
if (!fs.existsSync(loopsDir)) return { pending: 0 };
|
|
896
|
+
let pending = 0;
|
|
897
|
+
try {
|
|
898
|
+
const files = fs.readdirSync(loopsDir).filter(f => f.endsWith('-hil.md'));
|
|
899
|
+
for (const f of files) {
|
|
900
|
+
try {
|
|
901
|
+
const txt = fs.readFileSync(path.join(loopsDir, f), 'utf-8');
|
|
902
|
+
const answered = /^[ \t]*>[ \t]+\S/m.test(txt);
|
|
903
|
+
if (!answered) pending++;
|
|
904
|
+
} catch { /* ignore */ }
|
|
905
|
+
}
|
|
906
|
+
} catch { /* ignore */ }
|
|
907
|
+
return { pending };
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// Active org runs — scan .monomind/orgs/*/runs/*.jsonl for recent activity
|
|
911
|
+
// Also checks .git/monomind/orgs/ (git-safe path used by mastermind orgs).
|
|
912
|
+
// An org is "active" if it has an events file modified within the last 10 minutes.
|
|
913
|
+
function getActiveOrgs() {
|
|
914
|
+
// Try git-common-dir path first (mastermind orgs store run files there)
|
|
915
|
+
let orgsDir = path.join(CWD, '.monomind', 'orgs');
|
|
916
|
+
try {
|
|
917
|
+
const gitCommon = safeExec('git rev-parse --git-common-dir 2>/dev/null', 1000);
|
|
918
|
+
if (gitCommon) {
|
|
919
|
+
const candidate = path.isAbsolute(gitCommon)
|
|
920
|
+
? path.join(gitCommon, 'monomind', 'orgs')
|
|
921
|
+
: path.join(CWD, gitCommon, 'monomind', 'orgs');
|
|
922
|
+
if (fs.existsSync(candidate)) orgsDir = candidate;
|
|
923
|
+
}
|
|
924
|
+
} catch { /* use default */ }
|
|
925
|
+
if (!fs.existsSync(orgsDir)) return { count: 0, orgs: [] };
|
|
926
|
+
const STALE_MS = 10 * 60 * 1000; // 10 min
|
|
927
|
+
const now = Date.now();
|
|
928
|
+
const active = [];
|
|
929
|
+
try {
|
|
930
|
+
const orgNames = fs.readdirSync(orgsDir).filter(f => !f.startsWith('.'));
|
|
931
|
+
for (const orgName of orgNames.slice(0, 20)) {
|
|
932
|
+
const runsDir = path.join(orgsDir, orgName, 'runs');
|
|
933
|
+
if (!fs.existsSync(runsDir)) continue;
|
|
934
|
+
try {
|
|
935
|
+
const files = fs.readdirSync(runsDir).filter(f => f.endsWith('.jsonl'));
|
|
936
|
+
if (!files.length) continue;
|
|
937
|
+
files.sort();
|
|
938
|
+
const latest = files[files.length - 1];
|
|
939
|
+
const stat = safeStat(path.join(runsDir, latest));
|
|
940
|
+
if (!stat) continue;
|
|
941
|
+
const age = now - stat.mtimeMs;
|
|
942
|
+
if (age < STALE_MS) {
|
|
943
|
+
// Check last event type to determine if still running
|
|
944
|
+
let isRunning = true;
|
|
945
|
+
try {
|
|
946
|
+
const MAX_RUN = 512 * 1024; // 512 KiB
|
|
947
|
+
if (stat.size <= MAX_RUN) {
|
|
948
|
+
const raw = fs.readFileSync(path.join(runsDir, latest), 'utf-8');
|
|
949
|
+
const lines = raw.trim().split('\n').filter(Boolean);
|
|
950
|
+
if (lines.length) {
|
|
951
|
+
const lastEv = JSON.parse(lines[lines.length - 1]);
|
|
952
|
+
if (lastEv.type === 'run:complete' || lastEv.type === 'org:complete') isRunning = false;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
} catch { /* treat as running */ }
|
|
956
|
+
active.push({ name: orgName, runId: latest.replace('.jsonl', ''), ageMs: age, running: isRunning });
|
|
957
|
+
}
|
|
958
|
+
} catch { /* skip */ }
|
|
959
|
+
}
|
|
960
|
+
} catch { /* ignore */ }
|
|
961
|
+
return { count: active.length, orgs: active };
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
// Monograph knowledge graph stats
|
|
965
|
+
// Sources, in priority order:
|
|
966
|
+
// 1. .monomind/graph/stats.json — explicit cached stats
|
|
967
|
+
// 2. .monomind/monograph.db — live SQLite (read counts via sqlite3)
|
|
968
|
+
// 3. .monomind/graph/graph.json — legacy JSON dump
|
|
969
|
+
function getGraphifyStats() {
|
|
970
|
+
const statsPath = path.join(CWD, '.monomind', 'graph', 'stats.json');
|
|
971
|
+
const dbPath = path.join(CWD, '.monomind', 'monograph.db');
|
|
972
|
+
const graphPath = path.join(CWD, '.monomind', 'graph', 'graph.json');
|
|
973
|
+
|
|
974
|
+
try {
|
|
975
|
+
const s = readJSON(statsPath);
|
|
976
|
+
if (s && s.nodes !== undefined) return { nodes: s.nodes, edges: s.edges || 0, exists: true };
|
|
977
|
+
} catch { /* ignore */ }
|
|
978
|
+
|
|
979
|
+
try {
|
|
980
|
+
if (fs.existsSync(dbPath)) {
|
|
981
|
+
// Use spawnSync array args to prevent shell injection via dbPath (CWD-derived)
|
|
982
|
+
const result = spawnSync(
|
|
983
|
+
'sqlite3',
|
|
984
|
+
[dbPath, 'SELECT (SELECT COUNT(*) FROM nodes), (SELECT COUNT(*) FROM edges);'],
|
|
985
|
+
{ encoding: 'utf-8', timeout: 1000 }
|
|
986
|
+
);
|
|
987
|
+
const out = (result.stdout || '').trim();
|
|
988
|
+
if (out) {
|
|
989
|
+
const [n, e] = out.split('|').map(v => parseInt(v, 10) || 0);
|
|
990
|
+
if (n > 0) return { nodes: n, edges: e, exists: true };
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
} catch { /* ignore */ }
|
|
994
|
+
|
|
995
|
+
try {
|
|
996
|
+
const stat = safeStat(graphPath);
|
|
997
|
+
if (stat && stat.size < 10 * 1024 * 1024) {
|
|
998
|
+
const g = JSON.parse(fs.readFileSync(graphPath, 'utf-8'));
|
|
999
|
+
const nodes = Array.isArray(g.nodes) ? g.nodes.length : 0;
|
|
1000
|
+
const edges = (Array.isArray(g.edges) ? g.edges : (Array.isArray(g.links) ? g.links : [])).length;
|
|
1001
|
+
return { nodes, edges, exists: true };
|
|
1002
|
+
}
|
|
1003
|
+
} catch { /* ignore */ }
|
|
1004
|
+
return { nodes: 0, edges: 0, exists: false };
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
function getSIBudget() {
|
|
1008
|
+
const SI_LIMIT = 1500;
|
|
1009
|
+
const siPath = path.join(CWD, '.agents', 'shared_instructions.md');
|
|
1010
|
+
try {
|
|
1011
|
+
if (!fs.existsSync(siPath)) return null;
|
|
1012
|
+
const len = fs.readFileSync(siPath, 'utf-8').length;
|
|
1013
|
+
return { len, pct: Math.round((len / SI_LIMIT) * 100), limit: SI_LIMIT };
|
|
1014
|
+
} catch { return null; }
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// Token cost summary — reads cached .monomind/metrics/token-summary.json (no JSONL scanning).
|
|
1018
|
+
// Returns null if file absent, stale (cachedAt is not today in UTC), or cost is zero.
|
|
1019
|
+
// All costs are aggregated across ALL Claude Code projects, not just this repo.
|
|
1020
|
+
function getTokenCostSummary() {
|
|
1021
|
+
const summaryPath = path.join(CWD, '.monomind', 'metrics', 'token-summary.json');
|
|
1022
|
+
const d = readJSON(summaryPath);
|
|
1023
|
+
if (!d) return null;
|
|
1024
|
+
|
|
1025
|
+
// Staleness guard: only show "today" figures when cachedAt is today (UTC)
|
|
1026
|
+
const todayUtc = new Date().toISOString().slice(0, 10); // "YYYY-MM-DD"
|
|
1027
|
+
const cachedDate = (d.cachedAt || '').slice(0, 10);
|
|
1028
|
+
const isFresh = cachedDate === todayUtc;
|
|
1029
|
+
|
|
1030
|
+
const todayCost = isFresh ? (d.todayCost || 0) : 0;
|
|
1031
|
+
const monthCost = d.monthCost || 0;
|
|
1032
|
+
const todayCalls = isFresh ? (d.todayCalls || 0) : 0;
|
|
1033
|
+
|
|
1034
|
+
if (monthCost === 0 && todayCost === 0) return null;
|
|
1035
|
+
|
|
1036
|
+
return { todayCost, monthCost, todayCalls, isFresh };
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
// Format a dollar amount compactly: $0.0023, $1.23, $228.87
|
|
1040
|
+
function fmtCost(n) {
|
|
1041
|
+
if (n >= 100) return '$' + n.toFixed(0);
|
|
1042
|
+
if (n >= 1) return '$' + n.toFixed(2);
|
|
1043
|
+
if (n >= 0.01) return '$' + n.toFixed(3);
|
|
1044
|
+
return '$' + n.toFixed(4);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
// ── Single-line statusline (compact) ─────────────────────────────
|
|
1048
|
+
function generateStatusline() {
|
|
1049
|
+
const git = getGitInfo();
|
|
1050
|
+
const swarm = getSwarmStatus();
|
|
1051
|
+
const system = getSystemMetrics();
|
|
1052
|
+
const hooks = getHooksStatus();
|
|
1053
|
+
const knowledge = getKnowledgeStats();
|
|
1054
|
+
const triggers = getTriggerStats();
|
|
1055
|
+
const parts = [];
|
|
1056
|
+
|
|
1057
|
+
// Brand + swarm dot
|
|
1058
|
+
const swarmDot = swarm.coordinationActive ? `${x.green}●${x.reset}` : `${x.slate}○${x.reset}`;
|
|
1059
|
+
parts.push(`${x.bold}${x.purple}▊ Monomind${x.reset} ${swarmDot}`);
|
|
1060
|
+
|
|
1061
|
+
// Git branch + changes (compact)
|
|
1062
|
+
if (git.gitBranch) {
|
|
1063
|
+
let b = `${x.sky}⎇ ${x.bold}${git.gitBranch}${x.reset}`;
|
|
1064
|
+
if (git.staged > 0) b += ` ${x.green}+${git.staged}${x.reset}`;
|
|
1065
|
+
if (git.modified > 0) b += ` ${x.gold}~${git.modified}${x.reset}`;
|
|
1066
|
+
if (git.ahead > 0) b += ` ${x.green}↑${git.ahead}${x.reset}`;
|
|
1067
|
+
if (git.behind > 0) b += ` ${x.coral}↓${git.behind}${x.reset}`;
|
|
1068
|
+
parts.push(b);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
// Model
|
|
1072
|
+
parts.push(`${x.violet}${getModelName()}${x.reset}`);
|
|
1073
|
+
|
|
1074
|
+
// Active agent
|
|
1075
|
+
const activeAgent = getActiveAgent();
|
|
1076
|
+
if (activeAgent) {
|
|
1077
|
+
const col = activeAgent.activated ? x.green : x.sky;
|
|
1078
|
+
const icon = activeAgent.activated ? '●' : '→';
|
|
1079
|
+
parts.push(`${col}${icon} ${x.bold}${activeAgent.name}${x.reset}`);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// Active org runs — high signal for users tracking autonomous orgs
|
|
1083
|
+
const orgStatus = getActiveOrgs();
|
|
1084
|
+
if (orgStatus.count > 0) {
|
|
1085
|
+
const runningOrgs = orgStatus.orgs.filter(o => o.running);
|
|
1086
|
+
const doneOrgs = orgStatus.orgs.filter(o => !o.running);
|
|
1087
|
+
if (runningOrgs.length > 0) {
|
|
1088
|
+
const names = runningOrgs.slice(0, 2).map(o => o.name).join(', ');
|
|
1089
|
+
parts.push(`${x.green}🏛 ${x.bold}${names}${x.reset}${runningOrgs.length > 2 ? ` +${runningOrgs.length - 2}` : ''}`);
|
|
1090
|
+
} else if (doneOrgs.length > 0) {
|
|
1091
|
+
parts.push(`${x.slate}🏛 ${doneOrgs[0].name} done${x.reset}`);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
// Intelligence — only show when non-trivial (>15%) to avoid misleading 0%/noise
|
|
1096
|
+
const ic = pctColor(system.intelligencePct);
|
|
1097
|
+
if (system.intelligencePct > 15) {
|
|
1098
|
+
parts.push(`${ic}💡 ${system.intelligencePct}%${x.reset}`);
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// Knowledge chunks (Task 28) — show when populated
|
|
1102
|
+
if (knowledge.chunks > 0) {
|
|
1103
|
+
parts.push(`${x.teal}📚 ${knowledge.chunks}k${x.reset}`);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
// Triggers (Task 32) — show when populated
|
|
1107
|
+
if (triggers.triggers > 0) {
|
|
1108
|
+
parts.push(`${x.mint}🎯 ${triggers.triggers}t${x.reset}`);
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
// Swarm agents (only when active)
|
|
1112
|
+
if (swarm.activeAgents > 0) {
|
|
1113
|
+
parts.push(`${x.gold}🐝 ${swarm.activeAgents}/${swarm.maxAgents}${x.reset}`);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// Hooks
|
|
1117
|
+
if (hooks.enabled > 0) {
|
|
1118
|
+
parts.push(`${x.mint}⚡ ${hooks.enabled}h${x.reset}`);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
// Token cost — today's spend across all projects (from cached summary)
|
|
1122
|
+
const tokenCost = getTokenCostSummary();
|
|
1123
|
+
if (tokenCost) {
|
|
1124
|
+
if (tokenCost.isFresh && tokenCost.todayCost > 0) {
|
|
1125
|
+
const col = tokenCost.todayCost > 50 ? x.coral : tokenCost.todayCost > 10 ? x.gold : x.mint;
|
|
1126
|
+
parts.push(`${col}${fmtCost(tokenCost.todayCost)} today${x.reset}`);
|
|
1127
|
+
} else if (tokenCost.monthCost > 0) {
|
|
1128
|
+
parts.push(`${x.slate}${fmtCost(tokenCost.monthCost)} mo${x.reset}`);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
return parts.join(` ${DIV} `);
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
// ── Multi-line dashboard (full mode) ─────────────────────────────
|
|
1136
|
+
function generateDashboard() {
|
|
1137
|
+
const git = getGitInfo();
|
|
1138
|
+
const modelName = getModelName();
|
|
1139
|
+
const progress = getv1Progress();
|
|
1140
|
+
const security = getSecurityStatus();
|
|
1141
|
+
const swarm = getSwarmStatus();
|
|
1142
|
+
const system = getSystemMetrics();
|
|
1143
|
+
const adrs = getADRStatus();
|
|
1144
|
+
const hooks = getHooksStatus();
|
|
1145
|
+
const lancedb = getLanceDBStats();
|
|
1146
|
+
const tests = getTestStats();
|
|
1147
|
+
const session = getSessionStats();
|
|
1148
|
+
const integration = getIntegrationStatus();
|
|
1149
|
+
const knowledge = getKnowledgeStats();
|
|
1150
|
+
const triggers = getTriggerStats();
|
|
1151
|
+
const si = getSIBudget();
|
|
1152
|
+
const sec = secBadge(security.status);
|
|
1153
|
+
const activeAgent = getActiveAgent();
|
|
1154
|
+
const lines = [];
|
|
1155
|
+
|
|
1156
|
+
// ── Header: brand + git + model + session ────────────────────
|
|
1157
|
+
const swarmDot = swarm.coordinationActive ? `${x.green}● LIVE${x.reset}` : `${x.slate}○ IDLE${x.reset}`;
|
|
1158
|
+
const projName = getProjectName();
|
|
1159
|
+
const cwdName = path.basename(CWD);
|
|
1160
|
+
let hdr = `${x.bold}${x.purple}▊ Monomind ${VERSION}${x.reset} ${swarmDot} ${x.teal}${x.bold}${projName}${x.reset} ${DIV} ${x.dim}◎ ${cwdName}${x.reset} ${DIV} ${x.violet}⬡ ${git.name}${x.reset}`;
|
|
1161
|
+
|
|
1162
|
+
if (git.gitBranch) {
|
|
1163
|
+
hdr += ` ${DIV} ${x.sky}⎇ ${x.bold}${git.gitBranch}${x.reset}`;
|
|
1164
|
+
if (git.staged > 0) hdr += ` ${x.green}+${git.staged}${x.reset}`;
|
|
1165
|
+
if (git.modified > 0) hdr += ` ${x.gold}~${git.modified} mod${x.reset}`;
|
|
1166
|
+
if (git.untracked > 0) hdr += ` ${x.slate}?${git.untracked}${x.reset}`;
|
|
1167
|
+
if (git.ahead > 0) hdr += ` ${x.green}↑${git.ahead}${x.reset}`;
|
|
1168
|
+
if (git.behind > 0) hdr += ` ${x.coral}↓${git.behind}${x.reset}`;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
hdr += ` ${DIV} 🤖 ${x.violet}${x.bold}${modelName}${x.reset}`;
|
|
1172
|
+
if (session.duration) hdr += ` ${x.dim}⏱ ${session.duration}${x.reset}`;
|
|
1173
|
+
|
|
1174
|
+
// Token cost in dashboard header — today's spend (all projects)
|
|
1175
|
+
const tokenCost = getTokenCostSummary();
|
|
1176
|
+
if (tokenCost) {
|
|
1177
|
+
if (tokenCost.isFresh && tokenCost.todayCost > 0) {
|
|
1178
|
+
const col = tokenCost.todayCost > 50 ? x.coral : tokenCost.todayCost > 10 ? x.gold : x.mint;
|
|
1179
|
+
hdr += ` ${DIV} ${col}${fmtCost(tokenCost.todayCost)} today${x.reset}${x.dim} · ${fmtCost(tokenCost.monthCost)} mo${x.reset}`;
|
|
1180
|
+
} else if (tokenCost.monthCost > 0) {
|
|
1181
|
+
hdr += ` ${DIV} ${x.slate}${fmtCost(tokenCost.monthCost)} mo${x.reset}`;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
lines.push(hdr);
|
|
1186
|
+
lines.push(SEP);
|
|
1187
|
+
|
|
1188
|
+
// ── Row 1: Active agent + Loop status ────────────────────────
|
|
1189
|
+
let agentStr;
|
|
1190
|
+
if (activeAgent) {
|
|
1191
|
+
const col = activeAgent.activated ? x.green : x.sky;
|
|
1192
|
+
const mark = activeAgent.activated ? `${col}${x.bold}● ACTIVE${x.reset} ` : '';
|
|
1193
|
+
const conf = activeAgent.activated ? '' : ` ${x.slate}${(activeAgent.confidence * 100).toFixed(0)}%${x.reset}`;
|
|
1194
|
+
agentStr = `${mark}${col}👤 ${x.bold}${activeAgent.name}${x.reset}${conf}`;
|
|
1195
|
+
} else {
|
|
1196
|
+
agentStr = `${x.slate}👤 no agent routed${x.reset}`;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
const loopState = getLoopStatus();
|
|
1200
|
+
let loopStr;
|
|
1201
|
+
if (loopState.count > 0) {
|
|
1202
|
+
const parts = loopState.loops.slice(0, 2).map(l => {
|
|
1203
|
+
const status = l.status === 'hil:pending'
|
|
1204
|
+
? `${x.coral}⏳ HIL${x.reset}`
|
|
1205
|
+
: `${x.green}⟳${x.reset}`;
|
|
1206
|
+
const tag = l.type === 'tillend'
|
|
1207
|
+
? `${x.bold}${l.cmd}${x.reset}${x.slate} run ${l.rep}${x.reset}`
|
|
1208
|
+
: `${x.bold}${l.cmd}${x.reset}${x.slate} ${l.rep}/${l.max}${x.reset}`;
|
|
1209
|
+
return `${status} ${tag}`;
|
|
1210
|
+
});
|
|
1211
|
+
loopStr = `${x.gold}🔄${x.reset} ${parts.join(`${x.slate} · ${x.reset}`)}`;
|
|
1212
|
+
if (loopState.count > 2) loopStr += `${x.slate} +${loopState.count - 2} more${x.reset}`;
|
|
1213
|
+
} else {
|
|
1214
|
+
loopStr = `${x.slate}🔄 no active loops${x.reset}`;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
// Graph usage ratio + $ saved — show only when there's data
|
|
1218
|
+
const usage = getGraphUsage();
|
|
1219
|
+
let usageStr = '';
|
|
1220
|
+
if (usage) {
|
|
1221
|
+
const col = usage.pct >= 40 ? x.green : usage.pct >= 15 ? x.gold : x.coral;
|
|
1222
|
+
const saved = usage.dollarsSaved > 0
|
|
1223
|
+
? ` ${x.green}💰 +$${usage.dollarsSaved.toFixed(2)}${x.reset}`
|
|
1224
|
+
: '';
|
|
1225
|
+
usageStr = ` ${DIV} ${col}📊 graph ${usage.pct}%${x.reset}${x.slate} · grep ${100 - usage.pct}%${x.reset}${saved}`;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
// Hook latency — surface when slow (>500ms per prompt)
|
|
1229
|
+
const lat = getHookLatency();
|
|
1230
|
+
let latStr = '';
|
|
1231
|
+
if (lat && lat.perPromptMs > 500) {
|
|
1232
|
+
latStr = ` ${DIV} ${x.coral}⚡ hooks ${lat.perPromptMs}ms${x.reset}`;
|
|
1233
|
+
} else if (lat && lat.perPromptMs > 0) {
|
|
1234
|
+
latStr = ` ${DIV} ${x.dim}⚡ ${lat.perPromptMs}ms${x.reset}`;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
lines.push(`${x.purple}🤖 AGENT${x.reset} ${agentStr} ${DIV} ${loopStr}${usageStr}${latStr}`);
|
|
1238
|
+
lines.push(SEP);
|
|
1239
|
+
|
|
1240
|
+
// ── Row 2: Graph freshness + Pending HIL ─────────────────────
|
|
1241
|
+
const gf = getGraphifyStats();
|
|
1242
|
+
const freshness = getGraphFreshness();
|
|
1243
|
+
let graphStr;
|
|
1244
|
+
if (gf.exists) {
|
|
1245
|
+
const nodesFmt = gf.nodes >= 1000 ? `${(gf.nodes / 1000).toFixed(0)}k` : `${gf.nodes}`;
|
|
1246
|
+
const freshTag = freshness.fresh
|
|
1247
|
+
? `${x.green}● fresh${x.reset}`
|
|
1248
|
+
: freshness.stale
|
|
1249
|
+
? `${x.coral}● ${freshness.commitsBehind} commits stale${x.reset}`
|
|
1250
|
+
: `${x.gold}● ${freshness.commitsBehind} behind${x.reset}`;
|
|
1251
|
+
graphStr = `${x.sky}🔗 ${x.bold}${nodesFmt}${x.reset}${x.slate} nodes${x.reset} ${freshTag}`;
|
|
1252
|
+
} else {
|
|
1253
|
+
graphStr = `${x.slate}🔗 no graph${x.reset}`;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
const hil = getHILPending();
|
|
1257
|
+
const hilStr = hil.pending > 0
|
|
1258
|
+
? `${x.coral}✨ ${x.bold}${hil.pending}${x.reset}${x.coral} HIL pending${x.reset}`
|
|
1259
|
+
: `${x.slate}✨ no pending HIL${x.reset}`;
|
|
1260
|
+
|
|
1261
|
+
lines.push(`${x.teal}🧠 CONTEXT${x.reset} ${graphStr} ${DIV} ${hilStr}`);
|
|
1262
|
+
|
|
1263
|
+
// ── Row 3: Active org runs ───────────────────────────────────
|
|
1264
|
+
const orgStatus = getActiveOrgs();
|
|
1265
|
+
if (orgStatus.count > 0) {
|
|
1266
|
+
lines.push(SEP);
|
|
1267
|
+
const orgParts = orgStatus.orgs.slice(0, 5).map(o => {
|
|
1268
|
+
const ageMin = Math.floor(o.ageMs / 60000);
|
|
1269
|
+
const ageFmt = ageMin < 1 ? 'just now' : ageMin < 60 ? `${ageMin}m ago` : `${Math.floor(ageMin / 60)}h ago`;
|
|
1270
|
+
const col = o.running ? x.green : x.slate;
|
|
1271
|
+
const dot2 = o.running ? `${x.green}●${x.reset}` : `${x.slate}◌${x.reset}`;
|
|
1272
|
+
return `${dot2} ${col}${x.bold}${o.name}${x.reset} ${x.dim}${ageFmt}${x.reset}`;
|
|
1273
|
+
});
|
|
1274
|
+
lines.push(`${x.purple}🏛 ORGS${x.reset} ${orgParts.join(` ${DIV} `)}`);
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
return lines.join('\n');
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
// ── JSON output ──────────────────────────────────────────────────
|
|
1281
|
+
function generateJSON() {
|
|
1282
|
+
const git = getGitInfo();
|
|
1283
|
+
return {
|
|
1284
|
+
user: { name: git.name, gitBranch: git.gitBranch, modelName: getModelName() },
|
|
1285
|
+
domains: getv1Progress(),
|
|
1286
|
+
security: getSecurityStatus(),
|
|
1287
|
+
swarm: getSwarmStatus(),
|
|
1288
|
+
system: getSystemMetrics(),
|
|
1289
|
+
adrs: getADRStatus(),
|
|
1290
|
+
hooks: getHooksStatus(),
|
|
1291
|
+
lancedb: getLanceDBStats(),
|
|
1292
|
+
tests: getTestStats(),
|
|
1293
|
+
git: { modified: git.modified, untracked: git.untracked, staged: git.staged, ahead: git.ahead, behind: git.behind },
|
|
1294
|
+
tokenCost: getTokenCostSummary(),
|
|
1295
|
+
lastUpdated: new Date().toISOString(),
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
// ─── Mode state file ─────────────────────────────────────────────
|
|
1300
|
+
const MODE_FILE = path.join(CWD, '.monomind', 'statusline-mode.txt');
|
|
1301
|
+
|
|
1302
|
+
function readMode() {
|
|
1303
|
+
try {
|
|
1304
|
+
if (fs.existsSync(MODE_FILE)) {
|
|
1305
|
+
return fs.readFileSync(MODE_FILE, 'utf-8').trim();
|
|
1306
|
+
}
|
|
1307
|
+
} catch { /* ignore */ }
|
|
1308
|
+
return 'full'; // default
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
// ─── Testability export (when required as a module, not run as CLI) ──────────
|
|
1312
|
+
if (require.main !== module) {
|
|
1313
|
+
module.exports = {
|
|
1314
|
+
readJSON, safeStat, modelLabel,
|
|
1315
|
+
getSecurityStatus, getSwarmStatus, getADRStatus,
|
|
1316
|
+
getHooksStatus, getActiveAgent, getLanceDBStats,
|
|
1317
|
+
getLearningStats, getTestStats, getIntegrationStatus,
|
|
1318
|
+
generateJSON,
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
// ─── Main ───────────────────────────────────────────────────────
|
|
1323
|
+
if (require.main === module && process.argv.includes('--json')) {
|
|
1324
|
+
console.log(JSON.stringify(generateJSON(), null, 2));
|
|
1325
|
+
} else if (require.main === module && process.argv.includes('--compact')) {
|
|
1326
|
+
console.log(JSON.stringify(generateJSON()));
|
|
1327
|
+
} else if (require.main === module && process.argv.includes('--single-line')) {
|
|
1328
|
+
console.log(generateStatusline());
|
|
1329
|
+
} else if (require.main === module && process.argv.includes('--toggle')) {
|
|
1330
|
+
// Toggle mode and print the new view
|
|
1331
|
+
const current = readMode();
|
|
1332
|
+
const next = current === 'compact' ? 'full' : 'compact';
|
|
1333
|
+
try {
|
|
1334
|
+
fs.mkdirSync(path.dirname(MODE_FILE), { recursive: true });
|
|
1335
|
+
fs.writeFileSync(MODE_FILE, next, 'utf-8');
|
|
1336
|
+
} catch { /* ignore */ }
|
|
1337
|
+
if (next === 'compact') {
|
|
1338
|
+
console.log(generateStatusline());
|
|
1339
|
+
} else {
|
|
1340
|
+
console.log(generateDashboard());
|
|
1341
|
+
}
|
|
1342
|
+
} else if (require.main === module) {
|
|
1343
|
+
// Default: respect mode state file
|
|
1344
|
+
const mode = readMode();
|
|
1345
|
+
if (mode === 'compact') {
|
|
1346
|
+
console.log(generateStatusline());
|
|
1347
|
+
} else {
|
|
1348
|
+
console.log(generateDashboard());
|
|
1349
|
+
}
|
|
1350
|
+
}
|