claude-skills-cli 0.0.2 ā 0.0.3
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/core/templates.js +26 -54
- package/dist/core/templates.js.map +1 -1
- package/dist/core/validator.js +104 -15
- package/dist/core/validator.js.map +1 -1
- package/dist/utils/output.js +46 -16
- package/dist/utils/output.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,455 +1,270 @@
|
|
|
1
1
|
# claude-skills-cli
|
|
2
2
|
|
|
3
|
-
TypeScript CLI toolkit for creating, validating, and packaging Claude
|
|
4
|
-
|
|
5
|
-
**Status:** š§ In Development - See implementation plan below
|
|
6
|
-
|
|
7
|
-
---
|
|
3
|
+
TypeScript CLI toolkit for creating, validating, and packaging Claude Agent Skills with **progressive disclosure validation**.
|
|
8
4
|
|
|
9
5
|
## What This Is
|
|
10
6
|
|
|
11
|
-
A
|
|
7
|
+
A command-line tool for managing Claude Agent Skills. It enforces the 3-level progressive disclosure system from [Anthropic's Skills documentation](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview), ensuring skills are token-efficient and scannable.
|
|
12
8
|
|
|
13
9
|
```bash
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
npx claude-skills init my-skill
|
|
11
|
+
npx claude-skills validate .claude/skills/my-skill
|
|
12
|
+
npx claude-skills validate .claude/skills/my-skill --strict
|
|
13
|
+
npx claude-skills package .claude/skills/my-skill
|
|
17
14
|
```
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Repository Structure (Planned)
|
|
16
|
+
## Commands
|
|
24
17
|
|
|
25
|
-
|
|
18
|
+
### `init` - Create a new skill
|
|
26
19
|
|
|
27
|
-
```
|
|
28
|
-
claude-skills-
|
|
29
|
-
|
|
30
|
-
āāā tsconfig.json # TypeScript ES modules config
|
|
31
|
-
āāā README.md # This file
|
|
32
|
-
āāā .gitignore # Ignore node_modules, dist, etc.
|
|
33
|
-
āāā .prettierrc # Code formatting
|
|
34
|
-
āāā .changeset/ # Version management
|
|
35
|
-
ā āāā README.md
|
|
36
|
-
ā āāā config.json
|
|
37
|
-
āāā src/
|
|
38
|
-
ā āāā index.ts # CLI entry (#!/usr/bin/env node)
|
|
39
|
-
ā āāā types.ts # TypeScript type definitions
|
|
40
|
-
ā āāā commands/
|
|
41
|
-
ā ā āāā init.ts # Create new skill structure
|
|
42
|
-
ā ā āāā validate.ts # Validate skill format
|
|
43
|
-
ā ā āāā package.ts # Package skill to zip
|
|
44
|
-
ā āāā core/
|
|
45
|
-
ā ā āāā templates.ts # SKILL.md templates as strings
|
|
46
|
-
ā ā āāā validator.ts # Validation logic (class-based)
|
|
47
|
-
ā āāā utils/
|
|
48
|
-
ā āāā fs.ts # File system helpers
|
|
49
|
-
ā āāā output.ts # Emoji/formatting (chalk)
|
|
50
|
-
āāā templates/ # Copied from devhub-crm
|
|
51
|
-
ā āāā SKILL-TEMPLATE.md
|
|
52
|
-
ā āāā skill-structure/
|
|
53
|
-
ā āāā README.md
|
|
54
|
-
ā āāā references/
|
|
55
|
-
ā āāā scripts/
|
|
56
|
-
ā āāā assets/
|
|
57
|
-
āāā docs/ # Copied from devhub-crm
|
|
58
|
-
ā āāā SKILLS-ARCHITECTURE.md
|
|
59
|
-
ā āāā SKILL-DEVELOPMENT.md
|
|
60
|
-
ā āāā SKILL-EXAMPLES.md
|
|
61
|
-
āāā skills/ # Portable example skills
|
|
62
|
-
āāā skill-creator/ # Meta-skill from devhub-crm
|
|
63
|
-
āāā SKILL.md
|
|
64
|
-
āāā references/
|
|
20
|
+
```bash
|
|
21
|
+
claude-skills init my-skill
|
|
22
|
+
claude-skills init my-skill --description "Brief description with trigger keywords"
|
|
65
23
|
```
|
|
66
24
|
|
|
67
|
-
|
|
25
|
+
Creates a skill directory with:
|
|
68
26
|
|
|
69
|
-
|
|
27
|
+
- **SKILL.md** - Streamlined ~50 line template with progressive disclosure guidelines
|
|
28
|
+
- **README.md** - Skill documentation
|
|
29
|
+
- **references/** - Directory for Level 3 detailed documentation
|
|
30
|
+
- **scripts/** - Directory for executable Python scripts
|
|
31
|
+
- **assets/** - Directory for templates and resources
|
|
70
32
|
|
|
71
|
-
The
|
|
33
|
+
The generated SKILL.md template follows best practices:
|
|
72
34
|
|
|
73
|
-
|
|
35
|
+
- 1-2 code blocks maximum
|
|
36
|
+
- Clear "Quick Start" section
|
|
37
|
+
- Links to references/ for detailed content
|
|
38
|
+
- Progressive disclosure comments inline
|
|
74
39
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
40
|
+
### `validate` - Validate skill structure
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
claude-skills validate .claude/skills/my-skill
|
|
44
|
+
claude-skills validate .claude/skills/my-skill --strict
|
|
79
45
|
```
|
|
80
46
|
|
|
81
|
-
|
|
47
|
+
**Progressive Disclosure Validation** (3-Level System):
|
|
82
48
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
49
|
+
| Level | Content | Checks |
|
|
50
|
+
| -------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| **Level 1: Metadata** | YAML frontmatter | Description <200 chars (warn), <300 chars (error)<br>Trigger keywords present ("Use when/for/to")<br>No list bloat (>3 commas) |
|
|
52
|
+
| **Level 2: SKILL.md Body** | Main instructions | Line count ~50 (warn >80, error >150)<br>Word count <1000 (warn), <5000 (error)<br>Code blocks ā¤3 (recommend 1-2)<br>Sections ā¤8 (recommend 3-5)<br>"Quick Start" section present<br>Links to references/ when long |
|
|
53
|
+
| **Level 3: References** | Bundled files | Referenced files exist (error on broken links)<br>No empty directories |
|
|
88
54
|
|
|
89
|
-
|
|
55
|
+
**Validation Output:**
|
|
56
|
+
|
|
57
|
+
The validator displays a detailed progressive disclosure stats breakdown:
|
|
90
58
|
|
|
91
59
|
```
|
|
92
|
-
|
|
93
|
-
devhub-crm/.claude/skills/database-patterns/ # Project-specific
|
|
94
|
-
devhub-crm/.claude/TYPESCRIPT-CONVERSION-PROMPT.md # Completed
|
|
95
|
-
```
|
|
60
|
+
š Progressive Disclosure Stats:
|
|
96
61
|
|
|
97
|
-
|
|
62
|
+
Level 1 (Metadata - Always Loaded):
|
|
63
|
+
Description: 156 chars, ~18 tokens ā
Optimal
|
|
64
|
+
(Target: <200 chars, <30 tokens for Level 1 efficiency)
|
|
98
65
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"description": "CLI toolkit for creating and managing Claude Agent Skills",
|
|
106
|
-
"type": "module",
|
|
107
|
-
"main": "./dist/index.js",
|
|
108
|
-
"bin": {
|
|
109
|
-
"claude-skills-cli": "./dist/index.js"
|
|
110
|
-
},
|
|
111
|
-
"engines": {
|
|
112
|
-
"node": ">=22.0.0"
|
|
113
|
-
},
|
|
114
|
-
"scripts": {
|
|
115
|
-
"build": "tsc",
|
|
116
|
-
"dev": "tsc --watch",
|
|
117
|
-
"start": "node ./dist/index.js",
|
|
118
|
-
"format": "prettier --write .",
|
|
119
|
-
"format:check": "prettier --check .",
|
|
120
|
-
"changeset": "changeset",
|
|
121
|
-
"version": "changeset version",
|
|
122
|
-
"release": "pnpm run build && changeset publish"
|
|
123
|
-
},
|
|
124
|
-
"keywords": ["claude", "skills", "cli", "agent", "anthropic", "claude-code"],
|
|
125
|
-
"author": "Scott Spence",
|
|
126
|
-
"license": "MIT",
|
|
127
|
-
"dependencies": {
|
|
128
|
-
"@clack/prompts": "^0.11.0",
|
|
129
|
-
"chalk": "^5.3.0",
|
|
130
|
-
"archiver": "^7.0.0"
|
|
131
|
-
},
|
|
132
|
-
"devDependencies": {
|
|
133
|
-
"@changesets/cli": "^2.29.7",
|
|
134
|
-
"@types/node": "^24.7.0",
|
|
135
|
-
"@types/archiver": "^6.0.0",
|
|
136
|
-
"prettier": "^3.6.2",
|
|
137
|
-
"typescript": "^5.9.3"
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
```
|
|
66
|
+
Level 2 (SKILL.md Body - Loaded when triggered):
|
|
67
|
+
Lines: 48 (target: ~50, max: ~150) ā
Excellent
|
|
68
|
+
Words: 342 (recommended: <1000, max: <5000) ā
Excellent
|
|
69
|
+
Est. tokens: ~445 (budget: <6500) within budget
|
|
70
|
+
Code blocks: 1 ā
|
|
71
|
+
Sections: 5 ā
|
|
141
72
|
|
|
142
|
-
|
|
73
|
+
Level 3+ (References - Loaded as needed):
|
|
74
|
+
Use references/ directory for detailed docs (unlimited size)
|
|
143
75
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
```json
|
|
147
|
-
{
|
|
148
|
-
"compilerOptions": {
|
|
149
|
-
"target": "ES2022",
|
|
150
|
-
"module": "nodenext",
|
|
151
|
-
"moduleResolution": "nodenext",
|
|
152
|
-
"strict": true,
|
|
153
|
-
"outDir": "./dist",
|
|
154
|
-
"sourceMap": true,
|
|
155
|
-
"esModuleInterop": true,
|
|
156
|
-
"allowSyntheticDefaultImports": true,
|
|
157
|
-
"skipLibCheck": true
|
|
158
|
-
},
|
|
159
|
-
"include": ["src/**/*"],
|
|
160
|
-
"exclude": ["node_modules", "dist"]
|
|
161
|
-
}
|
|
76
|
+
Overall Assessment:
|
|
77
|
+
ā
Excellent progressive disclosure!
|
|
162
78
|
```
|
|
163
79
|
|
|
164
|
-
|
|
80
|
+
**Exit codes:**
|
|
165
81
|
|
|
166
|
-
|
|
82
|
+
- 0 = Valid (or valid with warnings)
|
|
83
|
+
- 1 = Validation errors
|
|
84
|
+
- 1 with `--strict` = Warnings treated as errors
|
|
167
85
|
|
|
168
|
-
###
|
|
86
|
+
### `package` - Create uploadable zip
|
|
169
87
|
|
|
170
|
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
88
|
+
```bash
|
|
89
|
+
claude-skills package .claude/skills/my-skill
|
|
90
|
+
claude-skills package .claude/skills/my-skill --output dist/
|
|
91
|
+
claude-skills package .claude/skills/my-skill --skip-validation
|
|
92
|
+
```
|
|
173
93
|
|
|
174
|
-
|
|
94
|
+
Creates a zip file ready to upload to Claude.ai, excluding:
|
|
175
95
|
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
- **prettier** - Code formatting
|
|
180
|
-
- **typescript** - TypeScript compiler
|
|
96
|
+
- Hidden files (.\*)
|
|
97
|
+
- Python bytecode (.pyc, **pycache**)
|
|
98
|
+
- Swap files (~, .swp)
|
|
181
99
|
|
|
182
|
-
|
|
100
|
+
Runs validation first unless `--skip-validation` is specified.
|
|
183
101
|
|
|
184
|
-
##
|
|
102
|
+
## The Progressive Disclosure System
|
|
185
103
|
|
|
186
|
-
|
|
104
|
+
Claude Skills use a 3-level loading system to optimize token usage:
|
|
187
105
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
106
|
+
| Level | File | Context Window | Token Budget |
|
|
107
|
+
| ------ | ------------------------------ | -------------------------- | ------------ |
|
|
108
|
+
| **1** | SKILL.md Metadata (YAML) | Always loaded | ~100 tokens |
|
|
109
|
+
| **2** | SKILL.md Body (Markdown) | Loaded when skill triggers | <5k tokens |
|
|
110
|
+
| **3+** | references/, scripts/, assets/ | Loaded as-needed by Claude | Unlimited |
|
|
192
111
|
|
|
193
|
-
|
|
112
|
+
### Why This Matters
|
|
194
113
|
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
- scripts/example.py (executable)
|
|
199
|
-
- assets/ directory
|
|
114
|
+
- **Level 1** is always in Claude's context, so keep descriptions <200 chars
|
|
115
|
+
- **Level 2** loads when Claude thinks the skill is relevant, so keep it scannable (~50 lines)
|
|
116
|
+
- **Level 3** loads on-demand, so move detailed docs, examples, and schemas there
|
|
200
117
|
|
|
201
|
-
|
|
118
|
+
The validator enforces these constraints to ensure skills are token-efficient.
|
|
202
119
|
|
|
203
|
-
|
|
204
|
-
ā
Skill created at: .claude/skills/my-skill
|
|
120
|
+
## Installation
|
|
205
121
|
|
|
206
|
-
|
|
207
|
-
1. Edit .claude/skills/my-skill/SKILL.md with your skill instructions
|
|
208
|
-
2. Add detailed documentation to references/
|
|
209
|
-
3. Add executable scripts to scripts/
|
|
210
|
-
4. Remove example files you don't need
|
|
122
|
+
### As a project dependency:
|
|
211
123
|
|
|
212
|
-
|
|
124
|
+
```bash
|
|
125
|
+
npm install claude-skills-cli --save-dev
|
|
213
126
|
```
|
|
214
127
|
|
|
215
|
-
###
|
|
128
|
+
### Global installation:
|
|
216
129
|
|
|
217
130
|
```bash
|
|
218
|
-
|
|
219
|
-
claude-skills validate .claude/skills/my-skill --strict
|
|
131
|
+
npm install -g claude-skills-cli
|
|
220
132
|
```
|
|
221
133
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
- SKILL.md exists
|
|
225
|
-
- YAML frontmatter format
|
|
226
|
-
- Required fields (name, description)
|
|
227
|
-
- Name format (kebab-case, max 64 chars)
|
|
228
|
-
- Description length (max 1024 chars)
|
|
229
|
-
- References mentioned in SKILL.md
|
|
230
|
-
- Scripts are executable
|
|
231
|
-
- No TODO placeholders
|
|
232
|
-
|
|
233
|
-
**Output:**
|
|
134
|
+
### Using npx (no install):
|
|
234
135
|
|
|
136
|
+
```bash
|
|
137
|
+
npx claude-skills-cli init my-skill
|
|
235
138
|
```
|
|
236
|
-
š Validating skill: my-skill
|
|
237
|
-
============================================================
|
|
238
139
|
|
|
239
|
-
|
|
240
|
-
ā ļø Reference file 'schema.md' not mentioned in SKILL.md
|
|
140
|
+
## Example Workflow
|
|
241
141
|
|
|
242
|
-
|
|
243
|
-
|
|
142
|
+
```bash
|
|
143
|
+
# 1. Create a new skill
|
|
144
|
+
npx claude-skills init database-queries \
|
|
145
|
+
--description "SQLite queries for contacts and companies. Use when querying the database."
|
|
244
146
|
|
|
245
|
-
|
|
147
|
+
# 2. Edit the generated SKILL.md
|
|
148
|
+
# - Keep it under 50 lines
|
|
149
|
+
# - Use 1 minimal code example in Quick Start
|
|
150
|
+
# - Link to references/ for detailed docs
|
|
246
151
|
|
|
247
|
-
|
|
248
|
-
-
|
|
249
|
-
- 1 with --strict = warnings treated as errors
|
|
152
|
+
# 3. Validate before using
|
|
153
|
+
npx claude-skills validate .claude/skills/database-queries
|
|
250
154
|
|
|
251
|
-
|
|
155
|
+
# 4. Fix any warnings (or use --strict to enforce)
|
|
156
|
+
npx claude-skills validate .claude/skills/database-queries --strict
|
|
252
157
|
|
|
253
|
-
|
|
254
|
-
claude-skills package .claude/skills/
|
|
255
|
-
claude-skills package .claude/skills/my-skill --output dist/
|
|
256
|
-
claude-skills package .claude/skills/my-skill --skip-validation
|
|
158
|
+
# 5. Package for sharing
|
|
159
|
+
npx claude-skills package .claude/skills/database-queries
|
|
257
160
|
```
|
|
258
161
|
|
|
259
|
-
|
|
162
|
+
## Validation Best Practices
|
|
260
163
|
|
|
261
|
-
|
|
262
|
-
- Excludes hidden files, .pyc, **pycache**, etc.
|
|
263
|
-
- Runs validation first (unless --skip-validation)
|
|
164
|
+
### ā
Good Skill (Passes Validation)
|
|
264
165
|
|
|
265
|
-
|
|
166
|
+
````markdown
|
|
167
|
+
---
|
|
168
|
+
name: api-client
|
|
169
|
+
description: REST API client for our service. Use when making HTTP requests to api.example.com.
|
|
170
|
+
---
|
|
266
171
|
|
|
267
|
-
|
|
268
|
-
š Validating skill...
|
|
269
|
-
ā
Skill is valid!
|
|
172
|
+
# API Client
|
|
270
173
|
|
|
271
|
-
|
|
272
|
-
+ my-skill/SKILL.md
|
|
273
|
-
+ my-skill/README.md
|
|
274
|
-
+ my-skill/references/detailed-guide.md
|
|
174
|
+
## Quick Start
|
|
275
175
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
Size: 12.3 KB
|
|
176
|
+
```typescript
|
|
177
|
+
import { apiClient } from '$lib/api';
|
|
279
178
|
|
|
280
|
-
|
|
179
|
+
const response = await apiClient.get('/users');
|
|
281
180
|
```
|
|
181
|
+
````
|
|
282
182
|
|
|
283
|
-
|
|
183
|
+
## Core Principles
|
|
284
184
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
- [x] Create claude-skills-cli repo
|
|
290
|
-
- [x] Copy .claude/ from devhub-crm
|
|
291
|
-
- [ ] Create package.json
|
|
292
|
-
- [ ] Create tsconfig.json
|
|
293
|
-
- [ ] Setup .gitignore, .prettierrc
|
|
294
|
-
- [ ] Install dependencies: `pnpm install`
|
|
295
|
-
|
|
296
|
-
### Phase 2: Reorganize Files
|
|
297
|
-
|
|
298
|
-
- [ ] Move `docs/` to root
|
|
299
|
-
- [ ] Move `templates/` to root
|
|
300
|
-
- [ ] Move `skills/skill-creator/` to root
|
|
301
|
-
- [ ] Delete `.claude/settings.local.json`
|
|
302
|
-
- [ ] Delete `.claude/skills/database-patterns/`
|
|
303
|
-
|
|
304
|
-
### Phase 3: Convert Python ā TypeScript
|
|
305
|
-
|
|
306
|
-
#### init.ts (from init_skill.py)
|
|
307
|
-
|
|
308
|
-
- [ ] Import types, fs, path, chalk
|
|
309
|
-
- [ ] Create template strings (SKILL.md, README.md, etc.)
|
|
310
|
-
- [ ] Implement createSkill() function
|
|
311
|
-
- Use fs.mkdirSync(path, { recursive: true })
|
|
312
|
-
- Use fs.writeFileSync()
|
|
313
|
-
- Use fs.chmodSync(scriptPath, 0o755) for executable
|
|
314
|
-
- [ ] Use @clack/prompts for interactive mode (optional)
|
|
315
|
-
- [ ] Match Python output format exactly (emoji, messages)
|
|
316
|
-
|
|
317
|
-
#### validate.ts (from validate_skill.py)
|
|
318
|
-
|
|
319
|
-
- [ ] Create SkillValidator class
|
|
320
|
-
- errors: string[]
|
|
321
|
-
- warnings: string[]
|
|
322
|
-
- [ ] Implement validation methods:
|
|
323
|
-
- validateDirectory()
|
|
324
|
-
- validateSkillMd() - parse YAML frontmatter
|
|
325
|
-
- validateReferences()
|
|
326
|
-
- validateScripts() - check executable with fs.statSync()
|
|
327
|
-
- validateAssets()
|
|
328
|
-
- [ ] Use chalk for colored output
|
|
329
|
-
- [ ] Match Python emoji output exactly
|
|
330
|
-
- [ ] Support --strict flag
|
|
331
|
-
|
|
332
|
-
#### package.ts (from package_skill.py)
|
|
333
|
-
|
|
334
|
-
- [ ] Import archiver for zip creation
|
|
335
|
-
- [ ] Call validate.ts first (child_process.spawnSync)
|
|
336
|
-
- [ ] Create zip with exclusions:
|
|
337
|
-
- Hidden files (starts with .)
|
|
338
|
-
- .pyc, .pyo, .swp, ~
|
|
339
|
-
- **pycache**, .DS_Store
|
|
340
|
-
- [ ] Report file size in KB
|
|
341
|
-
- [ ] Match Python output format
|
|
342
|
-
|
|
343
|
-
### Phase 4: CLI Entry Point
|
|
344
|
-
|
|
345
|
-
#### index.ts
|
|
346
|
-
|
|
347
|
-
- [ ] Add shebang: `#!/usr/bin/env node`
|
|
348
|
-
- [ ] Import @clack/prompts
|
|
349
|
-
- [ ] Import commands (init, validate, package)
|
|
350
|
-
- [ ] Create interactive menu (like mcpick)
|
|
351
|
-
- "Create new skill"
|
|
352
|
-
- "Validate skill"
|
|
353
|
-
- "Package skill"
|
|
354
|
-
- "Exit"
|
|
355
|
-
- [ ] Handle command-line arguments (for non-interactive)
|
|
356
|
-
- [ ] Error handling with try/catch
|
|
357
|
-
|
|
358
|
-
### Phase 5: Testing
|
|
359
|
-
|
|
360
|
-
- [ ] Build: `pnpm build`
|
|
361
|
-
- [ ] Test init: `node dist/index.js init --name test-skill`
|
|
362
|
-
- [ ] Test validate: `node dist/index.js validate skills/skill-creator`
|
|
363
|
-
- [ ] Test package: `node dist/index.js package skills/skill-creator`
|
|
364
|
-
- [ ] Verify output matches Python version
|
|
365
|
-
|
|
366
|
-
### Phase 6: Publishing
|
|
367
|
-
|
|
368
|
-
- [ ] Setup .changeset config
|
|
369
|
-
- [ ] Add initial changeset
|
|
370
|
-
- [ ] Test with `pnpx` locally
|
|
371
|
-
- [ ] Publish to npm: `pnpm release`
|
|
372
|
-
- [ ] Update devhub-crm to use `pnpx claude-skills-cli`
|
|
185
|
+
- Use typed requests and responses
|
|
186
|
+
- Handle errors with try/catch
|
|
187
|
+
- Include authentication headers
|
|
373
188
|
|
|
374
|
-
|
|
189
|
+
## Reference Files
|
|
375
190
|
|
|
376
|
-
|
|
191
|
+
- [references/endpoints.md](references/endpoints.md) - Complete API reference
|
|
192
|
+
- [references/examples.md](references/examples.md) - Request/response examples
|
|
377
193
|
|
|
378
|
-
|
|
194
|
+
````
|
|
379
195
|
|
|
380
|
-
|
|
381
|
-
-
|
|
382
|
-
-
|
|
196
|
+
**Why it's good:**
|
|
197
|
+
- Description: 81 chars with trigger keywords ā
|
|
198
|
+
- Lines: ~25 lines ā
|
|
199
|
+
- Code blocks: 1 ā
|
|
200
|
+
- Has Quick Start section ā
|
|
201
|
+
- Links to references/ for details ā
|
|
383
202
|
|
|
384
|
-
###
|
|
203
|
+
### ā Bad Skill (Fails Validation)
|
|
385
204
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
-
|
|
205
|
+
```markdown
|
|
206
|
+
---
|
|
207
|
+
name: api-client
|
|
208
|
+
description: Comprehensive REST API client for making HTTP requests to our service endpoints including GET, POST, PUT, DELETE, PATCH operations with authentication, error handling, retries, rate limiting, and response caching for users, posts, comments, tags, categories, and settings endpoints.
|
|
209
|
+
---
|
|
389
210
|
|
|
390
|
-
|
|
211
|
+
# API Client
|
|
391
212
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
- Widely used, stable
|
|
213
|
+
[186 lines of detailed documentation with 7 code blocks...]
|
|
214
|
+
````
|
|
395
215
|
|
|
396
|
-
|
|
216
|
+
**Problems:**
|
|
397
217
|
|
|
398
|
-
-
|
|
399
|
-
-
|
|
400
|
-
-
|
|
218
|
+
- Description: 287 chars, no trigger keywords ā
|
|
219
|
+
- Lines: 186 (max 150) ā
|
|
220
|
+
- Code blocks: 7 (recommend 1-2) ā
|
|
221
|
+
- No Quick Start section ā
|
|
222
|
+
- Should split into references/ ā
|
|
401
223
|
|
|
402
|
-
|
|
224
|
+
## Development
|
|
403
225
|
|
|
404
|
-
|
|
226
|
+
```bash
|
|
227
|
+
# Install dependencies
|
|
228
|
+
npm install
|
|
405
229
|
|
|
406
|
-
|
|
230
|
+
# Build TypeScript
|
|
231
|
+
npm run build
|
|
407
232
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
- [ ] Exit codes match (0 = success, 1 = error)
|
|
411
|
-
- [ ] Emoji indicators work (ā
ā ā ļø)
|
|
412
|
-
- [ ] --strict mode works on validate
|
|
413
|
-
- [ ] --skip-validation works on package
|
|
414
|
-
- [ ] Created skills validate successfully
|
|
415
|
-
- [ ] Packaged zips can be uploaded to Claude.ai
|
|
416
|
-
- [ ] Works via `pnpx claude-skills-cli`
|
|
417
|
-
- [ ] Works when installed globally
|
|
233
|
+
# Run locally
|
|
234
|
+
node dist/index.js validate path/to/skill
|
|
418
235
|
|
|
419
|
-
|
|
236
|
+
# Format code
|
|
237
|
+
npm run format
|
|
238
|
+
|
|
239
|
+
# Type check
|
|
240
|
+
npx tsc --noEmit
|
|
241
|
+
```
|
|
420
242
|
|
|
421
243
|
## Resources
|
|
422
244
|
|
|
423
|
-
### Official
|
|
245
|
+
### Official Documentation
|
|
424
246
|
|
|
425
247
|
- [Agent Skills Overview](https://www.anthropic.com/news/skills)
|
|
426
248
|
- [Engineering Blog: Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills)
|
|
427
249
|
- [Claude Docs: Skills](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview)
|
|
428
|
-
- [Anthropic Skills
|
|
250
|
+
- [Anthropic Skills Repository](https://github.com/anthropics/skills)
|
|
429
251
|
|
|
430
|
-
### Included Documentation
|
|
252
|
+
### Included Documentation
|
|
431
253
|
|
|
432
254
|
- [docs/SKILLS-ARCHITECTURE.md](docs/SKILLS-ARCHITECTURE.md) - Progressive disclosure system
|
|
433
|
-
- [docs/SKILL-DEVELOPMENT.md](docs/SKILL-DEVELOPMENT.md) -
|
|
255
|
+
- [docs/SKILL-DEVELOPMENT.md](docs/SKILL-DEVELOPMENT.md) - Skill creation workflow
|
|
434
256
|
- [docs/SKILL-EXAMPLES.md](docs/SKILL-EXAMPLES.md) - Real-world examples
|
|
435
257
|
|
|
436
|
-
|
|
258
|
+
## License
|
|
437
259
|
|
|
438
|
-
|
|
260
|
+
MIT Ā© Scott Spence
|
|
439
261
|
|
|
440
|
-
|
|
262
|
+
## Contributing
|
|
441
263
|
|
|
442
|
-
|
|
264
|
+
Contributions welcome! This tool is designed to help Claude use skills efficiently. When proposing changes, consider:
|
|
443
265
|
|
|
444
|
-
1. **
|
|
445
|
-
2. **
|
|
446
|
-
3. **
|
|
447
|
-
4. **Convert Python scripts one by one:** Start with init.ts (simplest), then validate.ts, then package.ts
|
|
448
|
-
5. **Create index.ts:** Wire up commands with @clack/prompts menu
|
|
449
|
-
6. **Test everything:** Build and run against skill-creator to verify
|
|
450
|
-
|
|
451
|
-
**Key principle:** Match Python output and behavior EXACTLY. Users should not notice any difference except it's faster and more portable.
|
|
452
|
-
|
|
453
|
-
---
|
|
266
|
+
1. **Token efficiency** - Does this help reduce token usage?
|
|
267
|
+
2. **Ergonomics for Claude** - Is it easy for Claude to understand and use?
|
|
268
|
+
3. **Progressive disclosure** - Does it enforce the 3-level system?
|
|
454
269
|
|
|
455
|
-
|
|
270
|
+
See the feedback document at [CLI-FEEDBACK.md](CLI-FEEDBACK.md) for detailed validation requirements.
|
package/dist/core/templates.js
CHANGED
|
@@ -5,78 +5,50 @@ description: ${description}
|
|
|
5
5
|
|
|
6
6
|
# ${title}
|
|
7
7
|
|
|
8
|
-
<!-- ============================================ -->
|
|
9
|
-
<!-- PROGRESSIVE DISCLOSURE GUIDELINES -->
|
|
10
|
-
<!-- ============================================ -->
|
|
11
|
-
<!-- This file uses the 3-level loading system: -->
|
|
12
|
-
<!-- -->
|
|
13
|
-
<!-- Level 1: Metadata (above) - Always loaded -->
|
|
14
|
-
<!-- ~100 tokens: name + description -->
|
|
15
|
-
<!-- -->
|
|
16
|
-
<!-- Level 2: This body - Loaded when triggered -->
|
|
17
|
-
<!-- Recommended: <1000 words (<1300 tokens) -->
|
|
18
|
-
<!-- Maximum: <5000 words (<6500 tokens) -->
|
|
19
|
-
<!-- What to include: Quick start, core patterns-->
|
|
20
|
-
<!-- What to exclude: Full docs, many examples -->
|
|
21
|
-
<!-- -->
|
|
22
|
-
<!-- Level 3: references/ - Loaded as needed -->
|
|
23
|
-
<!-- Unlimited: Detailed guides, API docs, -->
|
|
24
|
-
<!-- extensive examples, schemas -->
|
|
25
|
-
<!-- ============================================ -->
|
|
26
|
-
|
|
27
8
|
## Quick Start
|
|
28
|
-
<!-- Keep this section under 300 words -->
|
|
29
|
-
<!-- Show the most common workflow only -->
|
|
30
9
|
|
|
31
|
-
[Provide
|
|
10
|
+
[Provide ONE minimal working example - the most common use case]
|
|
32
11
|
|
|
33
12
|
\`\`\`typescript
|
|
34
|
-
//
|
|
35
|
-
//
|
|
13
|
+
// Keep this concise - show essential code only
|
|
14
|
+
// Detailed examples go in references/examples.md
|
|
36
15
|
\`\`\`
|
|
37
16
|
|
|
38
|
-
## Core
|
|
39
|
-
<!-- Limit to 2-3 most frequently used patterns -->
|
|
40
|
-
<!-- Each pattern should be <200 words -->
|
|
41
|
-
|
|
42
|
-
### Pattern 1: [Most Common Pattern]
|
|
43
|
-
|
|
44
|
-
[Brief description with minimal example]
|
|
17
|
+
## Core Principles
|
|
45
18
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
- Principle 1: [Key concept]
|
|
20
|
+
- Principle 2: [Key concept]
|
|
21
|
+
- Principle 3: [Key concept]
|
|
49
22
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
[Brief description with minimal example]
|
|
53
|
-
|
|
54
|
-
\`\`\`typescript
|
|
55
|
-
// Essential code only
|
|
56
|
-
\`\`\`
|
|
23
|
+
## Common Patterns
|
|
57
24
|
|
|
58
|
-
|
|
25
|
+
### [Most Frequent Pattern]
|
|
59
26
|
|
|
60
|
-
|
|
61
|
-
ā
Do [correct approach]
|
|
27
|
+
[Brief description - keep under 100 words]
|
|
62
28
|
|
|
63
|
-
##
|
|
64
|
-
<!-- Link to Level 3 resources instead of including detailed content here -->
|
|
29
|
+
## Reference Files
|
|
65
30
|
|
|
66
|
-
For
|
|
67
|
-
- [references/detailed-guide.md](references/detailed-guide.md) - Complete
|
|
68
|
-
- [references/examples.md](references/examples.md) -
|
|
31
|
+
For detailed documentation, see:
|
|
32
|
+
- [references/detailed-guide.md](references/detailed-guide.md) - Complete guide
|
|
33
|
+
- [references/examples.md](references/examples.md) - Additional examples
|
|
69
34
|
|
|
70
35
|
## Scripts
|
|
71
36
|
|
|
72
|
-
|
|
73
|
-
- \`scripts/example.py\`: [What this script does]
|
|
37
|
+
- \`scripts/example.py\` - [What this script does]
|
|
74
38
|
|
|
75
39
|
## Notes
|
|
76
40
|
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
41
|
+
- Important note 1
|
|
42
|
+
- Important note 2
|
|
43
|
+
|
|
44
|
+
<!--
|
|
45
|
+
PROGRESSIVE DISCLOSURE GUIDELINES:
|
|
46
|
+
- Keep this file ~50 lines total (max ~150 lines)
|
|
47
|
+
- Use 1-2 code blocks only (recommend 1)
|
|
48
|
+
- Keep description <200 chars for Level 1 efficiency
|
|
49
|
+
- Move detailed docs to references/ for Level 3 loading
|
|
50
|
+
- This is Level 2 - quick reference ONLY, not a manual
|
|
51
|
+
-->
|
|
80
52
|
`;
|
|
81
53
|
export const REFERENCE_TEMPLATE = (title) => `# ${title} Reference
|
|
82
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACZ,WAAmB,EACnB,KAAa,EACb,EAAE,CAAC;QACG,IAAI;eACG,WAAW;;;IAGtB,KAAK
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACZ,WAAmB,EACnB,KAAa,EACb,EAAE,CAAC;QACG,IAAI;eACG,WAAW;;;IAGtB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CR,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsD9D,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC;;;;;aAKxC,QAAQ;;;;;;;;CAQpB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,KAAa,EACb,WAAmB,EACnB,EAAE,CAAC,KAAK,KAAK;;EAEb,WAAW;;;;;;;;;;;;CAYZ,CAAC"}
|
package/dist/core/validator.js
CHANGED
|
@@ -7,6 +7,9 @@ export class SkillValidator {
|
|
|
7
7
|
stats = {
|
|
8
8
|
word_count: 0,
|
|
9
9
|
estimated_tokens: 0,
|
|
10
|
+
line_count: 0,
|
|
11
|
+
description_length: 0,
|
|
12
|
+
description_tokens: 0,
|
|
10
13
|
code_blocks: 0,
|
|
11
14
|
sections: 0,
|
|
12
15
|
long_paragraphs: 0,
|
|
@@ -46,6 +49,48 @@ export class SkillValidator {
|
|
|
46
49
|
estimate_tokens(word_count) {
|
|
47
50
|
return Math.round(word_count * 1.3);
|
|
48
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Estimate tokens for a string by counting words and applying ratio
|
|
54
|
+
*/
|
|
55
|
+
estimate_string_tokens(text) {
|
|
56
|
+
const word_count = this.count_words(text);
|
|
57
|
+
return this.estimate_tokens(word_count);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Validate Level 1 (Description in frontmatter) for progressive disclosure
|
|
61
|
+
*/
|
|
62
|
+
validate_description(description) {
|
|
63
|
+
const desc_length = description.length;
|
|
64
|
+
const desc_tokens = this.estimate_string_tokens(description);
|
|
65
|
+
// Store stats
|
|
66
|
+
this.stats.description_length = desc_length;
|
|
67
|
+
this.stats.description_tokens = desc_tokens;
|
|
68
|
+
// Level 1 progressive disclosure checks
|
|
69
|
+
// Recommended: <200 chars, <30 tokens for optimal Level 1 efficiency
|
|
70
|
+
if (desc_length > 300) {
|
|
71
|
+
this.error(`Description is ${desc_length} characters (MAX: 300 for Level 1)\n` +
|
|
72
|
+
` ā Level 1 is always loaded - keep it concise for token efficiency`);
|
|
73
|
+
}
|
|
74
|
+
else if (desc_length > 200) {
|
|
75
|
+
this.warning(`Description is ${desc_length} characters (recommended: <200 for Level 1)\n` +
|
|
76
|
+
` ā Estimated ~${desc_tokens} tokens - consider shortening for efficiency`);
|
|
77
|
+
}
|
|
78
|
+
// Check for trigger keywords
|
|
79
|
+
const lower_desc = description.toLowerCase();
|
|
80
|
+
const has_trigger = lower_desc.includes('use when') ||
|
|
81
|
+
lower_desc.includes('use for') ||
|
|
82
|
+
lower_desc.includes('use to');
|
|
83
|
+
if (!has_trigger) {
|
|
84
|
+
this.warning(`Description missing trigger keywords ('Use when...', 'Use for...', 'Use to...')\n` +
|
|
85
|
+
` ā Help Claude know when to activate this skill`);
|
|
86
|
+
}
|
|
87
|
+
// Check for list bloat (multiple commas indicating detailed lists)
|
|
88
|
+
const comma_count = (description.match(/,/g) || []).length;
|
|
89
|
+
if (comma_count >= 3) {
|
|
90
|
+
this.warning(`Description contains long lists (${comma_count} commas)\n` +
|
|
91
|
+
` ā Move detailed lists to Level 2 (SKILL.md body) or Level 3 (references/)`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
49
94
|
/**
|
|
50
95
|
* Analyze content structure and patterns
|
|
51
96
|
*/
|
|
@@ -64,13 +109,15 @@ export class SkillValidator {
|
|
|
64
109
|
}).length;
|
|
65
110
|
}
|
|
66
111
|
/**
|
|
67
|
-
* Validate progressive disclosure (word count and
|
|
112
|
+
* Validate progressive disclosure (word count, token budget, and line count)
|
|
68
113
|
*/
|
|
69
114
|
validate_progressive_disclosure(body) {
|
|
70
115
|
const word_count = this.count_words(body);
|
|
71
116
|
const estimated_tokens = this.estimate_tokens(word_count);
|
|
117
|
+
const line_count = body.trim().split('\n').length;
|
|
72
118
|
this.stats.word_count = word_count;
|
|
73
119
|
this.stats.estimated_tokens = estimated_tokens;
|
|
120
|
+
this.stats.line_count = line_count;
|
|
74
121
|
// Hard limit check (error)
|
|
75
122
|
if (word_count > this.MAX_WORDS) {
|
|
76
123
|
this.error(`SKILL.md body has ${word_count} words (MAX: ${this.MAX_WORDS} per Anthropic guidelines)\n` +
|
|
@@ -81,19 +128,44 @@ export class SkillValidator {
|
|
|
81
128
|
this.warning(`SKILL.md body has ${word_count} words (recommended: <${this.RECOMMENDED_WORDS})\n` +
|
|
82
129
|
` ā Consider moving examples/docs to references/ for better token efficiency`);
|
|
83
130
|
}
|
|
131
|
+
// Line count validation (Level 2 progressive disclosure)
|
|
132
|
+
// Target: ~50 lines, Warn: >80, Error: >150
|
|
133
|
+
if (line_count > 150) {
|
|
134
|
+
this.error(`SKILL.md body is ${line_count} lines (MAX: ~150 for Level 2 progressive disclosure)\n` +
|
|
135
|
+
` ā Move detailed content to references/ directory\n` +
|
|
136
|
+
` ā Target: ~50 lines for optimal scannability`);
|
|
137
|
+
}
|
|
138
|
+
else if (line_count > 80) {
|
|
139
|
+
this.warning(`SKILL.md body is ${line_count} lines (recommended: ~50, max: ~80)\n` +
|
|
140
|
+
` ā Consider moving detailed examples to references/ for Level 3 loading`);
|
|
141
|
+
}
|
|
84
142
|
// Content analysis warnings
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
143
|
+
// Code blocks: Recommend 1-2, warn at >3
|
|
144
|
+
if (this.stats.code_blocks > 3) {
|
|
145
|
+
this.warning(`SKILL.md contains ${this.stats.code_blocks} code examples (recommended: 1-2)\n` +
|
|
146
|
+
` ā Move additional examples to references/examples.md for Level 3 loading`);
|
|
88
147
|
}
|
|
148
|
+
// Long paragraphs
|
|
89
149
|
if (this.stats.long_paragraphs > 3) {
|
|
90
|
-
this.warning(`SKILL.md contains ${this.stats.long_paragraphs} lengthy paragraphs\n` +
|
|
150
|
+
this.warning(`SKILL.md contains ${this.stats.long_paragraphs} lengthy paragraphs (>100 words)\n` +
|
|
91
151
|
` ā Consider moving detailed explanations to references/`);
|
|
92
152
|
}
|
|
93
|
-
|
|
94
|
-
|
|
153
|
+
// Sections: Recommend 3-5, warn at >8
|
|
154
|
+
if (this.stats.sections > 8) {
|
|
155
|
+
this.warning(`SKILL.md contains ${this.stats.sections} sections (recommended: 3-5)\n` +
|
|
95
156
|
` ā Consider splitting into focused reference files`);
|
|
96
157
|
}
|
|
158
|
+
// Check for "Quick Start" section
|
|
159
|
+
if (!body.includes('## Quick Start') && !body.includes('## Quick start')) {
|
|
160
|
+
this.warning(`Missing "## Quick Start" section\n` +
|
|
161
|
+
` ā Add one minimal working example to help Claude get started quickly`);
|
|
162
|
+
}
|
|
163
|
+
// Check for references/ links when body is long
|
|
164
|
+
const has_references = body.includes('references/');
|
|
165
|
+
if (!has_references && line_count > 60) {
|
|
166
|
+
this.warning(`No references/ links found but SKILL.md is ${line_count} lines\n` +
|
|
167
|
+
` ā Consider splitting detailed content into reference files`);
|
|
168
|
+
}
|
|
97
169
|
}
|
|
98
170
|
validate_directory() {
|
|
99
171
|
if (!existsSync(this.skill_path)) {
|
|
@@ -158,18 +230,16 @@ export class SkillValidator {
|
|
|
158
230
|
const desc_match = frontmatter.match(/description:\s*(.+?)(?=\n[a-z]+:|$)/s);
|
|
159
231
|
if (desc_match) {
|
|
160
232
|
const description = desc_match[1].trim();
|
|
161
|
-
//
|
|
233
|
+
// Hard limit check (Anthropic requirement)
|
|
162
234
|
if (description.length > 1024) {
|
|
163
|
-
this.error(`Description too long (max 1024 chars): ${description.length}`);
|
|
235
|
+
this.error(`Description too long (max 1024 chars per Anthropic): ${description.length}`);
|
|
164
236
|
}
|
|
237
|
+
// Short description check
|
|
165
238
|
if (description.length < 20) {
|
|
166
239
|
this.warning('Description is very short (consider adding more detail)');
|
|
167
240
|
}
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
if (!lower_desc.includes('when') && !lower_desc.includes('use')) {
|
|
171
|
-
this.warning("Consider adding 'when to use' guidance to description");
|
|
172
|
-
}
|
|
241
|
+
// Comprehensive Level 1 validation
|
|
242
|
+
this.validate_description(description);
|
|
173
243
|
}
|
|
174
244
|
// Validate progressive disclosure (word count, token budget)
|
|
175
245
|
this.validate_progressive_disclosure(body);
|
|
@@ -189,6 +259,8 @@ export class SkillValidator {
|
|
|
189
259
|
}
|
|
190
260
|
validate_references() {
|
|
191
261
|
const references_dir = join(this.skill_path, 'references');
|
|
262
|
+
const skill_md_path = join(this.skill_path, 'SKILL.md');
|
|
263
|
+
// Check references directory if it exists
|
|
192
264
|
if (existsSync(references_dir)) {
|
|
193
265
|
const files = readdirSync(references_dir);
|
|
194
266
|
const md_files = files.filter((f) => f.endsWith('.md'));
|
|
@@ -196,7 +268,6 @@ export class SkillValidator {
|
|
|
196
268
|
this.warning('references/ directory exists but is empty');
|
|
197
269
|
}
|
|
198
270
|
// Check for references in SKILL.md
|
|
199
|
-
const skill_md_path = join(this.skill_path, 'SKILL.md');
|
|
200
271
|
if (existsSync(skill_md_path)) {
|
|
201
272
|
const skill_content = readFileSync(skill_md_path, 'utf-8');
|
|
202
273
|
for (const md_file of md_files) {
|
|
@@ -206,6 +277,24 @@ export class SkillValidator {
|
|
|
206
277
|
}
|
|
207
278
|
}
|
|
208
279
|
}
|
|
280
|
+
// Level 3 validation: Check that all referenced files exist
|
|
281
|
+
if (existsSync(skill_md_path)) {
|
|
282
|
+
const skill_content = readFileSync(skill_md_path, 'utf-8');
|
|
283
|
+
// Extract markdown links to references/ directory
|
|
284
|
+
// Matches: [text](references/file.md) or [text](references/subdir/file.md)
|
|
285
|
+
const reference_link_pattern = /\[([^\]]+)\]\((references\/[^)]+\.md)\)/g;
|
|
286
|
+
const matches = skill_content.matchAll(reference_link_pattern);
|
|
287
|
+
for (const match of matches) {
|
|
288
|
+
const link_text = match[1];
|
|
289
|
+
const file_path = match[2]; // e.g., "references/examples.md"
|
|
290
|
+
const full_path = join(this.skill_path, file_path);
|
|
291
|
+
if (!existsSync(full_path)) {
|
|
292
|
+
this.error(`Referenced file not found: ${file_path}\n` +
|
|
293
|
+
` ā Linked from: [${link_text}]\n` +
|
|
294
|
+
` ā Create the file or remove the broken link`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
209
298
|
return true;
|
|
210
299
|
}
|
|
211
300
|
validate_scripts() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,MAAM,OAAO,cAAc;IACjB,UAAU,CAAS;IACnB,MAAM,GAAa,EAAE,CAAC;IACtB,QAAQ,GAAa,EAAE,CAAC;IACxB,KAAK,GAAoB;QAC/B,UAAU,EAAE,CAAC;QACb,gBAAgB,EAAE,CAAC;QACnB,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,CAAC;QACX,eAAe,EAAE,CAAC;KACnB,CAAC;IAEF,4DAA4D;IAC3C,SAAS,GAAG,IAAI,CAAC,CAAC,aAAa;IAC/B,iBAAiB,GAAG,IAAI,CAAC,CAAC,aAAa;IACvC,WAAW,GAAG,GA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,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;YAEtC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,IAAI,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,YAAY;QACjB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC/B,OAAO;gBACL,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,KAAK;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAClC,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,YAAY;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
|
package/dist/utils/output.js
CHANGED
|
@@ -12,6 +12,26 @@ export const search = (msg) => console.log(`š ${msg}`);
|
|
|
12
12
|
*/
|
|
13
13
|
export function display_validation_stats(stats) {
|
|
14
14
|
console.log(chalk.cyan('\nš Progressive Disclosure Stats:'));
|
|
15
|
+
// Level 1: Description
|
|
16
|
+
console.log(chalk.bold('\n Level 1 (Metadata - Always Loaded):'));
|
|
17
|
+
const desc_status = stats.description_length <= 200
|
|
18
|
+
? chalk.green('ā
Optimal')
|
|
19
|
+
: stats.description_length <= 300
|
|
20
|
+
? chalk.yellow('ā ļø Long')
|
|
21
|
+
: chalk.red('ā Too long');
|
|
22
|
+
console.log(` Description: ${stats.description_length} chars, ~${stats.description_tokens} tokens ${desc_status}`);
|
|
23
|
+
console.log(` ${chalk.dim('(Target: <200 chars, <30 tokens for Level 1 efficiency)')}`);
|
|
24
|
+
// Level 2: SKILL.md Body
|
|
25
|
+
console.log(chalk.bold('\n Level 2 (SKILL.md Body - Loaded when triggered):'));
|
|
26
|
+
// Line count
|
|
27
|
+
const line_status = stats.line_count <= 50
|
|
28
|
+
? chalk.green('ā
Excellent')
|
|
29
|
+
: stats.line_count <= 80
|
|
30
|
+
? chalk.green('ā
Good')
|
|
31
|
+
: stats.line_count <= 150
|
|
32
|
+
? chalk.yellow('ā ļø Consider splitting')
|
|
33
|
+
: chalk.red('ā Too large');
|
|
34
|
+
console.log(` Lines: ${stats.line_count} (target: ~50, max: ~150) ${line_status}`);
|
|
15
35
|
// Word count with recommendations
|
|
16
36
|
const word_status = stats.word_count < 500
|
|
17
37
|
? chalk.green('ā
Excellent')
|
|
@@ -20,40 +40,50 @@ export function display_validation_stats(stats) {
|
|
|
20
40
|
: stats.word_count < 5000
|
|
21
41
|
? chalk.yellow('ā ļø Consider splitting')
|
|
22
42
|
: chalk.red('ā Too large');
|
|
23
|
-
console.log(`
|
|
43
|
+
console.log(` Words: ${stats.word_count} (recommended: <1000, max: <5000) ${word_status}`);
|
|
24
44
|
// Token estimation
|
|
25
45
|
const token_budget = 6500; // Level 2 budget (~5000 words * 1.3)
|
|
26
46
|
const token_status = stats.estimated_tokens < token_budget
|
|
27
47
|
? chalk.green('within budget')
|
|
28
48
|
: chalk.red('exceeds budget');
|
|
29
|
-
console.log(`
|
|
49
|
+
console.log(` Est. tokens: ~${stats.estimated_tokens} (budget: <${token_budget}) ${token_status}`);
|
|
30
50
|
// Code blocks
|
|
31
|
-
const code_status = stats.code_blocks >
|
|
32
|
-
? chalk.yellow(' (
|
|
33
|
-
:
|
|
34
|
-
|
|
51
|
+
const code_status = stats.code_blocks > 3
|
|
52
|
+
? chalk.yellow(' (recommended: 1-2)')
|
|
53
|
+
: stats.code_blocks <= 2
|
|
54
|
+
? chalk.green(' ā
')
|
|
55
|
+
: '';
|
|
56
|
+
console.log(` Code blocks: ${stats.code_blocks}${code_status}`);
|
|
35
57
|
// Sections
|
|
36
|
-
const section_status = stats.sections >
|
|
37
|
-
|
|
58
|
+
const section_status = stats.sections > 8
|
|
59
|
+
? chalk.yellow(' (recommended: 3-5)')
|
|
60
|
+
: stats.sections >= 3 && stats.sections <= 5
|
|
61
|
+
? chalk.green(' ā
')
|
|
62
|
+
: '';
|
|
63
|
+
console.log(` Sections: ${stats.sections}${section_status}`);
|
|
38
64
|
// Long paragraphs
|
|
39
65
|
if (stats.long_paragraphs > 0) {
|
|
40
66
|
const para_status = stats.long_paragraphs > 3
|
|
41
67
|
? chalk.yellow(' (consider moving to references/)')
|
|
42
68
|
: '';
|
|
43
|
-
console.log(`
|
|
69
|
+
console.log(` Long paragraphs: ${stats.long_paragraphs}${para_status}`);
|
|
44
70
|
}
|
|
71
|
+
// Level 3 info
|
|
72
|
+
console.log(chalk.bold('\n Level 3+ (References - Loaded as needed):'));
|
|
73
|
+
console.log(` ${chalk.dim('Use references/ directory for detailed docs (unlimited size)')}`);
|
|
45
74
|
// Overall assessment
|
|
46
|
-
|
|
47
|
-
|
|
75
|
+
console.log(chalk.bold('\n Overall Assessment:'));
|
|
76
|
+
if (stats.line_count <= 50 && stats.description_length <= 200) {
|
|
77
|
+
console.log(chalk.green(' ā
Excellent progressive disclosure!'));
|
|
48
78
|
}
|
|
49
|
-
else if (stats.
|
|
50
|
-
console.log(chalk.green('
|
|
79
|
+
else if (stats.line_count <= 80 && stats.description_length <= 300) {
|
|
80
|
+
console.log(chalk.green(' ā
Good progressive disclosure'));
|
|
51
81
|
}
|
|
52
|
-
else if (stats.word_count < 5000) {
|
|
53
|
-
console.log(chalk.yellow('
|
|
82
|
+
else if (stats.line_count <= 150 && stats.word_count < 5000) {
|
|
83
|
+
console.log(chalk.yellow(' ā ļø Consider splitting content into references/'));
|
|
54
84
|
}
|
|
55
85
|
else {
|
|
56
|
-
console.log(chalk.red('
|
|
86
|
+
console.log(chalk.red(' ā Violates progressive disclosure (move content to references/)'));
|
|
57
87
|
}
|
|
58
88
|
}
|
|
59
89
|
//# sourceMappingURL=output.js.map
|
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,CA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