claude-skills-cli 0.0.1 → 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 CHANGED
@@ -1,455 +1,270 @@
1
1
  # claude-skills-cli
2
2
 
3
- TypeScript CLI toolkit for creating, validating, and packaging Claude skills.
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 portable command-line tool for managing Claude Agent Skills, inspired by tools like `create-next-app` and `create-vite`. Install once, use anywhere:
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
- pnpx claude-skills-cli init --name my-skill --description "..."
15
- pnpx claude-skills-cli validate .claude/skills/my-skill
16
- pnpx claude-skills-cli package .claude/skills/my-skill
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
- This replaces the Python scripts that were previously in project `.claude/scripts/` directories.
20
-
21
- ---
22
-
23
- ## Repository Structure (Planned)
16
+ ## Commands
24
17
 
25
- Following the **mcpick** pattern:
18
+ ### `init` - Create a new skill
26
19
 
27
- ```
28
- claude-skills-cli/
29
- ā”œā”€ā”€ package.json # CLI package config
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
- ## Files to Move from devhub-crm
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 `.claude/` directory was copied wholesale, but needs reorganization:
33
+ The generated SKILL.md template follows best practices:
72
34
 
73
- ### āœ… Keep and Move to Root:
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
- devhub-crm/.claude/docs/ → claude-skills-cli/docs/
77
- devhub-crm/.claude/templates/ → claude-skills-cli/templates/
78
- devhub-crm/.claude/skills/skill-creator/ → claude-skills-cli/skills/skill-creator/
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
- ### āœ… Convert to TypeScript:
47
+ **Progressive Disclosure Validation** (3-Level System):
82
48
 
83
- ```
84
- devhub-crm/.claude/scripts/init_skill.py → src/commands/init.ts
85
- devhub-crm/.claude/scripts/validate_skill.py → src/commands/validate.ts
86
- devhub-crm/.claude/scripts/package_skill.py → src/commands/package.ts
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
- ### āŒ Delete (Not Needed):
55
+ **Validation Output:**
56
+
57
+ The validator displays a detailed progressive disclosure stats breakdown:
90
58
 
91
59
  ```
92
- devhub-crm/.claude/settings.local.json # Project-specific
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
- ## package.json Configuration
100
-
101
- ```json
102
- {
103
- "name": "claude-skills-cli",
104
- "version": "0.0.1",
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
- ## tsconfig.json Configuration
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
- ## Dependencies Explained
82
+ - 0 = Valid (or valid with warnings)
83
+ - 1 = Validation errors
84
+ - 1 with `--strict` = Warnings treated as errors
167
85
 
168
- ### Runtime Dependencies:
86
+ ### `package` - Create uploadable zip
169
87
 
170
- - **@clack/prompts** - Interactive CLI prompts (like mcpick uses)
171
- - **chalk** - Terminal string styling and colors
172
- - **archiver** - Create zip files (replaces Python's zipfile)
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
- ### Dev Dependencies:
94
+ Creates a zip file ready to upload to Claude.ai, excluding:
175
95
 
176
- - **@changesets/cli** - Version management and changelog
177
- - **@types/node** - TypeScript types for Node.js
178
- - **@types/archiver** - TypeScript types for archiver
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
- ## CLI Interface (Must Match Python Version)
102
+ ## The Progressive Disclosure System
185
103
 
186
- ### Command: init
104
+ Claude Skills use a 3-level loading system to optimize token usage:
187
105
 
188
- ```bash
189
- claude-skills init --name my-skill --description "What it does and when to use it"
190
- claude-skills init --path /custom/path/my-skill
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
- **Creates:**
112
+ ### Why This Matters
194
113
 
195
- - SKILL.md with YAML frontmatter
196
- - README.md
197
- - references/detailed-guide.md
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
- **Output:**
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
- Next steps:
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
- Validate with: claude-skills validate .claude/skills/my-skill
124
+ ```bash
125
+ npm install claude-skills-cli --save-dev
213
126
  ```
214
127
 
215
- ### Command: validate
128
+ ### Global installation:
216
129
 
217
130
  ```bash
218
- claude-skills validate .claude/skills/my-skill
219
- claude-skills validate .claude/skills/my-skill --strict
131
+ npm install -g claude-skills-cli
220
132
  ```
221
133
 
222
- **Checks:**
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
- āš ļø Warnings:
240
- āš ļø Reference file 'schema.md' not mentioned in SKILL.md
140
+ ## Example Workflow
241
141
 
242
- āœ… Skill is valid (with warnings)
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
- **Exit codes:**
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
- - 0 = success
248
- - 1 = validation failed
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
- ### Command: package
155
+ # 4. Fix any warnings (or use --strict to enforce)
156
+ npx claude-skills validate .claude/skills/database-queries --strict
252
157
 
253
- ```bash
254
- claude-skills package .claude/skills/my-skill
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
- **Creates:**
162
+ ## Validation Best Practices
260
163
 
261
- - Zip file with skill contents
262
- - Excludes hidden files, .pyc, **pycache**, etc.
263
- - Runs validation first (unless --skip-validation)
164
+ ### āœ… Good Skill (Passes Validation)
264
165
 
265
- **Output:**
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
- šŸ“¦ Packaging skill: my-skill
272
- + my-skill/SKILL.md
273
- + my-skill/README.md
274
- + my-skill/references/detailed-guide.md
174
+ ## Quick Start
275
175
 
276
- āœ… Skill packaged successfully!
277
- File: dist/my-skill.zip
278
- Size: 12.3 KB
176
+ ```typescript
177
+ import { apiClient } from '$lib/api';
279
178
 
280
- šŸ“¤ Upload to Claude.ai: Settings > Features > Skills > Upload
179
+ const response = await apiClient.get('/users');
281
180
  ```
181
+ ````
282
182
 
283
- ---
183
+ ## Core Principles
284
184
 
285
- ## Implementation Roadmap
286
-
287
- ### Phase 1: Setup (You're here!)
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
- ## Design Decisions
191
+ - [references/endpoints.md](references/endpoints.md) - Complete API reference
192
+ - [references/examples.md](references/examples.md) - Request/response examples
377
193
 
378
- ### Why @clack/prompts instead of commander?
194
+ ````
379
195
 
380
- - mcpick uses @clack/prompts for beautiful interactive menus
381
- - Provides better UX than raw commander arguments
382
- - Still support non-interactive mode with args
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
- ### Why archiver instead of node:zlib?
203
+ ### āŒ Bad Skill (Fails Validation)
385
204
 
386
- - archiver is battle-tested for creating zips
387
- - Handles file permissions, directory structure
388
- - Direct replacement for Python's zipfile
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
- ### Why chalk for colors?
211
+ # API Client
391
212
 
392
- - Match Python's emoji output (āœ… āŒ āš ļø)
393
- - Better terminal color support
394
- - Widely used, stable
213
+ [186 lines of detailed documentation with 7 code blocks...]
214
+ ````
395
215
 
396
- ### Why ES modules (type: "module")?
216
+ **Problems:**
397
217
 
398
- - Modern Node.js best practice
399
- - Matches mcpick setup
400
- - Better tree-shaking, cleaner imports
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
- ## Testing Checklist
226
+ ```bash
227
+ # Install dependencies
228
+ npm install
405
229
 
406
- Before publishing v1.0.0:
230
+ # Build TypeScript
231
+ npm run build
407
232
 
408
- - [ ] All three commands work (init, validate, package)
409
- - [ ] Output matches Python version exactly
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 Anthropic Documentation:
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 Repo](https://github.com/anthropics/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) - 6-step creation workflow
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
- ### Reference Implementation:
258
+ ## License
437
259
 
438
- - [mcpick](https://github.com/spences10/mcpick) - Similar CLI structure to follow
260
+ MIT Ā© Scott Spence
439
261
 
440
- ---
262
+ ## Contributing
441
263
 
442
- ## Notes for Next Chat Session
264
+ Contributions welcome! This tool is designed to help Claude use skills efficiently. When proposing changes, consider:
443
265
 
444
- 1. **Start with setup:** Create package.json and tsconfig.json first
445
- 2. **Install deps:** `pnpm install` to get @clack/prompts, chalk, archiver
446
- 3. **Reorganize files:** Move docs/, templates/, skills/ from .claude/ to root
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
- **Ready to build!** šŸš€
270
+ See the feedback document at [CLI-FEEDBACK.md](CLI-FEEDBACK.md) for detailed validation requirements.
@@ -1,6 +1,6 @@
1
1
  import { basename } from 'path';
2
2
  import { SkillValidator } from '../core/validator.js';
3
- import { info, error, success } from '../utils/output.js';
3
+ import { display_validation_stats, error, info, success, } from '../utils/output.js';
4
4
  export function validate_command(options) {
5
5
  const { skill_path, strict } = options;
6
6
  const skill_name = basename(skill_path);
@@ -8,6 +8,10 @@ export function validate_command(options) {
8
8
  console.log('='.repeat(60));
9
9
  const validator = new SkillValidator(skill_path);
10
10
  const result = validator.validate_all();
11
+ // Display progressive disclosure stats
12
+ if (result.stats) {
13
+ display_validation_stats(result.stats);
14
+ }
11
15
  // Print errors
12
16
  if (result.errors.length > 0) {
13
17
  console.log('\nāŒ Errors:');
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAW,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEnE,MAAM,UAAU,gBAAgB,CAAC,OAAwB;IACvD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAExC,IAAI,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5B,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;IAExC,eAAe;IACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,iBAAiB;IACjB,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,iBAAiB,CA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AQ,CAAC,MAAM,EAAE,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7B,CAAC;SAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC5C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,KAAK,CAAC,gCAAgC,MAAM,CAAC,MAAM,CAAC,MAAM,WAAW,CAAC,CAAC;IACzE,CAAC;IAED,oBAAoB;IACpB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -5,58 +5,105 @@ description: ${description}
5
5
 
6
6
  # ${title}
7
7
 
8
- ## Overview
9
-
10
- [Provide a brief overview of what this skill does and when to use it]
11
-
12
8
  ## Quick Start
13
9
 
10
+ [Provide ONE minimal working example - the most common use case]
11
+
14
12
  \`\`\`typescript
15
- // Example code showing basic usage
13
+ // Keep this concise - show essential code only
14
+ // Detailed examples go in references/examples.md
16
15
  \`\`\`
17
16
 
18
- ## Core Patterns
17
+ ## Core Principles
19
18
 
20
- ### Pattern 1: [Name]
19
+ - Principle 1: [Key concept]
20
+ - Principle 2: [Key concept]
21
+ - Principle 3: [Key concept]
21
22
 
22
- [Describe the pattern]
23
+ ## Common Patterns
23
24
 
24
- \`\`\`typescript
25
- // Code example
26
- \`\`\`
27
-
28
- ### Pattern 2: [Name]
25
+ ### [Most Frequent Pattern]
29
26
 
30
- [Describe the pattern]
27
+ [Brief description - keep under 100 words]
31
28
 
32
- \`\`\`typescript
33
- // Code example
34
- \`\`\`
29
+ ## Reference Files
35
30
 
36
- ## Advanced Usage
37
-
38
- For detailed information, see:
39
- - [references/detailed-guide.md](references/detailed-guide.md)
40
- - [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
41
34
 
42
35
  ## Scripts
43
36
 
44
- - \`scripts/example.py\`: Description of what this script does
37
+ - \`scripts/example.py\` - [What this script does]
45
38
 
46
39
  ## Notes
47
40
 
48
41
  - Important note 1
49
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
+ -->
50
52
  `;
51
53
  export const REFERENCE_TEMPLATE = (title) => `# ${title} Reference
52
54
 
53
- ## Section 1
55
+ <!-- This is a Level 3 resource file -->
56
+ <!-- It's loaded on-demand when Claude needs detailed information -->
57
+ <!-- No size limits - include comprehensive documentation here -->
58
+
59
+ ## Overview
60
+
61
+ [Detailed explanation of this topic]
62
+
63
+ ## Complete Examples
64
+
65
+ ### Example 1: [Scenario]
66
+
67
+ [Comprehensive example with full context]
68
+
69
+ \`\`\`typescript
70
+ // Detailed code with comments
71
+ // Include edge cases and variations
72
+ \`\`\`
73
+
74
+ ### Example 2: [Scenario]
75
+
76
+ [Another detailed example]
77
+
78
+ \`\`\`typescript
79
+ // More extensive code
80
+ \`\`\`
81
+
82
+ ## Advanced Topics
83
+
84
+ [Deep dive into complex aspects]
85
+
86
+ ## API Reference
87
+
88
+ [Complete API documentation if applicable]
89
+
90
+ ## Best Practices
91
+
92
+ - [Detailed best practice 1]
93
+ - [Detailed best practice 2]
94
+ - [Detailed best practice 3]
95
+
96
+ ## Troubleshooting
97
+
98
+ ### Issue 1
54
99
 
55
- Content here...
100
+ **Problem:** [Description]
101
+ **Solution:** [Detailed solution]
56
102
 
57
- ## Section 2
103
+ ### Issue 2
58
104
 
59
- Content here...
105
+ **Problem:** [Description]
106
+ **Solution:** [Detailed solution]
60
107
  `;
61
108
  export const SCRIPT_TEMPLATE = (filename) => `#!/usr/bin/env python3
62
109
  """
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CR,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,KAAK;;;;;;;;;CAS9D,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"}
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"}
@@ -1,9 +1,23 @@
1
- import { readFileSync, existsSync, statSync, readdirSync } from 'fs';
1
+ import { existsSync, readdirSync, readFileSync, statSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  export class SkillValidator {
4
4
  skill_path;
5
5
  errors = [];
6
6
  warnings = [];
7
+ stats = {
8
+ word_count: 0,
9
+ estimated_tokens: 0,
10
+ line_count: 0,
11
+ description_length: 0,
12
+ description_tokens: 0,
13
+ code_blocks: 0,
14
+ sections: 0,
15
+ long_paragraphs: 0,
16
+ };
17
+ // Progressive disclosure limits (from Anthropic guidelines)
18
+ MAX_WORDS = 5000; // Hard limit
19
+ RECOMMENDED_WORDS = 1000; // Sweet spot
20
+ IDEAL_WORDS = 500; // Minimal but effective
7
21
  constructor(skill_path) {
8
22
  this.skill_path = skill_path;
9
23
  }
@@ -13,6 +27,146 @@ export class SkillValidator {
13
27
  warning(msg) {
14
28
  this.warnings.push(`āš ļø ${msg}`);
15
29
  }
30
+ /**
31
+ * Extract body content from SKILL.md (excluding YAML frontmatter)
32
+ */
33
+ extract_body(content) {
34
+ const parts = content.split('---\n');
35
+ return parts.length >= 3 ? parts.slice(2).join('---\n').trim() : content;
36
+ }
37
+ /**
38
+ * Count words in text
39
+ */
40
+ count_words(text) {
41
+ return text
42
+ .trim()
43
+ .split(/\s+/)
44
+ .filter((w) => w.length > 0).length;
45
+ }
46
+ /**
47
+ * Estimate tokens (rough approximation: 1 word ā‰ˆ 1.3 tokens for English)
48
+ */
49
+ estimate_tokens(word_count) {
50
+ return Math.round(word_count * 1.3);
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
+ }
94
+ /**
95
+ * Analyze content structure and patterns
96
+ */
97
+ analyze_content(body) {
98
+ // Count code blocks
99
+ const code_block_matches = body.match(/```[\s\S]*?```/g);
100
+ this.stats.code_blocks = code_block_matches ? code_block_matches.length : 0;
101
+ // Count markdown sections (headings)
102
+ const heading_matches = body.match(/^#{1,6}\s/gm);
103
+ this.stats.sections = heading_matches ? heading_matches.length : 0;
104
+ // Count long paragraphs (>100 words)
105
+ const paragraphs = body.split(/\n\n+/);
106
+ this.stats.long_paragraphs = paragraphs.filter((p) => {
107
+ const words = this.count_words(p);
108
+ return words > 100;
109
+ }).length;
110
+ }
111
+ /**
112
+ * Validate progressive disclosure (word count, token budget, and line count)
113
+ */
114
+ validate_progressive_disclosure(body) {
115
+ const word_count = this.count_words(body);
116
+ const estimated_tokens = this.estimate_tokens(word_count);
117
+ const line_count = body.trim().split('\n').length;
118
+ this.stats.word_count = word_count;
119
+ this.stats.estimated_tokens = estimated_tokens;
120
+ this.stats.line_count = line_count;
121
+ // Hard limit check (error)
122
+ if (word_count > this.MAX_WORDS) {
123
+ this.error(`SKILL.md body has ${word_count} words (MAX: ${this.MAX_WORDS} per Anthropic guidelines)\n` +
124
+ ` → Move detailed content to references/ directory for Level 3 loading`);
125
+ }
126
+ // Recommended limit check (warning)
127
+ else if (word_count > this.RECOMMENDED_WORDS) {
128
+ this.warning(`SKILL.md body has ${word_count} words (recommended: <${this.RECOMMENDED_WORDS})\n` +
129
+ ` → Consider moving examples/docs to references/ for better token efficiency`);
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
+ }
142
+ // Content analysis warnings
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`);
147
+ }
148
+ // Long paragraphs
149
+ if (this.stats.long_paragraphs > 3) {
150
+ this.warning(`SKILL.md contains ${this.stats.long_paragraphs} lengthy paragraphs (>100 words)\n` +
151
+ ` → Consider moving detailed explanations to references/`);
152
+ }
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` +
156
+ ` → Consider splitting into focused reference files`);
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
+ }
169
+ }
16
170
  validate_directory() {
17
171
  if (!existsSync(this.skill_path)) {
18
172
  this.error(`Skill directory does not exist: ${this.skill_path}`);
@@ -76,19 +230,21 @@ export class SkillValidator {
76
230
  const desc_match = frontmatter.match(/description:\s*(.+?)(?=\n[a-z]+:|$)/s);
77
231
  if (desc_match) {
78
232
  const description = desc_match[1].trim();
79
- // Check description length
233
+ // Hard limit check (Anthropic requirement)
80
234
  if (description.length > 1024) {
81
- this.error(`Description too long (max 1024 chars): ${description.length}`);
235
+ this.error(`Description too long (max 1024 chars per Anthropic): ${description.length}`);
82
236
  }
237
+ // Short description check
83
238
  if (description.length < 20) {
84
239
  this.warning('Description is very short (consider adding more detail)');
85
240
  }
86
- // Check for "when to use" guidance
87
- const lower_desc = description.toLowerCase();
88
- if (!lower_desc.includes('when') && !lower_desc.includes('use')) {
89
- this.warning("Consider adding 'when to use' guidance to description");
90
- }
241
+ // Comprehensive Level 1 validation
242
+ this.validate_description(description);
91
243
  }
244
+ // Validate progressive disclosure (word count, token budget)
245
+ this.validate_progressive_disclosure(body);
246
+ // Analyze content structure
247
+ this.analyze_content(body);
92
248
  // Check body content
93
249
  if (body.trim().length < 100) {
94
250
  this.warning('SKILL.md body is very short');
@@ -103,6 +259,8 @@ export class SkillValidator {
103
259
  }
104
260
  validate_references() {
105
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
106
264
  if (existsSync(references_dir)) {
107
265
  const files = readdirSync(references_dir);
108
266
  const md_files = files.filter((f) => f.endsWith('.md'));
@@ -110,7 +268,6 @@ export class SkillValidator {
110
268
  this.warning('references/ directory exists but is empty');
111
269
  }
112
270
  // Check for references in SKILL.md
113
- const skill_md_path = join(this.skill_path, 'SKILL.md');
114
271
  if (existsSync(skill_md_path)) {
115
272
  const skill_content = readFileSync(skill_md_path, 'utf-8');
116
273
  for (const md_file of md_files) {
@@ -120,6 +277,24 @@ export class SkillValidator {
120
277
  }
121
278
  }
122
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
+ }
123
298
  return true;
124
299
  }
125
300
  validate_scripts() {
@@ -163,6 +338,7 @@ export class SkillValidator {
163
338
  errors: this.errors,
164
339
  warnings: this.warnings,
165
340
  is_valid: false,
341
+ stats: this.stats,
166
342
  };
167
343
  }
168
344
  this.validate_skill_md();
@@ -173,6 +349,7 @@ export class SkillValidator {
173
349
  errors: this.errors,
174
350
  warnings: this.warnings,
175
351
  is_valid: this.errors.length === 0,
352
+ stats: this.stats,
176
353
  };
177
354
  }
178
355
  get_errors() {
@@ -1 +1 @@
1
- {"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,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;IAEhC,YAAY,UAAkB;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEO,KAAK,CAAC,GAAW;QACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEO,OAAO,CAAC,GAAW;QACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACnC,CAAC;IAEO,kBAAkB;QACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,KAAK,CAAC,mCAAmC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;YACjE,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,WAAW,EA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 @@
1
+ import chalk from 'chalk';
1
2
  export const success = (msg) => console.log(`āœ… ${msg}`);
2
3
  export const error = (msg) => console.log(`āŒ ${msg}`);
3
4
  export const warning = (msg) => console.log(`āš ļø ${msg}`);
@@ -6,4 +7,83 @@ export const step = (msg) => console.log(` ${msg}`);
6
7
  export const package_ = (msg) => console.log(`šŸ“¦ ${msg}`);
7
8
  export const upload = (msg) => console.log(`šŸ“¤ ${msg}`);
8
9
  export const search = (msg) => console.log(`šŸ” ${msg}`);
10
+ /**
11
+ * Display progressive disclosure statistics with color-coded feedback
12
+ */
13
+ export function display_validation_stats(stats) {
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}`);
35
+ // Word count with recommendations
36
+ const word_status = stats.word_count < 500
37
+ ? chalk.green('āœ… Excellent')
38
+ : stats.word_count < 1000
39
+ ? chalk.green('āœ… Good')
40
+ : stats.word_count < 5000
41
+ ? chalk.yellow('āš ļø Consider splitting')
42
+ : chalk.red('āŒ Too large');
43
+ console.log(` Words: ${stats.word_count} (recommended: <1000, max: <5000) ${word_status}`);
44
+ // Token estimation
45
+ const token_budget = 6500; // Level 2 budget (~5000 words * 1.3)
46
+ const token_status = stats.estimated_tokens < token_budget
47
+ ? chalk.green('within budget')
48
+ : chalk.red('exceeds budget');
49
+ console.log(` Est. tokens: ~${stats.estimated_tokens} (budget: <${token_budget}) ${token_status}`);
50
+ // Code blocks
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}`);
57
+ // Sections
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}`);
64
+ // Long paragraphs
65
+ if (stats.long_paragraphs > 0) {
66
+ const para_status = stats.long_paragraphs > 3
67
+ ? chalk.yellow(' (consider moving to references/)')
68
+ : '';
69
+ console.log(` Long paragraphs: ${stats.long_paragraphs}${para_status}`);
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)')}`);
74
+ // Overall assessment
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!'));
78
+ }
79
+ else if (stats.line_count <= 80 && stats.description_length <= 300) {
80
+ console.log(chalk.green(' āœ… Good progressive disclosure'));
81
+ }
82
+ else if (stats.line_count <= 150 && stats.word_count < 5000) {
83
+ console.log(chalk.yellow(' āš ļø Consider splitting content into references/'));
84
+ }
85
+ else {
86
+ console.log(chalk.red(' āŒ Violates progressive disclosure (move content to references/)'));
87
+ }
88
+ }
9
89
  //# sourceMappingURL=output.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAEA,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"}
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,O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P,qEAAqE,CACtE,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-skills-cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "CLI toolkit for creating and managing Claude Agent Skills",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",