claude-flow-novice 2.18.19 → 2.18.20

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.
@@ -0,0 +1,263 @@
1
+ ---
2
+ description: "Execute CFN Loop in Task Mode with direct agent spawning (visible in main chat)"
3
+ argument-hint: "<task description> [--mode=mvp|standard|enterprise] [--max-iterations=n] [--ace-reflect]"
4
+ allowed-tools: ["Task", "TodoWrite", "Read", "Bash", "SlashCommand"]
5
+ ---
6
+
7
+ # CFN Loop Task Mode - Direct Agent Spawning
8
+
9
+ **Version:** 1.3.0 | **Date:** 2025-12-14 | **Status:** Production Ready
10
+
11
+ ## Quick Overview
12
+
13
+ Task Mode spawns agents directly in main chat with full visibility. Uses test-driven gate validation (not confidence scores).
14
+
15
+ ### When to Use Task Mode
16
+ - **Debugging** - Need to see agent thought process
17
+ - **Learning** - Understanding how agents work
18
+ - **Complex coordination** - Require custom agent interactions
19
+
20
+ ---
21
+
22
+ ## TDD Gate Enforcement (MANDATORY)
23
+
24
+ **Gate checks are based on TEST PASS RATES, not confidence scores.**
25
+
26
+ After Loop 3 agents complete, run gate validation:
27
+ ```bash
28
+ # Get test results
29
+ TEST_OUTPUT=$(npm test 2>&1 || true)
30
+ PASS_COUNT=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passed)' | head -1 || echo "0")
31
+ TOTAL_COUNT=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= total)' | head -1 || echo "1")
32
+
33
+ # Calculate pass rate
34
+ if [ "$TOTAL_COUNT" -gt 0 ]; then
35
+ PASS_RATE=$(echo "scale=4; $PASS_COUNT / $TOTAL_COUNT" | bc)
36
+ else
37
+ PASS_RATE="0"
38
+ fi
39
+
40
+ # Validate gate
41
+ npx ts-node .claude/skills/cfn-loop-orchestration-v2/lib/orchestrator/src/helpers/gate-check.ts \
42
+ --pass-rate "$PASS_RATE" \
43
+ --mode "$MODE"
44
+ ```
45
+
46
+ ### Gate Thresholds
47
+ | Mode | Pass Rate Threshold |
48
+ |------|-------------------|
49
+ | MVP | 70% |
50
+ | Standard | 95% |
51
+ | Enterprise | 98% |
52
+
53
+ **CRITICAL:** Validators MUST NOT start until gate check passes.
54
+
55
+ ---
56
+
57
+ ## Post-Edit Pipeline (MANDATORY)
58
+
59
+ After ANY file modification, run:
60
+ ```bash
61
+ ./.claude/hooks/cfn-invoke-post-edit.sh "$FILE_PATH" --agent-id "$AGENT_ID"
62
+ ```
63
+
64
+ Or if using project-local pipeline:
65
+ ```bash
66
+ node config/hooks/post-edit-pipeline.js "$FILE" --agent-id "${AGENT_ID:-hook}"
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Execution Instructions (AUTO-EXECUTE)
72
+
73
+ **Step 1: Parse Arguments**
74
+ ```bash
75
+ TASK_DESCRIPTION="$ARGUMENTS"
76
+ TASK_DESCRIPTION=$(echo "$TASK_DESCRIPTION" | sed 's/--mode[[:space:]]*[a-zA-Z]*//' | sed 's/--max-iterations[[:space:]]*[0-9]*//' | xargs)
77
+
78
+ MODE="standard"
79
+ MAX_ITERATIONS=10
80
+
81
+ for arg in $ARGUMENTS; do
82
+ case $arg in
83
+ --mode=*) MODE="${arg#*=}" ;;
84
+ --max-iterations=*) MAX_ITERATIONS="${arg#*=}" ;;
85
+ esac
86
+ done
87
+
88
+ if [[ ! "$MODE" =~ ^(mvp|standard|enterprise)$ ]]; then
89
+ echo "ERROR: Invalid mode '$MODE'. Must be: mvp, standard, enterprise"
90
+ exit 1
91
+ fi
92
+
93
+ TASK_ID="cfn-task-$(date +%s%N | tail -c 7)-${RANDOM}"
94
+ echo "Task ID: $TASK_ID | Mode: $MODE | Max Iterations: $MAX_ITERATIONS"
95
+ ```
96
+
97
+ **Step 2: Spawn Loop 3 Agents (Implementation)**
98
+ ```bash
99
+ case $MODE in
100
+ "mvp")
101
+ Task("backend-developer", `
102
+ AGENT_ID="backend-dev-${TASK_ID}"
103
+
104
+ TASK: Implement MVP for: ${TASK_DESCRIPTION}
105
+
106
+ TDD REQUIREMENTS (MANDATORY):
107
+ 1. Write tests BEFORE implementation (Red phase)
108
+ 2. Implement to make tests pass (Green phase)
109
+ 3. Refactor while keeping tests green
110
+ 4. Run: npm test -- --reporter=json after implementation
111
+ 5. Report actual pass/fail counts, NOT confidence scores
112
+
113
+ POST-EDIT (MANDATORY):
114
+ After each file edit, run:
115
+ ./.claude/hooks/cfn-invoke-post-edit.sh "$FILE_PATH" --agent-id "$AGENT_ID"
116
+
117
+ RETURN FORMAT:
118
+ {
119
+ "tests_passed": <number>,
120
+ "tests_total": <number>,
121
+ "pass_rate": <0.0-1.0>,
122
+ "files_created": [...],
123
+ "files_modified": [...]
124
+ }
125
+ `)
126
+ ;;
127
+
128
+ "standard"|"enterprise")
129
+ Task("backend-developer", `
130
+ AGENT_ID="backend-dev-${TASK_ID}"
131
+
132
+ TASK: Implement production solution for: ${TASK_DESCRIPTION}
133
+
134
+ TDD REQUIREMENTS (MANDATORY - London School):
135
+ 1. Write unit tests with mocks FIRST
136
+ 2. Write integration tests for component interactions
137
+ 3. Implement to make all tests pass
138
+ 4. Achieve ${MODE === 'standard' ? '80' : '95'}% coverage minimum
139
+ 5. Run: npm test -- --reporter=json after implementation
140
+ 6. Report actual pass/fail counts, NOT confidence scores
141
+
142
+ POST-EDIT (MANDATORY):
143
+ After each file edit, run:
144
+ ./.claude/hooks/cfn-invoke-post-edit.sh "$FILE_PATH" --agent-id "$AGENT_ID"
145
+
146
+ RETURN FORMAT:
147
+ {
148
+ "tests_passed": <number>,
149
+ "tests_total": <number>,
150
+ "pass_rate": <0.0-1.0>,
151
+ "coverage_percent": <number>,
152
+ "files_created": [...],
153
+ "files_modified": [...]
154
+ }
155
+ `)
156
+ ;;
157
+ esac
158
+ ```
159
+
160
+ **Step 3: Run Gate Check (BEFORE validators)**
161
+ ```bash
162
+ echo "Running gate check..."
163
+
164
+ # Parse agent output for test results
165
+ TESTS_PASSED=${LOOP3_RESULT.tests_passed:-0}
166
+ TESTS_TOTAL=${LOOP3_RESULT.tests_total:-1}
167
+ PASS_RATE=$(echo "scale=4; $TESTS_PASSED / $TESTS_TOTAL" | bc)
168
+
169
+ # Run gate validation
170
+ GATE_RESULT=$(npx ts-node .claude/skills/cfn-loop-orchestration-v2/lib/orchestrator/src/helpers/gate-check.ts \
171
+ --pass-rate "$PASS_RATE" \
172
+ --mode "$MODE" 2>&1)
173
+
174
+ if echo "$GATE_RESULT" | grep -q '"passed": false'; then
175
+ echo "GATE FAILED - Iterating Loop 3"
176
+ # Re-run Loop 3 with feedback
177
+ ITERATION=$((ITERATION + 1))
178
+ if [ $ITERATION -lt $MAX_ITERATIONS ]; then
179
+ # Spawn Loop 3 again with failure context
180
+ continue
181
+ else
182
+ echo "Max iterations reached. Gate still failing."
183
+ exit 1
184
+ fi
185
+ fi
186
+
187
+ echo "GATE PASSED - Proceeding to validators"
188
+ ```
189
+
190
+ **Step 4: Spawn Loop 2 Validators (ONLY after gate passes)**
191
+ ```bash
192
+ Task("code-reviewer", `
193
+ AGENT_ID="reviewer-${TASK_ID}"
194
+
195
+ TASK: Validate implementation for: ${TASK_DESCRIPTION}
196
+
197
+ VALIDATION CHECKLIST:
198
+ - [ ] Tests exist for all new code
199
+ - [ ] Tests follow TDD pattern (written before implementation)
200
+ - [ ] Coverage meets threshold for ${MODE} mode
201
+ - [ ] No hardcoded secrets or credentials
202
+ - [ ] Post-edit hooks were invoked
203
+
204
+ Return: PASS or FAIL with specific findings
205
+ `)
206
+
207
+ Task("tester", `
208
+ AGENT_ID="tester-${TASK_ID}"
209
+
210
+ TASK: Run comprehensive tests for: ${TASK_DESCRIPTION}
211
+
212
+ Execute:
213
+ 1. npm test -- --coverage
214
+ 2. Report pass/fail counts
215
+ 3. Report coverage percentages
216
+
217
+ Return: Test report with actual metrics, not estimates
218
+ `)
219
+ ```
220
+
221
+ **Step 5: Product Owner Decision**
222
+ ```bash
223
+ # Collect validator results
224
+ VALIDATOR_PASS_COUNT=0
225
+ VALIDATOR_TOTAL=2
226
+
227
+ for result in "${VALIDATOR_RESULTS[@]}"; do
228
+ if echo "$result" | grep -qi "PASS"; then
229
+ VALIDATOR_PASS_COUNT=$((VALIDATOR_PASS_COUNT + 1))
230
+ fi
231
+ done
232
+
233
+ CONSENSUS_RATE=$(echo "scale=2; $VALIDATOR_PASS_COUNT / $VALIDATOR_TOTAL" | bc)
234
+
235
+ # Mode-specific consensus thresholds
236
+ case $MODE in
237
+ "mvp") CONSENSUS_THRESHOLD="0.80" ;;
238
+ "standard") CONSENSUS_THRESHOLD="0.90" ;;
239
+ "enterprise") CONSENSUS_THRESHOLD="0.95" ;;
240
+ esac
241
+
242
+ if (( $(echo "$CONSENSUS_RATE >= $CONSENSUS_THRESHOLD" | bc -l) )); then
243
+ echo "PROCEED - Consensus reached ($CONSENSUS_RATE >= $CONSENSUS_THRESHOLD)"
244
+ else
245
+ echo "ITERATE - Consensus not met ($CONSENSUS_RATE < $CONSENSUS_THRESHOLD)"
246
+ # Loop back to Step 2
247
+ fi
248
+ ```
249
+
250
+ ---
251
+
252
+ ## Related Documentation
253
+
254
+ - **Full Task Mode Guide**: `.claude/commands/cfn-loop/cfn-loop-task.md`
255
+ - **CLI Mode Guide**: `.claude/commands/cfn-loop/cfn-loop-cli.md`
256
+ - **Gate Check Implementation**: `.claude/skills/cfn-loop-orchestration-v2/lib/orchestrator/src/helpers/gate-check.ts`
257
+
258
+ ---
259
+
260
+ **Version History:**
261
+ - v1.3.0 (2025-12-14) - Fixed to use test-based gate checks, not confidence scores
262
+ - v1.2.0 (2025-12-08) - Added TDD enforcement
263
+ - v1.1.0 (2025-12-01) - Added RuVector integration
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "enableAllProjectMcpServers": true,
15
15
  "enabledMcpjsonServers": [
16
- "shadcn"
16
+
17
17
  ],
18
18
  "disabledMcpjsonServers": [
19
19
  "n8n-mcp",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow-novice",
3
- "version": "2.18.19",
3
+ "version": "2.18.20",
4
4
  "description": "Claude Flow Novice - Advanced orchestration platform for multi-agent AI workflows with CFN Loop architecture\n\nIncludes Local RuVector Accelerator and all CFN skills for complete functionality.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,490 +0,0 @@
1
- ---
2
- description: "Execute CFN Loop in Task Mode with direct agent spawning (visible in main chat)"
3
- argument-hint: "<task description> [--mode=mvp|standard|enterprise]"
4
- allowed-tools: ["Task", "TodoWrite", "Read", "Bash", "SlashCommand"]
5
- ---
6
-
7
- # CFN Loop Task Mode - Direct Agent Spawning
8
-
9
- **Version:** 1.2.0 | **Date:** 2025-12-08 | **Status:** Production Ready
10
-
11
- 🚨 **v3.0 ARCHITECTURE:** Spawn agents directly with local MDAP orchestration support
12
-
13
- ---
14
-
15
- ## Quick Overview
16
-
17
- ### What is Task Mode?
18
-
19
- **v3.0 Task Mode Architecture:**
20
- - **Direct agent spawning** in main chat using Task() tool
21
- - **Visible execution** - all agent work shown in real-time
22
- - **Local MDAP support** - agents can use orchestrator for complex tasks
23
- - **No external dependencies** - works without Redis or Trigger.dev
24
-
25
- ### Task Mode vs CLI Mode
26
-
27
- | Feature | Task Mode | CLI Mode |
28
- |---------|-----------|----------|
29
- | Visibility | Full (agents in main chat) | Summary only |
30
- | Coordination | Manual (Task() tool) | Automated (local MDAP) |
31
- | External Deps | None | None |
32
- | Speed | Fast (direct spawning) | Fast (local orchestration) |
33
- | Control | High (manual workflow) | Automated (configured workflow) |
34
-
35
- ### When to Use Task Mode
36
-
37
- - **Debugging** - Need to see agent thought process
38
- - **Learning** - Understanding how agents work
39
- - **Complex coordination** - Require custom agent interactions
40
- - **Rapid prototyping** - Quick iteration with direct control
41
-
42
- ---
43
-
44
- ## TDD Enforcement
45
-
46
- **All agents spawned in CFN Loop must follow Test-Driven Development:**
47
-
48
- ```bash
49
- # Mandatory TDD Workflow for all agents:
50
- 1. Write tests BEFORE implementation (Red Phase)
51
- 2. Implement code to make tests pass (Green Phase)
52
- 3. Refactor while keeping tests passing (Refactor Phase)
53
- 4. Run tests after each implementation step
54
- 5. Ensure tests cover all functionality and edge cases
55
- ```
56
-
57
- **TDD Requirements:**
58
- - Test files must exist for each implementation file
59
- - Tests must be written at or before implementation time
60
- - All tests must pass before task completion
61
- - Minimum coverage thresholds apply (based on mode)
62
-
63
- **Post-Edit Pipeline (Required):**
64
- After ANY file modification, agents MUST invoke:
65
- ```bash
66
- ./.claude/hooks/cfn-invoke-post-edit.sh "$FILE_PATH" --agent-id "$AGENT_ID"
67
- ```
68
- This validates compilation and TDD compliance automatically.
69
-
70
- ---
71
-
72
- ## RuVector Integration
73
-
74
- **RuVector** (Rust-based vector database) provides semantic intelligence for Task Mode agents. Available features:
75
-
76
- **Semantic Codebase Search:**
77
- ```bash
78
- # Search codebase before implementing
79
- /codebase-search "authentication middleware patterns"
80
- # Returns: Relevant code snippets with semantic similarity scores
81
- ```
82
-
83
- **Stale Documentation Detection:**
84
- ```bash
85
- # Find outdated docs before refactoring
86
- /detect-stale-docs
87
- # Returns: Documents semantically distant from current code
88
- ```
89
-
90
- **Automatic Indexing:**
91
- ```bash
92
- # Reindex after major changes
93
- /codebase-reindex
94
- # Updates: Vector embeddings of all code files
95
- ```
96
-
97
- **Usage in Task Mode:**
98
- - Agents can call `/codebase-search` via Skill() tool before implementing
99
- - Main Chat can search context before spawning agents
100
- - Post-commit hook auto-reindexes (optional: `.claude/hooks/post-commit-codebase-index`)
101
-
102
- **Manual Learning & Error Tracking:**
103
- ```bash
104
- # After task failure - store error pattern for future avoidance
105
- ./.claude/skills/ruvector-codebase-index/store-error-pattern.sh \
106
- --task-id "task-123" \
107
- --error-type "TypeScript compilation" \
108
- --pattern "Missing type imports in multi-file refactor" \
109
- --context "Files: auth.ts, types.ts, middleware.ts" \
110
- --solution "Always add type imports before interface usage"
111
- ```
112
-
113
-
114
- ## Execution Instructions (AUTO-EXECUTE)
115
-
116
- **Step 1: Parse Arguments**
117
- ```bash
118
- # Extract task description (remove flags)
119
- TASK_DESCRIPTION="$ARGUMENTS"
120
- TASK_DESCRIPTION=$(echo "$TASK_DESCRIPTION" | sed 's/--mode[[:space:]]*[a-zA-Z]*//' | xargs)
121
-
122
- # Parse optional flags
123
- MODE="standard"
124
-
125
- for arg in $ARGUMENTS; do
126
- case $arg in
127
- --mode=*)
128
- MODE="${arg#*=}"
129
- ;;
130
- --mode)
131
- shift
132
- MODE="$1"
133
- ;;
134
- esac
135
- done
136
-
137
- # Validate mode
138
- if [[ ! "$MODE" =~ ^(mvp|standard|enterprise)$ ]]; then
139
- echo "❌ ERROR: Invalid mode '$MODE'. Must be one of: mvp, standard, enterprise"
140
- exit 1
141
- fi
142
- ```
143
-
144
- **Step 2: Generate Task ID**
145
- ```bash
146
- # Generate unique task ID
147
- TASK_ID="cfn-task-$(date +%s%N | tail -c 7)-${RANDOM}"
148
-
149
- echo "📋 Task ID: $TASK_ID"
150
- echo "🎯 Mode: $MODE"
151
- echo "📝 Task: ${TASK_DESCRIPTION:0:100}..."
152
- echo ""
153
- ```
154
-
155
- **Step 3: Spawn Task Mode Agents**
156
- ```bash
157
- # Define agent workflow based on mode
158
- case $MODE in
159
- "mvp")
160
- # MVP: Fast cycle with 2 agents
161
- echo "🚀 MVP Mode - Spawning 2 agents for rapid prototyping..."
162
- Task("backend-developer", `
163
- LIFECYCLE:
164
- AGENT_ID="backend-dev-${TASK_ID}"
165
-
166
- TASK: Implement MVP solution for: ${TASK_DESCRIPTION}
167
-
168
- TDD Requirements:
169
- - Write tests BEFORE implementation
170
- - Create test files for each implementation file
171
- - Ensure tests pass before completion
172
- - Run tests after each implementation step
173
- - Call post-edit pipeline after each file change
174
-
175
- RuVector Requirements:
176
- - Before implementing, query for similar patterns:
177
- /codebase-search "${TASK_DESCRIPTION}" --top 3
178
- - Query past errors: ./.claude/skills/cfn-ruvector-codebase-index/query-error-patterns.sh --task-description "${TASK_DESCRIPTION}"
179
- - Focus on speed over perfection but avoid duplication
180
-
181
- Use local MDAP orchestration for complex tasks:
182
- - Import from lib/mdap/orchestrator.js
183
- - Call orchestrate() with appropriate payload
184
- - Focus on speed over perfection
185
-
186
- Return: Implementation summary and confidence score
187
- `)
188
-
189
- Task("tester", `
190
- LIFECYCLE:
191
- AGENT_ID="tester-${TASK_ID}"
192
-
193
- TASK: Test MVP implementation for: ${TASK_DESCRIPTION}
194
-
195
- Create basic tests to verify core functionality:
196
- - Unit tests for key functions
197
- - Integration tests for main flows
198
- - Keep tests simple and fast
199
-
200
- Return: Test results and coverage summary
201
- `)
202
- ;;
203
-
204
- "standard")
205
- # Standard: Full workflow with 3-4 agents
206
- echo "🚀 Standard Mode - Spawning 3-4 agents for production quality..."
207
- Task("backend-developer", `
208
- LIFECYCLE:
209
- AGENT_ID="backend-dev-${TASK_ID}"
210
-
211
- TASK: Implement production solution for: ${TASK_DESCRIPTION}
212
-
213
- TDD Requirements:
214
- - Write tests BEFORE implementation (Red-Green-Refactor)
215
- - Create comprehensive test files for each implementation
216
- - Ensure >80% test coverage before completion
217
- - Run tests after each implementation step
218
- - Call post-edit pipeline after each file change
219
-
220
- RuVector Requirements:
221
- - Before implementing, ALWAYS query for similar patterns:
222
- /codebase-search "${TASK_DESCRIPTION}" --top 5
223
- /codebase-search "implementation pattern for ${TASK_DESCRIPTION}" --top 3
224
- - Query past errors and learnings:
225
- ./.claude/skills/cfn-ruvector-codebase-index/query-error-patterns.sh --task-description "${TASK_DESCRIPTION}"
226
- ./.claude/skills/cfn-ruvector-codebase-index/query-learnings.sh --task-description "${TASK_DESCRIPTION}" --category PATTERN
227
- - Use findings to avoid duplication and leverage existing solutions
228
-
229
- Use local MDAP orchestration for comprehensive development:
230
- - Import from lib/mdap/orchestrator.js
231
- - Call orchestrate() with mode: 'standard'
232
- - Include error handling and validation
233
- - Follow coding standards and best practices
234
-
235
- Return: Implementation details, files created/modified, confidence score
236
- `)
237
-
238
- Task("tester", `
239
- LIFECYCLE:
240
- AGENT_ID="tester-${TASK_ID}"
241
-
242
- TASK: Create comprehensive test suite for: ${TASK_DESCRIPTION}
243
-
244
- Develop full test coverage:
245
- - Unit tests (target >80% coverage)
246
- - Integration tests
247
- - Edge case testing
248
- - Performance tests if applicable
249
-
250
- Return: Test report with coverage metrics
251
- `)
252
-
253
- Task("code-reviewer", `
254
- LIFECYCLE:
255
- AGENT_ID="reviewer-${TASK_ID}"
256
-
257
- TASK: Review implementation and tests for: ${TASK_DESCRIPTION}
258
-
259
- Perform thorough code review:
260
- - Check code quality and standards
261
- - Verify security considerations
262
- - Assess performance implications
263
- - Validate test coverage
264
-
265
- Return: Review findings and recommendations
266
- `)
267
-
268
- # Optional security agent for sensitive tasks
269
- if [[ "$TASK_DESCRIPTION" =~ (auth|security|password|token|jwt|encryption| compliance) ]]; then
270
- Task("security-specialist", `
271
- LIFECYCLE:
272
- AGENT_ID="security-${TASK_ID}"
273
-
274
- TASK: Security audit for: ${TASK_DESCRIPTION}
275
-
276
- Conduct security review:
277
- - Identify vulnerabilities
278
- - Check OWASP top 10 compliance
279
- - Verify secure coding practices
280
- - Recommend security improvements
281
-
282
- Return: Security assessment report
283
- `)
284
- fi
285
- ;;
286
-
287
- "enterprise")
288
- # Enterprise: Comprehensive workflow with 5+ agents
289
- echo "🚀 Enterprise Mode - Spawning 5+ agents for compliance-grade solution..."
290
- Task("backend-developer", `
291
- LIFECYCLE:
292
- AGENT_ID="backend-dev-${TASK_ID}"
293
-
294
- TASK: Implement enterprise-grade solution for: ${TASK_DESCRIPTION}
295
-
296
- TDD Requirements:
297
- - Write tests BEFORE implementation (Strict TDD)
298
- - Create comprehensive test suites for each implementation
299
- - Ensure >95% test coverage before completion
300
- - Include integration, E2E, performance, and security tests
301
- - Run tests after each implementation step
302
- - Call post-edit pipeline after each file change
303
-
304
- RuVector Requirements:
305
- - Before implementing, perform comprehensive analysis:
306
- /codebase-search "${TASK_DESCRIPTION}" --top 10
307
- /codebase-search "enterprise implementation pattern for ${TASK_DESCRIPTION}" --top 5
308
- /codebase-search "compliance requirements for ${TASK_DESCRIPTION}" --top 3
309
- - Query all relevant knowledge bases:
310
- ./.claude/skills/cfn-ruvector-codebase-index/query-error-patterns.sh --task-description "${TASK_DESCRIPTION}"
311
- ./.claude/skills/cfn-ruvector-codebase-index/query-learnings.sh --task-description "${TASK_DESCRIPTION}" --category PATTERN
312
- ./.claude/skills/cfn-ruvector-codebase-index/query-learnings.sh --task-description "${TASK_DESCRIPTION}" --category COMPLIANCE
313
- - Document analysis and findings in implementation
314
-
315
- Use local MDAP orchestration with enterprise settings:
316
- - Import from lib/mdap/orchestrator.js
317
- - Call orchestrate() with mode: 'enterprise'
318
- - Include comprehensive error handling
319
- - Add extensive logging and monitoring
320
- - Ensure compliance with standards
321
-
322
- Return: Detailed implementation with compliance notes
323
- `)
324
-
325
- Task("tester", `
326
- LIFECYCLE:
327
- AGENT_ID="tester-${TASK_ID}"
328
-
329
- TASK: Create enterprise test suite for: ${TASK_DESCRIPTION}
330
-
331
- Develop comprehensive testing:
332
- - Unit tests (>95% coverage required)
333
- - Integration tests
334
- - End-to-end tests
335
- - Performance and load tests
336
- - Security tests
337
- - Compliance validation tests
338
-
339
- Return: Full test report with compliance metrics
340
- `)
341
-
342
- Task("code-reviewer", `
343
- LIFECYCLE:
344
- AGENT_ID="reviewer-${TASK_ID}"
345
-
346
- TASK: Enterprise code review for: ${TASK_DESCRIPTION}
347
-
348
- Perform rigorous review:
349
- - Code quality and maintainability
350
- - Performance optimization
351
- - Security best practices
352
- - Compliance requirements
353
- - Documentation completeness
354
-
355
- Return: Detailed review with compliance checklist
356
- `)
357
-
358
- Task("security-specialist", `
359
- LIFECYCLE:
360
- AGENT_ID="security-${TASK_ID}"
361
-
362
- TASK: Enterprise security assessment for: ${TASK_DESCRIPTION}
363
-
364
- Comprehensive security review:
365
- - Threat modeling
366
- - Vulnerability assessment
367
- - OWASP top 10 analysis
368
- - Compliance audit (GDPR, SOC2, etc.)
369
- - Security architecture review
370
-
371
- Return: Full security assessment with remediation plan
372
- `)
373
-
374
- Task("performance-specialist", `
375
- LIFECYCLE:
376
- AGENT_ID="performance-${TASK_ID}"
377
-
378
- TASK: Performance analysis for: ${TASK_DESCRIPTION}
379
-
380
- Evaluate performance characteristics:
381
- - Benchmark current performance
382
- - Identify bottlenecks
383
- - Optimization recommendations
384
- - Scalability assessment
385
- - Resource usage analysis
386
-
387
- Return: Performance report with optimization roadmap
388
- `)
389
- ;;
390
- esac
391
- ```
392
-
393
- **Step 4: Await Agent Completion**
394
- ```bash
395
- # Task Mode agents complete synchronously in main chat
396
- # No additional coordination needed - Task() tool handles completion
397
- echo ""
398
- echo "⏳ Waiting for agent completion..."
399
- echo ""
400
- echo "✅ All Task Mode agents spawned successfully"
401
- echo "📊 Results will appear as agents complete"
402
- ```
403
-
404
- **Step 5: Report Summary**
405
- ```bash
406
- # Collect results from completed agents
407
- # Results are visible in main chat as agents complete
408
-
409
- echo ""
410
- echo "=== TASK MODE SUMMARY ==="
411
- echo "Task ID: $TASK_ID"
412
- echo "Mode: $MODE"
413
- echo "Task: ${TASK_DESCRIPTION:0:200}..."
414
- echo ""
415
- echo "Review agent outputs above for:"
416
- echo " • Implementation details"
417
- echo " • Test results and coverage"
418
- echo " • Code review findings"
419
- echo " • Security assessment (if applicable)"
420
- echo " • Performance analysis (if applicable)"
421
- ```
422
-
423
- ---
424
-
425
- ## Gate Check Thresholds
426
-
427
- Loop 3 gate checks are based on test pass rates:
428
-
429
- | Mode | Pass Rate Threshold |
430
- |------|-------------------|
431
- | MVP | 70% |
432
- | Standard | 95% |
433
- | Enterprise | 98% |
434
-
435
- ---
436
-
437
- ## Security Considerations
438
-
439
- - All agent execution visible in main chat
440
- - No background processes or hidden coordination
441
- - Direct control over agent lifecycle
442
- - Local MDAP includes security validation
443
-
444
- ---
445
-
446
- ## Performance Characteristics
447
-
448
- - **Startup**: Instant (no external service initialization)
449
- - **Execution**: Parallel agent execution
450
- - **Memory**: Managed by main chat session
451
- - **Cleanup**: Automatic (no persistent processes)
452
-
453
- ---
454
-
455
- ## Local MDAP Integration
456
-
457
- Agents in Task Mode can use local MDAP:
458
-
459
- ```javascript
460
- // Agent can import and use MDAP orchestrator
461
- import { orchestrate } from "./lib/mdap/orchestrator.js";
462
-
463
- const result = await orchestrate({
464
- taskDescription: "Complex subtask",
465
- workDir: "./src",
466
- mode: "standard"
467
- });
468
- ```
469
-
470
- This allows:
471
- - Decomposition of complex tasks
472
- - Parallel implementation
473
- - Automated testing and validation
474
- - Iterative improvement
475
-
476
- ---
477
-
478
- ## Related Documentation
479
-
480
- - **CLI Mode Guide**: `.claude/commands/cfn-loop/cfn-loop-cli.md`
481
- - **Frontend CFN Loop**: `.claude/commands/cfn-loop/CFN_LOOP_FRONTEND.md`
482
- - **Agent Lifecycle**: `.claude/agents/SHARED_PROTOCOL.md`
483
- - **Post-Edit Pipeline**: `.claude/hooks/cfn-post-edit.config.json`
484
-
485
- ---
486
-
487
- **Version History:**
488
- - v1.2.0 (2025-12-08) - Added TDD enforcement and merged documentation
489
- - v1.1.0 (2025-12-01) - Added RuVector integration, semantic search
490
- - v1.0.0 (2025-10-28) - Initial Task mode implementation