@rhize/skill-forge 0.7.1 → 0.9.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/LICENSE CHANGED
@@ -19,6 +19,9 @@ Pro Modules
19
19
  - src/provenance.ts
20
20
  - src/queue.ts
21
21
  - src/evolve.ts
22
+ - src/organize.ts
23
+ - src/commands/watch.ts
24
+ - src/commands/ingest.ts
22
25
 
23
26
  ...and the portions of built artifacts (e.g. dist/cli.js in the published npm
24
27
  package) generated from these files. Each Pro Module carries a header
package/README.md CHANGED
@@ -69,6 +69,12 @@ skill-forge init [options] Detect installed agents and set g
69
69
  skill-forge add <source> [options] Quarantine-install a skill and run it through the gate
70
70
  skill-forge scan <source> [options] Gate a skill without installing it (always cleans up)
71
71
  skill-forge evolve <skill-dir> [options] Self-evolve an installed skill via SkillOpt-Sleep, re-gate, decide (Pro)
72
+ skill-forge audit [options] Doctor-style health check over the configured skill/MCP set (alias: doctor)
73
+ skill-forge organize [options] Set-level capability registry + dependency graph across configured skills roots (Pro)
74
+ skill-forge find [query] [options] Discover skills via skills.sh and check partner security audits (free)
75
+ skill-forge watch [options] Drift check across every SOURCES.md provenance ledger (Pro)
76
+ skill-forge ingest [options] Hand the pending-ingestion queue off to a coding agent for the decide/absorb pass (Pro)
77
+ skill-forge queue close <id> --status <s> Close a queue entry after the decide pass (Pro)
72
78
  skill-forge list List skills currently held in quarantine
73
79
  skill-forge status Show configuration and quarantine summary
74
80
  ```
@@ -89,6 +95,13 @@ overwrites the fields it's responsible for. If no `config.json` exists yet, `add
89
95
  `status` offer to run this for you on first use (skipped entirely for `--json`/`--yes`/non-TTY
90
96
  invocations, so scripted runs never block on a prompt).
91
97
 
98
+ **Init now ends by offering the audit (v0.8).** After an interactive run writes its config, it
99
+ asks "Run the skills & MCP audit now? [Y/n]" (default yes) and, if accepted, runs
100
+ `skill-forge audit` interactively — see [`audit`](#audit-v08) below. `init --defaults` runs it too,
101
+ but non-interactively (`--yes`): a report is written, with no business-profile prompt, no
102
+ foundation scaffold, and no agent handoff. `init --list` and an aborted/empty selection stay
103
+ write-free, so neither writes a config nor runs the audit.
104
+
92
105
  ### `add`
93
106
 
94
107
  ```bash
@@ -196,6 +209,196 @@ adopting, `evolve` refuses (unless `--force`) when the staged proposal is alread
196
209
  the live skill it would replace, since that's the signature of a staging dir that was already
197
210
  adopted once.
198
211
 
212
+ ### `audit` (v0.8)
213
+
214
+ ```bash
215
+ skill-forge audit
216
+ skill-forge doctor # alias
217
+ skill-forge audit --json --report ./audit.md
218
+ skill-forge audit --yes
219
+ skill-forge audit --foundation
220
+ skill-forge audit --handoff
221
+ ```
222
+
223
+ A re-runnable, doctor-style health check over the skill/MCP set you've **already** configured —
224
+ unlike `add`/`scan`, which gate a new candidate before it's installed, `audit` inventories what's
225
+ already there and looks for hygiene issues and consolidation/refinement opportunities. Requires a
226
+ real, saved config (`skill-forge init` first) — it never silently audits an invented default.
227
+ `init` now ends by offering to run it (see [`init`](#init) above); it's equally safe to run any
228
+ time on its own.
229
+
230
+ | Option | Effect |
231
+ |---|---|
232
+ | *(none)* | Interactive: offers to capture/reuse a business profile, then runs the audit, then offers the foundation scaffold and agent handoff. |
233
+ | `--json` | Prints the full audit report as JSON instead of the terminal summary. Non-interactive — skips the business-profile prompt. |
234
+ | `-y, --yes` | Skips every interactive prompt (business profile, foundation, handoff). Never implies `--foundation` or `--handoff`. |
235
+ | `--report <file>` | Write the report here instead of the default `~/.skill-forge/reports/audit-<ISO-timestamp>.md`. Refuses an existing path — never overwrites. |
236
+ | `--foundation` | The one skills-root write this command can make: scaffold a `business-foundation` skill from the captured business profile (see below). |
237
+ | `--handoff` | Hand the written report off to your configured coding agent with the bundled curation prompt, via the same handoff plumbing as `add --ingest`. |
238
+
239
+ **What it inventories/checks.** Every configured `skillsRoots` entry — symlink-aware, deduped by
240
+ realpath so a skill reachable via two roots or an aliased symlink is reported once, with alias
241
+ locations kept rather than dropped. Per skill: strict frontmatter validation (a missing/unclosed
242
+ fence or missing `name`/`description` is a finding, not silently backfilled), `SKILL.md` size and
243
+ an estimated token count, and a full `scanSafety` pass — the same safety ruleset `add`/`scan` run.
244
+ Every configured `mcpTargets` file: JSON targets get full server enumeration (name, command
245
+ basename, package spec, arg/env **counts** — never values); TOML targets (e.g. Codex CLI's
246
+ `config.toml`) get the same textual MCP safety scan `--artifact mcp` uses, since there's no
247
+ structured TOML enumeration. A per-item failure (unreadable skill, broken symlink, malformed MCP
248
+ config) becomes a finding — it never aborts the run.
249
+
250
+ **Opportunity pass.** Beyond hygiene, the report surfaces:
251
+
252
+ - **Overlap clusters** (Pro, free during the 0.x beta) — cross-root overlap scoring across every
253
+ inventoried skill, grouped into connected components, each with a top pairwise score and a
254
+ suggested verb code (`ABSORB`/`FORK`/`DEFER` — `opportunities.overlapLocked` in `--json` output
255
+ says whether this ran or was Pro-locked, without string-matching `notices`). The fuller
256
+ five-verb matrix (adding `REJECT`/`WATCH`) belongs to the agent-side curation prompt's deeper
257
+ decide pass (`--handoff`), not this report. Locked → that section shows the standard upgrade
258
+ notice and empty clusters; everything else in the report still runs.
259
+ - **Evolve-eligible skills** — structurally valid, safety-passing skills, labeled as eligible for
260
+ `skill-forge evolve` — an eligibility list, not a judgment that they need refining.
261
+ - **A business-foundation opportunity** — offered whenever `config.foundationSkillPath` isn't set
262
+ yet.
263
+
264
+ **Business profile.** Interactive runs (never under `--yes`/`--json`/non-TTY) open with a
265
+ business-name/industry/audiences/workflows/constraints Q&A, preceded by an explicit "don't enter
266
+ credentials or confidential customer data" warning. An existing stored profile is offered for
267
+ reuse rather than re-asked, and a fresh capture is shown back as a summary before it's saved to
268
+ `config.businessProfile`. This profile grounds both the foundation scaffold and the curation
269
+ handoff prompt.
270
+
271
+ **Report location + privacy.** Written to `~/.skill-forge/reports/audit-<ISO-timestamp>.md` by
272
+ default (`--report <file>` to override), created with `{ flag: 'wx', mode: 0o600 }` — exclusive
273
+ create (refuses to overwrite an existing report) and owner-only permissions. MCP `env` values and
274
+ arbitrary arg values are never written into the report or the `--json` payload — only server/
275
+ command names, package specs, and counts.
276
+
277
+ **Explicit opt-ins.** `--foundation` is the *only* way this command writes to a skills root: it
278
+ scaffolds `<targetRoot>/business-foundation/SKILL.md` from the captured business profile
279
+ (containment-checked against `config.skillsRoots`, refuses an existing or symlinked destination,
280
+ writes atomically, and runs `scanSafety` on the generated content before it's placed), then
281
+ records the path to `config.foundationSkillPath`. `--handoff` is the *only* way this command
282
+ launches an agent — same argv-array, no-shell discipline as `--ingest` (see
283
+ [Ingestion handoff](#ingestion-handoff---ingest)), using the bundled `assets/curation-prompt.md`
284
+ in place of `ingest-prompt.md`. `--yes` (and `init --defaults`, which passes it through) never
285
+ implies either — a non-interactive run writes only the report and, if a profile was already
286
+ stored, the config; nothing else.
287
+
288
+ ### `organize` (v0.9, Pro)
289
+
290
+ ```bash
291
+ skill-forge organize
292
+ skill-forge organize --json
293
+ skill-forge organize --out ./registry.json
294
+ skill-forge organize --usage-snapshot ./skill-monitor-snapshot.json
295
+ ```
296
+
297
+ Pro (free during the 0.x beta). Builds a set-level view across every configured `skillsRoots`
298
+ entry: a **capability registry** (per-skill row — `tier`/`domain`/`consumes`/`provenance`/
299
+ `maturity` frontmatter, plus untagged/rot flags) and a **dependency graph** (nodes, `consumes`
300
+ edges, orphans, hot resources, dangling edges, cycles). This is the TS port of the plugin's
301
+ `index_skills.py` + `build_dependency_graph.py`, merged into one command — graph nodes are keyed
302
+ by realpath-qualified stable IDs (not bare frontmatter names), so duplicate names across roots
303
+ don't collapse adjacency; duplicate-name ambiguity and unresolved `consumes` targets are reported
304
+ rather than silently dropped.
305
+
306
+ | Option | Effect |
307
+ |---|---|
308
+ | `--json` | Print the registry + graph as JSON instead of the terminal summary. |
309
+ | `--out <file>` | Write the full report JSON to this path. Refuses an existing path (`wx`, `0o600` — same discipline as `audit --report`). |
310
+ | `--usage-snapshot <file>` | Join per-skill usage counts from a skill-monitor snapshot JSON (`usage_joined` in the output); a zero-match snapshot is warned about, not silently ignored. |
311
+
312
+ `organize` performs its own self-contained scan — it does not reuse `audit`'s inventory walker
313
+ — and, like every other command, never executes anything found under a scanned skills root.
314
+
315
+ ### `find` (v0.9, free)
316
+
317
+ ```bash
318
+ skill-forge find "pdf form filling"
319
+ skill-forge find "pdf form filling" --limit 20 --json
320
+ skill-forge find --audit owner/skill-name
321
+ skill-forge find --get owner/skill-name
322
+ skill-forge find --curated
323
+ ```
324
+
325
+ Free. TS port of the plugin's `skills_sh.py` — discovery only, exactly one mode per invocation
326
+ (search, `--audit`, `--get`, or `--curated`; mutually exclusive):
327
+
328
+ | Mode | Effect |
329
+ |---|---|
330
+ | `<query>` (default) | Search skills.sh; each result shows id, install count, and the install hint `skill-forge add <id>` — **not** `npx skills add`, since `add` runs the full local quarantine/gate. |
331
+ | `--audit <id>` | Partner security-audit verdicts (Socket, Snyk, Gen Agent Trust Hub, …) for a specific skills.sh id — pass/warn/fail + risk. No auto-audit of search results. |
332
+ | `--get <id>` | Detail + file tree for a specific skills.sh id. |
333
+ | `--curated` | List skills.sh's curated skills. |
334
+ | `--limit <n>` | Max search results (default 10). |
335
+ | `--json` | Print the raw API payload as JSON. |
336
+
337
+ Search results are labeled **unvetted** — `find` never installs or gates anything itself. Think
338
+ of `find --audit` as the partner-verdict layer and `add`/`scan` as the deep local gate; they're
339
+ two independent checks, not a replacement for one another.
340
+
341
+ **Auth: `VERCEL_OIDC_TOKEN`.** All requests are HTTPS GETs to `https://skills.sh/api/v1`, using a
342
+ bearer token read from `process.env.VERCEL_OIDC_TOKEN` — never stored in config, never printed.
343
+ Without it, `find` fails loud (exit code 3) with setup guidance:
344
+
345
+ ```
346
+ 1. skills.sh authenticates with a short-lived Vercel OIDC token
347
+ 2. npm i -g vercel && vercel link && vercel env pull (writes VERCEL_OIDC_TOKEN to .env.local)
348
+ 3. export VERCEL_OIDC_TOKEN from .env.local into your shell before running this command
349
+ (or set it directly: export VERCEL_OIDC_TOKEN=...) — docs: https://skills.sh/docs/api
350
+ ```
351
+
352
+ Note step 3: `vercel env pull` writes the token into `.env.local`, it does not export it into your
353
+ shell — you (or your shell's dotenv loader) still need to export it before `find` can see it.
354
+
355
+ ### `watch` (v0.9, Pro)
356
+
357
+ ```bash
358
+ skill-forge watch
359
+ skill-forge watch --offline
360
+ skill-forge watch --json
361
+ ```
362
+
363
+ Pro (free during the 0.x beta). TS port of the plugin's `record_provenance.py --check-drift`.
364
+ Scans **every** configured `skillsRoots` entry's `SOURCES.md` provenance ledger (deduped by
365
+ realpath, each reported row names its ledger) and reports, per tracked entry, whether the
366
+ recorded upstream ref still matches what the source currently resolves to.
367
+
368
+ For entries whose `Source` parses as a git URL and whose `Upstream ref` looks like a commit/tag,
369
+ `watch` runs a fixed, first-party `git ls-remote <url> [ref]` (argv array, no shell) to compare —
370
+ `--offline` skips all network checks and just lists entries for manual comparison. Every other
371
+ entry is listed for manual checking regardless.
372
+
373
+ **`watch` NEVER executes a ledger's stored drift-check command string.** That string is
374
+ attacker-influenceable data — anyone who can write to a skills root's `SOURCES.md` controls it.
375
+ It is only ever printed, sanitized, as a suggestion for you (or an agent) to run yourself.
376
+
377
+ ### `ingest` + `queue close` (v0.9, Pro)
378
+
379
+ ```bash
380
+ skill-forge ingest
381
+ skill-forge ingest --list
382
+ skill-forge ingest --list --json
383
+ skill-forge queue close <id> --status ingested
384
+ skill-forge queue close <id> --status dismissed
385
+ ```
386
+
387
+ Pro (free during the 0.x beta). The queue-drain UX that previously only existed as the
388
+ `rhize-meta` plugin's `/rhize-meta:forge-ingest` slash command. `ingest` (no args) validates every
389
+ pending `~/.skill-forge/queue.json` entry — each entry's `quarantinePath`/`installedPath` must
390
+ canonicalize under the configured quarantine dir or a configured skills root/MCP target;
391
+ mismatched or escaping entries are reported and excluded — then hands the surviving summary off to
392
+ the configured coding agent (same handoff plumbing as `add --ingest`) with `assets/ingest-prompt.md`,
393
+ which now carries the full queue-drain workflow. `--list` is read-only: it prints pending entries
394
+ (`--json` for machine-readable output) without any handoff.
395
+
396
+ For a single new source, use `skill-forge add <source> --ingest` instead — that runs the full
397
+ quarantine/gate pipeline first; `ingest` only ever drains what's already queued.
398
+
399
+ `skill-forge queue close <id> --status ingested|dismissed` lets an agent close out a queue entry
400
+ after its decide pass without hand-editing `queue.json` — writes are atomic (temp file + rename).
401
+
199
402
  ### `list` / `status`
200
403
 
201
404
  `list` shows what's currently held in quarantine (installed via `add`, answered "hold", not yet
@@ -310,7 +513,12 @@ JSON. Detection/overlap is agent-format-agnostic; writing is JSON-only.
310
513
  | Provenance ledger (`SOURCES.md` audit trail) | | ✓ |
311
514
  | Pending-ingestion queue + `--ingest` handoff | | ✓ |
312
515
  | `evolve` — SkillOpt-Sleep self-evolution, re-gating, provenance, queueing (v0.7) | | ✓ |
313
- | Set-level organizer (capability registry, redundancy, dependency graph) | | ✓ |
516
+ | `audit` — inventory, hygiene findings, report, business profile, foundation scaffold (v0.8) | ✓ | ✓ |
517
+ | `audit`'s cross-root overlap clusters (v0.8) | | ✓ |
518
+ | `organize` — set-level capability registry + dependency graph (v0.9) | | ✓ |
519
+ | `find` — skills.sh discovery + partner audit verdicts (v0.9) | ✓ | ✓ |
520
+ | `watch` — provenance drift check across every `SOURCES.md` ledger (v0.9) | | ✓ |
521
+ | `ingest` + `queue close` — pending-queue drain handoff (v0.9) | | ✓ |
314
522
 
315
523
  Free is the complete safety gate on its own — quarantine, profile, safety scan, and an explicit
316
524
  promote/reject decision, with nothing held back. Pro is the curation layer on top: whether a new
@@ -362,9 +570,12 @@ implementation status.
362
570
  that deeper judgment (which patterns to keep, whether to absorb into an existing skill vs. fork a
363
571
  new one, verifying the result beats baseline) is a job for a coding agent, not the gate. `--ingest`
364
572
  hands a promoted skill off to one, running the bundled, agent-neutral prompt at
365
- `assets/ingest-prompt.md` (Claude Code users get a deeper experience via the companion
366
- `rhize-skill-forge` plugin skill, but the bundled prompt works with any agent). The same flag works
367
- on an MCP server promote (`--artifact mcp --ingest`, v0.6): the bundled prompt branches on the
573
+ `assets/ingest-prompt.md` — works with any agent. (As of v0.9, this fully replaces the `rhize-meta`
574
+ plugin's `rhize-skill-forge` skill and its `/rhize-meta:forge-ingest`/`forge-scan`/`forge-watch`/
575
+ `skill-find`/`skill-doctor` commands, which are removed; skill vetting/governance now lives
576
+ entirely in this npm package. The plugin's remaining `skill-refinement` skill can still receive
577
+ ABSORB extractions from an ingest pass — see [docs/forge-workflow.md](docs/forge-workflow.md).)
578
+ The same flag works on an MCP server promote (`--artifact mcp --ingest`, v0.6): the bundled prompt branches on the
368
579
  queue entry's `artifactType` and runs the matching decide pass — see
369
580
  [MCP gating](#mcp-gating-v05) above.
370
581