claude-skills-cli 0.0.3 → 0.0.5
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 +59 -226
- package/dist/commands/init.js +29 -20
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.js +69 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/package.js +5 -9
- 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/commands/validate.js +1 -1
- package/dist/commands/validate.js.map +1 -1
- package/dist/core/templates.js +63 -12
- package/dist/core/templates.js.map +1 -1
- package/dist/core/validator.js +31 -10
- package/dist/core/validator.js.map +1 -1
- package/dist/index.js +28 -4
- package/dist/index.js.map +1 -1
- package/dist/skills/skill-creator/SKILL.md +143 -0
- package/dist/skills/skill-creator/references/anthropic-resources.md +504 -0
- package/dist/skills/skill-creator/references/cli-reference.md +507 -0
- package/dist/skills/skill-creator/references/skill-examples.md +413 -0
- package/{skills → dist/skills}/skill-creator/references/writing-guide.md +156 -131
- package/dist/skills/skill-creator/skill-creator/SKILL.md +143 -0
- package/dist/skills/skill-creator/skill-creator/references/anthropic-resources.md +504 -0
- package/dist/skills/skill-creator/skill-creator/references/cli-reference.md +507 -0
- package/dist/skills/skill-creator/skill-creator/references/skill-examples.md +413 -0
- package/dist/skills/skill-creator/skill-creator/references/writing-guide.md +619 -0
- package/dist/utils/fs.js +2 -2
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/output.js +2 -1
- package/dist/utils/output.js.map +1 -1
- package/docs/SKILL-DEVELOPMENT.md +38 -35
- package/docs/SKILL-EXAMPLES.md +73 -63
- package/docs/SKILLS-ARCHITECTURE.md +42 -41
- package/package.json +2 -2
- package/skills/skill-creator/SKILL.md +0 -345
- package/skills/skill-creator/references/skill-examples.md +0 -403
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
# Skill Examples with claude-skills-cli
|
|
2
|
+
|
|
3
|
+
Real examples showing effective skill patterns using TypeScript/Node.
|
|
4
|
+
|
|
5
|
+
## Example 1: API Client Skill
|
|
6
|
+
|
|
7
|
+
### Use Case
|
|
8
|
+
|
|
9
|
+
Repeatedly making authenticated API requests with TypeScript types and
|
|
10
|
+
error handling.
|
|
11
|
+
|
|
12
|
+
### Structure
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
api-client/
|
|
16
|
+
├── SKILL.md # Core request patterns
|
|
17
|
+
├── references/
|
|
18
|
+
│ ├── endpoints.md # Complete API endpoint reference
|
|
19
|
+
│ ├── authentication.md # Auth patterns and token management
|
|
20
|
+
│ └── error-handling.md # Error codes and retry strategies
|
|
21
|
+
└── scripts/
|
|
22
|
+
├── validate-token.js # Check token validity
|
|
23
|
+
└── test-endpoints.js # Verify endpoint availability
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### SKILL.md Excerpt
|
|
27
|
+
|
|
28
|
+
````markdown
|
|
29
|
+
---
|
|
30
|
+
name: api-client
|
|
31
|
+
description:
|
|
32
|
+
REST API client with TypeScript types for user and data endpoints.
|
|
33
|
+
Use when making HTTP requests, handling authentication, managing API
|
|
34
|
+
errors, or working with async operations.
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# API Client
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { apiClient } from './lib/api';
|
|
43
|
+
|
|
44
|
+
// GET single resource with type safety
|
|
45
|
+
const user = await apiClient.get<User>(`/users/${id}`);
|
|
46
|
+
```
|
|
47
|
+
````
|
|
48
|
+
|
|
49
|
+
For complete endpoint docs:
|
|
50
|
+
[references/endpoints.md](references/endpoints.md)
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Why It Works
|
|
55
|
+
- ✅ Description includes operation keywords for matching
|
|
56
|
+
- ✅ Quick Start shows most common pattern with types
|
|
57
|
+
- ✅ Complete API docs in references (not inline)
|
|
58
|
+
- ✅ Scripts validate connectivity and tokens
|
|
59
|
+
- ✅ Keyword-rich: "HTTP requests", "authentication", "async operations"
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Example 2: React Component Patterns
|
|
64
|
+
|
|
65
|
+
### Use Case
|
|
66
|
+
Creating type-safe React components with hooks and TypeScript interfaces.
|
|
67
|
+
|
|
68
|
+
### Structure
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
react-patterns/ ├── SKILL.md # Core patterns and conventions ├──
|
|
72
|
+
references/ │ ├── component-library.md # Catalog of existing
|
|
73
|
+
components │ ├── hooks-patterns.md # Custom hooks and state management
|
|
74
|
+
│ └── routing-patterns.md # React Router conventions └── assets/ └──
|
|
75
|
+
component-templates/ ├── basic-component.tsx ├── form-component.tsx
|
|
76
|
+
└── list-component.tsx
|
|
77
|
+
|
|
78
|
+
````
|
|
79
|
+
|
|
80
|
+
### SKILL.md Excerpt
|
|
81
|
+
```markdown
|
|
82
|
+
---
|
|
83
|
+
name: react-patterns
|
|
84
|
+
description: Create type-safe React components with hooks, TypeScript interfaces, and functional patterns. Use when building UI components, implementing forms, or managing component state with hooks.
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
# React Patterns
|
|
88
|
+
|
|
89
|
+
## Component Template
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
interface CardProps {
|
|
93
|
+
title: string;
|
|
94
|
+
items: Array<{ id: string; label: string }>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function Card({ title, items }: CardProps) {
|
|
98
|
+
return (
|
|
99
|
+
<div className="card">
|
|
100
|
+
<h2>{title}</h2>
|
|
101
|
+
<ul>
|
|
102
|
+
{items.map(item => (
|
|
103
|
+
<li key={item.id}>{item.label}</li>
|
|
104
|
+
))}
|
|
105
|
+
</ul>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
````
|
|
110
|
+
|
|
111
|
+
For complete component library:
|
|
112
|
+
[references/component-library.md](references/component-library.md)
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Why It Works
|
|
117
|
+
- ✅ Shows TypeScript-first React patterns
|
|
118
|
+
- ✅ Type-safe props interfaces
|
|
119
|
+
- ✅ Component catalog in references
|
|
120
|
+
- ✅ Templates in assets for copying
|
|
121
|
+
- ✅ Keywords: "hooks", "TypeScript interfaces", "component state"
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Example 3: GitHub Integration
|
|
126
|
+
|
|
127
|
+
### Use Case
|
|
128
|
+
Implementing GitHub OAuth, fetching profiles, managing connections.
|
|
129
|
+
|
|
130
|
+
### Structure
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
github-integration/ ├── SKILL.md # Auth patterns, common operations
|
|
134
|
+
├── references/ │ ├── api-endpoints.md # GitHub API reference │ └──
|
|
135
|
+
oauth-flow.md # Complete OAuth implementation └── scripts/ ├──
|
|
136
|
+
test_connection.js # Validate GitHub credentials └──
|
|
137
|
+
check_rate_limit.js # Monitor API usage
|
|
138
|
+
|
|
139
|
+
````
|
|
140
|
+
|
|
141
|
+
### SKILL.md Excerpt
|
|
142
|
+
```markdown
|
|
143
|
+
---
|
|
144
|
+
name: github-integration
|
|
145
|
+
description: GitHub API integration with better-auth OAuth for fetching user profiles, repositories, and connections. Use when implementing GitHub features, OAuth flows, or working with GitHub data in contacts.
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
# GitHub Integration
|
|
149
|
+
|
|
150
|
+
## Authentication
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import { GITHUB_TOKEN } from '$env/static/private';
|
|
154
|
+
|
|
155
|
+
const response = await fetch('https://api.github.com/user', {
|
|
156
|
+
headers: {
|
|
157
|
+
'Authorization': `Bearer ${GITHUB_TOKEN}`,
|
|
158
|
+
'Accept': 'application/vnd.github.v3+json',
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
````
|
|
162
|
+
|
|
163
|
+
Check rate limits: `node scripts/check_rate_limit.js`
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Why It Works
|
|
168
|
+
- ✅ Auth pattern shown immediately
|
|
169
|
+
- ✅ Operational scripts (rate limit check)
|
|
170
|
+
- ✅ Complete OAuth flow in references
|
|
171
|
+
- ✅ Practical utilities included
|
|
172
|
+
- ✅ Keywords: "OAuth, GitHub data, contacts"
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Example 4: DaisyUI Conventions
|
|
177
|
+
|
|
178
|
+
### Use Case
|
|
179
|
+
Consistent component styling, theme usage, form patterns.
|
|
180
|
+
|
|
181
|
+
### Structure
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
daisyui-conventions/ ├── SKILL.md # Core components and patterns ├──
|
|
185
|
+
references/ │ ├── component-reference.md # All DaisyUI components │
|
|
186
|
+
└── theme-tokens.md # Color system and usage └── assets/ └──
|
|
187
|
+
theme-preview.html # Visual reference
|
|
188
|
+
|
|
189
|
+
````
|
|
190
|
+
|
|
191
|
+
### SKILL.md Excerpt
|
|
192
|
+
```markdown
|
|
193
|
+
---
|
|
194
|
+
name: daisyui-conventions
|
|
195
|
+
description: DaisyUI v5 component styling for cards, forms, buttons, and layouts with theme color tokens. Use when styling components, implementing forms, or applying consistent visual design.
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
# DaisyUI Conventions
|
|
199
|
+
|
|
200
|
+
## Card Pattern
|
|
201
|
+
|
|
202
|
+
```svelte
|
|
203
|
+
<div class="card bg-base-100 shadow-md">
|
|
204
|
+
<div class="card-body">
|
|
205
|
+
<h2 class="card-title">Title</h2>
|
|
206
|
+
<p>Content</p>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
````
|
|
210
|
+
|
|
211
|
+
For all components:
|
|
212
|
+
[references/component-reference.md](references/component-reference.md)
|
|
213
|
+
|
|
214
|
+
````
|
|
215
|
+
|
|
216
|
+
### Why It Works
|
|
217
|
+
- ✅ Shows actual DaisyUI classes used in project
|
|
218
|
+
- ✅ Theme tokens documented
|
|
219
|
+
- ✅ Visual reference for colors (assets/)
|
|
220
|
+
- ✅ Form patterns included
|
|
221
|
+
- ✅ Keywords: "cards, forms, buttons, layouts"
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Pattern: Description Keywords
|
|
226
|
+
|
|
227
|
+
Good descriptions include:
|
|
228
|
+
- **Technology names**: "TypeScript", "REST API", "React", "Node.js"
|
|
229
|
+
- **Operations**: "HTTP requests", "OAuth flow", "async/await"
|
|
230
|
+
- **Data types**: "users, posts, comments", "API responses"
|
|
231
|
+
- **Triggers**: "Use when...", "Use for...", "Use to..."
|
|
232
|
+
|
|
233
|
+
### Before (Vague)
|
|
234
|
+
```yaml
|
|
235
|
+
description: Helps with API stuff
|
|
236
|
+
````
|
|
237
|
+
|
|
238
|
+
### After (Specific)
|
|
239
|
+
|
|
240
|
+
```yaml
|
|
241
|
+
description:
|
|
242
|
+
REST API client with TypeScript types for user and data endpoints.
|
|
243
|
+
Use when making HTTP requests, handling authentication, managing API
|
|
244
|
+
errors, or working with async operations.
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Pattern: Progressive Disclosure
|
|
250
|
+
|
|
251
|
+
### Level 1: Metadata (Always)
|
|
252
|
+
|
|
253
|
+
```yaml
|
|
254
|
+
name: api-client
|
|
255
|
+
description: [50-100 words with keywords]
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Token cost**: ~100 tokens
|
|
259
|
+
|
|
260
|
+
### Level 2: SKILL.md Body (When Triggered)
|
|
261
|
+
|
|
262
|
+
- Quick Start example
|
|
263
|
+
- 3-5 core patterns
|
|
264
|
+
- Links to references
|
|
265
|
+
- Script descriptions
|
|
266
|
+
|
|
267
|
+
**Token cost**: ~3-5k tokens
|
|
268
|
+
|
|
269
|
+
### Level 3: Resources (As Needed)
|
|
270
|
+
|
|
271
|
+
- references/endpoints.md (complete API docs)
|
|
272
|
+
- references/examples.md (20+ examples)
|
|
273
|
+
- scripts/validate-token.js (runs without loading)
|
|
274
|
+
|
|
275
|
+
**Token cost**: Only what's accessed
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Pattern: Scripts for Efficiency
|
|
280
|
+
|
|
281
|
+
### Without Script
|
|
282
|
+
|
|
283
|
+
```markdown
|
|
284
|
+
Claude generates validation code every time: "Check that all
|
|
285
|
+
timestamps are valid..." [Claude writes 50 lines of JavaScript]
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Cost**: ~500 tokens each time
|
|
289
|
+
|
|
290
|
+
### With Script
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
node scripts/validate_timestamps.js
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**Cost**: ~50 tokens (just output)
|
|
297
|
+
|
|
298
|
+
### Script Types
|
|
299
|
+
|
|
300
|
+
- **Validation**: Check data consistency
|
|
301
|
+
- **Generation**: Create boilerplate
|
|
302
|
+
- **Analysis**: Parse and report
|
|
303
|
+
- **Testing**: Verify configuration
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Pattern: Assets for Templates
|
|
308
|
+
|
|
309
|
+
### Without Assets
|
|
310
|
+
|
|
311
|
+
```markdown
|
|
312
|
+
"Create a basic Svelte component..." [Claude writes boilerplate each
|
|
313
|
+
time]
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### With Assets
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
cp assets/component-templates/basic-component.svelte \
|
|
320
|
+
src/lib/components/new-component.svelte
|
|
321
|
+
# Modify as needed
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Asset Types
|
|
325
|
+
|
|
326
|
+
- Component templates (.svelte)
|
|
327
|
+
- SQL schemas (.sql)
|
|
328
|
+
- Configuration files (.json)
|
|
329
|
+
- Images and logos (.png, .svg)
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Anti-Patterns to Avoid
|
|
334
|
+
|
|
335
|
+
### ❌ Generic Description
|
|
336
|
+
|
|
337
|
+
```yaml
|
|
338
|
+
description: Database helper tool
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Fix**: Include table names, operations, when to use
|
|
342
|
+
|
|
343
|
+
### ❌ Everything Inline
|
|
344
|
+
|
|
345
|
+
```markdown
|
|
346
|
+
# Database Skill
|
|
347
|
+
|
|
348
|
+
## Complete Schema (1000 lines)
|
|
349
|
+
|
|
350
|
+
## All Queries (500 lines)
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**Fix**: Move to references/schema.md
|
|
354
|
+
|
|
355
|
+
### ❌ Second Person
|
|
356
|
+
|
|
357
|
+
```markdown
|
|
358
|
+
You should use prepared statements...
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Fix**: "Use prepared statements for all queries"
|
|
362
|
+
|
|
363
|
+
### ❌ Missing Keywords
|
|
364
|
+
|
|
365
|
+
```yaml
|
|
366
|
+
description: Helps with frontend stuff
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
**Fix**: "React components with hooks, TypeScript, forms"
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Skill Composition Example
|
|
374
|
+
|
|
375
|
+
**User Request**: "Create a user profile card with API data and
|
|
376
|
+
styling"
|
|
377
|
+
|
|
378
|
+
**Skills Activated**:
|
|
379
|
+
|
|
380
|
+
1. `api-client` - Fetch user data
|
|
381
|
+
2. `react-patterns` - Build component
|
|
382
|
+
3. `css-conventions` - Apply styling
|
|
383
|
+
4. `error-handling` - Handle fetch errors
|
|
384
|
+
|
|
385
|
+
**Result**: Skills work together naturally, each handling its domain.
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## Quick Checklist
|
|
390
|
+
|
|
391
|
+
Before considering a skill "done":
|
|
392
|
+
|
|
393
|
+
- [ ] Description includes keywords and "when to use"
|
|
394
|
+
- [ ] Quick Start shows most common pattern
|
|
395
|
+
- [ ] Core patterns (3-5) in SKILL.md
|
|
396
|
+
- [ ] Detailed docs in references/
|
|
397
|
+
- [ ] Scripts for repeated code
|
|
398
|
+
- [ ] Assets for templates
|
|
399
|
+
- [ ] Validated with `npx claude-skills validate`
|
|
400
|
+
- [ ] Tested in real conversations
|
|
401
|
+
- [ ] No TODO placeholders
|
|
402
|
+
- [ ] Imperative voice throughout
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Resources
|
|
407
|
+
|
|
408
|
+
- See main
|
|
409
|
+
[SKILLS-ARCHITECTURE.md](../../../docs/SKILLS-ARCHITECTURE.md) for
|
|
410
|
+
system design
|
|
411
|
+
- See [SKILL-EXAMPLES.md](../../../docs/SKILL-EXAMPLES.md) for
|
|
412
|
+
Anthropic examples
|
|
413
|
+
- See skill-creator SKILL.md for 6-step process
|