claude-flow-novice 2.14.3 → 2.14.5

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 (194) hide show
  1. package/.claude/commands/CFN_LOOP_TASK_MODE.md +4 -47
  2. package/.claude/commands/seo/SEO_TASK_MODE.md +892 -0
  3. package/.claude/commands/seo/seo-blog.md +428 -0
  4. package/.claude/commands/seo/seo-landing.md +91 -0
  5. package/.claude/commands/seo/seo-product.md +104 -0
  6. package/.claude/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -276
  7. package/claude-assets/agents/cfn-dev-team/coordinators/epic-creator.md +120 -0
  8. package/claude-assets/agents/cfn-seo-team/AGENT_CREATION_REPORT.md +481 -0
  9. package/claude-assets/agents/cfn-seo-team/DELEGATION_MATRIX.md +371 -0
  10. package/claude-assets/agents/cfn-seo-team/HUMANIZER_PROMPTS.md +536 -0
  11. package/claude-assets/agents/cfn-seo-team/INTEGRATION_REQUIREMENTS.md +642 -0
  12. package/claude-assets/agents/cfn-seo-team/cfn-seo-coordinator.md +414 -0
  13. package/claude-assets/agents/cfn-seo-team/competitive-seo-analyst.md +423 -0
  14. package/claude-assets/agents/cfn-seo-team/content-atomization-specialist.md +580 -0
  15. package/claude-assets/agents/cfn-seo-team/content-seo-strategist.md +245 -0
  16. package/claude-assets/agents/cfn-seo-team/eeat-content-auditor.md +389 -0
  17. package/claude-assets/agents/cfn-seo-team/geo-optimization-expert.md +269 -0
  18. package/claude-assets/agents/cfn-seo-team/link-building-specialist.md +291 -0
  19. package/claude-assets/agents/cfn-seo-team/local-seo-optimizer.md +333 -0
  20. package/claude-assets/agents/cfn-seo-team/programmatic-seo-engineer.md +244 -0
  21. package/claude-assets/agents/cfn-seo-team/schema-markup-engineer.md +430 -0
  22. package/claude-assets/agents/cfn-seo-team/seo-analytics-specialist.md +376 -0
  23. package/claude-assets/agents/cfn-seo-team/seo-validators/accessibility-validator.md +565 -0
  24. package/claude-assets/agents/cfn-seo-team/seo-validators/audience-validator.md +484 -0
  25. package/claude-assets/agents/cfn-seo-team/seo-validators/branding-validator.md +452 -0
  26. package/claude-assets/agents/cfn-seo-team/seo-validators/humanizer-validator.md +333 -0
  27. package/claude-assets/agents/cfn-seo-team/technical-seo-specialist.md +228 -0
  28. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +4 -47
  29. package/claude-assets/commands/seo/SEO_TASK_MODE.md +892 -0
  30. package/claude-assets/commands/seo/seo-blog.md +428 -0
  31. package/claude-assets/commands/seo/seo-landing.md +91 -0
  32. package/claude-assets/commands/seo/seo-product.md +104 -0
  33. package/claude-assets/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -276
  34. package/claude-assets/skills/seo-orchestration/SKILL.md +292 -0
  35. package/claude-assets/skills/seo-orchestration/orchestrate-seo.sh +566 -0
  36. package/claude-assets/skills/seo-orchestration/orchestrate-seo.sh.backup +755 -0
  37. package/claude-assets/skills/seo-orchestration/validate-consensus.sh +270 -0
  38. package/dist/agents/agent-loader.js +165 -146
  39. package/dist/agents/agent-loader.js.map +1 -1
  40. package/dist/cli/agent-prompt-builder.js +25 -0
  41. package/dist/cli/agent-prompt-builder.js.map +1 -1
  42. package/package.json +1 -1
  43. package/.claude/skills/cfn-redis-coordination/HEARTBEAT.md +0 -57
  44. package/.claude/skills/cfn-redis-coordination/HEARTBEAT_MONITORING.md +0 -267
  45. package/.claude/skills/cfn-redis-coordination/LOGGING.md +0 -260
  46. package/.claude/skills/cfn-redis-coordination/README.md +0 -65
  47. package/.claude/skills/cfn-redis-coordination/SECURITY_REVIEW.md +0 -25
  48. package/.claude/skills/cfn-redis-coordination/SHUTDOWN_HANDLING.md +0 -164
  49. package/.claude/skills/cfn-redis-coordination/SKILL.md +0 -720
  50. package/.claude/skills/cfn-redis-coordination/demos/test-dlq.sh +0 -129
  51. package/.claude/skills/cfn-redis-coordination/demos/test-iteration-feedback.sh +0 -320
  52. package/.claude/skills/cfn-redis-coordination/demos/test-orchestrator.sh +0 -249
  53. package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4-unix.sh +0 -148
  54. package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4.sh +0 -163
  55. package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake.sh +0 -138
  56. package/.claude/skills/cfn-redis-coordination/demos/test-quick-fix.sh +0 -81
  57. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-absolute.sh +0 -45
  58. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-fallback.sh +0 -68
  59. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-percentage.sh +0 -56
  60. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-with-retry.sh +0 -81
  61. package/.claude/skills/cfn-redis-coordination/demos/test-quorum.sh +0 -57
  62. package/.claude/skills/cfn-redis-coordination/demos/test-shutdown-handling.sh +0 -187
  63. package/.claude/skills/cfn-redis-coordination/demos/test-shutdown.sh +0 -160
  64. package/.claude/skills/cfn-redis-coordination/demos/test-utils-unix.sh +0 -97
  65. package/.claude/skills/cfn-redis-coordination/demos/test-utils.sh +0 -97
  66. package/.claude/skills/cfn-redis-coordination/demos/test-waiting-mode.sh +0 -59
  67. package/.claude/skills/cfn-redis-coordination/examples/README.md +0 -73
  68. package/.claude/skills/cfn-redis-coordination/examples/grafana-dashboard.json +0 -352
  69. package/.claude/skills/cfn-redis-coordination/examples/hierarchical-pattern.sh +0 -127
  70. package/.claude/skills/cfn-redis-coordination/examples/mesh-pattern.sh +0 -171
  71. package/.claude/skills/cfn-redis-coordination/examples/timeout-handling.sh +0 -227
  72. package/.claude/skills/cfn-redis-coordination/examples/waiting-mode-pattern.sh +0 -239
  73. package/.claude/skills/cfn-redis-coordination/execute-product-owner-decision.sh +0 -258
  74. package/.claude/skills/cfn-redis-coordination/get-agent-timeout.sh +0 -177
  75. package/.claude/skills/cfn-redis-coordination/heartbeat-functions.sh +0 -137
  76. package/.claude/skills/cfn-redis-coordination/heartbeat-protocol.md +0 -106
  77. package/.claude/skills/cfn-redis-coordination/heartbeat.sh +0 -126
  78. package/.claude/skills/cfn-redis-coordination/init-swarm.sh +0 -148
  79. package/.claude/skills/cfn-redis-coordination/invoke-redis-pattern.sh +0 -220
  80. package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +0 -283
  81. package/.claude/skills/cfn-redis-coordination/list-active-swarms.sh +0 -147
  82. package/.claude/skills/cfn-redis-coordination/log-event.sh +0 -109
  83. package/.claude/skills/cfn-redis-coordination/metrics-export.sh +0 -674
  84. package/.claude/skills/cfn-redis-coordination/metrics-schema.json +0 -66
  85. package/.claude/skills/cfn-redis-coordination/metrics-storage.md +0 -31
  86. package/.claude/skills/cfn-redis-coordination/monitor-cfn-violations.sh +0 -391
  87. package/.claude/skills/cfn-redis-coordination/monitor-heartbeats.sh +0 -101
  88. package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop-v3.sh +0 -141
  89. package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh +0 -31
  90. package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.bak +0 -0
  91. package/.claude/skills/cfn-redis-coordination/priority-wake-mechanism.md +0 -75
  92. package/.claude/skills/cfn-redis-coordination/priority_wake.py +0 -134
  93. package/.claude/skills/cfn-redis-coordination/query-dlq.sh +0 -162
  94. package/.claude/skills/cfn-redis-coordination/query-logs.sh +0 -103
  95. package/.claude/skills/cfn-redis-coordination/redis-pattern.sh +0 -619
  96. package/.claude/skills/cfn-redis-coordination/retrieve-context.sh +0 -58
  97. package/.claude/skills/cfn-redis-coordination/select-specialist-agent.sh +0 -371
  98. package/.claude/skills/cfn-redis-coordination/semantic-match-tfidf.py +0 -252
  99. package/.claude/skills/cfn-redis-coordination/send-heartbeat.sh +0 -165
  100. package/.claude/skills/cfn-redis-coordination/signal.sh +0 -38
  101. package/.claude/skills/cfn-redis-coordination/store-context.sh +0 -86
  102. package/.claude/skills/cfn-redis-coordination/store-epic-context.sh +0 -123
  103. package/.claude/skills/cfn-redis-coordination/test-context-injection.sh +0 -354
  104. package/.claude/skills/cfn-redis-coordination/test-timeout-enforcement.sh +0 -513
  105. package/.claude/skills/cfn-redis-coordination/tests/convert-line-endings.sh +0 -15
  106. package/.claude/skills/cfn-redis-coordination/tests/dlq-functionality-test.sh +0 -102
  107. package/.claude/skills/cfn-redis-coordination/tests/edge-cases-test.sh +0 -99
  108. package/.claude/skills/cfn-redis-coordination/tests/integration-test.sh +0 -170
  109. package/.claude/skills/cfn-redis-coordination/tests/retry-mechanism-test.sh +0 -82
  110. package/.claude/skills/cfn-redis-coordination/tests/run-test-suite.sh +0 -92
  111. package/.claude/skills/cfn-redis-coordination/tests/run-tests.sh +0 -4
  112. package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-monitoring.sh +0 -418
  113. package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-simple.sh +0 -124
  114. package/.claude/skills/cfn-redis-coordination/tests/test-primitives.sh +0 -166
  115. package/.claude/skills/cfn-redis-coordination/tests/test-utils.sh +0 -54
  116. package/.claude/skills/cfn-redis-coordination/tests/test_utils.sh +0 -49
  117. package/.claude/skills/cfn-redis-coordination/v2_modularization/core_orchestration.sh +0 -76
  118. package/.claude/skills/cfn-redis-coordination/validate-parameters.sh +0 -492
  119. package/claude-assets/skills/cfn-redis-coordination/HEARTBEAT.md +0 -57
  120. package/claude-assets/skills/cfn-redis-coordination/HEARTBEAT_MONITORING.md +0 -267
  121. package/claude-assets/skills/cfn-redis-coordination/LOGGING.md +0 -260
  122. package/claude-assets/skills/cfn-redis-coordination/README.md +0 -65
  123. package/claude-assets/skills/cfn-redis-coordination/SECURITY_REVIEW.md +0 -25
  124. package/claude-assets/skills/cfn-redis-coordination/SHUTDOWN_HANDLING.md +0 -164
  125. package/claude-assets/skills/cfn-redis-coordination/SKILL.md +0 -720
  126. package/claude-assets/skills/cfn-redis-coordination/demos/test-dlq.sh +0 -129
  127. package/claude-assets/skills/cfn-redis-coordination/demos/test-iteration-feedback.sh +0 -320
  128. package/claude-assets/skills/cfn-redis-coordination/demos/test-orchestrator.sh +0 -249
  129. package/claude-assets/skills/cfn-redis-coordination/demos/test-priority-wake-phase4-unix.sh +0 -148
  130. package/claude-assets/skills/cfn-redis-coordination/demos/test-priority-wake-phase4.sh +0 -163
  131. package/claude-assets/skills/cfn-redis-coordination/demos/test-priority-wake.sh +0 -138
  132. package/claude-assets/skills/cfn-redis-coordination/demos/test-quick-fix.sh +0 -81
  133. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-absolute.sh +0 -45
  134. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-fallback.sh +0 -68
  135. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-percentage.sh +0 -56
  136. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-with-retry.sh +0 -81
  137. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum.sh +0 -57
  138. package/claude-assets/skills/cfn-redis-coordination/demos/test-shutdown-handling.sh +0 -187
  139. package/claude-assets/skills/cfn-redis-coordination/demos/test-shutdown.sh +0 -160
  140. package/claude-assets/skills/cfn-redis-coordination/demos/test-utils-unix.sh +0 -97
  141. package/claude-assets/skills/cfn-redis-coordination/demos/test-utils.sh +0 -97
  142. package/claude-assets/skills/cfn-redis-coordination/demos/test-waiting-mode.sh +0 -59
  143. package/claude-assets/skills/cfn-redis-coordination/examples/README.md +0 -73
  144. package/claude-assets/skills/cfn-redis-coordination/examples/grafana-dashboard.json +0 -352
  145. package/claude-assets/skills/cfn-redis-coordination/examples/hierarchical-pattern.sh +0 -127
  146. package/claude-assets/skills/cfn-redis-coordination/examples/mesh-pattern.sh +0 -171
  147. package/claude-assets/skills/cfn-redis-coordination/examples/timeout-handling.sh +0 -227
  148. package/claude-assets/skills/cfn-redis-coordination/examples/waiting-mode-pattern.sh +0 -239
  149. package/claude-assets/skills/cfn-redis-coordination/execute-product-owner-decision.sh +0 -258
  150. package/claude-assets/skills/cfn-redis-coordination/get-agent-timeout.sh +0 -177
  151. package/claude-assets/skills/cfn-redis-coordination/heartbeat-functions.sh +0 -137
  152. package/claude-assets/skills/cfn-redis-coordination/heartbeat-protocol.md +0 -106
  153. package/claude-assets/skills/cfn-redis-coordination/heartbeat.sh +0 -126
  154. package/claude-assets/skills/cfn-redis-coordination/init-swarm.sh +0 -148
  155. package/claude-assets/skills/cfn-redis-coordination/invoke-redis-pattern.sh +0 -220
  156. package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +0 -283
  157. package/claude-assets/skills/cfn-redis-coordination/list-active-swarms.sh +0 -147
  158. package/claude-assets/skills/cfn-redis-coordination/log-event.sh +0 -109
  159. package/claude-assets/skills/cfn-redis-coordination/metrics-export.sh +0 -674
  160. package/claude-assets/skills/cfn-redis-coordination/metrics-schema.json +0 -66
  161. package/claude-assets/skills/cfn-redis-coordination/metrics-storage.md +0 -31
  162. package/claude-assets/skills/cfn-redis-coordination/monitor-cfn-violations.sh +0 -391
  163. package/claude-assets/skills/cfn-redis-coordination/monitor-heartbeats.sh +0 -101
  164. package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop-v3.sh +0 -141
  165. package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh +0 -31
  166. package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.bak +0 -0
  167. package/claude-assets/skills/cfn-redis-coordination/priority-wake-mechanism.md +0 -75
  168. package/claude-assets/skills/cfn-redis-coordination/priority_wake.py +0 -134
  169. package/claude-assets/skills/cfn-redis-coordination/query-dlq.sh +0 -162
  170. package/claude-assets/skills/cfn-redis-coordination/query-logs.sh +0 -103
  171. package/claude-assets/skills/cfn-redis-coordination/redis-pattern.sh +0 -619
  172. package/claude-assets/skills/cfn-redis-coordination/retrieve-context.sh +0 -58
  173. package/claude-assets/skills/cfn-redis-coordination/select-specialist-agent.sh +0 -371
  174. package/claude-assets/skills/cfn-redis-coordination/semantic-match-tfidf.py +0 -252
  175. package/claude-assets/skills/cfn-redis-coordination/send-heartbeat.sh +0 -165
  176. package/claude-assets/skills/cfn-redis-coordination/signal.sh +0 -38
  177. package/claude-assets/skills/cfn-redis-coordination/store-context.sh +0 -86
  178. package/claude-assets/skills/cfn-redis-coordination/store-epic-context.sh +0 -123
  179. package/claude-assets/skills/cfn-redis-coordination/test-context-injection.sh +0 -354
  180. package/claude-assets/skills/cfn-redis-coordination/test-timeout-enforcement.sh +0 -513
  181. package/claude-assets/skills/cfn-redis-coordination/tests/convert-line-endings.sh +0 -15
  182. package/claude-assets/skills/cfn-redis-coordination/tests/dlq-functionality-test.sh +0 -102
  183. package/claude-assets/skills/cfn-redis-coordination/tests/edge-cases-test.sh +0 -99
  184. package/claude-assets/skills/cfn-redis-coordination/tests/integration-test.sh +0 -170
  185. package/claude-assets/skills/cfn-redis-coordination/tests/retry-mechanism-test.sh +0 -82
  186. package/claude-assets/skills/cfn-redis-coordination/tests/run-test-suite.sh +0 -92
  187. package/claude-assets/skills/cfn-redis-coordination/tests/run-tests.sh +0 -4
  188. package/claude-assets/skills/cfn-redis-coordination/tests/test-heartbeat-monitoring.sh +0 -418
  189. package/claude-assets/skills/cfn-redis-coordination/tests/test-heartbeat-simple.sh +0 -124
  190. package/claude-assets/skills/cfn-redis-coordination/tests/test-primitives.sh +0 -166
  191. package/claude-assets/skills/cfn-redis-coordination/tests/test-utils.sh +0 -54
  192. package/claude-assets/skills/cfn-redis-coordination/tests/test_utils.sh +0 -49
  193. package/claude-assets/skills/cfn-redis-coordination/v2_modularization/core_orchestration.sh +0 -76
  194. package/claude-assets/skills/cfn-redis-coordination/validate-parameters.sh +0 -492
@@ -1,260 +0,0 @@
1
- # CFN Loop Logging System
2
-
3
- ## Overview
4
-
5
- The CFN Loop logging system provides comprehensive visibility into agent execution, decisions, and errors. All logs are stored in SQLite for efficient querying and analysis by AI agents.
6
-
7
- ## Database Location
8
-
9
- ```bash
10
- Default: claude-flow-novice/data/cfn-loop.db
11
- Custom: Set DB_PATH environment variable
12
- ```
13
-
14
- ## Schema
15
-
16
- ```sql
17
- CREATE TABLE cfn_loop_logs (
18
- id INTEGER PRIMARY KEY AUTOINCREMENT,
19
- task_id TEXT NOT NULL, -- Task/swarm identifier
20
- timestamp TEXT DEFAULT (datetime('now')), -- ISO 8601 timestamp
21
- event_type TEXT NOT NULL, -- Event category
22
- loop TEXT, -- loop3, loop2, product_owner, coordinator
23
- agent_id TEXT, -- Agent identifier (e.g., coder-1-1)
24
- iteration INTEGER, -- CFN loop iteration number
25
- details TEXT, -- JSON payload with event-specific data
26
- level TEXT DEFAULT 'INFO' -- DEBUG, INFO, WARN, ERROR
27
- );
28
-
29
- -- Indexes for fast queries
30
- CREATE INDEX idx_task_id ON cfn_loop_logs(task_id);
31
- CREATE INDEX idx_event_type ON cfn_loop_logs(event_type);
32
- CREATE INDEX idx_timestamp ON cfn_loop_logs(timestamp);
33
- CREATE INDEX idx_level ON cfn_loop_logs(level);
34
- ```
35
-
36
- ## Event Types
37
-
38
- | Event Type | Description | Level | Details Payload |
39
- |-----------|-------------|-------|-----------------|
40
- | `swarm_init` | CFN loop initialization | INFO | `{mode, loop3_agents, loop2_agents, product_owner, max_iterations, gate_threshold, consensus_threshold}` |
41
- | `agent_spawn` | Agent process started | INFO | `{agent_type, timeout}` |
42
- | `agent_complete` | Agent successfully completed | INFO | `{confidence, confidence_source, files_changed, latency_ms}` |
43
- | `agent_failure` | Agent execution failed | ERROR | `{error, output}` |
44
- | `gate_check` | Loop 3 gate validation | INFO/WARN | `{consensus, threshold, result: PASS\|FAIL, decision?}` |
45
- | `po_decision` | Product Owner strategic decision | INFO | `{decision: PROCEED\|ITERATE\|ABORT, reasoning, confidence}` |
46
- | `parameter_error` | Invalid parameters passed to tool | ERROR | `{error, command}` |
47
-
48
- ## Usage
49
-
50
- ### Logging Events (Orchestrator/Scripts)
51
-
52
- ```bash
53
- # Log swarm initialization
54
- ./.claude/skills/redis-coordination/log-event.sh \
55
- --task-id "cfn-task-123" \
56
- --event-type "swarm_init" \
57
- --details '{"mode": "standard", "loop3_agents": "coder", "loop2_agents": "reviewer"}' \
58
- --level "INFO"
59
-
60
- # Log agent spawn
61
- ./.claude/skills/redis-coordination/log-event.sh \
62
- --task-id "cfn-task-123" \
63
- --event-type "agent_spawn" \
64
- --loop "loop3" \
65
- --agent-id "coder-1-1" \
66
- --iteration 1 \
67
- --details '{"agent_type": "coder", "timeout": 900}' \
68
- --level "INFO"
69
-
70
- # Log error
71
- ./.claude/skills/redis-coordination/log-event.sh \
72
- --task-id "cfn-task-123" \
73
- --event-type "agent_failure" \
74
- --loop "loop3" \
75
- --agent-id "coder-1-1" \
76
- --iteration 1 \
77
- --details '{"error": "timeout", "output": "Agent exceeded 900s timeout"}' \
78
- --level "ERROR"
79
- ```
80
-
81
- ### Querying Logs (AI Agents/Debugging)
82
-
83
- ```bash
84
- # Get all logs for a task
85
- ./query-logs.sh --task-id "cfn-task-123"
86
-
87
- # Get only errors
88
- ./query-logs.sh --task-id "cfn-task-123" --level ERROR
89
-
90
- # Get Loop 3 agent spawns
91
- ./query-logs.sh --task-id "cfn-task-123" --event-type agent_spawn --loop loop3
92
-
93
- # Get Product Owner decisions
94
- ./query-logs.sh --task-id "cfn-task-123" --event-type po_decision
95
-
96
- # Get latest 10 events in table format
97
- ./query-logs.sh --task-id "cfn-task-123" --limit 10 --format table
98
-
99
- # Get events for specific iteration
100
- ./query-logs.sh --task-id "cfn-task-123" --iteration 2
101
-
102
- # Get events for specific agent
103
- ./query-logs.sh --task-id "cfn-task-123" --agent-id "coder-1-1"
104
- ```
105
-
106
- ### Output Formats
107
-
108
- **JSON (default):**
109
- ```json
110
- [
111
- {
112
- "id": 1,
113
- "task_id": "cfn-task-123",
114
- "timestamp": "2025-10-21T10:30:00Z",
115
- "event_type": "agent_spawn",
116
- "loop": "loop3",
117
- "agent_id": "coder-1-1",
118
- "iteration": 1,
119
- "details": "{\"agent_type\": \"coder\", \"timeout\": 900}",
120
- "level": "INFO"
121
- }
122
- ]
123
- ```
124
-
125
- **Table:**
126
- ```
127
- id task_id timestamp event_type loop agent_id iteration level
128
- 1 cfn-task-123 2025-10-21T10:30:00Z agent_spawn loop3 coder-1-1 1 INFO
129
- 2 cfn-task-123 2025-10-21T10:45:00Z agent_complete loop3 coder-1-1 1 INFO
130
- ```
131
-
132
- **CSV:**
133
- ```csv
134
- 1,cfn-task-123,2025-10-21T10:30:00Z,agent_spawn,loop3,coder-1-1,1,"{""agent_type"": ""coder"", ""timeout"": 900}",INFO
135
- ```
136
-
137
- ## AI Agent Consumption
138
-
139
- AI agents can query logs to improve workflows:
140
-
141
- ```bash
142
- # Example: Analyze agent failures
143
- ERRORS=$(./query-logs.sh --task-id "cfn-task-123" --level ERROR --format json)
144
-
145
- # Parse JSON with jq
146
- echo "$ERRORS" | jq -r '.[] | "\(.timestamp) [\(.agent_id)] \(.event_type): \(.details)"'
147
-
148
- # Example output:
149
- # 2025-10-21T10:45:00Z [coder-1-1] agent_failure: {"error": "skill_execution_error", "output": "Unknown parameter --invalid-param"}
150
- ```
151
-
152
- ### Common Queries for AI Analysis
153
-
154
- ```bash
155
- # Find agents with highest failure rate
156
- ./query-logs.sh --task-id "$TASK_ID" --event-type agent_failure --format json | \
157
- jq -r '.[].agent_id' | sort | uniq -c | sort -nr
158
-
159
- # Calculate average agent latency per loop
160
- ./query-logs.sh --task-id "$TASK_ID" --event-type agent_complete --format json | \
161
- jq -r '.[] | "\(.loop) \(.details | fromjson | .latency_ms)"' | \
162
- awk '{sum[$1]+=$2; count[$1]++} END {for (loop in sum) print loop, sum[loop]/count[loop]}'
163
-
164
- # Find parameter errors (for troubleshooting implementations)
165
- ./query-logs.sh --task-id "$TASK_ID" --event-type parameter_error --format json
166
-
167
- # Track decision history
168
- ./query-logs.sh --task-id "$TASK_ID" --event-type po_decision --format json | \
169
- jq -r '.[] | "\(.iteration): \(.details | fromjson | .decision) - \(.details | fromjson | .reasoning)"'
170
- ```
171
-
172
- ## Logged Events in Orchestrator
173
-
174
- The orchestrator automatically logs:
175
-
176
- 1. **Line ~643:** Swarm initialization with all configuration
177
- 2. **Line ~811:** Each Loop 3 agent spawn with timeout
178
- 3. **Line ~892:** Each Loop 3 agent completion with confidence and files changed
179
- 4. **Line ~917:** Each Loop 3 agent failure with error details
180
- 5. **Line ~1082:** Gate check failures with consensus scores
181
- 6. **Line ~1115:** Gate check successes
182
- 7. **Line ~1440:** Product Owner decisions with reasoning
183
-
184
- All logs include `2>/dev/null || true` to ensure logging failures don't break orchestration.
185
-
186
- ## Performance
187
-
188
- - **Write latency:** ~5-10ms per log entry
189
- - **Query latency:** ~10-50ms for typical queries (< 1000 events)
190
- - **Storage:** ~500 bytes per event (compressed SQLite)
191
- - **Indexes:** Optimized for task_id, event_type, timestamp, level queries
192
-
193
- ## Debugging
194
-
195
- ### Check if logging is working
196
-
197
- ```bash
198
- # Check database exists
199
- ls -lh data/cfn-loop.db
200
-
201
- # Count total log entries
202
- sqlite3 data/cfn-loop.db "SELECT COUNT(*) FROM cfn_loop_logs;"
203
-
204
- # Get latest 5 events
205
- ./query-logs.sh --task-id "YOUR_TASK_ID" --limit 5 --format table
206
- ```
207
-
208
- ### Common issues
209
-
210
- **Issue:** "Error: Database not found"
211
- - **Cause:** No logs written yet
212
- - **Fix:** Run a CFN loop task to generate logs
213
-
214
- **Issue:** "Error: --details must be valid JSON"
215
- - **Cause:** Malformed JSON in details parameter
216
- - **Fix:** Validate JSON with `echo "$DETAILS" | jq empty`
217
-
218
- **Issue:** Logging fails silently
219
- - **Cause:** `2>/dev/null || true` suppresses errors
220
- - **Fix:** Remove `2>/dev/null` temporarily to see error messages
221
-
222
- ## Web Portal Integration
223
-
224
- The web portal can query logs for real-time visibility:
225
-
226
- ```typescript
227
- // Example: Fetch logs for task
228
- const logs = await fetch('/api/logs?task_id=cfn-task-123&event_type=agent_spawn');
229
- const events = await logs.json();
230
-
231
- // Display in timeline
232
- events.forEach(event => {
233
- console.log(`${event.timestamp} [${event.loop}] ${event.agent_id}: ${event.event_type}`);
234
- });
235
- ```
236
-
237
- ## Retention
238
-
239
- - **Default:** Logs persist indefinitely in SQLite
240
- - **Recommended:** Implement cleanup job to delete logs older than 30 days for non-critical tasks
241
- - **Critical tasks:** Retain logs for audit trail
242
-
243
- ```bash
244
- # Example: Delete logs older than 30 days
245
- sqlite3 data/cfn-loop.db "DELETE FROM cfn_loop_logs WHERE timestamp < datetime('now', '-30 days');"
246
- ```
247
-
248
- ## Privacy & Security
249
-
250
- - **Sensitive data:** Avoid logging secrets, API keys, or PII in details field
251
- - **Access control:** Database file permissions (chmod 600) restrict access
252
- - **Audit trail:** Logs include full decision reasoning for compliance
253
-
254
- ## Future Enhancements
255
-
256
- - [ ] Structured logging levels (DEBUG for verbose agent output)
257
- - [ ] Log streaming to external systems (Elasticsearch, CloudWatch)
258
- - [ ] Automatic anomaly detection (high failure rates, long latencies)
259
- - [ ] Log rotation and archival
260
- - [ ] Web UI for log browsing and search
@@ -1,65 +0,0 @@
1
- # Redis Coordination Skill
2
-
3
- ## Quick Start
4
-
5
- ### Prerequisites
6
- - Redis 5.0+
7
- - bash
8
- - jq
9
- - redis-cli
10
-
11
- ### Installation
12
- 1. Ensure Redis is running
13
- 2. Configure Redis connection in `config.json`
14
- 3. Make scripts executable:
15
- ```bash
16
- chmod +x invoke-waiting-mode.sh
17
- ```
18
-
19
- ### Basic Usage
20
-
21
- #### Consensus Collection (Updated)
22
- ```bash
23
- # Agent reports results
24
- ./invoke-waiting-mode.sh report \
25
- --task-id "my-task" \
26
- --agent-id "agent-1" \
27
- --confidence 0.95
28
-
29
- # Collect and evaluate consensus
30
- ./invoke-waiting-mode.sh collect \
31
- --task-id "my-task" \
32
- --agent-ids "agent-1,agent-2,agent-3"
33
- ```
34
-
35
- ## Important Changes in P7 (Redis Script Cleanup)
36
-
37
- ### Deprecation Notices
38
- - 🚨 `enter` and `wake` subcommands are NO LONGER SUPPORTED
39
- - Agents should exit cleanly without waiting mode
40
- - Coordinator spawns agents directly
41
- - Fork-ID references have been removed
42
-
43
- ### Migration Guide
44
- - Update agent scripts to exit cleanly after task
45
- - Remove manual waiting mode calls
46
- - Use direct agent spawning in orchestrator
47
-
48
- ## Script Categories
49
- - **Production Scripts**:
50
- - `invoke-waiting-mode.sh`: Redis coordination wrapper
51
- - `orchestrate-cfn-loop.sh`: CFN Loop orchestration
52
- - **Demos and Tests**: Located in `./demos/`
53
-
54
- ## Performance
55
- - Zero-token waiting
56
- - Sub-100ms wake-up latency
57
- - Supports 10+ concurrent agents
58
- - Configurable consensus thresholds
59
-
60
- ## Configuration Options
61
- See `SKILL.md` for detailed configuration and usage instructions.
62
-
63
- ## Troubleshooting
64
- - If you encounter issues with old scripts, refer to migration guide
65
- - Test scripts are available in `./demos/` directory
@@ -1,25 +0,0 @@
1
- # Security Review: Metrics Export System (Phase 7)
2
-
3
- ## Overview
4
- Security review conducted by security-specialist-3 for Redis Coordination metrics export functionality.
5
-
6
- ## Confidence Score: 0.92 (High)
7
-
8
- ### Key Findings
9
- - ✅ Robust input validation
10
- - ✅ Secure file handling
11
- - ✅ Minimal data exposure
12
- - ⚠️ Recommended ACL improvements
13
-
14
- ### Recommendations
15
- 1. Implement optional PII sanitization
16
- 2. Enhance Redis key access controls
17
- 3. Create metrics export audit logging
18
- 4. Add optional export encryption
19
-
20
- ### Compliance
21
- - NIST SP 800-53 Alignment: Moderate Impact
22
- - SOC 2 Type II Ready
23
- - GDPR Data Minimization Compliant
24
-
25
- Full detailed report available in source code comments.
@@ -1,164 +0,0 @@
1
- # Shutdown Handling for Waiting Agents
2
-
3
- ## Overview
4
-
5
- Agents in waiting mode can now listen for shutdown signals and exit gracefully with proper cleanup. This enables coordinators to terminate long-running tasks without leaving orphaned agents in the system.
6
-
7
- ## Implementation Details
8
-
9
- ### Multi-Key Monitoring
10
-
11
- Agents in waiting mode now monitor **two** Redis keys simultaneously:
12
- 1. **Wake Queue**: `swarm:{task-id}:{agent-id}:wake-queue` (priority queue for wake signals)
13
- 2. **Shutdown Key**: `swarm:{task-id}:shutdown` (broadcast shutdown signal)
14
-
15
- ### Polling Strategy
16
-
17
- Since Redis `BZPOPMIN` doesn't support multiple keys, we implement a polling loop:
18
-
19
- ```bash
20
- while true; do
21
- # Check shutdown first (highest priority)
22
- SHUTDOWN_CHECK=$(redis-cli LPOP "swarm:${TASK_ID}:shutdown")
23
-
24
- if shutdown_detected; then
25
- exit 130 # SIGINT code for graceful shutdown
26
- fi
27
-
28
- # Block on wake queue with 1-second timeout
29
- WAKE_RESULT=$(redis-cli BZPOPMIN "$WAKE_QUEUE" 1)
30
-
31
- if wake_received; then
32
- process_wake_signal
33
- break
34
- fi
35
- done
36
- ```
37
-
38
- ### Exit Code Convention
39
-
40
- - **Exit Code 130**: Graceful shutdown via shutdown signal (SIGINT equivalent)
41
- - **Exit Code 0**: Normal completion after wake signal
42
-
43
- ## Usage
44
-
45
- ### Coordinator Broadcasts Shutdown
46
-
47
- ```bash
48
- ./invoke-waiting-mode.sh shutdown \
49
- --task-id "auth-system" \
50
- --reason "task_complete"
51
- ```
52
-
53
- **Broadcast Behavior:**
54
- - Shutdown signal is added to `swarm:{task-id}:shutdown` key
55
- - All agents monitoring this task will receive the signal on their next poll cycle (max 1 second latency)
56
- - Multiple agents can be shutdown with a single broadcast
57
-
58
- ### Agent Enters Waiting Mode
59
-
60
- ```bash
61
- ./invoke-waiting-mode.sh enter \
62
- --task-id "auth-system" \
63
- --agent-id "coder-1" \
64
- --context "iteration-1"
65
- ```
66
-
67
- **Agent will:**
68
- 1. Publish ready status to Redis
69
- 2. Enter polling loop monitoring both wake queue and shutdown key
70
- 3. Check shutdown key first (highest priority)
71
- 4. Block on wake queue with 1-second timeout
72
- 5. Exit with code 130 if shutdown signal received
73
- 6. Continue normally if wake signal received
74
-
75
- ## Priority Behavior
76
-
77
- **Shutdown signals have HIGHEST priority:**
78
- - Checked **before** wake queue on every poll cycle
79
- - Even if wake signals are in the queue, shutdown is processed first
80
- - Ensures clean task termination
81
-
82
- ## Performance Characteristics
83
-
84
- - **Latency**: Max 1 second to detect shutdown (BZPOPMIN timeout)
85
- - **Cost**: Still zero tokens during waiting (BZPOPMIN blocks, LPOP is instant)
86
- - **Overhead**: Minimal - one LPOP per second for shutdown check
87
-
88
- ## Test Results
89
-
90
- ```bash
91
- bash .claude/skills/redis-coordination/test-shutdown.sh
92
- ```
93
-
94
- **Test Coverage:**
95
- 1. ✅ Agent enters waiting mode successfully
96
- 2. ✅ Agent receives shutdown signal and exits with code 130
97
- 3. ✅ Shutdown signal is broadcasted properly
98
- 4. ✅ Agent terminates gracefully within 1-2 seconds
99
-
100
- ## Integration Examples
101
-
102
- ### CFN Loop Coordinator
103
-
104
- ```bash
105
- # After consensus reached or max iterations
106
- ./invoke-waiting-mode.sh shutdown \
107
- --task-id "$TASK_ID" \
108
- --reason "cfn_loop_complete"
109
-
110
- echo "All agents notified of task completion"
111
- ```
112
-
113
- ### Emergency Shutdown
114
-
115
- ```bash
116
- # Abort all agents in a task
117
- ./invoke-waiting-mode.sh shutdown \
118
- --task-id "$TASK_ID" \
119
- --reason "emergency_abort"
120
- ```
121
-
122
- ### Timeout Management
123
-
124
- ```bash
125
- # Coordinator timeout
126
- timeout 300 ./my-coordination-script.sh || {
127
- echo "Coordinator timeout - sending shutdown to all agents"
128
- ./invoke-waiting-mode.sh shutdown \
129
- --task-id "$TASK_ID" \
130
- --reason "coordinator_timeout"
131
- }
132
- ```
133
-
134
- ## File Changes
135
-
136
- **Modified:**
137
- - `/mnt/c/Users/masha/Documents/claude-flow-novice/.claude/skills/redis-coordination/invoke-waiting-mode.sh`
138
-
139
- **Added:**
140
- - `shutdown` command for broadcasting shutdown signals
141
- - Multi-key monitoring in `enter` command
142
- - Polling loop with shutdown priority
143
- - Exit code 130 convention for graceful shutdown
144
-
145
- **Test Suite:**
146
- - `/mnt/c/Users/masha/Documents/claude-flow-novice/.claude/skills/redis-coordination/test-shutdown.sh`
147
-
148
- ## Benefits
149
-
150
- 1. **Graceful Cleanup**: Agents exit cleanly instead of hanging indefinitely
151
- 2. **Broadcast Efficiency**: Single shutdown command affects all agents
152
- 3. **Priority Handling**: Shutdown always takes precedence over wake signals
153
- 4. **Zero Token Cost**: Still maintains efficient blocking while waiting
154
- 5. **Fast Response**: Max 1 second latency to detect shutdown
155
-
156
- ## Future Enhancements
157
-
158
- Potential improvements for future iterations:
159
-
160
- 1. **Agent-Specific Shutdown**: Target individual agents instead of broadcast
161
- 2. **Shutdown Acknowledgement**: Agents report shutdown receipt before exiting
162
- 3. **Lua Script Optimization**: Atomic shutdown check + wake queue pop
163
- 4. **Timeout Configuration**: Configurable poll timeout instead of hardcoded 1 second
164
- 5. **Shutdown Reason Logging**: Persist shutdown events to Redis for audit trail