Oyam Notes

Pstack Insights

I recently discovered a plugin for coding agents called pstack, developed by Lauren "Poteto" Tan. Its purpose is to automate software development without sacrificing too much quality. It's a big set of skills (a few dozen) of various kinds: one-off commands, principles, workflows, etc., collected by Poteto over time, and the collection keeps growing.

I decided to study it to pick up ideas to apply in my own work with coding agents — this post is an overview of the insights I found interesting.

Naturally, the plugin is fitted to the author's own workflows, but the core principles behind it must be generally valuable.

The plugin's sources are available on Cursor's GitHub, though it's not restricted only to Cursor.

How such a plugin is developed

The methodology for growing your own agentic skill set is to turn the agent's failures into skills. Over time the agents will literally grow on you and earn enough of your trust to take on jobs more autonomously.

I never set out to build pstack, my personal set of skills for rigorous engineering with agents. I just started turning every recurring failure mode into a skill

— Loops You Can Trust on X

Skills won't be perfect from the start, and as your work and methods evolve, the skills will need evolving too. pstack offers a /reflect skill that scans the transcript for issues that surfaced and turns them into persistent fixes:

name: reflect
description: >-
  Spawn three parallel review subagents over the active transcript,
  surface learnings, and route each to a concrete edit on an existing
  skill. Use when the user says reflect.

For skills that contain project knowledge, pstack suggests explicit maintenance to ensure that the knowledge stays up to date with the project's state. This idea is encoded in the /maintain-verification-skill skill.

Apps change, and feature maps go out of date. Run this at least once a day, ideally from a scheduled automation so nobody has to remember.

— Verify the result and open a PR in the pstack guide.

The author also advises verifying experimentally whether a skill update improves the agent's behavior. The Eval playbook describes how such an experiment can be run: several agents are spawned and given a test task, with a judge agent rating them afterwards. The playbook puts special effort into "blinding" the agents (making sure they don't get the idea that they are being tested):

  • No eval, test, judge, experiment, rubric, score, compare, benchmark, candidate, or arena in any directory, file, or prompt the candidate sees.
  • [...]
  • Don't tell the candidate other candidates exist.
  • [...]

— Eval playbook

Off topic, but I find it funny that these are the problems software development has come to deal with: deceiving the computer like a child.

Principles

"Principles" in pstack are skills that encode the author's values. They are supposed to steer the model preemptively (e.g. when another skill mentions a relevant principle to adhere to) or actively (when you bring them up in the chat yourself to point the model in the right direction).

Each principle is a small skill with a self-descriptive title and a few clarifications in the text. At the time of writing, the plugin lists 24 of them.

Some noteworthy principles, in my opinion:

  • Laziness Protocol: Prefer the smallest change that solves the problem.

  • Subtract Before You Add: Remove complexity and simplify first, then build.

  • Minimize Reader Load: Count layers between question and answer, and hidden state in the reader's head. Collapse one-caller wrappers and shrink mutable scope. (I want to try applying this in my own work more thoroughly because Claude likes to break the logic apart and tuck pieces into distant locations.)

  • Experience First: Choose user delight over implementation convenience; ship fewer polished features over more rough ones.

    A beautiful idea that I haven't thought about.

    The user in question isn't necessarily the end user of the UI; it can also be the developer consuming our API if that's what we're working on.

  • Model the Domain: Encode the real domain in a data structure instead of scattering it across conditionals. A structure that matches the domain makes invalid states unrepresentable and deletes branches.

    The skill's text lists specific recipes for domain modeling and when to apply them, like state machines and discriminated unions.

  • Boundary Discipline: Place validation, type narrowing, and error handling at system boundaries. Trust internal code unconditionally.

  • Type System Discipline: Make the compiler reject impossible states, mismatched primitives, and unhandled variants.

  • Fix Root Causes: Trace each symptom back to the first place the system went wrong and fix it there.

  • Test Behavior, Not Implementation: Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change.

  • Encode Lessons in Structure: Encode the rule as a lint, metadata flag, runtime check, or script instead of writing more instructions. Instructions can be missed, but automated checks can be enforced.

    This principle is accompanied by the /correct skill, which makes the agent find the mistakes agents keep repeating in the repo and encode the lessons in code.

Make it restate the problem

Don't trust the agent to have understood the problem. Make it restate the problem to ensure you're on the same page before it starts working:

/poteto-mode read this thread.
restate the underlying issue in your own words, in plain english.
don't change any code yet.

A misreading shows up in the restatement, before any code exists. Correct it there, and it costs you one message instead of one wrong fix.

— Route work through /poteto-mode in the pstack guide.

And don't give it hints about possible causes before it has restated the problem, because suggestions narrow its search.

A stated guess narrows the search to wherever you pointed. Let the agent restate the problem before you share your hunch.

— Route work through /poteto-mode in the pstack guide.

Decision log

For unattended sessions, make the agent keep a "decision log" where it records the decisions it made without you. The log can later be used to catch up on the agent's progress and to audit its work.

From /show-me-your-work:

name: show-me-your-work
description: >-
  Keep a reviewable decision trail for long-running or unattended work:
  a TSV log with one row per decision (what, why, evidence, result).
  Local by default; commit it when a reviewer needs the trail to trust
  the result. Use for /show-me-your-work, autonomous or multi-phase
  runs, or work a human reviews after stepping away.

Context recall

If you need the agent to restore context that was lost in one or several older sessions, you can use the /recall skill, which searches the old transcripts:

/recall catch me up on the export work from last week

/recall 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. Your old chats hold context that a fresh agent lacks, so start new work on an old topic by loading it first, then hand over the new input.

— Understand the code before changing it in the pstack guide.

I found this idea extremely useful for cases when an issue arises in a task completed some time ago. With my own modified version of /recall, I can restore an agent's knowledge of the completed work before starting a follow-up task or an investigation.

The same idea — mining transcripts for context — is applied in pstack's Session pickup playbook. This is a more specific scenario, where a fresh agent takes over a task from an older agent session:

The Session pickup playbook 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.

— Understand the code before changing it in the pstack guide.

High-level design before implementation

Drafting a high-level design before diving into details is not a new idea, but pstack contains ready-made recipes to reuse and learn from, like the /architect skill:

Sketch types, function signatures, class shapes, and module boundaries with not implemented bodies and pseudocode. Synthesize across multiple model perspectives, then fill in code against the chosen sketch.

— /architect skill

This skill also tasks different model families with the design, then judges the results and picks the best ones, which is neat if you like aggregating ideas from unrelated models for the best output.

In the same spirit, the plugin's guide suggests making the agent write tutorials for a new API before implementing it.

Writing the tutorial first forces the caller's view. You describe the API to a hypothetical user and work back to the implementation. The doc also becomes a concrete target the agent checks its own work against.

— Design before you write code in the pstack guide.

I especially like the "Redesign From First Principles" principle in the context of design. It encourages the agent to rethink the existing design so that a new feature is integrated organically, as if it had existed from day one, instead of being slapped on top of everything.

The "Foundational Thinking" principle also encourages the agent to approach problems from above by deciding on the data shape and concurrent data sharing first.

Implement several prototypes before choosing

Prototypes are cheap, so you can quickly try several things before committing to one. Moreover, prototyping can be fanned out to models of different families to get different takes.

The /arena skill encodes the flow of fanning out the same work to several agents and rating their results:

/arena 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.

— Design before you write code in the pstack guide.

Strip comments

pstack takes a hostile stance against code comments left by AI, which I'm inclined to sympathize with. More often than not, AI comments inflate the line count, create noise for readers and pollute the context of the next agent.

The plugin provides a subagent type called "Comment Sicko" specifically to erase comments from code:

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.

Only these exceptions get to crawl away.

  • Legal or license headers.
  • 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.
  • // prettier-ignore. Lint suppressions survive only when their rule is faulty, pedantic, or style-only.
  • Doc comments that define a public API contract.
  • Issue or RFC links that explain a constraint code cannot express.

That list is my only leash. When I am not sure a keep clause applies, the comment dies. Everything else is meat.

— Comment Sicko

Estimate blast radius

The plugin ships a skill called /blast-radius that estimates how likely a change is to break something else. The skill sends the agent off to investigate the change, find its risks and attempt to prove its safety, reporting the results back.

For a small diff you don't fully trust, /blast-radius finds what it could break elsewhere. It finds the one fact that makes the change safe and proves that fact by running code, not by arguing for it.

— Verify the result and open a PR in the pstack guide.

I like this because it can make quick shipping safer. The risks that the agent uncovers can either be reduced before shipping (by redesigning risky parts or testing them extra carefully) or accounted for in post-deployment verification (by planning to watch for signs of breakage in risky places).

Writing

The plugin comes with a whole set of skills related to writing. They might be useful to you if you're dissatisfied with how your model writes. I won't review them in detail here, but I will list them.

Unslop:

Edit text to remove AI patterns. Scan for the patterns below, then rewrite. Preserve meaning and match the intended tone.

Technical writing:

Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax.

/bro:

Restate your last message. Stop using jargon and speak coherently. State it more simply and concisely, like one human talking to another.

"Writing the reply" section in /poteto-mode:

  • Short declarative sentences. One thought per sentence, ended with a period.
  • No long-dash character anywhere. Write a file-list bullet as a sentence ("main.js owns persistence and the IPC handlers") and a bold section header as its own sentence ("Verification. End to end via CDP").

Hillclimb playbook

Show the agent how to measure a metric and it will be able to iteratively optimize the code for it. This is what the Hillclimb playbook is about: the agent makes a hypothesis, tests it and, if it improves the metric, keeps it; otherwise it moves on. It does this again and again until it meets the criterion you have set.

I think this is a wonderful application of coding agents, which have infinite patience for menial tasks, though I suspect code quality will suffer as a side effect of such tunnel-visioned optimization.

Performance issue mantras

A neat little cheat sheet for performance optimization in user-facing applications:

Try the performance mantras in order, cheapest first:

  1. Don't do it. Stop work whose result nothing uses rather than cheapening it.
  2. Do it, but don't do it again.
  3. Do it less.
  4. Do it later.
  5. Do it when they're not looking.
  6. Do it concurrently.
  7. Do it cheaper.

— Perf Issue playbook

Code review

The skill for AI code review in this plugin is called /interrogate. It spawns subagents of different model families and combines their findings.

The prompt for each subagent is built from a template. The findings are categorized by severity: critical, warning or nit.

The skill has an explicit list of quality criteria called the rubric, which covers things like obvious errors, unnecessary workarounds, broken abstractions and level boundaries, test coverage, security flaws and so on.

The reviewer agents are also encouraged to ambitiously rethink the implementation to find ways to improve the quality of the solution under review.

The master agent is instructed how to treat the subagents' findings: filter out nitpicks, verify findings, reject suggestions of premature abstractions, and evaluate each finding's importance.

Keep the skill set minimal

This isn't an insight from pstack but my own thoughts on the plugin's setup as a whole.

Boris Cherny suggests deleting your skills, hooks, etc. every six months, because models improve and the add-ons you created to cover the flaws of the model at the time might not be needed anymore.

I think some of pstack's prompts might already be obsolete in this way, at least if you judge by the latest Claude Opus.

  • The Never Block on the Human principle seems redundant. Claude is already fairly eager to work on its own, so your autonomy preference can be declared in a single line in CLAUDE.md.

    Same with Prove It Works: for me, Claude always reaches for whatever empirical verification methods it has access to.

  • The /how and /why skills micromanage the agent by teaching it how to do an investigation. I think a modern model should be capable of picking the right strategy on its own.

  • No is an acceptable answer. Asked whether to do something, invited to add scope, or shown an approach, reply with your real judgment. Decline, push back, or say "this doesn't earn its place" when true. A recommendation is a judgment, not a validation. Agreement is not the default, candor over sycophancy.

    — /poteto-mode skill

    Sycophancy is also a model flaw that is being, or will be, fixed with time, so this part of /poteto-mode may become unnecessary too.

This is not so much a criticism of pstack as a reminder for myself not to overgrow my own agentic skill set, but rather to keep it small and open to model improvements. Overly strict instructions might restrict a future model instead of letting it apply its creative potential and teach me something new about the application of AI. This field is still hot and no more than a few years old. It might be too soon to commit to particular processes while we still don't know what AI is capable of.