kaizen-agent 0.4.0 → 0.5.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 +438 -53
- package/cli/dashboard.ts +539 -0
- package/cli/install.ts +318 -23
- package/cli/settings.ts +160 -0
- package/commands/kaizen-config.md +5 -0
- package/package.json +7 -4
- package/skills/kaizen/SKILL.md +62 -4
- package/skills/kaizen/config.default.yml +13 -0
- package/skills/kaizen/spec-build.md +11 -1
- package/skills/kaizen/spec-plan.md +17 -0
- package/skills/kaizen-help/SKILL.md +4 -2
package/skills/kaizen/SKILL.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kaizen
|
|
3
3
|
description: >
|
|
4
|
-
Staged
|
|
5
|
-
|
|
4
|
+
Staged workflow for any kind of work: plan, human approval, build, then independent
|
|
5
|
+
review with a bounded fix loop. Not only for code — a run infers its own track (code,
|
|
6
|
+
writing, communication, operations, research) and every stage reads "deliverable",
|
|
7
|
+
"verification", and "finding" in that track's terms. Each stage runs as its own
|
|
6
8
|
subagent with clean context, and all state lives in a portable `.kaizen/` directory so
|
|
7
9
|
a run can be resumed later, by another session, or by another AI tool (Codex,
|
|
8
10
|
Antigravity). Use when the user says "kaizen", "/kaizen", asks to plan-then-build-then-review
|
|
9
|
-
|
|
11
|
+
something, wants approval steps before work begins, or wants to resume or check an
|
|
10
12
|
existing kaizen run. Also use to install the workflow into a repository.
|
|
11
13
|
---
|
|
12
14
|
|
|
@@ -44,6 +46,7 @@ Porting the workflow to Codex or Antigravity is covered in [`adapters.md`](adapt
|
|
|
44
46
|
| `/kaizen approve` | Approve whatever the current run is waiting on |
|
|
45
47
|
| `/kaizen reject <reason>` | Reject it; the reason is fed back to the stage that produced it |
|
|
46
48
|
| `/kaizen abort` | Mark the current run abandoned |
|
|
49
|
+
| `/kaizen config` | Show this project's settings and change them, one picker per setting |
|
|
47
50
|
| `/kaizen init` | Install `.kaizen/` with the `spec*.md` files, config, and the gitignore entry into the current repository |
|
|
48
51
|
| `/kaizen install` | Install the workflow itself globally or per-project (see below) |
|
|
49
52
|
|
|
@@ -64,6 +67,48 @@ If the user typed `/kaizen` with no argument and a run is in progress, treat it
|
|
|
64
67
|
4. Read `.kaizen/memory.md` if present. It holds cross-run lessons and carries real
|
|
65
68
|
weight: it is what previous reviewers learned about this codebase.
|
|
66
69
|
|
|
70
|
+
## Settings
|
|
71
|
+
|
|
72
|
+
`/kaizen config` reads `.kaizen/config.yml`, falling back to `config.default.yml` for
|
|
73
|
+
anything it does not set, and prints the current value of each setting below with a
|
|
74
|
+
one-line meaning. Then it offers the settings as choices — the tool's structured
|
|
75
|
+
question mechanism, one option per legal value, never free text — and writes back
|
|
76
|
+
whichever the user picks.
|
|
77
|
+
|
|
78
|
+
| Setting | Values | What it decides |
|
|
79
|
+
|---|---|---|
|
|
80
|
+
| `mode` | `approve`, `auto`, `plan-only`, `review-only` | Where a run stops |
|
|
81
|
+
| `build.executor` | `subagent`, `inline`, `ask` | Who carries out the approved plan |
|
|
82
|
+
| `approvals.plan` | `true`, `false` | Stop and show the plan before anything is built |
|
|
83
|
+
| `approvals.review` | `true`, `false` | Stop after the review, before the run is called done |
|
|
84
|
+
| `approvals.each_file` | `true`, `false` | Confirm every individual edit |
|
|
85
|
+
| `auto_fix.enabled` | `true`, `false` | Fix findings without asking, or hand every one over |
|
|
86
|
+
| `auto_fix.min_severity` | `critical`, `high`, `medium`, `low` | How bad a finding must be to be fixed automatically |
|
|
87
|
+
| `auto_fix.max_iterations` | `1`–`5` | Fix and recheck rounds before what is left is escalated |
|
|
88
|
+
| `review.write_memory` | `true`, `false` | Let the reviewer append lessons to `memory.md` |
|
|
89
|
+
| `git.auto_commit` | `true`, `false` | Commit the work when a run finishes |
|
|
90
|
+
| `git.branch_before_implement` | `true`, `false` | Branch before building when on the default branch |
|
|
91
|
+
|
|
92
|
+
Rules for writing the file:
|
|
93
|
+
|
|
94
|
+
- **Change the value in place.** `config.yml` ships with a comment above every key
|
|
95
|
+
explaining it; rewriting the file from a parsed object throws all of them away.
|
|
96
|
+
Edit the one line.
|
|
97
|
+
- **Only what the user picked.** A key the user did not touch stays absent if it was
|
|
98
|
+
absent — an absent key inherits the default, and writing every key out freezes
|
|
99
|
+
today's defaults into the project forever.
|
|
100
|
+
- If `.kaizen/` does not exist yet, run `init` first, then continue.
|
|
101
|
+
- After writing, print the setting and its new value, and nothing else. No summary of
|
|
102
|
+
the whole file.
|
|
103
|
+
|
|
104
|
+
Settings not in the table — the review checks, backlog and state paths — are edited by
|
|
105
|
+
hand in `config.yml`, which is commented throughout. Say so rather than offering a
|
|
106
|
+
picker with thirty options.
|
|
107
|
+
|
|
108
|
+
`kaizen settings` in a terminal opens the same settings as a full-screen browser, for
|
|
109
|
+
someone who would rather see the whole file at once. Mention it when the user is
|
|
110
|
+
changing several at a time.
|
|
111
|
+
|
|
67
112
|
## Modes
|
|
68
113
|
|
|
69
114
|
Set by `mode` in config, overridable per invocation.
|
|
@@ -171,6 +216,13 @@ are never renamed or moved, so a path written into another file cannot break.
|
|
|
171
216
|
|
|
172
217
|
## Running a stage
|
|
173
218
|
|
|
219
|
+
**If the tool you are running in has no subagents** — Codex, and anything else that
|
|
220
|
+
runs one session at a time — do not try to fake them. Run the stages sequentially in
|
|
221
|
+
the one session, following [`adapters.md`](adapters.md): start each stage by reading
|
|
222
|
+
only its declared inputs, write its artifact before moving on, and when reviewing,
|
|
223
|
+
judge the work on its own terms rather than defending the reasoning you used writing
|
|
224
|
+
it. Everything else in this file holds unchanged.
|
|
225
|
+
|
|
174
226
|
Each stage runs as a subagent via the Agent tool, with the agent type named below.
|
|
175
227
|
Pass it the run directory path and let it read its own inputs from there — do not
|
|
176
228
|
paste plans or diffs into the prompt, since the file is the shared source of truth
|
|
@@ -180,9 +232,15 @@ file, never the whole set.
|
|
|
180
232
|
| Stage | Agent type | Writes |
|
|
181
233
|
|---|---|---|
|
|
182
234
|
| Plan | `kaizen-planner` | `01-plan.md` |
|
|
183
|
-
| Implement | `kaizen-builder` | `03-impl.md` + the actual
|
|
235
|
+
| Implement | `kaizen-builder`, or the main thread when `build.executor` is `inline` | `03-impl.md` + the actual changes |
|
|
184
236
|
| Review | `kaizen-reviewer` | `04-review.md` |
|
|
185
237
|
|
|
238
|
+
`build.executor` decides who implements: `subagent` (default), `inline` — the main
|
|
239
|
+
thread does it against the same contract in `spec-build.md` — or `ask`, which puts
|
|
240
|
+
the choice at the plan approval. Building inline does not make the review less
|
|
241
|
+
independent: the reviewer is a separate agent in every case, and never sees the
|
|
242
|
+
conversation the work happened in.
|
|
243
|
+
|
|
186
244
|
After a subagent returns, update `state.json` yourself in the main thread. Subagents
|
|
187
245
|
report; the main thread owns the state machine.
|
|
188
246
|
|
|
@@ -14,6 +14,19 @@ approvals:
|
|
|
14
14
|
# Confirm every individual file edit. Maximum control, slowest.
|
|
15
15
|
each_file: false
|
|
16
16
|
|
|
17
|
+
build:
|
|
18
|
+
# Who carries out the approved plan.
|
|
19
|
+
# subagent - dispatch the builder as its own agent. The main thread keeps its
|
|
20
|
+
# context and the work is reported back. The default, and the only
|
|
21
|
+
# sane option for a large run.
|
|
22
|
+
# inline - the main thread does the work itself, against the same plan and the
|
|
23
|
+
# same contract. You watch it happen and can interrupt mid-step, at
|
|
24
|
+
# the cost of main-thread context.
|
|
25
|
+
# ask - offer the choice at the plan approval.
|
|
26
|
+
# The reviewer is a separate agent in every case; that is not configurable, because
|
|
27
|
+
# an agent reviewing work it just did will defend it.
|
|
28
|
+
executor: subagent
|
|
29
|
+
|
|
17
30
|
auto_fix:
|
|
18
31
|
# false: every finding stops the run and becomes a user decision.
|
|
19
32
|
# true: findings at or above min_severity are fixed and re-reviewed automatically.
|
|
@@ -10,7 +10,17 @@ builder's contract. The planner and reviewer do not read it.
|
|
|
10
10
|
**Output:** the deliverable itself, plus `03-impl.md`.
|
|
11
11
|
|
|
12
12
|
The builder produces whatever the track's deliverable is — code, a chapter, the
|
|
13
|
-
campaign copy, the runbook — and nothing else.
|
|
13
|
+
campaign copy, the runbook — and nothing else.
|
|
14
|
+
|
|
15
|
+
This file is the contract whether the builder is a dispatched agent or the main
|
|
16
|
+
thread working inline (see `build.executor`). Working inline changes who is typing,
|
|
17
|
+
not what is owed: the plan is still the scope, a step that turns out wrong still
|
|
18
|
+
stops the stage instead of being improvised around, and `03-impl.md` is still written
|
|
19
|
+
before the reviewer is called. The temptation inline is to skip the file because the
|
|
20
|
+
work is already visible in the conversation — but the reviewer never sees that
|
|
21
|
+
conversation, and reads the file instead.
|
|
22
|
+
|
|
23
|
+
Rules:
|
|
14
24
|
|
|
15
25
|
- Work only within the plan's scope. Something out of scope that clearly needs doing
|
|
16
26
|
is written to `03-impl.md` as a note, not produced.
|
|
@@ -90,6 +90,23 @@ Present to the user, in this order:
|
|
|
90
90
|
be readable on its own, without the plan's reasoning around it.
|
|
91
91
|
3. The open questions, **as a pick list** — see below.
|
|
92
92
|
|
|
93
|
+
**Who builds it.** Governed by `build.executor`. On `subagent` or `inline` the
|
|
94
|
+
approval says which is about to happen in one line and moves on; on `ask` it is one
|
|
95
|
+
more choice at this approval:
|
|
96
|
+
|
|
97
|
+
- **subagent** (default) — dispatch the builder as its own agent. The main thread
|
|
98
|
+
keeps its context, and the work is reported back rather than watched. Right for
|
|
99
|
+
most runs, and the only sane option for a large one.
|
|
100
|
+
- **inline** — the main thread does the work itself, against this plan. You watch it
|
|
101
|
+
happen and can interrupt mid-step, and it already holds the conversation the plan
|
|
102
|
+
came out of. It costs main-thread context, and a long run will exhaust it.
|
|
103
|
+
|
|
104
|
+
Either way the builder's contract is unchanged: the plan is the scope, `03-impl.md`
|
|
105
|
+
is written the same way, and the gate is answered with the same evidence. **The
|
|
106
|
+
reviewer is always a separate agent, in both.** Its independence is what the review
|
|
107
|
+
is worth, and it is not the user's to trade away — an inline build is judged by an
|
|
108
|
+
agent that never saw it happen, exactly as a dispatched one is.
|
|
109
|
+
|
|
93
110
|
Do not dump the whole plan into the terminal; point at its path for the detail.
|
|
94
111
|
|
|
95
112
|
**Ask with options, not open prose.** Every question the plan raises is put to the
|
|
@@ -30,6 +30,7 @@ anything.
|
|
|
30
30
|
| `/kaizen approve` | Approve whatever the current run is waiting on |
|
|
31
31
|
| `/kaizen reject <reason>` | Reject it; the reason decides revise (back to planner) vs kill (abandon) |
|
|
32
32
|
| `/kaizen abort` | Mark the current run abandoned |
|
|
33
|
+
| `/kaizen config` | Show this project's settings and change them, one picker per setting |
|
|
33
34
|
| `/kaizen init` | Install `.kaizen/` with `spec.md`, config, and the gitignore entry into the current repository |
|
|
34
35
|
| `/kaizen install` | Install the workflow itself globally or per-project |
|
|
35
36
|
|
|
@@ -74,11 +75,12 @@ Each iteration is written to `runs/<id>/05-iterations/`.
|
|
|
74
75
|
|---|---|---|
|
|
75
76
|
| `mode` | `approve` | Default run mode |
|
|
76
77
|
| `approvals.plan` | `true` | Stop after the plan |
|
|
77
|
-
| `approvals.review` | `
|
|
78
|
+
| `approvals.review` | `false` | Stop after the review |
|
|
78
79
|
| `approvals.each_file` | `false` | Confirm every file edit |
|
|
80
|
+
| `build.executor` | `subagent` | Who builds: `subagent`, `inline` (main thread), or `ask` at the approval |
|
|
79
81
|
| `auto_fix.enabled` | `true` | Auto-fix findings vs. escalate everything |
|
|
80
82
|
| `auto_fix.min_severity` | `high` | Threshold for auto-fix (`critical\|high\|medium\|low`) |
|
|
81
|
-
| `auto_fix.max_iterations` | `
|
|
83
|
+
| `auto_fix.max_iterations` | `2` | Fix/recheck rounds before escalating remaining findings |
|
|
82
84
|
| `track.default` | `""` (empty, inferred per run) | Pin a track for a repo that is always one kind of work |
|
|
83
85
|
| `review.write_memory` | `true` | Let the reviewer append lessons to `.kaizen/memory.md` |
|
|
84
86
|
| `backlog.enabled` | `true` | Capture what a run deliberately did not do |
|