@mccune1224/pi-pstack 0.1.0 → 0.2.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.
Files changed (126) hide show
  1. package/README.md +52 -100
  2. package/agents/comment-sicko.md +1 -1
  3. package/agents/poteto-agent.md +2 -2
  4. package/docs/compare.md +122 -0
  5. package/docs/guide/01-setup.md +37 -12
  6. package/docs/guide/02-poteto-mode.md +1 -1
  7. package/docs/guide/03-understand.md +0 -8
  8. package/docs/guide/05-build-and-clean.md +1 -1
  9. package/docs/guide/06-verify-and-ship.md +1 -1
  10. package/docs/guide/07-overnight.md +2 -2
  11. package/docs/guide/08-principles.md +4 -2
  12. package/docs/guide/10-recipes-and-pitfalls.md +2 -2
  13. package/docs/guide/README.md +2 -2
  14. package/extensions/compaction.test.ts +132 -0
  15. package/extensions/compaction.ts +183 -0
  16. package/extensions/context-guard.test.ts +53 -0
  17. package/extensions/context-guard.ts +65 -0
  18. package/extensions/doctor.test.ts +85 -0
  19. package/extensions/doctor.ts +100 -0
  20. package/extensions/index.ts +289 -26
  21. package/extensions/settings.test.ts +71 -16
  22. package/extensions/settings.ts +57 -9
  23. package/extensions/skill-budget.test.ts +110 -0
  24. package/extensions/skill-budget.ts +101 -0
  25. package/package.json +9 -4
  26. package/scripts/check-pi-isms.mjs +106 -0
  27. package/scripts/lib/pi-delta-rules.mjs +110 -0
  28. package/scripts/lib/pi-delta-rules.test.mjs +100 -0
  29. package/scripts/lib/upstream-vendor.mjs +32 -0
  30. package/scripts/pi-deltas.json +754 -0
  31. package/scripts/sync-upstream.mjs +117 -0
  32. package/scripts/verify-guards.mjs +132 -0
  33. package/scripts/verify-sync.mjs +206 -0
  34. package/skills/architect/SKILL.md +10 -10
  35. package/skills/architect/references/rationale-template.md +2 -2
  36. package/skills/architect/references/runner-prompt.md +7 -7
  37. package/skills/arena/SKILL.md +11 -11
  38. package/skills/automate-me/SKILL.md +21 -26
  39. package/skills/blast-radius/SKILL.md +5 -5
  40. package/skills/create-verification-skill/SKILL.md +5 -5
  41. package/skills/figure-it-out/SKILL.md +11 -13
  42. package/skills/how/SKILL.md +30 -104
  43. package/skills/how/references/explainer-prompt.md +6 -6
  44. package/skills/how/references/explorer-prompt.md +1 -1
  45. package/skills/interrogate/SKILL.md +13 -14
  46. package/skills/interrogate/references/code-quality-review.md +1 -1
  47. package/skills/interrogate/references/lead-judgment.md +1 -1
  48. package/skills/interrogate/references/rubric.md +2 -2
  49. package/skills/maintain-verification-skill/SKILL.md +5 -5
  50. package/skills/no-comments/SKILL.md +3 -3
  51. package/skills/poteto-mode/SKILL.md +9 -8
  52. package/skills/poteto-mode/playbooks/authoring-a-skill.md +4 -4
  53. package/skills/poteto-mode/playbooks/autonomous-run.md +4 -4
  54. package/skills/poteto-mode/playbooks/autopilot-full.md +9 -9
  55. package/skills/poteto-mode/playbooks/autopilot-stack.md +8 -8
  56. package/skills/poteto-mode/playbooks/babysit.md +17 -17
  57. package/skills/poteto-mode/playbooks/bug-fix.md +6 -6
  58. package/skills/poteto-mode/playbooks/eval.md +6 -8
  59. package/skills/poteto-mode/playbooks/feature.md +7 -7
  60. package/skills/poteto-mode/playbooks/hillclimb.md +10 -10
  61. package/skills/poteto-mode/playbooks/investigation.md +3 -3
  62. package/skills/poteto-mode/playbooks/multi-phase-plan.md +26 -25
  63. package/skills/poteto-mode/playbooks/opening-a-pr.md +17 -13
  64. package/skills/poteto-mode/playbooks/orchestrate.md +37 -39
  65. package/skills/poteto-mode/playbooks/pause-safely.md +4 -4
  66. package/skills/poteto-mode/playbooks/perf-issue.md +9 -9
  67. package/skills/poteto-mode/playbooks/prototype.md +5 -5
  68. package/skills/poteto-mode/playbooks/refactoring.md +9 -9
  69. package/skills/poteto-mode/playbooks/runtime-forensics.md +3 -3
  70. package/skills/poteto-mode/playbooks/session-pickup.md +4 -6
  71. package/skills/poteto-mode/playbooks/shipping.md +11 -14
  72. package/skills/poteto-mode/playbooks/trace-forensics.md +4 -4
  73. package/skills/poteto-mode/playbooks/visual-parity.md +3 -3
  74. package/skills/poteto-mode/playbooks/worktree-cleanup.md +4 -4
  75. package/skills/poteto-mode/references/bugbot-triage.md +3 -3
  76. package/skills/poteto-mode/scripts/worktree-audit.mjs +0 -7
  77. package/skills/principle-attack-the-premise/SKILL.md +23 -0
  78. package/skills/principle-boundary-discipline/SKILL.md +2 -2
  79. package/skills/principle-build-the-lever/SKILL.md +5 -5
  80. package/skills/principle-encode-lessons-in-structure/SKILL.md +3 -3
  81. package/skills/principle-experience-first/SKILL.md +5 -5
  82. package/skills/principle-fix-root-causes/SKILL.md +4 -4
  83. package/skills/principle-foundational-thinking/SKILL.md +3 -3
  84. package/skills/principle-guard-the-context-window/SKILL.md +2 -2
  85. package/skills/principle-laziness-protocol/SKILL.md +2 -2
  86. package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +1 -1
  87. package/skills/principle-minimize-reader-load/SKILL.md +2 -2
  88. package/skills/principle-model-the-domain/SKILL.md +3 -3
  89. package/skills/principle-never-block-on-the-human/SKILL.md +4 -5
  90. package/skills/principle-prove-it-works/SKILL.md +3 -3
  91. package/skills/principle-redesign-from-first-principles/SKILL.md +3 -3
  92. package/skills/principle-separate-before-serializing-shared-state/SKILL.md +3 -3
  93. package/skills/principle-sequence-verifiable-units/SKILL.md +3 -3
  94. package/skills/principle-subtract-before-you-add/SKILL.md +3 -4
  95. package/skills/principle-test-behavior-not-implementation/SKILL.md +25 -0
  96. package/skills/principle-type-system-discipline/SKILL.md +5 -5
  97. package/skills/recall/SKILL.md +7 -7
  98. package/skills/reflect/SKILL.md +14 -20
  99. package/skills/reflect/references/divergent-reviewer.md +3 -3
  100. package/skills/reflect/references/judgment-reviewer.md +3 -3
  101. package/skills/reflect/references/synthesizer.md +2 -2
  102. package/skills/reflect/references/tooling-reviewer.md +4 -6
  103. package/skills/setup-pstack/SKILL.md +61 -49
  104. package/skills/show-me-your-work/SKILL.md +17 -17
  105. package/skills/show-me-your-work/scripts/log.mjs +2 -8
  106. package/skills/swarm/SKILL.md +6 -6
  107. package/skills/tdd/SKILL.md +2 -2
  108. package/skills/teach/SKILL.md +7 -7
  109. package/skills/technical-writing/SKILL.md +5 -8
  110. package/skills/typescript-best-practices/SKILL.md +6 -3
  111. package/skills/typescript-best-practices/references/patterns.md +35 -14
  112. package/skills/unslop/SKILL.md +8 -20
  113. package/skills/why/SKILL.md +27 -100
  114. package/skills/why/references/epistemics.md +6 -6
  115. package/skills/why/references/investigator-prompt.md +5 -5
  116. package/skills/why/references/source-playbook.md +1 -1
  117. package/skills/why/references/sources/databricks.md +7 -7
  118. package/skills/why/references/sources/datadog.md +5 -5
  119. package/skills/why/references/sources/incident-postmortem.md +2 -2
  120. package/skills/why/references/sources/linear.md +2 -2
  121. package/skills/why/references/sources/notion.md +3 -3
  122. package/skills/why/references/sources/sentry.md +4 -4
  123. package/skills/why/references/sources/slack.md +2 -2
  124. package/skills/why/references/synthesizer-prompt.md +3 -3
  125. package/skills/how/references/critic-prompt.md +0 -59
  126. package/skills/how/references/critique-rubric.md +0 -58
package/README.md CHANGED
@@ -1,142 +1,94 @@
1
1
  # pi-pstack
2
2
 
3
- pstack for Pi. Poteto's rigorous engineering workflow as a Pi plugin. Write less code, write better code, and parallelize with confidence.
3
+ Poteto's engineering workflow on the Pi Agent Harness. Fifty skills, two agents, and an extension that wires the workflow into the parts of Pi a skill file cannot reach: settings, sessions, compaction, and the context window.
4
4
 
5
- **What this plugin does.** It is an engineering-workflow system, not another model wrapper. One command, `/poteto-mode`, turns any Pi session into a disciplined engineer: it matches your request to a playbook (bug fix, feature, perf, investigation, shipping, and more), opens a todo list with the playbook's steps, and routes to the right skill as the steps fire. The skills add the rigor: `how` and `why` for understanding, `architect` and `arena` for design, `swarm` for parallel checks, `interrogate` for adversarial review, `unslop`, `deslop`, and `no-comments` for clean output, plus 21 first-principle skills that ground every decision. Delegation happens through your own subagents (`scout`, `worker`, `reviewer`, `oracle`, `poteto-agent`), so one chat stays in control while the work fans out.
5
+ pstack is Lauren Tan's plugin for Cursor. Two other Pi ports carry the same name. This one differs in kind, not in degree: it is the port that treats Pi as a harness to build on. The skills are the same rigorous core everywhere. What you do with the rest of the machine is what this package is for.
6
6
 
7
- This package ships everything the upstream [pstack](https://github.com/cursor/plugins/tree/main/pstack) plugin (0.14.4) bundles, adapted to Pi: the skills, the subagents, and the guide. It also fills the upstream README's "not shipped here" list, so you do not need cursor-team-kit. Two upstream pieces bound to Cursor's own runtime are excluded; "Not shipped" below lists them.
7
+ ## What only this port ships
8
+
9
+ **A setup wizard that writes Pi's own settings.** `/pstack-setup` asks for a reasoning budget (unlimited, large, medium, small), then maps six roles onto the models your session can reach. It writes the `subagents.*` keys in `settings.json`, the same keys every other Pi tool reads. Nothing private, nothing parallel, hand-editable.
10
+
11
+ **A context guard with the principle enforced.** While Poteto Mode is on, the extension meters the context window every turn. At 70 percent it tells you to hand long output to files. At 85 it tells you to capture the decision state. At 92 it offers one-key compaction. The HUD below the editor shows the meter live.
12
+
13
+ **Compaction that keeps the run.** When Poteto Mode compacts, the summary is shaped around what the run needs to survive: the matched playbook and its step, the decision ledger with the principles cited, what was verified and how, file paths, next actions. Pi's default compaction summarizes a chat. This one resumes a job.
14
+
15
+ **A doctor.** `/pstack-doctor` validates both settings files, flags role typos that would silently do nothing, checks the package agents' frontmatter, counts the vendored playbooks, names missing companion packages, and reports the upstream pin.
16
+
17
+ **A port you can prove.** Every adaptation from upstream Cursor pstack is declared as data in `scripts/pi-deltas.json`. `npm run verify:sync` classifies all 100+ vendored files and fails on anything unexplained. A rule that stops matching is itself a failure, and the check is mutation-tested: `npm run verify:guards` injects hand edits, deleted rules, and stale baselines to prove the checker catches them.
8
18
 
9
19
  ## Install
10
20
 
11
- Requires Pi 0.84 or newer. Install `npm:pi-subagents` alongside for the agents and routed skills; the plugin warns at startup when a companion is missing.
21
+ Requires Pi 0.84 or newer. Install [`pi-subagents`](https://www.npmjs.com/package/pi-subagents) alongside it; it registers the `subagent` tool every routed workflow uses, and this package warns at startup when it is absent.
12
22
 
13
23
  ```bash
14
- pi install npm:@mccune1224/pi-pstack # once published to npm
15
- # or
16
- pi install git:github.com/McCune1224/pi-pstack # from the repository
17
- # or, from a local checkout:
18
- # pi install /path/to/pi-pstack
24
+ pi install npm:@mccune1224/pi-pstack
25
+ # or from the repository
26
+ pi install git:github.com/McCune1224/pi-pstack
19
27
  ```
20
28
 
21
29
  Then run `/reload`.
22
30
 
23
31
  ## Get started
24
32
 
25
- Two steps.
26
-
27
- 1. Run `/pstack-setup`. Pick a scope and a tier, or assign a model per role. Everything defaults to `inherit`, which runs delegated agents on your parent model at no extra cost.
28
- 2. Type `/poteto-mode <task>` whenever the task needs rigor. The mode matches your task to a playbook and routes to the other skills as the steps fire. It stays on for the session; `/poteto-mode off` turns it back off.
33
+ 1. Run `/pstack-setup`. Pick a scope, a budget, and a tier, or assign models per role. Everything defaults to `inherit`: delegated agents run on your parent model, at no extra cost, with no thinking floor. That is the recommended start.
34
+ 2. Run `/poteto-mode <task>` when the task needs rigor. The mode is sticky. Follow-ups keep the playbook discipline until `/poteto-mode off`, and the footer shows the state while it is on.
29
35
 
30
- New here? The [guide](docs/guide/README.md) walks through a first task from setup to verification.
36
+ New here? The [guide](docs/guide/README.md) walks a first task from install to verified ship.
31
37
 
32
38
  ## Commands
33
39
 
34
40
  | Command | What it does |
35
41
  |---|---|
36
- | `/poteto-mode` | Enables sticky Poteto Mode and runs the task. `/poteto-mode <task>` matches a playbook and routes the work; `/poteto-mode` with no task just enables the mode; `/poteto-mode off` disables it. The choice persists across reloads and shows a footer status while on. |
37
- | `/pstack-setup` | Model configuration wizard. Picks the target scope, applies tiers, or assigns a model per pstack role. Writes only the `subagents.*` keys in Pi settings. Fast paths: `/pstack-setup -l` (project scope), `/pstack-setup inherit` or `light` or `custom` (skip the tier picker), `/pstack-setup scout` (switch one role). |
38
- | `/pstack-status` | One screen: parent session model, effective model per role, which settings file wins, and which pstack skills are loaded. |
39
- | `/bro` | Restates the last assistant reply in plain human language. |
40
-
41
- ## Poteto Mode
42
-
43
- Poteto Mode is the entry point. It is sticky: once enabled it stays on for the session, so follow-ups keep the rigor without re-invoking. The choice persists across sessions through a custom session entry, and a footer status shows `pstack: poteto mode` while it is on.
44
-
45
- - `/poteto-mode <task>` enables the mode and routes that task through the playbook matcher.
46
- - `/poteto-mode` with no task enables the mode only.
47
- - `/poteto-mode off` disables it (also accepts `disable` and `stop`).
48
- - Invoking `/skill:poteto-mode` directly enables the mode as well.
49
-
50
- While on, every turn gets a short directive pointing at the `poteto-mode` skill as the single source of truth, so the rules are never duplicated in the extension.
51
-
52
- No tools are registered. Skills carry the workflow; the extension only wires what a skill cannot reach: the model registry, settings files, the session, and the TUI. One startup event checks that the companions below are installed and warns with the install command when one is missing.
53
-
54
- ## Skills
55
-
56
- All 44 Pi-compatible upstream skills ship, plus the four gap skills in the next section. The full set includes `/poteto-mode` and its 22 playbooks, the workflow skills (`how`, `why`, `architect`, `arena`, `swarm`, `interrogate`, `reflect`, `tdd`, `unslop`, `bro`, `technical-writing`, and more), and the 21 first-principle skills. Every skill is Pi-native: model defaults are `inherit`, subagents use Pi agents (`scout`, `worker`, `reviewer`, `oracle`, `poteto-agent`), and config reads Pi settings.
57
-
58
- ## Not shipped here, now shipped
59
-
60
- Upstream pstack outsources these. This package bundles them.
42
+ | `/poteto-mode` | Enable sticky Poteto Mode and optionally run a task. `<task>` matches one of 23 playbooks and copies its steps into a todo list verbatim. `off` disables. Tab completes playbook names. The choice survives a reload. |
43
+ | `/pstack-setup` | Model configuration. Reasoning budget first, then scope, tier, or a single role. Fast paths: `-l`, `inherit`, `light`, `custom`, a budget word like `small`, or a bare role name like `scout`. |
44
+ | `/pstack-status` | Parent session model, resolved model and thinking level per role, the recorded budget, the winning settings file, the loaded skill inventory, and the system-prompt token cost of what the model sees. |
45
+ | `/pstack-doctor` | Install diagnostics: settings validity, unknown roles, agent frontmatter, playbook count, companion tools, upstream pin. |
46
+ | `/bro` | Restates the last reply in plain human language. |
61
47
 
62
- | Piece | Where it came from | Status |
63
- |---|---|---|
64
- | `deslop` | cursor-team-kit | Ported. De-slops the diff before commit. |
65
- | `control-cli` | cursor-team-kit | Ported. Local harnesses to drive and profile CLIs and TUIs. |
66
- | `control-ui` | cursor-team-kit | Ported. Local browser/CDP harnesses to verify web and Electron UIs. |
67
- | `create-skill` | Cursor builtin | Authored for Pi. Read it before writing or editing any SKILL.md. |
68
- | `/babysit` | Cursor builtin | Resolved by the mode. Pi has no built-in; the `babysit` playbook in `/poteto-mode` owns PR-status requests. |
48
+ No tools are registered. Skills carry the workflow; the extension only reaches what skills cannot.
69
49
 
70
- ## Subagents
50
+ ## How it uses the harness
71
51
 
72
- Two agents ship under the pstack names you already use:
73
-
74
- - `poteto-agent` runs the mode end to end. It reads `poteto-mode` in full, including the inline principles index, before doing any work.
75
- - `comment-sicko` is the read-only comment reviewer. Invoke it through `/no-comments`.
76
-
77
- Both inherit your parent model by default. Configure them per role with `/pstack-setup`.
78
-
79
- ## Model configuration
80
-
81
- Pi resolves pstack role models in this order:
82
-
83
- 1. Per-run override in the skill's subagent call
84
- 2. Agent frontmatter `model:`
85
- 3. `~/.pi/agent/settings.json` → `subagents.agentOverrides.<name>.model`
86
- 4. `subagents.defaultModel`
87
- 5. Parent session model
88
-
89
- With no explicit selection, every role falls back to `inherit`, which follows the parent session model you run Pi with. `/pstack-setup` writes keys 3 and 4 (and `defaultThinking`, `thinking`, `fallbackModels` where a tier uses them). `/pstack-status` shows the parent model and the resolved role mapping, so you always see what `inherit` actually means right now.
90
-
91
- Only set an explicit model when you want a tier. The custom tier sets the `default` role for a blanket default, or any specific role for a targeted model.
92
-
93
- ## Companions
94
-
95
- pi-pstack needs no other plugins to load. Three Pi packages back specific surfaces; `subagent`, `todo`, and `ask_user_question` are package tools, not Pi built-ins.
96
-
97
- | Package | Why |
52
+ | Pi mechanism | What pstack does with it |
98
53
  |---|---|
99
- | `npm:pi-subagents` | Required for the full set. Registers the `subagent` tool, reads this package's `agents/`, and backs every routed skill (`how`, `why`, `architect`, `arena`, `swarm`, `interrogate`, `reflect`). Without it the two agents and the delegation workflows have no backend. |
100
- | `npm:@juicesharp/rpiv-todo` | Recommended. The playbooks open a todo list through the `todo` tool. |
101
- | `npm:@juicesharp/rpiv-ask-user-question` | Recommended. Skills reach the user through the `ask_user_question` tool. |
54
+ | `subagents.*` settings keys | Role models and thinking levels, user or project scope, shared with the rest of Pi |
55
+ | Session entries | Poteto Mode state, so the sticky mode survives reloads and restarts |
56
+ | `before_agent_start` | A short mode directive that points at the `poteto-mode` skill, never a duplicated rule |
57
+ | Context usage | The guard thresholds and the HUD meter |
58
+ | Compaction events | The poteto summary shape, with fallback to Pi's default on any failure |
59
+ | Widgets and status | The `pstack: poteto mode` footer and the live roles, budget, and context line |
102
60
 
103
- At startup the plugin checks for these and tells you the install command when something is missing.
61
+ Because the model map lives in Pi's own settings, it is not private to this package. The project scope in `.pi/settings.json` wins over the user scope when both exist.
104
62
 
105
- ## Not shipped
63
+ ## The skills
106
64
 
107
- Two upstream pieces are excluded because they are bound to Cursor's runtime and cannot work on Pi:
65
+ 50 ship and load together: 23 workflow skills, 23 first-principle leaves, and 4 Pi-only additions (`control-cli`, `control-ui`, `create-skill`, `deslop`). Upstream disables model invocation for most of them, so Pi filters 45 out of the system prompt and the mode skill reaches them by name as steps fire; the 5 Pi offers on its own judgment cost about 400 prompt tokens. `/pstack-status` prints the live number for your install.
108
66
 
109
- - `grokbot/make-bot-ui` drives Cursor's automation webhook panels.
110
- - The dormant `benny` automation pack registers through `.cursor/settings.json` and Cursor automations.
67
+ Two agents ship under the upstream names: `poteto-agent` runs the mode end to end, `comment-sicko` reviews comments through `/no-comments`. Both inherit your parent model until `/pstack-setup` says otherwise.
111
68
 
112
- Pi has no automation runtime. If you ever run under one, fetch both from upstream.
69
+ The [guide](docs/guide/README.md) has a chapter per workflow stage, and [compare.md](docs/compare.md) puts this port next to upstream and the other Pi port with reproducible numbers.
113
70
 
114
- ## Maintenance
71
+ ## Keeping the port current
115
72
 
116
- `npm run sync:upstream` re-vendors the upstream tree and then scans for Cursor-only references (`~/.cursor`, `AskQuestion`, `subagent_type`, `grok-4.6` and friends, `/add-plugin`) so a re-adapted state is a diff you review, and nothing Cursor-shaped ships to Pi. Run it after each upstream pstack release. Both tools are plain Node scripts, so they run on any machine that runs Pi.
117
-
118
- ## Troubleshooting
73
+ ```bash
74
+ git clone --depth 400 https://github.com/cursor/plugins.git /tmp/upstream-plugins
75
+ npm run sync:upstream # vendor upstream at the pinned ref and apply the declared deltas
76
+ npm run verify:sync # classify every file, fail on anything unexplained
77
+ npm run check:piisms # fail if Cursor-only content would ship
78
+ npm run verify:guards # mutation-test the checker itself
79
+ ```
119
80
 
120
- | Symptom | Fix |
121
- |---|---|
122
- | Skills do not appear | Run `/reload` after install. `/pstack-status` lists the loaded pstack skills and should show 48. |
123
- | Model changes do not apply | `/pstack-setup` writes settings; `/reload` applies them. `/pstack-status` shows what resolved. |
124
- | Startup warning about a missing companion | `pi install <package>` for each name in the warning, then `/reload`. |
125
- | `/poteto-mode` does not engage | Run `/skill:poteto-mode <task>` directly. A user-scope skill with the same name shadows the package one; remove it from `~/.pi/agent/skills/`. |
126
- | Everything broke after an upgrade | The package is a git repo; `git log` shows each release. Reinstall with `pi install git:github.com/McCune1224/pi-pstack@<tag>` to pin a version. |
81
+ The pin, the two commits it covers, and what each upstream change became here are written up in [compare.md](docs/compare.md).
127
82
 
128
83
  ## Development
129
84
 
130
85
  ```bash
131
- npm ci
132
- npm run typecheck # strict tsc over extensions/
133
- npm run check:piisms # exit 1 if Cursor-shaped content ships
86
+ npm test # node:test over the extension logic, 44 cases
87
+ npm run typecheck
134
88
  ```
135
89
 
136
- Verify against a real Pi surface before releasing: `pi -e . -p "Say ok"` must load clean, and `/pstack-status` in a TUI session must show the 48 skills and the resolved model map.
137
-
138
- `npm test` runs the committed unit tests over the extension's pure logic (model map parsing, tier builders, settings IO, mode state).
90
+ Extension logic is split into testable units: `settings.ts` (model maps and budgets), `context-guard.ts` (thresholds), `compaction.ts` (the summary contract), `doctor.ts` (validators), `skill-budget.ts` (prompt cost). Tests run on plain node, no build step.
139
91
 
140
92
  ## License
141
93
 
142
- MIT. The skillset is adapted from poteto's [pstack](https://github.com/cursor/plugins/tree/main/pstack) (MIT, Lauren Tan); this package ports and extends it for Pi. The extension patterns are informed by the earlier Pi ports [@zenspc/pi-pstack](https://github.com/zenspc/pi-extensions/tree/master/packages/pi-pstack) and [pi-pstack](https://www.npmjs.com/package/pi-pstack) (both MIT).
94
+ MIT. Upstream pstack is Lauren Tan's work; this port follows upstream and names every place it departs.
@@ -34,4 +34,4 @@ A long justification without a proven keep-list exception is a confession. Kill
34
34
 
35
35
  Every flag names code inside the scope and tells the truth. I invent nothing. I touch comments and identify refactor targets. I never write application code.
36
36
 
37
- Report only. Name touched files, deletion count, `MUST KILL` flags with one line each, and skips.
37
+ Report only. Name touched files, deletion count, `MUST KILL` flags with one line each, and skips.
@@ -11,6 +11,6 @@ is_background: true
11
11
 
12
12
  # Poteto subagent
13
13
 
14
- You are operating as poteto-mode's full agent style. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. If it is not already in context, locate it with `read` or `find` under the installed pi-pstack package's `skills/poteto-mode/` directory. Navigate to a leaf `principle-*` skill whenever you apply that principle.
14
+ You are operating as poteto-mode's full agent style. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. If it is not already in context, locate it under the installed pi-pstack package's `skills/poteto-mode/` directory. Navigate to a leaf `principle-*` skill whenever you apply that principle.
15
15
 
16
- Execute the assigned task exactly as that skill prescribes: match a playbook, copy its steps in verbatim, cite each principle with the decision it changed, verify against the real artifact, and write the reply clean as you draft it. You own the work. Review your own diff and report what changed for the consumer and the maintainer.
16
+ Execute the assigned task exactly as that skill prescribes: match a playbook, copy its steps in verbatim, cite each principle with the decision it changed, verify against the real artifact, and write the reply clean as you draft it. You own the work. Review your own diff and report what changed for the consumer and the maintainer.
@@ -0,0 +1,122 @@
1
+ # How this port compares
2
+
3
+ Two things get compared here. Upstream `cursor/plugins`' pstack, which is the source we vendor, and `@zenspc/pi-pstack`, the other Pi port on npm.
4
+
5
+ Every number below is reproducible. The commands are at the end.
6
+
7
+ ## Versions compared
8
+
9
+ | Thing | Version | Ref |
10
+ |---|---|---|
11
+ | Upstream pstack | 0.15.2 | `5bf2b1544db739998121a306340631963c2ff3de` |
12
+ | This port | 0.2.0 | working tree |
13
+ | `@zenspc/pi-pstack` | 0.6.0 | published 2026-09-09 |
14
+
15
+ The version this port was vendored from before this change was upstream 0.14.4. That is an eight-release gap, and the reason it existed is worth stating because it is the problem the port now solves.
16
+
17
+ The old `sync-upstream.mjs` wiped the vendored tree and asked a human to re-apply every Pi adaptation by hand. The adaptations were never written down, so each sync threw them away. Nobody wants to redo that work, so the port sat still. The fix was to record the adaptations as data instead of as tribal knowledge.
18
+
19
+ ## What upstream changed after the 0.15.2 pin
20
+
21
+ Upstream added two commits after the ref this port was pinned to, without a version bump. Both are covered as of this release.
22
+
23
+ | Upstream change | What this port did |
24
+ |---|---|
25
+ | bug-fix, perf-issue, and hillclimb code-delegate defaults moved to `grok-4.6-fast-xhigh` (#365) | Adopted by the sync lever and then erased by it. The `pi-model-defaults` rule rewrites every pinned slug to `inherit`, so the three playbooks came out byte-identical and needed no new rule. This is the port working as designed: upstream retunes its model panel, and Pi readers keep the parent-model default. |
26
+ | `/setup-pstack` asks for a reasoning budget first: unlimited, large, medium, or small, mapped onto the effort ladder and recorded in the rule (#366) | Ported natively. `/pstack-setup` asks the same four budgets and writes Pi's own `subagents.defaultThinking` (`large` is `xhigh`, `medium` is `high`, `small` is `medium`, `unlimited` clears the key), so a role with an explicit level keeps it. The recorded budget reads back off the settings, not out of a private file. |
27
+
28
+ ## What upstream changed between 0.14.4 and 0.15.2
29
+
30
+ | Upstream change | What this port did |
31
+ |---|---|
32
+ | Density and mannered-prose pass across every skill | Adopted. This is the bulk of the diff, 98 files. |
33
+ | Two new principle leaves, `principle-attack-the-premise` and `principle-test-behavior-not-implementation` | Adopted, and both added to the mode's principle index. |
34
+ | Critique mode removed from the `how` skill, with `references/critic-prompt.md` and `references/critique-rubric.md` deleted and the callers in `architect` and the investigation playbook updated | Adopted. The two reference files were deleted here too. |
35
+ | Model invocation disabled for `how`, `why`, `unslop`, `typescript-best-practices`, and `make-bot-ui` | Adopted. Pi now hides those four from the model's prompt list, so they are reached by name through `/poteto-mode` or directly with `/skill:<name>`. See the measurement below for why this makes the other port's skill-stripping feature even smaller than it looked. |
36
+ | A rule that every claim carries its evidence or its label | Adopted into the reply contract. |
37
+ | Operator-neutral pronouns in the autopilot and multi-phase playbooks | Adopted. Ours also drops the "lands herself" phrasing. |
38
+ | Forge-neutral shipping that reaches GitHub or Origin instead of requiring Graphite | Adopted. A reader without Graphite is no longer blocked. |
39
+ | Semicolons, em dashes, and connector colons replaced with periods and commas across the skill prose | Adopted. |
40
+ | A plugin logo and the Cursor marketplace asset | Skipped. It is a marketplace asset for Cursor's plugin directory. |
41
+ | `make-bot-ui` moved to the skills root and registered | Excluded. It drives Cursor's Grok Bot webhook through `api2.cursor.sh`, which Pi cannot reach. `control-ui` covers the same job locally. |
42
+ | Cursor model slugs reintroduced as role defaults | Rewritten. Every pinned slug becomes `inherit`, because Pi runs a delegate on the parent session model unless you assign one. |
43
+
44
+ One upstream change we deliberately did not take. Upstream 0.15.2 replaced the mode skill's opening non-negotiable with a weaker citation rule and dropped the instruction to make reading the Principles the first todo. Upstream's own guide flow diagram still shows that step. This port keeps the stronger instruction, and `skills/poteto-mode/SKILL.md` is declared as an override with a baselined hash so an upstream edit to that file fails the check instead of silently reverting us.
45
+
46
+ ## Capabilities against `@zenspc/pi-pstack` 0.6.0
47
+
48
+ | Capability | This port | `@zenspc/pi-pstack` 0.6.0 |
49
+ |---|---|---|
50
+ | Upstream content | 50 skills, current to 0.15.2 | 47 skills, current to the 0.15.x line |
51
+ | Workflow skills the model sees | 5 of 50, because this port keeps upstream's `disable-model-invocation` flags | 4 of 47, because the port deletes those flags and strips the skills at runtime instead |
52
+ | Setup | `/pstack-setup` interactive wizard. Budget picker, scope picker, three tiers, per-role picker, and argument fast paths (`-l`, `inherit`, `light`, `custom`, a budget word, a bare role name) | `/setup-pstack` writes a JSON file. No picker, no budget |
53
+ | Where role models live | Pi's own `subagents.*` keys in `settings.json`, shared with the rest of Pi and hand-editable | A private `~/.pi/agent/pstack/models.json` that nothing else reads |
54
+ | Reasoning budget | Four budgets written to `subagents.defaultThinking`, read back on re-runs, per-role levels win | None |
55
+ | Status surface | `/pstack-status` prints the parent session model, the resolved model for every role, the settings file that won, the loaded skill inventory, and the system-prompt token cost of the model-visible skills | `/pstack status` reports whether pstack is on or off |
56
+ | Sticky mode | Persisted as a session entry, survives a reload, shows a footer status, and shows a HUD line below the editor while on | A session entry and a footer status |
57
+ | Context guard | Metered every turn while the mode is on: advice at 70 and 85 percent, one-key compaction at 92, live meter in the HUD | None |
58
+ | Compaction | While the mode is on, compaction summaries are shaped around the playbook, decision ledger, and verification state, falling back to Pi's default on any failure | Pi's default compaction |
59
+ | Install diagnostics | `/pstack-doctor` validates settings, flags unknown roles, checks agent frontmatter, counts playbooks, names missing companions, reports the pin | None |
60
+ | Plain-language restate | `/bro` is a command | `bro` is a skill only |
61
+ | Missing-dependency check | At startup, names each missing companion package, what it provides, and the install command | None |
62
+ | Pi-only skills | `control-cli`, `control-ui`, `create-skill` have no counterpart in the other port | Absent |
63
+ | Port drift control | `scripts/pi-deltas.json` declares every adaptation, `npm run verify:sync` classifies every vendored file and fails on anything unexplained, and a rule that stops matching is itself a failure | None. A re-vendor is a manual diff |
64
+ | Prompt-cost transparency | Measured and printed by `/pstack-status` | Strips skills without reporting the number |
65
+ | Skill visibility toggle | None. Follows upstream's static `disable-model-invocation` flags, which hide 45 of 50 skills | `/pstack on|off` toggles skill visibility at runtime |
66
+ | Role model resolution | Recomputed from the settings chain on every status call, so `inherit` always shows what it currently means | Reads its own config file |
67
+ | Tests | 44 committed tests over the extension logic and the sync rule engine | `check-plan` tests plus watch-pr tests |
68
+
69
+ We are behind in exactly one respect that matters to a stranger: release cadence. The other port has shipped six releases since 2026-08-22 and this one is at 0.2.0.
70
+
71
+ ## The one place the other port does more, and what we did instead
72
+
73
+ `@zenspc/pi-pstack` ships `/pstack on|off`, a runtime toggle that adds and removes pstack's skills from the model's prompt list. It is a real convenience and it is the single thing that port has which this one does not.
74
+
75
+ It exists because of a design difference, not a missing capability. Upstream 0.15.2 marks `how`, `why`, `unslop`, and `typescript-best-practices` with `disable-model-invocation: true`, and Pi honours it by leaving them out of the prompt. This port keeps upstream's flags. The other port deletes those flags from its copy and gives the user a runtime toggle instead, so the default state is the same on both and the toggle is the addition.
76
+
77
+ We measured both sides before deciding whether to grow our own equivalent.
78
+
79
+ ```
80
+ total skills: 50
81
+ hidden by Pi from upstream's flags: 45
82
+ offered to the model: 5, control-cli, control-ui, create-skill, deslop, setup-pstack
83
+ their four toggleable skills, how, why, unslop, typescript-best-practices: about 373 tokens
84
+ the five this port leaves offered: about 402 tokens
85
+ all nine together: about 776 tokens
86
+ ```
87
+
88
+ The two designs land in the same place by default. Their toggle can hide about 373 tokens; this port already hides those same 373 tokens because upstream asked Pi to. What separates them is the mechanism and the reporting.
89
+
90
+ A static frontmatter flag costs no extension state, survives an upgrade, and works in any Pi session including one where this extension failed to load. A runtime toggle needs mode state, a command, and a way to re-apply the strip on every turn. We kept the flag, and we spent the equivalent effort on telling you the number instead. `/pstack-status` prints the live cost, and undoing a flag is documented in the README as one deleted line plus `/reload`.
91
+
92
+ If you want the toggle specifically, the other port has one and this one does not. That is an honest difference rather than a gap we are hiding, and the measurement above is why we did not build the same thing.
93
+
94
+ ## Related projects
95
+
96
+ Three Pi ports of pstack exist. This one is a third, named `@mccune1224/pi-pstack` to stay distinct.
97
+
98
+ The extension code here was written for this package. A line-level comparison of `extensions/index.ts` against `@zenspc/pi-pstack`'s `extensions/pstack/index.ts` finds 19 identical non-trivial lines out of 276, all of them Pi API boilerplate such as the `session_start` registration. There is no shared implementation to attribute.
99
+
100
+ The skills are a different matter. They are adapted from upstream pstack, which is MIT and copyright Lauren Tan. That attribution is in the LICENSE and at the end of the README. If you are looking for the other Pi ports, they are [`@zenspc/pi-pstack`](https://github.com/zenspc/pi-extensions/tree/master/packages/pi-pstack) and [`pi-pstack`](https://www.npmjs.com/package/pi-pstack).
101
+
102
+ ## How to reproduce
103
+
104
+ ```bash
105
+ git clone --depth 400 https://github.com/cursor/plugins.git /tmp/upstream-plugins
106
+ npm run verify:sync # per-file classification, exits non-zero on anything unexplained
107
+ npm run check:piisms # exits non-zero on any Cursor-only reference
108
+ npm test # extension logic and sync rule engine
109
+
110
+ # count what Pi exposes to the model and what it costs
111
+ node -e '
112
+ const { readdirSync, readFileSync } = require("node:fs");
113
+ for (const name of readdirSync("skills").sort()) {
114
+ const src = readFileSync(`skills/${name}/SKILL.md`, "utf8");
115
+ const fm = (src.match(/^---\n([\s\S]*?)\n---/) || [])[1] || "";
116
+ if (!/disable-model-invocation:\s*true/.test(fm)) console.log(name);
117
+ }'
118
+
119
+ # compare skill inventories with the other port
120
+ npm pack @zenspc/pi-pstack && tar xzf zenspc-pi-pstack-*.tgz
121
+ diff <(ls skills) <(ls package/skills)
122
+ ```
@@ -1,16 +1,16 @@
1
1
  # Set up pstack
2
2
 
3
- In this page you install the plugin, pick which models pstack uses, and run your first task. Setup is one command plus a short conversation.
3
+ In this page you install the package, pick which models pstack uses, and run your first task. Setup is one command plus a short conversation.
4
4
 
5
- ## Install the plugin
6
-
7
- In a Pi chat, install the package:
5
+ ## Install the package
8
6
 
9
7
  ```bash
10
- pi install /path/to/pi-pstack
8
+ pi install npm:@mccune1224/pi-pstack
11
9
  ```
12
10
 
13
- Then run `/reload`. Pi registers the skills, agents, and commands. If the package is published, `pi install git:github.com/<you>/pi-pstack` works the same way.
11
+ From a checkout, `pi install /path/to/pi-pstack` works the same way. Then run `/reload`, and Pi registers the skills, the agents, and the commands.
12
+
13
+ Install [`pi-subagents`](https://www.npmjs.com/package/pi-subagents) alongside it. It provides the `subagent` tool that every routed workflow uses. pstack checks at startup and names the missing package when it is absent.
14
14
 
15
15
  ## Pick your models
16
16
 
@@ -20,11 +20,36 @@ Run:
20
20
  /pstack-setup
21
21
  ```
22
22
 
23
- [`/pstack-setup`](../../skills/setup-pstack/SKILL.md) detects the models you have access to, shows you each role (code delegates, judgment, the review panels), and asks what you want. Answer the questions. It writes the `subagents.*` keys in Pi settings, the same source every pstack skill reads.
23
+ [`/pstack-setup`](../../skills/setup-pstack/SKILL.md) reads the models your session can reach, asks where to save the map, asks for a reasoning budget, and offers three tiers: all-inherit, light, or a per-role picker. Fast paths skip the questions, so `/pstack-setup -l` writes to the project, `/pstack-setup inherit` takes the cheapest tier, `/pstack-setup small` sets a small reasoning budget, and `/pstack-setup scout` changes one role.
24
+
25
+ The budget is Pi's own thinking ladder: `large` sets `xhigh` reasoning for every role that has no explicit level, `medium` sets `high`, `small` sets `medium`, and `unlimited` leaves each role at its own setting. It writes `subagents.defaultThinking`, so a role you configured individually keeps its level.
26
+
27
+ It writes the `subagents.*` keys in Pi settings, which is the same place every other Pi tool reads model choices from:
28
+
29
+ - User scope: `~/.pi/agent/settings.json`
30
+ - Project scope: `.pi/settings.json`, which wins when both exist
24
31
 
25
- You only override what you care about. A role with no override keeps the `inherit` default (the parent model). To restore the default later, run `/pstack-setup` again, or clear the override in `~/.pi/agent/settings.json`.
32
+ Every role defaults to `inherit`, which runs the delegate on your parent session model at no extra cost. That is the recommended setting. Set a role explicitly only when you want a tier, and `/pstack-status` shows the resolved map and names the file that won.
33
+
34
+ Because pstack uses Pi's own settings, the mapping is not private to this package. Anything else that reads `subagents.*` sees the same choices, and you can edit the file by hand.
35
+
36
+ ## Check what is loaded
37
+
38
+ Run:
39
+
40
+ ```text
41
+ /pstack-status
42
+ ```
43
+
44
+ [`/pstack-status`](../../extensions/index.ts) prints the parent session model, the effective model for every role, the recorded budget, the settings file that won, and how many pstack skills are loaded. It also reports the system-prompt cost of the skills Pi exposes to the model.
45
+
46
+ Something look off? Run:
47
+
48
+ ```text
49
+ /pstack-doctor
50
+ ```
26
51
 
27
- Set a role to `inherit` and pstack omits the subagent `model` field, so the subagent runs on your parent chat model. For a panel role the value is a list, and one subagent runs per entry, so the list length sets the panel size. Setup also configures the default model for every `/swarm` worker unless a race names a model for each arm. `.pi/settings.json` for a team-shared mapping.
52
+ [`/pstack-doctor`](../../extensions/doctor.ts) checks both settings files for bad model slugs, thinking levels, and role typos that would silently do nothing, verifies the package agents' frontmatter, counts the vendored playbooks, names missing companion packages, and reports the upstream pin.
28
53
 
29
54
  ## Accept the verification offer, or don't
30
55
 
@@ -32,7 +57,7 @@ At the end of setup, `/pstack-setup` looks for a way to prove app behavior in yo
32
57
 
33
58
  Say yes and it writes `.pi/skills/verify-<app>/`, a project-local skill that teaches agents to drive your app the way a user does. It proves the skill works once before handing it over. Say no and setup moves on. You can run `/create-verification-skill` yourself any time. [Verify and ship](./06-verify-and-ship.md#create-a-project-verification-skill) covers when it earns its place.
34
59
 
35
- After setup, run `/reload`. The model mapping applies from the next turn.
60
+ The model map applies from the next turn. Pi re-reads settings per turn, so no reload is needed.
36
61
 
37
62
  ## Run your first task
38
63
 
@@ -42,8 +67,8 @@ Pick something real but small, and describe it the way you'd describe it to a co
42
67
  /poteto-mode add a --json flag to this command. text output stays byte-identical. verify both.
43
68
  ```
44
69
 
45
- Watch the todo list. The first item is always "read the Principles section". The rest are the matched playbook's steps copied in, the Feature playbook for this prompt. If `/poteto-mode` skips a step, the step stays in the list with `skip: <reason>`, so you can see what it chose not to do.
70
+ Watch the todo list. The first item is always to read the Principles section. The rest are the matched playbook's steps copied in, the Feature playbook for this prompt. If `/poteto-mode` skips a step, the step stays in the list with `skip: <reason>`, so you can see what it chose not to do.
46
71
 
47
- From here you can type normal follow-ups. `/poteto-mode` is sticky. It stays on for the conversation until you opt out by saying so.
72
+ From here you can type normal follow-ups. `/poteto-mode` is sticky. It stays on for the session, the choice persists across reloads, and the footer shows `pstack: poteto mode` while it is on, with a live context meter in the HUD below the editor. `/poteto-mode off` turns it back off.
48
73
 
49
74
  Next: [Route work through `/poteto-mode`](./02-poteto-mode.md).
@@ -1,6 +1,6 @@
1
1
  # Route work through `/poteto-mode`
2
2
 
3
- `/poteto-mode` is the front door. You give it a goal, it matches one of twenty-two playbooks, copies that playbook's steps into the todo list, and calls the other skills as the steps need them. In this page you learn what a good prompt looks like, and how little of one you actually need.
3
+ `/poteto-mode` is the front door. You give it a goal, it matches one of twenty-three playbooks, copies that playbook's steps into the todo list, and calls the other skills as the steps need them. In this page you learn what a good prompt looks like, and how little of one you actually need.
4
4
 
5
5
  ![A dispatcher pulls a switch lever to route robots on rail handcars toward lit gates, under a /poteto-mode departure board listing BUG FIX, FEATURE, and INVESTIGATION.](./images/router.jpg)
6
6
 
@@ -12,14 +12,6 @@ Editing code you don't understand is how subtle regressions ship. pstack gives y
12
12
 
13
13
  Ask the question you actually have. [`/how`](../../skills/how/SKILL.md) reads the code and answers at the level of a senior engineer onboarding you onto the subsystem, with the runtime flow, the key types, and the non-obvious parts. For a big subsystem it fans out two to four read-only explorers first. For a narrow question it just reads and explains.
14
14
 
15
- `/how` can also push back on the design. Ask for Critique mode when you suspect the structure itself:
16
-
17
- ```text
18
- /how explain the sync service, then critique its ownership boundaries
19
- ```
20
-
21
- The explanation comes first, so the critique stays grounded in how the thing really works.
22
-
23
15
  ## Dig up history with `/why`
24
16
 
25
17
  ```text
@@ -48,7 +48,7 @@ In context, that's enough. [`/tdd`](../../skills/tdd/SKILL.md) writes the smalle
48
48
 
49
49
  ## Clean before you commit
50
50
 
51
- The [Opening a PR playbook](../../skills/poteto-mode/playbooks/opening-a-pr.md) runs `/deslop` on the diff before each commit and applies [`/unslop`](../../skills/unslop/SKILL.md) to the PR description and commit bodies. `/deslop` ships in this package as [`/skill:deslop`](../../skills/deslop/SKILL.md). remove narrating comments, unsupported guards, dead compatibility paths, and unrelated edits.
51
+ The [Opening a PR playbook](../../skills/poteto-mode/playbooks/opening-a-pr.md) runs `/deslop` on the diff before each commit and applies [`/unslop`](../../skills/unslop/SKILL.md) to the PR description and commit bodies. `/deslop` ships in this package as [`/skill:deslop`](../../skills/deslop/SKILL.md). The bar is the same either way: remove narrating comments, unsupported guards, dead compatibility paths, and unrelated edits.
52
52
 
53
53
  For prose, `/unslop` takes a target and any extra rules you have:
54
54
 
@@ -82,6 +82,6 @@ Green is not the same as safe. When you're ready to land, say so:
82
82
  /poteto-mode land the stack.
83
83
  ```
84
84
 
85
- The [Shipping playbook](../../skills/poteto-mode/playbooks/shipping.md) verifies each PR independently before it arms anything. One fresh agent per PR proves the behavior live, and the agent that judges a change is never the one that wrote it. Then Shipping lands only the contiguous verified run from the bottom, through Graphite merge-when-ready, and reports the first PR that breaks the chain. A verified PR sitting above an unverified one waits, because merging it would pull the gap in underneath.
85
+ The [Shipping playbook](../../skills/poteto-mode/playbooks/shipping.md) verifies each PR independently before it arms anything. One fresh agent per PR proves the behavior live, and the agent that judges a change is never the one that wrote it. Then Shipping lands only the contiguous verified run from the bottom, one PR at a time through GitHub by default or Origin when its CLI is available, and reports the first PR that breaks the chain. A verified PR sitting above an unverified one waits, because merging it would pull the gap in underneath.
86
86
 
87
87
  Next: [Run work while you sleep](./07-overnight.md).
@@ -12,7 +12,7 @@ A good handoff has the goal, the finish condition, permissions, and an escape ha
12
12
  /poteto-mode im going to bed. migrate every caller to the new parser in a fresh worktree off <base>.
13
13
  done means zero old callers, all parser fixtures pass, old api deleted.
14
14
  keep a decision log. don't ask me before committing.
15
- /loop until done. if you're truly stuck after a few hours, stop and write up why.
15
+ keep going until done. if you're truly stuck after a few hours, stop and write up why.
16
16
  ```
17
17
 
18
18
  Walk through what each line buys you:
@@ -64,7 +64,7 @@ The contract above drives one task to one finish condition. Some nights hold mor
64
64
  /poteto-mode full autopilot on this queue. each item is independent. i want them merged by morning.
65
65
  ```
66
66
 
67
- [Autopilot-stack](../../skills/poteto-mode/playbooks/autopilot-stack.md) runs the same owner loop but ships nothing. You wake up to one linear Graphite stack with a verifier's verdict on every link, and you review and land it yourself. Pick it over Autopilot-full when the changes are coupled, or when you want your own eyes on the work before anything merges:
67
+ [Autopilot-stack](../../skills/poteto-mode/playbooks/autopilot-stack.md) runs the same owner loop but ships nothing. You wake up to one linear base-branch stack with a verifier's verdict on every link, and you review and land it yourself. Pick it over Autopilot-full when the changes are coupled, or when you want your own eyes on the work before anything merges:
68
68
 
69
69
  ```text
70
70
  /poteto-mode autopilot these five changes but stack them, don't ship. i'll land the stack in the morning.
@@ -1,6 +1,6 @@
1
1
  # Steer with principle names
2
2
 
3
- pstack ships 21 principles as individual skills. `/poteto-mode` reads their index at the start of every multi-step task, applies the ones the task triggers, and names each applied principle in its reply along with the decision it changed.
3
+ pstack ships 23 principles as individual skills. `/poteto-mode` reads their index at the start of every multi-step task, applies the ones the task triggers, and names each applied principle in its reply along with the decision it changed.
4
4
 
5
5
  You don't invoke principles. You use their names to steer. Each name points at a complete rule the agent has already read, so one phrase redirects the work more precisely than a paragraph of instructions.
6
6
 
@@ -26,13 +26,14 @@ separate before serializing shared state. give each attempt its own worktree, no
26
26
 
27
27
  Each phrase lands because the rule behind it is specific. The agent still has to say, in its reply, which decision the rule changed. A principle citation with no decision behind it is the tell that it name-dropped instead of applying.
28
28
 
29
- ## The 21, briefly
29
+ ## The 23, briefly
30
30
 
31
31
  The core principles decide how much to build and when to rethink the design:
32
32
 
33
33
  - [Laziness Protocol](../../skills/principle-laziness-protocol/SKILL.md) prefers deletion and the smallest change that solves the problem.
34
34
  - [Foundational Thinking](../../skills/principle-foundational-thinking/SKILL.md) chooses the core data structures before writing logic.
35
35
  - [Redesign from First Principles](../../skills/principle-redesign-from-first-principles/SKILL.md) integrates a new requirement as if it had been there from day one.
36
+ - [Attack the Premise](../../skills/principle-attack-the-premise/SKILL.md) questions the premise that two or more failed fixes shared, after a census of which actors hold the imbalance.
36
37
  - [Subtract Before You Add](../../skills/principle-subtract-before-you-add/SKILL.md) removes dead weight before building on top of it.
37
38
  - [Minimize Reader Load](../../skills/principle-minimize-reader-load/SKILL.md) collapses layers and hidden state a reader must hold in their head.
38
39
  - [Outcome-Oriented Execution](../../skills/principle-outcome-oriented-execution/SKILL.md) converges rewrites on the target design instead of preserving throwaway compatibility states.
@@ -54,6 +55,7 @@ The verification principles define what counts as proof:
54
55
  - [Prove It Works](../../skills/principle-prove-it-works/SKILL.md) verifies the real artifact, not a proxy.
55
56
  - [Fix Root Causes](../../skills/principle-fix-root-causes/SKILL.md) reproduces and traces to the cause before changing code.
56
57
  - [Sequence Work into Verifiable Units](../../skills/principle-sequence-verifiable-units/SKILL.md) ends each small unit in a check before starting the next.
58
+ - [Test Behavior, Not Implementation](../../skills/principle-test-behavior-not-implementation/SKILL.md) calls the code the way its users do and asserts a literal expected value, and deletes a test that would still pass if every imported function returned `undefined`.
57
59
 
58
60
  The delegation principles keep parallel work sane:
59
61
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Prompts worth copying, then the mistakes everyone makes once. Swap in your own paths and finish conditions. The recipes are deliberately informal. That's how they get typed in practice, and the skills read intent fine.
4
4
 
5
- ![She tastes a finished dish while robots cook from a recipe box, with pinned cards reading /how, /tdd, and /loop above the counter.](./images/recipes.jpg)
5
+ ![She tastes a finished dish while robots cook from a recipe box, with pinned cards reading /how and /tdd above the counter.](./images/recipes.jpg)
6
6
 
7
7
  ## Understand an unfamiliar subsystem
8
8
 
@@ -81,7 +81,7 @@ That's the whole prompt. [`/bro`](../../skills/bro/SKILL.md) restates the last m
81
81
  ## The pitfalls
82
82
 
83
83
  - **Enumerating skills in the prompt.** "use /how then /architect then /arena" reorders steps the playbook already sequences. State the goal and constraints. Name a skill only to override a default.
84
- - **A vague finish condition.** "make it better" gives `/loop` nothing to check. Give a command or artifact that can pass or fail.
84
+ - **A vague finish condition.** "make it better" gives the run nothing to check. Give a command or artifact that can pass or fail.
85
85
  - **Parallel agents in one worktree.** They overwrite each other and the diff becomes archaeology. Say "own worktree per attempt" and the isolation is free.
86
86
  - **Using `/arena` for coverage.** `/arena` repeats one design or code brief, then picks a base and grafts the best parts. `/swarm` partitions slices or declared race arms and aggregates one report.
87
87
  - **Accepting every review comment.** Bots and humans both file real catches and noise in one list. `/interrogate` sorts findings into act-on and dismissed buckets with reasons, and you can override either way.
@@ -4,14 +4,14 @@ pstack works best when you stop micromanaging the agent. You describe what you w
4
4
 
5
5
  Here's what you'll learn:
6
6
 
7
- 1. [Set up pstack](./01-setup.md). Install the plugin and pick your models.
7
+ 1. [Set up pstack](./01-setup.md). Install the package and pick your models.
8
8
  2. [Route work through `/poteto-mode`](./02-poteto-mode.md). Give it a goal and watch it pick a playbook.
9
9
  3. [Understand the code](./03-understand.md). `/how`, `/why`, `/teach`, and `/recall` before you edit anything.
10
10
  4. [Design the change](./04-design.md). `/architect`, `/arena`, `/swarm`, and `/interrogate` before code locks in a shape.
11
11
  5. [Build and clean the change](./05-build-and-clean.md). The build playbooks, `/tdd`, `/unslop`, and `/no-comments`.
12
12
  6. [Verify and ship](./06-verify-and-ship.md). Prove behavior on the real app, then open a focused PR and drive it to merged.
13
13
  7. [Run work while you sleep](./07-overnight.md). An overnight contract, a decision log you can audit, and the playbooks that scale past one agent.
14
- 8. [Steer with principle names](./08-principles.md). The 21 names that redirect an agent mid-task.
14
+ 8. [Steer with principle names](./08-principles.md). The 23 names that redirect an agent mid-task.
15
15
  9. [Make it yours](./09-make-it-yours.md). Your own mode, plus how to test a skill change.
16
16
  10. [Recipes and pitfalls](./10-recipes-and-pitfalls.md). Prompts to copy and mistakes to skip.
17
17