claude-flow-novice 2.14.12 → 2.14.13

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 (32) hide show
  1. package/.claude/commands/CFN_LOOP_TASK_MODE.md +51 -7
  2. package/.claude/commands/cfn-loop-cli.md +1 -1
  3. package/.claude/skills/cfn-agent-selector/SKILL.md +2 -2
  4. package/.claude/skills/cfn-agent-selector/SKILL.md.backup_before_replace +91 -0
  5. package/.claude/skills/cfn-agent-selector/select-agents.sh +45 -0
  6. package/.claude/skills/cfn-loop-orchestration/helpers/context-injection.sh +69 -6
  7. package/.claude/skills/cfn-loop-orchestration/helpers/validate-task-context.sh +241 -0
  8. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +17 -0
  9. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +3 -3
  10. package/claude-assets/agents/cfn-dev-team/CLAUDE.md.backup_before_replace +1086 -0
  11. package/claude-assets/agents/cfn-dev-team/README.md +1 -1
  12. package/claude-assets/agents/cfn-dev-team/README.md.backup_before_replace +116 -0
  13. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +2 -2
  14. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md.backup_before_replace +451 -0
  15. package/claude-assets/agents/cfn-dev-team/developers/README.md +3 -3
  16. package/claude-assets/agents/cfn-dev-team/developers/README.md.backup_before_replace +69 -0
  17. package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md +1 -1
  18. package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md.backup_before_replace +465 -0
  19. package/claude-assets/agents/cfn-dev-team/test-agent.md +2 -2
  20. package/claude-assets/agents/cfn-dev-team/test-agent.md.backup_before_replace +141 -0
  21. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +51 -7
  22. package/claude-assets/commands/cfn-loop-cli.md +1 -1
  23. package/claude-assets/skills/cfn-agent-selector/SKILL.md +2 -2
  24. package/claude-assets/skills/cfn-agent-selector/SKILL.md.backup_before_replace +91 -0
  25. package/claude-assets/skills/cfn-agent-selector/select-agents.sh +45 -0
  26. package/claude-assets/skills/cfn-loop-orchestration/helpers/context-injection.sh +69 -6
  27. package/claude-assets/skills/cfn-loop-orchestration/helpers/validate-task-context.sh +241 -0
  28. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +17 -0
  29. package/dist/cli/config-manager.js +109 -91
  30. package/dist/cli/config-manager.js.map +1 -1
  31. package/package.json +1 -1
  32. package/scripts/init-project.js +36 -1
@@ -6,11 +6,11 @@
6
6
 
7
7
  ## Overview
8
8
 
9
- Task Mode: Main Chat spawns coordinator and agents via Task() tool with full context injection and visibility.
9
+ Task Mode: Main Chat acts as coordinator and spawns agents directly via Task() tool with full context injection and visibility.
10
10
 
11
11
  | Aspect | Task Mode | CLI Mode |
12
12
  |--------|-----------|----------|
13
- | **Spawning** | Main Chat via Task() | Coordinator via npx CLI |
13
+ | **Spawning** | Main Chat spawns agents directly via Task() | Coordinator spawns agents via npx CLI |
14
14
  | **Visibility** | Full transparency in Main Chat | Background, Redis logs |
15
15
  | **Provider** | All Anthropic | CLI uses Z.ai routing |
16
16
  | **Cost** | ~$0.150/iteration | ~$0.054/iteration (64% savings) |
@@ -35,6 +35,50 @@ Task Mode: Main Chat spawns coordinator and agents via Task() tool with full con
35
35
 
36
36
  ---
37
37
 
38
+ ## Task Mode Execution Pattern
39
+
40
+ **Key Principle: Main Chat IS the coordinator**
41
+
42
+ In Task Mode, Main Chat directly spawns all agents via Task() tool. No coordinator agent is used.
43
+
44
+ ### Example: Zone A React Router Migration
45
+
46
+ ```javascript
47
+ // ✅ CORRECT - Main Chat spawns agents directly
48
+ Task("backend-developer", `
49
+ Migrate React Router from v4 to v6 in Zone A components
50
+ Deliverables: Updated Routes, component fixes, tests
51
+ Directory: frontend/src/zone-a/
52
+ `);
53
+
54
+ Task("react-frontend-engineer", `
55
+ Review and fix any component issues after router migration
56
+ Focus on route parameters, navigation, and component integration
57
+ `);
58
+
59
+ Task("tester", `
60
+ Test React Router v6 migration in Zone A
61
+ Verify all routes work, navigation functions, no regressions
62
+ `);
63
+
64
+ // Later: Process outputs, collect confidence, decide next iteration
65
+ ```
66
+
67
+ ### What NOT to Do in Task Mode
68
+
69
+ ```javascript
70
+ // ❌ INCORRECT - Don't spawn coordinator agent
71
+ Task("cfn-v3-coordinator", "Coordinate React Router migration");
72
+
73
+ // ❌ INCORRECT - Don't use CLI commands in Task Mode
74
+ Bash("npx claude-flow-novice swarm 'task description'");
75
+
76
+ // ❌ INCORRECT - Don't nest CFN Loop calls
77
+ Task("reviewer", "/cfn-loop 'review this code'"); // Causes infinite loops
78
+ ```
79
+
80
+ ---
81
+
38
82
  ## Agent Specialization
39
83
 
40
84
  ### Loop 3 (Implementation)
@@ -88,15 +132,15 @@ return validators.slice(0, 6); // Max 6
88
132
  ## Sprint Completion Workflow
89
133
 
90
134
  **Key Difference in Task Mode:**
91
- - Product Owner spawned via `Task()` by coordinator (NOT via `execute-decision.sh`)
135
+ - Product Owner spawned via `Task()` by Main Chat acting as coordinator (NOT via `execute-decision.sh`)
92
136
  - Use helper scripts for parsing/validation: `parse-decision.sh`, `validate-deliverables.sh`
93
137
  - CLI Mode uses `execute-decision.sh` which handles spawning + all logic
94
138
 
95
139
  ### 1. Consensus Validation
96
140
 
97
- **Task Mode** - Coordinator spawns Product Owner via Task():
141
+ **Task Mode** - Main Chat (as coordinator) spawns Product Owner via Task():
98
142
  ```javascript
99
- // Coordinator builds context and spawns PO
143
+ // Main Chat (as coordinator) builds context and spawns PO
100
144
  const poContext = `
101
145
  CFN Loop iteration ${iteration} complete.
102
146
  Loop 2 Consensus: ${consensus} (threshold: ${threshold})
@@ -164,7 +208,7 @@ EOF
164
208
  ### 5. Execute Product Owner Suggested Next Steps
165
209
 
166
210
  **After PROCEED Decision:**
167
- Product Owner may suggest follow-up tasks (documentation, testing, refactoring). Coordinator (main chat) must proceed by spawning specialized agents to execute these tasks:
211
+ Product Owner may suggest follow-up tasks (documentation, testing, refactoring). Main Chat (as coordinator) must proceed by spawning specialized agents to execute these tasks:
168
212
 
169
213
  ```javascript
170
214
  // Parse PO feedback for suggested next steps
@@ -305,7 +349,7 @@ threshold = Math.min(threshold, 0.98); // Cap at 0.98
305
349
  ## Background Backlog Worker
306
350
 
307
351
  ### Architecture
308
- - **Main Chat**: Spawns Task() agents for Sprint N (foreground)
352
+ - **Main Chat (as coordinator)**: Spawns Task() agents directly for Sprint N (foreground)
309
353
  - **Background CLI**: Processes P3 backlog items (detached process)
310
354
 
311
355
  ### Launch Background Worker
@@ -149,7 +149,7 @@ Task("cfn-v3-coordinator", `
149
149
 
150
150
  1. INVOKE ORCHESTRATOR (CLI spawning):
151
151
 
152
- TASK_ID="cfn-cli-$(date +%s)"
152
+ TASK_ID="cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}"
153
153
  MODE="${mode}"
154
154
  LOOP3_AGENTS="backend-dev,researcher,devops" # Customize for task
155
155
  LOOP2_AGENTS="reviewer,tester,architect,security-specialist" # Scale by complexity
@@ -17,7 +17,7 @@ AGENTS=$(./.claude/skills/cfn-agent-selector/select-agents.sh \
17
17
  --task-type "software-development" \
18
18
  --description "Implement JWT authentication with refresh tokens")
19
19
 
20
- echo "$AGENTS" | jq '.loop3[]' # ["backend-dev", "security-specialist"]
20
+ echo "$AGENTS" | jq '.loop3[]' # ["backend-developer", "security-specialist"]
21
21
  echo "$AGENTS" | jq '.loop2[]' # ["reviewer", "tester", "security-auditor"]
22
22
  ```
23
23
 
@@ -35,7 +35,7 @@ echo "$AGENTS" | jq '.loop2[]' # ["reviewer", "tester", "security-auditor"]
35
35
  ## Agent Selection Rules
36
36
 
37
37
  ### Software Development
38
- **Base Loop 3:** backend-dev, coder
38
+ **Base Loop 3:** backend-developer, coder
39
39
  **Add if keywords:**
40
40
  - "security", "authentication", "JWT" → security-specialist
41
41
  - "database", "SQL", "schema" → database-engineer (if exists)
@@ -0,0 +1,91 @@
1
+ # Agent Selector Skill
2
+
3
+ **Version:** 1.0.0
4
+ **Purpose:** Select optimal agents for CFN Loop v3 based on task type and requirements
5
+
6
+ ## Overview
7
+
8
+ Recommends Loop 3 (producers) and Loop 2 (evaluators) agents based on:
9
+ - Task type (from task-classifier)
10
+ - Task description keywords
11
+ - Complexity requirements
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ AGENTS=$(./.claude/skills/cfn-agent-selector/select-agents.sh \
17
+ --task-type "software-development" \
18
+ --description "Implement JWT authentication with refresh tokens")
19
+
20
+ echo "$AGENTS" | jq '.loop3[]' # ["backend-dev", "security-specialist"]
21
+ echo "$AGENTS" | jq '.loop2[]' # ["reviewer", "tester", "security-auditor"]
22
+ ```
23
+
24
+ ## Output Format
25
+
26
+ ```json
27
+ {
28
+ "loop3": ["agent1", "agent2", "agent3"],
29
+ "loop2": ["validator1", "validator2", "validator3"],
30
+ "loop4": "product-owner",
31
+ "reasoning": "Explanation of agent selection"
32
+ }
33
+ ```
34
+
35
+ ## Agent Selection Rules
36
+
37
+ ### Software Development
38
+ **Base Loop 3:** backend-dev, coder
39
+ **Add if keywords:**
40
+ - "security", "authentication", "JWT" → security-specialist
41
+ - "database", "SQL", "schema" → database-engineer (if exists)
42
+ - "deploy", "CI/CD", "infrastructure" → devops-engineer
43
+ - "frontend", "React", "UI" → react-frontend-engineer
44
+
45
+ **Loop 2:** reviewer, tester, security-auditor
46
+
47
+ ### Content Creation
48
+ **Base Loop 3:** copywriter, content-strategist
49
+ **Add if keywords:**
50
+ - "SEO", "search", "keywords" → seo-specialist
51
+ - "technical", "documentation" → technical-writer (if exists)
52
+
53
+ **Loop 2:** editor, brand-reviewer, compliance-checker
54
+
55
+ ### Research
56
+ **Base Loop 3:** researcher, data-analyst
57
+ **Add if keywords:**
58
+ - "statistics", "data analysis" → statistician (if exists)
59
+ - "domain-specific" → domain-expert
60
+
61
+ **Loop 2:** fact-checker, methodology-reviewer, statistician
62
+
63
+ ### Design
64
+ **Base Loop 3:** ui-designer, ux-researcher
65
+ **Add if keywords:**
66
+ - "visual", "branding" → visual-designer
67
+ - "accessibility" → accessibility-advocate
68
+
69
+ **Loop 2:** accessibility-advocate, design-critic, user-tester
70
+
71
+ ### Infrastructure
72
+ **Base Loop 3:** devops-engineer, terraform-engineer
73
+ **Add if keywords:**
74
+ - "Kubernetes", "k8s", "container" → kubernetes-architect
75
+ - "network", "security" → network-engineer (if exists)
76
+
77
+ **Loop 2:** security-auditor, cost-optimizer, compliance-checker
78
+
79
+ ### Data Engineering
80
+ **Base Loop 3:** data-engineer, pipeline-builder
81
+ **Add if keywords:**
82
+ - "ETL", "transformation" → etl-specialist
83
+ - "streaming", "real-time" → streaming-specialist (if exists)
84
+
85
+ **Loop 2:** data-quality-validator, schema-reviewer, performance-tester
86
+
87
+ ## Integration
88
+
89
+ Used by:
90
+ - `.claude/agents/cfn-v3-coordinator.md` - Agent selection
91
+ - `.claude/skills/cfn-agent-selector/select-agents.sh` - Primary selection script
@@ -28,12 +28,57 @@ if [[ ! -f "$REGISTRY_PATH" ]]; then
28
28
  exit 1
29
29
  fi
30
30
 
31
+ # Smart agent selection for React Router and specialized tasks
32
+ smart_agent_selection() {
33
+ local description="$1"
34
+ local task_type="$2"
35
+
36
+ # React Router specialization - Zone A fix
37
+ if [[ "$description" =~ (React Router|react-router|TS2786|jsx.*component|route.*migration) ]]; then
38
+ echo '["react-frontend-engineer", "reviewer", "tester"]'
39
+ return 0
40
+ fi
41
+
42
+ # TypeScript/TSX specialization
43
+ if [[ "$description" =~ (TypeScript|tsx|TS[0-9]+|interface.*error) ]]; then
44
+ echo '["react-frontend-engineer", "reviewer", "tester"]'
45
+ return 0
46
+ fi
47
+
48
+ # Frontend UI specialization
49
+ if [[ "$description" =~ (frontend|ui|component|css|style|responsive) ]]; then
50
+ echo '["react-frontend-engineer", "reviewer", "accessibility-advocate-persona"]'
51
+ return 0
52
+ fi
53
+
54
+ # Authentication/Security specialization
55
+ if [[ "$description" =~ (auth|jwt|token|security|password|login|register) ]]; then
56
+ echo '["backend-developer", "security-specialist", "reviewer"]'
57
+ return 0
58
+ fi
59
+
60
+ # API/Backend specialization
61
+ if [[ "$description" =~ (api|endpoint|server|backend|database|orm|sql) ]]; then
62
+ echo '["backend-developer", "reviewer", "tester"]'
63
+ return 0
64
+ fi
65
+
66
+ return 1 # Fall back to registry-based selection
67
+ }
68
+
31
69
  # Score agents function with improved flat namespace matching
32
70
  score_agents() {
33
71
  local registry_path="$1"
34
72
  local description="$2"
35
73
  local task_type="$3"
36
74
 
75
+ # Try smart selection first
76
+ local smart_result
77
+ if smart_result=$(smart_agent_selection "$description" "$task_type"); then
78
+ echo "$smart_result"
79
+ return 0
80
+ fi
81
+
37
82
  # Complex JQ query for flexible matching
38
83
  jq -r --arg desc "$description" --arg task_type "$task_type" '
39
84
  [
@@ -116,16 +116,79 @@ inject_context_for_agent() {
116
116
  local task_id="$2"
117
117
  local iteration="${3:-1}"
118
118
 
119
- # Retrieve task context from Redis
120
- local task_context
119
+ # Retrieve structured task context from Redis
120
+ local task_context=""
121
+ local epic_context=""
122
+ local phase_context=""
123
+ local success_criteria=""
124
+ local expected_files=""
125
+
121
126
  if command -v redis-cli &> /dev/null; then
122
- task_context=$(redis-cli HGET "cfn_loop:task:$task_id:context" "task_description" 2>/dev/null || echo "")
123
- else
124
- task_context=""
127
+ # Get all structured context fields
128
+ task_context=$(redis-cli HGET "swarm:$task_id:context" "task_description" 2>/dev/null || echo "")
129
+ epic_context=$(redis-cli HGET "swarm:$task_id:context" "epic-context" 2>/dev/null || echo "")
130
+ phase_context=$(redis-cli HGET "swarm:$task_id:context" "phase-context" 2>/dev/null || echo "")
131
+ success_criteria=$(redis-cli HGET "swarm:$task_id:context" "success-criteria" 2>/dev/null || echo "")
132
+ expected_files=$(redis-cli HGET "swarm:$task_id:context" "expected-files" 2>/dev/null || echo "")
125
133
  fi
126
134
 
135
+ # Build comprehensive task description from all available context
136
+ local comprehensive_context=""
137
+
138
+ # Start with task description if available
139
+ if [ -n "$task_context" ]; then
140
+ comprehensive_context="$task_context"
141
+ fi
142
+
143
+ # Add epic context
144
+ if [ -n "$epic_context" ]; then
145
+ if [ -n "$comprehensive_context" ]; then
146
+ comprehensive_context="$comprehensive_context
147
+
148
+ Epic Context: $epic_context"
149
+ else
150
+ comprehensive_context="Epic Context: $epic_context"
151
+ fi
152
+ fi
153
+
154
+ # Add phase context
155
+ if [ -n "$phase_context" ]; then
156
+ if [ -n "$comprehensive_context" ]; then
157
+ comprehensive_context="$comprehensive_context
158
+
159
+ Phase Context: $phase_context"
160
+ else
161
+ comprehensive_context="Phase Context: $phase_context"
162
+ fi
163
+ fi
164
+
165
+ # Add success criteria
166
+ if [ -n "$success_criteria" ]; then
167
+ if [ -n "$comprehensive_context" ]; then
168
+ comprehensive_context="$comprehensive_context
169
+
170
+ Success Criteria: $success_criteria"
171
+ else
172
+ comprehensive_context="Success Criteria: $success_criteria"
173
+ fi
174
+ fi
175
+
176
+ # Add expected files
177
+ if [ -n "$expected_files" ]; then
178
+ if [ -n "$comprehensive_context" ]; then
179
+ comprehensive_context="$comprehensive_context
180
+
181
+ Expected Files: $expected_files"
182
+ else
183
+ comprehensive_context="Expected Files: $expected_files"
184
+ fi
185
+ fi
186
+
187
+ # Use comprehensive context for further processing
188
+ task_context="$comprehensive_context"
189
+
127
190
  if [ -z "$task_context" ]; then
128
- echo "# ACE Context (No Task Description)"
191
+ echo "# CFN Loop Context (No Task Description)"
129
192
  echo ""
130
193
  echo "_Task description not available for context injection._"
131
194
  return 1
@@ -0,0 +1,241 @@
1
+ #!/bin/bash
2
+ # Task Context Validation Helper
3
+ # Validates that CLI mode has complete task context (prevents "consensus on vapor")
4
+ #
5
+ # Usage: validate-task-context.sh --task-id <id> [--task-description <desc>] [--expected-files <files>] [--success-criteria <criteria>]
6
+
7
+ set -euo pipefail
8
+
9
+ # Initialize variables
10
+ TASK_ID=""
11
+ TASK_DESCRIPTION=""
12
+ EXPECTED_FILES=""
13
+ SUCCESS_CRITERIA=""
14
+ NAMESPACE="swarm"
15
+
16
+ # Parse arguments
17
+ while [[ $# -gt 0 ]]; do
18
+ case "$1" in
19
+ --task-id)
20
+ TASK_ID="$2"
21
+ shift 2
22
+ ;;
23
+ --task-description)
24
+ TASK_DESCRIPTION="$2"
25
+ shift 2
26
+ ;;
27
+ --expected-files)
28
+ EXPECTED_FILES="$2"
29
+ shift 2
30
+ ;;
31
+ --success-criteria)
32
+ SUCCESS_CRITERIA="$2"
33
+ shift 2
34
+ ;;
35
+ --namespace)
36
+ NAMESPACE="$2"
37
+ shift 2
38
+ ;;
39
+ *)
40
+ echo "Unknown parameter: $1" >&2
41
+ exit 1
42
+ ;;
43
+ esac
44
+ done
45
+
46
+ # Validate required arguments
47
+ if [[ -z "$TASK_ID" ]]; then
48
+ echo "Error: --task-id is required" >&2
49
+ echo "Usage: $0 --task-id <id> [--task-description <desc>] [--expected-files <files>] [--success-criteria <criteria>]" >&2
50
+ exit 1
51
+ fi
52
+
53
+ # Validation functions
54
+ validate_task_description() {
55
+ local task_desc="$1"
56
+
57
+ if [[ -z "$task_desc" ]]; then
58
+ echo "❌ Task description is empty or missing"
59
+ return 1
60
+ fi
61
+
62
+ # Check minimum length (should be meaningful)
63
+ if [[ ${#task_desc} -lt 10 ]]; then
64
+ echo "❌ Task description too short (${#task_desc} chars, minimum 10)"
65
+ return 1
66
+ fi
67
+
68
+ # Check for actionable verbs
69
+ if [[ ! "$task_desc" =~ (create|build|implement|fix|migrate|update|add|remove|refactor|test|review|validate) ]]; then
70
+ echo "⚠️ Task description lacks clear action verb"
71
+ fi
72
+
73
+ # Check for specific deliverables (Zone A fix: prevent generic context)
74
+ if [[ "$task_desc" =~ (zone-d-round2|checkpoint|iteration [0-9]+) ]]; then
75
+ echo "❌ Task description contains generic identifier (Zone A issue)"
76
+ return 1
77
+ fi
78
+
79
+ echo "✅ Task description validation passed"
80
+ return 0
81
+ }
82
+
83
+ validate_expected_files() {
84
+ local files="$1"
85
+ local errors=0
86
+
87
+ if [[ -z "$files" ]]; then
88
+ echo "⚠️ No expected files specified (may be OK for analysis tasks)"
89
+ return 0
90
+ fi
91
+
92
+ # Split files by comma and validate each
93
+ IFS=',' read -ra file_array <<< "$files"
94
+ for file in "${file_array[@]}"; do
95
+ # Remove whitespace
96
+ file=$(echo "$file" | xargs)
97
+
98
+ if [[ -z "$file" ]]; then
99
+ continue
100
+ fi
101
+
102
+ # Check file path format
103
+ if [[ ! "$file" =~ ^[a-zA-Z0-9_/-]+\.[a-zA-Z]+$ && ! "$file" =~ ^[a-zA-Z0-9_/-]+/ ]]; then
104
+ echo "❌ Invalid file format: $file"
105
+ ((errors++))
106
+ continue
107
+ fi
108
+
109
+ # Check for generic placeholders
110
+ if [[ "$file" =~ (placeholder|example|template) ]]; then
111
+ echo "❌ Generic file placeholder: $file"
112
+ ((errors++))
113
+ continue
114
+ fi
115
+
116
+ done
117
+
118
+ if [[ $errors -eq 0 ]]; then
119
+ echo "✅ Expected files validation passed"
120
+ return 0
121
+ else
122
+ return 1
123
+ fi
124
+ }
125
+
126
+ validate_success_criteria() {
127
+ local criteria="$1"
128
+ local errors=0
129
+
130
+ if [[ -z "$criteria" ]]; then
131
+ echo "⚠️ No success criteria specified (may be OK for discovery tasks)"
132
+ return 0
133
+ fi
134
+
135
+ # Check criteria length
136
+ if [[ ${#criteria} -lt 5 ]]; then
137
+ echo "❌ Success criteria too short: $criteria"
138
+ ((errors++))
139
+ fi
140
+
141
+ # Check for measurable outcomes
142
+ if [[ ! "$criteria" =~ (test|pass|fail|error|success|complete|0.*errors|100%) ]]; then
143
+ echo "⚠️ Success criteria lacks measurable outcomes"
144
+ fi
145
+
146
+ # Check for generic statements
147
+ if [[ "$criteria" =~ (done|finished|complete|good) && ${#criteria} -lt 20 ]]; then
148
+ echo "❌ Success criteria too generic: $criteria"
149
+ ((errors++))
150
+ fi
151
+
152
+ if [[ $errors -eq 0 ]]; then
153
+ echo "✅ Success criteria validation passed"
154
+ return 0
155
+ else
156
+ return 1
157
+ fi
158
+ }
159
+
160
+ check_redis_context() {
161
+ local task_id="$1"
162
+ local redis_key="${NAMESPACE}:${task_id}:context"
163
+
164
+ # Check if context exists
165
+ if ! redis-cli EXISTS "$redis_key" >/dev/null 2>&1; then
166
+ echo "❌ No context found in Redis for task: $task_id"
167
+ return 1
168
+ fi
169
+
170
+ # Get all context fields
171
+ local context_fields
172
+ context_fields=$(redis-cli HGETALL "$redis_key" 2>/dev/null || echo "")
173
+
174
+ if [[ -z "$context_fields" ]]; then
175
+ echo "❌ Context exists but is empty for task: $task_id"
176
+ return 1
177
+ fi
178
+
179
+ # Count non-metadata fields
180
+ local field_count=0
181
+ while IFS= read -r field; do
182
+ # Skip metadata fields
183
+ if [[ ! "$field" =~ (updated_at|stored_at) ]]; then
184
+ ((field_count++))
185
+ fi
186
+ done <<< "$context_fields"
187
+
188
+ if [[ $field_count -eq 0 ]]; then
189
+ echo "❌ Context contains only metadata fields"
190
+ return 1
191
+ fi
192
+
193
+ echo "✅ Redis context validation passed ($field_count data fields)"
194
+ return 0
195
+ }
196
+
197
+ # Main validation
198
+ validation_errors=0
199
+ echo "🔍 Validating task context for: $TASK_ID"
200
+ echo ""
201
+
202
+ # Validate task description
203
+ if [[ -n "$TASK_DESCRIPTION" ]]; then
204
+ if ! validate_task_description "$TASK_DESCRIPTION"; then
205
+ ((validation_errors++))
206
+ fi
207
+ fi
208
+
209
+ # Validate expected files
210
+ if [[ -n "$EXPECTED_FILES" ]]; then
211
+ if ! validate_expected_files "$EXPECTED_FILES"; then
212
+ ((validation_errors++))
213
+ fi
214
+ fi
215
+
216
+ # Validate success criteria
217
+ if [[ -n "$SUCCESS_CRITERIA" ]]; then
218
+ if ! validate_success_criteria "$SUCCESS_CRITERIA"; then
219
+ ((validation_errors++))
220
+ fi
221
+ fi
222
+
223
+ # Check Redis context
224
+ if ! check_redis_context "$TASK_ID"; then
225
+ ((validation_errors++))
226
+ fi
227
+
228
+ echo ""
229
+
230
+ # Final result
231
+ if [[ $validation_errors -eq 0 ]]; then
232
+ echo "🎉 All context validations passed!"
233
+ echo "✅ CLI Mode has complete, structured task context"
234
+ echo "✅ Zone A 'consensus on vapor' issue prevented"
235
+ exit 0
236
+ else
237
+ echo "❌ $validation_errors validation(s) failed"
238
+ echo "⚠️ Task context may be incomplete"
239
+ echo "⚠️ Risk of 'consensus on vapor' - please add missing context"
240
+ exit 1
241
+ fi
@@ -697,6 +697,23 @@ EOF
697
697
  # Store context in Redis
698
698
  store_context "$TASK_ID"
699
699
 
700
+ # Validate context completeness (Zone A fix: prevent "consensus on vapor")
701
+ echo "Validating task context completeness..."
702
+ if [[ -n "$SUCCESS_CRITERIA" || -n "$EXPECTED_FILES" ]]; then
703
+ validation_script="$HELPERS_DIR/validate-task-context.sh"
704
+ if [[ -f "$validation_script" ]]; then
705
+ if ! "$validation_script" \
706
+ --task-id "$TASK_ID" \
707
+ --success-criteria "$SUCCESS_CRITERIA" \
708
+ --expected-files "$EXPECTED_FILES"; then
709
+ echo "⚠️ WARNING: Task context validation failed"
710
+ echo "⚠️ This may result in 'consensus on vapor' (high confidence, zero deliverables)"
711
+ echo "⚠️ Consider adding more specific task context"
712
+ echo ""
713
+ fi
714
+ fi
715
+ fi
716
+
700
717
  # Iteration loop
701
718
  for ((ITERATION=1; ITERATION<=MAX_ITERATIONS; ITERATION++)); do
702
719
  echo ""
@@ -112,7 +112,7 @@ npx claude-flow-novice agent-spawn my-first-agent --task-id test-1
112
112
  │ ├── tester.md # Testing & validation
113
113
  │ └── coordinator.md # Multi-agent coordination
114
114
  ├── development/ # Development-focused agents
115
- │ ├── backend-dev.md
115
+ │ ├── backend-developer.md
116
116
  │ ├── react-frontend-engineer.md
117
117
  │ └── devops-engineer.md
118
118
  ├── security/ # Security-focused agents
@@ -613,7 +613,7 @@ Agents can work together using Redis pub/sub and CLI spawning:
613
613
  ### Agent Spawning Pattern
614
614
  ```bash
615
615
  # Spawn agents via CLI (coordinators only)
616
- npx claude-flow-novice agent-spawn backend-dev --task-id "${TASK_ID}"
616
+ npx claude-flow-novice agent-spawn backend-developer --task-id "${TASK_ID}"
617
617
  npx claude-flow-novice agent-spawn reviewer --task-id "${TASK_ID}"
618
618
  ```
619
619
 
@@ -948,7 +948,7 @@ acl_level: 1
948
948
  - `.claude/agents/core-agents/coder.md` - Code implementation
949
949
  - `.claude/agents/core-agents/reviewer.md` - Code review
950
950
  - `.claude/agents/core-agents/tester.md` - Testing & validation
951
- - `.claude/agents/development/backend-dev.md` - Backend development
951
+ - `.claude/agents/development/backend-developer.md` - Backend development
952
952
  - `.claude/agents/security/security-specialist.md` - Security analysis
953
953
 
954
954
  ### Documentation