@gobing-ai/superskill 0.2.4 → 0.2.6

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 (3) hide show
  1. package/README.md +41 -244
  2. package/dist/index.js +1235 -279
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,6 @@
1
1
  # superskill
2
2
 
3
- Multi-agent skill, command, subagent, hook, and MCP config distribution and authoring CLI install a Claude Code plugin to any coding agent, and create/validate/evaluate/refine/evolve agent-facing content from the command line.
4
-
5
- ## Why
6
-
7
- Coding agents (Claude Code, Codex, Pi, OpenCode, Antigravity, Hermes, omp) each use different config formats for skills, slash commands, subagents, hooks, and MCP servers. Maintaining hand-synced copies across agents is error-prone and doesn't scale.
8
-
9
- **superskill** solves this with two layers:
10
-
11
- 1. **Distribution** — `superskill install` takes a Claude Code plugin as the single source of truth and distributes it to any target agent, using [rulesync](https://www.npmjs.com/package/rulesync) as the format-conversion engine.
12
- 2. **Authoring + quality** — Five type commands (`agent`, `skill`, `command`, `hook`, `magent`) provide scaffold → validate → evaluate → refine → evolve workflows with persistent quality data in SQLite.
3
+ Multi-agent skill, command, subagent, hook, and MCP config distribution and authoring CLI. Install a Claude Code plugin to any coding agent, and create / validate / evaluate / refine / evolve agent-facing content from the command line.
13
4
 
14
5
  ## Install
15
6
 
@@ -29,7 +20,7 @@ bun run build
29
20
  cd apps/cli && bun link
30
21
  ```
31
22
 
32
- Requires [Bun](https://bun.sh/) ≥ 1.3.14. See [`docs/help/installation.md`](docs/help/installation.md) for details and troubleshooting.
23
+ Requires [Bun](https://bun.sh/) ≥ 1.3.14. See [Installation guide](docs/help/installation.md) for details and troubleshooting.
33
24
 
34
25
  ## Quick start
35
26
 
@@ -51,245 +42,51 @@ superskill skill migrate ./source-skill-1 ./source-skill-2 ./dest-skill
51
42
  superskill hook emit my-hook --target pi
52
43
  ```
53
44
 
54
- Full walkthrough: [`docs/help/quick_start.md`](docs/help/quick_start.md).
55
-
56
- ## Commands
57
-
58
- | Command | What it does | Docs |
59
- |---------|--------------|------|
60
- | `install` | Distribute a plugin's skills, commands, subagents, hooks, MCP to target agents | [`cmd_install.md`](docs/help/cmd_install.md) |
61
- | `agent` | Manage subagent definitions (scaffold/validate/evaluate/refine/evolve) | [`cmd_agent.md`](docs/help/cmd_agent.md) |
62
- | `skill` | Manage skill definitions (+ `package`, `migrate`) | [`cmd_skill.md`](docs/help/cmd_skill.md) |
63
- | `command` | Manage slash command definitions | [`cmd_command.md`](docs/help/cmd_command.md) |
64
- | `hook` | Manage hook definitions (+ `emit`) | [`cmd_hook.md`](docs/help/cmd_hook.md) |
65
- | `magent` | Manage main-agent configurations | [`cmd_magent.md`](docs/help/cmd_magent.md) |
66
-
67
- The five type commands share a common five-operation lifecycle (scaffold → validate → evaluate → refine → evolve) with type-specific quality dimensions and rubrics. Each command doc includes usage, architecture diagrams, sequence diagrams, and source-file references.
68
-
69
- **Help docs index:** [`docs/help/index.md`](docs/help/index.md)
70
-
71
- ### Operation lifecycle
72
-
73
- ```
74
- scaffold → validate → evaluate → refine → evolve
75
- ↑ │
76
- └─── longitudinal ───────┘
77
- ```
78
-
79
- | Operation | Purpose | Quality gate |
80
- |-----------|---------|-------------|
81
- | `scaffold` | Create new entity from template | Structure validation |
82
- | `validate` | Check structure and frontmatter | Pre-check spur rules |
83
- | `evaluate` | Score quality across dimensions | Rubric-weighted scoring (Scorer persona) |
84
- | `refine` | Apply low-risk fixes automatically | Fix classification (auto-apply / suggest / flag) |
85
- | `evolve` | Propose longitudinal improvements | Double-loop gate (Author → Skeptic → Judge) |
86
-
87
- Extra operations by type:
88
-
89
- | Type | Extra operation | What it does |
90
- |------|----------------|-------------|
91
- | `skill` | `package` | Bundle a skill + companion files into a distributable archive |
92
- | `skill` | `migrate` | Merge one or more source skills into a destination skill |
93
- | `hook` | `emit` | Emit a hook definition to a single target agent |
94
-
95
- ## Quality system
96
-
97
- ### Rubric-driven evaluation
98
-
99
- `evaluate` scores entities across type-specific quality dimensions using YAML rubrics. Ships with 5 package-default rubrics (`agent`, `skill`, `command`, `hook`, `magent`) — load custom ones with `--rubric <path>`.
100
-
101
- ```bash
102
- # Heuristic evaluation (built-in checks)
103
- superskill skill evaluate my-skill --save
104
-
105
- # Rubric evaluation — emit scoring brief for an external model
106
- superskill skill evaluate my-skill --rubric --json > scoring-brief.json
107
-
108
- # Ingest scored result and persist
109
- superskill skill evaluate my-skill --ingest scored-result.json --save
110
- ```
111
-
112
- ### Two-call seam (Scorer / Author / Skeptic / Judge)
113
-
114
- The CLI never scores or generates inline. Quality operations drive four personas via a two-call seam — the CLI emits envelopes, personas process offline, the CLI ingests results.
115
-
116
- | Persona | Role | Input | Output |
117
- |---------|------|-------|--------|
118
- | **Scorer** | Rubric judge | Envelope from `evaluate --rubric --json` | `{ rubric_version, dimensions: { score, note } }` |
119
- | **Author** | Rewriter | Envelope from `evolve --propose-only --json` | `ProposedChange[]` with `anchor_hash` |
120
- | **Skeptic** | Refuter | Proposal + verbatim goal anchor | `{ ok, violations[] }` |
121
- | **Judge** | Tournament selector | Multiple candidate proposals | Winning proposal ID |
122
-
123
- ### Double-loop gate for `evolve`
124
-
125
- `evolve --ingest <file>` applies authored proposals through a four-gate quality control:
126
-
127
- 1. **Deterministic validate** — 0 errors required
128
- 2. **Δ-margin** — score must improve by ≥ `--margin` (default 0.05)
129
- 3. **Anchor hash** — goal anchor unchanged (hash-gated)
130
- 4. **Skeptic review** — regressive merges rejected and restored
131
-
132
- Version-aware trends partition by `rubric_version`, preventing false regression signals when rubrics are updated.
133
-
134
- ## Proper Location for Coding Agents
135
-
136
- Each coding agent stores skills, slash commands, subagents, and hooks in different directories. This table is the single source of truth for where `superskill install` writes each entity type per target — verified against each agent's source code (`vendors/`).
137
-
138
- ### Entity locations — global (user-level, `~`)
139
-
140
- | Agent | Skills | Slash Commands | Subagents | Hooks |
141
- |-------|--------|---------------|-----------|-------|
142
- | **Claude Code** | `~/.claude/plugins/<name>/skills/` | `~/.claude/plugins/<name>/commands/` | `~/.claude/plugins/<name>/agents/` | `~/.claude/plugins/<name>/hooks/hooks.json` |
143
- | **Codex** | `~/.agents/skills/` | `~/.codex/prompts/` | `~/.codex/agents/` | — |
144
- | **Pi** | `~/.pi/agent/skills/` ¹ | `~/.pi/agent/prompts/` | `~/.pi/agent/agents/` ² | extensions ³ |
145
- | **omp** | `~/.omp/agent/skills/` | `~/.omp/agent/commands/` | `~/.omp/agent/agents/` ² | extensions ³ |
146
- | **OpenCode** | `~/.opencode/skills/` | `~/.config/opencode/commands/` | `~/.config/opencode/agents/` | — |
147
- | **Antigravity IDE** | `~/.gemini/config/skills/` | `~/.gemini/antigravity/global_workflows/` | — | — |
148
- | **Antigravity CLI** | `~/.gemini/antigravity-cli/skills/` | — | — | — |
149
- | **Hermes** | `~/.hermes/skills/` | config.yaml ⁴ | — ⁵ | `~/.hermes/hooks/<name>/HOOK.yaml` |
150
- | **OpenClaw** | `~/.openclaw/plugin-skills/` | — ⁶ | — ⁷ | webhooks ⁸ |
45
+ Full walkthrough: [Quick start guide](docs/help/quick_start.md).
151
46
 
152
- ### Entity locations — project-level (relative to workspace root)
47
+ ## Supported agents
153
48
 
154
- | Agent | Skills | Slash Commands | Subagents | Hooks |
155
- |-------|--------|---------------|-----------|-------|
156
- | **Claude Code** | `.claude/skills/` | `.claude/commands/` | `.claude/agents/` | `.claude/hooks/hooks.json` |
157
- | **Codex** | `.agents/skills/` | `.codex/prompts/` | `.codex/agents/` | — |
158
- | **Pi** | `.pi/skills/` | `.pi/prompts/` | `.pi/agents/` ² | `.pi/extensions/` |
159
- | **omp** | `.omp/skills/` | `.omp/commands/` | `.omp/agents/` ² | `.omp/hooks/` / `.omp/extensions/` |
160
- | **OpenCode** | `.opencode/skills/` | `.opencode/commands/` | `.opencode/agents/` | — |
161
- | **Antigravity IDE** | `.agents/skills/` | `.agents/workflows/` | — | — |
162
- | **Antigravity CLI** | `.agents/skills/` | — | — | — |
163
- | **Hermes** | `.hermes/skills/` | config.yaml | — | `.hermes/hooks/<name>/` |
164
- | **OpenClaw** | `skills/` | — | — | webhooks |
49
+ | Agent | Skills | Commands | Subagents | Hooks |
50
+ |-------|:------:|:--------:|:---------:|:-----:|
51
+ | Claude Code | | | | |
52
+ | Codex | | | | — |
53
+ | Pi | | | | |
54
+ | omp | | | | |
55
+ | OpenCode | | | | — |
56
+ | Antigravity IDE | | | — | — |
57
+ | Antigravity CLI | | — | — | — |
58
+ | Hermes | | | — | |
59
+ | OpenClaw | | — | — | |
165
60
 
166
- ¹ Pi also reads `~/.agents/skills/` (Codex interop). omp reads from multiple agent directories (Claude Code, Codex, Gemini, OpenCode, etc.).
61
+ See [entity locations](docs/help/entity_locations.md) for the exact install directories per agent.
167
62
 
168
- ² Subagents require an extension to be loaded (not built-in). Pi: `subagent` example extension. omp: `omp agents unpack` command.
63
+ > Agents that don't natively support some entity types still get them. `superskill install` adapts commands and subagents as Skills 2.0 skill directories for targets that lack them — so every agent receives the full plugin surface, regardless of native feature set.
169
64
 
170
- ³ Pi and omp replaced legacy hooks with an **Extensions** system (TypeScript event handlers at `~/.pi/agent/extensions/` / `~/.omp/agent/extensions/`). Legacy hook dirs: `.omp/hooks/pre|post/*.ts`.
171
-
172
- ⁴ Hermes slash commands: built-in `CommandDef` entries OR user-defined `quick_commands:` in `~/.hermes/config.yaml`. Skills auto-register as `/<skill-name>` — best path.
173
-
174
- ⁵ Hermes spawns subagents dynamically via `delegate_task` tool; no persistent subagent directory.
175
-
176
- ⁶ OpenClaw auto-discovers slash commands from skill directories as `/<skill-name>`. No separate commands directory.
177
-
178
- ⁷ OpenClaw agents are configured in YAML (`agents.list`), not as files in a directory.
179
-
180
- ⁸ OpenClaw hooks are inbound HTTP webhooks (`hooks.path`, `hooks.transformsDir`) — not coding-agent event hooks. No hook file installation needed.
181
-
182
- Since ts-ai-runner 0.3.21, `omp`, `hermes`, and `antigravity-cli` are canonical `AgentName` values — slash-command dialect translation maps 1:1. Only `antigravity-ide` still bridges through `opencode`.
183
-
184
- ### How superskill installs
185
-
186
- | Agent | Engine | Notes |
187
- |-------|--------|-------|
188
- | **Claude Code** | `claude plugin marketplace add` + `claude plugin install` | Native plugin system — handles all entity types automatically |
189
- | **Codex** | rulesync | `codex` → `codexcli` |
190
- | **Pi** | rulesync + superskill shim | Subagents adapted as Skills 2.0 skill directories; Pi native agents written directly to `~/.pi/agent/agents/` |
191
- | **omp** | rulesync + superskill shim | `omp` → `pi` surrogate for rulesync, then copy to `~/.omp/`; omp also reads from other agent dirs |
192
- | **OpenCode** | rulesync | `opencode` → `opencode` |
193
- | **Antigravity IDE** | rulesync | `antigravity-ide` → `antigravity-ide` |
194
- | **Antigravity CLI** | rulesync | `antigravity-cli` → `antigravity-cli`; commands/subagents not supported by rulesync for this target |
195
- | **Hermes** | rulesync + superskill shim | `hermes` → `opencode` surrogate for rulesync, then copy to `~/.hermes/`; hooks format is HOOK.yaml not hooks.json |
196
- | **OpenClaw** | implicit (via `~/.agents/skills/`) | Reads skills from `~/.agents/skills/` (shared root with codex/opencode in global mode). No dedicated dispatch needed. |
197
-
198
- ### Known gaps
199
-
200
- | Gap | Status |
201
- |-----|--------|
202
- | **antigravity-cli** commands/subagents | Rulesync doesn't support `antigravity-cli` for commands/subagents (only `antigravity` project-level). |
203
- | **Hermes hooks format** | Superskill writes `hooks.json`; Hermes expects `~/.hermes/hooks/<name>/HOOK.yaml` + `handler.py`. |
204
- | **Hermes commands** | No `commands/` directory. Install commands as skills for slash-command auto-discovery. |
205
- | **Pi/omp hooks → extensions** | Legacy pi-hooks shim should migrate to the Extensions format. |
206
- | **OpenClaw agents/hooks** | OpenClaw reads skills from `~/.agents/skills/` (implicitly covered). Dedicated agent YAML config and webhook-based hooks are not managed by superskill. |
207
- ## Bundled `cc` plugin
208
-
209
- superskill ships with a Claude Code plugin at [`plugins/cc/`](plugins/cc/) (marketplace name: `cc`, version `0.1.8`) that demonstrates the full authoring lifecycle and provides the meta-agent skills the expert personas reference:
210
-
211
- | Entity | Count | Purpose |
212
- |--------|-------|---------|
213
- | **commands** | 17 | 4 operations × 4 types + `hook-evaluate` — thin slash-command wrappers that delegate to skills |
214
- | **agents** | 5 | `expert-agent`, `expert-command`, `expert-hook`, `expert-magent`, `expert-skill` — specialist subagents that route to skills |
215
- | **hooks** | 1 | `Stop` hook running the anti-hallucination guard |
216
- | **scripts** | 3 | `ah_guard.ts`, `validate_response.ts`, `logger.ts` — deterministic enforcement for the anti-hallucination protocol |
217
-
218
- The plugin follows a three-tier delegation pattern: **Commands/Agents → Skills → `superskill` CLI**. For non-Claude targets, `superskill install` adapts commands and subagents as Skills 2.0 skill directories (`pipeline/adapt-command.ts`, `pipeline/adapt-subagent.ts`) so every target receives a uniform skill-based distribution. See [`plugins/cc/README.md`](plugins/cc/README.md) for the full entity design and relationship diagram.
219
-
220
- ## Development
221
-
222
- ### Stack
223
-
224
- | Concern | Tool |
225
- |---------|------|
226
- | Runtime / package manager | Bun 1.3.14 |
227
- | Language | TypeScript 5.x |
228
- | CLI framework | Commander.js |
229
- | Lint + format | Biome 2.4.16 |
230
- | Test runner | `bun:test` |
231
- | Format conversion | rulesync (npm) |
232
- | Quality store | SQLite via `@gobing-ai/ts-db` |
233
- | Constraint rules | Spur (`spur rule run`) |
234
- | Git hooks | Lefthook |
235
- | Conventional commits | cocogitto (`cog`) |
236
- | Tool versions | proto (`.prototools`) |
237
-
238
- ### Workspace layout
239
-
240
- ```
241
- apps/cli/ # Commander-based CLI entry (the binary); imports @gobing-ai/superskill-core
242
- packages/core/ # reusable domain logic and no-app operation APIs
243
- tooling/typescript/ # shared tsconfig presets
244
- plugins/cc/ # bundled Claude Code plugin
245
- ```
246
-
247
- ### Commands
248
-
249
- ```bash
250
- bun run lint # biome check + typecheck
251
- bun run format # biome check --write (autofix)
252
- bun run autofix # format then typecheck
253
- bun run test # bun test with coverage
254
- bun run build # compile to standalone binary
255
- bun run dev # watch mode
256
- bun run check # lint + test (CI gate)
257
- bun run spur-check # lint + pre-check rules + test + post-check rules
258
- ```
259
-
260
- ### Verification gate
261
-
262
- All must pass before a change is considered done:
263
-
264
- 1. `bun run lint` — Biome and typecheck clean.
265
- 2. `bun run test` — all tests pass, no `.skip` or commented-out tests. Coverage ≥ 90% lines + functions.
266
- 3. `bun run build` — standalone binary compiles.
267
- 4. `git status` — only intentional changes.
268
- 5. `bun run spur-check` — pre-check rules (22) + post-check rules (coverage-gate + tsdoc-export) all green.
269
-
270
- ### Code style
271
-
272
- Enforced by [biome.json](biome.json): 4-space indent, 120-char width, single quotes, semicolons, trailing commas. `interface` for object shapes, `type` for unions. `any` is an error. Workspace imports use `@<scope>/*` aliases.
273
-
274
- ### Commits
275
-
276
- [Conventional Commits](https://www.conventionalcommits.org/) enforced by cocogitto: `feat:`, `fix:`, `docs:`, `chore:`, etc.
277
-
278
- ## Documentation
279
-
280
- **Help docs** (usage + implementation diagrams): [`docs/help/`](docs/help/index.md)
281
-
282
- **Authoritative project docs:**
65
+ ## Commands
283
66
 
284
- | Doc | Covers |
285
- |-----|--------|
286
- | [00_ADR](docs/00_ADR.md) | Architecture decisions (authoritative) |
287
- | [01_PRD](docs/01_PRD.md) | Product scope (authoritative) |
288
- | [02_ROADMAP](docs/02_ROADMAP.md) | Phase sequencing |
289
- | [03_ARCHITECTURE](docs/03_ARCHITECTURE.md) | Module boundaries, data flow, invariants |
290
- | [04_DESIGN](docs/04_DESIGN.md) | CLI surface — commands, flags, schemas |
291
- | [05_FEATURES](docs/05_FEATURES.md) | Feature status tracker |
292
- | [99_PROJECT_CONSTITUTION](docs/99_PROJECT_CONSTITUTION.md) | Process rules for maintaining docs |
67
+ | Command | What it does | Docs |
68
+ |---------|-------------|------|
69
+ | `install` | Distribute a plugin's skills, commands, subagents, hooks, MCP to target agents | [cmd_install.md](docs/help/cmd_install.md) |
70
+ | `agent` | Manage subagent definitions (scaffold / validate / evaluate / refine / evolve) | [cmd_agent.md](docs/help/cmd_agent.md) |
71
+ | `skill` | Manage skill definitions (+ `package`, `migrate`) | [cmd_skill.md](docs/help/cmd_skill.md) |
72
+ | `command` | Manage slash command definitions | [cmd_command.md](docs/help/cmd_command.md) |
73
+ | `hook` | Manage hook definitions (+ `emit`) | [cmd_hook.md](docs/help/cmd_hook.md) |
74
+ | `magent` | Manage main-agent configurations | [cmd_magent.md](docs/help/cmd_magent.md) |
75
+
76
+ The five type commands share a common lifecycle: **scaffold → validate → evaluate → refine → evolve**, with type-specific quality dimensions and rubrics.
77
+
78
+ ## Further reading
79
+
80
+ | Topic | Document |
81
+ |-------|----------|
82
+ | Full help index | [docs/help/index.md](docs/help/index.md) |
83
+ | Quality system (rubrics, scoring, evolve gate) | [docs/help/quality_system.md](docs/help/quality_system.md) |
84
+ | Entity locations per target agent | [docs/help/entity_locations.md](docs/help/entity_locations.md) |
85
+ | Bundled `cc` plugin | [docs/help/bundled_plugin.md](docs/help/bundled_plugin.md) |
86
+ | Development guide (stack, build, tests) | [docs/help/development.md](docs/help/development.md) |
87
+ | Architecture decisions (authoritative) | [docs/00_ADR.md](docs/00_ADR.md) |
88
+ | Product scope | [docs/01_PRD.md](docs/01_PRD.md) |
89
+ | CLI surface reference | [docs/04_DESIGN.md](docs/04_DESIGN.md) |
293
90
 
294
91
  ## License
295
92