ccski 2.1.0 → 2.2.1

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 (2) hide show
  1. package/README.md +171 -1
  2. package/package.json +6 -2
package/README.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # ccski – Claude Code Skills Manager
2
2
 
3
- ccski is a CLI + MCP server to discover, install, enable/disable, and serve Claude Code-compatible skills. This README covers install and usage. For architecture and UX philosophy, see `SPEC.md`.
3
+ ccski is a CLI + MCP server to discover, install, enable/disable, and serve Claude/Codex-compatible skills. It also exports a small “kernel” API so you can embed discovery/validation in your own scripts. This README covers install and usage. For architecture and UX philosophy, see `SPEC.md`.
4
+
5
+ Documentation site: https://jixoai-labs.github.io/ccski/
6
+
7
+ ## Table of contents
8
+
9
+ - [Install](#install)
10
+ - [Quick start](#quick-start)
11
+ - [Run MCP server](#run-mcp-server)
12
+ - [Core CLI commands](#core-cli-commands)
13
+ - [Install examples](#install-examples)
14
+ - [Enable/disable](#enabledisable)
15
+ - [More](#more)
16
+ - [Acknowledgements](#acknowledgements)
17
+ - [API Reference](#api-reference)
4
18
 
5
19
  ## Install
6
20
 
@@ -75,6 +89,7 @@ ccski disable --all
75
89
 
76
90
  ## More
77
91
 
92
+ - Programmatic API is available from the package export; see [API Reference](#api-reference) (or the docs site) for usage examples.
78
93
  - Claude users: prefer `ccski mcp --exclude=claude` to avoid echoing built-in Claude skills.
79
94
  - Codex users: prefer `ccski mcp --exclude=codex` when avoid echoing built-in Codex skills.
80
95
  - All commands support `--json` for scripting.
@@ -85,3 +100,158 @@ ccski disable --all
85
100
 
86
101
  - [openskills](https://github.com/numman-ali/openskills) — established the SKILL.md authoring pattern; ccski aligns with that spec.
87
102
  - [universal-skills](https://github.com/klaudworks/universal-skills) — MCP-first skill set; ccski focuses on management, not bundling content.
103
+
104
+ ## API Reference
105
+
106
+ Public exports from `import ... from "ccski"`.
107
+
108
+ Notes:
109
+
110
+ - Package is ESM (`"type": "module"`). Use `import` in Node.js >= 20.
111
+ - `discoverSkills()` / `SkillRegistry.getAll()` return **metadata**. Use `loadSkill()` / `SkillRegistry.load()` to read full SKILL.md content.
112
+
113
+ ### Importing
114
+
115
+ ```ts
116
+ import { discoverSkills, SkillRegistry, validateSkillFile } from "ccski";
117
+ import type { Skill, SkillMetadata } from "ccski";
118
+ ```
119
+
120
+ ### Types
121
+
122
+ - `SkillProvider`: `"claude" | "codex" | "file"`
123
+ - `SkillLocation`: `"user" | "project" | "plugin"`
124
+ - `SkillFrontmatter`: required SKILL.md frontmatter shape (`name`, `description`, plus extra fields)
125
+ - `SkillMetadata`: discovered skill summary (name/description/provider/location/path + bundled resources flags)
126
+ - `Skill`: `SkillMetadata` + `content` (full markdown, including frontmatter) + `fullName`
127
+ - `ParseResult`: `{ frontmatter, content, fullContent }`
128
+ - `DiscoveryOptions`: configure default roots, custom directories, provider tagging, and disabled-skill handling
129
+ - `SkillRegistryOptions`: `DiscoveryOptions` + plugin discovery options (`pluginsFile`, `pluginsRoot`, `settingsFile`, `userDir`)
130
+
131
+ Reference shapes (simplified):
132
+
133
+ ```ts
134
+ export interface SkillMetadata {
135
+ name: string;
136
+ description: string;
137
+ disabled?: boolean;
138
+ provider: "claude" | "codex" | "file";
139
+ location: "user" | "project" | "plugin";
140
+ path: string;
141
+ hasReferences: boolean;
142
+ hasScripts: boolean;
143
+ hasAssets: boolean;
144
+ pluginInfo?: { pluginName: string; marketplace: string; version: string };
145
+ }
146
+
147
+ export interface Skill extends SkillMetadata {
148
+ content: string; // full markdown (including frontmatter)
149
+ fullName: string;
150
+ }
151
+ ```
152
+
153
+ ### Errors
154
+
155
+ All errors extend `CcskiError` and include a `suggestions: string[]` field for UX-friendly guidance.
156
+
157
+ - `SkillNotFoundError`: thrown when a skill name cannot be resolved
158
+ - `AmbiguousSkillNameError`: thrown when multiple skills match; includes `matches: string[]`
159
+ - `ParseError`: SKILL.md read/UTF-8/frontmatter parsing failures; includes `filePath`, `reason`
160
+ - `ValidationError`: frontmatter schema validation failures; includes `filePath`, `issues: string[]`
161
+
162
+ ### Parser
163
+
164
+ #### `parseSkillFile(filePath: string): ParseResult`
165
+
166
+ Parse a `SKILL.md` (or `.SKILL.md`) file and return:
167
+
168
+ - `frontmatter`: validated & normalized (`description` whitespace is normalized)
169
+ - `content`: markdown body **without** frontmatter
170
+ - `fullContent`: original file content **including** frontmatter
171
+
172
+ Throws `ParseError` (IO/encoding/YAML) and `ValidationError` (schema).
173
+
174
+ #### `validateSkillFile(filePath: string): { success; errors; suggestions }`
175
+
176
+ Safe validator wrapper around `parseSkillFile()`:
177
+
178
+ - `success: true` when file is valid
179
+ - otherwise returns `errors` and `suggestions` without throwing
180
+
181
+ ```ts
182
+ import { validateSkillFile } from "ccski";
183
+
184
+ const result = validateSkillFile("/abs/path/to/SKILL.md");
185
+ if (!result.success) {
186
+ console.error(result.errors);
187
+ console.error(result.suggestions);
188
+ }
189
+ ```
190
+
191
+ ### Discovery
192
+
193
+ #### `getDefaultSkillDirectories(userDir: string)`
194
+
195
+ Return the default search roots (project + user) with provider tagging (Claude/Codex).
196
+
197
+ #### `discoverSkills(options?: DiscoveryOptions): { skills; diagnostics }`
198
+
199
+ Scan built-in directories (unless `scanDefaultDirs: false`) plus `customDirs`.
200
+
201
+ - `skills`: `SkillMetadata[]`
202
+ - `diagnostics`: scanned paths, warnings, conflicts, and counts by provider
203
+
204
+ ```ts
205
+ import { discoverSkills } from "ccski";
206
+
207
+ const { skills, diagnostics } = discoverSkills({
208
+ includeDisabled: true,
209
+ customDirs: ["/extra/skills"],
210
+ customProvider: "file",
211
+ });
212
+ ```
213
+
214
+ #### `loadSkill(metadata: SkillMetadata): Skill`
215
+
216
+ Load a discovered skill’s full content (reads `SKILL.md` or `.SKILL.md` based on `metadata.disabled`).
217
+
218
+ #### `scanSkillDirectory(dirPath, options, provider, userDir?, scope?)`
219
+
220
+ Lower-level scanner used by `discoverSkills()`. Useful when you want full control over:
221
+
222
+ - root path + recursion
223
+ - provider tagging (`"claude" | "codex" | "file"`)
224
+ - optional `scope` prefixing for names
225
+
226
+ ### Registry
227
+
228
+ #### `new SkillRegistry(options?: SkillRegistryOptions)`
229
+
230
+ Convenience wrapper around discovery + fuzzy resolution.
231
+
232
+ ```ts
233
+ import { SkillRegistry } from "ccski";
234
+
235
+ const registry = new SkillRegistry({ includeDisabled: true });
236
+
237
+ const all = registry.getAll(); // SkillMetadata[]
238
+ const full = registry.load("some-skill"); // Skill (with content)
239
+ ```
240
+
241
+ Methods:
242
+
243
+ - `refresh()`: rescan directories (and plugins unless `skipPlugins: true`)
244
+ - `getAll()`: list all discovered skills
245
+ - `find(name)`: resolve a name (case-insensitive, supports short name and `provider:name`)
246
+ - `has(name)`: boolean existence check
247
+ - `load(name)`: resolve + read full content
248
+ - `getDiagnostics()`: totals + scanned roots + warnings/conflicts
249
+
250
+ ### Schemas (Zod)
251
+
252
+ These are exported for validating/parsing external JSON and frontmatter in a type-safe way:
253
+
254
+ - `SkillFrontmatterSchema` / `SkillFrontmatterType`
255
+ - `PluginEntrySchema` / `PluginEntryType`
256
+ - `InstalledPluginsSchema` / `InstalledPluginsType`
257
+ - `ClaudeSettingsSchema` / `ClaudeSettingsType`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccski",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "Claude Code Skills Manager - CLI and MCP interface for managing skills across AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -57,6 +57,7 @@
57
57
  "tsx": "^4.19.2",
58
58
  "typescript": "^5.7.2",
59
59
  "vitest": "^2.1.8",
60
+ "vitepress": "^1.5.0",
60
61
  "yargs": "^17.7.2",
61
62
  "zod": "^3.24.1"
62
63
  },
@@ -73,6 +74,9 @@
73
74
  "test:coverage": "vitest run --coverage",
74
75
  "ts": "tsc --noEmit",
75
76
  "lint": "echo 'Linting not configured yet'",
76
- "fmt": "prettier --write ."
77
+ "fmt": "prettier --write .",
78
+ "docs:dev": "vitepress dev docs",
79
+ "docs:build": "vitepress build docs",
80
+ "docs:preview": "vitepress preview docs"
77
81
  }
78
82
  }