flow-workflows 0.83.1 → 0.85.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 (92) hide show
  1. package/adapters/codex/CORE.md +115 -151
  2. package/adapters/codex/skills/flow-bug-fix/SKILL.md +2 -2
  3. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +3 -3
  4. package/adapters/codex/skills/flow-bug-postmortem/SKILL.md +2 -2
  5. package/adapters/codex/skills/flow-bug-review/SKILL.md +3 -3
  6. package/adapters/codex/skills/flow-bug-ship/SKILL.md +13 -14
  7. package/adapters/codex/skills/flow-bug-start/SKILL.md +16 -10
  8. package/adapters/codex/skills/flow-bug-validate/SKILL.md +3 -3
  9. package/adapters/codex/skills/flow-doctor/SKILL.md +8 -6
  10. package/adapters/codex/skills/flow-feat-build/SKILL.md +5 -5
  11. package/adapters/codex/skills/flow-feat-design/SKILL.md +3 -3
  12. package/adapters/codex/skills/flow-feat-plan/SKILL.md +1 -1
  13. package/adapters/codex/skills/flow-feat-review/SKILL.md +4 -5
  14. package/adapters/codex/skills/flow-feat-ship/SKILL.md +30 -30
  15. package/adapters/codex/skills/flow-feat-start/SKILL.md +19 -14
  16. package/adapters/codex/skills/flow-feat-validate/SKILL.md +3 -3
  17. package/adapters/codex/skills/flow-init/SKILL.md +2 -1
  18. package/adapters/codex/skills/flow-work-README/SKILL.md +1 -0
  19. package/adapters/codex/skills/flow-work-green/SKILL.md +26 -1
  20. package/adapters/codex/skills/flow-work-respond/SKILL.md +44 -1
  21. package/adapters/codex/skills/flow-work-resume/SKILL.md +3 -3
  22. package/adapters/codex/skills/flow-work-run/SKILL.md +70 -0
  23. package/adapters/gemini/CORE.md +115 -151
  24. package/adapters/gemini/commands/flow/bug/fix.toml +2 -2
  25. package/adapters/gemini/commands/flow/bug/investigate.toml +3 -3
  26. package/adapters/gemini/commands/flow/bug/postmortem.toml +2 -2
  27. package/adapters/gemini/commands/flow/bug/review.toml +3 -3
  28. package/adapters/gemini/commands/flow/bug/ship.toml +13 -14
  29. package/adapters/gemini/commands/flow/bug/start.toml +16 -10
  30. package/adapters/gemini/commands/flow/bug/validate.toml +3 -3
  31. package/adapters/gemini/commands/flow/doctor.toml +8 -6
  32. package/adapters/gemini/commands/flow/feat/build.toml +5 -5
  33. package/adapters/gemini/commands/flow/feat/design.toml +3 -3
  34. package/adapters/gemini/commands/flow/feat/plan.toml +1 -1
  35. package/adapters/gemini/commands/flow/feat/review.toml +4 -5
  36. package/adapters/gemini/commands/flow/feat/ship.toml +30 -30
  37. package/adapters/gemini/commands/flow/feat/start.toml +19 -14
  38. package/adapters/gemini/commands/flow/feat/validate.toml +3 -3
  39. package/adapters/gemini/commands/flow/init.toml +2 -1
  40. package/adapters/gemini/commands/flow/work/README.toml +1 -0
  41. package/adapters/gemini/commands/flow/work/green.toml +26 -1
  42. package/adapters/gemini/commands/flow/work/respond.toml +44 -1
  43. package/adapters/gemini/commands/flow/work/resume.toml +3 -3
  44. package/adapters/gemini/commands/flow/work/run.toml +67 -0
  45. package/adapters/hermes/CORE.md +115 -151
  46. package/adapters/hermes/skills/flow-bug-fix/SKILL.md +2 -2
  47. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +3 -3
  48. package/adapters/hermes/skills/flow-bug-postmortem/SKILL.md +2 -2
  49. package/adapters/hermes/skills/flow-bug-review/SKILL.md +3 -3
  50. package/adapters/hermes/skills/flow-bug-ship/SKILL.md +13 -14
  51. package/adapters/hermes/skills/flow-bug-start/SKILL.md +16 -10
  52. package/adapters/hermes/skills/flow-bug-validate/SKILL.md +3 -3
  53. package/adapters/hermes/skills/flow-doctor/SKILL.md +8 -6
  54. package/adapters/hermes/skills/flow-feat-build/SKILL.md +5 -5
  55. package/adapters/hermes/skills/flow-feat-design/SKILL.md +3 -3
  56. package/adapters/hermes/skills/flow-feat-plan/SKILL.md +1 -1
  57. package/adapters/hermes/skills/flow-feat-review/SKILL.md +4 -5
  58. package/adapters/hermes/skills/flow-feat-ship/SKILL.md +30 -30
  59. package/adapters/hermes/skills/flow-feat-start/SKILL.md +19 -14
  60. package/adapters/hermes/skills/flow-feat-validate/SKILL.md +3 -3
  61. package/adapters/hermes/skills/flow-init/SKILL.md +2 -1
  62. package/adapters/hermes/skills/flow-work-README/SKILL.md +1 -0
  63. package/adapters/hermes/skills/flow-work-green/SKILL.md +26 -1
  64. package/adapters/hermes/skills/flow-work-respond/SKILL.md +44 -1
  65. package/adapters/hermes/skills/flow-work-resume/SKILL.md +3 -3
  66. package/adapters/hermes/skills/flow-work-run/SKILL.md +70 -0
  67. package/adapters/opencode/CORE.md +115 -151
  68. package/adapters/opencode/commands/flow-bug-fix.md +2 -2
  69. package/adapters/opencode/commands/flow-bug-investigate.md +3 -3
  70. package/adapters/opencode/commands/flow-bug-postmortem.md +2 -2
  71. package/adapters/opencode/commands/flow-bug-review.md +3 -3
  72. package/adapters/opencode/commands/flow-bug-ship.md +13 -14
  73. package/adapters/opencode/commands/flow-bug-start.md +16 -10
  74. package/adapters/opencode/commands/flow-bug-validate.md +3 -3
  75. package/adapters/opencode/commands/flow-doctor.md +8 -6
  76. package/adapters/opencode/commands/flow-feat-build.md +5 -5
  77. package/adapters/opencode/commands/flow-feat-design.md +3 -3
  78. package/adapters/opencode/commands/flow-feat-plan.md +1 -1
  79. package/adapters/opencode/commands/flow-feat-review.md +4 -5
  80. package/adapters/opencode/commands/flow-feat-ship.md +30 -30
  81. package/adapters/opencode/commands/flow-feat-start.md +19 -14
  82. package/adapters/opencode/commands/flow-feat-validate.md +3 -3
  83. package/adapters/opencode/commands/flow-init.md +2 -1
  84. package/adapters/opencode/commands/flow-work-README.md +1 -0
  85. package/adapters/opencode/commands/flow-work-green.md +26 -1
  86. package/adapters/opencode/commands/flow-work-respond.md +44 -1
  87. package/adapters/opencode/commands/flow-work-resume.md +3 -3
  88. package/adapters/opencode/commands/flow-work-run.md +68 -0
  89. package/package.json +1 -1
  90. package/plugins/flow/.claude-plugin/plugin.json +1 -1
  91. package/plugins/flow/CHANGELOG.md +42 -0
  92. package/plugins/flow/examples/FLOW.template.md +8 -9
@@ -26,7 +26,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
26
26
 
27
27
  **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.
28
28
 
29
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
29
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
30
30
 
31
31
  - Read `meta.json` and `00-summary.md`; open in full only `03-investigation.md` (§3 areas with similar risk, and the minimal reproduction) — the testing agent reads it and `04-fix.md` itself. (flow-core §5)
32
32
  - Require `fix` in `phases_done`.
@@ -43,8 +43,8 @@ Then:
43
43
  1. Run only that test with `quality.test_one` from FLOW.md; it must pass.
44
44
  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).
45
45
  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 without an answer — a schema difference to apply is question
46
- `migration`, flow-core §2.1; a runner's *Apply it* relaunches this phase, this site takes the answer
47
- the pickup applied and runs it, and `05-validation.md` names that answer beside the migration).
46
+ `migration`, flow-core §2.1; the orchestrator's *Apply it* relaunches this phase, this site takes the
47
+ answer just applied and runs it, and `05-validation.md` names that answer beside the migration).
48
48
  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).
49
49
 
50
50
  ## 2.5 Reproduce the original symptom against the running app
@@ -170,12 +170,14 @@ base branch resolvable — is §2 below; flag the key here, check the world ther
170
170
  echo the mode and remind that the hard gates stop and ask in `manual`/`guided`/`auto` and that `guided`/`auto`
171
171
  never ask about the flow's own mechanics or anything already decided (both lists: `flow:flow-core`
172
172
  skill §2). Unrecognized value → flag, `manual` assumed. `unattended` → say what it does instead of
173
- the gates (flow-core §2.1): nothing is asked, questions end the run in `.claude/work/stop.json` for a runner, whose answer in `.claude/work/answer.json` lets the relaunched run continue,
174
- and `ship` is a draft only when `autonomy.unattended_ship` is `draft` — echo that value, or that it
175
- is empty and ship will stop on a question. Say which file set it: every session that reads that file
176
- — a person's included, when they share the checkout and the harness — stops asking too, so it
177
- belongs in a FLOW file only the runner's environment has. `unattended_ship` set with any other mode → note it is ignored; a
178
- value other than `draft`/`stop` → flag, `stop` assumed.
173
+ the gates (flow-core §2.1): nothing is asked, and every run ends with one order to the
174
+ orchestrator command — `ask`, `publish`, `blocked` or `done`; flow pushes nothing and opens no
175
+ MR/PR. Echo `autonomy.orchestrator_cmd` and the file it came from, and whether its first word
176
+ resolves on `PATH` (`command -v`) — **empty → flag it as an error**: no phase runs in
177
+ `unattended` without it. Say which file set the mode: every session that reads that file — a
178
+ person's included, when they share the checkout and the harness — stops asking too, so it belongs
179
+ in a FLOW file only the orchestrator's environment has. `orchestrator_cmd` set with any other mode
180
+ → note it is ignored.
179
181
 
180
182
  ## 2. Checks
181
183
 
@@ -22,7 +22,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
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
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
26
 
27
27
  Implementation phase. Code is written here.
28
28
 
@@ -33,9 +33,9 @@ Implementation phase. Code is written here.
33
33
  - `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).
34
34
  - **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`".)
35
35
  - **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`.
36
- - All `merged` → warn: feature is done, nothing to build (in `unattended`: `done`, `detail` saying so).
37
- - 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.
38
- - **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.
36
+ - All `merged` → warn: feature is done, nothing to build (in `unattended`: `done`, the summary saying so).
37
+ - 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 reason naming it.
38
+ - **Train/stacked** (never in `unattended`: there the startable MR/PR gets a **new branch of its own** from `meta.json.base` (empty → `git.default_base`) — the base the orchestrator gave the ticket, an umbrella branch once a split task's first part is merged. That branch may exist only on the remote, or locally without the part that just merged: `git fetch origin <base>` when a remote is configured (best-effort — a fetch the container cannot make is not an error), then start from `origin/<base>` when it resolves, the local `<base>` otherwise. Named `<ticket>-<slug>-<n>` and created as `/flow-feat-start §5.2` (in place) or `§5.4` (worktree) says — `git.worktree: always` → worktree, `off`/empty/`ask` → in place; that base is 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.
39
39
 
40
40
  ## 2. Business brief (before typing)
41
41
 
@@ -69,7 +69,7 @@ In `unattended` (flow-core §2.1) nobody is there to answer: write the brief, ma
69
69
  `recorded (unattended)` under its heading, record the site in `meta.json.defaults_used[]`, and build.
70
70
  The gate's purpose moves to the draft MR/PR, whose body carries the brief for the person who reads it.
71
71
  **A schema change or migration is still a question** (`migration`): before writing the first line
72
- of one → stop file, end the run. A person continues from there, or a runner's answer re-enters here
72
+ of one → the question stop, end the run. The orchestrator's answer re-enters here
73
73
  (flow-core §2.1): the brief, the contracts and the plan are already written — keep them — and the
74
74
  MR/PR is the one already `in_progress`, not a new pick. *Write it and continue* → the first unticked
75
75
  step, the migration included · *Change the design first* → `blocked`. A plan step marked approved
@@ -22,7 +22,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
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
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
26
 
27
27
  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.
28
28
 
@@ -30,8 +30,8 @@ Technical design phase. **Still no production code is written.** Opens the optio
30
30
  `auto` · questions the options surfaced (§1.5.5) or an acceptance criterion that is ambiguous (§9) →
31
31
  question `clarify` · a size that no longer fits (§1.5.5, §7) → record the new size · a `high`
32
32
  challenge with no response (§6) → question `design_challenge`, the findings and their options in the
33
- stop file · the design review (§9) → recorded as accepted, as in `auto`. Each of these stops comes
34
- after `03-design.md` holds what the phase computed, and a runner's answer re-enters where flow-core
33
+ question · the design review (§9) → recorded as accepted, as in `auto`. Each of these stops comes
34
+ after `03-design.md` holds what the phase computed, and the orchestrator's answer re-enters where flow-core
35
35
  §2.1's table says: the approaches are not generated again, the design is not written again — the
36
36
  answer goes into its section, and the phase continues from the choice (§1.5.5), from §9, or from §7
37
37
  after writing each challenge's Response.
@@ -22,7 +22,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
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
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
26
 
27
27
  Delivery planning phase. **No code is written.** Splits the feature into MRs/PRs that can each live on the main branch even if the subsequent ones never land.
28
28
 
@@ -22,7 +22,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
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
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
26
 
27
27
  Mandatory review phase. **`/flow-feat-ship` cannot run without passing through here and resolving blockers.**
28
28
 
@@ -392,10 +392,9 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
392
392
  - 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.
393
393
  - **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`.
394
394
  - **In `unattended`** (flow-core §2.1), blockers or unresolved high-severity findings are question
395
- `high_findings`: the surviving findings in `question`, one line each, and the run ends — after
396
- §8 has written them to `06-review.md` and the round's own fixes are committed. A person picks it
397
- up in a session of their own, where they are fixed and reviewed again; or a runner answers
398
- (flow-core §2.1). *Accept and go on* → this command re-enters at this Close: no reader is
395
+ `high_findings`: the surviving findings in the question, one line each, and the run ends — after
396
+ §8 has written them to `06-review.md` and the round's own fixes are committed. The orchestrator brings
397
+ the answer back (flow-core §2.1). *Accept and go on* → this command re-enters at this Close: no reader is
399
398
  launched again, the findings are recorded under "Answered (unattended)" as accepted by that
400
399
  answer, `reviewed_sha` = the candidate, and the phase advances and chains; `ship` lists them in
401
400
  the body. *Fix them* → this command re-enters at this Close too: it writes each finding as an
@@ -22,22 +22,23 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
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
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
26
 
27
27
  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.
28
28
 
29
- **In `unattended`** (flow-core §2.1) this command asks nothing, and it is the only place that run
30
- pushes. Each place it would ask:
31
-
32
- - **The MR/PR itself (§3–§4)** — `autonomy.unattended_ship: draft` → skip the confirmation and
33
- create it **as draft** with the §2 content (§4.1 says how); never merge it, never mark it ready.
34
- The body gains one line saying an unattended run opened it and nobody confirmed its brief.
35
- Empty or `stop` → nothing is pushed: question `ship`, the §3 preview as the question, and the run
36
- ends; a person ships it from a session of their own. Pre-deploy SQL in the branch → question
37
- `migration`, whatever `unattended_ship` says. A runner's answer (flow-core §2.1) relaunches this
38
- command from its pre-flight, since the draft lives only in context, and the site it was for takes
39
- the answer the pickup applied — *Create it as draft* creates the draft as `draft` would,
40
- *The SQL is complete — ship it* goes on to the MR/PR.
29
+ **In `unattended`** (flow-core §2.1) this command asks nothing, pushes nothing and opens nothing:
30
+ it hands the finished MR/PR to the orchestrator, which pushes the branch and opens the draft. Each
31
+ place it would ask:
32
+
33
+ - **The MR/PR itself (§3–§4)** — no confirmation and no forge. §2's title and description are
34
+ written to `publish-title.md` and `publish-body.md` in the work folder; the body gains one line
35
+ saying an unattended run prepared it and nobody confirmed its brief. §4.0's branch check still
36
+ runs (never the base; the name starts with `<ticket>-`) — and an upstream on the base is unset
37
+ (`git branch --unset-upstream`), with no push after it. §4.1–§4.3 do not: no push, no
38
+ pre-deploy thread, no performance comment — those numbers go in the body. Pre-deploy SQL in the
39
+ branch → question `migration` first; its answer relaunches this command from its pre-flight,
40
+ since the draft lives only in context, and the site takes the answer just applied
41
+ (*The SQL is complete — ship it*) and goes on.
41
42
  - **The §1 tree check** — `reviewed_sha` or `validated_sha` behind `HEAD` with more than tests →
42
43
  re-run what is behind, **once per MR/PR**: the review on the delta, then `validate`. First record
43
44
  `{ "key": "unattended:ship-recheck", "default": "mr <n>", "phase": "ship" }` in
@@ -45,21 +46,27 @@ pushes. Each place it would ask:
45
46
  MR/PR's `n` already there → `blocked`, whatever the sha. Tracked changes this run's own phases left uncommitted → commit them
46
47
  as WIP first (a WIP commit is `auto`'s to make) and check again · **blocking TODO/FIXME (§1)** →
47
48
  continue and list them in the body.
48
- - **Posting anything else** — the performance comment (§4.3), a contract handoff (§6.3) — → not
49
- posted; the numbers go in the body, the handoff stays `pending`.
49
+ - **Posting anything else** — a contract handoff (§6.3) — → not posted; the handoff stays
50
+ `pending`.
50
51
  - **The offers and surveys (§5, §5.1, §5.2, §5.5, §6.4, §6.4bis)** → `Later`; nothing written outside
51
52
  the work folder.
52
- - **"Was it merged?" (§6.1)** → not merged; `meta.json` as §6.1 says for an unmerged MR/PR. **The
53
- parent merged first (§6.2.1)** → blocked, never force-push. **Train continuation (§6.2)** → not
54
- started: one MR/PR per unattended run.
55
- - **At Close** write the stop file with `reason: "done"`, `mr_url`, and — with `mrs` still pending —
56
- `detail` naming the next MR/PR and what it waits on (its `depends_on` merged, then
57
- `/flow-feat-build`). It is the last thing the run does.
53
+ - **"Was it merged?" (§6.1)** → not merged: the entry stays `in_progress` (a work with no `mrs`
54
+ keeps `phase = "ship"`) until `publish` succeeds, below. **The parent merged first (§6.2.1)** → blocked, never
55
+ force-push. **Train continuation (§6.2)** → not started: one MR/PR per unattended run.
56
+ - **At Close**, after `meta.json` and `00-summary.md` are written: commit what is left outside
57
+ `.claude/work/` so the tree is clean, then the run's closing order — `<cmd> publish --title-file
58
+ <work>/publish-title.md --body-file <work>/publish-body.md`, plus `--part <n> --of <N>` when
59
+ `meta.json.mrs` has more than one entry (`n` this MR/PR's, `N` the number of entries). Exit 0 →
60
+ this MR/PR's `mrs[]` entry gets `status: "published"` (a work with no `mrs`: `meta.json.published:
61
+ true`) — what `/flow-work-run` turns into `merged` when the orchestrator relaunches with
62
+ `why = merged` — and nothing else runs. The summary and the panel written before it say the work
63
+ was *handed to the orchestrator*, never that it was published. Exit ≠ 0 → nothing
64
+ is marked; its stderr goes in the stop header (flow-core §2.1).
58
65
 
59
66
  **In every mode**, criteria `07-validation.md` marks `not-verified-unattended` go into the body under
60
67
  `## Not verified — needs a human`, with what to do for each — and so do the tests the suite left red
61
68
  because they also fail on the base (`unattended:validate-red-base`): each name, and the base sha
62
- where it failed too — and the review findings a runner's answer accepted unfixed
69
+ where it failed too — and the review findings an orchestrator's answer accepted unfixed
63
70
  (`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
64
71
  any other, and the person reading it is the check the run could not do.
65
72
 
@@ -215,14 +222,7 @@ git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null # must NOT be
215
222
  - Train mode (`stacked_on` ≠ null) → the MR/PR must target that parent branch, not the main base.
216
223
 
217
224
  ### 4.1 Create MR/PR
218
- **A draft (`unattended`, flow-core §2.1) — read this first: it replaces the invocation below.** Do
219
- **not** invoke `commit-push-pr`, and do not use the plain CLI fallback below: both open a normal
220
- MR/PR. Commit, `git push -u origin HEAD`, and create it with the forge CLI and its draft flag
221
- (`gh pr create --draft`, `glab mr create --draft`, the equivalent elsewhere), assignee and squash as
222
- below. The forge refusing a draft → `blocked` with its message; never retried without the flag.
223
- Then record the URL, as the paragraph after the bullets says.
224
-
225
- 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.
225
+ 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.
226
226
 
227
227
  - `git.assignee` not empty → assign to that user. `git.squash` `true` → enable squash-before-merge.
228
228
  - `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.
@@ -22,7 +22,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
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
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
26
 
27
27
  `$ARGUMENTS` is **optional**:
28
28
 
@@ -30,19 +30,23 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
30
30
  - **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.
31
31
 
32
32
  **In `unattended`** (flow-core §2.1) this command asks nothing; each place it would ask resolves as
33
- that table says. Here: a ticket is required — empty, or a tracker read that fails, ends the run
34
- `blocked` (there is no conversation to draft from and nobody to paste it) · uncommitted changes or a
35
- branch other than the main one (§5.1) → `blocked`: the runner owns the checkout · cross-repo scope
36
- (§3.5) → only the repos the ticket names · below-XS (§4) → open the work · `git.worktree: ask`
37
- (§5.0) → in place · §5.5's linked branch → skipped, it pushes a branch and nothing is pushed before
38
- `ship` · the tracker transition (§6.5) → as `auto`. **Clarifying questions (§2.1 precedence, §3)
39
- wait until the branch and the work folder exist** — create them (§5, §6) first, write the questions
40
- into `01-context.md` under "Decisions clarified at start" as open, then question `clarify` with all
41
- of them in one stop. Whoever picks the work up is asked them by the next phase, first (flow-core
42
- §2.1). That next phase is the stop's `resume` — the one §4 routes this size to — so a runner's answer
43
- lands there and `start` is never relaunched.
44
- A `blocked` before the folder exists still has the stop file: its path does not depend on the folder
45
- (flow-core §2.1).
33
+ that table says. Here: **the ticket is `<cmd> ticket --json`**, not the tracker — `number` is the
34
+ identifier, `title` and `body` replace §2's tracker read, and its `comments` (already limited to
35
+ authorised authors) are the whole thread of §2.1, read as that section says; `$ARGUMENTS` that
36
+ disagrees with `number` is ignored and named. The order failing or empty → `blocked` (there is no
37
+ conversation to draft from and nobody to paste it) · **the base is the ticket's `base`** (empty →
38
+ `git.default_base`), recorded as `meta.json.base` — the branch of §5.2 starts there, never from
39
+ where the checkout stands, and §5.1 asks nothing · uncommitted changes, or a checkout not on that
40
+ base → `blocked`: the orchestrator owns the checkout · the branch is named `<number>-<slug>`
41
+ whatever `git.branch_pattern` says — the orchestrator recognises the work branch by that prefix ·
42
+ cross-repo scope (§3.5) → only the repos the ticket names · below-XS (§4) → open the work ·
43
+ `git.worktree: ask` (§5.0) → in place · §5.5's linked branch and the tracker transition (§6.5) →
44
+ skipped: nothing outside the checkout is written in this mode. **Clarifying questions (§2.1
45
+ precedence, §3) wait until the branch and the work folder exist** — create them (§5, §6) first,
46
+ write the questions into `01-context.md` under "Decisions clarified at start" as open, then question
47
+ `clarify` with all of them in one stop. Its `resume` is the next phase §4 routes this size to, so
48
+ the answer lands there and `start` is never relaunched. A `blocked` before the folder exists writes
49
+ its reason file in a `mktemp -d` directory (flow-core §2.1).
46
50
 
47
51
  ## 1. Pre-flight
48
52
 
@@ -251,6 +255,7 @@ Create the work directory per §1: `.claude/work/<TICKET>-<slug>/` (ticket mode)
251
255
  ```
252
256
 
253
257
  - Ticket-less (§2.5) → `draft_from_conversation: true`, `tracker_issue` = created issue id/url (or `null` if local-only). Ticket mode → defaults above.
258
+ - `base` — `unattended` only: the ticket's `base` (the branch every MR/PR of this work starts from and targets; `/flow-work-run` refreshes it on `merged`). Omit it in every other mode.
254
259
  - `related_repos` from §3.5 — one `{ "repo": "<name>", "scope": "<one line>", "status": "pending", "contract_handoff": "pending" | "none" }` per *other* repo; `[]` for a single-repo task.
255
260
  - **This work *is* an accepted follow-up** (the ticket came from another work's `followups[]`, flow-core §7) → set `origin: { "work": "<originating work dir>", "followup": "F<n>" }`, carry that entry's recorded `why` into `01-context.md` verbatim instead of re-deriving it, and set the originating entry to `in_progress` with `work` naming this folder. Not a follow-up → omit `origin` entirely.
256
261
 
@@ -22,7 +22,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
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
- **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the `running` write, the pending question and the runner's answer are all in it, and a phase that reads only part of it skips them.
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
26
 
27
27
  Verify the feature is complete: test coverage, edge cases, performance, regressions.
28
28
 
@@ -166,7 +166,7 @@ If the feature has UI or critical flows:
166
166
  - Payments → test with the test cards or credentials the provider publishes for its sandbox (and the harness skill for that provider, if installed).
167
167
  - Workers/queues → make sure no jobs are stuck in dead-letter. Stuck jobs that are not yours: do not touch them here.
168
168
  - Migrations → run `quality.db_update` from `FLOW.md` (if defined; in `unattended`, never without an answer — a migration to apply is question `migration`, flow-core
169
- §2.1; a runner's *Apply it* relaunches this phase from §1, this site takes the answer the pickup
169
+ §2.1; the orchestrator's *Apply it* relaunches this phase from §1, this site takes the answer just
170
170
  applied and runs it, and §6 names that answer beside the migration under "Edge cases verified"); verify no unexpected schema difference with the comparison command the project uses.
171
171
 
172
172
  ## 6. Output
@@ -228,7 +228,7 @@ Write `.claude/work/<TICKET>/07-validation.md`:
228
228
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
229
229
  - **Autonomy handoff — this one stops in every mode, `auto` included.** `ship` pushes and opens the MR/PR: a hard gate in every mode, so do **not** chain into it. Stop here and propose `/flow-feat-ship` with a single `AskUserQuestion` (recommended option by default), invoking it only when the user confirms. This is the deliberate end of a run in `auto`.
230
230
  **In `unattended`** (flow-core §2.1): the phase advanced → chain into `/flow-feat-ship`, which
231
- decides from `autonomy.unattended_ship` between a draft MR/PR and a question. It did not advance
231
+ hands the MR/PR to the orchestrator with `publish`. It did not advance
232
232
  (red suite, a criterion `unproven`) → `blocked`, naming what failed; never chain. A red suite
233
233
  advances only under the base exception of flow-core §2.1: run the failing tests on the base, and
234
234
  write each name, its result there and the base sha under "Suite results" in `07-validation.md`.
@@ -101,7 +101,8 @@ review, not a questionnaire. Then, and only then, five questions:
101
101
  `auto` — also resolves the rest with recorded defaults. Explain the hard gates that stop in these
102
102
  three modes and the list of what `guided`/`auto` never ask (both in the `~/.claude/flow/CORE.hermes.md` §2),
103
103
  so `auto` runs without a stop between the brief and `ship`. Do not offer `unattended`: it is for a
104
- runner, written by hand where only the runner reads it. Editable any time. Empty = `manual`.
104
+ run an orchestrator launches, written by hand — with `autonomy.orchestrator_cmd` — where only that
105
+ run reads it. Editable any time. Empty = `manual`.
105
106
  4. **The quality commands as one block** (`quality.test`, `test_one`, `static_analysis`, `style_fix`,
106
107
  `db_update`, `db_diff`) — confirm or edit what §2 found, all in one question, each may stay empty
107
108
  (= auto-discover at the moment it is needed). Several suites chain into `test` with `&&`.
@@ -248,6 +248,7 @@ Two signals arrive on an open MR/PR, each with its own cross-cutting loop (feat
248
248
  resume; otherwise status.
249
249
  - `/flow-work-daily [question]` — the **work assistant** (daily standup), read-only. **Local** (`.claude/work/` + git) + **forge** (open MRs/PRs, reviews awaiting you, red CI, unmergeable, unresolved threads via `git.cli`) + **tracker** (assigned tickets, priority changes via `tracker.tool`); where they cross, concrete commands (`/flow-feat-start`, `/flow-work-green`, `/flow-work-respond`). No argument → *yesterday · today · blockers*; a question → just that. External sources best-effort, never blocking; the only write is a "last seen" marker, like `/flow-news`.
250
250
  - `/flow-work-status` — all works in `.claude/work/`, current phase, divergence with git.
251
+ - `/flow-work-run [ticket]` — the **entry an orchestrator launches** for an `unattended` run: asks it `why` (start · answer · merged · review · pipeline), routes to the phase that answers it, and makes no decision of its own. Refuses to run in any other mode.
251
252
  - `/flow-work-resume` — detects the branch, reads `meta.json`, recaps, suggests the next step. **Re-reads the ticket's comment thread** (§2.5), reports only what is new since `01-context.md`, appends it to the artifact; never amends the design on its own.
252
253
  - `/flow-work-try <branch>` / `/flow-work-try --back` — point the main checkout at a branch to test it here, then return; re-syncs per `git.worktree_resync`. Resolves the work behind the branch and, once the environment is up, **prints the manual test plan already written** (the `needs-manual`/`unproven` criteria, or the acceptance criteria when `validate` has not run) and offers to collect Pass/Fail/Blocked into the validation artifact. No work behind the branch → the plain switch, as before.
253
254
  - `/flow-work-clean [--dry-run]` — **periodic sweep** of finished work's residue: worktree, local branch, `.claude/work/` folder (intermediate train MR/PRs never set `phase: done`, so the `ship`/`abandon` prompt never fires). Verdict per branch from **the forge** with local fallbacks, including patch-equivalence for **squash merges** (`git branch --merged` misses them); acts only on `merged`/`empty`. `unknown` never a candidate; dirty and unpushed protected; work folders **archived, never deleted**; remote never touched. **`autonomy.mode` does not authorize deletion**: `auto` confirms the list too. `--purge-archive <N>d`: separate opt-in pass over `_archive/`, only folders already committed to git.
@@ -36,13 +36,38 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
36
36
 
37
37
  **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.
38
38
 
39
- **Autonomy.** Modes as in flow-core §2; `guided`/`auto` record their choices in `09-ci.md` (e.g. a pure formatter auto-fix). **Hard gates — ALWAYS stop and ask, in every mode, no exceptions:**
39
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
40
+
41
+ **Autonomy.** Modes as in flow-core §2; `guided`/`auto` record their choices in `09-ci.md` (e.g. a pure formatter auto-fix); `unattended` resolves gates 1–4 as its paragraph below says. **Hard gates — ALWAYS stop and ask, in `manual`, `guided` and `auto`, no exceptions:**
40
42
  1. **Any push** (§6).
41
43
  2. Creating/switching a branch, or DB schema changes/migrations, if a fix requires them.
42
44
  3. **Re-triggering a pipeline or job on the remote** (CI resources; outward action).
43
45
  4. **Integrating the base branch** — any `git merge`/`git rebase` of `git.default_base` into the branch, and any history rewrite or force-push it implies (§5.C).
44
46
  5. **Green-washing — NEVER, in any mode:** no rerun of a failed check hoping it passes; never disable, skip, `@skip`/`xit`, loosen a threshold, or delete a test/lint rule to force green; never resolve a conflict by blindly taking one side (`--ours`/`--theirs`, `checkout --theirs`, discarding the base's changes) — resolve by understanding both sides.
45
47
 
48
+ **In `unattended`** (flow-core §2.1) — launched by `/flow-work-run` on `why = pipeline` — this
49
+ command asks nothing and never touches the forge. Gate 5 holds exactly as written; the others
50
+ resolve this way:
51
+
52
+ - **§1–§2** — no MR/PR is resolved and no forge is read: the failures are `<cmd> events --json` →
53
+ `{"sha", "failed": [{name, conclusion, url, log_tail}]}`, and `log_tail` is the evidence. The order
54
+ failing → `blocked`; `failed` empty → `done`, the summary saying so. `sha` not `HEAD` → `blocked`:
55
+ the result is about another commit, and fixing it here would be fixing a guess.
56
+ - **§3** — triage as written, recorded in `09-ci.md`. **K** (flaky / infra) → `blocked` with the
57
+ evidence: the run has no rerun order, and the orchestrator owns reruns and the red-round limit.
58
+ **C** (conflict, behind base) and anything needing a rebase or force-push → `blocked`: the
59
+ orchestrator brings the base in. A **human** blocker → `blocked`, naming who. **S** → fixed within
60
+ scope, otherwise `blocked` with the justification.
61
+ - **§5** — fixes and the local verification as written; a local gate it cannot get green →
62
+ `blocked`. A fix adding behaviour gets its brief recorded, not asked; a fix that needs a schema
63
+ change, a design invalidation that is more than a tweak, or a high-severity finding from the
64
+ review gate the round cannot clear → `blocked` (flow-core §2.1). Commits as `auto`.
65
+ - **§7 before the closing order** — logged as written; offers are `Later`; re-posting the
66
+ performance comment is not done — a changed number goes into `publish-body.md`.
67
+ - **§6** — no push, no rerun, no watch. The closing order, after the WIP commit (flow-core §2.1): `publish` with the
68
+ work's `publish-title.md` / `publish-body.md` and the `--part/--of` `/flow-feat-ship` passed; the
69
+ orchestrator pushes and the pipeline runs again.
70
+
46
71
  ## 1. Pre-flight — locate the work and the MR/PR
47
72
 
48
73
  - Identify the current branch and its work folder `.claude/work/<TICKET>/` (via `meta.json`, matching `branch`). Read `meta.json` and `00-summary.md`; open in full only `09-ci.md` (previous rounds) and, when §3/§5.C need the recorded "why", `03-design.md`, `05-implementation.md`/`04-fix.md`. (flow-core §5)
@@ -32,7 +32,9 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
32
32
 
33
33
  **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.
34
34
 
35
- **Autonomy.** Modes as in flow-core §2 (`autonomy.mode`: `manual` | `guided` | `auto`; empty = `manual`); `guided`/`auto` record their choices in `08-feedback.md`. **Hard gates — ALWAYS stop and ask, in every mode, no exceptions:**
35
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
36
+
37
+ **Autonomy.** Modes as in flow-core §2 (`autonomy.mode`: `manual` | `guided` | `auto`; empty = `manual`); `guided`/`auto` record their choices in `08-feedback.md`; `unattended` resolves the gates as its paragraph below says. **Hard gates — ALWAYS stop and ask, in `manual`, `guided` and `auto`, no exceptions:**
36
38
  1. **Posting any comment/reply** to the MR/PR (§7).
37
39
  2. **Any push** (§6.2).
38
40
  3. Creating/switching a branch, or DB schema changes/migrations, when an agreed change requires them.
@@ -40,6 +42,47 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
40
42
 
41
43
  Everything else: take the sensible default and record it; ask only when irreversible/costly, ambiguous and not settled by ticket + design + knowledge search, or a hard gate.
42
44
 
45
+ **In `unattended`** (flow-core §2.1) — launched by `/flow-work-run` on `why = review` — this command
46
+ asks nothing and never touches the forge: the threads come from the orchestrator, the replies go
47
+ back through it, and the hard gates above resolve this way:
48
+
49
+ - **§1** — no MR/PR is resolved: the work is the one `/flow-work-run` found, on the branch the
50
+ orchestrator checked out. A round over the ceiling → `blocked`, its reason being the (a)(b)(c)
51
+ hand-back of §1.
52
+ - **§2** — the threads are `<cmd> events --json` → `comments[]`, grouped by `thread` (each comment:
53
+ `kind`, `id`, `author`, `at`, `body`, `url`, and `path`/`line` when it has them). The untrusted-input
54
+ rule stands unchanged. The machine-state check is skipped: the orchestrator relaunches for the
55
+ pipeline separately. The order failing → `blocked`; no comments → `done`, the summary saying so.
56
+ - **§3–§4** — triage and stances as `auto` decides them, the table and the drafts written to
57
+ `08-feedback.md` instead of shown. A thread only a person can settle — a product decision, or a
58
+ `D` the recorded rationale and the code do not decide — goes into **one** question for all of them,
59
+ asked **before anything is replied or committed**: `ask --gate decision`, free text `T<n>: <answer>`
60
+ per thread, with `pending.phase: "respond"`, `pending.resume: "work:respond"` (never the work's
61
+ `meta.json.phase`) and `pending.resume_at: "end of §4"`, and the run ends there. The answer is
62
+ written into this round's section of `08-feedback.md`, and the relaunch re-enters at the end of
63
+ §4, reading the threads and stances from that file rather than from `events`. **At the end of §4
64
+ — on a first run and on that re-entry alike** — a reply that would repeat an earlier round's
65
+ (§8's repeated-answer rule) is caught before anything is posted → `blocked`, naming the thread.
66
+ `§4.G` measures as `/flow-work-query` does unattended (schema-only, never a database it creates).
67
+ - **§5–§6** — a change adding behaviour gets its brief recorded (`recorded (unattended)`), not
68
+ asked. A design invalidation that is more than a tweak, or an agreed change that needs a schema
69
+ change → `blocked` (flow-core §2.1): the run does not redesign. Commits as `auto`. §6.1 runs
70
+ whole; a high-severity finding the round cannot clear → `blocked` with the findings. **§6.2 does
71
+ not run**: nothing is pushed — the orchestrator pushes on `publish`.
72
+ - **§8 before §7** — §8 completes the round's section §3–§4 opened in `08-feedback.md` (never a
73
+ second one) and counts `respond_rounds`, before any reply and before any `blocked` from here on.
74
+ A `blocked` earlier than this point (the repeated answer, §6.1) also counts the round first. The agent-lessons offer is `Later`; re-posting the performance comment is not
75
+ done — a changed number goes into `publish-body.md` instead.
76
+ - **§7** — one `<cmd> reply --thread <thread> --body-file <work>/reply-<thread>.md` per answered
77
+ thread, the reply naming the commit that changes the code. **Never resolve.** A `reply` that exits
78
+ ≠ 0 is recorded in `08-feedback.md` and the remaining replies still go out.
79
+ - **The one closing order**, after the WIP commit (flow-core §2.1): code changed this round →
80
+ `publish` with the work's `publish-title.md` / `publish-body.md` (updated when the round changed
81
+ what they say, and naming any thread whose reply failed) and the `--part/--of` `/flow-feat-ship`
82
+ passed — the commits the replies name must reach the branch; no code changed and every reply went
83
+ out → `done`, the summary listing the threads answered; no code changed and a reply failed →
84
+ `blocked`, naming those threads.
85
+
43
86
  ## 1. Pre-flight — locate the work and the MR/PR
44
87
 
45
88
  - Identify the current branch and its work folder `.claude/work/<TICKET>/` (the `meta.json` whose `branch` matches). Read `meta.json` and `00-summary.md`; open in full only `08-feedback.md` (spent rounds, below) and, in §3, the rationale artifacts a thread needs (`03-design.md`, `05-implementation.md`/`04-fix.md`). (flow-core §5)
@@ -23,7 +23,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, auto
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
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).
26
+ unattended run left with a question pending at its orchestrator (flow-core §2.1).
27
27
 
28
28
  **In `unattended`** this command asks nothing: recap, name the next step, end. It is how a person
29
29
  reads where the run got to, not how the run continues.
@@ -49,7 +49,7 @@ Last updated: <updated_at>
49
49
  Notes: <meta.notes>
50
50
  Cross-repo: <meta.related_repos entries not "done", as "repo: scope"; or "—">
51
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, its `id` and `resume` — and, when `answer_rejected` is set, which check the runner's answer failed (`answer_rejected`) · `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)
52
+ Unattended: <from `meta.json.pending` when it is set: the gate, `resume` and the question file's first line — the orchestrator holds the question and will relaunch with its answer> (line only when `pending` is set)
53
53
  ```
54
54
 
55
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.
@@ -91,7 +91,7 @@ With what is new (there is already work on disk):
91
91
 
92
92
  ## 4. Next step
93
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.
94
+ - An `Unattended:` line → the question is the orchestrator's to bring back: say so, and that answering it here instead means clearing `meta.json.pending` and continuing in this session's mode; the next step itself comes from `phase` as always.
95
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`.
96
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.
97
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.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: flow-work-run
3
+ description: "The one entry an orchestrator launches for an unattended run — asks it why it was launched and routes to the phase that answers it"
4
+ ---
5
+
6
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/commands/work/run.md — do not edit; change the plugin file and run the script. -->
7
+
8
+ # `/flow-work-run`
9
+
10
+ > **hermes adapter — how the Claude Code primitives named below map here.**
11
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
12
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `delegate_task`, which creates the child on the spot from the `goal` and `context` you give it: the name in `agents.<role>` in `FLOW.md` is a role to state in that prompt, not an agent to declare anywhere; empty → do it in this context.
13
+ > - Parallel fan-out → several `delegate_task` calls in one response, capped at `agents.fanout_max` (empty → 4) and, above that, by `delegation.max_concurrent_children` in `config.yaml` (default 10); `agents.fanout_tool` is Claude Code-only, ignore it.
14
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → Hermes schedules itself: the `cronjob` tool, or `/cron add "every 30m" "<this command>"`. Each firing is a fresh session with no history, so the state still lives in `monitor.md` and the scheduled text must stand alone; retiring the job from inside a firing needs `cron.allow_agent_scheduling: true`.
15
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
16
+ > - `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`).
17
+ > - `/model <value>` → Hermes's own `/model`; a subagent's model is `delegation.model` in `config.yaml`, one value for every child of a round.
18
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared under `mcp_servers` in `~/.hermes/config.yaml` (see `config.snippet.yaml`).
19
+ > - `$ARGUMENTS` → what the user typed after the skill name: Hermes takes everything from the first non-skill token on as the instruction.
20
+
21
+ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, 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).**
22
+
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
+
25
+ **In `unattended`, before this phase's first step, read flow-core §2.1 whole — from its heading to the next section, unless it is already in your context whole; having read parts of it does not count** — the orchestrator command, the question stop and the way its answer comes back are all in it, and a phase that reads only part of it skips them.
26
+
27
+ The command an orchestrator puts in its launch line, for every run of every ticket. It does no work
28
+ of its own: it asks the orchestrator why this run exists and hands the run to the phase that
29
+ answers it. `$ARGUMENTS` is the ticket, optional — the orchestrator's `ticket` order is the source
30
+ of truth, and an argument that disagrees with it is ignored and named in the log.
31
+
32
+ ## 1. Pre-flight
33
+
34
+ - Effective FLOW configuration per flow-core §0. `autonomy.mode` is not `unattended` → say this
35
+ command only routes unattended runs, name the mode and where it came from, and end: in any
36
+ other mode a person is the router (`/flow-next`).
37
+ - `autonomy.orchestrator_cmd` empty → flow-core §2.1: no phase runs.
38
+ - Run `<cmd> why`. It fails, or prints anything but `start`, `answer`, `review`, `pipeline` or
39
+ `merged` → print what it returned and its stderr in the §3 header and end. No closing order: an
40
+ orchestrator that cannot say why it launched the run cannot take one either.
41
+ - Run `<cmd> ticket --json` and keep `number`, `title`, `base` and `kind` (`kind` absent → `feat`).
42
+ It fails or prints no `number` → `blocked` (flow-core §2.1).
43
+ - Find the work: the `meta.json` under `.claude/work/` whose `ticket` equals `number` (archive
44
+ excluded). None is not an error — it is the "none" of the table below.
45
+
46
+ ## 2. Route
47
+
48
+ | `why` | The work | Run |
49
+ |---|---|---|
50
+ | `start` | none for this ticket | `/flow-feat-start <number>` — `/flow-bug-start <number>` when `kind` is `bug` |
51
+ | `start` | exists, `pending` set | a stop whose `ask` never landed, or a crash after it: send the same question again — `ask` with `<work>/<pending.question_file>`, `<work>/<pending.options_file>`, `--recommended 1` when that options file is not empty, `--free-text` when `pending.free_text`, `--gate pending.gate` — and end. `pending` stays as it is; nothing is recomputed |
52
+ | `start` | exists, an `mrs[]` entry `published`, or `meta.json.published` true (a work with no `mrs`) | `done` — the summary says it is waiting for that merge; the next launch for it is `merged` |
53
+ | `start` | exists, nothing pending | the phase after `meta.json.phase` on this work's route (`/flow-feat-start` §4 for a feature, `/flow-bug-start`'s routing for a bug, by `size`), or `phase` itself when its own Close never ran. A work folder the orchestrator restored from a study made elsewhere enters here, and is never started a second time |
54
+ | `answer` | `pending` set | apply `<cmd> answer` as flow-core §2.1 "The answer comes back" says, then `pending.resume` at `pending.resume_at`. The order fails or prints nothing → `blocked` |
55
+ | `answer` | nothing pending | `blocked` — there is no question for that answer to decide |
56
+ | `merged` | exists, something published | the entry of `meta.json.mrs` whose `status` is `published` (the only one: one MR/PR per run) becomes `merged`; set `meta.json.base` to the `base` just read; the next startable MR/PR → `/flow-feat-build`; none left, or a work with no `mrs` and `published` true (one MR/PR, every bug) → `phase = done` and `done`, the summary naming the ticket as complete |
57
+ | `merged` | none, or nothing published | `blocked` — nothing of this ticket was published from here |
58
+ | `review` | exists | `/flow-work-respond` — the threads come from `<cmd> events --json` |
59
+ | `pipeline` | exists | `/flow-work-green` — the failed jobs come from `<cmd> events --json` |
60
+ | `review` · `pipeline` | none | `blocked` — there is no work of this ticket to answer for |
61
+
62
+ The phase you hand the run to is unattended too: it reads §2.1, chains as `auto` and makes the
63
+ run's one closing order. This command makes none of its own except the re-sent `ask`, the `blocked`
64
+ and the `done` of the table above.
65
+
66
+ ## 3. Close
67
+
68
+ Nothing to write here beyond the routing above — the phase it hands to owns the artifacts, the
69
+ panel and the closing order. When the route ended the run itself (`ask` → `wait`, `blocked` → `block`,
70
+ `done` → `done`), publish the panel with that `attention` (flow-core §4) and print the §3 header.