claude-flow-novice 2.4.0 → 2.4.2

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.
@@ -35,7 +35,7 @@ lifecycle:
35
35
 
36
36
  ```bash
37
37
  # Spawn workers with explicit typed agents
38
- node src/cli/hybrid-routing/spawn-workers.js \
38
+ npx claude-flow-spawn \
39
39
  "Implement authentication system" \
40
40
  --agents=coder,security-specialist,coder \
41
41
  --provider zai --redis-channel swarm:auth
@@ -111,7 +111,7 @@ const tasks = decomposePhase(phaseObjective);
111
111
  const agentTypes = tasks.map(t => t.agentType).join(',');
112
112
 
113
113
  await Bash(`
114
- node src/cli/hybrid-routing/spawn-workers.js
114
+ npx claude-flow-spawn
115
115
  "${taskDescription}"
116
116
  --agents=${agentTypes}
117
117
  --provider zai
@@ -63,7 +63,7 @@ You are a senior project management and orchestration expert specializing in com
63
63
 
64
64
  ```bash
65
65
  # ✅ CORRECT: Production CLI spawning
66
- node src/cli/hybrid-routing/spawn-workers.js \
66
+ npx claude-flow-spawn \
67
67
  "Remove forbidden patterns from /readme docs" \
68
68
  --agents=coder,coder,coder \
69
69
  --provider zai --redis-channel swarm:doc-cleanup
@@ -85,7 +85,7 @@ Remove forbidden patterns from documentation:
85
85
  `;
86
86
 
87
87
  // 3. Delegate via CLI
88
- await Bash(`node src/cli/hybrid-routing/spawn-workers.js "${taskDescription}" --max-agents 3 --provider zai`);
88
+ await Bash(`npx claude-flow-spawn "${taskDescription}" --max-agents 3 --provider zai`);
89
89
 
90
90
  // 4. Monitor via Redis
91
91
  const results = await monitorRedisCompletions("swarm:*:complete", 3);
@@ -663,10 +663,10 @@ See `scripts/validate-agent-hooks.js` for hook validation:
663
663
 
664
664
  ```bash
665
665
  # Validate all agent profiles
666
- node scripts/validate-agent-hooks.js --all
666
+ npx claude-flow-validate-hooks --all
667
667
 
668
668
  # Validate specific profile
669
- node scripts/validate-agent-hooks.js .claude/agents/examples/blocking-coordinator-example.md
669
+ npx claude-flow-validate-hooks .claude/agents/examples/blocking-coordinator-example.md
670
670
  ```
671
671
 
672
672
  ## Debugging Hooks
@@ -105,13 +105,13 @@ Each phase follows the complete Loop 1 pattern:
105
105
 
106
106
  ```bash
107
107
  # Enterprise worker spawning with comprehensive validation (REQUIRED: --agents flag with explicit types)
108
- node src/cli/hybrid-routing/spawn-workers.js \
108
+ npx claude-flow-spawn \
109
109
  "Implement [feature] for Enterprise: production-ready, security-hardened, compliance-validated" \
110
110
  --agents=analyst,architect,coder,coder,security-specialist,tester,reviewer,compliance-specialist \
111
111
  --provider zai --redis-channel swarm:enterprise-phase
112
112
 
113
113
  # Mission-critical spawning with security focus
114
- node src/cli/hybrid-routing/spawn-workers.js \
114
+ npx claude-flow-spawn \
115
115
  "Build Enterprise version of [component] with zero-defect tolerance, compliance validation" \
116
116
  --agents=analyst,coder,coder,security-specialist,tester,reviewer \
117
117
  --provider zai --redis-channel swarm:enterprise-phase \
@@ -101,13 +101,13 @@ Each phase follows the complete Loop 1 pattern:
101
101
 
102
102
  ```bash
103
103
  # Basic MVP worker spawning (REQUIRED: --agents flag with explicit types)
104
- node src/cli/hybrid-routing/spawn-workers.js \
104
+ npx claude-flow-spawn \
105
105
  "Implement [feature] for MVP: rapid development focus on core functionality" \
106
106
  --agents=coder,coder,tester \
107
107
  --provider zai --redis-channel swarm:mvp-phase
108
108
 
109
109
  # Cost-optimized spawning (MVP priority)
110
- node src/cli/hybrid-routing/spawn-workers.js \
110
+ npx claude-flow-spawn \
111
111
  "Build MVP version of [component] with essential features only" \
112
112
  --agents=coder,coder \
113
113
  --provider zai --redis-channel swarm:mvp-phase \
@@ -101,13 +101,13 @@ Each phase follows the complete Loop 1 pattern:
101
101
 
102
102
  ```bash
103
103
  # Standard worker spawning with comprehensive testing (REQUIRED: --agents flag with explicit types)
104
- node src/cli/hybrid-routing/spawn-workers.js \
104
+ npx claude-flow-spawn \
105
105
  "Implement [feature] for Standard: comprehensive testing, edge cases, documentation" \
106
106
  --agents=analyst,coder,coder,tester,reviewer \
107
107
  --provider zai --redis-channel swarm:standard-phase
108
108
 
109
109
  # Quality-focused spawning
110
- node src/cli/hybrid-routing/spawn-workers.js \
110
+ npx claude-flow-spawn \
111
111
  "Build Standard version of [component] with full test suite and documentation" \
112
112
  --agents=coder,coder,tester,reviewer \
113
113
  --provider zai --redis-channel swarm:standard-phase \
@@ -53,7 +53,7 @@ swarm:cfn:mvp:${PHASE_ID}:loop3:complete
53
53
 
54
54
  **Worker Spawn:**
55
55
  ```bash
56
- node src/cli/hybrid-routing/spawn-workers.js \
56
+ npx claude-flow-spawn \
57
57
  "Implement [feature] for MVP - core functionality only" \
58
58
  --agents=coder,tester \
59
59
  --topology=sequential \
@@ -86,7 +86,7 @@ swarm:cfn:standard:${PHASE_ID}:loop3:complete
86
86
 
87
87
  **Worker Spawn:**
88
88
  ```bash
89
- node src/cli/hybrid-routing/spawn-workers.js \
89
+ npx claude-flow-spawn \
90
90
  "Implement [feature] with balanced quality and speed" \
91
91
  --agents=architect,coder,coder,tester \
92
92
  --topology=collaborative \
@@ -120,7 +120,7 @@ swarm:cfn:enterprise:${PHASE_ID}:loop3:complete
120
120
 
121
121
  **Worker Spawn:**
122
122
  ```bash
123
- node src/cli/hybrid-routing/spawn-workers.js \
123
+ npx claude-flow-spawn \
124
124
  "Implement [feature] with enterprise quality standards" \
125
125
  --agents=architect,architect,coder,coder,coder,tester,security-specialist,perf-analyzer \
126
126
  --topology=release-gate \
@@ -157,7 +157,7 @@ swarm:cfn:mvp:${PHASE_ID}:loop2:complete
157
157
 
158
158
  **Validator Spawn:**
159
159
  ```bash
160
- node src/cli/hybrid-routing/spawn-workers.js \
160
+ npx claude-flow-spawn \
161
161
  "Validate MVP implementation - focus on core functionality" \
162
162
  --agents=code-quality-validator,security-specialist \
163
163
  --topology=sequential \
@@ -192,7 +192,7 @@ swarm:cfn:standard:${PHASE_ID}:loop2:complete
192
192
 
193
193
  **Validator Spawn:**
194
194
  ```bash
195
- node src/cli/hybrid-routing/spawn-workers.js \
195
+ npx claude-flow-spawn \
196
196
  "Validate standard implementation - comprehensive review" \
197
197
  --agents=code-quality-validator,security-specialist,perf-analyzer,interaction-tester \
198
198
  --topology=collaborative \
@@ -227,7 +227,7 @@ swarm:cfn:enterprise:${PHASE_ID}:loop2:complete
227
227
 
228
228
  **Validator Spawn:**
229
229
  ```bash
230
- node src/cli/hybrid-routing/spawn-workers.js \
230
+ npx claude-flow-spawn \
231
231
  "Validate enterprise implementation - full compliance audit" \
232
232
  --agents=code-quality-validator,security-specialist,perf-analyzer,interaction-tester,compliance-auditor \
233
233
  --topology=release-gate \
@@ -455,7 +455,7 @@ Total: $4.00-$6.50 per phase
455
455
  /cfn-loop "Add user registration endpoint" --mode=mvp
456
456
 
457
457
  # Coordinator spawns workers
458
- node src/cli/hybrid-routing/spawn-workers.js \
458
+ npx claude-flow-spawn \
459
459
  "Implement user registration endpoint - core functionality only" \
460
460
  --agents=coder,tester \
461
461
  --topology=sequential \
@@ -473,7 +473,7 @@ node src/cli/hybrid-routing/spawn-workers.js \
473
473
  /cfn-loop "Implement payment processing system" --mode=standard
474
474
 
475
475
  # Coordinator spawns workers
476
- node src/cli/hybrid-routing/spawn-workers.js \
476
+ npx claude-flow-spawn \
477
477
  "Implement payment processing system with balanced quality and speed" \
478
478
  --agents=architect,coder,coder,tester \
479
479
  --topology=collaborative \
@@ -491,7 +491,7 @@ node src/cli/hybrid-routing/spawn-workers.js \
491
491
  /cfn-loop "Deploy HIPAA-compliant patient data API" --mode=enterprise
492
492
 
493
493
  # Coordinator spawns workers
494
- node src/cli/hybrid-routing/spawn-workers.js \
494
+ npx claude-flow-spawn \
495
495
  "Implement HIPAA-compliant patient data API with enterprise quality standards" \
496
496
  --agents=architect,architect,coder,coder,coder,tester,security-specialist,perf-analyzer \
497
497
  --topology=release-gate \
@@ -25,7 +25,7 @@ Disable CLI cost-savings mode to use traditional Task-tool agent spawning.
25
25
  **Execute mode toggle:**
26
26
 
27
27
  ```bash
28
- node scripts/toggle-cost-savings.cjs off
28
+ npx claude-flow-cost-savings off
29
29
  ```
30
30
 
31
31
  **After disabling:**
@@ -18,14 +18,14 @@ Enable cost-savings mode to use CLI-based agent spawning with spawn-workers.js f
18
18
  **Mode Details:**
19
19
  - **Coordinator**: Runs in main chat (Claude Max, $0)
20
20
  - **Workers**: Spawned via CLI with z.ai provider
21
- - **Spawning**: Uses `node src/cli/hybrid-routing/spawn-workers.js --agents=type1,type2 --provider zai`
21
+ - **Spawning**: Uses `npx claude-flow-spawn --agents=type1,type2 --provider zai`
22
22
  - **Coordination**: Redis pub/sub messaging
23
23
  - **State**: SQLite persistence with ACL
24
24
 
25
25
  **Execute mode toggle:**
26
26
 
27
27
  ```bash
28
- node scripts/toggle-cost-savings.cjs on
28
+ npx claude-flow-cost-savings on
29
29
  ```
30
30
 
31
31
  **After enabling:**
@@ -22,7 +22,7 @@ Display current cost-savings mode status and coordinator configuration.
22
22
  **Execute status check:**
23
23
 
24
24
  ```bash
25
- node scripts/toggle-cost-savings.cjs status
25
+ npx claude-flow-cost-savings status
26
26
  ```
27
27
 
28
28
  **Output includes:**
@@ -243,7 +243,7 @@ npm run build
243
243
  /launch-web-dashboard
244
244
 
245
245
  # Spawn workers (dashboard monitors them)
246
- node src/cli/hybrid-routing/spawn-workers.js "Task" --max-agents 5
246
+ npx claude-flow-spawn "Task" --max-agents 5
247
247
  ```
248
248
 
249
249
  ### With Swarm Coordination
@@ -34,7 +34,7 @@ Regenerate `src/cli/hybrid-routing/AVAILABLE-AGENTS.md` from live agent discover
34
34
 
35
35
  ```bash
36
36
  # Regenerate agent list
37
- node src/cli/hybrid-routing/spawn-workers.js --agents-by-category > src/cli/hybrid-routing/AVAILABLE-AGENTS.md.tmp
37
+ npx claude-flow-spawn --agents-by-category > src/cli/hybrid-routing/AVAILABLE-AGENTS.md.tmp
38
38
 
39
39
  # Parse and format into markdown document
40
40
  node << 'EOF'
@@ -126,9 +126,9 @@ markdown += '## Usage\n\n';
126
126
  markdown += '### CLI Commands\n\n';
127
127
  markdown += '```bash\n';
128
128
  markdown += '# List all agents (flat view)\n';
129
- markdown += 'node src/cli/hybrid-routing/spawn-workers.js --list-agents\n\n';
129
+ markdown += 'npx claude-flow-spawn --list-agents\n\n';
130
130
  markdown += '# List agents by category\n';
131
- markdown += 'node src/cli/hybrid-routing/spawn-workers.js --agents-by-category\n\n';
131
+ markdown += 'npx claude-flow-spawn --agents-by-category\n\n';
132
132
  markdown += '# Regenerate this documentation file\n';
133
133
  markdown += '/list-agents-rebuild\n';
134
134
  markdown += '```\n\n';
@@ -136,12 +136,12 @@ markdown += '```\n\n';
136
136
  markdown += '### Coordinator Usage\n\n';
137
137
  markdown += '```bash\n';
138
138
  markdown += '# Automatic selection (keyword-based)\n';
139
- markdown += 'node src/cli/hybrid-routing/spawn-workers.js "Build auth" --max-agents=3\n\n';
139
+ markdown += 'npx claude-flow-spawn "Build auth" --max-agents=3\n\n';
140
140
  markdown += '# Coordinator override (manual agent types)\n';
141
- markdown += 'node src/cli/hybrid-routing/spawn-workers.js "Task" \\\n';
141
+ markdown += 'npx claude-flow-spawn "Task" \\\n';
142
142
  markdown += ' --agents=architect,coder,tester\n\n';
143
143
  markdown += '# Full override (custom agents + subtasks)\n';
144
- markdown += 'node src/cli/hybrid-routing/spawn-workers.js "Task" \\\n';
144
+ markdown += 'npx claude-flow-spawn "Task" \\\n';
145
145
  markdown += ' --agents=coder,security-specialist \\\n';
146
146
  markdown += ' --subtasks="Subtask 1|Subtask 2"\n';
147
147
  markdown += '```\n\n';
@@ -180,7 +180,7 @@ Add feedback monitoring right after worker spawning:
180
180
  (... feedback monitor code ...)
181
181
 
182
182
  # Step 2: Spawn workers
183
- node src/cli/hybrid-routing/spawn-workers.js ...
183
+ npx claude-flow-spawn ...
184
184
 
185
185
  # Step 3: Monitor workers AND feedback simultaneously
186
186
  while [ $(redis-cli llen "swarm:cfn:${MODE}:${PHASE_ID}:loop3:complete") -eq 0 ]; do
@@ -282,7 +282,7 @@ type: coordinator
282
282
  ## Worker Spawning Pattern
283
283
 
284
284
  ```bash
285
- node src/cli/hybrid-routing/spawn-workers.js \
285
+ npx claude-flow-spawn \
286
286
  "Task description" \
287
287
  --agents=analyst,architect,coder \
288
288
  --provider zai
package/SYNC_USAGE.md CHANGED
@@ -20,6 +20,20 @@ npx claude-flow-sync --backup
20
20
  node node_modules/claude-flow-novice/scripts/sync-from-package.js --backup
21
21
  ```
22
22
 
23
+ ### 3. Available CLI Commands
24
+
25
+ The package provides additional commands for agent coordination:
26
+
27
+ ```bash
28
+ # Spawn agents via CLI (cost-optimized coordination)
29
+ npx claude-flow-spawn "Build auth system" --agents=coder,tester --provider zai
30
+
31
+ # Toggle cost-savings mode
32
+ npx claude-flow-cost-savings on # Enable CLI spawning
33
+ npx claude-flow-cost-savings off # Disable CLI spawning
34
+ npx claude-flow-cost-savings status # Check current mode
35
+ ```
36
+
23
37
  ## Sync Options
24
38
 
25
39
  ### Sync Everything (Recommended for first time)
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "claude-flow-novice",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "AI Agent Orchestration CLI",
5
5
  "main": "src/index.ts",
6
6
  "bin": {
7
7
  "claude-flow-novice": "./src/cli/index.ts",
8
- "claude-flow-sync": "./scripts/sync-from-package.js"
8
+ "claude-flow-sync": "./scripts/sync-from-package.js",
9
+ "claude-flow-spawn": "./src/cli/hybrid-routing/spawn-workers.js",
10
+ "claude-flow-cost-savings": "./scripts/toggle-cost-savings.cjs",
11
+ "claude-flow-validate-hooks": "./scripts/validate-agent-hooks.js"
9
12
  },
10
13
  "files": [
11
14
  "src",
@@ -1,5 +1,7 @@
1
1
  # Claude Flow Novice — AI Agent Orchestration
2
2
 
3
+ **🚀 Production Status:** Redis coordination system fully deployed (Phase 7 - 2025-10-17)
4
+
3
5
  ---
4
6
 
5
7
  ## 1) Critical Rules (Single Source of Truth)
@@ -11,12 +13,13 @@
11
13
  * Agents communicate via Redis pub/sub with explicit dependencies (see `.claude/redis-agent-dependencies.md`)
12
14
 
13
15
  **Core Principles:**
14
- * Use agents for all non-trivial work (≥4 steps or multi-file/research/testing/architecture/security)
16
+ * Use agents for all non-trivial work (≥3 steps or multi-file/research/testing/architecture/security)
15
17
  * **PRIMARY COORDINATOR: Use coordinator-hybrid for all multi-agent coordination** (cost-optimized CLI spawning with typed agents)
16
18
  * Initialize swarm before multi-agent work
17
19
  * Batch operations: spawn ALL agents (coordinator + workers) in single message
18
20
  * Run post-edit hook after every file edit
19
21
  * **REQUIRED: All CLI agent spawning must use explicit --agents flag with typed agents**
22
+ * **Context continuity:** Redis/SQLite persistence enables unlimited continuation — never stop due to context/token concerns
20
23
 
21
24
  **Prohibited Patterns:**
22
25
  * Main chat orchestrating agents directly — spawn coordinator to handle orchestration
@@ -25,11 +28,12 @@
25
28
  * Using generic "coordinator" fallback when coordinator-hybrid available
26
29
  * Spawning agents without explicit --agents flag (must specify types from AVAILABLE-AGENTS.md)
27
30
  * Agent coordination without Redis pub/sub messaging — ALL agents must use Redis
28
- * Running tests inside agents — execute once; agents read results
31
+ * Running tests inside agents — coordinator runs tests ONCE; workers read cached results from test-results.json
29
32
  * Concurrent test runs — terminate previous runs first
30
33
  * **Saving to project root — check `.artifacts/logs/post-edit-pipeline.log` after writes; move files if ROOT_WARNING**
31
34
  * Creating guides/summaries/reports unless explicitly asked
32
- * Asking permission to retry/advance when criteria/iterations allow. Instead relaunch agents
35
+ * Asking permission to retry/advance when criteria/iterations allow **relaunch agents immediately when consensus <threshold and iterations <max**
36
+ * Stopping work due to context/token concerns — Redis/SQLite persistence handles continuation automatically
33
37
 
34
38
  **Communication:**
35
39
  * Use spartan language
@@ -121,15 +125,28 @@ If file created in root, hook returns `status: "ROOT_WARNING"` with `rootWarning
121
125
 
122
126
  ### 3.3 Safe Test Execution
123
127
 
128
+ **Pattern: Coordinator runs tests ONCE before spawning workers**
129
+
124
130
  ```bash
125
- # Run once, save results
131
+ # 1. Coordinator terminates any existing test runs
132
+ pkill -f vitest; pkill -f "npm test"
133
+
134
+ # 2. Coordinator runs tests once and caches results
126
135
  npm test -- --run --reporter=json > test-results.json 2>&1
127
- # Agents read results only
136
+
137
+ # 3. Workers read cached results only (no test execution)
128
138
  cat test-results.json
129
- # Cleanup
139
+
140
+ # 4. Cleanup after all work complete
130
141
  pkill -f vitest; pkill -f "npm test"
131
142
  ```
132
143
 
144
+ **Rules:**
145
+ * Coordinator executes tests before worker spawn
146
+ * Workers ONLY read test-results.json (never run tests)
147
+ * Single test execution prevents concurrent run conflicts
148
+ * Cache results in test-results.json for worker consumption
149
+
133
150
  ### 3.4 Batching (One message = all related ops)
134
151
 
135
152
  * Spawn all agents with Task tool in one message
@@ -197,6 +214,47 @@ mv test.txt src/test.txt # Move to suggested location
197
214
 
198
215
  **→ Pattern: `.claude/coordinator-feedback-pattern.md`**
199
216
 
217
+ ### 6.3 Dashboard Integration (Phase 5)
218
+
219
+ **Real-time Dashboard:**
220
+ - URL: http://localhost:3001 (RealtimeServer)
221
+ - WebSocket: ws://localhost:3001/ws
222
+ - Components: RedisCoordinationMonitor.tsx
223
+
224
+ **REST API Endpoints:**
225
+ | Endpoint | Method | Description |
226
+ |----------|--------|-------------|
227
+ | /api/redis/feedback | GET | Recent feedback (limit=100) |
228
+ | /api/redis/metrics | GET | Current metrics snapshot |
229
+ | /api/swarm/status | GET | Current swarm coordination status |
230
+
231
+ **CLI Monitoring Commands:**
232
+ ```bash
233
+ # Monitor feedback
234
+ ./scripts/monitor-swarm-redis.sh feedback
235
+
236
+ # Monitor CFN Loop
237
+ ./scripts/monitor-swarm-redis.sh coordination
238
+
239
+ # Realtime dashboard launch
240
+ npx claude-flow-novice dashboard --port 3001
241
+ ```
242
+
243
+ **Post-Spawn Validation:**
244
+ ```bash
245
+ # Validate CLI agent
246
+ node config/hooks/post-spawn-validation.js coder-1
247
+
248
+ # Validate Task agent
249
+ node config/hooks/post-spawn-validation.js task_abc123 --coordinator-id coordinator-cfn
250
+ ```
251
+
252
+ **WebSocket Event Types:**
253
+ - `swarm:coordination`
254
+ - `agent:feedback`
255
+ - `system:metrics`
256
+ - `dashboard:status`
257
+
200
258
  ---
201
259
 
202
260
  ## 7) Commands & Setup