@gonrocca/zero-pi 0.1.26 → 0.1.27
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/README.md +51 -254
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,294 +13,91 @@
|
|
|
13
13
|
|
|
14
14
|
**The zero spec-driven development workflow, packaged for [pi](https://pi.dev).**
|
|
15
15
|
|
|
16
|
-
[](https://www.npmjs.com/package/@gonrocca/zero-pi)
|
|
17
|
-
[](https://github.com/gonzalonicolasr/zero-pi)
|
|
18
|
-
[](./LICENSE)
|
|
19
|
-
[](https://nodejs.org)
|
|
20
|
-
|
|
21
|
-
**Repositorio:** [github.com/gonzalonicolasr/zero-pi](https://github.com/gonzalonicolasr/zero-pi)
|
|
16
|
+
[](https://www.npmjs.com/package/@gonrocca/zero-pi) [](https://github.com/gonzalonicolasr/zero-pi) [](./LICENSE) [](https://nodejs.org)
|
|
22
17
|
|
|
23
18
|
</div>
|
|
24
19
|
|
|
25
20
|
---
|
|
26
21
|
|
|
27
|
-
zero-pi
|
|
28
|
-
|
|
29
|
-
**without modifying pi
|
|
30
|
-
zero-pi is a package
|
|
31
|
-
ships inside this one package.
|
|
32
|
-
|
|
33
|
-
## Contents
|
|
34
|
-
|
|
35
|
-
- [Install](#-install)
|
|
36
|
-
- [The SDD workflow](#-the-sdd-workflow)
|
|
37
|
-
- [Quality-of-life extensions](#-quality-of-life-extensions)
|
|
38
|
-
- [Commands](#-commands)
|
|
39
|
-
- [Environment variables](#-environment-variables)
|
|
40
|
-
- [Files it reads & writes](#-files-it-reads--writes)
|
|
41
|
-
- [Relationship to `zero`](#-relationship-to-zero)
|
|
42
|
-
- [Development](#-development)
|
|
43
|
-
|
|
44
|
-
---
|
|
22
|
+
zero-pi is an installable **[pi](https://pi.dev)** package that adds a
|
|
23
|
+
disciplined spec-driven development pipeline — plus a handful of quality-of-life
|
|
24
|
+
extensions — **without modifying pi**. Same idea as `gentle-pi`: pi stays
|
|
25
|
+
untouched; zero-pi is a package it loads.
|
|
45
26
|
|
|
46
27
|
## 📦 Install
|
|
47
28
|
|
|
48
29
|
```
|
|
49
30
|
pi install npm:@gonrocca/zero-pi
|
|
31
|
+
pi install npm:pi-subagents # required — the pipeline delegates to sub-agents
|
|
50
32
|
```
|
|
51
33
|
|
|
52
|
-
|
|
53
|
-
skills, theme, and extensions available in every pi session.
|
|
54
|
-
|
|
55
|
-
| Requirement | Detail |
|
|
56
|
-
| ----------- | ------ |
|
|
57
|
-
| `pi-subagents` | **Required** — the SDD pipeline delegates each phase to a sub-agent. Install with `pi install npm:pi-subagents`. |
|
|
58
|
-
| Node | ≥ 20.6 — pi loads the TypeScript extensions directly. |
|
|
59
|
-
| After upgrade | Restart pi for the new version to take effect. |
|
|
60
|
-
|
|
61
|
-
Remove it with `pi remove npm:@gonrocca/zero-pi`.
|
|
62
|
-
|
|
63
|
-
---
|
|
34
|
+
Needs Node ≥ 20.6. Restart pi after an upgrade.
|
|
64
35
|
|
|
65
|
-
## 🛠
|
|
36
|
+
## 🛠 `/forge` — the SDD pipeline
|
|
66
37
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
A spec-driven development run, driven through four phases in order:
|
|
38
|
+
The core of zero-pi. Run **`/forge <feature>`** and the orchestrator drives the
|
|
39
|
+
work through four phases, each delegated to its own sub-agent:
|
|
70
40
|
|
|
71
41
|
| Phase | Does |
|
|
72
42
|
| ----- | ---- |
|
|
73
43
|
| **explore** | Investigate the codebase read-only; produce findings. |
|
|
74
44
|
| **plan** | Write requirements, design, and an ordered task list. |
|
|
75
45
|
| **build** | Implement the plan. |
|
|
76
|
-
| **veredicto** | Review
|
|
77
|
-
|
|
78
|
-
Start it with `/forge <feature>`. The orchestrator drives phase order and
|
|
79
|
-
enforces a hard build/veredicto iteration cap — a `corregir` verdict re-runs
|
|
80
|
-
`build`, a `replantear` re-runs `plan`, and when the cap is reached without a
|
|
81
|
-
`pasa` the run stops and reports the result as **not verified**.
|
|
82
|
-
`/forge --continue [slug]` resumes an interrupted run from its `.sdd/<slug>/`
|
|
83
|
-
artifacts.
|
|
84
|
-
|
|
85
|
-
A run can also start from natural language: describe the work and signal SDD
|
|
86
|
-
intent — "hacelo con sdd", "usá el pipeline" — and the `sdd-routing` skill
|
|
87
|
-
routes it into `/forge`. It triggers only on a clear signal phrase; `/forge`
|
|
88
|
-
stays the primary, explicit entry point.
|
|
89
|
-
|
|
90
|
-
### Language & output
|
|
91
|
-
|
|
92
|
-
A `/forge` run reads as a short, calm progress stream, in Spanish:
|
|
93
|
-
|
|
94
|
-
- **Language Boundary** — every user-facing message is in Spanish (Rioplatense
|
|
95
|
-
voseo); sub-agent briefs stay in English for token efficiency; identifiers
|
|
96
|
-
(verdicts, slugs, paths, model ids, commands) are kept verbatim.
|
|
97
|
-
- **Output Contract** — each phase reports a bounded summary
|
|
98
|
-
(`Estado` / `Resumen` / `Artefactos` / `Siguiente`), never free-form prose.
|
|
99
|
-
No raw tool output, file dumps, sub-agent listings, or triple-backtick code
|
|
100
|
-
fences reach the chat. The phase-start line names the model and provider the
|
|
101
|
-
phase runs on plus a brief gloss of what it does — so a slow phase reads as
|
|
102
|
-
working, not frozen. The run ends stating `verificado` or `no verificado`.
|
|
103
|
-
|
|
104
|
-
### Review Workload Forecast
|
|
105
|
-
|
|
106
|
-
The `plan` phase keeps tasks reviewable. Every planned task carries a
|
|
107
|
-
`review: ~N changed lines` estimate, and `tasks.md` gains a `## Review Workload`
|
|
108
|
-
section with a bold run total. Tasks are sized against a fixed budget of
|
|
109
|
-
**400 changed lines per task** (borrowed from gentle-ai). A task over budget is
|
|
110
|
-
split; one that genuinely cannot be split stays whole and is recorded as an
|
|
111
|
-
over-budget exception with a reason.
|
|
112
|
-
|
|
113
|
-
### SDD sub-agents — `sdd-agents.ts`
|
|
114
|
-
|
|
115
|
-
`pi-subagents` discovers agents from `~/.pi/agent/agents/**/*.md`, but a
|
|
116
|
-
`pi install` ships only the phase *prompts*. This extension closes the gap: on
|
|
117
|
-
every load it generates the four `zero-<phase>` agent files under
|
|
118
|
-
`~/.pi/agent/agents/zero/` from the package's phase prompts and the per-phase
|
|
119
|
-
models in `~/.pi/zero.json`, so they stay in sync with the prompts and with
|
|
120
|
-
`/zero-models`.
|
|
121
|
-
|
|
122
|
-
### Per-phase models — `/zero-models`
|
|
123
|
-
|
|
124
|
-
A real pi command — a code handler, not an LLM prompt — for the SDD models. Run
|
|
125
|
-
it with no argument for the **provider-aware** interactive picker
|
|
126
|
-
(**phase → provider → model**, sourced from pi's model registry), or set one
|
|
127
|
-
directly:
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
/zero-models interactive picker
|
|
131
|
-
/zero-models build=claude-opus-4-7 set one phase
|
|
132
|
-
/zero-models build=codex/gpt-5-codex set one phase with an explicit provider
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
It reads and writes `~/.pi/zero.json` — a `models` map and a parallel
|
|
136
|
-
`providers` map. The orchestrator picks the change up on the next `/forge` run.
|
|
137
|
-
|
|
138
|
-
### Run memory — Cortex
|
|
139
|
-
|
|
140
|
-
Every run reads from and writes to Cortex, the persistent-memory MCP server.
|
|
141
|
-
Before exploring, the orchestrator recalls prior `zero-run/*` traces; when the
|
|
142
|
-
run ends it saves a run-trace — verdict, correction rounds, gotchas — under
|
|
143
|
-
`topic_key: zero-run/<slug>`. The next run starts from what the last one
|
|
144
|
-
learned. With `--no-mcp`, or when Cortex is unreachable, the loop degrades
|
|
145
|
-
silently and never blocks a run.
|
|
146
|
-
|
|
147
|
-
### Canonical specs & `/zero-sync`
|
|
148
|
-
|
|
149
|
-
zero keeps a **canonical, project-wide spec store** that accumulates accepted
|
|
150
|
-
requirements across runs, so each `/forge` run builds on the last.
|
|
151
|
-
|
|
152
|
-
- **The store** — `.sdd/specs/requirements.md`: a `# ` title followed by
|
|
153
|
-
`### REQ: <name>` blocks. The `plan` phase reads it as the baseline.
|
|
154
|
-
- **The plan artifacts** — every run's `plan` phase writes `proposal.md`,
|
|
155
|
-
`spec.md` (the **delta**: `## ADDED` / `## MODIFIED` / `## REMOVED`),
|
|
156
|
-
`design.md`, and `tasks.md` into `.sdd/<slug>/`.
|
|
157
|
-
- **`/zero-sync <slug>`** — a deterministic, unit-tested merge that folds the
|
|
158
|
-
delta into the store atomically. Guardrails reject a bad delta before
|
|
159
|
-
anything is written. The orchestrator invokes it automatically after a `pasa`
|
|
160
|
-
verdict — never on `corregir`, `replantear`, or a cap-reached run.
|
|
161
|
-
- **The archive** — `.sdd/archive/<YYYY-MM-DD>-<slug>/`: an append-only audit
|
|
162
|
-
trail of every sync.
|
|
163
|
-
|
|
164
|
-
### Adaptive model profiles — autotune
|
|
165
|
-
|
|
166
|
-
zero learns which model fits each SDD phase from your own run history.
|
|
167
|
-
|
|
168
|
-
- **The metrics log** — `~/.pi/zero-runs.jsonl`: every completed run appends one
|
|
169
|
-
JSON line (slug, per-phase models, verdict, round count, per-round verdict
|
|
170
|
-
sequence). Append-only.
|
|
171
|
-
- **Phase attribution** — a `corregir` round blames `build`, a `replantear`
|
|
172
|
-
blames `plan`. Autotune upgrades **only the phase at fault**, one tier at a
|
|
173
|
-
time. `explore` and `veredicto` are never tuned.
|
|
174
|
-
- **Cross-machine sync** — each run pushes its metrics to Cortex; `/forge`
|
|
175
|
-
pulls the shared log back, so autotune sees runs from other machines too.
|
|
46
|
+
| **veredicto** | Review it adversarially and record a verdict. |
|
|
176
47
|
|
|
177
|
-
The `
|
|
48
|
+
The verdict is `pasa` (done), `corregir` (re-run build), or `replantear`
|
|
49
|
+
(re-run plan). A hard iteration cap bounds the build↔veredicto loop — reached
|
|
50
|
+
without a `pasa`, the run stops and is reported as **not verified**.
|
|
51
|
+
`/forge --continue [slug]` resumes an interrupted run.
|
|
178
52
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
| `off` | Records run metrics, but never changes or recommends anything. |
|
|
53
|
+
The run speaks **Spanish**, in a bounded, low-noise format — one short summary
|
|
54
|
+
per phase, naming the model that phase runs on, no raw tool output. Or just
|
|
55
|
+
describe the work and say "hacelo con sdd": the `sdd-routing` skill routes it
|
|
56
|
+
into `/forge` for you.
|
|
184
57
|
|
|
185
|
-
|
|
186
|
-
recommendation shows as a leading `★ aplicar sugerencia` entry in `/zero-models`.
|
|
58
|
+
## ✨ What else it adds
|
|
187
59
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
Gives the agent a closed learning loop — distill a reusable skill from a
|
|
191
|
-
substantial task, store it, surface relevant skills on a new task, refine an
|
|
192
|
-
existing skill instead of duplicating it — so solutions are reused, not
|
|
193
|
-
re-derived.
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## ✨ Quality-of-life extensions
|
|
198
|
-
|
|
199
|
-
### Provider guard — `provider-guard.ts`
|
|
200
|
-
|
|
201
|
-
The `anthropic` provider runs two ways: a Claude Pro/Max **subscription** login
|
|
202
|
-
(OAuth, via `/login` — `pi-claude-oauth-adapter` smooths this path) or an **API
|
|
203
|
-
key**, which bills per token from your metered extra-usage pool. Same provider
|
|
204
|
-
id, different billing. The guard watches model switches and reads pi's auth mode
|
|
205
|
-
(`modelRegistry.isUsingOAuth`): when a model runs on `anthropic` with an API key
|
|
206
|
-
it emits a single non-blocking warning suggesting `/login`. On OAuth, or on any
|
|
207
|
-
other provider, it stays silent.
|
|
208
|
-
|
|
209
|
-
### Startup banner — `startup-banner.ts`
|
|
210
|
-
|
|
211
|
-
Renders the `ZERO` wordmark as ASCII-safe Tetris cells in pure ANSI 24-bit
|
|
212
|
-
colour, no runtime dependencies. The cells assemble from the bottom up, settle,
|
|
213
|
-
then run a short **sparkle pass** — a few cells glint bright for about a second.
|
|
214
|
-
The render runs synchronously before pi draws its UI.
|
|
215
|
-
|
|
216
|
-
| `ZERO_BANNER` | Effect |
|
|
217
|
-
| ------------- | ------ |
|
|
218
|
-
| _(unset)_ / `shimmer` | Animated assembly + sparkle, then settle (default) |
|
|
219
|
-
| `static` | Completed banner only, no animation |
|
|
220
|
-
| `off` | Render nothing |
|
|
221
|
-
|
|
222
|
-
Colour is skipped automatically when `NO_COLOR` is set or output is not a TTY.
|
|
223
|
-
|
|
224
|
-
### Working-phrase ticker — `working-phrases.ts`
|
|
225
|
-
|
|
226
|
-
Replaces pi's static `Working...` line with a context-aware, rotating Spanish
|
|
227
|
-
phrase — tool-specific while a tool runs (`Leyendo archivos…`), the SDD phase
|
|
228
|
-
while a sub-agent runs (`Planeando la solución…`), playful verbs while the model
|
|
229
|
-
thinks (`Maquinando…`) — plus a theme-tinted braille spinner.
|
|
230
|
-
|
|
231
|
-
### Conversation resume — `conversation-resume.ts`
|
|
232
|
-
|
|
233
|
-
When pi exits normally, writes a local handoff note at `.pi/zero-resume.md` —
|
|
234
|
-
the exact restore command for the persisted session plus a concise conversation
|
|
235
|
-
tail. Generate it any time with `/zero-resume`. zero-pi creates `.pi/.gitignore`
|
|
236
|
-
so conversation context is never committed. Set `ZERO_RESUME=off` to disable the
|
|
237
|
-
automatic write.
|
|
238
|
-
|
|
239
|
-
### Windows process-tree kill — `win-tree-kill.ts`
|
|
240
|
-
|
|
241
|
-
On Windows, `kill()` terminates only the target process — so aborting a turn can
|
|
242
|
-
leave an orphaned `claude` process streaming (Esc appears to do nothing). This
|
|
243
|
-
extension patches `child_process.spawn` so every later subprocess tree-kills via
|
|
244
|
-
`taskkill /T /F`. No-op on non-Windows. **Keep it enabled on Windows.**
|
|
245
|
-
|
|
246
|
-
### ZERO terminal theme — `themes/zero-sdd.json`
|
|
247
|
-
|
|
248
|
-
A dark, high-contrast pi theme with cyan, amber, mint, rose, and violet accents
|
|
249
|
-
tuned for SDD work. Select it from `/settings`, or set `"theme": "zero-sdd"`.
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## ⌨️ Commands
|
|
254
|
-
|
|
255
|
-
| Command | What it does |
|
|
60
|
+
| Feature | What it does |
|
|
256
61
|
| ------- | ------------ |
|
|
257
|
-
|
|
|
258
|
-
|
|
|
259
|
-
|
|
|
260
|
-
|
|
|
261
|
-
|
|
|
262
|
-
|
|
|
62
|
+
| **`/zero-models`** | Pick the model + provider for each SDD phase — interactive or direct. |
|
|
63
|
+
| **Autotune** | Learns which model fits each phase from your run history and re-tunes itself. |
|
|
64
|
+
| **`/zero-sync`** | Folds each run's spec delta into a canonical, project-wide spec store. |
|
|
65
|
+
| **Run memory** | Every run recalls and saves traces to Cortex, so runs learn from each other. |
|
|
66
|
+
| **Provider guard** | Warns when the `anthropic` provider runs on a metered API key instead of your subscription. |
|
|
67
|
+
| **Startup banner** | The animated `ZERO` wordmark — Tetris-cell assembly + a sparkle pass. |
|
|
68
|
+
| **Working-phrase ticker** | Swaps pi's `Working...` for a context-aware Spanish phrase + spinner. |
|
|
69
|
+
| **Conversation resume** | Writes `.pi/zero-resume.md` on exit — the restore command + a conversation tail. |
|
|
70
|
+
| **Windows tree-kill** | Aborting a turn kills the whole process tree — no orphaned `claude`. |
|
|
71
|
+
| **Skill auto-learning** | Distills reusable skills from substantial tasks and surfaces them later. |
|
|
72
|
+
| **`zero-sdd` theme** | A dark, high-contrast pi theme tuned for SDD work. |
|
|
263
73
|
|
|
264
|
-
##
|
|
74
|
+
## ⌨️ Commands
|
|
265
75
|
|
|
266
|
-
|
|
|
267
|
-
|
|
|
268
|
-
|
|
|
269
|
-
| `
|
|
270
|
-
|
|
|
76
|
+
| Command | Does |
|
|
77
|
+
| ------- | ---- |
|
|
78
|
+
| `/forge <feature>` | Run the SDD pipeline — `--continue [slug]` resumes. |
|
|
79
|
+
| `/zero-models [<phase>=[<provider>/]<model>]` | Show or set per-phase models — `autotune=auto\|ask\|off`. |
|
|
80
|
+
| `/zero-sync <slug>` | Fold a run's delta into the canonical spec store. |
|
|
81
|
+
| `/zero-resume` | Write the session handoff note now. |
|
|
271
82
|
|
|
272
|
-
##
|
|
83
|
+
## 🔧 Configuration
|
|
273
84
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
| `~/.pi/agent/agents/zero/` | Generated `zero-<phase>` sub-agent files. |
|
|
279
|
-
| `.sdd/<slug>/` | Per-run plan artifacts. |
|
|
280
|
-
| `.sdd/specs/requirements.md` | The canonical, project-wide spec store. |
|
|
281
|
-
| `.sdd/archive/` | Append-only audit trail of every `/zero-sync`. |
|
|
282
|
-
| `.pi/zero-resume.md` | Local session handoff note. |
|
|
85
|
+
zero-pi keeps its state in `~/.pi/zero.json` (per-phase models + autotune mode)
|
|
86
|
+
and `~/.pi/zero-runs.jsonl` (the run-metrics log); per-project artifacts live
|
|
87
|
+
under `.sdd/`. Environment variables: `ZERO_BANNER` (`shimmer` / `static` /
|
|
88
|
+
`off`) and `ZERO_RESUME` (`off` disables the resume note).
|
|
283
89
|
|
|
284
90
|
## 🔗 Relationship to `zero`
|
|
285
91
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
directly with `pi install npm:@gonrocca/zero-pi` if you only want the pi layer.
|
|
92
|
+
zero-pi is the pi layer of the **zero** integrator. The `zero` CLI installs it
|
|
93
|
+
onto pi and writes the per-phase model config; you can also install zero-pi on
|
|
94
|
+
its own with the command above.
|
|
290
95
|
|
|
291
|
-
##
|
|
96
|
+
## Development
|
|
292
97
|
|
|
293
98
|
Dependency-free, no build step — pi loads the TypeScript extensions directly.
|
|
294
|
-
Run the test suite with
|
|
99
|
+
Run the test suite with `npm test`.
|
|
295
100
|
|
|
296
|
-
|
|
297
|
-
npm test
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
---
|
|
101
|
+
## License
|
|
301
102
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
MIT © Gonzalo Rocca
|
|
305
|
-
|
|
306
|
-
</div>
|
|
103
|
+
MIT © Gonzalo Rocca · [github.com/gonzalonicolasr/zero-pi](https://github.com/gonzalonicolasr/zero-pi)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gonrocca/zero-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "zero-pi — an installable layer for pi (pi.dev): the zero spec-driven development workflow, skill auto-learning, and an animated ZERO startup banner. Adds capability to pi without modifying pi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|