@mccune1224/pi-pstack 0.1.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 (150) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -0
  3. package/agents/comment-sicko.md +37 -0
  4. package/agents/poteto-agent.md +16 -0
  5. package/docs/guide/01-setup.md +49 -0
  6. package/docs/guide/02-poteto-mode.md +98 -0
  7. package/docs/guide/03-understand.md +61 -0
  8. package/docs/guide/04-design.md +81 -0
  9. package/docs/guide/05-build-and-clean.md +75 -0
  10. package/docs/guide/06-verify-and-ship.md +87 -0
  11. package/docs/guide/07-overnight.md +81 -0
  12. package/docs/guide/08-principles.md +69 -0
  13. package/docs/guide/09-make-it-yours.md +67 -0
  14. package/docs/guide/10-recipes-and-pitfalls.md +94 -0
  15. package/docs/guide/README.md +30 -0
  16. package/docs/guide/images/design.jpg +0 -0
  17. package/docs/guide/images/overnight.jpg +0 -0
  18. package/docs/guide/images/recipes.jpg +0 -0
  19. package/docs/guide/images/router.jpg +0 -0
  20. package/docs/guide/images/understanding.jpg +0 -0
  21. package/docs/guide/images/verification.jpg +0 -0
  22. package/extensions/index.ts +358 -0
  23. package/extensions/settings.test.ts +110 -0
  24. package/extensions/settings.ts +240 -0
  25. package/package.json +77 -0
  26. package/skills/architect/SKILL.md +83 -0
  27. package/skills/architect/references/design-red-flags.md +33 -0
  28. package/skills/architect/references/rationale-template.md +35 -0
  29. package/skills/architect/references/runner-prompt.md +20 -0
  30. package/skills/arena/SKILL.md +71 -0
  31. package/skills/automate-me/SKILL.md +109 -0
  32. package/skills/blast-radius/SKILL.md +50 -0
  33. package/skills/bro/SKILL.md +7 -0
  34. package/skills/control-cli/SKILL.md +109 -0
  35. package/skills/control-ui/SKILL.md +109 -0
  36. package/skills/create-skill/SKILL.md +69 -0
  37. package/skills/create-verification-skill/SKILL.md +44 -0
  38. package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  39. package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  40. package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  41. package/skills/deslop/SKILL.md +22 -0
  42. package/skills/figure-it-out/SKILL.md +55 -0
  43. package/skills/how/SKILL.md +130 -0
  44. package/skills/how/references/critic-prompt.md +59 -0
  45. package/skills/how/references/critique-rubric.md +58 -0
  46. package/skills/how/references/explainer-prompt.md +55 -0
  47. package/skills/how/references/explorer-prompt.md +52 -0
  48. package/skills/interrogate/SKILL.md +112 -0
  49. package/skills/interrogate/references/code-quality-review.md +47 -0
  50. package/skills/interrogate/references/lead-judgment.md +58 -0
  51. package/skills/interrogate/references/reviewer-prompt.md +72 -0
  52. package/skills/interrogate/references/rubric.md +77 -0
  53. package/skills/maintain-verification-skill/SKILL.md +39 -0
  54. package/skills/no-comments/SKILL.md +24 -0
  55. package/skills/poteto-mode/SKILL.md +142 -0
  56. package/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
  57. package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  58. package/skills/poteto-mode/playbooks/autopilot-full.md +13 -0
  59. package/skills/poteto-mode/playbooks/autopilot-stack.md +16 -0
  60. package/skills/poteto-mode/playbooks/babysit.md +27 -0
  61. package/skills/poteto-mode/playbooks/bug-fix.md +17 -0
  62. package/skills/poteto-mode/playbooks/eval.md +27 -0
  63. package/skills/poteto-mode/playbooks/feature.md +21 -0
  64. package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  65. package/skills/poteto-mode/playbooks/investigation.md +14 -0
  66. package/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
  67. package/skills/poteto-mode/playbooks/opening-a-pr.md +29 -0
  68. package/skills/poteto-mode/playbooks/orchestrate.md +113 -0
  69. package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
  70. package/skills/poteto-mode/playbooks/perf-issue.md +24 -0
  71. package/skills/poteto-mode/playbooks/prototype.md +14 -0
  72. package/skills/poteto-mode/playbooks/refactoring.md +16 -0
  73. package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  74. package/skills/poteto-mode/playbooks/session-pickup.md +13 -0
  75. package/skills/poteto-mode/playbooks/shipping.md +20 -0
  76. package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  77. package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  78. package/skills/poteto-mode/playbooks/worktree-cleanup.md +14 -0
  79. package/skills/poteto-mode/references/bugbot-triage.md +142 -0
  80. package/skills/poteto-mode/scripts/bootstrap.ts +62 -0
  81. package/skills/poteto-mode/scripts/bun.lock +67 -0
  82. package/skills/poteto-mode/scripts/check-plan.mjs +186 -0
  83. package/skills/poteto-mode/scripts/orch/orch.test.ts +634 -0
  84. package/skills/poteto-mode/scripts/orch/orch.ts +578 -0
  85. package/skills/poteto-mode/scripts/orch/store.ts +1607 -0
  86. package/skills/poteto-mode/scripts/package.json +16 -0
  87. package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  88. package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  89. package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +118 -0
  90. package/skills/poteto-mode/scripts/watch-pr/github.test.ts +306 -0
  91. package/skills/poteto-mode/scripts/watch-pr/github.ts +699 -0
  92. package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
  93. package/skills/poteto-mode/scripts/watch-pr/policy.ts +832 -0
  94. package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  95. package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  96. package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  97. package/skills/poteto-mode/scripts/watch-pr/types.ts +401 -0
  98. package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  99. package/skills/poteto-mode/scripts/worktree-audit.mjs +178 -0
  100. package/skills/principle-boundary-discipline/SKILL.md +34 -0
  101. package/skills/principle-build-the-lever/SKILL.md +23 -0
  102. package/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
  103. package/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
  104. package/skills/principle-experience-first/SKILL.md +19 -0
  105. package/skills/principle-fix-root-causes/SKILL.md +23 -0
  106. package/skills/principle-foundational-thinking/SKILL.md +21 -0
  107. package/skills/principle-guard-the-context-window/SKILL.md +17 -0
  108. package/skills/principle-laziness-protocol/SKILL.md +18 -0
  109. package/skills/principle-make-operations-idempotent/SKILL.md +24 -0
  110. package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
  111. package/skills/principle-minimize-reader-load/SKILL.md +23 -0
  112. package/skills/principle-model-the-domain/SKILL.md +26 -0
  113. package/skills/principle-never-block-on-the-human/SKILL.md +23 -0
  114. package/skills/principle-outcome-oriented-execution/SKILL.md +22 -0
  115. package/skills/principle-prove-it-works/SKILL.md +33 -0
  116. package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
  117. package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
  118. package/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
  119. package/skills/principle-subtract-before-you-add/SKILL.md +22 -0
  120. package/skills/principle-type-system-discipline/SKILL.md +31 -0
  121. package/skills/recall/SKILL.md +35 -0
  122. package/skills/reflect/SKILL.md +77 -0
  123. package/skills/reflect/references/divergent-reviewer.md +43 -0
  124. package/skills/reflect/references/judgment-reviewer.md +42 -0
  125. package/skills/reflect/references/synthesizer.md +56 -0
  126. package/skills/reflect/references/tooling-reviewer.md +57 -0
  127. package/skills/setup-pstack/SKILL.md +92 -0
  128. package/skills/show-me-your-work/SKILL.md +82 -0
  129. package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  130. package/skills/show-me-your-work/scripts/log.mjs +30 -0
  131. package/skills/swarm/SKILL.md +46 -0
  132. package/skills/tdd/SKILL.md +44 -0
  133. package/skills/teach/SKILL.md +21 -0
  134. package/skills/technical-writing/SKILL.md +130 -0
  135. package/skills/typescript-best-practices/SKILL.md +28 -0
  136. package/skills/typescript-best-practices/references/patterns.md +292 -0
  137. package/skills/unslop/SKILL.md +80 -0
  138. package/skills/why/SKILL.md +229 -0
  139. package/skills/why/references/epistemics.md +144 -0
  140. package/skills/why/references/investigator-prompt.md +103 -0
  141. package/skills/why/references/source-playbook.md +17 -0
  142. package/skills/why/references/sources/code-archaeology.md +88 -0
  143. package/skills/why/references/sources/databricks.md +70 -0
  144. package/skills/why/references/sources/datadog.md +99 -0
  145. package/skills/why/references/sources/incident-postmortem.md +15 -0
  146. package/skills/why/references/sources/linear.md +48 -0
  147. package/skills/why/references/sources/notion.md +55 -0
  148. package/skills/why/references/sources/sentry.md +100 -0
  149. package/skills/why/references/sources/slack.md +54 -0
  150. package/skills/why/references/synthesizer-prompt.md +135 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lauren Tan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # pi-pstack
2
+
3
+ pstack for Pi. Poteto's rigorous engineering workflow as a Pi plugin. Write less code, write better code, and parallelize with confidence.
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.
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.
8
+
9
+ ## Install
10
+
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.
12
+
13
+ ```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
19
+ ```
20
+
21
+ Then run `/reload`.
22
+
23
+ ## Get started
24
+
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.
29
+
30
+ New here? The [guide](docs/guide/README.md) walks through a first task from setup to verification.
31
+
32
+ ## Commands
33
+
34
+ | Command | What it does |
35
+ |---|---|
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.
61
+
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. |
69
+
70
+ ## Subagents
71
+
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 |
98
+ |---|---|
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. |
102
+
103
+ At startup the plugin checks for these and tells you the install command when something is missing.
104
+
105
+ ## Not shipped
106
+
107
+ Two upstream pieces are excluded because they are bound to Cursor's runtime and cannot work on Pi:
108
+
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.
111
+
112
+ Pi has no automation runtime. If you ever run under one, fetch both from upstream.
113
+
114
+ ## Maintenance
115
+
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
119
+
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. |
127
+
128
+ ## Development
129
+
130
+ ```bash
131
+ npm ci
132
+ npm run typecheck # strict tsc over extensions/
133
+ npm run check:piisms # exit 1 if Cursor-shaped content ships
134
+ ```
135
+
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).
139
+
140
+ ## License
141
+
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).
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Comment Sicko
3
+ description: A deranged comment-hater that savors deletion and condemns workaround code. Read-only comment reviewer; reports only.
4
+ thinking: high
5
+ systemPromptMode: replace
6
+ inheritProjectContext: true
7
+ inheritSkills: true
8
+ tools: read, grep, find, ls, bash
9
+ ---
10
+
11
+ # Comment Sicko
12
+
13
+ My first output when spawned is exactly this.
14
+
15
+ Yes... Ha ha ha... Yes!
16
+
17
+ I hate comments. Feed me the parent scoped files or diff. If none exists, feed me the current diff against `main`. Narration, banners, commented-out corpses, workaround sermons. I want them all.
18
+
19
+ Only these exceptions get to crawl away.
20
+
21
+ - Legal or license headers.
22
+ - Non-obvious behavior forced by an external dependency, platform, vendor, or protocol we cannot reshape. Surprises in our own code are meat. Kill them and mark the exact symbol `MUST KILL` for rename, extract, type, or rearchitecture that makes the behavior obvious without prose.
23
+ - `// prettier-ignore`. Lint suppressions survive only when their rule is faulty, pedantic, or style-only.
24
+ - Doc comments that define a public API contract.
25
+ - Issue or RFC links that explain a constraint code cannot express.
26
+
27
+ That list is my only leash. When I am not sure a keep clause applies, the comment dies. Everything else is meat.
28
+
29
+ `eslint-disable`, `@ts-ignore`, `@ts-expect-error`, and similar suppressions stink. Look up the rule. If it catches real bugs or protects correctness or safety, kill the suppression and mark the exact guilty symbol `MUST KILL`.
30
+
31
+ `IMPORTANT`, `do not remove`, `too risky`, `fine for now`, and long justifications are scent, not conviction. Before judging, I read nearby code. If its claim is not obvious there, I run `/how`, `/why`, or both from the **how** and **why** skills on the named symbol or call. Only a foreign keep-list gotcha proven true today on a live path crawls away. Our-code surprises die with the reshape flag above. Doubt after the hunt is meat.
32
+
33
+ A long justification without a proven keep-list exception is a confession. Kill it. Never polish meat into a shorter alibi. Mark the exact guilty symbol `MUST KILL`. My kill ends there. I do not touch the code.
34
+
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
+
37
+ Report only. Name touched files, deletion count, `MUST KILL` flags with one line each, and skips.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: poteto-agent
3
+ description: Routing target for /poteto-mode and any request for poteto's style. Resume an existing poteto-agent for the conversation rather than spawning a sibling. Reads the poteto-mode skill's SKILL.md in full before any work, including its inline Principles index. Substituting generalPurpose skips that read and drifts.
4
+ thinking: high
5
+ systemPromptMode: replace
6
+ inheritProjectContext: true
7
+ inheritSkills: true
8
+ tools: read, grep, find, ls, bash, edit, write, subagent
9
+ is_background: true
10
+ ---
11
+
12
+ # Poteto subagent
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.
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.
@@ -0,0 +1,49 @@
1
+ # Set up pstack
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.
4
+
5
+ ## Install the plugin
6
+
7
+ In a Pi chat, install the package:
8
+
9
+ ```bash
10
+ pi install /path/to/pi-pstack
11
+ ```
12
+
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.
14
+
15
+ ## Pick your models
16
+
17
+ Run:
18
+
19
+ ```text
20
+ /pstack-setup
21
+ ```
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.
24
+
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`.
26
+
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.
28
+
29
+ ## Accept the verification offer, or don't
30
+
31
+ At the end of setup, `/pstack-setup` looks for a way to prove app behavior in your project, either a `verify-*` skill or an existing harness. If it finds neither, it offers once to generate one with [`/create-verification-skill`](../../skills/create-verification-skill/SKILL.md).
32
+
33
+ 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
+
35
+ After setup, run `/reload`. The model mapping applies from the next turn.
36
+
37
+ ## Run your first task
38
+
39
+ Pick something real but small, and describe it the way you'd describe it to a colleague:
40
+
41
+ ```text
42
+ /poteto-mode add a --json flag to this command. text output stays byte-identical. verify both.
43
+ ```
44
+
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.
46
+
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.
48
+
49
+ Next: [Route work through `/poteto-mode`](./02-poteto-mode.md).
@@ -0,0 +1,98 @@
1
+ # Route work through `/poteto-mode`
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.
4
+
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
+
7
+ ## What happens to your prompt
8
+
9
+ ```mermaid
10
+ flowchart TD
11
+ A[Your prompt] --> B[poteto-mode]
12
+ B --> C[Read the Principles section]
13
+ C --> D{Match the task}
14
+ D -->|Read-only question| E[Investigation]
15
+ D -->|Defect| F[Bug fix]
16
+ D -->|New behavior| G[Feature]
17
+ D -->|Structure only| H[Refactoring]
18
+ D -->|Measured slowness| I[Perf issue]
19
+ D -->|Large work or no match| J[figure-it-out]
20
+ E --> K[Verify and report]
21
+ F --> K
22
+ G --> K
23
+ H --> K
24
+ I --> K
25
+ J --> K
26
+ ```
27
+
28
+ The diagram shows the common routes. There are also playbooks for hillclimbing a metric, diagnosing runtime symptoms and captured traces, prototypes, visual parity, authoring and evaluating skills, autonomous runs, babysitting a PR or stack to merge-ready, shipping a verified stack, running a PR queue on autopilot, orchestrating project-scale programs, session pickup, pausing safely, multi-phase plans, and worktree cleanup. The [playbook directory](../../skills/poteto-mode/playbooks/) has the full set.
29
+
30
+ ## Say the goal, not the ceremony
31
+
32
+ You don't write a spec. You say what's wrong or what you want, plus anything you already know that saves the agent time:
33
+
34
+ ```text
35
+ /poteto-mode users get two notifications after a retry. repro first, then fix and verify.
36
+ ```
37
+
38
+ That's a Bug fix prompt. "repro first" is a real constraint, not politeness, and the playbook honors it. Watch the todo list fill with the Bug fix steps. A skipped step stays visible with `skip: <reason>`.
39
+
40
+ When the conversation already carries the context, the prompt shrinks to almost nothing. All of these are enough:
41
+
42
+ ```text
43
+ /poteto-mode do it
44
+ ```
45
+
46
+ ```text
47
+ continue
48
+ ```
49
+
50
+ ```text
51
+ keep going until done
52
+ ```
53
+
54
+ Short works because the mode is sticky and the playbook holds the structure. Your words carry the intent, and the skill carries the rigor.
55
+
56
+ ## Switch tasks with "new task"
57
+
58
+ A long chat accumulates context from the last task. When you change subjects, say so:
59
+
60
+ ```text
61
+ /poteto-mode new task. figure out why the cache entry survives logout. don't change any code yet.
62
+ ```
63
+
64
+ "new task" tells `/poteto-mode` to re-match rather than continue the prior playbook. "don't change any code yet" pins this one to Investigation. Without those two phrases, a mode mid-Feature tends to treat your question as the next feature step.
65
+
66
+ ## Give parallel work its own worktree
67
+
68
+ If you run several agents against one repository, they will fight over the working tree. Ask for isolation up front:
69
+
70
+ ```text
71
+ /poteto-mode new task. branch off <base> in a fresh worktree, then port the parser change there.
72
+ ```
73
+
74
+ Each task in its own branch and worktree means no agent stomps another's files. The [Opening a PR playbook](../../skills/poteto-mode/playbooks/opening-a-pr.md) already works from a worktree for code changes, so mostly you only say this when a specific base or location matters.
75
+
76
+ Worktrees accumulate. When disk gets tight, ask:
77
+
78
+ ```text
79
+ /poteto-mode what's eating my disk? prune the worktrees that are safe to prune.
80
+ ```
81
+
82
+ The [Worktree cleanup playbook](../../skills/poteto-mode/playbooks/worktree-cleanup.md) classifies every worktree by merge state, uncommitted work, and which chats still touch it. It deletes only what that evidence clears and pauses for your call on anything holding uncommitted work.
83
+
84
+ ## Leave it running
85
+
86
+ When you step away, say what done means and go:
87
+
88
+ ```text
89
+ /poteto-mode im stepping away. keep going until the migration check reports zero old callers. log your decisions.
90
+ ```
91
+
92
+ Work you'll review later routes through [`/figure-it-out`](../../skills/figure-it-out/SKILL.md), which designs the run's phases and keeps a [`/show-me-your-work`](../../skills/show-me-your-work/SKILL.md) decision log. [Run work while you sleep](./07-overnight.md) covers the full overnight contract.
93
+
94
+ **Pitfall:** don't enumerate skills in your prompt ("use /how, then /architect, then /arena..."). The playbook already sequences them, and a hand-written sequence usually reorders or drops steps the playbook would have kept. Name a skill only when you want to override a specific choice.
95
+
96
+ Read [`poteto-mode`](../../skills/poteto-mode/SKILL.md) itself for the full routing rules.
97
+
98
+ Next: [Understand the code](./03-understand.md).
@@ -0,0 +1,61 @@
1
+ # Understand the code before changing it
2
+
3
+ Editing code you don't understand is how subtle regressions ship. pstack gives you four ways in. `/how` explains what the code does now. `/why` digs up the reasons it's shaped that way. `/teach` blends both into one explanation. `/recall` rebuilds your own recent context on a topic.
4
+
5
+ ![A detective studies a machine blueprint with a magnifying glass while robots fetch case files; the evidence board behind her links clues under /how and /why.](./images/understanding.jpg)
6
+
7
+ ## Trace behavior with `/how`
8
+
9
+ ```text
10
+ /how do we dedupe notifications? is there an n+1 when we look up subscribers?
11
+ ```
12
+
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
+
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
+ ## Dig up history with `/why`
24
+
25
+ ```text
26
+ /why was the retry limit set to five? does the reason still hold?
27
+ ```
28
+
29
+ [`/why`](../../skills/why/SKILL.md) works like a detective on a cold case. It starts from source control, then queries whatever evidence categories your MCPs expose, such as the issue tracker, long-form docs, team chat, observability, error tracking, and analytics, all in parallel. The report cites everything, separates direct evidence from inference, and says "appears to" when the record is thin. A null result gets reported too, because "nobody wrote down why" is itself an answer.
30
+
31
+ The two compose naturally. `do why first then how` is a perfectly good prompt when you suspect the history explains the mess.
32
+
33
+ ## Actually understand it with `/teach`
34
+
35
+ ```text
36
+ /teach me how this PR changes retries. convince me it fixes the cause and not the symptom.
37
+ ```
38
+
39
+ [`/teach`](../../skills/teach/SKILL.md) is for when a summary isn't enough. It runs `/how` and `/why`, for a small change maybe just one of them, and weaves the findings into a plain explanation that builds up diagram by diagram. The "convince me" framing is worth stealing. It turns the explanation into an argument you can poke at instead of a tour.
40
+
41
+ ## Rebuild your own context with `/recall`
42
+
43
+ ```text
44
+ /recall catch me up on the export work from last week
45
+ ```
46
+
47
+ [`/recall`](../../skills/recall/SKILL.md) mines your own recent chats plus the shared record (issues, prior fixes, errors still firing) and hands back a brief on where things stand and what's next. Use it when you're returning to a topic cold. If you want to resume one specific chat, that's the Session pickup playbook below, not `/recall`.
48
+
49
+ ## Take over prior work with Session pickup
50
+
51
+ When another agent (or you, last week) left a branch mid-flight:
52
+
53
+ ```text
54
+ /poteto-mode take over this branch. read the decision log, figure out what's done, and continue from there. don't redo finished work.
55
+ ```
56
+
57
+ The [Session pickup playbook](../../skills/poteto-mode/playbooks/session-pickup.md) treats the prior trail as authoritative. It reconstructs the branch state and decisions, names the resume point, and verifies inherited claims against the original goal instead of re-deriving everything from scratch.
58
+
59
+ **Pitfall:** don't skip this page's skills because "the agent will read the code anyway." An agent that starts editing without a traced model tends to fix the symptom at the first plausible spot. `/how` first is cheaper than the second bug.
60
+
61
+ Next: [Design the change](./04-design.md).
@@ -0,0 +1,81 @@
1
+ # Design before you write code
2
+
3
+ One attempt at a hard design locks in the first shape the model thought of. `/architect` settles types and boundaries before implementation. `/arena` runs several attempts at the same brief and merges the best parts. `/interrogate` has other models try to break the result. When the job is coverage rather than design synthesis, `/swarm` fans out slices or races and aggregates their results.
4
+
5
+ ![Three robots draft competing bridge models at their own tables under /architect, /arena, and /interrogate panels, while a judge robot with a clipboard inspects skeptically.](./images/design.jpg)
6
+
7
+ ## Settle the shape with `/architect`
8
+
9
+ ```text
10
+ /architect design the import pipeline before writing any code. i care most about how callers use it.
11
+ ```
12
+
13
+ [`/architect`](../../skills/architect/SKILL.md) grounds itself first, running `/how` over the code the design touches and `/why` when it moves ownership or layers. Then it runs `/arena` to produce competing design sketches, with the caller's usage written first in each, followed by types, signatures, and a module map.
14
+
15
+ By default it proceeds straight from the synthesized design into implementation. If you want to see the design first, say so:
16
+
17
+ ```text
18
+ /architect with checkpoint. stop and show me before implementing.
19
+ ```
20
+
21
+ ## Fan out attempts with `/arena`
22
+
23
+ ```text
24
+ /arena take my prompt to the arena verbatim. i want to compare their proposals with yours.
25
+ ```
26
+
27
+ [`/arena`](../../skills/arena/SKILL.md) is the general tool underneath. N subagents attempt the same design or code brief in parallel, each writing to its own worktree or directory. A read-only judge, on a different model family when your configuration allows one, scores every candidate against a rubric. The coordinator reads each candidate end to end, picks a base, grafts in the best ideas from the losers, and verifies the result.
28
+
29
+ ```mermaid
30
+ flowchart LR
31
+ A[One task] --> B[Configured panel]
32
+ B --> C[Candidate 1]
33
+ B --> D[Candidate 2]
34
+ B --> E[Candidate N]
35
+ C --> F[Cross-judge]
36
+ D --> F
37
+ E --> F
38
+ F --> G[Pick a base]
39
+ G --> H[Graft the best parts]
40
+ H --> I[Verify]
41
+ ```
42
+
43
+ The panel comes from your [`/pstack-setup`](../../skills/setup-pstack/SKILL.md) configuration, and you can adjust it per task. Ask for more candidates when the decision matters, fewer when it doesn't:
44
+
45
+ ```text
46
+ /arena this, 5 candidates. the cache key format is expensive to change later.
47
+ ```
48
+
49
+ ## Cover slices and races with `/swarm`
50
+
51
+ ```text
52
+ /swarm check every package under packages/ against its check.sh. one worker per package. one report.
53
+ ```
54
+
55
+ [`/swarm`](../../skills/swarm/SKILL.md) fans N workers across independent slices, coverage matrices, gauntlet lanes, exploration partitions, or declared race arms. Each worker gets its own scope and check, then reports `PASS`, `ISSUES`, or `BLOCKED`. The parent waits for the workers and returns one compact report with any gaps or dropouts.
56
+
57
+ Reach for it when parallelism buys coverage or lets independent checks race. `/arena` gives every worker the same design or code brief, then picks a base and grafts the best parts. `/swarm` covers slices or runs a race with a selection rule declared up front. It does not use the base-selection and grafting ceremony.
58
+
59
+ ## Break it with `/interrogate`
60
+
61
+ ```text
62
+ /interrogate the whole branch, but skeptically. no nitpicks unless it's an actual bug or regression.
63
+ ```
64
+
65
+ [`/interrogate`](../../skills/interrogate/SKILL.md) sends the same diff, intent, and rubric to several reviewers on different model families. Model diversity is the point. Different models have different blind spots, so a finding two models raise independently is high-confidence signal. The lead sorts everything into `Act on`, `Consider`, `Noted`, and `Dismissed`, with a reason for each dismissal, and applies nothing automatically.
66
+
67
+ Read the dismissals too. The lead is a pragmatic senior engineer, not an oracle, and you can override it.
68
+
69
+ ## How much design work does a task deserve?
70
+
71
+ You might be wondering whether every change needs this. No. Most changes need none of it. A rough ladder:
72
+
73
+ - A small, finished change you're unsure about needs `/interrogate` alone.
74
+ - A change that crosses function boundaries or moves ownership earns `/architect`, which brings `/arena` with it.
75
+ - A standalone decision where independent attempts would help, like naming, formats, or an algorithm, is `/arena` directly.
76
+ - A coverage matrix, set of parallel checks, or race with declared arms is `/swarm`.
77
+ - A contested design that's expensive to reverse gets `/architect`, then `/interrogate` before shipping.
78
+
79
+ `/poteto-mode` already applies this ladder. Boundary-crossing work triggers `/architect` on its own, so you reach for these directly mainly when you want more or less scrutiny than the default.
80
+
81
+ Next: [Build and clean the change](./05-build-and-clean.md).
@@ -0,0 +1,75 @@
1
+ # Build the change and clean the diff
2
+
3
+ The build playbooks share one discipline. Say what you observed, let the playbook demand the evidence. This page shows what to put in the prompt for each common build task, then the cleanup habit that keeps diffs reviewable.
4
+
5
+ ## Prompt each build playbook with what you know
6
+
7
+ A bug prompt states the symptom and asks for a reproduction first:
8
+
9
+ ```text
10
+ /poteto-mode this command emits two records after a retry. repro first, then fix and verify.
11
+ ```
12
+
13
+ A feature prompt states the behavior and what must not change:
14
+
15
+ ```text
16
+ /poteto-mode add a --json flag. text output stays byte-identical. verify both forms.
17
+ ```
18
+
19
+ A refactoring prompt pins behavior before structure moves:
20
+
21
+ ```text
22
+ /poteto-mode move parsing into one module, zero behavior change. record the current output first and prove it's unchanged after.
23
+ ```
24
+
25
+ A perf prompt states the measurement, not a vibe:
26
+
27
+ ```text
28
+ /poteto-mode startup takes 1.8s on this fixture. trace it, fix the measured cause, show me before and after.
29
+ ```
30
+
31
+ Each of these routes to its playbook ([Bug fix](../../skills/poteto-mode/playbooks/bug-fix.md), [Feature](../../skills/poteto-mode/playbooks/feature.md), [Refactoring](../../skills/poteto-mode/playbooks/refactoring.md), [Perf issue](../../skills/poteto-mode/playbooks/perf-issue.md)), and the playbook supplies the steps you didn't type: reproduce before fixing, name the data shape before implementing, pin behavior before restructuring, profile before optimizing.
32
+
33
+ For sustained improvement of one number, there's the [Hillclimb playbook](../../skills/poteto-mode/playbooks/hillclimb.md). Give it the metric, a target, and a floor on attempts, and it loops one hypothesis at a time with a frozen measurement harness. It keeps wins and reverts everything else.
34
+
35
+ ## Write the failing test first with `/tdd`
36
+
37
+ When a bug has a cheap local test path, the whole prompt can be two words:
38
+
39
+ ```text
40
+ /tdd implement
41
+ ```
42
+
43
+ In context, that's enough. [`/tdd`](../../skills/tdd/SKILL.md) writes the smallest test that fails for the intended reason, then the fix, then reruns the test. If a test would need broad harness setup or brittle mocks, the skill says so and uses the closest executable check instead. Don't force a test where a real command is stronger evidence.
44
+
45
+ ## Let the TypeScript rules load themselves
46
+
47
+ [`typescript-best-practices`](../../skills/typescript-best-practices/SKILL.md) has no slash command in your workflow. It loads whenever the agent touches a `.ts` or `.tsx` file and turns the type-system principles into concrete rules: discriminated unions, `unknown` at boundaries, exhaustive variants, schema-derived types.
48
+
49
+ ## Clean before you commit
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.
52
+
53
+ For prose, `/unslop` takes a target and any extra rules you have:
54
+
55
+ ```text
56
+ /unslop the readme changes, no emdashes
57
+ ```
58
+
59
+ You'll develop your own shorthand. The skill reads intent fine from terse prompts like `unslop that, tighten it`.
60
+
61
+ ## Strip the comments with `/no-comments`
62
+
63
+ Comments need their own pass, and not from the agent that wrote them. An author defends its comments the way you'd defend yours. So before review, hand them to fresh eyes:
64
+
65
+ ```text
66
+ /no-comments the diff
67
+ ```
68
+
69
+ [`/no-comments`](../../skills/no-comments/SKILL.md) spawns [Comment Sicko](../../agents/comment-sicko.md), a read-only reviewer with a short keep list: license headers, doc comments on a public API, links that explain what code can't, behavior forced by an external dependency you can't reshape. Everything else goes. A surprise in your own code gets no such pass. The comment comes back as a refactor flag, and `/no-comments` fixes the flags it accepts at the root cause. When a comment claims a constraint, "do not remove", the skill offers to encode the claim as a type, test, or lint. Either way, the comment comes out.
70
+
71
+ The division of labor is worth keeping straight. `/deslop` cleans slop out of the code, `/unslop` cleans it out of prose, and `/no-comments` hands the comments to a reviewer who didn't write them.
72
+
73
+ **Pitfall:** cleanup is not optional polish. A diff with narrating comments and defensive dead weight reads as unfinished to reviewers, and the extra code is where the next bug hides. If the diff feels padded, say `deslop it` before you commit, not after review calls it out.
74
+
75
+ Next: [Verify and ship](./06-verify-and-ship.md).