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
|
@@ -1,103 +1,111 @@
|
|
|
1
|
-
# Skill Examples
|
|
1
|
+
# Skill Examples with claude-skills-cli
|
|
2
2
|
|
|
3
|
-
Real examples showing effective skill patterns
|
|
3
|
+
Real examples showing effective skill patterns using TypeScript/Node.
|
|
4
4
|
|
|
5
|
-
## Example 1:
|
|
5
|
+
## Example 1: API Client Skill
|
|
6
6
|
|
|
7
7
|
### Use Case
|
|
8
8
|
|
|
9
|
-
Repeatedly
|
|
9
|
+
Repeatedly making authenticated API requests with TypeScript types and error handling.
|
|
10
10
|
|
|
11
11
|
### Structure
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
|
|
15
|
-
├── SKILL.md # Core
|
|
14
|
+
api-client/
|
|
15
|
+
├── SKILL.md # Core request patterns
|
|
16
16
|
├── references/
|
|
17
|
-
│ ├──
|
|
18
|
-
│ ├──
|
|
19
|
-
│ └──
|
|
17
|
+
│ ├── endpoints.md # Complete API endpoint reference
|
|
18
|
+
│ ├── authentication.md # Auth patterns and token management
|
|
19
|
+
│ └── error-handling.md # Error codes and retry strategies
|
|
20
20
|
└── scripts/
|
|
21
|
-
├──
|
|
22
|
-
└──
|
|
21
|
+
├── validate-token.js # Check token validity
|
|
22
|
+
└── test-endpoints.js # Verify endpoint availability
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### SKILL.md Excerpt
|
|
26
26
|
|
|
27
27
|
````markdown
|
|
28
28
|
---
|
|
29
|
-
name:
|
|
30
|
-
description:
|
|
29
|
+
name: api-client
|
|
30
|
+
description: REST API client with TypeScript types for user and data endpoints. Use when making HTTP requests, handling authentication, managing API errors, or working with async operations.
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# API Client
|
|
34
34
|
|
|
35
35
|
## Quick Start
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
|
-
import {
|
|
38
|
+
import { apiClient } from './lib/api';
|
|
39
39
|
|
|
40
|
-
//
|
|
41
|
-
const
|
|
42
|
-
const contact = stmt.get(id, user_id) as Contact | undefined;
|
|
40
|
+
// GET single resource with type safety
|
|
41
|
+
const user = await apiClient.get<User>(`/users/${id}`);
|
|
43
42
|
```
|
|
44
43
|
````
|
|
45
44
|
|
|
46
|
-
For complete
|
|
45
|
+
For complete endpoint docs: [references/endpoints.md](references/endpoints.md)
|
|
47
46
|
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
### Why It Works
|
|
51
|
-
- ✅ Description includes
|
|
52
|
-
- ✅ Quick Start shows most common pattern
|
|
53
|
-
- ✅ Complete
|
|
54
|
-
- ✅ Scripts validate
|
|
55
|
-
- ✅ Keyword-rich: "
|
|
50
|
+
- ✅ Description includes operation keywords for matching
|
|
51
|
+
- ✅ Quick Start shows most common pattern with types
|
|
52
|
+
- ✅ Complete API docs in references (not inline)
|
|
53
|
+
- ✅ Scripts validate connectivity and tokens
|
|
54
|
+
- ✅ Keyword-rich: "HTTP requests", "authentication", "async operations"
|
|
56
55
|
|
|
57
56
|
---
|
|
58
57
|
|
|
59
|
-
## Example 2:
|
|
58
|
+
## Example 2: React Component Patterns
|
|
60
59
|
|
|
61
60
|
### Use Case
|
|
62
|
-
Creating type-safe
|
|
61
|
+
Creating type-safe React components with hooks and TypeScript interfaces.
|
|
63
62
|
|
|
64
63
|
### Structure
|
|
65
64
|
```
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
react-patterns/
|
|
68
67
|
├── SKILL.md # Core patterns and conventions
|
|
69
68
|
├── references/
|
|
70
69
|
│ ├── component-library.md # Catalog of existing components
|
|
71
|
-
│ ├──
|
|
72
|
-
│ └── routing-
|
|
70
|
+
│ ├── hooks-patterns.md # Custom hooks and state management
|
|
71
|
+
│ └── routing-patterns.md # React Router conventions
|
|
73
72
|
└── assets/
|
|
74
73
|
└── component-templates/
|
|
75
|
-
├── basic-component.
|
|
76
|
-
├── form-component.
|
|
77
|
-
└── list-component.
|
|
74
|
+
├── basic-component.tsx
|
|
75
|
+
├── form-component.tsx
|
|
76
|
+
└── list-component.tsx
|
|
78
77
|
|
|
79
78
|
````
|
|
80
79
|
|
|
81
80
|
### SKILL.md Excerpt
|
|
82
81
|
```markdown
|
|
83
82
|
---
|
|
84
|
-
name:
|
|
85
|
-
description: Create type-safe
|
|
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.
|
|
86
85
|
---
|
|
87
86
|
|
|
88
|
-
#
|
|
87
|
+
# React Patterns
|
|
89
88
|
|
|
90
89
|
## Component Template
|
|
91
90
|
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
+
}
|
|
101
109
|
````
|
|
102
110
|
|
|
103
111
|
For complete component library: [references/component-library.md](references/component-library.md)
|
|
@@ -105,11 +113,11 @@ For complete component library: [references/component-library.md](references/com
|
|
|
105
113
|
```
|
|
106
114
|
|
|
107
115
|
### Why It Works
|
|
108
|
-
- ✅ Shows
|
|
109
|
-
- ✅ Type-safe
|
|
116
|
+
- ✅ Shows TypeScript-first React patterns
|
|
117
|
+
- ✅ Type-safe props interfaces
|
|
110
118
|
- ✅ Component catalog in references
|
|
111
119
|
- ✅ Templates in assets for copying
|
|
112
|
-
- ✅ Keywords: "
|
|
120
|
+
- ✅ Keywords: "hooks", "TypeScript interfaces", "component state"
|
|
113
121
|
|
|
114
122
|
---
|
|
115
123
|
|
|
@@ -127,8 +135,8 @@ github-integration/
|
|
|
127
135
|
│ ├── api-endpoints.md # GitHub API reference
|
|
128
136
|
│ └── oauth-flow.md # Complete OAuth implementation
|
|
129
137
|
└── scripts/
|
|
130
|
-
├── test_connection.
|
|
131
|
-
└── check_rate_limit.
|
|
138
|
+
├── test_connection.js # Validate GitHub credentials
|
|
139
|
+
└── check_rate_limit.js # Monitor API usage
|
|
132
140
|
|
|
133
141
|
````
|
|
134
142
|
|
|
@@ -154,7 +162,7 @@ const response = await fetch('https://api.github.com/user', {
|
|
|
154
162
|
});
|
|
155
163
|
````
|
|
156
164
|
|
|
157
|
-
Check rate limits: `
|
|
165
|
+
Check rate limits: `node scripts/check_rate_limit.js`
|
|
158
166
|
|
|
159
167
|
```
|
|
160
168
|
|
|
@@ -221,20 +229,20 @@ For all components: [references/component-reference.md](references/component-ref
|
|
|
221
229
|
## Pattern: Description Keywords
|
|
222
230
|
|
|
223
231
|
Good descriptions include:
|
|
224
|
-
- **Technology names**: "
|
|
225
|
-
- **Operations**: "
|
|
226
|
-
- **Data types**: "
|
|
227
|
-
- **Triggers**: "Use when...", "
|
|
232
|
+
- **Technology names**: "TypeScript", "REST API", "React", "Node.js"
|
|
233
|
+
- **Operations**: "HTTP requests", "OAuth flow", "async/await"
|
|
234
|
+
- **Data types**: "users, posts, comments", "API responses"
|
|
235
|
+
- **Triggers**: "Use when...", "Use for...", "Use to..."
|
|
228
236
|
|
|
229
237
|
### Before (Vague)
|
|
230
238
|
```yaml
|
|
231
|
-
description: Helps with
|
|
239
|
+
description: Helps with API stuff
|
|
232
240
|
````
|
|
233
241
|
|
|
234
242
|
### After (Specific)
|
|
235
243
|
|
|
236
244
|
```yaml
|
|
237
|
-
description:
|
|
245
|
+
description: REST API client with TypeScript types for user and data endpoints. Use when making HTTP requests, handling authentication, managing API errors, or working with async operations.
|
|
238
246
|
```
|
|
239
247
|
|
|
240
248
|
---
|
|
@@ -244,7 +252,7 @@ description: SQLite database operations using better-sqlite3 for contacts, compa
|
|
|
244
252
|
### Level 1: Metadata (Always)
|
|
245
253
|
|
|
246
254
|
```yaml
|
|
247
|
-
name:
|
|
255
|
+
name: api-client
|
|
248
256
|
description: [50-100 words with keywords]
|
|
249
257
|
```
|
|
250
258
|
|
|
@@ -261,9 +269,9 @@ description: [50-100 words with keywords]
|
|
|
261
269
|
|
|
262
270
|
### Level 3: Resources (As Needed)
|
|
263
271
|
|
|
264
|
-
- references/
|
|
265
|
-
- references/
|
|
266
|
-
- scripts/validate.
|
|
272
|
+
- references/endpoints.md (complete API docs)
|
|
273
|
+
- references/examples.md (20+ examples)
|
|
274
|
+
- scripts/validate-token.js (runs without loading)
|
|
267
275
|
|
|
268
276
|
**Token cost**: Only what's accessed
|
|
269
277
|
|
|
@@ -276,7 +284,7 @@ description: [50-100 words with keywords]
|
|
|
276
284
|
```markdown
|
|
277
285
|
Claude generates validation code every time:
|
|
278
286
|
"Check that all timestamps are valid..."
|
|
279
|
-
[Claude writes 50 lines of
|
|
287
|
+
[Claude writes 50 lines of JavaScript]
|
|
280
288
|
```
|
|
281
289
|
|
|
282
290
|
**Cost**: ~500 tokens each time
|
|
@@ -284,7 +292,7 @@ Claude generates validation code every time:
|
|
|
284
292
|
### With Script
|
|
285
293
|
|
|
286
294
|
```bash
|
|
287
|
-
|
|
295
|
+
node scripts/validate_timestamps.js
|
|
288
296
|
```
|
|
289
297
|
|
|
290
298
|
**Cost**: ~50 tokens (just output)
|
|
@@ -360,20 +368,20 @@ You should use prepared statements...
|
|
|
360
368
|
description: Helps with frontend stuff
|
|
361
369
|
```
|
|
362
370
|
|
|
363
|
-
**Fix**: "
|
|
371
|
+
**Fix**: "React components with hooks, TypeScript, forms"
|
|
364
372
|
|
|
365
373
|
---
|
|
366
374
|
|
|
367
375
|
## Skill Composition Example
|
|
368
376
|
|
|
369
|
-
**User Request**: "Create a
|
|
377
|
+
**User Request**: "Create a user profile card with API data and styling"
|
|
370
378
|
|
|
371
379
|
**Skills Activated**:
|
|
372
380
|
|
|
373
|
-
1. `
|
|
374
|
-
2. `
|
|
375
|
-
3. `
|
|
376
|
-
4. `
|
|
381
|
+
1. `api-client` - Fetch user data
|
|
382
|
+
2. `react-patterns` - Build component
|
|
383
|
+
3. `css-conventions` - Apply styling
|
|
384
|
+
4. `error-handling` - Handle fetch errors
|
|
377
385
|
|
|
378
386
|
**Result**: Skills work together naturally, each handling its domain.
|
|
379
387
|
|
|
@@ -389,7 +397,7 @@ Before considering a skill "done":
|
|
|
389
397
|
- [ ] Detailed docs in references/
|
|
390
398
|
- [ ] Scripts for repeated code
|
|
391
399
|
- [ ] Assets for templates
|
|
392
|
-
- [ ] Validated with
|
|
400
|
+
- [ ] Validated with `npx claude-skills validate`
|
|
393
401
|
- [ ] Tested in real conversations
|
|
394
402
|
- [ ] No TODO placeholders
|
|
395
403
|
- [ ] Imperative voice throughout
|