@christang/keel 5.1.1 → 5.2.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.
Files changed (33) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +114 -158
  3. package/README.zh-CN.md +118 -197
  4. package/assets/bootstrap/AGENTS.md +1 -1
  5. package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/hardware-dsl.md +4 -2
  6. package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/hardware.md +4 -2
  7. package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/web.md +4 -2
  8. package/assets/openspec/schemas/keel-spec-driven/schema.yaml +172 -166
  9. package/assets/openspec/schemas/keel-spec-driven/templates/tasks.md +13 -4
  10. package/bin/keel.js +218 -15
  11. package/package.json +1 -1
  12. package/plugins/keel/.claude-plugin/plugin.json +1 -1
  13. package/plugins/keel/.codex-plugin/plugin.json +1 -1
  14. package/plugins/keel/hooks/hooks.json +30 -30
  15. package/plugins/keel/scripts/pretooluse-guard.js +156 -156
  16. package/plugins/keel/scripts/session-start.js +182 -182
  17. package/plugins/keel/skills/keel-align-expectations/SKILL.md +2 -6
  18. package/plugins/keel/skills/keel-debug-failure/SKILL.md +2 -2
  19. package/plugins/keel/skills/keel-review-checklist/SKILL.md +2 -2
  20. package/plugins/keel/skills/keel-tdd-or-test-first/SKILL.md +2 -2
  21. package/scripts/bump_version.js +140 -0
  22. package/scripts/install_to_repo.py +0 -70
  23. package/scripts/run_python.js +63 -63
  24. package/scripts/validate_plugin.py +408 -96
  25. package/src/core/capabilities.js +291 -291
  26. package/src/core/context.js +521 -514
  27. package/src/core/gates.js +664 -643
  28. package/src/core/goal.js +230 -230
  29. package/src/core/guard.js +295 -295
  30. package/src/core/helper.js +319 -319
  31. package/src/core/projection.js +195 -195
  32. package/src/core/task-contract.js +757 -736
  33. package/src/core/tasksview.js +123 -123
package/README.zh-CN.md CHANGED
@@ -8,71 +8,59 @@
8
8
  ![Node](https://img.shields.io/badge/node-%3E%3D20.19.0-brightgreen.svg)
9
9
  ![Targets](https://img.shields.io/badge/targets-Claude%20Code%20%C2%B7%20Codex%20%C2%B7%20OpenCode-blue.svg)
10
10
 
11
- Keel 在 [OpenSpec](https://github.com/fission-ai/openspec) 之上加一层轻量、确定性的执行纪律,
12
- 让编码 agent 在**稳定、可校验的边界**内完成「判断 → 设计 → 执行 → review → 交接」,
13
- 而不是中途跑偏或在会话之间丢失上下文。
14
-
15
- Keel **无状态**:每次会话都从你的 OpenSpec artifacts 和 Git 重新推导「现在该做什么」,
16
- 绝不依赖隐藏的对话记忆、transcript 或某个存下来的「当前任务」。这让 agent 的工作可恢复、
17
- 可审计,并且能安全地在不同 runtime 之间交接。
18
-
19
- > 这是完整中文手册。速览请看英文 [README](README.md)。
20
-
21
- ---
22
-
23
- ## 为什么用 Keel
24
-
25
- - **确定性门禁,而不是凭感觉。** `keel gate task-start | task-complete | change-close`
26
- 做本地、无模型的结构检查,返回 `pass` / `fail` / `needs-review` 和真实退出码。它们从不声称
27
- 判断你的设计是否*正确*——只判断契约与证据是否齐备。
28
- - **真正的写入守卫(Claude)。** 通过的 `task-start` 会落下一次性 manifest,插件的 `PreToolUse`
29
- hook 随后**确定性拒绝**任何超出任务声明 `Touch` 范围的 `Edit`/`Write`——把「请别越界」从
30
- 祈祷变成执法。
31
- - **无状态连续性。** `keel context` 每次都从 OpenSpec + Git 重建选中任务、下一步动作和最小读取
32
- 列表。能扛住 compaction、`/clear` 和冷启动。`keel/HANDOFF.md` 只作为可选的、经校验的覆盖存在。
33
- - **写代码前先对齐预期。** `keel-align-expectations` 在 specs/tasks 定稿*之前*对齐隐性假设——
34
- 风险触发的 deep path 一次只问一个材料性决策,并把接受的答案写回 OpenSpec。
35
- - **单任务原生目标执行。** 授权 agent 自动执行**恰好一个** OpenSpec task——带指纹化 capsule、
36
- 硬停边界,没有隐藏调度器替你选下一个任务。
37
- - **一套纪律,三个 runtime。** 同一协议在 Claude Code、Codex、OpenCode 上运行;执行技能与 hook
38
- 以原生插件分发。
39
-
40
- ---
41
-
42
- ## 工作流程
43
-
44
- ```mermaid
45
- flowchart LR
46
- A[keel --init] --> B[keel context]
47
- B --> C[proposal / design / specs / tasks]
48
- C --> D[keel-align-expectations]
49
- D --> E[/opsx:apply → 选一个 task/]
50
- E --> F[task-start<br/>+ 写入守卫]
51
- F --> G[实现 · 测试先行 · 验证]
52
- G --> H[keel-review-checklist]
53
- H --> I[task-complete]
54
- I --> J[/opsx:sync · /opsx:archive/]
55
- ```
11
+ ## Keel 是做什么的
56
12
 
57
- OpenSpec 拥有持久 artifacts(proposal、design、specs、tasks、archive);Keel 拥有它们周围的
58
- *执行纪律*:模式路由、任务 capsule 契约、确定性门禁、写入守卫、连续性、review 和交接卫生。
13
+ [OpenSpec](https://github.com/fission-ai/openspec) 给项目一套 spec 驱动的工作流:proposal、
14
+ design、specs、tasks,以及记录改动的 archive。Claude Code(或 Codex)提供干活的 agent。
15
+ Keel 夹在两者中间,在 agent 走完一个 OpenSpec change 的过程中盯住它别跑偏。
59
16
 
60
- ---
17
+ 放任不管时,agent 容易漂移:改了任务没提到的文件、上下文重置后丢了线索、或者没有证据就把活
18
+ 勾成完成。Keel 加的是一层轻量、可校验的约束来防止这些,而且它尽量复用你已有的能力,而不是另造
19
+ 一套。
61
20
 
62
- ## 环境要求
21
+ Keel 加的东西:
63
22
 
64
- - **Node.js `>=20.19.0`**(内置的 OpenSpec CLI 要求此版本;更低版本可能触发 `EBADENGINE`)。
23
+ - **无状态连续性**:`keel context` 每次会话都从 OpenSpec Git 重算当前任务和下一步,所以工作
24
+ 能扛住 `/clear`、compaction 和冷启动,不依赖对话记忆。
25
+ - **确定性门禁**:`keel gate task-start | task-complete | change-close` 做本地结构检查,返回
26
+ `pass` / `fail` / `needs-review` 和真实退出码。它们只检查任务契约和证据是否齐备,不判断设计对错。
27
+ - **写入守卫(Claude)**:`task-start` 之后,`PreToolUse` hook 会拒绝任何超出任务声明改动范围的
28
+ 文件编辑。
29
+ - **预期对齐**:在 specs 和 tasks 定稿前,Keel 把隐性假设摆出来,只针对真正会改变行为的那些提问。
65
30
 
66
- ---
31
+ Keel 尽量借力原生能力,而不是重造。spec 工作流就是原生 OpenSpec;执行技能、SessionStart 连续性
32
+ hook 和写入守卫 hook 都以一个普通的 Claude Code / Codex 插件分发。`keel --init` 只往你的 repo 里
33
+ 写一小块宿主面:`AGENTS.md` bootstrap 块、OpenSpec schema,以及 `/opsx:*` 命令的 Keel overlay。
34
+
35
+ ## 环境要求
36
+
37
+ Node.js `>=20.19.0`(内置的 OpenSpec CLI 需要)。
67
38
 
68
39
  ## 安装
69
40
 
70
- Keel 有两个可安装部分:**`keel` CLI**(context、gates、guard、schema、安装)和
71
- **`keel` 插件**(执行技能 + 运行时 hook)。
41
+ 两部分:`keel` CLI 和 `keel` 插件。
72
42
 
73
- ### 1. `keel` CLI
43
+ **CLI** —— 一条命令(同时装上捆绑的 OpenSpec CLI):
74
44
 
75
- 从 GitHub 打包后全局安装,避免与已有全局旧包在 Git 依赖准备阶段冲突,并会一并装上 OpenSpec CLI。
45
+ ```bash
46
+ npm install -g @christang/keel
47
+ keel --version
48
+ ```
49
+
50
+ **插件** —— 执行技能和运行时 hook:
51
+
52
+ ```bash
53
+ claude plugin install keel@<marketplace> # Claude Code
54
+ codex plugin add keel@<marketplace> # Codex
55
+ ```
56
+
57
+ > 捆绑的 OpenSpec 依赖在安装时会打印一行 opt-in 的 shell 补全提示。如果你的 npm 拦截安装脚本,
58
+ > 这行提示会被跳过,它纯属装饰,keel 照常工作。
59
+
60
+ <details>
61
+ <summary>从 GitHub 安装最新未发布版本</summary>
62
+
63
+ 打包当前 `main` 并安装该 tarball(跳过 npm registry):
76
64
 
77
65
  **Windows(PowerShell):**
78
66
 
@@ -93,101 +81,65 @@ npm pack github:TanglmChris/keel --pack-destination "$tmp_dir"
93
81
  npm install -g "$tmp_dir"/christang-keel-*.tgz
94
82
  rm -rf "$tmp_dir"
95
83
  ```
84
+ </details>
96
85
 
97
- 验证版本,之后可用 `keel --update` 自更新:
98
-
99
- ```bash
100
- keel --version
101
- keel --update # 重新打包 + 重装全局 CLI
102
- keel --update --dry-run # 先看将执行的 npm 命令
103
- ```
104
-
105
- ### 2. `keel` 插件(技能 + hook)
86
+ ## 怎么用
106
87
 
107
- 执行技能(`keel-*`)和运行时 hook(SessionStart 连续性、PreToolUse 写入守卫)以原生插件分发,
108
- **不会**被 `keel --init` 复制进你的 repo:
109
-
110
- ```bash
111
- claude plugin install keel@<marketplace> # Claude Code
112
- codex plugin add keel@<marketplace> # Codex
113
- ```
114
-
115
- ---
116
-
117
- ## 快速开始
118
-
119
- 在目标项目根目录:
88
+ 在项目根目录,先设置一次:
120
89
 
121
90
  ```bash
122
91
  keel --init # 默认 target:claude
123
- keel --init --target codex
124
- keel --init --target opencode
92
+ keel --init --target codex # 或 opencode
125
93
  ```
126
94
 
127
- `keel --init` 会运行 OpenSpec 初始化/更新并安装 Keel 的精简宿主面。之后每次开始或恢复工作:
95
+ `keel --init` 会跑 OpenSpec 初始化/更新,并写入 Keel 的宿主面。之后每次开始或恢复工作:
128
96
 
129
97
  ```bash
130
- keel context # keel context --json
98
+ keel context # 现在该做什么,从 OpenSpec + Git 重算
99
+ keel --doctor # 检查各部分是否就位
131
100
  ```
132
101
 
133
- 它返回 `ready` / `ambiguous` / `blocked` / `idle`,附带 selection、下一动作和最小读取列表。
134
- 随时检查完整就绪状态:
102
+ spec 相关的活走 OpenSpec 的命令(`/opsx:propose`、`/opsx:apply`、`/opsx:sync`、`/opsx:archive`),
103
+ Keel 的门禁在任务边界处运行。整个回路:
135
104
 
136
- ```bash
137
- keel --doctor
105
+ ```
106
+ keel --init → keel context → /opsx:apply(选一个 task)
107
+ → task-start(+ 写入守卫) → 实现并验证
108
+ → task-complete → /opsx:sync · /opsx:archive
138
109
  ```
139
110
 
140
- ### `--init` 会写入什么
141
-
142
- `keel --init` / `--install` 只保留**精简宿主面**——不复制技能或 hook(那些来自插件):
143
-
144
- - `AGENTS.md` —— Keel bootstrap 块(所有 target)
145
- - `CLAUDE.md` —— `@AGENTS.md` import 块(Claude target)
146
- - `openspec/config.yaml` —— 设置 `schema: keel-spec-driven`
147
- - `openspec/schemas/keel-spec-driven/` —— Keel 强化过的 OpenSpec schema
148
- - 以及 OpenSpec 生成并叠加 Keel overlay 的 `/opsx:*` 命令面
149
-
150
- 若目标 repo 里存在旧版打包的 `keel-*` skill、`keel-adapter.js` 或 `keel-gate` hook,
151
- `--install` 会迁移它们:与旧打包字节一致的副本被移除并提示改由原生插件提供,用户改过的副本
152
- 原样保留并给出手动迁移警告。
153
-
154
- ---
155
-
156
- ## 目标(Targets)
157
-
158
- | target | 初始化命令 | 命令面 |
159
- | --- | --- | --- |
160
- | Claude Code | `keel --init` | `.claude/commands/opsx/*.md` + 插件 hook(SessionStart、PreToolUse 守卫) |
161
- | Codex | `keel --init --target codex` | 全局 `CODEX_HOME/prompts/opsx-*.md` |
162
- | OpenCode | `keel --init --target opencode` | 项目内 `.opencode/commands/opsx-*.md` |
163
-
164
- 一个 repo 通常固定一个 target,后续 `--install` / `--check` / `--doctor` / `--uninstall` 都用它。
165
- 能力**按可观察证据探测,不按 target 名字假定**——无法验证的运行时行为报告为 `manual`,而非 `enforced`。
111
+ ### Full / Lite
166
112
 
167
- ---
113
+ **Full 模式**(上面的 OpenSpec 流程)用于新功能、接口或协议变更、跨模块,或超过约 3 文件 / 100 行
114
+ 的改动。被接受的原生 `plan mode` 产物只是会话态:其中影响 scope、完成定义或执行边界的决策,必须
115
+ 在实现前固化到 `proposal/design/specs/tasks`,session plan 本身不是执行权威。
168
116
 
169
- ## Full / Lite 模式
117
+ **Lite 模式**用于局部小改:单点修复、小脚本、文档或补测试,不改接口、影响可局部证明;Lite 默认不
118
+ 写 OpenSpec 状态。
170
119
 
171
- **Full 模式**——新功能、对外接口变更、跨模块、改动超过 3 文件 / 100 行、架构或协议/状态机决策,
172
- 或任何触及信号、reset、CDC、安全边界的硬件工作。Full 模式用 OpenSpec 走
173
- proposal → design → specs → tasks → archive。
120
+ ## 这些命令,agent 是怎么用起来的
174
121
 
175
- 被接受的原生 `plan mode` 产物只是会话态:其中影响 scope、Acceptance、完成定义或执行边界的决策,
176
- 必须在进入实现前固化到 `proposal/design/specs/tasks`;session plan 永远不是执行权威(review
177
- checklist 会检查这条通道)。
122
+ 下面这些命令你几乎不用手敲。Keel 的意义在于纪律会自己跑起来:`keel --init` 把它装进 agent 的
123
+ 工作流,agent 会在恰当的时刻去调用每一条命令。让这件事成立的有三样东西。
178
124
 
179
- **Lite 模式**——仅限局部小改:单点修复、小脚本、文档或补测试,不改对外接口、不加依赖、不引入新
180
- 设计决策、影响面可局部证明。Lite 默认不写 OpenSpec 状态。
125
+ - **协议**:`keel --init` 会往你 repo 的 `AGENTS.md` 写一段 bootstrap 块(在 Claude 上由
126
+ `CLAUDE.md` 引入)。它把 agent 要遵守的规则讲清楚:每次会话先跑 `keel context`、在任务边界处过
127
+ 门禁、只在任务声明的写入范围内改文件。这就是 agent 知道**何时**用哪条命令的来源。
128
+ - **技能**:`keel-*` 执行技能和 `/opsx:*` 命令 overlay 带着 agent 走「对齐 → apply → review →
129
+ 完成」,每一步按需调用门禁。
130
+ - **hook**:SessionStart hook 在会话打开的那一刻自动跑连续性投影;PreToolUse hook 在每次编辑时
131
+ 执行写入守卫。两者都不需要任何提示。
181
132
 
182
- ---
133
+ 所以日常使用里你真正要敲的只有两条:装配时的 `keel --init`,以及想体检时的 `keel --doctor`。
134
+ 下面列出的,是 agent 替你使用的「命令词汇表」。
183
135
 
184
- ## 核心命令
136
+ ## 命令参考
185
137
 
186
138
  ```bash
187
- # 连续性 —— 无状态地重算「现在该做什么」
139
+ # 连续性 —— 无状态重算「现在该做什么」
188
140
  keel context [--json] [--change <c> --task <t>]
189
141
 
190
- # 确定性门禁(schemaVersion 1 → pass | fail | needs-review
142
+ # 确定性门禁 → pass | fail | needs-review
191
143
  keel gate task-start --change <c> --task <t> --json
192
144
  keel gate task-complete --change <c> --task <t> [--base <git-ref>] --json
193
145
  keel gate change-close --change <c> --action sync|archive --json
@@ -197,99 +149,68 @@ keel guard start --change <c> --task <t> --json
197
149
  keel guard status --json
198
150
  keel guard clear --json
199
151
 
200
- # 一次性原生投影(视图,永不是权威)
201
- keel project --target claude --event resume --change <c> --task <t> --json
202
- keel project tasks [repo] --target claude [--change <c>] [--json]
152
+ # 一次性原生投影(只读视图,永不是权威)
153
+ keel project tasks --target claude [--change <c>] [--json]
203
154
  keel project --target codex --event compaction --json
204
155
 
205
156
  # 安装 / 维护
206
- keel --init | --install | --check | --doctor | --uninstall [--target <t>] [--dry-run]
157
+ keel --init | --install | --check | --doctor | --uninstall [--target <t>] [--dry-run]
207
158
  keel --update [--dry-run]
208
159
  keel --version | --help
209
160
  ```
210
161
 
211
- 退出码:`0` 通过 · `3` 确定性策略失败 · `4` 缺少语义 review · `1` 输入/解析故障。
212
-
213
- ### 写入守卫(Claude target)
162
+ 退出码:`0` 通过 · `3` 策略失败 · `4` 缺少语义 review · `1` 输入/解析故障。
214
163
 
215
- Touch 是唯一写权限来源。通过的 `keel gate task-start` 默认写入一次性守卫 manifest
216
- (`keel guard start` 显式激活、`keel guard clear` 停止执法、`--no-guard` 退出默认激活)。
217
- 守卫激活期间,插件的 `PreToolUse` hook 确定性拒绝 Touch 之外的文件编辑,并带出精确路径与恢复命令:
218
-
219
- - manifest 记录 change/task、capsule 指纹、规范化 Touch 和权威文件哈希,存于 `guard.json`;
220
- 失败即关闭(fail-closed):损坏、哈希漂移、指纹不匹配或 task 已勾选时一律拒绝。
221
- - 守卫只覆盖文件编辑工具;`Bash` 等间接写入仍属纪律约束,仓库外的临时/scratch 路径直接放行。
164
+ 能力按可观察证据探测,不按 target 名字假定:无法验证的运行时行为报告为 `manual`,而非 `enforced`。
165
+ 一个 repo 固定一个 target,后续 `--install` / `--check` / `--doctor` / `--uninstall` 都用它。
222
166
 
223
- ### 一次性原生投影
167
+ ### 写入守卫
224
168
 
225
- `keel project` 从当前 OpenSpec task 编译一次性视图(objective、Acceptance、Stop 边界、Read、Touch、
226
- evidence contract),永远只是投影、不是权威,也不勾选复选框:
169
+ Touch 是唯一写权限来源。通过的 `keel gate task-start` 默认写入一次性守卫 manifest
170
+ (`keel guard start` 显式激活、`keel guard clear` 停止执法、`--no-guard` 退出默认激活)。守卫
171
+ 激活时,`PreToolUse` hook 确定性拒绝 Touch 之外的文件编辑,并给出精确路径和恢复命令:
227
172
 
228
- - `keel project tasks --target claude` 把选中 change 的 tasks.md 编译成只读清单视图,由当前 agent
229
- 自行决定是否手动镜像到宿主任务 UI;只读、不落盘、无同步循环。
230
- - compaction 后手动重注入:`keel project --target codex --event compaction --json`。
173
+ - manifest 记录 change/task、capsule 指纹、规范化 Touch 和权威文件哈希,存于 `guard.json`,
174
+ fail-closed:损坏、哈希漂移、指纹不匹配或 task 已勾选时一律拒绝。
175
+ - 守卫只覆盖文件编辑工具;`Bash` 等间接写入仍受纪律约束,仓库外的临时路径直接放行。
231
176
 
232
- ---
177
+ ### 一次性投影
233
178
 
234
- ## 对齐与纪律
179
+ `keel project tasks --target claude` 把选中 change 的 tasks.md 编译成只读清单视图,由当前 agent
180
+ 自行决定是否手动镜像到宿主任务 UI,只读、不落盘、无同步循环。compaction 后可手动重注入:
181
+ `keel project --target codex --event compaction --json`。
235
182
 
236
- - **`keel-align-expectations`**:SPEC 前的隐性知识风险用 risk-triggered deep alignment(一次一个
237
- 决策、给推荐答案),而不是对所有 Full change 强制问卷;先查仓库事实再问用户,接受的结论写回
238
- proposal/design/specs/tasks。v5 已退役旧的 grill 问答技能,深度对齐统一由该技能承担。
239
- - **执行/review 阶段的领域引用**:web / hardware / hardware-dsl 三个 reference 各带一节
240
- `Execution and review checks`;当变更 artifacts 或 Touch 扩展名显示对应领域信号时,
241
- `keel-tdd-or-test-first`、`keel-debug-failure`、`keel-review-checklist` 会按需查阅——仍然只
242
- 加载匹配的那一个。
243
- - **Dedicated Skill Policy**:新增或实质扩展专门技能时,先研究 first-party 或其他 authoritative source
244
- 并记录 provenance/license 影响;用真实的 `should-trigger` 与近邻 `should-not-trigger`
245
- 提示验证 description,并至少通过一个 real task 验证程序性行为;以 `src/skills/<name>/SKILL.md`
246
- 为唯一 portable 权威,target metadata 只是 additive adapter,discovery 与激活仍由 target-native
247
- runtime 负责。
183
+ ## 对齐与技能纪律
248
184
 
249
- `/opsx:sync`、`/opsx:archive` 的完成门禁由确定性的 `keel gate change-close`
250
- `keel-review-checklist` 承担,不再由运行时 hook 执行(该门禁在所有 target 上能力为 `manual`)。
185
+ - **`keel-align-expectations`**:specs/tasks 定稿前用风险触发的 deep alignment(一次一个决策、给
186
+ 推荐答案)对齐隐性假设,而不是对所有 Full change 强制问卷;先查仓库事实再问用户,接受的结论写回
187
+ `proposal/design/specs/tasks`。
188
+ - **可插拔领域透镜**:keel 核心只保留机制,透镜内容由用户自己写在仓库的 `keel/lenses/*.md`。每份透镜
189
+ 自描述——开头一行 `Applies when:` 声明触发信号,并含一节 `Execution and review checks`。当变更
190
+ artifacts 或 Touch 扩展名匹配某份透镜的 `Applies when:` 时,`keel-align-expectations`、
191
+ `keel-tdd-or-test-first`、`keel-debug-failure`、`keel-review-checklist` 按需只加载匹配的那一份,
192
+ 没有匹配就不加载。`keel lenses list` 查看内置模板与已安装透镜;`keel lenses add web` 把内置模板
193
+ (web / hardware / hardware-dsl,随包放在 `assets/lenses/`)落到 `keel/lenses/` 后自行改写,
194
+ 已存在时需 `--force` 才覆盖。
195
+ - **专门技能政策**:新增或实质扩展技能前,先研究 first-party 或其他 authoritative source 并记录
196
+ provenance/license;用真实的 should-trigger 与近邻 `should-not-trigger` 用例验证 description,
197
+ 并至少通过一个 real task;以 `src/skills/<name>/SKILL.md` 为唯一可移植权威,target metadata 只是
198
+ 附加适配,discovery 与激活由 target-native runtime 负责。
251
199
 
252
- ---
200
+ `/opsx:sync`、`/opsx:archive` 的完成门禁由 `keel gate change-close` 加 `keel-review-checklist`
201
+ 承担,不再由运行时 hook 执行(在所有 target 上能力为 `manual`)。
253
202
 
254
- ## 开发与校验
203
+ ## 开发
255
204
 
256
- 无构建步骤。`src/skills/` 是可移植技能的唯一维护源;`plugins/keel/skills/` 等分发副本必须与源
257
- 字节一致(由校验强制)。修改后同步副本,然后运行:
205
+ 无构建步骤。`src/skills/` 是可移植技能的唯一维护源,`plugins/keel/skills/` 等分发副本必须与源
206
+ 字节一致(由校验强制)。
258
207
 
259
208
  ```bash
260
- npm run validate # baseline 校验
261
- npm test # baseline + 全部场景并行(约 25s)
262
-
263
- # 单场景调试
264
- node scripts/run_python.js scripts/validate_plugin.py --scenario core-gates
265
- node scripts/run_python.js scripts/validate_plugin.py --all --jobs 4
266
- ```
267
-
268
- `npm test` 是一条 `validate_plugin.py --all` 调用:先跑 baseline,再按内置 scenario registry
269
- 并行跑全部场景(`--jobs N` 控制并发,默认 CPU 数),fail-loud 而非 fail-fast。新增场景只需写
270
- `validate_<name>_scenario()` 并加入 registry。
271
-
272
- ### 目录结构
273
-
274
- ```text
275
- bin/keel.js # 跨平台 keel CLI
276
- src/core/ # 无状态 Keel Core(context、gates、guard、goal、helper、projection)
277
- src/skills/ # 可移植技能的唯一维护源(含 keel-align-expectations/references)
278
- plugins/keel/ # 原生插件(.claude-plugin / .codex-plugin、hooks、skills)
279
- assets/bootstrap/AGENTS.md # managed bootstrap 块的唯一权威源
280
- assets/openspec/ # OpenSpec schema 资产
281
- scripts/ # install_to_repo.py、validate_plugin.py、run_python.js
282
- openspec/ # 本仓库自身的 OpenSpec 工作区
283
- keel/ # 项目本地 Keel 状态(CHANGELOG、archive)
209
+ npm test # 一条 validate_plugin.py --all 调用:baseline + 全部场景并行(--jobs N 控制并发)
210
+ node scripts/run_python.js scripts/validate_plugin.py --scenario core-gates # 单场景调试
211
+ node scripts/bump_version.js <patch|minor|major> # 一次改齐所有版本 pin
284
212
  ```
285
213
 
286
- ---
287
-
288
- ## 文档
289
-
290
- - **[English README](README.md)** —— 速览与安装。
291
- - **[keel/CHANGELOG.md](keel/CHANGELOG.md)** —— 版本历史。
292
-
293
214
  ## License
294
215
 
295
- [MIT](LICENSE) © 2026 TanglmChris
216
+ [MIT](LICENSE) © 2026 TanglmChris · 版本历史见 [keel/CHANGELOG.md](keel/CHANGELOG.md)。
@@ -1,4 +1,4 @@
1
- <!-- keel:start version=5.1.1 -->
1
+ <!-- keel:start version=5.2.0 -->
2
2
  ## Keel Bootstrap
3
3
 
4
4
  - Start every session with `keel context`; OpenSpec artifacts and Git are the only durable authority — never native memory, goals, or transcripts.
@@ -1,6 +1,8 @@
1
- # Hardware DSL alignment reference
1
+ # Hardware DSL lens
2
2
 
3
- Domain lens for hardware modeling DSL work. Use during alignment when generated RTL, golden output, or model equivalence assumptions may be implicit.
3
+ Applies when: the change touches a hardware modeling DSL, generated RTL, generated tests, golden output, or model equivalence for example when Touch includes the DSL sources or their generated-RTL/test outputs, or the change artifacts describe regeneration, lowering, or equivalence.
4
+
5
+ Domain lens for hardware modeling DSL work. Use during alignment, execution, and review when generated RTL, golden output, or model equivalence assumptions may be implicit.
4
6
 
5
7
  ## Material risk surface
6
8
 
@@ -1,6 +1,8 @@
1
- # Hardware alignment reference
1
+ # Hardware lens
2
2
 
3
- Domain lens for Verilog/SystemVerilog work. Use during alignment when hardware protocol, timing, reset, or verification assumptions may be implicit.
3
+ Applies when: the change touches Verilog/SystemVerilog interfaces, protocol, reset, clocking/CDC, valid-ready/backpressure, arbitration, CSR/register fields, or RTL verification for example when Touch includes `.v`/`.sv`/`.vh`/`.svh` or the change artifacts describe a module interface, protocol, or testbench.
4
+
5
+ Domain lens for Verilog/SystemVerilog work. Use during alignment, execution, and review when hardware protocol, timing, reset, or verification assumptions may be implicit.
4
6
 
5
7
  ## Material risk surface
6
8
 
@@ -1,6 +1,8 @@
1
- # Web alignment reference
1
+ # Web lens
2
2
 
3
- Domain lens for web frontend/backend work. Use during alignment when UI, API, routing, persistence, or integration behavior may hide product assumptions.
3
+ Applies when: the change touches UI, API, routing, auth/session, persistence, migrations, async/loading/error states, accessibility, or backend integration for example when Touch includes `.tsx`/`.jsx`/`.ts`/`.js`/`.css`/`.html`/`.sql` or the change artifacts describe a route, endpoint, component, or schema.
4
+
5
+ Domain lens for web frontend/backend work. Use during alignment, execution, and review when UI, API, routing, persistence, or integration behavior may hide product assumptions.
4
6
 
5
7
  ## Material risk surface
6
8