claude-skills-cli 0.0.6 → 0.0.8

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.
Files changed (42) hide show
  1. package/README.md +49 -9
  2. package/dist/commands/doctor.js +128 -0
  3. package/dist/commands/doctor.js.map +1 -0
  4. package/dist/commands/init.js +5 -3
  5. package/dist/commands/init.js.map +1 -1
  6. package/dist/commands/install.js +1 -1
  7. package/dist/commands/install.js.map +1 -1
  8. package/dist/commands/stats.js +1 -1
  9. package/dist/commands/stats.js.map +1 -1
  10. package/dist/commands/validate.js +24 -3
  11. package/dist/commands/validate.js.map +1 -1
  12. package/dist/commands/watch.js +82 -0
  13. package/dist/commands/watch.js.map +1 -0
  14. package/dist/core/templates.js +18 -0
  15. package/dist/core/templates.js.map +1 -1
  16. package/dist/core/validator.js +174 -321
  17. package/dist/core/validator.js.map +1 -1
  18. package/dist/index.js +38 -12
  19. package/dist/index.js.map +1 -1
  20. package/dist/skills/skill-creator/SKILL.md +28 -112
  21. package/dist/skills/skill-creator/references/cli-reference.md +152 -38
  22. package/dist/skills/skill-creator/references/development-process.md +208 -0
  23. package/dist/skills/skill-creator/references/skill-examples.md +1 -1
  24. package/dist/validators/alignment-validator.js +54 -0
  25. package/dist/validators/alignment-validator.js.map +1 -0
  26. package/dist/validators/content-validator.js +144 -0
  27. package/dist/validators/content-validator.js.map +1 -0
  28. package/dist/validators/description-validator.js +136 -0
  29. package/dist/validators/description-validator.js.map +1 -0
  30. package/dist/validators/file-structure-validator.js +125 -0
  31. package/dist/validators/file-structure-validator.js.map +1 -0
  32. package/dist/validators/frontmatter-validator.js +165 -0
  33. package/dist/validators/frontmatter-validator.js.map +1 -0
  34. package/dist/validators/references-validator.js +125 -0
  35. package/dist/validators/references-validator.js.map +1 -0
  36. package/dist/validators/text-analysis.js +71 -0
  37. package/dist/validators/text-analysis.js.map +1 -0
  38. package/docs/prompt-that-started-it-all.md +19 -0
  39. package/package.json +3 -3
  40. package/docs/SKILL-DEVELOPMENT.md +0 -460
  41. package/docs/SKILL-EXAMPLES.md +0 -528
  42. package/docs/SKILLS-ARCHITECTURE.md +0 -381
@@ -1,381 +0,0 @@
1
- # Claude Skills Architecture
2
-
3
- ## Overview
4
-
5
- Claude Skills are modular capabilities that extend Claude's
6
- functionality through a filesystem-based architecture. They provide
7
- specialized domain expertise, workflows, and tools that transform
8
- Claude from a general-purpose agent into a specialist.
9
-
10
- ## Core Concepts
11
-
12
- ### What is a Skill?
13
-
14
- A Skill is a directory containing:
15
-
16
- - **SKILL.md** (required): Instructions and metadata
17
- - **references/** (optional): Detailed documentation
18
- - **scripts/** (optional): Executable code
19
- - **assets/** (optional): Templates and resources
20
-
21
- ### Why Use Skills?
22
-
23
- **Problems Skills Solve:**
24
-
25
- - Repeating the same context across conversations
26
- - Claude forgetting project-specific patterns
27
- - Inconsistent handling of specialized workflows
28
- - Token-heavy prompts for domain expertise
29
-
30
- **Benefits:**
31
-
32
- - **Reusable**: Write once, use automatically
33
- - **Composable**: Multiple skills work together
34
- - **Efficient**: Progressive disclosure minimizes tokens
35
- - **Portable**: Same format across Claude.ai, Claude Code, and API
36
-
37
- ## Progressive Disclosure (The Secret Sauce)
38
-
39
- Skills use a three-level loading system to manage context efficiently:
40
-
41
- ### Level 1: Metadata (~100 tokens)
42
-
43
- **Always loaded in system prompt**
44
-
45
- ```yaml
46
- ---
47
- name: database-patterns
48
- description: Guide for SQLite database operations in devhub-crm...
49
- ---
50
- ```
51
-
52
- Claude sees this at startup and knows:
53
-
54
- - What the skill does
55
- - When to use it
56
- - How to trigger it
57
-
58
- **Token cost**: ~100 tokens per skill (metadata only) **When**: At
59
- agent startup, every conversation
60
-
61
- ### Level 2: Instructions (<5k tokens)
62
-
63
- **Loaded when skill is triggered**
64
-
65
- The markdown body of SKILL.md contains:
66
-
67
- - Core patterns and workflows
68
- - Quick reference examples
69
- - Links to references and scripts
70
-
71
- ```markdown
72
- # Database Patterns
73
-
74
- ## Core Principles
75
-
76
- - Use prepared statements for all queries
77
- - Generate IDs with nanoid() ...
78
-
79
- For complete schema, see [references/schema.md](references/schema.md)
80
- ```
81
-
82
- **Token cost**: ~3-5k tokens typically **When**: Only when Claude
83
- determines skill is relevant
84
-
85
- ### Level 3: Resources (unlimited)
86
-
87
- **Loaded as needed**
88
-
89
- - **references/**: Documentation Claude reads into context as needed
90
- - **scripts/**: Executable code Claude runs without loading into
91
- context
92
- - **assets/**: Files used in output (templates, images, fonts)
93
-
94
- ```bash
95
- # Claude can execute scripts without reading them
96
- node scripts/validate_schema.js
97
-
98
- # Or read references when needed
99
- cat references/detailed-schema.md
100
- ```
101
-
102
- **Token cost**:
103
-
104
- - Scripts: Only output consumes tokens (not code itself)
105
- - References: Only if explicitly read
106
- - Assets: Zero tokens (used directly in output)
107
-
108
- **When**: Only when referenced or needed
109
-
110
- ## How Claude Accesses Skills
111
-
112
- ### Discovery Phase
113
-
114
- 1. User makes a request
115
- 2. Claude scans all skill metadata (Level 1)
116
- 3. Determines which skills are relevant
117
- 4. Triggers appropriate skills
118
-
119
- ### Loading Phase
120
-
121
- 1. Claude reads `SKILL.md` via bash command
122
- 2. Instructions enter context window (Level 2)
123
- 3. Claude sees references to additional files
124
- 4. Decides what to load next
125
-
126
- ### Execution Phase
127
-
128
- 1. Claude follows instructions from SKILL.md
129
- 2. Reads reference files if needed (Level 3)
130
- 3. Executes scripts via bash (Level 3)
131
- 4. Uses assets in final output (Level 3)
132
-
133
- ## Skill Structure
134
-
135
- ### Minimal Skill
136
-
137
- ```
138
- my-skill/
139
- └── SKILL.md
140
- ```
141
-
142
- ### Complete Skill
143
-
144
- ```
145
- my-skill/
146
- ├── SKILL.md # Main instructions
147
- ├── README.md # Human documentation
148
- ├── references/ # Detailed docs
149
- │ ├── api-reference.md
150
- │ ├── examples.md
151
- │ └── troubleshooting.md
152
- ├── scripts/ # Executable code
153
- │ ├── validate.js
154
- │ ├── generate.js
155
- │ └── test.sh
156
- └── assets/ # Templates & resources
157
- ├── template.sql
158
- ├── schema-diagram.png
159
- └── boilerplate/
160
- ```
161
-
162
- ## SKILL.md Format
163
-
164
- ### Required Structure
165
-
166
- ```markdown
167
- ---
168
- name: skill-name
169
- description: What this skill does and when to use it...
170
- ---
171
-
172
- # Skill Title
173
-
174
- [Instructions in markdown...]
175
- ```
176
-
177
- ### Frontmatter Fields
178
-
179
- **Required:**
180
-
181
- - `name`: Lowercase kebab-case, matches directory name (max 64 chars)
182
- - `description`: What and when to use (max 1024 chars)
183
-
184
- **Optional:**
185
-
186
- - `license`: License name or file reference
187
- - `allowed-tools`: Pre-approved tools (Claude Code only)
188
- - `metadata`: Custom key-value pairs
189
-
190
- ### Body Content
191
-
192
- **Best Practices:**
193
-
194
- - Use imperative voice ("Use X" not "You should use X")
195
- - Provide concrete examples
196
- - Link to references for details
197
- - Keep under 5k words
198
- - Include "when to use" guidance
199
-
200
- **Anti-Patterns:**
201
-
202
- - ❌ Using second person ("you")
203
- - ❌ Duplicating reference content
204
- - ❌ Including entire API docs inline
205
- - ❌ Generic advice without specifics
206
-
207
- ## References Directory
208
-
209
- ### Purpose
210
-
211
- Detailed documentation loaded only when needed by Claude.
212
-
213
- ### When to Use References
214
-
215
- - Database schemas
216
- - API documentation
217
- - Detailed workflows
218
- - Large example collections
219
- - Troubleshooting guides
220
-
221
- ### Naming Convention
222
-
223
- - Use descriptive names: `authentication-flow.md` not `auth.md`
224
- - Group related content: `api-users.md`, `api-repos.md`
225
- - Include search keywords if files are large (>10k words)
226
-
227
- ### Example
228
-
229
- ```markdown
230
- # In SKILL.md
231
-
232
- For complete database schema with all relationships, see
233
- [references/schema.md](references/schema.md).
234
-
235
- # Claude can then:
236
-
237
- cat references/schema.md # Load when needed
238
- ```
239
-
240
- ## Scripts Directory
241
-
242
- ### Purpose
243
-
244
- Executable code for deterministic operations that don't need token
245
- generation.
246
-
247
- ### When to Use Scripts
248
-
249
- - Validation (check data consistency)
250
- - Generation (create boilerplate)
251
- - Analysis (parse files)
252
- - Testing (verify setup)
253
-
254
- ### Why Scripts Are Efficient
255
-
256
- ```javascript
257
- // Option 1: Claude generates code every time (expensive)
258
- "Claude, write JavaScript to validate these timestamps..."
259
- // Result: ~500 tokens each time
260
-
261
- // Option 2: Claude runs existing script (cheap)
262
- node scripts/validate_timestamps.js
263
- // Result: ~50 tokens (just the output)
264
- ```
265
-
266
- ### Best Practices
267
-
268
- - Include shebang (`#!/usr/bin/env node`)
269
- - Make executable (`chmod +x`)
270
- - Add JSDoc comments with usage
271
- - Handle errors gracefully
272
- - Return meaningful output
273
-
274
- ## Assets Directory
275
-
276
- ### Purpose
277
-
278
- Files used in output, not loaded into context.
279
-
280
- ### Common Assets
281
-
282
- - Templates (HTML, React, SQL)
283
- - Images (logos, icons, diagrams)
284
- - Fonts (typography files)
285
- - Boilerplate (starter projects)
286
-
287
- ### Usage Pattern
288
-
289
- ```bash
290
- # Claude copies/modifies assets without reading into context
291
- cp assets/template.html output/index.html
292
- # Modify the template as needed
293
- ```
294
-
295
- ## Token Economics
296
-
297
- ### Example: Database Skill
298
-
299
- **Without Skill:**
300
-
301
- ```
302
- User prompt: ~500 tokens (repeated every conversation)
303
- Schema context: ~2000 tokens
304
- Example queries: ~1000 tokens
305
- Total: ~3500 tokens per conversation
306
- ```
307
-
308
- **With Skill:**
309
-
310
- ```
311
- Metadata (always): ~100 tokens
312
- SKILL.md (when triggered): ~3000 tokens
313
- Schema reference (if needed): ~2000 tokens
314
- Total: 100 tokens normally, 3100-5100 when used
315
- ```
316
-
317
- **Savings**: Skill metadata is loaded once. Without skill, you pay
318
- ~3500 tokens every conversation even if not needed.
319
-
320
- ## Skill Composition
321
-
322
- Multiple skills can work together automatically:
323
-
324
- ```
325
- User: "Create a dashboard showing GitHub contacts with database stats"
326
-
327
- Claude activates:
328
- 1. database-patterns (query contacts)
329
- 2. github-integration (fetch GitHub data)
330
- 3. daisyui-conventions (style dashboard)
331
- 4. sveltekit-patterns (build component)
332
-
333
- Each skill loads independently, shares context naturally.
334
- ```
335
-
336
- ## Where Skills Work
337
-
338
- ### Claude Code (Local)
339
-
340
- - Location: `~/.claude/skills/` or `.claude/skills/`
341
- - Format: Directory with SKILL.md
342
- - Installation: Copy folder or use plugin marketplace
343
- - Scope: Personal or project-specific
344
-
345
- ### Claude.ai (Web)
346
-
347
- - Location: Upload via Settings > Features > Skills
348
- - Format: Zip file containing skill directory
349
- - Installation: Manual upload
350
- - Scope: Individual user only
351
-
352
- ### Claude API (Programmatic)
353
-
354
- - Location: Upload via `/v1/skills` endpoint
355
- - Format: Zip file or directory
356
- - Installation: API call with skill package
357
- - Scope: Organization-wide
358
-
359
- ## Best Practices Summary
360
-
361
- ### Do:
362
-
363
- ✅ Keep SKILL.md concise and actionable ✅ Use imperative voice for
364
- instructions ✅ Provide concrete examples ✅ Link to references for
365
- details ✅ Include "when to use" in description ✅ Use scripts for
366
- deterministic operations ✅ Group related content in references ✅
367
- Test skills on real tasks
368
-
369
- ### Don't:
370
-
371
- ❌ Duplicate content between SKILL.md and references ❌ Use second
372
- person ("you") ❌ Include entire documentation inline ❌ Forget to
373
- specify when to use skill ❌ Make descriptions too generic ❌ Leave
374
- TODO placeholders ❌ Skip validation before packaging
375
-
376
- ## Next Steps
377
-
378
- - Read [SKILL-DEVELOPMENT.md](SKILL-DEVELOPMENT.md) for creation
379
- workflow
380
- - See [SKILL-EXAMPLES.md](SKILL-EXAMPLES.md) for real-world examples
381
- - Use `claude-skills init` to create your first skill