flow-workflows 0.79.0 → 0.81.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.
Files changed (35) hide show
  1. package/adapters/codex/CORE.md +22 -38
  2. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +1 -6
  3. package/adapters/codex/skills/flow-bug-review/SKILL.md +3 -3
  4. package/adapters/codex/skills/flow-doctor/SKILL.md +0 -3
  5. package/adapters/codex/skills/flow-feat-design/SKILL.md +32 -42
  6. package/adapters/codex/skills/flow-feat-review/SKILL.md +14 -15
  7. package/adapters/codex/skills/flow-work-README/SKILL.md +3 -4
  8. package/adapters/codex/skills/flow-work-resume/SKILL.md +0 -1
  9. package/adapters/gemini/CORE.md +22 -38
  10. package/adapters/gemini/commands/flow/bug/investigate.toml +1 -6
  11. package/adapters/gemini/commands/flow/bug/review.toml +3 -3
  12. package/adapters/gemini/commands/flow/doctor.toml +0 -3
  13. package/adapters/gemini/commands/flow/feat/design.toml +32 -42
  14. package/adapters/gemini/commands/flow/feat/review.toml +14 -15
  15. package/adapters/gemini/commands/flow/work/README.toml +3 -4
  16. package/adapters/gemini/commands/flow/work/resume.toml +0 -1
  17. package/adapters/hermes/CORE.md +22 -38
  18. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +1 -6
  19. package/adapters/hermes/skills/flow-bug-review/SKILL.md +3 -3
  20. package/adapters/hermes/skills/flow-doctor/SKILL.md +0 -3
  21. package/adapters/hermes/skills/flow-feat-design/SKILL.md +32 -42
  22. package/adapters/hermes/skills/flow-feat-review/SKILL.md +14 -15
  23. package/adapters/hermes/skills/flow-work-README/SKILL.md +3 -4
  24. package/adapters/hermes/skills/flow-work-resume/SKILL.md +0 -1
  25. package/adapters/opencode/CORE.md +22 -38
  26. package/adapters/opencode/commands/flow-bug-investigate.md +1 -6
  27. package/adapters/opencode/commands/flow-bug-review.md +3 -3
  28. package/adapters/opencode/commands/flow-doctor.md +0 -3
  29. package/adapters/opencode/commands/flow-feat-design.md +32 -42
  30. package/adapters/opencode/commands/flow-feat-review.md +14 -15
  31. package/adapters/opencode/commands/flow-work-README.md +3 -4
  32. package/adapters/opencode/commands/flow-work-resume.md +0 -1
  33. package/package.json +1 -1
  34. package/plugins/flow/.claude-plugin/plugin.json +1 -1
  35. package/plugins/flow/CHANGELOG.md +34 -0
@@ -17,7 +17,7 @@ Every `$flow-*` command assumes these rules. They are stated once, here, so a co
17
17
  carries what is specific to its phase. Read this once per session; a command that says "load
18
18
  `flow-core`" means this file.
19
19
 
20
- **This file belongs to flow `0.79.0`.** Compare it once, at the start of the session, against
20
+ **This file belongs to flow `0.81.0`.** Compare it once, at the start of the session, against
21
21
  `version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
22
22
  is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
23
23
  — which is exactly what happens when a branch or a release candidate is loaded over an installed
@@ -30,12 +30,9 @@ a command relies on is simply absent in that session, and nothing else will repo
30
30
  - **Look before you read.** The first thing a phase does about configuration is list what is there:
31
31
  `ls <root>/FLOW*.md` (the root being the one the next bullet resolves). One call, and it is not
32
32
  optional — **an overlay you did not list is an overlay you did not read**, and nothing downstream
33
- will notice. This is not a hypothetical: every command below, and every artifact they write,
34
- refers to the effective configuration as "`FLOW.md`", which is a file that exists, so reading it
35
- and stopping feels finished. Two real sessions in a row read the base in full and never went
36
- looking for the overlay sitting beside it — the models it set were silently the defaults, and
37
- both runs reported the keys as unset with no way to tell that apart from a repo that never set
38
- them. **Name the files this listing found the first time a phase reports any configured value**,
33
+ will notice. Every command and artifact calls the effective configuration "`FLOW.md`", a file that
34
+ exists, so reading it and stopping feels finished — and a missed overlay reports its keys as unset,
35
+ indistinguishable from a repo that never set them. **Name the files this listing found the first time a phase reports any configured value**,
39
36
  so a missed overlay is visible in the artifact rather than invisible everywhere.
40
37
  - Read `FLOW.md` at the repo root as the base, then the optional overlay for the harness running
41
38
  this command: `FLOW.claude.md`, `FLOW.codex.md`, `FLOW.opencode.md`, `FLOW.gemini.md`,
@@ -68,11 +65,8 @@ a command relies on is simply absent in that session, and nothing else will repo
68
65
  - **A fenced block in a FLOW file is an example, and an example is not configuration.** These
69
66
  files are prose with keys in them, and the rule that decides what a key *is* — a `- key:` line
70
67
  under a `## section` — knows nothing about triple backticks. So a block written to be pasted
71
- ("add this to try it once") was read as the configuration it illustrates, for as long as it sat
72
- there. It happened in a real repo: `agents.exec_cmd` came from the fenced example of a file whose
73
- prose argued at length that it was deliberately unset, and every review round took the one-shot
74
- path that prose warned against — with nothing anywhere to say so, because the file and the
75
- configuration disagreed while both looked right. **Skip fenced regions when you read a FLOW
68
+ ("add this to try it once") would be read as the configuration it illustrates, while the prose
69
+ around it says otherwise and nothing reports the disagreement. **Skip fenced regions when you read a FLOW
76
70
  file**; `flow-workflows` does the same, so the two of you resolve the same config.
77
71
  - Merge by section and key. A key present in the active overlay replaces the base value; a key
78
72
  absent there inherits the base. **A present-but-empty overlay key masks the base** and resolves
@@ -93,7 +87,7 @@ a command relies on is simply absent in that session, and nothing else will repo
93
87
  alongside whatever it was already asking. Resolve the destination by the ownership rule below.
94
88
  Never a question of its own, never a key off the list, and at most **one key per work** — the
95
89
  second one waits for the next work or for `$flow-init`.
96
- 3. `guided`/`auto` → take the default and **record** it: one line in the phase artifact as today,
90
+ 3. `guided`/`auto` → take the default and **record** it: one line in the phase artifact,
97
91
  plus an entry in `meta.json.defaults_used[]` — `{ "key": "agents.security", "default":
98
92
  "general-purpose", "phase": "review" }`. Asking here would break the never-a-question contract
99
93
  (§2); recording keeps the decision readable afterwards, and `$flow-doctor` aggregates it.
@@ -120,8 +114,7 @@ a command relies on is simply absent in that session, and nothing else will repo
120
114
  the consolidation appends to `KNOWLEDGE.md` at the repo root. Per-call timeout
121
115
  `knowledge.timeout_s` (empty = 2 s); a failure or timeout → continue without it, silently.
122
116
  **How a consolidation runs** (`ship`, `postmortem`, `abandon`, and the offer in `$flow-work-status`
123
- when `read_staging` has entries). No role set at all → say so in one line and stop; nothing here is
124
- worth a command of its own, which is why there is no longer one:
117
+ when `read_staging` has entries). No role set at all → say so in one line and stop:
125
118
 
126
119
  1. **Read the staging** for this branch with `knowledge.read_staging`; the role empty → the "why"
127
120
  findings already written in this work's artifacts (`03-design.md` ADR-light and challenges,
@@ -271,7 +264,7 @@ right now. **Any progress line you were about to type into the chat is a panel u
271
264
  **Two transports, one document.** When the tools `panel_set` / `panel_patch` / `panel_get` are
272
265
  available, this console is a pane of agent-terminal: publish the panel through them (§4.2) and
273
266
  **stop writing `.claude/work/<work>/panel.json`** — while a pane is claimed, its file is not read at
274
- all. When they are not there, write the file exactly as before (§4.3). No work folder (lightweight
267
+ all. When they are not there, write the file (§4.3). No work folder (lightweight
275
268
  `respond`/`green`) → nothing to publish, either way.
276
269
 
277
270
  **Look for them before you conclude they are missing**, once per session, in pre-flight. A harness
@@ -414,8 +407,7 @@ single largest token cost of a work, so every work carries a short handoff:
414
407
  MR/PR of `04-mr-plan.md`; `review` opens the design's contracts and the implementation log;
415
408
  `ship` opens the brief and the review verdict. A summary that does not answer the question you
416
409
  have is the cue to open the artifact — never a licence to guess.
417
- - Missing summary (a work started before this rule) → read the artifacts as before, write the
418
- summary at your Close.
410
+ - Missing summary → read the artifacts, write the summary at your Close.
419
411
  - **Name the phase, never the command.** An artifact outlives the session that wrote it and may be
420
412
  resumed from a different agent, where the same phase is invoked under another name. Write the
421
413
  phase — `validate`, `review`, `ship #2` — not the invocation. Applies to `00-summary.md`,
@@ -450,7 +442,7 @@ around each of its own findings to work out which changes are its doing, and how
450
442
  looks clean is clean by luck. **The parent thread is a writer too**: applying a round's fixes while
451
443
  its agents are still reading is the same collision, from the side nobody counts.
452
444
 
453
- So a round that contains a writer is not one round. Readers fan out freely, as they always did;
445
+ So a round that contains a writer is not one round. Readers fan out freely;
454
446
  writers go one at a time, each either alone or in a worktree of its own, and the readers sit
455
447
  entirely before them or entirely after them. The parent's own edits wait until the round is
456
448
  consolidated. Ordering costs wall clock and the phase says so in one line — a reading nobody can
@@ -492,8 +484,7 @@ Dropping a silent agent is always allowed, and always reported (`N/M` reported).
492
484
  no deadline is what costs a session.
493
485
 
494
486
  **The budget belongs to the command, not to the round.** `agents.fanout_max` caps *one* parallel
495
- round; nothing capped what a command spends across all of its rounds, and the phases that fan out
496
- compose: a review can run a panel, then area reinforcements, then a coverage sweep that relaunches
487
+ round, and the phases that fan out compose: a review can run a panel, then area reinforcements, then a coverage sweep that relaunches
497
488
  the panel, then one skeptic per finding — each round inside its own cap and the command an order of
498
489
  magnitude over what anyone intended.
499
490
 
@@ -558,15 +549,13 @@ must *react to* mid-wait is not a wait at all: it is the work, and it stays here
558
549
  ### 6.6 — Which agent a role resolves to
559
550
 
560
551
  **The harness already tells you which agents are installed**, each with a line on what it is for,
561
- and choosing the one that fits a piece of work is something you do well without being told. A rule
562
- that answers every empty role with `general-purpose` throws that away: a repo with a frontend
563
- specialist installed and no `agents.frontend` got a generalist told to act like one. So wherever a
552
+ and choosing the one that fits a piece of work is something you do well without being told. Answering every empty role with `general-purpose` throws that away. So wherever a
564
553
  command says *"`agents.<role>`, empty → `Agent general-purpose` with the role"*, it means this:
565
554
 
566
- 1. **`agents.<role>` names an agent** → that agent, as always.
555
+ 1. **`agents.<role>` names an agent** → that agent.
567
556
  2. **Empty** → the installed agent whose description fits the role **and this work's stack** best —
568
557
  read the list your harness gives you, never a guess at a name. None fits clearly →
569
- `general-purpose` with the role in the prompt, as before. An agent that fits the role but not the
558
+ `general-purpose` with the role in the prompt. An agent that fits the role but not the
570
559
  stack (a PHP reviewer on a React diff) does not fit.
571
560
 
572
561
  **`agents.selection`** decides how far your judgement reaches:
@@ -712,11 +701,11 @@ one more thing the user has to decide about.
712
701
  "title": "one line, what would be done",
713
702
  "why": "one line, why it was parked and why it still matters",
714
703
  "source": "design" | "plan" | "build" | "validate" | "fix" | "postmortem",
715
- "status": "proposed" | "accepted" | "declined" | "logged" | "done",
704
+ "status": "proposed" | "accepted" | "in_progress" | "declined" | "logged" | "done",
716
705
  "ticket": null, "work": null, "note": "" }
717
706
  ```
718
707
 
719
- The artifact keeps its human-readable section exactly as before, with the `F<n>` id in front of each
708
+ The artifact keeps its human-readable section, with the `F<n>` id in front of each
720
709
  row so the prose and the record never drift. **The record is the addition, not a replacement**: a
721
710
  reader of `05-implementation.md` still sees the ideas in context.
722
711
 
@@ -751,8 +740,8 @@ at `ship`'s Close, when the work is done and the user can see the whole set.
751
740
 
752
741
  **A skeptic sorts them before the user sees them.** `$flow-*-review` already refuses to hand over an
753
742
  unverified finding: its §6 gives each ambiguous one to a skeptic whose job is to *refute* it, burden
754
- of proof on the finding. Deferred work reached the user through no filter at all, judged only by the
755
- phase that parked it — the one party that cannot judge it, having just found it. So at Close, when
743
+ of proof on the finding. Deferred work needs the same filter: the phase that parked it is the one party that cannot judge
744
+ it, having just found it. So at Close, when
756
745
  **3 or more** entries are still `proposed`, they go to a skeptic first (grouped into at most
757
746
  `agents.fanout_max` briefs, the ceilings of §6 unchanged; **fewer than 3 → no agent**, the command
758
747
  applies the bar itself):
@@ -779,15 +768,10 @@ Then, and only then, the survey:
779
768
  **Not worth it** · **Later**. The `title` and `why` are the entire prompt. **`decision` entries
780
769
  are asked as their product question** — they never go to the skeptic, a question's value not being
781
770
  a thing to refute — and sit outside the ceiling.
782
- - **`tooling` asks nothing.** `logged`, and a count on screen. Asking **Log it** about a lint floor
783
- with slack in it was one question too many.
771
+ - **`tooling` asks nothing.** `logged`, and a count on screen.
784
772
  - **Not worth it** → `declined`, with the reason if given. Never asked again.
785
773
  - **`logged` is a status, not a destination.** The entry stays exactly where it already is — in
786
- `meta.json.followups[]` and in its artifact section — and no file is written anywhere. This used
787
- to append a line to a versioned debt log, one per repo; **that file is gone**. No command read it,
788
- `status` and `daily` excluded it on purpose, and it duplicated a record the work already keeps
789
- forever, so it grew without ever being triaged. A note nobody reads is not a lighter obligation
790
- than a ticket, it is the same obligation with the reader removed. If a gap in the machinery is
774
+ `meta.json.followups[]` and in its artifact section — and no file is written anywhere. If a gap in the machinery is
791
775
  worth someone's time, it is worth a ticket; if it is not, the record in the work is where it ends.
792
776
  - **A `decision` answered** → the answer is written into the artifact that owns it and the entry
793
777
  becomes `done` with the answer in `note`. Deferred again → stays `proposed`.
@@ -879,7 +863,7 @@ largest saving the review has.
879
863
 
880
864
  **What follows from that is a temptation, and it belongs to the diff, not to the plan.** A threshold
881
865
  that buys a lighter review pays whoever lands just under it: twelve lines below 150 is a review at
882
- `medium` with no project panel and no §6 round, twelve above it is the panel. So, in every phase:
866
+ `medium`, twelve above it is one at `high`; at 600 the project panel joins. So, in every phase:
883
867
 
884
868
  **The diff reports the change; the change is never shaped to fit the number.** Never delete a
885
869
  comment, a test, a blank line or a log line, never compress readable code into fewer statements,
@@ -28,9 +28,7 @@ Read `~/.claude/flow/CORE.codex.md` first (shared rules: `FLOW.md` step 0, model
28
28
 
29
29
  - Read `meta.json` and `00-summary.md`; open in full only `01-context.md`. (flow-core §5)
30
30
  - `type` is not `bug` → refuse. `size` is `XS` → suggest `$flow-bug-fix` and stop.
31
- - Require `context` in `phases_done`. A work whose `phase` is the retired `diagnose` (written before
32
- v0.53.0) is treated as having finished §1.5: read its `02-diagnose.md`, carry it into
33
- `03-investigation.md`, and go straight to §3.
31
+ - Require `context` in `phases_done`.
34
32
 
35
33
  ## 1.5 Reproduce — what is failing, before why
36
34
 
@@ -38,9 +36,6 @@ Isolate **what** fails before looking for **why**. On **S** this is the whole of
38
36
  first half and the chain is `start → investigate (reproduce only) → fix → …`; on **M/L** it is the
39
37
  ground §3 stands on. **XS** skips straight to `$flow-bug-fix`.
40
38
 
41
- *(This was the `bug:diagnose` command until v0.53.0. Reproducing and finding the cause were two commands
42
- sharing five headings, and the S-size chain already ran them back to back.)*
43
-
44
39
  1. **Focused knowledge query on the symptom.** `knowledge.search` set → 2-3 parallel queries about
45
40
  the **suspected component** (handler, worker, endpoint, module): the same root cause often
46
41
  returns wearing a different symptom. Dead-letter queue → `"DLX <handler-name>"`, `"retry policy
@@ -37,7 +37,7 @@ Read `~/.claude/flow/CORE.codex.md` first (shared rules: `FLOW.md` step 0, model
37
37
  member runs its own `git diff` and opens the same files pays for that material once per agent, and
38
38
  a reviewer that spends its turns exploring has fewer left to review. **Any non-zero exit is a
39
39
  fallback, not a failure** — no CLI on the machine, a base that does not resolve, a network that
40
- cannot reach it: read the diff from git as before and carry on, once, without retrying variants.
40
+ cannot reach it: read the diff from git and carry on, once, without retrying variants.
41
41
  What is not optional is the `Review path` line of §7: a round that skipped the pack and one that
42
42
  used it are indistinguishable from the artifact otherwise, which is how a phase quietly stops
43
43
  paying for itself.
@@ -72,7 +72,7 @@ Read `~/.claude/flow/CORE.codex.md` first (shared rules: `FLOW.md` step 0, model
72
72
  - **Review base**: the previous `reviewed_sha` when it is non-empty and an ancestor of the candidate, otherwise `git.default_base`, with the reason in one line. `--full` forces the whole branch.
73
73
  - **Then**: `bundle --rev <candidate_sha> --base <review base>`, and every brief names that range rather than the live tree.
74
74
 
75
- A fix is usually small enough that the delta and the branch are the same thing — which is exactly why the freeze matters more here than the scoping: a one-file fix whose round applies its own correction is the case where `reviewed_sha` used to equal `HEAD` while describing a tree nobody read.
75
+ A fix is usually small enough that the delta and the branch are the same thing — which is exactly why the freeze matters more here than the scoping: a one-file fix whose round applies its own correction is the case where recording `HEAD` as reviewed would describe a tree nobody read.
76
76
 
77
77
  ## 2. Run the code reviews
78
78
 
@@ -235,7 +235,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
235
235
  - **Record *what* you reviewed, and separately what you changed after reading it** — `$flow-feat-review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `$flow-bug-ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
236
236
  - **Record which pass found what** — `$flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow cost` reads them back per origin, and the retirement rule is the same: a pass with no exclusive surviving finding across twenty reviews comes out of the command.
237
237
  - **Record what the agents missed** — `$flow-feat-review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
238
- - **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 `postmortem`/`ship`»). Never `knowledge.save` here.
238
+ - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are 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 `postmortem`/`ship`»). Never `knowledge.save` here.
239
239
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
240
240
  - Stop body (after the flow-core §3 header): the findings that survived and what you did with each, plus the same Cost line as the Summary: "- Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>".
241
241
  - **Autonomy handoff.** Only without blockers — with blockers, stop in every mode. **M/L**: `manual` → propose `$flow-bug-postmortem` with a single `AskUserQuestion`; `guided`/`auto` → chain into it in this same turn. **XS/S**: the next step is `ship`, which pushes and opens the MR/PR — a hard gate in **every** mode: stop here and propose `$flow-bug-ship` with a single `AskUserQuestion`, never chaining into it.
@@ -47,9 +47,6 @@ Print this **before** the environment checks: a key nobody set is the commonest
47
47
  below looks broken. Read against `examples/FLOW.template.md` — do not invent keys, and do report
48
48
  documented keys absent from the effective configuration (the "empty → fallback" rows).
49
49
 
50
- **This was the `config` command until v0.53.0.** One question — *what will the flow do in this repo* —
51
- had two commands answering different halves of it.
52
-
53
50
  ### 1.5.1 Effective config, per section
54
51
 
55
52
  For **every** documented key in `examples/FLOW.template.md`, one row:
@@ -27,7 +27,7 @@ Technical design phase. **Still no production code is written.** Opens the optio
27
27
  ## 1. Pre-flight
28
28
 
29
29
  - Load `meta.json` by current branch. Missing → ask the user to start with `$flow-feat-start`.
30
- - Read `meta.json` and `00-summary.md`; open in full only `01-context.md` (ticket, decisions, contracts received), and `02-brainstorm.md` when a work started before v0.53.0 has one — its options are §1.5's output, already done. (flow-core §5)
30
+ - Read `meta.json` and `00-summary.md`; open in full only `01-context.md` (ticket, decisions, contracts received). (flow-core §5)
31
31
  - `size` is `XS` → suggest jumping to `$flow-feat-build` and stop unless the user insists.
32
32
 
33
33
  ## 1.5 Approaches — open the option space first (M/L)
@@ -36,13 +36,10 @@ Design that starts from the first idea is design that never had a second one. **
36
36
  section; XS and S skip it** and go straight to §2 — the cost does not pay on a change whose shape is
37
37
  obvious.
38
38
 
39
- *(This was the `feat:brainstorm` command until v0.53.0: a command whose whole output only this one ever
40
- read.)*
41
-
42
39
  **No code, and no design yet.** The output of this section is a ranked set of options and one chosen
43
40
  approach; §3 onwards designs *that* approach.
44
41
 
45
- ### 1.5.1 Focused knowledge query
42
+ ### 1.5.1 Focused knowledge query, then the inventory
46
43
 
47
44
  `knowledge.search` set → 2-3 parallel queries on the **concept or pattern** the feature covers, not
48
45
  its title (`$flow-feat-start` already queried that): tracking → `"tracking deduplication"`,
@@ -50,6 +47,11 @@ its title (`$flow-feat-start` already queried that): tracking → `"tracking ded
50
47
  `"attachment handler"`, `"tax rules integration"`. Two seconds, then continue regardless. Hits go
51
48
  under "Additional domain context" in §5's template.
52
49
 
50
+ **Then the inventory.** Run §3's prior inventory **now**, before any approach is proposed, and keep
51
+ its result for `03-design.md`'s "## What already exists". An approach proposed without it reinvents
52
+ what the repository already has, and a lens whose only job was to go and look for it spends an
53
+ agent on what one search answers for every advisor at once. §3 is then already done.
54
+
53
55
  ### 1.5.2 Panel or single agent?
54
56
 
55
57
  - **M or L**, in `manual`: offer the **parallel approach panel** with `AskUserQuestion` ("Generate
@@ -58,11 +60,14 @@ under "Additional domain context" in §5's template.
58
60
  panel, note it in one line of `03-design.md`, go to §1.5.3.
59
61
  - Declined, or the user insisted on running this on S → §1.5.4.
60
62
 
61
- ### 1.5.3 Approach panel (parallel fan-out — LLM-council pattern)
63
+ ### 1.5.3 Approach panel (parallel fan-out, one round)
62
64
 
63
- **Launch the advisors as parallel subagents** — one per lens, single round, each blind to the others
64
- (LLM-council: independent advisors, then a chairman synthesises; a **cross-critique** round in
65
- between for **L** only).
65
+ **Launch the advisors as parallel subagents** — one per lens, a single round, each blind to the
66
+ others; then you synthesise. **There is no debate round.** Advisors that share one base model share
67
+ its blind spots: a round in which they read and attack each other tends to converge on the most
68
+ confident answer rather than surface a new one, and it costs as many agents as the first round. The
69
+ diversity is in what each lens is asked to *optimise*, and the adversarial pass is §6's challenger,
70
+ which attacks the design that was actually chosen.
66
71
 
67
72
  **How wide the fan-out goes** — `agents.fanout_max` from `FLOW.md` (empty → **4**): never more than
68
73
  that in one round, and never more than `agents.budget_max` (empty → **12**) across this whole
@@ -70,22 +75,16 @@ command run (flow-core §6); a round that does not fit is truncated and the trun
70
75
  (`3/4`). With `models.workers` and `models.agents` empty, a round of 4 or more inherits this thread's
71
76
  model — say so in one line before launching, naming the key and never a model (flow-core §1).
72
77
 
73
- | Size | Rounds |
74
- |---|---|
75
- | M | Advisors → you synthesise |
76
- | L | Advisors → cross-critique → you synthesise |
77
-
78
- **You are the chairman.** Round 1 (and round 2 on L) are subagents; the synthesis and the ranking are
79
- yours, never a subagent's — you hold the work's context and you write `03-design.md`.
78
+ **You are the chairman.** The advisors are subagents; the synthesis and the ranking are yours, never
79
+ a subagent's — you hold the work's context and you write `03-design.md`.
80
80
 
81
- **Round 1 — advisors (parallel, blind to each other).** One subagent per lens, up to `fanout_max`.
82
- M → the first three lenses; L → add `operations`, and also on a sensitive surface (authentication or
81
+ **Advisors (parallel, blind to each other).** One subagent per lens, up to `fanout_max`. M → the
82
+ first two lenses; L → add `operations`, and also on a sensitive surface (authentication or
83
83
  authorization, payments, personal data, a public contract, a migration):
84
84
 
85
85
  | Lens | Brief |
86
86
  |---|---|
87
- | `minimum` | The **smallest** approach that solves the declared use case, nothing more (strict MVP) |
88
- | `reuse` | The approach that **most reuses** existing pieces in the affected module or its neighbours |
87
+ | `minimum` | The **smallest** approach that solves the declared use case, built on what the inventory found before anything new (strict MVP) |
89
88
  | `reframe` | **Challenge the premise**: what if the problem is solved without building what was asked, or somewhere else? |
90
89
  | `operations` | The most production-solid approach (observability, integration failure, data at scale) |
91
90
 
@@ -93,31 +92,22 @@ Each advisor gets this brief, with its lens substituted:
93
92
 
94
93
  > Propose ONE approach to solve ticket `<TICKET>`, from this lens: `<lens brief>`. Read
95
94
  > `.claude/work/<TICKET>/01-context.md` for context and the effective FLOW configuration (base plus
96
- > active harness overlay) for project conventions. Do not
95
+ > active harness overlay) for project conventions. What already exists in the repository:
96
+ > `<the §1.5.1 inventory>` — propose a new piece only where nothing there fits. Do not
97
97
  > write code. Be specific about real modules and layers of this project. Report: name, what it is
98
98
  > (one sentence), modules/layers affected, main risk, and why it could be a bad idea. Under 250 words.
99
99
  > **Write that same answer to `.claude/work/<TICKET>/approaches/<lens>.md` before you reply** — the
100
100
  > file is the deliverable and the reply is a copy of it.
101
101
 
102
- **Round 2 — cross-critique (L only, parallel).** Each advisor receives the full set and attacks the
103
- *others* from its own lens:
104
-
105
- > You are the "`<lens>`" advisor. The approaches proposed for `<TICKET>` are in
106
- > `.claude/work/<TICKET>/approaches/` — read them all, plus `.claude/work/<TICKET>/01-context.md`.
107
- > From your lens (`<lens brief>`), critique the
108
- > OTHER approaches — not your own. For each one name its single biggest flaw for THIS project, or
109
- > "none". Then say which is strongest and which weakest, and why. Be concrete and grounded in the
110
- > project; do not invent flaws to fill space. **Write your critique to
111
- > `.claude/work/<TICKET>/approaches/critique-<lens>.md` before you reply.**
112
-
113
- **Round 3 — you synthesise.** A reply that arrived is already in your context and its file adds
102
+ **Then you synthesise.** A reply that arrived is already in your context and its file adds
114
103
  nothing — **open only the files of the lenses that did not answer**, and only then. Rank the
115
- approaches best to worst *for this case* (project fit and
116
- simplicity, not generic merit), weighing the fatal flaws the critique surfaced. State explicitly
117
- where the advisors **agreed** and where they **disagreed** — the disagreement is the useful part.
104
+ approaches best to worst *for this case* (project fit and simplicity, not generic merit), weighing
105
+ each one's own "why it could be a bad idea" against the others' — rank on substance, not on which
106
+ advisor wrote best. State explicitly where the advisors **agreed** and where they **disagreed** —
107
+ the disagreement is the useful part.
118
108
 
119
- `agents.fanout_tool` set → run the rounds through that tool instead of plain parallel subagents; the
120
- rounds, the briefs and the ceiling do not change.
109
+ `agents.fanout_tool` set → run the round through that tool instead of plain parallel subagents; the
110
+ lenses, the briefs and the ceiling do not change.
121
111
 
122
112
  **A round that answers nothing is read off disk before it is written off** (flow-core §6). The
123
113
  advisors write their files first and reply second, so `ls .claude/work/<TICKET>/approaches/` settles
@@ -125,15 +115,15 @@ what actually happened: a file there is an answer that got lost in transit, and
125
115
  it without spending a single agent. Only a lens with no file is empty — **it is asked once for its
126
116
  answer and then dropped, never relaunched**, because an empty result is as often a truncated report
127
117
  as an advisor with nothing to say, and a relaunched round is paid for twice out of one
128
- `agents.budget_max`. Synthesise from those that answered and record `N/M`. An empty critique round
129
- → rank from the approaches alone.
118
+ `agents.budget_max`. Synthesise from those that answered and record `N/M`.
130
119
 
131
120
  ### 1.5.4 Single agent (the S case, or a declined panel)
132
121
 
133
122
  Launch a `general-purpose` subagent with this short, self-contained brief:
134
123
 
135
124
  > Generate 3-5 distinct approaches to solve `<title>` following the project conventions (see
136
- > the effective FLOW configuration and `.claude/work/<TICKET>/01-context.md`). For each: a
125
+ > the effective FLOW configuration and `.claude/work/<TICKET>/01-context.md`), building on what
126
+ > already exists: `<the §1.5.1 inventory>`. For each: a
137
127
  > one-sentence description,
138
128
  > modules/layers affected, main risk, and why it could be a bad idea. Do not write code. Report in
139
129
  > markdown, under 400 words.
@@ -166,7 +156,7 @@ A sensitive domain (payments, authentication, tracking) → launch **in parallel
166
156
 
167
157
  ## 3. Prior inventory (reuse before creating)
168
158
 
169
- **Before** launching the design subagents, list what the feature needs that **already exists** in code or DB. Launch an `Agent` with `subagent_type: Explore`:
159
+ **M/L already ran this in §1.5.1** — reuse that result and skip to §4. XS/S: **before** launching the design subagents, list what the feature needs that **already exists** in code or DB. Launch an `Agent` with `subagent_type: Explore`:
170
160
 
171
161
  > For feature `<title>` (see `.claude/work/<TICKET>/01-context.md`), search the repo for related pieces that already exist and could be reused: domain entities, value objects, repositories, services, events, columns or tables, CQRS commands/queries, and similar endpoints. Do not propose design — only list what is found with one line each and its location. If the feature mentions concepts like `<concept1>`, `<concept2>`, search for those specifically.
172
162
 
@@ -40,7 +40,7 @@ Mandatory review phase. **`$flow-feat-ship` cannot run without passing through h
40
40
  member runs its own `git diff` and opens the same files pays for that material once per agent, and
41
41
  a reviewer that spends its turns exploring has fewer left to review. **Any non-zero exit is a
42
42
  fallback, not a failure** — no CLI on the machine, a base that does not resolve, a network that
43
- cannot reach it: read the diff from git as before and carry on, once, without retrying variants.
43
+ cannot reach it: read the diff from git and carry on, once, without retrying variants.
44
44
  What is not optional is the `Review path` line of §8: a round that skipped the pack and one that
45
45
  used it are indistinguishable from the artifact otherwise, which is how a phase quietly stops
46
46
  paying for itself.
@@ -69,7 +69,7 @@ Mandatory review phase. **`$flow-feat-ship` cannot run without passing through h
69
69
 
70
70
  ### 1.5 Freeze what you are about to read, and resolve what to compare it against
71
71
 
72
- Two questions, answered here and nowhere later: **which tree** this round reads, and **against which base**. Both used to be answered implicitly — by the checkout as it happened to stand at each moment, and by `git.default_base` always — and both answers were wrong in a way no artifact could show.
72
+ Two questions, answered here and nowhere later: **which tree** this round reads, and **against which base**. Neither is implicit: the checkout changes while the round runs, and `git.default_base` is not always the right base.
73
73
 
74
74
  **The candidate.** A round applies its own fixes; the README's own first-minute example is *"3 reviewers, one finding — fixed"*. So "the working tree" is a different tree for the reviewer that read it first, for the skeptic that read it last, and for the `git rev-parse HEAD` taken at §9 — which by construction contains code no reviewer ever saw, and which `$flow-feat-ship §1` then compares against `HEAD` and finds equal. Resolve one revision before §2 launches anything:
75
75
 
@@ -79,11 +79,11 @@ Two questions, answered here and nowhere later: **which tree** this round reads,
79
79
  - Anchor it so it cannot be collected: `git update-ref refs/flow/candidate/<TICKET> <sha>`. A `stash create` object is unreferenced, and a candidate the `ship` gate cannot resolve is a gate that reports nothing. The ref is local, never pushed, and `$flow-feat-ship §6.5` deletes it.
80
80
  - Write `candidate_sha` to `meta.json` — work-level and in the current `mrs[]` entry — **in this pre-flight**. A candidate recorded after the reading is not a freeze.
81
81
 
82
- **The review base.** `reviewed_sha` already records the tree the last passing review read, and `ship` trusts it enough to stop a push — yet the review itself never read it, so a second review re-reads every line the first one cleared, and §2.0 resolves the tier on the accumulated total: a 30-line delta on a 900-line branch reviewed as the 900. Resolve:
82
+ **The review base.** `reviewed_sha` records the tree the last passing review read, and `ship` trusts it enough to stop a push. Reading only the delta since it keeps a second review from re-reading every line the first one cleared, and keeps §2.0 from resolving the tier on the accumulated total — a 30-line delta on a 900-line branch is a 30-line review. Resolve:
83
83
 
84
84
  - The current MR/PR's `reviewed_sha` (work-level when there is no train) when it is **non-empty** and **an ancestor of the candidate** (`git merge-base --is-ancestor <sha> <candidate>`) → that is the base.
85
85
  - Otherwise `git.default_base`. A `reviewed_sha` that is not an ancestor means history was rewritten or the branch recut; say so in one line rather than producing a nonsensical delta.
86
- - **A first review has no `reviewed_sha` and reads the whole branch**, exactly as before. The delta path only exists after a review that passed.
86
+ - **A first review has no `reviewed_sha` and reads the whole branch**. The delta path only exists after a review that passed.
87
87
  - `$flow-feat-review --full` ignores `reviewed_sha` and reads the branch on demand.
88
88
  - **Fall back to `git.default_base` and say why** when either holds, because a delta cannot see how it interacts with what was cleared before: the delta touches a file the previous review left a finding on, or it changes an external contract copied under `$flow-feat-build §2.0bis`.
89
89
 
@@ -97,7 +97,7 @@ Scope for every reviewer: **the candidate revision of §1.5, against the review
97
97
 
98
98
  **The CLI resolves it; you obey the output and record any deviation.** `npx flow-workflows@<version> tier --harness codex --rev <candidate_sha> --base <review base>` prints, from the config it already parses: changed lines over the §1.5 range, diff size, `meta.json.size`, **effective size** (the lower of the two), the built-in `code-review` effort with and without the sensitive-surface bump, whether the panel runs, the resolved `agents.budget_max`/`fanout_max`, whether the measurement landed **within 10% under** a threshold that changed the tier, and which `quality.sensitive_paths` globs the diff matched, with the path that matched each.
99
99
 
100
- Every step of that is arithmetic, and the cost of leaving it here was never mainly the tokens: `06-review.md` recorded the tier *this agent said it derived*, so a round that eyeballed the diff and a round that measured it wrote a byte-identical artifact — on the one number in this command that carries an incentive on it. Same treatment `Review path` and `Cost:` already got, for the same reason.
100
+ Every step of that is arithmetic. A tier this agent derives itself writes the same artifact whether it measured the diff or eyeballed it — on the one number in this command that carries an incentive on it.
101
101
 
102
102
  **Copy the output verbatim** into the `Review tier` and `Effective size` lines of §8, the way `bundle --checks` copies static analysis out. A computed line, not a narrated one.
103
103
 
@@ -107,7 +107,7 @@ Every step of that is arithmetic, and the cost of leaving it here was never main
107
107
  - **Whether a matched path is a sensitive *diff*.** The bump asks what the change *does* there, not where it lives: it applies to **control flow, or the data that reaches a person, a charge or a stored record** — a new guard, a new `catch`, a changed condition, a changed value, a changed contract. It does **not** apply when the diff moves **observability alone**: a log level, a channel, a message's text, a metric, a comment. Mixed diff → not observability-only, so it bumps. **Say which of the two it was in one line**; a diff demoted here is the one place a missed defect is expensive.
108
108
  - **Query changes.** §3.6 duels every query the diff adds or modifies, at every size, whatever this section resolved — routing them through the bump buys a second opinion on prose where §3.6 buys a plan.
109
109
 
110
- **No CLI, or a non-zero exit → the prose fallback**, and `Review path` names it with the reason (the same contract the panel follows). Measure `git diff --shortstat <review base>...<candidate_sha>`; **≤150 → XS · 151-600 → S · 601-1500 → M · >1500 → L**; effective size = the lower of that and `meta.json.size`; `proportional` runs the built-in at **medium/high/high/xhigh** by size and the panel at M and above (at S only on a sensitive surface); the bump raises the effort one tier (medium→high→xhigh→**max**) and always runs the panel; `full` is **xhigh** plus the panel at any size, `light` is the built-in alone at **medium** with no panel, no §3 and no §6 — and a sensitive surface lifts `light` to the proportional tier for that work. The thresholds and the ladder are documented in `docs/CONFIGURATION.md`, where they can be read without being re-taught to a model on every invocation.
110
+ **No CLI, or a non-zero exit → the prose fallback**, and `Review path` names it with the reason (the same contract the panel follows). Measure `git diff --shortstat <review base>...<candidate_sha>`; **≤150 → XS · 151-600 → S · 601-1500 → M · >1500 → L**; effective size = the lower of that and `meta.json.size`; `proportional` runs the built-in at **medium/high/high/xhigh** by size and the panel at M and above (at S only on a sensitive surface); the bump raises the effort one tier (medium→high→xhigh→**max**) and always runs the panel; `full` is **xhigh** plus the panel at any size, `light` is the built-in alone at **medium** with no panel, no §3 and no §6 — and a sensitive surface lifts `light` to the proportional tier for that work.
111
111
 
112
112
  **The diff pointing *higher* than `meta.json.size`** is worth one line in `06-review.md` (the work may be misclassified), never a heavier review. **The sensitive-surface bump is never scaled away** — a 12-line change to an authorization check still gets the panel, on a delta exactly as on a first review.
113
113
 
@@ -156,7 +156,7 @@ Launch the reviewers selected in §2.0 and **consolidate their findings into a s
156
156
 
157
157
  When both run, deduplicate overlapping correctness/simplification findings (count each once). The `review_skill` specialists (offensive/defensive security, silent failures, architecture) are not repeated in later phases.
158
158
 
159
- **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8 — `built-in`, a panel role, or the pass that raised it (`§3.5`, `§3.6`, `§5`, `§5.5`) — and a finding more than one source raised lists all of them. Counted once, credited to each. Beyond the built-in and the panel this command runs four specialised passes, roughly 1 800 of its words, every one added after a real defect got through and not one able to show it still earns that cost: a finding only the idiom audit saw and a finding three sources raised say opposite things about that pass, and until now both were written identically. The `Cost:` line stopped being a headcount when `meta.json.cost[]` arrived; this is the same move for the thing those costs are spent on.
159
+ **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8 — `built-in`, a panel role, or the pass that raised it (`§3.5`, `§3.6`, `§5`, `§5.5`) — and a finding more than one source raised lists all of them. Counted once, credited to each: a finding only one pass saw and a finding three sources raised say opposite things about that pass, and §9 records the difference.
160
160
 
161
161
  ### 2.2 Design truth vs design rationale (do not inherit rationalizations)
162
162
  `03-design.md` goes to reviewers as context, with unequal authority:
@@ -175,7 +175,7 @@ Only what §2 does **not** already cover; skipped entirely under `light` (§2.0)
175
175
 
176
176
  ## 3.5. Completeness sweep (anti-abandonment, M/L only)
177
177
 
178
- Counters a reviewer abandoning a large diff early. **Only if `meta.json.size` is M or L**, and only
178
+ Counters a reviewer abandoning a large diff early. **Only if the effective size of §2.0 is M or L**, and only
179
179
  if §2.0b's budget still covers it (it is the first phase dropped).
180
180
 
181
181
  **It runs after §2-§3 are consolidated, never in parallel with them.** The whole phase is an audit of
@@ -267,7 +267,7 @@ Findings enter the normal flow: §6, then the output. Blinded for the same reaso
267
267
 
268
268
  A filter against over-reporting, not a second review; narrow gate. Never runs under `light` (§2.0).
269
269
 
270
- **When it runs.** All three conditions:
270
+ **When it runs.** All four conditions:
271
271
 
272
272
  | Condition | Threshold |
273
273
  |---|---|
@@ -276,7 +276,7 @@ A filter against over-reporting, not a second review; narrow gate. Never runs un
276
276
  | Findings | **≥ 4** ambiguous findings across §2-§5 |
277
277
  | Budget | §2.0b's budget still covers a round (§6 is the second phase dropped) |
278
278
 
279
- Read the real diff (`git diff --stat` against the target branch), not the recorded size.
279
+ Read the real diff (`git diff --stat <review base>...<candidate_sha>`, §1.5), not the recorded size.
280
280
 
281
281
  When all three hold: in **`manual`**, offer it with `AskUserQuestion` ("Verify the ambiguous findings with skeptics in parallel? Discards false positives before you go fix them."). In **`guided`/`auto`, do not ask** — flow mechanics: run it and note in `06-review.md` that you did.
282
282
 
@@ -356,7 +356,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
356
356
  ## Discarded by adversarial verification
357
357
  <only if §6 was run; list of refuted findings with reason, or "not applicable">
358
358
  <if the `fanout_max` cap left ambiguous findings unverified, list them here as "unverified (cap)">
359
- <if §6 did not run, one line saying which condition did not hold — size, diff size, or count>
359
+ <if §6 did not run, one line saying which condition did not hold — size, diff size, count, or budget>
360
360
 
361
361
  ## Blockers (must-fix)
362
362
  1. [file:line] · <origin> · description + concrete proposal
@@ -379,12 +379,11 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
379
379
  - Blockers → **do not advance `phase`**. Leave `phase = "build"`; the user resolves them.
380
380
  - No blockers → `phase = "review"`, add to `phases_done`. **In a multi-MR/PR work**, also add `review` to the current `in_progress` MR/PR's own `phases_done` (its `mrs[]` entry) — `$flow-feat-ship §1` gates on it per MR/PR.
381
381
  - **Record *what* you reviewed, and separately what you changed after reading it**, in the same write, work-level and — in a multi-MR/PR work — in this MR/PR's `mrs[]` entry too:
382
- - `reviewed_sha` = **the candidate of §1.5**, the revision the reviewers actually read. Not `git rev-parse HEAD`, which is what it used to be and which by then holds this round's own fixes — code no reviewer saw, recorded as reviewed, and `ship` finding it equal to `HEAD` every time.
383
- - `fixed_sha` = `git rev-parse HEAD` after this round's fixes, or **empty** when the round applied none. Two fields because they are two facts, and collapsing them is what hid the delta.
382
+ - `reviewed_sha` = **the candidate of §1.5**, the revision the reviewers actually read. Not `git rev-parse HEAD`, which by then holds this round's own fixes — code no reviewer saw, recorded as reviewed, and `ship` finding it equal to `HEAD` every time.
383
+ - `fixed_sha` = `git rev-parse HEAD` after this round's fixes, or **empty** when the round applied none. Two fields because they are two facts.
384
384
  - `phases_done` says a review *happened*; these say which tree, and `$flow-feat-ship §1` reads both before pushing. Written whenever the phase advances, never when it does not: a review that ended in blockers reviewed nothing that stands.
385
385
  - **Record which pass found what**, in the same write: `meta.json.review_findings[]`, one entry per finding **per source** — `{ round, origin, severity, file, discarded_by_skeptic }`, and no finding text, which stays in the artifact. `flow review --record` writes these itself when the CLI ran the panel; when the agentic panel ran, write them here from the origins §2.1 carried. `flow cost` reads them back per origin: how many findings each pass contributed, how many only it raised, and how many of those survived §6. That last number is the only evidence a pass is still earning its words.
386
- **The retirement rule, written down before the data arrives** so it cannot be argued backwards later: a pass that contributes **no exclusive surviving finding across twenty reviews** is removed from this command. Zero is zero, and the decision is made against the number rather than against whoever is most attached to the pass.
387
- - **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.
386
+ - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are 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.
388
387
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
389
388
  - **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
390
389
  - **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 `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[]`.
@@ -72,7 +72,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
72
72
  - **Code review is mandatory**: `$flow-feat-ship` is not run and `$flow-bug-postmortem` is not closed without passing through `/*:review`.
73
73
  - **Existing sub-agents**: commands delegate to the project's agents and skills; work is never duplicated.
74
74
  - **The subagents' model is the repo's call, never the plugin's (`models` in FLOW.md)**: `agents` (every subagent a command improvises) · `workers` (the fan-out rounds, falling back to `agents`). Empty = **inherit**. There is no key for what the main agent does itself: **an agent cannot switch its own model** (say it, **continue**); **a named agent keeps its own** (`agents.<role>`) — flow-core §1. `$flow-doctor` prints both resolved; `quality.review_skill` owns the review panel.
75
- - **Parallel multi-agent fan-out (optional, only where it pays)**: plain subagents. (1) `$flow-feat-design` §1.5.3: one agent per lens (minimum / reuse / reframe, + operations for L or a sensitive surface), cross-critique for L only. (2) `$flow-bug-investigate` §3.A: one agent per root cause, evidence **for and against**. (3) `$flow-feat-review` §6 and `$flow-bug-review` §5: one skeptic per **ambiguous** finding, refute-by-default. (4) `$flow-feat-build` §2.1bis and `$flow-bug-fix` §2.2: **one** skeptic on a premise the change depends on and nothing verifies — at **any size, XS included**, once per MR/PR, a category and not a depth tier, like the query duel. Other phases **do not** fan out. `manual`: offered with `AskUserQuestion`; `guided`/`auto`: runs, noted in the artifact. **The fan-out has two ceilings, and the synthesis is not a subagent**: `agents.fanout_max` (empty → **4**) per round and `agents.budget_max` (empty → **12**) for everything one command run launches, with what either cap drops **said** and the phase each command gives up first declared in it; both count agents, not findings, so grouping is intended and one-agent-per-finding past the cap is a breach; the review tier scales to the **diff under review**, not the size of the feature, and the verification gate also needs a **diff over 150 changed lines**; delegate the **gathering**, keep the **deciding**. **A heavier orchestrator is opt-in, per repo**: `agents.fanout_tool` (e.g. Claude Code's `Workflow`), rounds and ceiling unchanged; empty is the default and the portable path.
75
+ - **Parallel multi-agent fan-out (optional, only where it pays)**: plain subagents. (1) `$flow-feat-design` §1.5.3: one agent per lens (minimum / reframe, + operations for L or a sensitive surface), one round, no debate. (2) `$flow-bug-investigate` §3.A: one agent per root cause, evidence **for and against**. (3) `$flow-feat-review` §6 and `$flow-bug-review` §5: one skeptic per **ambiguous** finding, refute-by-default. (4) `$flow-feat-build` §2.1bis and `$flow-bug-fix` §2.2: **one** skeptic on a premise the change depends on and nothing verifies — at **any size, XS included**, once per MR/PR, a category and not a depth tier, like the query duel. Other phases **do not** fan out. `manual`: offered with `AskUserQuestion`; `guided`/`auto`: runs, noted in the artifact. **The fan-out has two ceilings, and the synthesis is not a subagent**: `agents.fanout_max` (empty → **4**) per round and `agents.budget_max` (empty → **12**) for everything one command run launches, with what either cap drops **said** and the phase each command gives up first declared in it; both count agents, not findings, so grouping is intended and one-agent-per-finding past the cap is a breach; the review tier scales to the **diff under review**, not the size of the feature, and the verification gate also needs a **diff over 150 changed lines**; delegate the **gathering**, keep the **deciding**. **A heavier orchestrator is opt-in, per repo**: `agents.fanout_tool` (e.g. Claude Code's `Workflow`), rounds and ceiling unchanged; empty is the default and the portable path.
76
76
  - **Knowledge sources (full cycle)**: the `knowledge` section names a tool per **role** — `search`, `stage`, `read_staging`, `save` — any MCP (domain-memory, codegraph…), CLI or skill; a role that is empty degrades (no lookup / finding stays in the artifact / artifacts are the staging / `KNOWLEDGE.md`); `knowledge.timeout_s` (2 s) or any failure → continue silently. **`knowledge.search`**: `$flow-feat-start`, `$flow-bug-start` (ticket keywords), `$flow-feat-design` (approaches, module + integrations), `$flow-bug-investigate` (component in §1.5, cause in §2). **`knowledge.stage`**: closing `$flow-feat-design` and `$flow-bug-investigate`, offer to stage non-obvious domain decisions (silence by default; per-branch). **`knowledge.read_staging`** then **`knowledge.save`** at `$flow-feat-ship` and `$flow-bug-postmortem`: offer to consolidate the "why" only.
77
77
 
78
78
  ## `meta.json` schema
@@ -85,7 +85,6 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
85
85
  "branch": "{PREFIX}XXXXX-slug",
86
86
  "size": "XS" | "S" | "M" | "L",
87
87
  "phase": "context" | "design" | "plan" | "build" | "review" | "validate" | "ship" | "investigate" | "fix" | "postmortem" | "done" | "abandoned",
88
- // retired in v0.53.0 and still read from older works: "brainstorm" → treat as "context", "diagnose" → as "investigate"
89
88
  "phases_done": ["context", ...],
90
89
  "candidate_sha": "40-char sha the current review froze before reading, or ''",
91
90
  "reviewed_sha": "40-char sha the last passing review read, or ''",
@@ -118,11 +117,11 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
118
117
  ],
119
118
  "followups": [
120
119
  { "id": "F1",
121
- "kind": "prevention" | "audit" | "out-of-scope" | "risk" | "edge-case" | "other-bug",
120
+ "kind": "prevention" | "audit" | "out-of-scope" | "risk" | "edge-case" | "other-bug" | "tooling" | "decision",
122
121
  "title": "one line, what would be done",
123
122
  "why": "one line, why it was parked and why it still matters",
124
123
  "source": "design" | "plan" | "build" | "validate" | "fix" | "postmortem",
125
- "status": "proposed" | "accepted" | "in_progress" | "declined" | "done",
124
+ "status": "proposed" | "accepted" | "in_progress" | "declined" | "logged" | "done",
126
125
  "ticket": null, "work": null, "note": "" }
127
126
  ],
128
127
  "defaults_used": [
@@ -29,7 +29,6 @@ Use when returning to a work after a break (next morning, another session).
29
29
  - `git branch --show-current`.
30
30
  - Search `.claude/work/` for the `meta.json` whose `branch` matches.
31
31
  - None found → ask the user for the ticket or whether to start a new one.
32
- - **A `phase` retired in v0.53.0** — `brainstorm` or `diagnose`, from a work started before it — is mapped, never refused: `brainstorm` → `design` (its `02-brainstorm.md` is that command's §1.5 output, already done), `diagnose` → `investigate` (its `02-diagnose.md` is that command's §1.5 output). Say which mapping you applied, in one line, and suggest the mapped command. Do not rewrite `meta.json` for it; the phase advances normally at the next Close.
33
32
  - `meta.json.worktree` non-null and the current directory is not that worktree → tell the user the work lives in a worktree and to `cd <worktree>` before continuing; run the repo-state checks below from there (`git -C <worktree> …`).
34
33
 
35
34
  ## 2. Recap