pi-dev-flow 0.85.1 → 0.86.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.
@@ -1,73 +1,45 @@
1
- > Part of the **dev-flow** playbook. The always-on ground rules live in
2
- > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
- > when the session reaches that stage.
1
+ > Part of the **dev-flow** playbook. Ground rules: [../SKILL.md](../SKILL.md).
4
2
 
5
3
  ## Stage: plan
6
4
 
7
- 1. Research the code the plan needs (reads are always allowed).
8
- 2. **Clarify before drafting**: preliminary direction in chat (findings, shape
9
- of the fix, open unknowns), mode proposal with its reason, your questions
10
- and the operator's; draft only after the direction is confirmed.
11
- 3. Write `.dev-flow/<slug>/plan/plan.md` — problem, approach, files to touch,
12
- test strategy, risks; reviewable, not exhaustive. **Land it on disk early and
13
- keep it current**: create the file the moment the direction is confirmed —
14
- don't wait for the finished plan — and amend it in the file as the discussion
15
- continues. Plan talk held only in the conversation is gone when pi
16
- auto-compacts mid-stage; the gate reviews the file, not the memory. The file
17
- name is itself the gate's proof: **plan.md** — a preliminary direction
18
- belongs *inside* plan.md (marked draft), never a separate
19
- `pre-plan`/`direction.md` file: the approve gate requires plan.md by name.
20
- Scope splits off at plan (the operator wants part of it later)? Park that
21
- part with `flow roadmap add "<title>" --slug=<slug> --brief=<notes>` — never
22
- a second `.dev-flow/<slug>/` written by hand.
23
- First check
24
- `git log origin/<default>..<default> --oneline`: local-only default-branch
25
- commits fall out of the worktree's base (push them or re-plan).
26
- 4. **UI flag set?** Mockups live in `plan/mockups/`, one HTML per screen/state
27
- (`<screen>.html`), linking the project's real stylesheet and class names
28
- where they exist (relative links work from `.dev-flow/`). At plan the
29
- feature has **no worktree yet** — link the main checkout's stylesheet
30
- (`../../../../<path>` from `plan/mockups/`), never another feature's
31
- worktree (the approve gate refuses it: that branch drifts and is removed at
32
- its finish); after approve, re-render against this feature's worktree any
33
- mockup you keep using. Every mockup
34
- must be **rendered** — an unrendered mockup is not a mockup:
35
- - Headless chromium: PATH `chromium`/`chromium-browser`/`google-chrome`,
36
- else playwright's
37
- `~/.cache/ms-playwright/*/chrome-headless-shell-linux64/chrome-headless-shell`.
38
- Render at the project's widths (default phone 390, desktop 1280):
39
- `<binary> --no-sandbox --disable-gpu --hide-scrollbars --virtual-time-budget=5000 --window-size=<width>,<height> --screenshot=plan/mockups/<screen>-<width>.png file://<absolute path to html>`
40
- — height per screen, re-render if clipped.
41
- - Embed every render in plan.md under its section —
42
- `![<screen> — phone](mockups/<screen>-390.png)`. Image syntax only (a
43
- filename in prose is a broken link); before Approve? re-check that every
44
- tag points at an existing file. The approve gate proves this: it opens
45
- plan.md and refuses every render file that is not embedded, and every
46
- `mockups/<screen>.html` with no embedded `<screen>-<width>.` shot.
47
- - No chromium anywhere → tell the operator and ask; `*.html`-only plans
48
- only with their OK (knob: `mockupGlobs`); never fake or skip silently.
49
- - Gotchas: for a component question prefer a **static strip** — standalone
50
- HTML with the real stylesheet carrying only the markup in question, one
51
- first-try render; a full-page render is for layout context only. Shots
52
- start top-left and never scroll — hide what is above a below-the-fold
53
- region (inline `<style>`) or use a strip. `--user-data-dir` profiles keep
54
- localStorage between shots — fresh profile dir per intended UI state.
55
- Planned behavior must be visibly patched into the shot and captioned as
56
- such — never caption the current app's render with the behavior you plan
57
- to add. The app's repaint can destroy a transient state (an inline
58
- editor) — freeze it for the shot (e.g. stub the render entry point after
59
- opening). If the harness fights the same shot twice, verify that state
60
- via DOM/code and move on — screenshots are a spot-check, not a test loop.
61
- 5. Tell the user the plan is ready and **stop** — one word: **Approve?**
62
- Answered → `flow approve --confirmed` (yolo → `flow approve --yolo
63
- --confirmed`). Checkpoint report: stage line **📝 plan · `<slug>`** — mode ·
64
- ui · plan status · mockups `rendered/total` · open questions, then
65
- `Done:`/`Next steps:` per the Stage reports rule.
5
+ No code edits before approval. Reads are always allowed.
66
6
 
67
- Approval creates the worktree and branch, running `commands.setup` inside when
68
- configured — a failing setup fails the gate and the next `approve` **retries**
69
- setup in the kept worktree (stamping `setupAt` on success) instead of silently
70
- reusing it. A `--docs` feature runs no project command at all. No code edits
71
- before approval. `(ui)` playbook items never apply to non-UI features or
72
- appear in prompts.
7
+ 1. **Research** the code the plan needs.
8
+ 2. **Clarify before drafting**: give your direction in chat — findings, shape
9
+ of the fix, open unknowns, the mode you propose and why — and ask your
10
+ questions. Draft only after the direction is confirmed.
11
+ 3. **Write `.dev-flow/<slug>/plan/plan.md`** — problem, approach, files to
12
+ touch, test strategy, risks. Reviewable, not exhaustive.
13
+ - Create it as soon as the direction is confirmed and keep it current: chat
14
+ is lost at compaction, the gate reads the file.
15
+ - The name is the proof: `plan.md`. A preliminary direction goes inside it
16
+ (marked draft) — never a separate file.
17
+ - Part of the scope deferred? `flow roadmap add "<title>" --slug=<slug>
18
+ --brief=<notes>` — never a second `.dev-flow/<slug>/` by hand.
19
+ - Run `git log origin/<default>..<default> --oneline` first: local-only
20
+ default-branch commits fall out of the worktree's base (push or re-plan).
21
+ 4. **UI feature?** Mockups in `plan/mockups/`, one `<screen>.html` per
22
+ screen/state, using the project's real stylesheet and class names.
23
+ - No worktree exists yet: link the **main checkout's** stylesheet
24
+ (`../../../../<path>`), never another feature's worktree (refused).
25
+ - Render every mockup with headless chromium (`chromium`,
26
+ `chromium-browser`, `google-chrome`, else playwright's
27
+ `~/.cache/ms-playwright/*/chrome-headless-shell-linux64/chrome-headless-shell`)
28
+ at the project's widths (default 390 and 1280):
29
+ `<binary> --no-sandbox --disable-gpu --hide-scrollbars --virtual-time-budget=5000 --window-size=<w>,<h> --screenshot=plan/mockups/<screen>-<w>.png file://<abs path>`
30
+ - Embed every render in plan.md as an image:
31
+ `![<screen> — phone](mockups/<screen>-390.png)`. The gate refuses any
32
+ render not embedded and any `.html` without a shot.
33
+ - No chromium anywhere → tell the operator and ask; HTML-only only with
34
+ their OK. Never fake or skip silently.
35
+ - Tips: prefer a static strip (just the component, real stylesheet) over a
36
+ full page; shots never scroll; use a fresh `--user-data-dir` per UI
37
+ state; caption planned behavior as planned; if a shot fights you twice,
38
+ verify the state in the DOM and move on.
39
+ 5. **Ask Approve? and stop.** Report opening: **📝 plan · `<slug>`** (the
40
+ gate's stage line). Answer → `flow approve --confirmed` (yolo → `flow
41
+ approve --yolo --confirmed`).
73
42
 
43
+ Approval creates the worktree and branch and runs `commands.setup` there; a
44
+ failing setup fails the gate and the next approve retries it. `(ui)` playbook
45
+ items apply only to UI features.
@@ -1,55 +1,44 @@
1
- > Part of the **dev-flow** playbook. The always-on ground rules live in
2
- > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
- > when the session reaches that stage.
1
+ > Part of the **dev-flow** playbook. Ground rules: [../SKILL.md](../SKILL.md).
4
2
 
5
3
  ## Stage: pre-release
6
4
 
7
- Implemented, tested, running locally; prepare the release entirely in the
8
- worktree — main-repo git state stays off-limits until this gate hands over.
9
- **Versioning:** the `versioning.file` manifest is the single source of truth
10
- and tags are `versioning.pattern` rendered from it — one number everywhere. If
11
- `versioning.file` is unset, stop and clarify the scheme with the user; never
12
- invent one mid-release. Sequence:
5
+ Prepare the release entirely in the worktree; main stays off-limits until the
6
+ release gate hands over.
13
7
 
14
- 1. `/flow-review` the change; fix every **Must fix** and **Should fix**
15
- finding; `flow test` again if code changed.
16
- 2. Update documentation to reflect the change.
17
- 3. Update the changelog and bump the manifest to the exact version you will
18
- tag — manifest, changelog and tag must agree; commit the prep on the feature
19
- branch. **The changelog writer reviews the branch, not its commit list**:
20
- read `git log <default>..HEAD` *and* `git diff <default>…HEAD` first and
21
- write the entry from the net change the branch delivers, in the reader's
22
- terms (what was broken, what works now) — this entry is also the forge
23
- release body, so it publishes verbatim. **One entry per net change, never
24
- one per commit:** a feature that needed iteration commits (the fix, its
25
- follow-up, the test that chases it) is **one** line telling the final state;
26
- two lines sharing a subject are the tell to merge them. Work that never
27
- reached the reader — reverted mid-branch, dropped on the way, pure moves —
28
- gets no line. Consolidating your own entry is fold-safe: the fold proofs
29
- below guard lines that were already pending under `Unreleased` (another
30
- flow's), which you move verbatim; your own prose is yours until the heading
31
- ships. A versioned release **folds the `Unreleased` section** (entries
32
- `--no-version` flows left there) under the new version heading: the gate
33
- refuses while entries remain, refuses a fold that **drops or rewrites** one
34
- (move the lines as they are and reword afterwards in a follow-up), and
35
- refuses a changelog this branch never touched. `--no-fold-check` skips only
36
- the line proofs, on the operator's word.
37
- 4. `flow check` — the prep edits made the implement checks stale; the release
38
- gate demands them green again.
39
- 5. State what the PR will contain, present version and changelog entry,
40
- **stop** — **Release?** → `flow release --confirmed`. Under a standing
41
- yolo you run `flow release` without asking. If it returns **NEEDS-OPERATOR
42
- Release?**, ask anyway: either commits landed after Verified? (the yolo
43
- predates them, and the gate names them), or the playbook sets
44
- `yolo = until-release`. Checkpoint report:
45
- stage line **🔍 pre-release · `<slug>`** — version decision (`pending` /
46
- `bump <level> → vX.Y.Z ~` / `no-version ✓`) · tag · changelog · fold ·
47
- review tally · merge style, then `Done:`/`Next steps:` per the Stage
48
- reports rule. The gate re-checks
49
- tier-1, requires the manifest **ahead of the last tag**, a changelog
50
- **heading** naming that version (a mention in prose is not an entry) and that
51
- this branch prepared the entry. Operator ships this flow **without
52
- version/tag** → `flow release --no-version --confirmed` — no bump, but the
53
- changelog entry under `Unreleased` is still required: the gate proves the
54
- branch **added a line there**, not that it edited some older section.
8
+ **Versioning:** the `versioning.file` manifest is the single source of truth;
9
+ tags are `versioning.pattern` rendered from it. No `versioning.file` → stop
10
+ and settle the scheme with the operator; never invent one.
55
11
 
12
+ 1. **Review**: `/flow-review` the change; fix every **Must fix** and **Should
13
+ fix**; `flow check` again if code changed.
14
+ 2. **Docs**: update them to match the change.
15
+ 3. **Changelog + bump** — manifest, changelog heading and tag must agree;
16
+ commit the prep on the feature branch.
17
+ - **The changelog writer reviews the branch, not its commit list**: read
18
+ `git log <default>..HEAD` *and* `git diff <default>...HEAD`, then write
19
+ what the branch delivers in the reader's terms (what was broken, what
20
+ works now). The entry is also the forge release body.
21
+ - **One entry per net change, never one per commit.** Iteration commits
22
+ are one line about the final state; reverted or invisible work gets none.
23
+ Rewriting your own entry is fold-safe — the proofs guard only lines that
24
+ were already pending.
25
+ - A versioned release **folds `Unreleased`** under the new heading: move
26
+ pending lines verbatim (reword in a later flow). The gate refuses a
27
+ dropped or rewritten pending line, leftovers under `Unreleased`, and a
28
+ changelog this branch never touched. `--no-fold-check` only on the
29
+ operator's word.
30
+ 4. `flow check` — the prep made the earlier checks stale.
31
+ 5. **Ask Release? and stop.** Show what the PR contains, the version and the
32
+ changelog entry. Report opening: **🔍 pre-release · `<slug>`** (the gate's
33
+ stage line; the version field reads `pending` until decided — never
34
+ invent a bump or a no-version decision). Answer → `flow release
35
+ --confirmed`.
36
+ - Standing yolo → run `flow release` without asking. It still returns
37
+ `NEEDS-OPERATOR Release?` when commits landed after Verified? or the
38
+ playbook says `yolo = until-release` — then ask.
39
+ - Operator ships **without a version** → `flow release --no-version
40
+ --confirmed`: no bump or tag, but the branch must add its line under
41
+ `Unreleased`.
42
+
43
+ The gate re-checks tier-1, requires the manifest ahead of the last tag and a
44
+ changelog **heading** for that version written on this branch.
@@ -1,88 +1,54 @@
1
- > Part of the **dev-flow** playbook. The always-on ground rules live in
2
- > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
- > when the session reaches that stage.
1
+ > Part of the **dev-flow** playbook. Ground rules: [../SKILL.md](../SKILL.md).
4
2
 
5
3
  ## Reflect (this project's suggestion queue)
6
4
 
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. `flow reflect done <n> ["<what fixed it>"]` checks
29
- an item off once a flow has fixed it (`— fixed: <date> <slug> — <what>`), so
30
- doctor stops re-reporting it. A legacy `## plugin` row from an older dev-flow is
31
- flagged by `flow doctor` / `reflect list`: file it upstream and check it off
32
- `— filed: gh#NNN`. For a note to chase **now**: `flow doctor "<observation>"`
33
- prints an investigation brief without queueing.
34
-
35
- - Reflect real friction only, one line each, never the same issue twice.
36
- - **The end-of-session reflection runs at finish** (see Stage: finish): `flow
37
- finish` itself starts the `flow_stage({ op: "reflect" })` worker before it
38
- removes anything (only `--no-reflect --confirmed` skips it); the worker reviews the whole session — driver and
39
- every worker transcript — and the operator decides **fold or drop** per
40
- finding. Bare `flow reflect` prints that protocol (bound: delegate to the
41
- worker; unbound: review inline); the command writes nothing.
42
- - **When to suggest fixing open items** — the tool prints `⚑ fix the open
43
- reflections now?` only when a rule fires: an open item **recurred** this
44
- session (strongest signal), an item is **≥ 14 days** old, **≥ 3 playbook
45
- items** (one docs flow takes them all), or a **code** item while **between
46
- flows**. It surfaces at finish, in an unbound session, and in `flow doctor` —
47
- never mid-feature. Offer it in one line; the operator decides.
48
- - **When to suggest the tidy** — `flow reflect tidy` drops the closed (`- [x]`)
49
- items (the `— fixed:` note already recorded the outcome). The hint
50
- `↻ N closed reflection(s)` prints when **≥ 5** are closed, when closed
51
- **≥ open** with at least 3 closed, or when a closed item was filed **≥ 30
52
- days** ago — at finish, after a `reflect` write, in bare `reflect` and doctor.
53
- - Plain `flow doctor` reviews the open items and **routes** each — `## playbook`
54
- → docs flow, `## code` → patch flow. To fold items in on the operator's word:
55
- investigate, propose the fix, get confirmation, open the routed flow and apply
56
- it there — project.md is editable only in a docs/patch worktree. Once it is
57
- merged, check the item off with `flow reflect done <n> "<what>"` (or by hand in
58
- the gitignored `.dev-flow/reflections.md`: `- [x]` and a `— folded: <what>` or
59
- `— fixed: <what>` note).
60
- - **Open GitHub issues fold into the view** when the repo has a GitHub remote: `flow doctor` and
61
- `flow reflect list` list them under the local queue (read-time fold — issues are never imported,
62
- each item keeps one home). A local row an open issue already covers carries `⟷ gh#NNN` — fold it
63
- by checking the row off `— filed: gh#NNN` and resolving on GitHub. Unmatched upstream rows get a
64
- route, but their resolution is on GitHub (close there, never in reflections.md). A
65
- `~ gh#NNN may duplicate` hint is your verdict to make, never an auto-merge. No GitHub remote =
66
- silent; missing/offline `gh` or `DEV_FLOW_NO_ISSUES=1` = one skip line.
67
-
68
-
69
- ## Roadmap (your backlog)
70
-
71
- `.dev-flow/roadmap.md` — a gitignored `- [ ]` checklist; the operator owns the
72
- content, you maintain and honor it. Advisory like reflections, never gating:
73
-
74
- - `flow roadmap` lists the open items (the count is surfaced in status and
75
- stage context). Update on the operator's request —
76
- `flow roadmap add "<feature>"` or direct file edits are equally fine.
77
- - Handed a feature: `flow roadmap pick <n> <slug>` stamps the item with the
78
- slug (pick is one verb — it starts nothing), then `flow start <slug>` builds
79
- it as a normal flow; its `flow finish` checks the item off automatically.
80
- - **Spin-off** (a new feature surfaced mid-flow, split off on the operator's
81
- word): `flow roadmap add "<title>" --slug=<slug> --brief=<notes>` (or
82
- `--brief-file=<path>`) adds and stamps in one call; the brief sits under the
83
- item as ` > ` lines and a bound session's slug is recorded as `— split from
84
- <slug>`. `flow start <slug>` seeds `plan/plan.md` with the item and brief (a
85
- draft — plan and approve as usual). A hand-made `.dev-flow/<slug>/plan/` with
86
- no `state.json` is a ghost: `flow start <slug> --confirmed` adopts it.
87
- - Shipped outside a flow: `flow roadmap done <n>` (date-stamped by hand);
88
- `flow roadmap tidy` drops checked lines when history clutters the list.
5
+ Friction worth fixing gets parked, not complained about. One line each, real
6
+ friction only, never the same issue twice. `.dev-flow/reflections.md` holds
7
+ **this project's** items only.
8
+
9
+ | Command | Files under | Fixed by |
10
+ | --- | --- | --- |
11
+ | `flow reflect --playbook "<note>"` | `## playbook` (fix lives in `project.md`) | a docs flow: `flow start fold-<topic> --docs --confirmed` |
12
+ | `flow reflect --code "<note>"` | `## code` (this project's code, maybe the playbook) | a patch flow: `flow start fix-<topic> --patch --confirmed` (normal when bigger) |
13
+ | `flow reflect --plugin "<note>"` | nothing — prints the upstream recipe | a GitHub issue, filed only on the operator's word |
14
+
15
+ - `--plugin`: search first (`gh issue list --repo <dev-flow repo> --state all
16
+ --search "<keywords>"`); an issue already answered is reported back, never
17
+ re-filed. Body ends `— reflection from <slug> <date>`. In the dev-flow repo
18
+ itself, plugin feedback is code.
19
+ - No flag → the wording decides and the printed line says why.
20
+ - `flow reflect list` numbers the queue; `flow reflect move <n>
21
+ --playbook|--code` re-files; `flow reflect done <n> ["<what fixed it>"]`
22
+ checks one off; `flow reflect tidy` drops closed items.
23
+ - `flow doctor "<observation>"` prints an investigation brief without queueing.
24
+ - The end-of-session reflection runs at finish (see [finish.md](finish.md)).
25
+
26
+ **When to suggest a fix** — only when the tool prints `⚑ fix the open
27
+ reflections now?` (an item recurred, is ≥ 14 days old, ≥ 3 playbook items, or
28
+ a code item between flows). It surfaces at finish, unbound, and in `flow
29
+ doctor` — never mid-feature. One line; the operator decides.
30
+
31
+ **Folding items in** on the operator's word: investigate, propose, confirm,
32
+ open the routed flow and apply it there (`project.md` is editable only in a
33
+ docs/patch worktree), then `flow reflect done <n> "<what>"` once merged.
34
+
35
+ **GitHub issues** fold into `flow doctor` / `reflect list` when the repo has a
36
+ GitHub remote: a local row an open issue covers shows `⟷ gh#NNN` (check it off
37
+ `— filed: gh#NNN`); `~ gh#NNN may duplicate` is your call, never an auto-merge.
38
+ `DEV_FLOW_NO_ISSUES=1` turns it off.
39
+
40
+ ## Roadmap (the operator's backlog)
41
+
42
+ `.dev-flow/roadmap.md` — a gitignored `- [ ]` list the operator owns. Advisory,
43
+ never gating.
44
+
45
+ - `flow roadmap` lists open items; `flow roadmap add "<feature>"` (or editing
46
+ the file) adds one, on the operator's request.
47
+ - Handed a feature: `flow roadmap pick <n> <slug>` stamps it, then `flow start
48
+ <slug>`; its finish checks the item off.
49
+ - Spin-off mid-flow (on the operator's word): `flow roadmap add "<title>"
50
+ --slug=<slug> --brief=<notes>` — `flow start <slug>` later seeds the plan
51
+ from the brief. A hand-made `.dev-flow/<slug>/plan/` is a ghost; `flow start
52
+ <slug> --confirmed` adopts it.
53
+ - Shipped outside a flow: `flow roadmap done <n>`; `flow roadmap tidy` drops
54
+ checked lines.
@@ -1,68 +1,35 @@
1
- > Part of the **dev-flow** playbook. The always-on ground rules live in
2
- > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
- > when the session reaches that stage.
1
+ > Part of the **dev-flow** playbook. Ground rules: [../SKILL.md](../SKILL.md).
4
2
 
5
3
  ## Stage: release
6
4
 
7
- Cleared for main-repo git (merge/tag/push on the default branch is allowed only
8
- here) — this stage publishes; the preparation happened in pre-release. Run in
9
- the worktree unless noted:
5
+ Main-repo git (merge, tag, push on the default branch) is allowed only here.
6
+ Nothing in this stage asks the operator anything — Release? covered it. Report
7
+ each step with the gate's stage line, **🚀 release · `<slug>`**; no `Done:` /
8
+ `Next steps:` block.
10
9
 
11
- 1. Commit everything, push the feature branch, open the PR, and **merge only once
12
- CI is green**: `gh pr checks <n> --watch` (or your forge's equivalent) first — a
13
- locally-green branch can still fail checks that only CI runs (the host may lack the
14
- tool entirely), and the merge is what turns the default branch red (gh#134). Then
15
- wait for the merge
16
- (`gh pr merge <n> --merge` or ask the user) — with the **playbook's merge style spelled out**
17
- (`gh pr merge <n> --squash` under `merge = squash`), and **the PR number before the flag**: a bare
18
- `gh pr merge --merge main` makes gh read `main` as the PR selector ("no pull requests found for
19
- main"). The guard blocks a style that contradicts the
20
- playbook and asks the operator about a merge with no style flag, so let the playbook decide rather
21
- than the forge default. Merge without `--delete-branch`: it fails when
22
- the default branch is checked out in the main worktree, and `flow finish`
23
- deletes the branch on merge proof anyway.
24
- 2. `git fetch`, confirm the merge landed, create the **annotated** tag
25
- (`git tag -a`) and push the ref explicitly (`git push origin v<ver>`) —
26
- never `--follow-tags` (it silently skips lightweight tags: they never reach
27
- the remote, CI never publishes). After the merge a tag points at what
28
- actually shipped. If CI builds from the tag, set `release.preflight` (e.g.
29
- `docker build .`) so `flow release` proves that build before the tag exists,
30
- and `release.artifact` in
31
- the playbook — `release-done` then verifies the published artifact and
32
- refuses local-only tags outright. Unversioned flow (`--no-version` granted):
33
- no bump, no tag — publish the merge only (your entry rides under
34
- `Unreleased` until the next versioned release folds it), `release-done`
35
- asks nothing version-side.
36
- 3. `flow release-done` — **no question** (the Release? answer covered the
37
- publication). Reporting at this stage is stage lines only, one per step —
38
- **🚀 release · `<slug>`** — PR + state · merge style used · tag state ·
39
- artifact · forge release (all values `✓` — the Release? verb locked them);
40
- no `Done:`/`Next steps:` block, nothing is asked. It re-verifies (tag on the default branch, on origin, artifact
41
- when configured) against **the version the release gate stamped** — never a
42
- re-read from a checkout that may be behind — and refuses anything older than
43
- the newest matching tag on origin (lists come from `git ls-remote`, so an
44
- unfetched clone never decides what is tagged). It creates the forge release
45
- — `gh` for GitHub, `glab` for GitLab, nothing for `forge = self`, advisory
46
- note if a CLI or remote is missing; body = the `release.changelog` entry for
47
- that version — the changelog is what the release page must read like — else
48
- the tag's annotation, else nothing with the reason printed (annotate with
49
- `git tag -a`), and it reads the stored body back and refuses a mismatch
50
- (#97) — and records the release;
51
- `flow finish` closes the feature out. Skipping the forge release
52
- (`--no-release-create`, once, or `release.releases = false`, always) and
53
- the artifact check (`--no-artifact-check`, once) are operator calls only —
54
- act when told, never on your own. If this session runs an older build than
55
- the checkout, **the release gate asks instead of blocking**: it prints both
56
- builds, lists what shipped between them (those proofs will not run), and
57
- puts the choice to the operator — **update (`/reload` and re-run) or
58
- proceed with the old release?** Publishing under an older gate is a
59
- legitimate choice (hotfix, offline reload); the answer is recorded in the
60
- release output and `release-done` repeats the acknowledgement as the
61
- backstop for headless runs.
62
- Release-stage checklist items have no gate of their own: `release-done`
63
- lists the open ones and the Finish? answer closes them.
64
-
65
-
66
- Once `flow release-done` has recorded the release, the playbook continues in
67
- [finish.md](finish.md) — `flow finish` runs the closing reflection first and stops for
68
- fold/drop (that answer is **Finish?**); its re-run with `--confirmed` cleans up.
10
+ 1. **PR and merge.** Commit everything, push the feature branch, open the PR.
11
+ - **Merge only once CI is green**: `gh pr checks <n> --watch` (or your
12
+ forge's equivalent) first — CI runs jobs the host may not.
13
+ - Merge in the **playbook's style**, PR number before the flag:
14
+ `gh pr merge <n> --squash` under `merge = squash`, `--merge` under
15
+ `merge = merge`. (`gh pr merge --merge main` reads `main` as the PR.)
16
+ - No `--delete-branch` — finish deletes the branch on merge proof.
17
+ 2. **Tag** (versioned flows). `git fetch`, confirm the merge landed, create an
18
+ **annotated** tag (`git tag -a v<ver> -m …`) and push it explicitly:
19
+ `git push origin v<ver>`. Never `--follow-tags`.
20
+ - CI builds from the tag? `release.preflight` proves that build at
21
+ `flow release`; `release.artifact` makes the record step verify the
22
+ published artifact.
23
+ - `--no-version` flow: no bump, no tag — publish the merge only.
24
+ 3. **Hand over to finish.** Once merged and tagged, the playbook continues in
25
+ [finish.md](finish.md): `flow finish` records the release itself first
26
+ (the same proofs `flow release-done` runs — tag on the default branch and
27
+ on origin, artifact, forge release created from the changelog entry and
28
+ read back) and then closes the feature out.
29
+ - Skipping the forge release (`--no-release-create`, or `release.releases
30
+ = false`) or the artifact check (`--no-artifact-check`) is the
31
+ operator's call only.
32
+ - Session on an older build than the checkout: the release gate prints
33
+ both builds and what shipped between them and asks **update (`/reload`
34
+ and re-run) or proceed?** — a recorded choice, not a block.
35
+ - Release-stage checklist items close with the Finish? answer.
@@ -1,72 +1,53 @@
1
- > Part of the **dev-flow** playbook. The always-on ground rules live in
2
- > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
- > when the session reaches that stage.
1
+ > Part of the **dev-flow** playbook. Ground rules: [../SKILL.md](../SKILL.md).
4
2
 
5
3
  ## Start
6
4
 
7
- **No `.dev-flow/`?** `flow init` analyzes the repo and prints a **setup
8
- brief**: what was detected plus one numbered question per knob, each with
9
- `detected:` (what was found), `accept:` (the answer that keeps it) and `why:`.
10
- Relay them: group the ones with an `accept` line as one "keep these?", and
11
- explain the rest in a line each. Apply **every** answer in one call:
12
- `flow init --answers key=value …` (targeted edits onto the draft; unknown
13
- keys are refused). It **previews** the summary and diff and writes nothing.
14
- Present that, and only after the operator confirms, re-run the same call with
15
- `--confirmed --track` (validated write + the playbook commit). Free-text
16
- additions (checklist items, prose, `flow-guard` rules) go through
17
- `flow init --write-file <path>` with the full file (`flow init --draft` prints
18
- it). Never hand-edit, and never write project.md before the confirmation.
19
- Detection names CLAUDE.md / AGENTS.md / CONTRIBUTING.md when present: propose
20
- their stage rules as prose, never copy them unasked. **With existing config** `flow init` is a **doctor**: discuss
21
- findings, fix via the same write path, never overwrite hand edits without
22
- confirming; ghost feature dirs (a `plan/` whose `state.json` is gone) come
23
- with a delete offer — surface the dialog, never delete on your own.
24
- `flow doctor` runs the same probes **read-only** (prefer it when you only want
25
- findings); `--force` re-detects from scratch, `--draft` prints without
26
- writing.
27
-
28
- `flow start <slug> [--ui --confirmed]` — `--ui` adds a rendered-mockup gate to plan, so it is
29
- operator-granted like `--patch`/`--docs`: propose it when screens change, start with it only on their word;
30
- slug lowercase words-dashed; check `flow status` for an active feature first. Screens turned out to
31
- change after a plain start (the operator asks for mockups)? While the feature is still at plan,
32
- `flow start <slug> --ui --confirmed` from its session switches the mockup gate on; past plan it refuses.
33
-
34
- `flow start` **preflights** before it creates anything: it warns when this session runs an older dev-flow
35
- build than the checkout (`/reload` before trusting gate output), prints the playbook gaps `flow doctor`
36
- would report, and **refuses while the playbook has no merge policy**. That refusal is a question: ask the
37
- operator how a merged PR should land on the default branch — `squash`, `merge` (a merge commit), `rebase`,
38
- or `any` (no policy) — with the suggestion the refusal read off their own history, then re-run
39
- `flow start <slug> --merge=<style> --confirmed`. The gate writes the answer into `## release` (single-line
40
- insert, validated, `.bak` kept) and never asks again. Never pick the style yourself and never write
41
- `project.md` by hand to get rid of the question. Pre-flow reports open with **💬 pre-flow · new work** —
42
- mode proposal + why · detected knobs · merge-policy state (💬 = "operator, your turn": a grant or
43
- answer is pending).
44
-
45
-
46
- ---
47
-
48
- ### Moved here from the ground rules
49
-
50
- Modes are carried by `flow start` and belong to it:
51
-
52
- - **Modes are proposed, never taken**: every `flow start` carries the mode and
53
- a one-line why; the operator grants it in chat and the gate refuses
54
- `--patch`/`--docs` until the grant is anchored with `--confirmed` — never
55
- self-grant. `normal` (default): a written plan is enforced (`plan/plan.md`
56
- before Approve?). `--patch`: a small change you intend to release
57
- (one-file fix, version chore) — no plan file, one chat line is the plan,
58
- everything else identical. `--docs`: docs-only — no plan file **and no
59
- tier-1 checks** (build/lint/test); worktree discipline and the full release
60
- stay. A change that grows past one line or touches behavior is a normal
61
- feature, not patch/docs.
62
-
63
-
64
- Playbook ownership, in full:
65
-
66
- - `.dev-flow/<slug>/state.json` is flow-owned — never read or write it;
67
- `flow status` is your view. **project.md is the operator-owned playbook**
68
- (test/build/run commands, default branch, forge, worktree path, safety
69
- rules): read freely, **never edit** — changes go through `flow init --write`
70
- on the operator's word. In-life playbook updates run as a docs flow:
71
- project.md is editable only inside a docs/patch flow's worktree and is
72
- committed to git like any file.
5
+ ### No playbook yet: `flow init`
6
+
7
+ 1. `flow init` prints a setup brief: what was detected, then numbered
8
+ questions, each with `detected:`, `accept:` and `why:`.
9
+ 2. Relay it: group the questions that have an `accept` line as one "keep
10
+ these?", explain the rest in a line each.
11
+ 3. Apply every answer in one call: `flow init --answers key=value …`. It
12
+ previews the summary and diff and writes nothing — show that.
13
+ 4. After the operator confirms, re-run the same call with `--confirmed
14
+ --track`.
15
+
16
+ - Free text (checklist items, prose, `flow-guard` rules): `flow init
17
+ --write-file <path>` with the full file (`flow init --draft` prints it).
18
+ - Never hand-edit `project.md`, and never write it before the confirmation.
19
+ - CLAUDE.md / AGENTS.md / CONTRIBUTING.md found → propose their stage rules
20
+ as prose; never copy them unasked.
21
+ - With a playbook already there, `flow init` is a **doctor**: discuss its
22
+ findings and fix through the same write path. Ghost feature dirs come with
23
+ a delete offer — only on the operator's word. `flow doctor` is the
24
+ read-only version.
25
+
26
+ ### Starting a feature: `flow start <slug>`
27
+
28
+ Report opening: **💬 pre-flow · new work** — mode proposal + why · detected
29
+ knobs · merge-policy state.
30
+
31
+ - Check `flow status` for an active feature first. Slug: lowercase words,
32
+ dashes.
33
+ - **Ask every grant in one message**, then make one call with all of them:
34
+ the mode (`normal` default, or `--patch` / `--docs`), `--ui` when screens
35
+ change, and the merge policy if the playbook has none —
36
+ `flow start <slug> [--ui] [--patch|--docs] [--merge=<style>] --confirmed`.
37
+ Never grant any of them yourself.
38
+ - No merge policy → the gate refuses with `NEEDS-OPERATOR Merge policy?` and a
39
+ suggestion read off the repo's history. Ask: squash, merge, rebase or any.
40
+ The answer is written into `## release` once.
41
+ - `--ui` after a plain start, still at plan: `flow start <slug> --ui
42
+ --confirmed` from the feature's own session.
43
+ - Start warns when this session runs an older dev-flow build than the
44
+ checkout (`/reload` before trusting gate output) and lists playbook gaps.
45
+
46
+ ### Modes
47
+
48
+ - `normal` — a written plan (`plan/plan.md`) is required before Approve?.
49
+ - `--patch` — a small change to release now (one-file fix, version chore):
50
+ no plan file, one chat line is the plan, every other gate identical.
51
+ - `--docs` — docs only: no plan file and no tier-1 checks; worktree and the
52
+ full release stay.
53
+ - A change that grows past one line or touches behavior is a normal feature.