Primeros pasos
Once lecciones cortas para descubrir pstack, en orden. Léelas de un tirón o salta a la que te interese.
Lección 1
pstack es una caja de herramientas con tres tipos de piezas
Antes de los flujos, conoce las piezas. Hay tres tipos, y cada uno tiene una función distinta.
Skill
Una herramienta concreta que el agente sabe usar. Se llama con /nombre, por ejemplo /why. Un skill hace una sola cosa.
Playbook (receta)
Una receta paso a paso para un tipo de tarea: arreglar un bug, añadir una feature... Una receta llama a skills en ciertos pasos.
Principio
Una regla de criterio corta. No hace nada por sí sola. Las recetas la usan para decidir, por ejemplo “borra antes de añadir”.
Lección 2
Hablas con una sola puerta de entrada: /poteto-mode
No necesitas recordar todos los skills. Describes tu tarea a /poteto-mode y él elige la receta por ti.
- 1
Tú
Escribes tu petición con palabras normales, por ejemplo “el botón de exportar no funciona”.
- 2
/poteto-mode
Reformula tu objetivo y reconoce el tipo de tarea. Aquí, es un bug.
- 3
Una receta
Abre la receta correspondiente, aquí Bug fix, y copia sus pasos en su lista de tareas.
Bug fix - 4
Algunos skills
En cada paso, la receta llama a los skills que necesita. También puedes llamar a un skill tú mismo, sin pasar por la puerta.
/verify-<app>/why/architect
Escribe esto
Lección 3
El skill que se usa en todas partes: /verify-<app>
Casi todas las recetas terminan demostrando el trabajo en la app real. Para eso hace falta un skill capaz de manejar tu app. Lo creas una vez.
- 1
Crear
/create-verification-skill lee tu repo y genera para tu proyecto un skill de verificación, que contiene un CLI para manejar la app y una feature map (un archivo por funcionalidad).
/create-verification-skill - 2
Usar
El skill resultante, por ejemplo /verify-terms-era, arranca la app y hace clic en ella como una persona.
/verify-<app> - 3
En todas partes
Bug fix, Feature, Refactoring, Prototype, Perf y Shipping lo llaman para comprobar su trabajo.
Bug fixFeatureRefactoringShipping - 4
Mantener
Cuando la app cambia, /maintain-verification-skill pone al día el skill y el feature map.
/maintain-verification-skill
Escribe esto
Lección 4
Una feature map es el manual de tu app, escrito para el agente
Para demostrar su trabajo, el agente tiene que saber dónde está cada funcionalidad de tu app y cómo llegar a ella. Ese es el papel de la feature map: una carpeta de archivos Markdown, uno por funcionalidad, guardada junto al skill de verificación.
Lo que obtienes: un skill, con un CLI y una feature map
SKILL.mdCómo arrancar la app, comprobar que está sana, manejarla y guardar las pruebas.
scripts/control-notesUn comando que arranca la app, la maneja y captura pruebas, siempre de la misma manera.
features/Dónde está cada funcionalidad, cómo llegar a ella y cómo demostrar que funciona.
.cursor/skills/verify-notes/scripts/control-notes← el CLIfeatures/← la feature map¿De dónde sale control-notes?
En el ejemplo, la app se llama Notes y es imaginaria. control-notes es el CLI de su skill de verificación: es lo que los archivos de la feature map llaman en cada paso.
En su charla, la autora explica que un skill de verificación tiene dos partes. Primero, un CLI guardado en la carpeta del skill, para que cada agente arranque la app y recoja pruebas de la misma manera, en vez de escribir un script nuevo en cada sesión. Después, la feature map, que le dice al agente dónde está cada funcionalidad.
/create-verification-skill no dice «CLI» palabra por palabra. Primero reutiliza lo que tu repo ya tiene (Playwright, un harness PTY, curl) y luego exige que cada script incluido en el skill sea ejecutable y esté documentado, en la sección Helpers. Ese script es tu CLI. Para CLI genéricos, pstack remite a control-cli y control-ui, incluidos en otro plugin, cursor-team-kit.
Los archivos del skill
| 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.
Lección 5
Flujo 1: arreglar un bug
La regla de esta receta: nunca arregles lo que no has visto romperse. Sigue los pasos uno a uno.
- 1
Reproducir
El agente provoca el bug él mismo en la app real. No te pide que lo hagas tú.
/verify-<app> - 2
Encontrar la causa
Descarta hipótesis una a una con evidencia (logs, historial de git), en lugar de adivinar.
/why - 3
Delegar el arreglo
Si el arreglo abarca varias funciones, primero esboza la forma. Luego un subagente escribe el código.
/architect/poteto-agent - 4
Verificar
Repite exactamente el mismo recorrido en la app. El bug tiene que haber desaparecido.
/verify-<app> - 5
Primero el test
En el historial de git, el test que falla va antes del arreglo. Solo cuando existe un test sencillo.
/tdd - 6
Abrir la PR
La receta de cierre, la misma para todos. La lección 8 la explica.
Opening a PR
Escribe esto
Lección 6
Flujo 2: añadir una feature
Aquí el agente principal es dueño del diseño y delega el código. Actúa como un tech lead.
- 1
Entender la zona
Lee el código que va a tocar la feature.
- 2
Esbozar la forma
Tipos, funciones, módulos: esboza dos opciones y se queda con la más simple.
/architect - 3
Delegar el código
Un subagente escribe el código. Si varias formas son válidas, lanza arena para compararlas, lo que cuesta más.
/poteto-agent/arena - 4
Verificar
Prueba la feature en la app real.
/verify-<app> - 5
Desafiar
Solo si el diseño es discutible: unos agentes intentan romper el código.
/interrogate - 6
Abrir la PR
La misma receta de cierre que para un bug.
Opening a PR
Escribe esto
Lección 7
Tres recetas más, la misma lógica
Ya conoces el patrón: preparar, hacer, demostrar, abrir la PR. Estas tres recetas también lo siguen, cada una con un matiz.
Refactoring
Cambiar la estructura sin cambiar el comportamiento. El matiz: primero se fija el comportamiento con un test, que se mantiene en verde en cada paso.
Problema de rendimiento
Arreglar una lentitud. El matiz: una medición antes, otra después, y una comprobación de que la medición es fiable.
Prototype
Elegir entre diseños. El matiz: el código es desechable, el resultado es una decisión. Luego se pasa a la receta Feature.
Lección 8
La vida de una PR, de la apertura al merge
Tres recetas seguidas. Recuerda una regla: quien escribió el código nunca aprueba su propio trabajo.
- 1
Abrir una PR
Commits pequeños y limpios, limpieza de código y comentarios, una descripción corta con secciones fijas. La PR se abre lista, nunca como borrador.
/deslop/no-comments/technical-writing - 2
Babysit
Vigila la PR. Orden fijo: primero los conflictos, luego los comentarios de revisión, luego la CI. Nunca hace merge.
Babysit - 3
Shipping
Un agente nuevo prueba cada PR en la app real. Solo se hace merge de las PRs aprobadas, desde la base de la pila hacia arriba.
agente verificador/verify-<app>
Escribe esto
Lección 9
Los skills que lanzan muchos agentes
Algunos skills lanzan varios agentes a la vez. Dan mejores resultados pero cuestan muchos tokens. Las recetas solo los llaman cuando vale la pena.
arena: comparar
3 agentes hacen lo mismo, un juez los compara, gana el mejor y toma prestadas las buenas ideas de los demás.
swarm: repartir
Un trabajo grande dividido en partes, un agente por parte, y luego un único informe.
interrogate: atacar
Unos agentes intentan romper tu cambio. Un problema solo cuenta si un comando lo demuestra.
La trampa
architect parece ligero, pero llama a arena cuando el diseño es grande. Así que una feature sencilla puede salir cara sin avisar.
Lección 10
Dejar trabajar al agente mientras duermes
La clave para trabajar sin ti: decir de antemano qué significa “terminado”, para que el agente sepa cuándo parar.
- 1
Definir “terminado”
Una condición comprobable, por ejemplo “los tests pasan y el bug ya no se reproduce”.
- 2
Loop
El agente se despierta solo, hace el cambio útil más pequeño, comprueba, conserva o revierte. Una meseta no es motivo para parar.
/loop - 3
Registrarlo todo
Una línea por decisión con su evidencia. Otro modelo lee el log y señala lo que necesita tu atención.
/show-me-your-work - 4
Ponerte al día
Cuando vuelves, un resumen corto de lo que cambió y de las decisiones que te esperan.
/ketchup/recall - 5
Versión XXL
Autopilot hace lo mismo para toda una cola de PRs, un agente por PR. Es la parte más cara de pstack.
Autopilot
Escribe esto
Lección 11
Chuleta: cuando quieras X, escribe Y
Todo lo que has visto, resumido. Ten esta pantalla a mano.
/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