claude-flow-novice 1.5.5 → 1.5.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.
@@ -114,6 +114,28 @@ Priming Effect:
114
114
 
115
115
  ### Frontmatter (YAML)
116
116
 
117
+ #### Required Frontmatter Fields
118
+
119
+ - **name**: Lowercase with hyphens (e.g., `system-architect`, `api-developer`)
120
+ - **description**: Clear, keyword-rich description (supports multiline with `|`)
121
+ - **tools**: Comma-separated list of tool names (e.g., `Read, Write, Edit, Bash, Grep, Glob`)
122
+ - ⚠️ **IMPORTANT**: Use comma-separated format, NOT YAML array format
123
+ - ✅ **CORRECT**: `tools: Read, Write, Edit, Bash`
124
+ - ❌ **WRONG**: `tools:` followed by `- Read` on new lines
125
+ - **model**: AI model to use (`sonnet`, `opus`, or `haiku`)
126
+ - **color**: Visual identifier for the agent (e.g., `seagreen`, `royalblue`)
127
+
128
+ #### Optional Frontmatter Fields
129
+
130
+ - **type**: Agent classification (`specialist`, `coordinator`, `swarm`)
131
+ - **capabilities**: YAML array of capability tags
132
+ - **lifecycle**: Hooks for agent lifecycle events
133
+ - **hooks**: Integration points with Claude Flow system
134
+ - **triggers**: Automatic activation patterns (YAML array)
135
+ - **constraints**: Limitations and boundaries (YAML array)
136
+
137
+ #### Complete Frontmatter Example
138
+
117
139
  ```yaml
118
140
  ---
119
141
  name: agent-name # REQUIRED: Lowercase with hyphens
@@ -122,12 +144,7 @@ description: | # REQUIRED: Clear, keyword-rich description
122
144
  Use PROACTIVELY for [specific scenarios].
123
145
  ALWAYS delegate when user asks [trigger phrases].
124
146
  Keywords - [comma-separated keywords for search]
125
- tools: # REQUIRED: Array of tool names
126
- - Read
127
- - Write
128
- - Edit
129
- - Bash
130
- - TodoWrite
147
+ tools: Read, Write, Edit, Bash, TodoWrite # REQUIRED: Comma-separated list of tool names
131
148
  model: sonnet # REQUIRED: sonnet | opus | haiku
132
149
  color: seagreen # REQUIRED: Visual identifier
133
150
  type: specialist # OPTIONAL: specialist | coordinator | swarm
@@ -212,7 +229,7 @@ npx claude-flow@alpha hooks post-edit [FILE_PATH] --memory-key "agent/step" --st
212
229
  ---
213
230
  name: system-architect
214
231
  description: Expert in designing scalable systems
215
- tools: [Read, Write, Edit, Bash, TodoWrite]
232
+ tools: Read, Write, Edit, Bash, TodoWrite
216
233
  model: sonnet
217
234
  color: seagreen
218
235
  ---
@@ -281,7 +298,7 @@ You are a senior system architect specializing in [domain]. You excel at [key st
281
298
  ---
282
299
  name: backend-api-dev
283
300
  description: Backend API development specialist
284
- tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
301
+ tools: Read, Write, Edit, Bash, Grep, Glob, TodoWrite
285
302
  model: sonnet
286
303
  color: royalblue
287
304
  ---
@@ -419,7 +436,7 @@ Test Pyramid:
419
436
  ---
420
437
  name: rust-coder-basic
421
438
  description: Rust implementation specialist for basic tasks
422
- tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
439
+ tools: Read, Write, Edit, Bash, Grep, Glob, TodoWrite
423
440
  model: sonnet
424
441
  color: mediumblue
425
442
  ---
@@ -839,7 +856,7 @@ Apply same principles but validate with testing:
839
856
  ---
840
857
  name: code-reviewer
841
858
  description: Expert code reviewer focusing on quality and maintainability
842
- tools: [Read, Grep, Bash]
859
+ tools: Read, Grep, Bash
843
860
  model: sonnet
844
861
  color: orange
845
862
  ---
@@ -902,7 +919,7 @@ You are an experienced code reviewer who identifies issues and suggests improvem
902
919
  ---
903
920
  name: system-architect
904
921
  description: Senior system architect for scalable software design
905
- tools: [Read, Write, Edit, Bash, TodoWrite]
922
+ tools: Read, Write, Edit, Bash, TodoWrite
906
923
  model: sonnet
907
924
  color: seagreen
908
925
  ---
@@ -956,7 +973,7 @@ You are a senior system architect specializing in [domain].
956
973
  ---
957
974
  name: unit-tester
958
975
  description: Comprehensive unit test specialist
959
- tools: [Read, Write, Edit, Bash, Grep, TodoWrite]
976
+ tools: Read, Write, Edit, Bash, Grep, TodoWrite
960
977
  model: sonnet
961
978
  color: mediumvioletred
962
979
  ---
@@ -1052,7 +1069,7 @@ Test Categories:
1052
1069
  ---
1053
1070
  name: tech-researcher
1054
1071
  description: Technology research and analysis specialist
1055
- tools: [Read, WebSearch, Bash, TodoWrite]
1072
+ tools: Read, WebSearch, Bash, TodoWrite
1056
1073
  model: sonnet
1057
1074
  color: steelblue
1058
1075
  ---
@@ -1103,7 +1120,7 @@ You conduct thorough research to inform technical decisions.
1103
1120
  ---
1104
1121
  name: cicd-engineer
1105
1122
  description: CI/CD pipeline specialist
1106
- tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
1123
+ tools: Read, Write, Edit, Bash, Grep, Glob, TodoWrite
1107
1124
  model: sonnet
1108
1125
  color: darkkhaki
1109
1126
  ---
@@ -1566,7 +1583,7 @@ description: |
1566
1583
  Use PROACTIVELY for distributed systems, event-driven architecture,
1567
1584
  microservices decomposition, scalability planning.
1568
1585
  Keywords - architecture, system design, microservices, scalability
1569
- tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
1586
+ tools: Read, Write, Edit, Bash, Grep, Glob, TodoWrite
1570
1587
  model: sonnet
1571
1588
  color: seagreen
1572
1589
  ---
@@ -1636,7 +1653,7 @@ description: |
1636
1653
  Backend API development specialist for RESTful and GraphQL APIs.
1637
1654
  Use for endpoint implementation, data modeling, API documentation.
1638
1655
  Keywords - API, REST, GraphQL, backend, endpoints
1639
- tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
1656
+ tools: Read, Write, Edit, Bash, Grep, Glob, TodoWrite
1640
1657
  model: sonnet
1641
1658
  color: royalblue
1642
1659
  ---
@@ -1786,7 +1803,7 @@ description: |
1786
1803
  Rust implementation specialist for basic string processing,
1787
1804
  error handling, and CRUD operations.
1788
1805
  Keywords - rust, basic tasks, string processing, error handling
1789
- tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
1806
+ tools: Read, Write, Edit, Bash, Grep, Glob, TodoWrite
1790
1807
  model: sonnet
1791
1808
  color: mediumblue
1792
1809
  ---
@@ -0,0 +1,243 @@
1
+ # Agent Profile Validation Tool
2
+
3
+ A comprehensive validation script that checks agent profiles against CLAUDE.md standards and provides actionable feedback.
4
+
5
+ ## Usage
6
+
7
+ ### Validate a single agent
8
+
9
+ ```bash
10
+ node validate-agent.js path/to/agent.md
11
+ ```
12
+
13
+ **Example:**
14
+
15
+ ```bash
16
+ node validate-agent.js coder.md
17
+ node validate-agent.js benchmarking-tests/test-agent-minimal.md
18
+ node validate-agent.js architecture/system-architect.md
19
+ ```
20
+
21
+ ### Validate all agents
22
+
23
+ ```bash
24
+ node validate-agent.js --all
25
+ ```
26
+
27
+ This will:
28
+ - Recursively find all `.md` files in the agents directory
29
+ - Validate each agent profile
30
+ - Generate summary statistics
31
+ - Show top performers and agents needing improvement
32
+
33
+ ## What it Validates
34
+
35
+ ### 1. Frontmatter Structure
36
+
37
+ - Required fields: `name`, `description`, `tools`, `model`, `color`
38
+ - Tools from approved list: `Read, Write, Edit, MultiEdit, Bash, Glob, Grep, TodoWrite`
39
+ - Valid model names: `sonnet, haiku, opus, sonnet-3-5, sonnet-4-5`
40
+ - Color format: Named colors, hex (`#FF9800`), or RGB (`rgb(255, 152, 0)`)
41
+
42
+ ### 2. Format Classification
43
+
44
+ Automatically detects agent format based on content analysis:
45
+
46
+ - **MINIMAL** (200-400 lines): Complex tasks requiring reasoning
47
+ - **METADATA** (400-700 lines): Medium complexity with structured workflows
48
+ - **CODE-HEAVY** (700-1200 lines): Basic tasks benefiting from examples
49
+
50
+ ### 3. Complexity Analysis
51
+
52
+ Analyzes task complexity based on keywords:
53
+
54
+ - **Basic**: String processing, parsing, CRUD operations
55
+ - **Medium**: Multi-component integration, refactoring, pipelines
56
+ - **Complex**: Architecture, distributed systems, design trade-offs
57
+
58
+ ### 4. Format Alignment
59
+
60
+ Checks if the current format aligns with best practices for the detected complexity:
61
+
62
+ - Basic tasks → CODE-HEAVY format (+43% quality boost validated)
63
+ - Medium tasks → METADATA format (balanced approach)
64
+ - Complex tasks → MINIMAL format (avoid over-constraining)
65
+
66
+ ### 5. Quality Checks
67
+
68
+ - Clear role definition in opening paragraph
69
+ - Specific responsibilities section
70
+ - Appropriate use of negative instructions
71
+ - Anti-pattern detection
72
+
73
+ ## Output Example
74
+
75
+ ```
76
+ ════════════════════════════════════════════════════════════════════════════════
77
+ AGENT VALIDATION REPORT: coder.md
78
+ ════════════════════════════════════════════════════════════════════════════════
79
+
80
+ SUMMARY
81
+ ────────────────────────────────────────────────────────────────────────────────
82
+ Agent Profile Status: Excellent (100/100)
83
+ ✅ Format aligned with best practices (metadata)
84
+
85
+ FORMAT ANALYSIS
86
+ ────────────────────────────────────────────────────────────────────────────────
87
+ Detected Format: METADATA
88
+ Confidence: 60%
89
+ Estimated Tokens: ~1000
90
+ Word Count: 1215
91
+
92
+ Characteristics:
93
+ • codeBlocks: 1
94
+ • verbosity: medium
95
+
96
+ COMPLEXITY ANALYSIS
97
+ ────────────────────────────────────────────────────────────────────────────────
98
+ Estimated Complexity: MEDIUM
99
+ Confidence: HIGH
100
+ Indicator Scores:
101
+ • basic: 2.0
102
+ • medium: 3.5
103
+ • complex: 3.0
104
+
105
+ FORMAT RECOMMENDATION
106
+ ────────────────────────────────────────────────────────────────────────────────
107
+ Current Format: METADATA
108
+ Recommended Format: METADATA
109
+ Alignment: ✅ ALIGNED
110
+ Confidence: MEDIUM
111
+ Reason: Medium complexity benefits from structure without over-constraining
112
+ Evidence: Hypothesized from validated coder agent patterns
113
+
114
+ ════════════════════════════════════════════════════════════════════════════════
115
+ Compliance Score: 100/100
116
+ ════════════════════════════════════════════════════════════════════════════════
117
+ ```
118
+
119
+ ## Compliance Scoring
120
+
121
+ The script calculates a compliance score (0-100) based on:
122
+
123
+ - **Critical Issues** (-20 points each): Missing required fields, invalid values
124
+ - **Warnings** (-5 points each): Recommended improvements
125
+ - **Recommendations** (-2 points each): Quality enhancement suggestions
126
+
127
+ ### Score Interpretation
128
+
129
+ - **90-100**: Excellent - Production ready
130
+ - **75-89**: Good - Minor improvements recommended
131
+ - **60-74**: Fair - Several issues to address
132
+ - **<60**: Needs Improvement - Significant work required
133
+
134
+ ## Exit Codes
135
+
136
+ - **0**: Agent is valid (no critical issues)
137
+ - **1**: Agent has critical issues or validation errors
138
+
139
+ ## Integration with CI/CD
140
+
141
+ You can use this script in your CI/CD pipeline:
142
+
143
+ ```yaml
144
+ # .github/workflows/validate-agents.yml
145
+ name: Validate Agents
146
+
147
+ on: [push, pull_request]
148
+
149
+ jobs:
150
+ validate:
151
+ runs-on: ubuntu-latest
152
+ steps:
153
+ - uses: actions/checkout@v2
154
+ - uses: actions/setup-node@v2
155
+ with:
156
+ node-version: '18'
157
+ - run: cd .claude/agents && node validate-agent.js --all
158
+ ```
159
+
160
+ ## Programmatic Usage
161
+
162
+ You can also import and use the validation functions:
163
+
164
+ ```javascript
165
+ import { validateAgent, classifyFormat, estimateComplexity, recommendFormat } from './validate-agent.js';
166
+
167
+ // Validate a single agent
168
+ const result = await validateAgent('/path/to/agent.md');
169
+ console.log(`Valid: ${result.valid}`);
170
+ console.log(`Score: ${result.complianceScore}/100`);
171
+ console.log(`Format: ${result.format.classification.format}`);
172
+
173
+ // Classify format
174
+ const format = classifyFormat(content, frontmatter);
175
+ console.log(`Detected format: ${format.format}`);
176
+
177
+ // Estimate complexity
178
+ const complexity = estimateComplexity(frontmatter, content);
179
+ console.log(`Complexity: ${complexity.complexity}`);
180
+
181
+ // Get format recommendation
182
+ const recommendation = recommendFormat('coder', 'basic');
183
+ console.log(`Recommended: ${recommendation.recommended}`);
184
+ ```
185
+
186
+ ## Best Practices
187
+
188
+ 1. **Run validation before committing** new or updated agent profiles
189
+ 2. **Aim for 90+ score** for production agents
190
+ 3. **Address critical issues immediately** - they block deployment
191
+ 4. **Consider recommendations** - they improve agent effectiveness
192
+ 5. **Re-validate periodically** as CLAUDE.md standards evolve
193
+
194
+ ## Troubleshooting
195
+
196
+ ### "No frontmatter found"
197
+
198
+ Ensure your agent file starts with:
199
+
200
+ ```markdown
201
+ ---
202
+ name: agent-name
203
+ description: Agent description
204
+ tools: Read, Write, Edit
205
+ model: sonnet
206
+ color: blue
207
+ ---
208
+
209
+ # Agent Name
210
+ ...
211
+ ```
212
+
213
+ ### "Invalid YAML syntax"
214
+
215
+ Check for:
216
+ - Proper indentation (use spaces, not tabs)
217
+ - Quoted strings containing special characters
218
+ - Balanced brackets and quotes
219
+ - No duplicate keys
220
+
221
+ ### "Format mismatch"
222
+
223
+ The validator detected your agent format doesn't match the recommended format for the task complexity. Consider:
224
+
225
+ - Is the agent truly for basic/medium/complex tasks?
226
+ - Does the format align with empirical findings?
227
+ - Should you add/remove examples or structure?
228
+
229
+ ## Future Enhancements
230
+
231
+ - Integration with Claude Flow hooks
232
+ - Automated fix suggestions
233
+ - Performance benchmarking integration
234
+ - Format conversion tools
235
+ - Custom rule definitions
236
+
237
+ ## Support
238
+
239
+ For issues or suggestions, please file an issue in the project repository.
240
+
241
+ ## License
242
+
243
+ This validation tool is part of the Claude Flow project.
@@ -357,6 +357,12 @@ function validateFrontmatter(frontmatter) {
357
357
  }
358
358
 
359
359
  // Tools validation
360
+ // NOTE: Tools can be specified as comma-separated string OR YAML array
361
+ // Examples:
362
+ // tools: Read, Write, Edit # Comma-separated string
363
+ // tools: # YAML array
364
+ // - Read
365
+ // - Write
360
366
  if (!frontmatter.tools) {
361
367
  warnings.push({
362
368
  severity: 'warning',
@@ -365,9 +371,24 @@ function validateFrontmatter(frontmatter) {
365
371
  fix: 'Add "tools: Read, Write, Edit, ..." to frontmatter'
366
372
  });
367
373
  } else {
368
- const tools = typeof frontmatter.tools === 'string'
369
- ? frontmatter.tools.split(',').map(t => t.trim())
370
- : frontmatter.tools;
374
+ // Parse tools: handle both comma-separated strings and YAML arrays
375
+ let tools;
376
+ if (typeof frontmatter.tools === 'string') {
377
+ // Comma-separated format: "Read, Write, Edit"
378
+ tools = frontmatter.tools.split(',').map(t => t.trim());
379
+ } else if (Array.isArray(frontmatter.tools)) {
380
+ // YAML array format: ["Read", "Write", "Edit"]
381
+ tools = frontmatter.tools;
382
+ } else {
383
+ // Invalid format
384
+ issues.push({
385
+ severity: 'error',
386
+ field: 'tools',
387
+ message: 'Tools must be comma-separated string or YAML array',
388
+ fix: 'Use "tools: Read, Write, Edit" or YAML array format'
389
+ });
390
+ tools = [];
391
+ }
371
392
 
372
393
  const invalidTools = tools.filter(tool => !APPROVED_TOOLS.includes(tool));
373
394
  if (invalidTools.length > 0) {
@@ -44,8 +44,6 @@ import { createLocalExecutable } from './executable-wrapper.js';
44
44
  import { createSparcStructureManually } from './sparc-structure.js';
45
45
  import { createClaudeSlashCommands } from './claude-commands/slash-commands.js';
46
46
  import { createOptimizedClaudeSlashCommands } from './claude-commands/optimized-slash-commands.js';
47
- // execSync imported above as execSyncOriginal\nconst execSync = execSyncOriginal;
48
- import { promises as fs } from 'fs';
49
47
  import { copyTemplates } from './template-copier.js';
50
48
  import { copyRevisedTemplates, validateTemplatesExist } from './copy-revised-templates.js';
51
49
  import {