@icarusmx/creta 1.5.11 → 1.5.13
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/bin/creta.js +37 -1
- package/lib/data/command-help/aws-ec2.js +34 -0
- package/lib/data/command-help/grep.js +72 -0
- package/lib/data/command-help/index.js +9 -1
- package/lib/executors/CommandHelpExecutor.js +6 -1
- package/lib/executors/ExercisesExecutor.js +8 -0
- package/lib/exercises/.claude/settings.local.json +12 -0
- package/lib/exercises/01-developing-muscle-for-nvim.md +528 -0
- package/lib/exercises/{iterm2-pane-navigation.md → 02-iterm2-pane-navigation.md} +1 -1
- package/lib/exercises/05-svelte-first-steps.md +1340 -0
- package/lib/exercises/{curl-and-pipes.md → 06-curl-and-pipes.md} +187 -72
- package/lib/exercises/07-claude-api-first-steps.md +855 -0
- package/lib/exercises/08-playwright-svelte-guide.md +1384 -0
- package/lib/exercises/09-docker-first-steps.md +1475 -0
- package/lib/exercises/{railway-deployment.md → 10-railway-deployment.md} +1 -0
- package/lib/exercises/{aws-billing-detective.md → 11-aws-billing-detective.md} +215 -35
- package/lib/exercises/12-install-skills.md +755 -0
- package/lib/exercises/README.md +180 -0
- package/lib/exercises/utils/booklet-2up.js +133 -0
- package/lib/exercises/utils/booklet-manual-duplex.js +159 -0
- package/lib/exercises/utils/booklet-simple.js +136 -0
- package/lib/exercises/utils/create-booklet.js +116 -0
- package/lib/scripts/aws-ec2-all.sh +58 -0
- package/package.json +3 -2
- /package/lib/exercises/{git-stash-workflow.md → 03-git-stash-workflow.md} +0 -0
- /package/lib/exercises/{array-object-manipulation.md → 04-array-object-manipulation.md} +0 -0
|
@@ -0,0 +1,755 @@
|
|
|
1
|
+
# install-skills Command Design
|
|
2
|
+
|
|
3
|
+
**Exercise**: Design a safe, intelligent skill installer inspired by art-vandeley
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The `install-skills` command automates skill setup by:
|
|
8
|
+
1. Analyzing the project structure (using git analytics)
|
|
9
|
+
2. Recommending 3 most relevant skills from a registry
|
|
10
|
+
3. Installing skills to `~/.claude/skills/` directory
|
|
11
|
+
4. Validating skill structure (SKILL.md, scripts, permissions)
|
|
12
|
+
5. Optionally updating project's `.claude/CLAUDE.md`
|
|
13
|
+
|
|
14
|
+
**Inspired by:** The art-vandeley skill - the "importer-exporter of well-architected skills"
|
|
15
|
+
|
|
16
|
+
## Command Behavior
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Via creta CLI
|
|
20
|
+
creta install-skills
|
|
21
|
+
|
|
22
|
+
# Direct installation (one-liner)
|
|
23
|
+
curl -s https://skills.icarus.mx/install.sh | bash -s art-vandeley
|
|
24
|
+
|
|
25
|
+
# Manual installation
|
|
26
|
+
mkdir -p ~/.claude/skills/art-vandeley
|
|
27
|
+
curl -o ~/.claude/skills/art-vandeley/SKILL.md https://vandeley.art/art-vandeley.md
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Interactive Flow
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
🔍 Analyzing project structure...
|
|
34
|
+
- Detected: React + Express (Node.js)
|
|
35
|
+
- Git commits: 247
|
|
36
|
+
- Files: 89
|
|
37
|
+
|
|
38
|
+
📦 Recommended skills for your project:
|
|
39
|
+
|
|
40
|
+
1. component-review - Analyze React components for best practices
|
|
41
|
+
2. api-security - Review Express endpoints for security issues
|
|
42
|
+
3. refactor-detector - Suggest refactors for files over 300 lines
|
|
43
|
+
|
|
44
|
+
❓ Install these skills? [Y/n]: _
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Real-World Skill Structure (art-vandeley)
|
|
48
|
+
|
|
49
|
+
Skills installed to `~/.claude/skills/[skill-name]/`:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
~/.claude/skills/art-vandeley/
|
|
53
|
+
├── SKILL.md # Claude's instructions (required)
|
|
54
|
+
├── README.md # Human documentation (required)
|
|
55
|
+
└── scripts/ # Helper utilities (optional)
|
|
56
|
+
├── analyze-git.sh
|
|
57
|
+
├── create-architecture.sh
|
|
58
|
+
├── create-sequence.sh
|
|
59
|
+
├── create-erd.sh
|
|
60
|
+
├── create-interfaces.sh
|
|
61
|
+
└── create-class-diagram.sh
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### SKILL.md Format
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
---
|
|
68
|
+
name: art-vandeley
|
|
69
|
+
description: Create comprehensive Spanish README.md documentation and Mermaid diagrams
|
|
70
|
+
allowed-tools: [Read, Write, Glob, Grep, Bash, Task]
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
# Art Vandeley - Documentation Architect
|
|
74
|
+
|
|
75
|
+
[Detailed instructions for Claude on how to use this skill...]
|
|
76
|
+
|
|
77
|
+
## When to Invoke
|
|
78
|
+
[Trigger conditions...]
|
|
79
|
+
|
|
80
|
+
## Core Responsibilities
|
|
81
|
+
[What the skill does...]
|
|
82
|
+
|
|
83
|
+
## Workflow Protocol
|
|
84
|
+
[Step-by-step process...]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Key components:**
|
|
88
|
+
1. **Frontmatter** - YAML with name, description, allowed-tools
|
|
89
|
+
2. **Instructions** - Detailed guidance for Claude
|
|
90
|
+
3. **Triggers** - When to activate this skill
|
|
91
|
+
4. **Workflow** - Step-by-step protocol
|
|
92
|
+
|
|
93
|
+
## Project Analysis Strategy (Real Implementation)
|
|
94
|
+
|
|
95
|
+
### Git-Based Detection
|
|
96
|
+
|
|
97
|
+
Based on art-vandeley's `analyze-git.sh`:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
#!/bin/bash
|
|
101
|
+
# Detect tech stack from project files
|
|
102
|
+
|
|
103
|
+
detect_tech_stack() {
|
|
104
|
+
# Svelte
|
|
105
|
+
if [ -f "svelte.config.js" ] || grep -q "\"svelte\"" package.json 2>/dev/null; then
|
|
106
|
+
echo "svelte"
|
|
107
|
+
# React
|
|
108
|
+
elif grep -q "\"react\"" package.json 2>/dev/null; then
|
|
109
|
+
echo "react"
|
|
110
|
+
# Vue
|
|
111
|
+
elif grep -q "\"vue\"" package.json 2>/dev/null; then
|
|
112
|
+
echo "vue"
|
|
113
|
+
# Python
|
|
114
|
+
elif [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then
|
|
115
|
+
echo "python"
|
|
116
|
+
# Rust
|
|
117
|
+
elif [ -f "Cargo.toml" ]; then
|
|
118
|
+
echo "rust"
|
|
119
|
+
# Go
|
|
120
|
+
elif [ -f "go.mod" ]; then
|
|
121
|
+
echo "go"
|
|
122
|
+
# Node.js generic
|
|
123
|
+
elif [ -f "package.json" ]; then
|
|
124
|
+
echo "nodejs"
|
|
125
|
+
else
|
|
126
|
+
echo "unknown"
|
|
127
|
+
fi
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Output structured JSON
|
|
131
|
+
cat <<EOF
|
|
132
|
+
{
|
|
133
|
+
"tech_stack": "$(detect_tech_stack)",
|
|
134
|
+
"commit_count": $(git rev-list --count HEAD),
|
|
135
|
+
"file_count": $(find . -type f | wc -l),
|
|
136
|
+
"has_tests": $([ -d "test" ] || [ -d "__tests__" ] && echo "true" || echo "false")
|
|
137
|
+
}
|
|
138
|
+
EOF
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Old Simple Detection (Reference)
|
|
142
|
+
|
|
143
|
+
```javascript
|
|
144
|
+
const analyzers = {
|
|
145
|
+
// Tech stack detection
|
|
146
|
+
react: () => hasFile('package.json') && hasDep('react'),
|
|
147
|
+
express: () => hasFile('package.json') && hasDep('express'),
|
|
148
|
+
svelte: () => hasFile('package.json') && hasDep('svelte'),
|
|
149
|
+
|
|
150
|
+
// Project characteristics
|
|
151
|
+
largeCodebase: () => countFiles('**/*.js') > 100,
|
|
152
|
+
hasTests: () => hasFile('**/*.test.js'),
|
|
153
|
+
activeRepo: () => gitCommitCount() > 50,
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Skill Recommendation Matrix
|
|
158
|
+
|
|
159
|
+
| Project Type | Recommended Skills |
|
|
160
|
+
|-------------|-------------------|
|
|
161
|
+
| React + Large | component-review, refactor-detector, bundle-analyzer |
|
|
162
|
+
| Express API | api-security, endpoint-review, performance-audit |
|
|
163
|
+
| Svelte | component-review, store-analyzer, bundle-optimizer |
|
|
164
|
+
| Open Source | changelog-generator, release-notes, contributor-guide |
|
|
165
|
+
|
|
166
|
+
## Safe Implementation Approach
|
|
167
|
+
|
|
168
|
+
### Dry-Run Mode (Default)
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npm run install-skills --dry-run
|
|
172
|
+
|
|
173
|
+
# Output:
|
|
174
|
+
Would create:
|
|
175
|
+
.skillful/skills/component-review/SKILL.md
|
|
176
|
+
.skillful/skills/api-security/SKILL.md
|
|
177
|
+
.skillful/skills/refactor-detector/SKILL.md
|
|
178
|
+
|
|
179
|
+
Would update .claude/CLAUDE.md with:
|
|
180
|
+
## Skillful Framework
|
|
181
|
+
Available skills: component-review, api-security, refactor-detector
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Actual Installation (Opt-in)
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm run install-skills --confirm
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Only runs after user explicitly confirms.
|
|
191
|
+
|
|
192
|
+
## CLAUDE.md Integration
|
|
193
|
+
|
|
194
|
+
### Auto-Generated Section
|
|
195
|
+
|
|
196
|
+
```markdown
|
|
197
|
+
## Skillful Framework
|
|
198
|
+
This project uses Skillful for progressive skill loading.
|
|
199
|
+
|
|
200
|
+
Available skills in `.skillful/skills/`:
|
|
201
|
+
- **component-review** - Analyze React components for best practices
|
|
202
|
+
- **api-security** - Review Express endpoints for security issues
|
|
203
|
+
- **refactor-detector** - Suggest refactors for files over 300+ lines
|
|
204
|
+
|
|
205
|
+
Use skills via the Skill tool when tasks match skill descriptions.
|
|
206
|
+
Load only when needed to preserve context window.
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Smart Merging
|
|
210
|
+
|
|
211
|
+
If `.claude/CLAUDE.md` already exists:
|
|
212
|
+
- Detect existing "Skillful Framework" section
|
|
213
|
+
- Update skill list without touching other sections
|
|
214
|
+
- Preserve user customizations
|
|
215
|
+
|
|
216
|
+
If doesn't exist:
|
|
217
|
+
- Prompt: "Create .claude/CLAUDE.md with Skillful section? [Y/n]"
|
|
218
|
+
- Create minimal file with just framework instructions
|
|
219
|
+
|
|
220
|
+
## Skill Source Strategy (art-vandeley approach)
|
|
221
|
+
|
|
222
|
+
### Phase 1: Registry-Based Installation
|
|
223
|
+
|
|
224
|
+
Art-vandeley uses a **remote registry** approach with curl:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# 1. Analyze project and detect tech stack
|
|
228
|
+
ANALYTICS=$(bash analyze-git.sh)
|
|
229
|
+
TECH_STACK=$(echo "$ANALYTICS" | jq -r '.tech_stack')
|
|
230
|
+
|
|
231
|
+
# 2. Fetch skills registry
|
|
232
|
+
REGISTRY=$(curl -s https://vandeley.art/skills/registry.json)
|
|
233
|
+
|
|
234
|
+
# 3. Find appropriate skill for tech stack
|
|
235
|
+
SKILL_URL=$(echo "$REGISTRY" | jq -r ".skills[\"skillful-${TECH_STACK}\"].url")
|
|
236
|
+
|
|
237
|
+
# 4. Download skill template
|
|
238
|
+
SKILL_CONTENT=$(curl -s "https://vandeley.art${SKILL_URL}")
|
|
239
|
+
|
|
240
|
+
# 5. Install to ~/.claude/skills/
|
|
241
|
+
mkdir -p ~/.claude/skills/skillful-${TECH_STACK}
|
|
242
|
+
echo "$SKILL_CONTENT" > ~/.claude/skills/skillful-${TECH_STACK}/SKILL.md
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Registry format (registry.json):**
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"skills": {
|
|
249
|
+
"art-vandeley": {
|
|
250
|
+
"name": "art-vandeley",
|
|
251
|
+
"description": "Spanish README documentation architect",
|
|
252
|
+
"url": "/art-vandeley.md",
|
|
253
|
+
"category": "documentation",
|
|
254
|
+
"tags": ["readme", "mermaid", "spanish"]
|
|
255
|
+
},
|
|
256
|
+
"skillful-svelte": {
|
|
257
|
+
"name": "skillful-svelte",
|
|
258
|
+
"description": "Svelte 5 documentation specialist",
|
|
259
|
+
"url": "/skillful/svelte/SKILL.md",
|
|
260
|
+
"category": "framework",
|
|
261
|
+
"tags": ["svelte", "documentation"]
|
|
262
|
+
},
|
|
263
|
+
"skillful-react": {
|
|
264
|
+
"name": "skillful-react",
|
|
265
|
+
"description": "React documentation specialist",
|
|
266
|
+
"url": "/skillful/react/SKILL.md",
|
|
267
|
+
"category": "framework",
|
|
268
|
+
"tags": ["react", "documentation"]
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Phase 2: Bundled Skills Fallback
|
|
275
|
+
|
|
276
|
+
If curl fails (offline mode), fall back to bundled skills:
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
creta/lib/bundled-skills/
|
|
280
|
+
art-vandeley/
|
|
281
|
+
SKILL.md
|
|
282
|
+
README.md
|
|
283
|
+
scripts/
|
|
284
|
+
incident-report/
|
|
285
|
+
vim-architect/
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Copy to `~/.claude/skills/` during installation.
|
|
289
|
+
|
|
290
|
+
## Safety Features
|
|
291
|
+
|
|
292
|
+
### 1. Never Overwrite
|
|
293
|
+
|
|
294
|
+
```javascript
|
|
295
|
+
if (fs.existsSync('.skillful/skills/component-review')) {
|
|
296
|
+
console.log('⚠️ component-review already exists, skipping...')
|
|
297
|
+
continue
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### 2. Backup Before Changes
|
|
302
|
+
|
|
303
|
+
```javascript
|
|
304
|
+
if (fs.existsSync('.claude/CLAUDE.md')) {
|
|
305
|
+
fs.copyFileSync(
|
|
306
|
+
'.claude/CLAUDE.md',
|
|
307
|
+
`.claude/CLAUDE.md.backup-${Date.now()}`
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### 3. Rollback Support
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
npm run install-skills --rollback
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Restore from most recent backup.
|
|
319
|
+
|
|
320
|
+
### 4. Validation (Real Implementation)
|
|
321
|
+
|
|
322
|
+
Based on art-vandeley's structure:
|
|
323
|
+
|
|
324
|
+
```javascript
|
|
325
|
+
function validateSkill(skillPath) {
|
|
326
|
+
const skillMdPath = `${skillPath}/SKILL.md`
|
|
327
|
+
const readmePath = `${skillPath}/README.md`
|
|
328
|
+
|
|
329
|
+
// 1. Check required files exist
|
|
330
|
+
if (!fs.existsSync(skillMdPath)) {
|
|
331
|
+
throw new Error(`Missing SKILL.md in ${skillPath}`)
|
|
332
|
+
}
|
|
333
|
+
if (!fs.existsSync(readmePath)) {
|
|
334
|
+
console.warn(`⚠️ Missing README.md in ${skillPath}`)
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const skillMd = fs.readFileSync(skillMdPath, 'utf8')
|
|
338
|
+
|
|
339
|
+
// 2. Validate YAML frontmatter
|
|
340
|
+
const frontmatterMatch = skillMd.match(/^---\n([\s\S]*?)\n---/)
|
|
341
|
+
if (!frontmatterMatch) {
|
|
342
|
+
throw new Error('Invalid SKILL.md: missing YAML frontmatter')
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// 3. Parse frontmatter
|
|
346
|
+
const frontmatter = parseFrontmatter(frontmatterMatch[1])
|
|
347
|
+
|
|
348
|
+
// Required fields
|
|
349
|
+
if (!frontmatter.name) throw new Error('Missing "name" in frontmatter')
|
|
350
|
+
if (!frontmatter.description) throw new Error('Missing "description" in frontmatter')
|
|
351
|
+
if (!frontmatter['allowed-tools']) {
|
|
352
|
+
console.warn('⚠️ No "allowed-tools" specified - skill has access to all tools')
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// 4. Validate allowed-tools is array
|
|
356
|
+
if (frontmatter['allowed-tools'] && !Array.isArray(frontmatter['allowed-tools'])) {
|
|
357
|
+
throw new Error('allowed-tools must be an array')
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// 5. Check scripts directory (optional but recommended)
|
|
361
|
+
const scriptsPath = `${skillPath}/scripts`
|
|
362
|
+
if (fs.existsSync(scriptsPath)) {
|
|
363
|
+
// Verify scripts are executable
|
|
364
|
+
const scripts = fs.readdirSync(scriptsPath)
|
|
365
|
+
scripts.forEach(script => {
|
|
366
|
+
const scriptPath = `${scriptsPath}/${script}`
|
|
367
|
+
const stat = fs.statSync(scriptPath)
|
|
368
|
+
if (!stat.mode & 0o111) {
|
|
369
|
+
console.warn(`⚠️ Script not executable: ${script}`)
|
|
370
|
+
console.log(` Fix: chmod +x ${scriptPath}`)
|
|
371
|
+
}
|
|
372
|
+
})
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return {
|
|
376
|
+
valid: true,
|
|
377
|
+
name: frontmatter.name,
|
|
378
|
+
description: frontmatter.description,
|
|
379
|
+
hasScripts: fs.existsSync(scriptsPath),
|
|
380
|
+
scriptCount: fs.existsSync(scriptsPath) ? fs.readdirSync(scriptsPath).length : 0
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
function parseFrontmatter(yaml) {
|
|
385
|
+
// Simple YAML parser for frontmatter
|
|
386
|
+
const lines = yaml.split('\n')
|
|
387
|
+
const data = {}
|
|
388
|
+
|
|
389
|
+
for (const line of lines) {
|
|
390
|
+
if (line.includes(':')) {
|
|
391
|
+
const [key, ...valueParts] = line.split(':')
|
|
392
|
+
let value = valueParts.join(':').trim()
|
|
393
|
+
|
|
394
|
+
// Handle arrays: [Read, Write, Bash]
|
|
395
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
396
|
+
value = value.slice(1, -1).split(',').map(s => s.trim())
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
data[key.trim()] = value
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
return data
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Validation checks:**
|
|
408
|
+
1. ✅ SKILL.md exists (required)
|
|
409
|
+
2. ✅ README.md exists (recommended)
|
|
410
|
+
3. ✅ Frontmatter has name, description
|
|
411
|
+
4. ✅ allowed-tools is valid array
|
|
412
|
+
5. ✅ Scripts are executable (if present)
|
|
413
|
+
|
|
414
|
+
## Example Output
|
|
415
|
+
|
|
416
|
+
### Using creta CLI
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
$ creta install-skills
|
|
420
|
+
|
|
421
|
+
🎯 Skill Installer (art-vandeley approach)
|
|
422
|
+
|
|
423
|
+
🔍 Analyzing project...
|
|
424
|
+
📊 Running git analytics...
|
|
425
|
+
✓ Tech stack: svelte
|
|
426
|
+
✓ Commits: 247
|
|
427
|
+
✓ Files: 89
|
|
428
|
+
✓ Has tests: true
|
|
429
|
+
|
|
430
|
+
📡 Fetching skills registry...
|
|
431
|
+
✓ Connected to https://vandeley.art/skills/registry.json
|
|
432
|
+
|
|
433
|
+
📦 Recommended skills for Svelte projects:
|
|
434
|
+
1. ✓ art-vandeley - Spanish README documentation
|
|
435
|
+
2. ✓ skillful-svelte - Svelte 5 documentation specialist
|
|
436
|
+
3. ✓ vim-architect - File navigation with fold markers
|
|
437
|
+
|
|
438
|
+
❓ Install these skills? [Y/n]: Y
|
|
439
|
+
|
|
440
|
+
📥 Installing skills to ~/.claude/skills/...
|
|
441
|
+
|
|
442
|
+
[1/3] art-vandeley
|
|
443
|
+
✓ Downloaded SKILL.md (10.9 KB)
|
|
444
|
+
✓ Downloaded README.md (3.5 KB)
|
|
445
|
+
✓ Downloaded 6 scripts
|
|
446
|
+
✓ Made scripts executable
|
|
447
|
+
✓ Validated skill structure
|
|
448
|
+
|
|
449
|
+
[2/3] skillful-svelte
|
|
450
|
+
✓ Downloaded SKILL.md (8.2 KB)
|
|
451
|
+
✓ Validated skill structure
|
|
452
|
+
|
|
453
|
+
[3/3] vim-architect
|
|
454
|
+
✓ Downloaded SKILL.md (6.1 KB)
|
|
455
|
+
✓ Downloaded README.md (2.8 KB)
|
|
456
|
+
✓ Validated skill structure
|
|
457
|
+
|
|
458
|
+
📝 Update .claude/CLAUDE.md? [Y/n]: Y
|
|
459
|
+
✓ Backed up to .claude/CLAUDE.md.backup-1698260400
|
|
460
|
+
✓ Added skills section
|
|
461
|
+
|
|
462
|
+
✨ Installation complete!
|
|
463
|
+
|
|
464
|
+
Installed skills:
|
|
465
|
+
~/.claude/skills/art-vandeley/
|
|
466
|
+
~/.claude/skills/skillful-svelte/
|
|
467
|
+
~/.claude/skills/vim-architect/
|
|
468
|
+
|
|
469
|
+
Next steps:
|
|
470
|
+
- Try: "Document this project" (triggers art-vandeley)
|
|
471
|
+
- View: ~/.claude/skills/art-vandeley/README.md
|
|
472
|
+
- Add more: creta install-skills --add
|
|
473
|
+
|
|
474
|
+
📚 Docs: https://icarus.mx/creta/skills
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### Manual Installation (One-liner)
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
$ curl -s https://vandeley.art/install.sh | bash -s art-vandeley
|
|
481
|
+
|
|
482
|
+
🔽 Installing art-vandeley...
|
|
483
|
+
✓ Created ~/.claude/skills/art-vandeley/
|
|
484
|
+
✓ Downloaded SKILL.md
|
|
485
|
+
✓ Downloaded README.md
|
|
486
|
+
✓ Downloaded scripts (6 files)
|
|
487
|
+
✓ Made scripts executable
|
|
488
|
+
✓ Validated installation
|
|
489
|
+
|
|
490
|
+
✅ art-vandeley installed successfully!
|
|
491
|
+
|
|
492
|
+
Try: "Document this project" in Claude Code
|
|
493
|
+
Docs: https://vandeley.art/art-vandeley
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
## Edge Cases
|
|
497
|
+
|
|
498
|
+
### No package.json
|
|
499
|
+
|
|
500
|
+
```
|
|
501
|
+
⚠️ No package.json found.
|
|
502
|
+
Cannot analyze project type.
|
|
503
|
+
|
|
504
|
+
Install default skills? [Y/n]: _
|
|
505
|
+
Default: code-review, bug-investigator, refactor-detector
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
### Empty/New Project
|
|
509
|
+
|
|
510
|
+
```
|
|
511
|
+
🆕 New project detected!
|
|
512
|
+
|
|
513
|
+
Choose skill category:
|
|
514
|
+
1. Web Development (React, Vue, Svelte)
|
|
515
|
+
2. API Development (Express, Fastify)
|
|
516
|
+
3. CLI Tools (Node.js scripts)
|
|
517
|
+
4. General Purpose (code review, refactoring)
|
|
518
|
+
|
|
519
|
+
Select [1-4]: _
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Existing Skills
|
|
523
|
+
|
|
524
|
+
```
|
|
525
|
+
Found existing skills:
|
|
526
|
+
- custom-validator (user-created)
|
|
527
|
+
- legacy-analyzer (project-specific)
|
|
528
|
+
|
|
529
|
+
Keep these? [Y/n]: Y
|
|
530
|
+
|
|
531
|
+
Adding new skills alongside existing ones...
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
## User Control
|
|
535
|
+
|
|
536
|
+
### Flags
|
|
537
|
+
|
|
538
|
+
```bash
|
|
539
|
+
--dry-run # Show what would happen (default)
|
|
540
|
+
--confirm # Actually run installation
|
|
541
|
+
--add # Add more skills to existing setup
|
|
542
|
+
--remove # Remove skills interactively
|
|
543
|
+
--list # Show available skills
|
|
544
|
+
--registry <url> # Custom skill source
|
|
545
|
+
--no-claude # Skip CLAUDE.md update
|
|
546
|
+
--force # Overwrite existing skills
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### Configuration File
|
|
550
|
+
|
|
551
|
+
`.skillfulrc.json`:
|
|
552
|
+
```json
|
|
553
|
+
{
|
|
554
|
+
"autoInstall": false,
|
|
555
|
+
"defaultSkills": ["code-review", "bug-investigator"],
|
|
556
|
+
"skillSources": [
|
|
557
|
+
"bundled",
|
|
558
|
+
"https://skills.icarus.mx/registry"
|
|
559
|
+
],
|
|
560
|
+
"updateClaude": true
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
## Complete Installation Script Example
|
|
565
|
+
|
|
566
|
+
Based on art-vandeley's pattern:
|
|
567
|
+
|
|
568
|
+
```bash
|
|
569
|
+
#!/bin/bash
|
|
570
|
+
# install-skill.sh - Install a skill to ~/.claude/skills/
|
|
571
|
+
# Usage: ./install-skill.sh <skill-name> [registry-url]
|
|
572
|
+
|
|
573
|
+
set -e
|
|
574
|
+
|
|
575
|
+
SKILL_NAME="$1"
|
|
576
|
+
REGISTRY_URL="${2:-https://vandeley.art/skills/registry.json}"
|
|
577
|
+
SKILLS_DIR="$HOME/.claude/skills"
|
|
578
|
+
|
|
579
|
+
echo "🔽 Installing ${SKILL_NAME}..."
|
|
580
|
+
|
|
581
|
+
# 1. Fetch registry
|
|
582
|
+
echo " 📡 Fetching registry..."
|
|
583
|
+
REGISTRY=$(curl -s "$REGISTRY_URL")
|
|
584
|
+
|
|
585
|
+
# 2. Get skill info
|
|
586
|
+
SKILL_URL=$(echo "$REGISTRY" | jq -r ".skills[\"${SKILL_NAME}\"].url")
|
|
587
|
+
if [ "$SKILL_URL" = "null" ]; then
|
|
588
|
+
echo " ❌ Skill '${SKILL_NAME}' not found in registry"
|
|
589
|
+
exit 1
|
|
590
|
+
fi
|
|
591
|
+
|
|
592
|
+
# 3. Create skill directory
|
|
593
|
+
SKILL_DIR="${SKILLS_DIR}/${SKILL_NAME}"
|
|
594
|
+
mkdir -p "$SKILL_DIR"
|
|
595
|
+
echo " ✓ Created ${SKILL_DIR}/"
|
|
596
|
+
|
|
597
|
+
# 4. Download SKILL.md
|
|
598
|
+
echo " ⬇️ Downloading SKILL.md..."
|
|
599
|
+
curl -s "https://vandeley.art${SKILL_URL}" -o "${SKILL_DIR}/SKILL.md"
|
|
600
|
+
echo " ✓ Downloaded SKILL.md"
|
|
601
|
+
|
|
602
|
+
# 5. Download README.md (if exists)
|
|
603
|
+
README_URL="${SKILL_URL/SKILL.md/README.md}"
|
|
604
|
+
if curl -s -f "https://vandeley.art${README_URL}" -o "${SKILL_DIR}/README.md" 2>/dev/null; then
|
|
605
|
+
echo " ✓ Downloaded README.md"
|
|
606
|
+
fi
|
|
607
|
+
|
|
608
|
+
# 6. Download scripts directory (if exists)
|
|
609
|
+
SCRIPTS_URL="${SKILL_URL%/*}/scripts"
|
|
610
|
+
SCRIPTS_DIR="${SKILL_DIR}/scripts"
|
|
611
|
+
|
|
612
|
+
# Try to list scripts
|
|
613
|
+
SCRIPTS=$(curl -s "https://vandeley.art${SCRIPTS_URL}/" 2>/dev/null | grep -oP 'href="\K[^"]+\.sh' || echo "")
|
|
614
|
+
|
|
615
|
+
if [ -n "$SCRIPTS" ]; then
|
|
616
|
+
mkdir -p "$SCRIPTS_DIR"
|
|
617
|
+
echo " ⬇️ Downloading scripts..."
|
|
618
|
+
|
|
619
|
+
while IFS= read -r script; do
|
|
620
|
+
curl -s "https://vandeley.art${SCRIPTS_URL}/${script}" -o "${SCRIPTS_DIR}/${script}"
|
|
621
|
+
chmod +x "${SCRIPTS_DIR}/${script}"
|
|
622
|
+
done <<< "$SCRIPTS"
|
|
623
|
+
|
|
624
|
+
SCRIPT_COUNT=$(echo "$SCRIPTS" | wc -l)
|
|
625
|
+
echo " ✓ Downloaded ${SCRIPT_COUNT} scripts"
|
|
626
|
+
echo " ✓ Made scripts executable"
|
|
627
|
+
fi
|
|
628
|
+
|
|
629
|
+
# 7. Validate installation
|
|
630
|
+
echo " 🔍 Validating installation..."
|
|
631
|
+
|
|
632
|
+
if [ ! -f "${SKILL_DIR}/SKILL.md" ]; then
|
|
633
|
+
echo " ❌ Validation failed: SKILL.md missing"
|
|
634
|
+
exit 1
|
|
635
|
+
fi
|
|
636
|
+
|
|
637
|
+
# Check frontmatter
|
|
638
|
+
if ! grep -q "^---" "${SKILL_DIR}/SKILL.md"; then
|
|
639
|
+
echo " ❌ Validation failed: Invalid SKILL.md format"
|
|
640
|
+
exit 1
|
|
641
|
+
fi
|
|
642
|
+
|
|
643
|
+
echo " ✓ Validated skill structure"
|
|
644
|
+
|
|
645
|
+
# 8. Success
|
|
646
|
+
echo ""
|
|
647
|
+
echo "✅ ${SKILL_NAME} installed successfully!"
|
|
648
|
+
echo ""
|
|
649
|
+
echo "Location: ${SKILL_DIR}/"
|
|
650
|
+
echo "Try it: Mention its use case in Claude Code"
|
|
651
|
+
echo ""
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
## Implementation Notes
|
|
655
|
+
|
|
656
|
+
**art-vandeley approach:**
|
|
657
|
+
- ✅ Registry-based with curl (network required)
|
|
658
|
+
- ✅ Skills installed to `~/.claude/skills/` (global)
|
|
659
|
+
- ✅ Validation checks SKILL.md structure
|
|
660
|
+
- ✅ Scripts made executable automatically
|
|
661
|
+
- ✅ Graceful fallback if optional files missing
|
|
662
|
+
|
|
663
|
+
**Key principles:**
|
|
664
|
+
- Use remote registry for latest versions
|
|
665
|
+
- Fall back to bundled skills if offline
|
|
666
|
+
- Prioritize safety over convenience
|
|
667
|
+
- Make everything reversible
|
|
668
|
+
- Never touch files without explicit confirmation
|
|
669
|
+
- Provide clear output showing exactly what happened
|
|
670
|
+
- Skills are user-level, not project-level
|
|
671
|
+
|
|
672
|
+
## Future Enhancements
|
|
673
|
+
|
|
674
|
+
1. **Skill Marketplace** - Browse/search community skills
|
|
675
|
+
2. **Skill Updates** - `npm run update-skills` to get latest versions
|
|
676
|
+
3. **Skill Generator** - `npm run create-skill` to scaffold new skills
|
|
677
|
+
4. **Analytics** - Track which skills are most useful
|
|
678
|
+
5. **Dependencies** - Skills that require other skills
|
|
679
|
+
6. **Skill Packs** - Pre-configured bundles (frontend-pack, backend-pack)
|
|
680
|
+
|
|
681
|
+
## How Claude Code Discovers Skills
|
|
682
|
+
|
|
683
|
+
**Skill Discovery Protocol:**
|
|
684
|
+
|
|
685
|
+
```bash
|
|
686
|
+
# 1. User triggers a skill use case
|
|
687
|
+
User: "Document this project"
|
|
688
|
+
|
|
689
|
+
# 2. Claude checks ~/.claude/skills/ for matching skills
|
|
690
|
+
$ ls ~/.claude/skills/
|
|
691
|
+
art-vandeley/
|
|
692
|
+
incident-report/
|
|
693
|
+
session-handoff/
|
|
694
|
+
vim-architect/
|
|
695
|
+
|
|
696
|
+
# 3. Claude reads matching SKILL.md frontmatter
|
|
697
|
+
$ cat ~/.claude/skills/art-vandeley/SKILL.md | head -5
|
|
698
|
+
---
|
|
699
|
+
name: art-vandeley
|
|
700
|
+
description: Create comprehensive Spanish README.md documentation and Mermaid diagrams
|
|
701
|
+
allowed-tools: [Read, Write, Glob, Grep, Bash, Task]
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
# 4. Claude loads the skill and follows its instructions
|
|
705
|
+
# 5. Skill has access only to allowed-tools
|
|
706
|
+
# 6. Skill can call helper scripts in scripts/
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
**Key insights from art-vandeley:**
|
|
710
|
+
- Skills live in `~/.claude/skills/` (user-level, not project-level)
|
|
711
|
+
- Claude auto-discovers skills by reading SKILL.md frontmatter
|
|
712
|
+
- Skills have their own helper scripts (bash utilities)
|
|
713
|
+
- Skills can orchestrate framework-specific behavior (skillful-svelte, skillful-react)
|
|
714
|
+
- Skills can call remote registries for dynamic content
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
718
|
+
## Real-World Example: art-vandeley Installation
|
|
719
|
+
|
|
720
|
+
```bash
|
|
721
|
+
# What actually happens when you install art-vandeley:
|
|
722
|
+
|
|
723
|
+
# 1. Create directory
|
|
724
|
+
mkdir -p ~/.claude/skills/art-vandeley
|
|
725
|
+
|
|
726
|
+
# 2. Download core files
|
|
727
|
+
curl https://vandeley.art/art-vandeley.md > ~/.claude/skills/art-vandeley/SKILL.md
|
|
728
|
+
curl https://vandeley.art/README.md > ~/.claude/skills/art-vandeley/README.md
|
|
729
|
+
|
|
730
|
+
# 3. Download helper scripts
|
|
731
|
+
mkdir -p ~/.claude/skills/art-vandeley/scripts
|
|
732
|
+
cd ~/.claude/skills/art-vandeley/scripts
|
|
733
|
+
curl -O https://vandeley.art/scripts/analyze-git.sh
|
|
734
|
+
curl -O https://vandeley.art/scripts/create-architecture.sh
|
|
735
|
+
curl -O https://vandeley.art/scripts/create-sequence.sh
|
|
736
|
+
curl -O https://vandeley.art/scripts/create-erd.sh
|
|
737
|
+
curl -O https://vandeley.art/scripts/create-interfaces.sh
|
|
738
|
+
curl -O https://vandeley.art/scripts/create-class-diagram.sh
|
|
739
|
+
|
|
740
|
+
# 4. Make scripts executable
|
|
741
|
+
chmod +x *.sh
|
|
742
|
+
|
|
743
|
+
# 5. Validate
|
|
744
|
+
if grep -q "^---" ~/.claude/skills/art-vandeley/SKILL.md; then
|
|
745
|
+
echo "✅ art-vandeley installed"
|
|
746
|
+
else
|
|
747
|
+
echo "❌ Installation failed"
|
|
748
|
+
fi
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
---
|
|
752
|
+
|
|
753
|
+
**Philosophy**: Make it easy to get started, hard to mess up, and simple to undo.
|
|
754
|
+
|
|
755
|
+
**Inspired by**: [art-vandeley](https://vandeley.art) - The importer-exporter of well-architected skills.
|