claude-skills-cli 0.0.2 → 0.0.4
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/README.md +169 -354
- package/dist/commands/init.js +28 -19
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/package.js +2 -5
- package/dist/commands/package.js.map +1 -1
- package/dist/commands/stats.js +154 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/core/templates.js +82 -59
- package/dist/core/templates.js.map +1 -1
- package/dist/core/validator.js +117 -16
- package/dist/core/validator.js.map +1 -1
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/utils/output.js +46 -16
- package/dist/utils/output.js.map +1 -1
- package/docs/SKILL-DEVELOPMENT.md +28 -30
- package/docs/SKILL-EXAMPLES.md +27 -23
- package/docs/SKILLS-ARCHITECTURE.md +14 -14
- package/package.json +1 -1
- package/skills/skill-creator/SKILL.md +62 -301
- package/skills/skill-creator/references/anthropic-resources.md +458 -0
- package/skills/skill-creator/references/cli-feedback.md +431 -0
- package/skills/skill-creator/references/cli-reference.md +499 -0
- package/skills/skill-creator/references/skill-examples.md +77 -69
- package/skills/skill-creator/references/writing-guide.md +134 -119
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
# claude-skills-cli Reference
|
|
2
|
+
|
|
3
|
+
Complete command-line reference for the `claude-skills-cli` tool (TypeScript/Node).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Global Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g claude-skills-cli
|
|
11
|
+
claude-skills --version
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Using npx (No Installation)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx claude-skills <command>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Using pnpm
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpx claude-skills-cli <command>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### As Dev Dependency
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install --save-dev claude-skills-cli
|
|
30
|
+
|
|
31
|
+
# Use via package.json scripts
|
|
32
|
+
{
|
|
33
|
+
"scripts": {
|
|
34
|
+
"skill:init": "claude-skills init",
|
|
35
|
+
"skill:validate": "claude-skills validate",
|
|
36
|
+
"skill:package": "claude-skills package"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Commands
|
|
44
|
+
|
|
45
|
+
### `init` - Create New Skill
|
|
46
|
+
|
|
47
|
+
Create a new skill directory with standard structure.
|
|
48
|
+
|
|
49
|
+
#### Syntax
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
claude-skills init [options]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Options
|
|
56
|
+
|
|
57
|
+
| Option | Type | Required | Description |
|
|
58
|
+
| ---------------------- | ------ | -------- | ---------------------------------------------------- |
|
|
59
|
+
| `--name <name>` | string | Yes\* | Skill name (kebab-case, lowercase) |
|
|
60
|
+
| `--description <desc>` | string | No | Skill description (default: "TODO: Add description") |
|
|
61
|
+
| `--path <path>` | string | No | Custom path (mutually exclusive with --name) |
|
|
62
|
+
|
|
63
|
+
\*Either `--name` or `--path` must be provided
|
|
64
|
+
|
|
65
|
+
#### Examples
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Create skill with default location (.claude/skills/)
|
|
69
|
+
npx claude-skills init --name my-skill
|
|
70
|
+
|
|
71
|
+
# With description
|
|
72
|
+
npx claude-skills init --name my-skill \
|
|
73
|
+
--description "SQLite queries. Use when writing database operations"
|
|
74
|
+
|
|
75
|
+
# Custom path
|
|
76
|
+
npx claude-skills init --path /custom/path/my-skill
|
|
77
|
+
|
|
78
|
+
# Custom path with description
|
|
79
|
+
npx claude-skills init --path /custom/path/my-skill \
|
|
80
|
+
--description "Brief description"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Created Structure
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
.claude/skills/my-skill/
|
|
87
|
+
├── SKILL.md # Main skill instructions
|
|
88
|
+
├── README.md # Skill documentation
|
|
89
|
+
└── references/ # Level 3 detailed documentation
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Name Validation
|
|
93
|
+
|
|
94
|
+
- Must be lowercase
|
|
95
|
+
- Must be kebab-case (alphanumeric with hyphens)
|
|
96
|
+
- No spaces or special characters
|
|
97
|
+
- Example valid names: `database-queries`, `auth-patterns`, `ui-components`
|
|
98
|
+
|
|
99
|
+
#### Output
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
✅ Skill created at: .claude/skills/my-skill
|
|
103
|
+
|
|
104
|
+
Next steps:
|
|
105
|
+
1. Edit .claude/skills/my-skill/SKILL.md with your skill instructions
|
|
106
|
+
2. Add detailed documentation to references/
|
|
107
|
+
3. Add executable scripts to scripts/
|
|
108
|
+
4. Remove example files you don't need
|
|
109
|
+
|
|
110
|
+
Validate with: claude-skills validate .claude/skills/my-skill
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### `validate` - Validate Skill Structure
|
|
116
|
+
|
|
117
|
+
Validate skill structure and progressive disclosure compliance.
|
|
118
|
+
|
|
119
|
+
#### Syntax
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
claude-skills validate <skill_path> [options]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### Arguments
|
|
126
|
+
|
|
127
|
+
| Argument | Type | Required | Description |
|
|
128
|
+
| -------------- | ------ | -------- | ----------------------- |
|
|
129
|
+
| `<skill_path>` | string | Yes | Path to skill directory |
|
|
130
|
+
|
|
131
|
+
#### Options
|
|
132
|
+
|
|
133
|
+
| Option | Type | Description |
|
|
134
|
+
| ---------- | ------- | -------------------------------------- |
|
|
135
|
+
| `--strict` | boolean | Treat warnings as errors (exit code 1) |
|
|
136
|
+
|
|
137
|
+
#### Examples
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Validate skill
|
|
141
|
+
npx claude-skills validate .claude/skills/my-skill
|
|
142
|
+
|
|
143
|
+
# Strict mode (warnings = errors)
|
|
144
|
+
npx claude-skills validate .claude/skills/my-skill --strict
|
|
145
|
+
|
|
146
|
+
# Validate multiple skills
|
|
147
|
+
npx claude-skills validate .claude/skills/skill-1
|
|
148
|
+
npx claude-skills validate .claude/skills/skill-2
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Validation Checks
|
|
152
|
+
|
|
153
|
+
**Level 1 (Metadata):**
|
|
154
|
+
|
|
155
|
+
- Description length: <200 chars (optimal), <300 chars (warning), <1024 chars (max)
|
|
156
|
+
- Description includes trigger keywords ("Use when...", "Use for...", "Use to...")
|
|
157
|
+
- Description comma count (warns if >3, suggesting list bloat)
|
|
158
|
+
- Name format (lowercase, kebab-case)
|
|
159
|
+
- Name length (<64 chars)
|
|
160
|
+
- Name matches directory name
|
|
161
|
+
|
|
162
|
+
**Level 2 (SKILL.md Body):**
|
|
163
|
+
|
|
164
|
+
- Line count: ~50 (optimal), <80 (good), <150 (warning)
|
|
165
|
+
- Word count: <1000 (optimal), <5000 (max)
|
|
166
|
+
- Code blocks: 1-2 (optimal), ≤3 (good), >3 (warning)
|
|
167
|
+
- Sections: 3-5 (optimal), ≤8 (good), >8 (warning)
|
|
168
|
+
- Long paragraphs: ≤3 (warns if >3 paragraphs over 100 words)
|
|
169
|
+
- "Quick Start" section present
|
|
170
|
+
- Links to references/ when body is long (>60 lines)
|
|
171
|
+
- No TODO placeholders
|
|
172
|
+
|
|
173
|
+
**Level 3 (References):**
|
|
174
|
+
|
|
175
|
+
- Referenced files exist (errors on broken links)
|
|
176
|
+
- No empty directories (warnings)
|
|
177
|
+
- Scripts are executable (warnings)
|
|
178
|
+
- Scripts have shebang (#!)
|
|
179
|
+
|
|
180
|
+
#### Output Format
|
|
181
|
+
|
|
182
|
+
**Valid Skill:**
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
✅ Skill is valid!
|
|
186
|
+
|
|
187
|
+
📊 Progressive Disclosure Stats:
|
|
188
|
+
|
|
189
|
+
Level 1 (Metadata - Always Loaded):
|
|
190
|
+
Description: 156 chars, ~18 tokens ✅ Optimal
|
|
191
|
+
(Target: <200 chars, <30 tokens for Level 1 efficiency)
|
|
192
|
+
|
|
193
|
+
Level 2 (SKILL.md Body - Loaded when triggered):
|
|
194
|
+
Lines: 48 (target: ~50, max: ~150) ✅ Excellent
|
|
195
|
+
Words: 342 (recommended: <1000, max: <5000) ✅ Excellent
|
|
196
|
+
Est. tokens: ~445 (budget: <6500) within budget
|
|
197
|
+
Code blocks: 1 ✅
|
|
198
|
+
Sections: 5 ✅
|
|
199
|
+
|
|
200
|
+
Level 3+ (References - Loaded as needed):
|
|
201
|
+
Use references/ directory for detailed docs (unlimited size)
|
|
202
|
+
|
|
203
|
+
Overall Assessment:
|
|
204
|
+
✅ Excellent progressive disclosure!
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**With Warnings:**
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
⚠️ Skill is valid (with warnings)
|
|
211
|
+
|
|
212
|
+
⚠️ Warnings:
|
|
213
|
+
⚠️ Description contains long lists (5 commas)
|
|
214
|
+
→ Move detailed lists to Level 2 (SKILL.md body) or Level 3 (references/)
|
|
215
|
+
⚠️ SKILL.md body is 85 lines (recommended: ~50, max: ~80)
|
|
216
|
+
→ Consider moving detailed examples to references/ for Level 3 loading
|
|
217
|
+
|
|
218
|
+
📊 Progressive Disclosure Stats:
|
|
219
|
+
[... stats output ...]
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**With Errors:**
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
❌ Skill validation failed
|
|
226
|
+
|
|
227
|
+
❌ Errors:
|
|
228
|
+
❌ Referenced file not found: references/examples.md
|
|
229
|
+
→ Linked from: [references/examples.md]
|
|
230
|
+
→ Create the file or remove the broken link
|
|
231
|
+
❌ Description too long (max 1024 chars per Anthropic): 1250
|
|
232
|
+
|
|
233
|
+
📊 Progressive Disclosure Stats:
|
|
234
|
+
[... stats output ...]
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### Exit Codes
|
|
238
|
+
|
|
239
|
+
| Code | Meaning |
|
|
240
|
+
| ---- | --------------------------------------------- |
|
|
241
|
+
| 0 | Valid (no errors) |
|
|
242
|
+
| 1 | Invalid (has errors) |
|
|
243
|
+
| 1 | Valid but has warnings (only with `--strict`) |
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
### `package` - Create Distribution Zip
|
|
248
|
+
|
|
249
|
+
Package skill into a zip file for distribution.
|
|
250
|
+
|
|
251
|
+
#### Syntax
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
claude-skills package <skill_path> [options]
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
#### Arguments
|
|
258
|
+
|
|
259
|
+
| Argument | Type | Required | Description |
|
|
260
|
+
| -------------- | ------ | -------- | ----------------------- |
|
|
261
|
+
| `<skill_path>` | string | Yes | Path to skill directory |
|
|
262
|
+
|
|
263
|
+
#### Options
|
|
264
|
+
|
|
265
|
+
| Option | Type | Description |
|
|
266
|
+
| ------------------- | ------- | ----------------------------------- |
|
|
267
|
+
| `--output <path>` | string | Output directory (default: `dist/`) |
|
|
268
|
+
| `--skip-validation` | boolean | Skip validation before packaging |
|
|
269
|
+
|
|
270
|
+
#### Examples
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# Package skill (validates first)
|
|
274
|
+
npx claude-skills package .claude/skills/my-skill
|
|
275
|
+
|
|
276
|
+
# Custom output directory
|
|
277
|
+
npx claude-skills package .claude/skills/my-skill --output builds/
|
|
278
|
+
|
|
279
|
+
# Skip validation (not recommended)
|
|
280
|
+
npx claude-skills package .claude/skills/my-skill --skip-validation
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### Excluded Files
|
|
284
|
+
|
|
285
|
+
The packager automatically excludes:
|
|
286
|
+
|
|
287
|
+
- Hidden files (`.gitignore`, `.git/`, `.env`, etc.)
|
|
288
|
+
- Editor temp files (`.swp`, `~`, `.bak`)
|
|
289
|
+
- OS files (`.DS_Store`)
|
|
290
|
+
|
|
291
|
+
#### Output
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
✅ Skill validation passed
|
|
295
|
+
|
|
296
|
+
📦 Packaging skill: my-skill
|
|
297
|
+
✅ Package created: dist/my-skill.zip
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**With validation errors (without --skip-validation):**
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
❌ Skill validation failed
|
|
304
|
+
Packaging aborted. Fix errors or use --skip-validation
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### Distribution
|
|
308
|
+
|
|
309
|
+
The created zip can be:
|
|
310
|
+
|
|
311
|
+
1. Uploaded to Claude.ai (Settings > Features > Skills)
|
|
312
|
+
2. Uploaded via API (`/v1/skills` endpoint)
|
|
313
|
+
3. Shared with team members
|
|
314
|
+
4. Version controlled in git
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Common Workflows
|
|
319
|
+
|
|
320
|
+
### Create and Validate New Skill
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# 1. Create skill
|
|
324
|
+
npx claude-skills init --name database-queries \
|
|
325
|
+
--description "SQLite queries. Use when writing SELECT, INSERT, UPDATE"
|
|
326
|
+
|
|
327
|
+
# 2. Edit SKILL.md
|
|
328
|
+
vim .claude/skills/database-queries/SKILL.md
|
|
329
|
+
|
|
330
|
+
# 3. Add references
|
|
331
|
+
vim .claude/skills/database-queries/references/schema.md
|
|
332
|
+
|
|
333
|
+
# 4. Validate
|
|
334
|
+
npx claude-skills validate .claude/skills/database-queries
|
|
335
|
+
|
|
336
|
+
# 5. Fix any issues, re-validate
|
|
337
|
+
npx claude-skills validate .claude/skills/database-queries
|
|
338
|
+
|
|
339
|
+
# 6. Package
|
|
340
|
+
npx claude-skills package .claude/skills/database-queries
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Strict Validation in CI
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
# package.json
|
|
347
|
+
{
|
|
348
|
+
"scripts": {
|
|
349
|
+
"test:skills": "claude-skills validate .claude/skills/* --strict"
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
# Run in CI
|
|
354
|
+
npm run test:skills
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Batch Validate All Skills
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
# Bash script to validate all skills
|
|
361
|
+
for skill in .claude/skills/*/; do
|
|
362
|
+
echo "Validating $skill"
|
|
363
|
+
npx claude-skills validate "$skill" || exit 1
|
|
364
|
+
done
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Quick Skill Creation
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
# One-liner with validation
|
|
371
|
+
npx claude-skills init --name my-skill --description "Brief desc" && \
|
|
372
|
+
npx claude-skills validate .claude/skills/my-skill
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Environment Variables
|
|
378
|
+
|
|
379
|
+
Currently, the CLI does not use environment variables. All configuration is via command-line flags.
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Error Messages
|
|
384
|
+
|
|
385
|
+
### Common Errors
|
|
386
|
+
|
|
387
|
+
**Invalid skill name:**
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
❌ Skill name must be lowercase: MySkill
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**Missing required field:**
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
❌ SKILL.md frontmatter missing 'description' field
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
**Broken reference link:**
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
❌ Referenced file not found: references/examples.md
|
|
403
|
+
→ Linked from: [references/examples.md]
|
|
404
|
+
→ Create the file or remove the broken link
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Description too long:**
|
|
408
|
+
|
|
409
|
+
```
|
|
410
|
+
❌ Description too long (max 1024 chars per Anthropic): 1250
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Tips and Best Practices
|
|
416
|
+
|
|
417
|
+
### Naming Skills
|
|
418
|
+
|
|
419
|
+
✅ Good names:
|
|
420
|
+
|
|
421
|
+
- `database-queries`
|
|
422
|
+
- `auth-patterns`
|
|
423
|
+
- `ui-components`
|
|
424
|
+
- `api-client`
|
|
425
|
+
|
|
426
|
+
❌ Bad names:
|
|
427
|
+
|
|
428
|
+
- `DatabaseQueries` (not lowercase)
|
|
429
|
+
- `db queries` (spaces not allowed)
|
|
430
|
+
- `api_client` (underscores not recommended)
|
|
431
|
+
|
|
432
|
+
### Writing Descriptions
|
|
433
|
+
|
|
434
|
+
✅ Good descriptions:
|
|
435
|
+
|
|
436
|
+
```yaml
|
|
437
|
+
description: SQLite database operations using better-sqlite3 for contacts, companies, and interactions. Use when writing SELECT, INSERT, UPDATE, or DELETE operations.
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
❌ Bad descriptions:
|
|
441
|
+
|
|
442
|
+
```yaml
|
|
443
|
+
description: Database helper
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Progressive Disclosure
|
|
447
|
+
|
|
448
|
+
**Keep Level 1 & 2 lean:**
|
|
449
|
+
|
|
450
|
+
- Level 1: <200 chars, keyword-rich
|
|
451
|
+
- Level 2: ~50 lines, quick reference
|
|
452
|
+
- Level 3: Move details to references/
|
|
453
|
+
|
|
454
|
+
### Validation Workflow
|
|
455
|
+
|
|
456
|
+
1. Run `validate` frequently during development
|
|
457
|
+
2. Fix errors before warnings
|
|
458
|
+
3. Use `--strict` in CI/CD pipelines
|
|
459
|
+
4. Aim for "✅ Excellent progressive disclosure!"
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## Package.json Integration
|
|
464
|
+
|
|
465
|
+
```json
|
|
466
|
+
{
|
|
467
|
+
"scripts": {
|
|
468
|
+
"skill:new": "claude-skills init",
|
|
469
|
+
"skill:validate": "claude-skills validate .claude/skills/*",
|
|
470
|
+
"skill:validate:strict": "claude-skills validate .claude/skills/* --strict",
|
|
471
|
+
"skill:package": "claude-skills package",
|
|
472
|
+
"skill:check": "npm run skill:validate:strict"
|
|
473
|
+
},
|
|
474
|
+
"devDependencies": {
|
|
475
|
+
"claude-skills-cli": "^0.0.3"
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## Version Information
|
|
483
|
+
|
|
484
|
+
```bash
|
|
485
|
+
# Check CLI version
|
|
486
|
+
npx claude-skills --version
|
|
487
|
+
|
|
488
|
+
# Show help
|
|
489
|
+
npx claude-skills --help
|
|
490
|
+
npx claude-skills init --help
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
---
|
|
494
|
+
|
|
495
|
+
## Resources
|
|
496
|
+
|
|
497
|
+
- [GitHub Repository](https://github.com/spences10/claude-skills-cli)
|
|
498
|
+
- [Anthropic Skills Documentation](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview)
|
|
499
|
+
- [Anthropic Skills Repository](https://github.com/anthropics/skills)
|