claude-skills-cli 0.0.4 → 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 +1 -1
- 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 +3 -4
- package/dist/commands/package.js.map +1 -1
- package/dist/commands/stats.js +2 -2
- package/dist/commands/stats.js.map +1 -1
- package/dist/commands/validate.js +1 -1
- package/dist/commands/validate.js.map +1 -1
- package/dist/core/templates.js.map +1 -1
- package/dist/core/validator.js +16 -7
- package/dist/core/validator.js.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/skills/skill-creator/SKILL.md +143 -0
- package/{skills → dist/skills}/skill-creator/references/anthropic-resources.md +80 -34
- package/{skills → dist/skills}/skill-creator/references/cli-reference.md +24 -16
- package/{skills → dist/skills}/skill-creator/references/skill-examples.md +41 -39
- package/{skills → dist/skills}/skill-creator/references/writing-guide.md +65 -55
- 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 +11 -6
- package/docs/SKILL-EXAMPLES.md +51 -45
- package/docs/SKILLS-ARCHITECTURE.md +28 -27
- package/package.json +2 -2
- package/skills/skill-creator/SKILL.md +0 -106
- package/skills/skill-creator/references/cli-feedback.md +0 -431
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
# Skill Writing Guide
|
|
2
|
+
|
|
3
|
+
Detailed guidelines for writing effective Claude skills.
|
|
4
|
+
|
|
5
|
+
## Voice and Tone
|
|
6
|
+
|
|
7
|
+
### Use Imperative Voice
|
|
8
|
+
|
|
9
|
+
Claude responds best to direct instructions.
|
|
10
|
+
|
|
11
|
+
#### ✅ Good Examples
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
Use prepared statements for all database queries. Generate IDs with
|
|
15
|
+
nanoid() before inserting records. Store timestamps as Unix epoch
|
|
16
|
+
milliseconds. Validate input before saving to database.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
#### ❌ Bad Examples
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
You should use prepared statements for database queries. You'll want
|
|
23
|
+
to generate IDs with nanoid(). It's best if you store timestamps as
|
|
24
|
+
Unix epoch. Try to validate input before saving.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Be Specific, Not Vague
|
|
28
|
+
|
|
29
|
+
Provide concrete instructions, not general advice.
|
|
30
|
+
|
|
31
|
+
#### ✅ Good Examples
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// Use nanoid() for ID generation
|
|
35
|
+
import { nanoid } from 'nanoid';
|
|
36
|
+
const id = nanoid();
|
|
37
|
+
|
|
38
|
+
// Store timestamps as ISO strings
|
|
39
|
+
const timestamp = new Date().toISOString();
|
|
40
|
+
|
|
41
|
+
// Use type-safe interfaces
|
|
42
|
+
interface User {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
email: string;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### ❌ Bad Examples
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// Use an appropriate ID generator
|
|
53
|
+
const id = generateId();
|
|
54
|
+
|
|
55
|
+
// Store timestamps in a suitable format
|
|
56
|
+
const created_at = getCurrentTime();
|
|
57
|
+
|
|
58
|
+
// Use appropriate types
|
|
59
|
+
const user: any;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Avoid Conceptual Explanations
|
|
63
|
+
|
|
64
|
+
Focus on procedural steps, not theory.
|
|
65
|
+
|
|
66
|
+
#### ✅ Good (Procedural)
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
To fetch user data:
|
|
70
|
+
|
|
71
|
+
1. Import the API client
|
|
72
|
+
2. Call the endpoint with typed parameters
|
|
73
|
+
3. Handle the response with type checking
|
|
74
|
+
4. Return the typed result
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### ❌ Bad (Conceptual)
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
When thinking about API design, consider REST principles and how
|
|
81
|
+
architectural patterns affect your implementation...
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Description Writing
|
|
87
|
+
|
|
88
|
+
The description determines when Claude triggers your skill. Make it
|
|
89
|
+
count.
|
|
90
|
+
|
|
91
|
+
### Description Formula
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
[Technology] + [Operations] + [Data Types] + [Trigger Phrase]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Examples
|
|
98
|
+
|
|
99
|
+
#### API Client Skill
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
description:
|
|
103
|
+
REST API client for user data endpoints with TypeScript types. Use
|
|
104
|
+
when making HTTP requests, handling authentication, or working with
|
|
105
|
+
API responses and error handling.
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Breakdown**:
|
|
109
|
+
|
|
110
|
+
- Technology: "REST API", "TypeScript"
|
|
111
|
+
- Operations: "HTTP requests", "authentication", "error handling"
|
|
112
|
+
- Data types: "user data endpoints", "API responses"
|
|
113
|
+
- Trigger: "Use when making...or working with"
|
|
114
|
+
|
|
115
|
+
#### Component Skill
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
description:
|
|
119
|
+
Create type-safe React components with hooks and TypeScript
|
|
120
|
+
interfaces. Use when building UI components, implementing forms, or
|
|
121
|
+
managing component state and props.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Breakdown**:
|
|
125
|
+
|
|
126
|
+
- Technology: "React", "hooks", "TypeScript"
|
|
127
|
+
- Operations: "building components", "implementing forms"
|
|
128
|
+
- Data types: "component state", "props"
|
|
129
|
+
- Trigger: "Use when building...or working with"
|
|
130
|
+
|
|
131
|
+
### Description Checklist
|
|
132
|
+
|
|
133
|
+
- [ ] Includes technology names
|
|
134
|
+
- [ ] Lists specific operations
|
|
135
|
+
- [ ] Mentions data types or domains
|
|
136
|
+
- [ ] Has "Use when..." trigger phrase
|
|
137
|
+
- [ ] Contains searchable keywords
|
|
138
|
+
- [ ] Under 1024 characters
|
|
139
|
+
- [ ] Over 50 characters (not too short)
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Structure Patterns
|
|
144
|
+
|
|
145
|
+
### Quick Start Section
|
|
146
|
+
|
|
147
|
+
Show the most common operation immediately.
|
|
148
|
+
|
|
149
|
+
````markdown
|
|
150
|
+
## Quick Start
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import { apiClient } from './lib/api';
|
|
154
|
+
|
|
155
|
+
const response = await apiClient.get<User[]>('/users');
|
|
156
|
+
const users = response.data;
|
|
157
|
+
```
|
|
158
|
+
````
|
|
159
|
+
|
|
160
|
+
````
|
|
161
|
+
|
|
162
|
+
**Guidelines**:
|
|
163
|
+
- Minimal working example
|
|
164
|
+
- Most common use case
|
|
165
|
+
- Copy-paste ready
|
|
166
|
+
- Includes imports
|
|
167
|
+
- Shows types
|
|
168
|
+
|
|
169
|
+
### Core Patterns Section
|
|
170
|
+
|
|
171
|
+
Provide 3-5 essential patterns.
|
|
172
|
+
|
|
173
|
+
```markdown
|
|
174
|
+
## Core Patterns
|
|
175
|
+
|
|
176
|
+
### GET Requests
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
// Single resource
|
|
180
|
+
const user = await apiClient.get<User>(`/users/${id}`);
|
|
181
|
+
|
|
182
|
+
// Collection
|
|
183
|
+
const users = await apiClient.get<User[]>('/users');
|
|
184
|
+
````
|
|
185
|
+
|
|
186
|
+
### POST Requests
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
const newUser = await apiClient.post<User>('/users', {
|
|
190
|
+
id: nanoid(),
|
|
191
|
+
name: 'John Doe',
|
|
192
|
+
email: 'john@example.com',
|
|
193
|
+
createdAt: new Date().toISOString(),
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
````
|
|
198
|
+
|
|
199
|
+
**Guidelines**:
|
|
200
|
+
- One pattern per subsection
|
|
201
|
+
- Include code examples
|
|
202
|
+
- Show variations
|
|
203
|
+
- Real project code
|
|
204
|
+
- Not invented examples
|
|
205
|
+
|
|
206
|
+
### Advanced Usage Section
|
|
207
|
+
|
|
208
|
+
Link to detailed references.
|
|
209
|
+
|
|
210
|
+
```markdown
|
|
211
|
+
## Advanced Usage
|
|
212
|
+
|
|
213
|
+
For detailed information:
|
|
214
|
+
- [references/api-docs.md](references/api-docs.md) - Complete API reference
|
|
215
|
+
- [references/authentication.md](references/authentication.md) - Auth patterns
|
|
216
|
+
- [references/examples.md](references/examples.md) - 20+ usage examples
|
|
217
|
+
````
|
|
218
|
+
|
|
219
|
+
**Guidelines**:
|
|
220
|
+
|
|
221
|
+
- Brief descriptions of each reference
|
|
222
|
+
- Descriptive link text
|
|
223
|
+
- Organized by topic
|
|
224
|
+
- Not "click here"
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Code Examples
|
|
229
|
+
|
|
230
|
+
### Use Real Code
|
|
231
|
+
|
|
232
|
+
Pull examples from actual codebase, not invented scenarios.
|
|
233
|
+
|
|
234
|
+
#### ✅ Good (Real)
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
// From src/lib/api/users.ts
|
|
238
|
+
const response = await fetch(`${API_BASE}/users/${userId}/stats`, {
|
|
239
|
+
headers: {
|
|
240
|
+
Authorization: `Bearer ${token}`,
|
|
241
|
+
'Content-Type': 'application/json',
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
const stats = (await response.json()) as UserStats;
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
#### ❌ Bad (Generic)
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
// Generic example
|
|
251
|
+
const result = await api.getData();
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Include Context
|
|
255
|
+
|
|
256
|
+
Show imports, types, and surrounding context.
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
// ✅ Complete context
|
|
260
|
+
import { nanoid } from 'nanoid';
|
|
261
|
+
import type { User, CreateUserRequest } from './types';
|
|
262
|
+
import { apiClient } from './client';
|
|
263
|
+
|
|
264
|
+
const createUser = async (
|
|
265
|
+
request: CreateUserRequest,
|
|
266
|
+
): Promise<User> => {
|
|
267
|
+
const user: User = {
|
|
268
|
+
id: nanoid(),
|
|
269
|
+
...request,
|
|
270
|
+
createdAt: new Date().toISOString(),
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const response = await apiClient.post<User>('/users', user);
|
|
274
|
+
return response.data;
|
|
275
|
+
};
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Comment Strategically
|
|
279
|
+
|
|
280
|
+
Explain WHY, not WHAT.
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
// ✅ Good comments (explain why)
|
|
284
|
+
// Use Authorization header to verify JWT token
|
|
285
|
+
const headers = { Authorization: `Bearer ${token}` };
|
|
286
|
+
|
|
287
|
+
// Always validate input to prevent injection attacks
|
|
288
|
+
const sanitized = validator.escape(userInput);
|
|
289
|
+
|
|
290
|
+
// ❌ Bad comments (state the obvious)
|
|
291
|
+
// This creates headers
|
|
292
|
+
const headers = { Authorization: `Bearer ${token}` };
|
|
293
|
+
|
|
294
|
+
// This makes a request
|
|
295
|
+
const response = await fetch(url);
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Reference Files
|
|
301
|
+
|
|
302
|
+
### When to Create References
|
|
303
|
+
|
|
304
|
+
Create reference files when:
|
|
305
|
+
|
|
306
|
+
- SKILL.md exceeds ~5k words
|
|
307
|
+
- Content is only needed in specific scenarios
|
|
308
|
+
- You have exhaustive documentation
|
|
309
|
+
- Topic deserves deep treatment
|
|
310
|
+
|
|
311
|
+
### Reference File Structure
|
|
312
|
+
|
|
313
|
+
````markdown
|
|
314
|
+
# Topic Name
|
|
315
|
+
|
|
316
|
+
## Overview
|
|
317
|
+
|
|
318
|
+
Brief introduction to the topic.
|
|
319
|
+
|
|
320
|
+
## Section 1: Subtopic
|
|
321
|
+
|
|
322
|
+
Detailed content with examples...
|
|
323
|
+
|
|
324
|
+
```typescript
|
|
325
|
+
// Code examples
|
|
326
|
+
```
|
|
327
|
+
````
|
|
328
|
+
|
|
329
|
+
## Section 2: Another Subtopic
|
|
330
|
+
|
|
331
|
+
More detailed content...
|
|
332
|
+
|
|
333
|
+
## Examples
|
|
334
|
+
|
|
335
|
+
Real-world usage examples.
|
|
336
|
+
|
|
337
|
+
## Notes
|
|
338
|
+
|
|
339
|
+
Important considerations.
|
|
340
|
+
|
|
341
|
+
````
|
|
342
|
+
|
|
343
|
+
### Reference File Naming
|
|
344
|
+
|
|
345
|
+
Use descriptive, searchable names:
|
|
346
|
+
|
|
347
|
+
#### ✅ Good Names
|
|
348
|
+
- `authentication-flow.md`
|
|
349
|
+
- `api-endpoints-reference.md`
|
|
350
|
+
- `component-library-catalog.md`
|
|
351
|
+
- `query-patterns-complex.md`
|
|
352
|
+
|
|
353
|
+
#### ❌ Bad Names
|
|
354
|
+
- `auth.md`
|
|
355
|
+
- `api.md`
|
|
356
|
+
- `components.md`
|
|
357
|
+
- `queries.md`
|
|
358
|
+
|
|
359
|
+
### Linking to References
|
|
360
|
+
|
|
361
|
+
Always provide context for links:
|
|
362
|
+
|
|
363
|
+
```markdown
|
|
364
|
+
For complete database schema with all table definitions and relationships:
|
|
365
|
+
[references/schema.md](references/schema.md)
|
|
366
|
+
|
|
367
|
+
For 20+ common query patterns including joins and aggregations:
|
|
368
|
+
[references/query-examples.md](references/query-examples.md)
|
|
369
|
+
````
|
|
370
|
+
|
|
371
|
+
Not just:
|
|
372
|
+
|
|
373
|
+
```markdown
|
|
374
|
+
See [schema.md](references/schema.md) and
|
|
375
|
+
[examples](references/query-examples.md).
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Scripts
|
|
381
|
+
|
|
382
|
+
### When to Create Scripts
|
|
383
|
+
|
|
384
|
+
Create scripts for:
|
|
385
|
+
|
|
386
|
+
- **Validation**: Check data consistency, format correctness
|
|
387
|
+
- **Generation**: Create boilerplate, scaffolding
|
|
388
|
+
- **Analysis**: Parse files, generate reports
|
|
389
|
+
- **Testing**: Verify configuration, connectivity
|
|
390
|
+
|
|
391
|
+
### Script Structure
|
|
392
|
+
|
|
393
|
+
```javascript
|
|
394
|
+
#!/usr/bin/env node
|
|
395
|
+
/**
|
|
396
|
+
* Clear description of what this script does.
|
|
397
|
+
*
|
|
398
|
+
* This script [main purpose] by [method]. Use it to [when to use].
|
|
399
|
+
*
|
|
400
|
+
* Usage:
|
|
401
|
+
* node script-name.js [arguments]
|
|
402
|
+
*
|
|
403
|
+
* Example:
|
|
404
|
+
* node validate-config.js --check-all
|
|
405
|
+
* node validate-config.js --file config.json
|
|
406
|
+
*
|
|
407
|
+
* Options:
|
|
408
|
+
* --check-all Check all config files
|
|
409
|
+
* --file NAME Check specific file
|
|
410
|
+
* --verbose Show detailed output
|
|
411
|
+
*/
|
|
412
|
+
|
|
413
|
+
import { parseArgs } from 'node:util';
|
|
414
|
+
|
|
415
|
+
async function main() {
|
|
416
|
+
const { values } = parseArgs({
|
|
417
|
+
options: {
|
|
418
|
+
verbose: { type: 'boolean', default: false },
|
|
419
|
+
file: { type: 'string' },
|
|
420
|
+
'check-all': { type: 'boolean', default: false },
|
|
421
|
+
},
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
try {
|
|
425
|
+
const result = await performOperation(values);
|
|
426
|
+
console.log(`✅ Success: ${result}`);
|
|
427
|
+
process.exit(0);
|
|
428
|
+
} catch (error) {
|
|
429
|
+
console.error(`❌ Error: ${error.message}`);
|
|
430
|
+
process.exit(1);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
async function performOperation(options) {
|
|
435
|
+
// Main logic here
|
|
436
|
+
return 'Operation completed';
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
main();
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Script Best Practices
|
|
443
|
+
|
|
444
|
+
- Include shebang (`#!/usr/bin/env node`)
|
|
445
|
+
- Detailed JSDoc comment with usage examples
|
|
446
|
+
- Argument parsing with node:util or commander
|
|
447
|
+
- Error handling with meaningful messages
|
|
448
|
+
- Exit codes (0 = success, 1 = error)
|
|
449
|
+
- Clear output formatting (✅ ❌ ⚠️)
|
|
450
|
+
- Use ES modules (import/export) or CommonJS (require)
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## Assets
|
|
455
|
+
|
|
456
|
+
### When to Create Assets
|
|
457
|
+
|
|
458
|
+
Add assets when you have:
|
|
459
|
+
|
|
460
|
+
- **Templates**: Boilerplate that gets copied/modified
|
|
461
|
+
- **Images**: Logos, icons, diagrams
|
|
462
|
+
- **Config**: Standard configuration files
|
|
463
|
+
- **Data**: Seed data, examples
|
|
464
|
+
|
|
465
|
+
### Asset Organization
|
|
466
|
+
|
|
467
|
+
```
|
|
468
|
+
assets/
|
|
469
|
+
├── templates/
|
|
470
|
+
│ ├── component.svelte
|
|
471
|
+
│ ├── api-route.ts
|
|
472
|
+
│ └── sql-migration.sql
|
|
473
|
+
├── images/
|
|
474
|
+
│ ├── logo.png
|
|
475
|
+
│ └── diagram.svg
|
|
476
|
+
├── config/
|
|
477
|
+
│ └── tsconfig.json
|
|
478
|
+
└── data/
|
|
479
|
+
└── example-data.json
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
### Using Assets
|
|
483
|
+
|
|
484
|
+
````markdown
|
|
485
|
+
## Quick Start
|
|
486
|
+
|
|
487
|
+
Copy the component template:
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
cp assets/templates/component.svelte src/lib/components/new-component.svelte
|
|
491
|
+
```
|
|
492
|
+
````
|
|
493
|
+
|
|
494
|
+
Modify the template for your needs.
|
|
495
|
+
|
|
496
|
+
````
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
## Word Count Guidelines
|
|
501
|
+
|
|
502
|
+
### SKILL.md Body
|
|
503
|
+
- **Target**: 2k-5k words
|
|
504
|
+
- **Maximum**: 5k words
|
|
505
|
+
- **If exceeding**: Move content to references/
|
|
506
|
+
|
|
507
|
+
### Reference Files
|
|
508
|
+
- **Target**: 1k-10k words per file
|
|
509
|
+
- **Maximum**: 15k words per file
|
|
510
|
+
- **If exceeding**: Split into multiple focused files
|
|
511
|
+
|
|
512
|
+
### Description
|
|
513
|
+
- **Minimum**: 50 characters
|
|
514
|
+
- **Target**: 100-300 characters
|
|
515
|
+
- **Maximum**: 1024 characters
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## Common Mistakes
|
|
520
|
+
|
|
521
|
+
### Mistake 1: Vague Descriptions
|
|
522
|
+
```yaml
|
|
523
|
+
# ❌ Bad
|
|
524
|
+
description: Helper for API stuff
|
|
525
|
+
|
|
526
|
+
# ✅ Good
|
|
527
|
+
description: REST API client with TypeScript types for user endpoints. Use when making HTTP requests, handling auth, or managing API errors.
|
|
528
|
+
````
|
|
529
|
+
|
|
530
|
+
### Mistake 2: Second Person
|
|
531
|
+
|
|
532
|
+
```markdown
|
|
533
|
+
# ❌ Bad
|
|
534
|
+
|
|
535
|
+
You should always validate input before saving.
|
|
536
|
+
|
|
537
|
+
# ✅ Good
|
|
538
|
+
|
|
539
|
+
Validate input before saving to database.
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
### Mistake 3: Conceptual Over Procedural
|
|
543
|
+
|
|
544
|
+
````markdown
|
|
545
|
+
# ❌ Bad
|
|
546
|
+
|
|
547
|
+
Understanding the importance of authentication tokens in the context
|
|
548
|
+
of secure API communication is crucial for security...
|
|
549
|
+
|
|
550
|
+
# ✅ Good
|
|
551
|
+
|
|
552
|
+
Include authentication tokens in all API requests:
|
|
553
|
+
|
|
554
|
+
```typescript
|
|
555
|
+
const response = await fetch(url, {
|
|
556
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
557
|
+
});
|
|
558
|
+
```
|
|
559
|
+
````
|
|
560
|
+
|
|
561
|
+
````
|
|
562
|
+
|
|
563
|
+
### Mistake 4: Duplicate Content
|
|
564
|
+
```markdown
|
|
565
|
+
# ❌ Bad (repeated in multiple places)
|
|
566
|
+
SKILL.md has complete schema
|
|
567
|
+
references/schema.md has complete schema
|
|
568
|
+
|
|
569
|
+
# ✅ Good (single source of truth)
|
|
570
|
+
SKILL.md has quick reference
|
|
571
|
+
references/schema.md has complete schema
|
|
572
|
+
````
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
## Checklist
|
|
577
|
+
|
|
578
|
+
Before finalizing a skill:
|
|
579
|
+
|
|
580
|
+
### Content
|
|
581
|
+
|
|
582
|
+
- [ ] Description includes keywords and triggers
|
|
583
|
+
- [ ] Imperative voice throughout
|
|
584
|
+
- [ ] Specific, not vague
|
|
585
|
+
- [ ] Real examples from codebase
|
|
586
|
+
- [ ] No TODO placeholders
|
|
587
|
+
|
|
588
|
+
### Structure
|
|
589
|
+
|
|
590
|
+
- [ ] Quick Start section present
|
|
591
|
+
- [ ] 3-5 Core Patterns documented
|
|
592
|
+
- [ ] Links to references working
|
|
593
|
+
- [ ] Scripts described
|
|
594
|
+
- [ ] Under 5k words (SKILL.md body)
|
|
595
|
+
|
|
596
|
+
### Technical
|
|
597
|
+
|
|
598
|
+
- [ ] YAML frontmatter valid
|
|
599
|
+
- [ ] Name matches directory
|
|
600
|
+
- [ ] Scripts are executable
|
|
601
|
+
- [ ] References mentioned in SKILL.md
|
|
602
|
+
- [ ] Validation passes
|
|
603
|
+
|
|
604
|
+
### Testing
|
|
605
|
+
|
|
606
|
+
- [ ] Tested in real conversations
|
|
607
|
+
- [ ] Claude triggers skill correctly
|
|
608
|
+
- [ ] Instructions are clear
|
|
609
|
+
- [ ] Examples work as shown
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
## Resources
|
|
614
|
+
|
|
615
|
+
- [SKILLS-ARCHITECTURE.md](../../../docs/SKILLS-ARCHITECTURE.md) -
|
|
616
|
+
System overview
|
|
617
|
+
- [SKILL-DEVELOPMENT.md](../../../docs/SKILL-DEVELOPMENT.md) -
|
|
618
|
+
Development workflow
|
|
619
|
+
- [SKILL-EXAMPLES.md](../../../docs/SKILL-EXAMPLES.md) - Real examples
|
package/dist/utils/fs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mkdirSync, writeFileSync
|
|
2
|
-
import { dirname } from 'path';
|
|
1
|
+
import { chmodSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
3
|
export function ensure_dir(path) {
|
|
4
4
|
mkdirSync(path, { recursive: true });
|
|
5
5
|
}
|
package/dist/utils/fs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/utils/fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/utils/fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,UAAU,UAAU,CAAC,IAAY;IACtC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,OAAe;IACvD,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1B,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC/C,OAAO,UAAU;SACf,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW;IACxC,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACvC,OAAO,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
package/dist/utils/output.js
CHANGED
|
@@ -76,7 +76,8 @@ export function display_validation_stats(stats) {
|
|
|
76
76
|
if (stats.line_count <= 50 && stats.description_length <= 200) {
|
|
77
77
|
console.log(chalk.green(' ✅ Excellent progressive disclosure!'));
|
|
78
78
|
}
|
|
79
|
-
else if (stats.line_count <= 80 &&
|
|
79
|
+
else if (stats.line_count <= 80 &&
|
|
80
|
+
stats.description_length <= 300) {
|
|
80
81
|
console.log(chalk.green(' ✅ Good progressive disclosure'));
|
|
81
82
|
}
|
|
82
83
|
else if (stats.line_count <= 150 && stats.word_count < 5000) {
|
package/dist/utils/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,UAAU,wBAAwB,
|
|
1
|
+
{"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