flow-workflows 0.63.0 → 0.65.0-rc.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.
Files changed (42) hide show
  1. package/README.md +43 -8
  2. package/adapters/codex/CORE.md +35 -7
  3. package/adapters/codex/skills/flow-bug-fix/SKILL.md +1 -1
  4. package/adapters/codex/skills/flow-bug-review/SKILL.md +22 -0
  5. package/adapters/codex/skills/flow-doctor/SKILL.md +11 -0
  6. package/adapters/codex/skills/flow-feat-build/SKILL.md +1 -1
  7. package/adapters/codex/skills/flow-feat-review/SKILL.md +23 -1
  8. package/adapters/codex/skills/flow-feat-start/SKILL.md +1 -1
  9. package/adapters/codex/skills/flow-init/SKILL.md +10 -0
  10. package/adapters/codex/skills/flow-work-status/SKILL.md +2 -0
  11. package/adapters/gemini/CORE.md +35 -7
  12. package/adapters/gemini/commands/flow/bug/fix.toml +1 -1
  13. package/adapters/gemini/commands/flow/bug/review.toml +22 -0
  14. package/adapters/gemini/commands/flow/doctor.toml +11 -0
  15. package/adapters/gemini/commands/flow/feat/build.toml +1 -1
  16. package/adapters/gemini/commands/flow/feat/review.toml +23 -1
  17. package/adapters/gemini/commands/flow/feat/start.toml +1 -1
  18. package/adapters/gemini/commands/flow/init.toml +10 -0
  19. package/adapters/gemini/commands/flow/work/status.toml +2 -0
  20. package/adapters/hermes/CORE.md +35 -7
  21. package/adapters/hermes/skills/flow-bug-fix/SKILL.md +1 -1
  22. package/adapters/hermes/skills/flow-bug-review/SKILL.md +22 -0
  23. package/adapters/hermes/skills/flow-doctor/SKILL.md +11 -0
  24. package/adapters/hermes/skills/flow-feat-build/SKILL.md +1 -1
  25. package/adapters/hermes/skills/flow-feat-review/SKILL.md +23 -1
  26. package/adapters/hermes/skills/flow-feat-start/SKILL.md +1 -1
  27. package/adapters/hermes/skills/flow-init/SKILL.md +10 -0
  28. package/adapters/hermes/skills/flow-work-status/SKILL.md +2 -0
  29. package/adapters/opencode/CORE.md +35 -7
  30. package/adapters/opencode/commands/flow-bug-fix.md +1 -1
  31. package/adapters/opencode/commands/flow-bug-review.md +22 -0
  32. package/adapters/opencode/commands/flow-doctor.md +11 -0
  33. package/adapters/opencode/commands/flow-feat-build.md +1 -1
  34. package/adapters/opencode/commands/flow-feat-review.md +23 -1
  35. package/adapters/opencode/commands/flow-feat-start.md +1 -1
  36. package/adapters/opencode/commands/flow-init.md +10 -0
  37. package/adapters/opencode/commands/flow-work-status.md +2 -0
  38. package/bin/cli.mjs +543 -4
  39. package/package.json +1 -1
  40. package/plugins/flow/.claude-plugin/plugin.json +1 -1
  41. package/plugins/flow/CHANGELOG.md +78 -0
  42. package/plugins/flow/examples/FLOW.template.md +20 -0
package/README.md CHANGED
@@ -229,13 +229,47 @@ usable on real work.
229
229
 
230
230
  ## Token budget
231
231
 
232
- - The shared rules live in the `flow-core` skill, loaded once per session; a command file carries only its phase.
233
- - Every phase reads `meta.json` and `00-summary.md` first and opens a full artifact only on demand.
234
- - `quality.review_depth: light` runs only the base code-review — no panel, reinforcements or skeptics.
235
- - The review tier scales to the **diff under review**, not the size of the feature: a 40-line MR/PR in an L-sized work is reviewed as the 40 lines it is.
236
- - Two ceilings, both counting agents rather than findings: `agents.fanout_max` per parallel round (default 4) and `agents.budget_max` for everything one command run launches (default 12). Each command declares which phase it gives up first, and what a ceiling drops is reported.
237
- - The review output prints its cost as `spent/budget`: subagents launched, tier, effort, and every phase the ceiling skipped.
238
- - Which is why nothing here ever asks you to `/compact`: the phase boundary already is the compaction point, and it is selective, on disk and reversible. → [PHILOSOPHY](docs/PHILOSOPHY.md#nothing-here-asks-you-to-compact)
232
+ **A phase costs `turns × context`, plus what it writes.** The API keeps no state, so every tool call
233
+ resends the whole conversation: a 40-turn `build` carrying 70k of context pays for those 70k forty
234
+ times, even though the window never grows past 70k. Prompt caching makes the resent part roughly ten
235
+ times cheaper, which is why the number that matters is *turns*, not the size of a command file. Every
236
+ design decision below follows from that one line.
237
+
238
+ - **Fewer turns per phase.** The shared rules live in the `flow-core` skill, loaded once per session;
239
+ a command file carries only its phase. Every phase reads `meta.json` and `00-summary.md` first and
240
+ opens a full artifact only on demand — a handoff read in one turn instead of rediscovered in ten.
241
+ - **Fewer agents, declared in advance.** Two ceilings, both counting agents rather than findings:
242
+ `agents.fanout_max` per parallel round (default 4) and `agents.budget_max` for everything one
243
+ command run launches (default 12). Each command declares which phase it gives up first, and what a
244
+ ceiling drops is reported.
245
+ - **A tier that matches the diff, not the ticket.** The review scales to the **diff under review**: a
246
+ 40-line MR/PR inside an L-sized work is reviewed as the 40 lines it is.
247
+ - **Bounded output.** Output tokens are the most expensive kind and are never cached.
248
+ `agents.report_max_words` (default 250) is a cost ceiling as much as a format rule.
249
+ - **The cost is printed.** `review` reports `spent/budget` — subagents launched, tier, effort, and
250
+ every phase the ceiling skipped.
251
+
252
+ ### When it costs too much
253
+
254
+ Ordered by effect. Each is one line in `FLOW.md`:
255
+
256
+ | Change | What it drops | What you lose |
257
+ |---|---|---|
258
+ | `models.agents` / `models.workers` to a cheaper tier | Subagents stop running on the thread's model | Little: a subagent reads a diff and reports ≤250 words |
259
+ | `quality.review_depth: light` | The panel, the reinforcements, the skeptic fan-out | Depth on everything but the built-in reviewer; a sensitive surface still bumps back up |
260
+ | `agents.budget_max`, `agents.fanout_max` | Rounds past the ceiling, in the order each command declares | Coverage — but named coverage: what a ceiling skipped is reported, never silently dropped |
261
+ | `agents.report_max_words` | Output length per subagent | Detail in reports, not findings |
262
+
263
+ **Two things that cost real money and look free.** The first: a cache entry expires, so a phase run
264
+ in one sitting is cheaper than the same phase spread across an afternoon — coming back after a long
265
+ pause, the next turn repays the whole prefix at write price. The second: `/compact` is not a saving.
266
+ It rewrites the history the provider has already priced and stored, so the turn after it pays for
267
+ everything again. Nothing here ever asks you to compact, because the phase boundary already is the
268
+ compaction point — selective, on disk and reversible.
269
+ → [PHILOSOPHY](docs/PHILOSOPHY.md#nothing-here-asks-you-to-compact)
270
+
271
+ Cost figures in these docs are estimates, not measurements: the flow reports how many agents a
272
+ command launched, not how many tokens they spent.
239
273
 
240
274
  ## Other harnesses
241
275
 
@@ -300,9 +334,10 @@ python3 script/adapter-smoke.py # also runs install.sh against a throwaway
300
334
  bash script/tests/push-guard.sh # the push guard's cases
301
335
  bash script/tests/notify-update.sh # the update-notice hook's cases
302
336
  bash script/tests/session-start.sh # the where-you-left-off hook's cases
337
+ bash script/tests/review-unwrap.sh # the answer shapes `flow review` has to unwrap
303
338
  ```
304
339
 
305
- CI runs the same five on every PR. The preflight refuses what has shipped broken before: an empty tracked file, unparsable JSON or TOML, a manifest version out of step with `CHANGELOG.md`, a hook without its executable bit, a stale or unusable mirror. → [RELEASING](RELEASING.md)
340
+ CI runs the same six on every PR. The preflight refuses what has shipped broken before: an empty tracked file, unparsable JSON or TOML, a manifest version out of step with `CHANGELOG.md`, a hook without its executable bit, a stale or unusable mirror. → [RELEASING](RELEASING.md)
306
341
 
307
342
  ## What it does not ship (on purpose)
308
343
 
@@ -136,8 +136,8 @@ was wise.
136
136
  | Mode | Decisions | End of the command |
137
137
  |---|---|---|
138
138
  | `manual` | Stop at every decision point | Propose the next command with one `AskUserQuestion` (recommended step as default). Invoke it only on confirmation. Never make the user type it. |
139
- | `guided` | Resolve low-risk, unambiguous ones with the recommended default and **record** the choice in the phase artifact. Ask at genuine decision points. | Chain into the recommended next command automatically. |
140
- | `auto` | As `guided`, plus resolve the remaining decision points with sensible, recorded defaults. | Chain without pausing. |
139
+ | `guided` | Resolve low-risk, unambiguous ones with the recommended default and **record** the choice in the phase artifact. Ask at genuine decision points. | Chain into the recommended next command automatically — the call that starts it first, no closing report before it (§3). |
140
+ | `auto` | As `guided`, plus resolve the remaining decision points with sensible, recorded defaults. | Chain without pausing, same rule. |
141
141
 
142
142
  **Hard gates — stop and ask in every mode, no exceptions:**
143
143
  1. Any push or MR/PR creation (all of `ship`).
@@ -164,15 +164,33 @@ Asking these anyway is how an unattended run degrades into a manual one.
164
164
 
165
165
  ## 3. Reporting — how every stop reads
166
166
 
167
+ **A stop is where you hand the screen back**: a question, a hard gate, the end of the flow.
168
+ Nothing else is a stop, however much has just finished — a phase closing into the next one, a
169
+ chained command, a fan-out about to launch. The header below is the *shape* of a stop, so writing
170
+ it is how you stop: render it while meaning to continue and you will stop anyway. The shape
171
+ decides, not the intention — and on a harness where a message carrying text and no tool call is
172
+ terminal by construction, the turn is over before you notice.
173
+
174
+ - **Continuing? Do not report — act.** No header, no closing bullets. At most one short line naming
175
+ what you are moving to, and the tool call that starts it **in the same message**. Never end a
176
+ message on a promise to keep going.
177
+ - **The continuing call goes first.** When a step closes and the next one runs anyway
178
+ (`guided`/`auto` chaining, §2), the turn opens with the call that starts it, not with prose about
179
+ the one that ended. **A report is never the last thing in a turn you meant to continue.**
180
+ - **Progress belongs to the panel, not to a turn.** Someone watching reads `panel.json` (§4):
181
+ `Now`, `Next`. Writing it costs no turn and no stop; saying it in chat costs both.
182
+ - **Stopping? Then say so.** `I need:` names the decision or the action you are waiting on. It
183
+ never announces that you are continuing — if you were, you would not be writing this header.
184
+
167
185
  The user comes back to a screen they walked away from, often with other works in other panes.
168
- They have read none of your tool calls, subagent reports or artifacts. So every stop — a question,
169
- a hard gate, the end of the turn — **opens with this header**, before any prose:
186
+ They have read none of your tool calls, subagent reports or artifacts. So every stop **opens with
187
+ this header**, before any prose:
170
188
 
171
189
  ```
172
190
  <TICKET> · <size> · phase <phase> · MR #<n> of <N>
173
191
  Plan: <k> of <N> shipped — #1 <url/id> <state> · #2 <state> · #3–#N pending
174
192
  Now: <one line — what just finished>
175
- I need: <one line — the decision or action needed, or "nothing, continuing with X">
193
+ I need: <one line — the decision or action you are waiting on>
176
194
  ```
177
195
 
178
196
  - Every fact from `meta.json` (`ticket`, `size`, `phase`, `mrs[]`), never from memory. Drop the `MR #` and `Plan:` lines when the work has no `mrs`.
@@ -186,7 +204,8 @@ I need: <one line — the decision or action needed, or "nothing, continuing wit
186
204
  ## 4. Live panel — `panel.json`
187
205
 
188
206
  Whenever the state a panel would show changes, overwrite `.claude/work/<work>/panel.json`
189
- **whole** (never patch) from `meta.json` plus what you know right now:
207
+ **whole** (never patch) from `meta.json` plus what you know right now. **Any progress line you were
208
+ about to type into the chat is a panel write instead** (§3):
190
209
 
191
210
  ```json
192
211
  {
@@ -216,6 +235,15 @@ Whenever the state a panel would show changes, overwrite `.claude/work/<work>/pa
216
235
  - **When:** (a) in pre-flight, as soon as `meta.json` is loaded; (b) immediately **before** every stop header; (c) **before** any long stretch (fan-out, full suite, CI poll) — never after, so a step that dies halfway is not shown as finished. When the stretch will outlast the ~30 min staleness warning, set `stale_after_minutes` to what it will really take; (d) wherever `## Close` updates `meta.json`.
217
236
  - **Rules:** `phase` is the phase you are **running now** (not `meta.json.phase`, which advances only at Close). `header: true` means ticket, type, phase and age are drawn by the reader — do not repeat them in `lines`. Keep it under ~14 lines. Every fact from `meta.json` and the artifacts — an invented MR/PR state is worse than a blank panel. `updated_at` from the real clock (`date -Iseconds`), never carried over. Write in the language of the work's artifacts. No work folder (lightweight `respond`/`green`) → nothing to write.
218
237
 
238
+ ### `meta.json.cost[]` — what a phase measured, when it could
239
+
240
+ A phase that can measure what it spent appends one entry: `{ "phase": "review", "at": "<ISO>",
241
+ "reviewers": 8, "usd": 0.0124, "source": "harness" }`. `flow review --record` writes it; `flow cost`
242
+ reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
243
+ that reports no figure is recorded with `"source": "not reported"` rather than estimated, and a
244
+ phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
245
+ client-side estimate and can differ from a bill.
246
+
219
247
  ## 5. Work summary — `00-summary.md`
220
248
 
221
249
  Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
@@ -447,7 +475,7 @@ not `declined`/`logged`/`done`: a work being finished is precisely when its defe
447
475
 
448
476
  Mid-phase, the user corrects you. *«We don't put that in a listener here, use a message handler.»*
449
477
  *«Never mock the repository in that layer.»* *«The test command is `make test-unit`, not
450
- `bin/phpunit`.»* *«Stop proposing a DTO for that, we pass the entity.»* You comply, the phase closes,
478
+ `bin/test`.»* *«Stop proposing a DTO for that, we pass the entity.»* You comply, the phase closes,
451
479
  and the next work on the same repo proposes the same thing again. The place for these exists —
452
480
  `FLOW.md`'s `conventions` and `quality` — and nothing on the path from the correction to that file is
453
481
  automatic: the user has to notice they have said it three times and go and edit it.
@@ -167,5 +167,5 @@ Never the third way: building the mechanism here because the ticket says bug.
167
167
  - Update `meta.json`: `phase = "fix"`, add to `phases_done`.
168
168
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
169
169
  - Suggest next: `$flow-bug-validate` (S/M/L) or `$flow-bug-review` (XS).
170
- - Report **following the stop header** (flow-core §3) and name **any premise left unsettled by §2.2** in one line — what breaks if the cause was not the whole cause. `validate` builds its regression test on that assumption, so it is the one thing the user should hear before it is written.
170
+ - Report **following the stop header** (flow-core §3) **when this is a stop** — in `guided`/`auto` the next command runs in this same turn, so the body below goes to the artifact and the turn opens with the call that chains. Name **any premise left unsettled by §2.2** in one line — what breaks if the cause was not the whole cause. `validate` builds its regression test on that assumption, so it is the one thing the user should hear before it is written.
171
171
  - **Autonomy handoff** (flow-core §2): `manual` → propose that command with a single `AskUserQuestion` (recommended option by default), invoke it only on confirmation; `guided`/`auto` → chain into it in this same turn.
@@ -28,6 +28,26 @@ Read `~/.claude/flow/CORE.codex.md` first (shared rules: `FLOW.md` step 0, model
28
28
  - **A premise left open by `fix` §2.2 is an input to this review, not a note.** Every row of "Premises the fix depends on" whose verdict is `unsettled` enters §5 as an **ambiguous finding** and is named in §7 whether or not that gate opened — in a bug it is usually the claim that the root cause was the whole cause, which is exactly what the regression test cannot prove.
29
29
  - Require `fix` in `phases_done`; for `size` ≥ S also require `validate`.
30
30
  - `git diff` shows no changes → warn and stop.
31
+ - **Gather the material once, not once per reviewer.** `npx flow-workflows bundle --checks` prints
32
+ one context pack for this branch — worklist, the diff (minus `git.diff_exclude`), the changed files
33
+ in full, the raw output of `quality.static_analysis`, and the work's handoff — in a single call.
34
+ Read that instead of rediscovering it, and **pass it to the briefs of §2-§5**: a panel where every
35
+ member runs its own `git diff` and opens the same files pays for that material once per agent, and
36
+ a reviewer that spends its turns exploring has fewer left to review. **Any non-zero exit is a
37
+ fallback, not a failure** — no CLI on the machine, a base that does not resolve, a network that
38
+ cannot reach it: read the diff from git as before and carry on, once, without retrying variants.
39
+ What is not optional is the `Review path` line of §7: a round that skipped the pack and one that
40
+ used it are indistinguishable from the artifact otherwise, which is how a phase quietly stops
41
+ paying for itself.
42
+ - **`agents.exec_cmd` set → the panel runs from the CLI.** Not a choice to weigh: run
43
+ `npx flow-workflows review`, which spawns that command once per role over the pack above — **one
44
+ turn each instead of an agentic loop each** — and returns the findings already deduplicated, with
45
+ the reviewers it dropped for `agents.budget_max` named. Exactly three things send the round to the
46
+ agentic panel below: the key is empty (the default — nothing changes without it), the CLI is
47
+ unavailable by the rule above, or **every** role came back empty, which is a broken `exec_cmd` and
48
+ not a clean diff. Whichever happened is named in §7. When the CLI runs the panel, that command
49
+ picks the model, so `models.agents`/`models.workers` do not reach those reviewers. A one-shot sweep
50
+ cannot pull a thread, so an ambiguous finding still goes to a real agent with tools, as below.
31
51
 
32
52
  ## 2. Run the code reviews
33
53
 
@@ -132,7 +152,9 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
132
152
  - Review tier: <light | full | proportional — which reviewers ran, at what built-in effort (medium/high/xhigh/max), and why, per §2.0>
133
153
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
134
154
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>
155
+ - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `$flow-work-status` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
135
156
  - Effective size: <diff size (N changed lines) vs `meta.json.size`, which the tier used, and — when the diff landed within 10% under a tier threshold — that fact (§2.0)>
157
+ - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it.>
136
158
  - Agent models: <the value of `models.workers`/`models.agents` when set; otherwise "inherited from this thread"; agents named in `agents.<role>` keep their own definition's model>
137
159
  - Defaults used: <every empty `FLOW.md` key this round resolved with its default — one per line as `key → default` — or "none". In `guided`/`auto` each is also an entry in `meta.json.defaults_used[]` (flow-core §0); in `manual` the phase may offer one of them at its stop.>
138
160
  - Skipped for budget: <phases dropped by §2.0's give-up order, or "none">
@@ -89,6 +89,10 @@ workers (empty) → fan-out rounds — falls back to `agents`
89
89
  handoff; nothing enforces it.
90
90
  - One line: a role set in `agents.*` keeps its own agent definition's model, so a round can mix
91
91
  configured and self-declared models.
92
+ - **`agents.exec_cmd` set → say so here, next to the models it makes inert.** That command picks the
93
+ model for the review round it runs, so neither key reaches those reviewers while every other phase
94
+ still resolves them normally. A key that silently does nothing is worse than one that is absent,
95
+ and this is the only place a reader finds out.
92
96
 
93
97
  #### 1.5.3 Defaults that keep being used
94
98
 
@@ -221,6 +225,13 @@ refuse) · **degraded** (it runs, quietly worse than the config promises), plus
221
225
  a non-negative integer (`0` = no ceiling; else the default `12` applies). Report both effective
222
226
  numbers with the count of panel members `quality.review_skill`/`quality.reviewers` defines, so
223
227
  the widest command's cost is visible before it is paid, not after.
228
+ - **The `flow-workflows` CLI, which `review` reaches for before it composes a panel**:
229
+ `npx flow-workflows --version` answers, and the number matches this plugin's. Unreachable — no
230
+ node, no network, a machine that installs nothing — is **not** a failure: say so in one line, and
231
+ that the review falls back to reading the diff from git, paying for that material once per
232
+ reviewer. A version *behind* the plugin's is the one that misleads, because the commands then
233
+ describe flags the installed CLI does not have: report both numbers and let the reader decide.
234
+ This is the only check here about something no install step of ours puts on the machine.
224
235
  - The `flow-core` skill file exists under the plugin root: `~/.claude/flow/CORE.codex.md`.
225
236
  Missing → every phase command runs without its shared rules; fix: reinstall or update the plugin.
226
237
 
@@ -346,5 +346,5 @@ If there were no copied contracts (design said "none"), skip this step and recor
346
346
  - Update `meta.json`: `phase = "build"`, add to `phases_done`.
347
347
  - Multi-MR/PR build: leave the current MR/PR `in_progress` in `meta.json.mrs` (it becomes `merged` when `$flow-feat-ship` confirms the merge). **Also add `build` to that MR/PR's own `phases_done`** (its `mrs[]` entry) — the per-MR/PR marker the downstream gates read.
348
348
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
349
- - Report **following the stop header** (flow-core §3), then in bullets: files touched (high level), pending items, **result of §4.2 (contracts verified)**, and **any premise left unsettled by §2.1bis** — one line, in the language of what breaks if it is false. An open premise the user never hears about is an assumption they were not asked about. Next command: `$flow-feat-review` — in `guided`/`auto` say so in the `I need:` line ("nothing, chaining into review"), never as a question.
349
+ - Report **following the stop header** (flow-core §3) **only when this is a stop** — `manual`, or a blocker in any mode. Then in bullets: files touched (high level), pending items, **result of §4.2 (contracts verified)**, and **any premise left unsettled by §2.1bis** — one line, in the language of what breaks if it is false. An open premise the user never hears about is an assumption they were not asked about. In `guided`/`auto` `$flow-feat-review` runs in this same turn, so there is no report here: those same points go to the phase artifact, `panel.json` carries `Now`/`Next`, and the turn opens with the call that chains.
350
350
  - **Autonomy handoff.** The summary is a report, not the end of the flow. `manual`: stop and propose `$flow-feat-review` with a single `AskUserQuestion` (recommended option by default); invoke it only on confirmation, never make the user type it. `guided`/`auto`: **chain into `$flow-feat-review` automatically** in this same turn, without asking — never end the turn with the next command as a suggestion.
@@ -28,6 +28,26 @@ Mandatory review phase. **`$flow-feat-ship` cannot run without passing through h
28
28
  - **A premise left open by `build` §2.1bis is an input to this review, not a note.** Every row of "Premises the change depends on" whose verdict is `unsettled` enters §6 as an **ambiguous finding** (it rests, by construction, on code outside the diff) and is named in §7 whether or not the gate opened. A premise the build could not settle and the review does not mention is one the MR/PR ships as a fact.
29
29
  - Require `build` in `phases_done`. **In a multi-MR/PR work** (`meta.json.mrs` has >1 entry) require `build` in the **current `in_progress` MR/PR's** own `phases_done` (its `mrs[]` entry) — a previous MR/PR's `build` does not count. If missing, send the user to `$flow-feat-build` and stop.
30
30
  - Check that `git diff` has real changes. None → warn and stop.
31
+ - **Gather the material once, not once per reviewer.** `npx flow-workflows bundle --checks` prints
32
+ one context pack for this branch — worklist, the diff (minus `git.diff_exclude`), the changed files
33
+ in full, the raw output of `quality.static_analysis`, and the work's handoff — in a single call.
34
+ Read that instead of rediscovering it, and **pass it to the briefs of §2-§6**: a panel where every
35
+ member runs its own `git diff` and opens the same files pays for that material once per agent, and
36
+ a reviewer that spends its turns exploring has fewer left to review. **Any non-zero exit is a
37
+ fallback, not a failure** — no CLI on the machine, a base that does not resolve, a network that
38
+ cannot reach it: read the diff from git as before and carry on, once, without retrying variants.
39
+ What is not optional is the `Review path` line of §8: a round that skipped the pack and one that
40
+ used it are indistinguishable from the artifact otherwise, which is how a phase quietly stops
41
+ paying for itself.
42
+ - **`agents.exec_cmd` set → the panel runs from the CLI.** Not a choice to weigh: run
43
+ `npx flow-workflows review`, which spawns that command once per role over the pack above — **one
44
+ turn each instead of an agentic loop each** — and returns the findings already deduplicated, with
45
+ the reviewers it dropped for `agents.budget_max` named. Exactly three things send the round to the
46
+ agentic panel below: the key is empty (the default — nothing changes without it), the CLI is
47
+ unavailable by the rule above, or **every** role came back empty, which is a broken `exec_cmd` and
48
+ not a clean diff. Whichever happened is named in §8. When the CLI runs the panel, that command
49
+ picks the model, so `models.agents`/`models.workers` do not reach those reviewers. A one-shot sweep
50
+ cannot pull a thread, so an ambiguous finding still goes to a real agent with tools, as below.
31
51
 
32
52
  ## 2. Invoke the code reviews
33
53
 
@@ -282,8 +302,10 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
282
302
  ## Summary
283
303
  - Review tier: <full | proportional | light — which reviewers ran, at what built-in effort (medium/high/xhigh/max), and why, per §2.0>
284
304
  - Effective size: <diff size (N changed lines) vs `meta.json.size`, which of the two the tier used, and — when the diff pointed higher — that the work may be misclassified. When the diff landed within 10% under a tier threshold, say so here (§2.0).>
305
+ - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it.>
285
306
  - Agent models: <the value of `models.workers`/`models.agents` when set; otherwise "inherited from this thread" — plus, when the panel ran, that agents named in `agents.<role>` kept the model their own definition sets. The values as they are, no judgement on them>
286
307
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>, effort <medium|high|xhigh|max>
308
+ - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `$flow-work-status` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
287
309
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
288
310
  - Completeness rounds (M/L): N
289
311
  - Critical findings (block ship): N
@@ -346,5 +368,5 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
346
368
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `$flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
347
369
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
348
370
  - **Configuration this phase earned the right to ask about** (flow-core §0, `manual` only, at most one key per work, as an extra option on this same stop — never a question of its own): a role the panel had to improvise on an M/L or sensitive diff → `agents.<role>`; a `Cost:` line that went over `agents.budget_max` → `quality.review_depth`. In `guided`/`auto` neither is asked: the default is taken and recorded in `meta.json.defaults_used[]`.
349
- - Report findings and next step **following the stop header** (flow-core §3); include the `Cost:` line once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
371
+ - Report findings and next step **following the stop header** (flow-core §3) **when this is a stop**; in `guided`/`auto` with a clean gate the next command runs in this same turn, so this goes to `06-review.md` and the turn opens with the call that chains — the `Cost:` line then travels to the stop the run does reach, added to that phase's own. Include it once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
350
372
  - **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate). Clean: in `manual`, propose `$flow-feat-validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `$flow-feat-validate` automatically** in this same turn. Never chain into `$flow-feat-ship` from here — ship is reached through `validate`.
@@ -285,5 +285,5 @@ Run `tracker.start_cmd` with `{TICKET}` = `meta.json.ticket`, `{ASSIGNEE}` = `tr
285
285
  ## 7. Close
286
286
 
287
287
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5) — first written in §6; refresh it if §6.5 changed anything.
288
- - Report **following the stop header** (flow-core §3), branch added, body 2-3 lines: ticket, size, branch; recommended next command per the §4 table — in `guided`/`auto` you run it in this same turn, so say so in the `I need:` line instead of asking.
288
+ - Report **following the stop header** (flow-core §3), branch added, body 2-3 lines: ticket, size, branch; recommended next command per the §4 table — in `guided`/`auto` you run it in this same turn, so there is no report and no question here: update `panel.json` and chain (flow-core §3).
289
289
  - Apply `autonomy.mode`: `manual` → stop and let the user invoke the recommended command; `guided`/`auto` → chain into it, subject to the hard gates (the §5 branch-base ambiguity already stops on its own).
@@ -44,6 +44,10 @@ editing. This is an optional migration, not part of a normal update.
44
44
 
45
45
  ## 2. Auto-detection (do NOT ask about what you can infer)
46
46
 
47
+ <!-- stack-detection:start — the one place in this plugin that may name an
48
+ ecosystem's tools. Recognising eleven stacks is not depending on one;
49
+ outside these markers a tool name belongs in a FLOW.md key. -->
50
+
47
51
  Run, deduce, show what was found for confirmation or correction:
48
52
 
49
53
  - **Git host and CLI** — from `git remote -v`:
@@ -53,6 +57,10 @@ Run, deduce, show what was found for confirmation or correction:
53
57
  - Unknown domain (self-hosted) → ask which host (GitLab/Gitea/other) and which CLI.
54
58
  - Installed CLIs: `command -v gh glab tea az`.
55
59
  - **Base branch** — `git symbolic-ref refs/remotes/origin/HEAD` (or `git remote show origin`): `origin/main` or `origin/master` → `git.default_base`.
60
+ - **Generated files** — the lock, build and generated-migration paths this repo tracks, from what the
61
+ ecosystem markers above imply plus what `git ls-files` shows at the root → propose `git.diff_exclude`.
62
+ These cost context in every phase that opens the diff and buy nothing: nobody reviews a lockfile.
63
+ Nothing tracked that matches → leave the key out.
56
64
  - **Quality commands** — propose what the repo has (empty if nothing found):
57
65
  - `Makefile` → targets `test`, `lint`, `phpstan`/`stan`, `cs-fixer`/`fmt`, `database`/`migrate`.
58
66
  - `package.json` → `scripts` (test, lint, build, typecheck).
@@ -67,6 +75,8 @@ Run, deduce, show what was found for confirmation or correction:
67
75
  - **Data access** (`data.*`, all optional) — only if the repo talks to a database. Find the client and the local stack (a `docker-compose.yml` service, a `DATABASE_URL`/`DB_*` env var, a `Makefile` target that opens a shell). Propose `data.explain_cmd` and `data.schema_cmd` in the engine's dialect against the **development** database — MySQL over Docker Compose: `docker compose exec -T <db-service> mysql <db> -e "EXPLAIN {QUERY}"` and `… -e "SHOW CREATE TABLE {TABLE}"`; PostgreSQL: `psql -c "EXPLAIN (ANALYZE, BUFFERS) {QUERY}"` / `\d+ {TABLE}`. Leave `sandbox_cmd`/`seed_cmd`/`volumes` empty unless the user has something ready. Nothing detected → leave the section out (the query duel degrades to schema-only and says so).
68
76
  - **Knowledge sources** (`knowledge.*`) — look at the MCP tools exposed in this session: `mcp__domain-memory__*` → propose `search: mcp__domain-memory__search_knowledge`, `stage: mcp__domain-memory__stage_finding`, `read_staging: mcp__domain-memory__read_staging`, `save: mcp__domain-memory__save_knowledge`; any other tool whose name says search / query / knowledge / memory / graph (e.g. `mcp__codegraph__*`) → propose it as an additional `search` entry, roles it cannot fill left empty. A `docs/adr` or similar folder with no MCP → propose `search: rg -n -i "{QUERY}" docs/adr`. Nothing found → leave the section out. MCP and harness tool names detected in this session belong in the active overlay; a plain repo command such as the `rg` example belongs in `FLOW.md`.
69
77
 
78
+ <!-- stack-detection:end -->
79
+
70
80
  ## 3. Ask five things
71
81
 
72
82
  Everything §2 detected is shown **in one screen** for confirmation or correction — host, base
@@ -40,12 +40,14 @@ Overview of works in progress; detects divergences between artifacts and actual
40
40
  MR/PRs: 2/4 merged · MR/PR #3 in_progress · MR/PR #4 pending
41
41
  Cross-repo: <meta.related_repos entries not "done", as "repo: scope"> (line only if any)
42
42
  Follow-ups: 2 awaiting a decision · 1 accepted, not started (line only if any)
43
+ Cost: $0.71 measured over 2 phases · 1 phase not reported (line only if any)
43
44
  Next: <suggested next command>
44
45
  ```
45
46
 
46
47
  - "MR"/"PR" from `git.host` (`gitlab` → MR, every other host → PR); no host → "MR/PR".
47
48
  - `Cross-repo:` only when `meta.json.related_repos` has entries not `done`: each as `<repo>: <scope>`, appending ` — contract not handed over` when that entry's `contract_handoff` is `pending`. It flags that a **sibling repo still has a pending part**; flow never scans or touches the other repo.
48
49
  - `Follow-ups:` only when `meta.json.followups[]` has entries not `declined`/`logged`/`done` (flow-core §7): count the `proposed` ones as *awaiting a decision* and the `accepted` ones without a `work` as *accepted, not started*, naming the ticket id when there is one. `in_progress` entries are already visible as their own work — do not double-count them.
50
+ - `Cost:` only when `meta.json.cost[]` has entries (flow-core §4): sum the `usd` figures that are there, count the phases behind them, and count separately the entries whose `source` is `not reported`. A work with no entries shows **no line at all** — absence is not zero, and a `$0.00` under a work nobody measured is the one output that would make the block worth ignoring. The figures are the harness's own client-side estimates, not a bill; `flow cost` prints the same data phase by phase.
49
51
  - `MR/PRs:` only when `meta.json.mrs` exists with >0 entries:
50
52
  - Summary: `<merged>/<total> merged`.
51
53
  - `closed` or `superseded` MR/PRs present → add to the count: `2/4 merged · 1 closed · 1 pending`.
@@ -135,8 +135,8 @@ was wise.
135
135
  | Mode | Decisions | End of the command |
136
136
  |---|---|---|
137
137
  | `manual` | Stop at every decision point | Propose the next command with one `AskUserQuestion` (recommended step as default). Invoke it only on confirmation. Never make the user type it. |
138
- | `guided` | Resolve low-risk, unambiguous ones with the recommended default and **record** the choice in the phase artifact. Ask at genuine decision points. | Chain into the recommended next command automatically. |
139
- | `auto` | As `guided`, plus resolve the remaining decision points with sensible, recorded defaults. | Chain without pausing. |
138
+ | `guided` | Resolve low-risk, unambiguous ones with the recommended default and **record** the choice in the phase artifact. Ask at genuine decision points. | Chain into the recommended next command automatically — the call that starts it first, no closing report before it (§3). |
139
+ | `auto` | As `guided`, plus resolve the remaining decision points with sensible, recorded defaults. | Chain without pausing, same rule. |
140
140
 
141
141
  **Hard gates — stop and ask in every mode, no exceptions:**
142
142
  1. Any push or MR/PR creation (all of `ship`).
@@ -163,15 +163,33 @@ Asking these anyway is how an unattended run degrades into a manual one.
163
163
 
164
164
  ## 3. Reporting — how every stop reads
165
165
 
166
+ **A stop is where you hand the screen back**: a question, a hard gate, the end of the flow.
167
+ Nothing else is a stop, however much has just finished — a phase closing into the next one, a
168
+ chained command, a fan-out about to launch. The header below is the *shape* of a stop, so writing
169
+ it is how you stop: render it while meaning to continue and you will stop anyway. The shape
170
+ decides, not the intention — and on a harness where a message carrying text and no tool call is
171
+ terminal by construction, the turn is over before you notice.
172
+
173
+ - **Continuing? Do not report — act.** No header, no closing bullets. At most one short line naming
174
+ what you are moving to, and the tool call that starts it **in the same message**. Never end a
175
+ message on a promise to keep going.
176
+ - **The continuing call goes first.** When a step closes and the next one runs anyway
177
+ (`guided`/`auto` chaining, §2), the turn opens with the call that starts it, not with prose about
178
+ the one that ended. **A report is never the last thing in a turn you meant to continue.**
179
+ - **Progress belongs to the panel, not to a turn.** Someone watching reads `panel.json` (§4):
180
+ `Now`, `Next`. Writing it costs no turn and no stop; saying it in chat costs both.
181
+ - **Stopping? Then say so.** `I need:` names the decision or the action you are waiting on. It
182
+ never announces that you are continuing — if you were, you would not be writing this header.
183
+
166
184
  The user comes back to a screen they walked away from, often with other works in other panes.
167
- They have read none of your tool calls, subagent reports or artifacts. So every stop — a question,
168
- a hard gate, the end of the turn — **opens with this header**, before any prose:
185
+ They have read none of your tool calls, subagent reports or artifacts. So every stop **opens with
186
+ this header**, before any prose:
169
187
 
170
188
  ```
171
189
  <TICKET> · <size> · phase <phase> · MR #<n> of <N>
172
190
  Plan: <k> of <N> shipped — #1 <url/id> <state> · #2 <state> · #3–#N pending
173
191
  Now: <one line — what just finished>
174
- I need: <one line — the decision or action needed, or "nothing, continuing with X">
192
+ I need: <one line — the decision or action you are waiting on>
175
193
  ```
176
194
 
177
195
  - Every fact from `meta.json` (`ticket`, `size`, `phase`, `mrs[]`), never from memory. Drop the `MR #` and `Plan:` lines when the work has no `mrs`.
@@ -185,7 +203,8 @@ I need: <one line — the decision or action needed, or "nothing, continuing wit
185
203
  ## 4. Live panel — `panel.json`
186
204
 
187
205
  Whenever the state a panel would show changes, overwrite `.claude/work/<work>/panel.json`
188
- **whole** (never patch) from `meta.json` plus what you know right now:
206
+ **whole** (never patch) from `meta.json` plus what you know right now. **Any progress line you were
207
+ about to type into the chat is a panel write instead** (§3):
189
208
 
190
209
  ```json
191
210
  {
@@ -215,6 +234,15 @@ Whenever the state a panel would show changes, overwrite `.claude/work/<work>/pa
215
234
  - **When:** (a) in pre-flight, as soon as `meta.json` is loaded; (b) immediately **before** every stop header; (c) **before** any long stretch (fan-out, full suite, CI poll) — never after, so a step that dies halfway is not shown as finished. When the stretch will outlast the ~30 min staleness warning, set `stale_after_minutes` to what it will really take; (d) wherever `## Close` updates `meta.json`.
216
235
  - **Rules:** `phase` is the phase you are **running now** (not `meta.json.phase`, which advances only at Close). `header: true` means ticket, type, phase and age are drawn by the reader — do not repeat them in `lines`. Keep it under ~14 lines. Every fact from `meta.json` and the artifacts — an invented MR/PR state is worse than a blank panel. `updated_at` from the real clock (`date -Iseconds`), never carried over. Write in the language of the work's artifacts. No work folder (lightweight `respond`/`green`) → nothing to write.
217
236
 
237
+ ### `meta.json.cost[]` — what a phase measured, when it could
238
+
239
+ A phase that can measure what it spent appends one entry: `{ "phase": "review", "at": "<ISO>",
240
+ "reviewers": 8, "usd": 0.0124, "source": "harness" }`. `flow review --record` writes it; `flow cost`
241
+ reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
242
+ that reports no figure is recorded with `"source": "not reported"` rather than estimated, and a
243
+ phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
244
+ client-side estimate and can differ from a bill.
245
+
218
246
  ## 5. Work summary — `00-summary.md`
219
247
 
220
248
  Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
@@ -446,7 +474,7 @@ not `declined`/`logged`/`done`: a work being finished is precisely when its defe
446
474
 
447
475
  Mid-phase, the user corrects you. *«We don't put that in a listener here, use a message handler.»*
448
476
  *«Never mock the repository in that layer.»* *«The test command is `make test-unit`, not
449
- `bin/phpunit`.»* *«Stop proposing a DTO for that, we pass the entity.»* You comply, the phase closes,
477
+ `bin/test`.»* *«Stop proposing a DTO for that, we pass the entity.»* You comply, the phase closes,
450
478
  and the next work on the same repo proposes the same thing again. The place for these exists —
451
479
  `FLOW.md`'s `conventions` and `quality` — and nothing on the path from the correction to that file is
452
480
  automatic: the user has to notice they have said it three times and go and edit it.
@@ -163,6 +163,6 @@ Never the third way: building the mechanism here because the ticket says bug.
163
163
  - Update `meta.json`: `phase = "fix"`, add to `phases_done`.
164
164
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
165
165
  - Suggest next: `/flow:bug:validate` (S/M/L) or `/flow:bug:review` (XS).
166
- - Report **following the stop header** (flow-core §3) and name **any premise left unsettled by §2.2** in one line — what breaks if the cause was not the whole cause. `validate` builds its regression test on that assumption, so it is the one thing the user should hear before it is written.
166
+ - Report **following the stop header** (flow-core §3) **when this is a stop** — in `guided`/`auto` the next command runs in this same turn, so the body below goes to the artifact and the turn opens with the call that chains. Name **any premise left unsettled by §2.2** in one line — what breaks if the cause was not the whole cause. `validate` builds its regression test on that assumption, so it is the one thing the user should hear before it is written.
167
167
  - **Autonomy handoff** (flow-core §2): `manual` → propose that command with a single `AskUserQuestion` (recommended option by default), invoke it only on confirmation; `guided`/`auto` → chain into it in this same turn.
168
168
  """
@@ -24,6 +24,26 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
24
24
  - **A premise left open by `fix` §2.2 is an input to this review, not a note.** Every row of "Premises the fix depends on" whose verdict is `unsettled` enters §5 as an **ambiguous finding** and is named in §7 whether or not that gate opened — in a bug it is usually the claim that the root cause was the whole cause, which is exactly what the regression test cannot prove.
25
25
  - Require `fix` in `phases_done`; for `size` ≥ S also require `validate`.
26
26
  - `git diff` shows no changes → warn and stop.
27
+ - **Gather the material once, not once per reviewer.** `npx flow-workflows bundle --checks` prints
28
+ one context pack for this branch — worklist, the diff (minus `git.diff_exclude`), the changed files
29
+ in full, the raw output of `quality.static_analysis`, and the work's handoff — in a single call.
30
+ Read that instead of rediscovering it, and **pass it to the briefs of §2-§5**: a panel where every
31
+ member runs its own `git diff` and opens the same files pays for that material once per agent, and
32
+ a reviewer that spends its turns exploring has fewer left to review. **Any non-zero exit is a
33
+ fallback, not a failure** — no CLI on the machine, a base that does not resolve, a network that
34
+ cannot reach it: read the diff from git as before and carry on, once, without retrying variants.
35
+ What is not optional is the `Review path` line of §7: a round that skipped the pack and one that
36
+ used it are indistinguishable from the artifact otherwise, which is how a phase quietly stops
37
+ paying for itself.
38
+ - **`agents.exec_cmd` set → the panel runs from the CLI.** Not a choice to weigh: run
39
+ `npx flow-workflows review`, which spawns that command once per role over the pack above — **one
40
+ turn each instead of an agentic loop each** — and returns the findings already deduplicated, with
41
+ the reviewers it dropped for `agents.budget_max` named. Exactly three things send the round to the
42
+ agentic panel below: the key is empty (the default — nothing changes without it), the CLI is
43
+ unavailable by the rule above, or **every** role came back empty, which is a broken `exec_cmd` and
44
+ not a clean diff. Whichever happened is named in §7. When the CLI runs the panel, that command
45
+ picks the model, so `models.agents`/`models.workers` do not reach those reviewers. A one-shot sweep
46
+ cannot pull a thread, so an ambiguous finding still goes to a real agent with tools, as below.
27
47
 
28
48
  ## 2. Run the code reviews
29
49
 
@@ -128,7 +148,9 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
128
148
  - Review tier: <light | full | proportional — which reviewers ran, at what built-in effort (medium/high/xhigh/max), and why, per §2.0>
129
149
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
130
150
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>
151
+ - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `/flow:work:status` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
131
152
  - Effective size: <diff size (N changed lines) vs `meta.json.size`, which the tier used, and — when the diff landed within 10% under a tier threshold — that fact (§2.0)>
153
+ - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it.>
132
154
  - Agent models: <the value of `models.workers`/`models.agents` when set; otherwise "inherited from this thread"; agents named in `agents.<role>` keep their own definition's model>
133
155
  - Defaults used: <every empty `FLOW.md` key this round resolved with its default — one per line as `key → default` — or "none". In `guided`/`auto` each is also an entry in `meta.json.defaults_used[]` (flow-core §0); in `manual` the phase may offer one of them at its stop.>
134
156
  - Skipped for budget: <phases dropped by §2.0's give-up order, or "none">
@@ -85,6 +85,10 @@ workers (empty) → fan-out rounds — falls back to `agents`
85
85
  handoff; nothing enforces it.
86
86
  - One line: a role set in `agents.*` keeps its own agent definition's model, so a round can mix
87
87
  configured and self-declared models.
88
+ - **`agents.exec_cmd` set → say so here, next to the models it makes inert.** That command picks the
89
+ model for the review round it runs, so neither key reaches those reviewers while every other phase
90
+ still resolves them normally. A key that silently does nothing is worse than one that is absent,
91
+ and this is the only place a reader finds out.
88
92
 
89
93
  #### 1.5.3 Defaults that keep being used
90
94
 
@@ -217,6 +221,13 @@ refuse) · **degraded** (it runs, quietly worse than the config promises), plus
217
221
  a non-negative integer (`0` = no ceiling; else the default `12` applies). Report both effective
218
222
  numbers with the count of panel members `quality.review_skill`/`quality.reviewers` defines, so
219
223
  the widest command's cost is visible before it is paid, not after.
224
+ - **The `flow-workflows` CLI, which `review` reaches for before it composes a panel**:
225
+ `npx flow-workflows --version` answers, and the number matches this plugin's. Unreachable — no
226
+ node, no network, a machine that installs nothing — is **not** a failure: say so in one line, and
227
+ that the review falls back to reading the diff from git, paying for that material once per
228
+ reviewer. A version *behind* the plugin's is the one that misleads, because the commands then
229
+ describe flags the installed CLI does not have: report both numbers and let the reader decide.
230
+ This is the only check here about something no install step of ours puts on the machine.
220
231
  - The `flow-core` skill file exists under the plugin root: `~/.claude/flow/CORE.gemini.md`.
221
232
  Missing → every phase command runs without its shared rules; fix: reinstall or update the plugin.
222
233
 
@@ -342,6 +342,6 @@ If there were no copied contracts (design said "none"), skip this step and recor
342
342
  - Update `meta.json`: `phase = "build"`, add to `phases_done`.
343
343
  - Multi-MR/PR build: leave the current MR/PR `in_progress` in `meta.json.mrs` (it becomes `merged` when `/flow:feat:ship` confirms the merge). **Also add `build` to that MR/PR's own `phases_done`** (its `mrs[]` entry) — the per-MR/PR marker the downstream gates read.
344
344
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
345
- - Report **following the stop header** (flow-core §3), then in bullets: files touched (high level), pending items, **result of §4.2 (contracts verified)**, and **any premise left unsettled by §2.1bis** — one line, in the language of what breaks if it is false. An open premise the user never hears about is an assumption they were not asked about. Next command: `/flow:feat:review` — in `guided`/`auto` say so in the `I need:` line ("nothing, chaining into review"), never as a question.
345
+ - Report **following the stop header** (flow-core §3) **only when this is a stop** — `manual`, or a blocker in any mode. Then in bullets: files touched (high level), pending items, **result of §4.2 (contracts verified)**, and **any premise left unsettled by §2.1bis** — one line, in the language of what breaks if it is false. An open premise the user never hears about is an assumption they were not asked about. In `guided`/`auto` `/flow:feat:review` runs in this same turn, so there is no report here: those same points go to the phase artifact, `panel.json` carries `Now`/`Next`, and the turn opens with the call that chains.
346
346
  - **Autonomy handoff.** The summary is a report, not the end of the flow. `manual`: stop and propose `/flow:feat:review` with a single `AskUserQuestion` (recommended option by default); invoke it only on confirmation, never make the user type it. `guided`/`auto`: **chain into `/flow:feat:review` automatically** in this same turn, without asking — never end the turn with the next command as a suggestion.
347
347
  """
@@ -24,6 +24,26 @@ Mandatory review phase. **`/flow:feat:ship` cannot run without passing through h
24
24
  - **A premise left open by `build` §2.1bis is an input to this review, not a note.** Every row of "Premises the change depends on" whose verdict is `unsettled` enters §6 as an **ambiguous finding** (it rests, by construction, on code outside the diff) and is named in §7 whether or not the gate opened. A premise the build could not settle and the review does not mention is one the MR/PR ships as a fact.
25
25
  - Require `build` in `phases_done`. **In a multi-MR/PR work** (`meta.json.mrs` has >1 entry) require `build` in the **current `in_progress` MR/PR's** own `phases_done` (its `mrs[]` entry) — a previous MR/PR's `build` does not count. If missing, send the user to `/flow:feat:build` and stop.
26
26
  - Check that `git diff` has real changes. None → warn and stop.
27
+ - **Gather the material once, not once per reviewer.** `npx flow-workflows bundle --checks` prints
28
+ one context pack for this branch — worklist, the diff (minus `git.diff_exclude`), the changed files
29
+ in full, the raw output of `quality.static_analysis`, and the work's handoff — in a single call.
30
+ Read that instead of rediscovering it, and **pass it to the briefs of §2-§6**: a panel where every
31
+ member runs its own `git diff` and opens the same files pays for that material once per agent, and
32
+ a reviewer that spends its turns exploring has fewer left to review. **Any non-zero exit is a
33
+ fallback, not a failure** — no CLI on the machine, a base that does not resolve, a network that
34
+ cannot reach it: read the diff from git as before and carry on, once, without retrying variants.
35
+ What is not optional is the `Review path` line of §8: a round that skipped the pack and one that
36
+ used it are indistinguishable from the artifact otherwise, which is how a phase quietly stops
37
+ paying for itself.
38
+ - **`agents.exec_cmd` set → the panel runs from the CLI.** Not a choice to weigh: run
39
+ `npx flow-workflows review`, which spawns that command once per role over the pack above — **one
40
+ turn each instead of an agentic loop each** — and returns the findings already deduplicated, with
41
+ the reviewers it dropped for `agents.budget_max` named. Exactly three things send the round to the
42
+ agentic panel below: the key is empty (the default — nothing changes without it), the CLI is
43
+ unavailable by the rule above, or **every** role came back empty, which is a broken `exec_cmd` and
44
+ not a clean diff. Whichever happened is named in §8. When the CLI runs the panel, that command
45
+ picks the model, so `models.agents`/`models.workers` do not reach those reviewers. A one-shot sweep
46
+ cannot pull a thread, so an ambiguous finding still goes to a real agent with tools, as below.
27
47
 
28
48
  ## 2. Invoke the code reviews
29
49
 
@@ -278,8 +298,10 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
278
298
  ## Summary
279
299
  - Review tier: <full | proportional | light — which reviewers ran, at what built-in effort (medium/high/xhigh/max), and why, per §2.0>
280
300
  - Effective size: <diff size (N changed lines) vs `meta.json.size`, which of the two the tier used, and — when the diff pointed higher — that the work may be misclassified. When the diff landed within 10% under a tier threshold, say so here (§2.0).>
301
+ - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it.>
281
302
  - Agent models: <the value of `models.workers`/`models.agents` when set; otherwise "inherited from this thread" — plus, when the panel ran, that agents named in `agents.<role>` kept the model their own definition sets. The values as they are, no judgement on them>
282
303
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>, effort <medium|high|xhigh|max>
304
+ - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `/flow:work:status` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
283
305
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
284
306
  - Completeness rounds (M/L): N
285
307
  - Critical findings (block ship): N
@@ -342,6 +364,6 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
342
364
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most and, until now, the one phase that never staged — a work with three review rounds and seventeen blockers produced zero knowledge cards because nothing asked for them while they were in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow:feat:design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
343
365
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
344
366
  - **Configuration this phase earned the right to ask about** (flow-core §0, `manual` only, at most one key per work, as an extra option on this same stop — never a question of its own): a role the panel had to improvise on an M/L or sensitive diff → `agents.<role>`; a `Cost:` line that went over `agents.budget_max` → `quality.review_depth`. In `guided`/`auto` neither is asked: the default is taken and recorded in `meta.json.defaults_used[]`.
345
- - Report findings and next step **following the stop header** (flow-core §3); include the `Cost:` line once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
367
+ - Report findings and next step **following the stop header** (flow-core §3) **when this is a stop**; in `guided`/`auto` with a clean gate the next command runs in this same turn, so this goes to `06-review.md` and the turn opens with the call that chains — the `Cost:` line then travels to the stop the run does reach, added to that phase's own. Include it once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
346
368
  - **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate). Clean: in `manual`, propose `/flow:feat:validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `/flow:feat:validate` automatically** in this same turn. Never chain into `/flow:feat:ship` from here — ship is reached through `validate`.
347
369
  """
@@ -281,6 +281,6 @@ Run `tracker.start_cmd` with `{TICKET}` = `meta.json.ticket`, `{ASSIGNEE}` = `tr
281
281
  ## 7. Close
282
282
 
283
283
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5) — first written in §6; refresh it if §6.5 changed anything.
284
- - Report **following the stop header** (flow-core §3), branch added, body 2-3 lines: ticket, size, branch; recommended next command per the §4 table — in `guided`/`auto` you run it in this same turn, so say so in the `I need:` line instead of asking.
284
+ - Report **following the stop header** (flow-core §3), branch added, body 2-3 lines: ticket, size, branch; recommended next command per the §4 table — in `guided`/`auto` you run it in this same turn, so there is no report and no question here: update `panel.json` and chain (flow-core §3).
285
285
  - Apply `autonomy.mode`: `manual` → stop and let the user invoke the recommended command; `guided`/`auto` → chain into it, subject to the hard gates (the §5 branch-base ambiguity already stops on its own).
286
286
  """