@lenne.tech/cli 1.0.1 → 1.0.2
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.
- package/build/commands/claude/install-commands.js +10 -5
- package/build/commands/claude/install-mcps.js +256 -0
- package/build/commands/claude/install-skills.js +90 -23
- package/build/lib/mcp-registry.js +71 -0
- package/build/templates/claude-commands/commit-message.md +21 -0
- package/build/templates/claude-commands/skill-optimize.md +431 -90
- package/build/templates/claude-skills/building-stories-with-tdd/SKILL.md +265 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/code-quality.md +10 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/database-indexes.md +9 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/examples.md +115 -64
- package/build/templates/claude-skills/building-stories-with-tdd/handling-existing-tests.md +197 -0
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/reference.md +276 -29
- package/build/templates/claude-skills/{story-tdd → building-stories-with-tdd}/security-review.md +8 -0
- package/build/templates/claude-skills/building-stories-with-tdd/workflow.md +1004 -0
- package/build/templates/claude-skills/generating-nest-servers/SKILL.md +303 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/configuration.md +6 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/declare-keyword-warning.md +9 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/description-management.md +9 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/examples.md +7 -0
- package/build/templates/claude-skills/generating-nest-servers/framework-guide.md +259 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/quality-review.md +9 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/reference.md +16 -0
- package/build/templates/claude-skills/{nest-server-generator → generating-nest-servers}/security-rules.md +13 -0
- package/build/templates/claude-skills/generating-nest-servers/verification-checklist.md +262 -0
- package/build/templates/claude-skills/generating-nest-servers/workflow-process.md +1061 -0
- package/build/templates/claude-skills/{lt-cli → using-lt-cli}/SKILL.md +22 -10
- package/build/templates/claude-skills/{lt-cli → using-lt-cli}/examples.md +7 -3
- package/build/templates/claude-skills/{lt-cli → using-lt-cli}/reference.md +10 -3
- package/package.json +2 -2
- package/build/templates/claude-skills/nest-server-generator/SKILL.md +0 -1891
- package/build/templates/claude-skills/story-tdd/SKILL.md +0 -1173
|
@@ -1,140 +1,481 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Optimize Claude skill files
|
|
2
|
+
description: Optimize and validate Claude skill files against best practices
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Analyze and optimize
|
|
5
|
+
Analyze and optimize skill files for better Claude Code performance and compliance with official best practices.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 🎯 Step 1: Fetch Latest Best Practices
|
|
8
|
+
|
|
9
|
+
**🚨 MANDATORY: Execute this step FIRST at every invocation!**
|
|
10
|
+
|
|
11
|
+
Use WebFetch to download current official requirements:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Extract and analyze:
|
|
18
|
+
- Current file size recommendations (lines/tokens)
|
|
19
|
+
- Frontmatter requirements (name, description formats)
|
|
20
|
+
- Naming conventions (gerund vs noun vs action forms)
|
|
21
|
+
- Progressive disclosure patterns
|
|
22
|
+
- Content quality requirements
|
|
23
|
+
- Anti-patterns to avoid
|
|
24
|
+
- Any new requirements since last check
|
|
25
|
+
|
|
26
|
+
## ✅ Step 2: Validate All Skills
|
|
27
|
+
|
|
28
|
+
Run automated validation checks on all skills in `src/templates/claude-skills/`:
|
|
29
|
+
|
|
30
|
+
### A. Frontmatter Validation
|
|
31
|
+
|
|
32
|
+
Check required YAML frontmatter fields:
|
|
8
33
|
|
|
9
|
-
Analyze all skill files:
|
|
10
34
|
```bash
|
|
11
|
-
|
|
12
|
-
|
|
35
|
+
echo "=== Frontmatter Validation ==="
|
|
36
|
+
for skill in src/templates/claude-skills/*/SKILL.md; do
|
|
37
|
+
name=$(basename $(dirname "$skill"))
|
|
38
|
+
echo "--- $name ---"
|
|
39
|
+
|
|
40
|
+
# Check name field
|
|
41
|
+
skill_name=$(grep "^name:" "$skill" | cut -d: -f2 | tr -d ' ')
|
|
42
|
+
if [ -n "$skill_name" ]; then
|
|
43
|
+
# Validate format: lowercase, numbers, hyphens only, max 64 chars
|
|
44
|
+
if echo "$skill_name" | grep -qE '^[a-z0-9-]+$'; then
|
|
45
|
+
len=${#skill_name}
|
|
46
|
+
if [ "$len" -le 64 ]; then
|
|
47
|
+
echo "✅ name: $skill_name ($len chars)"
|
|
48
|
+
else
|
|
49
|
+
echo "❌ name: $skill_name (TOO LONG: $len chars, max 64)"
|
|
50
|
+
fi
|
|
51
|
+
else
|
|
52
|
+
echo "❌ name: $skill_name (INVALID: use lowercase, numbers, hyphens only)"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# Check for reserved words
|
|
56
|
+
if echo "$skill_name" | grep -qE '(anthropic|claude)'; then
|
|
57
|
+
echo "⚠️ WARNING: name contains reserved word"
|
|
58
|
+
fi
|
|
59
|
+
else
|
|
60
|
+
echo "❌ name: MISSING"
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Check description field
|
|
64
|
+
desc=$(grep "^description:" "$skill" | cut -d: -f2-)
|
|
65
|
+
if [ -n "$desc" ]; then
|
|
66
|
+
desc_len=${#desc}
|
|
67
|
+
if [ "$desc_len" -le 1024 ]; then
|
|
68
|
+
echo "✅ description: $desc_len chars"
|
|
69
|
+
|
|
70
|
+
# Check for first/second person (should be third person)
|
|
71
|
+
if echo "$desc" | grep -qiE '\b(I|you|your|my)\b'; then
|
|
72
|
+
echo "⚠️ WARNING: description uses first/second person (should be third person)"
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
# Check for vagueness
|
|
76
|
+
if echo "$desc" | grep -qiE '\b(helps|processes|manages|handles)\s+(with|data|files)?\s*$'; then
|
|
77
|
+
echo "⚠️ WARNING: description may be too vague (add specifics and trigger terms)"
|
|
78
|
+
fi
|
|
79
|
+
else
|
|
80
|
+
echo "❌ description: TOO LONG ($desc_len chars, max 1024)"
|
|
81
|
+
fi
|
|
82
|
+
else
|
|
83
|
+
echo "❌ description: MISSING"
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
echo ""
|
|
87
|
+
done
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Validation criteria:**
|
|
91
|
+
- [ ] `name` exists, lowercase/numbers/hyphens only, max 64 chars
|
|
92
|
+
- [ ] `name` doesn't contain reserved words ("anthropic", "claude")
|
|
93
|
+
- [ ] `description` exists, max 1024 chars
|
|
94
|
+
- [ ] `description` in third person (not "I" or "you")
|
|
95
|
+
- [ ] `description` includes specific actions and trigger terms
|
|
96
|
+
- [ ] No XML tags in either field
|
|
97
|
+
|
|
98
|
+
### B. File Size Validation
|
|
13
99
|
|
|
14
|
-
|
|
100
|
+
**Official guideline: SKILL.md body < 500 lines**
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
echo "=== File Size Validation ==="
|
|
15
104
|
for skill in src/templates/claude-skills/*/SKILL.md; do
|
|
16
|
-
lines=$(wc -l < "$skill")
|
|
17
105
|
name=$(basename $(dirname "$skill"))
|
|
18
|
-
|
|
106
|
+
|
|
107
|
+
# Count body lines (excluding frontmatter)
|
|
108
|
+
frontmatter_end=$(grep -n "^---$" "$skill" | tail -1 | cut -d: -f1)
|
|
109
|
+
body_lines=$(tail -n +$((frontmatter_end + 1)) "$skill" | wc -l)
|
|
110
|
+
|
|
111
|
+
printf "%-30s %5d lines " "$name:" "$body_lines"
|
|
112
|
+
|
|
113
|
+
if [ "$body_lines" -lt 500 ]; then
|
|
114
|
+
echo "✅ OPTIMAL"
|
|
115
|
+
elif [ "$body_lines" -lt 800 ]; then
|
|
116
|
+
echo "⚠️ ACCEPTABLE (consider optimization)"
|
|
117
|
+
else
|
|
118
|
+
echo "❌ TOO LARGE (needs optimization)"
|
|
119
|
+
fi
|
|
120
|
+
done
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Size targets:**
|
|
124
|
+
- ✅ **Optimal:** < 500 lines (Claude official recommendation)
|
|
125
|
+
- ⚠️ **Acceptable:** 500-800 lines (borderline)
|
|
126
|
+
- ❌ **Too Large:** > 800 lines (MUST optimize)
|
|
127
|
+
|
|
128
|
+
### C. Progressive Disclosure Check
|
|
129
|
+
|
|
130
|
+
**Official requirement: One-level-deep references only**
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
echo "=== Progressive Disclosure Check ==="
|
|
134
|
+
for skill_dir in src/templates/claude-skills/*/; do
|
|
135
|
+
skill_name=$(basename "$skill_dir")
|
|
136
|
+
echo "=== $skill_name ==="
|
|
137
|
+
|
|
138
|
+
# Count reference files (one level deep)
|
|
139
|
+
ref_files=$(find "$skill_dir" -maxdepth 1 -name "*.md" ! -name "SKILL.md")
|
|
140
|
+
ref_count=$(echo "$ref_files" | grep -c ".")
|
|
141
|
+
|
|
142
|
+
if [ "$ref_count" -gt 0 ]; then
|
|
143
|
+
echo "📄 Reference files: $ref_count"
|
|
144
|
+
echo "$ref_files" | while read -r file; do
|
|
145
|
+
filename=$(basename "$file")
|
|
146
|
+
lines=$(wc -l < "$file")
|
|
147
|
+
|
|
148
|
+
# Check if file > 100 lines should have TOC
|
|
149
|
+
if [ "$lines" -gt 100 ]; then
|
|
150
|
+
if grep -q "^## Table of Contents" "$file" || grep -q "^# Table of Contents" "$file"; then
|
|
151
|
+
echo " ✅ $filename ($lines lines, has TOC)"
|
|
152
|
+
else
|
|
153
|
+
echo " ⚠️ $filename ($lines lines, needs TOC)"
|
|
154
|
+
fi
|
|
155
|
+
else
|
|
156
|
+
echo " ✅ $filename ($lines lines)"
|
|
157
|
+
fi
|
|
158
|
+
done
|
|
159
|
+
else
|
|
160
|
+
echo "📄 Reference files: 0"
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
# Check for nested files (anti-pattern)
|
|
164
|
+
nested=$(find "$skill_dir" -mindepth 2 -name "*.md" 2>/dev/null)
|
|
165
|
+
if [ -n "$nested" ]; then
|
|
166
|
+
echo " ❌ WARNING: Nested files found (avoid deep nesting):"
|
|
167
|
+
echo "$nested" | sed 's/^/ /'
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
# Check for Windows-style paths in SKILL.md
|
|
171
|
+
if grep -q '\\' "$skill_dir/SKILL.md"; then
|
|
172
|
+
echo " ⚠️ WARNING: Windows-style backslashes found (use forward slashes)"
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
echo ""
|
|
19
176
|
done
|
|
20
177
|
```
|
|
21
178
|
|
|
22
|
-
|
|
179
|
+
**Rules:**
|
|
180
|
+
- ✅ Reference files one level deep from SKILL.md
|
|
181
|
+
- ✅ Files > 100 lines have table of contents
|
|
182
|
+
- ✅ Forward slashes in all paths
|
|
183
|
+
- ✅ Descriptive file names (not `doc1.md`, `utils.md`)
|
|
184
|
+
- ❌ No nested references (file → file → file)
|
|
23
185
|
|
|
24
|
-
|
|
25
|
-
- ✅ **Optimal:** 500-800 lines (fastest loading)
|
|
26
|
-
- ⚠️ **Acceptable:** 800-1,800 lines (borderline)
|
|
27
|
-
- ❌ **Too Large:** > 1,800 lines (MUST be optimized)
|
|
186
|
+
### D. Naming Convention Check
|
|
28
187
|
|
|
29
|
-
|
|
188
|
+
**Recommended: Gerund form (processing-pdfs, analyzing-data)**
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
echo "=== Naming Convention Check ==="
|
|
192
|
+
for skill in src/templates/claude-skills/*/SKILL.md; do
|
|
193
|
+
skill_name=$(grep "^name:" "$skill" | cut -d: -f2 | tr -d ' ')
|
|
194
|
+
|
|
195
|
+
# Check if gerund form (-ing)
|
|
196
|
+
if echo "$skill_name" | grep -qE -- '-(ing|izing|ising)(-|$)'; then
|
|
197
|
+
echo "✅ $skill_name (gerund form - recommended)"
|
|
198
|
+
# Check if action-oriented
|
|
199
|
+
elif echo "$skill_name" | grep -qE '^(process|analyze|manage|generate|create|build|test)-'; then
|
|
200
|
+
echo "⚠️ $skill_name (action-oriented - acceptable)"
|
|
201
|
+
# Check if noun phrase
|
|
202
|
+
elif echo "$skill_name" | grep -qE -- '-ing$'; then
|
|
203
|
+
echo "✅ $skill_name (noun phrase with -ing - acceptable)"
|
|
204
|
+
else
|
|
205
|
+
# Check for anti-patterns
|
|
206
|
+
if echo "$skill_name" | grep -qE '^(helper|utils|tools|common)'; then
|
|
207
|
+
echo "❌ $skill_name (VAGUE: avoid helper/utils/tools)"
|
|
208
|
+
else
|
|
209
|
+
echo "⚠️ $skill_name (consider gerund form: ${skill_name}ing or processing-${skill_name})"
|
|
210
|
+
fi
|
|
211
|
+
fi
|
|
212
|
+
done
|
|
213
|
+
```
|
|
30
214
|
|
|
31
|
-
|
|
215
|
+
### E. Content Quality Scan
|
|
32
216
|
|
|
33
|
-
For each oversized SKILL.md:
|
|
34
217
|
```bash
|
|
35
|
-
|
|
36
|
-
|
|
218
|
+
echo "=== Content Quality Scan ==="
|
|
219
|
+
for skill in src/templates/claude-skills/*/SKILL.md; do
|
|
220
|
+
name=$(basename $(dirname "$skill"))
|
|
221
|
+
echo "--- $name ---"
|
|
222
|
+
|
|
223
|
+
# Check for common anti-patterns
|
|
224
|
+
if grep -qi "magic number" "$skill"; then
|
|
225
|
+
echo "⚠️ Uses term 'magic number' - ensure values are justified"
|
|
226
|
+
fi
|
|
37
227
|
|
|
38
|
-
|
|
39
|
-
|
|
228
|
+
if grep -qE '\b(TODO|FIXME|XXX)\b' "$skill"; then
|
|
229
|
+
echo "⚠️ Contains TODO/FIXME markers"
|
|
230
|
+
fi
|
|
231
|
+
|
|
232
|
+
if grep -q "as of [0-9][0-9][0-9][0-9]" "$skill"; then
|
|
233
|
+
echo "⚠️ Contains time-sensitive information (use 'old patterns' section)"
|
|
234
|
+
fi
|
|
235
|
+
|
|
236
|
+
# Check for inconsistent terminology
|
|
237
|
+
if grep -qi "repository" "$skill" && grep -qi "repo" "$skill"; then
|
|
238
|
+
echo "⚠️ Inconsistent terminology: 'repository' and 'repo' both used"
|
|
239
|
+
fi
|
|
240
|
+
|
|
241
|
+
echo ""
|
|
242
|
+
done
|
|
40
243
|
```
|
|
41
244
|
|
|
42
|
-
|
|
43
|
-
- Quality Review processes (often 500-1000 lines)
|
|
44
|
-
- Security Rules (often 300-500 lines)
|
|
45
|
-
- Configuration Guides (often 200-300 lines)
|
|
46
|
-
- Test Guidelines (often 400-600 lines)
|
|
47
|
-
- Example Collections (often 300-500 lines)
|
|
245
|
+
## 📊 Step 3: Compare Against Fetched Best Practices
|
|
48
246
|
|
|
49
|
-
|
|
247
|
+
Cross-reference validation results with the best practices document from Step 1:
|
|
50
248
|
|
|
51
|
-
|
|
249
|
+
1. **Verify size limits:** Still 500 lines body?
|
|
250
|
+
2. **Check naming:** Still gerund-preferred?
|
|
251
|
+
3. **Review frontmatter:** Any new required fields?
|
|
252
|
+
4. **Scan anti-patterns:** Any new patterns to avoid?
|
|
253
|
+
5. **Note changes:** Document differences from current implementation
|
|
254
|
+
|
|
255
|
+
If official guidelines have changed, update validation criteria accordingly.
|
|
256
|
+
|
|
257
|
+
## 🔧 Step 4: Optimization (If Needed)
|
|
258
|
+
|
|
259
|
+
For skills > 500 lines, perform extraction:
|
|
260
|
+
|
|
261
|
+
### A. Identify Large Sections
|
|
52
262
|
|
|
53
|
-
**A. Extract section:**
|
|
54
263
|
```bash
|
|
55
|
-
#
|
|
56
|
-
|
|
264
|
+
# Analyze section sizes in oversized SKILL.md
|
|
265
|
+
awk '/^## / {
|
|
266
|
+
if (prev) print prev " " NR-start " lines"
|
|
267
|
+
prev=$0
|
|
268
|
+
start=NR
|
|
269
|
+
}
|
|
270
|
+
END {
|
|
271
|
+
if (prev) print prev " " NR-start " lines"
|
|
272
|
+
}' SKILL.md | sort -t' ' -k3 -rn
|
|
57
273
|
```
|
|
58
274
|
|
|
59
|
-
**
|
|
275
|
+
**Candidates for extraction (> 100 lines):**
|
|
276
|
+
- Detailed workflows and processes
|
|
277
|
+
- Extensive example collections
|
|
278
|
+
- Long checklists
|
|
279
|
+
- Reference tables
|
|
280
|
+
- Troubleshooting guides
|
|
281
|
+
- Historical context sections
|
|
282
|
+
|
|
283
|
+
### B. Extract Content
|
|
284
|
+
|
|
285
|
+
**1. Create reference file:**
|
|
286
|
+
|
|
60
287
|
```markdown
|
|
61
288
|
---
|
|
62
|
-
name: skill-name-
|
|
63
|
-
|
|
64
|
-
description: What this file contains
|
|
289
|
+
name: skill-name-topic
|
|
290
|
+
description: Detailed [topic] for skill-name skill
|
|
65
291
|
---
|
|
292
|
+
|
|
293
|
+
# [Topic Title]
|
|
294
|
+
|
|
295
|
+
## Table of Contents
|
|
296
|
+
(If file > 100 lines, REQUIRED)
|
|
297
|
+
|
|
298
|
+
[Content extracted from SKILL.md]
|
|
66
299
|
```
|
|
67
300
|
|
|
68
|
-
**
|
|
301
|
+
**2. Replace in SKILL.md:**
|
|
302
|
+
|
|
69
303
|
```markdown
|
|
70
|
-
##
|
|
304
|
+
## [Topic]
|
|
71
305
|
|
|
72
|
-
**📖
|
|
306
|
+
**📖 Complete [topic] details: `topic-name.md`**
|
|
73
307
|
|
|
74
308
|
**Quick overview:**
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
309
|
+
- Essential point 1
|
|
310
|
+
- Essential point 2
|
|
311
|
+
- Essential point 3
|
|
78
312
|
|
|
79
|
-
**Critical
|
|
80
|
-
- [ ]
|
|
81
|
-
- [ ]
|
|
313
|
+
**Critical checklist:**
|
|
314
|
+
- [ ] Must-know item 1
|
|
315
|
+
- [ ] Must-know item 2
|
|
82
316
|
```
|
|
83
317
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
**What to extract:**
|
|
87
|
-
- ✅ Detailed process descriptions
|
|
88
|
-
- ✅ Extensive examples
|
|
89
|
-
- ✅ Long checklists
|
|
90
|
-
- ✅ Reference documentation
|
|
91
|
-
- ✅ Troubleshooting guides
|
|
318
|
+
### C. Keep vs Extract
|
|
92
319
|
|
|
93
|
-
**
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
320
|
+
**Keep in SKILL.md:**
|
|
321
|
+
- Core workflow (numbered steps)
|
|
322
|
+
- Critical warnings
|
|
323
|
+
- "When to Use" section
|
|
324
|
+
- Quick command reference
|
|
325
|
+
- Essential checklists (< 10 items)
|
|
98
326
|
|
|
99
|
-
|
|
327
|
+
**Extract to separate files:**
|
|
328
|
+
- Detailed workflows (> 100 lines)
|
|
329
|
+
- Extensive examples (> 50 lines)
|
|
330
|
+
- Reference documentation
|
|
331
|
+
- Troubleshooting guides
|
|
332
|
+
- Historical "old patterns" sections
|
|
100
333
|
|
|
101
|
-
|
|
102
|
-
- [ ] SKILL.md has clear reference (📖) to detail file
|
|
103
|
-
- [ ] Detail file has frontmatter
|
|
104
|
-
- [ ] Compact summary remains in SKILL.md
|
|
105
|
-
- [ ] No information is lost
|
|
106
|
-
- [ ] Line count significantly reduced
|
|
107
|
-
|
|
108
|
-
## 📊 7. Measure Success
|
|
334
|
+
## 📋 Step 5: Generate Report
|
|
109
335
|
|
|
110
336
|
```bash
|
|
111
|
-
|
|
112
|
-
echo "
|
|
113
|
-
echo "
|
|
114
|
-
echo "
|
|
115
|
-
echo "
|
|
116
|
-
|
|
337
|
+
echo "=================================="
|
|
338
|
+
echo " Skill Validation Report"
|
|
339
|
+
echo "=================================="
|
|
340
|
+
echo ""
|
|
341
|
+
echo "📊 Summary:"
|
|
342
|
+
total=$(find src/templates/claude-skills -name "SKILL.md" | wc -l)
|
|
343
|
+
echo "Total skills validated: $total"
|
|
344
|
+
echo ""
|
|
345
|
+
|
|
346
|
+
echo "📏 Size Distribution:"
|
|
347
|
+
optimal=0
|
|
348
|
+
acceptable=0
|
|
349
|
+
too_large=0
|
|
350
|
+
|
|
351
|
+
for skill in src/templates/claude-skills/*/SKILL.md; do
|
|
352
|
+
frontmatter_end=$(grep -n "^---$" "$skill" | tail -1 | cut -d: -f1)
|
|
353
|
+
body_lines=$(tail -n +$((frontmatter_end + 1)) "$skill" | wc -l)
|
|
354
|
+
|
|
355
|
+
if [ "$body_lines" -lt 500 ]; then
|
|
356
|
+
optimal=$((optimal + 1))
|
|
357
|
+
elif [ "$body_lines" -lt 800 ]; then
|
|
358
|
+
acceptable=$((acceptable + 1))
|
|
359
|
+
else
|
|
360
|
+
too_large=$((too_large + 1))
|
|
361
|
+
fi
|
|
362
|
+
done
|
|
117
363
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- ✅ All information still available
|
|
364
|
+
echo " ✅ Optimal (< 500 lines): $optimal"
|
|
365
|
+
echo " ⚠️ Acceptable (500-800): $acceptable"
|
|
366
|
+
echo " ❌ Too large (> 800): $too_large"
|
|
367
|
+
echo ""
|
|
123
368
|
|
|
124
|
-
|
|
369
|
+
echo "📋 Frontmatter Compliance:"
|
|
370
|
+
complete=0
|
|
371
|
+
incomplete=0
|
|
125
372
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
373
|
+
for skill in src/templates/claude-skills/*/SKILL.md; do
|
|
374
|
+
if grep -q "^name:" "$skill" && grep -q "^description:" "$skill"; then
|
|
375
|
+
complete=$((complete + 1))
|
|
376
|
+
else
|
|
377
|
+
incomplete=$((incomplete + 1))
|
|
378
|
+
fi
|
|
379
|
+
done
|
|
129
380
|
|
|
130
|
-
|
|
131
|
-
|
|
381
|
+
echo " ✅ Complete: $complete"
|
|
382
|
+
echo " ❌ Incomplete: $incomplete"
|
|
383
|
+
echo ""
|
|
132
384
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
385
|
+
echo "🔍 Issues Requiring Attention:"
|
|
386
|
+
for skill in src/templates/claude-skills/*/SKILL.md; do
|
|
387
|
+
name=$(basename $(dirname "$skill"))
|
|
388
|
+
issues=""
|
|
389
|
+
|
|
390
|
+
# Check size
|
|
391
|
+
frontmatter_end=$(grep -n "^---$" "$skill" | tail -1 | cut -d: -f1)
|
|
392
|
+
body_lines=$(tail -n +$((frontmatter_end + 1)) "$skill" | wc -l)
|
|
393
|
+
if [ "$body_lines" -gt 800 ]; then
|
|
394
|
+
issues="${issues}- Size: $body_lines lines (optimize)\n"
|
|
395
|
+
fi
|
|
396
|
+
|
|
397
|
+
# Check frontmatter
|
|
398
|
+
if ! grep -q "^name:" "$skill"; then
|
|
399
|
+
issues="${issues}- Missing 'name' field\n"
|
|
400
|
+
fi
|
|
401
|
+
if ! grep -q "^description:" "$skill"; then
|
|
402
|
+
issues="${issues}- Missing 'description' field\n"
|
|
403
|
+
fi
|
|
404
|
+
|
|
405
|
+
# Check naming
|
|
406
|
+
skill_name=$(grep "^name:" "$skill" | cut -d: -f2 | tr -d ' ')
|
|
407
|
+
if echo "$skill_name" | grep -qE '^(helper|utils|tools)'; then
|
|
408
|
+
issues="${issues}- Vague name: $skill_name\n"
|
|
409
|
+
fi
|
|
410
|
+
|
|
411
|
+
if [ -n "$issues" ]; then
|
|
412
|
+
echo ""
|
|
413
|
+
echo "$name:"
|
|
414
|
+
echo -e "$issues"
|
|
415
|
+
fi
|
|
416
|
+
done
|
|
138
417
|
|
|
139
|
-
|
|
418
|
+
echo ""
|
|
419
|
+
echo "=================================="
|
|
420
|
+
echo "✅ Validation Complete"
|
|
421
|
+
echo "=================================="
|
|
140
422
|
```
|
|
423
|
+
|
|
424
|
+
## 🎯 Step 6: Action Items
|
|
425
|
+
|
|
426
|
+
Based on validation, create specific action items for each skill needing work:
|
|
427
|
+
|
|
428
|
+
**Priority 1 (Critical):**
|
|
429
|
+
- Missing frontmatter fields → Add immediately
|
|
430
|
+
- Invalid name format → Fix format
|
|
431
|
+
- > 800 lines → Extract content
|
|
432
|
+
|
|
433
|
+
**Priority 2 (Important):**
|
|
434
|
+
- 500-800 lines → Consider extraction
|
|
435
|
+
- Vague descriptions → Add specifics and trigger terms
|
|
436
|
+
- Missing TOC in large files → Add table of contents
|
|
437
|
+
|
|
438
|
+
**Priority 3 (Nice to have):**
|
|
439
|
+
- Improve naming (→ gerund form)
|
|
440
|
+
- Add concrete examples
|
|
441
|
+
- Fix inconsistent terminology
|
|
442
|
+
|
|
443
|
+
## ✅ Step 7: Verification
|
|
444
|
+
|
|
445
|
+
Before completing, verify:
|
|
446
|
+
- [ ] All skills have valid frontmatter (name + description)
|
|
447
|
+
- [ ] All descriptions in third person with trigger terms
|
|
448
|
+
- [ ] All names follow format (lowercase, hyphens, max 64 chars)
|
|
449
|
+
- [ ] All SKILL.md files < 800 lines (ideally < 500)
|
|
450
|
+
- [ ] Reference files > 100 lines have table of contents
|
|
451
|
+
- [ ] No deeply nested file references
|
|
452
|
+
- [ ] All paths use forward slashes
|
|
453
|
+
- [ ] No vague names (helper, utils, tools)
|
|
454
|
+
- [ ] Cross-referenced with latest best practices from Step 1
|
|
455
|
+
|
|
456
|
+
## 📚 References
|
|
457
|
+
|
|
458
|
+
Official documentation:
|
|
459
|
+
- https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices
|
|
460
|
+
- https://www.anthropic.com/engineering/claude-code-best-practices
|
|
461
|
+
|
|
462
|
+
## 💡 Tips for Command Execution
|
|
463
|
+
|
|
464
|
+
**For autonomous execution:**
|
|
465
|
+
1. Start with WebFetch in Step 1 (MANDATORY)
|
|
466
|
+
2. Run all validation scripts sequentially
|
|
467
|
+
3. Generate full report in Step 5
|
|
468
|
+
4. List specific action items for each skill
|
|
469
|
+
5. Provide clear next steps to user
|
|
470
|
+
|
|
471
|
+
**For interactive use:**
|
|
472
|
+
- Show progress between steps
|
|
473
|
+
- Highlight critical issues immediately
|
|
474
|
+
- Provide examples of good fixes
|
|
475
|
+
- Ask for clarification on borderline cases
|
|
476
|
+
|
|
477
|
+
**Success indicators:**
|
|
478
|
+
- All skills pass frontmatter validation
|
|
479
|
+
- 80%+ skills under 500 lines
|
|
480
|
+
- All issues documented with action items
|
|
481
|
+
- Report includes comparison with latest best practices
|