flow-workflows 0.92.0 → 0.94.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 (70) hide show
  1. package/README.md +4 -4
  2. package/adapters/codex/CORE.md +61 -20
  3. package/adapters/codex/skills/flow-bug-fix/SKILL.md +9 -1
  4. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +11 -0
  5. package/adapters/codex/skills/flow-bug-validate/SKILL.md +1 -1
  6. package/adapters/codex/skills/flow-doctor/SKILL.md +33 -15
  7. package/adapters/codex/skills/flow-feat-build/SKILL.md +9 -2
  8. package/adapters/codex/skills/flow-feat-design/SKILL.md +32 -2
  9. package/adapters/codex/skills/flow-feat-plan/SKILL.md +1 -0
  10. package/adapters/codex/skills/flow-feat-ship/SKILL.md +3 -1
  11. package/adapters/codex/skills/flow-feat-start/SKILL.md +1 -1
  12. package/adapters/codex/skills/flow-feat-validate/SKILL.md +1 -1
  13. package/adapters/codex/skills/flow-init/SKILL.md +12 -8
  14. package/adapters/codex/skills/flow-next/SKILL.md +5 -4
  15. package/adapters/codex/skills/flow-work-README/SKILL.md +9 -2
  16. package/adapters/codex/skills/flow-work-handoff/SKILL.md +19 -5
  17. package/adapters/codex/skills/flow-work-run/SKILL.md +18 -2
  18. package/adapters/gemini/CORE.md +61 -20
  19. package/adapters/gemini/commands/flow/bug/fix.toml +9 -1
  20. package/adapters/gemini/commands/flow/bug/investigate.toml +11 -0
  21. package/adapters/gemini/commands/flow/bug/validate.toml +1 -1
  22. package/adapters/gemini/commands/flow/doctor.toml +33 -15
  23. package/adapters/gemini/commands/flow/feat/build.toml +9 -2
  24. package/adapters/gemini/commands/flow/feat/design.toml +32 -2
  25. package/adapters/gemini/commands/flow/feat/plan.toml +1 -0
  26. package/adapters/gemini/commands/flow/feat/ship.toml +3 -1
  27. package/adapters/gemini/commands/flow/feat/start.toml +1 -1
  28. package/adapters/gemini/commands/flow/feat/validate.toml +1 -1
  29. package/adapters/gemini/commands/flow/init.toml +12 -8
  30. package/adapters/gemini/commands/flow/next.toml +5 -4
  31. package/adapters/gemini/commands/flow/work/README.toml +9 -2
  32. package/adapters/gemini/commands/flow/work/handoff.toml +19 -5
  33. package/adapters/gemini/commands/flow/work/run.toml +18 -2
  34. package/adapters/hermes/CORE.md +61 -20
  35. package/adapters/hermes/skills/flow-bug-fix/SKILL.md +9 -1
  36. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +11 -0
  37. package/adapters/hermes/skills/flow-bug-validate/SKILL.md +1 -1
  38. package/adapters/hermes/skills/flow-doctor/SKILL.md +33 -15
  39. package/adapters/hermes/skills/flow-feat-build/SKILL.md +9 -2
  40. package/adapters/hermes/skills/flow-feat-design/SKILL.md +32 -2
  41. package/adapters/hermes/skills/flow-feat-plan/SKILL.md +1 -0
  42. package/adapters/hermes/skills/flow-feat-ship/SKILL.md +3 -1
  43. package/adapters/hermes/skills/flow-feat-start/SKILL.md +1 -1
  44. package/adapters/hermes/skills/flow-feat-validate/SKILL.md +1 -1
  45. package/adapters/hermes/skills/flow-init/SKILL.md +12 -8
  46. package/adapters/hermes/skills/flow-next/SKILL.md +5 -4
  47. package/adapters/hermes/skills/flow-work-README/SKILL.md +9 -2
  48. package/adapters/hermes/skills/flow-work-handoff/SKILL.md +19 -5
  49. package/adapters/hermes/skills/flow-work-run/SKILL.md +18 -2
  50. package/adapters/opencode/CORE.md +61 -20
  51. package/adapters/opencode/commands/flow-bug-fix.md +9 -1
  52. package/adapters/opencode/commands/flow-bug-investigate.md +11 -0
  53. package/adapters/opencode/commands/flow-bug-validate.md +1 -1
  54. package/adapters/opencode/commands/flow-doctor.md +33 -15
  55. package/adapters/opencode/commands/flow-feat-build.md +9 -2
  56. package/adapters/opencode/commands/flow-feat-design.md +32 -2
  57. package/adapters/opencode/commands/flow-feat-plan.md +1 -0
  58. package/adapters/opencode/commands/flow-feat-ship.md +3 -1
  59. package/adapters/opencode/commands/flow-feat-start.md +1 -1
  60. package/adapters/opencode/commands/flow-feat-validate.md +1 -1
  61. package/adapters/opencode/commands/flow-init.md +12 -8
  62. package/adapters/opencode/commands/flow-next.md +5 -4
  63. package/adapters/opencode/commands/flow-work-README.md +9 -2
  64. package/adapters/opencode/commands/flow-work-handoff.md +19 -5
  65. package/adapters/opencode/commands/flow-work-run.md +18 -2
  66. package/bin/cli.mjs +160 -65
  67. package/package.json +1 -1
  68. package/plugins/flow/.claude-plugin/plugin.json +1 -1
  69. package/plugins/flow/CHANGELOG.md +61 -0
  70. package/plugins/flow/examples/FLOW.template.md +13 -4
@@ -148,13 +148,27 @@ the ticket read it there, never in the work folder; the receiver does not parse
148
148
  <!-- end flow-study -->
149
149
  ```
150
150
 
151
- Criteria keep their literal values. The plan lists each MR/PR with what it covers and what it
152
- waits on; a bug's plan is its single fix.
151
+ Criteria keep their literal values. `## Design in brief` ends with each `meta.json.ticket_deps`
152
+ entry and its why — `Depends on #253: <why>` — so whoever approves the study sees what it waits
153
+ for; an unattended study's `done-summary.md` is this block, so it carries them too. The plan
154
+ lists each MR/PR with what it covers and what it waits on; a bug's plan is its single fix.
153
155
  - **The new body**: the body read above with the block between the two markers replaced — or, with
154
- no markers yet, the block appended after a blank line. Written to a `mktemp` file outside the
156
+ no markers yet, the block appended after a blank line. Then, for each `meta.json.ticket_deps`
157
+ entry (`$flow-feat-design` §5.1) whose line is not already a line of that body — same text,
158
+ ignoring case and surrounding whitespace — one line after the end marker, in `ticket_deps` order:
159
+
160
+ ```
161
+ Depends on #253
162
+ ```
163
+
164
+ `#253` being the entry's `ticket` as it stands. Outside the markers so a later rewrite of the
165
+ block leaves it alone, and never removed: a line a person wrote by hand looks exactly like one
166
+ flow wrote, and the convention is theirs too. Written to a `mktemp` file outside the
155
167
  tree — `{BODY_FILE}` — so nothing of it can be committed later.
156
- - **Show the block and ask** with `AskUserQuestion`, **in every mode**: it writes to a shared
157
- tracker. **Write it** · **Skip**. Failure → its message in one line; the push stands.
168
+ - **Show the block, and the `Depends on` lines it adds, and ask** with `AskUserQuestion`, **in
169
+ every mode**: it writes to a shared tracker. A `Depends on` line already in the body, outside the
170
+ markers, that no entry names — a dependency a revised study dropped, or one a person added — is named in the same
171
+ question and left in place: whether it still holds is theirs to say. **Write it** · **Skip**. Failure → its message in one line; the push stands.
158
172
 
159
173
  ## 6. Close
160
174
 
@@ -67,7 +67,7 @@ of truth, and an argument that disagrees with it is ignored and named in the log
67
67
  | `conflict` | exists | `$flow-work-green` — the MR/PR conflicts with its base; which base, and where it stands, come from `<cmd> events --json` |
68
68
  | `review` · `pipeline` · `conflict` | none | `blocked` — there is no work of this ticket to answer for |
69
69
 
70
- **The work's branch, on `start` and `study`.** The current branch is `meta.json.branch` → nothing to do. It is
70
+ **The work's branch, on `start` and `study`.** The current branch is `meta.json.branch` → no switch. It is
71
71
  not — a study made on another machine arrives on the ticket's `base`, a run that died before its
72
72
  closing order is relaunched there — then, in this order:
73
73
 
@@ -90,6 +90,21 @@ closing order is relaunched there — then, in this order:
90
90
  `meta.json.branch` = it, `meta.json.base` = that base, `worktree` and `stacked_on` = `null` — paths and parents from the
91
91
  other machine mean nothing here — and record `{ "key": "unattended:rehomed", "default": "<old branch> → <name> from <base>", "phase": "run" }`.
92
92
 
93
+ **On `start`, a study's branch catches up with its base** — once on the work's branch, the "no
94
+ switch" case included, and only while no build or fix has begun (neither `05-implementation.md` nor
95
+ `04-fix.md` exists). Every command below runs in the work's own checkout — step 2's worktree when
96
+ that is where it lives. A study writes no code, so its branch still sits where the base was when the
97
+ study began; an approval that waited for the tickets the study depends on (`meta.json.ticket_deps`)
98
+ would otherwise build on a base that lacks them. `<base>` = `meta.json.base`, empty →
99
+ `git.default_base`: `git fetch origin <base>`, then `<ref>` = `origin/<base>`; the fetch failing
100
+ with a remote configured → `blocked`, since a stale ref would leave the build on the old base
101
+ unnoticed. No remote → the local `<base>`. `git merge-base --is-ancestor HEAD <ref>` and `HEAD` is not
102
+ `<ref>` → the branch holds no commit of its own and the base moved: `git merge --ff-only <ref>`, and
103
+ record `{ "key": "unattended:base-caught-up", "default": "<old short sha> → <new short sha> on
104
+ <base>", "phase": "run" }`. The fast-forward fails → `blocked`, its message as the reason. Not an
105
+ ancestor → it holds commits a previous run made: leave it as it is — bringing the base into work in
106
+ progress is the orchestrator's (flow-core §2.1).
107
+
93
108
  **A person's changes to a study, on `study`** (flow-core §2.1: they rewind it). The work's branch
94
109
  first, as above. `<work>/study-revision.md` holds the reply, as the row above wrote it. Each step
95
110
  can be run again: a run that dies part-way is finished by the next relaunch, whatever it serves.
@@ -113,7 +128,8 @@ can be run again: a run that dies part-way is finished by the next relaunch, wha
113
128
  `study-revision.md` and earlier `before-*/` folders into `<work>/before-<id7>/` — never
114
129
  overwriting a name already there — so no artifact, summary or agent answer of the discarded study
115
130
  leaks into the next. Then `meta.json`: `phase` = `context`, `phases_done` = `["context"]`, `mrs`
116
- removed (the row that blocks a work past the study guarantees nothing was built), `notes`
131
+ removed (the row that blocks a work past the study guarantees nothing was built), `ticket_deps`
132
+ removed (the redone study finds its dependencies again), `notes`
117
133
  emptied, and every `followups[]` entry a study phase wrote (`source` `design`, `plan` or
118
134
  `investigate`) removed.
119
135
  5. **Re-size**: estimate the size again with `$flow-feat-start` §4's table (`$flow-bug-start`'s for
@@ -16,7 +16,7 @@ Every `/flow:*` command assumes these rules. They are stated once, here, so a co
16
16
  carries what is specific to its phase. Read this once per session; a command that says "load
17
17
  `flow-core`" means this file.
18
18
 
19
- **This file belongs to flow `0.92.0`.** Compare it once, at the start of the session, against
19
+ **This file belongs to flow `0.94.0`.** Compare it once, at the start of the session, against
20
20
  `version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
21
21
  is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
22
22
  — which is exactly what happens when a branch or a release candidate is loaded over an installed
@@ -24,10 +24,14 @@ copy that stays enabled: the harness resolves a command from the one and a skill
24
24
  silently. Name both numbers at the first stop and say which half is which; a rule this file adds and
25
25
  a command relies on is simply absent in that session, and nothing else will report it.
26
26
 
27
- ## 0. Effective FLOW config — base plus harness overlay
27
+ ## 0. Effective FLOW config — base, context layer and harness overlay
28
28
 
29
29
  - **Look before you read.** The first thing a phase does about configuration is list what is there:
30
- `ls <root>/FLOW*.md` (the root being the one the next bullet resolves). One call, and it is not
30
+ `find <root> -maxdepth 1 -name 'FLOW*.md'; printf 'FLOW_CONTEXT=%q\n' "${FLOW_CONTEXT-}"` (the roots
31
+ being the ones the bullets below resolve — in a worktree, name both in the same `find`). A quoted
32
+ `-name`, not a shell glob: in zsh a glob that matches nothing aborts the whole command, so the
33
+ root that has no FLOW file would hide the one that does; and `%q`, not `echo`, so a trailing
34
+ space or a `\r` from a CRLF `.env` shows instead of reading as a clean name. One call, and it is not
31
35
  optional — **an overlay you did not list is an overlay you did not read**, and nothing downstream
32
36
  will notice. Every command and artifact calls the effective configuration "`FLOW.md`", a file that
33
37
  exists, so reading it and stopping feels finished — and a missed overlay reports its keys as unset,
@@ -37,24 +41,47 @@ a command relies on is simply absent in that session, and nothing else will repo
37
41
  this command: `FLOW.claude.md`, `FLOW.codex.md`, `FLOW.opencode.md`, `FLOW.gemini.md`,
38
42
  `FLOW.hermes.md`, or `FLOW.zcode.md`. The
39
43
  harness is the product executing the command, never guessed from a model name. An overlay is
40
- valid without a base file; unknown `FLOW.*.md` names are ignored. **A page can outlive the product it
44
+ valid without a base file. **A page can outlive the product it
41
45
  was written for**: zcode reads the plugin's Claude pages as well as its own `/flow:`-prefixed
42
46
  mirror of them, so a `claude` in a path or in a `--harness` flag records where the page was
43
47
  written, never who is running it. On zcode the overlay is `FLOW.zcode.md` and the flag is
44
48
  `--harness zcode`, whichever of the two pages you were handed. Throughout every command,
45
49
  **"FLOW.md" means this effective merged configuration** unless the command explicitly names a
46
50
  file it will edit.
51
+ - **The context layer sits between the two, and whoever launches flow picks it.** `FLOW_CONTEXT`
52
+ set in the environment → `FLOW.<FLOW_CONTEXT>.md` is read after the base and before the harness
53
+ overlay, with the overlay's merge rules. It is how a repo commits what only makes sense where
54
+ flow runs unattended, in CI or on a server — a way to drive the app in a container, a convention
55
+ for those MRs/PRs — without it reaching every laptop through the base. Flow never needs to know
56
+ who set it. Unset or empty → no context layer, and nothing else changes. Set, and the file is
57
+ not there → not an error; say so beside the files you name (`FLOW_CONTEXT=ci: FLOW.ci.md not
58
+ found`), because a typo in the variable is otherwise a repo with no context file. **The name is
59
+ one plain segment, taken exactly as written**: an ASCII letter or digit, then ASCII letters,
60
+ digits, `-` or `_` — nothing trimmed, so a padded `" ci"` fails — and not a harness name in any case
61
+ (`FLOW_CONTEXT=Claude` would read an overlay as the wrong layer). A name that fails → read no
62
+ context layer, say so in the same place, and carry on — never a stop. `flow-workflows` applies
63
+ the same rule, so the two of you resolve the same layers.
64
+ Any other `FLOW.<name>.md` at the root is a context file this run did not select: unread, by
65
+ design.
47
66
  - **"The repo root" is the main checkout's, not the worktree's.** With `git.worktree` set, every
48
67
  phase after `start` runs inside a linked worktree — and a `FLOW.md` the repo git-ignores (the
49
68
  normal case for a personal config, and always the case for a harness overlay) exists **only in
50
69
  the main checkout**. Looking for it where the phase happens finds nothing, and a configuration
51
70
  that resolves to every fallback looks exactly like a repo that never had one: the models, the
52
71
  ceilings and the sensitive paths are silently the defaults, and the phase reports nothing
53
- because from where it stands there is nothing to report. So: prefer a `FLOW.md` in the directory
54
- you are in — a repo that commits its config has one in every worktree, and it may legitimately
55
- differ — and otherwise read both files from the main checkout, which
72
+ because from where it stands there is nothing to report. So, **for each file on its own**: prefer
73
+ the copy in the directory you are in — a repo that commits its config has one in every worktree,
74
+ and it may legitimately differ — and otherwise read it from the main checkout, which
56
75
  `git rev-parse --path-format=absolute --git-common-dir` locates from anywhere (its parent
57
- directory). Name the file you actually read when a stop reports configuration.
76
+ directory) — **unless that checkout tracks it**: the main checkout's HEAD is the first `HEAD`
77
+ line of `git worktree list --porcelain`, and `git ls-tree --name-only <that sha> -- <file>`
78
+ printing the name means it is tracked. A tracked file missing here is this branch's own state,
79
+ deleted, renamed or not added yet, and the main checkout's copy is another branch's version.
80
+ Either command failing → do not borrow the file, and say so where you name the files you read.
81
+ The file name matches exactly, case included, even where the filesystem would not care. One root for all of them misses a file whenever
82
+ they live apart: a committed context file is in the worktree while the git-ignored base exists
83
+ only in the main checkout. Name the file you actually
84
+ read, and where, when a stop reports configuration.
58
85
  **This is a rule about reading a git-ignored config, and it inverts for anything a phase
59
86
  writes into the repo.** A tracked file belongs to the branch, and the branch is the worktree:
60
87
  written to the main checkout it lands on whatever that checkout is standing on — usually the
@@ -67,16 +94,17 @@ a command relies on is simply absent in that session, and nothing else will repo
67
94
  ("add this to try it once") would be read as the configuration it illustrates, while the prose
68
95
  around it says otherwise and nothing reports the disagreement. **Skip fenced regions when you read a FLOW
69
96
  file**; `flow-workflows` does the same, so the two of you resolve the same config.
70
- - Merge by section and key. A key present in the active overlay replaces the base value; a key
71
- absent there inherits the base. **A present-but-empty overlay key masks the base** and resolves
97
+ - Merge by section and key, in order: base, context layer, active overlay. A key present in a
98
+ later layer replaces the earlier value; a key absent there inherits it. **A present-but-empty key
99
+ masks what came before** and resolves
72
100
  to the normal empty-key fallback — this is how Codex can inherit its session model while a legacy
73
101
  `FLOW.md` still names a Claude model. A list-valued key is replaced as a whole, never appended.
74
- `conventions` is the one unkeyed section: its overlay lines are added after the base lines, so
75
- both sets apply. **Every value carries the file it came from**, and a phase that prints a value
102
+ `conventions` is the one unkeyed section: each layer's lines are added after the previous ones,
103
+ so every set applies. **Every value carries the file it came from**, and a phase that prints a value
76
104
  prints that file with it — "`agents: opus` (`FLOW.claude.md`)", never the value alone. `doctor` reports it and later
77
105
  edits preserve it.
78
- - The sections in either file are tracker, git, autonomy, quality, agents, models, data,
79
- conventions, notes, knowledge, and observability. Both files missing, or an effective empty key
106
+ - The sections in any of the files are tracker, git, autonomy, quality, agents, models, data,
107
+ conventions, notes, knowledge, and observability. No layer found, or an effective empty key
80
108
  → the default or auto-discovery each step names. Never stop because a file or key is empty.
81
109
  - **An empty key that is a real decision for this repo is offered where it first matters**, and
82
110
  nowhere else. Three steps, in order:
@@ -101,7 +129,10 @@ a command relies on is simply absent in that session, and nothing else will repo
101
129
  The FLOW config is personal, so writing a line is not a team decision; it is still an edit to the
102
130
  tree, so the option is an explicit choice the user makes, never a default action (same bar as
103
131
  flow-core §8's convention offer, and the two share their wording). Update a value in the file it
104
- came from. A new repo fact or shared preference goes to `FLOW.md`; a new harness-owned model,
132
+ came from — **except that the context layer is not personal**: it is committed, a value it holds
133
+ is the repo's, and changing it is a change to a tracked file of this branch, written here (the
134
+ inversion above) and shipped in the MR/PR like code, never offered as a quick config line. A new
135
+ key never goes to the context layer by this route. A new repo fact or shared preference goes to `FLOW.md`; a new harness-owned model,
105
136
  agent, skill, orchestration tool, or knowledge-tool name goes to the active overlay. Never edit an
106
137
  inactive harness's overlay.
107
138
  - **Knowledge sources, by role** (`knowledge` section): `search` (one or more tools or commands
@@ -252,7 +283,7 @@ assumed:
252
283
  <cmd> ask --question-file F --options-file F [--recommended N] [--free-text] [--gate NAME]
253
284
  <cmd> publish --title-file F --body-file F [--part N --of M]
254
285
  <cmd> blocked --reason-file F
255
- <cmd> done [--summary-file F]
286
+ <cmd> done [--summary-file F] [--depends-on N]…
256
287
  <cmd> reply --thread ID --body-file F
257
288
  ```
258
289
 
@@ -313,12 +344,18 @@ runs the study phases as any run does, and three rules make it stop where it sho
313
344
  study to code crosses that door, an answered question that resumes straight into `build`
314
345
  included, so the phases before it carry no clause. The run kind is read there, never stored: the
315
346
  approval reuses the same work folder with `why = start`.
316
- - **At the door**, a study run first writes the statement of the change when the study holds none
347
+ - **At the door**, a study run first checks each `meta.json.ticket_deps` entry: `N` = its `ticket`
348
+ without a leading `#`, the form `ticket --json` prints `number`, and it must match
349
+ `[A-Za-z0-9][A-Za-z0-9._-]*` — an `N` that does not (a space, a shell character, a leading `-`)
350
+ is never put on a command line: `blocked`, naming the entry, before anything below is written.
351
+ Then it writes the statement of the change when the study holds none
317
352
  (the command says which), then `done-summary.md` — the `flow-study` block of `/flow:work:handoff`
318
353
  §5, the same sections from the same sources, and, when `01-context.md` lists `## Study revisions`,
319
354
  the line `Revised at the reviewer's request: <n> reply(ies)` first under `## What and why`. It
320
355
  overwrites `00-summary.md`, sets the panel's `attention` to `done` and closes with
321
- `done --summary-file`. Nothing else moves — no `mrs[]` entry, no branch, no brief — so
356
+ `done --summary-file`, plus one `--depends-on N` per `meta.json.ticket_deps` entry, in its order —
357
+ so the orchestrator can hold the ticket until those land; what it does with them is its call.
358
+ Nothing else moves — no `mrs[]` entry, no branch, no brief — so
322
359
  `meta.json.phase` stays at the last study phase and approval is an ordinary `start`.
323
360
  - **A person's changes rewind the study.** `/flow:work:run` §2 adds the reply to the ticket in
324
361
  `01-context.md` and sends the work back to `context`; the study phases then run again whole, the
@@ -331,7 +368,7 @@ person asking for changes, a ticket that already has code — is `/flow:work:run
331
368
  | Where | In `unattended` |
332
369
  |---|---|
333
370
  | Business brief before code (`build`, `fix`) | record — the brief is written to the phase artifact, marked `recorded (unattended)`, and travels in the MR/PR body |
334
- | The door to code in a study run (`build`, `fix` pre-flight) | done — `done-summary.md`, the study as `/flow:work:handoff` §5 writes it for the ticket |
371
+ | The door to code in a study run (`build`, `fix` pre-flight) | done — `done-summary.md`, the study as `/flow:work:handoff` §5 writes it for the ticket, and one `--depends-on` per `meta.json.ticket_deps` entry |
335
372
  | Push and MR/PR creation (`ship`) | `publish` — the run commits on its own branch, writes title and body, and hands them over; the orchestrator pushes and opens the draft |
336
373
  | Writing a DB schema change, index or migration — in any phase, a review's own fixes included — or applying one (`validate`) | question `migration`, before the first line of it is written or run — except in `respond` and `green`, where it is blocked: a schema change agreed after the MR/PR exists goes back through `build` |
337
374
  | `review` with blockers or high-severity findings | question `high_findings` |
@@ -351,6 +388,7 @@ person asking for changes, a ticket that already has code — is `/flow:work:run
351
388
  | The next MR/PR of a train (`ship` close) | record — not started: one MR/PR per unattended run |
352
389
  | `build` with no startable MR/PR (its `depends_on` not `merged` in `meta.json`) | blocked — the reason names what must merge; an unattended `build` never stacks a branch on another, and never creates a remote branch |
353
390
  | The parent of a stacked MR/PR merged — rebase and force-push | blocked — never force-push unattended |
391
+ | An approved study's branch (`run`, `why = start`, no build or fix begun) | record — fast-forwarded to its base when it holds no commit of its own (`/flow:work:run` §2); the base unreadable or the fast-forward failing → blocked. Not integrating: nothing of the run's is merged |
354
392
  | Integrating the base into the MR/PR's branch (`green`) | on `why = conflict`, record — `git merge origin/<base>` as the orchestrator left it, never rebase, each conflict resolved on its merits (`/flow:work:green` §5.C); on any other `why`, blocked — the orchestrator brings the base in |
355
393
  | Any offer about the work's own bookkeeping — a tracker issue, the first `KNOWLEDGE.md` or a knowledge save, a FLOW convention, an agent lesson or a saved specialist, the follow-up survey, carrying files over from the main checkout, a contract handoff, archiving the work | record — `Later`; nothing written outside the work folder |
356
394
  | A step the command cannot complete (a red suite it cannot fix, a tool missing, auth failing, the same check failing a second time) | blocked |
@@ -1072,7 +1110,10 @@ learned during `build` is enforced in the review of that same MR/PR, not of the
1072
1110
  **`ship` offers them once, at Close** — one `AskUserQuestion`, batched up to 4, options **Add to
1073
1111
  FLOW.md** · **Not a rule** · **Later**, the `text` being the whole prompt. *Add* appends a convention
1074
1112
  to the base `FLOW.md`. A `quality` correction updates the file its effective value came from, or the
1075
- base when the key was absent: otherwise an overlay would immediately hide the correction. The FLOW
1113
+ base when the key was absent: otherwise an overlay would immediately hide the correction. A value
1114
+ that came from the context layer is the exception (§0): that file is committed, so the correction
1115
+ is a change to this branch, made before the MR/PR is created or offered as a follow-up — never a
1116
+ config line written after it. The FLOW
1076
1117
  config is personal, but this is still an edit to a file in the tree, so **it is asked in every
1077
1118
  mode**, like `KNOWLEDGE.md`'s first creation. No candidates → the step does not exist and says
1078
1119
  nothing.
@@ -32,7 +32,15 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
32
32
  would make — from the root cause and the constraints for the fix when the investigation has them,
33
33
  the reproduction and the ticket otherwise, `## Study revisions` included — the person approves a
34
34
  stated change, never `none`; then the summary, and
35
- `<cmd> done --summary-file <work>/done-summary.md`. Nothing else in this command runs.
35
+ `<cmd> done --summary-file <work>/done-summary.md`, plus `--depends-on N` per
36
+ `meta.json.ticket_deps` entry, `N` its `ticket` with the leading `#` dropped — a bare `#` starts a
37
+ shell comment — and checked against `[A-Za-z0-9][A-Za-z0-9._-]*` before anything is written, else
38
+ `blocked` (flow-core §2.1). Nothing else in this command runs.
39
+ - **`meta.json.ticket_deps` not empty, and not `unattended`** → the study rests on other tickets
40
+ (`/flow:feat:design` §5.1): name each — `<ticket> — <why>` — in the brief's stop (§2), one line,
41
+ so whoever builds confirms the piece is on **this work's branch**, not only on its base — the
42
+ branch was cut when the study began, and a piece that merged since needs the base brought in
43
+ before writing against it. Nothing is checked; waiting is the builder's call.
36
44
  - `size` `XS`: may start without `investigate`, but require a 2-3 line description of the fix — an `## Intended fix` in `03-investigation.md` is that description.
37
45
  - **An `## Intended fix` in `03-investigation.md` binds §2's brief at every size**: it is what a person approved at the end of a study (flow-core §2.1).
38
46
  - `size` ≥ S: require `investigate` in `phases_done` (on S it will have run its reproduction half only).
@@ -170,10 +170,21 @@ If `agents.fanout_tool` is set in `FLOW.md`, run the sweep through that tool; br
170
170
  - Do not touch X because…
171
171
  - Consider Y because…
172
172
 
173
+ ## Depends on other tickets
174
+ <§4.1: `- <ticket> — <what it brings that the base branch lacks>`, then "Not dependencies (either order works)", or "none".>
175
+
173
176
  ## Investigation challenges
174
177
  <filled in by §5 with the challenger table>
175
178
  ```
176
179
 
180
+ ### 4.1 Tickets this fix depends on
181
+
182
+ A fix can rest on another ticket the same way a design can — a corrected contract, a migration, a
183
+ decision that lands only when that ticket merges. Detect and record it before the challenger, exactly
184
+ as `/flow:feat:design` §5.1 says: the same rule, the same "Not dependencies (either order works)"
185
+ line, the same `meta.json.ticket_deps` entries, written under `## Depends on other tickets` in
186
+ `03-investigation.md`.
187
+
177
188
  ## 5. Root cause challenge (challenger)
178
189
 
179
190
  Before closing, launch a `Agent general-purpose` challenger with this task:
@@ -33,7 +33,7 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
33
33
 
34
34
  **Mandatory regression test**: launch the `agents.testing` agent from FLOW.md (empty → `Agent general-purpose` with a test-writing role):
35
35
 
36
- > Write a test that **fails** before the fix and **passes** after. Read `.claude/work/<TICKET>/03-investigation.md` (minimal reproduction), `04-fix.md` (what was changed). Follow the effective conventions from `FLOW.md` plus the active harness overlay. Report the path of the added test.
36
+ > Write a test that **fails** before the fix and **passes** after. Read `.claude/work/<TICKET>/03-investigation.md` (minimal reproduction), `04-fix.md` (what was changed). Follow the effective conventions from `FLOW.md`, the context layer `FLOW_CONTEXT` selects and the active harness overlay. Report the path of the added test.
37
37
 
38
38
  Then:
39
39
  1. Run only that test with `quality.test_one` from FLOW.md; it must pass.
@@ -26,15 +26,19 @@ changing machines, after `/flow:init`, or when a command failed the way an envir
26
26
  ## 1. Load
27
27
 
28
28
  - Identify the active harness and read the effective configuration exactly as flow-core §0: base
29
- `FLOW.md`, then its `FLOW.<harness>.md` overlay. Never read another harness's overlay. Both absent
29
+ `FLOW.md`, then the context layer `FLOW.<FLOW_CONTEXT>.md` when the variable is set, then its
30
+ `FLOW.<harness>.md` overlay. Never read another harness's overlay. **Name the active context** —
31
+ its value and the file it selects, `none` when the variable is unset, and the reason when the name
32
+ was refused or the file is missing (flow-core §0): a context set on a server and lost on the way
33
+ reads here as `none`, and nowhere else. No layer present
30
34
  is **not** an error: say so in one line, check what needs no config (git, hooks, harness, base
31
35
  branch, plugin files), and note that `/flow:init` would let this command check the rest.
32
36
  **Say which checkout the configuration came from** whenever it is not the directory you are in
33
37
  (flow-core §0: a worktree does not carry a git-ignored `FLOW.md`). A diagnosis run from a
34
38
  worktree that quietly read nothing is the one that certifies a repo as unconfigured.
35
- - Parse both files by section: `tracker`, `git`, `autonomy`, `quality`, `agents`, `models`, `data`,
39
+ - Parse each layer by section: `tracker`, `git`, `autonomy`, `quality`, `agents`, `models`, `data`,
36
40
  `conventions`, `notes`, `knowledge`, `observability`; merge keys and empty masks per flow-core §0.
37
- Keep the source of every effective value. Both absent → §1.5 runs with **every** key empty (all
41
+ Keep the source of every effective value. No layer present → §1.5 runs with **every** key empty (all
38
42
  fallbacks), which is a legitimate and complete answer.
39
43
 
40
44
  ## 1.5 What the configuration says
@@ -48,14 +52,14 @@ documented keys absent from the effective configuration (the "empty → fallback
48
52
  For **every** documented key in `examples/FLOW.template.md`, one row:
49
53
 
50
54
  - **set** → the value and source file (list keys like `git.worktree_resync` or
51
- `quality.reviewers`: the items). A value overridden by the active overlay names only the active
52
- value here; do not make the user mentally merge two tables.
55
+ `quality.reviewers`: the items). A value overridden by a later layer names only the winning
56
+ value and its file here; do not make the user mentally merge two tables.
53
57
  - **empty / absent** → `(empty → <what happens>)`, taken from the key's comment in the template
54
58
  (e.g. `quality.test` → "auto-discover from Makefile/npm/composer/Gradle/dotnet/Xcode/Flutter"; `tracker.tool` → "manual paste";
55
59
  `agents.security` → "general-purpose with the role"; `git.worktree` → "off / in-place";
56
60
  `git.worktree_resync` → "`/flow:work:try` only switches, no re-sync"; `quality.review_depth` →
57
- "proportional" — the other depths are `light` and `full`). An empty overlay mask says
58
- `(masked by FLOW.<harness>.md → <what happens>)`. Never leave a reader guessing what an empty key
61
+ "proportional" — the other depths are `light` and `full`). An empty mask says
62
+ `(masked by FLOW.<context or harness>.md → <what happens>)`. Never leave a reader guessing what an empty key
59
63
  does.
60
64
 
61
65
  For `knowledge`, print the four roles resolved with who decided each: the `knowledge` key, or empty with its fallback (`search` → no lookups; `stage` → artifact only; `read_staging` → artifacts; `save` → `KNOWLEDGE.md`). A `domain_memory` section still in the file → one line: *"`domain_memory` is no longer read; name the tools you want under `knowledge`"* — it is retired configuration, not an error.
@@ -69,7 +73,7 @@ print one informational line: those values currently apply to every harness with
69
73
  override. This is valid configuration, not a warning and never a claim that a free-text model name
70
74
  is invalid.
71
75
 
72
- #### 1.5.2 Resolved models (only if either file has a `models` key)
76
+ #### 1.5.2 Resolved models (only if any layer has a `models` key)
73
77
 
74
78
  Three keys, all about subagents. Print what each one actually reaches:
75
79
 
@@ -119,10 +123,23 @@ data.volumes (none — duel ran schema-only) 2 works last: query
119
123
 
120
124
  ### 1.5.4 Problems in the configuration files (flag, do not fix)
121
125
 
122
- Report problems, change nothing. Validate the base and active overlay separately, name the file
123
- that owns each problem, and ignore inactive overlays. An unknown root `FLOW.*.md` file gets one
124
- warning listing the supported harness names because no command will read it. **Scope: these files.**
125
- Whether the world they describe exists —
126
+ Report problems, change nothing. Validate the base, the active context file and the active
127
+ overlay separately, name the file that owns each problem, and ignore inactive overlays. Any other
128
+ root `FLOW.<name>.md` is a context file this run did not select: list it once, as inactive, with the
129
+ `FLOW_CONTEXT=<name>` that would select it and the six harness overlay names beside it — a
130
+ misspelled overlay (`FLOW.cluade.md`) reads exactly like a context, and only the reader can tell —
131
+ never as unknown, and its keys are not validated. Only a name the context rule refuses (flow-core
132
+ §0) gets a warning, because nothing will ever read it.
133
+ - **A context file git would swallow**: run `git check-ignore -v --no-index FLOW.flow-probe.md` at
134
+ the repo root — a name no repo tracks, so a context file that was force-added does not hide the
135
+ rule, and `--no-index` asks the ignore rules rather than the index. It prints a rule that does not
136
+ start with `!` → one warning naming that rule and its file (`.gitignore`, `.git/info/exclude`, a
137
+ global excludes file): a `FLOW.*.md` written by an older `/flow:init` hides every new context file
138
+ from `git add`, and the run that needs it reports it `not found` somewhere else, long after.
139
+ Replace the glob with the names `/flow:init` §5 lists. A `!` rule, or nothing printed → no
140
+ warning.
141
+
142
+ **Scope: these files.** Whether the world they describe exists —
126
143
  CLIs installed *and authenticated*, agents discoverable, hooks executable, the MCP reachable, the
127
144
  base branch resolvable — is §2 below; flag the key here, check the world there, never both.
128
145
 
@@ -262,10 +279,11 @@ refuse) · **degraded** (it runs, quietly worse than the config promises), plus
262
279
  ## 3. Output
263
280
 
264
281
  §1.5 always prints — it is the answer to half the question. Start it with one line naming the files
265
- that produced the effective configuration (`FLOW.md + FLOW.codex.md`, `FLOW.md only`, active
266
- overlay only, or defaults only). **The checks are quiet on success**:
282
+ that produced the effective configuration, in merge order and with the checkout each came from
283
+ when it is not this one (`FLOW.md + FLOW.ci.md [FLOW_CONTEXT=ci] + FLOW.codex.md`, `FLOW.md only`,
284
+ active overlay only, or defaults only), and the active context on the next line. **The checks are quiet on success**:
267
285
  one line per check that is *not* ok, grouped by the six areas above, plus a summary line. Close with
268
- `N effective keys set (O from overlay), M using fallbacks, K warnings` from §1.5 next to the
286
+ `N effective keys set (C from the context layer, O from overlay), M using fallbacks, K warnings` from §1.5 next to the
269
287
  findings count.
270
288
 
271
289
 
@@ -29,8 +29,15 @@ Implementation phase. Code is written here.
29
29
  and act as flow-core §2.1 "A study run" says. On `study` → this run writes no code: `size` XS and
30
30
  no `03-design.md` → first write the 2–3 line note below as that file, from `01-context.md` (its
31
31
  `## Study revisions` included) — the person approves a stated change, never `none`; then the
32
- summary, and `<cmd> done --summary-file <work>/done-summary.md`. Nothing else in this command
33
- runs.
32
+ summary, and `<cmd> done --summary-file <work>/done-summary.md`, plus `--depends-on N` per
33
+ `meta.json.ticket_deps` entry, `N` its `ticket` with the leading `#` dropped — a bare `#` starts a
34
+ shell comment — and checked against `[A-Za-z0-9][A-Za-z0-9._-]*` before anything is written, else
35
+ `blocked` (flow-core §2.1). Nothing else in this command runs.
36
+ - **`meta.json.ticket_deps` not empty, and not `unattended`** → the study rests on other tickets
37
+ (`/flow:feat:design` §5.1): name each — `<ticket> — <why>` — in the brief's stop (§2), one line,
38
+ so whoever builds confirms the piece is on **this work's branch**, not only on its base — the
39
+ branch was cut when the study began, and a piece that merged since needs the base brought in
40
+ before writing against it. Nothing is checked; waiting is the builder's call.
34
41
  - `size` M/L: require both `03-design.md` **and** `04-mr-plan.md`. Plan missing → send to `/flow:feat:plan`; design missing → send to `/flow:feat:design`.
35
42
  - `size` XS/S: may start without a design — ask the user for a 2-3 line note on what will be done and save it as a minimal `03-design.md`. No MR/PR plan (always 1 MR/PR).
36
43
  - **If `meta.json.mrs` has more than one entry**: pick the **startable** MR/PR — the `pending` one with the **lowest `n` whose `depends_on` are all `merged`**. Dependencies still `pending`/`in_progress` → not startable, even with a low `n`. (No `wave`/`depends_on` — an older plan — → "first pending by `n`".)
@@ -99,8 +99,8 @@ authorization, payments, personal data, a public contract, a migration):
99
99
  Each advisor gets this brief, with its lens substituted:
100
100
 
101
101
  > Propose ONE approach to solve ticket `<TICKET>`, from this lens: `<lens brief>`. Read
102
- > `.claude/work/<TICKET>/01-context.md` for context and the effective FLOW configuration (base plus
103
- > active harness overlay) for project conventions. What already exists in the repository:
102
+ > `.claude/work/<TICKET>/01-context.md` for context and the effective FLOW configuration (base, the
103
+ > context layer `FLOW_CONTEXT` selects, and the active harness overlay) for project conventions. What already exists in the repository:
104
104
  > `<the §1.5.1 inventory>` — propose a new piece only where nothing there fits. Do not
105
105
  > write code. Be specific about real modules and layers of this project. Report: name, what it is
106
106
  > (one sentence), modules/layers affected, main risk, and why it could be a bad idea. Under 250 words.
@@ -286,6 +286,9 @@ Consolidate outputs into `.claude/work/<TICKET>/03-design.md`:
286
286
  - **Invariant**: <e.g. "after assignTo(user), ticket.assignee == user AND ticket.status != 'unassigned'">
287
287
  - **Edge / boundary**: <e.g. "empty input list → returns 0, does not throw">
288
288
 
289
+ ## Depends on other tickets
290
+ <§5.1: one line per ticket this design cannot be built without — `- <ticket> — <what it brings that the base branch lacks>` — then, under "Not dependencies (either order works)", each premise on another ticket that holds whichever merges first, with one line why. Neither → "none".>
291
+
289
292
  ## Defensive mechanisms and their justification
290
293
  <One row per validation, guard, retry, lock, fallback, cache, idempotency, queue, or flag the design introduces. If you cannot name a REAL and PRESENT scenario that justifies it, the piece is unnecessary — remove it from the design.>
291
294
 
@@ -314,6 +317,33 @@ Consolidate outputs into `.claude/work/<TICKET>/03-design.md`:
314
317
 
315
318
  **"Acceptance criteria"**: start from the provisional list in `01-context.md` (pinned from the ticket in `/flow:feat:start`), fold in the clarifications and the internal/external contracts decided here, and promote it to the canonical enumerated list `/flow:feat:validate` gates against — observable, verifiable, proportional to size.
316
319
 
320
+ ### 5.1 Tickets this design depends on
321
+
322
+ Fill `## Depends on other tickets` now, before the challenger of §6 reads the design. The study is
323
+ often built by someone who never saw it made — another person, an unattended server — and who
324
+ starts from the base. A design that rests on what another ticket has not delivered yet leaves that
325
+ builder to find the piece missing and either ask or redo it.
326
+
327
+ - **A dependency** is a piece, contract or decision the chosen design needs, that is **not on the
328
+ base this work builds from** (`meta.json.base`, empty → `git.default_base`) — checked there, after
329
+ a best-effort `git fetch origin <base>`, never assumed from a local ref — and that **another
330
+ ticket** of this tracker brings. Missing from the base with no ticket bringing it → it is scope
331
+ or an open question, not a dependency. A ticket in another repo is not a `ticket_deps` entry —
332
+ the orchestrator only resolves this tracker's numbers — so write it in the section as a
333
+ cross-repo dependency, for a person, and leave it out of the list.
334
+ - **Not a dependency**: a premise that holds whichever ticket merges first. Say so under "Not
335
+ dependencies (either order works)", so nobody waits for it.
336
+ - **Record each one** in that section and in `meta.json.ticket_deps` —
337
+ `{ "ticket": "<the reference as a ticket body writes it: #253, MT-123>", "why": "<one line>" }`,
338
+ never one twice. `ticket_deps` is the record the exits read (`/flow:work:handoff` §5, the door to
339
+ code of an unattended study run, flow-core §2.1); the section is the study's prose. Each run of
340
+ this phase writes the list whole from the design it closes; `plan`, which runs after it, appends
341
+ its own again. A §6 response or a §9 edit that changes what the design needs changes
342
+ the section and the list together. None → `[]` and "none".
343
+
344
+ `ticket_deps` is not `mrs[].depends_on`: that one orders this work's own MRs/PRs, this one names
345
+ other tickets. Flow never checks whether a dependency has closed — whoever builds waits for it.
346
+
317
347
  ## 6. Design challenge (challenger)
318
348
 
319
349
  Before closing, **challenge the design** with an `Agent general-purpose` and this self-contained brief:
@@ -122,6 +122,7 @@ Add the `mrs` array with the agreed plan:
122
122
  ```
123
123
 
124
124
  - `n` = execution order (topological): `depends_on` only ever references a **lower** `n`; `wave` groups MRs/PRs that can run in parallel. `/flow:feat:build §1` reads `depends_on` to pick the next **startable** MR/PR and to say which can go in parallel — keep both accurate whenever the plan is edited or renumbered.
125
+ - **Another ticket is not a `depends_on`.** An MR/PR that turns out, while splitting, to need something another ticket brings is a dependency of the study: append it to `meta.json.ticket_deps` as `/flow:feat:design` §5.1 says, name it in that MR/PR's entry of `04-mr-plan.md` beside what it waits on, and leave `03-design.md` as it closed. The design's own entries stand as they are.
125
126
  - **`phases_done`** starts `[]` in every seeded entry: it tracks `build`/`review`/`validate` **for that MR/PR specifically**, so the gates in `/flow:feat:review §1`, `/flow:feat:validate §1` and `/flow:feat:ship §1` judge *this* MR/PR — a sibling's review never satisfies a new MR/PR's gate.
126
127
  - Estimates are **indicative**, not contractual. `/flow:feat:build` uses them as a thermometer: real work over `lines_est` +50% or `files_est + 2` triggers the "cut or continue" question (see §2.3 in build). **A thermometer is not a target** (flow-core §9): an estimate is never met by deleting comments, tests or blank lines, by compressing readable code, or by cutting where the piece is not coherent — the overrun is recorded instead, and a diff shaped to fit a number is the one case where these estimates lie to the phases downstream.
127
128
 
@@ -529,7 +529,9 @@ Read `meta.json.conventions_candidates[]` (flow-core §8). **No entries with `st
529
529
  decision — the FLOW config is personal — so it is one question, never a negotiation.
530
530
  4. **Add / Replace** → append a `conventions` line to the base `FLOW.md`. For a `quality.<key>`,
531
531
  update the file its effective value came from, or the base when it was absent; otherwise an
532
- overlay would immediately hide the correction. Show the old value and source in the result.
532
+ overlay would immediately hide the correction. A value from the context layer (flow-core §0) is
533
+ not edited here: that file is committed and the MR/PR is already out, so record the candidate as
534
+ a `followups[]` entry (`kind: "tooling"`) naming the file and the line instead. Show the old value and source in the result.
533
535
  Then `status: "added"`. **Not a rule** → `declined`, never offered again in any work.
534
536
  **Later** → stays `proposed` and is offered again by the next `ship` of a work that has it.
535
537
  5. **One line on screen**: how many rules were added and where, never a list of the texts —
@@ -46,7 +46,7 @@ its reason file in a `mktemp -d` directory (flow-core §2.1).
46
46
 
47
47
  ## 1. Pre-flight
48
48
 
49
- - Read the effective FLOW configuration per flow-core §0; neither base nor active overlay → each
49
+ - Read the effective FLOW configuration per flow-core §0; no FLOW layer present → each
50
50
  step's default. This command **creates** `00-summary.md` (§6) instead of reading it (flow-core §5).
51
51
  - No recognizable project structure → warn and stop.
52
52
  - **Determine the mode**: `{{args}}` non-empty → *ticket mode* (identifier = `{{args}}`); empty → *ticket-less* (identifier = the §2.5 slug).
@@ -34,7 +34,7 @@ One of the three below writes and two of them read, so they do not all go at onc
34
34
 
35
35
  **First, alone — the writer.** It is told the **test files are the deliverable**, saved as each one is finished, not at the end:
36
36
 
37
- 1. **Testing agent**: the `agents.testing` agent from the effective FLOW config; if empty, `Agent general-purpose` with this role. Brief: "Review the branch changes and complete the test suite where coverage is missing. Focus: the acceptance criteria in `03-design.md` marked `test` that no current test demonstrably asserts (see the §3 mapping), plus edge cases from `03-design.md`, error paths, input validations, emitted domain events. Do not rewrite tests that already pass. Read `.claude/work/<TICKET>/03-design.md` and `05-implementation.md`. Follow the project's effective test conventions from `FLOW.md` plus the active harness overlay."
37
+ 1. **Testing agent**: the `agents.testing` agent from the effective FLOW config; if empty, `Agent general-purpose` with this role. Brief: "Review the branch changes and complete the test suite where coverage is missing. Focus: the acceptance criteria in `03-design.md` marked `test` that no current test demonstrably asserts (see the §3 mapping), plus edge cases from `03-design.md`, error paths, input validations, emitted domain events. Do not rewrite tests that already pass. Read `.claude/work/<TICKET>/03-design.md` and `05-implementation.md`. Follow the project's effective test conventions from `FLOW.md`, the context layer `FLOW_CONTEXT` selects and the active harness overlay."
38
38
 
39
39
  **Then, in parallel — the readers**, once the testing agent has reported and its files are on disk. The suite runs here and not earlier for a second reason beyond the collision: run after the writer, it is the first thing that has ever executed the tests this phase just added.
40
40
 
@@ -20,14 +20,17 @@ and optional harness-owned values in the active `FLOW.<harness>.md`. The active
20
20
  `FLOW.zcode.md`; identify it from the
21
21
  product executing this command, never from the selected model (zcode runs the Claude pages too, so
22
22
  the page you are reading does not name the harness). Every other `/flow:*` command reads
23
- the base and then that overlay. The user answers the **minimum**: what the repo can tell is
23
+ the base, then the context layer `FLOW_CONTEXT` selects (flow-core §0), then that overlay. A
24
+ context file is the repo's, committed for where flow runs: `init` writes neither it nor its key. The user answers the **minimum**: what the repo can tell is
24
25
  auto-detected and only confirmed.
25
26
 
26
27
  Key names and contract: `examples/FLOW.template.md` from the plugin. Do not invent keys that are not there.
27
28
 
28
29
  ## 1. If either configuration file already exists
29
30
 
30
- Show `FLOW.md` and the active overlay when each exists, then show their effective merged values.
31
+ Show `FLOW.md` and the active overlay when each exists, then show their effective merged values —
32
+ with the context layer `FLOW_CONTEXT` selects merged in and named when it is set (flow-core §0), so
33
+ a value it masks is not offered as if the base still decided it.
31
34
  Ask: **update** (re-detect and re-ask, preserving what the user keeps) or **cancel**. Never read,
32
35
  change, or display another harness's overlay. Never overwrite either file without confirmation.
33
36
  Label harness-sensitive values that currently come from the base as **shared across harnesses**;
@@ -102,7 +105,7 @@ review, not a questionnaire. Then, and only then, five questions:
102
105
  4. **The quality commands as one block** (`quality.test`, `test_one`, `static_analysis`, `style_fix`,
103
106
  `db_update`, `db_diff`) — confirm or edit what §2 found, all in one question, each may stay empty
104
107
  (= auto-discover at the moment it is needed). Several suites chain into `test` with `&&`.
105
- 5. **Git-ignore** `FLOW.md`, `FLOW.*.md`, and `.claude/work/` — see §5.
108
+ 5. **Git-ignore** `FLOW.md`, the six harness overlays by name, and `.claude/work/` — see §5.
106
109
 
107
110
  **Two keys are written without being asked**: `agents.fanout_max` (`4`) and `agents.budget_max`
108
111
  (`12`), with their default values, because they are the only brake on what a review costs and a key
@@ -121,7 +124,7 @@ overlay, never the base.
121
124
 
122
125
  ## 4. Write the base and, only when needed, the active overlay
123
126
 
124
- Write compact files at the repo root — every command reads the base and active overlay in every
127
+ Write compact files at the repo root — every command reads every FLOW layer in every
125
128
  phase, so their size is paid on every step:
126
129
 
127
130
  - `FLOW.md` holds repo facts and shared preferences: tracker, git, autonomy, quality commands, cost
@@ -154,10 +157,11 @@ phase, so their size is paid on every step:
154
157
  - The base and overlays are **personal config, not team config** (repo facts mixed with one
155
158
  developer's flow preferences, tools and agents; **no secrets**) — they should not be committed.
156
159
  One `AskUserQuestion`, both parts in the same question:
157
- - The root files not already git-ignored → **offer to add `/FLOW.md` and `/FLOW.*.md` to
158
- `.gitignore`**. This edits a tracked file — confirm before writing. A team wanting the repo-fact
159
- subset can still commit it deliberately. Do not use a recursive pattern: examples under the
160
- plugin must remain visible.
160
+ - The root files not already git-ignored → **offer to add `/FLOW.md`, `/FLOW.claude.md`, `/FLOW.codex.md`, `/FLOW.gemini.md`, `/FLOW.hermes.md`, `/FLOW.opencode.md` and `/FLOW.zcode.md` to `.gitignore`**,
161
+ each by name. This edits a tracked file — confirm before writing. A team wanting the repo-fact
162
+ subset can still commit it deliberately. Never `/FLOW.*.md`: it also hides a context layer
163
+ (`FLOW.<context>.md`, flow-core §0), which a repo commits on purpose. Do not use a recursive
164
+ pattern either: examples under the plugin must remain visible.
161
165
  - Git-ignore `.claude/work/` too — recommended default: ignore it (artifacts are personal working state; teams that want to share them commit deliberately). `git.worktree` not `off` → offer `.worktrees/` in the same gesture.
162
166
  - Suggest `/flow:next` as the next step (it routes to `/flow:feat:start`, `/flow:work:resume` or `/flow:work:status`).
163
167
  """