@skillsmith/cli 0.4.2 → 0.5.0
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/dist/.tsbuildinfo +1 -1
- package/dist/src/commands/audit.d.ts +19 -0
- package/dist/src/commands/audit.d.ts.map +1 -0
- package/dist/src/commands/audit.js +134 -0
- package/dist/src/commands/audit.js.map +1 -0
- package/dist/src/commands/audit.test.d.ts +8 -0
- package/dist/src/commands/audit.test.d.ts.map +1 -0
- package/dist/src/commands/audit.test.js +97 -0
- package/dist/src/commands/audit.test.js.map +1 -0
- package/dist/src/commands/author/init.d.ts.map +1 -1
- package/dist/src/commands/author/init.js +4 -9
- package/dist/src/commands/author/init.js.map +1 -1
- package/dist/src/commands/create.d.ts +42 -0
- package/dist/src/commands/create.d.ts.map +1 -0
- package/dist/src/commands/create.js +325 -0
- package/dist/src/commands/create.js.map +1 -0
- package/dist/src/commands/diff.d.ts +17 -0
- package/dist/src/commands/diff.d.ts.map +1 -0
- package/dist/src/commands/diff.js +191 -0
- package/dist/src/commands/diff.js.map +1 -0
- package/dist/src/commands/diff.test.d.ts +6 -0
- package/dist/src/commands/diff.test.d.ts.map +1 -0
- package/dist/src/commands/diff.test.js +275 -0
- package/dist/src/commands/diff.test.js.map +1 -0
- package/dist/src/commands/index.d.ts +4 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +7 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/manage.d.ts.map +1 -1
- package/dist/src/commands/manage.js +18 -10
- package/dist/src/commands/manage.js.map +1 -1
- package/dist/src/commands/pin.d.ts +24 -0
- package/dist/src/commands/pin.d.ts.map +1 -0
- package/dist/src/commands/pin.js +123 -0
- package/dist/src/commands/pin.js.map +1 -0
- package/dist/src/commands/pin.test.d.ts +6 -0
- package/dist/src/commands/pin.test.d.ts.map +1 -0
- package/dist/src/commands/pin.test.js +206 -0
- package/dist/src/commands/pin.test.js.map +1 -0
- package/dist/src/commands/search.d.ts.map +1 -1
- package/dist/src/commands/search.js +3 -3
- package/dist/src/commands/search.js.map +1 -1
- package/dist/src/commands/sync.d.ts.map +1 -1
- package/dist/src/commands/sync.js +7 -6
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/import.js +2 -2
- package/dist/src/import.js.map +1 -1
- package/dist/src/index.js +9 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/templates/changelog.md.template.d.ts +8 -0
- package/dist/src/templates/changelog.md.template.d.ts.map +1 -0
- package/dist/src/templates/changelog.md.template.js +19 -0
- package/dist/src/templates/changelog.md.template.js.map +1 -0
- package/dist/src/templates/index.d.ts +1 -0
- package/dist/src/templates/index.d.ts.map +1 -1
- package/dist/src/templates/index.js +1 -0
- package/dist/src/templates/index.js.map +1 -1
- package/dist/src/templates/skill.md.template.d.ts +1 -1
- package/dist/src/templates/skill.md.template.d.ts.map +1 -1
- package/dist/src/templates/skill.md.template.js +1 -3
- package/dist/src/templates/skill.md.template.js.map +1 -1
- package/dist/src/utils/license-validation.js +1 -1
- package/dist/src/utils/license-validation.js.map +1 -1
- package/dist/src/utils/manifest.d.ts +46 -0
- package/dist/src/utils/manifest.d.ts.map +1 -0
- package/dist/src/utils/manifest.js +55 -0
- package/dist/src/utils/manifest.js.map +1 -0
- package/dist/src/utils/require-tier.d.ts +38 -0
- package/dist/src/utils/require-tier.d.ts.map +1 -0
- package/dist/src/utils/require-tier.js +74 -0
- package/dist/src/utils/require-tier.js.map +1 -0
- package/dist/src/utils/skill-name.d.ts +19 -0
- package/dist/src/utils/skill-name.d.ts.map +1 -0
- package/dist/src/utils/skill-name.js +26 -0
- package/dist/src/utils/skill-name.js.map +1 -0
- package/dist/src/utils/skills-directory.d.ts +12 -3
- package/dist/src/utils/skills-directory.d.ts.map +1 -1
- package/dist/src/utils/skills-directory.js +62 -7
- package/dist/src/utils/skills-directory.js.map +1 -1
- package/dist/tests/create.test.d.ts +5 -0
- package/dist/tests/create.test.d.ts.map +1 -0
- package/dist/tests/create.test.js +449 -0
- package/dist/tests/create.test.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMI-3083: skillsmith create command
|
|
3
|
+
*
|
|
4
|
+
* Scaffolds a new Claude Code skill into ~/.claude/skills/<name>/ with
|
|
5
|
+
* SKILL.md, README.md, CHANGELOG.md, .gitignore, resources/, and an optional
|
|
6
|
+
* scripts/ directory.
|
|
7
|
+
*
|
|
8
|
+
* Relationship with `skillsmith author init`:
|
|
9
|
+
* - `create` → ~/.claude/skills/<name>/ (user-level, publish-oriented,
|
|
10
|
+
* CHANGELOG.md + Behavioral Classification included)
|
|
11
|
+
* - `author init` → current working directory (in-project skill authoring)
|
|
12
|
+
*
|
|
13
|
+
* Long-term, `create` is the preferred command for publishing new skills to the
|
|
14
|
+
* Skillsmith registry. `author init` is retained for in-project authoring workflows.
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from 'commander';
|
|
17
|
+
import { input, confirm, select } from '@inquirer/prompts';
|
|
18
|
+
import chalk from 'chalk';
|
|
19
|
+
import ora from 'ora';
|
|
20
|
+
import { mkdir, writeFile, stat } from 'fs/promises';
|
|
21
|
+
import { join } from 'path';
|
|
22
|
+
import { homedir } from 'os';
|
|
23
|
+
import { sanitizeError } from '../utils/sanitize.js';
|
|
24
|
+
import { validateSkillName } from '../utils/skill-name.js';
|
|
25
|
+
import { SKILL_MD_TEMPLATE, README_MD_TEMPLATE, CHANGELOG_MD_TEMPLATE } from '../templates/index.js';
|
|
26
|
+
export { validateSkillName };
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// Constants
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
const VALID_TYPES = ['basic', 'intermediate', 'advanced'];
|
|
31
|
+
const VALID_BEHAVIORS = ['autonomous', 'guided', 'interactive', 'configurable'];
|
|
32
|
+
const VALID_CATEGORIES = [
|
|
33
|
+
'development',
|
|
34
|
+
'productivity',
|
|
35
|
+
'communication',
|
|
36
|
+
'data',
|
|
37
|
+
'security',
|
|
38
|
+
'other',
|
|
39
|
+
];
|
|
40
|
+
/** GitHub username format: alphanumeric and hyphens, must start with alphanumeric. */
|
|
41
|
+
const GITHUB_USERNAME_RE = /^[a-zA-Z0-9][a-zA-Z0-9-]*$/;
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Helpers
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
/**
|
|
46
|
+
* Sanitize a user-supplied string for safe insertion into a YAML scalar value.
|
|
47
|
+
* Strips newlines/carriage returns and double-quotes values containing YAML
|
|
48
|
+
* special characters to prevent frontmatter corruption.
|
|
49
|
+
*/
|
|
50
|
+
function sanitizeYamlScalar(value) {
|
|
51
|
+
const safe = value.replace(/[\r\n]/g, ' ').trim();
|
|
52
|
+
// Wrap in double quotes when value contains YAML-special characters
|
|
53
|
+
if (/[:#[\]{}&|>'"*?!%@`]/.test(safe) || safe.startsWith(' ') || safe.endsWith(' ')) {
|
|
54
|
+
return `"${safe.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
55
|
+
}
|
|
56
|
+
return safe;
|
|
57
|
+
}
|
|
58
|
+
function capitalize(s) {
|
|
59
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
60
|
+
}
|
|
61
|
+
function behaviorDescription(behavior) {
|
|
62
|
+
switch (behavior) {
|
|
63
|
+
case 'autonomous':
|
|
64
|
+
return 'This skill operates autonomously — it executes its full workflow without requiring user input at each step.';
|
|
65
|
+
case 'guided':
|
|
66
|
+
return 'This skill is guided — it asks for your input on key decisions, then executes based on your choices.';
|
|
67
|
+
case 'interactive':
|
|
68
|
+
return 'This skill is interactive — it maintains a back-and-forth dialogue throughout execution.';
|
|
69
|
+
case 'configurable':
|
|
70
|
+
return 'This skill is configurable — behavior is controlled by settings you provide upfront.';
|
|
71
|
+
default:
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Build the SKILL.md content, sanitizing YAML frontmatter values. */
|
|
76
|
+
function buildSkillMd(opts) {
|
|
77
|
+
const behavioralClassification = `\n## Behavioral Classification\n\n**Type**: ${capitalize(opts.type)}\n**Behavior**: ${capitalize(opts.behavior)}\n\n${behaviorDescription(opts.behavior)}\n`;
|
|
78
|
+
return SKILL_MD_TEMPLATE.replace(/\{\{name\}\}/g, opts.name)
|
|
79
|
+
.replace(/\{\{description\}\}/g, sanitizeYamlScalar(opts.description))
|
|
80
|
+
.replace(/\{\{author\}\}/g, sanitizeYamlScalar(opts.author))
|
|
81
|
+
.replace(/\{\{category\}\}/g, opts.category)
|
|
82
|
+
.replace(/\{\{date\}\}/g, opts.date)
|
|
83
|
+
.replace(/\{\{behavioralClassification\}\}/g, behavioralClassification);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Scaffold a new Claude Code skill at ~/.claude/skills/<name>/ (or --output).
|
|
87
|
+
*/
|
|
88
|
+
export async function createSkill(name, options = {}) {
|
|
89
|
+
// 1. Skill name
|
|
90
|
+
const skillName = name ??
|
|
91
|
+
(await input({
|
|
92
|
+
message: 'Skill name (lowercase, hyphens only):',
|
|
93
|
+
validate: validateSkillName,
|
|
94
|
+
}));
|
|
95
|
+
const nameValidation = validateSkillName(skillName);
|
|
96
|
+
if (nameValidation !== true) {
|
|
97
|
+
console.error(chalk.red(`Invalid skill name: ${nameValidation}`));
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
// 2. Description (identity fields first, so user understands context before technical choices)
|
|
101
|
+
const description = options.description ??
|
|
102
|
+
(await input({
|
|
103
|
+
message: 'Description:',
|
|
104
|
+
default: `A Claude Code skill for ${skillName}`,
|
|
105
|
+
validate: (v) => (v.trim() ? true : 'Description is required'),
|
|
106
|
+
}));
|
|
107
|
+
if (!description.trim()) {
|
|
108
|
+
console.error(chalk.red('Description is required'));
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
// 3. Author (GitHub username) — validated for URL safety
|
|
112
|
+
const rawAuthor = options.author ??
|
|
113
|
+
(await input({
|
|
114
|
+
message: 'Author (GitHub username):',
|
|
115
|
+
default: process.env['USER'] ?? process.env['USERNAME'] ?? 'author',
|
|
116
|
+
validate: (v) => {
|
|
117
|
+
if (!v.trim())
|
|
118
|
+
return 'Author is required';
|
|
119
|
+
if (!GITHUB_USERNAME_RE.test(v.trim()))
|
|
120
|
+
return 'Must be a valid GitHub username (alphanumeric and hyphens only)';
|
|
121
|
+
return true;
|
|
122
|
+
},
|
|
123
|
+
}));
|
|
124
|
+
if (!rawAuthor.trim() || !GITHUB_USERNAME_RE.test(rawAuthor.trim())) {
|
|
125
|
+
console.error(chalk.red('Invalid author: must be a valid GitHub username (alphanumeric and hyphens only)'));
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
const author = rawAuthor.trim();
|
|
129
|
+
// 4. Category — validate CLI flag; select prompt constrains to valid values
|
|
130
|
+
if (options.category && !VALID_CATEGORIES.includes(options.category)) {
|
|
131
|
+
console.error(chalk.red(`Invalid category: ${options.category}. Valid: ${VALID_CATEGORIES.join(', ')}`));
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
const category = options.category ??
|
|
135
|
+
(await select({
|
|
136
|
+
message: 'Category:',
|
|
137
|
+
choices: [
|
|
138
|
+
{ name: 'Development', value: 'development' },
|
|
139
|
+
{ name: 'Productivity', value: 'productivity' },
|
|
140
|
+
{ name: 'Communication', value: 'communication' },
|
|
141
|
+
{ name: 'Data', value: 'data' },
|
|
142
|
+
{ name: 'Security', value: 'security' },
|
|
143
|
+
{ name: 'Other', value: 'other' },
|
|
144
|
+
],
|
|
145
|
+
}));
|
|
146
|
+
// 5. Skill type — validate CLI flag
|
|
147
|
+
if (options.type && !VALID_TYPES.includes(options.type)) {
|
|
148
|
+
console.error(chalk.red(`Invalid type: ${options.type}. Valid: ${VALID_TYPES.join(', ')}`));
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
const skillType = options.type ??
|
|
152
|
+
(await select({
|
|
153
|
+
message: 'Skill type:',
|
|
154
|
+
choices: [
|
|
155
|
+
{ name: 'Basic — simple, single-purpose skill', value: 'basic' },
|
|
156
|
+
{ name: 'Intermediate — multi-step with some decisions', value: 'intermediate' },
|
|
157
|
+
{ name: 'Advanced — complex orchestration or agent delegation', value: 'advanced' },
|
|
158
|
+
],
|
|
159
|
+
}));
|
|
160
|
+
// 6. Behavioral classification — validate CLI flag
|
|
161
|
+
if (options.behavior && !VALID_BEHAVIORS.includes(options.behavior)) {
|
|
162
|
+
console.error(chalk.red(`Invalid behavior: ${options.behavior}. Valid: ${VALID_BEHAVIORS.join(', ')}`));
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
const behavior = options.behavior ??
|
|
166
|
+
(await select({
|
|
167
|
+
message: 'Behavioral classification:',
|
|
168
|
+
choices: [
|
|
169
|
+
{ name: 'Autonomous — runs without user input', value: 'autonomous' },
|
|
170
|
+
{ name: 'Guided — asks key questions then executes', value: 'guided' },
|
|
171
|
+
{
|
|
172
|
+
name: 'Interactive — back-and-forth dialogue throughout execution',
|
|
173
|
+
value: 'interactive',
|
|
174
|
+
},
|
|
175
|
+
{ name: 'Configurable — settings-driven, provided upfront', value: 'configurable' },
|
|
176
|
+
],
|
|
177
|
+
}));
|
|
178
|
+
// 7. Scripts directory
|
|
179
|
+
const includeScripts = options.scripts ??
|
|
180
|
+
(await confirm({
|
|
181
|
+
message: 'Include a scripts/ directory?',
|
|
182
|
+
default: false,
|
|
183
|
+
}));
|
|
184
|
+
// 8. Resolve output directory — lazy (never baked in at module load time)
|
|
185
|
+
const outputDir = options.output ?? join(homedir(), '.claude', 'skills');
|
|
186
|
+
const skillDir = join(outputDir, skillName);
|
|
187
|
+
// 9. Overwrite check — after all prompts so user knows what they committed to
|
|
188
|
+
let exists = false;
|
|
189
|
+
try {
|
|
190
|
+
await stat(skillDir);
|
|
191
|
+
exists = true;
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
// Directory does not exist — proceed
|
|
195
|
+
}
|
|
196
|
+
if (exists && !options.yes) {
|
|
197
|
+
// --yes semantics: always overwrite without prompt
|
|
198
|
+
const overwrite = await confirm({
|
|
199
|
+
message: `${skillDir} already exists. Overwrite?`,
|
|
200
|
+
default: false,
|
|
201
|
+
});
|
|
202
|
+
if (!overwrite) {
|
|
203
|
+
console.log(chalk.yellow('Cancelled.'));
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const date = new Date().toISOString().split('T')[0] ?? new Date().toISOString().slice(0, 10);
|
|
208
|
+
// Build file contents
|
|
209
|
+
const skillMdContent = buildSkillMd({
|
|
210
|
+
name: skillName,
|
|
211
|
+
description,
|
|
212
|
+
author,
|
|
213
|
+
category,
|
|
214
|
+
type: skillType,
|
|
215
|
+
behavior,
|
|
216
|
+
date,
|
|
217
|
+
});
|
|
218
|
+
const readmeContent = README_MD_TEMPLATE.replace(/skillsmith install \{\{name\}\}/g, `skillsmith install ${author}/{{name}}`)
|
|
219
|
+
.replace(/\{\{name\}\}/g, skillName)
|
|
220
|
+
.replace(/\{\{description\}\}/g, description);
|
|
221
|
+
const changelogContent = CHANGELOG_MD_TEMPLATE.replace(/\{\{name\}\}/g, skillName).replace(/\{\{date\}\}/g, date);
|
|
222
|
+
// JSON.stringify prevents skill names containing single-quotes from breaking generated JS
|
|
223
|
+
const scriptContent = `#!/usr/bin/env node\n/**\n * ${skillName} - Example Script\n */\nconsole.log(${JSON.stringify(`${skillName} script executed`)})\n`;
|
|
224
|
+
const gitignoreContent = `# Dependencies\nnode_modules/\n\n# Build output\ndist/\n\n# Environment\n.env\n.env.local\n\n# OS files\n.DS_Store\nThumbs.db\n`;
|
|
225
|
+
// 10. Dry run — preview scaffold output without writing any files
|
|
226
|
+
if (options.dryRun) {
|
|
227
|
+
console.log();
|
|
228
|
+
console.log(chalk.bold(`Dry run — would scaffold: ${skillDir}/`));
|
|
229
|
+
console.log(chalk.dim(' SKILL.md'));
|
|
230
|
+
console.log(chalk.dim(' README.md'));
|
|
231
|
+
console.log(chalk.dim(' CHANGELOG.md'));
|
|
232
|
+
console.log(chalk.dim(' .gitignore'));
|
|
233
|
+
console.log(chalk.dim(' resources/'));
|
|
234
|
+
if (includeScripts) {
|
|
235
|
+
console.log(chalk.dim(' scripts/'));
|
|
236
|
+
console.log(chalk.dim(' scripts/example.js'));
|
|
237
|
+
}
|
|
238
|
+
console.log();
|
|
239
|
+
console.log(chalk.bold('SKILL.md preview:'));
|
|
240
|
+
const preview = skillMdContent.length > 500 ? skillMdContent.slice(0, 500) + '\n…' : skillMdContent;
|
|
241
|
+
console.log(chalk.dim(preview));
|
|
242
|
+
console.log();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const spinner = ora('Scaffolding skill...').start();
|
|
246
|
+
try {
|
|
247
|
+
await mkdir(skillDir, { recursive: true });
|
|
248
|
+
await mkdir(join(skillDir, 'resources'), { recursive: true });
|
|
249
|
+
if (includeScripts) {
|
|
250
|
+
await mkdir(join(skillDir, 'scripts'), { recursive: true });
|
|
251
|
+
}
|
|
252
|
+
await writeFile(join(skillDir, 'SKILL.md'), skillMdContent, 'utf-8');
|
|
253
|
+
await writeFile(join(skillDir, 'README.md'), readmeContent, 'utf-8');
|
|
254
|
+
await writeFile(join(skillDir, 'CHANGELOG.md'), changelogContent, 'utf-8');
|
|
255
|
+
await writeFile(join(skillDir, '.gitignore'), gitignoreContent, 'utf-8');
|
|
256
|
+
if (includeScripts) {
|
|
257
|
+
await writeFile(join(skillDir, 'scripts', 'example.js'), scriptContent, 'utf-8');
|
|
258
|
+
}
|
|
259
|
+
spinner.succeed(`Skill scaffolded at ${skillDir}`);
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
spinner.fail(`Failed to scaffold skill: ${sanitizeError(error)}`);
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
// Publishing checklist — aligned with v1.1.0 publish gate requirements
|
|
266
|
+
// (README filled, CHANGELOG filled, release tag, registry submit)
|
|
267
|
+
console.log();
|
|
268
|
+
console.log(chalk.bold('Publishing checklist:'));
|
|
269
|
+
console.log(chalk.dim(` 1. Edit SKILL.md — write your skill's instructions and trigger phrases`));
|
|
270
|
+
console.log(chalk.dim(` 2. Complete README.md — problem statement, usage examples, requirements`));
|
|
271
|
+
console.log(chalk.dim(` 3. Update CHANGELOG.md — confirm the [1.0.0] entry is accurate`));
|
|
272
|
+
console.log(chalk.dim(' 4. Test your skill locally with Claude Code'));
|
|
273
|
+
console.log(chalk.dim(' 5. Publish to GitHub:'));
|
|
274
|
+
console.log(chalk.cyan(` gh repo create ${skillName} --public`));
|
|
275
|
+
console.log(chalk.cyan(` cd ${skillDir} && git init && git add . && git commit -m "feat: initial skill"`));
|
|
276
|
+
console.log(chalk.cyan(` git remote add origin https://github.com/${author}/${skillName}`));
|
|
277
|
+
console.log(chalk.cyan(' git push -u origin main'));
|
|
278
|
+
console.log(chalk.cyan(' gh release create v1.0.0 --title "v1.0.0" --notes "Initial release"'));
|
|
279
|
+
console.log(chalk.dim(' 6. Submit to Skillsmith registry: skillsmith publish'));
|
|
280
|
+
console.log();
|
|
281
|
+
}
|
|
282
|
+
// ---------------------------------------------------------------------------
|
|
283
|
+
// Command factory
|
|
284
|
+
// ---------------------------------------------------------------------------
|
|
285
|
+
/**
|
|
286
|
+
* Create the `skillsmith create` command.
|
|
287
|
+
* SMI-3083: Scaffold new Claude Code skills without a separate skill install.
|
|
288
|
+
*
|
|
289
|
+
* See also: `skillsmith author init` — scaffolds into the CWD for in-project
|
|
290
|
+
* skill authoring (no CHANGELOG.md or Behavioral Classification section).
|
|
291
|
+
*/
|
|
292
|
+
export function createCreateCommand() {
|
|
293
|
+
return new Command('create')
|
|
294
|
+
.description('Scaffold a new Claude Code skill at ~/.claude/skills/<name>/ (see also: skillsmith author init)')
|
|
295
|
+
.argument('[name]', 'Skill name (lowercase, hyphens only)')
|
|
296
|
+
.option('-o, --output <dir>', 'Output directory (default: ~/.claude/skills)')
|
|
297
|
+
.option('--type <type>', 'Skill type: basic|intermediate|advanced')
|
|
298
|
+
.option('--behavior <behavior>', 'Behavioral classification: autonomous|guided|interactive|configurable')
|
|
299
|
+
.option('-d, --description <description>', 'Skill description (skips prompt)')
|
|
300
|
+
.option('-a, --author <author>', 'Author GitHub username (skips prompt)')
|
|
301
|
+
.option('-c, --category <category>', 'Category: development|productivity|communication|data|security|other (skips prompt)')
|
|
302
|
+
.option('--scripts', 'Include a scripts/ directory')
|
|
303
|
+
.option('-y, --yes', 'Auto-confirm overwrite — always overwrites if skill directory exists')
|
|
304
|
+
.option('--dry-run', 'Preview scaffold output without writing files')
|
|
305
|
+
.action(async (name, opts) => {
|
|
306
|
+
try {
|
|
307
|
+
await createSkill(name, {
|
|
308
|
+
output: opts['output'],
|
|
309
|
+
type: opts['type'],
|
|
310
|
+
behavior: opts['behavior'],
|
|
311
|
+
description: opts['description'],
|
|
312
|
+
author: opts['author'],
|
|
313
|
+
category: opts['category'],
|
|
314
|
+
scripts: opts['scripts'],
|
|
315
|
+
yes: opts['yes'],
|
|
316
|
+
dryRun: opts['dryRun'],
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
console.error(chalk.red('Error creating skill:'), sanitizeError(error));
|
|
321
|
+
process.exit(1);
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK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;SACpE,MAAM,CACL,KAAK,EAAE,IAAwB,EAAE,IAAkD,EAAE,EAAE;QACrF,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,IAAI,EAAE;gBACtB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAuB;gBAC5C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAuB;gBACxC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAuB;gBAChD,WAAW,EAAE,IAAI,CAAC,aAAa,CAAuB;gBACtD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAuB;gBAC5C,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAuB;gBAChD,OAAO,EAAE,IAAI,CAAC,SAAS,CAAwB;gBAC/C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAwB;gBACvC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAwB;aAC9C,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;YACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,CACF,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview skillsmith diff — section-level skill content diff
|
|
3
|
+
* @module @skillsmith/cli/commands/diff
|
|
4
|
+
* @see SMI-skill-version-tracking Wave 2
|
|
5
|
+
*
|
|
6
|
+
* Compares an installed skill against its latest registry version using
|
|
7
|
+
* heading-level (H2/H3) section analysis. Produces a human-readable
|
|
8
|
+
* summary: sections removed (major), added (minor), or modified (patch).
|
|
9
|
+
*
|
|
10
|
+
* Tier gate: Individual (requires requireTier('individual')).
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
/**
|
|
14
|
+
* Create the diff command
|
|
15
|
+
*/
|
|
16
|
+
export declare function createDiffCommand(): Command;
|
|
17
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/commands/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA6JnC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAwD3C"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview skillsmith diff — section-level skill content diff
|
|
3
|
+
* @module @skillsmith/cli/commands/diff
|
|
4
|
+
* @see SMI-skill-version-tracking Wave 2
|
|
5
|
+
*
|
|
6
|
+
* Compares an installed skill against its latest registry version using
|
|
7
|
+
* heading-level (H2/H3) section analysis. Produces a human-readable
|
|
8
|
+
* summary: sections removed (major), added (minor), or modified (patch).
|
|
9
|
+
*
|
|
10
|
+
* Tier gate: Individual (requires requireTier('individual')).
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
import chalk from 'chalk';
|
|
14
|
+
import { readFile } from 'fs/promises';
|
|
15
|
+
import { join } from 'path';
|
|
16
|
+
import { homedir } from 'os';
|
|
17
|
+
import { classifyChange } from '@skillsmith/core';
|
|
18
|
+
import { requireTier } from '../utils/require-tier.js';
|
|
19
|
+
import { sanitizeError } from '../utils/sanitize.js';
|
|
20
|
+
import { loadManifest } from '../utils/manifest.js';
|
|
21
|
+
function extractHeadings(content) {
|
|
22
|
+
const headings = new Map();
|
|
23
|
+
for (const line of content.split('\n')) {
|
|
24
|
+
const m = /^#{2,3}\s+(.+)/.exec(line);
|
|
25
|
+
if (m && m[1] !== undefined) {
|
|
26
|
+
const title = m[1].trim();
|
|
27
|
+
headings.set(title.toLowerCase(), title);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return headings;
|
|
31
|
+
}
|
|
32
|
+
function extractSectionBodies(content) {
|
|
33
|
+
const result = new Map();
|
|
34
|
+
const lines = content.split('\n');
|
|
35
|
+
let currentHeading = null;
|
|
36
|
+
const bodyLines = [];
|
|
37
|
+
const flush = () => {
|
|
38
|
+
if (currentHeading !== null) {
|
|
39
|
+
result.set(currentHeading, bodyLines.join('\n').trim());
|
|
40
|
+
bodyLines.length = 0;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
for (const line of lines) {
|
|
44
|
+
const m = /^#{2,3}\s+(.+)/.exec(line);
|
|
45
|
+
if (m && m[1] !== undefined) {
|
|
46
|
+
flush();
|
|
47
|
+
currentHeading = m[1].trim().toLowerCase();
|
|
48
|
+
}
|
|
49
|
+
else if (currentHeading !== null) {
|
|
50
|
+
bodyLines.push(line);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
flush();
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
function diffSections(oldContent, newContent) {
|
|
57
|
+
const oldH = extractHeadings(oldContent);
|
|
58
|
+
const newH = extractHeadings(newContent);
|
|
59
|
+
const oldBodies = extractSectionBodies(oldContent);
|
|
60
|
+
const newBodies = extractSectionBodies(newContent);
|
|
61
|
+
const removed = [...oldH.values()].filter((t) => !newH.has(t.toLowerCase()));
|
|
62
|
+
const added = [...newH.values()].filter((t) => !oldH.has(t.toLowerCase()));
|
|
63
|
+
const modified = [];
|
|
64
|
+
for (const [key, title] of newH) {
|
|
65
|
+
if (oldH.has(key)) {
|
|
66
|
+
const oldBody = oldBodies.get(key) ?? '';
|
|
67
|
+
const newBody = newBodies.get(key) ?? '';
|
|
68
|
+
if (oldBody !== newBody)
|
|
69
|
+
modified.push(title);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { added, removed, modified };
|
|
73
|
+
}
|
|
74
|
+
// ============================================================================
|
|
75
|
+
// Content resolution helpers
|
|
76
|
+
// ============================================================================
|
|
77
|
+
async function readInstalledSkillContent(skillName) {
|
|
78
|
+
const skillPath = join(homedir(), '.claude', 'skills', skillName, 'SKILL.md');
|
|
79
|
+
try {
|
|
80
|
+
return await readFile(skillPath, 'utf-8');
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Convert a GitHub repo URL to the raw SKILL.md URL.
|
|
88
|
+
* Returns null for non-GitHub or unrecognised URL shapes.
|
|
89
|
+
*/
|
|
90
|
+
function buildRawUrl(source) {
|
|
91
|
+
if (source.startsWith('https://raw.githubusercontent.com/'))
|
|
92
|
+
return source;
|
|
93
|
+
const m = /^https:\/\/github\.com\/([^/]+)\/([^/]+)(?:\/tree\/([^/]+))?/.exec(source);
|
|
94
|
+
if (!m)
|
|
95
|
+
return null;
|
|
96
|
+
const [, owner, repo, ref = 'main'] = m;
|
|
97
|
+
return `https://raw.githubusercontent.com/${owner}/${repo}/${ref}/SKILL.md`;
|
|
98
|
+
}
|
|
99
|
+
async function fetchLatestContent(skillName) {
|
|
100
|
+
try {
|
|
101
|
+
const manifest = await loadManifest();
|
|
102
|
+
const entry = manifest.installedSkills[skillName];
|
|
103
|
+
if (!entry?.source)
|
|
104
|
+
return null;
|
|
105
|
+
const rawUrl = buildRawUrl(entry.source);
|
|
106
|
+
if (!rawUrl)
|
|
107
|
+
return null;
|
|
108
|
+
const response = await fetch(rawUrl, {
|
|
109
|
+
headers: { Accept: 'text/plain' },
|
|
110
|
+
signal: AbortSignal.timeout(10_000),
|
|
111
|
+
});
|
|
112
|
+
if (!response.ok)
|
|
113
|
+
return null;
|
|
114
|
+
return await response.text();
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// ============================================================================
|
|
121
|
+
// Display
|
|
122
|
+
// ============================================================================
|
|
123
|
+
function printDiff(skillName, diff, changeType) {
|
|
124
|
+
const totalChanges = diff.removed.length + diff.added.length + diff.modified.length;
|
|
125
|
+
console.log('\n' +
|
|
126
|
+
chalk.bold(skillName) +
|
|
127
|
+
' ' +
|
|
128
|
+
chalk.dim(`[${changeType.toUpperCase()}]`) +
|
|
129
|
+
` ${totalChanges} section(s) changed`);
|
|
130
|
+
for (const s of diff.removed)
|
|
131
|
+
console.log(chalk.red(` - ${s}`));
|
|
132
|
+
for (const s of diff.added)
|
|
133
|
+
console.log(chalk.green(` + ${s}`));
|
|
134
|
+
for (const s of diff.modified)
|
|
135
|
+
console.log(chalk.yellow(` ~ ${s}`));
|
|
136
|
+
if (totalChanges === 0) {
|
|
137
|
+
console.log(chalk.dim(' No section-level changes detected'));
|
|
138
|
+
}
|
|
139
|
+
console.log();
|
|
140
|
+
}
|
|
141
|
+
// ============================================================================
|
|
142
|
+
// Command factory
|
|
143
|
+
// ============================================================================
|
|
144
|
+
/**
|
|
145
|
+
* Create the diff command
|
|
146
|
+
*/
|
|
147
|
+
export function createDiffCommand() {
|
|
148
|
+
return new Command('diff')
|
|
149
|
+
.description('Show section-level diff between installed and latest version of a skill (Individual tier)')
|
|
150
|
+
.argument('<skill>', 'Skill name to diff')
|
|
151
|
+
.option('--old-content <path>', 'Path to old SKILL.md (uses installed skill if omitted)')
|
|
152
|
+
.option('--new-content <path>', 'Path to new SKILL.md (fetches from registry if omitted)')
|
|
153
|
+
.action(async (skillName, opts) => {
|
|
154
|
+
try {
|
|
155
|
+
await requireTier('individual');
|
|
156
|
+
// Resolve old content
|
|
157
|
+
let oldContent = null;
|
|
158
|
+
if (opts.oldContent) {
|
|
159
|
+
oldContent = await readFile(opts.oldContent, 'utf-8');
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
oldContent = await readInstalledSkillContent(skillName);
|
|
163
|
+
}
|
|
164
|
+
if (!oldContent) {
|
|
165
|
+
console.error(chalk.red(`Skill "${skillName}" is not installed or SKILL.md not found.`));
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
// Resolve new content
|
|
169
|
+
let newContent = null;
|
|
170
|
+
if (opts.newContent) {
|
|
171
|
+
newContent = await readFile(opts.newContent, 'utf-8');
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
newContent = await fetchLatestContent(skillName);
|
|
175
|
+
}
|
|
176
|
+
if (!newContent) {
|
|
177
|
+
console.error(chalk.red(`Could not fetch latest version for "${skillName}". ` +
|
|
178
|
+
`Check your network connection or provide --new-content.`));
|
|
179
|
+
process.exit(1);
|
|
180
|
+
}
|
|
181
|
+
const diff = diffSections(oldContent, newContent);
|
|
182
|
+
const changeType = classifyChange(oldContent, newContent);
|
|
183
|
+
printDiff(skillName, diff, changeType);
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
console.error(chalk.red('Error:'), sanitizeError(error));
|
|
187
|
+
process.exit(1);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../src/commands/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAYnD,SAAS,eAAe,CAAC,OAAe;IACtC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAA;IAC1C,KAAK,MAAM,IAAI,IAA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