Glean 拾遗
日刊 /2026-11-09 / 别写抽象计划:pstack 用代码做规划与架构

别写抽象计划:pstack 用代码做规划与架构

原文 x.com 收录 2026-11-09 15:21 阅读 20 min
AI 解读

poteto 的 pstack 指南第二篇讲 agent 工作流的前半段:研究、规划、原型与架构。她认为 agent 的两类常见失败来自意图表述不足与上下文缺失,因此先用「间接提示」让 agent 用自己的话复述问题,再用 /how、/why、/recall、/teach 补齐运行时机制与历史动机。规划环节她反对写抽象计划文档,改为 README 先行、写教程倒推 API,并用 /prototype 在真实代码里跑多套方案、截图对比。/architect 会并行启动多个模型家族的候选设计,交给异模型交叉评审;实现阶段一旦发现类型需要 any 或强制转换,就推倒重来。适合已让 agent 写生产代码、又被「计划看着厚实却无实质」困扰的工程师。

原文 20 分钟
原文 x.com ↗
§ 1

The Complete Guide to pstack Pt. 2

The Complete Guide to pstack Pt. 2

§ 2

In my last post, I showed you why verification is the foundation of everything I do with agents, and how to get started creating your own verification skills. The key lesson was that if an agent can't verify its own work, nothing else matters. You remain the bottleneck, and your whole day will be spent babysitting your agents.

But once you have verification working, the next question is: how do you actually figure out what to build?

In this post, I am going to walk you through how I do research, planning, prototyping, and architecture with pstack. This is the exact workflow that allows me to ship thousands of PRs a month into production while keeping code quality extraordinarily high.

上一篇里,我讲了为什么验证是我所有 agent 工作流的基础,以及如何开始创建自己的验证 skill。关键一课是:如果 agent 不能验证自己的工作,其他一切都无从谈起。你仍然是瓶颈,整天都得盯着 agent。

但验证跑通之后,下一个问题就是:到底该怎么判断要建什么?

这篇文章里,我会带你走一遍我如何用 pstack 做调研、规划、原型和架构。正是这套工作流,让我每月能把成千上万个 PR 送进生产环境,同时把代码质量维持在极高水准。

§ 3

§ 4

Back in the old days of 2024, to make any change in a system, you first needed to read enough of it to build a mental model of what's going on. Depending on the size and complexity of the codebase, this may have taken you anywhere from hours, to even days and months. With a small change, you could get away with maybe only a local understanding of a small subsystem. If you were refactoring the core however, you'd probably need to have a mental model of how the whole thing works in order to do the refactor correctly and effectively.

回到 2024 年那会儿,想在系统里做任何改动,你首先得读足够多的代码,在脑子里建起一套正在发生什么的心智模型。取决于代码库的规模和复杂度,这可能要花几小时,甚至几天、几个月。如果只是小改动,也许了解某个小子系统就够了;但如果你在重构核心,大概率得先理解整个系统怎么运转,才能做得正确、有效。

§ 5

Agents obviously remove this barrier. You can make changes to systems very easily by just prompting your agent and it will do it, regardless of how much or little you know about the code. But keeping the quality of the code and user experience high is still difficult, especially if you're not already a domain expert who knows what to look for and ask.

Even though frontier models have gotten very capable, there are still 2 failure modes that I constantly observe:

  1. They are unable to fully understand your intent because they're under/poorly specified.
  2. They don't have enough context on how to do the work correctly. Both of these problems are related. Using agents well comes down to how well you're able to prime the agent's context window with high quality context. You can certainly write code that works without doing this, but I find that the outcomes and quality are much better when I've done the work to provide my agents with everything they need to do a high quality job.

agent 显然把这个门槛拆掉了。你只要给 agent 一个提示,它就能改动系统,不管你对代码了解多少。但要把代码质量和用户体验维持在高位仍然很难,尤其当你还不是领域专家、不知道要看什么、该问什么的时候。

即便前沿模型已经非常能干,我仍然经常看到两种失败模式:

  1. 它们无法完全理解你的意图,因为意图说明不足或质量太差。
  2. 它们没有足够上下文,不知道怎样才能把活干对。 这两个问题彼此相关。用好 agent,归根结底取决于你能多好地给它的上下文窗口喂高质量上下文。不做这件事,你当然也能写出能跑的代码,但我发现,当我花功夫把高质量工作所需的一切交给 agent 时,结果和质量会好得多。
§ 6

Frontier models are very capable coders. While with older models I might have prompted very specifically what I wanted it to do, almost micromanaging them, the latest models are able to write code better than you or I can. So there's a fine balance I want to strike with telling the agent what I want it to achieve, while giving it the freedom to solve it in ways I might not have thought of.

This is the art of supervising someone smarter than you, on a codebase you haven't written yourself, and where humans can no longer fit the entire mental model of the codebase in their head.

前沿模型是非常强的程序员。用旧模型时,我可能会非常具体地告诉它要做什么,几乎是在微管理;而最新模型写代码的能力已经超过你我。所以我想拿捏一个平衡:告诉 agent 我要它达成什么,同时给它自由,让它用我没想到的方式解决。

这就是监督一个比你更聪明的人的艺术——而且是在一个不是你写的代码库上,人类已经无法把整个代码库的心智模型装进脑子里。

§ 7

One technique I like to use is the indirect prompt. Instead of telling the agent exactly what I want, I try to draw it out of the agent instead - in its own words.

For example, when someone reports an issue in Slack, I will often ask the agent to read the thread and restate the problem in its own words before doing anything else.

For example, I might say:

/poteto-mode read this slack thread. restate in your own words and in plain english what you think the underlying issue is

This accomplishes three things:

First, it forces the agent to compress a noisy conversation into a structured problem statement. Second, it lets me catch misunderstandings immediately. If the agent fixates on a red herring in the thread, I can correct it quickly before it starts writing any code.

And third, I haven't potentially led it down the wrong path by stating my own assumptions and hypotheses which could be incorrect or limit what the agent could otherwise achieve.

我最喜欢用的一个技巧是间接提示。与其精确告诉 agent 我想要什么,不如试着让它自己说出来——用它的语言。

比如,有人在 Slack 里报了一个问题,我通常会先让 agent 读整个 thread,然后用自己的话复述问题,再做别的事。

比如我会说:

/poteto-mode read this slack thread. restate in your own words and in plain english what you think the underlying issue is

这能做到三件事:

第一,它逼着 agent 把一段嘈杂的对话压缩成结构清晰的问题陈述。第二,我能立刻发现误解。如果 agent 盯上了 thread 里的红鲱鱼,我可以在它开始写代码之前迅速纠正。

第三,我没有用自己的假设和猜想把它带偏——这些假设可能是错的,也可能限制 agent 本来能达成的结果。

§ 8

Asking the agent to restate itself in a way that you can understand is an important part of working with someone that is smarter than you. That was the inspiration for /teach, a skill that helps your agent explain things to you in an intuitive way. I use it whenever I need to make sure my agent is doing something that makes sense to me.

Under the hood, /teach calls out to /how and /why.

/how traces runtime mechanics. When you ask /how, the agent assesses the complexity of the subsystem. If the subsystem spans multiple directories or services, it spawns parallel explorer agents on fast, efficient models like Grok.

/how is virtualization implemented?

/why investigates motivation and intent. Code tells you what happens. It rarely tells you why someone wrote it that way. When you run /why, pstack queries historical evidence across multiple sources in parallel: Git history and PR review comments, Linear tickets, Notion design docs, Slack conversations, Datadog monitors, Sentry errors, code lineage, and analytics warehouse events.

/why are we still stuck an old version of node.js?

让 agent 用你能听懂的方式复述,是和一个比你更聪明的人共事时很重要的一环。这也是 /teach 的灵感来源:这个 skill 帮 agent 用直观的方式向你解释事情。每当我需要确认 agent 做的事对我来说说得通,就会用它。

底层上,/teach 会调用 /how 和 /why。

/how 追踪运行时机制。当你问 /how 时,agent 会评估子系统的复杂度。如果这个子系统横跨多个目录或服务,它会在 Grok 这类快速、高效的模型上并行启动多个探索 agent。

/how is virtualization implemented?

/why 调查动机和意图。代码告诉你发生了什么,却很少告诉你为什么有人那样写。运行 /why 时,pstack 会并行查询多个来源里的历史证据:Git 历史和 PR 评审评论、Linear 工单、Notion 设计文档、Slack 对话、Datadog 监控、Sentry 错误、代码谱系,以及分析仓库里的事件。

/why are we still stuck an old version of node.js?

§ 9

§ 10

I use /teach whenever I want the agent to restate something so I can better understand and trust its work.

/teach me why you implemented it this way and not <other way>. what were the tradeoffs you made and why?

In practice, I have also found that the research done by the /teach skill is not just useful to humans, but for agents as well. Even with the latest frontier models, (this also depends on the quality of the harness), in general I find that they still often state things confidently without backing it up with data or actually reading the code needed to build up a mental model of how it works. So this act of teaching you what it's going to do and why ends up helping the agent too.

每当我希望 agent 复述某件事,好让我更好地理解并信任它的工作,我就会用 /teach。

/teach me why you implemented it this way and not <other way>. what were the tradeoffs you made and why?

在实践中我还发现,/teach 这个 skill 做的研究不仅对人有用,对 agent 也有用。即便用最新前沿模型(这也取决于 harness 的质量),我总体发现它们仍然经常自信地陈述结论,却不用数据支撑,也没有真的去读理解运行机制所需的代码。所以,让 agent 教你它要做什么、为什么这么做,最终也会帮到 agent 自己。

§ 11

Many of my projects span multiple conversations. For example, a few months ago I was working on fixing virtualization bugs and perf issues that people were reporting in Cursor. I realized that every time I started a new chat I had to basically start over with building up the rich context my agent had before when it was solving a similar problem.

What I realized is that your past transcripts are often a gold mine for rich context. pstack ships with the /recall skill to pull your recent context from chat history, so even fresh agents have the right context they need to get back to a good state.

/recall the work i did yesterday on virtualization and then read this bug report on slack

Using /teach, /recall, /how, and /why are how I keep my own mental models of the codebase up to date, compressed into a form I can easily understand and remember. And, it helps agents too!

我的很多项目会跨多次对话。比如几个月前,我在修 Cursor 用户反馈的虚拟化 bug 和性能问题。我意识到,每次开新 chat,我都得从头帮 agent 重建之前解决类似问题时已有的丰富上下文。

后来我发现,你过去的对话记录往往是丰富上下文的金矿。pstack 自带 /recall skill,能从聊天历史里拉出最近的上下文,这样即便是全新的 agent,也能拿到回到良好状态所需的正确上下文。

/recall the work i did yesterday on virtualization and then read this bug report on slack

我用 /teach、/recall、/how 和 /why 来让自己对代码库的心智模型保持最新,并压缩成容易理解和记住的形式。而且,它也能帮到 agent!

§ 12

§ 13

Once you understand the problem, how do you specify the solution?

In my opinion, most harnesses that have plan modes tend to over-specify implementation details and under-specify everything else. That's why in pstack, I cheekily said that "I don't believe in planning". The truth is that I do plan, but I do so through code.

For certain kinds of work, like creating shared code or packages that others will use, I am a big believer in readme driven development. If you're not familiar with it, it's a technique of development that was popular back in the day, where you start with crafting your readme first. This forced you to put on your developer experience hat, where you start with describing the APIs to a hypothetical user, and work backwards to the implementation and architecture.

For example, when I was building Dune, our in-house client framework for desktop apps, I started by first writing a tutorial for it, so I could understand what it would be like to build an app with it. Or at least I tried to. It was real a struggle getting the agent to produce anything good or readable. So I had to first spend some time sharpening my knife, by creating the /technical-writing skill.

The first pass of the readme without the /technical-writing skill was painful to read because it mixed up different goals. It tried to be a tutorial, a how-to guide, an architectural explanation, and an API reference all in the same document, written with your usual AI slop and mannered prose.

一旦理解了问题,该怎么指定解决方案?

在我看来,大多数带 plan mode 的 harness 往往过度指定实现细节,却把其他一切都说明不足。所以在 pstack 里,我半开玩笑地说过“我不相信规划”。事实是,我确实做规划,只是通过代码来规划。

对某类工作,比如创建别人会使用的共享代码或 package,我非常信奉 readme 驱动开发。如果你不熟悉,这是一种当年流行的开发方法:先写 readme。它会逼你戴上开发者体验的帽子,从向一个假想用户描述 API 开始,再倒推实现和架构。

比如我打造 Dune——我们内部用于桌面应用的客户端框架——时,先从写一篇教程开始,这样我就能理解用它构建应用会是什么体验。至少我试过。想让 agent 产出任何好用、可读的东西,真的很难。所以我只好先花时间磨刀,创建了 /technical-writing skill。

没有 /technical-writing skill 的第一版 readme 读起来很痛苦,因为它把不同目标混在了一起。它想同时当教程、操作指南、架构说明和 API 参考,还带着那种典型的 AI 味和做作文风。

§ 14

§ 15

/technical-writing uses the Diátaxis framework to separate documentation into four distinct modes:

  1. Tutorial: Learning by doing. A lesson that leads a newcomer through a series of steps to build something visible.
  2. How-to guide: Steps to solve a specific, real-world problem for an experienced user.
  3. Reference: Dry, complete, authoritative technical descriptions of machinery, APIs, and configuration flags.
  4. Explanation: High-level discussion that clarifies and illuminates background, design choices, and tradeoffs. It also uses /unslop, so it produces documentation that is very readable.

/technical-writing 使用 Diátaxis 框架,把文档拆成四种不同模式:

  1. 教程:边做边学。用一系列步骤带新手做出一个可见的东西。
  2. 操作指南:为有经验的用户解决某个具体现实问题。
  3. 参考:对机制、API 和配置项做枯燥、完整、权威的技术描述。
  4. 解释:高层讨论,讲清背景、设计选择和权衡。 它还会用 /unslop,所以产出的文档非常可读。
§ 16

Writing a plan this way is very helpful because it also gives your agents a concrete target and goal that it can check its own work against. And of course, it's also much easier to understand what exactly the agent is going to build.

Many of pstack's skills compound here in the design phase. For example:

(1) /recall my work fixing virtualization bugs and perf issues from the past 7 days. use /how and /why to understand how our current virtualization implementation works.

(2) then use /poteto-mode planning and /technical-writing to come up with a new virtualization engine that categorically eliminates flickering and jittering. let's start by writing a tutorial on how i would use this new package to virtualize a React app

(3) after you write the plan, /teach me and prove to me why this new approach is superior to our current engine

这样写计划很有帮助,因为它同时给了 agent 一个具体目标和靶子,让它能拿自己的工作去对照检查。当然,也更容易让人理解 agent 到底要建什么。

pstack 的很多 skill 会在设计阶段叠加发挥作用。比如:

(1) /recall my work fixing virtualization bugs and perf issues from the past 7 days. use /how and /why to understand how our current virtualization implementation works.

(2) then use /poteto-mode planning and /technical-writing to come up with a new virtualization engine that categorically eliminates flickering and jittering. let's start by writing a tutorial on how i would use this new package to virtualize a React app

(3) after you write the plan, /teach me and prove to me why this new approach is superior to our current engine

§ 17

The technique here is really about drawing out interesting and rich context that gives your agents the ability to see the problem the same way you do - not just as a small slice:

  1. The first part of the prompt recalls relevant past and present context about how virtualization is implemented in my app.
  2. The second part guides the agent to use that context, such as bugs it has fixed before, to come up with a new design that eliminates those problems entirely.
  3. The final piece is asking your agent to prove to you that this new package is superior. This is where high quality tools like verification skills are important to have.

这里的技巧,本质上是把有意思、丰富的上下文拉出来,让 agent 能像你一样看问题——而不是只看到一小块:

  1. 提示的第一部分,回忆我的应用里虚拟化如何实现的过去与现在相关上下文。
  2. 第二部分引导 agent 利用这些上下文,比如它以前修过的 bug,设计一个能彻底消除这些问题的新方案。
  3. 最后一块,是让 agent 向你证明这个新 package 更优。这里就需要验证 skill 这类高质量工具。
§ 18

§ 19

When planning, two of the most common mistakes I see are:

  1. Accepting the agent's first design.
  2. Overcooking the plan without empirical evidence. When humans wrote code, we often collaborated with each other over design documents. These were docs that talked about high level architecture, alternatives considered, tradeoffs, and any unusual implementation notes. It was very common to go through multiple iterations of these docs before you landed on a settled design.

With agents, while we can skip the ceremony of the design doc, I often see the mistake of accepting the first thing the agent gives back to you. With pstack, we can instead take the "measure twice, cut once" approach to its limit, using parallel agents.

做规划时,我见到最常见的两个错误是:

  1. 接受 agent 的第一版设计。
  2. 没有实证就把计划过度打磨。 人类写代码时,我们经常围绕设计文档协作。那些文档会讨论高层架构、考虑过的替代方案、权衡,以及任何不寻常的实现备注。在定下设计之前,这些文档经历多轮迭代非常常见。

用 agent 时,我们可以跳过设计文档的仪式,但我经常看到另一个错误:agent 给你什么,你就接受什么。用 pstack,我们可以反过来把“量两次,剪一次”推到极限,用并行 agent 来做。

§ 20

We do this by using the prototyping playbook.

In pstack, playbooks aren't skills, but reference files inside of /poteto-mode. These playbooks are conditionally loaded (for token efficiency) depending on the type of task you're working on. These 23 playbooks (as of 0.15.0) each contain a workflow that I use when I'm doing a task.

Unlike skills, playbooks are automatically used by the agent as part of /poteto-mode. For example:

/poteto-mode prototype a few options for the new dropdown menu /poteto-mode fix this bug /poteto-mode eval this skill change

我们靠 prototyping playbook 来做到这一点。

在 pstack 里,playbook 不是 skill,而是 /poteto-mode 内部的参考文件。这些 playbook 会根据你正在做的任务类型有条件加载(为了省 token)。截至 0.15.0,这 23 个 playbook 每个都包含我做某类任务时用的工作流。

和 skill 不同,playbook 会由 agent 作为 /poteto-mode 的一部分自动使用。比如:

/poteto-mode prototype a few options for the new dropdown menu /poteto-mode fix this bug /poteto-mode eval this skill change

§ 21

Prototyping is one of my favorite pstack playbooks. It gives you many attempts at a goal and helps the agent reason about the best option. This is useful not just for visual prototyping, but also prototyping different solutions for features, bug fixes, and so on.

/poteto-mode prototype a few options for <feature request>. use /control-app* and take videos/screenshots for me to review and choose from

  • note: /control-app is the verification skill we created in Part 1

When prototyping visual changes, the agent builds throwaway sketches in your app or in a scratch directory. If it is testing a UI interaction, it puts two or three variations behind a simple switcher. Then it drives the interaction with the /control-app skill, takes screenshots of each variant, and measures the actual timing or layout.

Prototyping is planning, but with code. It allows agents the freedom to explore the problem space, and to give them a chance to surprise you with something you wouldn't have thought of yourself. Prototypes allow agents to answer their own questions with empirical evidence instead of waiting for my input.

原型是我最喜欢的 pstack playbook 之一。它让你对同一个目标做多次尝试,帮 agent 推理出最佳选项。这不仅对视觉原型有用,对功能、bug 修复等不同方案的打样也同样有用。

/poteto-mode prototype a few options for <feature request>. use /control-app* and take videos/screenshots for me to review and choose from

  • 注:/control-app 是我们在第一部分创建的验证 skill

做视觉改动的原型时,agent 会在你的应用里或一个临时目录里搭一次性草图。如果它在测试某个 UI 交互,会把两三个变体放在一个简单切换器后面。然后它用 /control-app skill 驱动交互,给每个变体截图,并测量实际时序或布局。

原型就是规划,只不过是用代码来规划。它让 agent 自由探索问题空间,也有机会用你本人想不到的东西给你惊喜。原型让 agent 用经验证据回答自己的问题,而不是等我输入。

§ 22

As an engineer in the agentic era, it's more important to spend my time on architecture, choosing the right data structures, and thinking about how the systems I build will work together. My agents fill in the implementation details.

作为 agent 时代的工程师,更重要的是把时间花在架构、选对数据结构,以及思考我构建的系统如何协同工作上。实现细节交给我的 agent 去填。

§ 23

§ 24

Another useful skill that pstack ships with is /architect. It structures design into distinct, disciplined phases:

  1. Ground the problem. The agent runs /how and /why over the affected systems to build an accurate mental model of existing ownership and constraints.
  2. Sketch. The agent enters an architecture arena. It spawns independent candidate runners in parallel, often across different model families. Each runner receives the grounding brief and drafts a complete design package: the caller's usage sketch, the core type definitions, public function signatures, and a concise rationale. These are usually done by sketching out just the type signatures, that derive from how we want call sites to look like. Each runner must evaluate interface depth, examine failure modes on weak models, and screen against our catalog of design red flags.

pstack 还自带另一个有用的 skill:/architect。它把设计拆成几个清晰、有纪律的阶段:

  1. 打地基。agent 对受影响的系统运行 /how 和 /why,建立对现有归属关系和约束的准确心智模型。
  2. 画草图。agent 进入架构竞技场。它会并行启动独立的候选 runner,通常横跨不同模型家族。每个 runner 收到打地基简报,并起草一份完整设计包:调用方的使用草图、核心类型定义、公开函数签名,以及简明理由。这些通常只通过画类型签名来完成,而类型签名又来自我们希望调用点长什么样。每个 runner 都必须评估接口深度、检查在弱模型上的失败模式,并用我们的设计红旗清单做筛查。
§ 25
  1. Cross-judge and Synthesize. A cross-judge agent using a different model than the main agent evaluates the candidates against a strict rubric.
  2. Implement against the sketch. The agent replaces the sketch's placeholder bodies with real logic. If the agent discovers during implementation that a function needs unexpected parameters or extra state, it surfaces the discrepancy.
  3. Scrap when the design is wrong. If during implementation we find that the sketches were wrong, the agent throws it all away and starts over. The point here is to give the agent a self contained mini-loop where it can synthesize multiple competing designs from different model families into one optimal approach, and take care to be rigorous and not be afraid to throw its design away if it turns out that the architecture it came up with is wrong based on empirical proof. If the same workaround appears across unrelated call sites, or if the types require escape hatches like 𝚊𝚗𝚢 or forced casts, that is empirical proof that the architecture is wrong.

/architect this new <feature request>

  1. 交叉评审并综合。一个使用不同模型的 cross-judge agent 会按严格评分标准评估候选方案。
  2. 按草图实现。agent 用真实逻辑替换草图里的占位函数体。如果实现过程中发现某个函数需要意料之外的参数或额外状态,它会把这种不一致暴露出来。
  3. 设计错了就丢掉。如果实现过程中发现草图是错的,agent 会把整套东西扔掉,从头再来。 这里的重点,是给 agent 一个自包含的小循环:它能从不同模型家族的多个竞争设计里综合出一条最优路径,并且保持严谨,不怕在设计被经验证明错误时把它扔掉。如果同一个 workaround 出现在互不相关的调用点,或者类型需要 𝚊𝚗𝚢 或强制类型转换这类逃生舱,那就是架构错误的经验证据。

/architect this new <feature request>

§ 26

The big lesson here is that it's far more effective to plan with code using /poteto-mode prototyping and /architect.

It's also why I never bother with reviewing abstract plans adversarially. The agents start hallucinating theoretical risks, and inventing complex edge cases to protect against problems that will never happen. Don't overcook your plans when they're still abstract: let the agent answer open questions on its own through prototyping and verifying its own work.

这里最大的教训是:用 /poteto-mode prototyping 和 /architect 通过代码做规划,要有效得多。

这也是为什么我从不去对抗式地评审抽象计划。agent 会开始幻觉出理论风险,发明复杂边缘情况,去防范永远不会发生的问题。计划还停留在抽象阶段时,别过度打磨:让 agent 通过原型和验证自己的工作,自己回答开放问题。

§ 27

§ 28

While pstack doesn't come with a planning skill, it does ship with a multi-phase planning playbook. I typically use this after the agent has come up with a design I'm happy with, as a way to create a tactical execution plan.

/poteto-mode turn this design into a plan

Every single task in the plan is structured around proof and verification. The playbook tells agents that tests alone are not sufficient verification. It's verified only when it has actually run the code and verified that it works.

pstack 虽然没有 planning skill,但自带一个多阶段 planning playbook。我通常会在 agent 给出一个我满意的设计之后用它,来生成战术执行计划。

/poteto-mode turn this design into a plan

计划里的每一个任务都围绕证明和验证来组织。playbook 会告诉 agent:光有测试不足以完成验证。只有真正跑过代码并确认它能工作,才算验证通过。

§ 29

Every plan is checked by an automated script that validates its structure and formatting. Once approved, the plan executes item by item. Each PR is small, self-contained, and easily reviewed.

For really large projects (like one that might take me a whole week), I may sometimes decide to commit the plans temporarily to the codebase so that other agents are aware of the work in progress. But I typically delete them when I'm done so I don't leave the codebase in a state of confusion. I don't find it valuable to keep plans around permanently.

每份计划都会由一个自动脚本检查,验证其结构和格式。批准之后,计划逐项执行。每个 PR 都很小、自包含、容易评审。

对于真正大的项目(比如可能花我一整周的那种),我有时会决定把计划临时提交到代码库里,让其他 agent 知道有工作正在进行。但我通常做完就删掉,免得把代码库留在混乱状态。我不觉得长期保留计划有什么价值。

§ 30

To see how all of these pieces fit together, let us walk through three concrete examples of how I prompt these workflows.

为了看清这些部件如何拼在一起,我们走一遍几个具体例子,看看我是怎么给这些工作流写提示的。

§ 31

When an issue appears in production and the root cause is unclear:

/poteto-mode investigate why background workers periodically fail with timeout errors. give me a breakdown of what we know, what data you used, and your best hypotheses.

The agent explores the code, checks metrics and historical commits in parallel, and gives you its best educated guesses on where the problem might lie.

当生产环境出问题、根因又不清楚时:

/poteto-mode investigate why background workers periodically fail with timeout errors. give me a breakdown of what we know, what data you used, and your best hypotheses.

agent 会探索代码,并行检查指标和历史提交,然后给出它对问题可能在哪里的最佳推测。

§ 32

When introducing a new subsystem that other modules will depend on:

/poteto-mode we need to add rate limiting for external webhooks. /architect this first, and answer any open questions with prototypes. let me review before proceeding.

The agent grounds the existing webhook architecture, spins up competing design runners across multiple models, benchmarks with throwaway prototypes, and produces a clean, verified interface.

当引入一个会被其他模块依赖的新子系统时:

/poteto-mode we need to add rate limiting for external webhooks. /architect this first, and answer any open questions with prototypes. let me review before proceeding.

agent 会先摸清现有 webhook 架构,跨多个模型启动竞争性设计 runner,用一次性原型做基准测试,最后产出一个干净、经过验证的接口。

§ 33

When executing a complex refactor across many files:

/poteto-mode create a plan to migrate our entire UI library to StyleX. break the migration into small, verifiable PRs. each PR must have its visual regression tests and live verification steps. i want the final result to be 100% identical compared to the original - bugs included

The agent breaks the work into independent steps, writes an auditable checklist, and prepares each unit so that it can be built, verified, and landed safely.

当要在很多文件里执行一次复杂重构时:

/poteto-mode create a plan to migrate our entire UI library to StyleX. break the migration into small, verifiable PRs. each PR must have its visual regression tests and live verification steps. i want the final result to be 100% identical compared to the original - bugs included

agent 会把工作拆成独立步骤,写出可审计的清单,并准备好每个单元,让它能被构建、验证并安全落地。

§ 34

If you've ever seen me on Slack in one of our issues or feedback channels, you'll probably have seen these classics:

thread already has sufficient context

/poteto-mode do it

/poteto-mode repro this with /control-app. if it repros on main, fix it and show me a video as proof

Many of the skills I've talked about here are already automatically used by /poteto-mode, so the vast majority of times you can just use /poteto-mode and move on with your life!

如果你在 Slack 的问题或反馈频道见过我,大概见过这些经典操作:

thread already has sufficient context

/poteto-mode do it

/poteto-mode repro this with /control-app. if it repros on main, fix it and show me a video as proof

我在这里聊到的很多 skill 已经由 /poteto-mode 自动使用,所以绝大多数时候,你直接用 /poteto-mode,然后继续过你的日子就行!

§ 35

Plan Mode is often used as a way to convince yourself that the agent is going to do the right thing. But the reality is that abstract plans only give you the illusion of progress. A long and lengthy plan makes it look like you and your agent were very productive, but it's probably lacking in substance.

pstack gives you tools to combine thorough investigation, empirical evidence, and rigorous verification. When you plan this way, engineering with agents stops feeling like a gamble. It becomes predictable and repeatable.

Thanks for reading, and stay tuned for Part 3!

Plan Mode 经常被用来让自己相信 agent 会做对的事。但现实是,抽象计划只给你进步的幻觉。一份又长又详细的计划,看起来像你和 agent 都很有产出,但很可能缺乏实质。

pstack 给你的工具,把彻底调查、经验证据和严格验证结合起来。这样规划时,用 agent 做工程不再像赌博。它变得可预测、可重复。

感谢阅读,第三部分见!

打开原文 ↗