Getting started
Eleven short lessons to discover pstack, in order. Read them in one go or jump to the one you need.
Lesson 1
pstack is a toolbox with three kinds of pieces
Before the flows, meet the pieces. There are three kinds, and each has a different job.
Skill
A specific tool the agent knows how to use. You call it with /name, for example /why. A skill does one thing.
Playbook (recipe)
A step-by-step recipe for one kind of task: fix a bug, add a feature... A recipe calls skills at certain steps.
Principle
A short judgment rule. It does nothing on its own. Recipes use it to decide, for example “delete before you add”.
Lesson 2
You talk to one front door: /poteto-mode
You don't need to remember every skill. You describe your task to /poteto-mode, and it picks the recipe for you.
- 1
You
You write your request in plain words, for example “the export button doesn't work”.
- 2
/poteto-mode
It restates your goal, then recognizes the kind of task. Here, it's a bug.
- 3
A recipe
It opens the matching recipe, here Bug fix, and copies its steps into its task list.
Bug fix - 4
Some skills
At each step, the recipe calls the skills it needs. You can also call a skill yourself, without going through the door.
/verify-<app>/why/architect
Type this
Lesson 3
The skill used everywhere: /verify-<app>
Almost every recipe ends by proving the work on the real app. That needs a skill that can drive your app. You create it once.
- 1
Create
/create-verification-skill reads your repo and generates a verification skill for your project, which holds a CLI to drive the app and a feature map (one file per feature).
/create-verification-skill - 2
Use
The resulting skill, for example /verify-terms-era, starts the app and clicks through it like a person.
/verify-<app> - 3
Everywhere
Bug fix, Feature, Refactoring, Prototype, Perf and Shipping call it to check their work.
Bug fixFeatureRefactoringShipping - 4
Maintain
When the app changes, /maintain-verification-skill brings the skill and feature map up to date.
/maintain-verification-skill
Type this
Lesson 4
A feature map is your app's user guide, written for the agent
To prove its work, the agent has to know where each feature of your app lives and how to reach it. That's the job of the feature map: a folder of Markdown files, one per feature, stored next to the verification skill.
What you get: a skill, with a CLI and a feature map
SKILL.mdHow to start the app, check it's healthy, drive it and store the proof.
scripts/control-notesOne command that starts the app, drives it and captures proof, the same way every time.
features/Where each feature lives, how to reach it and how to prove it works.
.cursor/skills/verify-notes/scripts/control-notes← the CLIfeatures/← the feature mapWhere does control-notes come from?
In the example, the app is called Notes and it's made up. control-notes is the CLI of its verification skill: it's what the feature map files call at every step.
In her talk, the author explains that a verification skill has two parts. First, a CLI stored in the skill folder, so every agent starts the app and collects proof the same way, instead of writing a new script each session. Second, the feature map, which tells the agent where each feature lives.
/create-verification-skill doesn't say "CLI" word for word. It first reuses what your repo already has (Playwright, a PTY harness, curl), then requires every script shipped with the skill to be executable and documented, in the Helpers section. That script is your CLI. For generic CLIs, pstack points to control-cli and control-ui, shipped in another plugin, cursor-team-kit.
The skill's files
| name | verify-notes |
|---|---|
| description | Launch Notes, drive its browser UI and notes CLI the way a user does, and capture proof. Use before claiming a Notes change works, or to reproduce a Notes bug report. |
Verify Notes
Drive the real Notes app through control-notes, the CLI that ships in this skill. Read features/README.md first, then the feature file that matches the change.
Launch
- Run
scripts/control-notes launch. It setsNOTES_DATA_DIR=/tmp/notes-verify-$RUN_ID, applies migrations, seedsQuarterly planandGrocery list, and starts Notes athttp://127.0.0.1:4173. - Ready means usable: the
All notesheading is visible and both seeded notes are listed. A port that answers is not enough. - Put
scripts/onPATHsocontrol-notesand thenotesCLI resolve. - Teardown is
control-notes stop. See Cleanup.
Doctor
- Run
control-notes doctorbefore driving, and again whenever something looks off. - It is read-only. It checks that the process is up, the port is owned by this run, the build revision matches the checkout, and the data directory is the disposable one.
- If doctor fails, fix the instance or report it. Do not drive it.
Drive
- Browser actions:
control-notes browser <click|fill|press|snapshot|screenshot>with--roleand--name. - Terminal actions:
control-notes cli -- notes <command>. - Use ARIA roles, accessible names and prompt strings. Never coordinates or tab order.
- The exact steps for each feature live in
features/<feature>.md.
Evidence
- Save artifacts under
artifacts/<feature-id>/, named after the entry point used. - Exercise the real user path. No internal setters or test-only endpoints.
- Capture the action and the resulting state, not only the final screen.
- Check side effects too: reopen a saved note from a second view, read the CLI exit code.
Cleanup
- Run
control-notes stop. It stops only the instance this run launched, never by process name. - Remove
NOTES_DATA_DIR. Keepartifacts/: the proof must survive the teardown.
Helpers
scripts/control-notesis executable. Runcontrol-notes --helpto list every subcommand.
Notes verification map
This directory is the maintained source for verifying the user-facing behavior of Notes. Read the index before driving the app, then use the matching feature file as the recipe.
Baseline preconditions
- Launch Notes at
http://127.0.0.1:4173with a disposable data directory. - Set
NOTES_DATA_DIR=/tmp/notes-verify-$RUN_IDso concurrent runs do not share state. - Seed notes titled
Quarterly planandGrocery list. - Put
control-notesand thenotesCLI onPATH. - Run
control-notes doctorand require the expected URL, data directory, and build revision. - Never drive an instance that was not started by this verification run.
Driving conventions
- Start every recipe from the baseline state unless its preconditions say otherwise.
- Prefer ARIA roles and accessible names over CSS selectors or DOM position.
- Treat every command as literal. Keep quoted names and flags unchanged.
- Run browser actions through
control-notes browser. - Run terminal actions through
control-notes cli -- <command>. - Restore seeded data after a mutation. Do not remove proof artifacts during cleanup.
Proof and skip reporting
- Capture the user action and the resulting state, not only the final screen.
- UI proof includes an ARIA snapshot and a screenshot with the app identity visible.
- CLI proof includes the command, stdout, stderr, and exit code.
- Mutation proof includes a read-only second view of the stored value.
- Record the feature ID and entry point used with every artifact.
- Report an unreachable path with the attempted command and the unmet precondition.
- Do not report a skipped entry point as verified through a different path.
Feature entry contract
Each feature file starts with an H1 title and one paragraph describing the user-visible behavior. It then uses exactly four H2 sections in this order.
Sub-featureslists short IDs with one line for each behavior.How to get to it (user POV)lists every user entry point.Driving it with <harness>starts withPreconditions:and uses labeled bullets that pair each user action with an exact command and observable result.Gotchaslists traps that can waste or invalidate a verification run.
Keep implementation details out of the map. Name only user paths, stable handles, required state, commands, and observable proof.
Features
- covers browser and CLI creation, cancellation, persistence, and cleanup.
- covers toolbar, keyboard, and CLI search with matching, empty, and clear states.
Create a note
Create note lets a user save a titled note from the browser or CLI, cancel an unfinished draft, and confirm the saved note from a second user-facing view.
Sub-features
create-openopens a blank editor from each browser entry point.create-savepersists a title and body.create-canceldiscards an unfinished browser draft.create-clicreates the same note shape from the terminal.
How to get to it (user POV)
- Choose the
New notebutton in the browser toolbar. - Press
nin the browser while focus is outside an editable field. - Run
notes create --title <title> --body <body>in a terminal.
Driving it with control-notes
Preconditions:
- Notes is healthy at
http://127.0.0.1:4173. - No note is titled
Release checklist. control-notes doctorreports the expected URL and disposable data directory.
- Open editor. Choose
New note. Runcontrol-notes browser click --role button --name "New note". A form namedNote editorappears with focus in theTitletextbox. - Enter content. Type the title and body. Run
control-notes browser fill --role textbox --name "Title" --value "Release checklist"andcontrol-notes browser fill --role textbox --name "Body" --value "Tag and publish". TheSave notebutton becomes enabled. - Save note. Choose
Save note. Runcontrol-notes browser click --role button --name "Save note". A status namedNote savedappears and the heading readsRelease checklist. - Confirm persistence. Return to the note list and reopen the note. Run
control-notes browser click --role link --name "All notes"andcontrol-notes browser click --role link --name "Release checklist". The editor shows both saved values. - Cancel draft. Open a new note, enter
Discard me, and chooseCancel. Runcontrol-notes browser click --role button --name "New note",control-notes browser fill --role textbox --name "Title" --value "Discard me", andcontrol-notes browser click --role button --name "Cancel". The note list returns and has noDiscard melink. - CLI entry. Create a second note. Run
control-notes cli -- notes create --title "CLI note" --body "Created from terminal" --format json. Exit code0and stdout contain the new note ID and title. - Proof. Reopen both saved notes from
All notes. Runcontrol-notes browser snapshot --aria --path artifacts/create-note/list.aria.txtandcontrol-notes browser screenshot --path artifacts/create-note/list.png. The artifacts showRelease checklistandCLI note.
Gotchas
- Pressing
nwhile a textbox has focus types the character instead of opening a new editor. - Titles are trimmed on save. Assert the rendered title, not the draft input value.
- A save status alone is insufficient proof. Reopen the note from the list.
- Remove
Release checklistandCLI noteduring fixture cleanup, but retain their proof artifacts.
Search notes
Search lets a user find notes by title or body text, inspect a matching note, and distinguish no matches from an unavailable search.
Sub-features
search-openopens search from each supported browser entry point.search-matchreturns title and body matches without changing note data.search-open-resultopens a result in the note editor.search-emptyshows a complete empty state for a query with no matches.search-clearremoves the query and restores the recent-notes view.search-clireturns the same matching notes from the terminal.
How to get to it (user POV)
- Choose the
Searchbutton in the browser toolbar. - Press
/in the browser while focus is outside an editable field. - Run
notes search <query>in a terminal.
Driving it with control-notes
Preconditions:
- Notes is healthy at
http://127.0.0.1:4173. - The disposable data directory contains
Quarterly planwith body textDraft budget. control-notes doctorreports the expected URL and data directory.
- Toolbar entry. Choose the
Searchbutton. Runcontrol-notes browser click --role button --name "Search". A dialog namedSearch notesappears with focus in its searchbox. - Keyboard entry. Close the dialog, focus the page, and press
/. Runcontrol-notes browser press --key "/". The same dialog appears and the page does not insert a slash. - Title match. Type
quarterly. Runcontrol-notes browser fill --role searchbox --name "Search notes" --value "quarterly". TheSearch resultslist containsQuarterly planand does not containGrocery list. - Body match. Replace the query with
budget. Runcontrol-notes browser fill --role searchbox --name "Search notes" --value "budget". The resultQuarterly planremains visible with a body-match excerpt. - Open result. Choose
Quarterly plan. Runcontrol-notes browser click --role link --name "Quarterly plan". The dialog closes and the editor heading readsQuarterly plan. - Empty state. Reopen search and enter
volcano. Runcontrol-notes browser fill --role searchbox --name "Search notes" --value "volcano". A status namedNo matching notesappears after search completes. - Clear query. Choose
Clear search. Runcontrol-notes browser click --role button --name "Clear search". The searchbox is empty and theRecent notesregion replaces the result list. - CLI match. Search from the terminal. Run
control-notes cli -- notes search "quarterly" --format json. Exit code0and stdout contain one object whose title isQuarterly plan. - CLI miss. Search for an absent value. Run
control-notes cli -- notes search "volcano" --format json. Exit code0and stdout are[]. - Proof. Capture the populated result state. Run
control-notes browser snapshot --aria --path artifacts/search/results.aria.txtandcontrol-notes browser screenshot --path artifacts/search/results.png. Both artifacts identify Notes, the query, andQuarterly plan.
Gotchas
- Pressing
/while the editor or searchbox has focus inserts text instead of opening search. - Results update after a short debounce. Wait for the results list or empty status, not a fixed sleep.
- Archived notes are excluded unless the user enables
Include archived. - The CLI defaults to human-readable output. Use
--format jsonfor stable assertions. - Opening a result changes browser state. Reopen search before proving another query.
Lesson 5
Flow 1: fixing a bug
The rule of this recipe: never fix what you haven't seen break. Follow the steps one by one.
- 1
Reproduce
The agent makes the bug happen itself in the real app. It doesn't ask you to do it.
/verify-<app> - 2
Find the cause
It rules out hypotheses one by one with evidence (logs, git history), instead of guessing.
/why - 3
Delegate the fix
If the fix spans several functions, it sketches the shape first. Then a sub-agent writes the code.
/architect/poteto-agent - 4
Verify
It replays the exact same path in the app. The bug must be gone.
/verify-<app> - 5
Test first
In git history, the failing test comes before the fix. Only when a simple test exists.
/tdd - 6
Open the PR
The closing recipe, the same for everyone. Lesson 8 covers it.
Opening a PR
Type this
Lesson 6
Flow 2: adding a feature
Here the main agent owns the design and delegates the coding. It acts like a tech lead.
- 1
Understand the area
It reads the code the feature will touch.
- 2
Sketch the shape
Types, functions, modules: it sketches two options and keeps the simpler one.
/architect - 3
Delegate the code
A sub-agent writes the code. If several shapes are valid, it runs arena to compare them, which costs more.
/poteto-agent/arena - 4
Verify
It tests the feature in the real app.
/verify-<app> - 5
Challenge
Only if the design is debatable: agents try to break the code.
/interrogate - 6
Open the PR
Same closing recipe as for a bug.
Opening a PR
Type this
Lesson 7
Three more recipes, same logic
You now know the pattern: prepare, do, prove, open the PR. These three recipes follow it too, each with a twist.
Refactoring
Change the structure without changing behavior. The twist: first freeze the behavior with a test, and keep it green at every step.
Perf issue
Fix slowness. The twist: one measurement before, one after, and a check that the measurement is reliable.
Prototype
Pick between designs. The twist: the code is throwaway, the result is a decision. Then you move on to the Feature recipe.
Lesson 8
A PR's life, from open to merge
Three recipes in a row. Remember one rule: whoever wrote the code never approves their own work.
- 1
Opening a PR
Small clean commits, cleanup of code and comments, a short description with fixed headings. The PR opens ready, never as a draft.
/deslop/no-comments/technical-writing - 2
Babysit
Watches the PR. Fixed order: conflicts first, then review comments, then CI. Never merges.
Babysit - 3
Shipping
A fresh agent tests each PR in the real app. Only approved PRs get merged, from the bottom of the stack up.
verifier agent/verify-<app>
Type this
Lesson 9
The skills that launch many agents
Some skills launch several agents at once. They give better results but cost a lot of tokens. Recipes call them only when it's worth it.
arena: compare
3 agents do the same thing, a judge compares them, the best one wins and borrows the others' good ideas.
swarm: split up
A big job cut into pieces, one agent per piece, then a single report.
interrogate: attack
Agents try to break your change. A problem only counts if a command proves it.
The catch
architect looks light, but it calls arena when the design is big. So a simple feature can get expensive without warning.
Lesson 10
Letting the agent work while you sleep
The key to working without you: say upfront what “done” means, so the agent knows when to stop.
- 1
Define “done”
A checkable condition, for example “tests pass and the bug no longer reproduces”.
- 2
Loop
The agent wakes itself up, makes the smallest useful change, checks, keeps or reverts. A plateau is not a reason to stop.
/loop - 3
Log everything
One line per decision with its evidence. Another model reads the log and flags what needs your attention.
/show-me-your-work - 4
Catch you up
When you're back, a short summary of what changed and which decisions wait for you.
/ketchup/recall - 5
XXL version
Autopilot does the same for a whole queue of PRs, one agent per PR. It's the most expensive part of pstack.
Autopilot
Type this
Lesson 11
Cheat sheet: when you want X, type Y
Everything you've seen, summed up. Keep this screen handy.
/poteto-mode <ta demande>/how /why /teach/poteto-mode <symptôme>. repro first/poteto-mode add <comportement>/poteto-mode refactor <code>, zero behavior change/poteto-mode prototype options for <x>/interrogate/poteto-mode open the pr → babysit → land the stack/poteto-mode im going to bed… /loop until done/ketchup /recall/figure-it-out/correct /reflect