flow-workflows 0.62.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 (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +320 -0
  3. package/adapters/README.md +128 -0
  4. package/adapters/codex/AGENTS.md +82 -0
  5. package/adapters/codex/CORE.md +522 -0
  6. package/adapters/codex/PRIMITIVES.md +64 -0
  7. package/adapters/codex/README.md +126 -0
  8. package/adapters/codex/config.snippet.toml +88 -0
  9. package/adapters/codex/skills/flow-bug-fix/SKILL.md +171 -0
  10. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +216 -0
  11. package/adapters/codex/skills/flow-bug-postmortem/SKILL.md +98 -0
  12. package/adapters/codex/skills/flow-bug-review/SKILL.md +190 -0
  13. package/adapters/codex/skills/flow-bug-ship/SKILL.md +187 -0
  14. package/adapters/codex/skills/flow-bug-start/SKILL.md +212 -0
  15. package/adapters/codex/skills/flow-bug-validate/SKILL.md +99 -0
  16. package/adapters/codex/skills/flow-doctor/SKILL.md +254 -0
  17. package/adapters/codex/skills/flow-feat-build/SKILL.md +350 -0
  18. package/adapters/codex/skills/flow-feat-design/SKILL.md +399 -0
  19. package/adapters/codex/skills/flow-feat-plan/SKILL.md +165 -0
  20. package/adapters/codex/skills/flow-feat-review/SKILL.md +350 -0
  21. package/adapters/codex/skills/flow-feat-ship/SKILL.md +417 -0
  22. package/adapters/codex/skills/flow-feat-start/SKILL.md +289 -0
  23. package/adapters/codex/skills/flow-feat-validate/SKILL.md +216 -0
  24. package/adapters/codex/skills/flow-init/SKILL.md +153 -0
  25. package/adapters/codex/skills/flow-news/SKILL.md +57 -0
  26. package/adapters/codex/skills/flow-next/SKILL.md +55 -0
  27. package/adapters/codex/skills/flow-work-README/SKILL.md +247 -0
  28. package/adapters/codex/skills/flow-work-abandon/SKILL.md +103 -0
  29. package/adapters/codex/skills/flow-work-clean/SKILL.md +228 -0
  30. package/adapters/codex/skills/flow-work-daily/SKILL.md +114 -0
  31. package/adapters/codex/skills/flow-work-green/SKILL.md +162 -0
  32. package/adapters/codex/skills/flow-work-query/SKILL.md +169 -0
  33. package/adapters/codex/skills/flow-work-respond/SKILL.md +176 -0
  34. package/adapters/codex/skills/flow-work-resume/SKILL.md +123 -0
  35. package/adapters/codex/skills/flow-work-status/SKILL.md +127 -0
  36. package/adapters/codex/skills/flow-work-try/SKILL.md +94 -0
  37. package/adapters/codex/skills/flow-work-watch/SKILL.md +223 -0
  38. package/adapters/gemini/CORE.md +521 -0
  39. package/adapters/gemini/PRIMITIVES.md +117 -0
  40. package/adapters/gemini/README.md +149 -0
  41. package/adapters/gemini/commands/flow/bug/fix.toml +168 -0
  42. package/adapters/gemini/commands/flow/bug/investigate.toml +213 -0
  43. package/adapters/gemini/commands/flow/bug/postmortem.toml +95 -0
  44. package/adapters/gemini/commands/flow/bug/review.toml +187 -0
  45. package/adapters/gemini/commands/flow/bug/ship.toml +184 -0
  46. package/adapters/gemini/commands/flow/bug/start.toml +209 -0
  47. package/adapters/gemini/commands/flow/bug/validate.toml +96 -0
  48. package/adapters/gemini/commands/flow/doctor.toml +251 -0
  49. package/adapters/gemini/commands/flow/feat/build.toml +347 -0
  50. package/adapters/gemini/commands/flow/feat/design.toml +396 -0
  51. package/adapters/gemini/commands/flow/feat/plan.toml +162 -0
  52. package/adapters/gemini/commands/flow/feat/review.toml +347 -0
  53. package/adapters/gemini/commands/flow/feat/ship.toml +414 -0
  54. package/adapters/gemini/commands/flow/feat/start.toml +286 -0
  55. package/adapters/gemini/commands/flow/feat/validate.toml +213 -0
  56. package/adapters/gemini/commands/flow/init.toml +150 -0
  57. package/adapters/gemini/commands/flow/news.toml +54 -0
  58. package/adapters/gemini/commands/flow/next.toml +52 -0
  59. package/adapters/gemini/commands/flow/work/README.toml +244 -0
  60. package/adapters/gemini/commands/flow/work/abandon.toml +100 -0
  61. package/adapters/gemini/commands/flow/work/clean.toml +225 -0
  62. package/adapters/gemini/commands/flow/work/daily.toml +111 -0
  63. package/adapters/gemini/commands/flow/work/green.toml +159 -0
  64. package/adapters/gemini/commands/flow/work/query.toml +166 -0
  65. package/adapters/gemini/commands/flow/work/respond.toml +173 -0
  66. package/adapters/gemini/commands/flow/work/resume.toml +120 -0
  67. package/adapters/gemini/commands/flow/work/status.toml +124 -0
  68. package/adapters/gemini/commands/flow/work/try.toml +91 -0
  69. package/adapters/gemini/commands/flow/work/watch.toml +220 -0
  70. package/adapters/gemini/settings.snippet.json +11 -0
  71. package/adapters/hermes/CORE.md +522 -0
  72. package/adapters/hermes/PRIMITIVES.md +86 -0
  73. package/adapters/hermes/README.md +145 -0
  74. package/adapters/hermes/config.snippet.yaml +63 -0
  75. package/adapters/hermes/skills/flow-bug-fix/SKILL.md +171 -0
  76. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +216 -0
  77. package/adapters/hermes/skills/flow-bug-postmortem/SKILL.md +98 -0
  78. package/adapters/hermes/skills/flow-bug-review/SKILL.md +190 -0
  79. package/adapters/hermes/skills/flow-bug-ship/SKILL.md +187 -0
  80. package/adapters/hermes/skills/flow-bug-start/SKILL.md +212 -0
  81. package/adapters/hermes/skills/flow-bug-validate/SKILL.md +99 -0
  82. package/adapters/hermes/skills/flow-doctor/SKILL.md +254 -0
  83. package/adapters/hermes/skills/flow-feat-build/SKILL.md +350 -0
  84. package/adapters/hermes/skills/flow-feat-design/SKILL.md +399 -0
  85. package/adapters/hermes/skills/flow-feat-plan/SKILL.md +165 -0
  86. package/adapters/hermes/skills/flow-feat-review/SKILL.md +350 -0
  87. package/adapters/hermes/skills/flow-feat-ship/SKILL.md +417 -0
  88. package/adapters/hermes/skills/flow-feat-start/SKILL.md +289 -0
  89. package/adapters/hermes/skills/flow-feat-validate/SKILL.md +216 -0
  90. package/adapters/hermes/skills/flow-init/SKILL.md +153 -0
  91. package/adapters/hermes/skills/flow-news/SKILL.md +57 -0
  92. package/adapters/hermes/skills/flow-next/SKILL.md +55 -0
  93. package/adapters/hermes/skills/flow-work-README/SKILL.md +247 -0
  94. package/adapters/hermes/skills/flow-work-abandon/SKILL.md +103 -0
  95. package/adapters/hermes/skills/flow-work-clean/SKILL.md +228 -0
  96. package/adapters/hermes/skills/flow-work-daily/SKILL.md +114 -0
  97. package/adapters/hermes/skills/flow-work-green/SKILL.md +162 -0
  98. package/adapters/hermes/skills/flow-work-query/SKILL.md +169 -0
  99. package/adapters/hermes/skills/flow-work-respond/SKILL.md +176 -0
  100. package/adapters/hermes/skills/flow-work-resume/SKILL.md +123 -0
  101. package/adapters/hermes/skills/flow-work-status/SKILL.md +127 -0
  102. package/adapters/hermes/skills/flow-work-try/SKILL.md +94 -0
  103. package/adapters/hermes/skills/flow-work-watch/SKILL.md +223 -0
  104. package/adapters/install.sh +99 -0
  105. package/adapters/opencode/CORE.md +521 -0
  106. package/adapters/opencode/PRIMITIVES.md +118 -0
  107. package/adapters/opencode/README.md +113 -0
  108. package/adapters/opencode/commands/flow-bug-fix.md +169 -0
  109. package/adapters/opencode/commands/flow-bug-investigate.md +214 -0
  110. package/adapters/opencode/commands/flow-bug-postmortem.md +96 -0
  111. package/adapters/opencode/commands/flow-bug-review.md +188 -0
  112. package/adapters/opencode/commands/flow-bug-ship.md +185 -0
  113. package/adapters/opencode/commands/flow-bug-start.md +210 -0
  114. package/adapters/opencode/commands/flow-bug-validate.md +97 -0
  115. package/adapters/opencode/commands/flow-doctor.md +252 -0
  116. package/adapters/opencode/commands/flow-feat-build.md +348 -0
  117. package/adapters/opencode/commands/flow-feat-design.md +397 -0
  118. package/adapters/opencode/commands/flow-feat-plan.md +163 -0
  119. package/adapters/opencode/commands/flow-feat-review.md +348 -0
  120. package/adapters/opencode/commands/flow-feat-ship.md +415 -0
  121. package/adapters/opencode/commands/flow-feat-start.md +287 -0
  122. package/adapters/opencode/commands/flow-feat-validate.md +214 -0
  123. package/adapters/opencode/commands/flow-init.md +151 -0
  124. package/adapters/opencode/commands/flow-news.md +55 -0
  125. package/adapters/opencode/commands/flow-next.md +53 -0
  126. package/adapters/opencode/commands/flow-work-README.md +245 -0
  127. package/adapters/opencode/commands/flow-work-abandon.md +101 -0
  128. package/adapters/opencode/commands/flow-work-clean.md +226 -0
  129. package/adapters/opencode/commands/flow-work-daily.md +112 -0
  130. package/adapters/opencode/commands/flow-work-green.md +160 -0
  131. package/adapters/opencode/commands/flow-work-query.md +167 -0
  132. package/adapters/opencode/commands/flow-work-respond.md +174 -0
  133. package/adapters/opencode/commands/flow-work-resume.md +121 -0
  134. package/adapters/opencode/commands/flow-work-status.md +125 -0
  135. package/adapters/opencode/commands/flow-work-try.md +92 -0
  136. package/adapters/opencode/commands/flow-work-watch.md +221 -0
  137. package/adapters/opencode/opencode.json +8 -0
  138. package/bin/cli.mjs +222 -0
  139. package/package.json +43 -0
  140. package/plugins/flow/.claude-plugin/plugin.json +21 -0
  141. package/plugins/flow/CHANGELOG.md +1744 -0
  142. package/plugins/flow/examples/FLOW.template.md +324 -0
@@ -0,0 +1,521 @@
1
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/skills/flow-core/SKILL.md — do not edit; change the plugin file and run the script. -->
2
+
3
+ # flow-core — the rules shared by every `/flow` command
4
+
5
+ > **gemini adapter — how the Claude Code primitives named below map here.**
6
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
7
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `@<name>` from `.gemini/agents/`; the name comes from `agents.<role>` in `FLOW.md`, empty or absent → do it in this context.
8
+ > - Parallel fan-out → several `@name` in one turn (sequential in this context if none are configured), capped at `agents.fanout_max` (empty → 4); `agents.fanout_tool` is Claude Code-only, ignore it.
9
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → not available in-session: run one cycle, persist state in `monitor.md`, let the user schedule `gemini -p "<command>"` with cron.
10
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
11
+ > - `Skill commit-commands:commit-push-pr` → `git add` · `git commit` · `git push -u origin HEAD` · the `git.cli` CLI (`gh pr create` / `glab mr create`).
12
+ > - `/model <value>` → the `--model` flag at launch.
13
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared under `mcpServers` in `settings.json` (see `settings.snippet.json`).
14
+
15
+ Every `/flow:*` command assumes these rules. They are stated once, here, so a command file only
16
+ carries what is specific to its phase. Read this once per session; a command that says "load
17
+ `flow-core`" means this file.
18
+
19
+ ## 0. Effective FLOW config — base plus harness overlay
20
+
21
+ - Read `FLOW.md` at the repo root as the base, then the optional overlay for the harness running
22
+ this command: `FLOW.claude.md`, `FLOW.codex.md`, `FLOW.opencode.md`, `FLOW.gemini.md`, or
23
+ `FLOW.hermes.md`. The
24
+ harness is the product executing the command, never guessed from a model name. An overlay is
25
+ valid without a base file; unknown `FLOW.*.md` names are ignored. Throughout every command,
26
+ **"FLOW.md" means this effective merged configuration** unless the command explicitly names a
27
+ file it will edit.
28
+ - Merge by section and key. A key present in the active overlay replaces the base value; a key
29
+ absent there inherits the base. **A present-but-empty overlay key masks the base** and resolves
30
+ to the normal empty-key fallback — this is how Codex can inherit its session model while a legacy
31
+ `FLOW.md` still names a Claude model. A list-valued key is replaced as a whole, never appended.
32
+ `conventions` is the one unkeyed section: its overlay lines are added after the base lines, so
33
+ both sets apply. Keep the source file of every effective value; `doctor` reports it and later
34
+ edits preserve it.
35
+ - The sections in either file are tracker, git, autonomy, quality, agents, models, data,
36
+ conventions, notes, knowledge, and observability. Both files missing, or an effective empty key
37
+ → the default or auto-discovery each step names. Never stop because a file or key is empty.
38
+ - **An empty key that is a real decision for this repo is offered where it first matters**, and
39
+ nowhere else. Three steps, in order:
40
+ 1. Resolve the default or auto-discover, as above. The step never waits for configuration.
41
+ 2. The key is on the short list below **and** this phase was going to stop anyway **and** the mode
42
+ is `manual` → add **one option** to that stop: *"write `<key>: <value>` to `<destination>`"*,
43
+ alongside whatever it was already asking. Resolve the destination by the ownership rule below.
44
+ Never a question of its own, never a key off the list, and at most **one key per work** — the
45
+ second one waits for the next work or for `/flow:init`.
46
+ 3. `guided`/`auto` → take the default and **record** it: one line in the phase artifact as today,
47
+ plus an entry in `meta.json.defaults_used[]` — `{ "key": "agents.security", "default":
48
+ "general-purpose", "phase": "review" }`. Asking here would break the never-a-question contract
49
+ (§2); recording keeps the decision readable afterwards, and `/flow:doctor` aggregates it.
50
+
51
+ **The list, and it is short on purpose**: `agents.<role>` when a panel is about to improvise that
52
+ role on an M/L or sensitive diff · `quality.review_depth` after a review's cost line went over
53
+ `agents.budget_max` · `data.volumes` or `data.explain_cmd` when the query duel came back
54
+ schema-only · `quality.functional_check` when `validate` found a runnable app and no way to drive
55
+ it · `tracker.start_cmd`/`done_cmd`/`abandon_cmd` the first time a ticket could have been
56
+ transitioned. A key whose default is fine forever — `request_sections`, `worktree_path`,
57
+ `knowledge.timeout_s` — never appears here, in any mode.
58
+
59
+ The FLOW config is personal, so writing a line is not a team decision; it is still an edit to the
60
+ tree, so the option is an explicit choice the user makes, never a default action (same bar as
61
+ flow-core §8's convention offer, and the two share their wording). Update a value in the file it
62
+ came from. A new repo fact or shared preference goes to `FLOW.md`; a new harness-owned model,
63
+ agent, skill, orchestration tool, or knowledge-tool name goes to the active overlay. Never edit an
64
+ inactive harness's overlay.
65
+ - **Knowledge sources, by role** (`knowledge` section): `search` (one or more tools or commands
66
+ that return context for a query — all consulted in parallel, results merged as material to weigh),
67
+ `stage` (record one finding for this branch), `read_staging` (what this branch staged), `save`
68
+ (consolidate into the store). A step names the role, never a product. Missing role → that step
69
+ degrades: no `search` → skip the lookup silently; no `stage` → the finding goes to the phase
70
+ artifact only; no `read_staging` → the artifacts are the staging; no `save` →
71
+ the consolidation appends to `KNOWLEDGE.md` at the repo root. Per-call timeout
72
+ `knowledge.timeout_s` (empty = 2 s); a failure or timeout → continue without it, silently.
73
+ **How a consolidation runs** (`ship`, `postmortem`, `abandon`, and the offer in `/flow:work:status`
74
+ when `read_staging` has entries). No role set at all → say so in one line and stop; nothing here is
75
+ worth a command of its own, which is why there is no longer one:
76
+
77
+ 1. **Read the staging** for this branch with `knowledge.read_staging`; the role empty → the "why"
78
+ findings already written in this work's artifacts (`03-design.md` ADR-light and challenges,
79
+ `03-investigation.md`, `06-review.md`, `99-postmortem.md`). Nothing there and nothing new in the
80
+ session → *"nothing to consolidate on this branch"*, and stop.
81
+ 2. **Combine** the staged findings with what this session learned and has not staged, applying the
82
+ why-vs-what rule: anything the code already states — a path, a class, how it works — is discarded
83
+ here, not saved.
84
+ 3. **Per finding**: `knowledge.search` set → query it with the topic and the finding's paths, then
85
+ decide *create* · *update* · *enrich with a new angle* · *conflict*. A conflict is asked
86
+ immediately (`AskUserQuestion`) and nothing is saved until it is resolved. Then `knowledge.save`,
87
+ one call per finding; the role empty → append to **`KNOWLEDGE.md` at the repo root** under a
88
+ `## <topic>` heading — the finding, its evidence line, the date and the branch. Creating that file
89
+ the first time edits the tree, so it is asked once, in every mode; appending to an existing one is
90
+ recorded, not asked.
91
+ 4. **Report** in one line: *"Created N · Updated M · Conflicts resolved J"*, or *"Appended N
92
+ finding(s) to KNOWLEDGE.md"*.
93
+ 5. **Clear the staging** for the branch afterwards, when the store has that notion.
94
+
95
+ A tool call that fails is **reported, never swallowed** — this is the one knowledge path that is
96
+ explicit rather than degrading in silence.
97
+
98
+ - `notes.<command>` (or `notes.all`) → mandatory extra instructions for that command.
99
+ - Key names, merge rules, and defaults: the template shipped with the plugin
100
+ (`examples/FLOW.template.md`).
101
+
102
+ ## 1. Models — which model runs a step
103
+
104
+ Two keys, and they govern **subagents only**: `models.agents` for every subagent a command
105
+ improvises, `models.workers` for the parallel fan-out rounds (falling back to `models.agents`).
106
+ Empty, absent, or no section → everything runs on the model you were launched with, and you say
107
+ nothing.
108
+
109
+ - Pass the resolved value to every subagent you launch, **except** an agent named in `agents.<role>`,
110
+ which keeps the model its own definition sets.
111
+ - **You cannot switch your own model**, so no key names the phases the main agent performs itself.
112
+ A phase that wants another model says it in one line at the handoff (`this step reads better on
113
+ <value>, you are on <current>` → `/model <value>`), records it in the artifact, and continues.
114
+ Never a question, never a gate.
115
+ - A harness that cannot set a model per subagent: note it once, continue with the inherited one.
116
+
117
+ **A wide round inherits in silence — say what it inherits, never what it should be.** An empty key is
118
+ the right default and stays it: which model is cheap, capable or appropriate changes every few
119
+ months, differs per harness and per account, and belongs to whoever pays for the tokens. But
120
+ inheriting is unremarkable for one subagent and a blank cheque for a round of fifteen. So before
121
+ launching a round of **4 or more** subagents with both keys (`models.workers`, then `models.agents`)
122
+ empty, say it in one line: how many agents, and that they run on this thread's
123
+ model because no key is set. **Name the key, never a model** — no default, no suggestion, no ranking.
124
+ A harness that cannot report the model it runs on says the round inherits it, and that is the whole
125
+ line. Never a question, never a gate; the artifact's cost line carries the same fact.
126
+
127
+ Agents named in `agents.<role>` are the exception here as above: they keep whatever their own
128
+ definition sets, so a round can mix inherited and self-declared models. Report which, not whether it
129
+ was wise.
130
+
131
+ ## 2. Autonomy — `autonomy.mode`
132
+
133
+ `manual` (default) · `guided` · `auto`. Read it once and apply it throughout the command.
134
+
135
+ | Mode | Decisions | End of the command |
136
+ |---|---|---|
137
+ | `manual` | Stop at every decision point | Propose the next command with one `AskUserQuestion` (recommended step as default). Invoke it only on confirmation. Never make the user type it. |
138
+ | `guided` | Resolve low-risk, unambiguous ones with the recommended default and **record** the choice in the phase artifact. Ask at genuine decision points. | Chain into the recommended next command automatically. |
139
+ | `auto` | As `guided`, plus resolve the remaining decision points with sensible, recorded defaults. | Chain without pausing. |
140
+
141
+ **Hard gates — stop and ask in every mode, no exceptions:**
142
+ 1. Any push or MR/PR creation (all of `ship`).
143
+ 2. Creating or switching a branch when the base is ambiguous (not on a clean main, or a possible train/stacked branch).
144
+ 3. DB schema changes or migrations.
145
+ 4. A `review` that surfaced high-severity findings — never chain into `ship` on those.
146
+ 5. The business brief written before touching code (`build`, `fix`).
147
+
148
+ `respond` and `green` add their own gates (posting a reply, re-running a pipeline, integrating the
149
+ base) — see the command.
150
+
151
+ Rule of thumb for everything else: ask only when a decision is (a) irreversible or costly to undo,
152
+ (b) ambiguous and not resolved by ticket + knowledge search, or (c) a hard gate. Otherwise take the
153
+ sensible default and record it.
154
+
155
+ **Never a question in `guided`/`auto` — decide, record, continue:**
156
+ - (a) **Flow mechanics** — whether to launch a panel, challengers, skeptics or a fan-out, how wide, how many reviewers, inline vs subagent. Each step's recommended default *is* the answer.
157
+ - (b) **WIP commits** on the work branch.
158
+ - (c) **Continuing to the next MR/PR of a train** — asked in `manual`, taken and recorded in `guided`/`auto`.
159
+ - (d) **Size confirmation** — take the proposed size, record it, move on.
160
+ - (e) **Anything already decided and recorded** in the work's artifacts or `meta.json.notes`. Reopen only when new evidence contradicts the premise — then lead with the evidence.
161
+
162
+ Asking these anyway is how an unattended run degrades into a manual one.
163
+
164
+ ## 3. Reporting — how every stop reads
165
+
166
+ The user comes back to a screen they walked away from, often with other works in other panes.
167
+ They have read none of your tool calls, subagent reports or artifacts. So every stop — a question,
168
+ a hard gate, the end of the turn — **opens with this header**, before any prose:
169
+
170
+ ```
171
+ <TICKET> · <size> · phase <phase> · MR #<n> of <N>
172
+ Plan: <k> of <N> shipped — #1 <url/id> <state> · #2 <state> · #3–#N pending
173
+ Now: <one line — what just finished>
174
+ I need: <one line — the decision or action needed, or "nothing, continuing with X">
175
+ ```
176
+
177
+ - Every fact from `meta.json` (`ticket`, `size`, `phase`, `mrs[]`), never from memory. Drop the `MR #` and `Plan:` lines when the work has no `mrs`.
178
+ - **Body: at most ~10 lines**, only what could change a decision. Everything else goes to the phase artifact.
179
+ - **Product altitude.** Say what changed for whoever uses the software, not what you built. A code identifier earns a line only when the user must decide about it, asked something technical, or named it first.
180
+ - **Short lines.** One or two lines of headline, then two to five bullets, one idea each. No "for context", no restating an earlier stop. When the user asks a technical question, answer it in full.
181
+ - **Out of the chat, into the artifact:** your own process, your mistakes, corrections to subagent reports, bookkeeping. Subagent completion or idle notifications never earn a turn of their own.
182
+ - **Zero-context rule.** First mention of an identifier carries 4–6 words of what it is. Never cite a section number without naming what it is. No jargon the user has not used first.
183
+ - **If it is a question, it is `AskUserQuestion`.** Never end a message with a question in prose. If it does not deserve the menu, it is a decision you take and record.
184
+
185
+ ## 4. Live panel — `panel.json`
186
+
187
+ Whenever the state a panel would show changes, overwrite `.claude/work/<work>/panel.json`
188
+ **whole** (never patch) from `meta.json` plus what you know right now:
189
+
190
+ ```json
191
+ {
192
+ "updated_at": "2026-08-06T16:45:00+02:00",
193
+ "phase": "validate",
194
+ "header": true,
195
+ "lines": [
196
+ {"text": "Expose a thread's tracking state and events", "style": "title"},
197
+ "",
198
+ {"ref": "#1", "text": "batch read sources", "mark": "wait", "link": "https://gitlab.com/…/merge_requests/9977"},
199
+ {"ref": "#2", "text": "per-event and per-recipient counters", "mark": "current"},
200
+ {"ref": "#3–#6", "text": "channel map · use case · document detail · route", "mark": "pending"},
201
+ "",
202
+ {"ref": "Now", "text": "unit suite and the test agent over #2", "mark": "info"},
203
+ {"ref": "Next", "text": "ship #2", "mark": "info"},
204
+ {"ref": "Decision", "text": "confirm the MR/PR body before I create it", "mark": "wait"},
205
+ "",
206
+ {"text": "sibling-repo still needs the endpoint contract", "mark": "block"}
207
+ ]
208
+ }
209
+ ```
210
+
211
+ - **`mark` says what a line is**; the reader draws it. `done` · `current` (at most one) · `pending` · `wait` (waiting on someone else: an open MR/PR, a user decision) · `block` · `info`. Marked lines form an aligned column: symbol, `ref`, text, link pinned right. Do not set `style` on a marked line — except `mark: "info"` + `style: ok|warn|error` when the colour *is* the information (a monitoring verdict).
212
+ - **`ref` need not be a number**: `#1`, `#3–#6`, `Now`, `Next`, `Decision`. Column width is per block; blocks are separated by blank lines — use them so the MR/PR train and the labels below do not drag each other wide.
213
+ - **`link` is a field, never a URL inside `text`.**
214
+ - **Order:** (1) work title (`style: title`, no mark); (2) the MR/PR train, one entry per `meta.json.mrs[]` with `ref` `#n`, short title, real-state `mark`, `link` when there is a URL — not-started entries collapse into one `#a–#z` `pending` line; omit the block without `mrs`; (3) `Now` — what is running, the one fact `meta.json` cannot hold; (4) `Next`; (5) `Decision`, `mark: wait`, **only** when parked on the user; (6) blockers, `mark: block` (a sibling repo with `contract_handoff: pending`, a red pipeline, an unmerged dependency).
215
+ - **When:** (a) in pre-flight, as soon as `meta.json` is loaded; (b) immediately **before** every stop header; (c) **before** any long stretch (fan-out, full suite, CI poll) — never after, so a step that dies halfway is not shown as finished. When the stretch will outlast the ~30 min staleness warning, set `stale_after_minutes` to what it will really take; (d) wherever `## Close` updates `meta.json`.
216
+ - **Rules:** `phase` is the phase you are **running now** (not `meta.json.phase`, which advances only at Close). `header: true` means ticket, type, phase and age are drawn by the reader — do not repeat them in `lines`. Keep it under ~14 lines. Every fact from `meta.json` and the artifacts — an invented MR/PR state is worse than a blank panel. `updated_at` from the real clock (`date -Iseconds`), never carried over. Write in the language of the work's artifacts. No work folder (lightweight `respond`/`green`) → nothing to write.
217
+
218
+ ## 5. Work summary — `00-summary.md`
219
+
220
+ Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
221
+ single largest token cost of a work, so every work carries a short handoff:
222
+
223
+ - `.claude/work/<work>/00-summary.md`, **≤ 15 lines**, overwritten whole at every `## Close`:
224
+ what the work is (one line), size and current MR/PR, the decisions that stand (one line each),
225
+ the contracts declared or received (names and where the literal shape lives), what is pending,
226
+ what the next phase must open in full.
227
+ - **Pre-flight of every phase reads `meta.json` and `00-summary.md` first.** Open a full artifact
228
+ only when the step needs it: `build` opens `03-design.md` (contracts, verbatim) and the current
229
+ MR/PR of `04-mr-plan.md`; `review` opens the design's contracts and the implementation log;
230
+ `ship` opens the brief and the review verdict. A summary that does not answer the question you
231
+ have is the cue to open the artifact — never a licence to guess.
232
+ - Missing summary (a work started before this rule) → read the artifacts as before, write the
233
+ summary at your Close.
234
+ - **Name the phase, never the command.** An artifact outlives the session that wrote it and may be
235
+ resumed from a different agent, where the same phase is invoked under another name. Write the
236
+ phase — `validate`, `review`, `ship #2` — not the invocation. Applies to `00-summary.md`,
237
+ `panel.json`'s `Next` line and every numbered artifact; the prose you *say* at a stop is exempt.
238
+
239
+ ## 6. Delegating — what every brief owes the parent
240
+
241
+ A brief that says what to look at and nothing about what to send back is how a round of agents goes
242
+ quiet: the work gets done and the parent never sees it. The prompts this plugin writes out in full
243
+ already carry a report contract (`Under 250 words`, *findings only, one line each*). **A brief you
244
+ compose yourself carries the same one:**
245
+
246
+ > Report in under `agents.report_max_words` words (empty → 250): findings only, one line each as
247
+ > `file:line` + what is wrong + the fix. No method, no preamble, no apology.
248
+
249
+ The cap is not style. **A long report can be truncated in transit and reach you as nothing at all** —
250
+ Claude Code discards a subagent result over ~16 000 characters and hands the parent a placeholder,
251
+ which from here is indistinguishable from an agent that did no work. An uncapped brief over a large
252
+ diff hits that every time, and a stronger model hits it sooner, because it writes more.
253
+
254
+ **Bulk output is a file, not a report.** When the agent produces volume — a translation, a generated
255
+ test suite, a migration, a batch of edits — name the **path it writes** and require it to **save
256
+ after each finished piece, not at the end**. Then verify the artifact instead of believing the
257
+ report: half a chunk on disk is recoverable, what lives only in the agent's context is not.
258
+
259
+ **A size in a brief is a thermometer, not a budget.** When the brief hands an agent a `lines_est`,
260
+ a size or a review threshold, it says which one it is (§9). An agent that reads a number as a target
261
+ returns shorter, worse code — fewer comments, fewer tests, denser statements — and returns it looking
262
+ finished.
263
+
264
+ **A brief over a large corpus needs a bounded first step.** *"Review this 8 700-line diff"* has no
265
+ first move, and an agent handed one can sit for hours producing nothing. Split it: by path, by
266
+ numbered question, or by the concrete command that answers each one.
267
+
268
+ **Fan-out has a deadline, because a stall raises no event.** The harness reports an agent that
269
+ *finishes* and never one that *stops advancing*, so a stuck round is invisible unless you look. On
270
+ launching a round, record the time and what you expect it to take. At **every stop of the command** —
271
+ not only the last — check it: whatever your harness offers for listing running agents, and failing
272
+ that, the named path each one was told to write. An agent past `agents.stall_after_minutes`
273
+ (empty → 25) with nothing written is stopped, its brief split in two, and relaunched. An agent that
274
+ went idle with an empty or truncated result is **asked for it directly** before it is written off.
275
+
276
+ Dropping a silent agent is always allowed, and always reported (`N/M` reported). Waiting on one with
277
+ no deadline is what costs a session.
278
+
279
+ **The budget belongs to the command, not to the round.** `agents.fanout_max` caps *one* parallel
280
+ round; nothing capped what a command spends across all of its rounds, and the phases that fan out
281
+ compose: a review can run a panel, then area reinforcements, then a coverage sweep that relaunches
282
+ the panel, then one skeptic per finding — each round inside its own cap and the command an order of
283
+ magnitude over what anyone intended.
284
+
285
+ - **`agents.budget_max`** (empty → **12**) is the ceiling on subagents **one command run may launch
286
+ in total**, summed over every round, including relaunched rounds. `0` = no ceiling (not
287
+ recommended). A skill invoked as one reviewer counts as the agents it launches when you know the
288
+ number, and as 1 when you do not.
289
+ - **Count before you launch, not after.** Before each round: budget minus spent = what is left. The
290
+ round does not fit whole → launch what fits and report the truncation (`4/7`). Nothing left → skip
291
+ the phase and say which one, in one line, in the artifact.
292
+ - **Each command that fans out declares its own give-up order** — which phase is dropped first when
293
+ the budget runs out — so a truncation is deterministic and reviewable, never the model's mood on
294
+ the day.
295
+ - **Grouping does not raise a ceiling.** Both ceilings count *agents launched*, whatever the split
296
+ of findings, files or hypotheses between them. Twelve agents under `fanout_max: 4` is a breach,
297
+ not an optimisation; four agents carrying three findings each is the intended shape.
298
+ - **The cost is reported where the user reads it**, as `spent/budget`: a phase silently skipped for
299
+ budget and a phase that found nothing are not the same result.
300
+
301
+ ## 7. Deferred work — `followups[]`
302
+
303
+ Every chain in this plugin reaches moments where the right call is **not to do it here**: a build
304
+ step finds a neighbouring defect, a plan names a piece as out of scope, a design records a risk it
305
+ does not mitigate, a validation leaves an edge case unchecked, a postmortem lists what would prevent
306
+ the next incident. Refusing to widen the diff is correct. Writing the note into an artifact and
307
+ walking away is where it stops being correct — `.claude/work/` is git-ignored in most repos and
308
+ archived once the work ships, so the note is gone the moment it would have mattered.
309
+
310
+ **The bar — most of what a phase notices is not a deferral.** A developer who spends a day inside
311
+ unfamiliar code sees twenty things: something that works but is not pretty, a failure mode that
312
+ needs three unlikely events at once, a name that stopped fitting, a coupling nobody enjoys. They
313
+ report one or two, and they are right to. Left without a bar, this section produces seven entries
314
+ out of one ticket — and seven entries is not seven problems, it is one problem and six reading
315
+ notes wearing its clothes. An entry is written only when it clears three questions, in order:
316
+
317
+ 1. **Who notices, and when?** Name them — a user, an operator, a consumer of this API, the next
318
+ person who has to change this file — and the moment they notice. No subject, no entry.
319
+ 2. **How likely is what it describes?** A path that needs a conjunction nobody has ever seen is a
320
+ note, not deferred work. Frequency is part of the finding, not colour on top of it.
321
+ 3. **Does waiting cost more than doing it now?** When it does not, waiting is free — and free is
322
+ the answer.
323
+
324
+ Three yeses → `followups[]`. Anything less stays in the phase artifact, where it is already written
325
+ in context, and travels no further: not lost, **not escalated**. What fails this bar nearly every
326
+ time: «this could be extracted», «the state is not trimmed», a coupling with no symptom, generic
327
+ missing coverage, a correct-but-unpretty shape, a rename. None of those is thoroughness; each is
328
+ one more thing the user has to decide about.
329
+
330
+ **A deferral is a record, not a sentence.** Whenever a phase parks work, it appends to
331
+ `meta.json.followups[]`:
332
+
333
+ ```json
334
+ { "id": "F1",
335
+ "kind": "prevention" | "audit" | "out-of-scope" | "risk" | "edge-case" | "other-bug"
336
+ | "tooling" | "decision",
337
+ "title": "one line, what would be done",
338
+ "why": "one line, why it was parked and why it still matters",
339
+ "source": "design" | "plan" | "build" | "validate" | "fix" | "postmortem",
340
+ "status": "proposed" | "accepted" | "declined" | "logged" | "done",
341
+ "ticket": null, "work": null, "note": "" }
342
+ ```
343
+
344
+ The artifact keeps its human-readable section exactly as before, with the `F<n>` id in front of each
345
+ row so the prose and the record never drift. **The record is the addition, not a replacement**: a
346
+ reader of `05-implementation.md` still sees the ideas in context.
347
+
348
+ **Two kinds are not work, and are treated apart.**
349
+
350
+ - **`tooling`** — a gap in the repository's own machinery rather than in what it ships: a test that
351
+ does not bind, a guard, ratchet or lint floor with slack in it, a stale knowledge card, prose that
352
+ drifted from the code. Real, worth writing down, and nobody's next task — a tracker where these
353
+ outnumber the product's defects makes the number lie and buries «a console goes silent and says
354
+ nothing» under «a floor has no subject». Their destination is the **debt log**, a versioned file
355
+ in the repo, not the tracker — **and it is not a question**: choosing the kind already decided it
356
+ (survey below).
357
+ - **`decision`** — a product question the current diff depends on: what the user sees when X,
358
+ whether closing Y also does Z, how much of the surface a notice may take. **A missing decision is
359
+ not deferred work.** Parking it does not shrink the diff, it makes the diff guess — and the guess
360
+ ships, gets reviewed, and comes back as a ticket that costs a whole work to answer what was two
361
+ minutes of the user's. The test is one line: **if the answer changes what the code being written
362
+ does now, ask now; if it changes what someone builds later, record it.** Asked now means one
363
+ `AskUserQuestion` the moment it surfaces, **in every `autonomy.mode`, `auto` included** — the
364
+ never-ask list of §2 is about flow mechanics, and a product decision is the opposite of mechanics —
365
+ phrased as the question itself with the options that were on the table, recommended one first. The
366
+ answer goes where the phase keeps its decisions (the brief in `04-fix.md`, the ADR-light in
367
+ `03-design.md`, `05-implementation.md`), never into `followups[]`. A `decision` entry exists only
368
+ when the user, asked, chose to defer: it stays `proposed` and is asked again at `ship` — **as its
369
+ question, never as *do it / not worth it***. A `followups[]` entry whose `title` is a question is
370
+ the signature of this mistake: rewrite it as the question and ask it.
371
+
372
+ **One survey, at the end, not one question per phase.** Nothing is asked when the note is written —
373
+ mid-build is the worst moment to judge whether a neighbouring defect is worth a ticket, and a
374
+ question there is exactly the interruption `guided`/`auto` exist to avoid. The triage happens once,
375
+ at `ship`'s Close, when the work is done and the user can see the whole set.
376
+
377
+ **A skeptic sorts them before the user sees them.** `/flow:*:review` already refuses to hand over an
378
+ unverified finding: its §6 gives each ambiguous one to a skeptic whose job is to *refute* it, burden
379
+ of proof on the finding. Deferred work reached the user through no filter at all, judged only by the
380
+ phase that parked it — the one party that cannot judge it, having just found it. So at Close, when
381
+ **3 or more** entries are still `proposed`, they go to a skeptic first (grouped into at most
382
+ `agents.fanout_max` briefs, the ceilings of §6 unchanged; **fewer than 3 → no agent**, the command
383
+ applies the bar itself):
384
+
385
+ > You are a skeptic. These are pieces of work a phase deliberately parked while shipping a ticket:
386
+ > <entries, each with `id`, `kind`, `title`, `why`, `source`>. For each one, try to REFUTE that it
387
+ > deserves a tracker issue. **The burden of proof is on the entry**: read the real code and say who
388
+ > notices it, how likely the path is, and what waiting actually costs. One verdict per entry —
389
+ > `ticket` (named subject, plausible path, waiting costs more), `log` (real, and nobody's next
390
+ > task), `drop` (no subject, or a path needing a conjunction nobody has seen). When the evidence is
391
+ > genuinely ambiguous, **do not** say `ticket`. Be concrete about why, citing what you read.
392
+
393
+ - **`drop`** → `declined`, the skeptic's reason in `note`. Still readable in the artifact and in
394
+ `meta.json`, never asked, never counted, never shown again by `status`/`daily`/`next`.
395
+ - **`log`** → straight to the debt log, no question, same destination as `tooling`.
396
+ - **`ticket`** → these are what the user is asked about, and **only the strongest
397
+ `tracker.followup_ask_max`** of them (empty → **2**). The rest are logged, with one line saying
398
+ how many and where they went. **A finished work never becomes more than `followup_ask_max`
399
+ questions**, whatever the phases found. `0` → nothing is ever asked and everything is logged.
400
+
401
+ Then, and only then, the survey:
402
+
403
+ - One `AskUserQuestion`, **one batch**, at most `followup_ask_max` entries, options **Do it** ·
404
+ **Not worth it** · **Later**. The `title` and `why` are the entire prompt. **`decision` entries
405
+ are asked as their product question** — they never go to the skeptic, a question's value not being
406
+ a thing to refute — and sit outside the ceiling.
407
+ - **`tooling` asks nothing.** One line in the debt log, `logged`, and a count on screen. Asking
408
+ **Log it** about a lint floor with slack in it was one question too many.
409
+ - **Not worth it** → `declined`, with the reason if given. Never asked again.
410
+ - **The debt log**: `tracker.debt_log` from FLOW.md (empty → `docs/DEBT.md`), a versioned Markdown
411
+ file created on first use — `- <date> · <ticket> · <title> — <why>` — committed on the work branch
412
+ so it travels with the MR/PR. Read by whoever next works on the machinery, triaged by nobody;
413
+ `status` and `daily` stop showing it. It is a file on the branch, not a queue.
414
+ - **A `decision` answered** → the answer is written into the artifact that owns it and the entry
415
+ becomes `done` with the answer in `note`. Deferred again → stays `proposed`.
416
+ - **Later** → stays `proposed`, and surfaces in `status`, `daily` and `next` until it is decided.
417
+ - **Do it** → `accepted`, then create the tracker issue with the tool's native command, exactly as
418
+ `/flow:feat:start` §2.5.4 does for a ticket-less draft — same commands, same best-effort fallback
419
+ to local-only when `tracker.tool` is `none`/empty or creation fails. Record the id in `ticket`.
420
+ - No entries still `proposed` → **the step does not exist**. Never show an empty survey.
421
+
422
+ **One line on screen, not one per entry.** However many were written, a stop mentions deferred work
423
+ in **at most one line** (§3): the one that escalated, named in product terms, plus a count and a
424
+ destination for the rest — «2 more went to `docs/DEBT.md`». Never a list of seven titles, and never
425
+ «7 findings are waiting for triage» as the last thing the user reads before closing the pane.
426
+
427
+ **Creating an issue is outward-facing, so it asks in every mode**, `auto` included — the same
428
+ category as the MR/PR gate, never flow mechanics. Writing a `followups[]` entry asks nothing, ever.
429
+
430
+ **What stays open is published.** Entries still `proposed` or `accepted` when the MR/PR is created
431
+ get a line in its description: what was consciously left out, and why. A reviewer cannot weigh a
432
+ diff against what the author decided not to do unless someone tells them.
433
+
434
+ **Where an accepted one goes next.** `/flow:feat:start` and `/flow:bug:start` on that ticket record
435
+ `meta.json.origin` — `{ "work": "<originating work>", "followup": "F1" }` — and carry the `why` into
436
+ `01-context.md` instead of re-deriving it. The originating entry moves to `in_progress` with `work`
437
+ pointing at the new folder, and to `done` when that work does.
438
+
439
+ **Archiving does not close anything.** `status` and `daily` read `_archive/*/meta.json` for entries
440
+ not `declined`/`logged`/`done`: a work being finished is precisely when its deferrals become invisible.
441
+
442
+ ## 8. Conventions learned — `conventions_candidates[]`
443
+
444
+ Mid-phase, the user corrects you. *«We don't put that in a listener here, use a message handler.»*
445
+ *«Never mock the repository in that layer.»* *«The test command is `make test-unit`, not
446
+ `bin/phpunit`.»* *«Stop proposing a DTO for that, we pass the entity.»* You comply, the phase closes,
447
+ and the next work on the same repo proposes the same thing again. The place for these exists —
448
+ `FLOW.md`'s `conventions` and `quality` — and nothing on the path from the correction to that file is
449
+ automatic: the user has to notice they have said it three times and go and edit it.
450
+
451
+ **The test is one question: would the same correction apply to an unrelated ticket in this repo?**
452
+ Yes → it is a convention. No → it is this ticket, and the artifact of the phase that heard it is
453
+ where it belongs. A scope change, a naming preference about this diff, the answer to a product
454
+ question: all about the work, none about the repo.
455
+
456
+ **Capture, never interpret, never ask.** When the user's reply to a stop overrides something you
457
+ proposed and it passes that test, append to `meta.json.conventions_candidates[]`:
458
+
459
+ ```json
460
+ { "id": "C1",
461
+ "text": "the rule, one line, in the user's own words",
462
+ "target": "conventions" | "quality.<key>",
463
+ "phase": "build",
464
+ "evidence": "the stop it came from" }
465
+ ```
466
+
467
+ and write the same row under a `## Conventions learned` heading in the phase artifact, same `C<n>`
468
+ id — as `followups[]` does with its own sections. Do not rewrite the sentence into policy prose: the
469
+ value of the line is that it is what they said. `target` is `quality.<key>` when the correction names
470
+ a command the flow runs (a test, a linter, a formatter) and `conventions` for everything else.
471
+
472
+ **`review` reads them in the same work.** The idiom audit is already handed *the project's primitive
473
+ vocabulary from its effective conventions*; this work's candidates join that input, so a rule
474
+ learned during `build` is enforced in the review of that same MR/PR, not of the next one.
475
+
476
+ **`ship` offers them once, at Close** — one `AskUserQuestion`, batched up to 4, options **Add to
477
+ FLOW.md** · **Not a rule** · **Later**, the `text` being the whole prompt. *Add* appends a convention
478
+ to the base `FLOW.md`. A `quality` correction updates the file its effective value came from, or the
479
+ base when the key was absent: otherwise an overlay would immediately hide the correction. The FLOW
480
+ config is personal, but this is still an edit to a file in the tree, so **it is asked in every
481
+ mode**, like `KNOWLEDGE.md`'s first creation. No candidates → the step does not exist and says
482
+ nothing.
483
+
484
+ **Duplicates and contradictions, before anything is shown.** Already in `conventions`, in any wording
485
+ → dropped silently, no question. Contradicting a line that is there → the option is **Replace**
486
+ rather than **Add**, and both lines are shown, the existing one first. A candidate the user declines
487
+ is `declined` and never offered again, in this work or a later one.
488
+
489
+ **These are not domain knowledge.** `knowledge.stage`/`save` is for the *why* of the business, and
490
+ that filter does not move: a repo convention is the *what* of the code, it goes to `FLOW.md`, and it
491
+ never reaches the knowledge store. Two buckets, two destinations, no overlap.
492
+
493
+ ## 9. Size is a route, never a target
494
+
495
+ Two numbers decide how much apparatus a change gets. `meta.json.size` and each `lines_est` in
496
+ `meta.json.mrs` route the phases (`/flow:feat:start §4`, `/flow:feat:plan`), and the **diff's own
497
+ size** picks the review tier and opens or closes the skeptic round (`/flow:feat:review §2.0`, §6).
498
+ Both are doing their job: a 40-line change does not need the apparatus an 800-line one does, and
499
+ scaling the review to the diff in front of you instead of to the feature it belongs to is the single
500
+ largest saving the review has.
501
+
502
+ **What follows from that is a temptation, and it belongs to the diff, not to the plan.** A threshold
503
+ that buys a lighter review pays whoever lands just under it: twelve lines below 150 is a review at
504
+ `medium` with no project panel and no §6 round, twelve above it is the panel. So, in every phase:
505
+
506
+ **The diff reports the change; the change is never shaped to fit the number.** Never delete a
507
+ comment, a test, a blank line or a log line, never compress readable code into fewer statements,
508
+ never add an abstraction because it shortens the diff, and never cut at a point that is not coherent
509
+ — not to land under a `lines_est`, and not to land under a review threshold. Each of those makes the
510
+ diff smaller without making the change smaller, which is the only way a number here can lie: the
511
+ review that arrives is the one a different, smaller change had earned.
512
+
513
+ **The honest moves are already written down.** Over the estimate, and the cut would be artificial →
514
+ `/flow:feat:build §2.3`'s "continue and record the overrun". Genuinely two deliverables → a cut at a
515
+ coherent point, which is a different act with its own justification (`/flow:feat:plan`'s four
516
+ criteria). Under the estimate because the change turned out smaller → nothing to do; that is a good
517
+ estimate meeting a good change.
518
+
519
+ **It travels into every brief.** A subagent handed a size or a `lines_est` is handed a thermometer,
520
+ never a budget, and the brief says so (§6). An agent optimising for a number nobody told it was
521
+ advisory is the one that returns tidier, shorter, worse code — and it returns it looking finished.
@@ -0,0 +1,117 @@
1
+ # Primitive map: flow plugin → Gemini CLI
2
+
3
+ > The generated commands carry a short **legend** right after their title; it comes from the `LEGEND`
4
+ > dict in `script/adapter-build.py`. This document is the long form of that legend. The command prose
5
+ > itself is the plugin's, untouched — the legend defines the terms, the body keeps using them.
6
+
7
+ ## Translation table
8
+
9
+ | Original primitive (Claude Code) | Meaning | Translation in this adapter |
10
+ |---|---|---|
11
+ | `AskUserQuestion` | Structured options menu waiting for the user's choice | Plain text question with numbered options. Gemini CLI has no structured menu; the agent asks and waits for the user's free-text reply. |
12
+ | `ScheduleWakeup(N min)` | Auto-wake in N minutes within the session | **Does not exist in session.** One invocation of `/flow:work:watch` is one cycle. To repeat it: OS cron + `gemini -p "/flow:work:watch TICKET"`. State between cycles lives in `monitor.md` (surface, baseline, approved plan). |
13
+ | Parallel fan-out | N subagents in one round, main agent synthesizes | **Ports directly** — the plugin describes the fan-out as parallel subagents, not as a Claude Code tool. Invoke them with `@name` from `.gemini/agents/`; with no sub-agents configured, run the round sequentially in the same context (same rounds, same briefs, more wall-clock). Respect `agents.fanout_max` from FLOW.md (empty → 4) and leave `agents.fanout_tool` empty: it names a harness-specific orchestrator that Gemini CLI does not have. The fan-out points are `/flow:feat:brainstorm` §3.A, `/flow:bug:investigate` §3.A and `/flow:feat:review`/`/flow:bug:review`. |
14
+ | `Agent <role>` / `Agent general-purpose` | Delegate isolated work to a sub-agent of a specific type | `@name` where `name` comes from the `agents.<role>` map in FLOW.md. If the field is empty or the agent does not exist in `.gemini/agents/`, the conductor performs the task in the same context. |
15
+ | `Skill commit-commands:commit-push-pr` | Create commit + push + open MR/PR | Run directly: `git add`, `git commit`, `git push -u origin HEAD`, and the `git.cli` CLI from FLOW.md (e.g. `glab mr create` or `gh pr create`). |
16
+ | `Skill save-knowledge` | Consolidate the branch's knowledge findings | Run the `/flow:save-knowledge` command from this adapter. |
17
+ | `Skill flow:flow-core` | Load the shared rules once per session | Read `~/.claude/flow/CORE.gemini.md` — `install.sh` puts it there from `CORE.md`. |
18
+ | `/model <value>` | Switch the session's model | The `--model` flag at launch. Reported, not enforced — see `models` below. |
19
+ | `TaskCreate` / `TaskUpdate` | Step tracking with status (in_progress, completed) | Maintain a manual markdown checklist in `05-implementation.md` or `04-fix.md`. Update it as work progresses. |
20
+ | `mcp__domain-memory__<tool>` | Call to a domain-memory MCP tool | The tool name is identical. Only the server configuration mechanism changes (see `settings.snippet.json`). |
21
+ | `$ARGUMENTS` | Arguments passed to the command | `{{args}}` in Gemini CLI TOML — the generator rewrites it. |
22
+
23
+ ---
24
+
25
+ ## What is ported unchanged
26
+
27
+ Everything the plugin prose says — the generator does not rewrite a sentence of it. In particular:
28
+
29
+ - Phase gates for each command (`phases_done`, `meta.json` as source of truth).
30
+ - Untrusted input quarantine (logs, traces, user payloads treated as inert data).
31
+ - Adversarial design verification (challenger in `/flow:feat:design` and `/flow:bug:investigate`).
32
+ - Pre-deploy section + blocking thread in `/flow:feat:ship` and `/flow:bug:ship`.
33
+ - Reading `FLOW.md` in step 0 of every command.
34
+ - `knowledge` degradation rule: `knowledge.*` roles: if a tool does not respond within `knowledge.timeout_s` (2 s) or fails, continue without it, silently.
35
+ - Business brief required before writing code (`/flow:feat:build`, `/flow:bug:fix`).
36
+ - MR/PR preview before creating (`/flow:feat:ship`, `/flow:bug:ship`).
37
+ - Design contract anchoring (verbatim copy + double-blind verification).
38
+
39
+ ---
40
+
41
+ ## What degrades
42
+
43
+ ### `AskUserQuestion` — no structured menu
44
+
45
+ In Claude Code, `AskUserQuestion` presents numbered options and the user picks one. Gemini CLI has no such mechanism. Commands ask in free text. The flow is equivalent, but the interaction is less guided: the user must type their choice rather than pressing a number.
46
+
47
+ ### `/flow:work:watch` autopilot — no `ScheduleWakeup` in session
48
+
49
+ In Claude Code, `/flow:work:watch` reschedules itself automatically within the session using `ScheduleWakeup`. Gemini CLI has no session-level equivalent. What the legend asks instead:
50
+
51
+ 1. One invocation is **one monitoring cycle**.
52
+ 2. To repeat every 5 minutes, configure a cron job:
53
+ ```
54
+ */5 * * * * gemini -p "/flow:work:watch TICKET" >> ~/.gemini/watch-TICKET.log 2>&1
55
+ ```
56
+ 3. State between cycles (monitored surface, baseline, approved plan, accumulated verdicts) is persisted in `.claude/work/TICKET/monitor.md`. The plugin prose already reads it at the start of each cycle to avoid repeating the discovery step.
57
+
58
+ ### Parallel fan-out — conditional on configured sub-agents
59
+
60
+ The fan-out in `/flow:feat:brainstorm`, `/flow:bug:investigate`, and the adversarial reviewers of `/flow:feat:review`/`/flow:bug:review` is only parallel if the user has declared sub-agents in `.gemini/agents/`. Without them, execution is sequential in the same context. The result is functionally equivalent but slower and with less diversity of perspectives.
61
+
62
+ ---
63
+
64
+ ## Sub-agents in Gemini CLI: reference format
65
+
66
+ Sub-agent names come from the `agents` map in FLOW.md (fields `architecture`, `persistence`, `api`, `performance`, `security`, `testing`, `queues`, `frontend`, `frontend_test`).
67
+
68
+ To declare a sub-agent in Gemini CLI, create `.gemini/agents/<name>.md` with this frontmatter:
69
+
70
+ ```markdown
71
+ ---
72
+ name: <name> # must match the value in FLOW.md agents.<role>
73
+ description: <what it does> # Gemini uses this for automatic selection by description
74
+ kind: agent # optional; indicates it is a delegable sub-agent
75
+ tools: # optional; list of allowed tools
76
+ - read_file
77
+ - run_shell_command
78
+ mcpServers: # optional; inherits from settings.json if not specified
79
+ - domain-memory
80
+ model: gemini-2.5-pro # optional; inherits from the conductor by default
81
+ temperature: 0.3 # optional
82
+ max_turns: 20 # optional
83
+ timeout_mins: 10 # optional
84
+ ---
85
+
86
+ <!-- Sub-agent system prompt starts here -->
87
+ You are the <role> agent for the project. Your job is...
88
+ ```
89
+
90
+ Invocation from a command: `@name task here`.
91
+
92
+ **Do not bundle concrete agents in this adapter.** Sub-agent names and prompts are project- and team-specific. Those for your project go in `.gemini/agents/` (local, not versioned in the plugin).
93
+
94
+ ---
95
+
96
+ ## `models` in the effective FLOW config
97
+
98
+ The `models` section has two keys: `agents` for every improvised subagent and `workers` for the
99
+ parallel fan-out rounds (`workers` falls back to `agents`). Both are optional; empty means inherit
100
+ the model the session was launched with. Values are free text handed to the harness: flow neither
101
+ validates nor ranks model names.
102
+
103
+ Put Gemini-specific values in `FLOW.gemini.md`. Gemini reads it after `FLOW.md`, key by key; an
104
+ explicitly empty overlay key masks the base, and an absent key inherits it. A repo with only
105
+ `FLOW.md` behaves exactly as before.
106
+
107
+ How it lands here:
108
+
109
+ - **Subagent steps** — a subagent's model is set in its own definition (`model:` in `.gemini/agents/<name>.md`),
110
+ not at invocation time. To honour a `models` key, declare the subagent you invoke with that model.
111
+ A subagent named in `agents.<role>` keeps whatever its own definition sets; the `models` keys apply
112
+ where the command falls back to a general-purpose subagent, and to the fan-out workers.
113
+ - **What the conductor does itself** — reading the ticket, designing, and writing the code in
114
+ `build`/`fix` (single-thread on XS/S/M): neither key applies, because a session cannot switch its
115
+ own model. It continues with the model it was launched with.
116
+
117
+ Full reference: `docs/CONFIGURATION.md` §`models` in the repo.