ccski 2.3.1 → 2.4.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/README.md CHANGED
@@ -8,10 +8,12 @@ Documentation site: https://jixoai-labs.github.io/ccski/
8
8
 
9
9
  - [Install](#install)
10
10
  - [Quick start](#quick-start)
11
+ - [Connect ccski to your agent prompt](#connect-ccski-to-your-agent-prompt)
11
12
  - [Run MCP server](#run-mcp-server)
12
13
  - [Core CLI commands](#core-cli-commands)
13
14
  - [Install examples](#install-examples)
14
15
  - [Enable/disable](#enabledisable)
16
+ - [Discovery roots and priority](#discovery-roots-and-priority)
15
17
  - [More](#more)
16
18
  - [Acknowledgements](#acknowledgements)
17
19
  - [API Reference](#api-reference)
@@ -31,6 +33,52 @@ ccski --help
31
33
 
32
34
  ## Quick start
33
35
 
36
+ ### Connect ccski to your agent prompt
37
+
38
+ ccski works best when your agent is told how to discover local skills at the
39
+ start of a new context. The installer writes a managed English workflow block
40
+ into common agent instruction files:
41
+
42
+ ```bash
43
+ npx -y ccski install
44
+ ```
45
+
46
+ By default this installs at user scope for known agents:
47
+
48
+ - Codex: `~/.codex/AGENTS.md`
49
+ - Claude Code: `~/.claude/CLAUDE.md`
50
+ - Gemini CLI: `~/.gemini/GEMINI.md`
51
+ - OpenCode: `~/.config/opencode/AGENTS.md`
52
+
53
+ Limit the target or install only into the current project:
54
+
55
+ ```bash
56
+ # one agent, user scope
57
+ npx -y ccski install --agent=codex
58
+
59
+ # one project file in the current directory
60
+ npx -y ccski install --agent=gemini --project
61
+
62
+ # preview changes
63
+ npx -y ccski install --dry-run --json
64
+ ```
65
+
66
+ The installer is idempotent. It replaces only the managed
67
+ `<workflow name="ccski">...</workflow>` block and preserves the rest of your
68
+ prompt file.
69
+
70
+ Manual install is also fine. Add this block to your user or project instruction
71
+ file, such as `~/.codex/AGENTS.md`, `~/.claude/CLAUDE.md`, or
72
+ `~/.gemini/GEMINI.md`:
73
+
74
+ ```md
75
+ <workflow name="ccski">
76
+ When starting a new context, run `bunx ccski list --no-color` to discover extra local skills available on this machine, especially shared `agents:user` skills and agent-specific skills such as `claude:user`, `codex:user`, and `gemini:user`.
77
+ If the user names a skill, or a task clearly matches a skill that is not already exposed in the current session, do not assume the skill is unavailable. First run `bunx ccski list --no-color`, then run `bunx ccski info <name>` and load the `SKILL.md` path reported by the output.
78
+ `ccski` may emit compatibility warnings while reading local agent or plugin metadata, such as `installed_plugins.json`. These warnings do not necessarily block `list` or `info`; prefer `--no-color` for readable output and downstream parsing.
79
+ </workflow>
80
+ ```
81
+
34
82
  ### Run MCP server
35
83
 
36
84
  ```bash
@@ -55,15 +103,16 @@ MCP plugin config example (Codex/Cursor/Windsurf/VS Code):
55
103
 
56
104
  ### Core CLI commands
57
105
 
58
- | Command | Purpose |
59
- | ----------------------------------------------- | ------------------------------------------------------------------------------ |
60
- | `ccski list` | List discovered skills (project, user, plugin) |
61
- | `ccski info <name>` | Show metadata and content preview |
62
- | `ccski install <source> [-i\|--all\|--path]` | Install from git/dir/marketplace/SKILL.md; interactive picker available |
63
- | `ccski enable [names...] [-i\|--all]` | Enable skills (`.SKILL.md` -> `SKILL.md`) |
64
- | `ccski disable [names...] [-i\|--all]` | Disable skills (`SKILL.md` -> `.SKILL.md`) |
65
- | `ccski validate <path>` | Validate SKILL.md or skill directory |
66
- | `ccski mcp` | Start MCP server (stdio/http/sse) |
106
+ | Command | Purpose |
107
+ | -------------------------------------------- | ----------------------------------------------------------------------- |
108
+ | `ccski list` | List discovered skills (project, user, plugin) |
109
+ | `ccski info <name>` | Show metadata and content preview |
110
+ | `ccski install` | Install the ccski workflow block into agent instruction files |
111
+ | `ccski install <source> [-i\|--all\|--path]` | Install from git/dir/marketplace/SKILL.md; interactive picker available |
112
+ | `ccski enable [names...] [-i\|--all]` | Enable skills (`.SKILL.md` -> `SKILL.md`) |
113
+ | `ccski disable [names...] [-i\|--all]` | Disable skills (`SKILL.md` -> `.SKILL.md`) |
114
+ | `ccski validate <path>` | Validate SKILL.md or skill directory |
115
+ | `ccski mcp` | Start MCP server (stdio/http/sse) |
67
116
 
68
117
  ### Install examples
69
118
 
@@ -87,6 +136,27 @@ ccski enable -i
87
136
  ccski disable --all
88
137
  ```
89
138
 
139
+ ### Discovery roots and priority
140
+
141
+ By default ccski scans shared and agent-specific skill roots in the workspace and user
142
+ home directory. Built-in agent roots include `.claude/skills`, `.codex/skills`,
143
+ `.gemini/skills`, and `.openclaw/skills`; ccski also discovers shallow dynamic
144
+ agent roots such as `.<agent>/skills`.
145
+
146
+ When `auto` selection sees the same skill name in multiple roots, ccski keeps every
147
+ copy internally but chooses one by source priority:
148
+
149
+ 1. `--skill-dir` custom roots
150
+ 2. `<workspace>/.<agent>/skills`
151
+ 3. `<workspace>/.agents/skills`
152
+ 4. `<workspace>/skills`
153
+ 5. `~/.<agent>/skills`
154
+ 6. `~/.agents/skills`
155
+ 7. Claude plugin skills
156
+
157
+ If two copies have the same source priority, the newer `SKILL.md` or `.SKILL.md`
158
+ mtime wins. If mtimes also tie, provider ordering is deterministic.
159
+
90
160
  ## More
91
161
 
92
162
  - Programmatic API is available from the package export; see [API Reference](#api-reference) (or the docs site) for usage examples.
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { x as __require } from "./create-prompt-CIJV_96B.mjs";
3
- import { $ as AmbiguousSkillNameError, A as highlight, C as formatSkillLabel, D as error, E as duplicateBadge, F as tone, I as warn, L as containsCaseInsensitive, M as renderList, N as setColorEnabled, O as formatBytes, P as success, R as rankStrings, S as SkillRegistry, T as dim, U as compareSkillProviders, W as providerNamesFromSkills, _ as listSkills, a as InstallCancelledError, b as computeDuplicateGroups, f as validateSkill, g as resolveSkill, h as getSkillInfo, i as toggleSkills, j as info, k as heading, l as installSkills, n as MultiSelectError, nt as SkillNotFoundError, o as MultiSkillSelectionError, p as searchSkills, r as ToggleCancelledError, s as createConsoleInstallOutput, t as startMCPServer, u as registerInstallCleanupHandlers, v as buildRegistryOptions, w as colors, x as parseFilters, y as applyFilters } from "./server-y5_8eQ5a.mjs";
3
+ import { A as colors, B as success, C as resolveSkill, D as parseFilters, E as computeDuplicateGroups, F as heading, H as warn, I as highlight, L as info, M as duplicateBadge, N as error, O as SkillRegistry, P as formatBytes, R as renderList, S as getSkillInfo, T as applyFilters, U as containsCaseInsensitive, V as tone, W as rankStrings, X as providerNamesFromSkills, Y as compareSkillProviders, at as AmbiguousSkillNameError, b as promptMultiSelect, c as ToggleCancelledError, ct as SkillNotFoundError, f as startMCPServer, g as createConsoleInstallOutput, h as MultiSkillSelectionError, i as listAgentInstructionTargets, j as dim, k as formatSkillLabel, l as toggleSkills, m as InstallCancelledError, o as validateSkill, p as listSkills, r as installCcskiWorkflow, s as MultiSelectError, u as searchSkills, v as installSkills, w as buildRegistryOptions, y as registerInstallCleanupHandlers, z as setColorEnabled } from "./workflow-install-D85Tfr9z.mjs";
4
4
  import { readFileSync, statSync } from "node:fs";
5
5
  import { readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync as statSync$1, writeFile } from "fs";
6
6
  import { homedir } from "node:os";
@@ -4193,6 +4193,68 @@ async function infoCommand(argv) {
4193
4193
  }
4194
4194
  }
4195
4195
 
4196
+ //#endregion
4197
+ //#region src/cli/commands/install-workflow.ts
4198
+ async function installWorkflowCommand(argv) {
4199
+ try {
4200
+ const scope = resolveWorkflowScope(argv);
4201
+ const explicitAgents = [...normalizeArray(argv.agents), ...normalizeArray(argv.agent)];
4202
+ const agents = explicitAgents.length > 0 ? explicitAgents : await maybePromptAgents(argv);
4203
+ const result = installCcskiWorkflow({
4204
+ ...agents.length > 0 ? { agents } : {},
4205
+ scope,
4206
+ ...argv.userDir !== void 0 ? { userDir: argv.userDir } : {},
4207
+ ...argv.dryRun !== void 0 ? { dryRun: argv.dryRun } : {}
4208
+ });
4209
+ if (argv.json) console.log(JSON.stringify(result, null, 2));
4210
+ else printWorkflowInstallSummary(result);
4211
+ if (result.failed > 0) process.exitCode = 1;
4212
+ } catch (err) {
4213
+ console.error(error(`Install failed: ${err instanceof Error ? err.message : String(err)}`));
4214
+ process.exitCode = 1;
4215
+ }
4216
+ }
4217
+ function resolveWorkflowScope(argv) {
4218
+ if (argv.project && argv.user) throw new Error("Use only one of --project or --user.");
4219
+ if (argv.project) return "project";
4220
+ if (argv.user) return "user";
4221
+ return argv.scope ?? "user";
4222
+ }
4223
+ function normalizeArray(values) {
4224
+ if (!values) return [];
4225
+ return Array.isArray(values) ? values.map(String) : [String(values)];
4226
+ }
4227
+ async function maybePromptAgents(argv) {
4228
+ if (!argv.interactive) return [];
4229
+ if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error("Interactive workflow install requires a TTY. Use --agent instead.");
4230
+ return promptMultiSelect({
4231
+ message: "Select agent prompt target(s)",
4232
+ choices: listAgentInstructionTargets().map((target) => ({
4233
+ value: target.id,
4234
+ label: `${tone.bold(target.label)} ${dim(target.id)}`,
4235
+ description: `${target.userPath.join("/")} / ${target.projectPath.join("/")}`,
4236
+ checked: true
4237
+ })),
4238
+ defaultChecked: true,
4239
+ command: {
4240
+ base: "ccski install",
4241
+ label: "Command",
4242
+ argPrefix: "--agent"
4243
+ }
4244
+ });
4245
+ }
4246
+ function printWorkflowInstallSummary(summary) {
4247
+ console.log(info(`Installing ccski workflow instructions (${summary.scope} scope)\n`));
4248
+ for (const result of summary.results) {
4249
+ const status = result.status === "installed" ? tone.success("✓ installed") : result.status === "updated" ? tone.warning("↻ updated") : result.status === "unchanged" ? dim("○ unchanged") : tone.danger("✗ failed");
4250
+ const errorText = result.error ? ` ${tone.danger(result.error)}` : "";
4251
+ console.log(`${tone.bold(result.label)}: ${status} ${dim(result.path)}${errorText}`);
4252
+ }
4253
+ console.log();
4254
+ console.log(dim(`Known targets: ${listAgentInstructionTargets().map((target) => target.id).join(", ")}`));
4255
+ console.log(dim("Use --agent=<name> to limit targets, --project for the current directory, or --dry-run."));
4256
+ }
4257
+
4196
4258
  //#endregion
4197
4259
  //#region src/cli/commands/install.ts
4198
4260
  async function installCommand(argv) {
@@ -4200,8 +4262,13 @@ async function installCommand(argv) {
4200
4262
  if (argv.color) setColorEnabled(true);
4201
4263
  registerInstallCleanupHandlers();
4202
4264
  const skills = Array.isArray(argv._) ? argv._.slice(1).map(String) : [];
4265
+ const source = typeof argv.source === "string" ? argv.source : skills.shift();
4266
+ if (!source) {
4267
+ await installWorkflowCommand(argv);
4268
+ return;
4269
+ }
4203
4270
  const options = {
4204
- source: argv.source,
4271
+ source,
4205
4272
  skills,
4206
4273
  ...argv.force !== void 0 ? { force: argv.force } : {},
4207
4274
  ...argv.override !== void 0 ? { override: argv.override } : {},
@@ -4756,11 +4823,28 @@ const mcpModule = {
4756
4823
  handler: mcpCommand
4757
4824
  };
4758
4825
  const installModule = {
4759
- command: "install <source>",
4760
- describe: "Install a skill into .claude/skills",
4826
+ command: "install [source]",
4827
+ describe: "Install ccski workflow instructions, or install skills from a source",
4761
4828
  builder: (cmd) => cmd.positional("source", {
4762
4829
  type: "string",
4763
- demandOption: true
4830
+ description: "Optional git/dir/marketplace/SKILL.md source. Omit to install ccski workflow instructions."
4831
+ }).option("agent", {
4832
+ alias: "A",
4833
+ type: "array",
4834
+ string: true,
4835
+ description: "Agent prompt target for workflow install (repeatable, default: all)"
4836
+ }).option("scope", {
4837
+ choices: ["user", "project"],
4838
+ default: "user",
4839
+ description: "Workflow install scope when no source is provided"
4840
+ }).option("user", {
4841
+ type: "boolean",
4842
+ default: false,
4843
+ description: "Install workflow instructions at user scope"
4844
+ }).option("project", {
4845
+ type: "boolean",
4846
+ default: false,
4847
+ description: "Install workflow instructions in the current project"
4764
4848
  }).option("out-dir", {
4765
4849
  type: "array",
4766
4850
  string: true,