claude-flow-novice 2.14.5 → 2.14.7

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 (61) hide show
  1. package/.claude/commands/cfn/run-tests.md +119 -0
  2. package/.claude/hooks/cfn-post-edit.config.json +11 -4
  3. package/.claude/skills/cfn-agent-selector/SKILL.md +3 -2
  4. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +1 -1
  5. package/.claude/skills/cfn-product-owner-decision/execute-decision.sh +141 -114
  6. package/.claude/skills/cfn-redis-coordination/report-completion.sh +86 -0
  7. package/.claude/skills/cfn-redis-coordination/store-context.sh +34 -0
  8. package/.claude/skills/pre-edit-backup/backup.sh +130 -0
  9. package/.claude/skills/pre-edit-backup/cleanup.sh +155 -0
  10. package/.claude/skills/pre-edit-backup/restore.sh +128 -0
  11. package/.claude/skills/pre-edit-backup/revert-file.sh +168 -0
  12. package/claude-assets/agents/README-AGENT_LIFECYCLE.md +522 -0
  13. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +6 -3
  14. package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +1 -1
  15. package/claude-assets/agents/cfn-dev-team/test-agent.md +141 -0
  16. package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +35 -0
  17. package/claude-assets/commands/cfn/run-tests.md +119 -0
  18. package/claude-assets/hooks/cfn-post-edit.config.json +11 -4
  19. package/claude-assets/skills/agent-name-validation/README.md +28 -0
  20. package/claude-assets/skills/agent-name-validation/SKILL.md +168 -0
  21. package/claude-assets/skills/agent-name-validation/validate-agent-names.sh +47 -0
  22. package/claude-assets/skills/cfn-agent-selector/SKILL.md +3 -2
  23. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +1 -1
  24. package/claude-assets/skills/cfn-product-owner-decision/execute-decision.sh +141 -114
  25. package/claude-assets/skills/cfn-redis-coordination/report-completion.sh +86 -0
  26. package/claude-assets/skills/cfn-redis-coordination/store-context.sh +34 -0
  27. package/claude-assets/skills/cfn-task-classifier/SKILL.md +1 -1
  28. package/claude-assets/skills/cfn-test-runner/SKILL.md +288 -0
  29. package/claude-assets/skills/cfn-test-runner/detect-regressions.sh +55 -0
  30. package/claude-assets/skills/cfn-test-runner/init-benchmark-db.sh +48 -0
  31. package/claude-assets/skills/cfn-test-runner/run-all-tests.sh +222 -0
  32. package/claude-assets/skills/cfn-test-runner/store-benchmarks.sh +55 -0
  33. package/claude-assets/skills/cfn-test-runner/validate-redis-keys.sh +143 -0
  34. package/claude-assets/skills/hook-pipeline/bash-dependency-checker.sh +89 -0
  35. package/claude-assets/skills/hook-pipeline/bash-pipe-safety.sh +69 -0
  36. package/claude-assets/skills/hook-pipeline/enforce-lf.sh +36 -0
  37. package/claude-assets/skills/hook-pipeline/js-promise-safety.sh +110 -0
  38. package/claude-assets/skills/hook-pipeline/python-async-safety.py +124 -0
  39. package/claude-assets/skills/hook-pipeline/python-import-checker.py +114 -0
  40. package/claude-assets/skills/hook-pipeline/python-subprocess-safety.py +77 -0
  41. package/claude-assets/skills/hook-pipeline/rust-command-safety.sh +38 -0
  42. package/claude-assets/skills/hook-pipeline/rust-dependency-checker.sh +50 -0
  43. package/claude-assets/skills/hook-pipeline/rust-future-safety.sh +50 -0
  44. package/dist/cli/agent-executor.js +1 -1
  45. package/dist/cli/agent-executor.js.map +1 -1
  46. package/dist/cli/agent-prompt-builder.js +40 -30
  47. package/dist/cli/agent-prompt-builder.js.map +1 -1
  48. package/package.json +2 -1
  49. package/scripts/init-project.js +14 -1
  50. package/claude-assets/agents/cfn-dev-team/developers/dev-backend-api.md +0 -147
  51. package/claude-assets/agents/cfn-dev-team/developers/frontend/spec-mobile-react-native.md +0 -199
  52. package/claude-assets/agents/cfn-dev-team/documentation/docs-api-openapi.md +0 -98
  53. package/claude-assets/agents/cfn-dev-team/product-owners/product-owner-agent.md +0 -155
  54. package/claude-assets/agents/cfn-dev-team/reviewers/quality/analyze-code-quality.md +0 -141
  55. /package/claude-assets/agents/cfn-dev-team/developers/{backend-dev.md → backend-developer.md} +0 -0
  56. /package/claude-assets/agents/cfn-dev-team/documentation/{api-docs.md → api-documentation.md} +0 -0
  57. /package/claude-assets/agents/cfn-dev-team/documentation/{specification.md → specification-agent.md} +0 -0
  58. /package/claude-assets/agents/cfn-dev-team/reviewers/quality/{code-analyzer.md → code-quality-validator.md} +0 -0
  59. /package/claude-assets/agents/cfn-dev-team/testers/e2e/{playwright-agent.md → playwright-tester.md} +0 -0
  60. /package/claude-assets/agents/cfn-dev-team/testers/unit/{tdd-london-swarm.md → tdd-london-unit-swarm.md} +0 -0
  61. /package/claude-assets/agents/cfn-dev-team/testers/validation/{production-validator.md → validation-production-validator.md} +0 -0
@@ -499,6 +499,41 @@ Before finalizing an agent template, verify:
499
499
  - [ ] Bash variables use `\$VARIABLE` in template examples
500
500
  - [ ] Multi-line strings properly indented
501
501
 
502
+ ## Post-Creation Validation
503
+
504
+ **CRITICAL: After creating or updating any agent file, run agent name validation:**
505
+
506
+ ```bash
507
+ ./.claude/skills/agent-name-validation/validate-agent-names.sh
508
+ ```
509
+
510
+ This ensures:
511
+ - Filename matches frontmatter `name:` field
512
+ - Agent can be discovered by spawning system
513
+ - Naming consistency across codebase
514
+
515
+ **Example:**
516
+ ```bash
517
+ # After creating new agent
518
+ Write: file_path=".claude/agents/cfn-dev-team/developers/api-developer.md"
519
+
520
+ # Validate filename matches frontmatter
521
+ ./.claude/skills/agent-name-validation/validate-agent-names.sh
522
+
523
+ # Check result
524
+ if [ $? -eq 0 ]; then
525
+ echo "✅ Agent name validation passed"
526
+ else
527
+ echo "❌ Agent name mismatch detected - review output"
528
+ fi
529
+ ```
530
+
531
+ **Common Issues:**
532
+ - Filename: `backend-dev.md` but frontmatter: `name: backend-developer` ❌
533
+ - Filename: `backend-developer.md` and frontmatter: `name: backend-developer` ✅
534
+
535
+ See: `.claude/skills/agent-name-validation/SKILL.md` for full documentation
536
+
502
537
  ---
503
538
 
504
539
  ## Success Metrics
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: run-tests
3
+ description: Run CFN test suites with benchmarking and regression detection
4
+ category: testing
5
+ ---
6
+
7
+ # Run CFN Tests
8
+
9
+ Execute CFN test suites (Hello World + CFN E2E) with automatic benchmarking and regression detection.
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Run all tests
15
+ /run-tests
16
+
17
+ # Run specific suite
18
+ /run-tests hello-world
19
+ /run-tests cfn-e2e
20
+
21
+ # With benchmarking
22
+ /run-tests --benchmark
23
+
24
+ # With regression detection
25
+ /run-tests --detect-regressions --threshold 0.10
26
+ ```
27
+
28
+ ## Execution
29
+
30
+ ```bash
31
+ ./.claude/skills/cfn-test-runner/run-all-tests.sh \
32
+ --suite {{arg1:-all}} \
33
+ {{#if benchmark}}--benchmark{{/if}} \
34
+ {{#if detect-regressions}}--detect-regressions --threshold {{threshold:-0.10}}{{/if}}
35
+ ```
36
+
37
+ ## Test Suites
38
+
39
+ ### Hello World (4 tests)
40
+ - Layer 0: Tool Validation (60s)
41
+ - Layer 5: Coordinator Spawning (120s)
42
+ - Layer 6: Review Handoff (180s)
43
+ - Layer 7: Error Retry (150s)
44
+
45
+ ### CFN E2E (9 tests)
46
+ - Coordinator → Orchestrator handoff
47
+ - Loop 3 → Gate Check
48
+ - Gate Pass → Loop 2
49
+ - Loop 2 → Product Owner
50
+ - Product Owner Decision
51
+ - Iteration Cycle
52
+ - Redis Key Structure
53
+ - Error Recovery
54
+ - Cleanup
55
+
56
+ ## Benchmarking
57
+
58
+ Results stored in `.artifacts/test-benchmarks.db`:
59
+ - Test run history (30 days)
60
+ - Success rate trends
61
+ - Duration tracking
62
+ - Git commit correlation
63
+
64
+ ## Regression Detection
65
+
66
+ Automatic alerts for:
67
+ - Test failures (was passing)
68
+ - Performance degradation (>10% slower)
69
+ - Success rate drops (>10% decrease)
70
+
71
+ View regressions:
72
+ ```sql
73
+ sqlite3 .artifacts/test-benchmarks.db "SELECT * FROM regression_alerts WHERE acknowledged = 0"
74
+ ```
75
+
76
+ ## Examples
77
+
78
+ **Standard test run:**
79
+ ```
80
+ /run-tests
81
+ ```
82
+
83
+ **With full benchmarking:**
84
+ ```
85
+ /run-tests --benchmark --detect-regressions
86
+ ```
87
+
88
+ **Specific suite only:**
89
+ ```
90
+ /run-tests cfn-e2e --benchmark
91
+ ```
92
+
93
+ ## Output
94
+
95
+ ```
96
+ ==========================================
97
+ CFN Test Suite Runner
98
+ ==========================================
99
+ Suite: all
100
+ Benchmark: true
101
+ Detect Regressions: true
102
+ Git: main @ abc123
103
+
104
+ Hello World: 4 passed, 0 failed, 0 skipped (494s)
105
+ CFN E2E: 7 passed, 0 failed, 2 skipped (356s)
106
+
107
+ ==========================================
108
+ Test Summary
109
+ ==========================================
110
+ Total: 13 tests
111
+ Passed: 11
112
+ Failed: 0
113
+ Skipped: 2
114
+ Duration: 850s
115
+ Success Rate: 84.6%
116
+
117
+ ✅ Benchmark stored (run_id: 42)
118
+ ✅ No regressions detected
119
+ ```
@@ -3,12 +3,14 @@
3
3
  "version": "2.0.0",
4
4
  "pipeline": "config/hooks/post-edit-pipeline.js",
5
5
  "triggerOn": ["Edit", "Write", "MultiEdit"],
6
- "fileTypes": [".ts", ".tsx", ".js", ".jsx", ".json", ".md"],
6
+ "fileTypes": [".ts", ".tsx", ".js", ".jsx", ".json", ".md", ".sh", ".bash", ".py", ".rs"],
7
7
  "blocking": false,
8
8
  "exitCodes": {
9
9
  "0": "SUCCESS",
10
10
  "1": "ERROR",
11
- "2": "SYNTAX_ERROR"
11
+ "2": "SYNTAX_ERROR",
12
+ "9": "BASH_VALIDATOR_ERROR",
13
+ "10": "BASH_VALIDATOR_WARNING"
12
14
  },
13
15
  "redis": {
14
16
  "enabled": true,
@@ -26,12 +28,17 @@
26
28
  "enabled": true,
27
29
  "noEmit": true,
28
30
  "skipLibCheck": true
31
+ },
32
+ "bash": {
33
+ "enabled": true,
34
+ "validators": ["pipe-safety", "dependency-checker", "line-endings"],
35
+ "timeout": 5000
29
36
  }
30
37
  },
31
38
  "feedback": {
32
39
  "provideSuggestions": true,
33
40
  "autoFixable": ["LINT_ISSUES"],
34
- "nonBlocking": ["TYPE_WARNING", "LINT_ISSUES"],
35
- "blocking": ["SYNTAX_ERROR"]
41
+ "nonBlocking": ["TYPE_WARNING", "LINT_ISSUES", "BASH_VALIDATOR_WARNING"],
42
+ "blocking": ["SYNTAX_ERROR", "BASH_VALIDATOR_ERROR"]
36
43
  }
37
44
  }
@@ -0,0 +1,28 @@
1
+ # Agent Name Validation Skill
2
+
3
+ ## Quick Start
4
+
5
+ ```bash
6
+ ./.claude/skills/agent-name-validation/validate-agent-names.sh
7
+ ```
8
+
9
+ ## What It Does
10
+
11
+ Validates that agent filenames match their frontmatter `name:` field across the entire `.claude/agents/` directory.
12
+
13
+ ## Integration
14
+
15
+ This skill is automatically run by the `agent-builder` agent after:
16
+ - Creating new agents
17
+ - Updating agent frontmatter
18
+ - Renaming agent files
19
+
20
+ ## Files
21
+
22
+ - `SKILL.md` - Complete documentation
23
+ - `validate-agent-names.sh` - Validation script
24
+ - `README.md` - This file
25
+
26
+ ## Usage in Agent Builder
27
+
28
+ See `agent-builder.md` Post-Creation Validation section for integration details.
@@ -0,0 +1,168 @@
1
+ # Agent Name Validation Skill
2
+
3
+ **Version:** 1.0.0
4
+ **Last Updated:** 2025-11-04
5
+ **Owner:** agent-builder
6
+ **Status:** Production
7
+
8
+ ## Overview
9
+
10
+ Validates that agent filenames match their frontmatter `name:` field to ensure consistency and prevent discovery issues.
11
+
12
+ ## Purpose
13
+
14
+ - Ensures agent files can be discovered correctly by the agent spawning system
15
+ - Prevents mismatches between filename and agent identity
16
+ - Maintains naming consistency across the codebase
17
+ - Runs automatically after agent creation/updates
18
+
19
+ ## Usage
20
+
21
+ ### Basic Validation
22
+
23
+ ```bash
24
+ ./.claude/skills/agent-name-validation/validate-agent-names.sh
25
+ ```
26
+
27
+ ### Output Format
28
+
29
+ ```
30
+ Validating agent filenames match frontmatter names...
31
+ ==============================================
32
+ ❌ MISMATCH: /path/to/backend-dev.md
33
+ Filename: backend-dev
34
+ Frontmatter: backend-developer
35
+
36
+ ⚠️ WARNING: No frontmatter name found in /path/to/README.md
37
+ ==============================================
38
+ ✅ All agent files have matching names!
39
+ ```
40
+
41
+ ## Integration with Agent Builder
42
+
43
+ The agent-builder agent automatically runs this validation after:
44
+
45
+ 1. Creating new agent files
46
+ 2. Updating agent frontmatter
47
+ 3. Renaming agent files
48
+
49
+ ### Post-Creation Validation
50
+
51
+ ```bash
52
+ # After creating/updating an agent
53
+ ./.claude/skills/agent-name-validation/validate-agent-names.sh
54
+
55
+ # Check exit code
56
+ if [ $? -ne 0 ]; then
57
+ echo "⚠️ Agent name validation failed - please review mismatches"
58
+ fi
59
+ ```
60
+
61
+ ## Validation Rules
62
+
63
+ ### ✅ Valid Patterns
64
+
65
+ - Filename: `backend-developer.md` → Frontmatter: `name: backend-developer`
66
+ - Filename: `api-tester.md` → Frontmatter: `name: api-tester`
67
+
68
+ ### ❌ Invalid Patterns
69
+
70
+ - Filename: `backend-dev.md` → Frontmatter: `name: backend-developer` (mismatch)
71
+ - Filename: `APITester.md` → Frontmatter: `name: api-tester` (case mismatch)
72
+
73
+ ### Ignored Files
74
+
75
+ - `CLAUDE.md` - Documentation file, not an agent
76
+ - Files without frontmatter (templates, READMEs)
77
+
78
+ ## Exit Codes
79
+
80
+ - `0` - All agent files validated successfully
81
+ - `1` - One or more mismatches found
82
+
83
+ ## Configuration
84
+
85
+ ### Excluded Files
86
+
87
+ Edit the validation script to exclude additional files:
88
+
89
+ ```bash
90
+ # Skip specific files
91
+ if [ "$filename" = "CLAUDE" ] || [ "$filename" = "README" ]; then
92
+ continue
93
+ fi
94
+ ```
95
+
96
+ ## Examples
97
+
98
+ ### Example 1: Successful Validation
99
+
100
+ ```bash
101
+ $ ./.claude/skills/agent-name-validation/validate-agent-names.sh
102
+ Validating agent filenames match frontmatter names...
103
+ ==============================================
104
+ ✅ All agent files have matching names!
105
+ ```
106
+
107
+ ### Example 2: Mismatch Detected
108
+
109
+ ```bash
110
+ $ ./.claude/skills/agent-name-validation/validate-agent-names.sh
111
+ Validating agent filenames match frontmatter names...
112
+ ==============================================
113
+ ❌ MISMATCH: .claude/agents/cfn-dev-team/developers/backend-dev.md
114
+ Filename: backend-dev
115
+ Frontmatter: backend-developer
116
+ ==============================================
117
+ ❌ Found 1 mismatch(es)
118
+ ```
119
+
120
+ ## Troubleshooting
121
+
122
+ ### Issue: False Positives
123
+
124
+ **Symptom:** Valid agent files reported as mismatches
125
+
126
+ **Solution:** Verify frontmatter format:
127
+ ```yaml
128
+ ---
129
+ name: agent-name # Must be on line 2, no extra spaces
130
+ ---
131
+ ```
132
+
133
+ ### Issue: AWK Parsing Errors
134
+
135
+ **Symptom:** No frontmatter names detected
136
+
137
+ **Solution:** Check for:
138
+ - Windows line endings (run `dos2unix` on files)
139
+ - Missing `---` delimiters
140
+ - Malformed YAML
141
+
142
+ ## Related Skills
143
+
144
+ - **Agent Creation** (`.claude/skills/agent-creation/`) - Creates new agents
145
+ - **Template Validation** (`.claude/skills/template-validation/`) - Validates agent structure
146
+ - **Pre-Edit Backup** (`.claude/skills/pre-edit-backup/`) - Backup system for file changes
147
+
148
+ ## Maintenance
149
+
150
+ ### Adding New Validations
151
+
152
+ To add additional validation rules, modify `validate-agent-names.sh`:
153
+
154
+ ```bash
155
+ # Example: Validate agent type matches directory structure
156
+ if [[ "$agent_file" == *"/testers/"* ]]; then
157
+ expected_type="validator"
158
+ actual_type=$(awk 'BEGIN{in_fm=0} /^---$/{in_fm++; next} in_fm==1 && /^type:/{print $2; exit}' "$agent_file")
159
+
160
+ if [ "$actual_type" != "$expected_type" ]; then
161
+ echo "⚠️ Type mismatch in $agent_file"
162
+ fi
163
+ fi
164
+ ```
165
+
166
+ ## Version History
167
+
168
+ - **1.0.0** (2025-11-04) - Initial release with filename validation
@@ -0,0 +1,47 @@
1
+ #!/bin/bash
2
+
3
+ # Script to validate agent filenames match frontmatter names
4
+ # Usage: ./scripts/validate-agent-names.sh
5
+
6
+ AGENTS_DIR="/mnt/c/Users/masha/Documents/claude-flow-novice/.claude/agents"
7
+ MISMATCHES=0
8
+
9
+ echo "Validating agent filenames match frontmatter names..."
10
+ echo "=============================================="
11
+
12
+ # Find all .md files in agents directory recursively
13
+ while IFS= read -r -d '' agent_file; do
14
+ # Get filename without extension
15
+ filename=$(basename "$agent_file" .md)
16
+
17
+ # Skip CLAUDE.md files
18
+ if [ "$filename" = "CLAUDE" ]; then
19
+ continue
20
+ fi
21
+
22
+ # Extract frontmatter name (between --- blocks, look for 'name:' field)
23
+ frontmatter_name=$(awk 'BEGIN{in_fm=0} /^---$/{in_fm++; next} in_fm==1 && /^name:/{print $2; exit}' "$agent_file")
24
+
25
+ # Skip if no frontmatter name found
26
+ if [ -z "$frontmatter_name" ]; then
27
+ echo "⚠️ WARNING: No frontmatter name found in $agent_file"
28
+ continue
29
+ fi
30
+
31
+ # Compare filename with frontmatter name
32
+ if [ "$filename" != "$frontmatter_name" ]; then
33
+ echo "❌ MISMATCH: $agent_file"
34
+ echo " Filename: $filename"
35
+ echo " Frontmatter: $frontmatter_name"
36
+ echo ""
37
+ ((MISMATCHES++))
38
+ fi
39
+ done < <(find "$AGENTS_DIR" -name "*.md" -type f -print0)
40
+
41
+ echo "=============================================="
42
+ if [ $MISMATCHES -eq 0 ]; then
43
+ echo "✅ All agent files have matching names!"
44
+ else
45
+ echo "❌ Found $MISMATCHES mismatch(es)"
46
+ exit 1
47
+ fi
@@ -13,7 +13,7 @@ Recommends Loop 3 (producers) and Loop 2 (evaluators) agents based on:
13
13
  ## Usage
14
14
 
15
15
  ```bash
16
- AGENTS=$(./.claude/skills/agent-selector/select-agents.sh \
16
+ 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
 
@@ -87,4 +87,5 @@ echo "$AGENTS" | jq '.loop2[]' # ["reviewer", "tester", "security-auditor"]
87
87
  ## Integration
88
88
 
89
89
  Used by:
90
- - `.claude/agents/cfn-v3-coordinator.md` - Agent selection
90
+ - `.claude/agents/cfn-v3-coordinator.md` - Agent selection
91
+ - `.claude/skills/cfn-agent-selector/select-agents.sh` - Primary selection script
@@ -635,7 +635,7 @@ function spawn_product_owner() {
635
635
  # BLOCKER #2 FIX: Match execute-decision.sh actual parameters
636
636
  # Required: --task-id, --agent-id, --consensus, --threshold, --iteration, --max-iterations
637
637
  local decision_output
638
- decision_output=$("$SCRIPT_DIR/.claude/skills/cfn-cfn-product-owner-decision/execute-decision.sh" \
638
+ decision_output=$("$SCRIPT_DIR/.claude/skills/cfn-product-owner-decision/execute-decision.sh" \
639
639
  --task-id "$task_id" \
640
640
  --agent-id "$PRODUCT_OWNER" \
641
641
  --consensus "$LOOP2_FINAL_CONSENSUS" \