claude-flow-novice 2.10.8 → 2.11.0

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 (193) hide show
  1. package/.claude/commands/README.md +157 -0
  2. package/.claude/hooks/cfn-invoke-post-edit.sh +1 -1
  3. package/.claude/hooks/cfn-invoke-pre-edit.sh +88 -0
  4. package/.claude/skills/cfn-agent-spawning/spawn-worker.sh +176 -0
  5. package/.claude/skills/cfn-backlog-management/SKILL.md +199 -0
  6. package/.claude/skills/cfn-backlog-management/add-backlog-item.sh +210 -0
  7. package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +7 -21
  8. package/claude-assets/agents/cfn-dev-team/testing/test-validation-agent.md +312 -0
  9. package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +480 -115
  10. package/claude-assets/agents/csuite/cto-agent.md +371 -0
  11. package/claude-assets/agents/marketing_hybrid/cost_tracker.md +13 -0
  12. package/claude-assets/agents/marketing_hybrid/docker_deployer.md +13 -0
  13. package/claude-assets/agents/marketing_hybrid/zai_worker_spawner.md +13 -0
  14. package/claude-assets/hooks/cfn-invoke-post-edit.sh +1 -1
  15. package/claude-assets/hooks/cfn-invoke-pre-edit.sh +88 -0
  16. package/claude-assets/skills/cfn-agent-spawning/spawn-worker.sh +176 -0
  17. package/claude-assets/skills/cfn-backlog-management/SKILL.md +199 -0
  18. package/claude-assets/skills/cfn-backlog-management/add-backlog-item.sh +210 -0
  19. package/claude-assets/skills/pre-edit-backup/backup.sh +130 -0
  20. package/claude-assets/skills/pre-edit-backup/cleanup.sh +155 -0
  21. package/claude-assets/skills/pre-edit-backup/restore.sh +128 -0
  22. package/claude-assets/skills/pre-edit-backup/revert-file.sh +168 -0
  23. package/dist/agents/agent-loader.js +315 -0
  24. package/dist/agents/agent-loader.js.map +1 -1
  25. package/package.json +3 -2
  26. package/scripts/init-project.js +38 -3
  27. package/scripts/marketing_hybrid_deployment.sh +45 -0
  28. package/scripts/redis-prometheus-exporter.sh +33 -0
  29. package/scripts/track-zai-costs.sh +19 -0
  30. package/claude-assets/commands/agents/README.md +0 -10
  31. package/claude-assets/commands/agents/agent-capabilities.md +0 -21
  32. package/claude-assets/commands/agents/agent-coordination.md +0 -28
  33. package/claude-assets/commands/agents/agent-spawning.md +0 -28
  34. package/claude-assets/commands/agents/agent-types.md +0 -26
  35. package/claude-assets/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
  36. package/claude-assets/commands/analysis/README.md +0 -9
  37. package/claude-assets/commands/analysis/bottleneck-detect.md +0 -162
  38. package/claude-assets/commands/analysis/performance-bottlenecks.md +0 -59
  39. package/claude-assets/commands/analysis/performance-report.md +0 -25
  40. package/claude-assets/commands/analysis/token-efficiency.md +0 -45
  41. package/claude-assets/commands/analysis/token-usage.md +0 -25
  42. package/claude-assets/commands/automation/README.md +0 -9
  43. package/claude-assets/commands/automation/auto-agent.md +0 -122
  44. package/claude-assets/commands/automation/self-healing.md +0 -106
  45. package/claude-assets/commands/automation/session-memory.md +0 -90
  46. package/claude-assets/commands/automation/smart-agents.md +0 -73
  47. package/claude-assets/commands/automation/smart-spawn.md +0 -25
  48. package/claude-assets/commands/automation/workflow-select.md +0 -25
  49. package/claude-assets/commands/claude-md.js +0 -237
  50. package/claude-assets/commands/claude-soul.js +0 -28
  51. package/claude-assets/commands/cli-integration.js +0 -216
  52. package/claude-assets/commands/coordination/README.md +0 -9
  53. package/claude-assets/commands/coordination/agent-spawn.md +0 -25
  54. package/claude-assets/commands/coordination/coordination-system.md +0 -88
  55. package/claude-assets/commands/coordination/init.md +0 -44
  56. package/claude-assets/commands/coordination/orchestrate.md +0 -43
  57. package/claude-assets/commands/coordination/spawn.md +0 -45
  58. package/claude-assets/commands/coordination/swarm-init.md +0 -85
  59. package/claude-assets/commands/coordination/task-orchestrate.md +0 -25
  60. package/claude-assets/commands/github/README.md +0 -11
  61. package/claude-assets/commands/github/code-review-swarm.md +0 -514
  62. package/claude-assets/commands/github/code-review.md +0 -25
  63. package/claude-assets/commands/github/github-modes.md +0 -147
  64. package/claude-assets/commands/github/github-swarm.md +0 -121
  65. package/claude-assets/commands/github/issue-tracker.md +0 -292
  66. package/claude-assets/commands/github/issue-triage.md +0 -25
  67. package/claude-assets/commands/github/multi-repo-swarm.md +0 -519
  68. package/claude-assets/commands/github/pr-enhance.md +0 -26
  69. package/claude-assets/commands/github/pr-manager.md +0 -170
  70. package/claude-assets/commands/github/project-board-sync.md +0 -471
  71. package/claude-assets/commands/github/release-manager.md +0 -338
  72. package/claude-assets/commands/github/release-swarm.md +0 -544
  73. package/claude-assets/commands/github/repo-analyze.md +0 -25
  74. package/claude-assets/commands/github/repo-architect.md +0 -367
  75. package/claude-assets/commands/github/swarm-issue.md +0 -482
  76. package/claude-assets/commands/github/swarm-pr.md +0 -285
  77. package/claude-assets/commands/github/sync-coordinator.md +0 -301
  78. package/claude-assets/commands/github/workflow-automation.md +0 -442
  79. package/claude-assets/commands/github.js +0 -638
  80. package/claude-assets/commands/hive-mind/README.md +0 -17
  81. package/claude-assets/commands/hive-mind/hive-mind-consensus.md +0 -8
  82. package/claude-assets/commands/hive-mind/hive-mind-init.md +0 -18
  83. package/claude-assets/commands/hive-mind/hive-mind-memory.md +0 -8
  84. package/claude-assets/commands/hive-mind/hive-mind-metrics.md +0 -8
  85. package/claude-assets/commands/hive-mind/hive-mind-resume.md +0 -8
  86. package/claude-assets/commands/hive-mind/hive-mind-sessions.md +0 -8
  87. package/claude-assets/commands/hive-mind/hive-mind-spawn.md +0 -21
  88. package/claude-assets/commands/hive-mind/hive-mind-status.md +0 -8
  89. package/claude-assets/commands/hive-mind/hive-mind-stop.md +0 -8
  90. package/claude-assets/commands/hive-mind/hive-mind-wizard.md +0 -8
  91. package/claude-assets/commands/hive-mind/hive-mind.md +0 -27
  92. package/claude-assets/commands/hooks/README.md +0 -11
  93. package/claude-assets/commands/hooks/overview.md +0 -58
  94. package/claude-assets/commands/hooks/post-edit.md +0 -117
  95. package/claude-assets/commands/hooks/post-task.md +0 -112
  96. package/claude-assets/commands/hooks/pre-edit.md +0 -113
  97. package/claude-assets/commands/hooks/pre-task.md +0 -111
  98. package/claude-assets/commands/hooks/session-end.md +0 -118
  99. package/claude-assets/commands/hooks/session-start.md +0 -9
  100. package/claude-assets/commands/hooks/setup.md +0 -103
  101. package/claude-assets/commands/hooks.js +0 -651
  102. package/claude-assets/commands/index.js +0 -119
  103. package/claude-assets/commands/memory/README.md +0 -9
  104. package/claude-assets/commands/memory/memory-bank.md +0 -58
  105. package/claude-assets/commands/memory/memory-persist.md +0 -25
  106. package/claude-assets/commands/memory/memory-search.md +0 -25
  107. package/claude-assets/commands/memory/memory-usage.md +0 -25
  108. package/claude-assets/commands/memory/neural.md +0 -47
  109. package/claude-assets/commands/memory/usage.md +0 -46
  110. package/claude-assets/commands/monitoring/README.md +0 -9
  111. package/claude-assets/commands/monitoring/agent-metrics.md +0 -25
  112. package/claude-assets/commands/monitoring/agents.md +0 -44
  113. package/claude-assets/commands/monitoring/real-time-view.md +0 -25
  114. package/claude-assets/commands/monitoring/status.md +0 -46
  115. package/claude-assets/commands/monitoring/swarm-monitor.md +0 -25
  116. package/claude-assets/commands/neural.js +0 -572
  117. package/claude-assets/commands/optimization/README.md +0 -9
  118. package/claude-assets/commands/optimization/auto-topology.md +0 -62
  119. package/claude-assets/commands/optimization/cache-manage.md +0 -25
  120. package/claude-assets/commands/optimization/parallel-execute.md +0 -25
  121. package/claude-assets/commands/optimization/parallel-execution.md +0 -50
  122. package/claude-assets/commands/optimization/topology-optimize.md +0 -25
  123. package/claude-assets/commands/pair/README.md +0 -261
  124. package/claude-assets/commands/pair/commands.md +0 -546
  125. package/claude-assets/commands/pair/config.md +0 -510
  126. package/claude-assets/commands/pair/examples.md +0 -512
  127. package/claude-assets/commands/pair/modes.md +0 -348
  128. package/claude-assets/commands/pair/session.md +0 -407
  129. package/claude-assets/commands/pair/start.md +0 -209
  130. package/claude-assets/commands/parse-epic.js +0 -180
  131. package/claude-assets/commands/performance.js +0 -582
  132. package/claude-assets/commands/register-all-commands.js +0 -320
  133. package/claude-assets/commands/register-claude-md.js +0 -82
  134. package/claude-assets/commands/register-claude-soul.js +0 -80
  135. package/claude-assets/commands/sparc/analyzer.md +0 -52
  136. package/claude-assets/commands/sparc/architect.md +0 -53
  137. package/claude-assets/commands/sparc/batch-executor.md +0 -54
  138. package/claude-assets/commands/sparc/coder.md +0 -54
  139. package/claude-assets/commands/sparc/debugger.md +0 -54
  140. package/claude-assets/commands/sparc/designer.md +0 -53
  141. package/claude-assets/commands/sparc/documenter.md +0 -54
  142. package/claude-assets/commands/sparc/innovator.md +0 -54
  143. package/claude-assets/commands/sparc/memory-manager.md +0 -54
  144. package/claude-assets/commands/sparc/optimizer.md +0 -54
  145. package/claude-assets/commands/sparc/orchestrator.md +0 -132
  146. package/claude-assets/commands/sparc/researcher.md +0 -54
  147. package/claude-assets/commands/sparc/reviewer.md +0 -54
  148. package/claude-assets/commands/sparc/sparc-modes.md +0 -174
  149. package/claude-assets/commands/sparc/swarm-coordinator.md +0 -54
  150. package/claude-assets/commands/sparc/tdd.md +0 -54
  151. package/claude-assets/commands/sparc/tester.md +0 -54
  152. package/claude-assets/commands/sparc/workflow-manager.md +0 -54
  153. package/claude-assets/commands/sparc.js +0 -110
  154. package/claude-assets/commands/stream-chain/pipeline.md +0 -121
  155. package/claude-assets/commands/stream-chain/run.md +0 -70
  156. package/claude-assets/commands/swarm/README.md +0 -15
  157. package/claude-assets/commands/swarm/analysis.md +0 -95
  158. package/claude-assets/commands/swarm/development.md +0 -96
  159. package/claude-assets/commands/swarm/examples.md +0 -168
  160. package/claude-assets/commands/swarm/maintenance.md +0 -102
  161. package/claude-assets/commands/swarm/optimization.md +0 -117
  162. package/claude-assets/commands/swarm/research.md +0 -136
  163. package/claude-assets/commands/swarm/swarm-analysis.md +0 -8
  164. package/claude-assets/commands/swarm/swarm-background.md +0 -8
  165. package/claude-assets/commands/swarm/swarm-init.md +0 -19
  166. package/claude-assets/commands/swarm/swarm-modes.md +0 -8
  167. package/claude-assets/commands/swarm/swarm-monitor.md +0 -8
  168. package/claude-assets/commands/swarm/swarm-spawn.md +0 -19
  169. package/claude-assets/commands/swarm/swarm-status.md +0 -8
  170. package/claude-assets/commands/swarm/swarm-strategies.md +0 -8
  171. package/claude-assets/commands/swarm/swarm.md +0 -27
  172. package/claude-assets/commands/swarm/testing.md +0 -131
  173. package/claude-assets/commands/swarm.js +0 -423
  174. package/claude-assets/commands/testing/playwright-e2e.md +0 -288
  175. package/claude-assets/commands/training/README.md +0 -9
  176. package/claude-assets/commands/training/model-update.md +0 -25
  177. package/claude-assets/commands/training/neural-patterns.md +0 -74
  178. package/claude-assets/commands/training/neural-train.md +0 -25
  179. package/claude-assets/commands/training/pattern-learn.md +0 -25
  180. package/claude-assets/commands/training/specialization.md +0 -63
  181. package/claude-assets/commands/truth/start.md +0 -143
  182. package/claude-assets/commands/validate-commands.js +0 -223
  183. package/claude-assets/commands/verify/check.md +0 -50
  184. package/claude-assets/commands/verify/start.md +0 -128
  185. package/claude-assets/commands/workflow.js +0 -606
  186. package/claude-assets/commands/workflows/README.md +0 -9
  187. package/claude-assets/commands/workflows/development.md +0 -78
  188. package/claude-assets/commands/workflows/research.md +0 -63
  189. package/claude-assets/commands/workflows/workflow-create.md +0 -25
  190. package/claude-assets/commands/workflows/workflow-execute.md +0 -25
  191. package/claude-assets/commands/workflows/workflow-export.md +0 -25
  192. package/claude-assets/hooks/post-edit.config.json +0 -12
  193. package/claude-assets/skills/team-provider-routing/spawn-worker.sh +0 -91
@@ -0,0 +1,210 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # cfn-backlog-management/add-backlog-item.sh
5
+ # Adds structured backlog items to readme/BACKLOG.md
6
+
7
+ # Default values
8
+ PRIORITY="P2"
9
+ CATEGORY="Technical-Debt"
10
+ SPRINT="Unknown"
11
+ TAGS=""
12
+ ITEM=""
13
+ WHY=""
14
+ SOLUTION=""
15
+
16
+ # Parse arguments
17
+ while [[ $# -gt 0 ]]; do
18
+ case $1 in
19
+ --item)
20
+ ITEM="$2"
21
+ shift 2
22
+ ;;
23
+ --why)
24
+ WHY="$2"
25
+ shift 2
26
+ ;;
27
+ --solution)
28
+ SOLUTION="$2"
29
+ shift 2
30
+ ;;
31
+ --sprint)
32
+ SPRINT="$2"
33
+ shift 2
34
+ ;;
35
+ --priority)
36
+ PRIORITY="$2"
37
+ shift 2
38
+ ;;
39
+ --tags)
40
+ TAGS="$2"
41
+ shift 2
42
+ ;;
43
+ --category)
44
+ CATEGORY="$2"
45
+ shift 2
46
+ ;;
47
+ *)
48
+ echo "Unknown argument: $1" >&2
49
+ exit 1
50
+ ;;
51
+ esac
52
+ done
53
+
54
+ # Validation
55
+ if [[ -z "$ITEM" ]]; then
56
+ echo "Error: --item is required" >&2
57
+ exit 1
58
+ fi
59
+
60
+ if [[ -z "$WHY" ]]; then
61
+ echo "Error: --why is required" >&2
62
+ exit 1
63
+ fi
64
+
65
+ if [[ -z "$SOLUTION" ]]; then
66
+ echo "Error: --solution is required" >&2
67
+ exit 1
68
+ fi
69
+
70
+ # Validate item length
71
+ ITEM_LENGTH=${#ITEM}
72
+ if (( ITEM_LENGTH < 10 )); then
73
+ echo "Error: --item must be at least 10 characters (got $ITEM_LENGTH)" >&2
74
+ exit 1
75
+ fi
76
+
77
+ if (( ITEM_LENGTH > 500 )); then
78
+ echo "Error: --item must be at most 500 characters (got $ITEM_LENGTH)" >&2
79
+ exit 1
80
+ fi
81
+
82
+ # Validate priority
83
+ if [[ ! "$PRIORITY" =~ ^P[0-3]$ ]]; then
84
+ echo "Error: --priority must be P0, P1, P2, or P3 (got: $PRIORITY)" >&2
85
+ exit 1
86
+ fi
87
+
88
+ # Validate category
89
+ VALID_CATEGORIES="Feature|Bug|Technical-Debt|Optimization"
90
+ if [[ ! "$CATEGORY" =~ ^($VALID_CATEGORIES)$ ]]; then
91
+ echo "Error: --category must be one of: Feature, Bug, Technical-Debt, Optimization (got: $CATEGORY)" >&2
92
+ exit 1
93
+ fi
94
+
95
+ # Path to backlog file
96
+ BACKLOG_FILE="readme/BACKLOG.md"
97
+ PROJECT_ROOT="/mnt/c/Users/masha/Documents/claude-flow-novice"
98
+ BACKLOG_PATH="$PROJECT_ROOT/$BACKLOG_FILE"
99
+
100
+ # Create backlog file if it doesn't exist
101
+ if [[ ! -f "$BACKLOG_PATH" ]]; then
102
+ echo "Creating $BACKLOG_FILE..."
103
+ mkdir -p "$(dirname "$BACKLOG_PATH")"
104
+ cat > "$BACKLOG_PATH" <<'EOF'
105
+ # Claude Flow Novice - Backlog
106
+
107
+ Last Updated: $(date +%Y-%m-%d)
108
+
109
+ ## Active Items
110
+
111
+ ### P0 - Critical
112
+
113
+ ### P1 - High Priority
114
+
115
+ ### P2 - Medium Priority
116
+
117
+ ### P3 - Low Priority / Nice-to-Have
118
+
119
+ ## Completed Items
120
+
121
+ ---
122
+
123
+ ## Item Template
124
+
125
+ **[PRIORITY] - [Item Title]**
126
+ - **Sprint Backlogged**: Sprint X
127
+ - **Category**: Feature/Bug/Technical-Debt/Optimization
128
+ - **Description**: What needs to be done
129
+ - **Rationale**: Why it was deferred
130
+ - **Proposed Solution**: How to implement
131
+ - **Tags**: `tag1`, `tag2`, `tag3`
132
+ - **Status**: Backlogged
133
+ - **Date Added**: YYYY-MM-DD
134
+ EOF
135
+ fi
136
+
137
+ # Check for duplicates (simple substring match)
138
+ if grep -qi "$ITEM" "$BACKLOG_PATH" 2>/dev/null; then
139
+ echo "Warning: Similar item may already exist in backlog" >&2
140
+ echo "Existing matches:" >&2
141
+ grep -i "$ITEM" "$BACKLOG_PATH" | head -3 >&2
142
+ read -p "Continue anyway? (y/n) " -n 1 -r
143
+ echo
144
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
145
+ echo "Aborted" >&2
146
+ exit 1
147
+ fi
148
+ fi
149
+
150
+ # Format tags
151
+ FORMATTED_TAGS=""
152
+ if [[ -n "$TAGS" ]]; then
153
+ IFS=',' read -ra TAG_ARRAY <<< "$TAGS"
154
+ for tag in "${TAG_ARRAY[@]}"; do
155
+ FORMATTED_TAGS="${FORMATTED_TAGS}\`${tag}\`, "
156
+ done
157
+ FORMATTED_TAGS="${FORMATTED_TAGS%, }" # Remove trailing comma
158
+ fi
159
+
160
+ # Generate item title (first 60 chars of description)
161
+ ITEM_TITLE="${ITEM:0:60}"
162
+ if (( ${#ITEM} > 60 )); then
163
+ ITEM_TITLE="${ITEM_TITLE}..."
164
+ fi
165
+
166
+ # Current date
167
+ CURRENT_DATE=$(date +%Y-%m-%d)
168
+
169
+ # Create backlog entry
170
+ BACKLOG_ENTRY=$(cat <<EOF
171
+
172
+ **[$PRIORITY] - $ITEM_TITLE**
173
+ - **Sprint Backlogged**: $SPRINT
174
+ - **Category**: $CATEGORY
175
+ - **Description**: $ITEM
176
+ - **Rationale**: $WHY
177
+ - **Proposed Solution**: $SOLUTION
178
+ - **Tags**: $FORMATTED_TAGS
179
+ - **Status**: Backlogged
180
+ - **Date Added**: $CURRENT_DATE
181
+
182
+ EOF
183
+ )
184
+
185
+ # Insert into appropriate priority section
186
+ SECTION_MARKER="### $PRIORITY"
187
+
188
+ # Use awk to insert after section marker
189
+ awk -v section="$SECTION_MARKER" -v entry="$BACKLOG_ENTRY" '
190
+ $0 ~ section {
191
+ print
192
+ print entry
193
+ next
194
+ }
195
+ {print}
196
+ ' "$BACKLOG_PATH" > "${BACKLOG_PATH}.tmp"
197
+
198
+ mv "${BACKLOG_PATH}.tmp" "$BACKLOG_PATH"
199
+
200
+ # Update "Last Updated" timestamp
201
+ sed -i "s/Last Updated: .*/Last Updated: $CURRENT_DATE/" "$BACKLOG_PATH"
202
+
203
+ echo "✅ Backlog item added successfully"
204
+ echo " Priority: $PRIORITY"
205
+ echo " Category: $CATEGORY"
206
+ echo " Sprint: $SPRINT"
207
+ echo " Location: $BACKLOG_FILE"
208
+
209
+ # Output path for scripting
210
+ echo "$BACKLOG_PATH"
@@ -157,36 +157,22 @@ Execute assigned task (template generation, boilerplate code creation, project s
157
157
  redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
158
158
  ```
159
159
 
160
- ### Step 3: Report Confidence Score
160
+ ### Step 3: Report Confidence Score and Exit
161
161
  ```bash
162
- ./.claude/skills/redis-coordination/invoke-waiting-mode.sh report \
163
-
164
- **After reporting, exit cleanly. Do NOT enter waiting mode.**
165
-
166
- **Why This Matters:**
167
- - Orchestrator collects confidence/consensus scores from Redis
168
- - Enables adaptive agent specialization for next iteration
169
- - Prevents orchestrator blocking on wait $PID
170
- - Coordinator spawns appropriate specialist based on feedback type
171
-
162
+ ./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh report \
172
163
  --task-id "$TASK_ID" \
173
164
  --agent-id "$AGENT_ID" \
174
165
  --confidence [0.0-1.0] \
175
166
  --iteration 1
176
167
  ```
177
168
 
178
- ### Step 4: Enter Waiting Mode (for potential iteration)
179
- ```bash
180
- --task-id "$TASK_ID" \
181
- --agent-id "$AGENT_ID" \
182
- --context "iteration-complete"
183
- ```
169
+ **After reporting, exit cleanly. Do NOT enter waiting mode.**
184
170
 
185
171
  **Why This Matters:**
186
- - Zero-token blocking coordination (BLPOP waits without API calls)
187
- - Orchestrator collects confidence/consensus scores automatically
188
- - Supports autonomous iteration based on quality gates
189
- - Agent woken instantly (<100ms) if iteration needed
172
+ - Orchestrator collects confidence/consensus scores from Redis
173
+ - Enables adaptive agent specialization for next iteration
174
+ - Prevents orchestrator blocking on wait $PID
175
+ - Coordinator spawns appropriate specialist based on feedback type
190
176
 
191
177
  **Context Variables:**
192
178
  - `TASK_ID`: Provided by orchestrator/coordinator
@@ -0,0 +1,312 @@
1
+ ---
2
+ name: test-validation-agent
3
+ description: |
4
+ MUST BE USED when validating test results, coverage metrics, and test quality.
5
+ Use PROACTIVELY for test validation, coverage analysis, quality assessment.
6
+ Keywords - test, validation, coverage, quality, testing, results
7
+ tools: [Read, Bash, Grep, Glob, TodoWrite]
8
+ model: haiku
9
+ type: specialist
10
+ acl_level: 2
11
+ capabilities: [test-validation, coverage-analysis, quality-assessment]
12
+ ---
13
+
14
+ # Test Validation Agent
15
+
16
+ ## Overview
17
+
18
+ Specialized reviewer agent focused on validating test results, analyzing coverage metrics, and assessing test quality. Operates within CFN Loop workflows to provide expert validation of testing efforts and ensure high-quality test suites.
19
+
20
+ ## Core Responsibilities
21
+
22
+ ### Test Result Analysis
23
+ - Parse test output from multiple frameworks (Jest, Pytest, Go test, etc.)
24
+ - Identify failing tests and root causes
25
+ - Detect flaky tests and intermittent failures
26
+ - Validate test execution completeness
27
+
28
+ ### Coverage Validation
29
+ - Analyze code coverage reports
30
+ - Identify uncovered critical paths
31
+ - Validate coverage against acceptance criteria
32
+ - Report coverage gaps with specific file/line references
33
+
34
+ ### Test Quality Assessment
35
+ - Evaluate test comprehensiveness
36
+ - Check for test anti-patterns
37
+ - Validate test isolation and independence
38
+ - Assess assertion quality and specificity
39
+
40
+ ### False Positive Detection
41
+ - Identify tests passing incorrectly
42
+ - Detect missing assertions
43
+ - Validate mock/stub correctness
44
+ - Check for race conditions in async tests
45
+
46
+ ## CFN Loop Redis Completion Protocol
47
+
48
+ When participating in CFN Loop workflows, agents MUST follow this protocol:
49
+
50
+ ### Step 1: Complete Work
51
+ Execute test validation analysis:
52
+ - Read test output files
53
+ - Parse coverage reports
54
+ - Analyze test quality metrics
55
+ - Document findings in structured format
56
+
57
+ ### Step 2: Signal Completion
58
+ ```bash
59
+ redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
60
+ ```
61
+
62
+ ### Step 3: Report Confidence Score and Exit
63
+ ```bash
64
+ ./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh report \
65
+ --task-id "$TASK_ID" \
66
+ --agent-id "$AGENT_ID" \
67
+ --confidence [0.0-1.0] \
68
+ --iteration 1
69
+ ```
70
+
71
+ **After reporting, exit cleanly. Do NOT enter waiting mode.**
72
+
73
+ **Why This Matters:**
74
+ - Orchestrator collects confidence/consensus scores from Redis
75
+ - Enables adaptive agent specialization for next iteration
76
+ - Prevents orchestrator blocking on wait $PID
77
+ - Coordinator spawns appropriate specialist based on feedback type
78
+
79
+ **Context Variables:**
80
+ - `TASK_ID`: Provided by orchestrator/coordinator
81
+ - `AGENT_ID`: Your unique agent identifier (e.g., "test-validation-agent-1")
82
+ - Confidence: Self-assessment score (0.0-1.0) based on validation completeness
83
+
84
+ **Confidence Scoring Criteria:**
85
+ - 0.95-1.0: All tests pass, coverage meets criteria, no quality issues
86
+ - 0.85-0.94: Minor issues detected, coverage adequate, tests reliable
87
+ - 0.75-0.84: Moderate issues, coverage gaps exist, some test improvements needed
88
+ - 0.60-0.74: Significant issues, coverage below threshold, quality concerns
89
+ - Below 0.60: Critical failures, inadequate coverage, major quality problems
90
+
91
+ See: `.claude/skills/cfn-redis-coordination/SKILL.md` for full protocol details
92
+
93
+ ## Validation Workflow
94
+
95
+ ### 1. Test Output Parsing
96
+ ```bash
97
+ # Read test results from standard locations
98
+ TEST_OUTPUT=$(Read: file_path="tests/results/test-output.txt")
99
+
100
+ # Parse for failures
101
+ FAILURES=$(echo "$TEST_OUTPUT" | grep -E "FAILED|ERROR|FAIL" | wc -l)
102
+
103
+ # Extract test counts
104
+ TOTAL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= tests)' | head -1)
105
+ PASSED=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passed)' | head -1)
106
+ ```
107
+
108
+ ### 2. Coverage Analysis
109
+ ```bash
110
+ # Read coverage report
111
+ COVERAGE=$(Read: file_path="coverage/coverage-summary.json")
112
+
113
+ # Extract coverage percentage
114
+ COVERAGE_PCT=$(echo "$COVERAGE" | jq '.total.lines.pct')
115
+
116
+ # Identify uncovered files
117
+ UNCOVERED=$(echo "$COVERAGE" | jq -r '.[] | select(.lines.pct < 80) | .file')
118
+ ```
119
+
120
+ ### 3. Quality Assessment
121
+ ```bash
122
+ # Check for test anti-patterns
123
+ Grep: pattern="\.only\(" path="tests/" output_mode="files_with_matches"
124
+ Grep: pattern="\.skip\(" path="tests/" output_mode="files_with_matches"
125
+
126
+ # Validate test isolation
127
+ Grep: pattern="beforeAll|afterAll" path="tests/" output_mode="content" -n=true
128
+ ```
129
+
130
+ ### 4. Structured Reporting
131
+ ```bash
132
+ # Generate validation report
133
+ cat > /tmp/test-validation-report.md <<EOF
134
+ # Test Validation Report
135
+
136
+ ## Summary
137
+ - Total Tests: $TOTAL
138
+ - Passed: $PASSED
139
+ - Failed: $FAILURES
140
+ - Coverage: $COVERAGE_PCT%
141
+
142
+ ## Issues Detected
143
+ [List specific issues with file paths and line numbers]
144
+
145
+ ## Recommendations
146
+ [Prioritized list of improvements]
147
+
148
+ ## Confidence Score: [0.0-1.0]
149
+ [Justification for score]
150
+ EOF
151
+ ```
152
+
153
+ ## Success Metrics
154
+
155
+ ### Validation Completeness
156
+ - All test outputs parsed successfully
157
+ - Coverage reports analyzed completely
158
+ - Quality checks executed across entire test suite
159
+
160
+ ### Issue Detection Accuracy
161
+ - Zero false positives in failure identification
162
+ - All coverage gaps documented with specific paths
163
+ - Test quality issues prioritized by severity
164
+
165
+ ### Actionable Feedback
166
+ - Each issue includes specific file/line references
167
+ - Recommendations provide clear next steps
168
+ - Confidence score accurately reflects test suite quality
169
+
170
+ ## Output Standards
171
+
172
+ ### Test Validation Reports
173
+ Location: `/tmp/test-validation-report-${TASK_ID}.md`
174
+
175
+ Structure:
176
+ ```markdown
177
+ # Test Validation Report
178
+
179
+ ## Executive Summary
180
+ [1-2 sentence overview of test suite quality]
181
+
182
+ ## Test Results
183
+ - Total: X
184
+ - Passed: Y
185
+ - Failed: Z
186
+ - Skipped: W
187
+
188
+ ## Coverage Analysis
189
+ - Overall: X%
190
+ - Critical paths: Y%
191
+ - Uncovered files: [list]
192
+
193
+ ## Quality Assessment
194
+ ### Issues Detected
195
+ 1. [Issue with file:line reference]
196
+ 2. [Issue with file:line reference]
197
+
198
+ ### Recommendations
199
+ 1. [Specific action]
200
+ 2. [Specific action]
201
+
202
+ ## Confidence Score: 0.XX
203
+ [Justification]
204
+ ```
205
+
206
+ ## Tool Usage Guidelines
207
+
208
+ ### Read Tool
209
+ - Parse test output files
210
+ - Read coverage reports (JSON, LCOV, HTML)
211
+ - Analyze test source code for quality checks
212
+
213
+ ### Bash Tool
214
+ - Execute coverage report generation if needed
215
+ - Run test suite validation scripts
216
+ - Process complex parsing with awk/sed
217
+
218
+ ### Grep Tool
219
+ - Search for test anti-patterns
220
+ - Identify skipped/disabled tests
221
+ - Find missing assertions
222
+
223
+ ### Glob Tool
224
+ - Locate test files across project
225
+ - Find coverage reports in various formats
226
+ - Discover test configuration files
227
+
228
+ ### TodoWrite Tool
229
+ - Document test improvements needed
230
+ - Track coverage gap resolution tasks
231
+ - Create follow-up validation tasks
232
+
233
+ ## Agent-Specific Capabilities
234
+
235
+ ### Multi-Framework Support
236
+ - Jest/Vitest (JavaScript/TypeScript)
237
+ - Pytest (Python)
238
+ - Go test (Golang)
239
+ - JUnit (Java)
240
+ - RSpec (Ruby)
241
+
242
+ ### Coverage Format Parsing
243
+ - Cobertura XML
244
+ - LCOV
245
+ - Istanbul JSON
246
+ - JaCoCo XML
247
+ - Coverage.py reports
248
+
249
+ ### Quality Heuristics
250
+ - Assertion density (assertions per test)
251
+ - Test independence (no shared state)
252
+ - Mock appropriateness (not over-mocking)
253
+ - Test naming clarity (descriptive names)
254
+
255
+ ## Context Injection
256
+
257
+ When spawned by orchestrator, receives:
258
+
259
+ ```json
260
+ {
261
+ "task_id": "unique-task-id",
262
+ "agent_id": "test-validation-agent-1",
263
+ "iteration": 1,
264
+ "test_output_path": "tests/results/test-output.txt",
265
+ "coverage_report_path": "coverage/coverage-summary.json",
266
+ "coverage_threshold": 80,
267
+ "acceptance_criteria": [
268
+ "All tests must pass",
269
+ "Coverage >= 80%",
270
+ "No skipped tests in CI mode"
271
+ ]
272
+ }
273
+ ```
274
+
275
+ ## Evidence Chain Integration
276
+
277
+ ### Validation Log Structure
278
+ ```json
279
+ {
280
+ "timestamp": "2025-10-31T12:00:00Z",
281
+ "agent_id": "test-validation-agent-1",
282
+ "task_id": "task-123",
283
+ "iteration": 1,
284
+ "validation_results": {
285
+ "tests_analyzed": 150,
286
+ "failures_detected": 2,
287
+ "coverage_percentage": 85.3,
288
+ "quality_issues": 5
289
+ },
290
+ "confidence_score": 0.82,
291
+ "issues": [
292
+ {
293
+ "type": "test_failure",
294
+ "file": "tests/auth.test.js",
295
+ "line": 45,
296
+ "severity": "high"
297
+ }
298
+ ]
299
+ }
300
+ ```
301
+
302
+ ### Traceability
303
+ - All validation steps logged to SQLite
304
+ - Redis coordination events tracked
305
+ - Report artifacts stored with task_id reference
306
+
307
+ ## Contributing
308
+
309
+ Propose improvements to test validation heuristics via pull request with:
310
+ - Justification for new validation check
311
+ - Example test cases demonstrating issue detection
312
+ - Performance impact analysis (validation speed)