claude-flow-novice 1.5.4 → 1.5.6

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.
@@ -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.