claude-flow-novice 2.14.23 → 2.14.25

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.
@@ -153,45 +153,71 @@ const calculateTechnicalDebtScore = (items: TechnicalDebtItem[]): number => {
153
153
  - [x] Persisted results to SQLite with appropriate ACL
154
154
 
155
155
  Remember: Code analysis reveals improvement opportunities. Focus on actionable, prioritized recommendations that balance impact with effort.
156
- ## CFN Loop Redis Completion Protocol
156
+ ## ⚠️ CRITICAL: Mode-Specific Completion Protocol (ANTI-023 MEMORY LEAK FIX)
157
157
 
158
- When participating in CFN Loop workflows, agents MUST follow this protocol:
158
+ **First, determine how you were spawned:**
159
159
 
160
- ### Step 1: Complete Work
161
- Execute assigned task (code analysis, technical debt assessment, quality validation)
160
+ **Task Mode (95%):** You were called via `Task("code-quality-validator", "...")` in Main Chat
161
+ - Simply complete your code quality analysis and return structured JSON output
162
+ - **❌ DO NOT:** Use Redis commands, execute bash scripts, signal completion via CLI tools
163
+ - Main Chat receives your output automatically
162
164
 
163
- ### Step 2: Signal Completion
164
- ```bash
165
- redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
165
+ **CLI Mode (5%):** You were spawned via `npx claude-flow-novice agent-spawn ...` command
166
+ - Use Redis signals and completion scripts as outlined below
167
+
168
+ ### Task Mode (Spawned via Task() tool in Main Chat)
169
+
170
+ **Simply complete your work and return structured output.**
171
+
172
+ ```json
173
+ {
174
+ "confidence": 0.85,
175
+ "status": "COMPLETE|NEEDS_WORK",
176
+ "summary": "Code quality analysis completed",
177
+ "deliverables": ["quality-report.md", "technical-debt-assessment.json"],
178
+ "analysis": {
179
+ "complexity_score": 7.2,
180
+ "maintainability_index": 85,
181
+ "technical_debt_items": 12,
182
+ "code_smells": 5
183
+ }
184
+ }
166
185
  ```
167
186
 
168
- ### Step 3: Report Confidence Score
169
- ```bash
170
- ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report --task-id "$TASK_ID" --agent-id "$AGENT_ID" --confidence [0.0-1.0] --iteration 1
187
+ **❌ FORBIDDEN in Task Mode:**
188
+ - **DO NOT** run `redis-cli` commands
189
+ - **DO NOT** execute `invoke-waiting-mode.sh` scripts
190
+ - **DO NOT** use bash completion scripts
191
+ - **DO NOT** signal completion via CLI tools
192
+ - **Main Chat receives your output automatically - no coordination needed**
171
193
 
172
- **After reporting, exit cleanly. Do NOT enter waiting mode.**
194
+ ### CLI Mode (Spawned via `npx claude-flow-novice agent-spawn`)
173
195
 
174
- **Why This Matters:**
175
- - Orchestrator collects confidence/consensus scores from Redis
176
- - Enables adaptive agent specialization for next iteration
177
- - Prevents orchestrator blocking on wait $PID
178
- - Coordinator spawns appropriate specialist based on feedback type
196
+ **Step 1: Complete Work**
197
+ Execute assigned task (code analysis, technical debt assessment, quality validation)
179
198
 
199
+ **Step 2: Signal Completion**
200
+ ```bash
201
+ redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
180
202
  ```
181
203
 
182
- ### Step 4: Enter Waiting Mode (for potential iteration)
204
+ **Step 3: Report Confidence Score and Exit**
183
205
  ```bash
206
+ ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report \
207
+ --task-id "$TASK_ID" \
208
+ --agent-id "$AGENT_ID" \
209
+ --confidence [0.0-1.0] \
210
+ --iteration 1
184
211
  ```
185
212
 
186
213
  **Why This Matters:**
187
- - Zero-token blocking coordination (BLPOP waits without API calls)
188
- - Orchestrator collects confidence/consensus scores automatically
189
- - Supports autonomous iteration based on quality gates
190
- - Agent woken instantly (<100ms) if iteration needed
214
+ - **ANTI-023 MEMORY LEAK:** Task Mode agents attempting CLI commands hang indefinitely
215
+ - Task Mode uses direct JSON output, CLI Mode uses Redis coordination
216
+ - Mixing protocols causes memory leaks and process hanging
217
+ - **Check your spawn method FIRST before using any completion protocol**
191
218
 
192
- **Context Variables:**
193
- - `TASK_ID`: Provided by orchestrator/coordinator
194
- - `AGENT_ID`: Your unique agent identifier (e.g., "code-analyzer-1")
195
- - Confidence: Self-assessment score based on analysis comprehensiveness (0.0-1.0)
219
+ ### How to Tell Which Mode You're In
196
220
 
197
- See: `.claude/skills/redis-coordination/SKILL.md` for full protocol details
221
+ - **Task Mode**: You see a direct task assignment in Main Chat context
222
+ - **CLI Mode**: You have TASK_ID and AGENT_ID environment variables
223
+ - **When in doubt, assume Task Mode and return structured JSON output**
@@ -277,18 +277,75 @@ After creating/editing any file, run:
277
277
  ./.claude/hooks/cfn-invoke-post-edit.sh "$EDITED_FILE" --agent-id "cyclomatic-complexity-reducer"
278
278
  ```
279
279
 
280
- ## Redis Coordination (if part of swarm)
280
+ ## ⚠️ CRITICAL: Mode-Specific Completion Protocol (ANTI-023 MEMORY LEAK FIX)
281
+
282
+ **First, determine how you were spawned:**
283
+
284
+ **Task Mode (95%):** You were called via `Task("cyclomatic-complexity-reducer", "...")` in Main Chat
285
+ - Simply complete your complexity reduction and return structured JSON output
286
+ - **❌ DO NOT:** Use Redis commands, execute bash scripts, signal completion via CLI tools
287
+ - Main Chat receives your output automatically
288
+
289
+ **CLI Mode (5%):** You were spawned via `npx claude-flow-novice agent-spawn ...` command
290
+ - Use Redis signals and completion scripts as outlined below
291
+
292
+ ### Task Mode (Spawned via Task() tool in Main Chat)
293
+
294
+ **Simply complete your work and return structured output.**
295
+
296
+ ```json
297
+ {
298
+ "confidence": 0.85,
299
+ "status": "COMPLETE|NEEDS_WORK",
300
+ "summary": "Cyclomatic complexity reduced from X to Y across Z files",
301
+ "deliverables": ["refactored-file.sh", "complexity-report.md"],
302
+ "metrics": {
303
+ "original_complexity": 25,
304
+ "final_complexity": 12,
305
+ "reduction_percentage": "52%",
306
+ "files_refactored": 3
307
+ }
308
+ }
309
+ ```
310
+
311
+ **❌ FORBIDDEN in Task Mode:**
312
+ - **DO NOT** run `redis-cli` commands
313
+ - **DO NOT** execute `invoke-waiting-mode.sh` scripts
314
+ - **DO NOT** use bash completion scripts
315
+ - **DO NOT** signal completion via CLI tools
316
+ - **Main Chat receives your output automatically - no coordination needed**
317
+
318
+ ### CLI Mode (Spawned via `npx claude-flow-novice agent-spawn`)
319
+
320
+ **Step 1: Complete Work**
321
+ Execute assigned complexity reduction (refactoring, simplification, extraction)
322
+
323
+ **Step 2: Signal Completion**
281
324
  ```bash
282
- # Signal completion
283
325
  redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
326
+ ```
284
327
 
285
- # Report confidence
286
- ./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh report \
328
+ **Step 3: Report Confidence Score and Exit**
329
+ ```bash
330
+ ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report \
287
331
  --task-id "$TASK_ID" \
288
332
  --agent-id "$AGENT_ID" \
289
- --confidence 0.85
333
+ --confidence [0.0-1.0] \
334
+ --iteration 1
290
335
  ```
291
336
 
337
+ **Why This Matters:**
338
+ - **ANTI-023 MEMORY LEAK:** Task Mode agents attempting CLI commands hang indefinitely
339
+ - Task Mode uses direct JSON output, CLI Mode uses Redis coordination
340
+ - Mixing protocols causes memory leaks and process hanging
341
+ - **Check your spawn method FIRST before using any completion protocol**
342
+
343
+ ### How to Tell Which Mode You're In
344
+
345
+ - **Task Mode**: You see a direct task assignment in Main Chat context
346
+ - **CLI Mode**: You have TASK_ID and AGENT_ID environment variables
347
+ - **When in doubt, assume Task Mode and return structured JSON output**
348
+
292
349
  ## Example Usage
293
350
 
294
351
  ### Scenario 1: Refactor orchestrate.sh
@@ -191,45 +191,70 @@ const analyzeLoadTest = (result: LoadTestResult): PerformanceIssue[] => {
191
191
  - [ ] Results persisted to SQLite
192
192
 
193
193
  Remember: Optimize for highest impact with reasonable effort. Focus on critical bottlenecks first and validate improvements through testing.
194
- ## CFN Loop Redis Completion Protocol
194
+ ## ⚠️ CRITICAL: Mode-Specific Completion Protocol (ANTI-023 MEMORY LEAK FIX)
195
195
 
196
- When participating in CFN Loop workflows, agents MUST follow this protocol:
196
+ **First, determine how you were spawned:**
197
197
 
198
- ### Step 1: Complete Work
199
- Execute assigned task (performance analysis, bottleneck detection, optimization recommendations)
198
+ **Task Mode (95%):** You were called via `Task("perf-analyzer", "...")` in Main Chat
199
+ - Simply complete your performance analysis and return structured JSON output
200
+ - **❌ DO NOT:** Use Redis commands, execute bash scripts, signal completion via CLI tools
201
+ - Main Chat receives your output automatically
200
202
 
201
- ### Step 2: Signal Completion
202
- ```bash
203
- redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
203
+ **CLI Mode (5%):** You were spawned via `npx claude-flow-novice agent-spawn ...` command
204
+ - Use Redis signals and completion scripts as outlined below
205
+
206
+ ### Task Mode (Spawned via Task() tool in Main Chat)
207
+
208
+ **Simply complete your work and return structured output.**
209
+
210
+ ```json
211
+ {
212
+ "confidence": 0.85,
213
+ "status": "COMPLETE|NEEDS_WORK",
214
+ "summary": "Performance analysis completed with X bottlenecks identified",
215
+ "deliverables": ["performance-report.md", "optimization-recommendations.json"],
216
+ "findings": {
217
+ "bottlenecks": 3,
218
+ "optimizations": 5,
219
+ "expected_improvement": "45%"
220
+ }
221
+ }
204
222
  ```
205
223
 
206
- ### Step 3: Report Confidence Score
207
- ```bash
208
- ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report --task-id "$TASK_ID" --agent-id "$AGENT_ID" --confidence [0.0-1.0] --iteration 1
224
+ **❌ FORBIDDEN in Task Mode:**
225
+ - **DO NOT** run `redis-cli` commands
226
+ - **DO NOT** execute `invoke-waiting-mode.sh` scripts
227
+ - **DO NOT** use bash completion scripts
228
+ - **DO NOT** signal completion via CLI tools
229
+ - **Main Chat receives your output automatically - no coordination needed**
209
230
 
210
- **After reporting, exit cleanly. Do NOT enter waiting mode.**
231
+ ### CLI Mode (Spawned via `npx claude-flow-novice agent-spawn`)
211
232
 
212
- **Why This Matters:**
213
- - Orchestrator collects confidence/consensus scores from Redis
214
- - Enables adaptive agent specialization for next iteration
215
- - Prevents orchestrator blocking on wait $PID
216
- - Coordinator spawns appropriate specialist based on feedback type
233
+ **Step 1: Complete Work**
234
+ Execute assigned performance analysis (bottleneck detection, optimization recommendations)
217
235
 
236
+ **Step 2: Signal Completion**
237
+ ```bash
238
+ redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
218
239
  ```
219
240
 
220
- ### Step 4: Enter Waiting Mode (for potential iteration)
241
+ **Step 3: Report Confidence Score and Exit**
221
242
  ```bash
243
+ ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report \
244
+ --task-id "$TASK_ID" \
245
+ --agent-id "$AGENT_ID" \
246
+ --confidence [0.0-1.0] \
247
+ --iteration 1
222
248
  ```
223
249
 
224
250
  **Why This Matters:**
225
- - Zero-token blocking coordination (BLPOP waits without API calls)
226
- - Orchestrator collects confidence/consensus scores automatically
227
- - Supports autonomous iteration based on quality gates
228
- - Agent woken instantly (<100ms) if iteration needed
251
+ - **ANTI-023 MEMORY LEAK:** Task Mode agents attempting CLI commands hang indefinitely
252
+ - Task Mode uses direct JSON output, CLI Mode uses Redis coordination
253
+ - Mixing protocols causes memory leaks and process hanging
254
+ - **Check your spawn method FIRST before using any completion protocol**
229
255
 
230
- **Context Variables:**
231
- - `TASK_ID`: Provided by orchestrator/coordinator
232
- - `AGENT_ID`: Your unique agent identifier (e.g., "perf-analyzer-1")
233
- - Confidence: Self-assessment score based on analysis depth and actionability (0.0-1.0)
256
+ ### How to Tell Which Mode You're In
234
257
 
235
- See: `.claude/skills/redis-coordination/SKILL.md` for full protocol details
258
+ - **Task Mode**: You see a direct task assignment in Main Chat context
259
+ - **CLI Mode**: You have TASK_ID and AGENT_ID environment variables
260
+ - **When in doubt, assume Task Mode and return structured JSON output**
@@ -129,55 +129,74 @@ await redis.publish('swarm:security:critical', {
129
129
  - Security code review
130
130
  - Penetration testing scenarios
131
131
 
132
- ## CFN Loop Redis Completion Protocol
132
+ ## ⚠️ CRITICAL: Mode-Specific Completion Protocol (ANTI-023 MEMORY LEAK FIX)
133
133
 
134
- When participating in CFN Loop workflows, agents MUST follow this protocol:
134
+ **First, determine how you were spawned:**
135
135
 
136
- ### Step 1: Complete Work
137
- Execute assigned task (implementation, review, testing, etc.)
136
+ **Task Mode (95%):** You were called via `Task("security-specialist", "...")` in Main Chat
137
+ - Simply complete your security audit and return structured JSON output
138
+ - **❌ DO NOT:** Use Redis commands, execute bash scripts, signal completion via CLI tools
139
+ - Main Chat receives your output automatically
138
140
 
139
- ### Step 2: Signal Completion
140
- ```bash
141
- redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
141
+ **CLI Mode (5%):** You were spawned via `npx claude-flow-novice agent-spawn ...` command
142
+ - Use Redis signals and completion scripts as outlined below
143
+
144
+ ### Task Mode (Spawned via Task() tool in Main Chat)
145
+
146
+ **Simply complete your work and return structured output.**
147
+
148
+ ```json
149
+ {
150
+ "confidence": 0.85,
151
+ "status": "COMPLETE|NEEDS_WORK",
152
+ "summary": "Security audit completed with X findings",
153
+ "deliverables": ["security-report.md", "vulnerability-scan.json"],
154
+ "findings": {
155
+ "critical": 0,
156
+ "high": 2,
157
+ "medium": 5,
158
+ "low": 3
159
+ }
160
+ }
142
161
  ```
143
162
 
144
- ### Step 3: Report Confidence Score
145
- ```bash
146
- ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report \
163
+ **❌ FORBIDDEN in Task Mode:**
164
+ - **DO NOT** run `redis-cli` commands
165
+ - **DO NOT** execute `invoke-waiting-mode.sh` scripts
166
+ - **DO NOT** use bash completion scripts
167
+ - **DO NOT** signal completion via CLI tools
168
+ - **Main Chat receives your output automatically - no coordination needed**
147
169
 
148
- **After reporting, exit cleanly. Do NOT enter waiting mode.**
170
+ ### CLI Mode (Spawned via `npx claude-flow-novice agent-spawn`)
149
171
 
150
- **Why This Matters:**
151
- - Orchestrator collects confidence/consensus scores from Redis
152
- - Enables adaptive agent specialization for next iteration
153
- - Prevents orchestrator blocking on wait $PID
154
- - Coordinator spawns appropriate specialist based on feedback type
172
+ **Step 1: Complete Work**
173
+ Execute assigned security audit (vulnerability assessment, threat modeling, etc.)
155
174
 
156
- --task-id "$TASK_ID" \
157
- --agent-id "$AGENT_ID" \
158
- --confidence [0.0-1.0] \
159
- --iteration 1
175
+ **Step 2: Signal Completion**
176
+ ```bash
177
+ redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
160
178
  ```
161
179
 
162
- ### Step 4: Enter Waiting Mode (for potential iteration)
180
+ **Step 3: Report Confidence Score and Exit**
163
181
  ```bash
182
+ ./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh report \
164
183
  --task-id "$TASK_ID" \
165
184
  --agent-id "$AGENT_ID" \
166
- --context "iteration-complete"
185
+ --confidence [0.0-1.0] \
186
+ --iteration 1
167
187
  ```
168
188
 
169
189
  **Why This Matters:**
170
- - Zero-token blocking coordination (BLPOP waits without API calls)
171
- - Orchestrator collects confidence/consensus scores automatically
172
- - Supports autonomous iteration based on quality gates
173
- - Agent woken instantly (<100ms) if iteration needed
190
+ - **ANTI-023 MEMORY LEAK:** Task Mode agents attempting CLI commands hang indefinitely
191
+ - Task Mode uses direct JSON output, CLI Mode uses Redis coordination
192
+ - Mixing protocols causes memory leaks and process hanging
193
+ - **Check your spawn method FIRST before using any completion protocol**
174
194
 
175
- **Context Variables:**
176
- - `TASK_ID`: Provided by orchestrator/coordinator
177
- - `AGENT_ID`: Your unique agent identifier (e.g., "coder-1", "reviewer-2")
178
- - Confidence: Your self-assessment score (0.0-1.0)
195
+ ### How to Tell Which Mode You're In
179
196
 
180
- See: `.claude/skills/redis-coordination/SKILL.md` for full protocol details
197
+ - **Task Mode**: You see a direct task assignment in Main Chat context
198
+ - **CLI Mode**: You have TASK_ID and AGENT_ID environment variables
199
+ - **When in doubt, assume Task Mode and return structured JSON output**
181
200
 
182
201
  ## Success Metrics
183
202