pi-dev-flow 0.90.0 → 0.90.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.
- package/CHANGELOG.md +7 -0
- package/README.md +89 -225
- package/docs/concurrency.md +54 -50
- package/docs/development.md +48 -54
- package/docs/gates.md +187 -25
- package/docs/guardrails.md +112 -30
- package/docs/headless.md +32 -44
- package/docs/playbook.md +215 -278
- package/docs/reflections.md +73 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ Format: newest first. `Unreleased` collects what's merged but not yet tagged.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.90.1] - 2026-11-11
|
|
8
|
+
|
|
9
|
+
**Docs only: a shorter README and readable docs pages.**
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **Shorter, friendlier docs.** The README is half its old length and covers the essentials. `docs/gates.md` is now an overview plus one short section per gate instead of one giant table. The other docs are tightened, issue numbers have moved out of them, and reflections have their own page (`docs/reflections.md`). The README's doc links now point to GitHub, so they render on npm and pi.dev instead of opening raw markdown.
|
|
13
|
+
|
|
7
14
|
## [0.90.0] - 2026-11-10
|
|
8
15
|
|
|
9
16
|
**Operator answers are checked everywhere they are given, docs flows stop being asked for impossible checks, and stage workers get the project's setup.**
|
package/README.md
CHANGED
|
@@ -2,91 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
question, answered by the harness instead of by trust.
|
|
17
|
-
|
|
18
|
-
**A bound session is self-identifying.** `flow start` (and `flow use`) renames the Pi session after
|
|
19
|
-
the flow slug, so the session picker always tells you which feature each session holds.
|
|
20
|
-
|
|
21
|
-
**Stages end in gates, not vibes.** Each stage has one exit gate that refuses until its criteria
|
|
22
|
-
hold: your plan file exists; every command your playbook names as a check passes; the app really
|
|
23
|
-
starts, with real data, and answers a health probe **after** a real deploy; changelog and version
|
|
24
|
-
manifest agree and the version is ahead of the last tag; the release is tagged and on the remote.
|
|
25
|
-
Gates read state that the agent is blocked from writing, so a step cannot be quietly skipped — and
|
|
26
|
-
each gate asks you exactly **one** question.
|
|
27
|
-
|
|
28
|
-
The flow itself ships with the plugin; a project carries only a `.dev-flow/` folder — state files,
|
|
29
|
-
plans and worktrees, nothing the plugin needs to run.
|
|
30
|
-
|
|
31
|
-
**Git stays clean by construction.** Nothing commits to the default branch while a feature is in
|
|
32
|
-
flight: work happens in its own git worktree and branch (`feat/<slug>`), so your checkout keeps
|
|
33
|
-
moving while a feature is under way. Publishing has one order — PR → merge → annotated tag → forge
|
|
34
|
-
release — and only in the release stage does dev-flow let git touch main again. A `pre-commit` hook
|
|
35
|
-
covers commits made outside Pi.
|
|
36
|
-
|
|
37
|
-
**Many features at once.** One Pi session = one feature = one worktree, and a repo can host as many
|
|
38
|
-
as you want in parallel. A write inside worktree X is judged by X's stage whoever made it, so
|
|
39
|
-
sessions cannot dirty each other's branches or borrow each other's approvals. [More here.](docs/concurrency.md)
|
|
40
|
-
|
|
41
|
-
**It learns from friction.** Every time the agent hits something that cost it a step — a playbook
|
|
42
|
-
command that no longer exists, a guard that refused the wrong thing, a gate that forced a detour — it
|
|
43
|
-
writes the observation down in `.dev-flow/reflections.md` instead of just working around it. Those
|
|
44
|
-
notes are advisory and never gate anything, but they are how your playbook stops drifting: you review
|
|
45
|
-
them with `flow doctor` and decide what to fix. [More here.](docs/playbook.md)
|
|
5
|
+
A feature workflow for [Pi](https://pi.dev) that the agent can't skip. You describe a feature, the
|
|
6
|
+
agent builds it, and **the harness, not the agent, decides when a stage is done.** Each feature goes
|
|
7
|
+
`plan → implement → pre-release → release → done`, and you answer one question at each checkpoint.
|
|
8
|
+
|
|
9
|
+
- **Plan first.** The agent writes a spec and can't touch code until you approve it.
|
|
10
|
+
- **Real gates.** Each stage ends in a check: tests pass, the app deploys and is healthy, the
|
|
11
|
+
changelog and version agree, the tag is on the remote.
|
|
12
|
+
- **Clean git.** Each feature gets its own worktree and branch. Nothing lands on main until release.
|
|
13
|
+
- **Parallel features.** One Pi session per feature, as many at once as you like.
|
|
14
|
+
- **It learns.** When something gets in the agent's way, it leaves you a note so you can fix your
|
|
15
|
+
setup.
|
|
46
16
|
|
|
47
17
|
## Install
|
|
48
18
|
|
|
49
19
|
```bash
|
|
50
|
-
pi install npm:pi-dev-flow #
|
|
51
|
-
pi install git:github.com/dmarchevsky/pi-dev-flow # or from git
|
|
52
|
-
pi install ./pi-dev-flow # or a local checkout
|
|
20
|
+
pi install npm:pi-dev-flow # from npm
|
|
21
|
+
pi install git:github.com/dmarchevsky/pi-dev-flow # or from git (pin with @vX.Y.Z)
|
|
53
22
|
```
|
|
54
23
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
guard hooks check which registered version is highest, and a stale duplicate answers nothing — the
|
|
60
|
-
most in-package removal can be, because Node cannot unload a loaded module and pi cannot unregister
|
|
61
|
-
its hooks. Only a host restart drops stale code; `/reload` re-binds session state, it never swaps
|
|
62
|
-
code. `flow version` lists every dev-flow copy registered in the process and names the copy serving
|
|
63
|
-
the call, and the on-disk session claim keeps the guard of a copy that never served
|
|
64
|
-
a flow call attributing your commands correctly.
|
|
65
|
-
|
|
66
|
-
Until `flow init` writes the playbook (`.dev-flow/project.md`), dev-flow says nothing in a repo — no
|
|
67
|
-
injections, no guards, no footer: the playbook is the opt-in. A stray `.dev-flow/` without it keeps
|
|
68
|
-
the folder dormant.
|
|
24
|
+
Then run **`/flow init`** once in each project. It reads your repo (branch, forge, package manager,
|
|
25
|
+
test/build commands, version file, CI) and writes **`.dev-flow/project.md`**: your playbook. Each
|
|
26
|
+
question shows what it detected, so "keep these" usually answers it. It also installs a `pre-commit`
|
|
27
|
+
hook that blocks direct commits to main.
|
|
69
28
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
— your playbook**: the commands that count as checks, the manual checklist, the version and tag
|
|
73
|
-
convention, how a merged PR lands (`merge = squash | merge | rebase`), and any hard safety rules of your
|
|
74
|
-
own. It also reads lint/typecheck scripts, CI workflows, Makefiles, Docker files, secrets on disk and your existing
|
|
75
|
-
tags. Every question shows what was detected and why it matters, so "keep these" answers most of
|
|
76
|
-
them. Your answers land as targeted edits (`flow init --answers key=value …`), previewed as a diff
|
|
77
|
-
before anything is written. It asks about everything detection could not decide (self-hosted forge?
|
|
78
|
-
Docker artifacts? what "healthy" means?) and installs a `pre-commit` hook that blocks direct main
|
|
79
|
-
commits (or prints the lines for husky/lefthook when they own the hooks). Run `/flow init` again later and it becomes a **doctor**: drift in
|
|
80
|
-
your playbook, dead commands, config problems — it never rewrites your hand edits without asking.
|
|
81
|
-
The flow is completely inert in repos with no `.dev-flow/`.
|
|
29
|
+
dev-flow does nothing in a repo until you run `/flow init`. Run it again later to check your
|
|
30
|
+
playbook for drift.
|
|
82
31
|
|
|
83
|
-
|
|
32
|
+
**Updating:** `pi update --extensions`, then `/reload` in running sessions. A running session keeps
|
|
33
|
+
the code it started with, and `flow version` tells you when it's behind.
|
|
84
34
|
|
|
85
|
-
## How
|
|
35
|
+
## How it works
|
|
86
36
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
walking five stages with a gate between each:
|
|
37
|
+
Ask for a feature in plain words, for example *"sessions expire silently, add sliding renewal and
|
|
38
|
+
a test"*. It becomes the feature `session-renewal`:
|
|
90
39
|
|
|
91
40
|
```
|
|
92
41
|
you ask for a feature
|
|
@@ -94,185 +43,100 @@ walking five stages with a gate between each:
|
|
|
94
43
|
┌────────▼────────┐
|
|
95
44
|
│ plan │ spec (+ mockups) in .dev-flow/<slug>/plan/
|
|
96
45
|
└────────┬────────┘
|
|
97
|
-
Approve?
|
|
46
|
+
Approve?
|
|
98
47
|
┌────────▼────────┐
|
|
99
|
-
│ implement │ code + tests,
|
|
48
|
+
│ implement │ code + tests, in the feature's own worktree
|
|
100
49
|
└────────┬────────┘
|
|
101
|
-
Verified? ·
|
|
50
|
+
Verified? · checks green, app deployed and healthy
|
|
102
51
|
┌────────▼────────┐
|
|
103
|
-
│ pre-release │ review, docs, changelog
|
|
52
|
+
│ pre-release │ review, docs, changelog, version bump
|
|
104
53
|
└────────┬────────┘
|
|
105
|
-
Release? ·
|
|
106
|
-
(answers itself when only that prep changed since Verified?)
|
|
54
|
+
Release? · usually answers itself when only release prep changed
|
|
107
55
|
┌────────▼────────┐
|
|
108
|
-
│ release │ PR → merge →
|
|
56
|
+
│ release │ PR → merge → tag → release notes
|
|
109
57
|
└────────┬────────┘
|
|
110
|
-
Finish?
|
|
58
|
+
Finish?
|
|
111
59
|
┌────────▼────────┐
|
|
112
60
|
│ done │ worktree, branch and feature folder removed
|
|
113
61
|
└─────────────────┘
|
|
114
62
|
```
|
|
115
63
|
|
|
116
|
-
| Stage |
|
|
64
|
+
| Stage | The agent | You answer |
|
|
117
65
|
|---|---|---|
|
|
118
|
-
| **plan** | reads the code, asks
|
|
119
|
-
| **implement** | works
|
|
120
|
-
| **pre-release** |
|
|
121
|
-
| **release** |
|
|
122
|
-
| **done** | removes the worktree, branch and `.dev-flow/session-renewal/` | — |
|
|
123
|
-
|
|
124
|
-
Three or four answers from you; everything between them was the agent's problem and your playbook's gates. If
|
|
125
|
-
the feature grows mid-flight it is folded into this one (the plan gains an `Added mid-stage:` line and
|
|
126
|
-
checks re-run); a *different* problem waits for the next flow — one feature, one plan, one PR.
|
|
127
|
-
|
|
128
|
-
Your answers at a checkpoint:
|
|
66
|
+
| **plan** | reads the code, asks questions, writes `plan/plan.md` | **Approve?** — build it |
|
|
67
|
+
| **implement** | works on `feat/<slug>`, commits in small steps, gets the checks green | **Verified?** — you tried it; also pick patch / minor / major, or merge unreleased |
|
|
68
|
+
| **pre-release** | reviews, fixes, updates docs and changelog, bumps the version | **Release?** — only asked if something beyond release prep changed |
|
|
69
|
+
| **release** | opens the PR, merges, tags, publishes release notes | **Finish?** — clean up |
|
|
129
70
|
|
|
130
|
-
|
|
131
|
-
- **yolo** — answers this checkpoint *and* pre-confirms the rest, so the remaining gates run back to
|
|
132
|
-
back with every check still enforced. Attach your wishes to the word: *"yolo, patch bump"*,
|
|
133
|
-
*"yolo, no tag"*. Release? is asked anyway when commits landed after Verified?, or always when
|
|
134
|
-
the playbook sets `yolo = until-release` under `## release`.
|
|
135
|
-
- **merge unreleased** (the release call at Verified?, or a change of mind at Release?) — merge and
|
|
136
|
-
changelog land, no bump or tag; the next versioned release folds your `Unreleased` entry under its
|
|
137
|
-
heading. A patch/minor/major call is turned into a number when the release runs, so a parallel flow
|
|
138
|
-
that ships first just moves yours to the next one.
|
|
71
|
+
### Your answers
|
|
139
72
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
are the only things dev-flow cannot do for you.
|
|
73
|
+
- **yes**, or **no** with a reason. The agent fixes it and asks again.
|
|
74
|
+
- **yolo**: yes to this question and to all the remaining ones. Every check still runs. You can add
|
|
75
|
+
wishes: *"yolo, patch bump"*.
|
|
76
|
+
- **merge unreleased**: merge with a changelog entry, but no version bump or tag. The next release
|
|
77
|
+
picks it up.
|
|
146
78
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
`flow` command — gate results show you facts and the one question waiting on you, never the command
|
|
150
|
-
behind it, and an answer that slips one in gets corrected on the next run. `/flow …` is your manual override — for when the session is stuck, wrong, or
|
|
151
|
-
claiming a gate result it never produced. → [Gate reference](docs/gates.md)
|
|
79
|
+
For small work the agent may suggest a lighter **mode**: `--patch` for a quick fix with no written
|
|
80
|
+
plan, or `--docs` for docs-only changes with no build checks.
|
|
152
81
|
|
|
153
|
-
|
|
82
|
+
You never need to type `flow` commands. `/flow …` is there as a manual override when a session gets
|
|
83
|
+
stuck. See the [gate reference](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/gates.md).
|
|
154
84
|
|
|
155
|
-
|
|
156
|
-
refused the wrong thing, a gate that forced a detour, a rough edge in dev-flow itself — it does not
|
|
157
|
-
just work around it. It parks a one-line note in `.dev-flow/reflections.md` — your project's queue — under **playbook**
|
|
158
|
-
(the fix lives in `project.md`, a docs flow) or **code** (the fix touches your code, a patch flow):
|
|
159
|
-
`flow reflect --playbook|--code "<note>"`. Feedback about **dev-flow itself never lands in your
|
|
160
|
-
project**: `flow reflect --plugin "<note>"` prints the recipe for a GitHub issue on the dev-flow repo
|
|
161
|
-
(search first, then `gh issue create`), filed on your word. A note queued without a flag lands on a
|
|
162
|
-
keyword guess the printed line explains (`flow reflect list` numbers the queue, `flow reflect move
|
|
163
|
-
<n> --code` re-files one). The open count surfaces in `flow status` and `flow doctor`.
|
|
164
|
-
|
|
165
|
-
**At finish, a separate reviewer reflects on the session.** `flow finish` runs it before it removes
|
|
166
|
-
anything (the worktree, `.dev-flow/<slug>/` and the session binding are still there), stops for your
|
|
167
|
-
answer, and cleans up on the re-run; only your explicit `--no-reflect` skips it. The worker (also
|
|
168
|
-
callable earlier as `flow_stage` op `reflect`) is a fresh
|
|
169
|
-
read-only pi session that reads the whole driving transcript *and every worker's*, re-checks the
|
|
170
|
-
open items, dedupes against them and the upstream issues, and returns a numbered list — each
|
|
171
|
-
finding classified docs / code / plugin with a **fold or drop** recommendation. You answer per item
|
|
172
|
-
(`fold 1,3 drop 2`): fold records a docs/code row or files the plugin issue, drop records nothing.
|
|
173
|
-
|
|
174
|
-
The nudges are timed, not constant. *Fix the open reflections now?* is suggested only when an item
|
|
175
|
-
recurred this session, has waited 14 days, three playbook items can share one docs flow, or a code
|
|
176
|
-
item waits while you are between flows — at finish, in an unbound session, in `flow doctor`, never
|
|
177
|
-
mid-feature. *Tidy* is suggested once the closed pile is real (5 closed, more closed than open, or a
|
|
178
|
-
month-old closed item).
|
|
179
|
-
|
|
180
|
-
With a GitHub remote, `flow doctor` and `flow reflect list` also **fold in the open GitHub issues**
|
|
181
|
-
— external submissions land on GitHub while the queue lives in `reflections.md`, so both surfaces
|
|
182
|
-
show one deduplicated view: a local item an open issue already covers carries `⟷ gh#120`, the rest
|
|
183
|
-
list below as upstream rows, and a near-duplicate is flagged (`~ gh#NNN may duplicate`) but never
|
|
184
|
-
auto-merged. The fold is display-only — upstream items close on GitHub, local items check off in
|
|
185
|
-
the file, never both. No GitHub remote shows nothing; missing or failing `gh` is one skip line, and
|
|
186
|
-
`DEV_FLOW_NO_ISSUES=1` turns the fold off.
|
|
187
|
-
|
|
188
|
-
They never gate anything, and the fix is never the agent's call alone. You ask it to go through them
|
|
189
|
-
— usually with `flow doctor`, which reviews each open item and routes it: a playbook item becomes a
|
|
190
|
-
small docs flow that edits `project.md` through the flow (so the change is committed and reviewed like
|
|
191
|
-
any other), a code item a patch flow. Leaving them is the one option that lets the same friction come
|
|
192
|
-
back next feature — which is exactly what the *recurred* nudge catches.
|
|
193
|
-
|
|
194
|
-
### Reviews and senior discipline, built in
|
|
195
|
-
|
|
196
|
-
No companion plugin to install: dev-flow ships its own review skills. **`/flow-review`**
|
|
197
|
-
reviews a change — by default the bound flow's branch diff against the default branch, plus
|
|
198
|
-
uncommitted work — read against its `plan/plan.md` and its callers, not just the diff: every
|
|
199
|
-
finding needs a concrete triggering case (refuted findings are dropped), grouped Must fix /
|
|
200
|
-
Should fix / Nice to have, ending in a verdict and an honest `Not checked:` line. It is the
|
|
201
|
-
pre-release review step (`release.review` in `project.md` stays yours to set). **`/flow-audit`**
|
|
202
|
-
audits the whole repo in the same style: map first, judge against the load the project actually
|
|
203
|
-
expects, at most 20 ranked findings, changes nothing. The operative sibling **`/flow-simplify`**
|
|
204
|
-
makes the cuts audit and review only name: dead code, no-op subsystems, duplication,
|
|
205
|
-
speculative layers — removed in a risk-ascending order, one verified commit per cut, green
|
|
206
|
-
tests as contract, and a structural-vs-cheap self-audit so the diff shrank because the system
|
|
207
|
-
got smaller, not because comments got deleted. For a big implement slice the session can hand
|
|
208
|
-
the work to **`flow_stage`**: a fresh pi session in the worktree that edits, commits and reports,
|
|
209
|
-
or a fresh read-only reviewer (`op: "review"`) whose PASS/FAIL is advice, not a gate, or the
|
|
210
|
-
end-of-session reflection (`op: "reflect"`, see Reflections). All are optional, and the plan path, commits and checks are briefed automatically. In pi-web a worker also
|
|
211
|
-
shows up in the session's Agents menu as a subagent, its final status on the row and its report in
|
|
212
|
-
the opened transcript. And while a flow writes code, the
|
|
213
|
-
implement stage injects a compact senior-discipline guidance — smallest complete change, no
|
|
214
|
-
speculative abstraction, finish what your change breaks, a failing-first test for risky logic —
|
|
215
|
-
your playbook's `prose.implement` replaces it wholesale whenever you write your own. (The review
|
|
216
|
-
rules adapt ponytail, obra/superpowers and pi-development-system — all MIT, credited in the
|
|
217
|
-
skill files; `/flow-simplify` adapts goal-sloc (MIT), addyosmani/agent-skills (MIT) and
|
|
218
|
-
Anthropic's code-simplifier plugin (Apache-2.0).)
|
|
85
|
+
## What is enforced
|
|
219
86
|
|
|
220
|
-
|
|
87
|
+
While a feature is in flight, every tool call goes through a guard:
|
|
221
88
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
read. Nothing to configure; reloads, resumed and forked sessions do not pay for it twice.
|
|
89
|
+
- no commit, merge or push to main before the release stage (plus a git hook for work outside Pi);
|
|
90
|
+
- during plan, the agent can only write in its own feature folder; after that, only in its own
|
|
91
|
+
worktree;
|
|
92
|
+
- outside a flow, the agent can't edit source at all;
|
|
93
|
+
- flow state and your playbook are off limits to the agent, so gates can't be faked;
|
|
94
|
+
- your own `deny` / `confirm` / `protect` / `forbid` rules run on every command and path;
|
|
95
|
+
- shell calls without a timeout get a sensible default, so nothing hangs forever.
|
|
230
96
|
|
|
231
|
-
|
|
97
|
+
More detail, and what this deliberately is *not*, is in
|
|
98
|
+
[Guardrails](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/guardrails.md).
|
|
232
99
|
|
|
233
|
-
|
|
100
|
+
## Also built in
|
|
234
101
|
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
|
|
238
|
-
-
|
|
239
|
-
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
dev-flow's verdicts, with the reason you wrote;
|
|
245
|
-
- a shell call with no timeout gets its class default armed silently, and a bash command named `flow` is refused (there is no
|
|
246
|
-
CLI — gates live in the session).
|
|
247
|
-
|
|
248
|
-
→ [Guardrails](docs/guardrails.md) — the full list, and [what this is *not*](docs/guardrails.md#limitations-deliberate-v1).
|
|
102
|
+
- **Reflections.** When something costs the agent a step, it notes it in
|
|
103
|
+
`.dev-flow/reflections.md`. At finish, a separate reviewer reads the session and suggests what to
|
|
104
|
+
keep. [More](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/reflections.md)
|
|
105
|
+
- **`/flow-review`** reviews a change against its plan. **`/flow-audit`** audits the whole repo.
|
|
106
|
+
**`/flow-simplify`** removes dead and duplicated code, one verified commit at a time.
|
|
107
|
+
- **`flow_stage` workers.** The agent can hand big chunks of work, or a second-opinion review, to a
|
|
108
|
+
fresh Pi session.
|
|
109
|
+
- **A roadmap.** `.dev-flow/roadmap.md` is a backlog of future features. `flow start <slug>` can
|
|
110
|
+
pick one up.
|
|
249
111
|
|
|
250
112
|
## Where things live
|
|
251
113
|
|
|
252
114
|
```
|
|
253
115
|
.dev-flow/
|
|
254
|
-
project.md your playbook
|
|
255
|
-
reflections.md
|
|
256
|
-
roadmap.md your backlog of future features
|
|
116
|
+
project.md your playbook (the only committed file here)
|
|
117
|
+
reflections.md the agent's notes to you
|
|
118
|
+
roadmap.md your backlog of future features
|
|
257
119
|
<slug>/
|
|
258
|
-
plan/plan.md the spec you approve
|
|
259
|
-
plan/mockups/
|
|
260
|
-
worktree/ the feature's git worktree
|
|
261
|
-
state.json stage, approvals, checks (agent
|
|
120
|
+
plan/plan.md the spec you approve
|
|
121
|
+
plan/mockups/ mockups and screenshots (UI features)
|
|
122
|
+
worktree/ the feature's git worktree
|
|
123
|
+
state.json stage, approvals, checks (the agent can't write it)
|
|
262
124
|
```
|
|
263
125
|
|
|
264
|
-
|
|
265
|
-
shipped feature checks off the item it was picked from. A new feature that comes up mid-flow is parked
|
|
266
|
-
there as a spin-off (`flow roadmap add "<title>" --slug=<slug> --brief=<notes>`); `flow start <slug>`
|
|
267
|
-
later seeds its plan from the brief.
|
|
268
|
-
|
|
269
|
-
## Documentation
|
|
126
|
+
## Docs
|
|
270
127
|
|
|
271
|
-
| Doc |
|
|
128
|
+
| Doc | What's in it |
|
|
272
129
|
|---|---|
|
|
273
|
-
| [
|
|
274
|
-
| [
|
|
275
|
-
| [
|
|
276
|
-
| [
|
|
277
|
-
| [
|
|
278
|
-
| [
|
|
130
|
+
| [Playbook](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/playbook.md) | writing `project.md`: checks, checklists, guard rules, `flow init` |
|
|
131
|
+
| [Gates](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/gates.md) | every gate, its flags, and why it refuses |
|
|
132
|
+
| [Guardrails](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/guardrails.md) | everything enforced, and the deliberate limits |
|
|
133
|
+
| [Reflections](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/reflections.md) | the agent's notes, the closing review, nudges |
|
|
134
|
+
| [Concurrency](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/concurrency.md) | several sessions in one repo |
|
|
135
|
+
| [Headless](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/headless.md) | driving dev-flow from a bot, web UI or queue |
|
|
136
|
+
| [Development](https://github.com/dmarchevsky/pi-dev-flow/blob/main/docs/development.md) | working on dev-flow itself |
|
|
137
|
+
|
|
138
|
+
## Credits
|
|
139
|
+
|
|
140
|
+
The review skills adapt ideas from ponytail, obra/superpowers and pi-development-system (MIT).
|
|
141
|
+
`/flow-simplify` adapts goal-sloc (MIT), addyosmani/agent-skills (MIT) and Anthropic's
|
|
142
|
+
code-simplifier plugin (Apache-2.0). Details are in each skill file. dev-flow itself is MIT.
|
package/docs/concurrency.md
CHANGED
|
@@ -1,50 +1,54 @@
|
|
|
1
|
-
# Concurrency:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
bind
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
**A claim
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
**
|
|
45
|
-
|
|
46
|
-
and `
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
# Concurrency: several sessions, one repo
|
|
2
|
+
|
|
3
|
+
**One Pi session = one feature = one branch and worktree.** A repo can have as many features in
|
|
4
|
+
flight as you like, each in its own session. This is the normal way to use dev-flow, not an edge
|
|
5
|
+
case.
|
|
6
|
+
|
|
7
|
+
## Binding
|
|
8
|
+
|
|
9
|
+
- A session binds to a feature only when you say so: `flow start <slug>` for a new one, or
|
|
10
|
+
`flow use <slug>` for an existing one. Even a lone unfinished feature waits to be claimed.
|
|
11
|
+
- Binding renames the session after the slug, so the session picker shows which feature it holds.
|
|
12
|
+
- The binding survives reload, resume and fork.
|
|
13
|
+
- With nothing bound and nothing unfinished, the session has to start a flow. Work doesn't happen
|
|
14
|
+
outside a flow.
|
|
15
|
+
|
|
16
|
+
## Claims
|
|
17
|
+
|
|
18
|
+
- Each bind writes a claim (`claim.json`). Gates, including `flow abort`, refuse a feature that
|
|
19
|
+
another live session has claimed. `flow use <slug>` takes it over explicitly.
|
|
20
|
+
- The agent can't edit or delete a claim, just like `state.json`.
|
|
21
|
+
- **A claim ends with its session, not its process.** Hosts like pi-web run many sessions in one
|
|
22
|
+
process. So dev-flow releases a session's claims when that session shuts down, and a resumed
|
|
23
|
+
session reclaims what it held.
|
|
24
|
+
- If the host gives sessions no id, all sessions in a directory share one binding.
|
|
25
|
+
`flow status` says so.
|
|
26
|
+
|
|
27
|
+
## Who may write where
|
|
28
|
+
|
|
29
|
+
A write inside worktree X is judged by X's own stage, whichever session makes it. Sessions can't
|
|
30
|
+
dirty each other's branches or borrow each other's approvals. The main checkout's code stays closed
|
|
31
|
+
while your feature is at plan or implement.
|
|
32
|
+
|
|
33
|
+
## Sharing one dev stack
|
|
34
|
+
|
|
35
|
+
A dev deploy is machine state, not branch state, so `flow verify` keeps a small registry in
|
|
36
|
+
`.dev-flow/dev-ports.json` (port → slug, commit, time). `flow status` shows it.
|
|
37
|
+
|
|
38
|
+
If another live flow last deployed on your port, verify doesn't deploy. Instead it asks
|
|
39
|
+
**Dev port?**, showing who holds the port and how much RAM and disk are free, and offers:
|
|
40
|
+
|
|
41
|
+
- **run alongside** on the next free port (`--port=<n>`). This needs `parallelDev` not set to `no`,
|
|
42
|
+
`dev`/`health` using `$DEV_FLOW_PORT`, and enough resources;
|
|
43
|
+
- **replace** that deploy (`--replace`);
|
|
44
|
+
- **wait**.
|
|
45
|
+
|
|
46
|
+
`--port` and `--replace` count as your answer, so the agent can only use them after you reply.
|
|
47
|
+
Finished and aborted flows hold no port. `flow finish` stops an extra-port instance with `devDown`.
|
|
48
|
+
Playbook setup is in [playbook → Dev port](playbook.md#dev-port-and-parallel-flows).
|
|
49
|
+
|
|
50
|
+
## Reviewing what will ship
|
|
51
|
+
|
|
52
|
+
Parallel flows release while others are still working. So `flow verify` rebases a branch that fell
|
|
53
|
+
behind main before deploying it for your review. `flow verify --confirmed` refuses if main moved
|
|
54
|
+
again before you answered.
|