@christang/keel 5.1.2 → 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.
- 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/tasks.md +13 -4
- package/bin/keel.js +218 -15
- 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 +0 -70
- package/scripts/validate_plugin.py +408 -96
- package/src/core/context.js +10 -3
- package/src/core/gates.js +30 -9
- package/src/core/task-contract.js +21 -0
package/README.md
CHANGED
|
@@ -8,77 +8,64 @@
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- **
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **Expectation alignment
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## How it works
|
|
46
|
-
|
|
47
|
-
```mermaid
|
|
48
|
-
flowchart LR
|
|
49
|
-
A[keel --init] --> B[keel context]
|
|
50
|
-
B --> C[proposal / design / specs / tasks]
|
|
51
|
-
C --> D[keel-align-expectations]
|
|
52
|
-
D --> E[/opsx:apply → pick one task/]
|
|
53
|
-
E --> F[task-start<br/>+ write guard]
|
|
54
|
-
F --> G[implement · test-first · verify]
|
|
55
|
-
G --> H[keel-review-checklist]
|
|
56
|
-
H --> I[task-complete]
|
|
57
|
-
I --> J[/opsx:sync · /opsx:archive/]
|
|
58
|
-
```
|
|
11
|
+
## What Keel is for
|
|
12
|
+
|
|
13
|
+
[OpenSpec](https://github.com/fission-ai/openspec) gives a project a spec-driven
|
|
14
|
+
workflow: proposal, design, specs, tasks, and an archive of what changed. Claude Code
|
|
15
|
+
(or Codex) gives you the agent that does the work. Keel sits between them and keeps the
|
|
16
|
+
agent on track while it works through an OpenSpec change.
|
|
17
|
+
|
|
18
|
+
Left alone, an agent tends to drift: it edits files the task never mentioned, loses the
|
|
19
|
+
thread after a context reset, or checks work off without proof. Keel adds a thin, checkable
|
|
20
|
+
layer that prevents that, and it does so by building on tools you already have instead of
|
|
21
|
+
replacing them.
|
|
22
|
+
|
|
23
|
+
What Keel adds:
|
|
24
|
+
|
|
25
|
+
- **Stateless continuity.** `keel context` recomputes the current task and next step from
|
|
26
|
+
OpenSpec and Git every session, so work survives `/clear`, compaction, and cold starts
|
|
27
|
+
without depending on chat memory.
|
|
28
|
+
- **Deterministic gates.** `keel gate task-start | task-complete | change-close` run local
|
|
29
|
+
structural checks and return `pass` / `fail` / `needs-review` with real exit codes. They
|
|
30
|
+
check that the task contract and evidence are present; they do not judge whether the design
|
|
31
|
+
is correct.
|
|
32
|
+
- **A write guard (Claude).** After `task-start`, a `PreToolUse` hook rejects any edit
|
|
33
|
+
outside the files the task declared it would touch.
|
|
34
|
+
- **Expectation alignment.** Before specs and tasks are finalized, Keel surfaces hidden
|
|
35
|
+
assumptions and asks about the ones that actually change behavior.
|
|
36
|
+
|
|
37
|
+
Keel leans on native capabilities rather than reinventing them. The spec workflow is plain
|
|
38
|
+
OpenSpec. The execution skills, the SessionStart continuity hook, and the write-guard hook
|
|
39
|
+
ship as an ordinary Claude Code / Codex plugin. `keel --init` writes only a small host
|
|
40
|
+
surface into your repo: an `AGENTS.md` bootstrap block, the OpenSpec schema, and the
|
|
41
|
+
`/opsx:*` command overlay.
|
|
59
42
|
|
|
60
|
-
|
|
61
|
-
*execution discipline* around them: mode routing, the task capsule contract, deterministic
|
|
62
|
-
gates, the write guard, continuity, review, and handoff hygiene.
|
|
43
|
+
## Requirements
|
|
63
44
|
|
|
64
|
-
|
|
45
|
+
Node.js `>=20.19.0` (the bundled OpenSpec CLI needs it).
|
|
65
46
|
|
|
66
|
-
##
|
|
47
|
+
## Install
|
|
67
48
|
|
|
68
|
-
|
|
69
|
-
`EBADENGINE`).
|
|
49
|
+
Two pieces: the `keel` CLI and the `keel` plugin.
|
|
70
50
|
|
|
71
|
-
|
|
51
|
+
**CLI** — one command (also installs the bundled OpenSpec CLI):
|
|
72
52
|
|
|
73
|
-
|
|
53
|
+
```bash
|
|
54
|
+
npm install -g @christang/keel
|
|
55
|
+
keel --version
|
|
56
|
+
```
|
|
74
57
|
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
**Plugin** — the execution skills and runtime hooks:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
claude plugin install keel@<marketplace> # Claude Code
|
|
62
|
+
codex plugin add keel@<marketplace> # Codex
|
|
63
|
+
```
|
|
77
64
|
|
|
78
|
-
|
|
65
|
+
<details>
|
|
66
|
+
<summary>Install the latest unreleased build from GitHub</summary>
|
|
79
67
|
|
|
80
|
-
Pack
|
|
81
|
-
preparation and installs the bundled OpenSpec CLI.
|
|
68
|
+
Pack the current `main` and install the tarball (skips the npm registry):
|
|
82
69
|
|
|
83
70
|
**Windows (PowerShell):**
|
|
84
71
|
|
|
@@ -99,97 +86,84 @@ npm pack github:TanglmChris/keel --pack-destination "$tmp_dir"
|
|
|
99
86
|
npm install -g "$tmp_dir"/christang-keel-*.tgz
|
|
100
87
|
rm -rf "$tmp_dir"
|
|
101
88
|
```
|
|
89
|
+
</details>
|
|
102
90
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
keel --version
|
|
107
|
-
keel --update # re-pack + reinstall the global CLI
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### 2. The `keel` plugin (skills + hooks)
|
|
91
|
+
## Use
|
|
111
92
|
|
|
112
|
-
|
|
113
|
-
write guard) ship as a native plugin — they are **not** copied into your repo by `keel --init`:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
claude plugin install keel@<marketplace> # Claude Code
|
|
117
|
-
codex plugin add keel@<marketplace> # Codex
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## Quick start
|
|
123
|
-
|
|
124
|
-
From your target project's root:
|
|
93
|
+
In your project's root, set it up once:
|
|
125
94
|
|
|
126
95
|
```bash
|
|
127
96
|
keel --init # default target: claude
|
|
128
|
-
keel --init --target codex
|
|
129
|
-
keel --init --target opencode
|
|
97
|
+
keel --init --target codex # or: opencode
|
|
130
98
|
```
|
|
131
99
|
|
|
132
|
-
`keel --init` runs OpenSpec init/update and
|
|
133
|
-
|
|
100
|
+
`keel --init` runs OpenSpec init/update and writes Keel's host surface. Then, every time you
|
|
101
|
+
start or resume work:
|
|
134
102
|
|
|
135
103
|
```bash
|
|
136
|
-
keel context #
|
|
104
|
+
keel context # what to do now, recomputed from OpenSpec + Git
|
|
105
|
+
keel --doctor # check everything is wired up
|
|
137
106
|
```
|
|
138
107
|
|
|
139
|
-
|
|
140
|
-
|
|
108
|
+
Do the spec work through OpenSpec's commands (`/opsx:propose`, `/opsx:apply`, `/opsx:sync`,
|
|
109
|
+
`/opsx:archive`). Keel's gates run at the task boundaries. The whole loop:
|
|
141
110
|
|
|
142
|
-
```
|
|
143
|
-
keel --
|
|
111
|
+
```
|
|
112
|
+
keel --init → keel context → /opsx:apply (pick one task)
|
|
113
|
+
→ task-start (+ write guard) → implement & verify
|
|
114
|
+
→ task-complete → /opsx:sync · /opsx:archive
|
|
144
115
|
```
|
|
145
116
|
|
|
146
|
-
###
|
|
147
|
-
|
|
148
|
-
`keel --init` / `--install` keeps a **thin host surface** — it does not copy skills or hooks
|
|
149
|
-
(those come from the plugin):
|
|
150
|
-
|
|
151
|
-
- `AGENTS.md` — Keel bootstrap block (all targets)
|
|
152
|
-
- `CLAUDE.md` — `@AGENTS.md` import block (Claude target)
|
|
153
|
-
- `openspec/config.yaml` — sets `schema: keel-spec-driven`
|
|
154
|
-
- `openspec/schemas/keel-spec-driven/` — the Keel-hardened OpenSpec schema
|
|
155
|
-
- plus the OpenSpec command surface (`/opsx:*`) with the Keel authoring/apply/archive overlay
|
|
117
|
+
### Full vs Lite
|
|
156
118
|
|
|
157
|
-
|
|
119
|
+
Use **Full mode** (the OpenSpec flow above) for new features, interface or protocol changes,
|
|
120
|
+
cross-module work, or anything over ~3 files / 100 lines. Use **Lite mode** for local fixes,
|
|
121
|
+
small scripts, docs, or tests with no interface change and locally provable impact; Lite does
|
|
122
|
+
not write OpenSpec state.
|
|
158
123
|
|
|
159
|
-
##
|
|
124
|
+
## How the agent uses these
|
|
160
125
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
| Codex | `keel --init --target codex` | global `CODEX_HOME/prompts/opsx-*.md` |
|
|
165
|
-
| OpenCode | `keel --init --target opencode` | project-local `.opencode/commands/opsx-*.md` |
|
|
126
|
+
You rarely type the commands below. The point of Keel is that the discipline runs itself:
|
|
127
|
+
`keel --init` installs it into the agent's own workflow, and the agent reaches for each
|
|
128
|
+
command at the right moment. Three things make that happen.
|
|
166
129
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
130
|
+
- **The protocol.** `keel --init` writes a bootstrap block into your repo's `AGENTS.md`
|
|
131
|
+
(imported by `CLAUDE.md` on Claude). It states the rules the agent follows: open every
|
|
132
|
+
session with `keel context`, pass the gates at task boundaries, and stay inside the task's
|
|
133
|
+
declared write scope. That is how the agent knows *when* to run what.
|
|
134
|
+
- **The skills.** The `keel-*` execution skills and the `/opsx:*` command overlays walk the
|
|
135
|
+
agent through align → apply → review → complete, invoking the gates at each step.
|
|
136
|
+
- **The hooks.** A SessionStart hook runs the continuity projection the moment a session
|
|
137
|
+
opens; a PreToolUse hook enforces the write guard on every edit. Neither needs prompting.
|
|
170
138
|
|
|
171
|
-
|
|
139
|
+
So in day-to-day use you run two commands: `keel --init` once, and `keel --doctor` when you
|
|
140
|
+
want to check the wiring. Everything below is the vocabulary the agent uses on your behalf.
|
|
172
141
|
|
|
173
|
-
##
|
|
142
|
+
## Domain lenses
|
|
174
143
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
144
|
+
Keel's core is pure process; it ships no domain knowledge of its own. Domain guidance lives in
|
|
145
|
+
**lenses** you author under `keel/lenses/*.md` in your repo. Each lens is self-describing: it
|
|
146
|
+
opens with an `Applies when:` line stating the signals that trigger it (file extensions, artifact
|
|
147
|
+
shapes) and carries an `Execution and review checks` section. When a change's artifacts or Touch
|
|
148
|
+
match a lens, the alignment, test, debug, and review skills load only that one lens — and nothing
|
|
149
|
+
when none match. Keel stays domain-agnostic; the knowledge is yours to own and edit.
|
|
179
150
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
OpenSpec state by default.
|
|
151
|
+
Three lenses ship as opt-in templates (`web`, `hardware`, `hardware-dsl`) under `assets/lenses/`.
|
|
152
|
+
They are never installed automatically:
|
|
183
153
|
|
|
184
|
-
|
|
154
|
+
```bash
|
|
155
|
+
keel lenses list # shipped templates + lenses installed in keel/lenses/
|
|
156
|
+
keel lenses add web # copy the web template into keel/lenses/web.md, then edit it
|
|
157
|
+
keel lenses add web --force # overwrite an existing lens
|
|
158
|
+
```
|
|
185
159
|
|
|
186
|
-
##
|
|
160
|
+
## Commands
|
|
187
161
|
|
|
188
162
|
```bash
|
|
189
163
|
# Continuity — recompute what to do (stateless)
|
|
190
164
|
keel context [--json] [--change <c> --task <t>]
|
|
191
165
|
|
|
192
|
-
# Deterministic gates
|
|
166
|
+
# Deterministic gates → pass | fail | needs-review
|
|
193
167
|
keel gate task-start --change <c> --task <t> --json
|
|
194
168
|
keel gate task-complete --change <c> --task <t> [--base <git-ref>] --json
|
|
195
169
|
keel gate change-close --change <c> --action sync|archive --json
|
|
@@ -199,52 +173,34 @@ keel guard start --change <c> --task <t> --json
|
|
|
199
173
|
keel guard status --json
|
|
200
174
|
keel guard clear --json
|
|
201
175
|
|
|
176
|
+
# Domain lenses — user-authored guidance in keel/lenses/
|
|
177
|
+
keel lenses list
|
|
178
|
+
keel lenses add <name> [--force]
|
|
179
|
+
|
|
202
180
|
# Install / maintenance
|
|
203
|
-
keel --init | --install | --check | --doctor | --uninstall
|
|
181
|
+
keel --init | --install | --check | --doctor | --uninstall [--target <t>] [--dry-run]
|
|
204
182
|
keel --update [--dry-run]
|
|
205
183
|
keel --version | --help
|
|
206
184
|
```
|
|
207
185
|
|
|
208
|
-
Exit codes: `0` pass · `3`
|
|
209
|
-
input/parse failure.
|
|
186
|
+
Exit codes: `0` pass · `3` policy failure · `4` missing semantic review · `1` input error.
|
|
210
187
|
|
|
211
|
-
|
|
188
|
+
Targets are probed, not assumed by name: unverified runtime behavior is reported as `manual`,
|
|
189
|
+
not `enforced`. Pick one target per repo and use it for every `--install` / `--check` /
|
|
190
|
+
`--doctor` / `--uninstall`.
|
|
212
191
|
|
|
213
192
|
## Development
|
|
214
193
|
|
|
215
|
-
No build step. `src/skills/` is the single source of truth for portable skills;
|
|
216
|
-
copies under `plugins/keel/skills/` must stay byte-identical (enforced by
|
|
217
|
-
|
|
194
|
+
No build step. `src/skills/` is the single source of truth for portable skills; the
|
|
195
|
+
distribution copies under `plugins/keel/skills/` must stay byte-identical (enforced by
|
|
196
|
+
validation).
|
|
218
197
|
|
|
219
198
|
```bash
|
|
220
|
-
npm
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
# single scenario
|
|
224
|
-
node scripts/run_python.js scripts/validate_plugin.py --scenario core-gates
|
|
199
|
+
npm test # baseline + all scenarios in parallel
|
|
200
|
+
node scripts/bump_version.js <patch|minor|major> # bump every version pin at once
|
|
225
201
|
```
|
|
226
202
|
|
|
227
|
-
### Repository layout
|
|
228
|
-
|
|
229
|
-
```text
|
|
230
|
-
bin/keel.js # cross-platform keel CLI
|
|
231
|
-
src/core/ # stateless Keel Core (context, gates, guard, goal, helper, projection)
|
|
232
|
-
src/skills/ # canonical portable skills (+ keel-align-expectations/references)
|
|
233
|
-
plugins/keel/ # native plugin (.claude-plugin / .codex-plugin, hooks, skills)
|
|
234
|
-
assets/bootstrap/AGENTS.md # canonical managed bootstrap block
|
|
235
|
-
assets/openspec/ # OpenSpec schema assets
|
|
236
|
-
scripts/ # install_to_repo.py, validate_plugin.py, run_python.js
|
|
237
|
-
openspec/ # this repo's own OpenSpec workspace
|
|
238
|
-
keel/ # project-local Keel state (CHANGELOG, archive)
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## Documentation
|
|
244
|
-
|
|
245
|
-
- **[中文完整手册 (Chinese full manual)](README.zh-CN.md)** — exhaustive command and workflow reference.
|
|
246
|
-
- **[keel/CHANGELOG.md](keel/CHANGELOG.md)** — version history.
|
|
247
|
-
|
|
248
203
|
## License
|
|
249
204
|
|
|
250
|
-
[MIT](LICENSE) © 2026 TanglmChris
|
|
205
|
+
[MIT](LICENSE) © 2026 TanglmChris. See the **[中文完整手册](README.zh-CN.md)** for the full
|
|
206
|
+
command and workflow reference.
|