claude-skills-cli 0.0.20 → 0.0.22

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.
Files changed (81) hide show
  1. package/dist/add-hook.cmd-JWw5UqA3.js +193 -0
  2. package/dist/add-hook.cmd-JWw5UqA3.js.map +1 -0
  3. package/dist/dependency-validator-CQJ1hCoU.js +382 -0
  4. package/dist/dependency-validator-CQJ1hCoU.js.map +1 -0
  5. package/dist/doctor.cmd-DJpHLDCV.js +142 -0
  6. package/dist/doctor.cmd-DJpHLDCV.js.map +1 -0
  7. package/dist/fs-CuGv3Ob2.js +23 -0
  8. package/dist/fs-CuGv3Ob2.js.map +1 -0
  9. package/dist/index.js +24 -22
  10. package/dist/index.js.map +1 -1
  11. package/dist/init.cmd-BdqImX8b.js +108 -0
  12. package/dist/init.cmd-BdqImX8b.js.map +1 -0
  13. package/dist/install.cmd-BaP8k9d2.js +79 -0
  14. package/dist/install.cmd-BaP8k9d2.js.map +1 -0
  15. package/dist/output-DiffPD2u.js +104 -0
  16. package/dist/output-DiffPD2u.js.map +1 -0
  17. package/dist/package.cmd-BYhkheya.js +107 -0
  18. package/dist/package.cmd-BYhkheya.js.map +1 -0
  19. package/dist/stats.cmd-Dd46qjoV.js +154 -0
  20. package/dist/stats.cmd-Dd46qjoV.js.map +1 -0
  21. package/dist/{core/templates.js → templates-fyteNbD0.js} +20 -13
  22. package/dist/templates-fyteNbD0.js.map +1 -0
  23. package/dist/validate.cmd-BxF4HNsu.js +96 -0
  24. package/dist/validate.cmd-BxF4HNsu.js.map +1 -0
  25. package/dist/validator-Dp5x-OjP.js +729 -0
  26. package/dist/validator-Dp5x-OjP.js.map +1 -0
  27. package/package.json +34 -35
  28. package/dist/commands/add-hook.cmd.js +0 -35
  29. package/dist/commands/add-hook.cmd.js.map +0 -1
  30. package/dist/commands/add-hook.js +0 -216
  31. package/dist/commands/add-hook.js.map +0 -1
  32. package/dist/commands/doctor.cmd.js +0 -19
  33. package/dist/commands/doctor.cmd.js.map +0 -1
  34. package/dist/commands/doctor.js +0 -128
  35. package/dist/commands/doctor.js.map +0 -1
  36. package/dist/commands/init.cmd.js +0 -37
  37. package/dist/commands/init.cmd.js.map +0 -1
  38. package/dist/commands/init.js +0 -86
  39. package/dist/commands/init.js.map +0 -1
  40. package/dist/commands/install.cmd.js +0 -23
  41. package/dist/commands/install.cmd.js.map +0 -1
  42. package/dist/commands/install.js +0 -64
  43. package/dist/commands/install.js.map +0 -1
  44. package/dist/commands/package.cmd.js +0 -28
  45. package/dist/commands/package.cmd.js.map +0 -1
  46. package/dist/commands/package.js +0 -134
  47. package/dist/commands/package.js.map +0 -1
  48. package/dist/commands/stats.cmd.js +0 -19
  49. package/dist/commands/stats.cmd.js.map +0 -1
  50. package/dist/commands/stats.js +0 -154
  51. package/dist/commands/stats.js.map +0 -1
  52. package/dist/commands/validate.cmd.js +0 -39
  53. package/dist/commands/validate.cmd.js.map +0 -1
  54. package/dist/commands/validate.js +0 -77
  55. package/dist/commands/validate.js.map +0 -1
  56. package/dist/core/templates.js.map +0 -1
  57. package/dist/core/validator.js +0 -252
  58. package/dist/core/validator.js.map +0 -1
  59. package/dist/help.js +0 -305
  60. package/dist/help.js.map +0 -1
  61. package/dist/skills/.gitkeep +0 -0
  62. package/dist/types.js +0 -2
  63. package/dist/types.js.map +0 -1
  64. package/dist/utils/fs.js +0 -25
  65. package/dist/utils/fs.js.map +0 -1
  66. package/dist/utils/output.js +0 -102
  67. package/dist/utils/output.js.map +0 -1
  68. package/dist/validators/alignment-validator.js +0 -54
  69. package/dist/validators/alignment-validator.js.map +0 -1
  70. package/dist/validators/content-validator.js +0 -156
  71. package/dist/validators/content-validator.js.map +0 -1
  72. package/dist/validators/description-validator.js +0 -150
  73. package/dist/validators/description-validator.js.map +0 -1
  74. package/dist/validators/file-structure-validator.js +0 -125
  75. package/dist/validators/file-structure-validator.js.map +0 -1
  76. package/dist/validators/frontmatter-validator.js +0 -190
  77. package/dist/validators/frontmatter-validator.js.map +0 -1
  78. package/dist/validators/references-validator.js +0 -155
  79. package/dist/validators/references-validator.js.map +0 -1
  80. package/dist/validators/text-analysis.js +0 -71
  81. package/dist/validators/text-analysis.js.map +0 -1
@@ -1,155 +0,0 @@
1
- /**
2
- * References validation (Level 3 progressive disclosure)
3
- */
4
- import { existsSync, readdirSync, readFileSync } from 'node:fs';
5
- import { join } from 'node:path';
6
- /**
7
- * Strip fenced code blocks from content to avoid parsing example links
8
- */
9
- function strip_code_blocks(content) {
10
- // Remove fenced code blocks (``` or ~~~)
11
- return content.replace(/```[\s\S]*?```|~~~[\s\S]*?~~~/g, '');
12
- }
13
- /**
14
- * Check nesting depth of reference files
15
- */
16
- function check_reference_nesting(skill_path, file_path, visited = new Set()) {
17
- if (visited.has(file_path)) {
18
- return { depth: 0, references: [] };
19
- }
20
- visited.add(file_path);
21
- const full_path = join(skill_path, file_path);
22
- if (!existsSync(full_path)) {
23
- return { depth: 0, references: [] };
24
- }
25
- const content = readFileSync(full_path, 'utf-8');
26
- // Strip code blocks to avoid parsing example links inside them
27
- const content_without_code = strip_code_blocks(content);
28
- const reference_pattern = /\[([^\]]+)\]\(([^)]+\.md)\)/g;
29
- const matches = [
30
- ...content_without_code.matchAll(reference_pattern),
31
- ];
32
- const references = matches.map((m) => m[2]);
33
- if (references.length === 0) {
34
- return { depth: 1, references: [] };
35
- }
36
- // Recursively check nested references
37
- let max_depth = 1;
38
- for (const ref of references) {
39
- const nested = check_reference_nesting(skill_path, ref, new Set(visited));
40
- max_depth = Math.max(max_depth, 1 + nested.depth);
41
- }
42
- return { depth: max_depth, references };
43
- }
44
- /**
45
- * Validate references directory and links
46
- */
47
- export function validate_references(skill_path) {
48
- const references_dir = join(skill_path, 'references');
49
- const skill_md_path = join(skill_path, 'SKILL.md');
50
- const files_found = [];
51
- const files_referenced = [];
52
- const missing_files = [];
53
- const nesting_data = [];
54
- const warnings = [];
55
- const errors = [];
56
- // Check references directory if it exists
57
- if (existsSync(references_dir)) {
58
- const files = readdirSync(references_dir);
59
- const md_files = files.filter((f) => f.endsWith('.md'));
60
- files_found.push(...md_files.map((f) => `references/${f}`));
61
- if (md_files.length === 0) {
62
- warnings.push({
63
- type: 'empty_directory',
64
- message: 'references/ directory exists but is empty',
65
- });
66
- }
67
- // Check for references in SKILL.md
68
- if (existsSync(skill_md_path)) {
69
- const skill_content = readFileSync(skill_md_path, 'utf-8');
70
- for (const md_file of md_files) {
71
- if (!skill_content.includes(md_file)) {
72
- warnings.push({
73
- type: 'orphaned_file',
74
- message: `Reference file 'references/${md_file}' not mentioned in SKILL.md`,
75
- });
76
- }
77
- }
78
- }
79
- }
80
- // Check root-level .md files (excluding SKILL.md)
81
- if (existsSync(skill_path)) {
82
- const root_files = readdirSync(skill_path);
83
- const root_md_files = root_files.filter((f) => f.endsWith('.md') && f !== 'SKILL.md' && f !== 'README.md');
84
- files_found.push(...root_md_files);
85
- if (existsSync(skill_md_path)) {
86
- const skill_content = readFileSync(skill_md_path, 'utf-8');
87
- for (const md_file of root_md_files) {
88
- if (!skill_content.includes(md_file)) {
89
- warnings.push({
90
- type: 'orphaned_file',
91
- message: `Root file '${md_file}' not mentioned in SKILL.md`,
92
- });
93
- }
94
- }
95
- }
96
- }
97
- // Level 3 validation: Check that all referenced files exist
98
- if (existsSync(skill_md_path)) {
99
- const skill_content = readFileSync(skill_md_path, 'utf-8');
100
- // Strip code blocks to avoid parsing example links inside them
101
- const content_without_code = strip_code_blocks(skill_content);
102
- // Extract markdown links to .md files (references/ or root-level)
103
- // Matches: [text](file.md), [text](references/file.md), etc.
104
- const reference_link_pattern = /\[([^\]]+)\]\(([^)]+\.md)\)/g;
105
- const matches = content_without_code.matchAll(reference_link_pattern);
106
- for (const match of matches) {
107
- const link_text = match[1];
108
- const file_path = match[2]; // e.g., "references/examples.md"
109
- const full_path = join(skill_path, file_path);
110
- files_referenced.push(file_path);
111
- if (!existsSync(full_path)) {
112
- missing_files.push(file_path);
113
- errors.push({
114
- type: 'missing_file',
115
- message: `Referenced file not found: ${file_path}\n` +
116
- ` → Linked from: [${link_text}]\n` +
117
- ` → Create the file or remove the broken link`,
118
- });
119
- }
120
- else {
121
- // Check nesting depth
122
- const nesting = check_reference_nesting(skill_path, file_path);
123
- let warning = null;
124
- if (nesting.depth > 1) {
125
- warning = `File has depth ${nesting.depth} (recommended: 1). Keep references one level deep from SKILL.md.`;
126
- warnings.push({
127
- type: 'nesting_depth',
128
- message: `${file_path} has nesting depth ${nesting.depth} (recommended: 1)\n` +
129
- ` → Keep references one level deep from SKILL.md for clarity`,
130
- });
131
- }
132
- nesting_data.push({
133
- file: file_path,
134
- references: nesting.references,
135
- depth: nesting.depth,
136
- warning,
137
- });
138
- }
139
- }
140
- }
141
- // Calculate orphaned files
142
- const orphaned = files_found.filter((f) => !files_referenced.some((ref) => ref.includes(f)));
143
- const validation = {
144
- files_found,
145
- files_referenced,
146
- missing_files,
147
- orphaned_files: orphaned,
148
- nesting: nesting_data,
149
- max_nesting_depth: nesting_data.length > 0
150
- ? Math.max(...nesting_data.map((n) => n.depth))
151
- : 0,
152
- };
153
- return { validation, warnings, errors };
154
- }
155
- //# sourceMappingURL=references-validator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"references-validator.js","sourceRoot":"","sources":["../../src/validators/references-validator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA4BjC;;GAEG;AACH,SAAS,iBAAiB,CAAC,OAAe;IACzC,yCAAyC;IACzC,OAAO,OAAO,CAAC,OAAO,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB,CAC/B,UAAkB,EAClB,SAAiB,EACjB,UAAuB,IAAI,GAAG,EAAE;IAEhC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS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C3B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAClC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACvD,CAAC;IAEF,MAAM,UAAU,GAAyB;QACxC,WAAW;QACX,gBAAgB;QAChB,aAAa;QACb,cAAc,EAAE,QAAQ;QACxB,OAAO,EAAE,YAAY;QACrB,iBAAiB,EAChB,YAAY,CAAC,MAAM,GAAG,CAAC;YACtB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;KACL,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC"}
@@ -1,71 +0,0 @@
1
- /**
2
- * Text analysis utilities for skill validation
3
- */
4
- /**
5
- * Extract body content from SKILL.md (excluding YAML frontmatter)
6
- */
7
- export function extract_body(content) {
8
- const parts = content.split('---\n');
9
- return parts.length >= 3
10
- ? parts.slice(2).join('---\n').trim()
11
- : content;
12
- }
13
- /**
14
- * Count words in text
15
- */
16
- export function count_words(text) {
17
- return text
18
- .trim()
19
- .split(/\s+/)
20
- .filter((w) => w.length > 0).length;
21
- }
22
- /**
23
- * Estimate tokens (rough approximation: 1 word ≈ 1.3 tokens for English)
24
- */
25
- export function estimate_tokens(word_count) {
26
- return Math.round(word_count * 1.3);
27
- }
28
- /**
29
- * Estimate tokens for a string by counting words and applying ratio
30
- */
31
- export function estimate_string_tokens(text) {
32
- const word_count = count_words(text);
33
- return estimate_tokens(word_count);
34
- }
35
- /**
36
- * Remove HTML comments from content (for line counting)
37
- */
38
- export function strip_html_comments(text) {
39
- return text.replace(/<!--[\s\S]*?-->/g, '');
40
- }
41
- /**
42
- * Extract keywords from text (simplified extraction)
43
- */
44
- export function extract_keywords(text) {
45
- const words = text
46
- .toLowerCase()
47
- .replace(/[^\w\s-]/g, ' ')
48
- .split(/\s+/)
49
- .filter((w) => w.length > 3);
50
- const unique = [...new Set(words)];
51
- return unique.filter((w) => ![
52
- 'this',
53
- 'that',
54
- 'with',
55
- 'from',
56
- 'have',
57
- 'will',
58
- 'when',
59
- 'what',
60
- 'where',
61
- 'which',
62
- 'their',
63
- 'them',
64
- 'then',
65
- 'than',
66
- 'these',
67
- 'those',
68
- 'there',
69
- ].includes(w));
70
- }
71
- //# sourceMappingURL=text-analysis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-analysis.js","sourceRoot":"","sources":["../../src/validators/text-analysis.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC;QACvB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE;QACrC,CAAC,CAAC,OAAO,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,OAAO,IAAI;SACT,IAAI,EAAE;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,UAAkB;IACjD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY;IAClD,MAAM,UAAU,GAAG,WAAW,CAA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