agentic-flow 2.0.1-alpha.40 → 2.0.1-alpha.42
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/settings.json +133 -9
- package/.claude/skills/worker-benchmarks/skill.md +135 -0
- package/.claude/skills/worker-integration/skill.md +154 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/commands/workers.d.ts.map +1 -1
- package/dist/cli/commands/workers.js +224 -0
- package/dist/cli/commands/workers.js.map +1 -1
- package/dist/workers/index.d.ts +5 -0
- package/dist/workers/index.d.ts.map +1 -1
- package/dist/workers/index.js +8 -0
- package/dist/workers/index.js.map +1 -1
- package/dist/workers/ruvector-native-integration.d.ts +92 -0
- package/dist/workers/ruvector-native-integration.d.ts.map +1 -0
- package/dist/workers/ruvector-native-integration.js +530 -0
- package/dist/workers/ruvector-native-integration.js.map +1 -0
- package/dist/workers/worker-agent-integration.d.ts +140 -0
- package/dist/workers/worker-agent-integration.d.ts.map +1 -0
- package/dist/workers/worker-agent-integration.js +471 -0
- package/dist/workers/worker-agent-integration.js.map +1 -0
- package/dist/workers/worker-benchmarks.d.ts +88 -0
- package/dist/workers/worker-benchmarks.d.ts.map +1 -0
- package/dist/workers/worker-benchmarks.js +451 -0
- package/dist/workers/worker-benchmarks.js.map +1 -0
- package/package.json +2 -2
- package/wasm/reasoningbank/reasoningbank_wasm_bg.js +2 -2
- package/wasm/reasoningbank/reasoningbank_wasm_bg.wasm +0 -0
package/.claude/settings.json
CHANGED
|
@@ -5,14 +5,125 @@
|
|
|
5
5
|
"CLAUDE_FLOW_HOOKS_ENABLED": "true",
|
|
6
6
|
"CLAUDE_FLOW_TELEMETRY_ENABLED": "true",
|
|
7
7
|
"CLAUDE_FLOW_REMOTE_EXECUTION": "true",
|
|
8
|
-
"CLAUDE_FLOW_CHECKPOINTS_ENABLED": "true"
|
|
8
|
+
"CLAUDE_FLOW_CHECKPOINTS_ENABLED": "true",
|
|
9
|
+
"CLAUDE_FLOW_WORKERS_ENABLED": "true",
|
|
10
|
+
"CLAUDE_FLOW_WORKER_PARALLEL": "true",
|
|
11
|
+
"CLAUDE_FLOW_MODEL_CACHE_MB": "512",
|
|
12
|
+
"CLAUDE_FLOW_SUPPRESS_WARNINGS": "true"
|
|
13
|
+
},
|
|
14
|
+
"workers": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"parallel": true,
|
|
17
|
+
"maxConcurrent": 10,
|
|
18
|
+
"maxPerTrigger": 3,
|
|
19
|
+
"defaultTimeout": 300000,
|
|
20
|
+
"memoryDepositEnabled": true,
|
|
21
|
+
"progressEventsEnabled": true,
|
|
22
|
+
"triggers": {
|
|
23
|
+
"ultralearn": { "priority": "high", "timeout": 300000, "maxAgents": 5 },
|
|
24
|
+
"optimize": { "priority": "medium", "timeout": 180000, "maxAgents": 2 },
|
|
25
|
+
"consolidate": { "priority": "low", "timeout": 120000, "maxAgents": 1 },
|
|
26
|
+
"predict": { "priority": "medium", "timeout": 60000, "maxAgents": 2 },
|
|
27
|
+
"audit": { "priority": "high", "timeout": 300000, "maxAgents": 3 },
|
|
28
|
+
"map": { "priority": "medium", "timeout": 240000, "maxAgents": 2 },
|
|
29
|
+
"preload": { "priority": "low", "timeout": 30000, "maxAgents": 1 },
|
|
30
|
+
"deepdive": { "priority": "high", "timeout": 600000, "maxAgents": 4 },
|
|
31
|
+
"document": { "priority": "low", "timeout": 180000, "maxAgents": 2 },
|
|
32
|
+
"refactor": { "priority": "medium", "timeout": 120000, "maxAgents": 2 },
|
|
33
|
+
"benchmark": { "priority": "medium", "timeout": 180000, "maxAgents": 2 },
|
|
34
|
+
"testgaps": { "priority": "medium", "timeout": 120000, "maxAgents": 2 }
|
|
35
|
+
},
|
|
36
|
+
"agentMappings": {
|
|
37
|
+
"ultralearn": ["researcher", "coder"],
|
|
38
|
+
"optimize": ["performance-analyzer", "coder"],
|
|
39
|
+
"audit": ["security-analyst", "tester"],
|
|
40
|
+
"benchmark": ["performance-analyzer"],
|
|
41
|
+
"testgaps": ["tester"],
|
|
42
|
+
"document": ["documenter", "researcher"],
|
|
43
|
+
"deepdive": ["researcher", "security-analyst"],
|
|
44
|
+
"refactor": ["coder", "reviewer"],
|
|
45
|
+
"map": ["researcher"],
|
|
46
|
+
"preload": ["researcher"],
|
|
47
|
+
"predict": ["performance-analyzer"],
|
|
48
|
+
"consolidate": ["researcher"]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"performance": {
|
|
52
|
+
"modelCache": {
|
|
53
|
+
"enabled": true,
|
|
54
|
+
"maxSizeMB": 512,
|
|
55
|
+
"evictionPolicy": "lru"
|
|
56
|
+
},
|
|
57
|
+
"benchmarkThresholds": {
|
|
58
|
+
"triggerDetection": { "p95Ms": 5 },
|
|
59
|
+
"workerRegistry": { "p95Ms": 10 },
|
|
60
|
+
"agentSelection": { "p95Ms": 1 },
|
|
61
|
+
"memoryKeyGeneration": { "p95Ms": 0.1 },
|
|
62
|
+
"concurrentWorkers": { "totalMs": 1000 }
|
|
63
|
+
},
|
|
64
|
+
"optimizations": {
|
|
65
|
+
"parallelDispatch": true,
|
|
66
|
+
"batchMemoryWrites": true,
|
|
67
|
+
"cacheEmbeddings": true,
|
|
68
|
+
"suppressWarnings": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"agents": {
|
|
72
|
+
"presets": {
|
|
73
|
+
"quick-scan": {
|
|
74
|
+
"phases": ["file-discovery", "pattern-discovery", "summarization"],
|
|
75
|
+
"timeout": 60000,
|
|
76
|
+
"priority": "low"
|
|
77
|
+
},
|
|
78
|
+
"deep-analysis": {
|
|
79
|
+
"phases": ["file-discovery", "static-analysis", "complexity-analysis", "pattern-extraction", "summarization"],
|
|
80
|
+
"timeout": 300000,
|
|
81
|
+
"priority": "high"
|
|
82
|
+
},
|
|
83
|
+
"security-scan": {
|
|
84
|
+
"phases": ["file-discovery", "security-analysis", "secret-detection", "summarization"],
|
|
85
|
+
"timeout": 180000,
|
|
86
|
+
"priority": "critical"
|
|
87
|
+
},
|
|
88
|
+
"learning": {
|
|
89
|
+
"phases": ["file-discovery", "pattern-extraction", "vectorization", "sona-training", "pattern-storage"],
|
|
90
|
+
"timeout": 300000,
|
|
91
|
+
"priority": "medium"
|
|
92
|
+
},
|
|
93
|
+
"api-docs": {
|
|
94
|
+
"phases": ["api-discovery", "pattern-extraction", "report-generation", "indexing"],
|
|
95
|
+
"timeout": 180000,
|
|
96
|
+
"priority": "low"
|
|
97
|
+
},
|
|
98
|
+
"test-analysis": {
|
|
99
|
+
"phases": ["file-discovery", "pattern-discovery", "coverage-analysis", "summarization"],
|
|
100
|
+
"timeout": 120000,
|
|
101
|
+
"priority": "medium"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"capabilities": {
|
|
105
|
+
"default": {
|
|
106
|
+
"onnxEmbeddings": true,
|
|
107
|
+
"vectorDb": true,
|
|
108
|
+
"sonaLearning": true,
|
|
109
|
+
"reasoningBank": true,
|
|
110
|
+
"intelligenceStore": true,
|
|
111
|
+
"progressEvents": true,
|
|
112
|
+
"memoryDeposits": true,
|
|
113
|
+
"persistResults": true
|
|
114
|
+
}
|
|
115
|
+
}
|
|
9
116
|
},
|
|
10
117
|
"permissions": {
|
|
11
118
|
"allow": [
|
|
12
119
|
"Bash(npx claude-flow *)",
|
|
120
|
+
"Bash(npx agentic-flow *)",
|
|
13
121
|
"Bash(npm run lint)",
|
|
14
122
|
"Bash(npm run test:*)",
|
|
15
123
|
"Bash(npm test *)",
|
|
124
|
+
"Bash(npm run build)",
|
|
125
|
+
"Bash(npm run benchmark)",
|
|
126
|
+
"Bash(npm run workers *)",
|
|
16
127
|
"Bash(git status)",
|
|
17
128
|
"Bash(git diff *)",
|
|
18
129
|
"Bash(git log *)",
|
|
@@ -28,7 +139,10 @@
|
|
|
28
139
|
"Bash(node *)",
|
|
29
140
|
"Bash(which *)",
|
|
30
141
|
"Bash(pwd)",
|
|
31
|
-
"Bash(ls *)"
|
|
142
|
+
"Bash(ls *)",
|
|
143
|
+
"mcp__ruv-swarm",
|
|
144
|
+
"mcp__claude-flow@alpha",
|
|
145
|
+
"mcp__flow-nexus"
|
|
32
146
|
],
|
|
33
147
|
"deny": [
|
|
34
148
|
"Bash(rm -rf /)",
|
|
@@ -38,13 +152,23 @@
|
|
|
38
152
|
]
|
|
39
153
|
},
|
|
40
154
|
"hooks": {
|
|
155
|
+
"UserPromptSubmit": [
|
|
156
|
+
{
|
|
157
|
+
"hooks": [
|
|
158
|
+
{
|
|
159
|
+
"type": "command",
|
|
160
|
+
"command": "cat | jq -r '.user_prompt // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha workers dispatch --prompt '{}' --parallel true 2>/dev/null || true"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
],
|
|
41
165
|
"PreToolUse": [
|
|
42
166
|
{
|
|
43
167
|
"matcher": "Bash",
|
|
44
168
|
"hooks": [
|
|
45
169
|
{
|
|
46
170
|
"type": "command",
|
|
47
|
-
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true"
|
|
171
|
+
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true 2>/dev/null || true"
|
|
48
172
|
}
|
|
49
173
|
]
|
|
50
174
|
},
|
|
@@ -53,7 +177,7 @@
|
|
|
53
177
|
"hooks": [
|
|
54
178
|
{
|
|
55
179
|
"type": "command",
|
|
56
|
-
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true"
|
|
180
|
+
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true 2>/dev/null || true"
|
|
57
181
|
}
|
|
58
182
|
]
|
|
59
183
|
}
|
|
@@ -64,7 +188,7 @@
|
|
|
64
188
|
"hooks": [
|
|
65
189
|
{
|
|
66
190
|
"type": "command",
|
|
67
|
-
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-command --command '{}' --track-metrics true --store-results true"
|
|
191
|
+
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-command --command '{}' --track-metrics true --store-results true 2>/dev/null || true"
|
|
68
192
|
}
|
|
69
193
|
]
|
|
70
194
|
},
|
|
@@ -73,7 +197,7 @@
|
|
|
73
197
|
"hooks": [
|
|
74
198
|
{
|
|
75
199
|
"type": "command",
|
|
76
|
-
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-edit --file '{}' --format true --update-memory true"
|
|
200
|
+
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-edit --file '{}' --format true --update-memory true 2>/dev/null || true"
|
|
77
201
|
}
|
|
78
202
|
]
|
|
79
203
|
}
|
|
@@ -84,7 +208,7 @@
|
|
|
84
208
|
"hooks": [
|
|
85
209
|
{
|
|
86
210
|
"type": "command",
|
|
87
|
-
"command": "/bin/bash -c '
|
|
211
|
+
"command": "/bin/bash -c 'echo \"🔄 PreCompact: Check CLAUDE.md for 54 agents, swarm patterns, SPARC workflows\"; echo \"✅ Ready for compact\"'"
|
|
88
212
|
}
|
|
89
213
|
]
|
|
90
214
|
},
|
|
@@ -93,7 +217,7 @@
|
|
|
93
217
|
"hooks": [
|
|
94
218
|
{
|
|
95
219
|
"type": "command",
|
|
96
|
-
"command": "/bin/bash -c 'echo \"🔄 Auto-Compact
|
|
220
|
+
"command": "/bin/bash -c 'echo \"🔄 Auto-Compact: Preserving agent/worker context\"; echo \"✅ Auto-compact proceeding\"'"
|
|
97
221
|
}
|
|
98
222
|
]
|
|
99
223
|
}
|
|
@@ -103,7 +227,7 @@
|
|
|
103
227
|
"hooks": [
|
|
104
228
|
{
|
|
105
229
|
"type": "command",
|
|
106
|
-
"command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true"
|
|
230
|
+
"command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true 2>/dev/null || true"
|
|
107
231
|
}
|
|
108
232
|
]
|
|
109
233
|
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: worker-benchmarks
|
|
3
|
+
description: Run comprehensive worker system benchmarks and performance analysis
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
invocable: true
|
|
6
|
+
author: agentic-flow
|
|
7
|
+
capabilities:
|
|
8
|
+
- performance_testing
|
|
9
|
+
- metrics_collection
|
|
10
|
+
- optimization_recommendations
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Worker Benchmarks Skill
|
|
14
|
+
|
|
15
|
+
Run comprehensive performance benchmarks for the agentic-flow worker system.
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Run full benchmark suite
|
|
21
|
+
npx agentic-flow workers benchmark
|
|
22
|
+
|
|
23
|
+
# Run specific benchmark
|
|
24
|
+
npx agentic-flow workers benchmark --type trigger-detection
|
|
25
|
+
npx agentic-flow workers benchmark --type registry
|
|
26
|
+
npx agentic-flow workers benchmark --type agent-selection
|
|
27
|
+
npx agentic-flow workers benchmark --type concurrent
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Benchmark Types
|
|
31
|
+
|
|
32
|
+
### 1. Trigger Detection (`trigger-detection`)
|
|
33
|
+
Tests keyword detection speed across 12 worker triggers.
|
|
34
|
+
- **Target**: p95 < 5ms
|
|
35
|
+
- **Iterations**: 1000
|
|
36
|
+
- **Metrics**: latency, throughput, histogram
|
|
37
|
+
|
|
38
|
+
### 2. Worker Registry (`registry`)
|
|
39
|
+
Tests CRUD operations on worker entries.
|
|
40
|
+
- **Target**: p95 < 10ms
|
|
41
|
+
- **Iterations**: 500 creates, gets, updates
|
|
42
|
+
- **Metrics**: per-operation latency breakdown
|
|
43
|
+
|
|
44
|
+
### 3. Agent Selection (`agent-selection`)
|
|
45
|
+
Tests performance-based agent selection.
|
|
46
|
+
- **Target**: p95 < 1ms
|
|
47
|
+
- **Iterations**: 1000
|
|
48
|
+
- **Metrics**: selection confidence, agent scores
|
|
49
|
+
|
|
50
|
+
### 4. Model Cache (`cache`)
|
|
51
|
+
Tests model caching performance.
|
|
52
|
+
- **Target**: p95 < 0.5ms
|
|
53
|
+
- **Metrics**: hit rate, cache size, eviction stats
|
|
54
|
+
|
|
55
|
+
### 5. Concurrent Workers (`concurrent`)
|
|
56
|
+
Tests parallel worker creation and updates.
|
|
57
|
+
- **Target**: < 1000ms for 10 workers
|
|
58
|
+
- **Metrics**: per-worker latency, memory usage
|
|
59
|
+
|
|
60
|
+
### 6. Memory Key Generation (`memory-keys`)
|
|
61
|
+
Tests memory pattern key generation.
|
|
62
|
+
- **Target**: p95 < 0.1ms
|
|
63
|
+
- **Iterations**: 5000
|
|
64
|
+
- **Metrics**: unique patterns, throughput
|
|
65
|
+
|
|
66
|
+
## Output Format
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
═══════════════════════════════════════════════════════════
|
|
70
|
+
📈 BENCHMARK RESULTS
|
|
71
|
+
═══════════════════════════════════════════════════════════
|
|
72
|
+
|
|
73
|
+
✅ Trigger Detection
|
|
74
|
+
Operation: detect
|
|
75
|
+
Count: 1,000
|
|
76
|
+
Avg: 0.045ms | p95: 0.120ms (target: 5ms)
|
|
77
|
+
Throughput: 22,222 ops/s
|
|
78
|
+
Memory Δ: 0.12MB
|
|
79
|
+
|
|
80
|
+
✅ Worker Registry
|
|
81
|
+
Operation: crud
|
|
82
|
+
Count: 1,500
|
|
83
|
+
Avg: 1.234ms | p95: 3.456ms (target: 10ms)
|
|
84
|
+
Throughput: 810 ops/s
|
|
85
|
+
Memory Δ: 2.34MB
|
|
86
|
+
|
|
87
|
+
───────────────────────────────────────────────────────────
|
|
88
|
+
📊 SUMMARY
|
|
89
|
+
───────────────────────────────────────────────────────────
|
|
90
|
+
Total Tests: 6
|
|
91
|
+
Passed: 6 | Failed: 0
|
|
92
|
+
Avg Latency: 0.567ms
|
|
93
|
+
Total Duration: 2345ms
|
|
94
|
+
Peak Memory: 8.90MB
|
|
95
|
+
═══════════════════════════════════════════════════════════
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Integration with Settings
|
|
99
|
+
|
|
100
|
+
Benchmark thresholds are configured in `.claude/settings.json`:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"performance": {
|
|
105
|
+
"benchmarkThresholds": {
|
|
106
|
+
"triggerDetection": { "p95Ms": 5 },
|
|
107
|
+
"workerRegistry": { "p95Ms": 10 },
|
|
108
|
+
"agentSelection": { "p95Ms": 1 },
|
|
109
|
+
"memoryKeyGeneration": { "p95Ms": 0.1 },
|
|
110
|
+
"concurrentWorkers": { "totalMs": 1000 }
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Programmatic Usage
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { workerBenchmarks, runBenchmarks } from 'agentic-flow/workers/worker-benchmarks';
|
|
120
|
+
|
|
121
|
+
// Run full suite
|
|
122
|
+
const suite = await runBenchmarks();
|
|
123
|
+
console.log(suite.summary);
|
|
124
|
+
|
|
125
|
+
// Run individual benchmarks
|
|
126
|
+
const triggerResult = await workerBenchmarks.benchmarkTriggerDetection(1000);
|
|
127
|
+
const registryResult = await workerBenchmarks.benchmarkRegistryOperations(500);
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Performance Optimization Tips
|
|
131
|
+
|
|
132
|
+
1. **Model Cache**: Enable with `CLAUDE_FLOW_MODEL_CACHE_MB=512`
|
|
133
|
+
2. **Parallel Workers**: Enable with `CLAUDE_FLOW_WORKER_PARALLEL=true`
|
|
134
|
+
3. **Warning Suppression**: Enable with `CLAUDE_FLOW_SUPPRESS_WARNINGS=true`
|
|
135
|
+
4. **SQLite WAL Mode**: Automatic for better concurrent performance
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: worker-integration
|
|
3
|
+
description: Worker-Agent integration for intelligent task dispatch and performance tracking
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
invocable: true
|
|
6
|
+
author: agentic-flow
|
|
7
|
+
capabilities:
|
|
8
|
+
- agent_selection
|
|
9
|
+
- performance_tracking
|
|
10
|
+
- memory_coordination
|
|
11
|
+
- self_learning
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Worker-Agent Integration Skill
|
|
15
|
+
|
|
16
|
+
Intelligent coordination between background workers and specialized agents.
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# View agent recommendations for a trigger
|
|
22
|
+
npx agentic-flow workers agents ultralearn
|
|
23
|
+
npx agentic-flow workers agents optimize
|
|
24
|
+
|
|
25
|
+
# View performance metrics
|
|
26
|
+
npx agentic-flow workers metrics
|
|
27
|
+
|
|
28
|
+
# View integration stats
|
|
29
|
+
npx agentic-flow workers stats --integration
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Agent Mappings
|
|
33
|
+
|
|
34
|
+
Workers automatically dispatch to optimal agents based on trigger type:
|
|
35
|
+
|
|
36
|
+
| Trigger | Primary Agents | Fallback | Pipeline Phases |
|
|
37
|
+
|---------|---------------|----------|-----------------|
|
|
38
|
+
| `ultralearn` | researcher, coder | planner | discovery → patterns → vectorization → summary |
|
|
39
|
+
| `optimize` | performance-analyzer, coder | researcher | static-analysis → performance → patterns |
|
|
40
|
+
| `audit` | security-analyst, tester | reviewer | security → secrets → vulnerability-scan |
|
|
41
|
+
| `benchmark` | performance-analyzer | coder, tester | performance → metrics → report |
|
|
42
|
+
| `testgaps` | tester | coder | discovery → coverage → gaps |
|
|
43
|
+
| `document` | documenter, researcher | coder | api-discovery → patterns → indexing |
|
|
44
|
+
| `deepdive` | researcher, security-analyst | coder | call-graph → deps → trace |
|
|
45
|
+
| `refactor` | coder, reviewer | researcher | complexity → smells → patterns |
|
|
46
|
+
|
|
47
|
+
## Performance-Based Selection
|
|
48
|
+
|
|
49
|
+
The system learns from execution history to improve agent selection:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// Agent selection considers:
|
|
53
|
+
// 1. Quality score (0-1)
|
|
54
|
+
// 2. Success rate
|
|
55
|
+
// 3. Average latency
|
|
56
|
+
// 4. Execution count
|
|
57
|
+
|
|
58
|
+
const { agent, confidence, reasoning } = selectBestAgent('optimize');
|
|
59
|
+
// agent: "performance-analyzer"
|
|
60
|
+
// confidence: 0.87
|
|
61
|
+
// reasoning: "Selected based on 45 executions with 94.2% success"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Memory Key Patterns
|
|
65
|
+
|
|
66
|
+
Workers store results using consistent patterns:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
{trigger}/{topic}/{phase}
|
|
70
|
+
|
|
71
|
+
Examples:
|
|
72
|
+
- ultralearn/auth-module/analysis
|
|
73
|
+
- optimize/database/performance
|
|
74
|
+
- audit/payment/vulnerabilities
|
|
75
|
+
- benchmark/api/metrics
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Benchmark Thresholds
|
|
79
|
+
|
|
80
|
+
Agents are monitored against performance thresholds:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"researcher": {
|
|
85
|
+
"p95_latency": "<500ms",
|
|
86
|
+
"memory_mb": "<256MB"
|
|
87
|
+
},
|
|
88
|
+
"coder": {
|
|
89
|
+
"p95_latency": "<300ms",
|
|
90
|
+
"quality_score": ">0.85"
|
|
91
|
+
},
|
|
92
|
+
"security-analyst": {
|
|
93
|
+
"scan_coverage": ">95%",
|
|
94
|
+
"p95_latency": "<1000ms"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Feedback Loop
|
|
100
|
+
|
|
101
|
+
Workers provide feedback for continuous improvement:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import { workerAgentIntegration } from 'agentic-flow/workers/worker-agent-integration';
|
|
105
|
+
|
|
106
|
+
// Record execution feedback
|
|
107
|
+
workerAgentIntegration.recordFeedback(
|
|
108
|
+
'optimize', // trigger
|
|
109
|
+
'coder', // agent
|
|
110
|
+
true, // success
|
|
111
|
+
245, // latency ms
|
|
112
|
+
0.92 // quality score
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Check compliance
|
|
116
|
+
const { compliant, violations } = workerAgentIntegration.checkBenchmarkCompliance('coder');
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Integration Statistics
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
$ npx agentic-flow workers stats --integration
|
|
123
|
+
|
|
124
|
+
Worker-Agent Integration Stats
|
|
125
|
+
══════════════════════════════
|
|
126
|
+
Total Agents: 6
|
|
127
|
+
Tracked Agents: 4
|
|
128
|
+
Total Feedback: 156
|
|
129
|
+
Avg Quality Score: 0.89
|
|
130
|
+
|
|
131
|
+
Model Cache Stats
|
|
132
|
+
─────────────────
|
|
133
|
+
Hits: 1,234
|
|
134
|
+
Misses: 45
|
|
135
|
+
Hit Rate: 96.5%
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Configuration
|
|
139
|
+
|
|
140
|
+
Enable integration features in `.claude/settings.json`:
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"workers": {
|
|
145
|
+
"enabled": true,
|
|
146
|
+
"parallel": true,
|
|
147
|
+
"memoryDepositEnabled": true,
|
|
148
|
+
"agentMappings": {
|
|
149
|
+
"ultralearn": ["researcher", "coder"],
|
|
150
|
+
"optimize": ["performance-analyzer", "coder"]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|