claude-flow-novice 2.14.10 → 2.14.12

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 (31) hide show
  1. package/.claude/commands/CFN_LOOP_TASK_MODE copy.md +495 -0
  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-loop-orchestration/orchestrate.sh +5 -72
  5. package/.claude/skills/cfn-redis-coordination/get-context.sh +113 -0
  6. package/.claude/skills/cfn-redis-coordination/store-context.sh +74 -19
  7. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +3 -3
  8. package/claude-assets/agents/cfn-dev-team/README.md +1 -1
  9. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +2 -2
  10. package/claude-assets/agents/cfn-dev-team/developers/README.md +3 -3
  11. package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md +1 -1
  12. package/claude-assets/agents/cfn-dev-team/test-agent.md +2 -2
  13. package/claude-assets/commands/CFN_LOOP_TASK_MODE copy.md +495 -0
  14. package/claude-assets/commands/cfn-loop-cli.md +1 -1
  15. package/claude-assets/skills/cfn-agent-selector/SKILL.md +2 -2
  16. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +5 -72
  17. package/claude-assets/skills/cfn-redis-coordination/get-context.sh +113 -0
  18. package/claude-assets/skills/cfn-redis-coordination/store-context.sh +74 -19
  19. package/dist/agents/agent-loader.js +146 -165
  20. package/dist/cli/config-manager.js +91 -109
  21. package/dist/cli/config-manager.js.map +1 -1
  22. package/package.json +1 -1
  23. package/scripts/init-project.js +21 -3
  24. package/.claude/skills/cfn-agent-selector/SKILL.md.backup_before_replace +0 -91
  25. package/claude-assets/agents/cfn-dev-team/CLAUDE.md.backup_before_replace +0 -1086
  26. package/claude-assets/agents/cfn-dev-team/README.md.backup_before_replace +0 -116
  27. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md.backup_before_replace +0 -451
  28. package/claude-assets/agents/cfn-dev-team/developers/README.md.backup_before_replace +0 -69
  29. package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md.backup_before_replace +0 -465
  30. package/claude-assets/agents/cfn-dev-team/test-agent.md.backup_before_replace +0 -141
  31. package/claude-assets/skills/cfn-agent-selector/SKILL.md.backup_before_replace +0 -91
@@ -0,0 +1,113 @@
1
+ #!/bin/bash
2
+ # Retrieve CFN Loop task context from Redis
3
+ # Used by CLI-spawned agents to get structured context from orchestrator
4
+ #
5
+ # Usage:
6
+ # get-context.sh --task-id <id> [--namespace <ns>]
7
+ # get-context.sh --task-id <id> --key <key> [--namespace <ns>]
8
+ # get-context.sh <task_id> (legacy mode)
9
+
10
+ set -euo pipefail
11
+
12
+ # Initialize variables
13
+ TASK_ID=""
14
+ KEY=""
15
+ NAMESPACE="swarm"
16
+ FORMAT="json" # json or raw
17
+
18
+ # Parse arguments
19
+ while [[ $# -gt 0 ]]; do
20
+ case $1 in
21
+ --task-id)
22
+ TASK_ID="$2"
23
+ shift 2
24
+ ;;
25
+ --key)
26
+ KEY="$2"
27
+ shift 2
28
+ ;;
29
+ --namespace)
30
+ NAMESPACE="$2"
31
+ shift 2
32
+ ;;
33
+ --format)
34
+ FORMAT="$2"
35
+ shift 2
36
+ ;;
37
+ *)
38
+ # Legacy mode: positional argument
39
+ if [ -z "$TASK_ID" ]; then
40
+ TASK_ID="$1"
41
+ fi
42
+ shift
43
+ ;;
44
+ esac
45
+ done
46
+
47
+ # Validate required arguments
48
+ if [ -z "$TASK_ID" ]; then
49
+ echo "Error: --task-id or TASK_ID required" >&2
50
+ echo "Usage: $0 --task-id <id> [--key <key>] [--namespace <ns>] [--format <json|raw>]" >&2
51
+ echo " or: $0 <task_id> (legacy)" >&2
52
+ exit 1
53
+ fi
54
+
55
+ REDIS_KEY="${NAMESPACE}:${TASK_ID}:context"
56
+
57
+ # Check if context exists
58
+ if ! redis-cli EXISTS "$REDIS_KEY" >/dev/null 2>&1; then
59
+ echo "⚠️ No context found for task: $TASK_ID" >&2
60
+ exit 1
61
+ fi
62
+
63
+ # Handle specific key retrieval
64
+ if [ -n "$KEY" ]; then
65
+ VALUE=$(redis-cli HGET "$REDIS_KEY" "$KEY" 2>/dev/null || echo "")
66
+ if [ -z "$VALUE" ]; then
67
+ echo "⚠️ Key '$KEY' not found in context for task: $TASK_ID" >&2
68
+ exit 1
69
+ fi
70
+
71
+ if [ "$FORMAT" = "raw" ]; then
72
+ echo "$VALUE"
73
+ else
74
+ echo "{\"$KEY\":$VALUE}"
75
+ fi
76
+ exit 0
77
+ fi
78
+
79
+ # Handle full context retrieval
80
+ ALL_FIELDS=$(redis-cli HGETALL "$REDIS_KEY" 2>/dev/null || echo "")
81
+
82
+ if [ -z "$ALL_FIELDS" ]; then
83
+ echo "⚠️ Empty context for task: $TASK_ID" >&2
84
+ exit 1
85
+ fi
86
+
87
+ # Format as JSON
88
+ if [ "$FORMAT" = "json" ]; then
89
+ echo "{"
90
+ first=true
91
+ while IFS= read -r field; do
92
+ if [ -z "$field" ]; then continue; fi
93
+ if [ "$first" = true ]; then
94
+ first=false
95
+ else
96
+ echo ","
97
+ fi
98
+ # Skip empty lines and properly format JSON values
99
+ if [[ $field =~ ^[0-9]+$ ]]; then
100
+ # Numeric value
101
+ echo -n " \"$field\": $(redis-cli HGET "$REDIS_KEY" "$field")"
102
+ else
103
+ # String value
104
+ value=$(redis-cli HGET "$REDIS_KEY" "$field" | sed 's/"/\\"/g')
105
+ echo -n " \"$field\": \"$value\""
106
+ fi
107
+ done <<< "$ALL_FIELDS"
108
+ echo ""
109
+ echo "}"
110
+ else
111
+ # Raw format
112
+ redis-cli HGETALL "$REDIS_KEY"
113
+ fi
@@ -1,34 +1,89 @@
1
1
  #!/bin/bash
2
2
  # Store CFN Loop task context in Redis
3
- # Used by orchestrator to pass context to CLI-spawned agents
3
+ # Used by orchestrator to pass structured context to CLI-spawned agents
4
4
  #
5
- # Usage: store-context.sh <task_id> <context_json>
5
+ # Usage:
6
+ # store-context.sh --task-id <id> --key <key> --value <value> [--namespace <ns>]
7
+ # store-context.sh <task_id> <context_json> (legacy mode)
6
8
 
7
9
  set -euo pipefail
8
10
 
9
- TASK_ID="${1:-}"
10
- CONTEXT="${2:-}"
11
+ # Initialize variables
12
+ TASK_ID=""
13
+ KEY=""
14
+ VALUE=""
15
+ NAMESPACE="swarm"
16
+ CONTEXT=""
11
17
 
18
+ # Parse arguments
19
+ while [[ $# -gt 0 ]]; do
20
+ case $1 in
21
+ --task-id)
22
+ TASK_ID="$2"
23
+ shift 2
24
+ ;;
25
+ --key)
26
+ KEY="$2"
27
+ shift 2
28
+ ;;
29
+ --value)
30
+ VALUE="$2"
31
+ shift 2
32
+ ;;
33
+ --namespace)
34
+ NAMESPACE="$2"
35
+ shift 2
36
+ ;;
37
+ *)
38
+ # Legacy mode: positional arguments
39
+ if [ -z "$TASK_ID" ]; then
40
+ TASK_ID="$1"
41
+ elif [ -z "$CONTEXT" ]; then
42
+ CONTEXT="$1"
43
+ fi
44
+ shift
45
+ ;;
46
+ esac
47
+ done
48
+
49
+ # Validate required arguments
12
50
  if [ -z "$TASK_ID" ]; then
13
- echo "Error: TASK_ID required" >&2
14
- echo "Usage: $0 <task_id> <context_json>" >&2
51
+ echo "Error: --task-id or TASK_ID required" >&2
52
+ echo "Usage: $0 --task-id <id> --key <key> --value <value> [--namespace <ns>]" >&2
53
+ echo " or: $0 <task_id> <context_json> (legacy)" >&2
15
54
  exit 1
16
55
  fi
17
56
 
18
- if [ -z "$CONTEXT" ]; then
19
- echo "Error: CONTEXT required" >&2
20
- echo "Usage: $0 <task_id> <context_json>" >&2
21
- exit 1
57
+ # Handle structured mode (new)
58
+ if [ -n "$KEY" ] && [ -n "$VALUE" ]; then
59
+ # Store structured context with specific key
60
+ REDIS_KEY="${NAMESPACE}:${TASK_ID}:context"
61
+
62
+ redis-cli HSET "$REDIS_KEY" \
63
+ "$KEY" "$VALUE" \
64
+ "updated_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
65
+ > /dev/null
66
+
67
+ # Set TTL (24 hours)
68
+ redis-cli EXPIRE "$REDIS_KEY" 86400 > /dev/null
69
+
70
+ echo "✅ Context stored: $KEY for task: $TASK_ID"
71
+ exit 0
22
72
  fi
23
73
 
24
- # Store context in Redis
25
- redis-cli HSET "cfn_loop:task:${TASK_ID}:context" \
26
- "task_description" "$CONTEXT" \
27
- "stored_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
28
- > /dev/null
74
+ # Handle legacy mode
75
+ if [ -n "$CONTEXT" ]; then
76
+ redis-cli HSET "swarm:${TASK_ID}:context" \
77
+ "task_description" "$CONTEXT" \
78
+ "stored_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
79
+ > /dev/null
80
+
81
+ # Set TTL (24 hours)
82
+ redis-cli EXPIRE "swarm:${TASK_ID}:context" 86400 > /dev/null
29
83
 
30
- # Set TTL (24 hours)
31
- redis-cli EXPIRE "cfn_loop:task:${TASK_ID}:context" 86400 > /dev/null
84
+ echo "✅ Context stored for task: $TASK_ID"
85
+ exit 0
86
+ fi
32
87
 
33
- echo " Context stored for task: $TASK_ID"
34
- exit 0
88
+ echo "Error: Either --key/--value or <context_json> required" >&2
89
+ exit 1
@@ -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-developer.md
115
+ │ ├── backend-dev.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-developer --task-id "${TASK_ID}"
616
+ npx claude-flow-novice agent-spawn backend-dev --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-developer.md` - Backend development
951
+ - `.claude/agents/development/backend-dev.md` - Backend development
952
952
  - `.claude/agents/security/security-specialist.md` - Security analysis
953
953
 
954
954
  ### Documentation
@@ -15,7 +15,7 @@ The CFN (Claude Flow Novice) development team comprises 23 production agents org
15
15
  - **Purpose**: Core implementation and creative problem-solving
16
16
  - **Key Agents**:
17
17
  - `coder`: Production code implementation
18
- - `backend-developer`: Backend system design and implementation
18
+ - `backend-dev`: Backend system design and implementation
19
19
  - `researcher`: Technical research and solution exploration
20
20
  - `architect`: System design and architectural planning
21
21
  - `agent-builder`: Agent template and workflow design
@@ -149,7 +149,7 @@ LOOP2_AGENTS=("${VERIFIED_LOOP2_AGENTS[@]:-default_loop2_agent}")
149
149
  **Agent Selection Rules (Enhanced):**
150
150
 
151
151
  **Software Development:**
152
- - Base Loop 3: `backend-developer`, `coder`, `devops-engineer`
152
+ - Base Loop 3: `backend-dev`, `coder`, `devops-engineer`
153
153
  - If security keywords → add `security-specialist`
154
154
  - If database keywords → add `database-engineer`
155
155
  - Base Loop 2: `reviewer`, `tester`, `security-auditor`
@@ -388,7 +388,7 @@ Mode: task
388
388
  ```json
389
389
  {
390
390
  "task_type": "software-development",
391
- "loop3_agents": ["backend-developer", "security-specialist"],
391
+ "loop3_agents": ["backend-dev", "security-specialist"],
392
392
  "loop2_agents": ["reviewer", "tester", "security-auditor"],
393
393
  "loop4_agent": "product-owner",
394
394
  "validation_criteria": {
@@ -5,7 +5,7 @@ Implementation agents focused on building features and components.
5
5
  ## Active Agents (7)
6
6
 
7
7
  **Backend Development:**
8
- - `backend-developer.md` - Backend services, APIs, server-side logic
8
+ - `backend-dev.md` - Backend services, APIs, server-side logic
9
9
  - `dev-backend-api.md` - Specialized REST/GraphQL API development
10
10
 
11
11
  **Frontend Development:**
@@ -42,12 +42,12 @@ All developers follow:
42
42
  Automatically spawned by orchestrator in Loop 3:
43
43
  ```bash
44
44
  ./.claude/skills/cfn-loop-orchestration/orchestrate.sh \
45
- --loop3-agents "backend-developer,react-frontend-engineer"
45
+ --loop3-agents "backend-dev,react-frontend-engineer"
46
46
  ```
47
47
 
48
48
  **Standalone Implementation:**
49
49
  ```bash
50
- npx claude-flow-novice agent-spawn backend-developer --task-id "$TASK_ID"
50
+ npx claude-flow-novice agent-spawn backend-dev --task-id "$TASK_ID"
51
51
  ```
52
52
 
53
53
  ## Deliverables
@@ -453,7 +453,7 @@ Deployment Process:
453
453
  ## Agent Selection Guide
454
454
 
455
455
  **Core Development**: coder, tester, reviewer
456
- **Backend**: backend-developer, api-docs, system-architect
456
+ **Backend**: backend-dev, api-docs, system-architect
457
457
  **Frontend**: coder (specialized), mobile-dev
458
458
  **Quality**: tester, reviewer, security-specialist, perf-analyzer
459
459
  **Planning**: researcher, planner, architect
@@ -19,7 +19,7 @@ The `epic-creator.md` coordinator agent kept getting deleted from `.claude/agent
19
19
  ### Why It Happened
20
20
 
21
21
  1. `package.json` has `"postinstall": "node scripts/init-project.js"`
22
- 2. Running `npx claude-flow-novice agent backend-developer` triggers postinstall
22
+ 2. Running `npx claude-flow-novice agent backend-dev` triggers postinstall
23
23
  3. `init-project.js` ran `cfn-init` unconditionally
24
24
  4. cfn-init copied package version of cfn-dev-team/, overwriting local files
25
25
  5. epic-creator.md (and other local customizations) got deleted
@@ -28,7 +28,7 @@ The `epic-creator.md` coordinator agent kept getting deleted from `.claude/agent
28
28
 
29
29
  ```bash
30
30
  # Each of these triggered cfn-init:
31
- npx claude-flow-novice agent backend-developer
31
+ npx claude-flow-novice agent backend-dev
32
32
  npx claude-flow-novice agent reviewer
33
33
  npx claude-flow-novice agent epic-creator
34
34