pi-dev-flow 0.68.1 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/docs/gates.md +1 -1
- package/docs/playbook.md +5 -0
- package/docs/stage-agent.md +138 -49
- package/extensions/dev-flow.ts +501 -80
- package/package.json +1 -1
- package/skills/dev-flow/SKILL.md +4 -1
- package/skills/dev-flow/references/finish.md +7 -3
- package/skills/dev-flow/references/implement.md +22 -8
- package/skills/dev-flow/references/plan.md +4 -0
- package/skills/dev-flow/references/reflect.md +6 -1
- package/skills/dev-flow/references/start.md +12 -0
- package/src/core.ts +528 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-dev-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "Enforced feature workflow for Pi: plan → implement → pre-release → release, gated checkpoints, self-improvement reflections, one git worktree per feature, changelog + publish as part of the release",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
package/skills/dev-flow/SKILL.md
CHANGED
|
@@ -50,6 +50,9 @@ Ground rules:
|
|
|
50
50
|
`flow release --no-version --confirmed` — the merge still owes a changelog
|
|
51
51
|
entry under `Unreleased`, which the next versioned release folds under its
|
|
52
52
|
version heading (default is versioned: bump + tag).
|
|
53
|
+
- **Pre-plan before binding:** an unbound session writes **nothing** — bring
|
|
54
|
+
findings, questions and a proposed direction + slug/mode, and **ask the
|
|
55
|
+
operator to start** (protocol: `references/start.md`).
|
|
53
56
|
- **One session = exactly one feature** (flow + branch + worktree); parallel
|
|
54
57
|
sessions, one feature each, are the model. A session binds **explicitly and
|
|
55
58
|
only**: `flow start <slug>` binds its own feature (main checkout must be on
|
|
@@ -86,7 +89,7 @@ session's stage injection names the file to read now, and this is the map.
|
|
|
86
89
|
|
|
87
90
|
| Read | For |
|
|
88
91
|
| --- | --- |
|
|
89
|
-
| `references/start.md` | `flow init` (no `.dev-flow/` yet), mode grants (`--patch`, `--docs`), playbook ownership |
|
|
92
|
+
| `references/start.md` | pre-plan (unbound: no writes, ask to start), `flow init` (no `.dev-flow/` yet), mode grants (`--patch`, `--docs`), playbook ownership |
|
|
90
93
|
| `references/plan.md` | plan stage — research, clarify, plan file, mockups, Approve? |
|
|
91
94
|
| `references/implement.md` | implement stage — worktree, commits, checks, tier-2 list, Verified? |
|
|
92
95
|
| `references/pre-release.md` | pre-release — `/flow-review`, docs, changelog + bump, Release? |
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
## Stage: finish
|
|
6
6
|
|
|
7
7
|
**Reflect before you finish** — `flow finish` deletes `.dev-flow/<slug>/` and
|
|
8
|
-
the session context goes with it.
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
the session context goes with it. **Delegate the review**: `flow_stage { op:
|
|
9
|
+
"reflect" }` (legal after `release-done`) hands the whole finished flow — this
|
|
10
|
+
session's transcript plus every worker transcript, the plan, live status — to a
|
|
11
|
+
fresh reviewer that returns `[playbook]`/`[plugin]`-tagged findings as an
|
|
12
|
+
outside view. Park real issues with `flow reflect` (the bare `flow reflect`
|
|
13
|
+
self-protocol under *Reflect* is the fallback only when delegation is
|
|
14
|
+
impossible); then:
|
|
11
15
|
|
|
12
16
|
- issues parked → ask **Fold? Fix? Drop?** and stop: fold = write the items
|
|
13
17
|
into `.dev-flow/reflections.md` (your queue), fix = route them now via
|
|
@@ -9,12 +9,16 @@ or the injection line) — writes elsewhere are blocked; other sessions'
|
|
|
9
9
|
worktrees are theirs (attribution guards judge every path by its owning
|
|
10
10
|
feature).
|
|
11
11
|
|
|
12
|
-
**Delegating the stage's work.**
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
**Delegating the stage's work.** Non-trivial implement is **delegated by default**: run it in
|
|
13
|
+
a disposable worker session with `flow_stage` (`stage: "implement"`) — this session keeps its
|
|
14
|
+
context for the gates and the checkpoint; stay inline only for a tail you can finish in a
|
|
15
|
+
handful of file edits. The
|
|
15
16
|
worker gets a fresh context holding the plan, live git and `flow status
|
|
16
17
|
--json` — it keeps nothing from this conversation, so put every operator
|
|
17
|
-
answer, decision, warning and the exact next action into `note
|
|
18
|
+
answer, decision, warning and the exact next action into `note`, and a short
|
|
19
|
+
`label` — a few words of purpose — so the picker reads `⏳ 🔨 #2 · wire ops` and,
|
|
20
|
+
when it ends, `✓ 🔨 #2 · 3 commits · wire ops` (a verify: `✓ 🔍 · PASS · <label>`)
|
|
21
|
+
instead of a column of identical rows. The worker
|
|
18
22
|
may edit and commit in the worktree but holds no flow tool: gates,
|
|
19
23
|
checkpoints and the claim stay with you. When it returns, digest its stage
|
|
20
24
|
report (done/files/notes/blockers — a handoff, never a verification), rerun
|
|
@@ -25,9 +29,11 @@ snapshot `.diff` the result gives. Delegate a real slice, not the tail: do not
|
|
|
25
29
|
delegate a stage you are about to finish anyway. One worker per session at a
|
|
26
30
|
time — but **sequential re-delegation is legal and often right**: a second
|
|
27
31
|
worker whose `note` says what the first one proved is how a big stage is
|
|
28
|
-
sliced. While one runs, the
|
|
32
|
+
sliced. While one runs, the **tool card streams the worker's live output into
|
|
33
|
+
your transcript** (current tool, last assistant line, ✓/✗ results, clock against budget,
|
|
34
|
+
usage); the footer beats progress, the worker is visible as a
|
|
29
35
|
named session in the picker, and `flow_stage { op: "status" }` answers “how’s it
|
|
30
|
-
going?” without a model call. Size `budgetMin` to the slice (default 45): at 75%
|
|
36
|
+
going?” without a model call on any host (the tail also mirrors to `stage-live.log`). Size `budgetMin` to the slice (default 45; verify/reflect default 30): at 75%
|
|
31
37
|
the worker is steered to commit and report rather than cut off.
|
|
32
38
|
|
|
33
39
|
1. Implement per the approved plan with project conventions and the **stage
|
|
@@ -48,7 +54,15 @@ the worker is steered to commit and report rather than cut off.
|
|
|
48
54
|
the tier-2 confirmation — rerun before verify.
|
|
49
55
|
4. UI flag set? An actual browser visual pass (screenshot or the project's
|
|
50
56
|
automated pass) — not just a typecheck.
|
|
51
|
-
5.
|
|
57
|
+
5. **The independent checker speaks before the operator does:** `flow_stage { op: "verify" }`
|
|
58
|
+
runs a read-only reviewer (toolset read + bash, standing order *check, don't fix*) over the
|
|
59
|
+
plan and the branch diff; it closes with a `VERIFY REPORT` verdict. Its **PASS is a
|
|
60
|
+
precondition of `flow verify`** and belongs to the tree it read: any edit after it — yours or
|
|
61
|
+
a delegated fixer's — drops it like a tier-1 record, so fix → a **fresh** verify worker;
|
|
62
|
+
a verdict from an interrupted or tree-touching worker never stamps (a reviewer that edits
|
|
63
|
+
voids its own report). FAIL means: fix (or delegate), then rerun a fresh one — the report is
|
|
64
|
+
a handoff, the gate's own rerun is the proof.
|
|
65
|
+
6. Done means **running and healthy with pre-existing data**, not "compiles":
|
|
52
66
|
`commands.seedData` (if set) puts real data in place, the app starts with
|
|
53
67
|
the `run` command, and the health check passes — `flow check` covers it
|
|
54
68
|
(seedData runs before health) and `flow verify` probes **the deployed app
|
|
@@ -63,7 +77,7 @@ the worker is steered to commit and report rather than cut off.
|
|
|
63
77
|
`health` itself and refuses while nothing is answering). Checkpoint report: stage line **🔨 implement ·
|
|
64
78
|
`<slug>`** — commits `N ahead, M uncommitted` · tier-1 · tier-2 · deploy/
|
|
65
79
|
health · `branch@sha`, then `Done:`/`Next steps:` per the Stage reports rule. Fixes = iterate and re-verify; that loop is
|
|
66
|
-
free.
|
|
80
|
+
free — but every fix re-owes the verify worker's PASS.
|
|
67
81
|
|
|
68
82
|
`flow verify` re-runs build, runs the `dev` deploy when configured (the
|
|
69
83
|
operator reviews the running app; the gate **prints what it ran** —
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
name is itself the gate's proof: **plan.md** — a preliminary direction
|
|
18
18
|
belongs *inside* plan.md (marked draft), never a separate
|
|
19
19
|
`pre-plan`/`direction.md` file: the approve gate requires plan.md by name.
|
|
20
|
+
The flow folder is the plan's permanent home — the worktree only exists
|
|
21
|
+
after approval, while the plan must exist (and stay amendable during
|
|
22
|
+
implement) from before it; that is why plan.md lives in
|
|
23
|
+
`.dev-flow/<slug>/plan/`, not in the worktree.
|
|
20
24
|
First check
|
|
21
25
|
`git log origin/<default>..<default> --oneline`: local-only default-branch
|
|
22
26
|
commits fall out of the worktree's base (push them or re-plan).
|
|
@@ -26,7 +26,12 @@ and stage context; the operator decides:
|
|
|
26
26
|
count with this verb when the pile grows; offer the tidy to the operator then.
|
|
27
27
|
- **Bare `flow reflect` is the end-of-session reflection** — it runs as part
|
|
28
28
|
of every finish (before the slug folder is deleted — see Stage: finish) and
|
|
29
|
-
whenever the operator asks.
|
|
29
|
+
whenever the operator asks. The default way to run that review at finish is
|
|
30
|
+
delegated: `flow_stage { op: "reflect" }` (release stage, after
|
|
31
|
+
`release-done`) gives the whole flow — driver transcript + every worker
|
|
32
|
+
transcript + plan + status — to an independent session that returns tagged
|
|
33
|
+
findings you put to the operator (Fold? Fix? Drop?); the self-protocol below
|
|
34
|
+
is the fallback when delegation is impossible. It prints the
|
|
30
35
|
protocol: review the full session log (messages, tool calls, results);
|
|
31
36
|
re-check each open item against the current playbook and newer dev-flow
|
|
32
37
|
versions (`npm view pi-dev-flow version` vs the running version, or
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
> [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
|
|
3
3
|
> when the session reaches that stage.
|
|
4
4
|
|
|
5
|
+
## Before a flow exists (pre-plan)
|
|
6
|
+
|
|
7
|
+
A feature request arriving in an **unbound** session gets analysis, not
|
|
8
|
+
scaffolding — this is the only phase with **no writes at all** (guards refuse
|
|
9
|
+
checkout writes unbound anyway): read the code the request touches (reads are
|
|
10
|
+
always free), then bring back to chat: findings, the real unknowns, your
|
|
11
|
+
**open questions** and a proposed **direction**, with a proposed slug and mode
|
|
12
|
+
and its one-line why. **Ask the operator to start the flow** — only on their
|
|
13
|
+
word do you `flow start <slug>` (they grant any `--patch`/`--docs` mode at the
|
|
14
|
+
start gate). The direction lives in chat until the plan stage writes and owns
|
|
15
|
+
`plan.md`.
|
|
16
|
+
|
|
5
17
|
## Start
|
|
6
18
|
|
|
7
19
|
**No `.dev-flow/`?** `flow init` analyzes the repo and prints a **setup
|