ccski 0.0.0 → 1.0.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.
@@ -0,0 +1,334 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/types/skill.d.ts
4
+ /**
5
+ * Skill location types
6
+ */
7
+ type SkillLocation = "user" | "project" | "plugin";
8
+ /**
9
+ * Core skill metadata interface
10
+ */
11
+ interface SkillMetadata {
12
+ /** Skill name (from frontmatter) */
13
+ name: string;
14
+ /** Skill description (from frontmatter) */
15
+ description: string;
16
+ /** Location type */
17
+ location: SkillLocation;
18
+ /** Absolute path to skill directory */
19
+ path: string;
20
+ /** Whether the skill has a references/ directory */
21
+ hasReferences: boolean;
22
+ /** Whether the skill has a scripts/ directory */
23
+ hasScripts: boolean;
24
+ /** Whether the skill has an assets/ directory */
25
+ hasAssets: boolean;
26
+ /** Plugin information (only for plugin skills) */
27
+ pluginInfo?: {
28
+ pluginName: string;
29
+ marketplace: string;
30
+ version: string;
31
+ };
32
+ }
33
+ /**
34
+ * Complete skill interface with content
35
+ */
36
+ interface Skill extends SkillMetadata {
37
+ /** Full markdown content (including frontmatter) */
38
+ content: string;
39
+ /** Full qualified name (e.g., "plugin:skill" for plugin skills) */
40
+ fullName: string;
41
+ }
42
+ /**
43
+ * SKILL.md frontmatter interface
44
+ */
45
+ interface SkillFrontmatter {
46
+ name: string;
47
+ description: string;
48
+ [key: string]: unknown;
49
+ }
50
+ /**
51
+ * Plugin registry entry from installed_plugins.json
52
+ */
53
+ interface PluginEntry {
54
+ version: string;
55
+ installedAt: string;
56
+ lastUpdated: string;
57
+ installPath: string;
58
+ gitCommitSha: string;
59
+ isLocal: boolean;
60
+ }
61
+ /**
62
+ * Installed plugins JSON structure
63
+ */
64
+ interface InstalledPlugins {
65
+ version: number;
66
+ plugins: Record<string, PluginEntry>;
67
+ }
68
+ //#endregion
69
+ //#region src/types/errors.d.ts
70
+ /**
71
+ * Base error class for ccski errors
72
+ */
73
+ declare class CcskiError extends Error {
74
+ readonly suggestions: string[];
75
+ constructor(message: string, suggestions?: string[]);
76
+ }
77
+ /**
78
+ * Error thrown when a skill is not found
79
+ */
80
+ declare class SkillNotFoundError extends CcskiError {
81
+ skillName: string;
82
+ constructor(skillName: string, suggestions?: string[]);
83
+ }
84
+ /**
85
+ * Error thrown when a skill name is ambiguous
86
+ */
87
+ declare class AmbiguousSkillNameError extends CcskiError {
88
+ skillName: string;
89
+ matches: string[];
90
+ constructor(skillName: string, matches: string[]);
91
+ }
92
+ /**
93
+ * Error thrown when skill validation fails
94
+ */
95
+ declare class ValidationError extends CcskiError {
96
+ filePath: string;
97
+ issues: string[];
98
+ constructor(filePath: string, issues: string[], suggestions?: string[]);
99
+ }
100
+ /**
101
+ * Error thrown when parsing SKILL.md fails
102
+ */
103
+ declare class ParseError extends CcskiError {
104
+ filePath: string;
105
+ reason: string;
106
+ constructor(filePath: string, reason: string, suggestions?: string[]);
107
+ }
108
+ //#endregion
109
+ //#region src/types/schemas.d.ts
110
+ /**
111
+ * Schema for SKILL.md frontmatter
112
+ */
113
+ declare const SkillFrontmatterSchema: z.ZodObject<{
114
+ name: z.ZodString;
115
+ description: z.ZodString;
116
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
117
+ name: z.ZodString;
118
+ description: z.ZodString;
119
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
120
+ name: z.ZodString;
121
+ description: z.ZodString;
122
+ }, z.ZodTypeAny, "passthrough">>;
123
+ /**
124
+ * Schema for plugin entry in installed_plugins.json
125
+ */
126
+ declare const PluginEntrySchema: z.ZodObject<{
127
+ version: z.ZodString;
128
+ installedAt: z.ZodString;
129
+ lastUpdated: z.ZodString;
130
+ installPath: z.ZodString;
131
+ gitCommitSha: z.ZodString;
132
+ isLocal: z.ZodBoolean;
133
+ }, "strip", z.ZodTypeAny, {
134
+ version: string;
135
+ installedAt: string;
136
+ lastUpdated: string;
137
+ installPath: string;
138
+ gitCommitSha: string;
139
+ isLocal: boolean;
140
+ }, {
141
+ version: string;
142
+ installedAt: string;
143
+ lastUpdated: string;
144
+ installPath: string;
145
+ gitCommitSha: string;
146
+ isLocal: boolean;
147
+ }>;
148
+ /**
149
+ * Schema for installed_plugins.json
150
+ */
151
+ declare const InstalledPluginsSchema: z.ZodObject<{
152
+ version: z.ZodNumber;
153
+ plugins: z.ZodRecord<z.ZodString, z.ZodObject<{
154
+ version: z.ZodString;
155
+ installedAt: z.ZodString;
156
+ lastUpdated: z.ZodString;
157
+ installPath: z.ZodString;
158
+ gitCommitSha: z.ZodString;
159
+ isLocal: z.ZodBoolean;
160
+ }, "strip", z.ZodTypeAny, {
161
+ version: string;
162
+ installedAt: string;
163
+ lastUpdated: string;
164
+ installPath: string;
165
+ gitCommitSha: string;
166
+ isLocal: boolean;
167
+ }, {
168
+ version: string;
169
+ installedAt: string;
170
+ lastUpdated: string;
171
+ installPath: string;
172
+ gitCommitSha: string;
173
+ isLocal: boolean;
174
+ }>>;
175
+ }, "strip", z.ZodTypeAny, {
176
+ version: number;
177
+ plugins: Record<string, {
178
+ version: string;
179
+ installedAt: string;
180
+ lastUpdated: string;
181
+ installPath: string;
182
+ gitCommitSha: string;
183
+ isLocal: boolean;
184
+ }>;
185
+ }, {
186
+ version: number;
187
+ plugins: Record<string, {
188
+ version: string;
189
+ installedAt: string;
190
+ lastUpdated: string;
191
+ installPath: string;
192
+ gitCommitSha: string;
193
+ isLocal: boolean;
194
+ }>;
195
+ }>;
196
+ /**
197
+ * Infer TypeScript types from Zod schemas
198
+ */
199
+ type SkillFrontmatterType = z.infer<typeof SkillFrontmatterSchema>;
200
+ type PluginEntryType = z.infer<typeof PluginEntrySchema>;
201
+ type InstalledPluginsType = z.infer<typeof InstalledPluginsSchema>;
202
+ //#endregion
203
+ //#region src/core/parser.d.ts
204
+ /**
205
+ * Parse result from parseSkillFile
206
+ */
207
+ interface ParseResult {
208
+ frontmatter: SkillFrontmatter;
209
+ content: string;
210
+ fullContent: string;
211
+ }
212
+ /**
213
+ * Parse a SKILL.md file and extract frontmatter and content
214
+ *
215
+ * @param filePath - Absolute path to SKILL.md file
216
+ * @returns Parsed frontmatter and content
217
+ * @throws {ParseError} If file cannot be read or parsed
218
+ * @throws {ValidationError} If frontmatter validation fails
219
+ */
220
+ declare function parseSkillFile(filePath: string): ParseResult;
221
+ /**
222
+ * Validate a SKILL.md file without throwing errors
223
+ *
224
+ * @param filePath - Absolute path to SKILL.md file
225
+ * @returns Validation result with success flag and error messages
226
+ */
227
+ declare function validateSkillFile(filePath: string): {
228
+ success: boolean;
229
+ errors: string[];
230
+ suggestions: string[];
231
+ };
232
+ //#endregion
233
+ //#region src/core/discovery.d.ts
234
+ /**
235
+ * Skill directories in priority order (highest to lowest)
236
+ */
237
+ declare const SKILL_DIRECTORIES: readonly [".agent/skills", ".claude/skills", `${string}/.agent/skills`, `${string}/.claude/skills`];
238
+ interface DiscoveryDiagnostics {
239
+ scannedDirectories: string[];
240
+ warnings: string[];
241
+ conflicts: string[];
242
+ }
243
+ interface DiscoveryResult {
244
+ skills: SkillMetadata[];
245
+ diagnostics: DiscoveryDiagnostics;
246
+ }
247
+ /**
248
+ * Options for skill discovery
249
+ */
250
+ interface DiscoveryOptions {
251
+ /** Additional custom directories to scan */
252
+ customDirs?: string[];
253
+ /** Skip plugin skills */
254
+ skipPlugins?: boolean;
255
+ /** Whether to scan built-in directories (.agent/.claude). Defaults to true. */
256
+ scanDefaultDirs?: boolean;
257
+ }
258
+ interface ScanOptions {
259
+ location?: SkillLocation;
260
+ recursive?: boolean;
261
+ diagnostics: DiscoveryDiagnostics;
262
+ }
263
+ /**
264
+ * Scan a single skill directory and return found skills
265
+ */
266
+ declare function scanSkillDirectory(dirPath: string, {
267
+ location,
268
+ recursive,
269
+ diagnostics
270
+ }: ScanOptions): SkillMetadata[];
271
+ /**
272
+ * Discover all skills from standard directories
273
+ */
274
+ declare function discoverSkills(options?: DiscoveryOptions): DiscoveryResult;
275
+ /**
276
+ * Load full skill content
277
+ */
278
+ declare function loadSkill(metadata: SkillMetadata): Skill;
279
+ //#endregion
280
+ //#region src/core/plugins.d.ts
281
+ interface PluginDiscoveryOptions {
282
+ pluginsFile?: string;
283
+ pluginsRoot?: string;
284
+ }
285
+ //#endregion
286
+ //#region src/core/registry.d.ts
287
+ type SkillRegistryOptions = DiscoveryOptions & PluginDiscoveryOptions;
288
+ /**
289
+ * Skill registry for managing discovered skills
290
+ */
291
+ declare class SkillRegistry {
292
+ private options;
293
+ private skills;
294
+ private diagnostics;
295
+ constructor(options?: SkillRegistryOptions);
296
+ /**
297
+ * Refresh the skill registry by rescanning directories
298
+ */
299
+ refresh(): void;
300
+ /**
301
+ * Get all skills
302
+ */
303
+ getAll(): SkillMetadata[];
304
+ /**
305
+ * Find a skill by name (case-insensitive, supports full and short names)
306
+ */
307
+ find(name: string): SkillMetadata;
308
+ /**
309
+ * Check if a skill exists
310
+ */
311
+ has(name: string): boolean;
312
+ /**
313
+ * Load full skill content
314
+ */
315
+ load(name: string): Skill;
316
+ /**
317
+ * Get suggestions for similar skill names (fuzzy matching)
318
+ */
319
+ private getSuggestions;
320
+ /**
321
+ * Get diagnostic information
322
+ */
323
+ getDiagnostics(): {
324
+ totalSkills: number;
325
+ byLocation: Record<string, number>;
326
+ directoriesScanned: string[];
327
+ pluginSources: string[];
328
+ warnings: string[];
329
+ conflicts: string[];
330
+ };
331
+ }
332
+ //#endregion
333
+ export { AmbiguousSkillNameError, CcskiError, DiscoveryDiagnostics, DiscoveryOptions, DiscoveryResult, InstalledPlugins, InstalledPluginsSchema, InstalledPluginsType, ParseError, ParseResult, PluginEntry, PluginEntrySchema, PluginEntryType, SKILL_DIRECTORIES, Skill, SkillFrontmatter, SkillFrontmatterSchema, SkillFrontmatterType, SkillLocation, SkillMetadata, SkillNotFoundError, SkillRegistry, SkillRegistryOptions, ValidationError, discoverSkills, loadSkill, parseSkillFile, scanSkillDirectory, validateSkillFile };
334
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/skill.ts","../src/types/errors.ts","../src/types/schemas.ts","../src/core/parser.ts","../src/core/discovery.ts","../src/core/plugins.ts","../src/core/registry.ts"],"sourcesContent":[],"mappings":";;;;;;AAGY,KAAA,aAAA,GAAa,MAAA,GAAA,SAAA,GAAA,QAAA;AAKzB;AA0BA;AAUA;AASiB,UA7CA,aAAA,CA6CW;EAYX;;;;EC9DJ;EAaA,QAAA,EDFD,aCEoB;EAanB;EAeA,IAAA,EAAA,MAAA;EAcA;;;;ECrDA;;;;;;;;;;;;AAAsB,UF6BlB,KAAA,SAAc,aE7BI,CAAA;EAAA;EAQtB,OAAA,EAAA,MAAA;;;;;;;UF+BI,gBAAA;EE/Ba,IAAA,EAAA,MAAA;EAAA,WAAA,EAAA,MAAA;EAYjB,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;;;;UF4BI,WAAA;;;;;;;;;;;AE5BkB,UFwClB,gBAAA,CExCkB;EAQvB,OAAA,EAAA,MAAA;EACA,OAAA,EFiCD,MEjCC,CAAA,MAAe,EFiCD,WEjCmB,CAAA;AAC7C;;;;;;AFhCY,cCAC,UAAA,SAAmB,KAAA,CDAP;EAKR,SAAA,WAAa,EAAA,MAMlB,EAAA;EAoBK,WAAM,CAAA,OAAA,EAAQ,MAAA,EAAA,WAAa,CAAA,EAAA,MAAA,EAAA;AAU5C;AASA;AAYA;;cCjDa,kBAAA,SAA2B,UAAA;;EAb3B,WAAA,CAAA,SAAW,EAAA,MAAQ,EAAK,WAAA,CAAA,EAAA,MAAA,EAAA;AAarC;AAaA;AAeA;AAcA;cA7Ba,uBAAA,SAAgC,UAAA;;;ECxBhC,WAAA,CAAA,SAAA,EAAA,MAGG,EAAA,OAAA,EAAA,MAAA,EAAA;;;;;cDoCH,eAAA,SAAwB,UAAA;;;;;;;;ACvCF,cDqDtB,UAAA,SAAmB,UAAA,CCrDG;EAQtB,QAAA,EAAA,MAAA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,EAAA;IAAA,aAAA,EAAA,MAAA,EAAA;IAYjB,QAAA,EAAA,MAAA,EAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { F as AmbiguousSkillNameError, I as CcskiError, L as ParseError, R as SkillNotFoundError, _ as validateSkillFile, a as discoverSkills, b as SkillFrontmatterSchema, g as parseSkillFile, i as SKILL_DIRECTORIES, o as loadSkill, s as scanSkillDirectory, t as SkillRegistry, v as InstalledPluginsSchema, y as PluginEntrySchema, z as ValidationError } from "./registry-DGrbpgs5.mjs";
2
+
3
+ export { AmbiguousSkillNameError, CcskiError, InstalledPluginsSchema, ParseError, PluginEntrySchema, SKILL_DIRECTORIES, SkillFrontmatterSchema, SkillNotFoundError, SkillRegistry, ValidationError, discoverSkills, loadSkill, parseSkillFile, scanSkillDirectory, validateSkillFile };