kaizen-agent 1.6.8 → 1.7.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/LICENSE +21 -21
- package/README.md +657 -647
- package/agents/kaizen-builder.md +77 -77
- package/agents/kaizen-planner.md +250 -250
- package/agents/kaizen-reviewer.md +127 -127
- package/cli/dashboard.ts +1187 -1187
- package/cli/install.ts +959 -959
- package/cli/publish-gh.sh +27 -27
- package/cli/release.sh +45 -45
- package/cli/settings.ts +415 -415
- package/cli/state.test.ts +197 -197
- package/cli/state.ts +691 -691
- package/cli/web.ts +416 -403
- package/commands/kaizen-abort.md +5 -5
- package/commands/kaizen-approve.md +5 -5
- package/commands/kaizen-auto.md +6 -6
- package/commands/kaizen-backlog.md +5 -5
- package/commands/kaizen-config.md +5 -5
- package/commands/kaizen-full.md +5 -5
- package/commands/kaizen-init.md +5 -5
- package/commands/kaizen-install.md +5 -5
- package/commands/kaizen-lite.md +5 -5
- package/commands/kaizen-plan.md +6 -6
- package/commands/kaizen-reject.md +6 -6
- package/commands/kaizen-review.md +6 -6
- package/commands/kaizen-run.md +5 -5
- package/commands/kaizen-status.md +5 -5
- package/package.json +1 -1
- package/skills/kaizen/README.md +281 -281
- package/skills/kaizen/SKILL.md +440 -440
- package/skills/kaizen/adapters.md +77 -77
- package/skills/kaizen/config.default.yml +167 -167
- package/skills/kaizen/spec-build.md +119 -119
- package/skills/kaizen/spec-main.md +104 -104
- package/skills/kaizen/spec-plan.md +201 -201
- package/skills/kaizen/spec-review.md +121 -121
- package/skills/kaizen/spec.md +153 -153
- package/skills/kaizen-help/SKILL.md +129 -129
- package/web/board.html +513 -444
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
# Kaizen — review stage
|
|
2
|
-
|
|
3
|
-
Read with [`spec.md`](spec.md) (core: track, intake, resume). This file is the
|
|
4
|
-
reviewer's contract. The planner and builder do not read it.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
## Stage 3 — Review
|
|
8
|
-
|
|
9
|
-
**Agent:** reviewer, with a context that has never seen the builder's reasoning.
|
|
10
|
-
**Input:** `01-plan.md` (its File manifest names what to read), `03-impl.md`, the
|
|
11
|
-
track, and the work produced.
|
|
12
|
-
**Output:** `04-review.md`.
|
|
13
|
-
|
|
14
|
-
The track's third answer — *what would make it wrong* — is the reviewer's primary
|
|
15
|
-
brief. It reads that first and hunts for it specifically.
|
|
16
|
-
|
|
17
|
-
Five checks are universal, in every track:
|
|
18
|
-
|
|
19
|
-
1. **Correctness** — is it true, and does it hold up? For code: logic errors,
|
|
20
|
-
unhandled cases, broken error paths, races, leaks. For a document: false claims,
|
|
21
|
-
internal contradictions, unsupported conclusions. For communication: overclaims,
|
|
22
|
-
and meaning the audience will not take as intended.
|
|
23
|
-
2. **Plan conformance** — did the work do what was approved, no more and no less?
|
|
24
|
-
Scope creep is a finding. So is a step quietly skipped.
|
|
25
|
-
3. **Blast radius** — what else touches what changed. A diff shows the lines that
|
|
26
|
-
moved; it does not show who depended on them. For every changed function, export,
|
|
27
|
-
schema field, config key, endpoint, or shared string, find its other callers and
|
|
28
|
-
readers and check each one still holds. This is the check a diff cannot contain,
|
|
29
|
-
and skipping it is how a run that passes its own verification breaks a feature
|
|
30
|
-
nobody looked at. In a non-code track the same question is "what else quoted,
|
|
31
|
-
linked to, or depended on the part that changed".
|
|
32
|
-
4. **Regression** — the builder's before-and-after results from `03-impl.md`, verified
|
|
33
|
-
rather than trusted: re-run the checks. A check that passed at baseline and fails
|
|
34
|
-
now is a `high` finding at minimum, whatever else the work achieved. If the builder
|
|
35
|
-
recorded no baseline, that absence is itself the finding.
|
|
36
|
-
|
|
37
|
-
5. **The plan's gate** — every `G-nn` item from the plan's Verification section,
|
|
38
|
-
re-answered against the work rather than against `03-impl.md`. A gate item the
|
|
39
|
-
builder marked `PASS` with no evidence behind it, or with evidence that only
|
|
40
|
-
restates the item, is treated as unproven and re-checked here; if it does not hold,
|
|
41
|
-
that is the finding. A `reason`-tier item fails when the technique is present and
|
|
42
|
-
the written reason is not.
|
|
43
|
-
|
|
44
|
-
Then the track's own checks. For software work: security, reuse and simplification,
|
|
45
|
-
test coverage. For a document: completeness against its own structure, accuracy of
|
|
46
|
-
every checkable claim, whether its intended reader can actually use it. For
|
|
47
|
-
operational work: missing prerequisites, absent rollback, steps that cannot be
|
|
48
|
-
executed as written. The plan's Verification section says what was promised; the
|
|
49
|
-
reviewer checks that promise was kept.
|
|
50
|
-
|
|
51
|
-
**Keep the working transcript small.** Everything the reviewer reads stays in its
|
|
52
|
-
context and is re-read on every request that follows, so the re-run suite dumped in
|
|
53
|
-
full at check 4 is paid for again at every check after it. Pipe long output through a
|
|
54
|
-
filter that keeps the decisive lines — the failure count, the failing test names, the
|
|
55
|
-
first error — and read the full output only where a check actually fails, which is the
|
|
56
|
-
only place the detail becomes a finding. The same holds for the work under review: open
|
|
57
|
-
the manifest's paths at the ranges the plan names, and read the diff rather than the
|
|
58
|
-
whole file wherever the finding would cite a changed line. `04-review.md` records the
|
|
59
|
-
findings, not the transcript.
|
|
60
|
-
|
|
61
|
-
This does not apply to check 3. Blast radius is the check whose whole point is what
|
|
62
|
-
the diff does not contain, so it reads as widely as it needs to — every caller, every
|
|
63
|
-
reader, whole files where that is what it takes. A cheaper blast-radius pass is not a
|
|
64
|
-
cheaper review, it is the check not happening.
|
|
65
|
-
|
|
66
|
-
Each finding is one line, numbered from 1 within the review:
|
|
67
|
-
`<n>. <where>: <severity>: <problem>. <fix>. [G-nn]` Where is a `path:line` for code,
|
|
68
|
-
and a section, page, or step reference otherwise. Severity is one of `critical`,
|
|
69
|
-
`high`, `medium`, `low`. The number is what the user approves fixes by, and what the
|
|
70
|
-
fix loop and the backlog refer to afterward, so it never changes once written.
|
|
71
|
-
|
|
72
|
-
**A finding against a gate item cites it, and takes its severity from that item's
|
|
73
|
-
tier** — `block` is `critical` or `high`, `reason` is `medium`, `lock` is `low`. This
|
|
74
|
-
is what keeps the same class of problem from being graded differently run to run, and
|
|
75
|
-
it is not a judgment the reviewer re-litigates: the tier was set at the plan, which
|
|
76
|
-
the user approved. A finding outside the gate carries no id and is graded on its own
|
|
77
|
-
merits.
|
|
78
|
-
|
|
79
|
-
The reviewer verifies before reporting: a finding it cannot construct a concrete
|
|
80
|
-
failing input or scenario for is dropped, not softened into a maybe. No praise, no
|
|
81
|
-
summary of what the code does, no style nits that do not change meaning.
|
|
82
|
-
|
|
83
|
-
The reviewer also appends any durable lesson about this material to `memory.md` —
|
|
84
|
-
a recurring bug pattern, a non-obvious constraint, a convention worth keeping. Not
|
|
85
|
-
run-specific detail; only what the next run would want to know.
|
|
86
|
-
|
|
87
|
-
`memory.md` is read by every stage of every future run, so its size is a tax on all of
|
|
88
|
-
them. Keep it under `review.memory_max_lines` (default 100): before appending, drop
|
|
89
|
-
any lesson that is now wrong, already enforced by a test or a lint rule, or restated
|
|
90
|
-
by a newer entry. A memory file that only grows stops being read carefully.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Stage 4 — Fix loop
|
|
95
|
-
|
|
96
|
-
Governed by `auto_fix`. See the skill's fix-loop section for the exact behavior.
|
|
97
|
-
|
|
98
|
-
Each iteration writes `05-iterations/NN-fix.md` (what the builder changed) and
|
|
99
|
-
`NN-recheck.md` (what the reviewer found afterward). The loop ends when the reviewer
|
|
100
|
-
reports nothing at or above the threshold, or `max_iterations` is reached.
|
|
101
|
-
|
|
102
|
-
A finding the loop could not close is escalated to the user with the reviewer's
|
|
103
|
-
description intact — never quietly downgraded to make the run look clean.
|
|
104
|
-
|
|
105
|
-
**A recheck is not a second review.** Re-answer the findings it was meant to close,
|
|
106
|
-
the gate items the change could plausibly touch, and the regression check. Nothing
|
|
107
|
-
else. State which items were skipped and why, in one line, so the reader can disagree
|
|
108
|
-
with the judgement — a skipped item is a claim that the change could not have reached
|
|
109
|
-
it, and that claim is checkable.
|
|
110
|
-
|
|
111
|
-
Answering all of them again is not thoroughness, it is the same evidence gathered
|
|
112
|
-
twice. A fix that touched one line of a message string cannot have broken an item
|
|
113
|
-
about which directories the installer writes to, and re-running that item's live
|
|
114
|
-
setup to prove it costs more than the fix did. Where a change genuinely could have
|
|
115
|
-
reached everything — a rename across the run's files, a shared helper — say so and
|
|
116
|
-
re-answer everything.
|
|
117
|
-
|
|
118
|
-
The exception is the regression check, which runs every iteration whatever the fix
|
|
119
|
-
touched. It is cheap, and it is the one that catches a fix breaking something nobody
|
|
120
|
-
thought to connect it to.
|
|
121
|
-
|
|
1
|
+
# Kaizen — review stage
|
|
2
|
+
|
|
3
|
+
Read with [`spec.md`](spec.md) (core: track, intake, resume). This file is the
|
|
4
|
+
reviewer's contract. The planner and builder do not read it.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
## Stage 3 — Review
|
|
8
|
+
|
|
9
|
+
**Agent:** reviewer, with a context that has never seen the builder's reasoning.
|
|
10
|
+
**Input:** `01-plan.md` (its File manifest names what to read), `03-impl.md`, the
|
|
11
|
+
track, and the work produced.
|
|
12
|
+
**Output:** `04-review.md`.
|
|
13
|
+
|
|
14
|
+
The track's third answer — *what would make it wrong* — is the reviewer's primary
|
|
15
|
+
brief. It reads that first and hunts for it specifically.
|
|
16
|
+
|
|
17
|
+
Five checks are universal, in every track:
|
|
18
|
+
|
|
19
|
+
1. **Correctness** — is it true, and does it hold up? For code: logic errors,
|
|
20
|
+
unhandled cases, broken error paths, races, leaks. For a document: false claims,
|
|
21
|
+
internal contradictions, unsupported conclusions. For communication: overclaims,
|
|
22
|
+
and meaning the audience will not take as intended.
|
|
23
|
+
2. **Plan conformance** — did the work do what was approved, no more and no less?
|
|
24
|
+
Scope creep is a finding. So is a step quietly skipped.
|
|
25
|
+
3. **Blast radius** — what else touches what changed. A diff shows the lines that
|
|
26
|
+
moved; it does not show who depended on them. For every changed function, export,
|
|
27
|
+
schema field, config key, endpoint, or shared string, find its other callers and
|
|
28
|
+
readers and check each one still holds. This is the check a diff cannot contain,
|
|
29
|
+
and skipping it is how a run that passes its own verification breaks a feature
|
|
30
|
+
nobody looked at. In a non-code track the same question is "what else quoted,
|
|
31
|
+
linked to, or depended on the part that changed".
|
|
32
|
+
4. **Regression** — the builder's before-and-after results from `03-impl.md`, verified
|
|
33
|
+
rather than trusted: re-run the checks. A check that passed at baseline and fails
|
|
34
|
+
now is a `high` finding at minimum, whatever else the work achieved. If the builder
|
|
35
|
+
recorded no baseline, that absence is itself the finding.
|
|
36
|
+
|
|
37
|
+
5. **The plan's gate** — every `G-nn` item from the plan's Verification section,
|
|
38
|
+
re-answered against the work rather than against `03-impl.md`. A gate item the
|
|
39
|
+
builder marked `PASS` with no evidence behind it, or with evidence that only
|
|
40
|
+
restates the item, is treated as unproven and re-checked here; if it does not hold,
|
|
41
|
+
that is the finding. A `reason`-tier item fails when the technique is present and
|
|
42
|
+
the written reason is not.
|
|
43
|
+
|
|
44
|
+
Then the track's own checks. For software work: security, reuse and simplification,
|
|
45
|
+
test coverage. For a document: completeness against its own structure, accuracy of
|
|
46
|
+
every checkable claim, whether its intended reader can actually use it. For
|
|
47
|
+
operational work: missing prerequisites, absent rollback, steps that cannot be
|
|
48
|
+
executed as written. The plan's Verification section says what was promised; the
|
|
49
|
+
reviewer checks that promise was kept.
|
|
50
|
+
|
|
51
|
+
**Keep the working transcript small.** Everything the reviewer reads stays in its
|
|
52
|
+
context and is re-read on every request that follows, so the re-run suite dumped in
|
|
53
|
+
full at check 4 is paid for again at every check after it. Pipe long output through a
|
|
54
|
+
filter that keeps the decisive lines — the failure count, the failing test names, the
|
|
55
|
+
first error — and read the full output only where a check actually fails, which is the
|
|
56
|
+
only place the detail becomes a finding. The same holds for the work under review: open
|
|
57
|
+
the manifest's paths at the ranges the plan names, and read the diff rather than the
|
|
58
|
+
whole file wherever the finding would cite a changed line. `04-review.md` records the
|
|
59
|
+
findings, not the transcript.
|
|
60
|
+
|
|
61
|
+
This does not apply to check 3. Blast radius is the check whose whole point is what
|
|
62
|
+
the diff does not contain, so it reads as widely as it needs to — every caller, every
|
|
63
|
+
reader, whole files where that is what it takes. A cheaper blast-radius pass is not a
|
|
64
|
+
cheaper review, it is the check not happening.
|
|
65
|
+
|
|
66
|
+
Each finding is one line, numbered from 1 within the review:
|
|
67
|
+
`<n>. <where>: <severity>: <problem>. <fix>. [G-nn]` Where is a `path:line` for code,
|
|
68
|
+
and a section, page, or step reference otherwise. Severity is one of `critical`,
|
|
69
|
+
`high`, `medium`, `low`. The number is what the user approves fixes by, and what the
|
|
70
|
+
fix loop and the backlog refer to afterward, so it never changes once written.
|
|
71
|
+
|
|
72
|
+
**A finding against a gate item cites it, and takes its severity from that item's
|
|
73
|
+
tier** — `block` is `critical` or `high`, `reason` is `medium`, `lock` is `low`. This
|
|
74
|
+
is what keeps the same class of problem from being graded differently run to run, and
|
|
75
|
+
it is not a judgment the reviewer re-litigates: the tier was set at the plan, which
|
|
76
|
+
the user approved. A finding outside the gate carries no id and is graded on its own
|
|
77
|
+
merits.
|
|
78
|
+
|
|
79
|
+
The reviewer verifies before reporting: a finding it cannot construct a concrete
|
|
80
|
+
failing input or scenario for is dropped, not softened into a maybe. No praise, no
|
|
81
|
+
summary of what the code does, no style nits that do not change meaning.
|
|
82
|
+
|
|
83
|
+
The reviewer also appends any durable lesson about this material to `memory.md` —
|
|
84
|
+
a recurring bug pattern, a non-obvious constraint, a convention worth keeping. Not
|
|
85
|
+
run-specific detail; only what the next run would want to know.
|
|
86
|
+
|
|
87
|
+
`memory.md` is read by every stage of every future run, so its size is a tax on all of
|
|
88
|
+
them. Keep it under `review.memory_max_lines` (default 100): before appending, drop
|
|
89
|
+
any lesson that is now wrong, already enforced by a test or a lint rule, or restated
|
|
90
|
+
by a newer entry. A memory file that only grows stops being read carefully.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Stage 4 — Fix loop
|
|
95
|
+
|
|
96
|
+
Governed by `auto_fix`. See the skill's fix-loop section for the exact behavior.
|
|
97
|
+
|
|
98
|
+
Each iteration writes `05-iterations/NN-fix.md` (what the builder changed) and
|
|
99
|
+
`NN-recheck.md` (what the reviewer found afterward). The loop ends when the reviewer
|
|
100
|
+
reports nothing at or above the threshold, or `max_iterations` is reached.
|
|
101
|
+
|
|
102
|
+
A finding the loop could not close is escalated to the user with the reviewer's
|
|
103
|
+
description intact — never quietly downgraded to make the run look clean.
|
|
104
|
+
|
|
105
|
+
**A recheck is not a second review.** Re-answer the findings it was meant to close,
|
|
106
|
+
the gate items the change could plausibly touch, and the regression check. Nothing
|
|
107
|
+
else. State which items were skipped and why, in one line, so the reader can disagree
|
|
108
|
+
with the judgement — a skipped item is a claim that the change could not have reached
|
|
109
|
+
it, and that claim is checkable.
|
|
110
|
+
|
|
111
|
+
Answering all of them again is not thoroughness, it is the same evidence gathered
|
|
112
|
+
twice. A fix that touched one line of a message string cannot have broken an item
|
|
113
|
+
about which directories the installer writes to, and re-running that item's live
|
|
114
|
+
setup to prove it costs more than the fix did. Where a change genuinely could have
|
|
115
|
+
reached everything — a rename across the run's files, a shared helper — say so and
|
|
116
|
+
re-answer everything.
|
|
117
|
+
|
|
118
|
+
The exception is the regression check, which runs every iteration whatever the fix
|
|
119
|
+
touched. It is cheap, and it is the one that catches a fix breaking something nobody
|
|
120
|
+
thought to connect it to.
|
|
121
|
+
|
package/skills/kaizen/spec.md
CHANGED
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
# Kaizen workflow specification
|
|
2
|
-
|
|
3
|
-
This file is the tool-neutral contract. Claude Code, Codex, and Antigravity all
|
|
4
|
-
follow this document; only the way stages are dispatched differs per tool. If an
|
|
5
|
-
adapter and this file disagree, this file wins.
|
|
6
|
-
|
|
7
|
-
A stage may only start when the previous stage's artifact exists on disk and the approval
|
|
8
|
-
between them, if enabled, has been resolved.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## The track
|
|
13
|
-
|
|
14
|
-
Kaizen is not a software workflow. The stage structure — frame, approve, produce,
|
|
15
|
-
review independently, fix under a bound — holds for a book, a marketing campaign, a
|
|
16
|
-
migration runbook, or a research memo just as well as for code. What changes per kind
|
|
17
|
-
of work is what the words *deliverable*, *verification*, and *finding* mean.
|
|
18
|
-
|
|
19
|
-
That meaning is fixed once, at intake, and recorded as the run's **track**. Every
|
|
20
|
-
later stage reads it and adapts. A reviewer hunting race conditions in a book
|
|
21
|
-
manuscript is worse than no reviewer at all, and a track is what prevents it.
|
|
22
|
-
|
|
23
|
-
**The track is inferred, never asked.** Reading a request and recognizing what kind
|
|
24
|
-
of work it is — an app, a chapter, a campaign, a runbook — is the workflow's job, not
|
|
25
|
-
the user's. Asking "is this software or writing?" hands back the analysis they came
|
|
26
|
-
here to have done, and a request almost always says which it is: what it names, the
|
|
27
|
-
verbs it uses, where the material lives, what the person is evidently trying to
|
|
28
|
-
produce. Read it and decide.
|
|
29
|
-
|
|
30
|
-
Do not classify against a fixed taxonomy of work types; the sixth kind of work will
|
|
31
|
-
not be on the list. Establish the track by answering three questions from the request
|
|
32
|
-
itself, and only then ask about what genuinely cannot be read from it:
|
|
33
|
-
|
|
34
|
-
1. **What is the deliverable?** A merged code change, a chapter, a landing page, a
|
|
35
|
-
decision memo, a set of ad variants, a runbook someone else will execute.
|
|
36
|
-
2. **What counts as done?** The concrete, checkable condition. Tests pass. The
|
|
37
|
-
chapter reads end to end without contradicting chapter two. A colleague can follow
|
|
38
|
-
the runbook without asking a question. Someone in the audience understands the
|
|
39
|
-
offer in one read.
|
|
40
|
-
3. **What would make it wrong?** The failure this work must not have. A security
|
|
41
|
-
hole. A claim that is not true. A tone that alienates the reader. A step that
|
|
42
|
-
silently loses data.
|
|
43
|
-
|
|
44
|
-
Answer three is what the reviewer becomes. Answer two is what the builder must
|
|
45
|
-
demonstrate. Draft all three yourself from the request, then state them back as
|
|
46
|
-
conclusions — "this is a book chapter; done means it reads end to end without
|
|
47
|
-
contradicting chapter two; wrong means a claim that is not true" — so the user
|
|
48
|
-
corrects a reading rather than performing a classification. A wrong reading stated
|
|
49
|
-
plainly is easy to fix; a question about categories is work handed back.
|
|
50
|
-
|
|
51
|
-
Only where the request genuinely leaves the outcome open — two plausible readings
|
|
52
|
-
with materially different work behind them — does this become a question, and even
|
|
53
|
-
then ask about the outcome the user wants, never about which category the work
|
|
54
|
-
belongs to.
|
|
55
|
-
|
|
56
|
-
Common shapes, as illustration only — never as a menu to force a request into:
|
|
57
|
-
|
|
58
|
-
| Shape | Deliverable | Done means | Wrong means |
|
|
59
|
-
|---|---|---|---|
|
|
60
|
-
| Enhancing existing software | A change in this repo | Tests and the plan's checks pass | Regression, security hole, scope creep |
|
|
61
|
-
| Building something new | A working first version | It runs and does the named thing | Wrong foundation, unnecessary complexity |
|
|
62
|
-
| Writing and documentation | A document | Complete, accurate, follows its own structure | False claim, contradiction, unusable for its reader |
|
|
63
|
-
| Marketing and communication | Copy, campaign, positioning | The audience takes the intended meaning | Overclaim, wrong audience, off-brand |
|
|
64
|
-
| Operations and process | A runbook, a config, a migration | Someone else can execute it unaided | Missing rollback, unstated prerequisite |
|
|
65
|
-
| Research and analysis | Findings and a recommendation | The conclusion follows from evidence shown | Unsupported leap, cherry-picked data |
|
|
66
|
-
|
|
67
|
-
A run may be a mix. Record it as a mix — the honest description beats the nearest
|
|
68
|
-
label.
|
|
69
|
-
|
|
70
|
-
Record the track in `state.json` as `track`, with the three answers written into
|
|
71
|
-
`00-request.md`. Every subsequent stage reads them before starting, and the words
|
|
72
|
-
*build*, *verify*, and *finding* below are always to be read in the track's terms.
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Stage 0 — Intake
|
|
77
|
-
|
|
78
|
-
**Input:** the user's request.
|
|
79
|
-
**Output:** `runs/<id>/00-request.md`, `state.json`.
|
|
80
|
-
|
|
81
|
-
Create the run id as `YYYY-MM-DD-<short-kebab-slug>`. Write the request verbatim —
|
|
82
|
-
do not summarize it, since later stages read this instead of the conversation and a
|
|
83
|
-
summary is where requirements quietly disappear.
|
|
84
|
-
|
|
85
|
-
Verbatim includes the mess. Requests arrive as thinking out loud: half-formed,
|
|
86
|
-
out of order, self-correcting, with the decisive constraint tucked into an aside near
|
|
87
|
-
the end. Capture all of it, in the order it was said, including the parts that were
|
|
88
|
-
later revised — the revision only makes sense next to what it revised. Making sense
|
|
89
|
-
of that material is the planner's work, not the user's, and the user is never asked
|
|
90
|
-
to restate a request more precisely.
|
|
91
|
-
|
|
92
|
-
Then read the request and infer the track, per the section above. This is the one
|
|
93
|
-
moment where the direction of the whole run is set: whether it is an enhancement, a
|
|
94
|
-
build from nothing, a document, or work with no code in it at all. Getting it wrong
|
|
95
|
-
here is not recoverable later — every stage will do good work aimed at the wrong
|
|
96
|
-
target.
|
|
97
|
-
|
|
98
|
-
The inference is stated in the plan's Framing and confirmed at the plan approval along with
|
|
99
|
-
everything else. That is the correction point, and it is enough: the user reads one
|
|
100
|
-
sentence and either nods or says "no, this is a blog post". They are never asked to
|
|
101
|
-
categorize their own request up front.
|
|
102
|
-
|
|
103
|
-
Write into `00-request.md`: the verbatim request, the deliverable, what done means,
|
|
104
|
-
and what wrong means. Record in `state.json`: `id`, `mode`, `runner`, `agent`, `track`,
|
|
105
|
-
`stage: "plan"`, `awaiting: null`.
|
|
106
|
-
|
|
107
|
-
`stage` takes exactly one of five words, and boards key their columns on them:
|
|
108
|
-
`plan`, `build`, `review`, `done`, `abandoned`. Set it when the stage starts —
|
|
109
|
-
`build` before the builder touches anything, `review` before the reviewer reads — as
|
|
110
|
-
its own write, not tacked onto a longer command that may not finish. Any other word
|
|
111
|
-
(`implement`, `fix`, `building`) is unknown to every reader and shows as still planning.
|
|
112
|
-
|
|
113
|
-
`awaiting` is `null` or the config key of the approval being waited on —
|
|
114
|
-
`approvals.plan`, `approvals.review`, `approvals.each_file` — or `findings` when the
|
|
115
|
-
run has stopped for the user to pick which review findings to fix. Boards read it to
|
|
116
|
-
say what a run is waiting for and where it sits; a word outside this list is shown but
|
|
117
|
-
not understood.
|
|
118
|
-
|
|
119
|
-
`agent` is the tool this run is happening in — `claude`, `codex`, `agy`, `opencode`,
|
|
120
|
-
`gemini`, or `cursor` — written once at intake and never changed, so a board can say
|
|
121
|
-
which agent to look for when a run is waiting. The tool running this stage knows what
|
|
122
|
-
it is; no detection is needed.
|
|
123
|
-
|
|
124
|
-
`runner` is read from config at intake and written down here, because it decides
|
|
125
|
-
whether the stages that follow are separate agents or this one. A run resumed later
|
|
126
|
-
keeps the runner it started with: a review done in the same session as the work is a
|
|
127
|
-
different thing from an independent one, and which happened should not depend on what
|
|
128
|
-
the config said the day someone came back to it.
|
|
129
|
-
|
|
130
|
-
If the request remains ambiguous enough that a plan would be guesswork, ask now. One
|
|
131
|
-
round of questions here is cheaper than a rejected plan.
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## Stage files
|
|
136
|
-
|
|
137
|
-
Read core (this file) plus the one file for the stage being run. Nothing else.
|
|
138
|
-
|
|
139
|
-
| Reader | Reads |
|
|
140
|
-
|---|---|
|
|
141
|
-
| Planner | `spec.md` + [`spec-plan.md`](spec-plan.md) |
|
|
142
|
-
| Builder | `spec.md` + [`spec-build.md`](spec-build.md) |
|
|
143
|
-
| Reviewer | `spec.md` + [`spec-review.md`](spec-review.md) |
|
|
144
|
-
| Main thread | `spec.md` + [`spec-main.md`](spec-main.md), plus the stage file for an approval it is presenting |
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Resume semantics
|
|
149
|
-
|
|
150
|
-
Any tool picking up a run reads `state.json` and continues from `stage`, honoring
|
|
151
|
-
`awaiting`. A run whose `awaiting` is non-null must not be advanced without a
|
|
152
|
-
recorded decision in `02-approval.md`. This is what makes a run safe to hand between
|
|
153
|
-
Claude Code, Codex, and Antigravity mid-flight.
|
|
1
|
+
# Kaizen workflow specification
|
|
2
|
+
|
|
3
|
+
This file is the tool-neutral contract. Claude Code, Codex, and Antigravity all
|
|
4
|
+
follow this document; only the way stages are dispatched differs per tool. If an
|
|
5
|
+
adapter and this file disagree, this file wins.
|
|
6
|
+
|
|
7
|
+
A stage may only start when the previous stage's artifact exists on disk and the approval
|
|
8
|
+
between them, if enabled, has been resolved.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The track
|
|
13
|
+
|
|
14
|
+
Kaizen is not a software workflow. The stage structure — frame, approve, produce,
|
|
15
|
+
review independently, fix under a bound — holds for a book, a marketing campaign, a
|
|
16
|
+
migration runbook, or a research memo just as well as for code. What changes per kind
|
|
17
|
+
of work is what the words *deliverable*, *verification*, and *finding* mean.
|
|
18
|
+
|
|
19
|
+
That meaning is fixed once, at intake, and recorded as the run's **track**. Every
|
|
20
|
+
later stage reads it and adapts. A reviewer hunting race conditions in a book
|
|
21
|
+
manuscript is worse than no reviewer at all, and a track is what prevents it.
|
|
22
|
+
|
|
23
|
+
**The track is inferred, never asked.** Reading a request and recognizing what kind
|
|
24
|
+
of work it is — an app, a chapter, a campaign, a runbook — is the workflow's job, not
|
|
25
|
+
the user's. Asking "is this software or writing?" hands back the analysis they came
|
|
26
|
+
here to have done, and a request almost always says which it is: what it names, the
|
|
27
|
+
verbs it uses, where the material lives, what the person is evidently trying to
|
|
28
|
+
produce. Read it and decide.
|
|
29
|
+
|
|
30
|
+
Do not classify against a fixed taxonomy of work types; the sixth kind of work will
|
|
31
|
+
not be on the list. Establish the track by answering three questions from the request
|
|
32
|
+
itself, and only then ask about what genuinely cannot be read from it:
|
|
33
|
+
|
|
34
|
+
1. **What is the deliverable?** A merged code change, a chapter, a landing page, a
|
|
35
|
+
decision memo, a set of ad variants, a runbook someone else will execute.
|
|
36
|
+
2. **What counts as done?** The concrete, checkable condition. Tests pass. The
|
|
37
|
+
chapter reads end to end without contradicting chapter two. A colleague can follow
|
|
38
|
+
the runbook without asking a question. Someone in the audience understands the
|
|
39
|
+
offer in one read.
|
|
40
|
+
3. **What would make it wrong?** The failure this work must not have. A security
|
|
41
|
+
hole. A claim that is not true. A tone that alienates the reader. A step that
|
|
42
|
+
silently loses data.
|
|
43
|
+
|
|
44
|
+
Answer three is what the reviewer becomes. Answer two is what the builder must
|
|
45
|
+
demonstrate. Draft all three yourself from the request, then state them back as
|
|
46
|
+
conclusions — "this is a book chapter; done means it reads end to end without
|
|
47
|
+
contradicting chapter two; wrong means a claim that is not true" — so the user
|
|
48
|
+
corrects a reading rather than performing a classification. A wrong reading stated
|
|
49
|
+
plainly is easy to fix; a question about categories is work handed back.
|
|
50
|
+
|
|
51
|
+
Only where the request genuinely leaves the outcome open — two plausible readings
|
|
52
|
+
with materially different work behind them — does this become a question, and even
|
|
53
|
+
then ask about the outcome the user wants, never about which category the work
|
|
54
|
+
belongs to.
|
|
55
|
+
|
|
56
|
+
Common shapes, as illustration only — never as a menu to force a request into:
|
|
57
|
+
|
|
58
|
+
| Shape | Deliverable | Done means | Wrong means |
|
|
59
|
+
|---|---|---|---|
|
|
60
|
+
| Enhancing existing software | A change in this repo | Tests and the plan's checks pass | Regression, security hole, scope creep |
|
|
61
|
+
| Building something new | A working first version | It runs and does the named thing | Wrong foundation, unnecessary complexity |
|
|
62
|
+
| Writing and documentation | A document | Complete, accurate, follows its own structure | False claim, contradiction, unusable for its reader |
|
|
63
|
+
| Marketing and communication | Copy, campaign, positioning | The audience takes the intended meaning | Overclaim, wrong audience, off-brand |
|
|
64
|
+
| Operations and process | A runbook, a config, a migration | Someone else can execute it unaided | Missing rollback, unstated prerequisite |
|
|
65
|
+
| Research and analysis | Findings and a recommendation | The conclusion follows from evidence shown | Unsupported leap, cherry-picked data |
|
|
66
|
+
|
|
67
|
+
A run may be a mix. Record it as a mix — the honest description beats the nearest
|
|
68
|
+
label.
|
|
69
|
+
|
|
70
|
+
Record the track in `state.json` as `track`, with the three answers written into
|
|
71
|
+
`00-request.md`. Every subsequent stage reads them before starting, and the words
|
|
72
|
+
*build*, *verify*, and *finding* below are always to be read in the track's terms.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Stage 0 — Intake
|
|
77
|
+
|
|
78
|
+
**Input:** the user's request.
|
|
79
|
+
**Output:** `runs/<id>/00-request.md`, `state.json`.
|
|
80
|
+
|
|
81
|
+
Create the run id as `YYYY-MM-DD-<short-kebab-slug>`. Write the request verbatim —
|
|
82
|
+
do not summarize it, since later stages read this instead of the conversation and a
|
|
83
|
+
summary is where requirements quietly disappear.
|
|
84
|
+
|
|
85
|
+
Verbatim includes the mess. Requests arrive as thinking out loud: half-formed,
|
|
86
|
+
out of order, self-correcting, with the decisive constraint tucked into an aside near
|
|
87
|
+
the end. Capture all of it, in the order it was said, including the parts that were
|
|
88
|
+
later revised — the revision only makes sense next to what it revised. Making sense
|
|
89
|
+
of that material is the planner's work, not the user's, and the user is never asked
|
|
90
|
+
to restate a request more precisely.
|
|
91
|
+
|
|
92
|
+
Then read the request and infer the track, per the section above. This is the one
|
|
93
|
+
moment where the direction of the whole run is set: whether it is an enhancement, a
|
|
94
|
+
build from nothing, a document, or work with no code in it at all. Getting it wrong
|
|
95
|
+
here is not recoverable later — every stage will do good work aimed at the wrong
|
|
96
|
+
target.
|
|
97
|
+
|
|
98
|
+
The inference is stated in the plan's Framing and confirmed at the plan approval along with
|
|
99
|
+
everything else. That is the correction point, and it is enough: the user reads one
|
|
100
|
+
sentence and either nods or says "no, this is a blog post". They are never asked to
|
|
101
|
+
categorize their own request up front.
|
|
102
|
+
|
|
103
|
+
Write into `00-request.md`: the verbatim request, the deliverable, what done means,
|
|
104
|
+
and what wrong means. Record in `state.json`: `id`, `mode`, `runner`, `agent`, `track`,
|
|
105
|
+
`stage: "plan"`, `awaiting: null`.
|
|
106
|
+
|
|
107
|
+
`stage` takes exactly one of five words, and boards key their columns on them:
|
|
108
|
+
`plan`, `build`, `review`, `done`, `abandoned`. Set it when the stage starts —
|
|
109
|
+
`build` before the builder touches anything, `review` before the reviewer reads — as
|
|
110
|
+
its own write, not tacked onto a longer command that may not finish. Any other word
|
|
111
|
+
(`implement`, `fix`, `building`) is unknown to every reader and shows as still planning.
|
|
112
|
+
|
|
113
|
+
`awaiting` is `null` or the config key of the approval being waited on —
|
|
114
|
+
`approvals.plan`, `approvals.review`, `approvals.each_file` — or `findings` when the
|
|
115
|
+
run has stopped for the user to pick which review findings to fix. Boards read it to
|
|
116
|
+
say what a run is waiting for and where it sits; a word outside this list is shown but
|
|
117
|
+
not understood.
|
|
118
|
+
|
|
119
|
+
`agent` is the tool this run is happening in — `claude`, `codex`, `agy`, `opencode`,
|
|
120
|
+
`gemini`, or `cursor` — written once at intake and never changed, so a board can say
|
|
121
|
+
which agent to look for when a run is waiting. The tool running this stage knows what
|
|
122
|
+
it is; no detection is needed.
|
|
123
|
+
|
|
124
|
+
`runner` is read from config at intake and written down here, because it decides
|
|
125
|
+
whether the stages that follow are separate agents or this one. A run resumed later
|
|
126
|
+
keeps the runner it started with: a review done in the same session as the work is a
|
|
127
|
+
different thing from an independent one, and which happened should not depend on what
|
|
128
|
+
the config said the day someone came back to it.
|
|
129
|
+
|
|
130
|
+
If the request remains ambiguous enough that a plan would be guesswork, ask now. One
|
|
131
|
+
round of questions here is cheaper than a rejected plan.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Stage files
|
|
136
|
+
|
|
137
|
+
Read core (this file) plus the one file for the stage being run. Nothing else.
|
|
138
|
+
|
|
139
|
+
| Reader | Reads |
|
|
140
|
+
|---|---|
|
|
141
|
+
| Planner | `spec.md` + [`spec-plan.md`](spec-plan.md) |
|
|
142
|
+
| Builder | `spec.md` + [`spec-build.md`](spec-build.md) |
|
|
143
|
+
| Reviewer | `spec.md` + [`spec-review.md`](spec-review.md) |
|
|
144
|
+
| Main thread | `spec.md` + [`spec-main.md`](spec-main.md), plus the stage file for an approval it is presenting |
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Resume semantics
|
|
149
|
+
|
|
150
|
+
Any tool picking up a run reads `state.json` and continues from `stage`, honoring
|
|
151
|
+
`awaiting`. A run whose `awaiting` is non-null must not be advanced without a
|
|
152
|
+
recorded decision in `02-approval.md`. This is what makes a run safe to hand between
|
|
153
|
+
Claude Code, Codex, and Antigravity mid-flight.
|