pstack 作者 @poteto 公开了这个 Cursor 官方内置插件的工程原则设计思路,核心是随模型能力提升,把写给智能体的冗长步骤压缩为简短的命名原则。
pstack 作者公开她的 “工程原则” 设计思路
「Clean Code」作者 Uncle Bob 是传统软件工程方法论的宗师,他最近看到了 pstack,认为本质上是把经典工程智慧「最小改动、先删后加、验证根因、用类型系统让非法状态不可表示、幂等操作」重新编码给 AI Agent 使用。
pstack 作者 @poteto 回应并公开了这个 Cursor 官方内置插件的工程原则的设计思路,核心是:随着模型能力提升,写给智能体的指令正在从“冗长的操作步骤”压缩为“简短的命名原则”。
几个关键信息点
1. 原则即极简 skill。pstack 的每条工程原则只有约 10–20 行,是一段被提炼、命名过的好实践,而不是一个流程脚本。她预期随着模型变强,pstack 里大部分 skill 最终都会被压缩成这样的短原则或工作流,从而可以删掉一批。
2. /poteto-mode 的运行机制。智能体在开始多步任务前先读一份简短的原则索引;执行过程中,必须“点名每一条影响了决策的原则,以及它具体改变了哪个选择”,并在回复末尾生成一个 "Principles Named or Used" 段落。这个设计很巧妙:如果原则被引用却没有对应的实际决策,就说明智能体只是在“报菜名”而没有真正应用;强制原则与决策挂钩,让推理过程可检验。
3. 原则来自真实纠错。这些原则大多来自她今年在会话中亲自纠正智能体的场景,属于“教训的结构化沉淀”。
4. 原则可被唤起。每条原则都能以 /principle-<名称> 的形式作为 skill 调用;更常用法是用名字来“掌舵”;因为名字背后指向智能体已经读过的完整规则,一个短语比一段指令更能精准地重定向工作。比如对着一堆旧适配器说 "subtract before you add",智能体就知道先删过时的、再设计剩下的。
perhaps one of the most durable parts of pstack are its engineering principles: very concise skills (~10-20 loc) that distill down good practices into its core. as models get smarter, i expect most of pstack skills to compress into short principles or workflows (a generic list of steps) and that i will be able to delete a few of them. how it works is that /poteto-mode contains a short index of available principles and tells agents "In your reply, name each principle that shaped a decision and the specific choice it changed." this is why you'll often see a Principles Named or Used section at the end of the agent's response many of these principles were extracted from my sessions correcting agents since the start of this year. some are inspired by problems i see people talk about, like Attack the Premise, inspired by @VictorTaelin's post https://x.com/VictorTaelin/status/2096273196412498057 you can also use the principles as skills if you want greater control, by invoking /principle-<name> https://github.com/cursor/plugins/blob/main/pstack/docs/guide/08-principles.md在 X 查看被引用的帖子
来源:meng shao · x.com