claude-skills-cli 0.0.19 → 0.0.21
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/add-hook.cmd-B6iZtoPi.js +193 -0
- package/dist/add-hook.cmd-B6iZtoPi.js.map +1 -0
- package/dist/doctor.cmd-CkNw6ine.js +119 -0
- package/dist/doctor.cmd-CkNw6ine.js.map +1 -0
- package/dist/frontmatter-validator-DO686mla.js +226 -0
- package/dist/frontmatter-validator-DO686mla.js.map +1 -0
- package/dist/fs-CuGv3Ob2.js +23 -0
- package/dist/fs-CuGv3Ob2.js.map +1 -0
- package/dist/index.js +24 -22
- package/dist/index.js.map +1 -1
- package/dist/init.cmd-BoeuCgQP.js +108 -0
- package/dist/init.cmd-BoeuCgQP.js.map +1 -0
- package/dist/install.cmd-CH7yZ92g.js +79 -0
- package/dist/install.cmd-CH7yZ92g.js.map +1 -0
- package/dist/output-Dz8fk6Gu.js +102 -0
- package/dist/output-Dz8fk6Gu.js.map +1 -0
- package/dist/package.cmd-CwGRHdEq.js +107 -0
- package/dist/package.cmd-CwGRHdEq.js.map +1 -0
- package/dist/stats.cmd-D1ujNiDO.js +121 -0
- package/dist/stats.cmd-D1ujNiDO.js.map +1 -0
- package/dist/{core/templates.js → templates-BQTgkXfH.js} +18 -15
- package/dist/templates-BQTgkXfH.js.map +1 -0
- package/dist/validate.cmd-CDUJDKGs.js +96 -0
- package/dist/validate.cmd-CDUJDKGs.js.map +1 -0
- package/dist/validator-DV5zeeel.js +721 -0
- package/dist/validator-DV5zeeel.js.map +1 -0
- package/package.json +34 -35
- package/dist/commands/add-hook.cmd.js +0 -35
- package/dist/commands/add-hook.cmd.js.map +0 -1
- package/dist/commands/add-hook.js +0 -216
- package/dist/commands/add-hook.js.map +0 -1
- package/dist/commands/doctor.cmd.js +0 -19
- package/dist/commands/doctor.cmd.js.map +0 -1
- package/dist/commands/doctor.js +0 -128
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/init.cmd.js +0 -37
- package/dist/commands/init.cmd.js.map +0 -1
- package/dist/commands/init.js +0 -82
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/install.cmd.js +0 -23
- package/dist/commands/install.cmd.js.map +0 -1
- package/dist/commands/install.js +0 -64
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/package.cmd.js +0 -28
- package/dist/commands/package.cmd.js.map +0 -1
- package/dist/commands/package.js +0 -134
- package/dist/commands/package.js.map +0 -1
- package/dist/commands/stats.cmd.js +0 -19
- package/dist/commands/stats.cmd.js.map +0 -1
- package/dist/commands/stats.js +0 -154
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/validate.cmd.js +0 -39
- package/dist/commands/validate.cmd.js.map +0 -1
- package/dist/commands/validate.js +0 -77
- package/dist/commands/validate.js.map +0 -1
- package/dist/core/templates.js.map +0 -1
- package/dist/core/validator.js +0 -252
- package/dist/core/validator.js.map +0 -1
- package/dist/help.js +0 -305
- package/dist/help.js.map +0 -1
- package/dist/skills/.gitkeep +0 -0
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils/fs.js +0 -25
- package/dist/utils/fs.js.map +0 -1
- package/dist/utils/output.js +0 -102
- package/dist/utils/output.js.map +0 -1
- package/dist/validators/alignment-validator.js +0 -54
- package/dist/validators/alignment-validator.js.map +0 -1
- package/dist/validators/content-validator.js +0 -156
- package/dist/validators/content-validator.js.map +0 -1
- package/dist/validators/description-validator.js +0 -136
- package/dist/validators/description-validator.js.map +0 -1
- package/dist/validators/file-structure-validator.js +0 -125
- package/dist/validators/file-structure-validator.js.map +0 -1
- package/dist/validators/frontmatter-validator.js +0 -190
- package/dist/validators/frontmatter-validator.js.map +0 -1
- package/dist/validators/references-validator.js +0 -155
- package/dist/validators/references-validator.js.map +0 -1
- package/dist/validators/text-analysis.js +0 -71
- package/dist/validators/text-analysis.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate.cmd.js","sourceRoot":"","sources":["../../src/commands/validate.cmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,eAAe,aAAa,CAAC;IAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE;IAC3D,IAAI,EAAE;QACL,UAAU,EAAE;YACX,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,IAAI;SACd;QACD,MAAM,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,8BAA8B;YAC3C,OAAO,EAAE,MAAM;SACf;QACD,MAAM,EAAE;YACP,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,qCAAqC;SAClD;QACD,OAAO,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,oCAAoC;SACjD;QACD,KAAK,EAAE;YACN,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,+CAA+C;SAC5D;KACD;IACD,GAAG,CAAC,EAAE,IAAI,EAAE;QACX,gBAAgB,CAAC;YAChB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAChD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,CAAC,CAAC;IACJ,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { basename } from 'node:path';
|
|
2
|
-
import { SkillValidator } from '../core/validator.js';
|
|
3
|
-
import { display_validation_stats, error, info, success, } from '../utils/output.js';
|
|
4
|
-
export function validate_command(options) {
|
|
5
|
-
const { skill_path, strict, format = 'text', lenient = false, loose = false, } = options;
|
|
6
|
-
// Normalize path by removing trailing slashes before extracting basename
|
|
7
|
-
const normalized_path = skill_path.replace(/\/+$/, '');
|
|
8
|
-
const skill_name = basename(normalized_path);
|
|
9
|
-
// Determine validation mode: loose > lenient > strict (default)
|
|
10
|
-
const mode = loose ? 'loose' : lenient ? 'lenient' : 'strict';
|
|
11
|
-
const validator = new SkillValidator(skill_path, { mode });
|
|
12
|
-
const result = validator.validate_all();
|
|
13
|
-
// JSON output
|
|
14
|
-
if (format === 'json') {
|
|
15
|
-
const json_output = {
|
|
16
|
-
skill_name,
|
|
17
|
-
valid: result.is_valid,
|
|
18
|
-
errors: result.errors,
|
|
19
|
-
warnings: result.warnings,
|
|
20
|
-
validation: result.validation,
|
|
21
|
-
stats: result.stats,
|
|
22
|
-
};
|
|
23
|
-
console.log(JSON.stringify(json_output, null, 2));
|
|
24
|
-
// Exit codes for JSON mode
|
|
25
|
-
if (!result.is_valid) {
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
if (strict && result.warnings.length > 0) {
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
process.exit(0);
|
|
32
|
-
}
|
|
33
|
-
// Text output (existing)
|
|
34
|
-
info(`Validating skill: ${skill_name}`);
|
|
35
|
-
console.log('='.repeat(60));
|
|
36
|
-
// Display progressive disclosure stats
|
|
37
|
-
if (result.stats) {
|
|
38
|
-
display_validation_stats(result.stats);
|
|
39
|
-
}
|
|
40
|
-
// Print errors
|
|
41
|
-
if (result.errors.length > 0) {
|
|
42
|
-
console.log('\n❌ Errors:');
|
|
43
|
-
for (const err of result.errors) {
|
|
44
|
-
console.log(` ${err}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// Print warnings
|
|
48
|
-
if (result.warnings.length > 0) {
|
|
49
|
-
console.log('\n⚠️ Warnings:');
|
|
50
|
-
for (const warn of result.warnings) {
|
|
51
|
-
console.log(` ${warn}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// Print final status
|
|
55
|
-
if (!result.errors.length && !result.warnings.length) {
|
|
56
|
-
console.log('');
|
|
57
|
-
success('Skill is valid!');
|
|
58
|
-
}
|
|
59
|
-
else if (!result.errors.length) {
|
|
60
|
-
console.log('');
|
|
61
|
-
success('Skill is valid (with warnings)');
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
console.log('');
|
|
65
|
-
error(`Skill validation failed with ${result.errors.length} error(s)`);
|
|
66
|
-
}
|
|
67
|
-
// Handle exit codes
|
|
68
|
-
if (!result.is_valid) {
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
if (strict && result.warnings.length > 0) {
|
|
72
|
-
console.log('\n❌ Failed in strict mode due to warnings');
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|
|
75
|
-
process.exit(0);
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EACN,wBAAwB,EACxB,KAAK,EACL,IAAI,EACJ,OAAO,GACP,MAAM,oBAAoB,CAAC;AAE5B,MAAM,UAAU,gBAAgB,CAAC,OAAwB;IACxD,MAAM,EACL,UAAU,EACV,MAAM,EACN,MAAM,GAAG,MAAM,EACf,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,KAAK,GACb,GAAG,OAAO,CAAC;IACZ,yEAAyE;IACzE,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAE7C,gEAAgE;IAChE,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,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AAM,sBAAsB,GAAG,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6J3C,CAAC"}
|
package/dist/core/validator.js
DELETED
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
// Import validators
|
|
4
|
-
import { analyze_alignment } from '../validators/alignment-validator.js';
|
|
5
|
-
import { validate_content } from '../validators/content-validator.js';
|
|
6
|
-
import { analyze_trigger_phrase, analyze_user_phrasing, validate_description_content, } from '../validators/description-validator.js';
|
|
7
|
-
import { validate_assets, validate_directory, validate_path_formats, validate_scripts, } from '../validators/file-structure-validator.js';
|
|
8
|
-
import { extract_frontmatter, validate_frontmatter_structure, validate_hard_limits, validate_name_format, } from '../validators/frontmatter-validator.js';
|
|
9
|
-
import { validate_references } from '../validators/references-validator.js';
|
|
10
|
-
export class SkillValidator {
|
|
11
|
-
skill_path;
|
|
12
|
-
options;
|
|
13
|
-
errors = [];
|
|
14
|
-
warnings = [];
|
|
15
|
-
stats = {
|
|
16
|
-
word_count: 0,
|
|
17
|
-
estimated_tokens: 0,
|
|
18
|
-
line_count: 0,
|
|
19
|
-
description_length: 0,
|
|
20
|
-
description_tokens: 0,
|
|
21
|
-
code_blocks: 0,
|
|
22
|
-
sections: 0,
|
|
23
|
-
long_paragraphs: 0,
|
|
24
|
-
};
|
|
25
|
-
// Structured validation data
|
|
26
|
-
structured_validation = {
|
|
27
|
-
hard_limits: {
|
|
28
|
-
name: { length: 0, limit: 64, valid: true, error: null },
|
|
29
|
-
description: {
|
|
30
|
-
length: 0,
|
|
31
|
-
limit: 1024,
|
|
32
|
-
valid: true,
|
|
33
|
-
error: null,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
name_format: {
|
|
37
|
-
name: '',
|
|
38
|
-
format_valid: true,
|
|
39
|
-
directory_name: '',
|
|
40
|
-
matches_directory: true,
|
|
41
|
-
errors: [],
|
|
42
|
-
},
|
|
43
|
-
yaml_validation: {
|
|
44
|
-
valid: true,
|
|
45
|
-
has_frontmatter: false,
|
|
46
|
-
parse_error: null,
|
|
47
|
-
missing_fields: [],
|
|
48
|
-
},
|
|
49
|
-
path_format: {
|
|
50
|
-
invalid_paths: [],
|
|
51
|
-
},
|
|
52
|
-
triggering: {
|
|
53
|
-
trigger_phrase: {
|
|
54
|
-
has_explicit_trigger: false,
|
|
55
|
-
trigger_phrase: null,
|
|
56
|
-
trigger_type: 'missing',
|
|
57
|
-
},
|
|
58
|
-
user_phrasing: {
|
|
59
|
-
style_checks: {
|
|
60
|
-
is_third_person: true,
|
|
61
|
-
uses_gerund_form: true,
|
|
62
|
-
is_action_oriented: true,
|
|
63
|
-
},
|
|
64
|
-
issues: [],
|
|
65
|
-
},
|
|
66
|
-
keywords: {
|
|
67
|
-
description_keywords: [],
|
|
68
|
-
content_keywords: [],
|
|
69
|
-
overlap: [],
|
|
70
|
-
description_only: [],
|
|
71
|
-
content_only: [],
|
|
72
|
-
},
|
|
73
|
-
alignment: {
|
|
74
|
-
severity: 'good',
|
|
75
|
-
description_focus: [],
|
|
76
|
-
content_focus: [],
|
|
77
|
-
matches: [],
|
|
78
|
-
mismatches: [],
|
|
79
|
-
explanation: '',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
constructor(skill_path, options = {}) {
|
|
84
|
-
this.skill_path = skill_path;
|
|
85
|
-
this.options = options;
|
|
86
|
-
}
|
|
87
|
-
error(msg) {
|
|
88
|
-
this.errors.push(`❌ ${msg}`);
|
|
89
|
-
}
|
|
90
|
-
warning(msg) {
|
|
91
|
-
this.warnings.push(`⚠️ ${msg}`);
|
|
92
|
-
}
|
|
93
|
-
validate_skill_md() {
|
|
94
|
-
const skill_md_path = join(this.skill_path, 'SKILL.md');
|
|
95
|
-
if (!existsSync(skill_md_path)) {
|
|
96
|
-
this.error('SKILL.md file not found');
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
const content = readFileSync(skill_md_path, 'utf-8');
|
|
100
|
-
// Validate path formats (no Windows backslashes)
|
|
101
|
-
const path_format_result = validate_path_formats(content);
|
|
102
|
-
this.structured_validation.path_format =
|
|
103
|
-
path_format_result.validation;
|
|
104
|
-
path_format_result.errors.forEach((err) => this.error(err.message));
|
|
105
|
-
// Validate frontmatter structure
|
|
106
|
-
const frontmatter_validation = validate_frontmatter_structure(content);
|
|
107
|
-
this.structured_validation.yaml_validation =
|
|
108
|
-
frontmatter_validation;
|
|
109
|
-
if (!frontmatter_validation.valid) {
|
|
110
|
-
if (frontmatter_validation.parse_error) {
|
|
111
|
-
this.error(frontmatter_validation.parse_error);
|
|
112
|
-
}
|
|
113
|
-
frontmatter_validation.missing_fields.forEach((field) => {
|
|
114
|
-
this.error(`SKILL.md frontmatter missing '${field}' field`);
|
|
115
|
-
});
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
// Extract frontmatter data
|
|
119
|
-
const { name, description, body, description_is_multiline } = extract_frontmatter(content);
|
|
120
|
-
if (!name || !description) {
|
|
121
|
-
this.error('Failed to extract name or description from frontmatter');
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
// Warn if description spans multiple lines
|
|
125
|
-
if (description_is_multiline) {
|
|
126
|
-
this.warning(`Multi-line description detected. Claude Code cannot recognize skills with multi-line descriptions.\n` +
|
|
127
|
-
` → Run 'claude-skills-cli doctor ${this.skill_path}' to fix automatically`);
|
|
128
|
-
}
|
|
129
|
-
// Get directory name (normalize path to handle trailing slashes)
|
|
130
|
-
const normalized_path = this.skill_path.replace(/\/+$/, '');
|
|
131
|
-
const dir_name = normalized_path.split('/').pop() || '';
|
|
132
|
-
// Validate name format
|
|
133
|
-
const name_validation = validate_name_format(name, dir_name);
|
|
134
|
-
this.structured_validation.name_format = name_validation;
|
|
135
|
-
name_validation.errors.forEach((err) => this.error(err));
|
|
136
|
-
// Validate hard limits
|
|
137
|
-
const hard_limits = validate_hard_limits(name, description);
|
|
138
|
-
this.structured_validation.hard_limits = hard_limits;
|
|
139
|
-
if (!hard_limits.name.valid && hard_limits.name.error) {
|
|
140
|
-
this.error(hard_limits.name.error);
|
|
141
|
-
}
|
|
142
|
-
if (!hard_limits.description.valid &&
|
|
143
|
-
hard_limits.description.error) {
|
|
144
|
-
this.error(hard_limits.description.error);
|
|
145
|
-
}
|
|
146
|
-
// Validate description content
|
|
147
|
-
const desc_validation = validate_description_content(description);
|
|
148
|
-
this.stats.description_length =
|
|
149
|
-
desc_validation.stats.description_length;
|
|
150
|
-
this.stats.description_tokens =
|
|
151
|
-
desc_validation.stats.description_tokens;
|
|
152
|
-
desc_validation.errors.forEach((err) => this.error(err.message));
|
|
153
|
-
desc_validation.warnings.forEach((warn) => this.warning(warn.message));
|
|
154
|
-
// Analyze trigger phrase
|
|
155
|
-
const trigger_analysis = analyze_trigger_phrase(description);
|
|
156
|
-
this.structured_validation.triggering.trigger_phrase =
|
|
157
|
-
trigger_analysis;
|
|
158
|
-
if (!trigger_analysis.has_explicit_trigger) {
|
|
159
|
-
this.warning(`Description missing explicit trigger phrase ('Use when...', 'Use for...', 'Use to...')\n` +
|
|
160
|
-
` → Help Claude know when to activate this skill`);
|
|
161
|
-
}
|
|
162
|
-
// Analyze user phrasing
|
|
163
|
-
const { analysis: phrasing_analysis, warnings: phrasing_warnings, } = analyze_user_phrasing(description);
|
|
164
|
-
this.structured_validation.triggering.user_phrasing =
|
|
165
|
-
phrasing_analysis;
|
|
166
|
-
phrasing_warnings.forEach((warn) => this.warning(warn.message));
|
|
167
|
-
// Analyze alignment
|
|
168
|
-
const alignment_result = analyze_alignment(description, body);
|
|
169
|
-
this.structured_validation.triggering.keywords =
|
|
170
|
-
alignment_result.keywords;
|
|
171
|
-
this.structured_validation.triggering.alignment =
|
|
172
|
-
alignment_result.alignment;
|
|
173
|
-
alignment_result.warnings.forEach((warn) => this.warning(warn.message));
|
|
174
|
-
// Validate content (progressive disclosure)
|
|
175
|
-
const content_validation = validate_content(body, {
|
|
176
|
-
mode: this.options.mode,
|
|
177
|
-
});
|
|
178
|
-
this.stats.word_count = content_validation.stats.word_count;
|
|
179
|
-
this.stats.estimated_tokens =
|
|
180
|
-
content_validation.stats.estimated_tokens;
|
|
181
|
-
this.stats.line_count = content_validation.stats.line_count;
|
|
182
|
-
this.stats.code_blocks = content_validation.stats.code_blocks;
|
|
183
|
-
this.stats.sections = content_validation.stats.sections;
|
|
184
|
-
this.stats.long_paragraphs =
|
|
185
|
-
content_validation.stats.long_paragraphs;
|
|
186
|
-
content_validation.errors.forEach((err) => this.error(err.message));
|
|
187
|
-
content_validation.warnings.forEach((warn) => this.warning(warn.message));
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
validate_all() {
|
|
191
|
-
// Validate directory
|
|
192
|
-
const dir_result = validate_directory(this.skill_path);
|
|
193
|
-
if (!dir_result.valid) {
|
|
194
|
-
dir_result.errors.forEach((err) => this.error(err.message));
|
|
195
|
-
return {
|
|
196
|
-
errors: this.errors,
|
|
197
|
-
warnings: this.warnings,
|
|
198
|
-
is_valid: false,
|
|
199
|
-
stats: this.stats,
|
|
200
|
-
validation: this.structured_validation,
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
// Validate SKILL.md
|
|
204
|
-
this.validate_skill_md();
|
|
205
|
-
// Validate references
|
|
206
|
-
const refs_result = validate_references(this.skill_path);
|
|
207
|
-
refs_result.errors.forEach((err) => this.error(err.message));
|
|
208
|
-
refs_result.warnings.forEach((warn) => this.warning(warn.message));
|
|
209
|
-
// Validate scripts
|
|
210
|
-
const scripts_result = validate_scripts(this.skill_path);
|
|
211
|
-
scripts_result.warnings.forEach((warn) => this.warning(warn.message));
|
|
212
|
-
// Validate assets
|
|
213
|
-
const assets_result = validate_assets(this.skill_path);
|
|
214
|
-
assets_result.warnings.forEach((warn) => this.warning(warn.message));
|
|
215
|
-
// Populate progressive disclosure structured validation
|
|
216
|
-
// Use mode-specific limits: strict (50), lenient (150), loose (500)
|
|
217
|
-
const line_limit = this.options.mode === 'loose'
|
|
218
|
-
? 500
|
|
219
|
-
: this.options.mode === 'lenient'
|
|
220
|
-
? 150
|
|
221
|
-
: 50;
|
|
222
|
-
const word_limit = this.options.mode === 'loose'
|
|
223
|
-
? 5000
|
|
224
|
-
: this.options.mode === 'lenient'
|
|
225
|
-
? 2000
|
|
226
|
-
: 1000;
|
|
227
|
-
this.structured_validation.progressive_disclosure = {
|
|
228
|
-
skill_md_size: {
|
|
229
|
-
lines: this.stats.line_count,
|
|
230
|
-
words: this.stats.word_count,
|
|
231
|
-
tokens: this.stats.estimated_tokens,
|
|
232
|
-
exceeds_line_limit: this.stats.line_count > line_limit,
|
|
233
|
-
exceeds_word_limit: this.stats.word_count > word_limit,
|
|
234
|
-
},
|
|
235
|
-
references: refs_result.validation,
|
|
236
|
-
};
|
|
237
|
-
return {
|
|
238
|
-
errors: this.errors,
|
|
239
|
-
warnings: this.warnings,
|
|
240
|
-
is_valid: this.errors.length === 0,
|
|
241
|
-
stats: this.stats,
|
|
242
|
-
validation: this.structured_validation,
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
get_errors() {
|
|
246
|
-
return this.errors;
|
|
247
|
-
}
|
|
248
|
-
get_warnings() {
|
|
249
|
-
return this.warnings;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC,oBAAoB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ting for commands
|
|
2
|
-
export const INIT_HELP = {
|
|
3
|
-
command: 'init',
|
|
4
|
-
description: 'Create a new skill',
|
|
5
|
-
usage: 'claude-skills-cli init [options]',
|
|
6
|
-
options: [
|
|
7
|
-
{
|
|
8
|
-
flag: '--name',
|
|
9
|
-
type: 'string',
|
|
10
|
-
required: true,
|
|
11
|
-
description: 'Skill name (kebab-case, lowercase)',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
flag: '--description',
|
|
15
|
-
type: 'string',
|
|
16
|
-
required: true,
|
|
17
|
-
description: 'Brief description with trigger keywords',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
flag: '--path',
|
|
21
|
-
type: 'string',
|
|
22
|
-
description: 'Custom path (alternative to --name)',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
flag: '--with-examples',
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
description: 'Include example files (scripts/, assets/)',
|
|
28
|
-
},
|
|
29
|
-
{ flag: '--help, -h', description: 'Show this help' },
|
|
30
|
-
],
|
|
31
|
-
examples: [
|
|
32
|
-
'claude-skills-cli init --name my-skill --description "Brief description"',
|
|
33
|
-
'claude-skills-cli init --name my-skill --description "..." --with-examples',
|
|
34
|
-
'claude-skills-cli init --path /custom/path/my-skill --description "..."',
|
|
35
|
-
],
|
|
36
|
-
};
|
|
37
|
-
export const INSTALL_HELP = {
|
|
38
|
-
command: 'install',
|
|
39
|
-
description: 'Install a bundled skill (see claude-code-toolkit for pre-built skills)',
|
|
40
|
-
usage: 'claude-skills-cli install <skill-name> [options]',
|
|
41
|
-
options: [
|
|
42
|
-
{
|
|
43
|
-
flag: '<skill-name>',
|
|
44
|
-
required: true,
|
|
45
|
-
description: 'Name of bundled skill',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
flag: '--force',
|
|
49
|
-
type: 'boolean',
|
|
50
|
-
description: 'Replace existing skill without prompting',
|
|
51
|
-
},
|
|
52
|
-
{ flag: '--help, -h', description: 'Show this help' },
|
|
53
|
-
],
|
|
54
|
-
examples: [
|
|
55
|
-
'claude-skills-cli install my-skill',
|
|
56
|
-
'claude-skills-cli install my-skill --force',
|
|
57
|
-
],
|
|
58
|
-
};
|
|
59
|
-
export const VALIDATE_HELP = {
|
|
60
|
-
command: 'validate',
|
|
61
|
-
description: 'Validate a skill',
|
|
62
|
-
usage: 'claude-skills-cli validate <skill-path> [options]',
|
|
63
|
-
options: [
|
|
64
|
-
{
|
|
65
|
-
flag: '<skill-path>',
|
|
66
|
-
required: true,
|
|
67
|
-
description: 'Path to skill directory',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
flag: '--format',
|
|
71
|
-
type: 'json|text',
|
|
72
|
-
description: 'Output format (default: text)',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
flag: '--strict',
|
|
76
|
-
type: 'boolean',
|
|
77
|
-
description: 'Fail validation if warnings present',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
flag: '--lenient',
|
|
81
|
-
type: 'boolean',
|
|
82
|
-
description: 'Use relaxed limits (150 lines max)',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
flag: '--loose',
|
|
86
|
-
type: 'boolean',
|
|
87
|
-
description: 'Use Anthropic official limits (500 lines max)',
|
|
88
|
-
},
|
|
89
|
-
{ flag: '--help, -h', description: 'Show this help' },
|
|
90
|
-
],
|
|
91
|
-
examples: [
|
|
92
|
-
'claude-skills-cli validate .claude/skills/my-skill',
|
|
93
|
-
'claude-skills-cli validate .claude/skills/my-skill --lenient',
|
|
94
|
-
'claude-skills-cli validate .claude/skills/my-skill --loose',
|
|
95
|
-
'claude-skills-cli validate .claude/skills/my-skill --format json',
|
|
96
|
-
],
|
|
97
|
-
};
|
|
98
|
-
export const DOCTOR_HELP = {
|
|
99
|
-
command: 'doctor',
|
|
100
|
-
description: 'Fix common skill issues automatically',
|
|
101
|
-
usage: 'claude-skills-cli doctor <skill-path>',
|
|
102
|
-
options: [
|
|
103
|
-
{
|
|
104
|
-
flag: '<skill-path>',
|
|
105
|
-
required: true,
|
|
106
|
-
description: 'Path to skill directory',
|
|
107
|
-
},
|
|
108
|
-
{ flag: '--help, -h', description: 'Show this help' },
|
|
109
|
-
],
|
|
110
|
-
examples: ['claude-skills-cli doctor .claude/skills/my-skill'],
|
|
111
|
-
};
|
|
112
|
-
export const PACKAGE_HELP = {
|
|
113
|
-
command: 'package',
|
|
114
|
-
description: 'Package a skill to zip',
|
|
115
|
-
usage: 'claude-skills-cli package <skill-path> [options]',
|
|
116
|
-
options: [
|
|
117
|
-
{
|
|
118
|
-
flag: '<skill-path>',
|
|
119
|
-
required: true,
|
|
120
|
-
description: 'Path to skill directory',
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
flag: '--output',
|
|
124
|
-
type: 'string',
|
|
125
|
-
description: 'Output path for zip file',
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
flag: '--skip-validation',
|
|
129
|
-
type: 'boolean',
|
|
130
|
-
description: 'Skip validation before packaging',
|
|
131
|
-
},
|
|
132
|
-
{ flag: '--help, -h', description: 'Show this help' },
|
|
133
|
-
],
|
|
134
|
-
examples: [
|
|
135
|
-
'claude-skills-cli package .claude/skills/my-skill',
|
|
136
|
-
'claude-skills-cli package .claude/skills/my-skill --output my-skill.zip',
|
|
137
|
-
],
|
|
138
|
-
};
|
|
139
|
-
export const STATS_HELP = {
|
|
140
|
-
command: 'stats',
|
|
141
|
-
description: 'Show overview of all skills in a directory',
|
|
142
|
-
usage: 'claude-skills-cli stats [directory]',
|
|
143
|
-
options: [
|
|
144
|
-
{
|
|
145
|
-
flag: '[directory]',
|
|
146
|
-
description: 'Directory containing skills (default: .claude/skills)',
|
|
147
|
-
},
|
|
148
|
-
{ flag: '--help, -h', description: 'Show this help' },
|
|
149
|
-
],
|
|
150
|
-
examples: [
|
|
151
|
-
'claude-skills-cli stats',
|
|
152
|
-
'claude-skills-cli stats .claude/skills',
|
|
153
|
-
],
|
|
154
|
-
};
|
|
155
|
-
export const ADD_HOOK_HELP = {
|
|
156
|
-
command: 'add-hook',
|
|
157
|
-
description: 'Add skill activation hook to .claude/settings.json',
|
|
158
|
-
usage: 'claude-skills-cli add-hook [options]',
|
|
159
|
-
options: [
|
|
160
|
-
{
|
|
161
|
-
flag: '--type',
|
|
162
|
-
type: 'forced-eval|llm-eval|prompt-eval|simple-script|simple-inline',
|
|
163
|
-
description: 'Hook type (default: forced-eval)',
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
flag: '--project',
|
|
167
|
-
type: 'boolean',
|
|
168
|
-
description: 'Install in project .claude/settings.json',
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
flag: '--local',
|
|
172
|
-
type: 'boolean',
|
|
173
|
-
description: 'Install in project .claude/settings.local.json',
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
flag: '--force',
|
|
177
|
-
type: 'boolean',
|
|
178
|
-
description: 'Replace existing hook without prompting',
|
|
179
|
-
},
|
|
180
|
-
{ flag: '--help, -h', description: 'Show this help' },
|
|
181
|
-
],
|
|
182
|
-
examples: [
|
|
183
|
-
'claude-skills-cli add-hook',
|
|
184
|
-
'claude-skills-cli add-hook --type llm-eval',
|
|
185
|
-
'claude-skills-cli add-hook --project',
|
|
186
|
-
'claude-skills-cli add-hook --type forced-eval --force',
|
|
187
|
-
],
|
|
188
|
-
};
|
|
189
|
-
export const MAIN_HELP = {
|
|
190
|
-
name: 'claude-skills-cli',
|
|
191
|
-
description: 'CLI toolkit for creating Claude Agent Skills',
|
|
192
|
-
usage: 'claude-skills-cli <command> [options]',
|
|
193
|
-
commands: [
|
|
194
|
-
{ command: 'init', description: 'Create a new skill' },
|
|
195
|
-
{
|
|
196
|
-
command: 'install',
|
|
197
|
-
description: 'Install a bundled skill',
|
|
198
|
-
},
|
|
199
|
-
{ command: 'validate', description: 'Validate a skill' },
|
|
200
|
-
{
|
|
201
|
-
command: 'doctor',
|
|
202
|
-
description: 'Fix common skill issues automatically',
|
|
203
|
-
},
|
|
204
|
-
{ command: 'package', description: 'Package a skill to zip' },
|
|
205
|
-
{
|
|
206
|
-
command: 'stats',
|
|
207
|
-
description: 'Show overview of all skills in a directory',
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
command: 'add-hook',
|
|
211
|
-
description: 'Add skill activation hook to .claude/settings.json',
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
globalOptions: [
|
|
215
|
-
{ flag: '--help, -h', description: 'Show help' },
|
|
216
|
-
{ flag: '--version, -v', description: 'Show version' },
|
|
217
|
-
{
|
|
218
|
-
flag: '--format',
|
|
219
|
-
type: 'text|json',
|
|
220
|
-
description: 'Output format for help (default: text)',
|
|
221
|
-
},
|
|
222
|
-
],
|
|
223
|
-
examples: [
|
|
224
|
-
'claude-skills-cli init --name my-skill --description "Description"',
|
|
225
|
-
'claude-skills-cli validate .claude/skills/my-skill',
|
|
226
|
-
'claude-skills-cli add-hook',
|
|
227
|
-
'claude-skills-cli --help --format json',
|
|
228
|
-
],
|
|
229
|
-
notes: [
|
|
230
|
-
'IMPORTANT FOR LLMs:',
|
|
231
|
-
' ALWAYS run validate after creating or editing a skill:',
|
|
232
|
-
' claude-skills-cli validate <skill-path>',
|
|
233
|
-
' Skills MUST pass validation before use.',
|
|
234
|
-
' Fix all errors immediately. Address warnings promptly.',
|
|
235
|
-
'',
|
|
236
|
-
'Resources:',
|
|
237
|
-
' Pre-built skills: https://github.com/spences10/claude-code-toolkit',
|
|
238
|
-
],
|
|
239
|
-
};
|
|
240
|
-
export function show_command_help(help, format) {
|
|
241
|
-
if (format === 'json') {
|
|
242
|
-
console.log(JSON.stringify(help, null, 2));
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
// Text format (human-friendly)
|
|
246
|
-
console.log(`claude-skills-cli ${help.command} - ${help.description}\n`);
|
|
247
|
-
console.log('Usage:');
|
|
248
|
-
console.log(` ${help.usage}\n`);
|
|
249
|
-
if (help.options.length > 0) {
|
|
250
|
-
console.log('Options:');
|
|
251
|
-
for (const opt of help.options) {
|
|
252
|
-
const flag_part = opt.flag.padEnd(20);
|
|
253
|
-
const type_part = opt.type ? `<${opt.type}>`.padEnd(15) : '';
|
|
254
|
-
const req_part = opt.required ? '[required]'.padEnd(12) : '';
|
|
255
|
-
console.log(` ${flag_part}${type_part}${opt.description}`);
|
|
256
|
-
}
|
|
257
|
-
console.log('');
|
|
258
|
-
}
|
|
259
|
-
if (help.examples.length > 0) {
|
|
260
|
-
console.log('Examples:');
|
|
261
|
-
for (const example of help.examples) {
|
|
262
|
-
console.log(` ${example}`);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
export function show_main_help(format) {
|
|
267
|
-
if (format === 'json') {
|
|
268
|
-
console.log(JSON.stringify(MAIN_HELP, null, 2));
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
// Text format (human-friendly)
|
|
272
|
-
console.log(`${MAIN_HELP.name} - ${MAIN_HELP.description}\n`);
|
|
273
|
-
console.log('Usage:');
|
|
274
|
-
console.log(` ${MAIN_HELP.usage}\n`);
|
|
275
|
-
if (MAIN_HELP.commands.length > 0) {
|
|
276
|
-
console.log('Commands:');
|
|
277
|
-
for (const cmd of MAIN_HELP.commands) {
|
|
278
|
-
const cmd_part = cmd.command.padEnd(12);
|
|
279
|
-
console.log(` ${cmd_part}${cmd.description}`);
|
|
280
|
-
}
|
|
281
|
-
console.log('');
|
|
282
|
-
}
|
|
283
|
-
if (MAIN_HELP.globalOptions.length > 0) {
|
|
284
|
-
console.log('Global Options:');
|
|
285
|
-
for (const opt of MAIN_HELP.globalOptions) {
|
|
286
|
-
const flag_part = opt.flag.padEnd(20);
|
|
287
|
-
const type_part = opt.type ? `<${opt.type}>`.padEnd(15) : '';
|
|
288
|
-
console.log(` ${flag_part}${type_part}${opt.description}`);
|
|
289
|
-
}
|
|
290
|
-
console.log('');
|
|
291
|
-
}
|
|
292
|
-
if (MAIN_HELP.examples.length > 0) {
|
|
293
|
-
console.log('Examples:');
|
|
294
|
-
for (const example of MAIN_HELP.examples) {
|
|
295
|
-
console.log(` ${example}`);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (MAIN_HELP.notes && MAIN_HELP.notes.length > 0) {
|
|
299
|
-
console.log('');
|
|
300
|
-
for (const note of MAIN_HELP.notes) {
|
|
301
|
-
console.log(note);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
//# sourceMappingURL=help.js.map
|