pi-dev-flow 0.89.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 +22 -0
- package/README.md +89 -225
- package/docs/concurrency.md +54 -48
- 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 -275
- package/docs/reflections.md +73 -0
- package/extensions/dev-flow.ts +3 -2
- package/package.json +1 -1
- package/skills/dev-flow/references/implement.md +3 -1
- package/skills/dev-flow/references/reflect.md +4 -1
- package/skills/dev-flow/references/start.md +4 -1
- package/src/core.ts +85 -36
- package/src/projectmd.ts +18 -5
- package/src/runtime/gates.ts +10 -4
- package/src/runtime/grants.ts +13 -3
- package/src/runtime/reflect.ts +29 -17
- package/src/runtime/ship.ts +23 -6
package/docs/playbook.md
CHANGED
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
# The playbook
|
|
1
|
+
# The playbook: `.dev-flow/project.md`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Your playbook says how *your* project is tested, run, versioned and guarded. `flow init` writes it,
|
|
4
|
+
and after that it's yours to edit. The agent can't change the main copy. It can only edit the
|
|
5
|
+
playbook inside a docs or patch flow, so every change is reviewed like any other.
|
|
4
6
|
|
|
5
7
|
## Quickstart
|
|
6
8
|
|
|
7
|
-
1. `/flow init`. dev-flow reads the repo
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
1. Run `/flow init`. dev-flow reads the repo, prints what it found, then asks one numbered question
|
|
10
|
+
per setting. Each question shows what was `detected:`, the answer that keeps it (`accept:`), and
|
|
11
|
+
`why:` it matters. Nothing is written yet.
|
|
12
|
+
2. Answer in chat. "Keep these" answers every question that has an `accept` line.
|
|
13
|
+
3. The agent applies your answers in one call (`flow init --answers merge=squash test="npm test" …`)
|
|
14
|
+
and shows you a summary and a diff.
|
|
15
|
+
4. You confirm. The agent writes the playbook and commits it (`--confirmed --track`).
|
|
16
|
+
5. Add anything detection can't know later: checklist items, guidance, guard rules. Edit the file
|
|
17
|
+
yourself or ask the agent.
|
|
18
|
+
|
|
19
|
+
In a TUI, a single dialog offers to accept everything detected. Decline it to go through the
|
|
20
|
+
questions in chat.
|
|
21
|
+
|
|
22
|
+
**What detection reads** (files and git only; it never runs your commands):
|
|
23
|
+
- language manifests, the package manager and its scripts;
|
|
24
|
+
- lint, typecheck and format scripts, Makefile / justfile / Taskfile targets;
|
|
25
|
+
- CI workflows and publish steps (npm, crates, container images);
|
|
26
|
+
- Dockerfile and compose files;
|
|
27
|
+
- `.env` files and `secrets/` folders, which become suggested guard rules;
|
|
28
|
+
- the version file, existing tags, the changelog, the merge style in your history;
|
|
29
|
+
- CLAUDE.md, AGENTS.md and CONTRIBUTING.md, named so their rules can be proposed but never copied
|
|
30
|
+
silently.
|
|
31
|
+
|
|
32
|
+
Anything detection can't find is asked about, never guessed.
|
|
33
|
+
|
|
34
|
+
**Typical playbooks**, to start small and grow:
|
|
12
35
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
- CI workflows (the commands they run, which your checks should match) and publish steps (npm, crates, container image) → a suggested `artifact` check
|
|
20
|
-
- Dockerfile and compose files → suggested `preflight` and `dev`
|
|
21
|
-
- `.env` and `secrets/` on disk → drafted `protect`/`forbid` guard rules; an `.env.example` → a reminder that `setup` must copy it
|
|
22
|
-
- the version manifest, existing tags (the `versionTag` convention), the changelog, the merge style seen in history, monorepo workspaces
|
|
23
|
-
- CLAUDE.md, AGENTS.md and CONTRIBUTING.md (named, so their rules can be proposed as guidance; never copied silently)
|
|
36
|
+
| Project | `## implement` | `## pre-release` / `## release` |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| npm library | `test`, `build`, lint/typecheck checks | `versionFile = package.json`, `artifact = npm view --prefer-online <name>@{version} version`, `merge = …` |
|
|
39
|
+
| Go / Rust CLI | `test`, `build`, vet/clippy checks | `versionFile = VERSION`, `merge = …` |
|
|
40
|
+
| web service | `setup` (install + copy `.env`), `test`, `run`, a `health` check, `(ui)` checklist items | `versionFile`, `merge = …` |
|
|
41
|
+
| Docker app | `dev = docker compose up -d --build`, a `health` check | `preflight = docker build .`, `artifact = docker buildx imagetools inspect <image>:{version}` |
|
|
24
42
|
|
|
25
|
-
|
|
43
|
+
## How the file is organized
|
|
26
44
|
|
|
27
|
-
|
|
45
|
+
Sections follow the stages (`## global`, `## plan`, `## implement`, `## pre-release`, `## release`).
|
|
46
|
+
Inside each one, content has three tiers:
|
|
28
47
|
|
|
29
|
-
|
|
|
30
|
-
|---|---|---|
|
|
31
|
-
| library (npm) | `test`, `build`, `flow-check lint` / `typecheck` | `versionFile = package.json`, `artifact = npm view --prefer-online <name>@{version} version`, `merge = …` |
|
|
32
|
-
| CLI (go/rust) | `test`, `build`, `flow-check vet` / `clippy` | `versionFile = VERSION`, `releases = true`, `merge = …` |
|
|
33
|
-
| web service | `setup` (install + copy `.env`), `test`, `run`, `flow-check health`, `(ui)` checklist items | `versionFile`, `merge = …` |
|
|
34
|
-
| Docker app | `dev = docker compose up -d --build`, `flow-check health` | `preflight = docker build .`, `artifact = docker buildx imagetools inspect <image>:{version}` |
|
|
35
|
-
|
|
36
|
-
The rest of this page is the reference.
|
|
37
|
-
|
|
38
|
-
`.dev-flow/` ignores itself — its own `.dev-flow/.gitignore` is `*` with the single exception
|
|
39
|
-
`!project.md`, so no state, plan or worktree path is ever tracked by accident. Tracking the playbook
|
|
40
|
-
in a repo that ignores the folder is a deliberate one-off:
|
|
41
|
-
`git add -f .dev-flow/project.md && DEV_FLOW_ALLOW_MAIN=1 git commit -m "track project.md"` — the
|
|
42
|
-
env prefix is for dev-flow's `pre-commit` hook, which allows a main commit whose only change is the
|
|
43
|
-
playbook.
|
|
44
|
-
|
|
45
|
-
It is **committed to git**; you edit it (the agent is blocked from writing the main-checkout copy
|
|
46
|
-
and may edit it only inside a docs/patch flow's worktree, or apply it through `flow init --write`
|
|
47
|
-
on your word, which validates). Content is organized per stage
|
|
48
|
-
(`## plan`, `## implement`, `## pre-release`, `## release`…) in **three tiers** — tier 1 splits into
|
|
49
|
-
executable checks and hard safety rules:
|
|
50
|
-
|
|
51
|
-
| Tier | Notation | Enforcement |
|
|
48
|
+
| Tier | Written as | What happens |
|
|
52
49
|
|---|---|---|
|
|
53
|
-
| 1
|
|
54
|
-
| 1
|
|
55
|
-
|
|
|
56
|
-
|
|
|
50
|
+
| 1. checks | a ` ```flow ` block of `key = value` lines, and ` ```flow-check <name> ` command blocks | gates run them and record pass/fail. **Hard.** |
|
|
51
|
+
| 1. guard rules | a ` ```flow-guard ` block in `## global` | checked on every command and edit. **Hard.** |
|
|
52
|
+
| 1. worker setup | a ` ```flow-worker ` block in `## global` | runs first in every `flow_stage` worker (for example, exporting a test password) |
|
|
53
|
+
| 2. checklist | `- [ ] item` lines | you confirm them as a set at the gate |
|
|
54
|
+
| 3. prose | any other text | shown to the agent when the stage starts. Advisory. |
|
|
55
|
+
|
|
56
|
+
**Checklist tags:**
|
|
57
|
+
- `- [ ] (ui) …` applies only to `--ui` features.
|
|
58
|
+
- `- [ ] (versioned) …` applies only when the flow ships a version.
|
|
59
|
+
- `- [ ] (docs) …` is kept on a `--docs` flow. Other `## implement` items are skipped there, since a
|
|
60
|
+
docs flow builds nothing.
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
If you change the items, you're asked again.
|
|
63
|
+
|
|
64
|
+
**Prose:** your `## implement` prose replaces dev-flow's built-in "senior discipline" guidance.
|
|
65
|
+
|
|
66
|
+
Example:
|
|
59
67
|
|
|
60
68
|
````markdown
|
|
61
69
|
## implement
|
|
@@ -72,244 +80,182 @@ node scripts/check-overflow.mjs
|
|
|
72
80
|
Prefer feature flags for risky paths.
|
|
73
81
|
````
|
|
74
82
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
## Implement settings
|
|
84
|
+
|
|
85
|
+
| Key | What it does |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `setup` | runs once in a fresh worktree at `approve`, for example `cp .env.example .env && npm ci`. A failure fails the gate. |
|
|
88
|
+
| `test` | your test command |
|
|
89
|
+
| `build` | runs at `verify` |
|
|
90
|
+
| `run` | how the agent starts the app to try it. dev-flow never runs it itself. |
|
|
91
|
+
| `dev` | the dev deploy `verify` runs before asking you. It must start in the background and exit, like `docker compose up -d`. |
|
|
92
|
+
| `seedData` | runs before the health probe |
|
|
93
|
+
| `health` | the health probe. After a deploy, `verify` re-runs it and refuses if it fails. |
|
|
94
|
+
| `healthWait` | seconds the probe keeps retrying, every 2s (default 30; `0` = try once) |
|
|
95
|
+
| `servedBuild` | prints the commit the running app serves. `verify` checks it's this branch's HEAD. |
|
|
96
|
+
|
|
97
|
+
The health probe runs in the worktree, so it can compare the app's build stamp with
|
|
98
|
+
`git rev-parse HEAD`. Without a probe, `verify` says `health: none configured` and `flow doctor`
|
|
99
|
+
flags it.
|
|
78
100
|
|
|
79
|
-
|
|
101
|
+
### Dev port and parallel flows
|
|
102
|
+
|
|
103
|
+
By default, two flows on one machine share one dev stack. To let them run side by side:
|
|
80
104
|
|
|
81
105
|
```flow
|
|
82
|
-
port = 8090 #
|
|
83
|
-
parallelDev = yes # can two instances run side by side? (no =
|
|
84
|
-
instanceMem = 2G # what one instance needs
|
|
85
|
-
instanceDisk = 5G #
|
|
106
|
+
port = 8090 # default dev port, exported as $DEV_FLOW_PORT
|
|
107
|
+
parallelDev = yes # can two instances run side by side? (no = replace or wait only)
|
|
108
|
+
instanceMem = 2G # what one instance needs, checked against free RAM
|
|
109
|
+
instanceDisk = 5G # ...and against free disk
|
|
86
110
|
dev = BFF_PORT=$DEV_FLOW_PORT COMPOSE_PROJECT_NAME=app$DEV_FLOW_SUFFIX docker compose up -d
|
|
87
111
|
devDown = COMPOSE_PROJECT_NAME=app$DEV_FLOW_SUFFIX docker compose down
|
|
88
|
-
servedBuild = curl -fsS http://127.0.0.1:$DEV_FLOW_PORT/version
|
|
112
|
+
servedBuild = curl -fsS http://127.0.0.1:$DEV_FLOW_PORT/version
|
|
89
113
|
```
|
|
90
114
|
|
|
91
|
-
`$DEV_FLOW_SUFFIX` is empty on the default port and `-<slug>` on any other, so a second instance gets
|
|
92
|
-
compose project.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
115
|
+
`$DEV_FLOW_SUFFIX` is empty on the default port and `-<slug>` on any other, so a second instance gets
|
|
116
|
+
its own compose project. The deploy output shows what the variables resolved to.
|
|
117
|
+
`flow finish` runs `devDown` for an instance on a non-default port. See
|
|
118
|
+
[concurrency](concurrency.md#sharing-one-dev-stack).
|
|
119
|
+
|
|
120
|
+
## Guard rules
|
|
96
121
|
|
|
97
|
-
Your project's own safety rules
|
|
98
|
-
adopting dev-flow can delete its own guard extension:
|
|
122
|
+
Your project's own safety rules go in a `flow-guard` block in `## global`:
|
|
99
123
|
|
|
100
124
|
````markdown
|
|
101
125
|
## global
|
|
102
126
|
```flow-guard
|
|
103
|
-
deny \bgit\b[^\n]*\bpush\b[^\n]*--force(?!\w) :: history stays linear — the playbook sets the merge style
|
|
104
127
|
deny \bgit\b[^\n]*\bworktree\s+prune\b :: it prunes other sessions' worktrees
|
|
105
|
-
confirm \bgit\b[^\n]*\bbranch\s+(?:-D\b|--delete\b) :: deletes a
|
|
128
|
+
confirm \bgit\b[^\n]*\bbranch\s+(?:-D\b|--delete\b) :: deletes a branch git can't see as merged
|
|
106
129
|
confirm \bdocker\b[^\n]*\bcompose\b[^\n]*\brestart\b :: drops a permanent upstream connection
|
|
107
|
-
protect docker/.env* ::
|
|
108
|
-
forbid docker/secrets ::
|
|
130
|
+
protect docker/.env* :: live secrets, and any backup copied beside them
|
|
131
|
+
forbid docker/secrets :: secret storage
|
|
109
132
|
```
|
|
110
133
|
````
|
|
111
134
|
|
|
112
135
|
| Verb | Applies to | What happens |
|
|
113
136
|
|---|---|---|
|
|
114
|
-
| `deny` |
|
|
115
|
-
| `confirm` |
|
|
116
|
-
| `protect` | an edit/write path | asks
|
|
117
|
-
| `forbid` | an edit/write path |
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
you mean, not
|
|
123
|
-
`git filter-branch --force
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
`origin` URL at the moment of use (GitHub gets `gh`, GitLab gets `glab`, self-hosted stays forge-neutral:
|
|
185
|
-
no automatic release creation, merge proof by ancestry only), and `release.releases = false` skips
|
|
186
|
-
automatic release creation entirely.
|
|
187
|
-
|
|
188
|
-
### The merge policy (`merge = squash | merge | rebase | any`)
|
|
189
|
-
|
|
190
|
-
The one knob a repo can silently lack: a squash and a merge commit look identical right up until someone
|
|
191
|
-
needs to know which one the release contains. Three things read the key:
|
|
192
|
-
|
|
193
|
-
| policy | `main` gains | provable with git alone |
|
|
137
|
+
| `deny` | a bash command (regex) | blocked |
|
|
138
|
+
| `confirm` | a bash command (regex) | asks you; blocked when there's no UI to ask |
|
|
139
|
+
| `protect` | an edit/write path | asks you; blocked when there's no UI |
|
|
140
|
+
| `forbid` | an edit/write path | blocked |
|
|
141
|
+
|
|
142
|
+
Tips:
|
|
143
|
+
- Text after ` :: ` is the reason, shown when the rule fires.
|
|
144
|
+
- An invalid regex makes the playbook invalid, and `flow init` refuses it.
|
|
145
|
+
- Match the **verb** you mean, not a flag. `\bgit\b[^\n]*--force` also blocks
|
|
146
|
+
`git filter-branch --force`.
|
|
147
|
+
- You don't need a rule for force pushes. dev-flow already asks you about every one.
|
|
148
|
+
- A path rule on a directory covers everything under it, including files that don't exist yet.
|
|
149
|
+
- A glob only works in the **last** path segment: `docker/.env*` covers `.env` and
|
|
150
|
+
`.env.bak-2026`. A glob anywhere else matches nothing, and `flow init` warns about it.
|
|
151
|
+
- Rules are matched per shell segment (`;`, `|`, `&&`). Read-only commands like `grep`, `cat` and
|
|
152
|
+
`git log` are skipped, so `grep "git push --force" docs/` is just a search. Read-only commands that
|
|
153
|
+
can write (`find -delete`, `sort -o`) are still checked.
|
|
154
|
+
- Guard rules belong in `## global` only. A block under a stage is ignored with a warning.
|
|
155
|
+
|
|
156
|
+
## Release settings
|
|
157
|
+
|
|
158
|
+
These go under `## pre-release` or `## release`. Either section works.
|
|
159
|
+
|
|
160
|
+
| Key | Default | What it does |
|
|
161
|
+
|---|---|---|
|
|
162
|
+
| `versionFile` | — | the version manifest (`package.json`, `VERSION`, …). Without it, releases are unversioned. |
|
|
163
|
+
| `versionTag` | `v{version}` | tag format |
|
|
164
|
+
| `changelog` | `CHANGELOG.md` | set it empty to opt out |
|
|
165
|
+
| `merge` | *(asked)* | how a PR lands: `squash`, `merge`, `rebase` or `any`. See below. |
|
|
166
|
+
| `version` | `ask` | who makes the release call: `ask` (you, at Verified?), or `versioned` / `unversioned` for every flow |
|
|
167
|
+
| `ask` | `on-change` | `on-change`: Release? answers itself when only release prep changed. `always`: ask every time. |
|
|
168
|
+
| `yolo` | `all` | `until-release`: a yolo given earlier never answers Release? |
|
|
169
|
+
| `reflect` | `on-friction` | `always`: run the closing reflection on every finish |
|
|
170
|
+
| `review` | `/flow-review` | the review step at pre-release |
|
|
171
|
+
| `preflight` | — | runs in the worktree at `flow release` before anything ships, for example `docker build .` |
|
|
172
|
+
| `artifact` | — | proves the release was published, for example `npm view <pkg>@{version} version` |
|
|
173
|
+
| `releases` | `true` | `false` skips creating a forge release |
|
|
174
|
+
|
|
175
|
+
`## pre-release` prose is a good place for your versioning rules, such as "minor for user-facing
|
|
176
|
+
features, patch otherwise". The gates check the mechanics: the version is bumped past the last tag,
|
|
177
|
+
and the changelog has the entry. See [gates](gates.md#release-release).
|
|
178
|
+
|
|
179
|
+
A changelog entry describes the branch's **net change**, not its commit history. A feature that took
|
|
180
|
+
several commits is one entry.
|
|
181
|
+
|
|
182
|
+
### The merge policy
|
|
183
|
+
|
|
184
|
+
A squash and a merge commit look the same until someone needs to know which one a release contains.
|
|
185
|
+
So dev-flow asks.
|
|
186
|
+
|
|
187
|
+
| Policy | Main gains | Provable with git alone? |
|
|
188
|
+
|---|---|---|
|
|
189
|
+
| `merge` | a merge commit plus the branch's commits | yes |
|
|
190
|
+
| `squash` | one new commit | no, it asks the forge |
|
|
191
|
+
| `rebase` | the branch's commits with new SHAs | no, it asks the forge |
|
|
192
|
+
| `any` | no policy, and no asking | — |
|
|
193
|
+
|
|
194
|
+
- **`flow init` and `flow start` ask** if it isn't set, with evidence from your history.
|
|
195
|
+
- **The guard enforces it.** `gh pr merge <n> --squash` under `merge = merge` is blocked, and a merge
|
|
196
|
+
with no style flag asks you. Put the PR number *before* the flag.
|
|
197
|
+
- **Merge only once CI is green** (`gh pr checks <n> --watch`). Local checks can't run CI-only jobs.
|
|
198
|
+
- **`release-done` proves** that what landed matches the policy. When it can't tell, it prints a note
|
|
199
|
+
instead of refusing.
|
|
200
|
+
|
|
201
|
+
dev-flow can't stop someone clicking the merge button in the web UI. Use your forge's
|
|
202
|
+
merge-strategy setting for that.
|
|
203
|
+
|
|
204
|
+
## Global settings
|
|
205
|
+
|
|
206
|
+
| Key | Default | What it does |
|
|
194
207
|
|---|---|---|
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
Init prints its findings and never regenerates your file: a draft cannot reproduce your prose, checklist items and hand-set keys. `--force` is the deliberate overwrite — with your word (`--confirmed`, or one
|
|
237
|
-
confirm dialog) and a `project.md.bak` of what was there. At any time
|
|
238
|
-
you can just edit `.dev-flow/project.md` yourself — the next `flow init` (doctor) validates and
|
|
239
|
-
flags problems, and `flow doctor` runs the same probes on demand without offering to change
|
|
240
|
-
anything (findings are also printed whenever `flow init` runs without a UI, e.g. in CI). `--force`
|
|
241
|
-
rewrites from fresh detection. Improvement
|
|
242
|
-
ideas the agent notices along the way queue up in `.dev-flow/reflections.md` — *this project's*
|
|
243
|
-
queue only: `## playbook` (the fix lives in your playbook → docs flow) and `## code` (the fix
|
|
244
|
-
touches your code → patch flow). Feedback about dev-flow itself never lands there: it becomes a
|
|
245
|
-
GitHub issue on the dev-flow repo. `flow reflect --playbook|--code "<note>"` appends a note,
|
|
246
|
-
`flow reflect --plugin "<note>"` prints the upstream issue recipe instead (no flag guesses from the
|
|
247
|
-
wording and prints why), `flow reflect list` numbers the open ones, `flow reflect move <n>
|
|
248
|
-
--playbook|--code` re-files one, `flow reflect tidy` drops the closed (`- [x]`) ones, plain
|
|
249
|
-
`flow doctor` reviews the open ones and routes each fix to the flow that implements it. At finish
|
|
250
|
-
— run by `flow finish` itself, before it removes anything — a fresh read-only **reflect worker**
|
|
251
|
-
(`flow_stage` op `reflect`) reviews the whole session — the
|
|
252
|
-
driver's and every worker's transcript — and returns classified findings with a fold/drop
|
|
253
|
-
recommendation each; the operator decides per item (fold = a queue row or an upstream issue, drop
|
|
254
|
-
= nothing recorded). Suggestions to fix open items or tidy closed ones are timed (finish, between
|
|
255
|
-
flows, doctor — never mid-feature) — and nothing there ever gates.
|
|
256
|
-
Future features have their own file: `.dev-flow/roadmap.md`, a gitignored backlog `flow roadmap`
|
|
257
|
-
manages (add / pick → `flow start` / done / tidy) — a picked item is checked off by `finish` when
|
|
258
|
-
its feature ships, and it never gates either.
|
|
259
|
-
|
|
260
|
-
### Structured stage reports (a convention, not a gate)
|
|
261
|
-
|
|
262
|
-
The gates enforce *state*; how the agent *talks* about that state is presentation. The norm lives in
|
|
263
|
-
the skill itself — the **Stage reports** clause in `SKILL.md` ground rules, echoed by the
|
|
264
|
-
`Stage reports:` line in every stage-context injection — so every repo using dev-flow gets the same
|
|
265
|
-
output protocol without writing a word of playbook prose. This is the human explanation of it.
|
|
266
|
-
|
|
267
|
-
**Two readers, one result.** Every `flow` tool result is split. The agent's copy keeps every
|
|
268
|
-
instruction (what to run next, what to ask). Your copy — the tool row in the TUI — shows a header
|
|
269
|
-
(`✅ Verification · dark-mode`, `❌ … refused`, `💬` when it waits on you), the stage line, the facts,
|
|
270
|
-
and the one question waiting on you, phrased as a word to answer in chat. Lines the gate marks
|
|
271
|
-
agent-only, and any clause that names a `flow` command, are left out of your copy (expand the row to see
|
|
272
|
-
them dimmed). The test suite checks every gate it drives: no operator view names a command. If an answer
|
|
273
|
-
still hands you a command to type, the next run gets a hidden correction.
|
|
274
|
-
|
|
275
|
-
**The gate writes the stage line.** It is built from state on every gate that has a feature in scope,
|
|
276
|
-
so it is the same every time; the agent pastes it as is (`stage line for your report`) instead of
|
|
277
|
-
rebuilding glyphs and marks from memory.
|
|
278
|
-
|
|
279
|
-
One gate message = **stage line** + event title + **`Done:`** / **`Next steps:`** blocks, all plain
|
|
280
|
-
markdown, **never fenced** (a fenced block renders monospace with a horizontal scrollbar in web UIs;
|
|
281
|
-
fences stay for diffs and command output).
|
|
282
|
-
|
|
283
|
-
**The stage line** *is* the decision record — one copy of every fact. It opens with the statusbar's
|
|
284
|
-
own stage glyph (the footer is the legend: 💬 pre-flow "operator, your turn" · 📝 plan · 🔨 implement
|
|
285
|
-
· 🔍 pre-release · 🚀 release · 🏁 finish), then `slug — key value` pairs separated by `·`, with the
|
|
286
|
-
mode glyphs after the slug as in the footer (⚡ patch · 📚 docs · 🎱 yolo). Every value carries a
|
|
287
|
-
provenance mark:
|
|
288
|
-
|
|
289
|
-
| mark | meaning |
|
|
208
|
+
| `defaultBranch` | `main` | |
|
|
209
|
+
| `forge` | detected from `origin` | `github` (uses `gh`), `gitlab` (uses `glab`) or `self` (no automatic releases; merges proven by git ancestry) |
|
|
210
|
+
| `branchPattern` | `feat/{slug}` | |
|
|
211
|
+
| `worktreeDir` | `.dev-flow/{slug}/worktree` | |
|
|
212
|
+
| `mainHook` | `true` | install the `pre-commit` hook that blocks main commits |
|
|
213
|
+
| `mockupGlobs` | `*.png` | what counts as a mockup render for `--ui` |
|
|
214
|
+
| `bashTimeout` | `inject` | `require`: refuse shell calls with no timeout, instead of adding one |
|
|
215
|
+
|
|
216
|
+
## flow init in detail
|
|
217
|
+
|
|
218
|
+
- **Fresh repo:** prints the detection report and the questions. Writes nothing.
|
|
219
|
+
- **`--answers key=value …`** (or `--answers-file <path>`) applies answers as targeted edits. Your
|
|
220
|
+
hand-written lines survive. It shows a diff, and writes only with `--confirmed`. Keys include
|
|
221
|
+
`forge`, `defaultBranch`, `setup` / `test` / `build` / `run` / `dev` / `health`,
|
|
222
|
+
`versionFile` / `versionTag` / `changelog`, `releases` / `artifact` / `preflight` / `merge`, and
|
|
223
|
+
`check.<name>` for a check block (an empty value removes it).
|
|
224
|
+
- **`--write-file <path>`** (or `--write "<content>"`) replaces the whole file, after validating it.
|
|
225
|
+
- **`--track`** commits the playbook. **`--draft`** prints the draft without writing.
|
|
226
|
+
- **Existing playbook:** init becomes a doctor. It reports drift, dead commands, an unparseable
|
|
227
|
+
manifest and leftover feature folders, and never rewrites your file. `--force` regenerates it from
|
|
228
|
+
fresh detection, with your OK and a `.bak`. `flow doctor` runs the same checks without offering
|
|
229
|
+
changes.
|
|
230
|
+
- **Hook managers** (husky, lefthook): init prints the hook lines for you to add instead of installing
|
|
231
|
+
a hook git would ignore.
|
|
232
|
+
|
|
233
|
+
`.dev-flow/` ignores itself except for `project.md`. To track the playbook in a repo that ignores
|
|
234
|
+
the folder: `git add -f .dev-flow/project.md && DEV_FLOW_ALLOW_MAIN=1 git commit -m "track project.md"`.
|
|
235
|
+
|
|
236
|
+
## How the agent reports
|
|
237
|
+
|
|
238
|
+
The gates enforce state. How the agent *talks* about it is a convention built into the skill, so
|
|
239
|
+
every repo gets it without writing any prose.
|
|
240
|
+
|
|
241
|
+
**Two copies of each result.** The agent's copy has every instruction. Your copy shows a header
|
|
242
|
+
(`✅ Verification · dark-mode`, `❌ … refused`, or `💬` when it's waiting on you), the stage line, the
|
|
243
|
+
facts, and the one question for you. It never shows a command for you to type.
|
|
244
|
+
|
|
245
|
+
**The stage line** is the decision record. The gate builds it from state and the agent pastes it
|
|
246
|
+
as is. Every value carries a mark:
|
|
247
|
+
|
|
248
|
+
| Mark | Means |
|
|
290
249
|
|---|---|
|
|
291
|
-
| `✓` |
|
|
292
|
-
| `✓playbook` / `✓detected` |
|
|
293
|
-
| `~` | agent
|
|
294
|
-
| `?` |
|
|
295
|
-
|
|
296
|
-
A
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
it; PR/tag/artifact/forge proofs at 🚀 (stage lines only there — that stage asks nothing); release-
|
|
301
|
-
recorded / main-state / unmerged / reflections at 🏁.
|
|
302
|
-
|
|
303
|
-
**The checkpoint** closes exactly one message per stage (the operator's verb stays a plain-chat word
|
|
304
|
-
— a structured-question tool is not chat). Event title, then the labels **`Done:`** and
|
|
305
|
-
**`Next steps:`** standing alone on their own lines. `Done:` says what now works, in plain words and
|
|
306
|
-
counts, not vibes; a path or SHA only when the operator needs it. Internals (modules, code paths)
|
|
307
|
-
stay out of chat unless asked. `Next steps:` lists the operator's verbs in italics (the recommended one
|
|
308
|
-
***bold italic***, and no line needs a "(recommended)" tag when the styling carries it) and **never
|
|
309
|
-
gate commands** (the agent runs those): recommended first, then alternatives, then *yolo* last with
|
|
310
|
-
what it pre-confirms, then the plain closing line "or say what to do differently". Example:
|
|
311
|
-
|
|
312
|
-
> **🔍 pre-release · `dark-mode`** — `normal` ✓playbook · ui `on` ✓ · commits `4 ahead, 0 uncommitted` · checks test ✓ build ✓ · version `0.56.0` ~ · merge `merge` ✓playbook · `feat/dark-mode@3f2c1a9`
|
|
250
|
+
| `✓` | you decided |
|
|
251
|
+
| `✓playbook` / `✓detected` | a rule or detection decided |
|
|
252
|
+
| `~` | the agent assumed it, and you can veto it |
|
|
253
|
+
| `?` | waiting on you |
|
|
254
|
+
|
|
255
|
+
**A checkpoint message** is the stage line, a title, then **Done:** (what works now, in plain
|
|
256
|
+
words) and **Next steps:** (your options as words to say, recommended first, yolo last):
|
|
257
|
+
|
|
258
|
+
> **🔍 pre-release · `dark-mode`** — `normal` ✓playbook · ui `on` ✓ · commits `4 ahead, 0 uncommitted` · checks test ✓ build ✓ · version `0.56.0` ~ · merge `merge` ✓playbook
|
|
313
259
|
>
|
|
314
260
|
> **Release prep done**
|
|
315
261
|
>
|
|
@@ -317,13 +263,7 @@ what it pre-confirms, then the plain closing line "or say what to do differently
|
|
|
317
263
|
> review 0 must / 0 should; CHANGELOG `## [0.56.0]` folded from `Unreleased`; manifest bumped
|
|
318
264
|
>
|
|
319
265
|
> **Next steps:**
|
|
320
|
-
> - ***Release*** → tag `v0.56.0`, forge release
|
|
321
|
-
> - *No-version* → merge only, entry
|
|
322
|
-
> - *Yolo* → release with these
|
|
323
|
-
> - or say what to do differently
|
|
324
|
-
|
|
325
|
-
Mid-stage (non-checkpoint) reports are the stage line plus a short body — no `Next steps:` block —
|
|
326
|
-
and mid-stage scope additions amend `plan.md` with an `**Added mid-stage:**` line instead of opening
|
|
327
|
-
a second checkpoint. Like all tier-3 prose this is advisory: gates refuse what gates refuse no matter
|
|
328
|
-
how the report is formatted. A project can still set `prose.<stage>` for its own stage guidance —
|
|
329
|
-
that replaces the built-in guidance text but the Stage reports rule keeps applying.
|
|
266
|
+
> - ***Release*** → tag `v0.56.0`, forge release
|
|
267
|
+
> - *No-version* → merge only, entry stays under `Unreleased`
|
|
268
|
+
> - *Yolo* → release with these settings, remaining gates back to back
|
|
269
|
+
> - or say what to do differently
|