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