Skip to content
  1. How-to
  2. In real projects
  3. Add a feature without breaking old ones

Add a feature without breaking old ones

In one lineSay what to add and which old behavior must not change. Then have it verify both the new and the old cases.

One or two conversations for a small featureFor: You want to add a feature to a project people already use, without breaking what worksFull guide step 5: Design, build, clean up

Copy this first

The shortest version
/pstack:poteto-mode add a --json flag. text output stays byte-identical. verify both forms.

This is the example from pstack’s own docs. It has three parts:

  1. What you want: a --json flag.
  2. What must not change: the text output. It compares the output before and after. One byte different means it failed.
  3. Verify both: so it doesn’t test only the new JSON and forget the old text.

The hard part is not breaking the old stuff. The new feature works, but the old output quietly changed. Put what must not change in the prompt, and it becomes something it checks.

A Chrome extension example

You want a new setting on the options page: which group the side panel shows when it opens. There was no such setting before. The side panel always showed “All.”

Chrome extension example
/pstack:poteto-mode Add a setting to the options page: which group to show by default when the side panel opens.
Before writing code, tell me how this setting will be stored in chrome.storage.sync.
What must not change: users who never set it still see "All" in the side panel, just like now. All other existing settings read back unchanged.
Verify both cases: a brand-new profile that never set it, and a profile set to the "Work" group.
Show me what's actually in chrome.storage.sync in both cases, plus a screenshot of the side panel when it opens.
  • Say how it’s stored first: you catch problems before any code. Maybe it wants a new key, and you want it inside the existing settings.
  • Users who never set it see no change: they upgrade and touch nothing. That case breaks most easily.
  • Two profiles: one pass-or-fail check for the old case, one for the new.
  • Storage plus a screenshot: a UI that looks right isn’t enough. Check the value that was really saved.

Where to look after you send it

At the start: its restatement and the storage shape. It reads the code first, then says how it plans to store the setting. If that’s wrong, stop it right away.

At the end: evidence for both cases. Two sets of storage contents and screenshots. Anything it can’t verify is marked “inconclusive,” not passed.

See the design before it starts

When a change spans several files, it runs /pstack:architect on its own. By default it starts coding right after the design. To look first, send this:

Stop and show me the design first
/pstack:architect with checkpoint. Stop after the design and show it to me. Don't start until I agree.

Let it open your extension itself

To check the UI, it has to know how to launch your project. If it keeps saying it can’t, run /pstack:create-verification-skill once. It makes a verification skill for your project. See step 6 of the guide.

Stuck?

It changed the old output format along the way.

Reply: “The original text output must not change. Show me the diff of the output before and after. It must be empty.” Next time, say what must not change in your first prompt.

It only verified the new feature, not the old behavior.

Add: “apply prove it works. Run the real command for both cases and paste the output.” prove it works means: show real results that it works. It’s the name of a pstack principle. Type it as is, and it knows what you mean. You get real output, not just “it compiles.”

Does a tiny feature need the whole design process?

Not always. When only one file changes, steps it doesn’t need are marked n/a or skip in the todo list, with a reason. If you disagree with a reason, say so.

It added features I didn't ask for.

Reply: “Only build the one setting I asked for. List your other ideas, but don’t build them.” Extra ideas belong in the reply, not in the code.

An unofficial beginner's guide to pstack, not its official docs. pstack is made by poteto; the official repo is the source of truth for commands and behavior. The original guide source is on GitHub.

Hosted by airali. Adapted from Xiaoxiaodong's MIT-licensed guide.