flow-workflows 0.81.0 → 0.82.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/adapters/codex/CORE.md +120 -6
  2. package/adapters/codex/skills/flow-bug-fix/SKILL.md +8 -2
  3. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +5 -0
  4. package/adapters/codex/skills/flow-bug-postmortem/SKILL.md +1 -1
  5. package/adapters/codex/skills/flow-bug-review/SKILL.md +1 -1
  6. package/adapters/codex/skills/flow-bug-ship/SKILL.md +15 -2
  7. package/adapters/codex/skills/flow-bug-start/SKILL.md +9 -0
  8. package/adapters/codex/skills/flow-bug-validate/SKILL.md +2 -2
  9. package/adapters/codex/skills/flow-doctor/SKILL.md +11 -3
  10. package/adapters/codex/skills/flow-feat-build/SKILL.md +12 -6
  11. package/adapters/codex/skills/flow-feat-design/SKILL.md +6 -0
  12. package/adapters/codex/skills/flow-feat-review/SKILL.md +4 -1
  13. package/adapters/codex/skills/flow-feat-ship/SKILL.md +43 -3
  14. package/adapters/codex/skills/flow-feat-start/SKILL.md +14 -0
  15. package/adapters/codex/skills/flow-feat-validate/SKILL.md +16 -5
  16. package/adapters/codex/skills/flow-init/SKILL.md +4 -3
  17. package/adapters/codex/skills/flow-work-query/SKILL.md +1 -1
  18. package/adapters/codex/skills/flow-work-resume/SKILL.md +7 -1
  19. package/adapters/gemini/CORE.md +120 -6
  20. package/adapters/gemini/commands/flow/bug/fix.toml +8 -2
  21. package/adapters/gemini/commands/flow/bug/investigate.toml +5 -0
  22. package/adapters/gemini/commands/flow/bug/postmortem.toml +1 -1
  23. package/adapters/gemini/commands/flow/bug/review.toml +1 -1
  24. package/adapters/gemini/commands/flow/bug/ship.toml +15 -2
  25. package/adapters/gemini/commands/flow/bug/start.toml +9 -0
  26. package/adapters/gemini/commands/flow/bug/validate.toml +2 -2
  27. package/adapters/gemini/commands/flow/doctor.toml +11 -3
  28. package/adapters/gemini/commands/flow/feat/build.toml +12 -6
  29. package/adapters/gemini/commands/flow/feat/design.toml +6 -0
  30. package/adapters/gemini/commands/flow/feat/review.toml +4 -1
  31. package/adapters/gemini/commands/flow/feat/ship.toml +43 -3
  32. package/adapters/gemini/commands/flow/feat/start.toml +14 -0
  33. package/adapters/gemini/commands/flow/feat/validate.toml +16 -5
  34. package/adapters/gemini/commands/flow/init.toml +4 -3
  35. package/adapters/gemini/commands/flow/work/query.toml +1 -1
  36. package/adapters/gemini/commands/flow/work/resume.toml +7 -1
  37. package/adapters/hermes/CORE.md +120 -6
  38. package/adapters/hermes/skills/flow-bug-fix/SKILL.md +8 -2
  39. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +5 -0
  40. package/adapters/hermes/skills/flow-bug-postmortem/SKILL.md +1 -1
  41. package/adapters/hermes/skills/flow-bug-review/SKILL.md +1 -1
  42. package/adapters/hermes/skills/flow-bug-ship/SKILL.md +15 -2
  43. package/adapters/hermes/skills/flow-bug-start/SKILL.md +9 -0
  44. package/adapters/hermes/skills/flow-bug-validate/SKILL.md +2 -2
  45. package/adapters/hermes/skills/flow-doctor/SKILL.md +11 -3
  46. package/adapters/hermes/skills/flow-feat-build/SKILL.md +12 -6
  47. package/adapters/hermes/skills/flow-feat-design/SKILL.md +6 -0
  48. package/adapters/hermes/skills/flow-feat-review/SKILL.md +4 -1
  49. package/adapters/hermes/skills/flow-feat-ship/SKILL.md +43 -3
  50. package/adapters/hermes/skills/flow-feat-start/SKILL.md +14 -0
  51. package/adapters/hermes/skills/flow-feat-validate/SKILL.md +16 -5
  52. package/adapters/hermes/skills/flow-init/SKILL.md +4 -3
  53. package/adapters/hermes/skills/flow-work-query/SKILL.md +1 -1
  54. package/adapters/hermes/skills/flow-work-resume/SKILL.md +7 -1
  55. package/adapters/opencode/CORE.md +120 -6
  56. package/adapters/opencode/commands/flow-bug-fix.md +8 -2
  57. package/adapters/opencode/commands/flow-bug-investigate.md +5 -0
  58. package/adapters/opencode/commands/flow-bug-postmortem.md +1 -1
  59. package/adapters/opencode/commands/flow-bug-review.md +1 -1
  60. package/adapters/opencode/commands/flow-bug-ship.md +15 -2
  61. package/adapters/opencode/commands/flow-bug-start.md +9 -0
  62. package/adapters/opencode/commands/flow-bug-validate.md +2 -2
  63. package/adapters/opencode/commands/flow-doctor.md +11 -3
  64. package/adapters/opencode/commands/flow-feat-build.md +12 -6
  65. package/adapters/opencode/commands/flow-feat-design.md +6 -0
  66. package/adapters/opencode/commands/flow-feat-review.md +4 -1
  67. package/adapters/opencode/commands/flow-feat-ship.md +43 -3
  68. package/adapters/opencode/commands/flow-feat-start.md +14 -0
  69. package/adapters/opencode/commands/flow-feat-validate.md +16 -5
  70. package/adapters/opencode/commands/flow-init.md +4 -3
  71. package/adapters/opencode/commands/flow-work-query.md +1 -1
  72. package/adapters/opencode/commands/flow-work-resume.md +7 -1
  73. package/package.json +1 -1
  74. package/plugins/flow/.claude-plugin/plugin.json +1 -1
  75. package/plugins/flow/CHANGELOG.md +36 -0
  76. package/plugins/flow/examples/FLOW.template.md +12 -3
@@ -26,7 +26,7 @@ Read `~/.claude/flow/CORE.codex.md` first (shared rules: `FLOW.md` step 0, model
26
26
 
27
27
  Invoked by `$flow-feat-review` and `$flow-bug-review` (duel over the diff), `$flow-work-respond` (a reviewer objected to a query), `$flow-feat-design` (access paths), `$flow-feat-build`, `$flow-feat-validate`. Invoke directly for any doubt outside them (chat question, comment on an open MR/PR, a year-old query).
28
28
 
29
- **Autonomy.** Modes as in flow-core §2. The duel, challenger count and whether to measure are flow mechanics — never a question, in any mode. **Hard gates — stop and ask, in every mode:** (1) **creating, seeding or dropping any database, schema or table**, including a throwaway one (§4) — show exact commands and target, never a database the project uses; (2) **any DDL** on a real database (index, column, collation) — the flow's schema gate; (3) editing code (output is a verdict, not a patch); (4) posting anything to an MR/PR or ticket.
29
+ **Autonomy.** Modes as in flow-core §2. The duel, challenger count and whether to measure are flow mechanics — never a question, in any mode. **Hard gates — stop and ask, in every mode:** (1) **creating, seeding or dropping any database, schema or table**, including a throwaway one (§4) — show exact commands and target, never a database the project uses; (2) **any DDL** on a real database (index, column, collation) — the flow's schema gate; (3) editing code (output is a verdict, not a patch); (4) posting anything to an MR/PR or ticket. **In `unattended`** (flow-core §2.1) (1) and (2) are never done: the verdict is schema-only and says so; (3) and (4) do not apply, this command never edits or posts.
30
30
 
31
31
  ## 1. Resolve the subject
32
32
 
@@ -22,7 +22,11 @@ Read `~/.claude/flow/CORE.codex.md` first (shared rules: `FLOW.md` step 0, auton
22
22
 
23
23
  **Panel words are closed** — `mark`: `done` · `current` · `pending` · `wait` · `block` · `info`; `style`: `normal` · `dim` · `title` · `accent` · `ok` · `warn` · `error`. Anything else is dropped by the reader in silence: the panel still paints, and nobody is told.
24
24
 
25
- Use when returning to a work after a break (next morning, another session).
25
+ Use when returning to a work after a break (next morning, another session) — including a work an
26
+ unattended run left waiting on a person (flow-core §2.1).
27
+
28
+ **In `unattended`** this command asks nothing: recap, name the next step, end. It is how a person
29
+ reads where the run got to, not how the run continues.
26
30
 
27
31
  ## 1. Detection
28
32
 
@@ -45,6 +49,7 @@ Last updated: <updated_at>
45
49
  Notes: <meta.notes>
46
50
  Cross-repo: <meta.related_repos entries not "done", as "repo: scope"; or "—">
47
51
  Ticket thread: <new since <updated_at>: <n> comment(s) that change the work — detailed below · or "nothing new" · or "not read"> (line only in ticket mode, from §2.5)
52
+ Unattended: <from `.claude/work/stop.json` when its `work` is this one: `question` → the gate and the question, verbatim, with its options · `blocked` → the detail · `running` → "a run is working in <phase>, or died there, at <at>" · `done` → the MR/PR · `picked_up` → omit the line> (line only when that file names this work)
48
53
  ```
49
54
 
50
55
  - `MR/PRs:` and `Waves:` from `meta.json.mrs` (same format as `$flow-work-status §2`). `∥` = can run in parallel, `→` = waits for the previous wave to merge.
@@ -86,6 +91,7 @@ With what is new (there is already work on disk):
86
91
 
87
92
  ## 4. Next step
88
93
 
94
+ - A pending `question` in the `Unattended:` line → say that the next phase will ask it first (flow-core §2.1); the next step itself comes from `phase` as always.
89
95
  - Suggest the concrete command from `phase` and `size`. Interrupted phase (e.g. `build` with an empty artifact) → suggest rerunning it with `$flow-feat-build` or `$flow-bug-fix`.
90
96
  - §2.5 found something new → let it inform the suggestion (a contract that arrived after you left may mean rerunning `design` rather than continuing `build`); say why in one line.
91
97
  - `meta.json.related_repos` entries not `done` → remind that a **sibling repo still has a pending part** (`<repo>: <scope>`, plus `contract not handed over` when its `contract_handoff` is `pending`); suggest `$flow-feat-start <TICKET>` there. flow only reminds; it never scans or touches the other repo.
@@ -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.81.0`.** Compare it once, at the start of the session, against
19
+ **This file belongs to flow `0.82.1`.** 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
@@ -177,15 +177,20 @@ line: the wait inherits this thread's model because no key is set. Name the key,
177
177
 
178
178
  ## 2. Autonomy — `autonomy.mode`
179
179
 
180
- `manual` (default) · `guided` · `auto`. Read it once and apply it throughout the command.
180
+ `manual` (default) · `guided` · `auto` · `unattended`. Read it once and apply it throughout the command.
181
181
 
182
182
  | Mode | Decisions | End of the command |
183
183
  |---|---|---|
184
184
  | `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. |
185
185
  | `guided` | Resolve low-risk, unambiguous ones with the recommended default and **record** the choice in the phase artifact. Ask at genuine decision points. | Chain into the recommended next command automatically — the call that starts it first, no closing report before it (§3). |
186
186
  | `auto` | As `guided`, plus resolve the remaining decision points with sensible, recorded defaults. | Chain without pausing, same rule. |
187
+ | `unattended` | As `auto`, for a run **nobody is watching** (a script, a container, a headless CLI). Every place `auto` would still stop for a person resolves by §2.1 instead. | Chain as `auto`; the run ends at a **stop file** (§2.1), never at a question. |
187
188
 
188
- **Hard gates — stop and ask in every mode, no exceptions:**
189
+ `unattended` is never inferred — not from a headless harness, not from a missing terminal. It is
190
+ the value someone wrote in the FLOW config, or it is not in effect.
191
+
192
+ **Hard gates — in `manual`, `guided` and `auto`, stop and ask, no exceptions** (in `unattended`
193
+ each one resolves as §2.1's table says — never approved in silence):
189
194
  1. Any push or MR/PR creation (all of `ship`).
190
195
  2. Creating or switching a branch when the base is ambiguous (not on a clean main, or a possible train/stacked branch).
191
196
  3. DB schema changes or migrations.
@@ -210,7 +215,112 @@ sensible default and record it.
210
215
  delegation removes. Take it, record it. What is still asked in `manual` is whatever the evidence
211
216
  turns out to call for, once it is back.
212
217
 
213
- Asking these anyway is how an unattended run degrades into a manual one.
218
+ Asking these anyway is how a run in `guided`/`auto` degrades into a manual one.
219
+
220
+ ### 2.1 `unattended` — where a person would have been asked
221
+
222
+ Nobody answers a question in this mode. A question tool — `AskUserQuestion`, OpenCode's `question`,
223
+ whatever the harness calls it — either blocks a run that has no one to unblock it or, in print mode,
224
+ ends it with a question nobody reads. So **no question tool is ever called in `unattended`**, and a
225
+ question in prose is not a substitute. The run goes as far as it can without a person, and where it
226
+ needs one it **stops and says exactly what for**. It never answers for them. Each place a command
227
+ would have asked resolves one of three ways:
228
+
229
+ - **record** — take the resolution the table names, write it where the phase keeps its decisions,
230
+ add `{ "key": "unattended:<site>", "default": "<resolution>", "phase": "<phase>" }` to
231
+ `meta.json.defaults_used[]` (the prefix says it is not a FLOW key), and continue.
232
+ - **question** — a decision only a person can take. Write the stop file with `reason: "question"`,
233
+ the question and its options as `AskUserQuestion` would have carried them, set the panel's
234
+ `attention` to `wait`, and **end the run**: no further phase starts. A person picks the work up
235
+ in a session of their own, in any other mode, and the next phase asks them (below).
236
+ - **blocked** — something the run cannot get past (the environment, a tool, a check that keeps
237
+ failing). The stop file with `reason: "blocked"` and a one-line `detail`, `attention: block`, end
238
+ the run.
239
+
240
+ The §3 stop header is still printed at every stop — a log is the only screen that run has.
241
+
242
+ | Where | In `unattended` |
243
+ |---|---|
244
+ | 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 |
245
+ | Push and MR/PR creation (`ship`) | `autonomy.unattended_ship: draft` → push the work branch and create the MR/PR **as draft**; never merge, never mark it ready; the forge refusing a draft → blocked, never retried as a normal one. Empty or `stop` → question `ship` |
246
+ | 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 |
247
+ | `review` with blockers or high-severity findings | question `high_findings` |
248
+ | `validate` with a red suite or a criterion `unproven` | blocked — the phase does not advance and does not chain. **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion → record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Short of all three — a failure the base does not reproduce, a base that cannot be run, a test this diff touched — blocked |
249
+ | A product decision (§7 `decision`) | question `decision` |
250
+ | Clarifying questions on the ticket (`start`) | question `clarify` — after the branch and the work folder exist, with the questions also written to `01-context.md` |
251
+ | An unanswered high-severity challenge (`design`, `investigate`) | question `design_challenge` / `investigation_challenge` |
252
+ | No ticket, a tracker read that fails, a checkout that is not a clean default base (`start`) | blocked — the runner owns the checkout and the ticket |
253
+ | Below-XS check (`start`) | record — open the work |
254
+ | "Create the branch?" (`start`), the 2–3 line note an XS `build`/`fix` asks for, a contract the design left in prose (`build`) | record — create it · write the note from the ticket · convert it to literal and say so in the artifact |
255
+ | `git.worktree: ask` | record — in place |
256
+ | Cross-repo scope (`start`) | record — only the repos the ticket names |
257
+ | Criteria that need a person to verify (`validate`) | record — `not-verified-unattended`; every later `ship`, in any mode, lists them in the body under "Not verified — needs a human" |
258
+ | The query duel needs a database (`review`, `query`) | record — schema-only verdict; never create or seed a database |
259
+ | "Was it merged?" (`ship` close) | record — not merged |
260
+ | The next MR/PR of a train (`ship` close) | record — not started: one MR/PR per unattended run |
261
+ | `build` with no startable MR/PR (its `depends_on` not `merged` in `meta.json`) | blocked — the detail names what must merge; an unattended `build` never stacks a branch on another, and never creates a remote branch |
262
+ | The parent of a stacked MR/PR merged — rebase and force-push | blocked — never force-push unattended |
263
+ | 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 |
264
+ | 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 |
265
+ | Anything `auto` already decides on its own (size, flow mechanics, WIP commits, the next command) | as `auto` |
266
+
267
+ A place where `auto` would still ask and this table does not name is a **question** — the
268
+ conservative reading, never a guess dressed as a default.
269
+
270
+ **The stop file** — `.claude/work/stop.json`, at the root of the main checkout (§0: the repo root is
271
+ the main checkout's, whichever worktree the phase runs in). One fixed path, so a runner finds it
272
+ without knowing the work's folder, and `start` can write it before that folder exists. Written
273
+ whole, every time, with every field — by unattended runs, and outside that mode only to mark it
274
+ `picked_up` (below). **One unattended run per repository**: its
275
+ worktrees all share this file. A clean-tree check never counts `.claude/work/` — the flow's own
276
+ folder.
277
+
278
+ ```json
279
+ {"reason": "question",
280
+ "phase": "build",
281
+ "gate": "migration",
282
+ "ticket": "168",
283
+ "work": "168-unattended-autonomy-mode",
284
+ "branch": "168-unattended-autonomy-mode",
285
+ "worktree": null,
286
+ "question": "The design adds a nullable column `mails.opened_at` and its migration. Write and apply it?",
287
+ "options": [{"label": "Write and apply it", "recommended": true}, {"label": "Change the design first"}],
288
+ "mr_url": null,
289
+ "detail": null,
290
+ "at": "2026-09-29T14:30:00+02:00"}
291
+ ```
292
+
293
+ - `reason`: `running` · `question` · `blocked` · `done` · `picked_up`. It mirrors the panel's `attention` (§4.2):
294
+ `question` ↔ `wait`, `blocked` ↔ `block`, `done` ↔ `done`, `running` and `picked_up` ↔ absent.
295
+ Set both in the same step.
296
+ - `work`, `branch`, `worktree`: where the person picks it up — `null` for the ones that do not exist
297
+ yet when `start` stops early.
298
+ - `gate`: the site's id from the table, or `null`. `question` and `options` carry the whole question,
299
+ the recommended option first — whoever reads it has not seen this session.
300
+ - `done` is written when the run's work is over: the MR/PR created (`mr_url` set; with a train,
301
+ `detail` says which MR/PR comes next and what it waits on), or a phase that finds nothing to do
302
+ (every MR/PR merged, a work already shipped) — `detail` says which. **No unattended phase ends
303
+ with `running` in the file**: every ending is one of `question`, `blocked` or `done`.
304
+ - `at` from the real clock (`date -Iseconds`).
305
+
306
+ **Every phase that starts in this mode writes `reason: "running"` first** — the whole file, `work`,
307
+ `branch` and `worktree` included — unless it holds a `question`, for this work or any other: no
308
+ person has answered it yet, and the file is the only record of it, so say so and end the run,
309
+ touching nothing. One question at a time per repository. (A `blocked` is overwritten: running
310
+ again *is* its retry, once the runner has fixed what it named.) A run that dies therefore leaves
311
+ `running` behind. For the runner: `running` at exit is a crash; a `question` older than the run's
312
+ own start is the earlier stop, still waiting, and the run refused to go past it.
313
+
314
+ **A person picks it up in any other mode.** `/flow:work:resume` names the pending stop in its
315
+ recap, and **the next phase that runs on that work** (`stop.json.work` is this one — never another
316
+ work's) **asks it first** — the question, verbatim, with its options — before doing anything else,
317
+ then overwrites the file with `reason: "picked_up"`. The answer decides what happens next, as any
318
+ answer does: *go on* → the phase goes on; *change the design*, *fix them* → the phase does that
319
+ instead (back to `design`, fix and review again). A `ship` question is not replayed: `ship`'s own
320
+ preview asks it, fresh. **The person's session must not itself be `unattended`**: set the mode where
321
+ only the runner reads it — a FLOW file the runner's own environment writes (its container, its CI
322
+ checkout), or the overlay of a harness only the runner uses. `/flow:doctor` says which file the
323
+ mode came from.
214
324
 
215
325
  ## 3. Reporting — how every stop reads
216
326
 
@@ -233,6 +343,9 @@ terminal by construction, the turn is over before you notice.
233
343
  the answer arrives, before the work resumes (§4.4e).
234
344
  - **Stopping? Then say so.** `I need:` names the decision or the action you are waiting on. It
235
345
  never announces that you are continuing — if you were, you would not be writing this header.
346
+ - **In `unattended`, the stop is the stop file** (§2.1): write it, set the panel's `attention`,
347
+ end the run. The header below is still printed — a log is the only screen that run has — but
348
+ nothing in it is asked.
236
349
 
237
350
  The user comes back to a screen they walked away from, often with other works in other panes.
238
351
  They have read none of your tool calls, subagent reports or artifacts. So every stop **opens with
@@ -251,7 +364,7 @@ I need: <one line — the decision or action you are waiting on>
251
364
  - **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.
252
365
  - **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.
253
366
  - **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.
254
- - **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.
367
+ - **If it is a question, it is `AskUserQuestion`** — in `unattended`, the stop file (§2.1). Never end a message with a question in prose. If it does not deserve the menu, it is a decision you take and record.
255
368
  - **What the question is about travels with the question.** A brief, an MR/PR body, a plan, a finding: put it where the user answers it — in the question text and its options — and not only in the prose above. **Nothing runs between the two**: a tool call after that prose is what makes a terminal fold it away, and the last thing a chat UI collapses is exactly the thing they were asked to read. A gate answered without seeing what it was about is not a gate; "it is in `05-implementation.md`" is not showing it, because the answer then costs opening an editor and finding the file. Too long for the harness's question → print it as the **last** thing before asking, tool calls already done.
256
369
 
257
370
  ## 4. Live panel — over the terminal's MCP, or `panel.json`
@@ -723,7 +836,8 @@ reader of `05-implementation.md` still sees the ideas in context.
723
836
  ships, gets reviewed, and comes back as a ticket that costs a whole work to answer what was two
724
837
  minutes of the user's. The test is one line: **if the answer changes what the code being written
725
838
  does now, ask now; if it changes what someone builds later, record it.** Asked now means one
726
- `AskUserQuestion` the moment it surfaces, **in every `autonomy.mode`, `auto` included** — the
839
+ `AskUserQuestion` the moment it surfaces, **in every `autonomy.mode`, `auto` included** (in
840
+ `unattended`, a `decision` question in the stop file, §2.1) — the
727
841
  never-ask list of §2 is about flow mechanics, and a product decision is the opposite of mechanics —
728
842
  phrased as the question itself with the options that were on the table, recommended one first. The
729
843
  answer goes where the phase keeps its decisions (the brief in `04-fix.md`, the ADR-light in
@@ -48,6 +48,12 @@ What is NOT touched:
48
48
 
49
49
  In `auto` this is one of the only two stops of the whole flow (this one and `ship`; `guided` adds the plan of §2.0bis on a fix of more than two steps): open with the **full stop header** (flow-core §3), then the brief.
50
50
 
51
+ In `unattended` (flow-core §2.1) nobody is there to answer: write the brief, mark it
52
+ `recorded (unattended)` under its heading, record the site in `meta.json.defaults_used[]`, and fix.
53
+ The gate's purpose moves to the draft MR/PR, whose body carries the brief for the person who reads it.
54
+ **A schema change or migration is still a question** (`migration`): before writing the first line
55
+ of one → stop file, end the run. A person continues from there.
56
+
51
57
  **The brief travels inside the question** (flow-core §3) — read in the prompt being answered, not by opening `04-fix.md` — and **nothing runs between the brief and the question**: a tool call after it is what lets a terminal fold it away. Options:
52
58
  - **Yes, go ahead** → apply the fix.
53
59
  - **No, something is missing or wrong** → adjust the brief, ask again. No code until confirmed.
@@ -114,13 +120,13 @@ the fix is minimal precisely because it trusts that. When the fix depends on X b
114
120
  cause and the investigation's evidence does not close that — one reproduction, a correlation, a
115
121
  `git blame` that fits the story — that is the premise, and one skeptic on it costs less than the
116
122
  second regression. **Refuted** → back to `/flow:bug:investigate`, never a second patch layered on
117
- the first. **Unsettled** → recorded in `04-fix.md` under "Premises the fix depends on" and carried
123
+ the first (in `unattended`, the run ends `blocked` there, flow-core §2.1). **Unsettled** → recorded in `04-fix.md` under "Premises the fix depends on" and carried
118
124
  into the stop, because `/flow:bug:validate` writes a regression test against the cause the fix
119
125
  assumed.
120
126
 
121
127
  ## 2.3 Something outside the brief comes up?
122
128
 
123
- Anything **not in the §2 brief** ("while I'm at it, I'll also fix X", "this rename fits here", "this extra test covers another case"): **pause before touching it** and ask with `AskUserQuestion`:
129
+ Anything **not in the §2 brief** ("while I'm at it, I'll also fix X", "this rename fits here", "this extra test covers another case"): **pause before touching it** and ask with `AskUserQuestion` (in `unattended`: *No, leave it out*, recorded):
124
130
  - **Yes, add it to the brief** — update the brief in `04-fix.md`, continue.
125
131
  - **No, leave it out** — note it under "Areas with similar risk" (a risk from the same pattern) or under "Ideas for separate tickets" in `04-fix.md`, **and append it to `meta.json.followups[]`** as `kind: "audit"` (similar risk) or `kind: "out-of-scope"`, `source: "fix"` (flow-core §7). **Only when it clears the bar of flow-core §7** — a named subject, a path that has actually been seen, and waiting costing more than doing it now; short of that the artifact section keeps it and `followups[]` never sees it.
126
132
 
@@ -16,6 +16,11 @@ prompt = """
16
16
 
17
17
  Investigation phase: reproduce the failure, then find **why it happened** — not just what is failing.
18
18
 
19
+ **In `unattended`** (flow-core §2.1) this command asks nothing. The hypothesis sweep runs as in
20
+ `auto` · a size that no longer fits → record the new size · a `high` challenge with no response →
21
+ question `investigation_challenge`, the findings and their options in the stop file · a bug that
22
+ cannot be reproduced and needs a person to try → blocked.
23
+
19
24
  ## 1. Pre-flight
20
25
 
21
26
  Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, models, autonomy modes and hard gates, how a stop reads, the live panel, `00-summary.md`) — skip if you already read it in this session. **Models: the subagents it launches take `models.agents`; its parallel rounds take `models.workers`.**
@@ -93,5 +93,5 @@ Neither role set → skip this block silently.
93
93
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
94
94
  - **Write every prevention action and similar-risk area to `meta.json.followups[]`** (flow-core §7), ids matching the tables above. This is the whole point of the phase: an action that lives only in `99-postmortem.md` is archived with the work and read by nobody, which is how the incident repeats.
95
95
  - Suggest `/flow:bug:ship`. Say how many follow-ups it will ask about at its Close — **do not triage them here**: mid-postmortem is the wrong moment to judge what is worth a ticket, and `ship` asks once with the whole set in view.
96
- - **Autonomy handoff — stops in every mode, `auto` included.** `ship` pushes and opens the MR/PR, a hard gate in every mode: do **not** chain into it; stop here and propose `/flow:bug:ship` with a single `AskUserQuestion` (recommended option by default).
96
+ - **Autonomy handoff — stops in every mode, `auto` included.** `ship` pushes and opens the MR/PR, a hard gate in every mode: do **not** chain into it; stop here and propose `/flow:bug:ship` with a single `AskUserQuestion` (recommended option by default). In `unattended` (flow-core §2.1), chain into `/flow:bug:ship`: it decides between a draft and a question.
97
97
  """
@@ -234,5 +234,5 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
234
234
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow:feat:design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
235
235
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
236
236
  - Stop body (after the flow-core §3 header): the findings that survived and what you did with each, plus the same Cost line as the Summary: "- Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>".
237
- - **Autonomy handoff.** Only without blockers — with blockers, stop in every mode. **M/L**: `manual` → propose `/flow:bug:postmortem` with a single `AskUserQuestion`; `guided`/`auto` → chain into it in this same turn. **XS/S**: the next step is `ship`, which pushes and opens the MR/PR — a hard gate in **every** mode: stop here and propose `/flow:bug:ship` with a single `AskUserQuestion`, never chaining into it.
237
+ - **Autonomy handoff.** Only without blockers — with blockers, stop in every mode (in `unattended`, question `high_findings` and the run ends, flow-core §2.1). **M/L**: `manual` → propose `/flow:bug:postmortem` with a single `AskUserQuestion`; `guided`/`auto` → chain into it in this same turn. **XS/S**: the next step is `ship`, which pushes and opens the MR/PR — a hard gate in **every** mode: stop here and propose `/flow:bug:ship` with a single `AskUserQuestion`, never chaining into it. In `unattended`, chain into `/flow:bug:ship`: it decides between a draft and a question.
238
238
  """
@@ -19,6 +19,17 @@ Close the bug flow: commit, push, MR/PR. Same mechanics as `/flow:feat:ship`, wi
19
19
  1. If `99-postmortem.md` exists, **include the link or the executive summary** in the MR/PR description.
20
20
  2. The knowledge-consolidation offer was already made in `/flow:bug:postmortem` — do not ask again here.
21
21
 
22
+ **In `unattended`** (flow-core §2.1) this command asks nothing — the same resolutions as
23
+ `/flow:feat:ship`'s unattended paragraph, and its "In every mode" paragraph too, applied to the
24
+ sections here: the MR/PR (§2–§3) is a draft only with `autonomy.unattended_ship: draft`, created as
25
+ §3.1 says for a draft; otherwise question `ship` and the run ends; pre-deploy SQL → question
26
+ `migration`. The tree check (§0) re-runs what is behind `HEAD` once per MR/PR, recorded as
27
+ `/flow:feat:ship` says — here `validate` first, since it ran before the review, then the review on
28
+ the delta — and is `blocked` after that. The
29
+ performance comment (§3.3) is not posted; every offer and survey at Close (§4) — follow-ups,
30
+ conventions, archiving — is `Later`; "was it merged?" is not merged; and Close writes the stop file
31
+ with `reason: "done"` and `mr_url`.
32
+
22
33
  ## 0. Pre-flight
23
34
 
24
35
  Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, models, autonomy modes and hard gates, how a stop reads, the live panel, `00-summary.md`) — skip if you already read it in this session. **Models: this command runs with the model it was launched with; the wait it delegates takes `models.supervisors`.**
@@ -118,7 +129,7 @@ Determine whether the fix modifies the database (migrations, mappings/schema, or
118
129
 
119
130
  ## 2. Show to user and wait for confirmation (REQUIRED)
120
131
 
121
- **Never skip this step** — hard gate: the user approves what will be published before anything is created. Print in this exact format:
132
+ **Never skip this step** — hard gate: the user approves what will be published before anything is created (in `unattended`, the unattended paragraph above decides it). Print in this exact format:
122
133
 
123
134
  ```
124
135
  ─── Preview of {MR or PR, per git.host} (fix) ──────────────────────────────────
@@ -152,7 +163,9 @@ Same as `/flow:feat:ship` §4.0: `git rev-parse --abbrev-ref HEAD` must not be t
152
163
 
153
164
  ### 3.1 Create MR/PR
154
165
 
155
- Only here — with the content approved in §2 — invoke `Skill commit-commands:commit-push-pr` passing **the final title and description**. The skill must not re-ask; if it does, answer with what was confirmed. If it pushes, it uses `git push -u origin HEAD`, never to the main base.
166
+ **A draft (`unattended`) — read this first:** exactly as `/flow:feat:ship §4.1` says for a draft — never `commit-push-pr`, never the plain CLI; the forge CLI with its draft flag; a refused draft → `blocked`.
167
+
168
+ Otherwise, only here — with the content approved in §2 — invoke `Skill commit-commands:commit-push-pr` passing **the final title and description**. The skill must not re-ask; if it does, answer with what was confirmed. If it pushes, it uses `git push -u origin HEAD`, never to the main base.
156
169
 
157
170
  Assign to `git.assignee` from FLOW.md (empty → unassigned). Squash per `git.squash`.
158
171
 
@@ -19,6 +19,15 @@ Start a bug. `{{args}}` is **optional**:
19
19
  - **Given** — a ticket (format `tracker.prefix` from FLOW.md) → *ticket mode*: start from it (§1 reads it).
20
20
  - **Empty** — *ticket-less mode*: do **not** stop. Synthesize the bug from the conversation just held with the user (§1.5). Ask for a one-line symptom only if there is no conversation to draft from.
21
21
 
22
+ **In `unattended`** (flow-core §2.1) this command asks nothing; each place it would ask resolves as
23
+ that table says. Here: a ticket is required — empty, or a tracker read that fails, ends the run
24
+ `blocked` · uncommitted changes or a branch other than the main one (§3) → `blocked`: the runner
25
+ owns the checkout · cross-repo scope (§1.6) → only the repos the ticket names · `git.worktree: ask`
26
+ → in place · a linked remote branch → skipped, nothing is pushed before `ship` · the tracker
27
+ transition (§4.5) → as `auto`. **A thread that changes what the bug *is* (§1.1 precedence) waits
28
+ until the branch and the work folder exist** — create them (§3, §4) first, write it into
29
+ `01-context.md` as open, then question `clarify`; the next phase asks it first (flow-core §2.1).
30
+
22
31
  ## 0. Pre-flight
23
32
 
24
33
  Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, models, autonomy modes and hard gates, how a stop reads, the live panel, `00-summary.md`) — skip if you already read it in this session. **Models: this command runs with the model it was launched with (no `models` key).**
@@ -36,7 +36,7 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
36
36
  Then:
37
37
  1. Run only that test with `quality.test_one` from FLOW.md; it must pass.
38
38
  2. Run the full suite with `quality.test` to rule out collateral regressions (in the background if slow; measured in tens of minutes → delegate it as a wait to a supervisor subagent on `models.supervisors`, flow-core §6.5 — it returns the exit code and the failing output, and the reading of them stays here).
39
- 3. DB touched → verify the schema has no unexpected differences (`quality.db_update` or the FLOW.md equivalent, if defined).
39
+ 3. DB touched → verify the schema has no unexpected differences (`quality.db_update` or the FLOW.md equivalent, if defined; in `unattended` it is never run — a schema difference to apply is question `migration`, flow-core §2.1).
40
40
  4. Security or authentication touched → launch the `agents.security` agent from FLOW.md in parallel over the fix files (empty → `Agent general-purpose` with a security role).
41
41
 
42
42
  ## 2.5 Reproduce the original symptom against the running app
@@ -89,7 +89,7 @@ this is the same gate as a red test.
89
89
 
90
90
  ## 5. Close
91
91
 
92
- - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode.
92
+ - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode (in `unattended`, the run ends `blocked` with the failing test named, flow-core §2.1 — unless every failing test also fails on the base, the one exception that row records; the reproduction test lives in a file this diff touches, so it never qualifies).
93
93
  - Green → `phase = "validate"`, add to `phases_done`; in the same write record `validated_sha` = `git rev-parse HEAD` — the tree the regression test passed on, which `/flow:bug:ship §0` reads. Suggest `/flow:bug:review`.
94
94
  - **Other bugs detected become `followups[]` entries** (flow-core §7) when they clear its bar — a reproducible symptom with someone who suffers it, not «this looks fragile» — per the output template.
95
95
  - **Stage what the validation taught** (`knowledge.stage` set; silence by default): a mutation that stayed green, a disguise the scenario wore, a fixture that could not produce the case — findings about how this codebase is tested, not about this diff. Same rule and evidence line as the review's Close.
@@ -98,7 +98,9 @@ supervisors (empty) → the delegated waits (running pipeline, pending deploy
98
98
  empty key in `guided`/`auto` records it rather than asking. This block is where that record is read
99
99
  back.
100
100
 
101
- Aggregate `defaults_used[]` from every `.claude/work/*/meta.json`, **`_archive/` included**. One row
101
+ Aggregate `defaults_used[]` from every `.claude/work/*/meta.json`, **`_archive/` included**, leaving
102
+ out keys prefixed `unattended:` — those record how an unattended run resolved a stop, not a FLOW key
103
+ with a line to paste. One row
102
104
  per key: the key, the default that was used, in how many works, and the last phase that used it.
103
105
  Sort by count, most-used first, and cap the block at the ten busiest keys with a count of the rest.
104
106
 
@@ -161,9 +163,15 @@ base branch resolvable — is §2 below; flag the key here, check the world ther
161
163
  run against a development or throwaway database, never a live one.
162
164
  - **Autonomy**: `autonomy.mode` empty → note it defaults to `manual` (every phase stops and, at the
163
165
  end, proposes the next command as a one-click confirmation — never runs it unconfirmed). Set →
164
- echo the mode and remind that the hard gates stop and ask in every mode and that `guided`/`auto`
166
+ echo the mode and remind that the hard gates stop and ask in `manual`/`guided`/`auto` and that `guided`/`auto`
165
167
  never ask about the flow's own mechanics or anything already decided (both lists: `flow:flow-core`
166
- skill §2). Unrecognized value → flag, `manual` assumed.
168
+ skill §2). Unrecognized value → flag, `manual` assumed. `unattended` → say what it does instead of
169
+ the gates (flow-core §2.1): nothing is asked, questions end the run in `.claude/work/stop.json` for a runner,
170
+ and `ship` is a draft only when `autonomy.unattended_ship` is `draft` — echo that value, or that it
171
+ is empty and ship will stop on a question. Say which file set it: every session that reads that file
172
+ — a person's included, when they share the checkout and the harness — stops asking too, so it
173
+ belongs in a FLOW file only the runner's environment has. `unattended_ship` set with any other mode → note it is ignored; a
174
+ value other than `draft`/`stop` → flag, `stop` assumed.
167
175
 
168
176
  ## 2. Checks
169
177
 
@@ -27,9 +27,9 @@ Implementation phase. Code is written here.
27
27
  - `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).
28
28
  - **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`".)
29
29
  - **Parallel siblings**: startable `pending` MRs/PRs in the **same `wave`** with no dependency between them can be built in parallel or as a train. `manual`: let the user choose which to take now (default: lowest `n`); `guided`/`auto`: take the lowest `n`, record the choice. Mark the chosen one `in_progress`.
30
- - All `merged` → warn: feature is done, nothing to build.
31
- - Some `pending` but **none** startable → start nothing: tell the user which MR/PR must merge to unlock the next wave, and stop.
32
- - **Train/stacked**: this MR/PR needs its own branch stacked on the previous one — do **not** keep committing on the previous MR/PR's branch. `/flow:feat:ship §6.2` creates and links it when it chains here; if you arrived directly and are still on the previous branch, create it now per `/flow:feat:start §5` (explicit base = the previous MR/PR's branch, `--no-track`, worktree per `git.worktree`) and, for `tracker.tool: gh`, the linked-branch step `/flow:feat:start §5.5`. Record `stacked_on` in `meta.json`. The train does **not** wait for the previous MR/PR to merge.
30
+ - All `merged` → warn: feature is done, nothing to build (in `unattended`: `done`, `detail` saying so).
31
+ - Some `pending` but **none** startable → start nothing: tell the user which MR/PR must merge to unlock the next wave, and stop. In `unattended`: `blocked`, the detail naming it.
32
+ - **Train/stacked** (never in `unattended`: there the startable MR/PR gets a **new branch of its own** from `git.default_base`, created as `/flow:feat:start §5.2` (in place) or `§5.4` (worktree) says — `git.worktree: always` → worktree, `off`/empty/`ask` → in place; base `git.default_base`, already decided, so §5.1 asks nothing; `--no-track`, no linked remote branch — and never commits onto a previous MR/PR's branch; flow-core §2.1): this MR/PR needs its own branch stacked on the previous one — do **not** keep committing on the previous MR/PR's branch. `/flow:feat:ship §6.2` creates and links it when it chains here; if you arrived directly and are still on the previous branch, create it now per `/flow:feat:start §5` (explicit base = the previous MR/PR's branch, `--no-track`, worktree per `git.worktree`) and, for `tracker.tool: gh`, the linked-branch step `/flow:feat:start §5.5`. Record `stacked_on` in `meta.json`. The train does **not** wait for the previous MR/PR to merge.
33
33
 
34
34
  ## 2. Business brief (before typing)
35
35
 
@@ -59,6 +59,12 @@ Rules for writing it:
59
59
 
60
60
  In `auto` this is one of the only two stops per MR/PR (`guided` adds the plan of §2.0ter on a big one), so it carries the **full stop header** (flow-core §3) — ticket, size, phase, `MR #<n> of <N>`, plan state — followed by the brief.
61
61
 
62
+ In `unattended` (flow-core §2.1) nobody is there to answer: write the brief, mark it
63
+ `recorded (unattended)` under its heading, record the site in `meta.json.defaults_used[]`, and build.
64
+ The gate's purpose moves to the draft MR/PR, whose body carries the brief for the person who reads it.
65
+ **A schema change or migration is still a question** (`migration`): before writing the first line
66
+ of one → stop file, end the run. A person continues from there.
67
+
62
68
  **The brief travels inside the question** (flow-core §3): the user reads it in the prompt they are answering, never by opening `05-implementation.md`. Write the file, run whatever you need, and *then* open the gate — **nothing runs between the brief and the question**, because a tool call after it is what lets a terminal fold the brief into one collapsed line, and the gate is answered blind. Options:
63
69
  - **Yes, proceed** → start building.
64
70
  - **No, something is extra or missing** → the user clarifies, adjust the brief, ask again. **Do not touch code** until the brief is confirmed.
@@ -182,7 +188,7 @@ said in one line, never silently skipped. `manual` → offer it with `AskUserQue
182
188
  premise that X before building on it?"). `guided`/`auto` → run it and record it; it is flow
183
189
  machinery, not a decision.
184
190
 
185
- **The verdict, and the rule that makes it worth running.** **Refuted** → the brief or the design is
191
+ **The verdict, and the rule that makes it worth running** (in `unattended`, *Refuted* ends the run as `blocked`, flow-core §2.1). **Refuted** → the brief or the design is
186
192
  wrong, not the code: stop, say what fell, and go back (§2.4 for a brief, `/flow:feat:design` for a
187
193
  contract) rather than patching around it. **Holds** → one row in §3 with what was read. **Unsettled
188
194
  stays unsettled** — the same rule as the query duel's *no number, no win*: it is recorded as an open
@@ -252,7 +258,7 @@ Warning thresholds:
252
258
  - **Real lines > `lines_est * 1.5`**, or
253
259
  - **Real files > `files_est + 2`**.
254
260
 
255
- If either is exceeded, **pause** and ask the user with `AskUserQuestion` (options, in this order):
261
+ If either is exceeded, **pause** and ask the user with `AskUserQuestion` (options, in this order — in `unattended`, take option 2 and record it):
256
262
 
257
263
  1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains — the §2.0ter steps still pending, or what is left of `04-mr-plan.md` where that step was skipped — goes into a new one inserted in `meta.json.mrs` right after. Zero code wasted.
258
264
  2. **Continue and record the overrun**. When the cut would be artificial. Note the deviation in `05-implementation.md` to calibrate `/flow:feat:plan` on future tickets.
@@ -279,7 +285,7 @@ slip under a threshold buys itself the review a smaller change had earned.
279
285
 
280
286
  ### 2.4 Does something fall outside the brief?
281
287
 
282
- If during the build the temptation arises to add something **not in the §2 brief** ("while I'm here…", "this test would also cover X…", "this rename would improve Y…"), **pause before doing it** and ask the user with `AskUserQuestion`:
288
+ If during the build the temptation arises to add something **not in the §2 brief** ("while I'm here…", "this test would also cover X…", "this rename would improve Y…"), **pause before doing it** and ask the user with `AskUserQuestion` (in `unattended`: *No, leave it out*, recorded):
283
289
  - **Yes, add it to the brief** — update the brief in `05-implementation.md` and continue. (If the addition is large, consider §2.3: it could trigger a MR/PR cut.)
284
290
  - **No, leave it out** — note it in the "Ideas for separate tickets" section of `05-implementation.md` **and append it to `meta.json.followups[]`** as `kind: "out-of-scope"`, `source: "build"` (flow-core §7): the section keeps it in context, the record is what survives the archive. **Only when it clears the bar of flow-core §7** — a named subject, a path that has actually been seen, and waiting costing more than doing it now; short of that the artifact section keeps it and `followups[]` never sees it. Continue with the original brief.
285
291
 
@@ -20,6 +20,12 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
20
20
 
21
21
  Technical design phase. **Still no production code is written.** Opens the option space first (M/L), then designs the approach that was chosen. Output: a plan the next step executes.
22
22
 
23
+ **In `unattended`** (flow-core §2.1) this command asks nothing. Panel and approach choice run as in
24
+ `auto` · questions the options surfaced (§1.5.5) or an acceptance criterion that is ambiguous (§9) →
25
+ question `clarify` · a size that no longer fits (§1.5.5, §7) → record the new size · a `high`
26
+ challenge with no response (§6) → question `design_challenge`, the findings and their options in the
27
+ stop file · the design review (§9) → recorded as accepted, as in `auto`.
28
+
23
29
  ## 1. Pre-flight
24
30
 
25
31
  - Load `meta.json` by current branch. Missing → ask the user to start with `/flow:feat:start`.
@@ -384,5 +384,8 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
384
384
  - **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
385
385
  - **Configuration this phase earned the right to ask about** (flow-core §0, `manual` only, at most one key per work, as an extra option on this same stop — never a question of its own): a `Cost:` line that went over `agents.budget_max` → `quality.review_depth`. In `guided`/`auto` neither is asked: the default is taken and recorded in `meta.json.defaults_used[]`.
386
386
  - Report findings and next step **following the stop header** (flow-core §3) **when this is a stop**; in `guided`/`auto` with a clean gate the next command runs in this same turn, so this goes to `06-review.md` and the turn opens with the call that chains — the `Cost:` line then travels to the stop the run does reach, added to that phase's own. Include it once. Body: the findings that **survived** verification and what you did with each — a blocker, an applied fix, a rejection with its reason. Corrections to the reviewers' own reports go to `06-review.md`, not here.
387
- - **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate). Clean: in `manual`, propose `/flow:feat:validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `/flow:feat:validate` automatically** in this same turn. Never chain into `/flow:feat:ship` from here — ship is reached through `validate`.
387
+ - **Autonomy handoff.** Only when there are **no blockers and no unresolved high-severity findings** — with any of those, stop in every mode (hard gate; in `unattended`, see below). Clean: in `manual`, propose `/flow:feat:validate` with a single `AskUserQuestion` and invoke it on confirmation; in `guided`/`auto`, **chain into `/flow:feat:validate` automatically** in this same turn. Never chain into `/flow:feat:ship` from here — ship is reached through `validate`.
388
+ - **In `unattended`** (flow-core §2.1), blockers or unresolved high-severity findings are question
389
+ `high_findings`: the surviving findings in `question`, one line each, and the run ends. A person
390
+ picks it up in a session of their own, where they are fixed and reviewed again.
388
391
  """
@@ -20,6 +20,39 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
20
20
 
21
21
  Closes the feature: commit, push, MR/PR (assigned per `git.assignee`, squash per `git.squash`, sections per `git.request_sections`) and an optional offer to consolidate knowledge.
22
22
 
23
+ **In `unattended`** (flow-core §2.1) this command asks nothing, and it is the only place that run
24
+ pushes. Each place it would ask:
25
+
26
+ - **The MR/PR itself (§3–§4)** — `autonomy.unattended_ship: draft` → skip the confirmation and
27
+ create it **as draft** with the §2 content (§4.1 says how); never merge it, never mark it ready.
28
+ The body gains one line saying an unattended run opened it and nobody confirmed its brief.
29
+ Empty or `stop` → nothing is pushed: question `ship`, the §3 preview as the question, and the run
30
+ ends; a person ships it from a session of their own. Pre-deploy SQL in the branch → question
31
+ `migration`, whatever `unattended_ship` says.
32
+ - **The §1 tree check** — `reviewed_sha` or `validated_sha` behind `HEAD` with more than tests →
33
+ re-run what is behind, **once per MR/PR**: the review on the delta, then `validate`. First record
34
+ `{ "key": "unattended:ship-recheck", "default": "mr <n>", "phase": "ship" }` in
35
+ `meta.json.defaults_used[]` — the record, not the context, is what remembers it; an entry with this
36
+ MR/PR's `n` already there → `blocked`, whatever the sha. Tracked changes this run's own phases left uncommitted → commit them
37
+ as WIP first (a WIP commit is `auto`'s to make) and check again · **blocking TODO/FIXME (§1)** →
38
+ continue and list them in the body.
39
+ - **Posting anything else** — the performance comment (§4.3), a contract handoff (§6.3) — → not
40
+ posted; the numbers go in the body, the handoff stays `pending`.
41
+ - **The offers and surveys (§5, §5.1, §5.2, §5.5, §6.4, §6.4bis)** → `Later`; nothing written outside
42
+ the work folder.
43
+ - **"Was it merged?" (§6.1)** → not merged; `meta.json` as §6.1 says for an unmerged MR/PR. **The
44
+ parent merged first (§6.2.1)** → blocked, never force-push. **Train continuation (§6.2)** → not
45
+ started: one MR/PR per unattended run.
46
+ - **At Close** write the stop file with `reason: "done"`, `mr_url`, and — with `mrs` still pending —
47
+ `detail` naming the next MR/PR and what it waits on (its `depends_on` merged, then
48
+ `/flow:feat:build`). It is the last thing the run does.
49
+
50
+ **In every mode**, criteria `07-validation.md` marks `not-verified-unattended` go into the body under
51
+ `## Not verified — needs a human`, with what to do for each — and so do the tests the suite left red
52
+ because they also fail on the base (`unattended:validate-red-base`): each name, and the base sha
53
+ where it failed too. The §3 preview shows that section like
54
+ any other, and the person reading it is the check the run could not do.
55
+
23
56
  ## 1. Pre-flight
24
57
 
25
58
  - Read `meta.json` and `00-summary.md`; open in full only the `Brief MR/PR #N` of `05-implementation.md`, the `## Summary`/blockers of `06-review.md` and `07-validation.md`. (flow-core §5)
@@ -131,7 +164,7 @@ Determine whether the branch modifies the database (migrations, mappings/schema,
131
164
 
132
165
  ## 3. Show the user and wait for confirmation (MANDATORY)
133
166
 
134
- **Never skip this step, even when the content seems obvious.** Hard gate in every mode.
167
+ **Never skip this step, even when the content seems obvious.** Hard gate in every mode — in `unattended`, the unattended paragraph above decides it.
135
168
 
136
169
  Print to the user in this exact format:
137
170
 
@@ -172,7 +205,14 @@ git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null # must NOT be
172
205
  - Train mode (`stacked_on` ≠ null) → the MR/PR must target that parent branch, not the main base.
173
206
 
174
207
  ### 4.1 Create MR/PR
175
- Only here — with the content approved in §3 — invoke `Skill commit-commands:commit-push-pr` passing **the final title and description**. The skill must not re-ask for the content; if it does, answer with what was confirmed. Any push it does must be `git push -u origin HEAD` (own branch), never to the base branch.
208
+ **A draft (`unattended`, flow-core §2.1) — read this first: it replaces the invocation below.** Do
209
+ **not** invoke `commit-push-pr`, and do not use the plain CLI fallback below: both open a normal
210
+ MR/PR. Commit, `git push -u origin HEAD`, and create it with the forge CLI and its draft flag
211
+ (`gh pr create --draft`, `glab mr create --draft`, the equivalent elsewhere), assignee and squash as
212
+ below. The forge refusing a draft → `blocked` with its message; never retried without the flag.
213
+ Then record the URL, as the paragraph after the bullets says.
214
+
215
+ Otherwise, only here — with the content approved in §3 — invoke `Skill commit-commands:commit-push-pr` passing **the final title and description**. The skill must not re-ask for the content; if it does, answer with what was confirmed. Any push it does must be `git push -u origin HEAD` (own branch), never to the base branch.
176
216
 
177
217
  - `git.assignee` not empty → assign to that user. `git.squash` `true` → enable squash-before-merge.
178
218
  - `commit-push-pr` skill unavailable → commit and push manually and create the MR/PR with the `git.cli` CLI from `FLOW.md` — always with the content confirmed in §3.
@@ -465,7 +505,7 @@ Read `meta.json.conventions_candidates[]` (flow-core §8). **No entries with `st
465
505
 
466
506
  ### 6.4ter Defaults that were used (one line, no question)
467
507
 
468
- `meta.json.defaults_used[]` non-empty → **one line** in the Close: how many empty `FLOW.md` keys this
508
+ `meta.json.defaults_used[]` non-empty (keys prefixed `unattended:` not counted) → **one line** in the Close: how many empty `FLOW.md` keys this
469
509
  work resolved with their default, and that `/flow:doctor` lists which ones and prints the line to
470
510
  paste. Never a list here, and never a question: in `guided`/`auto` not asking is the contract
471
511
  (flow-core §0, §2), and in `manual` the phases already offered what they were allowed to offer.
@@ -23,6 +23,20 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
23
23
  - **Given** — an identifier in `tracker.prefix` format from `FLOW.md` → *ticket mode* (§2 reads it).
24
24
  - **Empty** — *ticket-less mode*: do **not** stop or demand a ticket. Draft a ticket from the conversation just held (§2.5), as `/flow:feat:ship` builds the MR/PR body from the work log. Ask for a one-liner only if there is no conversation to draft from.
25
25
 
26
+ **In `unattended`** (flow-core §2.1) this command asks nothing; each place it would ask resolves as
27
+ that table says. Here: a ticket is required — empty, or a tracker read that fails, ends the run
28
+ `blocked` (there is no conversation to draft from and nobody to paste it) · uncommitted changes or a
29
+ branch other than the main one (§5.1) → `blocked`: the runner owns the checkout · cross-repo scope
30
+ (§3.5) → only the repos the ticket names · below-XS (§4) → open the work · `git.worktree: ask`
31
+ (§5.0) → in place · §5.5's linked branch → skipped, it pushes a branch and nothing is pushed before
32
+ `ship` · the tracker transition (§6.5) → as `auto`. **Clarifying questions (§2.1 precedence, §3)
33
+ wait until the branch and the work folder exist** — create them (§5, §6) first, write the questions
34
+ into `01-context.md` under "Decisions clarified at start" as open, then question `clarify` with all
35
+ of them in one stop. Whoever picks the work up is asked them by the next phase, first (flow-core
36
+ §2.1).
37
+ A `blocked` before the folder exists still has the stop file: its path does not depend on the folder
38
+ (flow-core §2.1).
39
+
26
40
  ## 1. Pre-flight
27
41
 
28
42
  - Read the effective FLOW configuration per flow-core §0; neither base nor active overlay → each