pi-dev-flow 0.76.1 → 0.77.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,18 +5,36 @@
5
5
  ## Stage: finish
6
6
 
7
7
  **Reflect before you finish** — `flow finish` deletes `.dev-flow/<slug>/` and
8
- the session context goes with it. Run the end-of-session reflection (bare
9
- `flow reflect` protocol under *Reflect*) now and park real issues with
10
- `flow reflect`; then:
11
-
12
- - issues parked → ask **Fold? Fix? Drop?** and stop: fold = write the items
13
- into `.dev-flow/reflections.md` (your queue), fix = route them now via
14
- `flow doctor`, drop = discard them. The answer replaces **Finish?** — act
15
- on it, then run `flow finish --confirmed` without asking again;
16
- - nothing parked → ask the operator **Finish?** → `flow finish --confirmed`.
17
- Checkpoint report: stage line **🏁 finish · `<slug>`** — release recorded ·
18
- main state · unmerged count · reflections open · release-checklist open,
19
- then `Done:`/`Next steps:` per the Stage reports rule.
8
+ the session context goes with it. Run the end-of-session reflection now:
9
+
10
+ 1. `flow_stage({ op: "reflect", note })` — a fresh **read-only** reviewer reads
11
+ this session's transcript **and every `flow_stage` worker transcript**,
12
+ re-checks the open items in `.dev-flow/reflections.md`, dedupes against them
13
+ and the upstream issues, and returns numbered findings, each classified
14
+ **docs** (fix only in `project.md` → docs flow), **code** (fix in this
15
+ project's code, maybe the playbook too → patch flow) or **plugin** (dev-flow
16
+ itself → GitHub issue upstream), with a **fold** or **drop** recommendation.
17
+ `note` = anything the operator said about friction this session. If the
18
+ worker fails, run the review inline (bare `flow reflect` prints the protocol).
19
+ 2. Show the operator the list with your recommendation per item and ask
20
+ **fold or drop** for each (`fold 1,3 drop 2` is a fine answer) — then stop.
21
+ 3. Apply the answer: fold docs → `flow reflect --playbook "<note>"`; fold code →
22
+ `flow reflect --code "<note>"`; fold plugin → `flow reflect --plugin "<note>"`
23
+ prints the upstream recipe — search first, then `gh issue create` (the fold
24
+ answer is the confirmation; report the URL). **Plugin findings never become
25
+ rows in the project's `reflections.md`.** Drop → nothing is recorded. Open
26
+ items the reviewer found fixed → propose checking them off.
27
+ 4. Offer the fix / tidy suggestions the tool printed (`⚑ fix the open
28
+ reflections now?`, `↻ N closed reflection(s)`) — one line each, only when
29
+ printed; never start a fix flow without the operator's word.
30
+
31
+ The fold/drop answer replaces **Finish?** — act on it, then run
32
+ `flow finish --confirmed` without asking again. Nothing found → ask the
33
+ operator **Finish?** → `flow finish --confirmed`. A finish question with no
34
+ reflection recorded for the flow names it (advisory, never a block).
35
+ Checkpoint report: stage line **🏁 finish · `<slug>`** — release recorded ·
36
+ main state · unmerged count · reflections open · release-checklist open,
37
+ then `Done:`/`Next steps:` per the Stage reports rule.
20
38
 
21
39
  The question covers the whole cleanup and mentions any commits that look
22
40
  unmerged. `flow finish [slug]`:
@@ -50,6 +50,45 @@ Big slices can go to a worker so this conversation stays lean; small work and
50
50
  small fixes are fine inline. **Delegation is a tool, not a rule** — no gate
51
51
  asks who wrote a commit.
52
52
 
53
+ **The rule of thumb:** delegate a slice when it is in the plan, provable by
54
+ `flow check`, needs no operator input, and is large enough (≈4+ files or heavy
55
+ reading) that doing it here would crowd out the context you need for verify;
56
+ otherwise do it inline. The worker starts fresh and is briefed with the plan,
57
+ commits and checks, but it cannot see this chat, cannot ask the operator and
58
+ holds no gate.
59
+
60
+ Delegate when most of these hold:
61
+ - **Specifiable** — the slice fits a short `note`; its decisions are in
62
+ `plan.md`, not only in chat (write them there first if they are not).
63
+ - **Mechanically done** — `flow check` green plus an acceptance criterion you
64
+ can state proves it.
65
+ - **Broad** — ≈4+ files, a few hundred lines, or a lot of reading this session
66
+ will not need again (a mechanical sweep, a new module with its tests, a
67
+ migration).
68
+ - **Clean boundary** — it does not overlap uncommitted work in progress.
69
+ - **Context pressure** — this conversation is past ~40–50% of its window;
70
+ delegating beats compacting away detail.
71
+ - **Hands-off** — nothing mid-slice needs the operator.
72
+
73
+ Stay inline when any of these hold:
74
+ - **Small** — one or two files, a review finding, a verify follow-up, an
75
+ operator tweak: the note would cost more than the change.
76
+ - **Context already loaded** — mid-debug, you hold the failure; a handoff
77
+ throws that away.
78
+ - **Still being decided** — the approach is still moving in chat.
79
+ - **Operator-judged** — a UI pass, tier-2 items, anything that ends in a
80
+ question to the operator.
81
+ - **Integration** — the final wiring and polish before Verified? is yours: you
82
+ own verify.
83
+ - **Exploratory** — "find out why X": what you learn shapes the next step, and
84
+ a worker's summary is lossy.
85
+
86
+ Running it: one slice per worker, in sequence — read each returned diff before
87
+ briefing the next. Slice along the plan's steps, never into half-working
88
+ commits. When workers wrote most of the code, run a `review` before Verified?.
89
+ A worker that fails or stalls → take the slice over inline rather than
90
+ resending the same note.
91
+
53
92
  - `flow_stage({ op: "implement", note, label })` — a fresh pi session in the
54
93
  worktree, with read/bash/edit/write, edits and commits one slice. The tool
55
94
  adds the facts itself: the absolute plan path, the branch's commits, the
@@ -62,6 +101,10 @@ asks who wrote a commit.
62
101
  no stamp, no gate waits on it. On a non-trivial feature, run one before
63
102
  Verified?. Fix what is real (inline is fine), and re-review only if the fix
64
103
  was large.
104
+ - `flow_stage({ op: "reflect", note })` — a fresh **read-only** reviewer of this
105
+ session's transcripts (driver + every worker), at any stage; its standard
106
+ moment is finish (see Stage: finish). It returns classified reflection
107
+ findings with fold/drop recommendations and writes nothing.
65
108
  - One worker at a time per session. The worker holds no flow tool, so gates
66
109
  and checkpoints stay with you. Its transcript nests under this session in
67
110
  pi's picker.
@@ -2,64 +2,64 @@
2
2
  > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
3
  > when the session reaches that stage.
4
4
 
5
- ## Reflect (your suggestion queue)
5
+ ## Reflect (this project's suggestion queue)
6
6
 
7
- Anything the playbook or plugin should improve (drifted commands, gate friction,
8
- a plugin bug) gets parked, not complained about:
9
- `flow reflect --playbook|--plugin "<one-line note>"`; gate flags are ignored —
10
- `flow reflect "<note>" --confirmed` queues the note alone. For a note to chase
11
- **now**: `flow doctor "<observation>"` prints an investigation brief without
12
- queueing. **You file the note, the tool does not guess**: `--playbook` puts it
13
- under `## playbook`, `--plugin` under `## plugin` (you already know which one it
14
- is — the session log does). With no flag the wording guesses ONE section and the
15
- printed line says why (`"gate" names dev-flow itself`, `playbook or project
16
- wording`, or `nothing plugin-shaped in the note …`); if the guess is wrong,
17
- `flow reflect list` numbers the queue and `flow reflect move <n> --plugin` (or
18
- `--playbook`) re-files the item — never hand-retype it. Nothing is ever written
19
- to both sections: one note, one home, one route. The open count shows in status
20
- and stage context; the operator decides:
7
+ Anything this project's playbook or code should improve (drifted commands, a
8
+ checklist that no longer fits, a script that keeps biting) gets parked, not
9
+ complained about. `.dev-flow/reflections.md` is **this project's** queue only:
10
+
11
+ - `flow reflect --playbook "<note>"` — the fix lives only in `project.md` →
12
+ `## playbook`, fixed by a **docs flow** (`flow start fold-<topic> --docs --confirmed`).
13
+ - `flow reflect --code "<note>"` — the fix touches this project's code (maybe
14
+ the playbook too) → `## code`, fixed by a **patch flow**
15
+ (`flow start fix-<topic> --patch --confirmed`; a normal flow when bigger).
16
+ - `flow reflect --plugin "<note>"` — dev-flow itself. **Never written to
17
+ reflections.md**: it prints the upstream recipe — `gh issue list --repo
18
+ <dev-flow repo> --state all --search "<keywords>"` first (an issue the author
19
+ already answered is reported back, never re-filed), then `gh issue create`
20
+ with a detailed body ending `— reflection from <slug> <date>` so the fold
21
+ matches it. File it only on the operator's word. In the dev-flow repo itself
22
+ plugin is code, so `--plugin` files under `## code`.
23
+
24
+ Gate flags are ignored (`flow reflect "<note>" --confirmed` queues the note
25
+ alone). With no flag the wording guesses (plugin-shaped → the upstream recipe,
26
+ otherwise `## playbook`) and the printed line says why; `flow reflect list`
27
+ numbers the queue and `flow reflect move <n> --playbook|--code` re-files an
28
+ item — never hand-retype it. A legacy `## plugin` row from an older dev-flow is
29
+ flagged by `flow doctor` / `reflect list`: file it upstream and check it off
30
+ `— filed: gh#NNN`. For a note to chase **now**: `flow doctor "<observation>"`
31
+ prints an investigation brief without queueing.
21
32
 
22
33
  - Reflect real friction only, one line each, never the same issue twice.
23
- - **`flow reflect tidy` drops the closed (`- [x]`) items** — the `— fixed:` note has
24
- already recorded the outcome, so the check-off is history and the file stays
25
- scannable. Queueing a note, bare `reflect` and `doctor` all print the closed
26
- count with this verb when the pile grows; offer the tidy to the operator then.
27
- - **Bare `flow reflect` is the end-of-session reflection** — it runs as part
28
- of every finish (before the slug folder is deleted — see Stage: finish) and
29
- whenever the operator asks. It prints the
30
- protocol: review the full session log (messages, tool calls, results);
31
- re-check each open item against the current playbook and newer dev-flow
32
- versions (`npm view pi-dev-flow version` vs the running version, or
33
- `git ls-remote` for a git-installed copy — a newer one that fixes an
34
- item → recommend updating the plugin, check it off); queue deduplicated new
35
- findings; report playbook vs plugin items structurally; ask whether to fix
36
- now. The command writes nothing; you execute the protocol.
37
- - Plain `flow doctor` reviews the open items and **routes** each to the flow
38
- that implements it — playbook item → docs flow; plugin item → upstream issue
39
- (or a patch/normal flow in the dev-flow repo). It labels each item with the
40
- `## heading` it is filed under (the file is the record; the wording of the
41
- note decided nothing since the note was queued) and flags items sitting
42
- outside both sections. To fold items in on the
43
- operator's word: investigate, propose the fix, get confirmation, open the
44
- routed flow (playbook items: `flow start fold-<topic> --docs --confirmed`)
45
- and apply it there — project.md is editable only in that worktree. Check
46
- items off in `.dev-flow/reflections.md` (your queue, gitignored, yours to
47
- edit; not `project.md`) with `- [x]` and a `— folded: <what>` or
48
- `— fixed: <what>` note.
34
+ - **The end-of-session reflection runs at finish** (see Stage: finish): a
35
+ `flow_stage({ op: "reflect" })` worker reviews the whole session — driver and
36
+ every worker transcript — and the operator decides **fold or drop** per
37
+ finding. Bare `flow reflect` prints that protocol (bound: delegate to the
38
+ worker; unbound: review inline); the command writes nothing.
39
+ - **When to suggest fixing open items** — the tool prints `⚑ fix the open
40
+ reflections now?` only when a rule fires: an open item **recurred** this
41
+ session (strongest signal), an item is **≥ 14 days** old, **≥ 3 playbook
42
+ items** (one docs flow takes them all), or a **code** item while **between
43
+ flows**. It surfaces at finish, in an unbound session, and in `flow doctor` —
44
+ never mid-feature. Offer it in one line; the operator decides.
45
+ - **When to suggest the tidy** — `flow reflect tidy` drops the closed (`- [x]`)
46
+ items (the `— fixed:` note already recorded the outcome). The hint
47
+ `↻ N closed reflection(s)` prints when **≥ 5** are closed, when closed
48
+ **≥ open** with at least 3 closed, or when a closed item was filed **≥ 30
49
+ days** ago — at finish, after a `reflect` write, in bare `reflect` and doctor.
50
+ - Plain `flow doctor` reviews the open items and **routes** each — `## playbook`
51
+ → docs flow, `## code` → patch flow. To fold items in on the operator's word:
52
+ investigate, propose the fix, get confirmation, open the routed flow and apply
53
+ it there — project.md is editable only in a docs/patch worktree. Check items
54
+ off in `.dev-flow/reflections.md` (gitignored, yours to edit; not
55
+ `project.md`) with `- [x]` and a `— folded: <what>` or `— fixed: <what>` note.
49
56
  - **Open GitHub issues fold into the view** when the repo has a GitHub remote: `flow doctor` and
50
57
  `flow reflect list` list them under the local queue (read-time fold — issues are never imported,
51
58
  each item keeps one home). A local row an open issue already covers carries `⟷ gh#NNN` — fold it
52
59
  by checking the row off `— filed: gh#NNN` and resolving on GitHub. Unmatched upstream rows get a
53
60
  route, but their resolution is on GitHub (close there, never in reflections.md). A
54
- `~ gh#NNN may duplicate` hint is your verdict to make, never an auto-merge. When you file an
55
- issue for a local item, end its body with `— reflection from <slug> <date>` so future folds
56
- match it. No GitHub remote = silent; missing/offline `gh` or `DEV_FLOW_NO_ISSUES=1` = one skip line.
57
- - `## plugin` items, on the operator's go: search upstream first —
58
- `gh issue list --repo <dev-flow repo> --state all --search "<keywords>"` —
59
- an issue the author already answered (fixed or won't-fix) is reported back,
60
- never re-filed; no match → offer to file one (`gh issue create`; `glab issue
61
- create` on GitLab) with a detailed description, session evidence and a
62
- suggested fix; the operator confirms.
61
+ `~ gh#NNN may duplicate` hint is your verdict to make, never an auto-merge. No GitHub remote =
62
+ silent; missing/offline `gh` or `DEV_FLOW_NO_ISSUES=1` = one skip line.
63
63
 
64
64
 
65
65
  ## Roadmap (your backlog)