skillfit 0.15.2 → 0.16.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/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.16.0 — Personal agent configuration maintenance (2026-11-16)
6
+
7
+ - Add versioned `doctor --json` output and opt-in `doctor --strict` health
8
+ failures. Read-only reports distinguish native Skill events from resource
9
+ reads and preview bounded evaluations before any model spending.
10
+ - Select real JSON MCP entries for redacted checks, and add `mcp apply` for
11
+ managed JSON creation, update and removal with backups, verification and
12
+ rollback. Native Codex TOML remains explicitly unsupported.
13
+ - Add precise managed Skill/rules uninstall with drift checks and retained
14
+ recovery copies; usage counts never trigger automatic maintenance.
15
+ - Extend portable bundles with explicit Kimi selection, existing Codex defaults,
16
+ provenance retention and restricted JSON MCP declarations. Migration stays
17
+ within the same Agent and does not transfer credential-bearing entries.
18
+ - Add repeatable `bundle export --allow-symlink-root` for deliberately shared
19
+ Skills. Canonical targets and nested links must stay inside approved roots,
20
+ cycles and escapes fail, and exports contain ordinary files.
21
+ - Keep all runtime dependencies at zero and cover the new behavior with offline
22
+ tests and real-source temporary export/install validation.
23
+
24
+ ## 0.15.4 — Correct review grading and failure diagnostics (2026-11-05)
25
+
26
+ - Fresh Codex profiles can initialize their managed `.system` Skills between
27
+ calls without falsely stopping an evaluation. User Skill changes and root
28
+ alias changes still stop the batch.
29
+ - The bundled code-review grader recognizes English and Chinese findings about
30
+ missing tests. A valid coverage finding about `percentOff` earns its proper
31
+ credit, while incorrect calculation and style allegations still incur penalties.
32
+ - Markdown evaluation reports link to the current metrics reference.
33
+ - Commit mining reports Git's exit status, process error and termination signal
34
+ alongside stderr, so an empty stderr retains the available failure diagnostics.
35
+
36
+ ## 0.15.3 — Restore the frozen feature recipe (2026-11-04)
37
+
38
+ - `tools/verify/recipes/0.11.0-feature-smoke.mjs` is back to the bytes published
39
+ with 0.11.0 and is excluded from Biome. Its public-flag check now reads
40
+ `eval --help` and `report --help`. 0.15.2 is published; its acceptance
41
+ stopped because the formatted recipe no longer contained the adaptation
42
+ text. That version was not uploaded again.
43
+
5
44
  ## 0.15.2 — Release acceptance matches the shipped help (2026-11-04)
6
45
 
7
46
  - Registry install acceptance reads `--request` from `eval --help`. The
package/README.md CHANGED
@@ -27,12 +27,16 @@ skillfit compares a baseline and a treatment on the same tasks and reports what
27
27
  `report` and `doctor` read this machine and do not call a model.
28
28
 
29
29
  ```bash
30
- npx skillfit@0.15.2 report
31
- npx skillfit@0.15.2 doctor
30
+ npx skillfit@0.16.0 report
31
+ npx skillfit@0.16.0 doctor
32
+ npx skillfit@0.16.0 doctor --json
33
+ npx skillfit@0.16.0 doctor --strict
32
34
  ```
33
35
 
36
+ The JSON output is a `skillfit.doctor-report` [version-1 document](docs/schemas/doctor-report.schema.json) with Agent detection, Rules/Skills/MCP checks and matching summary counts. Findings remain advisory and exit 0 by default; `--strict` explicitly exits 1 when a FAIL exists, while an unknown Agent exits 2. Every doctor mode stays read-only: no model call, MCP connection or configuration write is performed.
37
+
34
38
  ```console
35
- $ npx skillfit@0.15.2 report --agent codex
39
+ $ npx skillfit@0.16.0 report --agent codex
36
40
 
37
41
  codex — 280 session(s), 280 transcript(s)
38
42
  skill FIRES SESSIONS LAST SEEN
@@ -59,16 +63,16 @@ codex — 280 session(s), 280 transcript(s)
59
63
  Overall: 17 installed skill(s), 12 observed firing, 5 with no observed fire in retained history.
60
64
  ```
61
65
 
62
- Captured 2026-11-04 from one Codex history. Five installed skills have no observed fire; that is a priority signal, and install dates are unavailable. `prflow` is a project skill. Codex sessions record the project directory, so that skill counts as installed. The omitted catalog-size line covers the user catalog only.
66
+ Captured 2026-11-04 from one Codex history. Five installed skills have no observed fire; that is a priority signal, and install dates are unavailable. `prflow` is a project skill. Codex sessions record the project directory, so that skill counts as installed. The omitted catalog-size line covers the user catalog only. Reports distinguish native Skill events from Codex's registered `SKILL.md` read commands. Missing history is unmeasured, not zero use. Evaluation suggestions start with `--dry-run`; trigger observations are not task-quality outcomes, and usage never automatically uninstalls or upgrades a Skill.
63
67
 
64
68
  ## See a real report before you spend
65
69
 
66
70
  No agent CLI, no login, no model calls. These read the benches shipped inside the package and take a few seconds:
67
71
 
68
72
  ```bash
69
- npx skillfit@0.15.2 bench check code-review
70
- npx skillfit@0.15.2 bench self-test code-review --suite existing-mock-arms --runs-root ./runs --run-group controls-001 --yes
71
- npx skillfit@0.15.2 report eval ./runs/controls-001/existing-mock-arms
73
+ npx skillfit@0.16.0 bench check code-review
74
+ npx skillfit@0.16.0 bench self-test code-review --suite existing-mock-arms --runs-root ./runs --run-group controls-001 --yes
75
+ npx skillfit@0.16.0 report eval ./runs/controls-001/existing-mock-arms
72
76
  ```
73
77
 
74
78
  <p align="center">
@@ -88,11 +92,11 @@ Paired eval defaults to **5 trials per condition**: 8 tasks require 80 agent exe
88
92
  ## Install
89
93
 
90
94
  ```bash
91
- npx skillfit@0.15.2 --help
92
- npx skillfit@0.15.2 doctor
95
+ npx skillfit@0.16.0 --help
96
+ npx skillfit@0.16.0 doctor
93
97
  ```
94
98
 
95
- Requires Node.js 22+. Both commands above are offline and make no model calls: `--help` lists the eight commands, and `doctor` is a read-only health report that detects which supported agents you have, inspects their rules files, and flags invalid or conflicting Skills. [Choose your build](docs/README.md#choose-your-build) owns the package/source boundary, availability checks and older release documentation.
99
+ Requires Node.js 22+. Both commands above are offline and make no model calls: `--help` lists the nine commands, and `doctor` is a read-only health report that detects which supported agents you have, inspects their rules files, and flags invalid or conflicting Skills. [Choose your build](docs/README.md#choose-your-build) owns the package/source boundary, availability checks and older release documentation.
96
100
 
97
101
  ## Why
98
102
 
@@ -128,10 +132,10 @@ The instructions the agent should follow.
128
132
  Then scaffold a case and preview an evaluation:
129
133
 
130
134
  ```bash
131
- npx skillfit@0.15.2 bench init my-bench --kind command --dry-run
132
- npx skillfit@0.15.2 bench init my-bench --kind command --yes
133
- npx skillfit@0.15.2 bench check ./my-bench --json
134
- npx skillfit@0.15.2 eval ./my-skill --bench ./my-bench --mode installed --agent codex --trials 1 --max-calls 2 --runs-root ./runs --run-group first-eval --json --dry-run
135
+ npx skillfit@0.16.0 bench init my-bench --kind command --dry-run
136
+ npx skillfit@0.16.0 bench init my-bench --kind command --yes
137
+ npx skillfit@0.16.0 bench check ./my-bench --json
138
+ npx skillfit@0.16.0 eval ./my-skill --bench ./my-bench --mode installed --agent codex --trials 1 --max-calls 2 --runs-root ./runs --run-group first-eval --json --dry-run
135
139
  ```
136
140
 
137
141
  Replace the teaching fixture, prompt, verifier and oracle before measuring benefit. The preview declares two calls and makes none. Inspect `plan.evaluation.agentPreflight.status`; login remains unknown offline. Keep cases and runs in separate directories. Continue with [your first real evaluation](docs/guides/first-real-eval.md).
@@ -177,7 +181,7 @@ checkout once:
177
181
  ```bash
178
182
  git clone https://github.com/remote-controlled-man/skillfit.git
179
183
  cd skillfit
180
- git switch --detach f506681edd0490a7690f2a96bd5b7e589f0bd5d0
184
+ git switch --detach 3656a8975fa29af822a7359d18d0578b415c755b
181
185
  npm ci
182
186
  npm run build
183
187
  node dist/cli.js --help
@@ -188,7 +192,7 @@ node dist/cli.js eval skills/skillfit --bench code-review --agent codex --dry-ru
188
192
  node dist/cli.js install --agent codex --dry-run
189
193
  ```
190
194
 
191
- The detached commit is the one tag v0.15.0 names. Building it prints 0.15.0.
195
+ The detached commit contains the review-grading, metrics-link and Git-diagnostic fixes before the version bump. Building it prints 0.15.3.
192
196
  For development on your own checkout, follow
193
197
  [CONTRIBUTING.md](https://github.com/remote-controlled-man/skillfit/blob/main/CONTRIBUTING.md).
194
198
 
@@ -232,7 +236,7 @@ node dist/cli.js eval <skill-dir> --bench <bench-dir> --agent codex --input work
232
236
  node dist/cli.js bench check <bench-dir> --calibrate --agent codex --input workspace --trials 3 --dry-run
233
237
  ```
234
238
 
235
- Import the issue request with `--prompt-file` so the fix message does not reveal the answer. Follow the [real OSS workflow](docs/guides/bench-authoring.md) or inspect the [pinned mcp-use example](https://github.com/remote-controlled-man/skillfit/blob/f506681edd0490a7690f2a96bd5b7e589f0bd5d0/benches/contrib/oss-mcp-use-utf8/README.md).
239
+ Import the issue request with `--prompt-file` so the fix message does not reveal the answer. Follow the [real OSS workflow](docs/guides/bench-authoring.md) or inspect the [pinned mcp-use example](https://github.com/remote-controlled-man/skillfit/blob/3656a8975fa29af822a7359d18d0578b415c755b/benches/contrib/oss-mcp-use-utf8/README.md).
236
240
 
237
241
  ### Compare Skill revisions
238
242
 
@@ -313,9 +317,9 @@ node dist/cli.js setup codex --skill vibe-coding --skill diagnosing-bugs --yes
313
317
 
314
318
  See the [selectable setup guide](docs/guides/selectable-codex.md) for source provenance, retired entries and evidence limits.
315
319
 
316
- ### Portable Codex setup
320
+ ### Portable personal setup
317
321
 
318
- Export user-level Skills observed in at least two Codex sessions and your active global guidance:
322
+ By default, export user-level Skills observed in at least two Codex sessions and your active global guidance. Select `--agent kimi-code` to migrate a Kimi Code configuration instead:
319
323
 
320
324
  ```bash
321
325
  node dist/cli.js bundle export ./personal-codex --dry-run
@@ -323,22 +327,26 @@ node dist/cli.js bundle export ./personal-codex --yes
323
327
  # transfer the personal-codex directory to the new machine
324
328
  node ./personal-codex/setup.mjs --dry-run
325
329
  node ./personal-codex/setup.mjs --yes
330
+ node dist/cli.js bundle export ./personal-kimi --agent kimi-code --skill example --mcp docs --dry-run
331
+ node dist/cli.js bundle export ./personal-kimi-linked --agent kimi-code --skill example --allow-symlink-root "$HOME/.local/share/my-skills" --dry-run
326
332
  ```
327
333
 
328
- For options, including the full 65-Skill upstream catalog via `--upstream-lock`, see [portable setup](docs/guides/selectable-codex.md) and the [source audit](https://github.com/remote-controlled-man/skillfit/blob/3a3ff415ccef1a3a45d1e2d2cc00d903ab7db850/docs/codex-upstream-audit.md).
334
+ Repeated `--mcp` selects JSON declarations without credentials or machine-local paths; native Codex TOML remains unsupported. Symlinked Skills stay refused by default. Repeat `--allow-symlink-root` only for precise source directories you approve; links must remain inside the selected Skill and an approved root, and exports contain ordinary files rather than links. This migrates between machines for the same Agent, not between Agent formats. For options, including the full 65-Skill upstream catalog via `--upstream-lock`, see [portable setup](docs/guides/selectable-codex.md) and the [source audit](https://github.com/remote-controlled-man/skillfit/blob/3a3ff415ccef1a3a45d1e2d2cc00d903ab7db850/docs/codex-upstream-audit.md).
329
335
 
330
- ## The eight commands
336
+ ## The nine commands
331
337
 
332
338
  | Command | What it does | Writes? |
333
339
  |---|---|---|
334
- | `doctor` | Inspect agent configuration, invalid Skills, conflicts and supported MCP declarations | Read-only |
340
+ | `doctor` | Inspect agent configuration, invalid Skills, conflicts and supported MCP declarations | Read-only; `--strict` changes only the exit status |
335
341
  | `report` | Summarize observed Skill usage or render saved evaluation results | Only `report eval --export --yes` writes a fresh replay directory |
336
342
  | `eval <target>` | Compare a Skill, rules or MCP overlay; trigger mode observes Skill activation | Saves runs; real evaluations call an agent/model |
337
- | `mcp check <spec>` | Connect to an MCP server and audit `tools/list`; never invoke a tool | No skillfit output files; starts or contacts the server |
343
+ | `mcp check <spec>` | Audit an explicit probe spec or [a server selected from Agent configuration](docs/guides/experiment-workflow.md#inspect-an-mcp-server); never invoke a tool | No configuration writes; starts or contacts the server |
344
+ | `mcp apply` | [Create, update or remove one managed JSON MCP entry](docs/guides/experiment-workflow.md#apply-a-scoped-json-mcp-entry) with preview, backup and rollback | After confirmation; no server or model call |
338
345
  | `bench` | Scaffold, inspect, edit and validate tasks; current source also supports offline `self-test` | Edits require confirmation; calibration/drafting call agents and save output; plain checks run local verifiers |
339
346
  | `install` | Apply a profile with conflict checks, backups, verification and rollback on failure | After confirmation; preview with `--dry-run`, add `--strict` to fail on conflicts |
347
+ | `uninstall` | Remove selected managed Skills or AGENTS.md rules with drift checks and retained recovery copies | After confirmation; `--dry-run` writes nothing |
340
348
  | `setup codex` | Select pinned Skills and global routing guidance; defaults to a preview | Only `--yes` installs; source selection needs network |
341
- | `bundle` | Export selected local Skills and global guidance for another machine | After confirmation; generated setup previews before installation |
349
+ | `bundle` | Export Codex/Kimi rules, selected Skills and safe JSON MCP declarations for another machine | After confirmation; generated setup previews before installation; no server/model call |
342
350
 
343
351
  Use `node dist/cli.js <command> --help` for that command's flags and the [configuration guide](docs/guides/selectable-codex.md) for setup options. No observed Skill use is not proof of uselessness. Offline checks and replay still execute trusted local bench code. Installation keeps the first `<file>.skillfit-bak`; rollback handles write/validation failures, while abrupt termination can leave a partial install.
344
352
 
@@ -390,7 +398,7 @@ Check the [documentation](docs/README.md) for the build you use. For bugs or que
390
398
 
391
399
  Follow [CONTRIBUTING.md](https://github.com/remote-controlled-man/skillfit/blob/main/CONTRIBUTING.md). Useful contributions include real-workflow cases, reproducible evidence and matrix corrections. [Security reports](https://github.com/remote-controlled-man/skillfit/blob/main/SECURITY.md) have a separate channel.
392
400
 
393
- For development handoff, use [architecture and maintenance](docs/maintainers/architecture.md). Planned work is in [GitHub milestones](https://github.com/remote-controlled-man/skillfit/milestones).
401
+ For development handoff, use [architecture and maintenance](docs/maintainers/architecture.md). Find public work in [GitHub Issues](https://github.com/remote-controlled-man/skillfit/issues).
394
402
 
395
403
  ## License
396
404
 
package/README.zh-CN.md CHANGED
@@ -27,12 +27,16 @@ skillfit 在同一批任务上比较基线组与实验组,并报告变化及
27
27
  `report` 和 `doctor` 只读这台机器,不调用模型。
28
28
 
29
29
  ```bash
30
- npx skillfit@0.15.2 report
31
- npx skillfit@0.15.2 doctor
30
+ npx skillfit@0.16.0 report
31
+ npx skillfit@0.16.0 doctor
32
+ npx skillfit@0.16.0 doctor --json
33
+ npx skillfit@0.16.0 doctor --strict
32
34
  ```
33
35
 
36
+ JSON 输出是 `skillfit.doctor-report` [v1 文档](docs/schemas/doctor-report.schema.json),包含 Agent 检测、Rules/Skills/MCP 检查及一致的汇总计数。默认情况下发现异常仍是建议信息并退出 0;`--strict` 在存在 FAIL 时显式退出 1,未知 Agent 仍退出 2。所有 doctor 模式都保持只读:不调用模型、不连接 MCP,也不修改配置。
37
+
34
38
  ```console
35
- $ npx skillfit@0.15.2 report --agent codex
39
+ $ npx skillfit@0.16.0 report --agent codex
36
40
 
37
41
  codex — 280 session(s), 280 transcript(s)
38
42
  skill FIRES SESSIONS LAST SEEN
@@ -59,16 +63,16 @@ codex — 280 session(s), 280 transcript(s)
59
63
  Overall: 17 installed skill(s), 12 observed firing, 5 with no observed fire in retained history.
60
64
  ```
61
65
 
62
- 摘自 2026-11-04 的一份 Codex 历史。五个已安装 Skill 没有触发记录,这只是优先处理的信号,安装日期并不知道。`prflow` 是项目里的 Skill。Codex 会话记下了项目目录,所以它算作已安装。省略的目录体积那一行只统计用户目录。
66
+ 摘自 2026-11-04 的一份 Codex 历史。五个已安装 Skill 没有触发记录,这只是优先处理的信号,安装日期并不知道。`prflow` 是项目里的 Skill。Codex 会话记下了项目目录,所以它算作已安装。省略的目录体积那一行只统计用户目录。报告会区分原生 Skill 事件与 Codex 对已注册 `SKILL.md` 的读取命令。缺失历史代表未测量,不是零使用。评估建议先使用 `--dry-run`;触发观察不是任务质量结果,使用情况也不会自动卸载或升级 Skill。
63
67
 
64
68
  ## 花钱之前先看一份真实报告
65
69
 
66
70
  不需要 agent CLI、不需要登录、不调用模型。以下命令读取包内自带的 bench,几秒即可跑完:
67
71
 
68
72
  ```bash
69
- npx skillfit@0.15.2 bench check code-review
70
- npx skillfit@0.15.2 bench self-test code-review --suite existing-mock-arms --runs-root ./runs --run-group controls-001 --yes
71
- npx skillfit@0.15.2 report eval ./runs/controls-001/existing-mock-arms
73
+ npx skillfit@0.16.0 bench check code-review
74
+ npx skillfit@0.16.0 bench self-test code-review --suite existing-mock-arms --runs-root ./runs --run-group controls-001 --yes
75
+ npx skillfit@0.16.0 report eval ./runs/controls-001/existing-mock-arms
72
76
  ```
73
77
 
74
78
  <p align="center">
@@ -88,11 +92,11 @@ npx skillfit@0.15.2 report eval ./runs/controls-001/existing-mock-arms
88
92
  ## 安装
89
93
 
90
94
  ```bash
91
- npx skillfit@0.15.2 --help
92
- npx skillfit@0.15.2 doctor
95
+ npx skillfit@0.16.0 --help
96
+ npx skillfit@0.16.0 doctor
93
97
  ```
94
98
 
95
- 需要 Node.js 22+。以上两条命令均离线执行,不调用模型:`--help` 列出八个命令;`doctor` 是只读健康报告,检测你装了哪些受支持的 agent、检查它们的规则文件,并标出无效或冲突的 Skill。[选择构建](docs/README.md#choose-your-build)是包/源码边界、可用性确认与旧版发布文档的唯一入口。
99
+ 需要 Node.js 22+。以上两条命令均离线执行,不调用模型:`--help` 列出九个命令;`doctor` 是只读健康报告,检测你装了哪些受支持的 agent、检查它们的规则文件,并标出无效或冲突的 Skill。[选择构建](docs/README.md#choose-your-build)是包/源码边界、可用性确认与旧版发布文档的唯一入口。
96
100
 
97
101
  ## 为什么
98
102
 
@@ -128,10 +132,10 @@ The instructions the agent should follow.
128
132
  然后脚手架一个 case 并预览评测:
129
133
 
130
134
  ```bash
131
- npx skillfit@0.15.2 bench init my-bench --kind command --dry-run
132
- npx skillfit@0.15.2 bench init my-bench --kind command --yes
133
- npx skillfit@0.15.2 bench check ./my-bench --json
134
- npx skillfit@0.15.2 eval ./my-skill --bench ./my-bench --mode installed --agent codex --trials 1 --max-calls 2 --runs-root ./runs --run-group first-eval --json --dry-run
135
+ npx skillfit@0.16.0 bench init my-bench --kind command --dry-run
136
+ npx skillfit@0.16.0 bench init my-bench --kind command --yes
137
+ npx skillfit@0.16.0 bench check ./my-bench --json
138
+ npx skillfit@0.16.0 eval ./my-skill --bench ./my-bench --mode installed --agent codex --trials 1 --max-calls 2 --runs-root ./runs --run-group first-eval --json --dry-run
135
139
  ```
136
140
 
137
141
  测收益前先把教学用 fixture、prompt、verifier 和 oracle 换成真实任务。预览声明两次调用,实际不调用。检查 `plan.evaluation.agentPreflight.status`;离线登录状态仍未知。case 与运行记录分开放。继续阅读[第一次真实评测](docs/guides/first-real-eval.md)。
@@ -174,7 +178,7 @@ F1 : 0.20 (no CI: a harmonic mean of two proportions has no clo
174
178
  ```bash
175
179
  git clone https://github.com/remote-controlled-man/skillfit.git
176
180
  cd skillfit
177
- git switch --detach f506681edd0490a7690f2a96bd5b7e589f0bd5d0
181
+ git switch --detach 3656a8975fa29af822a7359d18d0578b415c755b
178
182
  npm ci
179
183
  npm run build
180
184
  node dist/cli.js --help
@@ -185,7 +189,7 @@ node dist/cli.js eval skills/skillfit --bench code-review --agent codex --dry-ru
185
189
  node dist/cli.js install --agent codex --dry-run
186
190
  ```
187
191
 
188
- 该 detached commit 就是 tag v0.15.0 指向的提交。构建后打印 0.15.0。要在自己的检出上开发,请按 [CONTRIBUTING.md](https://github.com/remote-controlled-man/skillfit/blob/main/CONTRIBUTING.md) 操作。
192
+ 该 detached commit 包含审查评分、指标链接和 Git 错误诊断修复,位于版本号更新之前。构建后打印 0.15.3。要在自己的检出上开发,请按 [CONTRIBUTING.md](https://github.com/remote-controlled-man/skillfit/blob/main/CONTRIBUTING.md) 操作。
189
193
 
190
194
  校验离线执行;`doctor` 只读,两种预览都只展示计划。适配器覆盖 **Claude Code**、**OpenAI Codex CLI** 与 **Kimi Code**;[当前源码能力表](docs/guides/experiment-workflow.md#executor-capabilities)列出模式、trigger reader、token/cache 限制与验证层级。matrix 声明命令;离线替身不能证明已安装 CLI 的兼容性或登录状态。
191
195
 
@@ -227,7 +231,7 @@ node dist/cli.js eval <skill-dir> --bench <bench-dir> --agent codex --input work
227
231
  node dist/cli.js bench check <bench-dir> --calibrate --agent codex --input workspace --trials 3 --dry-run
228
232
  ```
229
233
 
230
- 导入时用 `--prompt-file` 保留 issue 请求,避免修复提交信息泄露答案。参见[真实 OSS 流程](docs/guides/bench-authoring.md)或[固定的 mcp-use 示例](https://github.com/remote-controlled-man/skillfit/blob/f506681edd0490a7690f2a96bd5b7e589f0bd5d0/benches/contrib/oss-mcp-use-utf8/README.md)。
234
+ 导入时用 `--prompt-file` 保留 issue 请求,避免修复提交信息泄露答案。参见[真实 OSS 流程](docs/guides/bench-authoring.md)或[固定的 mcp-use 示例](https://github.com/remote-controlled-man/skillfit/blob/3656a8975fa29af822a7359d18d0578b415c755b/benches/contrib/oss-mcp-use-utf8/README.md)。
231
235
 
232
236
  ### 比较 Skill 修订版本
233
237
 
@@ -306,9 +310,9 @@ node dist/cli.js setup codex --skill vibe-coding --skill diagnosing-bugs --yes
306
310
 
307
311
  [可选择配置指南](docs/guides/selectable-codex.md)说明来源、退役条目和证据限制。
308
312
 
309
- ### 可迁移的 Codex 配置
313
+ ### 可迁移的个人配置
310
314
 
311
- 导出至少在两次 Codex 会话中观察到的用户级 Skill 和当前全局指引:
315
+ 默认导出至少在两次 Codex 会话中观察到的用户级 Skill 和当前全局指引;使用 `--agent kimi-code` 可改为迁移 Kimi Code 配置:
312
316
 
313
317
  ```bash
314
318
  node dist/cli.js bundle export ./personal-codex --dry-run
@@ -316,22 +320,26 @@ node dist/cli.js bundle export ./personal-codex --yes
316
320
  # transfer the personal-codex directory to the new machine
317
321
  node ./personal-codex/setup.mjs --dry-run
318
322
  node ./personal-codex/setup.mjs --yes
323
+ node dist/cli.js bundle export ./personal-kimi --agent kimi-code --skill example --mcp docs --dry-run
324
+ node dist/cli.js bundle export ./personal-kimi-linked --agent kimi-code --skill example --allow-symlink-root "$HOME/.local/share/my-skills" --dry-run
319
325
  ```
320
326
 
321
- 完整 65 个 Skill 的上游目录可使用 `--upstream-lock`;其他选项参见[迁移配置](docs/guides/selectable-codex.md)和[源审计](https://github.com/remote-controlled-man/skillfit/blob/3a3ff415ccef1a3a45d1e2d2cc00d903ab7db850/docs/codex-upstream-audit.md)。
327
+ 重复 `--mcp` 可选择不含凭据或本机路径的 JSON 声明;原生 Codex TOML 仍不支持。symlink Skill 默认仍拒绝。只对你批准的精确源目录重复使用 `--allow-symlink-root`;链接必须同时位于所选 Skill 和批准的根目录内,导出结果是普通文件而不是链接。这是同一 Agent 的跨机器迁移,不是 Agent 格式互转。完整 65 个 Skill 的上游目录可使用 `--upstream-lock`;其他选项参见[迁移配置](docs/guides/selectable-codex.md)和[源审计](https://github.com/remote-controlled-man/skillfit/blob/3a3ff415ccef1a3a45d1e2d2cc00d903ab7db850/docs/codex-upstream-audit.md)。
322
328
 
323
- ## 八个命令
329
+ ## 九个命令
324
330
 
325
331
  | 命令 | 干什么 | 写文件? |
326
332
  |---|---|---|
327
- | `doctor` | 检查 agent 配置、无效 Skill、冲突和受支持的 MCP 声明 | 只读 |
333
+ | `doctor` | 检查 agent 配置、无效 Skill、冲突和受支持的 MCP 声明 | 只读;`--strict` 只改变退出状态 |
328
334
  | `report` | 汇总观察到的 Skill 使用情况,或读取已保存评测结果 | 只有 `report eval --export --yes` 写入全新回放目录 |
329
335
  | `eval <target>` | 比较 Skill、规则或 MCP 覆盖层;trigger 模式观察 Skill 触发 | 保存运行记录;真实评测调用 agent/模型 |
330
- | `mcp check <spec>` | 连接 MCP 服务并检查 `tools/list`,不调用工具 | 不写 skillfit 输出文件;会启动或连接服务 |
336
+ | `mcp check <spec>` | 检查显式 probe spec 或[从 Agent 配置选择的 MCP 服务](docs/guides/experiment-workflow.md#inspect-an-mcp-server),不调用工具 | 不写配置;会启动或连接服务 |
337
+ | `mcp apply` | [创建、更新或移除一个托管 JSON MCP 条目](docs/guides/experiment-workflow.md#apply-a-scoped-json-mcp-entry),支持预览、备份与回滚 | 确认后写入;不启动服务或调用模型 |
331
338
  | `bench` | 创建、查看、修改和校验任务;当前源码另有离线 `self-test` | 修改需要确认;校准/起草调用 agent 并保存输出;普通检查执行本地 verifier |
332
339
  | `install` | 应用 profile,包含冲突检查、备份、写后验证和失败回滚 | 确认后写入;`--dry-run` 预览,加 `--strict` 让冲突失败 |
340
+ | `uninstall` | 卸载选定的托管 Skill 或 AGENTS.md 规则,检查漂移并保留恢复副本 | 确认后写入;`--dry-run` 不写文件 |
333
341
  | `setup codex` | 选择固定版本 Skill 与全局触发指引,默认预览 | 仅 `--yes` 安装;选择源需要网络 |
334
- | `bundle` | 导出所选本地 Skill 与全局指引,迁移到另一台机器 | 确认后写入;生成的安装器也先预览 |
342
+ | `bundle` | 导出 Codex/Kimi 规则、所选 Skill 与安全的 JSON MCP 声明,迁移到另一台机器 | 确认后写入;生成的安装器也先预览;不连接服务或调用模型 |
335
343
 
336
344
  参数见 `node dist/cli.js <command> --help`,配置选项见[配置指南](docs/guides/selectable-codex.md)。未观察到 Skill 使用不等于无用。离线检查和回放仍会执行可信的本地 bench 代码。安装保留首份 `<file>.skillfit-bak`;回滚处理写入或验证失败,进程突然终止仍可能留下部分安装。
337
345
 
@@ -383,7 +391,7 @@ bench 包含 `bench.json`、fixtures 和确定性 verifier。参见[Bench 编写
383
391
 
384
392
  按 [CONTRIBUTING.md](https://github.com/remote-controlled-man/skillfit/blob/main/CONTRIBUTING.md) 贡献真实工作 case、可复现证据和矩阵修正。[安全报告](https://github.com/remote-controlled-man/skillfit/blob/main/SECURITY.md)有独立渠道。
385
393
 
386
- 开发接手时,阅读[架构与维护](docs/maintainers/architecture.md)。计划中的工作见 [GitHub milestones](https://github.com/remote-controlled-man/skillfit/milestones)。
394
+ 开发接手时,阅读[架构与维护](docs/maintainers/architecture.md)。公开任务见 [GitHub Issues](https://github.com/remote-controlled-man/skillfit/issues)。
387
395
 
388
396
  ## License
389
397
 
@@ -6,7 +6,7 @@ Fixture layout: `src/` holds the pre-PR code and `CHANGES.diff` is the pull requ
6
6
 
7
7
  1. **Bare `Error` violates SPEC §1/§5 (high)**: post-PR `src/order.js` line 25 (diff line `+ throw new Error('invalid quantity: ' + item.qty);`) throws a bare `Error` with no `code`. SPEC §1 requires every caller-facing error to be an `AppError` with a stable code, and §5 mandates `INVALID_QUANTITY` for invalid quantities.
8
8
  2. **Boundary condition error (high)**: post-PR `src/order.js` line 30 `} else if (item.qty > 10) {` should be `>= 10`. SPEC §4 grants the 5% discount at quantity **>= 10**; as written, a line with `qty = 10` gets no discount.
9
- 3. **New function ships without tests (medium)**: `applyBulkDiscount` is a new exported function with new branches, yet the diff does not touch `tests/` — a SPEC §2 violation.
9
+ 3. **New function ships without tests (medium)**: `applyBulkDiscount` is a new exported function with new branches, yet the diff does not touch `tests/` — a SPEC §2 violation. The newly exported `percentOff` also lacks tests, so a coverage finding that names both functions is valid.
10
10
 
11
11
  ## Style decoys (must NOT be reported)
12
12
 
@@ -15,8 +15,8 @@ Post-PR lines 22–23 use a C-style `for (let i = 0; ...)` loop although the sur
15
15
  ## Scoring anchors
16
16
 
17
17
  - Recall: each of the 3 seeded defects scores 2 points (reported with a correct location: 2; reported but vaguely located: 1).
18
- - False positives: reporting the style decoy costs −1; reporting post-PR `money.js` `percentOff` (which correctly reuses `roundCents`) costs −1.
18
+ - False positives: reporting the style decoy costs −1; alleging a calculation defect in post-PR `money.js` `percentOff` (which correctly reuses `roundCents`) costs −1. A finding about its missing tests is valid under SPEC §2. A separate incorrect calculation finding still incurs the penalty.
19
19
 
20
20
  The bundled verifier (`verifiers/seeded-bugs.mjs`) collapses this rubric to four deterministic checks: one per seeded defect, each hit by a `file:line` or an unambiguous keyword reference on a line naming the file, plus `no-false-positives`, which fails when any decoy is reported. Exit code 0 requires all four, so the −1 penalty above is enforced rather than merely described.
21
21
 
22
- `missing-tests` requires an actual claim about absent coverage — a negation or obligation word near "test"/"coverage" — not merely the word "test" appearing on a line that names `applyBulkDiscount`.
22
+ `missing-tests` recognizes English and Chinese claims about absent or insufficient coverage, or required tests, on a line naming `applyBulkDiscount`. Merely naming tests or stating that coverage exists earns no credit. The verifier checks each finding on its own line; a valid coverage finding does not exempt another finding from decoy checks.
@@ -7,6 +7,17 @@ if (!runDir) {
7
7
  process.exit(2);
8
8
  }
9
9
 
10
+ // Coverage findings may be written in English or Chinese; a topic word alone is not evidence.
11
+ const missingCoverage = [
12
+ /\b(?:no|lacks?|lacking|missing|without|has no)\b[^.\n]{0,40}\b(?:tests?|coverage|covered)\b/i,
13
+ /\b(?:should|needs?|must|requires?)\b[^.\n]{0,40}\b(?:tests?|coverage)\b/i,
14
+ /\buntested\b/i,
15
+ /\bnot covered\b/i,
16
+ /(?:没有|缺少|缺乏|缺失|无|未(?:附带|添加|提供|包含|编写|覆盖))[^。!?,;\n]{0,40}(?:测试|覆盖|\btests?\b|\bcoverage\b)/i,
17
+ /(?:需要|应当|应该|必须)[^。!?,;\n]{0,40}(?:测试|覆盖|\btests?\b|\bcoverage\b)/i,
18
+ /(?:测试|覆盖率?)(?:缺失|不足)/,
19
+ ];
20
+
10
21
  const bugs = [
11
22
  {
12
23
  id: 'bare-error',
@@ -21,21 +32,25 @@ const bugs = [
21
32
  {
22
33
  id: 'missing-tests',
23
34
  anchor: /applyBulkDiscount/,
24
- // A bare /test/i passed on any line that named the function and contained the word "test", so
25
- // "applyBulkDiscount test" scored the same as a reasoned coverage finding. Require an actual
26
- // claim about missing coverage rather than the topic word.
27
- evidence: [
28
- /\b(?:no|lacks?|lacking|missing|without|has no)\b[^.\n]{0,40}\b(?:tests?|coverage|covered)\b/i,
29
- /\b(?:should|needs?|must|requires?)\b[^.\n]{0,40}\b(?:tests?|coverage)\b/i,
30
- /\buntested\b/i,
31
- /\bnot covered\b/i,
32
- ],
35
+ evidence: missingCoverage,
33
36
  },
34
37
  ];
35
38
 
36
39
  const decoys = [
37
40
  { id: 'c-style-loop', anchor: /order\.js/, evidence: [/\b2[23]\b/] },
38
- { id: 'percentoff', anchor: /money\.js/, evidence: [/percentOff/] },
41
+ // percentOff's calculation is correct, but its missing tests violate SPEC §2.
42
+ {
43
+ id: 'percentoff',
44
+ anchor: /money\.js.*percentOff|percentOff.*money\.js/,
45
+ evidence: [
46
+ /\b(?:incorrectly|wrongly)\s+(?:calls?|uses?|rounds?|calculates?|computes?|returns?)\b/i,
47
+ /\b(?:double[- ]rounds?|rounds?\s+(?:again|twice))\b/i,
48
+ /\b(?:should(?: not)?|must(?: not)?|does not|doesn't|fails? to)\s+(?:round|(?:call|use)\s+`?roundCents)\b/i,
49
+ /\b(?:returns?|uses?|calls?|rounds?|computes?|calculates?|is|has)\s+(?:(?:the|an?)\s+)?(?:wrong|incorrect|broken|buggy)\b/i,
50
+ /(?:重复|多次|两次|错误地|不应(?:该)?)(?:调用|使用|舍入|计算)/,
51
+ /(?:计算|舍入|百分比|公式)(?:错误|有误|有问题|不正确)/,
52
+ ],
53
+ },
39
54
  ];
40
55
 
41
56
  const outputPath = path.join(runDir, '_output.md');
@@ -3,6 +3,8 @@ import { existsSync, readFileSync } from "node:fs";
3
3
  import { dirname, isAbsolute, resolve } from "node:path";
4
4
  import { killTree, treeSpawnOptions } from "../shared/process-tree.js";
5
5
  import { VERSION } from "../shared/version.js";
6
+ import { resolveAgentPath } from "./environment.js";
7
+ import { getAgent } from "./matrix.js";
6
8
  const PROTOCOL_VERSION = "2025-11-25";
7
9
  const DEFAULT_TIMEOUT_MS = 10_000;
8
10
  const MAX_BUFFER_BYTES = 4 * 1024 * 1024;
@@ -22,17 +24,7 @@ function stringRecord(value, label) {
22
24
  throw new Error(`${label} values must be strings`);
23
25
  return record;
24
26
  }
25
- export function loadMcpProbeSpec(path) {
26
- const absolute = resolve(path);
27
- if (!existsSync(absolute))
28
- throw new Error(`MCP probe spec not found: ${absolute}`);
29
- let value;
30
- try {
31
- value = JSON.parse(readFileSync(absolute, "utf8"));
32
- }
33
- catch (error) {
34
- throw new Error(`Invalid MCP probe spec JSON: ${error.message}`);
35
- }
27
+ export function parseMcpProbeSpec(value, baseDir) {
36
28
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
37
29
  throw new Error("MCP probe spec must contain a JSON object");
38
30
  }
@@ -81,7 +73,7 @@ export function loadMcpProbeSpec(path) {
81
73
  const cwdValue = record["cwd"];
82
74
  if (cwdValue !== undefined && typeof cwdValue !== "string")
83
75
  throw new Error("MCP probe spec cwd must be a string");
84
- const base = dirname(absolute);
76
+ const base = baseDir;
85
77
  const cwd = cwdValue === undefined ? base : isAbsolute(cwdValue) ? cwdValue : resolve(base, cwdValue);
86
78
  return {
87
79
  schemaVersion: 1,
@@ -94,6 +86,111 @@ export function loadMcpProbeSpec(path) {
94
86
  timeoutMs,
95
87
  };
96
88
  }
89
+ export function loadMcpProbeSpec(path) {
90
+ const absolute = resolve(path);
91
+ if (!existsSync(absolute))
92
+ throw new Error(`MCP probe spec not found: ${absolute}`);
93
+ let value;
94
+ try {
95
+ value = JSON.parse(readFileSync(absolute, "utf8"));
96
+ }
97
+ catch (error) {
98
+ throw new Error(`Invalid MCP probe spec JSON: ${error.message}`);
99
+ }
100
+ return parseMcpProbeSpec(value, dirname(absolute));
101
+ }
102
+ export function selectAgentMcpProbe(options) {
103
+ const agent = getAgent(options.agent);
104
+ const scope = options.project ? "project" : "user";
105
+ const context = { homeDir: options.homeDir, cwd: options.cwd, env: options.env ?? {} };
106
+ const sourcePaths = [
107
+ ...new Set((options.project ? agent.mcp.projectFiles : agent.mcp.userFiles).map((path) => resolveAgentPath(path, context))),
108
+ ].filter((path) => existsSync(path));
109
+ if (sourcePaths.length === 0)
110
+ throw new Error(`No ${scope} MCP configuration exists for ${agent.displayName}; no server was started or contacted.`);
111
+ if (agent.mcp.format !== "json-mcpServers")
112
+ throw new Error(`Native ${agent.displayName} MCP format "${agent.mcp.format}" is not supported by real-config mcp check yet; use an explicit probe spec. No server was started or contacted.`);
113
+ const matches = [];
114
+ for (const sourcePath of sourcePaths) {
115
+ let document;
116
+ try {
117
+ document = JSON.parse(readFileSync(sourcePath, "utf8"));
118
+ }
119
+ catch {
120
+ throw new Error(`Invalid JSON MCP configuration at ${sourcePath}; no server was started or contacted.`);
121
+ }
122
+ if (typeof document !== "object" || document === null || Array.isArray(document))
123
+ throw new Error(`MCP configuration at ${sourcePath} must contain a JSON object.`);
124
+ const servers = document["mcpServers"];
125
+ if (servers === undefined)
126
+ continue;
127
+ if (typeof servers !== "object" || servers === null || Array.isArray(servers))
128
+ throw new Error(`MCP configuration at ${sourcePath} requires an mcpServers object.`);
129
+ if (!Object.hasOwn(servers, options.server))
130
+ continue;
131
+ const raw = servers[options.server];
132
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw))
133
+ throw new Error(`MCP server "${options.server}" at ${sourcePath} must be an object.`);
134
+ const entry = raw;
135
+ const supportedFields = new Set([
136
+ "type",
137
+ "transport",
138
+ "command",
139
+ "args",
140
+ "env",
141
+ "cwd",
142
+ "url",
143
+ "headers",
144
+ "enabled",
145
+ "disabled",
146
+ "timeoutMs",
147
+ ]);
148
+ const unknownFields = Object.keys(entry).filter((field) => !supportedFields.has(field));
149
+ if (unknownFields.length > 0)
150
+ throw new Error(`MCP server "${options.server}" has unsupported field(s): ${unknownFields.join(", ")}; no server was started or contacted.`);
151
+ if (entry["enabled"] === false || entry["disabled"] === true)
152
+ throw new Error(`MCP server "${options.server}" is disabled; no server was started or contacted.`);
153
+ if ((entry["enabled"] !== undefined && typeof entry["enabled"] !== "boolean") ||
154
+ (entry["disabled"] !== undefined && typeof entry["disabled"] !== "boolean"))
155
+ throw new Error(`MCP server "${options.server}" enabled/disabled fields must be boolean.`);
156
+ const hasCommand = entry["command"] !== undefined;
157
+ const hasUrl = entry["url"] !== undefined;
158
+ if (hasCommand === hasUrl)
159
+ throw new Error(`MCP server "${options.server}" needs exactly one of command or url.`);
160
+ const transport = hasUrl ? "http" : "stdio";
161
+ const declaredTransport = entry["transport"] ?? entry["type"];
162
+ if (declaredTransport !== undefined &&
163
+ declaredTransport !== transport &&
164
+ !(transport === "http" && declaredTransport === "streamable-http"))
165
+ throw new Error(`MCP server "${options.server}" declares an incompatible transport/type.`);
166
+ const common = {
167
+ schemaVersion: 1,
168
+ name: options.server,
169
+ transport,
170
+ ...(entry["timeoutMs"] === undefined ? {} : { timeoutMs: entry["timeoutMs"] }),
171
+ };
172
+ const value = transport === "http"
173
+ ? { ...common, url: entry["url"], headers: entry["headers"] }
174
+ : {
175
+ ...common,
176
+ command: entry["command"],
177
+ args: entry["args"],
178
+ env: entry["env"],
179
+ cwd: entry["cwd"],
180
+ };
181
+ matches.push({
182
+ spec: parseMcpProbeSpec(value, dirname(sourcePath)),
183
+ entry,
184
+ sourcePath,
185
+ scope,
186
+ });
187
+ }
188
+ if (matches.length === 0)
189
+ throw new Error(`MCP server "${options.server}" was not found in the selected ${scope} ${agent.displayName} configuration; no server was started or contacted.`);
190
+ if (matches.length > 1)
191
+ throw new Error(`MCP server "${options.server}" has ambiguous ${scope} definitions: ${matches.map((match) => match.sourcePath).join(", ")}`);
192
+ return matches[0];
193
+ }
97
194
  function windowsSpawn(command, args) {
98
195
  if (process.platform !== "win32")
99
196
  return { command, args, shell: false };
@@ -289,8 +386,36 @@ export async function probeMcpHttp(spec) {
289
386
  }
290
387
  throw new Error("MCP tools/list pagination did not terminate");
291
388
  }
389
+ function mcpSecretValues(spec) {
390
+ const values = new Set();
391
+ for (const value of Object.values(spec.transport === "stdio" ? (spec.env ?? {}) : (spec.headers ?? {}))) {
392
+ if (value !== "")
393
+ values.add(value);
394
+ }
395
+ if (spec.transport === "http") {
396
+ const url = new URL(spec.url);
397
+ for (const value of [url.username, url.password, ...url.searchParams.values()]) {
398
+ if (value !== "") {
399
+ values.add(value);
400
+ values.add(encodeURIComponent(value));
401
+ }
402
+ }
403
+ }
404
+ return [...values].sort((a, b) => b.length - a.length);
405
+ }
406
+ function redactMcpText(text, secrets) {
407
+ return secrets.reduce((result, secret) => result.split(secret).join("<REDACTED>"), text);
408
+ }
292
409
  export async function probeMcp(spec) {
293
- return spec.transport === "http" ? probeMcpHttp(spec) : probeMcpStdio(spec);
410
+ const secrets = mcpSecretValues(spec);
411
+ try {
412
+ const result = await (spec.transport === "http" ? probeMcpHttp(spec) : probeMcpStdio(spec));
413
+ return { ...result, stderr: redactMcpText(result.stderr, secrets) };
414
+ }
415
+ catch (error) {
416
+ const message = error instanceof Error ? error.message : String(error);
417
+ throw new Error(redactMcpText(message, secrets));
418
+ }
294
419
  }
295
420
  export async function probeMcpStdio(spec) {
296
421
  if (spec.transport !== "stdio")
@@ -608,12 +608,20 @@ function gitRun(repo, args) {
608
608
  encoding: "utf8",
609
609
  maxBuffer: 64 * 1024 * 1024,
610
610
  });
611
- return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
611
+ return { ...result, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
612
612
  }
613
613
  function gitMust(repo, args) {
614
614
  const result = gitRun(repo, args);
615
615
  if (result.status !== 0) {
616
- throw new Error(`git ${args.join(" ")} failed in ${repo}: ${result.stderr.trim() || `exit ${result.status}`}`);
616
+ const details = [
617
+ result.stderr.trim(),
618
+ `exit ${result.status}`,
619
+ result.error ? String(result.error) : "",
620
+ result.signal ? `signal ${result.signal}` : "",
621
+ ]
622
+ .filter(Boolean)
623
+ .join(", ");
624
+ throw new Error(`git ${args.join(" ")} failed in ${repo}: ${details}`);
617
625
  }
618
626
  return result.stdout;
619
627
  }