@rhize/skill-forge 0.7.0 → 0.8.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
@@ -69,6 +69,7 @@ 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)
72
73
  skill-forge list List skills currently held in quarantine
73
74
  skill-forge status Show configuration and quarantine summary
74
75
  ```
@@ -89,6 +90,13 @@ overwrites the fields it's responsible for. If no `config.json` exists yet, `add
89
90
  `status` offer to run this for you on first use (skipped entirely for `--json`/`--yes`/non-TTY
90
91
  invocations, so scripted runs never block on a prompt).
91
92
 
93
+ **Init now ends by offering the audit (v0.8).** After an interactive run writes its config, it
94
+ asks "Run the skills & MCP audit now? [Y/n]" (default yes) and, if accepted, runs
95
+ `skill-forge audit` interactively — see [`audit`](#audit-v08) below. `init --defaults` runs it too,
96
+ but non-interactively (`--yes`): a report is written, with no business-profile prompt, no
97
+ foundation scaffold, and no agent handoff. `init --list` and an aborted/empty selection stay
98
+ write-free, so neither writes a config nor runs the audit.
99
+
92
100
  ### `add`
93
101
 
94
102
  ```bash
@@ -196,6 +204,82 @@ adopting, `evolve` refuses (unless `--force`) when the staged proposal is alread
196
204
  the live skill it would replace, since that's the signature of a staging dir that was already
197
205
  adopted once.
198
206
 
207
+ ### `audit` (v0.8)
208
+
209
+ ```bash
210
+ skill-forge audit
211
+ skill-forge doctor # alias
212
+ skill-forge audit --json --report ./audit.md
213
+ skill-forge audit --yes
214
+ skill-forge audit --foundation
215
+ skill-forge audit --handoff
216
+ ```
217
+
218
+ A re-runnable, doctor-style health check over the skill/MCP set you've **already** configured —
219
+ unlike `add`/`scan`, which gate a new candidate before it's installed, `audit` inventories what's
220
+ already there and looks for hygiene issues and consolidation/refinement opportunities. Requires a
221
+ real, saved config (`skill-forge init` first) — it never silently audits an invented default.
222
+ `init` now ends by offering to run it (see [`init`](#init) above); it's equally safe to run any
223
+ time on its own.
224
+
225
+ | Option | Effect |
226
+ |---|---|
227
+ | *(none)* | Interactive: offers to capture/reuse a business profile, then runs the audit, then offers the foundation scaffold and agent handoff. |
228
+ | `--json` | Prints the full audit report as JSON instead of the terminal summary. Non-interactive — skips the business-profile prompt. |
229
+ | `-y, --yes` | Skips every interactive prompt (business profile, foundation, handoff). Never implies `--foundation` or `--handoff`. |
230
+ | `--report <file>` | Write the report here instead of the default `~/.skill-forge/reports/audit-<ISO-timestamp>.md`. Refuses an existing path — never overwrites. |
231
+ | `--foundation` | The one skills-root write this command can make: scaffold a `business-foundation` skill from the captured business profile (see below). |
232
+ | `--handoff` | Hand the written report off to your configured coding agent with the bundled curation prompt, via the same handoff plumbing as `add --ingest`. |
233
+
234
+ **What it inventories/checks.** Every configured `skillsRoots` entry — symlink-aware, deduped by
235
+ realpath so a skill reachable via two roots or an aliased symlink is reported once, with alias
236
+ locations kept rather than dropped. Per skill: strict frontmatter validation (a missing/unclosed
237
+ fence or missing `name`/`description` is a finding, not silently backfilled), `SKILL.md` size and
238
+ an estimated token count, and a full `scanSafety` pass — the same safety ruleset `add`/`scan` run.
239
+ Every configured `mcpTargets` file: JSON targets get full server enumeration (name, command
240
+ basename, package spec, arg/env **counts** — never values); TOML targets (e.g. Codex CLI's
241
+ `config.toml`) get the same textual MCP safety scan `--artifact mcp` uses, since there's no
242
+ structured TOML enumeration. A per-item failure (unreadable skill, broken symlink, malformed MCP
243
+ config) becomes a finding — it never aborts the run.
244
+
245
+ **Opportunity pass.** Beyond hygiene, the report surfaces:
246
+
247
+ - **Overlap clusters** (Pro, free during the 0.x beta) — cross-root overlap scoring across every
248
+ inventoried skill, grouped into connected components, each with a top pairwise score and a
249
+ suggested verb code (`ABSORB`/`FORK`/`DEFER` — `opportunities.overlapLocked` in `--json` output
250
+ says whether this ran or was Pro-locked, without string-matching `notices`). The fuller
251
+ five-verb matrix (adding `REJECT`/`WATCH`) belongs to the agent-side curation prompt's deeper
252
+ decide pass (`--handoff`), not this report. Locked → that section shows the standard upgrade
253
+ notice and empty clusters; everything else in the report still runs.
254
+ - **Evolve-eligible skills** — structurally valid, safety-passing skills, labeled as eligible for
255
+ `skill-forge evolve` — an eligibility list, not a judgment that they need refining.
256
+ - **A business-foundation opportunity** — offered whenever `config.foundationSkillPath` isn't set
257
+ yet.
258
+
259
+ **Business profile.** Interactive runs (never under `--yes`/`--json`/non-TTY) open with a
260
+ business-name/industry/audiences/workflows/constraints Q&A, preceded by an explicit "don't enter
261
+ credentials or confidential customer data" warning. An existing stored profile is offered for
262
+ reuse rather than re-asked, and a fresh capture is shown back as a summary before it's saved to
263
+ `config.businessProfile`. This profile grounds both the foundation scaffold and the curation
264
+ handoff prompt.
265
+
266
+ **Report location + privacy.** Written to `~/.skill-forge/reports/audit-<ISO-timestamp>.md` by
267
+ default (`--report <file>` to override), created with `{ flag: 'wx', mode: 0o600 }` — exclusive
268
+ create (refuses to overwrite an existing report) and owner-only permissions. MCP `env` values and
269
+ arbitrary arg values are never written into the report or the `--json` payload — only server/
270
+ command names, package specs, and counts.
271
+
272
+ **Explicit opt-ins.** `--foundation` is the *only* way this command writes to a skills root: it
273
+ scaffolds `<targetRoot>/business-foundation/SKILL.md` from the captured business profile
274
+ (containment-checked against `config.skillsRoots`, refuses an existing or symlinked destination,
275
+ writes atomically, and runs `scanSafety` on the generated content before it's placed), then
276
+ records the path to `config.foundationSkillPath`. `--handoff` is the *only* way this command
277
+ launches an agent — same argv-array, no-shell discipline as `--ingest` (see
278
+ [Ingestion handoff](#ingestion-handoff---ingest)), using the bundled `assets/curation-prompt.md`
279
+ in place of `ingest-prompt.md`. `--yes` (and `init --defaults`, which passes it through) never
280
+ implies either — a non-interactive run writes only the report and, if a profile was already
281
+ stored, the config; nothing else.
282
+
199
283
  ### `list` / `status`
200
284
 
201
285
  `list` shows what's currently held in quarantine (installed via `add`, answered "hold", not yet
@@ -270,6 +354,14 @@ map — it never touches a skills root:
270
354
  - **Missing target file/parent dirs:** created.
271
355
  - A candidate config listing more than one server gates/promotes the first (same "N found — using
272
356
  the first" convention `add`/`scan` already use for a multi-skill source), noted on stderr.
357
+ - **Version pinning is enforced, including on a candidate's own documented entry (v0.7).** A
358
+ candidate's `.mcp.json` server entry is used for `command`/`args` when present, but an unpinned
359
+ `npx` spec there (`"args": ["-y", "pkg@latest"]`) is no longer written through as-is: it's
360
+ **auto-pinned** to `<package>@<version>` when it matches the version skill-forge scanned from the
361
+ candidate's own (self-declared) `package.json`, or **promotion is refused** (with an explanation
362
+ and no override flag) when it can't be safely auto-pinned — a different package name, no version
363
+ found, or a more complex shape (e.g. a `-p`/`--package` dependency, or more than one spec).
364
+ See [docs/gate-policy.md](docs/gate-policy.md#mcp-promote-version-pin-enforcement-v07).
273
365
 
274
366
  There's no MCP equivalent of the skill provenance ledger (`SOURCES.md`) — the pending-ingestion
275
367
  queue (Pro) and `--ingest` handoff both apply the same way, keyed on the written config file path
@@ -302,6 +394,8 @@ JSON. Detection/overlap is agent-format-agnostic; writing is JSON-only.
302
394
  | Provenance ledger (`SOURCES.md` audit trail) | | ✓ |
303
395
  | Pending-ingestion queue + `--ingest` handoff | | ✓ |
304
396
  | `evolve` — SkillOpt-Sleep self-evolution, re-gating, provenance, queueing (v0.7) | | ✓ |
397
+ | `audit` — inventory, hygiene findings, report, business profile, foundation scaffold (v0.8) | ✓ | ✓ |
398
+ | `audit`'s cross-root overlap clusters (v0.8) | | ✓ |
305
399
  | Set-level organizer (capability registry, redundancy, dependency graph) | | ✓ |
306
400
 
307
401
  Free is the complete safety gate on its own — quarantine, profile, safety scan, and an explicit