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.
@@ -1,103 +1,111 @@
1
- # Skill Examples for devhub-crm
1
+ # Skill Examples with claude-skills-cli
2
2
 
3
- Real examples showing effective skill patterns for this project.
3
+ Real examples showing effective skill patterns using TypeScript/Node.
4
4
 
5
- ## Example 1: Database Patterns Skill
5
+ ## Example 1: API Client Skill
6
6
 
7
7
  ### Use Case
8
8
 
9
- Repeatedly providing database schema, query patterns, and transaction handling.
9
+ Repeatedly making authenticated API requests with TypeScript types and error handling.
10
10
 
11
11
  ### Structure
12
12
 
13
13
  ```
14
- database-patterns/
15
- ├── SKILL.md # Core query patterns
14
+ api-client/
15
+ ├── SKILL.md # Core request patterns
16
16
  ├── references/
17
- │ ├── schema.md # Complete database schema
18
- │ ├── relationships.md # Table relationships diagram
19
- │ └── query-examples.md # 20+ common queries
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
- ├── validate_timestamps.py # Check data consistency
22
- └── analyze_schema.py # Generate relationship graph
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: database-patterns
30
- description: SQLite database operations using better-sqlite3 for contacts, companies, interactions, and social_links tables. Use when writing SELECT, INSERT, UPDATE, DELETE operations with prepared statements, handling timestamps, or managing relationships.
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
- # Database Patterns
33
+ # API Client
34
34
 
35
35
  ## Quick Start
36
36
 
37
37
  ```typescript
38
- import { db } from '$lib/server/db';
38
+ import { apiClient } from './lib/api';
39
39
 
40
- // SELECT single row
41
- const stmt = db.prepare('SELECT * FROM contacts WHERE id = ? AND user_id = ?');
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 schema: [references/schema.md](references/schema.md)
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 table names for keyword matching
52
- - ✅ Quick Start shows most common pattern
53
- - ✅ Complete schema in references (not inline)
54
- - ✅ Scripts validate data consistency
55
- - ✅ Keyword-rich: "SELECT, INSERT, UPDATE, DELETE"
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: SvelteKit Component Patterns
58
+ ## Example 2: React Component Patterns
60
59
 
61
60
  ### Use Case
62
- Creating type-safe Svelte 5 components with proper runes and snippets.
61
+ Creating type-safe React components with hooks and TypeScript interfaces.
63
62
 
64
63
  ### Structure
65
64
  ```
66
65
 
67
- sveltekit-patterns/
66
+ react-patterns/
68
67
  ├── SKILL.md # Core patterns and conventions
69
68
  ├── references/
70
69
  │ ├── component-library.md # Catalog of existing components
71
- │ ├── reactive-stores.md # SvelteKit load/invalidate patterns
72
- │ └── routing-conventions.md # File-based routing guide
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.svelte
76
- ├── form-component.svelte
77
- └── list-component.svelte
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: sveltekit-patterns
85
- description: Create type-safe Svelte 5 components with $props(), $derived, and snippets following devhub-crm conventions. Use when building components, implementing forms, or working with reactive stores and SvelteKit routing.
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
- # SvelteKit Patterns
87
+ # React Patterns
89
88
 
90
89
  ## Component Template
91
90
 
92
- ```svelte
93
- <script lang="ts">
94
- interface Props {
95
- title: string;
96
- items: Array<{id: string; label: string}>;
97
- }
98
-
99
- let { title, items }: Props = $props();
100
- </script>
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 current Svelte 5 syntax ($props, $derived)
109
- - ✅ Type-safe patterns emphasized
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: "components, forms, reactive stores"
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.py # Validate GitHub credentials
131
- └── check_rate_limit.py # Monitor API usage
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: `python scripts/check_rate_limit.py`
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**: "SQLite", "GitHub API", "DaisyUI v5"
225
- - **Operations**: "SELECT, INSERT, UPDATE", "OAuth flow"
226
- - **Data types**: "contacts, companies, interactions"
227
- - **Triggers**: "Use when...", "implementing", "working with"
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 database stuff
239
+ description: Helps with API stuff
232
240
  ````
233
241
 
234
242
  ### After (Specific)
235
243
 
236
244
  ```yaml
237
- description: SQLite database operations using better-sqlite3 for contacts, companies, interactions, and social_links tables. Use when writing SELECT, INSERT, UPDATE, DELETE operations with prepared statements.
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: database-patterns
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/schema.md (complete schema)
265
- - references/query-examples.md (20+ queries)
266
- - scripts/validate.py (runs without loading)
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 Python]
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
- python scripts/validate_timestamps.py
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**: "Svelte 5 components with $props(), forms, routing"
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 GitHub contact card with database-backed favorites"
377
+ **User Request**: "Create a user profile card with API data and styling"
370
378
 
371
379
  **Skills Activated**:
372
380
 
373
- 1. `github-integration` - Fetch profile
374
- 2. `database-patterns` - Query favorites
375
- 3. `sveltekit-patterns` - Build component
376
- 4. `daisyui-conventions` - Style card
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 validate_skill.py
400
+ - [ ] Validated with `npx claude-skills validate`
393
401
  - [ ] Tested in real conversations
394
402
  - [ ] No TODO placeholders
395
403
  - [ ] Imperative voice throughout