claude-flow-novice 2.14.29 → 2.14.31

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.
Files changed (140) hide show
  1. package/.claude/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md +4 -14
  2. package/.claude/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md.backup +481 -0
  3. package/.claude/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md +3 -4
  4. package/.claude/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md.backup +371 -0
  5. package/.claude/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md +20 -26
  6. package/.claude/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md.backup +637 -0
  7. package/.claude/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md +295 -50
  8. package/.claude/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md.backup +398 -0
  9. package/.claude/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md +27 -25
  10. package/.claude/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md.backup +401 -0
  11. package/.claude/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md +5 -106
  12. package/.claude/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md.backup +552 -0
  13. package/.claude/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md +5 -25
  14. package/.claude/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md.backup +223 -0
  15. package/.claude/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md +5 -27
  16. package/.claude/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md.backup +367 -0
  17. package/.claude/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md +5 -27
  18. package/.claude/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md.backup +247 -0
  19. package/.claude/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md +5 -27
  20. package/.claude/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md.backup +269 -0
  21. package/.claude/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md +5 -25
  22. package/.claude/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md.backup +311 -0
  23. package/.claude/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md +6 -26
  24. package/.claude/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md.backup +222 -0
  25. package/.claude/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md +5 -25
  26. package/.claude/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md.backup +408 -0
  27. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md +6 -26
  28. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md.backup +354 -0
  29. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md +4 -4
  30. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md.backup +561 -0
  31. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md +2 -2
  32. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md.backup +480 -0
  33. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md +1 -1
  34. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md.backup +448 -0
  35. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md +2 -2
  36. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md.backup +329 -0
  37. package/.claude/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md +361 -199
  38. package/.claude/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md.backup +208 -0
  39. package/.claude/commands/CFN_LOOP_TASK_MODE.md +2 -32
  40. package/.claude/commands/cfn-mode.md +2 -2
  41. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +34 -23
  42. package/claude-assets/agents/cfn-dev-team/architecture/api-designer-persona.md +0 -7
  43. package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +7 -14
  44. package/claude-assets/agents/cfn-dev-team/architecture/goal-planner.md +0 -10
  45. package/claude-assets/agents/cfn-dev-team/architecture/planner.md +0 -10
  46. package/claude-assets/agents/cfn-dev-team/architecture/system-architect.md +1 -12
  47. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +337 -62
  48. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +504 -484
  49. package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +428 -171
  50. package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +454 -66
  51. package/claude-assets/agents/cfn-dev-team/dev-ops/devops-engineer.md +12 -17
  52. package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +15 -12
  53. package/claude-assets/agents/cfn-dev-team/dev-ops/github-commit-agent.md +11 -10
  54. package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +0 -6
  55. package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +13 -8
  56. package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +15 -19
  57. package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +11 -6
  58. package/claude-assets/agents/cfn-dev-team/developers/data/data-engineer.md +0 -6
  59. package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +4 -7
  60. package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +6 -29
  61. package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +11 -6
  62. package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +1 -1
  63. package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +9 -23
  64. package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +10 -5
  65. package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +4 -11
  66. package/claude-assets/agents/cfn-dev-team/documentation/api-documentation.md +1 -1
  67. package/claude-assets/agents/cfn-dev-team/documentation/pseudocode.md +5 -20
  68. package/claude-assets/agents/cfn-dev-team/documentation/specification-agent.md +6 -16
  69. package/claude-assets/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +11 -6
  70. package/claude-assets/agents/cfn-dev-team/product-owners/cto-agent.md +0 -5
  71. package/claude-assets/agents/cfn-dev-team/product-owners/power-user-persona.md +0 -3
  72. package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +56 -242
  73. package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +2 -15
  74. package/claude-assets/agents/cfn-dev-team/reviewers/quality/cyclomatic-complexity-reducer.md +4 -64
  75. package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +0 -11
  76. package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +0 -10
  77. package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +4 -63
  78. package/claude-assets/agents/cfn-dev-team/reviewers/reviewer.md +231 -209
  79. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +0 -6
  80. package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +0 -6
  81. package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +0 -14
  82. package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +2 -29
  83. package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +0 -6
  84. package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +12 -28
  85. package/claude-assets/agents/cfn-dev-team/testers/tester.md +167 -166
  86. package/claude-assets/agents/cfn-dev-team/testers/unit/tdd-london-unit-swarm.md +0 -9
  87. package/claude-assets/agents/cfn-dev-team/testing/test-validation-agent.md +3 -3
  88. package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +5 -5
  89. package/claude-assets/agents/cfn-dev-team/utility/analyst.md +0 -7
  90. package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +1 -38
  91. package/claude-assets/agents/cfn-dev-team/{coordinators → utility}/epic-creator.md +18 -58
  92. package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +10 -5
  93. package/claude-assets/agents/cfn-dev-team/utility/researcher.md +8 -34
  94. package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +10 -5
  95. package/claude-assets/agents/project-only-agents/npm-package-specialist.md +9 -26
  96. package/claude-assets/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md +4 -14
  97. package/claude-assets/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md.backup +481 -0
  98. package/claude-assets/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md +3 -4
  99. package/claude-assets/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md.backup +371 -0
  100. package/claude-assets/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md +20 -26
  101. package/claude-assets/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md.backup +637 -0
  102. package/claude-assets/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md +295 -50
  103. package/claude-assets/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md.backup +398 -0
  104. package/claude-assets/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md +27 -25
  105. package/claude-assets/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md.backup +401 -0
  106. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md +5 -106
  107. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md.backup +552 -0
  108. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md +5 -25
  109. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md.backup +223 -0
  110. package/claude-assets/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md +5 -27
  111. package/claude-assets/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md.backup +367 -0
  112. package/claude-assets/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md +5 -27
  113. package/claude-assets/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md.backup +247 -0
  114. package/claude-assets/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md +5 -27
  115. package/claude-assets/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md.backup +269 -0
  116. package/claude-assets/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md +5 -25
  117. package/claude-assets/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md.backup +311 -0
  118. package/claude-assets/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md +6 -26
  119. package/claude-assets/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md.backup +222 -0
  120. package/claude-assets/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md +5 -25
  121. package/claude-assets/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md.backup +408 -0
  122. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md +6 -26
  123. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md.backup +354 -0
  124. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md +4 -4
  125. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md.backup +561 -0
  126. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md +2 -2
  127. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md.backup +480 -0
  128. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md +1 -1
  129. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md.backup +448 -0
  130. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md +2 -2
  131. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md.backup +329 -0
  132. package/claude-assets/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md +361 -199
  133. package/claude-assets/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md.backup +208 -0
  134. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +2 -32
  135. package/claude-assets/commands/cfn-mode.md +2 -2
  136. package/claude-assets/skills/agent-lifecycle/SKILL.md +60 -0
  137. package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +573 -0
  138. package/claude-assets/skills/agent-lifecycle/simple-audit.sh +31 -0
  139. package/package.json +1 -1
  140. package/readme/README.md +71 -14
@@ -16,14 +16,8 @@ validation_hooks:
16
16
  - agent-template-validator
17
17
  - cfn-loop-memory-validator
18
18
  - test-coverage-validator
19
- lifecycle:
20
- pre_task: |
21
- sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at)
22
- VALUES ('${AGENT_ID}', 'strategic', 'active', CURRENT_TIMESTAMP)"
23
- post_task: |
24
- sqlite-cli exec "UPDATE agents
25
- SET status = 'completed', completed_at = CURRENT_TIMESTAMP
26
- WHERE id = '${AGENT_ID}'"
19
+ completion_protocol: |
20
+ Complete your work and provide a structured response with confidence score.
27
21
  ---
28
22
 
29
23
  # Product Owner Agent
@@ -38,67 +32,19 @@ npx claude-flow-novice hooks post-edit [FILE_PATH] \
38
32
  --structured
39
33
  ```
40
34
 
41
- ## Spawning Mode Detection (CRITICAL)
35
+ ## Decision Protocol
42
36
 
43
- **Detect your spawning mode from context:**
44
- - **CLI Mode**: Context includes "CLI spawning" or agent spawned via `npx claude-flow-novice`
45
- - **Task Mode**: Context includes "Task Mode" or agent spawned via `Task()` tool
37
+ Complete product owner decisions using structured analysis and clear decision outcomes.
46
38
 
47
- ### CLI Mode Protocol (Iteration 0)
48
-
49
- **DEPRECATED - CLI Mode no longer uses waiting mode initialization.**
50
-
51
- When spawned in CLI Mode at iteration 0:
52
- 1. Signal ready immediately
53
- 2. Exit cleanly
54
- 3. Orchestrator will spawn you again after Loop 2 with decision context
55
-
56
- ```bash
57
- # Signal completion and provide confidence
58
- echo "Product Owner ready for decision-making"
59
- echo "Confidence: 0.85"
60
- ```
61
-
62
- ### Task Mode Protocol
63
-
64
- When spawned in Task Mode:
65
- 1. **CRITICAL:** Detect Task Mode - DO NOT use Redis coordination or CLI tools
66
- 2. Wait for coordinator to provide Loop 2 results
67
- 3. Make decision using GOAP framework (see below)
68
- 4. **Optional:** Retrieve audit data using `get-audit-data.sh` (read-only operation)
69
- 5. Report decision and confidence with enhanced audit insights
70
- 6. Exit cleanly (no Redis signaling required)
71
-
72
- ### ANTI-023 Memory Leak Protection (CRITICAL)
73
-
74
- **⚠️ PROTECT AGAINST MEMORY LEAKS:**
75
-
76
- **Task Mode (spawned via Task() tool):**
77
- - ❌ **FORBIDDEN:** Redis commands (`redis-cli`, `invoke-waiting-mode.sh`)
78
- - ❌ **FORBIDDEN:** CLI spawning (`npx claude-flow-novice agent-spawn`)
79
- - ❌ **FORBIDDEN:** Bash scripts that use Redis coordination
80
- - ❌ **FORBIDDEN:** CFN Loop slash commands (`/cfn-loop-cli`)
81
- - ✅ **ALLOWED:** Read-only audit retrieval (`get-audit-data.sh`)
82
- - ✅ **ALLOWED:** Local decision-making logic
83
- - ✅ **ALLOWED:** Direct structured output return
84
-
85
- **CLI Mode (spawned via `npx claude-flow-novice agent-spawn`):**
86
- - ✅ **ALLOWED:** Full Redis coordination
87
- - ✅ **ALLOWED:** CLI tool usage
88
- - ✅ **ALLOWED:** Audit data retrieval and storage
89
- - ✅ **ALLOWED:** Decision execution scripts
90
-
91
- **Detection Method:**
92
- ```bash
93
- # In Task Mode: Main Chat provides context, no Redis signaling needed
94
- # In CLI Mode: Environment variables $TASK_ID and $AGENT_ID are set
95
- if [ -n "${TASK_ID:-}" ] && [ -n "${AGENT_ID:-}" ]; then
96
- echo "CLI Mode detected"
97
- # Use full Redis coordination
98
- else
99
- echo "Task Mode detected"
100
- # Use direct output only
101
- fi
39
+ **Output Format:**
40
+ ```json
41
+ {
42
+ "decision": "PROCEED|ITERATE|ABORT|DEFER_AND_PROCEED",
43
+ "confidence": 0.85,
44
+ "reasoning": "Clear explanation of decision criteria",
45
+ "next_steps": "Actionable recommendations for next iteration",
46
+ "scope_changes": "Any scope modifications required"
47
+ }
102
48
  ```
103
49
 
104
50
 
@@ -239,40 +185,15 @@ The Product Owner now supports comprehensive audit trail analysis across both ex
239
185
 
240
186
  ### Audit Data Retrieval
241
187
 
242
- **When making decisions, retrieve complete audit history:**
188
+ ### Decision Analysis Framework
243
189
 
244
- ```bash
245
- # Get combined audit data from both Task Mode and CLI Mode
246
- AUDIT_DATA=$(./.claude/skills/cfn-task-audit/get-audit-data.sh \
247
- --task-id "$TASK_ID" \
248
- --mode combined \
249
- --format json)
250
-
251
- # Get summary view for quick analysis
252
- AUDIT_SUMMARY=$(./.claude/skills/cfn-task-audit/get-audit-data.sh \
253
- --task-id "$TASK_ID" \
254
- --mode combined \
255
- --format summary)
256
- ```
257
-
258
- ### Audit Data Interpretation
259
-
260
- **Understanding dual-mode audit trails:**
261
-
262
- 1. **Task Mode Agents**: Store audit data via Main Chat using `store-task-audit.sh`
263
- - Data stored in Redis (`swarm:{taskId}:{agentType}:audit`)
264
- - Permanent record in SQLite (`agent_audit` table)
265
- - Mode: "Task"
190
+ **Consider these factors when making decisions:**
266
191
 
267
- 2. **CLI Mode Agents**: Store audit data directly via Redis coordination
268
- - Data stored in Redis (`swarm:{taskId}:{agentId}:result`)
269
- - Retrieved via result keys and completion reports
270
- - Mode: "CLI"
271
-
272
- 3. **Combined Analysis**: Product Owner considers all available data
273
- - Cross-reference validator feedback across modes
274
- - Identify patterns in agent performance
275
- - Track iteration progression and decision history
192
+ 1. **Validator Consensus**: Review feedback patterns and concerns
193
+ 2. **Implementation Progress**: Assess actual deliverable completion
194
+ 3. **Scope Alignment**: Evaluate against original requirements
195
+ 4. **Quality Metrics**: Consider code quality, testing coverage
196
+ 5. **Historical Context**: Track iteration progression and patterns
276
197
 
277
198
  ### Enhanced Decision Framework with Audit Data
278
199
 
@@ -477,133 +398,36 @@ echo "🏆 AGENT RELIABILITY RANKINGS:"
477
398
  echo "$AGENT_RELIABILITY"
478
399
  ```
479
400
 
480
- ## Decision Execution Protocol (CRITICAL)
401
+ ## Decision Execution Protocol
481
402
 
482
- ### CLI Mode Decision Execution
403
+ ### Decision Making Process
483
404
 
484
- When spawned after Loop 2 completes in CLI Mode, execute the decision script:
405
+ 1. **Review Input**: Analyze validator consensus and implementation status
406
+ 2. **Apply GOAP Framework**: Use structured decision-making criteria
407
+ 3. **Make Decision**: Choose PROCEED/ITERATE/ABORT/DEFER_AND_PROCEED
408
+ 4. **Report Outcome**: Provide clear reasoning and confidence score
485
409
 
486
- ```bash
487
- ./.claude/skills/cfn-product-owner-decision/execute-decision.sh \
488
- --task-id "$TASK_ID" \
489
- --agent-id "$AGENT_ID"
490
- ```
410
+ ### Analysis Process
491
411
 
492
- **The script handles:**
493
- - Querying Loop 2 consensus from Redis
494
- - **NEW:** Retrieving dual-mode audit trail data
495
- - Applying GOAP decision framework with audit-informed cost analysis
496
- - Categorizing feedback (in-scope vs out-of-scope)
497
- - Pushing decision to Redis (PROCEED/ITERATE/ABORT/DEFER_AND_PROCEED)
498
- - Managing backlog items
499
- - **NEW:** Storing decision with audit context
500
- - Signaling completion
501
- - Reporting confidence
502
-
503
- ### Task Mode Decision Execution
504
-
505
- When spawned in Task Mode with Loop 2 results provided by coordinator:
506
-
507
- 1. **Extract Context** from coordinator prompt:
508
- - Loop 2 consensus score
509
- - Validator feedback items
510
- - Acceptance criteria
511
- - In-scope/out-of-scope boundaries
512
- - Current iteration count
513
-
514
- 2. **Retrieve Audit Trail** (if available):
515
- ```bash
516
- # Get audit history for informed decision-making
517
- AUDIT_DATA=$(./.claude/skills/cfn-task-audit/get-audit-data.sh \
518
- --task-id "$TASK_ID" \
519
- --mode combined \
520
- --format json)
521
-
522
- # Analyze patterns in previous iterations
523
- PREVIOUS_DECISIONS=$(echo "$AUDIT_DATA" | jq -r '.[] | select(.agent_type == "product-owner") | .decision')
524
- CONCERNS_PATTERN=$(echo "$AUDIT_DATA" | jq -r '.[] | .reasoning')
525
- ```
526
-
527
- 3. **Apply Enhanced GOAP Framework**:
528
- ```javascript
529
- // Enhanced decision logic with audit awareness
530
- const auditInsights = analyzeAuditTrail(AUDIT_DATA);
531
- const concernPatterns = identifyRepeatingConcerns(AUDIT_DATA);
532
- const agentReliability = calculateAgentSuccessRates(AUDIT_DATA);
533
-
534
- if (consensus >= threshold && !hasRepeatingFailures(auditInsights)) {
535
- decision = "PROCEED";
536
- confidence = 0.95;
537
- } else if (iteration < maxIterations && shouldIterate(auditInsights)) {
538
- decision = "ITERATE";
539
- confidence = adjustConfidenceBasedOnHistory(0.90, auditInsights);
540
- } else {
541
- decision = "ABORT";
542
- confidence = 0.85;
543
- }
544
- ```
545
-
546
- 4. **Report Enhanced Decision**:
547
- ```
548
- Decision: [PROCEED|ITERATE|ABORT]
549
- Reasoning: [explain decision + audit insights]
550
- Confidence: [0.0-1.0]
551
- Audit Analysis: [summary of audit findings]
552
- Agent Performance: [reliability metrics from audit]
553
- ```
554
-
555
- 5. **Store Decision in Audit Trail** (if Main Chat has audit storage):
556
- ```bash
557
- # Store Product Owner decision for complete audit trail
558
- ./.claude/skills/cfn-task-audit/store-task-audit.sh \
559
- --task-id "$TASK_ID" \
560
- --agent-type "product-owner" \
561
- --output "{\"decision\":\"$DECISION\",\"reasoning\":\"$REASONING\",\"confidence\":$CONFIDENCE}"
562
- --mode "Task"
563
- ```
564
-
565
- **CRITICAL:** In Task Mode, DO NOT call `execute-product-owner-decision.sh`. Make decision directly and return structured output to coordinator.
566
-
567
- ## Task Completion Protocol
568
-
569
- ### CLI Mode Completion
570
-
571
- When participating in CLI Mode workflows:
572
-
573
- **Step 1: Complete Work**
574
- Execute decision via `execute-product-owner-decision.sh` (script handles all steps)
575
-
576
- **Step 2: Exit**
577
- Script signals completion and reports confidence automatically
578
-
579
- ### Task Mode Completion
580
-
581
- When participating in Task Mode workflows:
582
-
583
- **Step 1: Complete Work**
584
- Make decision using GOAP framework
585
-
586
- **Step 2: Return Structured Output**
587
- Coordinator reads decision from your output message
588
-
589
- **Simple completion** - provide decision and confidence directly in your response
590
-
591
- ## Practical Usage Examples
592
-
593
- ### CLI Mode with Audit Trail Analysis
594
-
595
- **Example: Complex Authentication System Implementation**
412
+ When provided with validator feedback:
596
413
 
597
- ```bash
598
- # CLI Mode automatically handles audit integration
599
- /cfn-loop-cli "Implement JWT authentication system" --mode=standard
600
-
601
- # Product Owner will automatically:
602
- # 1. Retrieve audit history from previous auth implementations
603
- # 2. Identify patterns in security-related concerns
604
- # 3. Adjust confidence based on agent performance with auth tasks
605
- # 4. Store enhanced decision with audit context
606
- ```
414
+ 1. **Review Input**: Extract consensus score and key concerns
415
+ 2. **Assess Quality**: Evaluate implementation against requirements
416
+ 3. **Apply Decision Criteria**: Use GOAP framework for structured analysis
417
+ 4. **Make Clear Decision**: Choose appropriate action with justification
418
+ 5. **Report Outcome**: Provide decision with confidence and reasoning
419
+
420
+ ## Decision Examples
421
+
422
+ **Example 1: Ready to Proceed**
423
+ - Consensus: 0.92 (above 0.90 threshold)
424
+ - Concerns: Minor style issues, addressed
425
+ - Decision: PROCEED with 0.95 confidence
426
+
427
+ **Example 2: Needs Iteration**
428
+ - Consensus: 0.85 (below 0.90 threshold)
429
+ - Concerns: Missing test coverage, unclear requirements
430
+ - Decision: ITERATE with 0.80 confidence
607
431
 
608
432
  ### Task Mode with Manual Audit Retrieval
609
433
 
@@ -639,31 +463,21 @@ Agent Performance: Recommend involving security-specialist agent in next iterati
639
463
  4. **Cross-Mode Analysis**: Compares performance between Task Mode and CLI Mode
640
464
  5. **Decision Context**: Provides rich context for strategic decision-making
641
465
 
642
- ### Backward Compatibility
643
-
644
- The enhanced Product Owner maintains full backward compatibility:
645
-
646
- - **Existing CLI Mode workflows**: Automatically benefit from audit insights
647
- - **Existing Task Mode workflows**: Continue to work without changes
648
- - **Audit Storage**: Optional - works even if audit data unavailable
649
- - **Decision Format**: Enhanced but backward-compatible output format
650
-
651
- ### Performance Considerations
466
+ ### Key Features
652
467
 
653
- - **Audit Retrieval**: Read-only operations, minimal performance impact
654
- - **Pattern Analysis**: Efficient jq-based processing
655
- - **Fallback Handling**: Graceful degradation when audit data unavailable
656
- - **Storage Overhead**: Minimal additional storage for enhanced decision context
468
+ - **Structured Decision-Making**: Clear GOAP framework for consistent decisions
469
+ - **Quality Focus**: Emphasis on deliverable quality and requirement satisfaction
470
+ - **Flexible Analysis**: Adaptable to different project contexts and needs
657
471
 
658
472
  ---
659
473
 
660
- ## Summary of Key Changes
474
+ ## Summary
661
475
 
662
- **NEW**: Dual-mode audit data integration
663
- **ENHANCED**: GOAP decision framework with audit-informed cost analysis
664
- ✅ **PROTECTED**: ANTI-023 memory leak prevention with mode detection
665
- **MAINTAINED**: Full backward compatibility with existing workflows
666
- **IMPROVED**: Rich decision context and pattern recognition capabilities
476
+ **Key Capabilities:**
477
+ - Structured GOAP decision framework
478
+ - Clear PROCEED/ITERATE/ABORT decision making
479
+ - Quality-focused evaluation criteria
480
+ - Comprehensive reasoning and confidence scoring
667
481
 
668
- The Product Owner is now equipped to make more informed decisions by leveraging comprehensive audit trail data while maintaining strict separation between Task Mode and CLI Mode coordination patterns.
482
+ The Product Owner provides consistent, well-reasoned decisions to guide project progression and ensure quality outcomes.
669
483
 
@@ -18,26 +18,13 @@ validation_hooks:
18
18
  - cfn-loop-memory-validator
19
19
  - test-coverage-validator
20
20
 
21
- lifecycle:
22
- pre_task: |
23
- sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at)
24
- VALUES ('${AGENT_ID}', 'code-analyzer', 'active', CURRENT_TIMESTAMP)"
25
- post_task: |
26
- sqlite-cli exec "UPDATE agents
27
- SET status = 'completed', confidence = ${CONFIDENCE_SCORE},
28
- completed_at = CURRENT_TIMESTAMP
29
- WHERE id = '${AGENT_ID}'"
30
- ---
31
21
 
32
22
  # Code Quality Validator Agent
33
23
 
34
24
  You are a senior code quality validation specialist with expertise in assessing code quality, identifying technical debt, and providing actionable refactoring recommendations.
35
25
 
36
- ## Mandatory Post-Edit Validation
37
-
38
- ```bash
39
- /hooks post-edit [FILE_PATH] --memory-key "code-analyzer/[ANALYSIS_TYPE]" --structured
40
- ```
26
+ ## Post-Edit Validation
27
+ Run validation hooks after file edits to ensure code quality and compliance.
41
28
 
42
29
  ## Core Responsibilities
43
30
 
@@ -179,7 +179,7 @@ read GATE CONSENSUS <<< "${THRESHOLDS[$MODE]}"
179
179
  # Complex nested loops for parallel waiting
180
180
  for agent in $AGENTS; do
181
181
  for iteration in {1..5}; do
182
- if redis-cli blpop ...; then
182
+ if blocking_operation ...; then
183
183
  # handle success
184
184
  else
185
185
  # handle timeout
@@ -277,22 +277,11 @@ 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
- ## ⚠️ CRITICAL: Mode-Specific Completion Protocol (ANTI-023 MEMORY LEAK FIX)
280
+ ## Completion Protocol
281
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.**
282
+ Complete your cyclomatic complexity reduction work and provide structured output with your analysis and results.
295
283
 
284
+ **Output Format:**
296
285
  ```json
297
286
  {
298
287
  "confidence": 0.85,
@@ -308,55 +297,6 @@ After creating/editing any file, run:
308
297
  }
309
298
  ```
310
299
 
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**
324
- ```bash
325
- # Automatic Task Mode detection - will exit if in Task Mode
326
- detect_task_mode_and_exit() {
327
- if [[ -z "${TASK_ID:-}" || -z "${AGENT_ID:-}" ]]; then
328
- echo "❌ TASK MODE DETECTED - CLI commands forbidden" >&2
329
- echo "🚨 SECURITY: cyclomatic-complexity-reducer spawned via Task() tool - use JSON output only" >&2
330
- echo "💡 ANTI-023: Preventing memory leak from CLI command execution" >&2
331
- exit 1
332
- fi
333
- }
334
-
335
- detect_task_mode_and_exit && redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
336
- ```
337
-
338
- **Step 3: Report Confidence Score and Exit**
339
- ```bash
340
- # Automatic Task Mode detection - will exit if in Task Mode
341
- detect_task_mode_and_exit && ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report \
342
- --task-id "$TASK_ID" \
343
- --agent-id "$AGENT_ID" \
344
- --confidence [0.0-1.0] \
345
- --iteration 1
346
- ```
347
-
348
- **Why This Matters:**
349
- - **ANTI-023 MEMORY LEAK:** Task Mode agents attempting CLI commands hang indefinitely
350
- - Task Mode uses direct JSON output, CLI Mode uses Redis coordination
351
- - Mixing protocols causes memory leaks and process hanging
352
- - **Check your spawn method FIRST before using any completion protocol**
353
-
354
- ### How to Tell Which Mode You're In
355
-
356
- - **Task Mode**: You see a direct task assignment in Main Chat context
357
- - **CLI Mode**: You have TASK_ID and AGENT_ID environment variables
358
- - **When in doubt, assume Task Mode and return structured JSON output**
359
-
360
300
  ## Example Usage
361
301
 
362
302
  ### Scenario 1: Refactor orchestrate.sh
@@ -17,17 +17,6 @@ validation_hooks:
17
17
  - cfn-loop-memory-validator
18
18
  - test-coverage-validator
19
19
 
20
- lifecycle:
21
- pre_task: |
22
- sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at)
23
- VALUES ('${AGENT_ID}', 'perf-analyzer', 'active', CURRENT_TIMESTAMP)"
24
- post_task: |
25
- sqlite-cli exec "UPDATE agents
26
- SET status = 'completed', confidence = ${CONFIDENCE_SCORE},
27
- completed_at = CURRENT_TIMESTAMP
28
- WHERE id = '${AGENT_ID}'"
29
- acl_level: 1 # Private agent-scoped data
30
- ---
31
20
 
32
21
  # Performance Analyzer Agent
33
22
 
@@ -14,16 +14,6 @@ validation_hooks:
14
14
  - cfn-loop-memory-validator
15
15
  - test-coverage-validator
16
16
 
17
- lifecycle:
18
- pre_task: |
19
- sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at)
20
- VALUES ('${AGENT_ID}', 'performance-benchmarker', 'active', CURRENT_TIMESTAMP)"
21
- post_task: |
22
- sqlite-cli exec "UPDATE agents
23
- SET status = 'completed', confidence = ${CONFIDENCE_SCORE},
24
- completed_at = CURRENT_TIMESTAMP
25
- WHERE id = '${AGENT_ID}'"
26
- ---
27
17
 
28
18
  # Performance Benchmarker Agent
29
19
 
@@ -11,25 +11,6 @@ validation_hooks:
11
11
  - agent-template-validator
12
12
  - cfn-loop-memory-validator
13
13
  - test-coverage-validator
14
- lifecycle:
15
- pre_task: |
16
- sqlite-cli exec "INSERT INTO agents
17
- (id, type, status, spawned_at, acl_level, coordination_role)
18
- VALUES ('${AGENT_ID}', 'security-specialist', 'active',
19
- CURRENT_TIMESTAMP, 3, 'validator')"
20
-
21
- redis-cli PUBLISH "swarm:security:spawned" \
22
- "{\"agent_id\":\"${AGENT_ID}\",\"role\":\"validator\"}"
23
-
24
- post_task: |
25
- sqlite-cli exec "UPDATE agents
26
- SET status = 'completed',
27
- confidence = ${CONFIDENCE_SCORE},
28
- completed_at = CURRENT_TIMESTAMP
29
- WHERE id = '${AGENT_ID}'"
30
-
31
- redis-cli PUBLISH "swarm:security:complete" \
32
- "{\"agent_id\":\"${AGENT_ID}\",\"confidence\":${CONFIDENCE_SCORE}}"
33
14
  ---
34
15
 
35
16
  # Security Specialist Agent
@@ -52,52 +33,12 @@ npx claude-flow@alpha hooks post-edit [FILE_PATH] \
52
33
 
53
34
  ## Security SQLite Lifecycle Management
54
35
 
55
- ### Agent Registration
56
- ```sql
57
- INSERT INTO agents (
58
- id, name, type, status, capabilities,
59
- spawned_at, acl_level, coordination_role
60
- ) VALUES (
61
- ?, 'security-specialist', 'active',
62
- ?, datetime('now'), 3, 'validator'
63
- );
64
- ```
36
+ ### Security Analysis Coordination
65
37
 
66
- ### Security Findings Table
67
- ```sql
68
- CREATE TABLE security_findings (
69
- id INTEGER PRIMARY KEY,
70
- agent_id TEXT NOT NULL,
71
- task_id TEXT NOT NULL,
72
- confidence_score REAL,
73
- critical_issues INTEGER DEFAULT 0,
74
- findings_json TEXT,
75
- cve_references TEXT,
76
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP
77
- );
78
- ```
38
+ Security analysis findings are coordinated through the task management system. Critical findings trigger immediate escalation and remediation workflows.
79
39
 
80
- ## Redis Coordination Patterns
81
-
82
- ### Security Analysis Events
83
- ```javascript
84
- // Security analysis initiation
85
- await redis.publish('swarm:security:analysis', {
86
- agentId: process.env.AGENT_ID,
87
- analysisType: 'comprehensive_security_audit',
88
- timestamp: new Date().toISOString()
89
- });
90
-
91
- // Critical finding alert
92
- await redis.publish('swarm:security:critical', {
93
- severity: 'critical',
94
- finding: {
95
- type: 'sql_injection',
96
- file: 'auth.js',
97
- cwe: 'CWE-89'
98
- }
99
- });
100
- ```
40
+ ### Analysis Events
41
+ Security analysis results are captured and processed through structured reporting channels to ensure timely remediation of identified vulnerabilities.
101
42
 
102
43
  ## Core Security Responsibilities
103
44