原文是英文。我删掉了口头填充词、重复和语病,修正了 ASR 听错的专有名词(poteto、Grok Bot、control-glass、pstack、Dune、Bugbot),并补上标点与分段;观点、顺序和细节保持原样。中文是逐段译文,尽量保留她的语气,技术词(agent、skill、lint rule、PR)按原样混用。
真正稀缺的不是速度,是信任
Hi, I'm Lauren. You might know me as poteto on X, and I work on Grok Bot at SpaceX AI.
嗨,我是 Lauren。你可能在 X 上认识我,我叫 poteto。我在 SpaceX AI 做 Grok Bot。
Last month I did something pretty crazy: I shipped a couple thousand pull requests to production. A lot of how I'm able to do this comes down to trust — trusting my agents to produce high-quality work even when I'm not there.
上个月我干了件挺疯的事:往生产环境送了差不多两千个 PR。我能做到这一点,很大程度上靠的是信任——相信我哪怕不在场,agent 也能产出高质量的工作。
My thesis for this talk is simple: if you set up the environment for your agents really, really well, you end up with something that looks more like a personal — or even team-wide — software factory, producing very high-quality code at a much greater rate than before.
我今天想讲的论点很简单:如果你把 agent 的环境搭得足够好,你最终会得到一个更像个人、甚至团队级“软件工厂”的东西,以比过去高得多的速度产出高质量代码。
米其林后厨,而不是软件工厂
But I'm not a fan of the term “software factory.” I like the analogy of a Michelin kitchen much better.
但我不喜欢“软件工厂”这个词。我更喜欢米其林后厨这个比喻。
As technologists, we're not mass-producing a product on an assembly line. The work we do is creative — it's the act of building a product, and in some sense it's art. Even though with agents we're no longer cooking the individual components that go into the product, we're still responsible for the final outcome, and for thinking about how our kitchen is set up.
作为技术人,我们不是在流水线上量产产品。我们做的事是创造性的——它是在构建一个产品,某种意义上也是艺术。即便有了 agent,我们不再亲手烹饪产品里的每个部件,我们仍然要对最终出品负责,也要思考厨房该怎么布置。
Depending on how you set up your line cooks, your sous chefs, the equipment they have, the training they get, the dishwashers, and the ratio of line cooks to dishwashers — all of these ingredients go into making the final product. I think that analogy is really apt.
你如何安排你的流水线厨师、副主厨,他们有什么设备、受过什么训练,洗碗工怎么配、厨师和洗碗工的比例是多少——所有这些“配料”都会进入最终产品。我觉得这个比喻非常贴切。
故事:从 Cursor Agent 窗口的性能泥潭开始
I want to tell a story before we begin. Six months ago, when I first joined Cursor — before we were part of SpaceX AI — I had no agent skills to use. I'd just joined the company; it was a fresh codebase and a fresh product.
开始之前,我想先讲个故事。六个月前我刚加入 Cursor——那时我们还没并入 SpaceX AI——我手上没有任何 agent skills 可用。我刚进公司,面对的是一个全新的代码库和全新的产品。
At the time, Cursor was building the replacement for the Cursor IDE: the new agents window. Before I joined, it had quite a lot of performance issues, and my manager asked if I could help. Since I'd spent some time on the React team before joining Cursor, it seemed like a good fit.
当时 Cursor 正在做 Cursor IDE 的替代品:新的 agents window。在我加入之前,它的性能问题不少,我当时的经理问我能不能帮上忙。因为我加入 Cursor 之前在 React 团队待过,看起来挺合适。
But when I started, I quickly realized how manual the process was. I'd done performance work before, but at the rate pull requests were landing, it felt like an insurmountable wall of PRs that just kept coming in — and I had no idea whether the app's performance would regress.
但真正开始后,我很快意识到这个过程有多手工。我以前做过性能优化,但以当时 PR 落地的速度,那感觉像一堵不断压过来的、无法逾越的 PR 墙,而我根本不知道应用的性能有没有回退。
A lot of my early time on the Cursor team was spent looking at Chrome DevTools, doing performance traces and taking heap snapshots. It was extremely, extremely manual. It got to the point where I was frustrated and started thinking: wait, we have agents. What am I doing?
我早期在 Cursor 团队的大量时间都花在看 Chrome DevTools、做性能 trace、抓堆快照上,极其、极其手工。手工到让我很挫败,开始想:等等,我们明明有 agent,我在干什么?
So I started thinking about verification skills. What if my agent could run the application itself, take the traces for me, understand them, find the hotspots, and basically hill-climb toward better performance automatically?
于是我开始琢磨 verification skills。如果 agent 能自己跑应用、替我抓 trace、读懂 trace、找到热点,然后基本上自动地朝着更好的性能“爬山”,会怎样?
Over the last six months at Cursor and SpaceX AI, my productivity has skyrocketed. I never set out to ship thousands of pull requests a month — that was not a goal at all. But I realized that all the skills, tools, and codebase changes I was making laddered up to this idea of trust.
过去六个月,在 Cursor 和 SpaceX AI,我的生产力可以说是暴涨。我从来没想过要一个月送几千个 PR——那根本不是我的目标。但我意识到,我做的所有 skills、工具和代码库改动,最终都层层叠加成了“信任”这件事。
I had this thought in the back of my head: I am the bottleneck. I need to take all the knowledge I have as an engineer and impart it to my team of agents, so that I don't have to be the blocker for everything. And you can clearly see that it's paid off.
我脑子里一直有个念头:瓶颈是我自己。我需要把作为工程师的所有知识传授给我的 agent 团队,这样我就不必成为所有事情的阻塞点。而结果你也看到了,它奏效了。
信任阶梯:为什么你卡在 1–5 个 agent
So it really comes down to trust. But how exactly do you build that trust, and where do you start?
所以归根结底是信任。但信任到底怎么建立?如果你正在用 agent 的旅途上,无论走到哪一步,该从哪里开始?
When I started, I was in the one-to-five-agent range. You still feel like you have to babysit every chat and conversation, constantly course-correcting, intervening so the agent does the right thing. If you're not there, basically nothing happens — or the agent does the wrong thing.
我刚开始时,显然处在同时用 1 到 5 个 agent 的区间:你仍然觉得每个对话都得盯着,不断纠正方向、介入,好让 agent 做对的事。你不在,基本就什么都不会发生,或者 agent 就做错。
I'd argue this phase is actually the hardest to get out of, because it's not always clear how. Again, it just comes down to trust.
我甚至认为,这个阶段其实是最难走出来的,因为你往往不清楚到底该怎么走出来。再说一次,还是回到信任。
The reason you're unable to go from one-to-five agents to something more like a hundred is that you don't have trust in your agent's work yet. If you don't have trust and you try to spawn a hundred sub-agents or cloud agents, you'll quickly find that you get a ton of slop-filled PRs, a bunch of regressions, and a bunch of bugs shipping. No one's going to be very happy with that.
你没法从 1–5 个 agent 走到一百个,是因为你还不信任 agent 的产出。没有信任却硬开一百个子 agent 或云端 agent,你很快就会发现:一大堆注水的 PR、一堆回归、一堆 bug 被送上线,没人会满意。
验证的光谱:从 control-glass 到形式化方法
How do you trust your agents more? For me, it started when I joined the Cursor team and began working on performance, where I realized the need for verification.
那怎么才能更信任 agent?对我来说,起点是在 Cursor 团队做性能时,我意识到需要“验证”。
Verification has levels. At the lower end are the verification skills I'll talk about: you teach your agent how to run your application, using the Chrome DevTools Protocol or whatever debugging protocol you have, and how to debug, take performance traces, take heap snapshots, and so on.
验证是分层的。在较低的一端,就是我接下来要讲的 verification skills:你教 agent 怎么跑你的应用,用 Chrome DevTools Protocol 或你手头任何调试协议,教它怎么调试、怎么抓性能 trace、怎么抓堆快照,等等。
At the opposite end of the spectrum — much, much harder, and still very much an open question — is formal verification. Maybe you rely on formal methods, or languages like Lean or TLA+, to check that your business-logic invariants always hold, and to formally verify that your application is always in a correct state.
在光谱的另一端——难得多,而且至今仍是个开放问题——是形式化验证:也许你依赖 formal methods,或者 Lean、TLA+ 这类语言,去检查你的业务逻辑不变量始终成立,并形式化地证明应用永远处于正确状态。
But even if you don't have the ability to run formal methods — and very few people really do — verification skills can get you very far.
但即便你没法做形式化方法——真正能做的人很少——光靠 verification skills 也能走很远。
control-glass 的两件套:CLI 与 feature map
When I joined Cursor and started working on the agents window, the first skill I built was called control-glass. It's a verification skill that teaches the agent how to run the application and take traces through the Chrome DevTools Protocol.
我加入 Cursor、开始做 agents window 时,写的第一个 skill 叫 control-glass。它是一个验证 skill,教 agent 怎么跑应用,并通过 Chrome DevTools Protocol 抓 trace。
The interesting thing — and I iterated my way to this; it didn't start out this way — is that a control or verification skill really has two components.
有意思的是——这是我一路迭代出来的,一开始并不是这样——一个 control 或验证 skill 其实有两个组成部分。
The first is a CLI. You want your agents to be able to reproducibly run the application, collect traces, and collect empirical evidence that the code is working and that your performance bar is being met. Rather than having agents create scripts every time — scripts that differ between sessions — you create a CLI inside the skill directory, and your agents use it every time. Of course, you have to invest in it and make it good enough to handle all sorts of use cases and run the application correctly.
第一部分显然是一个 CLI。你希望 agent 能可复现地跑应用、收集 trace、收集经验证据,证明代码能工作、性能门槛达标。与其让 agent 每次都临时写脚本——不同会话写出来的还各不相同——不如在 skill 目录里放一个 CLI,让 agent 每次都用它。当然,你得投入把它做好,能覆盖各种用例,并且能正确地把应用跑起来。
Another thing that's also really important is the idea of a feature map. We started using these control skills at Cursor, and we quickly realized that a Slack report would come in and a user would post a very vague screenshot — a very small slice of the UI and just three question marks. Agents using our control skills had no idea. They could run the application, but they'd just be guessing at what the user meant.
另一个非常重要的东西是 feature map。我们在 Cursor 开始用这些 control skills 后,很快发现:Slack 上会来一条报告,用户贴一张非常模糊的截图——UI 的一小块,外加三个问号。用着 control skills 的 agent 完全没头绪:它能跑应用,但只能猜用户到底指什么。
So I had the idea for a feature map, inspired by a sitemap. It's a form of materialized memory: how exactly does your application work? What features does it have? How does a user reach them — keyboard shortcuts, which DOM elements to click — and what do all those features do? The feature map is stored in the skill itself, in the codebase, as part of the skill directory, and we have an automation that maintains it.
于是我有了 feature map 的想法,灵感大概来自 sitemap。它本质上是一种“物化记忆”:你的应用到底怎么运作?有哪些功能?用户怎么到达这些功能——键盘快捷键是什么、该点哪个 DOM 元素——以及每个功能分别是干什么的?feature map 存在 skill 里,作为 skill 目录的一部分放在代码库中,我们还有一个自动化在维护它。
When we combined the CLI and the feature map, we quickly realized this combination was very powerful. Agents could not only reproducibly control the application and take traces, but also understand requests coming from internal and external users. The control and verification skills became more or less critical infrastructure for our team, and we maintain them constantly.
当 CLI 和 feature map 组合起来,我们很快意识到这个组合非常强大:agent 不仅能可复现地控制应用、抓 trace,还能理解来自内部用户和外部用户的请求。很快,control/verification skills 就成了团队的关键基础设施,我们也一直在维护它。
正确不等于高质量:pstack 与工程习惯
The ability for an agent to verify its own work is extremely powerful, and we've spent a lot of time on that skill. It's very powerful for building trust.
agent 能验证自己的工作,这件事极其强大,我们在这个 skill 上花了很多时间,它对建立信任非常有效。
But verification is really about correctness. Correctness to me is: does the feature or the code do what you want it to do? Does the checkout button actually check out the cart? Verification is important for that because you get empirical evidence that the feature works. But it doesn't tell you much about the performance or the code quality of that feature.
但验证真正解决的是“正确性”。对我来说,正确性就是:这个功能或这段代码,做了你想让它做的事吗?结账按钮真的能结账吗?验证之所以重要,是因为你能拿到功能确实可用的经验证据。但它说明不了这个功能的性能如何、代码质量如何。
That's where you start thinking about skills that teach agents to work like real software engineers.
这就是为什么你开始需要另一类 skills:教 agent 像真正的软件工程师那样工作。
I've built a plugin called pstack. I'm not going to talk about the plugin too much today, but a lot of its inspiration comes from workflows I've used myself across all sorts of tasks — debugging, feature development, prototyping. There's a whole set of playbooks and skills in pstack that teach your agents to write code the way you want them to.
我做了一个插件叫 pstack。今天不细讲这个插件,但它的很多灵感来自我自己做各种任务时用过的工作流——调试、功能开发、做原型。pstack 里有一整套 playbook 和 skill,教你的 agent 按你希望的方式写代码。
This is where the more experienced engineers on your team can really contribute: set up a team repository of skills that makes your agents a lot smarter. Combine those skills with verification skills, and agents can verify not just that the work is correct, but that it's high quality. And because of verification, you can collect real performance metrics — real numbers, statistics, and telemetry on how the application performs. That's a really important part to invest in.
这正是团队里更有经验的工程师可以真正贡献的地方:建立一个团队级的 skill 仓库,让你的 agent 聪明得多。把这些 skill 和 verification skills 结合,agent 就不只能验证工作“正确”,还能验证它“高质量”。而且因为有了验证,你能收集到真实的性能指标——真实的数字、统计和遥测。这部分非常值得投入。
代码库是 agent 最好的记忆
Another thing that's really important is refactoring and rewriting your architecture to be more agent-friendly. I almost want to say this is one of the most important things you can do as a software engineering team: if you truly believe agents are going to write all the code in the future, then we need to design our codebases so that they do the right thing by default.
另一件很重要的事,是把架构重构、重写到对 agent 更友好。我几乎想说,这是一个软件工程团队能做的最重要的事情之一:如果你真的相信未来代码都由 agent 来写,那我们就必须把代码库设计成“默认做对”。
There's a scale or a continuum between the different pieces of building trust. The codebase is really the best form of memory, because agents love to extend existing patterns. I think this is just the nature of how LLMs work: they're more likely to use whatever is in their context window to make changes — and the files the agent reads and opens are part of that context window.
建立对 agent 的信任,这些手段之间存在一个尺度或连续谱。代码库其实是最好的记忆形式,因为 agent 特别喜欢扩展现有模式。我觉得这就是 LLM 的本性:它们更可能使用上下文窗口里的东西来做修改——而 agent 读取、打开的文件正是上下文的一部分。
So the codebase is a really important part of this, because agents aren't going to refactor your code in every single PR. They're going to look at what's already there and extend it.
所以代码库在这件事里非常重要,因为 agent 不会在每个 PR 里都帮你重构代码。它们会看现有代码,然后照着扩展。
The next level is static analysis: linters, compiler diagnostics, continuous integration. These are guidelines and constraints you can enforce in your codebase. When you correct your agent and find that it keeps making the same mistake, you can add a lint rule — or even better, refactor your codebase so that the mistake becomes categorically impossible.
下一层是静态分析:linter、编译器诊断、持续集成。这些是你能在代码库里强制执行的准则和约束。当你纠正 agent,发现它总犯同一个错,你可以加一条 lint rule——更好的做法是重构代码库,让这个错误在结构上不可能发生。
Then, a step above that, you move from hard constraints to guidance: rules, Bugbot, skills. Agents will mostly use them when they're working, but there's a chance they forget to read a rule, or the person piloting the agent ignores them. They aren't quite as enforceable, but they're an important part of setting up an environment you can trust.
再往上,就从硬约束进入了“引导”的范畴:rules、Bugbot、skills。agent 工作时大多会用它们,但也可能因为各种原因忘了读某条 rule,或者操控 agent 的人选择忽略。它们没那么强的可执行性,但仍是搭建可信环境的重要部分。
Finally there's the style guide, which is really only enforceable by humans in code review. You could put some of it into rules, Bugbot, and skills, but if you don't, you have a big glaring hole in your review process: humans have to look at every single changed line and remember to comment — and at the rate pull requests come in, that becomes impossible.
最后是 style guide,它实际上只能靠人在 code review 里执行。你可以把一部分写进 rules、Bugbot 和 skills;但如果不写,你的 review 流程就会有一个巨大的漏洞:人必须逐行看每一处改动,还得记得评论——以 PR 进来的速度,这根本不可能。
I definitely wouldn't recommend relying only on the style guide. It's a good place to start, in terms of seeing what's missing, but you should invest in the other four parts: your codebase, making things categorically impossible through better data structures or algorithms, static analysis, and then layering on rules, Bugbot, and skills.
所以我绝对不建议只依赖 style guide。它可以作为一个起点,用来看还缺什么,但你真正该投入的是另外四层:代码库,通过更好的数据结构或算法让错误在结构上不可能;静态分析;然后再叠加 rules、Bugbot 和 skills。
Dune:把捷径修成唯一正确的路
On the codebase front, in the Grok Bot codebase we've invested in something we call Dune, our agent-friendly framework.
在代码库这条线上,Grok Bot 的代码库投入建设了一个我们叫 Dune 的东西——我们的 agent-friendly 框架。
The inspiration came from a lot of the performance issues we were seeing in the Cursor agents window. A lot of lessons came out of that exploration, but the key principle we landed on is this: agents love taking shortcuts. So what if we design the framework such that the shortcut — the easy path — is the right path for agents?
Dune 的灵感来自我们在 Cursor agents window 里看到的大量性能问题。那次探索得出了很多教训,但我们最终落到的一个核心原则是:agent 特别爱走捷径。那如果我们把框架设计成:捷径——那条好走的路——恰好就是 agent 该走的正确路径呢?
And also a codebase that might be pretty annoying for humans to work in, because it's so locked down in terms of what you can and can't do — but it creates the perfect environment for agents, especially ones that have very minimal context.
而且还要做一个对人类来说可能挺烦的代码库,因为它对“能做什么、不能做什么”锁得非常死——但它为 agent 创造了完美的环境,尤其是那些上下文非常少的 agent。
Not every contributor to your codebase is going to be an engineer anymore. You can have designers, product managers, CEOs going into the codebase and shipping features. So we really need to think about how we invest in and set up our codebases so that even agents piloted by busy people with not a lot of context can do a good job by default.
代码库的贡献者不再一定都是工程师了。你会有设计师、产品经理、CEO 走进代码库,把功能送上线。所以我们必须认真思考如何投入和搭建代码库,让即便由很忙、上下文很少的人操控的 agent,也能默认把事做好。
花园、病毒,以及为什么我们禁掉了注释
Your codebase is a form of memory for agents because they love to extend the existing patterns they see. The reverse is also true: if you have existing anti-patterns, they will spread like a virus.
你的代码库是 agent 的一种记忆,因为它们喜欢扩展现有模式。反过来也成立:如果代码库里已有反模式,它们会像病毒一样传播。
You have one small workaround, or a comment explaining a workaround, and agents love to copy it. In a matter of a few days or weeks, that workaround has spread everywhere and become a de facto pattern for all agents. That's a really, really bad place to be.
你有一个小小的 workaround,或者一条解释 workaround 的注释,agent 就特别爱抄。几天或几周之内,这个 workaround 就蔓延得到处都是,成了所有 agent 事实上的模式——那会是一个非常、非常糟糕的处境。
That goes back to why, whenever you're correcting your agents, you should invest time in codebase changes and static analysis, and layer them with good rules, Bugbot, and skills.
这就回到我为什么说:每当你纠正 agent 时,都值得投入时间去做代码库改动和静态分析,当然还要叠加好的 rules、Bugbot 和 skills。
Another analogy I like, in addition to the Michelin kitchen, is that your codebase is a garden. Workarounds seem innocent at first, but because agents copy patterns over and over, you quickly end up with a very vibe-coded codebase that's a pain to maintain and has a lot of performance issues.
除了米其林后厨,我喜欢的另一个比喻是:你的代码库像一座花园。workaround 起初看起来人畜无害,但因为 agent 会一遍遍复制模式,你很快就会得到一个非常“vibe-coded”的代码库——维护起来痛苦,性能问题一堆。
In my opinion, the perfect agent codebase is so locked down that it's really annoying for humans to write code in, but so conventional and standardized that even innocent-looking patterns are forgotten.
在我看来,完美的 agent 代码库应该锁得让人类写代码时觉得很烦,但又足够约定俗成、足够标准化,以至于连那些看起来无害的模式都会被遗忘。
The best example is something that looks very innocent but is actually really bad: agents leaving comments in the code. When I first saw agents doing this, I thought a lot of it was slop, but I also thought it wasn't necessarily a bad thing. As humans, we leave comments when we see edge cases, when we need to make a workaround, or to leave a note to ourselves or a colleague on a particularly tricky part of the codebase.
最好的例子,是某件看起来非常无害、实际上非常糟糕的事:agent 在代码里留注释。我第一次看到 agent 这么干时,觉得很多都是垃圾,但也觉得这未必是坏事——作为人类,我们看到边界情况、需要做 workaround,或者想给自己或同事在特别棘手的代码处留个提醒时,也会写注释。
But what I quickly realized in the Cursor codebase was that agents were using the comments around the code as justification for why they weren't going to solve the actual problem — and instead papered over it with a band-aid or a short-term solution. So in Dune, we made the choice to ban comments, so agents wouldn't copy that pattern and propagate it everywhere.
但我在 Cursor 代码库里很快意识到:agent 是在拿代码周围的注释,当作自己不去解决真正问题的理由,然后用创可贴或短期方案把问题糊过去。所以在 Dune 里,我们选择直接禁止注释,这样 agent 就不会复制这个模式、把它传播得到处都是。
园丁、三条原则,以及 16 毫秒的边界
My pitch is that every team really needs a role I'm calling a gardener. In a real garden, you need someone thinking about the things that creep in and grow where you don't want them — weeds, pests, organic growth. I don't know gardening that well, but you get the idea. Unwanted things creep into your codebase, and you want to nip them in the bud before they propagate everywhere.
我的主张是:每个团队都需要一个我称为“园丁”的角色。就像真实的花园,你需要有人一直想着那些会悄悄钻进来、往你不希望的方向生长的东西——杂草、害虫、各种有机增长。我对园艺不太懂,但你明白意思。代码库里也会钻进不想要的东西,你要在它们蔓延之前尽早掐掉。
A lot of the principles behind Dune center on three things.
Dune 背后的很多原则集中在三件事上。
First, we want to delete the tech debt we already have, for the reasons I just mentioned.
第一,删除我们已经存在的技术债,原因就是我刚说的那些。
Second, we want to enforce a single paved path for most blessed patterns. There should be one conventional way to do things, so agents don't have to guess, and there should be enough guidance in the codebase, in CI, and in lint rules to steer agents onto that path.
第二,为大多数“受祝福”的模式强制一条铺好的路。做某件事应该只有一种约定俗成的方式,这样 agent 不需要猜;代码库、CI、lint rule 里要有足够引导,把 agent 引到这条路上。
Third, whenever you see tech debt or bad patterns, your instinct should be: I need to write a lint rule against it. You don't always have to clean it up immediately, because a lint rule at least stops the bleeding. It doesn't solve the problem entirely, but it prevents it from growing.
第三,每当你看到技术债或坏模式,本能反应应该是:我要写一条 lint rule 来禁止它。你不一定非得立刻清理干净,因为一条 lint rule 至少能止血。它不能完全解决问题,但至少能阻止它继续扩大。
So I definitely recommend thinking hard about how to guard against anti-patterns so they don't spread like a virus, and then spending time getting your agents to clean them up — so your codebase is constantly in a state you'd be happy for an agent to copy.
所以我强烈建议认真思考如何防住反模式,别让它们像病毒一样扩散;然后再花时间让 agent 把它们清理掉,让你的代码库始终处于“你愿意让 agent 照抄”的状态。
I won't go through all the implementation details, but I'll gloss over some interesting parts. Dune is the architecture, the client framework we built to power Grok Bot. We've invested a lot in conventions: where code should live, and how and where code should be imported between places.
实现细节我不全讲,只挑一些有意思的部分过一下。Dune 是架构,是我们为 Grok Bot 打造的客户端框架。我们在约定上投入很多:代码应该放在哪、代码之间应该怎样、从哪里导入。
In Dune applications there are different concepts. Features are co-located in a single folder. There's an entry point in the React part that works like a route. There are transcript pods that show up in the Grok Bot application. There's a host that runs on the Grok Bot virtual machine. And there's the client that powers the overall Dune application.
在 Dune 应用里有几个不同概念:功能都放在同一个文件夹里;React 那部分有一个入口点,你可以把它想成一条路由;有在 Grok Bot 应用里显示的 transcript pod;有跑在 Grok Bot 虚拟机上的 host;还有驱动整个 Dune 应用的 client。
We have strict boundaries between these. For example, things that run on the main process — the main thread in Electron — aren't allowed to run on the renderer thread. We keep that separation very intentionally, because of lessons from Cursor's agents window, where code would accidentally get imported into the renderer and slow it down.
我们之间有严格的边界。举个例子:跑在主进程——Electron 主线程——里的东西,不允许跑到渲染线程上。我们刻意保持这种隔离,因为从 Cursor agents window 得到了教训:有时代码会被意外导入渲染线程,拖慢它。
On the renderer thread you want the UI to be smooth and performant. You need to make sure there are no long tasks over 16 milliseconds if you want 60 frames per second, or 8 milliseconds if you want 120. The renderer has to be constantly chunking up the work rather than doing it all at once. Dune enforces these boundaries through the import dependency graph.
在渲染线程上,你希望 UI 流畅、性能好。你要确保没有超过 16 毫秒的长任务(如果想要 60 帧),或者 8 毫秒(如果想要 120 帧)。渲染线程必须不断把工作分块,而不是一次做完。Dune 通过导入依赖图来强制这些边界。
That's just one example of a pattern that led to really bad performance and that we categorically eliminated through the architecture of Dune.
这只是一个例子:某种模式导致了非常糟糕的性能,而我们在 Dune 的架构层面把它彻底消除了。
The core theme here isn't Dune. It's that an agent-friendly framework of your own is very, very powerful: you can encode all the learnings and tribal knowledge of your best engineers. The lesson is to take what used to live in the style guide and in engineers reviewing each other's code and leaving comments, extract that knowledge, and encode it into the framework — into the codebase itself.
这里的核心主题不是 Dune,而是:你自己的、对 agent 友好的框架其实非常强大,你可以把团队里最优秀工程师的经验和“部落知识”全部编码进去。
The codebase is the memory. It's the materialized snapshot of the state in which you want your agents to extend. You want it so pristine, so great, that the next agent that comes along is very likely to continue that pattern and keep it really, really good.
代码库就是记忆。它是你想要 agent 去扩展的那个状态的物化快照。你希望它如此纯净、如此优秀,以至于下一个接手的 agent 极大概率会延续这个模式,让它继续保持很好。
内循环与外循环:Grok Bot + Cursor
If you spend enough time on this process, you can really set up a Michelin kitchen or a software factory. You've spent so much time on all these pieces that let you trust your agents — the codebase, lint rules, diagnostics, rules, Bugbot, skills — and these layers come together and provide a lot of trust.
如果你在这个过程上花足够多时间,你真的可以搭出一间米其林后厨,或者一个软件工厂。因为你在所有让你能信任 agent 的部件上花了大量时间——代码库、lint rule、诊断、rules、Bugbot、skills——这些层叠在一起,提供了大量信任。
Imagine for a moment you're working in the Grok Bot codebase. It's super locked down — almost impossible to write bad code. Even an agent with very little context, or not a lot of reasoning, can come in and write good code.
想象一下你在 Grok Bot 代码库里工作。它锁得极死,几乎不可能写出坏代码。所以即便是一个上下文很少、推理能力不强的 agent,也能进来写出好代码。
Going back to the Michelin analogy: we're setting up our agents and bots with skills and tools, training them, setting up our kitchen in a way that makes sense for them to do the right thing by default. If one of our cooks or dishwashers is constantly tripping over something, we fix it so others don't trip too. A kitchen is a dangerous place; you don't want anyone hurt. It's the same mindset we should have with our codebases: how do we set it up so that even agents without a lot of knowledge can do a good job?
回到米其林比喻:我们在用 skills 和工具武装 agent 和 bot,训练它们,把厨房布置成让它们默认做对的样子。如果在厨房里看到某个厨师或洗碗工总被某个东西绊倒,我们当然要修好,让别人也不会绊倒——厨房很危险,不能让人受伤。对待代码库也该是同样的心态:怎么布置,才能让即便没多少知识的 agent 也能干好?
Grok Bot and Cursor play an interesting role together. Grok Bot is really great at providing what I call the outer loop. You can connect it to lots of different connectors — Slack, Datadog, Sentry, PlanetScale, whatever services you use — and aggregate all that information to make really good decisions for itself. Some people call this a company brain. I personally don't think you need anything that sophisticated, because agents are really good at using tools.
Grok Bot 和 Cursor 在一起扮演了很有意思的角色。Grok Bot 很擅长提供我所说的“外循环”:你可以把它接到 Slack、Datadog、Sentry、PlanetScale 等各种服务,把信息聚合起来,用它做出很好的决策。有人把这叫 company brain。我个人觉得不需要那么复杂,因为 agent 很擅长用工具。
If you connect these tools through Grok Bot, and have it automatically kick off things like cloud agents, you'll find you don't really have to invest in a lot of infrastructure to build a software factory. In fact, I'll cross out that term — I don't like it. You can set up this personal Michelin kitchen for yourself through things like Grok Bot routines, which let you subscribe to Slack threads or Sentry alerts and kick things off automatically.
如果你把这些工具通过 Grok Bot 接起来,让它自动触发 cloud agents 之类的东西,你会发现其实不需要投入很多基础设施就能构建一个软件工厂。事实上,我要把“软件工厂”这个词划掉——我不喜欢它。你可以通过 Grok Bot routines 这类东西,为自己搭一间个人米其林后厨:订阅 Slack 线程、Sentry 告警,自动触发事情。
When you combine all of these things — your codebase, your rules, your skills — they compound. Grok Bot can automatically respond to events from the outer loop and kick off cloud agents. You can also set up Cursor automations and use our SDK to set up additional bots that reuse a lot of this agent infrastructure and do much more complicated tasks.
当你把这一切——代码库、rules、skills——组合起来,它们会复利。Grok Bot 能自动响应来自外循环的事件,然后触发 cloud agents。你也可以设置 Cursor automations,用我们的 SDK 搭额外的 bot,复用你已经搭好的 agent 基础设施,让它们做复杂得多的事情。
If you've done all this, you get to a point — I have screenshots of some of our automations and agents working on Cursor — where we're automatically reproducing bug reports, automatically opening pull requests, essentially adding a lot of value to the entire team, because all of these things compound.
如果这些都做到了,你会到达一个状态——我这有几张我们自动化流程和 agent 在 Cursor 上工作的截图——我们在自动复现 bug 报告、自动开 PR,实质上为整个团队增加了大量价值,因为所有东西都在复利。
收尾:五层防御,按这个顺序做
To close: if you spend a lot of time thinking about all the pieces you need to ascend the trust graph, you get to a place where you can really trust your agents more, parallelize your work, and empower your entire team to build on top of these pieces of infrastructure — every engineer, every builder, extremely productive and able to write high-quality code.
收尾:如果你花大量时间思考“爬上信任曲线”需要的所有部件,你会到达一个能真正更信任 agent、并行化工作,并让整个团队在这套基础设施上继续构建的状态——每位工程师、每位构建者都极其高产,都能写出高质量代码。
The last thing I want to leave you with is this slide. If there's only one thing you take away from this talk, it should be this: these are the activities that will help you build toward a high-trust environment. Whenever you find yourself correcting and intervening with your agent, think about these five pieces and where the most effective step is in the sequence to make your agent much more trustworthy.
最后我想留给你的是这张幻灯片。如果这场演讲你只带走一件事,那应该是这张:这些活动能帮你走向高信任环境。每当你发现自己在纠正、介入 agent 时,都从这五个部件去想:在这个序列里,最有效的一步是哪一步,能让你的 agent 更可信。
I definitely recommend thinking about it in this order. Either invest the time to make that pattern categorically impossible through your codebase, architecture, and data structures — or start looking at static analysis, and then layer that with rules, Bugbot, and skills.
我强烈建议按这个顺序想:要么投入时间,通过代码库、架构和数据结构让这个模式在结构上不可能发生;要么从静态分析入手,然后叠加 rules、Bugbot 和 skills。
If you do all of that, and you also spend some time thinking about your code quality in terms of skills, you get to a place where you trust the environment so much that your agents can just be free.
如果这些都做了,你还花时间从 skills 的角度思考代码质量,你就会到达一个状态:你如此信任环境,以至于 agent 可以完全自由。
Personally, I've spent a lot of time on Grok Bot's codebase. This is really the secret. Well — it's not really a secret; it's a lot of hard work. I hope you found this talk useful. Please reach out to me on X — my handle is poteto, with an E — and I hope you'll have a lot of fun and success building your own Michelin kitchen. Thanks for watching.
就我个人而言,我在 Grok Bot 的代码库上花了很多时间。这才是真正的秘密。好吧——也不是什么秘密,就是大量苦功。希望这场演讲对你有用。欢迎在 X 上找我——我的 handle 是 poteto,带一个 E。祝你自己搭米其林后厨时玩得开心、做得成功。谢谢观看。
“你真正要设计的不是 prompt,而是那个让 agent 默认做对的厨房。”
- 01原演讲视频 · Lauren TanX · 38:02 · 本页文字稿的唯一来源
- 02Lauren Tan · @potetoX 主页 · 演讲者本人
- 03no.lol · Lauren Tan 的博客工程、领导力与 TypeScript / Elixir / Rust
- 04GitHub · @poteto个人主页 · 开源项目与代码
- 05pstack · Cursor 官方插件仓库她开源的那套 skills / playbooks
- 06The Complete Guide to pstack · Part 1X 长文 · 她本人写的使用指南
- 07Loops You Can TrustX 长文 · 关于可信任的 agent 循环
- 08Introducing Grok BotxAI 官方发布公告
- 09Cursor Bugbot她文中反复提到的自动 review 工具
- 10React CompilerReact 官方文档 · 她此前在 Meta 参与的项目
来源:X · @poteto · 视频原帖
说明:视频标题写作 “2,500 PRs”,讲者口述为 “a couple thousand / 2,000”;正文保留口述说法。英文为编辑后的演讲原文,中文为逐段译文。原始 ASR 全文见工作区 lauren-2500prs-文字稿.md。所有外部链接见上方「出处与延伸阅读」。
专有名词校正:poteto(非 Potato)· Grok Bot · control-glass · pstack(非 PStack)· Dune · Bugbot · heap snapshot(非 heat map)· lint rule(非 lit rule)。