flow-workflows 0.69.0 → 0.70.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.
- package/README.md +3 -1
- package/adapters/codex/CORE.md +1 -1
- package/adapters/codex/skills/flow-bug-fix/SKILL.md +32 -2
- package/adapters/codex/skills/flow-feat-build/SKILL.md +36 -4
- package/adapters/gemini/CORE.md +1 -1
- package/adapters/gemini/commands/flow/bug/fix.toml +32 -2
- package/adapters/gemini/commands/flow/feat/build.toml +36 -4
- package/adapters/hermes/CORE.md +1 -1
- package/adapters/hermes/skills/flow-bug-fix/SKILL.md +32 -2
- package/adapters/hermes/skills/flow-feat-build/SKILL.md +36 -4
- package/adapters/opencode/CORE.md +1 -1
- package/adapters/opencode/commands/flow-bug-fix.md +32 -2
- package/adapters/opencode/commands/flow-feat-build.md +36 -4
- package/package.json +1 -1
- package/plugins/flow/.claude-plugin/plugin.json +1 -1
- package/plugins/flow/CHANGELOG.md +33 -0
package/README.md
CHANGED
|
@@ -368,7 +368,9 @@ configuration, normally the active harness overlay. One worked set ships as an *
|
|
|
368
368
|
never loaded: [`examples/symfony/`](plugins/flow/examples/symfony/) is a filled-in `FLOW.md` plus
|
|
369
369
|
four reviewers for a Symfony + Doctrine repo, to copy and edit. Three generic hooks ship: a guard
|
|
370
370
|
against pushing to `master`/`main`, an update notice at session start, and a session-start line
|
|
371
|
-
saying which work this branch belongs to and where it stands
|
|
371
|
+
saying which work this branch belongs to and where it stands — after a compaction, that last one
|
|
372
|
+
prints the brief and plan the build is held to instead, since there the context is what was lost,
|
|
373
|
+
not the thread. Optional dependencies (a knowledge
|
|
372
374
|
source such as `domain-memory` or `codegraph`, your git host CLI, a tracker CLI) improve specific
|
|
373
375
|
steps; without them those steps degrade and the rest works.
|
|
374
376
|
|
package/adapters/codex/CORE.md
CHANGED
|
@@ -17,7 +17,7 @@ Every `$flow-*` command assumes these rules. They are stated once, here, so a co
|
|
|
17
17
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
18
18
|
`flow-core`" means this file.
|
|
19
19
|
|
|
20
|
-
**This file belongs to flow `0.
|
|
20
|
+
**This file belongs to flow `0.70.0`.** Compare it once, at the start of the session, against
|
|
21
21
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
22
22
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
23
23
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -48,7 +48,7 @@ What is NOT touched:
|
|
|
48
48
|
|
|
49
49
|
**Ask with `AskUserQuestion`** whether this reflects the expected fix — a hard gate, **in every mode, `auto` included**: widening the fix is the main source of collateral regressions, and this is the last point to settle scope before there is a diff.
|
|
50
50
|
|
|
51
|
-
In `
|
|
51
|
+
In `auto` this is one of the only two stops of the whole flow (this one and `ship`; `guided` adds the plan of §2.0bis on a fix of more than two steps): open with the **full stop header** (flow-core §3), then the brief. Options:
|
|
52
52
|
- **Yes, go ahead** → apply the fix.
|
|
53
53
|
- **No, something is missing or wrong** → adjust the brief, ask again. No code until confirmed.
|
|
54
54
|
|
|
@@ -60,11 +60,38 @@ blockers lived in the half a third option let in.
|
|
|
60
60
|
|
|
61
61
|
Save the brief at the top of `04-fix.md`. Any "also fix X while we're at it" during implementation → §2.3.
|
|
62
62
|
|
|
63
|
+
## 2.0bis Plan the fix (more than 2 steps)
|
|
64
|
+
|
|
65
|
+
A fix of one or two steps is its own plan, and a planning round on it is pure friction. Past that the steps stop fitting in the brief — which says what stops happening, never in which file — and the fix starts being discovered while it is typed. **Trigger: more than 2 fix steps.** Two or fewer → skip, record one line in `04-fix.md` (`plan: skipped — 2 steps`) and go to §2.1.
|
|
66
|
+
|
|
67
|
+
The steps come from the root cause in `03-investigation.md`, not from the repo you are about to open: a step that cause never implied is either the investigation being wrong (§4.1) or scope that belongs in §2.3. **No code yet.** Under 200 words:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## Plan
|
|
71
|
+
1. <step> — `<file or path>` — <the test that proves it, or "covered by step M">
|
|
72
|
+
2. …
|
|
73
|
+
|
|
74
|
+
- **Point of no return**: <the migration, contract or published event after which rollback stops being a revert — or "none">.
|
|
75
|
+
- **Out of this plan**: <the adjacent thing that will be tempting once these files are open>.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Rules, and the first one is the bug flow's own:
|
|
79
|
+
- **The regression test is a step, and it comes first when it can fail before the fix.** `$flow-bug-validate` is what proves the fix, and `$flow-bug-review` refuses to run without it on size ≥ S (`$flow-bug-start §2`). A plan that leaves the test until last has the one step that can still say "the cause was not this" arriving after everything is already built on the answer.
|
|
80
|
+
- **A step is a thing on disk**, not a phase of thought: "add the idempotency key on the retry path", not "look at the retry logic".
|
|
81
|
+
- **A step that widens the blast radius is not part of the minimal fix** (§2.1) — it goes to §2.3 before it is written down here, not after it is built.
|
|
82
|
+
- A fix whose plan needs more than about five steps is usually two tickets or a feature in disguise: check §4.2 before planning further.
|
|
83
|
+
|
|
84
|
+
**Present it, then behave by mode:**
|
|
85
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, one `AskUserQuestion` — **Approve and fix** · **Change the order or the steps**. On a bug the order is the decision: it is what settles whether the proof comes before the repair.
|
|
86
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
87
|
+
|
|
88
|
+
Save it in `04-fix.md` under `## Plan`, right after the brief. **A fix that was going to be one step and turns into a third**: come back here and write it then — the trigger is the shape of the work, not the moment it was first guessed.
|
|
89
|
+
|
|
63
90
|
## 2.1 Work
|
|
64
91
|
|
|
65
92
|
- Apply the minimal fix targeting the finding of `03-investigation.md` (or the diagnosis if investigate was skipped).
|
|
66
93
|
- Sensitive area (authentication, payments, sensitive data) → consult the `agents.architecture` agent from FLOW.md to confirm the correct layer; empty → check against `conventions` in FLOW.md.
|
|
67
|
-
- More than 2 fix steps →
|
|
94
|
+
- More than 2 fix steps → the §2.0bis plan is already written: track its numbered steps with `TaskCreate` where the harness offers one, otherwise tick them off in `04-fix.md` where they stand. One task per step, same order, marked `in_progress` and `completed` as they go — not batched.
|
|
68
95
|
- **Comment discipline**: comment only a *why* the code cannot say (a non-obvious constraint, the reason for a workaround, a subtle invariant); match the surrounding file's comment density. **Never write the ticket ID or "fix for #N" into a code comment** — that lives in the commit/branch/MR-PR.
|
|
69
96
|
- Keep the log updated while editing.
|
|
70
97
|
|
|
@@ -118,6 +145,9 @@ A **product decision** the fix turns out to need is neither of these — not sco
|
|
|
118
145
|
**What is NOT touched**:
|
|
119
146
|
- <adjacent areas out of scope>
|
|
120
147
|
|
|
148
|
+
## Plan
|
|
149
|
+
<the numbered steps of §2.0bis, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 2 steps`). What §2.1 tracks with `TaskCreate`. Steps are annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
150
|
+
|
|
121
151
|
## Fix description
|
|
122
152
|
<one sentence: "The fix consists of …">
|
|
123
153
|
|
|
@@ -59,7 +59,7 @@ Rules for writing it:
|
|
|
59
59
|
|
|
60
60
|
**Ask the user with `AskUserQuestion`** whether the brief reflects what they expect — **hard gate, in every autonomy mode, `auto` included**: it is the last point where scope can be corrected before there is a diff to argue with.
|
|
61
61
|
|
|
62
|
-
In `
|
|
62
|
+
In `auto` this is one of the only two stops per MR/PR (`guided` adds the plan of §2.0ter on a big one), so it carries the **full stop header** (flow-core §3) — ticket, size, phase, `MR #<n> of <N>`, plan state — followed by the brief. Options:
|
|
63
63
|
- **Yes, proceed** → start building.
|
|
64
64
|
- **No, something is extra or missing** → the user clarifies, adjust the brief, ask again. **Do not touch code** until the brief is confirmed.
|
|
65
65
|
|
|
@@ -84,7 +84,36 @@ Hard rules:
|
|
|
84
84
|
- **If there is a "Pattern deviation" section**: copy it too — it reminds you at coding time not to mimic the repo pattern.
|
|
85
85
|
- **If the design says "none"** (no external surfaces), skip this step and record: "## Contracts to respect — none declared in design".
|
|
86
86
|
|
|
87
|
-
Without this copy, do not proceed to §2.
|
|
87
|
+
Without this copy, do not proceed to §2.0ter.
|
|
88
|
+
|
|
89
|
+
## 2.0ter Plan this MR/PR (size-gated)
|
|
90
|
+
|
|
91
|
+
`03-design.md` §"Implementation plan (order)" is the **feature's** order, written before `$flow-feat-plan` split anything — it does not know which of its steps belong to this MR/PR. The brief above says what this MR/PR delivers in business terms; neither says which files are touched in which order. On a MR/PR big enough to lose its thread, that plan is written here.
|
|
92
|
+
|
|
93
|
+
**Gate — run this step only when the current `mrs[]` entry is big enough**: `lines_est > 150` **or** `files_est > 5`. No estimates in the entry (an older plan) → fall back to its `size`: `M`/`L` run it, `XS`/`S` skip. No `mrs[]` at all (XS/S, single MR/PR) → skip; the brief and the contracts are the whole plan, and a 30-line change does not earn a planning round. Skipped → record one line in `05-implementation.md` — the estimates that let it through (`plan: skipped — 40 lines / 2 files`), or `plan: skipped — single MR/PR` when there is no entry to read — and go to §2.1.
|
|
94
|
+
|
|
95
|
+
Write it against `03-design.md` and the contracts just copied — **no code yet, no exploratory edits**. Under 250 words, as numbered steps:
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
## Plan MR/PR #N
|
|
99
|
+
1. <step> — `<file or path>` — <test that proves it, or "covered by step M">
|
|
100
|
+
2. …
|
|
101
|
+
|
|
102
|
+
- **Point of no return**: <the migration, contract, published event or flag after which rollback stops being a revert — or "none">.
|
|
103
|
+
- **Out of this plan**: <what belongs to a later MR/PR and will be tempting while inside these files>.
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Rules for the steps:
|
|
107
|
+
- **A step is a thing on disk**, not a phase of thought: "add the nullable column + migration", not "analyse the schema". A step nobody can tell is finished is two steps or none.
|
|
108
|
+
- **Order by what unblocks what**, and put the point of no return as late as the design allows: everything reversible lands before it.
|
|
109
|
+
- **Every step names its test** or the step that covers it. A step that proves no acceptance criterion and guards no contract is a candidate to cut — same bar as `03-design.md` §"Planned tests".
|
|
110
|
+
- Steps come from the **design**, not from the repo you are about to open. A step the design never mentions is either a deviation to log (§3 "Deviations from design") or scope that belongs in §2.4.
|
|
111
|
+
|
|
112
|
+
**Present it, then behave by mode:**
|
|
113
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, and one `AskUserQuestion` — **Approve and build** · **Change the order or the steps** (the user edits, rewrite it, ask again). This is a genuine decision point: the order of an irreversible step is exactly what is expensive to argue with once there is a diff.
|
|
114
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
115
|
+
|
|
116
|
+
Save it in `05-implementation.md` under `## Plan MR/PR #N`, right after the brief. It is what seeds `TaskCreate` in §2.1, and what a §2.3 hot cut splits: the steps already done stay in this MR/PR, the ones still pending move to the new entry.
|
|
88
117
|
|
|
89
118
|
## 2.1 Work
|
|
90
119
|
|
|
@@ -115,7 +144,7 @@ Execution mode:
|
|
|
115
144
|
- **Give it a bounded first step.** A piece with no natural first move ("do the whole module") produces nothing for hours; split it by file or by numbered step until it has one.
|
|
116
145
|
- **Check the round at every stop of this command**, not only at the end: an agent past `agents.stall_after_minutes` (empty → 25) with nothing written to its path is stopped, split in two and relaunched.
|
|
117
146
|
|
|
118
|
-
Use `TaskCreate` to track the steps from the
|
|
147
|
+
Use `TaskCreate` to track the steps of the **§2.0ter plan for this MR/PR** — one task per numbered step, same order. Step skipped there (small MR/PR) → seed from `03-design.md` §"Implementation plan (order)", taking only the steps this MR/PR covers per `04-mr-plan.md`; the feature's plan predates the split and carries steps that belong to siblings. Mark each step `in_progress` when starting and `completed` when done — do not batch.
|
|
119
148
|
|
|
120
149
|
### 2.1bis The premise this change rests on (any size, XS included)
|
|
121
150
|
|
|
@@ -221,7 +250,7 @@ Warning thresholds:
|
|
|
221
250
|
|
|
222
251
|
If either is exceeded, **pause** and ask the user with `AskUserQuestion` (options, in this order):
|
|
223
252
|
|
|
224
|
-
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains
|
|
253
|
+
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains — the §2.0ter steps still pending, or what is left of `04-mr-plan.md` where that step was skipped — goes into a new one inserted in `meta.json.mrs` right after. Zero code wasted.
|
|
225
254
|
2. **Continue and record the overrun**. When the cut would be artificial. Note the deviation in `05-implementation.md` to calibrate `$flow-feat-plan` on future tickets.
|
|
226
255
|
3. **Reopen plan**. Return to `$flow-feat-plan` to rethink the entire split. Only if the overrun shows the plan is wrong at a deeper level, not just that this MR/PR is slightly underestimated.
|
|
227
256
|
|
|
@@ -269,6 +298,9 @@ Keep `.claude/work/<TICKET>/05-implementation.md` updated as you work (not at th
|
|
|
269
298
|
**This MR/PR does NOT include**:
|
|
270
299
|
- <pieces that are out of scope>
|
|
271
300
|
|
|
301
|
+
## Plan MR/PR #N
|
|
302
|
+
<the numbered steps of §2.0ter, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 40 lines / 2 files`). What §2.1 seeds `TaskCreate` from and what a §2.3 cut splits. Steps are struck through or annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
303
|
+
|
|
272
304
|
## Changes per file
|
|
273
305
|
- <file> — what changed and why (1 line each)
|
|
274
306
|
|
package/adapters/gemini/CORE.md
CHANGED
|
@@ -16,7 +16,7 @@ Every `/flow:*` command assumes these rules. They are stated once, here, so a co
|
|
|
16
16
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
17
17
|
`flow-core`" means this file.
|
|
18
18
|
|
|
19
|
-
**This file belongs to flow `0.
|
|
19
|
+
**This file belongs to flow `0.70.0`.** Compare it once, at the start of the session, against
|
|
20
20
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
21
21
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
22
22
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -44,7 +44,7 @@ What is NOT touched:
|
|
|
44
44
|
|
|
45
45
|
**Ask with `AskUserQuestion`** whether this reflects the expected fix — a hard gate, **in every mode, `auto` included**: widening the fix is the main source of collateral regressions, and this is the last point to settle scope before there is a diff.
|
|
46
46
|
|
|
47
|
-
In `
|
|
47
|
+
In `auto` this is one of the only two stops of the whole flow (this one and `ship`; `guided` adds the plan of §2.0bis on a fix of more than two steps): open with the **full stop header** (flow-core §3), then the brief. Options:
|
|
48
48
|
- **Yes, go ahead** → apply the fix.
|
|
49
49
|
- **No, something is missing or wrong** → adjust the brief, ask again. No code until confirmed.
|
|
50
50
|
|
|
@@ -56,11 +56,38 @@ blockers lived in the half a third option let in.
|
|
|
56
56
|
|
|
57
57
|
Save the brief at the top of `04-fix.md`. Any "also fix X while we're at it" during implementation → §2.3.
|
|
58
58
|
|
|
59
|
+
## 2.0bis Plan the fix (more than 2 steps)
|
|
60
|
+
|
|
61
|
+
A fix of one or two steps is its own plan, and a planning round on it is pure friction. Past that the steps stop fitting in the brief — which says what stops happening, never in which file — and the fix starts being discovered while it is typed. **Trigger: more than 2 fix steps.** Two or fewer → skip, record one line in `04-fix.md` (`plan: skipped — 2 steps`) and go to §2.1.
|
|
62
|
+
|
|
63
|
+
The steps come from the root cause in `03-investigation.md`, not from the repo you are about to open: a step that cause never implied is either the investigation being wrong (§4.1) or scope that belongs in §2.3. **No code yet.** Under 200 words:
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## Plan
|
|
67
|
+
1. <step> — `<file or path>` — <the test that proves it, or "covered by step M">
|
|
68
|
+
2. …
|
|
69
|
+
|
|
70
|
+
- **Point of no return**: <the migration, contract or published event after which rollback stops being a revert — or "none">.
|
|
71
|
+
- **Out of this plan**: <the adjacent thing that will be tempting once these files are open>.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Rules, and the first one is the bug flow's own:
|
|
75
|
+
- **The regression test is a step, and it comes first when it can fail before the fix.** `/flow:bug:validate` is what proves the fix, and `/flow:bug:review` refuses to run without it on size ≥ S (`/flow:bug:start §2`). A plan that leaves the test until last has the one step that can still say "the cause was not this" arriving after everything is already built on the answer.
|
|
76
|
+
- **A step is a thing on disk**, not a phase of thought: "add the idempotency key on the retry path", not "look at the retry logic".
|
|
77
|
+
- **A step that widens the blast radius is not part of the minimal fix** (§2.1) — it goes to §2.3 before it is written down here, not after it is built.
|
|
78
|
+
- A fix whose plan needs more than about five steps is usually two tickets or a feature in disguise: check §4.2 before planning further.
|
|
79
|
+
|
|
80
|
+
**Present it, then behave by mode:**
|
|
81
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, one `AskUserQuestion` — **Approve and fix** · **Change the order or the steps**. On a bug the order is the decision: it is what settles whether the proof comes before the repair.
|
|
82
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
83
|
+
|
|
84
|
+
Save it in `04-fix.md` under `## Plan`, right after the brief. **A fix that was going to be one step and turns into a third**: come back here and write it then — the trigger is the shape of the work, not the moment it was first guessed.
|
|
85
|
+
|
|
59
86
|
## 2.1 Work
|
|
60
87
|
|
|
61
88
|
- Apply the minimal fix targeting the finding of `03-investigation.md` (or the diagnosis if investigate was skipped).
|
|
62
89
|
- Sensitive area (authentication, payments, sensitive data) → consult the `agents.architecture` agent from FLOW.md to confirm the correct layer; empty → check against `conventions` in FLOW.md.
|
|
63
|
-
- More than 2 fix steps →
|
|
90
|
+
- More than 2 fix steps → the §2.0bis plan is already written: track its numbered steps with `TaskCreate` where the harness offers one, otherwise tick them off in `04-fix.md` where they stand. One task per step, same order, marked `in_progress` and `completed` as they go — not batched.
|
|
64
91
|
- **Comment discipline**: comment only a *why* the code cannot say (a non-obvious constraint, the reason for a workaround, a subtle invariant); match the surrounding file's comment density. **Never write the ticket ID or "fix for #N" into a code comment** — that lives in the commit/branch/MR-PR.
|
|
65
92
|
- Keep the log updated while editing.
|
|
66
93
|
|
|
@@ -114,6 +141,9 @@ A **product decision** the fix turns out to need is neither of these — not sco
|
|
|
114
141
|
**What is NOT touched**:
|
|
115
142
|
- <adjacent areas out of scope>
|
|
116
143
|
|
|
144
|
+
## Plan
|
|
145
|
+
<the numbered steps of §2.0bis, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 2 steps`). What §2.1 tracks with `TaskCreate`. Steps are annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
146
|
+
|
|
117
147
|
## Fix description
|
|
118
148
|
<one sentence: "The fix consists of …">
|
|
119
149
|
|
|
@@ -55,7 +55,7 @@ Rules for writing it:
|
|
|
55
55
|
|
|
56
56
|
**Ask the user with `AskUserQuestion`** whether the brief reflects what they expect — **hard gate, in every autonomy mode, `auto` included**: it is the last point where scope can be corrected before there is a diff to argue with.
|
|
57
57
|
|
|
58
|
-
In `
|
|
58
|
+
In `auto` this is one of the only two stops per MR/PR (`guided` adds the plan of §2.0ter on a big one), so it carries the **full stop header** (flow-core §3) — ticket, size, phase, `MR #<n> of <N>`, plan state — followed by the brief. Options:
|
|
59
59
|
- **Yes, proceed** → start building.
|
|
60
60
|
- **No, something is extra or missing** → the user clarifies, adjust the brief, ask again. **Do not touch code** until the brief is confirmed.
|
|
61
61
|
|
|
@@ -80,7 +80,36 @@ Hard rules:
|
|
|
80
80
|
- **If there is a "Pattern deviation" section**: copy it too — it reminds you at coding time not to mimic the repo pattern.
|
|
81
81
|
- **If the design says "none"** (no external surfaces), skip this step and record: "## Contracts to respect — none declared in design".
|
|
82
82
|
|
|
83
|
-
Without this copy, do not proceed to §2.
|
|
83
|
+
Without this copy, do not proceed to §2.0ter.
|
|
84
|
+
|
|
85
|
+
## 2.0ter Plan this MR/PR (size-gated)
|
|
86
|
+
|
|
87
|
+
`03-design.md` §"Implementation plan (order)" is the **feature's** order, written before `/flow:feat:plan` split anything — it does not know which of its steps belong to this MR/PR. The brief above says what this MR/PR delivers in business terms; neither says which files are touched in which order. On a MR/PR big enough to lose its thread, that plan is written here.
|
|
88
|
+
|
|
89
|
+
**Gate — run this step only when the current `mrs[]` entry is big enough**: `lines_est > 150` **or** `files_est > 5`. No estimates in the entry (an older plan) → fall back to its `size`: `M`/`L` run it, `XS`/`S` skip. No `mrs[]` at all (XS/S, single MR/PR) → skip; the brief and the contracts are the whole plan, and a 30-line change does not earn a planning round. Skipped → record one line in `05-implementation.md` — the estimates that let it through (`plan: skipped — 40 lines / 2 files`), or `plan: skipped — single MR/PR` when there is no entry to read — and go to §2.1.
|
|
90
|
+
|
|
91
|
+
Write it against `03-design.md` and the contracts just copied — **no code yet, no exploratory edits**. Under 250 words, as numbered steps:
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
## Plan MR/PR #N
|
|
95
|
+
1. <step> — `<file or path>` — <test that proves it, or "covered by step M">
|
|
96
|
+
2. …
|
|
97
|
+
|
|
98
|
+
- **Point of no return**: <the migration, contract, published event or flag after which rollback stops being a revert — or "none">.
|
|
99
|
+
- **Out of this plan**: <what belongs to a later MR/PR and will be tempting while inside these files>.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Rules for the steps:
|
|
103
|
+
- **A step is a thing on disk**, not a phase of thought: "add the nullable column + migration", not "analyse the schema". A step nobody can tell is finished is two steps or none.
|
|
104
|
+
- **Order by what unblocks what**, and put the point of no return as late as the design allows: everything reversible lands before it.
|
|
105
|
+
- **Every step names its test** or the step that covers it. A step that proves no acceptance criterion and guards no contract is a candidate to cut — same bar as `03-design.md` §"Planned tests".
|
|
106
|
+
- Steps come from the **design**, not from the repo you are about to open. A step the design never mentions is either a deviation to log (§3 "Deviations from design") or scope that belongs in §2.4.
|
|
107
|
+
|
|
108
|
+
**Present it, then behave by mode:**
|
|
109
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, and one `AskUserQuestion` — **Approve and build** · **Change the order or the steps** (the user edits, rewrite it, ask again). This is a genuine decision point: the order of an irreversible step is exactly what is expensive to argue with once there is a diff.
|
|
110
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
111
|
+
|
|
112
|
+
Save it in `05-implementation.md` under `## Plan MR/PR #N`, right after the brief. It is what seeds `TaskCreate` in §2.1, and what a §2.3 hot cut splits: the steps already done stay in this MR/PR, the ones still pending move to the new entry.
|
|
84
113
|
|
|
85
114
|
## 2.1 Work
|
|
86
115
|
|
|
@@ -111,7 +140,7 @@ Execution mode:
|
|
|
111
140
|
- **Give it a bounded first step.** A piece with no natural first move ("do the whole module") produces nothing for hours; split it by file or by numbered step until it has one.
|
|
112
141
|
- **Check the round at every stop of this command**, not only at the end: an agent past `agents.stall_after_minutes` (empty → 25) with nothing written to its path is stopped, split in two and relaunched.
|
|
113
142
|
|
|
114
|
-
Use `TaskCreate` to track the steps from the
|
|
143
|
+
Use `TaskCreate` to track the steps of the **§2.0ter plan for this MR/PR** — one task per numbered step, same order. Step skipped there (small MR/PR) → seed from `03-design.md` §"Implementation plan (order)", taking only the steps this MR/PR covers per `04-mr-plan.md`; the feature's plan predates the split and carries steps that belong to siblings. Mark each step `in_progress` when starting and `completed` when done — do not batch.
|
|
115
144
|
|
|
116
145
|
### 2.1bis The premise this change rests on (any size, XS included)
|
|
117
146
|
|
|
@@ -217,7 +246,7 @@ Warning thresholds:
|
|
|
217
246
|
|
|
218
247
|
If either is exceeded, **pause** and ask the user with `AskUserQuestion` (options, in this order):
|
|
219
248
|
|
|
220
|
-
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains
|
|
249
|
+
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains — the §2.0ter steps still pending, or what is left of `04-mr-plan.md` where that step was skipped — goes into a new one inserted in `meta.json.mrs` right after. Zero code wasted.
|
|
221
250
|
2. **Continue and record the overrun**. When the cut would be artificial. Note the deviation in `05-implementation.md` to calibrate `/flow:feat:plan` on future tickets.
|
|
222
251
|
3. **Reopen plan**. Return to `/flow:feat:plan` to rethink the entire split. Only if the overrun shows the plan is wrong at a deeper level, not just that this MR/PR is slightly underestimated.
|
|
223
252
|
|
|
@@ -265,6 +294,9 @@ Keep `.claude/work/<TICKET>/05-implementation.md` updated as you work (not at th
|
|
|
265
294
|
**This MR/PR does NOT include**:
|
|
266
295
|
- <pieces that are out of scope>
|
|
267
296
|
|
|
297
|
+
## Plan MR/PR #N
|
|
298
|
+
<the numbered steps of §2.0ter, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 40 lines / 2 files`). What §2.1 seeds `TaskCreate` from and what a §2.3 cut splits. Steps are struck through or annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
299
|
+
|
|
268
300
|
## Changes per file
|
|
269
301
|
- <file> — what changed and why (1 line each)
|
|
270
302
|
|
package/adapters/hermes/CORE.md
CHANGED
|
@@ -17,7 +17,7 @@ Every `/flow-*` command assumes these rules. They are stated once, here, so a co
|
|
|
17
17
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
18
18
|
`flow-core`" means this file.
|
|
19
19
|
|
|
20
|
-
**This file belongs to flow `0.
|
|
20
|
+
**This file belongs to flow `0.70.0`.** Compare it once, at the start of the session, against
|
|
21
21
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
22
22
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
23
23
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -48,7 +48,7 @@ What is NOT touched:
|
|
|
48
48
|
|
|
49
49
|
**Ask with `AskUserQuestion`** whether this reflects the expected fix — a hard gate, **in every mode, `auto` included**: widening the fix is the main source of collateral regressions, and this is the last point to settle scope before there is a diff.
|
|
50
50
|
|
|
51
|
-
In `
|
|
51
|
+
In `auto` this is one of the only two stops of the whole flow (this one and `ship`; `guided` adds the plan of §2.0bis on a fix of more than two steps): open with the **full stop header** (flow-core §3), then the brief. Options:
|
|
52
52
|
- **Yes, go ahead** → apply the fix.
|
|
53
53
|
- **No, something is missing or wrong** → adjust the brief, ask again. No code until confirmed.
|
|
54
54
|
|
|
@@ -60,11 +60,38 @@ blockers lived in the half a third option let in.
|
|
|
60
60
|
|
|
61
61
|
Save the brief at the top of `04-fix.md`. Any "also fix X while we're at it" during implementation → §2.3.
|
|
62
62
|
|
|
63
|
+
## 2.0bis Plan the fix (more than 2 steps)
|
|
64
|
+
|
|
65
|
+
A fix of one or two steps is its own plan, and a planning round on it is pure friction. Past that the steps stop fitting in the brief — which says what stops happening, never in which file — and the fix starts being discovered while it is typed. **Trigger: more than 2 fix steps.** Two or fewer → skip, record one line in `04-fix.md` (`plan: skipped — 2 steps`) and go to §2.1.
|
|
66
|
+
|
|
67
|
+
The steps come from the root cause in `03-investigation.md`, not from the repo you are about to open: a step that cause never implied is either the investigation being wrong (§4.1) or scope that belongs in §2.3. **No code yet.** Under 200 words:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## Plan
|
|
71
|
+
1. <step> — `<file or path>` — <the test that proves it, or "covered by step M">
|
|
72
|
+
2. …
|
|
73
|
+
|
|
74
|
+
- **Point of no return**: <the migration, contract or published event after which rollback stops being a revert — or "none">.
|
|
75
|
+
- **Out of this plan**: <the adjacent thing that will be tempting once these files are open>.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Rules, and the first one is the bug flow's own:
|
|
79
|
+
- **The regression test is a step, and it comes first when it can fail before the fix.** `/flow-bug-validate` is what proves the fix, and `/flow-bug-review` refuses to run without it on size ≥ S (`/flow-bug-start §2`). A plan that leaves the test until last has the one step that can still say "the cause was not this" arriving after everything is already built on the answer.
|
|
80
|
+
- **A step is a thing on disk**, not a phase of thought: "add the idempotency key on the retry path", not "look at the retry logic".
|
|
81
|
+
- **A step that widens the blast radius is not part of the minimal fix** (§2.1) — it goes to §2.3 before it is written down here, not after it is built.
|
|
82
|
+
- A fix whose plan needs more than about five steps is usually two tickets or a feature in disguise: check §4.2 before planning further.
|
|
83
|
+
|
|
84
|
+
**Present it, then behave by mode:**
|
|
85
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, one `AskUserQuestion` — **Approve and fix** · **Change the order or the steps**. On a bug the order is the decision: it is what settles whether the proof comes before the repair.
|
|
86
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
87
|
+
|
|
88
|
+
Save it in `04-fix.md` under `## Plan`, right after the brief. **A fix that was going to be one step and turns into a third**: come back here and write it then — the trigger is the shape of the work, not the moment it was first guessed.
|
|
89
|
+
|
|
63
90
|
## 2.1 Work
|
|
64
91
|
|
|
65
92
|
- Apply the minimal fix targeting the finding of `03-investigation.md` (or the diagnosis if investigate was skipped).
|
|
66
93
|
- Sensitive area (authentication, payments, sensitive data) → consult the `agents.architecture` agent from FLOW.md to confirm the correct layer; empty → check against `conventions` in FLOW.md.
|
|
67
|
-
- More than 2 fix steps →
|
|
94
|
+
- More than 2 fix steps → the §2.0bis plan is already written: track its numbered steps with `TaskCreate` where the harness offers one, otherwise tick them off in `04-fix.md` where they stand. One task per step, same order, marked `in_progress` and `completed` as they go — not batched.
|
|
68
95
|
- **Comment discipline**: comment only a *why* the code cannot say (a non-obvious constraint, the reason for a workaround, a subtle invariant); match the surrounding file's comment density. **Never write the ticket ID or "fix for #N" into a code comment** — that lives in the commit/branch/MR-PR.
|
|
69
96
|
- Keep the log updated while editing.
|
|
70
97
|
|
|
@@ -118,6 +145,9 @@ A **product decision** the fix turns out to need is neither of these — not sco
|
|
|
118
145
|
**What is NOT touched**:
|
|
119
146
|
- <adjacent areas out of scope>
|
|
120
147
|
|
|
148
|
+
## Plan
|
|
149
|
+
<the numbered steps of §2.0bis, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 2 steps`). What §2.1 tracks with `TaskCreate`. Steps are annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
150
|
+
|
|
121
151
|
## Fix description
|
|
122
152
|
<one sentence: "The fix consists of …">
|
|
123
153
|
|
|
@@ -59,7 +59,7 @@ Rules for writing it:
|
|
|
59
59
|
|
|
60
60
|
**Ask the user with `AskUserQuestion`** whether the brief reflects what they expect — **hard gate, in every autonomy mode, `auto` included**: it is the last point where scope can be corrected before there is a diff to argue with.
|
|
61
61
|
|
|
62
|
-
In `
|
|
62
|
+
In `auto` this is one of the only two stops per MR/PR (`guided` adds the plan of §2.0ter on a big one), so it carries the **full stop header** (flow-core §3) — ticket, size, phase, `MR #<n> of <N>`, plan state — followed by the brief. Options:
|
|
63
63
|
- **Yes, proceed** → start building.
|
|
64
64
|
- **No, something is extra or missing** → the user clarifies, adjust the brief, ask again. **Do not touch code** until the brief is confirmed.
|
|
65
65
|
|
|
@@ -84,7 +84,36 @@ Hard rules:
|
|
|
84
84
|
- **If there is a "Pattern deviation" section**: copy it too — it reminds you at coding time not to mimic the repo pattern.
|
|
85
85
|
- **If the design says "none"** (no external surfaces), skip this step and record: "## Contracts to respect — none declared in design".
|
|
86
86
|
|
|
87
|
-
Without this copy, do not proceed to §2.
|
|
87
|
+
Without this copy, do not proceed to §2.0ter.
|
|
88
|
+
|
|
89
|
+
## 2.0ter Plan this MR/PR (size-gated)
|
|
90
|
+
|
|
91
|
+
`03-design.md` §"Implementation plan (order)" is the **feature's** order, written before `/flow-feat-plan` split anything — it does not know which of its steps belong to this MR/PR. The brief above says what this MR/PR delivers in business terms; neither says which files are touched in which order. On a MR/PR big enough to lose its thread, that plan is written here.
|
|
92
|
+
|
|
93
|
+
**Gate — run this step only when the current `mrs[]` entry is big enough**: `lines_est > 150` **or** `files_est > 5`. No estimates in the entry (an older plan) → fall back to its `size`: `M`/`L` run it, `XS`/`S` skip. No `mrs[]` at all (XS/S, single MR/PR) → skip; the brief and the contracts are the whole plan, and a 30-line change does not earn a planning round. Skipped → record one line in `05-implementation.md` — the estimates that let it through (`plan: skipped — 40 lines / 2 files`), or `plan: skipped — single MR/PR` when there is no entry to read — and go to §2.1.
|
|
94
|
+
|
|
95
|
+
Write it against `03-design.md` and the contracts just copied — **no code yet, no exploratory edits**. Under 250 words, as numbered steps:
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
## Plan MR/PR #N
|
|
99
|
+
1. <step> — `<file or path>` — <test that proves it, or "covered by step M">
|
|
100
|
+
2. …
|
|
101
|
+
|
|
102
|
+
- **Point of no return**: <the migration, contract, published event or flag after which rollback stops being a revert — or "none">.
|
|
103
|
+
- **Out of this plan**: <what belongs to a later MR/PR and will be tempting while inside these files>.
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Rules for the steps:
|
|
107
|
+
- **A step is a thing on disk**, not a phase of thought: "add the nullable column + migration", not "analyse the schema". A step nobody can tell is finished is two steps or none.
|
|
108
|
+
- **Order by what unblocks what**, and put the point of no return as late as the design allows: everything reversible lands before it.
|
|
109
|
+
- **Every step names its test** or the step that covers it. A step that proves no acceptance criterion and guards no contract is a candidate to cut — same bar as `03-design.md` §"Planned tests".
|
|
110
|
+
- Steps come from the **design**, not from the repo you are about to open. A step the design never mentions is either a deviation to log (§3 "Deviations from design") or scope that belongs in §2.4.
|
|
111
|
+
|
|
112
|
+
**Present it, then behave by mode:**
|
|
113
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, and one `AskUserQuestion` — **Approve and build** · **Change the order or the steps** (the user edits, rewrite it, ask again). This is a genuine decision point: the order of an irreversible step is exactly what is expensive to argue with once there is a diff.
|
|
114
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
115
|
+
|
|
116
|
+
Save it in `05-implementation.md` under `## Plan MR/PR #N`, right after the brief. It is what seeds `TaskCreate` in §2.1, and what a §2.3 hot cut splits: the steps already done stay in this MR/PR, the ones still pending move to the new entry.
|
|
88
117
|
|
|
89
118
|
## 2.1 Work
|
|
90
119
|
|
|
@@ -115,7 +144,7 @@ Execution mode:
|
|
|
115
144
|
- **Give it a bounded first step.** A piece with no natural first move ("do the whole module") produces nothing for hours; split it by file or by numbered step until it has one.
|
|
116
145
|
- **Check the round at every stop of this command**, not only at the end: an agent past `agents.stall_after_minutes` (empty → 25) with nothing written to its path is stopped, split in two and relaunched.
|
|
117
146
|
|
|
118
|
-
Use `TaskCreate` to track the steps from the
|
|
147
|
+
Use `TaskCreate` to track the steps of the **§2.0ter plan for this MR/PR** — one task per numbered step, same order. Step skipped there (small MR/PR) → seed from `03-design.md` §"Implementation plan (order)", taking only the steps this MR/PR covers per `04-mr-plan.md`; the feature's plan predates the split and carries steps that belong to siblings. Mark each step `in_progress` when starting and `completed` when done — do not batch.
|
|
119
148
|
|
|
120
149
|
### 2.1bis The premise this change rests on (any size, XS included)
|
|
121
150
|
|
|
@@ -221,7 +250,7 @@ Warning thresholds:
|
|
|
221
250
|
|
|
222
251
|
If either is exceeded, **pause** and ask the user with `AskUserQuestion` (options, in this order):
|
|
223
252
|
|
|
224
|
-
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains
|
|
253
|
+
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains — the §2.0ter steps still pending, or what is left of `04-mr-plan.md` where that step was skipped — goes into a new one inserted in `meta.json.mrs` right after. Zero code wasted.
|
|
225
254
|
2. **Continue and record the overrun**. When the cut would be artificial. Note the deviation in `05-implementation.md` to calibrate `/flow-feat-plan` on future tickets.
|
|
226
255
|
3. **Reopen plan**. Return to `/flow-feat-plan` to rethink the entire split. Only if the overrun shows the plan is wrong at a deeper level, not just that this MR/PR is slightly underestimated.
|
|
227
256
|
|
|
@@ -269,6 +298,9 @@ Keep `.claude/work/<TICKET>/05-implementation.md` updated as you work (not at th
|
|
|
269
298
|
**This MR/PR does NOT include**:
|
|
270
299
|
- <pieces that are out of scope>
|
|
271
300
|
|
|
301
|
+
## Plan MR/PR #N
|
|
302
|
+
<the numbered steps of §2.0ter, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 40 lines / 2 files`). What §2.1 seeds `TaskCreate` from and what a §2.3 cut splits. Steps are struck through or annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
303
|
+
|
|
272
304
|
## Changes per file
|
|
273
305
|
- <file> — what changed and why (1 line each)
|
|
274
306
|
|
|
@@ -16,7 +16,7 @@ Every `/flow-*` command assumes these rules. They are stated once, here, so a co
|
|
|
16
16
|
carries what is specific to its phase. Read this once per session; a command that says "load
|
|
17
17
|
`flow-core`" means this file.
|
|
18
18
|
|
|
19
|
-
**This file belongs to flow `0.
|
|
19
|
+
**This file belongs to flow `0.70.0`.** Compare it once, at the start of the session, against
|
|
20
20
|
`version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
|
|
21
21
|
is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
|
|
22
22
|
— which is exactly what happens when a branch or a release candidate is loaded over an installed
|
|
@@ -46,7 +46,7 @@ What is NOT touched:
|
|
|
46
46
|
|
|
47
47
|
**Ask with `AskUserQuestion`** whether this reflects the expected fix — a hard gate, **in every mode, `auto` included**: widening the fix is the main source of collateral regressions, and this is the last point to settle scope before there is a diff.
|
|
48
48
|
|
|
49
|
-
In `
|
|
49
|
+
In `auto` this is one of the only two stops of the whole flow (this one and `ship`; `guided` adds the plan of §2.0bis on a fix of more than two steps): open with the **full stop header** (flow-core §3), then the brief. Options:
|
|
50
50
|
- **Yes, go ahead** → apply the fix.
|
|
51
51
|
- **No, something is missing or wrong** → adjust the brief, ask again. No code until confirmed.
|
|
52
52
|
|
|
@@ -58,11 +58,38 @@ blockers lived in the half a third option let in.
|
|
|
58
58
|
|
|
59
59
|
Save the brief at the top of `04-fix.md`. Any "also fix X while we're at it" during implementation → §2.3.
|
|
60
60
|
|
|
61
|
+
## 2.0bis Plan the fix (more than 2 steps)
|
|
62
|
+
|
|
63
|
+
A fix of one or two steps is its own plan, and a planning round on it is pure friction. Past that the steps stop fitting in the brief — which says what stops happening, never in which file — and the fix starts being discovered while it is typed. **Trigger: more than 2 fix steps.** Two or fewer → skip, record one line in `04-fix.md` (`plan: skipped — 2 steps`) and go to §2.1.
|
|
64
|
+
|
|
65
|
+
The steps come from the root cause in `03-investigation.md`, not from the repo you are about to open: a step that cause never implied is either the investigation being wrong (§4.1) or scope that belongs in §2.3. **No code yet.** Under 200 words:
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
## Plan
|
|
69
|
+
1. <step> — `<file or path>` — <the test that proves it, or "covered by step M">
|
|
70
|
+
2. …
|
|
71
|
+
|
|
72
|
+
- **Point of no return**: <the migration, contract or published event after which rollback stops being a revert — or "none">.
|
|
73
|
+
- **Out of this plan**: <the adjacent thing that will be tempting once these files are open>.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Rules, and the first one is the bug flow's own:
|
|
77
|
+
- **The regression test is a step, and it comes first when it can fail before the fix.** `/flow-bug-validate` is what proves the fix, and `/flow-bug-review` refuses to run without it on size ≥ S (`/flow-bug-start §2`). A plan that leaves the test until last has the one step that can still say "the cause was not this" arriving after everything is already built on the answer.
|
|
78
|
+
- **A step is a thing on disk**, not a phase of thought: "add the idempotency key on the retry path", not "look at the retry logic".
|
|
79
|
+
- **A step that widens the blast radius is not part of the minimal fix** (§2.1) — it goes to §2.3 before it is written down here, not after it is built.
|
|
80
|
+
- A fix whose plan needs more than about five steps is usually two tickets or a feature in disguise: check §4.2 before planning further.
|
|
81
|
+
|
|
82
|
+
**Present it, then behave by mode:**
|
|
83
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, one `AskUserQuestion` — **Approve and fix** · **Change the order or the steps**. On a bug the order is the decision: it is what settles whether the proof comes before the repair.
|
|
84
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
85
|
+
|
|
86
|
+
Save it in `04-fix.md` under `## Plan`, right after the brief. **A fix that was going to be one step and turns into a third**: come back here and write it then — the trigger is the shape of the work, not the moment it was first guessed.
|
|
87
|
+
|
|
61
88
|
## 2.1 Work
|
|
62
89
|
|
|
63
90
|
- Apply the minimal fix targeting the finding of `03-investigation.md` (or the diagnosis if investigate was skipped).
|
|
64
91
|
- Sensitive area (authentication, payments, sensitive data) → consult the `agents.architecture` agent from FLOW.md to confirm the correct layer; empty → check against `conventions` in FLOW.md.
|
|
65
|
-
- More than 2 fix steps →
|
|
92
|
+
- More than 2 fix steps → the §2.0bis plan is already written: track its numbered steps with `TaskCreate` where the harness offers one, otherwise tick them off in `04-fix.md` where they stand. One task per step, same order, marked `in_progress` and `completed` as they go — not batched.
|
|
66
93
|
- **Comment discipline**: comment only a *why* the code cannot say (a non-obvious constraint, the reason for a workaround, a subtle invariant); match the surrounding file's comment density. **Never write the ticket ID or "fix for #N" into a code comment** — that lives in the commit/branch/MR-PR.
|
|
67
94
|
- Keep the log updated while editing.
|
|
68
95
|
|
|
@@ -116,6 +143,9 @@ A **product decision** the fix turns out to need is neither of these — not sco
|
|
|
116
143
|
**What is NOT touched**:
|
|
117
144
|
- <adjacent areas out of scope>
|
|
118
145
|
|
|
146
|
+
## Plan
|
|
147
|
+
<the numbered steps of §2.0bis, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 2 steps`). What §2.1 tracks with `TaskCreate`. Steps are annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
148
|
+
|
|
119
149
|
## Fix description
|
|
120
150
|
<one sentence: "The fix consists of …">
|
|
121
151
|
|
|
@@ -57,7 +57,7 @@ Rules for writing it:
|
|
|
57
57
|
|
|
58
58
|
**Ask the user with `AskUserQuestion`** whether the brief reflects what they expect — **hard gate, in every autonomy mode, `auto` included**: it is the last point where scope can be corrected before there is a diff to argue with.
|
|
59
59
|
|
|
60
|
-
In `
|
|
60
|
+
In `auto` this is one of the only two stops per MR/PR (`guided` adds the plan of §2.0ter on a big one), so it carries the **full stop header** (flow-core §3) — ticket, size, phase, `MR #<n> of <N>`, plan state — followed by the brief. Options:
|
|
61
61
|
- **Yes, proceed** → start building.
|
|
62
62
|
- **No, something is extra or missing** → the user clarifies, adjust the brief, ask again. **Do not touch code** until the brief is confirmed.
|
|
63
63
|
|
|
@@ -82,7 +82,36 @@ Hard rules:
|
|
|
82
82
|
- **If there is a "Pattern deviation" section**: copy it too — it reminds you at coding time not to mimic the repo pattern.
|
|
83
83
|
- **If the design says "none"** (no external surfaces), skip this step and record: "## Contracts to respect — none declared in design".
|
|
84
84
|
|
|
85
|
-
Without this copy, do not proceed to §2.
|
|
85
|
+
Without this copy, do not proceed to §2.0ter.
|
|
86
|
+
|
|
87
|
+
## 2.0ter Plan this MR/PR (size-gated)
|
|
88
|
+
|
|
89
|
+
`03-design.md` §"Implementation plan (order)" is the **feature's** order, written before `/flow-feat-plan` split anything — it does not know which of its steps belong to this MR/PR. The brief above says what this MR/PR delivers in business terms; neither says which files are touched in which order. On a MR/PR big enough to lose its thread, that plan is written here.
|
|
90
|
+
|
|
91
|
+
**Gate — run this step only when the current `mrs[]` entry is big enough**: `lines_est > 150` **or** `files_est > 5`. No estimates in the entry (an older plan) → fall back to its `size`: `M`/`L` run it, `XS`/`S` skip. No `mrs[]` at all (XS/S, single MR/PR) → skip; the brief and the contracts are the whole plan, and a 30-line change does not earn a planning round. Skipped → record one line in `05-implementation.md` — the estimates that let it through (`plan: skipped — 40 lines / 2 files`), or `plan: skipped — single MR/PR` when there is no entry to read — and go to §2.1.
|
|
92
|
+
|
|
93
|
+
Write it against `03-design.md` and the contracts just copied — **no code yet, no exploratory edits**. Under 250 words, as numbered steps:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
## Plan MR/PR #N
|
|
97
|
+
1. <step> — `<file or path>` — <test that proves it, or "covered by step M">
|
|
98
|
+
2. …
|
|
99
|
+
|
|
100
|
+
- **Point of no return**: <the migration, contract, published event or flag after which rollback stops being a revert — or "none">.
|
|
101
|
+
- **Out of this plan**: <what belongs to a later MR/PR and will be tempting while inside these files>.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Rules for the steps:
|
|
105
|
+
- **A step is a thing on disk**, not a phase of thought: "add the nullable column + migration", not "analyse the schema". A step nobody can tell is finished is two steps or none.
|
|
106
|
+
- **Order by what unblocks what**, and put the point of no return as late as the design allows: everything reversible lands before it.
|
|
107
|
+
- **Every step names its test** or the step that covers it. A step that proves no acceptance criterion and guards no contract is a candidate to cut — same bar as `03-design.md` §"Planned tests".
|
|
108
|
+
- Steps come from the **design**, not from the repo you are about to open. A step the design never mentions is either a deviation to log (§3 "Deviations from design") or scope that belongs in §2.4.
|
|
109
|
+
|
|
110
|
+
**Present it, then behave by mode:**
|
|
111
|
+
- `manual` / `guided` → **stop**: full stop header (flow-core §3), the plan, and one `AskUserQuestion` — **Approve and build** · **Change the order or the steps** (the user edits, rewrite it, ask again). This is a genuine decision point: the order of an irreversible step is exactly what is expensive to argue with once there is a diff.
|
|
112
|
+
- `auto` → **do not stop**. Print the numbered steps and the point of no return, record the plan as accepted, and open the same message with the call that starts §2.1 (flow-core §3: a report is never the last thing in a turn you meant to continue).
|
|
113
|
+
|
|
114
|
+
Save it in `05-implementation.md` under `## Plan MR/PR #N`, right after the brief. It is what seeds `TaskCreate` in §2.1, and what a §2.3 hot cut splits: the steps already done stay in this MR/PR, the ones still pending move to the new entry.
|
|
86
115
|
|
|
87
116
|
## 2.1 Work
|
|
88
117
|
|
|
@@ -113,7 +142,7 @@ Execution mode:
|
|
|
113
142
|
- **Give it a bounded first step.** A piece with no natural first move ("do the whole module") produces nothing for hours; split it by file or by numbered step until it has one.
|
|
114
143
|
- **Check the round at every stop of this command**, not only at the end: an agent past `agents.stall_after_minutes` (empty → 25) with nothing written to its path is stopped, split in two and relaunched.
|
|
115
144
|
|
|
116
|
-
Use `TaskCreate` to track the steps from the
|
|
145
|
+
Use `TaskCreate` to track the steps of the **§2.0ter plan for this MR/PR** — one task per numbered step, same order. Step skipped there (small MR/PR) → seed from `03-design.md` §"Implementation plan (order)", taking only the steps this MR/PR covers per `04-mr-plan.md`; the feature's plan predates the split and carries steps that belong to siblings. Mark each step `in_progress` when starting and `completed` when done — do not batch.
|
|
117
146
|
|
|
118
147
|
### 2.1bis The premise this change rests on (any size, XS included)
|
|
119
148
|
|
|
@@ -219,7 +248,7 @@ Warning thresholds:
|
|
|
219
248
|
|
|
220
249
|
If either is exceeded, **pause** and ask the user with `AskUserQuestion` (options, in this order):
|
|
221
250
|
|
|
222
|
-
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains
|
|
251
|
+
1. **Cut here (recommended if the current piece is coherent)**. What is built so far stays as this MR/PR; what remains — the §2.0ter steps still pending, or what is left of `04-mr-plan.md` where that step was skipped — goes into a new one inserted in `meta.json.mrs` right after. Zero code wasted.
|
|
223
252
|
2. **Continue and record the overrun**. When the cut would be artificial. Note the deviation in `05-implementation.md` to calibrate `/flow-feat-plan` on future tickets.
|
|
224
253
|
3. **Reopen plan**. Return to `/flow-feat-plan` to rethink the entire split. Only if the overrun shows the plan is wrong at a deeper level, not just that this MR/PR is slightly underestimated.
|
|
225
254
|
|
|
@@ -267,6 +296,9 @@ Keep `.claude/work/<TICKET>/05-implementation.md` updated as you work (not at th
|
|
|
267
296
|
**This MR/PR does NOT include**:
|
|
268
297
|
- <pieces that are out of scope>
|
|
269
298
|
|
|
299
|
+
## Plan MR/PR #N
|
|
300
|
+
<the numbered steps of §2.0ter, its point of no return and its "out of this plan" line — or one line saying the step was skipped and why (`plan: skipped — 40 lines / 2 files`). What §2.1 seeds `TaskCreate` from and what a §2.3 cut splits. Steps are struck through or annotated as they are reworked, never deleted: a plan edited to match what happened records nothing.>
|
|
301
|
+
|
|
270
302
|
## Changes per file
|
|
271
303
|
- <file> — what changed and why (1 line each)
|
|
272
304
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flow-workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.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.
|
|
6
|
+
"version": "0.70.0",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Alberto Vioque",
|
|
9
9
|
"email": "mashware@gmail.com"
|
|
@@ -5,6 +5,39 @@ 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.70.0 — The plan each MR/PR was built from belonged to the feature · 2026-09-21
|
|
9
|
+
|
|
10
|
+
**In short**
|
|
11
|
+
- **`/flow:feat:build` §2.0ter plans the MR/PR it is about to build**: numbered steps, each with its file and the test that proves it, plus the point of no return and what is out of scope. Gated on the entry already in `meta.json.mrs` — `lines_est > 150` or `files_est > 5` — so a small MR/PR never pays for a planning round.
|
|
12
|
+
- **`/flow:bug:fix` §2.0bis gives the same shape to a fix of more than two steps**, and leads it with the bug flow's own rule: the regression test is a step, and it comes first when it can fail before the fix.
|
|
13
|
+
- **`TaskCreate` seeds from that plan** instead of the design's implementation order, which was written before `/flow:feat:plan` split anything and handed each MR/PR its siblings' steps.
|
|
14
|
+
- **A compaction gives the contract back.** The `SessionStart` hook reads the event's `source`, and on `compact` prints the brief and plan from `05-implementation.md` or `04-fix.md` instead of "where was I" — and never invites a resume of work that never stopped.
|
|
15
|
+
- **`manual`/`guided` stop on the plan with one question; `auto` prints it and builds.** No plan-mode primitive is used, so every harness gets the same step.
|
|
16
|
+
|
|
17
|
+
`03-design.md` writes its implementation plan before the delivery split exists, so its steps never
|
|
18
|
+
knew which MR/PR they would land in — and `build` seeded its task list from that same list all the
|
|
19
|
+
same. Between the business brief, which says what the user gets and never in which file, and the
|
|
20
|
+
first edit, there was nothing that named a path. On a large MR/PR the work was being discovered
|
|
21
|
+
while it was typed, and the record of it arrived afterwards.
|
|
22
|
+
|
|
23
|
+
The gate reuses numbers that were already there. `/flow:feat:plan` estimates `lines_est` and
|
|
24
|
+
`files_est` per MR/PR, `§2.3` already measures the real diff against them, and the same pair now
|
|
25
|
+
decides whether a plan is worth writing. A bug has no `mrs[]` to estimate against — and an M bug is
|
|
26
|
+
often three lines in a hard place — so there the trigger stays the one the fix flow already used,
|
|
27
|
+
more than two steps, and a fix that turns into a third step mid-way comes back and writes it then.
|
|
28
|
+
|
|
29
|
+
The order is the decision being asked about, which is why the plan stops for one. On a bug that is
|
|
30
|
+
sharpest: `validate` is what proves a fix and `review` refuses to run without it above size S, so a
|
|
31
|
+
plan that leaves the regression test until last puts the one step that can still refute the root
|
|
32
|
+
cause after everything has been built on it.
|
|
33
|
+
|
|
34
|
+
Keeping a plan in context is a separate problem from writing one, and it is the hook's, not the
|
|
35
|
+
phase's. Re-reading the plan at every checkpoint spends tokens on the turns that lost nothing;
|
|
36
|
+
`SessionStart` already ran after every compaction and answered with the wrong thing, so the cost
|
|
37
|
+
now falls only on the compactions that actually happen. What it prints is labelled as a record of
|
|
38
|
+
what was agreed rather than an instruction — a hook's stdout arrives as context, and a stale plan
|
|
39
|
+
read as an order outranks the decision that replaced it.
|
|
40
|
+
|
|
8
41
|
## v0.69.0 — Waiting on the pipeline was paid for at the main thread's price · 2026-09-21
|
|
9
42
|
|
|
10
43
|
**In short**
|