flow-workflows 0.85.1 → 0.87.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 (49) hide show
  1. package/README.md +1 -0
  2. package/adapters/codex/CORE.md +7 -1
  3. package/adapters/codex/skills/flow-bug-start/SKILL.md +1 -1
  4. package/adapters/codex/skills/flow-feat-build/SKILL.md +2 -2
  5. package/adapters/codex/skills/flow-feat-design/SKILL.md +1 -1
  6. package/adapters/codex/skills/flow-feat-plan/SKILL.md +1 -1
  7. package/adapters/codex/skills/flow-feat-start/SKILL.md +1 -1
  8. package/adapters/codex/skills/flow-work-README/SKILL.md +1 -0
  9. package/adapters/codex/skills/flow-work-green/SKILL.md +1 -1
  10. package/adapters/codex/skills/flow-work-handoff/SKILL.md +158 -0
  11. package/adapters/codex/skills/flow-work-respond/SKILL.md +1 -1
  12. package/adapters/codex/skills/flow-work-run/SKILL.md +25 -2
  13. package/adapters/gemini/CORE.md +7 -1
  14. package/adapters/gemini/commands/flow/bug/start.toml +1 -1
  15. package/adapters/gemini/commands/flow/feat/build.toml +2 -2
  16. package/adapters/gemini/commands/flow/feat/design.toml +1 -1
  17. package/adapters/gemini/commands/flow/feat/plan.toml +1 -1
  18. package/adapters/gemini/commands/flow/feat/start.toml +1 -1
  19. package/adapters/gemini/commands/flow/work/README.toml +1 -0
  20. package/adapters/gemini/commands/flow/work/green.toml +1 -1
  21. package/adapters/gemini/commands/flow/work/handoff.toml +155 -0
  22. package/adapters/gemini/commands/flow/work/respond.toml +1 -1
  23. package/adapters/gemini/commands/flow/work/run.toml +25 -2
  24. package/adapters/hermes/CORE.md +7 -1
  25. package/adapters/hermes/skills/flow-bug-start/SKILL.md +1 -1
  26. package/adapters/hermes/skills/flow-feat-build/SKILL.md +2 -2
  27. package/adapters/hermes/skills/flow-feat-design/SKILL.md +1 -1
  28. package/adapters/hermes/skills/flow-feat-plan/SKILL.md +1 -1
  29. package/adapters/hermes/skills/flow-feat-start/SKILL.md +1 -1
  30. package/adapters/hermes/skills/flow-work-README/SKILL.md +1 -0
  31. package/adapters/hermes/skills/flow-work-green/SKILL.md +1 -1
  32. package/adapters/hermes/skills/flow-work-handoff/SKILL.md +158 -0
  33. package/adapters/hermes/skills/flow-work-respond/SKILL.md +1 -1
  34. package/adapters/hermes/skills/flow-work-run/SKILL.md +25 -2
  35. package/adapters/opencode/CORE.md +7 -1
  36. package/adapters/opencode/commands/flow-bug-start.md +1 -1
  37. package/adapters/opencode/commands/flow-feat-build.md +2 -2
  38. package/adapters/opencode/commands/flow-feat-design.md +1 -1
  39. package/adapters/opencode/commands/flow-feat-plan.md +1 -1
  40. package/adapters/opencode/commands/flow-feat-start.md +1 -1
  41. package/adapters/opencode/commands/flow-work-README.md +1 -0
  42. package/adapters/opencode/commands/flow-work-green.md +1 -1
  43. package/adapters/opencode/commands/flow-work-handoff.md +156 -0
  44. package/adapters/opencode/commands/flow-work-respond.md +1 -1
  45. package/adapters/opencode/commands/flow-work-run.md +25 -2
  46. package/package.json +1 -1
  47. package/plugins/flow/.claude-plugin/plugin.json +1 -1
  48. package/plugins/flow/CHANGELOG.md +29 -0
  49. package/plugins/flow/examples/FLOW.template.md +3 -0
@@ -26,14 +26,14 @@ Implementation phase. Code is written here.
26
26
 
27
27
  ## 1. Pre-flight
28
28
 
29
- - Load `meta.json` by current branch. Read `meta.json` and `00-summary.md`; open in full only `03-design.md` (§"External contracts", verbatim) and the current MR/PR entry of `04-mr-plan.md`. (flow-core §5)
29
+ - Load `meta.json` by current branch — in `unattended`, the work `/flow-work-run` found (flow-core §2.1). Read `meta.json` and `00-summary.md`; open in full only `03-design.md` (§"External contracts", verbatim) and the current MR/PR entry of `04-mr-plan.md`. (flow-core §5)
30
30
  - `size` M/L: require both `03-design.md` **and** `04-mr-plan.md`. Plan missing → send to `/flow-feat-plan`; design missing → send to `/flow-feat-design`.
31
31
  - `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).
32
32
  - **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`".)
33
33
  - **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`.
34
34
  - All `merged` → warn: feature is done, nothing to build (in `unattended`: `done`, the summary saying so).
35
35
  - 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.
36
- - **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.
36
+ - **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>`, written to `meta.json.branch` (a relaunch of this part then finds it) 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.
37
37
 
38
38
  ## 2. Business brief (before typing)
39
39
 
@@ -36,7 +36,7 @@ after writing each challenge's Response.
36
36
 
37
37
  ## 1. Pre-flight
38
38
 
39
- - Load `meta.json` by current branch. Missing → ask the user to start with `/flow-feat-start`.
39
+ - Load `meta.json` by current branch — in `unattended`, the work `/flow-work-run` found (flow-core §2.1). Missing → ask the user to start with `/flow-feat-start`.
40
40
  - Read `meta.json` and `00-summary.md`; open in full only `01-context.md` (ticket, decisions, contracts received). (flow-core §5)
41
41
  - `size` is `XS` → suggest jumping to `/flow-feat-build` and stop unless the user insists.
42
42
 
@@ -26,7 +26,7 @@ Delivery planning phase. **No code is written.** Splits the feature into MRs/PRs
26
26
 
27
27
  ## 1. Pre-flight
28
28
 
29
- - Load `meta.json` by current branch. Missing → send the user to `/flow-feat-start`.
29
+ - Load `meta.json` by current branch — in `unattended`, the work `/flow-work-run` found (flow-core §2.1). Missing → send the user to `/flow-feat-start`.
30
30
  - Require `design` in `phases_done`. Missing → send to `/flow-feat-design` and stop.
31
31
  - Read `meta.json` and `00-summary.md`; open in full only `03-design.md`. (flow-core §5)
32
32
  - **`size` `XS` or `S`** → warn that this phase does not apply (always 1 MR/PR), add `"plan:skipped"` to `phases_done`, suggest `/flow-feat-build`. Stop.
@@ -253,7 +253,7 @@ Create the work directory per §1: `.claude/work/<TICKET>-<slug>/` (ticket mode)
253
253
  ```
254
254
 
255
255
  - Ticket-less (§2.5) → `draft_from_conversation: true`, `tracker_issue` = created issue id/url (or `null` if local-only). Ticket mode → defaults above.
256
- - `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.
256
+ - `base` — `unattended` only: the ticket's `base`, or `git.default_base` when it is empty — never empty (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.
257
257
  - `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.
258
258
  - **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.
259
259
 
@@ -247,6 +247,7 @@ Two signals arrive on an open MR/PR, each with its own cross-cutting loop (feat
247
247
  - `/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`.
248
248
  - `/flow-work-status` — all works in `.claude/work/`, current phase, divergence with git.
249
249
  - `/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.
250
+ - `/flow-work-handoff` — hands a **finished study** to whoever builds it elsewhere (an unattended server, another machine): refuses an unfinished one, pushes only this work's folder as a parentless commit to `git.handoff_branch` without touching the checkout, asks before the push, then offers a marked summary for the ticket body (`tracker.edit_cmd`).
250
251
  - `/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.
251
252
  - `/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.
252
253
  - `/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.
@@ -68,7 +68,7 @@ resolve this way:
68
68
 
69
69
  ## 1. Pre-flight — locate the work and the MR/PR
70
70
 
71
- - 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)
71
+ - Identify the current branch and its work folder `.claude/work/<TICKET>/` (via `meta.json`, matching `branch`) — in `unattended`, the work `/flow-work-run` found (flow-core §2.1). 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)
72
72
  - **No** work folder (MR opened outside the flow) → **lightweight mode**: skip `meta.json`/artifact reads, warn once that there is no recorded design rationale, keep going.
73
73
  - Resolve the target MR/PR, in this order:
74
74
  1. `$ARGUMENTS` if given (IID or URL).
@@ -0,0 +1,156 @@
1
+ ---
2
+ description: Hand a finished study to whoever builds it elsewhere — push only this work's folder to a branch of its own, then offer a summary for the ticket
3
+ ---
4
+
5
+ <!-- GENERATED by script/adapter-build.py from plugins/flow/commands/work/handoff.md — do not edit; change the plugin file and run the script. -->
6
+
7
+ # `/flow-work-handoff`
8
+
9
+ > **opencode adapter — how the Claude Code primitives named below map here.**
10
+ > - `AskUserQuestion` → ask in plain text with numbered options and wait for the reply.
11
+ > - `Agent <role>` / `Agent general-purpose` / subagents → `@<name>` declared in `agents/<name>.md` (`mode: subagent`); the name comes from `agents.<role>` in `FLOW.md`, empty → do it in this context.
12
+ > - Parallel fan-out → several `@name` in one prompt, capped at `agents.fanout_max` (empty → 4); `agents.fanout_tool` is Claude Code-only, ignore it.
13
+ > - `ScheduleWakeup` / `Monitor` / `/loop` → not available in-session: run one cycle, persist state in `monitor.md`, let the user schedule `opencode run -p "<command>"` with cron.
14
+ > - `TaskCreate` → a markdown checklist in the phase artifact.
15
+ > - `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`).
16
+ > - `/model <value>` → opencode's model picker (`/models`).
17
+ > - `knowledge.*` roles → whatever tools `FLOW.md` names there; an MCP tool keeps its name, its server is declared in `opencode.json` (see this adapter's `opencode.json` for the domain-memory example).
18
+
19
+ Read `~/.claude/flow/CORE.opencode.md` first (shared rules: `FLOW.md` step 0, autonomy, how a stop reads, the live panel, `00-summary.md`) — skip if you already read it in this session.
20
+
21
+ **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.
22
+
23
+ For a study made here and built somewhere else — a server running `/flow-work-run` unattended,
24
+ another person, another machine. The builder gets the work folder at the same path and nothing
25
+ else: no conversation, maybe a less capable model. So this command checks the study can stand on
26
+ its own, pushes the folder to a branch that holds only it, and offers to put a summary in the
27
+ ticket for the people who review it.
28
+
29
+ ## 1. Pre-flight
30
+
31
+ - Effective FLOW configuration per flow-core §0. `autonomy.mode: unattended` → refuse in one line:
32
+ an unattended run never pushes (flow-core §2.1); handing off is a person's step.
33
+ - Locate the active `meta.json` by current branch; not found → ask the user for the ticket.
34
+ - `git.handoff_branch` empty → refuse, naming the key and an example
35
+ (`git.handoff_branch: study/{TICKET}`): where the study goes is the receiver's convention, never
36
+ flow's guess. `{TICKET}` = `meta.json.ticket`.
37
+ - `origin` not configured → refuse; there is nowhere to push.
38
+
39
+ ## 2. Is the study finished?
40
+
41
+ The builder can ask no one. Refuse — pushing nothing, naming every reason that holds — when:
42
+
43
+ - **The study's last phase is not in `phases_done`.** A feature: `context` on XS (what `start`
44
+ records), `design` on S, `plan` on M/L. A bug: `context` on XS, `investigate` otherwise.
45
+ - **`meta.json.pending` is set** — a question is still waiting for its answer.
46
+ - **A clarification is still open** — a question under "Decisions clarified at start" in
47
+ `01-context.md` recorded without its answer.
48
+
49
+ Then, **before anything is pushed**: decisions this session settled while talking that no artifact
50
+ records yet → write them where they belong now (`01-context.md` "Decisions clarified at start",
51
+ `03-design.md` "Decisions (ADR-light)", `04-mr-plan.md`), and say which. What was decided only in
52
+ the chat does not travel.
53
+
54
+ ## 3. Build the commit, without touching the checkout
55
+
56
+ A throwaway index holds only this folder, so the current branch, `HEAD`, the real index (staged
57
+ work included) and the working tree are never read into it nor written to, and a git-ignored
58
+ `.claude/work/` is no obstacle.
59
+
60
+ **Each block below is one shell call, run as it stands** — a harness need not keep variables from
61
+ one call to the next, so every block sets its own. Replace each `@…@` with its literal value first:
62
+ `@WORK@` the work folder relative to the repository root (`.claude/work/<work-dir>`, no trailing
63
+ slash), `@BRANCH@` the resolved `git.handoff_branch`, `@TICKET@` `meta.json.ticket`, `@COMMIT@` the
64
+ sha the build block printed. A value holding a `'` cannot go inside those quotes: refuse it and
65
+ say which.
66
+
67
+ First, the branch must not exist on `origin` — a second push would need a force, and this command
68
+ never forces:
69
+
70
+ ```bash handoff-check
71
+ BRANCH='@BRANCH@'
72
+ git ls-remote --exit-code origin "refs/heads/$BRANCH" >/dev/null; echo "rc=$?"
73
+ ```
74
+
75
+ `rc=0` → the branch exists: refuse, and say what the person does next — delete it on the forge
76
+ (only when nothing still reads it), or set another name in `git.handoff_branch`. `rc=2` → absent,
77
+ continue. Anything else → stop and say why (no network, no access). Then build the commit:
78
+
79
+ ```bash handoff-build
80
+ WORK='@WORK@'; TICKET='@TICKET@'
81
+ cd "$(git rev-parse --show-toplevel)" || exit 1
82
+ [ -d "$WORK" ] || { echo "no such folder: $WORK"; exit 1; }
83
+ tmp=$(mktemp -d) || exit 1
84
+ idx="$tmp/index" # does not exist yet: git starts an empty index there
85
+ GIT_INDEX_FILE="$idx" git add -f -- "$WORK" ":(exclude)$WORK/panel.json" &&
86
+ files=$(GIT_INDEX_FILE="$idx" git ls-files) &&
87
+ tree=$(GIT_INDEX_FILE="$idx" git write-tree) &&
88
+ commit=$(git commit-tree "$tree" -m "study $TICKET")
89
+ rc=$?; rm -rf "$tmp"
90
+ [ "$rc" -eq 0 ] && [ -n "$files" ] || { echo "nothing was built (rc=$rc)"; exit 1; }
91
+ printf '%s\n' "$files"; echo "commit=$commit"
92
+ ```
93
+
94
+ `GIT_INDEX_FILE` is set per command, never exported, so a failure leaves no session pointing git
95
+ at a deleted index. `panel.json` stays out: it is this machine's terminal panel, and on another one
96
+ it would show this session's last state as if it were theirs. The block failing → its message, and
97
+ stop: `commit-tree` with no git identity configured is the usual cause.
98
+
99
+ ## 4. Confirm, then push
100
+
101
+ Show the branch, the remote and the file list the build printed — every path, one per line — then
102
+ ask with `AskUserQuestion` **in every `autonomy.mode`**: a push leaves the machine (flow-core §2).
103
+ **Push** · **Cancel**. Nothing between the list and the question (flow-core §3).
104
+
105
+ ```bash handoff-push
106
+ BRANCH='@BRANCH@'; COMMIT='@COMMIT@'
107
+ case "$COMMIT" in ''|*[!0-9a-f]*) echo "not a commit sha: $COMMIT"; exit 1 ;; esac
108
+ git cat-file -e "$COMMIT^{commit}" || exit 1
109
+ git push origin "$COMMIT:refs/heads/$BRANCH"
110
+ ```
111
+
112
+ The sha is checked first because `git push origin :refs/heads/<branch>` — an empty source —
113
+ deletes the branch on the remote. A rejected push → its message, verbatim, and stop. Never retried
114
+ with `--force`.
115
+
116
+ ## 5. The ticket summary (offer)
117
+
118
+ Only after a successful push, and only in ticket mode with a real tracker id. The people reviewing
119
+ the ticket read it there, never in the work folder; the receiver does not parse it.
120
+
121
+ - **Read the body back** — the summary goes inside the ticket's own text, never over it:
122
+ `gh` → `gh issue view {TICKET} --json body -q .body` · `glab` → `glab issue view {TICKET} -F json`,
123
+ its `description`. Any other tracker → the offer is not made: one line saying flow cannot read that
124
+ body back to keep its text.
125
+ - **The write command** — `tracker.edit_cmd`, `{TICKET}` and `{BODY_FILE}` substituted. Empty →
126
+ `gh issue edit {TICKET} --body-file {BODY_FILE}` for `gh`,
127
+ `glab issue update {TICKET} --description-file {BODY_FILE}` for `glab`.
128
+ - **The block**, short, in the language of the ticket. A feature takes it from `01-context.md`,
129
+ `03-design.md` and `04-mr-plan.md`; a bug from `01-context.md` and `03-investigation.md` — the
130
+ expected behaviour as its criteria, the root cause and the intended fix as its design, "Areas with
131
+ similar risk" as its risks. A section whose source does not exist (an XS study, an S feature with
132
+ no plan) says `none`:
133
+
134
+ ```
135
+ <!-- flow-study -->
136
+ ## What and why
137
+ ## Acceptance criteria
138
+ ## Design in brief
139
+ ## MR/PR plan
140
+ ## Risks
141
+ <!-- end flow-study -->
142
+ ```
143
+
144
+ Criteria keep their literal values. The plan lists each MR/PR with what it covers and what it
145
+ waits on; a bug's plan is its single fix.
146
+ - **The new body**: the body read above with the block between the two markers replaced — or, with
147
+ no markers yet, the block appended after a blank line. Written to a `mktemp` file outside the
148
+ tree — `{BODY_FILE}` — so nothing of it can be committed later.
149
+ - **Show the block and ask** with `AskUserQuestion`, **in every mode**: it writes to a shared
150
+ tracker. **Write it** · **Skip**. Failure → its message in one line; the push stands.
151
+
152
+ ## 6. Close
153
+
154
+ Report following flow-core §3: the branch and the commit, the file count, whether the ticket
155
+ summary was written. Refresh the panel: a `Now` line saying the study was handed off, no `Decision`
156
+ line. `meta.json` gains nothing — the branch on `origin` is the record, and the §3 refusal reads it.
@@ -83,7 +83,7 @@ back through it, and the hard gates above resolve this way:
83
83
 
84
84
  ## 1. Pre-flight — locate the work and the MR/PR
85
85
 
86
- - 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)
86
+ - Identify the current branch and its work folder `.claude/work/<TICKET>/` (the `meta.json` whose `branch` matches) — in `unattended`, the work `/flow-work-run` found (flow-core §2.1). 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)
87
87
  - **No** work folder (MR opened outside the flow) → **lightweight mode**: skip `meta.json`/artifact reads, warn once that there is no recorded design rationale to draw on, keep going — triage and reply loop still work.
88
88
  - Resolve the target MR/PR, in this order:
89
89
  1. `$ARGUMENTS` if given (IID or URL).
@@ -48,15 +48,38 @@ of truth, and an argument that disagrees with it is ignored and named in the log
48
48
  | `start` | none for this ticket | `/flow-feat-start <number>` — `/flow-bug-start <number>` when `kind` is `bug` |
49
49
  | `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 |
50
50
  | `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` |
51
- | `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 |
51
+ | `start` | exists, nothing pending | the work's branch first (below), then 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 |
52
52
  | `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` |
53
53
  | `answer` | nothing pending | `blocked` — there is no question for that answer to decide |
54
- | `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 |
54
+ | `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 (empty → `git.default_base`); 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 |
55
55
  | `merged` | none, or nothing published | `blocked` — nothing of this ticket was published from here |
56
56
  | `review` | exists | `/flow-work-respond` — the threads come from `<cmd> events --json` |
57
57
  | `pipeline` | exists | `/flow-work-green` — the failed jobs come from `<cmd> events --json` |
58
58
  | `review` · `pipeline` | none | `blocked` — there is no work of this ticket to answer for |
59
59
 
60
+ **The work's branch, on `start`.** The current branch is `meta.json.branch` → nothing to do. It is
61
+ not — a study made on another machine arrives on the ticket's `base`, a run that died before its
62
+ closing order is relaunched there — then, in this order:
63
+
64
+ 1. Anything `git status --porcelain` lists outside `.claude/work/` — untracked files included, since
65
+ the WIP commit before a closing order takes new files too → `blocked`: the orchestrator owns the
66
+ checkout.
67
+ 2. `meta.json.base` is set and `meta.json.worktree` is a worktree of this checkout (`git worktree
68
+ list`) whose branch is `meta.json.branch` → run the phase from there: `git switch` would refuse a
69
+ branch checked out elsewhere. A path that is not such a worktree falls through to step 3.
70
+ 3. `meta.json.base` is set — the work was started or re-homed by an unattended run, so its branch is
71
+ one this kind of run made — and `meta.json.branch` exists locally → `git switch` onto it, change
72
+ nothing. It holds the commits a previous run left.
73
+ 4. `<number>-<slug>` (`slug` from `meta.json`), or `meta.json.branch` without `meta.json.base`,
74
+ exists locally → `blocked`, naming it: a branch with the work's name that no run here recorded is
75
+ history nobody can vouch for.
76
+ 5. Otherwise create it as `/flow-feat-start` does in this mode: `git switch --create <name>
77
+ --no-track <base>` (`base` empty → `git.default_base`), `<name>` being `<number>-<slug>`, or
78
+ `<number>-<slug>-<n>` when the `in_progress` entry of `meta.json.mrs` has `n` > 1 — the name
79
+ `/flow-feat-build` gives that part, since the first part's name is already published. Then
80
+ `meta.json.branch` = it, `meta.json.base` = that base, `worktree` and `stacked_on` = `null` — paths and parents from the
81
+ other machine mean nothing here — and record `{ "key": "unattended:rehomed", "default": "<old branch> → <name> from <base>", "phase": "run" }`.
82
+
60
83
  The phase you hand the run to is unattended too: it reads §2.1, chains as `auto` and makes the
61
84
  run's one closing order. This command makes none of its own except the re-sent `ask`, the `blocked`
62
85
  and the `done` of the table above.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-workflows",
3
- "version": "0.85.1",
3
+ "version": "0.87.0",
4
4
  "description": "Guided feat/bug workflows (start→ship), post-deploy monitoring and multi-agent code review, stack-agnostic. Each repo uses a shared FLOW.md plus optional harness overlay.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,7 +3,7 @@
3
3
  "name": "flow",
4
4
  "displayName": "Flow — guided dev workflows",
5
5
  "description": "Guided feat/bug workflows (start→ship), post-deploy monitoring and multi-agent code review, stack-agnostic. Each repo uses a shared FLOW.md plus optional harness overlay.",
6
- "version": "0.85.1",
6
+ "version": "0.87.0",
7
7
  "author": {
8
8
  "name": "Alberto Vioque",
9
9
  "email": "mashware@gmail.com"
@@ -5,6 +5,35 @@ plugin and is what `/flow:news` reads to show you what changed since your previo
5
5
 
6
6
  The canonical, richest notes live in the [GitHub Releases](https://github.com/mashware/flow-workflows/releases).
7
7
 
8
+ ## v0.87.0 — A finished study is handed off from the laptop, and summarised in its ticket · 2026-10-01
9
+
10
+ **In short**
11
+ - **`/flow:work:handoff` hands a study to whoever builds it elsewhere.** It pushes this work's
12
+ folder, and nothing else, as a commit with no history to the branch `git.handoff_branch` names
13
+ (e.g. `study/{TICKET}`). Your current branch, staged changes and other works are never touched,
14
+ even when `.claude/work/` is git-ignored.
15
+ - **It refuses a study that cannot stand on its own** — its design or plan not closed, a question
16
+ pending, a clarification open — and writes down first what this session decided but no file says.
17
+ - **It asks before the push, and never forces**: a branch that already exists is refused, with what
18
+ to do next.
19
+ - **A summary for the ticket**, offered after the push: what and why, criteria, design in brief,
20
+ MR/PR plan and risks, in a marked block that keeps the ticket's own text and is replaced on a
21
+ second run. GitHub and GitLab out of the box; new key `tracker.edit_cmd`.
22
+ - Completes #186.
23
+
24
+ ## v0.86.0 — An unattended run builds a study made on another machine · 2026-10-01
25
+
26
+ **In short**
27
+ - **A study restored on a server is built there, not redone.** When the orchestrator copies a work
28
+ folder made on a laptop and launches `/flow:work:run` on the ticket's base branch, the run gives
29
+ the work a branch of its own (`<number>-<slug>`, from that base) and goes straight to the next
30
+ phase — `build` after a plan. It never designs or plans the ticket again.
31
+ - **A run relaunched after a crash goes back to its branch** instead of failing to find its work.
32
+ - **The next part of a split task finds its work** while the checkout stands on the umbrella branch.
33
+ - **It stops instead of guessing** when the checkout has uncommitted changes, or holds a branch with
34
+ the work's name that the work never recorded.
35
+ - Nothing changes in `manual`, `guided` or `auto`. Part of #186.
36
+
8
37
  ## v0.85.1 — An unattended run reads the orchestrator's answers as agent-runner sends them · 2026-10-01
9
38
 
10
39
  **In short**
@@ -48,6 +48,7 @@ How tickets are identified and read.
48
48
  # they are asked before running in `autonomy.mode: manual` and run automatically in `guided`/`auto`;
49
49
  # a failure or an already-in-state ticket warns and continues, never blocks. They run only in
50
50
  # ticket mode with a real tracker id (skipped for ticket-less / local-only works).
51
+ - `edit_cmd:` # optional, rewrites a ticket's BODY from a file: `/flow:work:handoff` writes its study summary with it. `{TICKET}` and `{BODY_FILE}` substituted. Empty = derived for `gh` (`gh issue edit {TICKET} --body-file {BODY_FILE}`) and `glab` (`glab issue update {TICKET} --description-file {BODY_FILE}`); other trackers get no summary — flow cannot read their body back to keep its text.
51
52
  - `followup_ask_max:` # how many parked findings one finished work may turn into questions at `ship`'s Close (flow-core §7). Empty = 2. `0` = never ask, log everything. A ticket where
52
53
  # seven phases each notice something is not seven problems: with 3+ candidates a skeptic tries to refute each one (burden of proof on the finding), the ones
53
54
  # without a named subject are dropped, and only the strongest survivors up to this number are put to you. Raise it if you would rather triage than be handed a log.
@@ -86,6 +87,8 @@ Branch and Pull/Merge Request conventions.
86
87
  # - make database-update
87
88
  # - make frontend
88
89
 
90
+ - `handoff_branch:` # branch `/flow:work:handoff` pushes a finished study to, holding only that work's folder. `{TICKET}` substituted. Empty = the command refuses: where a study goes is the receiver's convention. e.g. `study/{TICKET}`.
91
+
89
92
  ## autonomy
90
93
  How much the flow advances on its own vs. stopping to ask you.
91
94