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