pi-dev-flow 0.62.2 → 0.63.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 +6 -0
- package/README.md +7 -2
- package/docs/guardrails.md +1 -1
- package/package.json +1 -1
- package/skills/flow-simplify/SKILL.md +137 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ Format: newest first. `Unreleased` collects what's merged but not yet tagged.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.63.0] - 2026-10-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`/flow-simplify` — the review skill that actually cuts.** `/flow-review` and `/flow-audit` only report; the new third sibling edits: dead code, no-op placeholder subsystems, misplaced dev scaffolding, genuine duplication (reuse the existing helper before inventing one) and speculative abstractions, removed in a risk-ascending order with the safe levers first. The rails are the feature: a green baseline before any cut (red → stop), behavior-preserving only — a test touched to pass is a reverted cut, Chesterton's fence for anything you cannot explain, semantic dead-code tooling with grep demoted to confirmation, one cut → checks → commit so every regression names its cut, and a structural-vs-cheap self-audit that forces the skill to admit when it shrank the number instead of the system (reformatting, comment-trimming-as-strategy and counted-path moves are named as gaming). Deleting a feature is always escalated, never done. Default target: what you name, else the bound flow's branch diff — whole-repo stays `/flow-audit`'s job. Adapts maxim-saplin/goal-sloc (MIT), addyosmani/agent-skills code-simplification (MIT) and Anthropic's code-simplifier plugin (Apache-2.0).
|
|
12
|
+
|
|
7
13
|
## [0.62.2] - 2026-10-24
|
|
8
14
|
|
|
9
15
|
### Added
|
package/README.md
CHANGED
|
@@ -167,12 +167,17 @@ finding needs a concrete triggering case (refuted findings are dropped), grouped
|
|
|
167
167
|
Should fix / Nice to have, ending in a verdict and an honest `Not checked:` line. It is the
|
|
168
168
|
pre-release review step (`release.review` in `project.md` stays yours to set). **`/flow-audit`**
|
|
169
169
|
audits the whole repo in the same style: map first, judge against the load the project actually
|
|
170
|
-
expects, at most 20 ranked findings, changes nothing.
|
|
170
|
+
expects, at most 20 ranked findings, changes nothing. The operative sibling **`/flow-simplify`**
|
|
171
|
+
makes the cuts audit and review only name: dead code, no-op subsystems, duplication,
|
|
172
|
+
speculative layers — removed in a risk-ascending order, one verified commit per cut, green
|
|
173
|
+
tests as contract, and a structural-vs-cheap self-audit so the diff shrank because the system
|
|
174
|
+
got smaller, not because comments got deleted. And while a flow writes code, the
|
|
171
175
|
implement stage injects a compact senior-discipline guidance — smallest complete change, no
|
|
172
176
|
speculative abstraction, finish what your change breaks, a failing-first test for risky logic —
|
|
173
177
|
your playbook's `prose.implement` replaces it wholesale whenever you write your own. (The review
|
|
174
178
|
rules adapt ponytail, obra/superpowers and pi-development-system — all MIT, credited in the
|
|
175
|
-
skill files
|
|
179
|
+
skill files; `/flow-simplify` adapts goal-sloc (MIT), addyosmani/agent-skills (MIT) and
|
|
180
|
+
Anthropic's code-simplifier plugin (Apache-2.0).)
|
|
176
181
|
|
|
177
182
|
## The playbook the agent always has
|
|
178
183
|
|
package/docs/guardrails.md
CHANGED
|
@@ -14,7 +14,7 @@ While a feature is active, the extension intercepts every tool call:
|
|
|
14
14
|
- **A forced push asks the operator**: `git push` carrying `--force`, `--force-with-lease…` or `-f` is confirmed before it runs — a rewritten branch is history CI and other sessions already have. The one spelling that answers for it is the prefix the refusal prints (`DEV_FLOW_ALLOW_REWRITE=1 git push -f …`), the same "the operator said so" contract as `DEV_FLOW_ALLOW_MAIN`. Local history rewrites (`git filter-branch --force`) are not pushes and stay free, so a project never needs a blunt flag-only deny of its own.
|
|
15
15
|
- **Shell calls can't hang forever**: pi kills a shell command only when the model passed a `timeout` — it omits one in ~75% of calls, so a `gh` waiting on a prompt or a dead `curl` froze sessions for hours. In an initiated repo (`.dev-flow/project.md` exists) the call is therefore by default **refused** until the model states one (`bashTimeout = require`): the refusal names the exact value the class table would have armed, so the retry is a one-token fix and the call line in the transcript shows the timeout that is actually running. The injected class default (30s quick inspection · 120s local git and unknown · 180s network · 300s containers/services · 900s builds/tests/installs · 1,200s watchers like `gh run watch`) stays armed underneath either way, and absurd explicit values clamp to 1,800s. A project that would rather not nag sets `bashTimeout = inject` in `## global` — then the default is armed silently and the call passes. Uninitiated folders hear nothing at all: without the playbook dev-flow enforces no rules.
|
|
16
16
|
- **Compact-aware**: dev-flow paces compaction the way pi counts it: the self-compaction trigger uses the *effective* `reserveTokens` (settings and per-model overrides, not the built-in default) and is checked at every turn end, not only when a run settles. When pi force-compacts on its threshold anyway — the chat-only states (open tier-2 dialog, plan discussion not yet in `plan/`) refuse to self-compact by design — dev-flow takes the compaction over and redoes it with flow-aware summary instructions (overflow recovery keeps pi's compact-and-retry and is left alone). Auto-compaction turned off in settings is honored; a note about any compaction dev-flow could not shape still lands in `reflections.md`.
|
|
17
|
-
- The active stage is injected into the model's context every turn; the bundled `dev-flow` skill is the agent's playbook, including the recommended sequences: pre-release — review (`/flow-review`) → fixes → docs → changelog/version bump; release — PR → merge → tag → `release-done`. The package also bundles the review skills themselves — `/flow-review` (a change, read against its `plan/plan.md`)
|
|
17
|
+
- The active stage is injected into the model's context every turn; the bundled `dev-flow` skill is the agent's playbook, including the recommended sequences: pre-release — review (`/flow-review`) → fixes → docs → changelog/version bump; release — PR → merge → tag → `release-done`. The package also bundles the review skills themselves — `/flow-review` (a change, read against its `plan/plan.md`), `/flow-audit` (the whole repo) and `/flow-simplify` (the operative cut: deletes dead and duplicated code, one verified commit at a time) — and injects a built-in senior-discipline guidance at implement stage unless the playbook sets its own `prose.implement`.
|
|
18
18
|
- **Status bar**: an initiated repo (`.dev-flow/project.md` exists) always carries the dev-flow footer; while the session **is bound** to a feature it shows `<stage glyph> <slug>` plus mode markers — stages 📝 plan, 🔨 implement, 🔍 pre-release, 🚀 release; markers ⚡ patch, 📚 docs, 🎱 yolo, and `⚠️` while a check of the bound feature fails (emoji render in their own color, so the footer carries no theme coloring). An **unbound** session never sees a slug — it shows `⧖ N flow(s) open` (unfinished-feature count only, no warning marker) or `⧖ no flows` when nothing is in flight; a session binds only via `flow start`/`flow use`, never by opening. The footer repaints at session start, at the start of every agent run (the earliest a late-attaching web client is listening) and after every gate; an uninitiated folder gets no footer at all. `flow status` is the spelled-out surface: `stage=implement`, the per-feature mode tags (`[ui]`, `[yolo]`, `[no-version]`) and the `flow=<ver>` stamp of the build that started the feature.
|
|
19
19
|
|
|
20
20
|
## Limitations (deliberate, v1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-dev-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.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": [
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-simplify
|
|
3
|
+
description: >
|
|
4
|
+
Operative cut-down of code: delete dead code, collapse near-copies, reuse
|
|
5
|
+
shared helpers, remove unused options and speculative abstractions — while
|
|
6
|
+
behavior and the green test suite are contract. Unlike the read-only
|
|
7
|
+
flow-review and flow-audit, this one edits, commit by verified commit. Use
|
|
8
|
+
for "simplify this", "slim this down", "compact this code", "remove dead
|
|
9
|
+
code", "dedupe this". Default target: what the operator names, or the bound
|
|
10
|
+
flow's branch diff.
|
|
11
|
+
argument-hint: "[file... | dir...]"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# flow-simplify
|
|
15
|
+
|
|
16
|
+
Cut real weight: less system, same behavior. Review and audit report; this
|
|
17
|
+
skill edits — under a discipline that keeps every cut reviewable and cheaply
|
|
18
|
+
revertible. Order of importance: **behavior preserved, honest cuts, least
|
|
19
|
+
code.** Editing means working where editing is allowed — a dev-flow worktree
|
|
20
|
+
or a branch, never a bare default branch. Deleting or changing a feature is
|
|
21
|
+
one cut too far: that is the operator's call.
|
|
22
|
+
|
|
23
|
+
## 0. The game's rules
|
|
24
|
+
|
|
25
|
+
- Behavior-preserving only: same inputs, outputs, error behavior, side
|
|
26
|
+
effects, edges. Tests define that behavior.
|
|
27
|
+
- Green baseline first: run the project's checks (playbook test/build/lint
|
|
28
|
+
commands, or README's). Red baseline → stop; never simplify on top of red.
|
|
29
|
+
- Never touch a test to make it pass after a cut. A cut that breaks a green
|
|
30
|
+
test changed behavior — or found a bug. Revert and report; the bug is a
|
|
31
|
+
separate flow.
|
|
32
|
+
- Small steps: one cut, one check, one commit (§6).
|
|
33
|
+
|
|
34
|
+
## 1. Pick the target
|
|
35
|
+
|
|
36
|
+
- What the operator names: files, a folder, a subsystem.
|
|
37
|
+
- Nothing named and the session is bound to a dev-flow feature: the code
|
|
38
|
+
this flow's branch touched — `git diff $(git merge-base origin/<default> HEAD)`
|
|
39
|
+
plus uncommitted work (run `flow status` for the worktree and default).
|
|
40
|
+
- Neither: ask. Never silently widen to the whole repo — that is
|
|
41
|
+
`/flow-audit`'s job: audit finds it, you cut it.
|
|
42
|
+
|
|
43
|
+
## 2. Baseline and tools
|
|
44
|
+
|
|
45
|
+
- Count lines per area (app code, tests) before you start, measured through
|
|
46
|
+
the project's formatter so a reformat cannot fake a win.
|
|
47
|
+
- Dead-code claims come from semantic tooling — language server, knip,
|
|
48
|
+
vulture, `cargo machete`, whatever the repo has. Grep confirms a tool's
|
|
49
|
+
hit; grep alone lies: it misses re-exports, dynamic and string dispatch,
|
|
50
|
+
tear-offs, and config references.
|
|
51
|
+
- Name the floor you will not touch: generated files, vendored code,
|
|
52
|
+
platform scaffolding. A line that was never yours is not bloat.
|
|
53
|
+
|
|
54
|
+
## 3. Chesterton's fence
|
|
55
|
+
|
|
56
|
+
Understand why the code exists before you touch it: who calls it, what it
|
|
57
|
+
calls, which tests pin it, what `git blame` says about its origin. If you
|
|
58
|
+
cannot say why it exists and what exact maintenance cost removing it lifts,
|
|
59
|
+
leave it and list it under `Untouched:`. Commented-out blocks and
|
|
60
|
+
unreachable branches are the exception — they never get a fence.
|
|
61
|
+
|
|
62
|
+
## 4. The cut order
|
|
63
|
+
|
|
64
|
+
Safe to risky; risk rises as you go down, so stopping at any line is a fine
|
|
65
|
+
answer. Verify each cut (§6) before the next.
|
|
66
|
+
|
|
67
|
+
1. **Dead code:** files, exports, functions, branches with zero references —
|
|
68
|
+
§2-verified, tests, fixtures, config and dynamic references included.
|
|
69
|
+
2. **No-op places:** fully plumbed subsystems that do nothing, toggles
|
|
70
|
+
hardcoded off, config nobody sets, options with no effect. Dead weight
|
|
71
|
+
in feature clothing.
|
|
72
|
+
3. **Misplaced scaffolding:** dev/debug/test harnesses in shipping code →
|
|
73
|
+
move them to their real home.
|
|
74
|
+
4. **Duplication:** same logic in two places → one remains. Search for an
|
|
75
|
+
existing helper before extracting a new one — reuse beats inventing.
|
|
76
|
+
Near-identical files become one; two helpers doing one job keep the
|
|
77
|
+
better path, by name.
|
|
78
|
+
5. **Speculative structure:** an interface with one implementation, a
|
|
79
|
+
factory or strategy for one case, a wrapper that only forwards. Delete
|
|
80
|
+
the layer; call the thing.
|
|
81
|
+
6. **Comment hygiene:** comments restating the code die; comments saying
|
|
82
|
+
*why* stay. This rides along on files you are already editing — a
|
|
83
|
+
standalone comment-trim is not simplification, it is silencing.
|
|
84
|
+
7. **Only when asked and the tests are a faithful spec:** clean-room rewrite
|
|
85
|
+
of a worst file against its tests, discarding accumulated cruft. Riskiest
|
|
86
|
+
lever here; without trusting tests you rewrite bugs into features.
|
|
87
|
+
|
|
88
|
+
## 5. Honest cuts
|
|
89
|
+
|
|
90
|
+
The number is the temptation; the system is the point. Never: reformat, pack
|
|
91
|
+
lines or strip blanks to shrink; delete docs or features to win; move code
|
|
92
|
+
out of the counted path; adjust the measuring tool. When done, split your
|
|
93
|
+
cuts: **structural** (dead, no-op, duplication, layers) vs **cheap**
|
|
94
|
+
(comments, whitespace, cosmetic moves). Cheap in the majority means the
|
|
95
|
+
metric was gamed — say so plainly and report that the structural well is
|
|
96
|
+
dry; that report is itself a good result.
|
|
97
|
+
|
|
98
|
+
## 6. The loop
|
|
99
|
+
|
|
100
|
+
One cut → project checks → commit, or revert and reconsider. Never batch cuts
|
|
101
|
+
into one commit — a regression must name its cut. A single cut touching 500+
|
|
102
|
+
lines gets scripted (codemod, AST transform, sed), not hand-edited. Pure
|
|
103
|
+
reformatting, when you must have any, rides a separate commit from real cuts.
|
|
104
|
+
|
|
105
|
+
## 7. Do not over-simplify
|
|
106
|
+
|
|
107
|
+
- Never inline away a helper whose name was the concept.
|
|
108
|
+
- Never merge two functions into one with two jobs.
|
|
109
|
+
- Never remove error handling "for cleanliness"; never delete an abstraction
|
|
110
|
+
that exists for testability — ask before that one.
|
|
111
|
+
- Never trade if/else for a nested ternary to save lines; explicit and a
|
|
112
|
+
touch longer beats clever and short.
|
|
113
|
+
- Never rename to your taste — project conventions win; churn dressed as
|
|
114
|
+
cleanup is just churn.
|
|
115
|
+
|
|
116
|
+
## 8. When to stop
|
|
117
|
+
|
|
118
|
+
The remaining cuts are architecture reshuffles you cannot finish and verify
|
|
119
|
+
here, product scope, or riskier than their value: stop and report. No
|
|
120
|
+
refactor→regret→revert loops, no half-migrated layer left behind — half a
|
|
121
|
+
migration is worse than none. A legitimate ending is *"already lean"*:
|
|
122
|
+
small cut, suite green, nothing worth removing.
|
|
123
|
+
|
|
124
|
+
## 9. Report
|
|
125
|
+
|
|
126
|
+
Plain English, short sentences. Start with **`Cut:`** — counts per §4
|
|
127
|
+
category, files and lines before → after, the structural:cheap split (§5),
|
|
128
|
+
checks green. Then **`Reused:`** — the existing helpers duplicated logic
|
|
129
|
+
folded into (paths). Then **`Untouched:`** — fences left standing and why,
|
|
130
|
+
parts not covered and anything you could not verify. Close with
|
|
131
|
+
**`Decisions needed:`** only when a remaining cut is scope or product — with
|
|
132
|
+
the numbers, so the operator can choose.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
_Adapted for dev-flow from: maxim-saplin/goal-sloc (MIT), addyosmani/
|
|
136
|
+
agent-skills code-simplification (MIT),
|
|
137
|
+
anthropics/claude-plugins-official code-simplifier (Apache-2.0)._
|