产品多源确认

pstack 作者公开工程原则设计思路:写给智能体的指令正在压缩为命名原则

精选理由

Cursor 内置插件 pstack 的作者亲自讲设计:把纠正智能体的教训写成 10-20 行短原则,还强制智能体交代每条原则改变了哪个决策,方法很实用。

pstack 作者 @poteto 公开了这个 Cursor 官方内置插件的工程原则设计思路。每条原则约 10–20 行,是从好实践中提炼的命名短原则,而非流程脚本。/poteto-mode 要求智能体在回复末尾列出 Principles Named or Used,点名每条影响决策的原则及其改变了哪个选择,避免智能体只引用原则而不实际应用。这些原则来自她今年纠正智能体的真实会话,也可通过 /principle-<名称> 作为 skill 单独调用。

原文 · shao__meng

pstack 作者公开她的 “工程原则” 设计思路 「Clean Code」作者 Uncle Bob 是传统软件工程方法论的宗师,他最近看到了 pstack,认为本质上是把经典工程智慧「最小改动、先删后加、验证根因、用类型系统让非法状态不可表示、幂等操作」重新编码给 AI Agent 使用。 pstack 作者 @poteto 回应并公开了这个 Cursor 官方内置插件的工程原则的设计思路,核心是:随着模型能力提升,写给智能体的指令正在从“冗长的操作步骤”压缩为“简短的命名原则”。 # 几个关键信息点 1. 原则即极简 skill。pstack 的每条工程原则只有约 10–20 行,是一段被提炼、命名过的好实践,而不是一个流程脚本。她预期随着模型变强,pstack 里大部分 skill 最终都会被压缩成这样的短原则或工作流,从而可以删掉一批。 2. /poteto-mode 的运行机制。智能体在开始多步任务前先读一份简短的原则索引;执行过程中,必须“点名每一条影响了决策的原则,以及它具体改变了哪个选择”,并在回复末尾生成一个 &quot;Principles Named or Used&quot; 段落。这个设计很巧妙:如果原则被引用却没有对应的实际决策,就说明智能体只是在“报菜名”而没有真正应用;强制原则与决策挂钩,让推理过程可检验。 3. 原则来自真实纠错。这些原则大多来自她今年在会话中亲自纠正智能体的场景,属于“教训的结构化沉淀”。 4. 原则可被唤起。每条原则都能以 /principle-&lt;名称&gt; 的形式作为 skill 调用;更常用法是用名字来“掌舵”;因为名字背后指向智能体已经读过的完整规则,一个短语比一段指令更能精准地重定向工作。比如对着一堆旧适配器说 &quot;subtract before you add&quot;,智能体就知道先删过时的、再设计剩下的。 lauren @poteto 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 &quot;In your reply, name each principle that shaped a decision and the specific choice it changed.&quot; this is why you&#39;ll often see a Principles Named or Used section at the end of the agent&#39;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 &#39;s post x.com/VictorTaelin/s… you can also use the principles as skills if you want greater control, by invoking /principle-&lt;name&gt; github.com/cursor/plugins… 🔗 View Quoted Tweet 💬 0 🔄 0 ❤️ 0 👀 66 ⚡