claude-skills-cli 0.0.1
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 +455 -0
- package/dist/commands/init.js +70 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/package.js +133 -0
- package/dist/commands/package.js.map +1 -0
- package/dist/commands/validate.js +48 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/core/templates.js +90 -0
- package/dist/core/templates.js.map +1 -0
- package/dist/core/validator.js +185 -0
- package/dist/core/validator.js.map +1 -0
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/fs.js +25 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/output.js +9 -0
- package/dist/utils/output.js.map +1 -0
- package/docs/SKILL-DEVELOPMENT.md +457 -0
- package/docs/SKILL-EXAMPLES.md +518 -0
- package/docs/SKILLS-ARCHITECTURE.md +380 -0
- package/package.json +58 -0
- package/skills/skill-creator/SKILL.md +345 -0
- package/skills/skill-creator/references/skill-examples.md +403 -0
- package/skills/skill-creator/references/writing-guide.md +594 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
# Skill Development Workflow
|
|
2
|
+
|
|
3
|
+
## Quick Start
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Create a new skill
|
|
7
|
+
python .claude/scripts/init_skill.py --name my-skill --description "What it does"
|
|
8
|
+
|
|
9
|
+
# Validate the skill
|
|
10
|
+
python .claude/scripts/validate_skill.py .claude/skills/my-skill
|
|
11
|
+
|
|
12
|
+
# Package for distribution
|
|
13
|
+
python .claude/scripts/package_skill.py .claude/skills/my-skill
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## The 6-Step Process
|
|
17
|
+
|
|
18
|
+
Based on Anthropic's skill-creator methodology, adapted for devhub-crm.
|
|
19
|
+
|
|
20
|
+
### Step 1: Understanding with Concrete Examples
|
|
21
|
+
|
|
22
|
+
**Goal**: Clearly understand how the skill will be used in practice.
|
|
23
|
+
|
|
24
|
+
**Process**:
|
|
25
|
+
|
|
26
|
+
1. Identify specific scenarios where skill is needed
|
|
27
|
+
2. Collect real examples from your workflow
|
|
28
|
+
3. Note what Claude struggles with currently
|
|
29
|
+
4. Validate examples with actual usage
|
|
30
|
+
|
|
31
|
+
**Example Questions**:
|
|
32
|
+
|
|
33
|
+
- "What task am I repeating that needs this skill?"
|
|
34
|
+
- "Can I give 3-5 concrete examples of using this?"
|
|
35
|
+
- "What would trigger Claude to use this skill?"
|
|
36
|
+
- "What information does Claude need that I keep providing?"
|
|
37
|
+
|
|
38
|
+
**Output**: 3-5 concrete examples of skill usage
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Step 2: Planning Reusable Contents
|
|
43
|
+
|
|
44
|
+
**Goal**: Analyze examples to determine what to include in skill.
|
|
45
|
+
|
|
46
|
+
**For each example, ask**:
|
|
47
|
+
|
|
48
|
+
1. What would Claude need to execute this from scratch?
|
|
49
|
+
2. What code is being rewritten repeatedly? → `scripts/`
|
|
50
|
+
3. What context is repeated each time? → `SKILL.md` or `references/`
|
|
51
|
+
4. What templates or assets are reused? → `assets/`
|
|
52
|
+
|
|
53
|
+
**Decision Matrix**:
|
|
54
|
+
|
|
55
|
+
| Content Type | Goes In | Example |
|
|
56
|
+
| ---------------------- | ----------- | -------------------------------- |
|
|
57
|
+
| Core workflow patterns | SKILL.md | "Always use prepared statements" |
|
|
58
|
+
| Detailed documentation | references/ | Complete API reference |
|
|
59
|
+
| Repeated code | scripts/ | Validation logic |
|
|
60
|
+
| Templates/resources | assets/ | Boilerplate HTML |
|
|
61
|
+
|
|
62
|
+
**Output**: List of files to create with their purposes
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Step 3: Initializing the Skill
|
|
67
|
+
|
|
68
|
+
**Command**:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python .claude/scripts/init_skill.py \
|
|
72
|
+
--name database-patterns \
|
|
73
|
+
--description "Guide for SQLite operations..."
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**What This Creates**:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
.claude/skills/database-patterns/
|
|
80
|
+
├── SKILL.md # With frontmatter template
|
|
81
|
+
├── README.md # Human documentation
|
|
82
|
+
├── references/
|
|
83
|
+
│ └── detailed-guide.md # Example reference
|
|
84
|
+
├── scripts/
|
|
85
|
+
│ └── example.py # Example script
|
|
86
|
+
└── assets/ # Empty directory
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Next**: Customize or delete example files as needed
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Step 4: Editing the Skill
|
|
94
|
+
|
|
95
|
+
**Focus**: Write content for another instance of Claude to use effectively.
|
|
96
|
+
|
|
97
|
+
#### Start with Reusable Contents
|
|
98
|
+
|
|
99
|
+
1. **Add scripts** (if identified in Step 2)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cd .claude/skills/database-patterns/scripts/
|
|
103
|
+
# Create validation, generation, or analysis scripts
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
2. **Add references** (if identified in Step 2)
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
cd references/
|
|
110
|
+
# Create detailed documentation files
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
3. **Add assets** (if identified in Step 2)
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
cd assets/
|
|
117
|
+
# Copy templates, images, or other resources
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
4. **Delete unused directories**
|
|
121
|
+
```bash
|
|
122
|
+
# If you don't need scripts:
|
|
123
|
+
rm -rf scripts/
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### Update SKILL.md
|
|
127
|
+
|
|
128
|
+
**Writing Guidelines**:
|
|
129
|
+
|
|
130
|
+
- ✅ Use imperative/infinitive form: "Use prepared statements"
|
|
131
|
+
- ❌ Not second person: "You should use prepared statements"
|
|
132
|
+
- ✅ Be specific: "Generate IDs with nanoid()"
|
|
133
|
+
- ❌ Not vague: "Use appropriate IDs"
|
|
134
|
+
|
|
135
|
+
**Structure to Include**:
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
---
|
|
139
|
+
name: skill-name
|
|
140
|
+
description: [What it does + When to use it]
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
# Skill Title
|
|
144
|
+
|
|
145
|
+
## Overview
|
|
146
|
+
|
|
147
|
+
[2-3 sentences on purpose]
|
|
148
|
+
|
|
149
|
+
## Quick Start
|
|
150
|
+
|
|
151
|
+
[Minimal example showing basic usage]
|
|
152
|
+
|
|
153
|
+
## Core Patterns
|
|
154
|
+
|
|
155
|
+
### Pattern 1
|
|
156
|
+
|
|
157
|
+
[Common workflow with code example]
|
|
158
|
+
|
|
159
|
+
### Pattern 2
|
|
160
|
+
|
|
161
|
+
[Another common workflow]
|
|
162
|
+
|
|
163
|
+
## Advanced Usage
|
|
164
|
+
|
|
165
|
+
For detailed information:
|
|
166
|
+
|
|
167
|
+
- [references/file1.md](references/file1.md)
|
|
168
|
+
- [references/file2.md](references/file2.md)
|
|
169
|
+
|
|
170
|
+
## Scripts
|
|
171
|
+
|
|
172
|
+
- `scripts/validate.py`: Description
|
|
173
|
+
- `scripts/generate.py`: Description
|
|
174
|
+
|
|
175
|
+
## Notes
|
|
176
|
+
|
|
177
|
+
- Important consideration 1
|
|
178
|
+
- Important consideration 2
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Questions to Answer**:
|
|
182
|
+
|
|
183
|
+
1. What is the purpose? (2-3 sentences)
|
|
184
|
+
2. When should this be used? (triggers/contexts)
|
|
185
|
+
3. How should Claude use this? (step-by-step)
|
|
186
|
+
4. What bundled resources exist? (references, scripts, assets)
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
### Step 5: Packaging the Skill
|
|
191
|
+
|
|
192
|
+
**Validation First**:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
python .claude/scripts/validate_skill.py .claude/skills/database-patterns
|
|
196
|
+
|
|
197
|
+
# Output shows:
|
|
198
|
+
# ✅ All required fields present
|
|
199
|
+
# ✅ SKILL.md structure correct
|
|
200
|
+
# ⚠️ Warning: Reference file not mentioned in SKILL.md
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Fix Validation Issues**, then package:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
python .claude/scripts/package_skill.py .claude/skills/database-patterns
|
|
207
|
+
|
|
208
|
+
# Creates:
|
|
209
|
+
# dist/database-patterns.zip
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**The package includes**:
|
|
213
|
+
|
|
214
|
+
- All files from skill directory
|
|
215
|
+
- Maintains directory structure
|
|
216
|
+
- Excludes hidden files and temp files
|
|
217
|
+
- Ready to upload to Claude.ai or share
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### Step 6: Iterate
|
|
222
|
+
|
|
223
|
+
**Test the Skill**:
|
|
224
|
+
|
|
225
|
+
1. Use skill in real conversations
|
|
226
|
+
2. Notice where it struggles or excels
|
|
227
|
+
3. Collect feedback from actual usage
|
|
228
|
+
4. Update SKILL.md or references based on observations
|
|
229
|
+
|
|
230
|
+
**Iteration Workflow**:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Edit skill content
|
|
234
|
+
vim .claude/skills/database-patterns/SKILL.md
|
|
235
|
+
|
|
236
|
+
# Validate changes
|
|
237
|
+
python .claude/scripts/validate_skill.py .claude/skills/database-patterns
|
|
238
|
+
|
|
239
|
+
# Test in conversation
|
|
240
|
+
# (Skills auto-reload in Claude Code)
|
|
241
|
+
|
|
242
|
+
# Package new version if needed
|
|
243
|
+
python .claude/scripts/package_skill.py .claude/skills/database-patterns
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Common Iterations**:
|
|
247
|
+
|
|
248
|
+
- Add more examples to SKILL.md
|
|
249
|
+
- Move detailed content to references
|
|
250
|
+
- Create new scripts for repeated tasks
|
|
251
|
+
- Clarify confusing instructions
|
|
252
|
+
- Add "when to use" guidance
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Development Best Practices
|
|
257
|
+
|
|
258
|
+
### Start Small
|
|
259
|
+
|
|
260
|
+
Begin with minimal SKILL.md, add complexity only as needed:
|
|
261
|
+
|
|
262
|
+
```markdown
|
|
263
|
+
# Version 1: Just core patterns
|
|
264
|
+
|
|
265
|
+
# Version 2: Add references
|
|
266
|
+
|
|
267
|
+
# Version 3: Add scripts
|
|
268
|
+
|
|
269
|
+
# Version 4: Add assets
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Test Early and Often
|
|
273
|
+
|
|
274
|
+
Don't wait until skill is "complete":
|
|
275
|
+
|
|
276
|
+
- Test after basic SKILL.md is written
|
|
277
|
+
- Iterate based on actual usage
|
|
278
|
+
- Skills are never truly "done"
|
|
279
|
+
|
|
280
|
+
### Use Real Examples
|
|
281
|
+
|
|
282
|
+
Pull examples from actual code, not invented scenarios:
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
// ✅ Good: From your actual codebase
|
|
286
|
+
const stmt = db.prepare('SELECT * FROM contacts WHERE user_id = ?');
|
|
287
|
+
const contacts = stmt.all(user_id) as Contact[];
|
|
288
|
+
|
|
289
|
+
// ❌ Bad: Generic example
|
|
290
|
+
const result = database.query('SELECT * FROM table');
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Keep SKILL.md Lean
|
|
294
|
+
|
|
295
|
+
When it grows beyond 5k words, split content:
|
|
296
|
+
|
|
297
|
+
- Core workflows → stay in SKILL.md
|
|
298
|
+
- Detailed docs → move to references/
|
|
299
|
+
- API reference → definitely references/
|
|
300
|
+
|
|
301
|
+
### Write for Claude, Not Humans
|
|
302
|
+
|
|
303
|
+
Claude needs different information than developers:
|
|
304
|
+
|
|
305
|
+
- ✅ Procedural: "To do X, follow these steps..."
|
|
306
|
+
- ✅ Specific: "Use nanoid() to generate IDs"
|
|
307
|
+
- ✅ Concrete: "Store timestamps as Date.now()"
|
|
308
|
+
- ❌ Conceptual: "Think about data integrity..."
|
|
309
|
+
- ❌ Opinion: "We prefer approach X over Y..."
|
|
310
|
+
|
|
311
|
+
### Document Your Intent
|
|
312
|
+
|
|
313
|
+
Add comments explaining WHY, not just WHAT:
|
|
314
|
+
|
|
315
|
+
```markdown
|
|
316
|
+
## ID Generation
|
|
317
|
+
|
|
318
|
+
Generate IDs with nanoid() to ensure uniqueness without database overhead.
|
|
319
|
+
|
|
320
|
+
<!-- Not just: "Use nanoid()" -->
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Validate Before Sharing
|
|
324
|
+
|
|
325
|
+
Always run validation:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
python .claude/scripts/validate_skill.py .claude/skills/my-skill --strict
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
Strict mode treats warnings as errors - use before packaging for distribution.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Troubleshooting
|
|
336
|
+
|
|
337
|
+
### Skill Not Triggering
|
|
338
|
+
|
|
339
|
+
**Problem**: Claude doesn't use the skill when expected
|
|
340
|
+
|
|
341
|
+
**Solutions**:
|
|
342
|
+
|
|
343
|
+
1. Check description includes "when to use" keywords
|
|
344
|
+
2. Make description more specific
|
|
345
|
+
3. Test with explicit request: "Use the database-patterns skill to..."
|
|
346
|
+
4. Verify SKILL.md frontmatter is valid YAML
|
|
347
|
+
|
|
348
|
+
### Token Limit Exceeded
|
|
349
|
+
|
|
350
|
+
**Problem**: Skill uses too many tokens
|
|
351
|
+
|
|
352
|
+
**Solutions**:
|
|
353
|
+
|
|
354
|
+
1. Move detailed content from SKILL.md to references/
|
|
355
|
+
2. Use scripts for code instead of inline examples
|
|
356
|
+
3. Split large references into focused files
|
|
357
|
+
4. Link to references instead of duplicating content
|
|
358
|
+
|
|
359
|
+
### Skill Conflicts
|
|
360
|
+
|
|
361
|
+
**Problem**: Multiple skills trying to handle same task
|
|
362
|
+
|
|
363
|
+
**Solutions**:
|
|
364
|
+
|
|
365
|
+
1. Make descriptions more specific
|
|
366
|
+
2. Define clear boundaries between skills
|
|
367
|
+
3. Use skill composition intentionally
|
|
368
|
+
4. Add "when NOT to use" guidance
|
|
369
|
+
|
|
370
|
+
### Invalid Package
|
|
371
|
+
|
|
372
|
+
**Problem**: Packaged skill doesn't work
|
|
373
|
+
|
|
374
|
+
**Solutions**:
|
|
375
|
+
|
|
376
|
+
1. Run validator before packaging
|
|
377
|
+
2. Check YAML frontmatter syntax
|
|
378
|
+
3. Ensure required fields present
|
|
379
|
+
4. Test skill locally before packaging
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## File Templates
|
|
384
|
+
|
|
385
|
+
### Minimal SKILL.md
|
|
386
|
+
|
|
387
|
+
```markdown
|
|
388
|
+
---
|
|
389
|
+
name: my-skill
|
|
390
|
+
description: Brief description including when to use this skill
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
# My Skill
|
|
394
|
+
|
|
395
|
+
## Quick Start
|
|
396
|
+
|
|
397
|
+
[Minimal working example]
|
|
398
|
+
|
|
399
|
+
## Core Pattern
|
|
400
|
+
|
|
401
|
+
[Most common usage]
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Reference File
|
|
405
|
+
|
|
406
|
+
```markdown
|
|
407
|
+
# Topic Reference
|
|
408
|
+
|
|
409
|
+
## Overview
|
|
410
|
+
|
|
411
|
+
[Brief intro]
|
|
412
|
+
|
|
413
|
+
## Section 1
|
|
414
|
+
|
|
415
|
+
[Detailed content]
|
|
416
|
+
|
|
417
|
+
## Section 2
|
|
418
|
+
|
|
419
|
+
[More detail]
|
|
420
|
+
|
|
421
|
+
## Examples
|
|
422
|
+
|
|
423
|
+
[Concrete examples]
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Script File
|
|
427
|
+
|
|
428
|
+
```python
|
|
429
|
+
#!/usr/bin/env python3
|
|
430
|
+
"""
|
|
431
|
+
Description of what this script does.
|
|
432
|
+
|
|
433
|
+
Usage:
|
|
434
|
+
python script_name.py [arguments]
|
|
435
|
+
|
|
436
|
+
Example:
|
|
437
|
+
python validate.py --check-all
|
|
438
|
+
"""
|
|
439
|
+
|
|
440
|
+
import sys
|
|
441
|
+
|
|
442
|
+
def main():
|
|
443
|
+
# Script logic here
|
|
444
|
+
pass
|
|
445
|
+
|
|
446
|
+
if __name__ == "__main__":
|
|
447
|
+
main()
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## Next Steps
|
|
453
|
+
|
|
454
|
+
1. Read [SKILLS-ARCHITECTURE.md](SKILLS-ARCHITECTURE.md) for system overview
|
|
455
|
+
2. See [SKILL-EXAMPLES.md](SKILL-EXAMPLES.md) for real examples
|
|
456
|
+
3. Create your first skill with `python .claude/scripts/init_skill.py`
|
|
457
|
+
4. Join skill development workflow for devhub-crm
|