@monoes/monomindcli 2.9.4 → 2.9.6
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/.claude/commands/mastermind/approvev1.md +94 -0
- package/.claude/commands/mastermind/architect.md +52 -0
- package/.claude/commands/mastermind/autodev.md +28 -0
- package/.claude/commands/mastermind/build.md +23 -0
- package/.claude/commands/mastermind/finish.md +17 -0
- package/.claude/commands/mastermind/runorgv1.md +159 -0
- package/.claude/commands/mastermind/taskdev.md +23 -0
- package/.claude/commands/mastermind/tdd.md +19 -0
- package/.claude/commands/mastermind/verify.md +19 -0
- package/.claude/helpers/intelligence.cjs +6 -27
- package/.claude/skills/agentic-jujutsu/SKILL.md +15 -17
- package/.claude/skills/hive-mind-advanced/SKILL.md +559 -212
- package/.claude/skills/hooks-automation/SKILL.md +1 -1
- package/.claude/skills/mastermind-approvev1/SKILL.md +191 -0
- package/.claude/skills/mastermind-architect/SKILL.md +862 -0
- package/.claude/skills/mastermind-autodev/SKILL.md +360 -0
- package/.claude/skills/mastermind-build/SKILL.md +169 -0
- package/.claude/skills/mastermind-companies/SKILL.md +256 -0
- package/.claude/skills/mastermind-content/SKILL.md +197 -0
- package/.claude/skills/mastermind-costs/SKILL.md +151 -0
- package/.claude/skills/mastermind-finance/SKILL.md +166 -0
- package/.claude/skills/mastermind-finish/SKILL.md +251 -0
- package/.claude/skills/mastermind-heartbeatv1/SKILL.md +167 -0
- package/.claude/skills/mastermind-instance-settings/SKILL.md +315 -0
- package/.claude/skills/mastermind-marketing/SKILL.md +228 -0
- package/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +181 -0
- package/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +158 -0
- package/.claude/skills/mastermind-ops/SKILL.md +168 -0
- package/.claude/skills/mastermind-org-chart/SKILL.md +209 -0
- package/.claude/skills/mastermind-project-detail/SKILL.md +249 -0
- package/.claude/skills/mastermind-project-workspace/SKILL.md +244 -0
- package/.claude/skills/mastermind-projects/SKILL.md +167 -0
- package/.claude/skills/mastermind-runorgv1/SKILL.md +731 -0
- package/.claude/skills/mastermind-sales/SKILL.md +170 -0
- package/.claude/skills/mastermind-taskdev/SKILL.md +377 -0
- package/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +60 -0
- package/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +144 -0
- package/.claude/skills/mastermind-taskdev/implementer-prompt.md +114 -0
- package/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +80 -0
- package/.claude/skills/mastermind-tdd/SKILL.md +424 -0
- package/.claude/skills/mastermind-verify/SKILL.md +196 -0
- package/.claude/skills/mastermind-wiki/SKILL.md +314 -0
- package/.claude/skills/monolean-review/SKILL.md +57 -0
- package/.claude/skills/pair-programming/SKILL.md +1 -1
- package/.claude/skills/performance-analysis/SKILL.md +484 -228
- package/.claude/skills/swarm-advanced/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +150 -220
- package/.claude/skills/verification-quality/SKILL.md +571 -247
- package/README.md +3 -3
- package/dist/src/commands/agent-lifecycle.js +3 -3
- package/dist/src/commands/agent-lifecycle.js.map +1 -1
- package/dist/src/commands/autopilot.d.ts.map +1 -1
- package/dist/src/commands/autopilot.js +1 -7
- package/dist/src/commands/autopilot.js.map +1 -1
- package/dist/src/commands/doc.d.ts.map +1 -1
- package/dist/src/commands/doc.js +3 -14
- package/dist/src/commands/doc.js.map +1 -1
- package/dist/src/commands/doctor-env-checks.d.ts +1 -1
- package/dist/src/commands/doctor-env-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +37 -3
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +1 -30
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.js +67 -75
- package/dist/src/commands/hooks-coverage-commands.js.map +1 -1
- package/dist/src/commands/hooks-workers.d.ts.map +1 -1
- package/dist/src/commands/hooks-workers.js +10 -41
- package/dist/src/commands/hooks-workers.js.map +1 -1
- package/dist/src/commands/hooks.js +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +7 -80
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +2 -78
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +3 -116
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/commands/performance.js +1 -1
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/security-cve.d.ts.map +1 -1
- package/dist/src/commands/security-cve.js +11 -1
- package/dist/src/commands/security-cve.js.map +1 -1
- package/dist/src/commands/security-misc.d.ts +9 -0
- package/dist/src/commands/security-misc.d.ts.map +1 -1
- package/dist/src/commands/security-misc.js +54 -33
- package/dist/src/commands/security-misc.js.map +1 -1
- package/dist/src/commands/security-scan.d.ts.map +1 -1
- package/dist/src/commands/security-scan.js +11 -3
- package/dist/src/commands/security-scan.js.map +1 -1
- package/dist/src/commands/swarm.d.ts.map +1 -1
- package/dist/src/commands/swarm.js +2 -7
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/init/claudemd-generator.js +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +3 -13
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/kimi-generator.d.ts +2 -3
- package/dist/src/init/kimi-generator.d.ts.map +1 -1
- package/dist/src/init/kimi-generator.js +13 -45
- package/dist/src/init/kimi-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +1 -1
- package/dist/src/init/statusline-generator.js +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +2 -2
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-intelligence.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-intelligence.js +3 -29
- package/dist/src/mcp-tools/hooks-intelligence.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +19 -32
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph/query-tools.js +18 -48
- package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +10 -15
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/memory/embedding-operations.d.ts +0 -4
- package/dist/src/memory/embedding-operations.d.ts.map +1 -1
- package/dist/src/memory/embedding-operations.js +32 -125
- package/dist/src/memory/embedding-operations.js.map +1 -1
- package/dist/src/memory/hnsw-operations.d.ts +1 -1
- package/dist/src/memory/hnsw-operations.js +1 -1
- package/dist/src/memory/memory-read.d.ts +1 -1
- package/dist/src/memory/memory-read.js +2 -2
- package/dist/src/memory/memory-read.js.map +1 -1
- package/dist/src/monovector/diff-classifier.js +3 -3
- package/dist/src/monovector/diff-classifier.js.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts +1 -11
- package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.js +1 -15
- package/dist/src/orgrt/checkpoint-ops.js.map +1 -1
- package/dist/src/orgrt/checkpoint.js +1 -1
- package/dist/src/orgrt/checkpoint.js.map +1 -1
- package/dist/src/orgrt/daemon.d.ts +0 -6
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +0 -26
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/decisions.d.ts +0 -13
- package/dist/src/orgrt/decisions.d.ts.map +1 -1
- package/dist/src/orgrt/decisions.js +0 -95
- package/dist/src/orgrt/decisions.js.map +1 -1
- package/dist/src/orgrt/kimicode-runner.js +1 -1
- package/dist/src/orgrt/kimicode-runner.js.map +1 -1
- package/dist/src/orgrt/opencode-runner.js +1 -1
- package/dist/src/orgrt/opencode-runner.js.map +1 -1
- package/dist/src/orgrt/session.d.ts +1 -27
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +3 -42
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/task-dag.d.ts +1 -11
- package/dist/src/orgrt/task-dag.d.ts.map +1 -1
- package/dist/src/orgrt/task-dag.js +2 -93
- package/dist/src/orgrt/task-dag.js.map +1 -1
- package/dist/src/orgrt/templates.d.ts.map +1 -1
- package/dist/src/orgrt/templates.js +0 -24
- package/dist/src/orgrt/templates.js.map +1 -1
- package/dist/src/orgrt/types.d.ts +1 -70
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +0 -19
- package/dist/src/orgrt/types.js.map +1 -1
- package/dist/src/orgrt/vercel-providers.d.ts.map +1 -1
- package/dist/src/orgrt/vercel-providers.js +4 -9
- package/dist/src/orgrt/vercel-providers.js.map +1 -1
- package/dist/src/orgrt/vercel-runner.d.ts +23 -0
- package/dist/src/orgrt/vercel-runner.d.ts.map +1 -1
- package/dist/src/orgrt/vercel-runner.js +1 -26
- package/dist/src/orgrt/vercel-runner.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -1,304 +1,560 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: performance-analysis
|
|
3
|
-
description:
|
|
3
|
+
description: |
|
|
4
|
+
Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Monomind swarms
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
#
|
|
7
|
+
# Performance Analysis Skill
|
|
8
|
+
|
|
9
|
+
Comprehensive performance analysis suite for identifying bottlenecks, profiling swarm operations, generating detailed reports, and providing actionable optimization recommendations.
|
|
7
10
|
|
|
8
11
|
## Overview
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
This skill consolidates all performance analysis capabilities:
|
|
14
|
+
- **Bottleneck Detection**: Identify performance bottlenecks across communication, processing, memory, and network
|
|
15
|
+
- **Performance Profiling**: Real-time monitoring and historical analysis of swarm operations
|
|
16
|
+
- **Report Generation**: Create comprehensive performance reports in multiple formats
|
|
17
|
+
- **Optimization Recommendations**: AI-powered suggestions for improving performance
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
real before fixing it. Symptoms are not root causes.
|
|
19
|
+
## Quick Start
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
|
|
21
|
+
### Basic Bottleneck Detection
|
|
22
|
+
```bash
|
|
23
|
+
npx monomind bottleneck detect
|
|
19
24
|
```
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- Something feels slow (swarm run, memory search, build, MCP tool call)
|
|
24
|
-
- Before/after a change that could affect performance
|
|
25
|
-
- A regression report or user complaint about latency
|
|
26
|
-
- Capacity planning — picking `maxAgents`, topology, or memory backend
|
|
27
|
-
- Token burn higher than expected
|
|
28
|
-
|
|
29
|
-
**Use ESPECIALLY when:** the fix "feels obvious". Obvious fixes without measurement
|
|
30
|
-
are the most common source of fake optimizations.
|
|
31
|
-
|
|
32
|
-
## The Real Command Surface
|
|
33
|
-
|
|
34
|
-
These are the ONLY performance/analysis commands. Anything else is wrong.
|
|
35
|
-
|
|
36
|
-
| Command | What it does |
|
|
37
|
-
|---|---|
|
|
38
|
-
| `monomind performance benchmark` | Run benchmarks (wasm/neural/memory/search) |
|
|
39
|
-
| `monomind performance profile` | Profile CPU/memory/IO over a window |
|
|
40
|
-
| `monomind performance metrics` | View/export metrics (1h/24h/7d/30d) |
|
|
41
|
-
| `monomind performance bottleneck` | Identify bottlenecks (quick or full) |
|
|
42
|
-
| `monomind analyze diff` | Git diff risk + change classification |
|
|
43
|
-
| `monomind analyze code` | Static code analysis |
|
|
44
|
-
| `monomind analyze deps` | Dependency analysis (`--security` for CVEs) |
|
|
45
|
-
| `monomind analyze ast` | AST analysis via tree-sitter |
|
|
46
|
-
| `monomind analyze complexity` | Code complexity metrics |
|
|
47
|
-
| `monomind analyze symbols` | Extract functions/classes/types |
|
|
48
|
-
| `monomind analyze imports` | Import dependency graph |
|
|
49
|
-
| `monomind doctor` | 28 health-check categories |
|
|
50
|
-
| `monomind hooks metrics` | Learning metrics dashboard |
|
|
51
|
-
| `monomind tokens dashboard` | Token usage (`today`/`week`/`30days`/`month`) |
|
|
52
|
-
|
|
53
|
-
> Use `npx monomind@latest ...` from outside the repo; inside the repo `node packages/@monomind/cli/bin/cli.js ...` works too. Never use `monomind@alpha`.
|
|
54
|
-
|
|
55
|
-
## The Four Phases
|
|
56
|
-
|
|
57
|
-
Complete each phase before moving on. Skipping a phase produces fake optimizations.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
### Phase 1: Establish a Baseline
|
|
62
|
-
|
|
63
|
-
Before changing anything, capture the current state so later comparison is honest.
|
|
64
|
-
|
|
26
|
+
### Generate Performance Report
|
|
65
27
|
```bash
|
|
66
|
-
|
|
67
|
-
npx monomind@latest performance benchmark -s all -i 100 -o json > baseline-bench.json
|
|
68
|
-
|
|
69
|
-
# Snapshot current metrics for the relevant window
|
|
70
|
-
npx monomind@latest performance metrics -t 24h -f json > baseline-metrics.json
|
|
71
|
-
|
|
72
|
-
# Capture a profile so you know where time is going today
|
|
73
|
-
npx monomind@latest performance profile -t all -d 60 -o baseline-profile.json
|
|
28
|
+
npx monomind analysis performance-report --format html --include-metrics
|
|
74
29
|
```
|
|
75
30
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
### Phase 2: Find the Bottleneck (don't guess, ask the system)
|
|
81
|
-
|
|
82
|
-
`performance bottleneck` answers the question "where is time being spent?".
|
|
83
|
-
|
|
31
|
+
### Analyze and Auto-Fix
|
|
84
32
|
```bash
|
|
85
|
-
|
|
86
|
-
npx monomind@latest performance bottleneck
|
|
87
|
-
|
|
88
|
-
# Deep dive when quick confirms something is off
|
|
89
|
-
npx monomind@latest performance bottleneck -d full
|
|
90
|
-
|
|
91
|
-
# Scope to a suspected component (e.g. network, memory, search)
|
|
92
|
-
npx monomind@latest performance bottleneck -c memory
|
|
33
|
+
npx monomind bottleneck detect --fix --threshold 15
|
|
93
34
|
```
|
|
94
35
|
|
|
95
|
-
|
|
36
|
+
## Core Capabilities
|
|
96
37
|
|
|
97
|
-
|
|
98
|
-
|---|---|
|
|
99
|
-
| Slow swarm coordination | network (inter-agent messages) |
|
|
100
|
-
| Memory search slow | memory (SQLite vs. WASM fallback path) |
|
|
101
|
-
| Token burn surprise | cpu / model invocation |
|
|
102
|
-
| Boot/startup slow | io (file reads, graph load) |
|
|
103
|
-
| MCP tool latency | network (server round-trip) |
|
|
104
|
-
|
|
105
|
-
**If `bottleneck` reports nothing:** the problem may be code-level, not system-level.
|
|
106
|
-
Move to Phase 2b.
|
|
107
|
-
|
|
108
|
-
#### Phase 2b: Code-Level Analysis
|
|
109
|
-
|
|
110
|
-
When the system is healthy but the code is slow, switch to `analyze`:
|
|
38
|
+
### 1. Bottleneck Detection
|
|
111
39
|
|
|
40
|
+
#### Command Syntax
|
|
112
41
|
```bash
|
|
113
|
-
|
|
114
|
-
npx monomind@latest analyze diff --risk --classify -v
|
|
115
|
-
|
|
116
|
-
# Flag high-complexity hotspots (default threshold 10)
|
|
117
|
-
npx monomind@latest analyze complexity src/ -t 15 -f json
|
|
118
|
-
|
|
119
|
-
# Inspect import graph for accidental heavy dependencies
|
|
120
|
-
npx monomind@latest analyze imports src/ --external
|
|
121
|
-
|
|
122
|
-
# Dependency audit (CVEs and bloat both hurt performance)
|
|
123
|
-
npx monomind@latest analyze deps --security
|
|
42
|
+
npx monomind bottleneck detect [options]
|
|
124
43
|
```
|
|
125
44
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
Numbers without interpretation are noise. Read the dashboard, then explain it.
|
|
45
|
+
#### Options
|
|
46
|
+
- `--swarm-id, -s <id>` - Analyze specific swarm (default: current)
|
|
47
|
+
- `--time-range, -t <range>` - Analysis period: 1h, 24h, 7d, all (default: 1h)
|
|
48
|
+
- `--threshold <percent>` - Bottleneck threshold percentage (default: 20)
|
|
49
|
+
- `--export, -e <file>` - Export analysis to file
|
|
50
|
+
- `--fix` - Apply automatic optimizations
|
|
134
51
|
|
|
52
|
+
#### Usage Examples
|
|
135
53
|
```bash
|
|
136
|
-
#
|
|
137
|
-
npx monomind
|
|
54
|
+
# Basic detection for current swarm
|
|
55
|
+
npx monomind bottleneck detect
|
|
138
56
|
|
|
139
|
-
#
|
|
140
|
-
npx monomind
|
|
57
|
+
# Analyze specific swarm over 24 hours
|
|
58
|
+
npx monomind bottleneck detect --swarm-id swarm-123 -t 24h
|
|
141
59
|
|
|
142
|
-
#
|
|
143
|
-
npx monomind
|
|
60
|
+
# Export detailed analysis
|
|
61
|
+
npx monomind bottleneck detect -t 24h -e bottlenecks.json
|
|
144
62
|
|
|
145
|
-
#
|
|
146
|
-
npx monomind
|
|
147
|
-
```
|
|
63
|
+
# Auto-fix detected issues
|
|
64
|
+
npx monomind bottleneck detect --fix --threshold 15
|
|
148
65
|
|
|
149
|
-
|
|
66
|
+
# Low threshold for sensitive detection
|
|
67
|
+
npx monomind bottleneck detect --threshold 10 --export critical-issues.json
|
|
68
|
+
```
|
|
150
69
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
|
|
70
|
+
#### Metrics Analyzed
|
|
71
|
+
|
|
72
|
+
**Communication Bottlenecks:**
|
|
73
|
+
- Message queue delays
|
|
74
|
+
- Agent response times
|
|
75
|
+
- Coordination overhead
|
|
76
|
+
- Memory access patterns
|
|
77
|
+
- Inter-agent communication latency
|
|
78
|
+
|
|
79
|
+
**Processing Bottlenecks:**
|
|
80
|
+
- Task completion times
|
|
81
|
+
- Agent utilization rates
|
|
82
|
+
- Parallel execution efficiency
|
|
83
|
+
- Resource contention
|
|
84
|
+
- CPU/memory usage patterns
|
|
85
|
+
|
|
86
|
+
**Memory Bottlenecks:**
|
|
87
|
+
- Cache hit rates
|
|
88
|
+
- Memory access patterns
|
|
89
|
+
- Storage I/O performance
|
|
90
|
+
- Neural pattern loading times
|
|
91
|
+
- Memory allocation efficiency
|
|
92
|
+
|
|
93
|
+
**Network Bottlenecks:**
|
|
94
|
+
- API call latency
|
|
95
|
+
- MCP communication delays
|
|
96
|
+
- External service timeouts
|
|
97
|
+
- Concurrent request limits
|
|
98
|
+
- Network throughput issues
|
|
99
|
+
|
|
100
|
+
#### Output Format
|
|
101
|
+
```
|
|
102
|
+
🔍 Bottleneck Analysis Report
|
|
103
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
104
|
+
|
|
105
|
+
📊 Summary
|
|
106
|
+
├── Time Range: Last 1 hour
|
|
107
|
+
├── Agents Analyzed: 6
|
|
108
|
+
├── Tasks Processed: 42
|
|
109
|
+
└── Critical Issues: 2
|
|
110
|
+
|
|
111
|
+
🚨 Critical Bottlenecks
|
|
112
|
+
1. Agent Communication (35% impact)
|
|
113
|
+
└── coordinator → coder-1 messages delayed by 2.3s avg
|
|
114
|
+
|
|
115
|
+
2. Memory Access (28% impact)
|
|
116
|
+
└── Neural pattern loading taking 1.8s per access
|
|
117
|
+
|
|
118
|
+
⚠️ Warning Bottlenecks
|
|
119
|
+
1. Task Queue (18% impact)
|
|
120
|
+
└── 5 tasks waiting > 10s for assignment
|
|
121
|
+
|
|
122
|
+
💡 Recommendations
|
|
123
|
+
1. Switch to hierarchical topology (est. 40% improvement)
|
|
124
|
+
2. Enable memory caching (est. 25% improvement)
|
|
125
|
+
3. Increase agent concurrency to 8 (est. 20% improvement)
|
|
126
|
+
|
|
127
|
+
✅ Quick Fixes Available
|
|
128
|
+
Run with --fix to apply:
|
|
129
|
+
- Enable smart caching
|
|
130
|
+
- Optimize message routing
|
|
131
|
+
- Adjust agent priorities
|
|
132
|
+
```
|
|
158
133
|
|
|
159
|
-
|
|
134
|
+
### 2. Performance Profiling
|
|
135
|
+
|
|
136
|
+
#### Real-time Detection
|
|
137
|
+
Automatic analysis during task execution:
|
|
138
|
+
- Execution time vs. complexity
|
|
139
|
+
- Agent utilization rates
|
|
140
|
+
- Resource constraints
|
|
141
|
+
- Operation patterns
|
|
142
|
+
|
|
143
|
+
#### Common Bottleneck Patterns
|
|
144
|
+
|
|
145
|
+
**Time Bottlenecks:**
|
|
146
|
+
- Tasks taking > 5 minutes
|
|
147
|
+
- Sequential operations that could parallelize
|
|
148
|
+
- Redundant file operations
|
|
149
|
+
- Inefficient algorithm implementations
|
|
150
|
+
|
|
151
|
+
**Coordination Bottlenecks:**
|
|
152
|
+
- Single agent for complex tasks
|
|
153
|
+
- Unbalanced agent workloads
|
|
154
|
+
- Poor topology selection
|
|
155
|
+
- Excessive synchronization points
|
|
156
|
+
|
|
157
|
+
**Resource Bottlenecks:**
|
|
158
|
+
- High operation count (> 100)
|
|
159
|
+
- Memory constraints
|
|
160
|
+
- I/O limitations
|
|
161
|
+
- Thread pool saturation
|
|
162
|
+
|
|
163
|
+
#### MCP Integration
|
|
164
|
+
```javascript
|
|
165
|
+
// Check for bottlenecks in Claude Code
|
|
166
|
+
mcp__monomind__bottleneck_detect({
|
|
167
|
+
timeRange: "1h",
|
|
168
|
+
threshold: 20,
|
|
169
|
+
autoFix: false
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
// Get detailed task results with bottleneck analysis
|
|
173
|
+
mcp__monomind__task_results({
|
|
174
|
+
taskId: "task-123",
|
|
175
|
+
format: "detailed"
|
|
176
|
+
})
|
|
177
|
+
```
|
|
160
178
|
|
|
161
|
-
|
|
179
|
+
**Result Format:**
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"bottlenecks": [
|
|
183
|
+
{
|
|
184
|
+
"type": "coordination",
|
|
185
|
+
"severity": "high",
|
|
186
|
+
"description": "Single agent used for complex task",
|
|
187
|
+
"recommendation": "Spawn specialized agents for parallel work",
|
|
188
|
+
"impact": "35%",
|
|
189
|
+
"affectedComponents": ["coordinator", "coder-1"]
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"improvements": [
|
|
193
|
+
{
|
|
194
|
+
"area": "execution_time",
|
|
195
|
+
"suggestion": "Use parallel task execution",
|
|
196
|
+
"expectedImprovement": "30-50% time reduction",
|
|
197
|
+
"implementationSteps": [
|
|
198
|
+
"Split task into smaller units",
|
|
199
|
+
"Spawn 3-4 specialized agents",
|
|
200
|
+
"Use mesh topology for coordination"
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"metrics": {
|
|
205
|
+
"avgExecutionTime": "142s",
|
|
206
|
+
"agentUtilization": "67%",
|
|
207
|
+
"cacheHitRate": "82%",
|
|
208
|
+
"parallelizationFactor": 1.2
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
162
212
|
|
|
163
|
-
|
|
213
|
+
### 3. Report Generation
|
|
164
214
|
|
|
215
|
+
#### Command Syntax
|
|
165
216
|
```bash
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
# Re-run the EXACT same baseline commands
|
|
169
|
-
npx monomind@latest performance benchmark -s all -i 100 -o json > after-bench.json
|
|
170
|
-
npx monomind@latest performance metrics -t 24h -f json > after-metrics.json
|
|
171
|
-
npx monomind@latest performance profile -t all -d 60 -o after-profile.json
|
|
172
|
-
|
|
173
|
-
# Diff before vs after. Did the targeted metric move? Did anything else regress?
|
|
217
|
+
npx monomind analysis performance-report [options]
|
|
174
218
|
```
|
|
175
219
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
220
|
+
#### Options
|
|
221
|
+
- `--format <type>` - Report format: json, html, markdown (default: markdown)
|
|
222
|
+
- `--include-metrics` - Include detailed metrics and charts
|
|
223
|
+
- `--compare <id>` - Compare with previous swarm
|
|
224
|
+
- `--time-range <range>` - Analysis period: 1h, 24h, 7d, 30d, all
|
|
225
|
+
- `--output <file>` - Output file path
|
|
226
|
+
- `--sections <list>` - Comma-separated sections to include
|
|
227
|
+
|
|
228
|
+
#### Report Sections
|
|
229
|
+
1. **Executive Summary**
|
|
230
|
+
- Overall performance score
|
|
231
|
+
- Key metrics overview
|
|
232
|
+
- Critical findings
|
|
233
|
+
|
|
234
|
+
2. **Swarm Overview**
|
|
235
|
+
- Topology configuration
|
|
236
|
+
- Agent distribution
|
|
237
|
+
- Task statistics
|
|
238
|
+
|
|
239
|
+
3. **Performance Metrics**
|
|
240
|
+
- Execution times
|
|
241
|
+
- Throughput analysis
|
|
242
|
+
- Resource utilization
|
|
243
|
+
- Latency breakdown
|
|
244
|
+
|
|
245
|
+
4. **Bottleneck Analysis**
|
|
246
|
+
- Identified bottlenecks
|
|
247
|
+
- Impact assessment
|
|
248
|
+
- Optimization priorities
|
|
249
|
+
|
|
250
|
+
5. **Comparative Analysis** (when --compare used)
|
|
251
|
+
- Performance trends
|
|
252
|
+
- Improvement metrics
|
|
253
|
+
- Regression detection
|
|
254
|
+
|
|
255
|
+
6. **Recommendations**
|
|
256
|
+
- Prioritized action items
|
|
257
|
+
- Expected improvements
|
|
258
|
+
- Implementation guidance
|
|
259
|
+
|
|
260
|
+
#### Usage Examples
|
|
192
261
|
```bash
|
|
193
|
-
#
|
|
194
|
-
npx monomind
|
|
195
|
-
|
|
196
|
-
#
|
|
197
|
-
npx monomind
|
|
262
|
+
# Generate HTML report with all metrics
|
|
263
|
+
npx monomind analysis performance-report --format html --include-metrics
|
|
264
|
+
|
|
265
|
+
# Compare current swarm with previous
|
|
266
|
+
npx monomind analysis performance-report --compare swarm-123 --format markdown
|
|
267
|
+
|
|
268
|
+
# Custom output with specific sections
|
|
269
|
+
npx monomind analysis performance-report \
|
|
270
|
+
--sections summary,metrics,recommendations \
|
|
271
|
+
--output reports/perf-analysis.html \
|
|
272
|
+
--format html
|
|
273
|
+
|
|
274
|
+
# Weekly performance report
|
|
275
|
+
npx monomind analysis performance-report \
|
|
276
|
+
--time-range 7d \
|
|
277
|
+
--include-metrics \
|
|
278
|
+
--format markdown \
|
|
279
|
+
--output docs/weekly-performance.md
|
|
280
|
+
|
|
281
|
+
# JSON format for CI/CD integration
|
|
282
|
+
npx monomind analysis performance-report \
|
|
283
|
+
--format json \
|
|
284
|
+
--output build/performance.json
|
|
285
|
+
```
|
|
198
286
|
|
|
199
|
-
|
|
200
|
-
|
|
287
|
+
#### Sample Markdown Report
|
|
288
|
+
```markdown
|
|
289
|
+
# Performance Analysis Report
|
|
290
|
+
|
|
291
|
+
## Executive Summary
|
|
292
|
+
- **Overall Score**: 87/100
|
|
293
|
+
- **Analysis Period**: Last 24 hours
|
|
294
|
+
- **Swarms Analyzed**: 3
|
|
295
|
+
- **Critical Issues**: 1
|
|
296
|
+
|
|
297
|
+
## Key Metrics
|
|
298
|
+
| Metric | Value | Trend | Target |
|
|
299
|
+
|--------|-------|-------|--------|
|
|
300
|
+
| Avg Task Time | 42s | ↓ 12% | 35s |
|
|
301
|
+
| Agent Utilization | 78% | ↑ 5% | 85% |
|
|
302
|
+
| Cache Hit Rate | 91% | → | 90% |
|
|
303
|
+
| Parallel Efficiency | 2.3x | ↑ 0.4x | 2.5x |
|
|
304
|
+
|
|
305
|
+
## Bottleneck Analysis
|
|
306
|
+
### Critical
|
|
307
|
+
1. **Agent Communication Delay** (Impact: 35%)
|
|
308
|
+
- Coordinator → Coder messages delayed by 2.3s avg
|
|
309
|
+
- **Fix**: Switch to hierarchical topology
|
|
310
|
+
|
|
311
|
+
### Warnings
|
|
312
|
+
1. **Memory Access Pattern** (Impact: 18%)
|
|
313
|
+
- Neural pattern loading: 1.8s per access
|
|
314
|
+
- **Fix**: Enable memory caching
|
|
315
|
+
|
|
316
|
+
## Recommendations
|
|
317
|
+
1. **High Priority**: Switch to hierarchical topology (40% improvement)
|
|
318
|
+
2. **Medium Priority**: Enable memory caching (25% improvement)
|
|
319
|
+
3. **Low Priority**: Increase agent concurrency to 8 (20% improvement)
|
|
201
320
|
```
|
|
202
321
|
|
|
203
|
-
|
|
322
|
+
### 4. Optimization Recommendations
|
|
323
|
+
|
|
324
|
+
#### Automatic Fixes
|
|
325
|
+
When using `--fix`, the following optimizations may be applied:
|
|
326
|
+
|
|
327
|
+
**1. Topology Optimization**
|
|
328
|
+
- Switch to more efficient topology (mesh → hierarchical)
|
|
329
|
+
- Adjust communication patterns
|
|
330
|
+
- Reduce coordination overhead
|
|
331
|
+
- Optimize message routing
|
|
332
|
+
|
|
333
|
+
**2. Caching Enhancement**
|
|
334
|
+
- Enable memory caching
|
|
335
|
+
- Optimize cache strategies
|
|
336
|
+
- Preload common patterns
|
|
337
|
+
- Implement cache warming
|
|
338
|
+
|
|
339
|
+
**3. Concurrency Tuning**
|
|
340
|
+
- Adjust agent counts
|
|
341
|
+
- Optimize parallel execution
|
|
342
|
+
- Balance workload distribution
|
|
343
|
+
- Implement load balancing
|
|
344
|
+
|
|
345
|
+
**4. Priority Adjustment**
|
|
346
|
+
- Reorder task queues
|
|
347
|
+
- Prioritize critical paths
|
|
348
|
+
- Reduce wait times
|
|
349
|
+
- Implement fair scheduling
|
|
350
|
+
|
|
351
|
+
**5. Resource Optimization**
|
|
352
|
+
- Optimize memory usage
|
|
353
|
+
- Reduce I/O operations
|
|
354
|
+
- Batch API calls
|
|
355
|
+
- Implement connection pooling
|
|
356
|
+
|
|
357
|
+
#### Performance Impact
|
|
358
|
+
Typical improvements after bottleneck resolution:
|
|
359
|
+
|
|
360
|
+
- **Communication**: 30-50% faster message delivery
|
|
361
|
+
- **Processing**: 20-40% reduced task completion time
|
|
362
|
+
- **Memory**: 40-60% fewer cache misses
|
|
363
|
+
- **Network**: 25-45% reduced API latency
|
|
364
|
+
- **Overall**: 25-45% total performance improvement
|
|
365
|
+
|
|
366
|
+
## Advanced Usage
|
|
367
|
+
|
|
368
|
+
### Continuous Monitoring
|
|
369
|
+
```bash
|
|
370
|
+
# Monitor performance in real-time
|
|
371
|
+
npx monomind swarm monitor --interval 5
|
|
372
|
+
|
|
373
|
+
# Generate hourly reports
|
|
374
|
+
while true; do
|
|
375
|
+
npx monomind analysis performance-report \
|
|
376
|
+
--format json \
|
|
377
|
+
--output logs/perf-$(date +%Y%m%d-%H%M).json
|
|
378
|
+
sleep 3600
|
|
379
|
+
done
|
|
380
|
+
```
|
|
204
381
|
|
|
382
|
+
### CI/CD Integration
|
|
205
383
|
```yaml
|
|
206
|
-
|
|
207
|
-
|
|
384
|
+
# .github/workflows/performance.yml
|
|
385
|
+
name: Performance Analysis
|
|
386
|
+
on: [push, pull_request]
|
|
387
|
+
|
|
208
388
|
jobs:
|
|
209
|
-
|
|
389
|
+
analyze:
|
|
210
390
|
runs-on: ubuntu-latest
|
|
211
391
|
steps:
|
|
212
|
-
- uses: actions/checkout@
|
|
213
|
-
- name:
|
|
214
|
-
run:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
392
|
+
- uses: actions/checkout@v2
|
|
393
|
+
- name: Run Performance Analysis
|
|
394
|
+
run: |
|
|
395
|
+
npx monomind analysis performance-report \
|
|
396
|
+
--format json \
|
|
397
|
+
--output performance.json
|
|
398
|
+
- name: Check Performance Thresholds
|
|
399
|
+
run: |
|
|
400
|
+
npx monomind bottleneck detect \
|
|
401
|
+
--threshold 15 \
|
|
402
|
+
--export bottlenecks.json
|
|
403
|
+
- name: Upload Reports
|
|
404
|
+
uses: actions/upload-artifact@v2
|
|
218
405
|
with:
|
|
219
|
-
name:
|
|
406
|
+
name: performance-reports
|
|
220
407
|
path: |
|
|
221
|
-
|
|
222
|
-
|
|
408
|
+
performance.json
|
|
409
|
+
bottlenecks.json
|
|
223
410
|
```
|
|
224
411
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
412
|
+
### Custom Analysis Scripts
|
|
413
|
+
```javascript
|
|
414
|
+
// scripts/analyze-performance.js
|
|
415
|
+
const { exec } = require('child_process');
|
|
416
|
+
const fs = require('fs');
|
|
417
|
+
|
|
418
|
+
async function analyzePerformance() {
|
|
419
|
+
// Run bottleneck detection
|
|
420
|
+
const bottlenecks = await runCommand(
|
|
421
|
+
'npx monomind bottleneck detect --format json'
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
// Generate performance report
|
|
425
|
+
const report = await runCommand(
|
|
426
|
+
'npx monomind analysis performance-report --format json'
|
|
427
|
+
);
|
|
428
|
+
|
|
429
|
+
// Analyze results
|
|
430
|
+
const analysis = {
|
|
431
|
+
bottlenecks: JSON.parse(bottlenecks),
|
|
432
|
+
performance: JSON.parse(report),
|
|
433
|
+
timestamp: new Date().toISOString()
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
// Save combined analysis
|
|
437
|
+
fs.writeFileSync(
|
|
438
|
+
'analysis/combined-report.json',
|
|
439
|
+
JSON.stringify(analysis, null, 2)
|
|
440
|
+
);
|
|
441
|
+
|
|
442
|
+
// Generate alerts if needed
|
|
443
|
+
if (analysis.bottlenecks.critical.length > 0) {
|
|
444
|
+
console.error('CRITICAL: Performance bottlenecks detected!');
|
|
445
|
+
process.exit(1);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function runCommand(cmd) {
|
|
450
|
+
return new Promise((resolve, reject) => {
|
|
451
|
+
exec(cmd, (error, stdout, stderr) => {
|
|
452
|
+
if (error) reject(error);
|
|
453
|
+
else resolve(stdout);
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
analyzePerformance().catch(console.error);
|
|
459
|
+
```
|
|
228
460
|
|
|
229
|
-
|
|
461
|
+
## Best Practices
|
|
230
462
|
|
|
231
|
-
|
|
463
|
+
### 1. Regular Analysis
|
|
464
|
+
- Run bottleneck detection after major changes
|
|
465
|
+
- Generate weekly performance reports
|
|
466
|
+
- Monitor trends over time
|
|
467
|
+
- Set up automated alerts
|
|
232
468
|
|
|
233
|
-
|
|
469
|
+
### 2. Threshold Tuning
|
|
470
|
+
- Start with default threshold (20%)
|
|
471
|
+
- Lower for production systems (10-15%)
|
|
472
|
+
- Higher for development (25-30%)
|
|
473
|
+
- Adjust based on requirements
|
|
234
474
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
| io | Batch file reads; lazy-load graphs; check for sync I/O on hot path |
|
|
241
|
-
| search | Rebuild monograph; verify BM25 index is current |
|
|
242
|
-
| coordination | Lower `maxAgents` if utilization is low; raise it if queue is deep |
|
|
475
|
+
### 3. Fix Strategy
|
|
476
|
+
- Always review before applying --fix
|
|
477
|
+
- Test fixes in development first
|
|
478
|
+
- Apply fixes incrementally
|
|
479
|
+
- Monitor impact after changes
|
|
243
480
|
|
|
244
|
-
|
|
245
|
-
|
|
481
|
+
### 4. Report Integration
|
|
482
|
+
- Include in documentation
|
|
483
|
+
- Share with team regularly
|
|
484
|
+
- Track improvements over time
|
|
485
|
+
- Use for capacity planning
|
|
246
486
|
|
|
247
|
-
|
|
487
|
+
### 5. Continuous Optimization
|
|
488
|
+
- Learn from each analysis
|
|
489
|
+
- Build performance budgets
|
|
490
|
+
- Establish baselines
|
|
491
|
+
- Set improvement goals
|
|
248
492
|
|
|
249
|
-
##
|
|
493
|
+
## Troubleshooting
|
|
250
494
|
|
|
495
|
+
### Common Issues
|
|
496
|
+
|
|
497
|
+
**High Memory Usage**
|
|
251
498
|
```bash
|
|
252
|
-
#
|
|
253
|
-
npx monomind
|
|
499
|
+
# Analyze memory bottlenecks
|
|
500
|
+
npx monomind bottleneck detect --threshold 10
|
|
254
501
|
|
|
255
|
-
#
|
|
256
|
-
npx monomind
|
|
502
|
+
# Check cache performance
|
|
503
|
+
npx monomind cache manage --action stats
|
|
257
504
|
|
|
258
|
-
#
|
|
259
|
-
npx monomind
|
|
505
|
+
# Review memory metrics
|
|
506
|
+
npx monomind memory usage
|
|
260
507
|
```
|
|
261
508
|
|
|
262
|
-
|
|
263
|
-
|
|
509
|
+
**Slow Task Execution**
|
|
510
|
+
```bash
|
|
511
|
+
# Identify slow tasks
|
|
512
|
+
npx monomind task status --detailed
|
|
513
|
+
|
|
514
|
+
# Analyze coordination overhead
|
|
515
|
+
npx monomind bottleneck detect --time-range 1h
|
|
264
516
|
|
|
265
|
-
|
|
517
|
+
# Check agent utilization
|
|
518
|
+
npx monomind agent metrics
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
**Poor Cache Performance**
|
|
522
|
+
```bash
|
|
523
|
+
# Analyze cache hit rates
|
|
524
|
+
npx monomind analysis performance-report --sections metrics
|
|
266
525
|
|
|
267
|
-
|
|
526
|
+
# Review cache strategy
|
|
527
|
+
npx monomind cache manage --action analyze
|
|
268
528
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
| "I'll add a cache, that always helps" | Cache without a measured miss rate is bloat. |
|
|
273
|
-
| "Let me try a few optimizations together" | Can't isolate what worked. One change. |
|
|
274
|
-
| "Benchmark improved so we're done" | Did anything else regress? Check, don't assume. |
|
|
275
|
-
| "It feels faster now" | Feeling is not measurement. Re-run baseline. |
|
|
276
|
-
| 3+ fixes applied, no movement | Architectural problem. Stop, discuss design. |
|
|
529
|
+
# Enable cache warming
|
|
530
|
+
npx monomind bottleneck detect --fix
|
|
531
|
+
```
|
|
277
532
|
|
|
278
533
|
## Integration with Other Skills
|
|
279
534
|
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
535
|
+
- **swarm-orchestration**: Use performance data to optimize topology
|
|
536
|
+
- **memory-management**: Improve cache strategies based on analysis
|
|
537
|
+
- **task-coordination**: Adjust scheduling based on bottlenecks
|
|
538
|
+
- **neural-training**: Train patterns from performance data
|
|
284
539
|
|
|
285
|
-
##
|
|
540
|
+
## Related Commands
|
|
286
541
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
| 3. Interpret | `performance metrics`, `tokens dashboard` | Metric tied to a symptom |
|
|
293
|
-
| 4. Fix + re-measure | same baseline commands | Target moved, nothing regressed |
|
|
542
|
+
- `npx monomind swarm monitor` - Real-time monitoring
|
|
543
|
+
- `npx monomind token usage` - Token optimization analysis
|
|
544
|
+
- `npx monomind cache manage` - Cache optimization
|
|
545
|
+
- `npx monomind agent metrics` - Agent performance metrics
|
|
546
|
+
- `npx monomind task status` - Task execution analysis
|
|
294
547
|
|
|
295
548
|
## See Also
|
|
296
549
|
|
|
297
|
-
- [
|
|
298
|
-
- [
|
|
299
|
-
- [
|
|
550
|
+
- [Bottleneck Detection Guide](https://github.com/monoes/monomind/wiki/bottleneck-detect)
|
|
551
|
+
- [Performance Report Guide](https://github.com/monoes/monomind/wiki/performance-report)
|
|
552
|
+
- [Performance Bottlenecks Overview](https://github.com/monoes/monomind/wiki/performance-bottlenecks)
|
|
553
|
+
- [Swarm Monitoring Documentation](../swarm-orchestration/SKILL.md)
|
|
554
|
+
- [Memory Management Documentation](../memory-management/SKILL.md)
|
|
300
555
|
|
|
301
556
|
---
|
|
302
557
|
|
|
303
|
-
**Version**:
|
|
304
|
-
**Last Updated**:
|
|
558
|
+
**Version**: 1.0.0
|
|
559
|
+
**Last Updated**: 2025-10-19
|
|
560
|
+
**Maintainer**: Monomind Team
|