omp packages

pi-pstack-updated0.1.0

Maintained Pi port of Cursor pstack: Poteto Mode, 52 skills, playbooks, and isolated subagents, with explicit confirmation before external writes.

janmayer Published 3 days ago MIT ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-pstack-updated

npm CI License: MIT pstack

Cursor's pstack for Pi. You get Poteto Mode, 52 skills, 22 playbooks, two bundled agents, and an extension that runs isolated Pi subagents. Agents ask before any external or irreversible action.

pi install npm:pi-pstack-updated

Why this package

The original Pi port, pi-pstack 0.1.0, has had no release since 2026-08-08. Upstream pstack has moved on since then. This package continues that port and keeps it current.

  • Synced to upstream pstack 0.15.42. upstream.json records the exact commit. A sync script and a test suite make each later sync a reviewed, rerunnable step.
  • Self-contained. It ships its own subagent tool, so it needs no other Pi package.
  • Stricter about external actions. Upstream lets agents post to chat, update tickets, and start evals without asking. Here, agents ask before every push, PR change, CI trigger, merge, deploy, deletion, or outside message. The extension also asks before risky shell commands.
  • Fixed for Pi. It includes a fix for a subagent crash on string message content, statechart running from a Pi install, and skills that no longer mention Cursor-only features.

Install

The package needs Node 22.18 or later. It was tested with Pi 1.6.0. Pick one source:

# Latest release from npm
pi install npm:pi-pstack-updated

# A pinned npm version
pi install npm:pi-pstack-updated@0.1.0

# A pinned git tag
pi install git:github.com/heyjan/pi-pstack-updated@v0.1.0

To share the package with everyone who works in one repository, run the install from the repository root with -l. Pi writes the entry to .pi/settings.json instead of ~/.pi/agent/settings.json:

pi install -l npm:pi-pstack-updated@0.1.0

Restart Pi after an install. Run pi config to turn single skills or the extension on or off.

Do not load this package together with another pstack package or any package that registers a subagent tool. Only one of them can own the tool and the /poteto-mode command.

Quick start

/poteto-mode investigate the flaky retry test, fix it, then verify it
/poteto-mode off
/skill:poteto-help which skill should I use to review this diff?

/poteto-mode turns on Poteto Mode for the current session and loads the poteto-mode skill. It picks a playbook for the task, keeps a checklist, delegates bounded work to subagents, and verifies the result before it reports. The mode persists in the session until you run /poteto-mode off. /skill:poteto-mode loads the skill for one request.

Every model role uses the current session's model by default, so no setup is needed. Run /setup-pstack to pick models per role. See Model roles.

What you get

Skill Use it to
/poteto-mode Work any non-trivial task with a playbook: investigation, bug fix, perf issue, feature, refactoring, prototype, PR babysitting, shipping, autonomous runs, and more
/skill:poteto-help Find the right skill or playbook for a task
/skill:how, /skill:why Explain how code works now, or why it was built that way, from the commit and PR record
/skill:architect, /skill:arena Settle a design before coding, or compare several attempts and merge the best parts
/skill:interrogate Have adversaries try to break a change, keeping only findings proven by a run
/skill:swarm Fan out parallel workers over slices or as a race
/skill:blast-radius Check what a small diff breaks outside itself
/skill:tdd, /skill:benchmark-checklist Fix test-first, or vet a measured performance number
/skill:recall, /skill:ketchup Rebuild context from recent sessions, or catch up on this one
/skill:sharpen Rewrite a prompt deeper, not bigger, before sending it
/skill:statechart Check a TLA+ model and draw it as a Mermaid statechart (needs Java and TLC)
/skill:unslop, /skill:technical-writing Remove AI tells from prose, or write docs, PRs, and commit messages
/skill:reflect, /skill:automate-me Turn a finished run or your habits into skill edits

The other skills cover verification drivers, comment review, catch-ups, plain restatements, TypeScript rules, decision trails, and 24 engineering principles such as Prove It Works and Fix Root Causes. Run ls skills in the package, or /skill:poteto-help, for the full list.

Deploy to several workplaces

Do these steps once on each machine.

  1. Remove any other pstack package. Run pi list and pass each one's source to pi remove:

    pi list
    pi remove <source>
    
  2. Install a pinned version:

    pi install npm:pi-pstack-updated@0.1.0
    
  3. Optional. Start Pi and run /setup-pstack to pick models for each role. Without it, every role uses the model of the current session. Model choices live in ~/.pi/agent/pstack/models.json on each machine and are not part of the package.

  4. Restart Pi and run /poteto-mode off. If the extension loaded, Pi replies "Poteto Mode disabled for this session."

A pinned version stays where it is. pi update --extensions reconciles installed packages, but it does not move a pinned npm version or a git tag. To upgrade a pinned install, run pi install with the new version. Pi replaces the old entry for the same package. An unpinned npm:pi-pstack-updated moves to the newest release on pi update --extensions.

For a team, declare the package in the repository instead of installing it on each machine:

{
	"packages": ["npm:pi-pstack-updated@0.1.0"]
}

Save this as .pi/settings.json in the repository, or create it with pi install -l. Pi installs project packages after each user grants project trust. A project entry replaces a personal entry for the same package. Another pstack package that a user installed personally still has to be removed on that machine.

After an update, Pi shows the new CHANGELOG.md entries under "Extension Updates" on the next fresh start.

Extension, tools, and agents

The extension in extensions/pstack/ registers four tools and two commands.

Name Kind Purpose
subagent tool Runs Pi subagents as separate processes.
pstack_todo tool Keeps the task checklist for the session.
pstack_sessions tool Lists Pi session files for the current working directory only.
pstack_config tool Reads and writes role-to-model settings.
/poteto-mode command Turns Poteto Mode on or off for the session.
/setup-pstack command Picks a model for each role.

Each child of the subagent tool is a separate pi --mode json --print --no-session process. The parent receives only the child's final answer. The tool takes one task, a tasks array for parallel work, or a chain for sequential work with {previous} interpolation. It accepts up to eight tasks per call and runs at most four at once. Children are local and fresh. Pi has no resume API.

The agents/ folder holds two bundled agents:

  • poteto-agent is a bounded implementation or investigation delegate. It reads the full poteto-mode skill before it starts.
  • comment-sicko reviews comments only.

The subagent tool also reads user agents from ~/.pi/agent/agents/*.md. It reads project agents from .pi/agents/*.md only with agentScope: "project" or "both", and asks before it runs them.

The skills/ folder holds 52 skills. To count them, run ls skills | wc -l. They include poteto-mode with its playbooks, 24 principle-* skills, and workflow skills such as architect, arena, interrogate, swarm, reflect, how, why, sharpen, and statechart. Run /skill:poteto-help for a guided tour.

Safety model

pstack agents run shell commands, so this package keeps two separate guards.

The extension checks each bash call against a fixed list of risky commands:

  • git push
  • gh pr create, edit, merge, or close
  • gt submit, merge, or create
  • terraform or tofu apply or destroy
  • kubectl apply, delete, or rollout
  • vercel, flyctl, or railway deploy or promote
  • rm with a recursive flag

In an interactive session, Pi asks you to allow or decline each match. In a non-interactive run, such as a subagent child or pi --print, the extension blocks the command. A command that the list does not recognize runs without a prompt, so treat this as a guardrail and not a sandbox.

The skills add a second rule. An agent must get your explicit confirmation before any external or irreversible action. That includes pushes, force-pushes, PR creation or updates, CI triggers, merges, deployments, data deletion, and customer messages. Phrases such as "don't stop" or "run until done" never waive it. Upstream pstack 0.15.42 lets agents do external actions such as team chat, ticket updates, and evals without asking, and pauses only for irreversible writes. This port asks for both.

Statechart prerequisites

The statechart skill checks a TLA+ model with TLC and draws a Mermaid chart. It needs:

  • Node 22.18 or later, Bun, or Deno to run skills/statechart/scripts/statechart.ts.
  • Java 11 or later and TLC.

There are two ways to provide Java and TLC:

  • Set TLA2TOOLS to the path of tla2tools.jar. Set JAVA to a Java binary, or put java on your PATH.
  • Install mise. On its first run, the script installs TLC and Java through mise, which needs network access.

The skill tells agents not to install mise, Java, or TLC without your approval. Without either setup, the skill reports the blocker.

Node does not strip TypeScript types for files under node_modules, and Pi installs npm packages there. The scripts/statechart wrapper therefore copies the TypeScript sources to ~/.cache/pi-pstack/statechart-<checksum>, or under $XDG_CACHE_HOME when set, and runs the copy. The checksum comes from the file contents, so each package update makes a new copy. You can delete old copies at any time.

Model roles

Each role names a kind of delegated work. The extension knows these 13 roles:

  • feature, refactoring
  • bug-fix
  • perf-issue
  • hillclimb
  • judgment and prose
  • hardest tasks
  • reflect tooling
  • reflect judgment, divergent, synthesizer
  • arena runners
  • arena cross-judge pool
  • swarm workers
  • architect runners
  • interrogate reviewers

Every role defaults to inherit-parent, so a child uses the model of the parent session. The package works with no setup. If ~/.pi/agent/pstack/models.json is missing or invalid, every role inherits.

To set roles interactively, run /setup-pstack. It lists the models your Pi session can use and saves one model per role. To give a panel role such as interrogate reviewers a list of models, ask the agent to call pstack_config with action: "set" and a models array. Each entry in the list is one subagent. The file uses Pi provider/model selectors:

{
	"version": 1,
	"roles": {
		"hardest tasks": "provider/model",
		"interrogate reviewers": ["provider/model-a", "provider/model-b"]
	}
}

The file is per machine. Run /setup-pstack again when your models or provider access change.

Cursor-to-Pi mapping

The port replaces Cursor-only behavior with Pi equivalents:

Cursor pstack Pi port
Task and subagent_type subagent tool and Markdown agent definitions
Cursor model slugs and rules /setup-pstack, pstack_config, and Pi provider/model selectors
sticky mode: true session-persisted /poteto-mode extension command
Cursor todo list pstack_todo tool
Cursor transcript directories $PI_SESSION_FILE and pstack_sessions
/loop, cloud-agent resume explicit project watchers, with local and fresh child Pi processes
cloud swarm workers and cloud_base_branch local Pi workers in bounded batches, with a worktree as the task cwd
Cursor Team Kit skills capability detection and project-native verification tooling

The helper scripts in skills/poteto-mode/scripts/ keep their upstream runtime, and their tests use Bun. The PR workflows in the skills need an authenticated gh.

What's not included

These upstream skills are left out. upstream.json lists them.

Upstream skill Reason
make-bot-ui Describes a Cursor-only bot UI
ketchup-video Renders a slide video, which a terminal cannot play inline. /skill:ketchup gives the same content as text
correct, in-your-own-words, reframe Not ported yet
create-formal-verification-skill, maintain-formal-verification-skill Not ported yet. The setup-pstack formal-verification offer that depends on them is left out too

The port also leaves out Cursor's default model names and their migrations, and the Orchestrate playbook, which upstream removed in 0.15.43. Program-scale work routes to figure-it-out.

Update from upstream pstack

CHANGELOG.md lists every user-facing change, and docs/upstream-sync/ records each sync in detail.

upstream.json records the upstream commit and version this package matches, the upstream skills it leaves out, and what it does not port. To move to a newer upstream commit:

  1. Stage the upstream changes:

    npm run sync:upstream -- --ref <sha>
    
  2. Resolve each conflict by the rules in scripts/sync/PORT-CONTRACT.md. Port the meaning of each upstream change, and keep the Pi confirmation rules and subagent limits.

  3. Run the tests:

    npm test
    
  4. Record the sync:

    npm run sync:upstream -- --finalize --ref <sha>
    
  5. Add a record to docs/upstream-sync/ and an entry to CHANGELOG.md.

Develop and release

Install the dev dependencies, then run the tests:

npm install
npm test

The tests load Pi from node_modules/@earendil-works/pi-coding-agent. To test against another Pi install, set PI_PACKAGE_ROOT to its package directory.

npm test runs three suites:

  • test:package loads every skill with Pi's skill loader and checks links, model roles, the confirmation gates, and the contents of npm pack.
  • test:extension runs the subagent tool against a simulated child process. It makes no model requests.
  • test:statechart runs the upstream statechart tests. Tests that need a real TLC are skipped unless TLA2TOOLS is set.

npm run test:helpers runs the watch-pr and check-plan tests and needs Bun.

To release:

  1. Raise version in package.json.
  2. Add a ## [x.y.z] - YYYY-MM-DD section to CHANGELOG.md. Pi matches these headings against the installed version.
  3. Commit, then push a tag such as v0.2.1.

A tag that starts with v starts the publish workflow in .github/workflows/. It publishes to npm with the NPM_TOKEN repository secret. prepublishOnly runs npm test before each publish.

The pi-package keyword in package.json lists the package in the Pi package gallery.

Provenance and license

The package is MIT licensed. See LICENSE.