@christang/keel 5.1.2 → 5.2.1
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 +114 -158
- package/README.zh-CN.md +118 -197
- package/assets/bootstrap/AGENTS.md +1 -1
- package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/hardware-dsl.md +4 -2
- package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/hardware.md +4 -2
- package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/web.md +4 -2
- package/assets/openspec/schemas/keel-spec-driven/schema.yaml +11 -5
- package/assets/openspec/schemas/keel-spec-driven/templates/design.md +1 -1
- package/assets/openspec/schemas/keel-spec-driven/templates/tasks.md +13 -4
- package/bin/keel.js +221 -18
- package/package.json +1 -1
- package/plugins/keel/.claude-plugin/plugin.json +1 -1
- package/plugins/keel/.codex-plugin/plugin.json +1 -1
- package/plugins/keel/skills/keel-align-expectations/SKILL.md +2 -6
- package/plugins/keel/skills/keel-debug-failure/SKILL.md +2 -2
- package/plugins/keel/skills/keel-review-checklist/SKILL.md +2 -2
- package/plugins/keel/skills/keel-tdd-or-test-first/SKILL.md +2 -2
- package/scripts/bump_version.js +140 -0
- package/scripts/install_to_repo.py +3 -73
- package/scripts/validate_plugin.py +558 -107
- package/src/core/context.js +10 -3
- package/src/core/gates.js +40 -10
- package/src/core/task-contract.js +21 -0
package/README.zh-CN.md
CHANGED
|
@@ -8,71 +8,59 @@
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
Keel
|
|
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
|
|
58
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
71
|
-
**`keel` 插件**(执行技能 + 运行时 hook)。
|
|
41
|
+
两部分:`keel` CLI 和 `keel` 插件。
|
|
72
42
|
|
|
73
|
-
|
|
43
|
+
**CLI** —— 一条命令(同时装上捆绑的 OpenSpec CLI):
|
|
74
44
|
|
|
75
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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`
|
|
95
|
+
`keel --init` 会跑 OpenSpec 初始化/更新,并写入 Keel 的宿主面。之后每次开始或恢复工作:
|
|
128
96
|
|
|
129
97
|
```bash
|
|
130
|
-
keel context #
|
|
98
|
+
keel context # 现在该做什么,从 OpenSpec + Git 重算
|
|
99
|
+
keel --doctor # 检查各部分是否就位
|
|
131
100
|
```
|
|
132
101
|
|
|
133
|
-
|
|
134
|
-
|
|
102
|
+
spec 相关的活走 OpenSpec 的命令(`/opsx:propose`、`/opsx:apply`、`/opsx:sync`、`/opsx:archive`),
|
|
103
|
+
Keel 的门禁在任务边界处运行。整个回路:
|
|
135
104
|
|
|
136
|
-
```
|
|
137
|
-
keel --
|
|
105
|
+
```
|
|
106
|
+
keel --init → keel context → /opsx:apply(选一个 task)
|
|
107
|
+
→ task-start(+ 写入守卫) → 实现并验证
|
|
108
|
+
→ task-complete → /opsx:sync · /opsx:archive
|
|
138
109
|
```
|
|
139
110
|
|
|
140
|
-
###
|
|
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
|
-
|
|
117
|
+
**Lite 模式**用于局部小改:单点修复、小脚本、文档或补测试,不改接口、影响可局部证明;Lite 默认不
|
|
118
|
+
写 OpenSpec 状态。
|
|
170
119
|
|
|
171
|
-
|
|
172
|
-
或任何触及信号、reset、CDC、安全边界的硬件工作。Full 模式用 OpenSpec 走
|
|
173
|
-
proposal → design → specs → tasks → archive。
|
|
120
|
+
## 这些命令,agent 是怎么用起来的
|
|
174
121
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
checklist 会检查这条通道)。
|
|
122
|
+
下面这些命令你几乎不用手敲。Keel 的意义在于纪律会自己跑起来:`keel --init` 把它装进 agent 的
|
|
123
|
+
工作流,agent 会在恰当的时刻去调用每一条命令。让这件事成立的有三样东西。
|
|
178
124
|
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
#
|
|
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 --
|
|
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
|
|
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`
|
|
212
|
-
|
|
213
|
-
### 写入守卫(Claude target)
|
|
162
|
+
退出码:`0` 通过 · `3` 策略失败 · `4` 缺少语义 review · `1` 输入/解析故障。
|
|
214
163
|
|
|
215
|
-
|
|
216
|
-
|
|
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
|
|
226
|
-
|
|
169
|
+
Touch 是唯一写权限来源。通过的 `keel gate task-start` 默认写入一次性守卫 manifest
|
|
170
|
+
(`keel guard start` 显式激活、`keel guard clear` 停止执法、`--no-guard` 退出默认激活)。守卫
|
|
171
|
+
激活时,`PreToolUse` hook 确定性拒绝 Touch 之外的文件编辑,并给出精确路径和恢复命令:
|
|
227
172
|
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
250
|
-
|
|
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/`
|
|
257
|
-
|
|
205
|
+
无构建步骤。`src/skills/` 是可移植技能的唯一维护源,`plugins/keel/skills/` 等分发副本必须与源
|
|
206
|
+
字节一致(由校验强制)。
|
|
258
207
|
|
|
259
208
|
```bash
|
|
260
|
-
npm
|
|
261
|
-
|
|
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)。
|
package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/hardware-dsl.md
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# Hardware DSL
|
|
1
|
+
# Hardware DSL lens
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
package/{plugins/keel/skills/keel-align-expectations/references → assets/lenses}/hardware.md
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# Hardware
|
|
1
|
+
# Hardware lens
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
1
|
+
# Web lens
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
|
@@ -99,7 +99,7 @@ artifacts:
|
|
|
99
99
|
be covered by a slice, deferred to a durable owner, or explicitly
|
|
100
100
|
discarded with rationale before the slice can be selected for execution.
|
|
101
101
|
Accepted hidden-knowledge assumptions from risk-triggered deep
|
|
102
|
-
alignment or a domain
|
|
102
|
+
alignment or a domain lens are critical expectations when they
|
|
103
103
|
affect completion definition or execution boundaries.
|
|
104
104
|
Covers references the relevant D/F/A/Q identifiers. An unresolved Q<n>
|
|
105
105
|
without an authorized fallback blocks implementation.
|
|
@@ -134,9 +134,15 @@ artifacts:
|
|
|
134
134
|
outside Touch, broader design work, or an interface/security boundary
|
|
135
135
|
change not covered by design.md, stop and report an Out-of-scope Need.
|
|
136
136
|
Before task completion, Evidence records the current agent's semantic
|
|
137
|
-
Review with Status, Acceptance check, Scope check, and Findings.
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
Review with Status, Acceptance check, Scope check, and Findings. Status is
|
|
138
|
+
one of pass, passed, complete, completed, ok, or done. Findings
|
|
139
|
+
are `none` or carry a durable owner — a `Discard reason:`/`Discard
|
|
140
|
+
rationale:` prefix, a `keel/archive/…` path, or an existing
|
|
141
|
+
`openspec/changes/…` artifact; `keel/HANDOFF.md` is never the owner.
|
|
142
|
+
tasks.md ends with a `## Expectation Coverage` section that change-close
|
|
143
|
+
requires: one `- E<n>: <expectation> Covered by: <task ids>` line per
|
|
144
|
+
critical expectation (or a `Durable owner:` / `Discard reason:` closure),
|
|
145
|
+
or `- None.` when the change has no critical expectations.
|
|
140
146
|
requires:
|
|
141
147
|
- specs
|
|
142
148
|
- design
|
|
@@ -152,7 +158,7 @@ apply:
|
|
|
152
158
|
2. Select one unchecked task or a small contiguous group of unchecked tasks from tasks.md.
|
|
153
159
|
3. Run the Task Authoring Gate: every relevant critical expectation must be covered by a selected slice, deferred to a durable owner, or explicitly discarded with rationale.
|
|
154
160
|
4. Run the Slice Start Gate: every selected current slice must name source expectations and compile to a complete keel-task-capsule/v1 contract from its compact Covers, Touch, Verify, and Evidence fields plus any declared exceptional Mode, Read, Acceptance delta, Autonomy boundary, Coupling/Candidate Boundary, or Stop if clauses.
|
|
155
|
-
5. If a selected task lacks an execution contract, source expectations, or accepted hidden-knowledge assumptions raised by risk-triggered deep alignment or a domain
|
|
161
|
+
5. If a selected task lacks an execution contract, source expectations, or accepted hidden-knowledge assumptions raised by risk-triggered deep alignment or a domain lens, update OpenSpec first instead of dispatching implementation.
|
|
156
162
|
6. Rough future slices may remain non-executable drafts, but they cannot be selected for implementation or marked complete.
|
|
157
163
|
7. The current Keel agent remains task owner and executor. Treat any Execution recommendation as an advisory implementation note, not as a completion gate.
|
|
158
164
|
8. Do not hand Keel-managed execution to another agent, subagent, or operator unless the selected task or user explicitly authorizes it. Keep task selection, implementation, verification, and failure recovery in the current agent conversation.
|
|
@@ -21,7 +21,7 @@ Ordinary narrative stays unnumbered. -->
|
|
|
21
21
|
## Hidden Knowledge / Assumptions
|
|
22
22
|
|
|
23
23
|
<!-- Accepted hidden-knowledge assumptions from risk-triggered grill or domain
|
|
24
|
-
|
|
24
|
+
lenses. Critical assumptions use A<n>, record Basis, and name Resolve by or a
|
|
25
25
|
durable Owner. Put compressed recovery context here when future sessions need
|
|
26
26
|
it; keel/HANDOFF.md should only point to durable owners. Use "None." when empty. -->
|
|
27
27
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
- [ ] 1.1 <!-- Task description -->
|
|
13
13
|
- Covers:
|
|
14
|
-
- <source expectation: spec scenario as `capability / requirement or scenario heading`, hidden-knowledge assumption, domain
|
|
14
|
+
- <source expectation: spec scenario as `capability / requirement or scenario heading`, hidden-knowledge assumption, domain lens requirement, or critical D<n>/F<n>/A<n>/Q<n>; an unresolved Q<n> requires an authorized fallback>
|
|
15
15
|
- Touch:
|
|
16
16
|
- <path>
|
|
17
17
|
- Verify:
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
- Strategy: <strategy>
|
|
25
25
|
- M1: <public behavior check>
|
|
26
26
|
- Evidence:
|
|
27
|
-
- Contract: pending
|
|
27
|
+
- Contract: pending
|
|
28
28
|
- M1: pending
|
|
29
29
|
- Review:
|
|
30
|
-
<!--
|
|
30
|
+
<!-- Status: one of pass, passed, complete, completed, ok, done -->
|
|
31
|
+
<!-- Findings: none, or carry a durable owner — a "Discard reason:"/"Discard rationale:" prefix, a keel/archive/… path, or an existing openspec/changes/… artifact; not keel/HANDOFF.md -->
|
|
31
32
|
- Status: pending
|
|
32
33
|
- Acceptance check: pending
|
|
33
34
|
- Scope check: pending
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
- Strategy: evidence-first
|
|
59
60
|
- M1: <reproduction or diagnosis check with its observable evidence>
|
|
60
61
|
- Evidence:
|
|
61
|
-
- Contract: pending
|
|
62
|
+
- Contract: pending
|
|
62
63
|
- M1: pending
|
|
63
64
|
- Review:
|
|
64
65
|
- Status: pending
|
|
@@ -66,3 +67,11 @@
|
|
|
66
67
|
- Scope check: pending
|
|
67
68
|
- Findings: pending
|
|
68
69
|
- Blocker: none
|
|
70
|
+
|
|
71
|
+
## Expectation Coverage
|
|
72
|
+
|
|
73
|
+
<!-- change-close requires this section. One line per critical expectation:
|
|
74
|
+
`- E1: the expectation Covered by: 1.1` (task ids that own it), or a
|
|
75
|
+
`Durable owner: openspec/changes/<change>/tasks.md` / `Discard reason: why`
|
|
76
|
+
closure. Use `- None.` only when the change has no critical expectations. -->
|
|
77
|
+
- None.
|