我如何借助可信智能体一个月向生产环境提交 2500 个 PR

How I Shipped 2,500 PRs to Production with Trusted Agents

劳伦·谭 Lauren Tan · poteto(X) · 2026-09-22 · 约 38 分钟 · 原视频 ↗

打开互动全文版(中英对照 + 朗读 + 问答)→

本期速览 · Overview

Lauren 分享如何通过验证技能建立对 AI 智能体的信任,从而以一人之力像软件工厂一样提交数千个 PR。

Lauren shares how building trust in AI agents through verification skills turned her into a one-person software factory shipping thousands of PRs.

要点 · TL;DR

核心观点 · Key points

反共识 · Contrarian takes

本期章节 · Chapters(共 15)

全文 · Full transcript(中英对照)

引言与论点 Introduction and Thesis

Lauren

嗨,我叫 Lauren。你们可能知道我是 Potato OnX。我在 SpaceX AI 的 Grok Bot 项目工作。上个月我做了一件相当疯狂的事:我向生产环境提交了 2,000 个拉取请求。我能做到这一点,很大程度上靠的是信任。我经常思考信任问题,思考我如何能信任我的智能体,即使我不在场,它们也能产出高质量的工作。我今天演讲的论点和主题是:如果你为你的智能体把环境搭建得非常好,你最终会得到一种更像个人甚至团队软件工厂的东西,以比以往高得多的速率产出非常高质量的代码。但我不喜欢“软件工厂”这个词。我更喜欢米其林厨房的比喻。作为技术人员,我们并不是在流水线上批量生产产品,我们所做的工作看起来非常有创造性。这是构建产品的行为,某种意义上说是艺术。所以,即使有了智能体,我们不再亲自烹饪产品中的各个组件,我们仍然要对最终结果负责,并思考我们的厨房设置,对吧?因为取决于你如何设置你的流水线厨师、你的副厨师,他们拥有的设备种类、接受的培训,以及洗碗工和流水线厨师与洗碗工的比例。所有这些因素都影响最终产品。我认为这个比喻非常贴切。

Hi, my name is Lauren. You might know me as Potato OnX. And I work on Grok Bot at SpaceX AI. So, last month I did something pretty crazy. I shipped 2,000 pull requests to production. A lot of how I'm able to do this is through trust. Um, and I think a lot about trust in terms of how I can trust my agents to produce high quality work even when I'm not there. And my argument and thesis for this talk today is that if you set up your environment for your agents really really well, you can end up with something that looks more like a personal or even team software factory where you're producing very high quality code at much greater rates than before. Uh but I'm not a fan of the term software factory. I like the analogy of a Michelin kitchen better where you know um as technologists we're not really producing we're not mass producing a product on an assembly line but the work that we do looks very creative. It's very um you know it's the act of building a product and it's art in some sense. So, you know, even though with agents, we're not cooking the individual components that go into the product anymore, um, we're still responsible for the final outcome and thinking about our kitchen setup, right? Because depending on how you set up your line cooks, your sous chefs, you know, the kind of equipment they have, the kind of training they have, you know, dishwashers and the ratio, I guess, of line cooks to dishwashers. Um, all of these ingredients go into making the final product. Um, and I think this analogy is really apt.

Cursor早期岁月 Early Days at Cursor

Lauren

所以,我想先讲一个小故事。六个月前我刚加入 Cursor 时,我们还没并入 SpaceX AI,我显然还没有任何智能体技能可用。我刚加入公司,面对的是一个全新的代码库和全新的产品。当时 Cursor 正在构建 Cursor IDE 的替代品,也就是新的智能体窗口。在我加入之前,Cursor 智能体窗口有很多性能问题。我当时的经理问我能否帮忙解决。因为我加入 Cursor 之前在 React 团队待过一段时间,所以看起来挺合适。但刚开始时,我很快意识到这个过程有多手动。显然我以前做过性能工作,但以拉取请求合入的速度,感觉就像一堵无法逾越的拉取请求之墙不断涌来,我完全不知道应用性能是否会回退。所以我在 Cursor 团队的早期大量时间都花在看 Chrome 开发者工具、分析性能、做性能追踪和堆快照上。这极其极其手动。手动到让我非常沮丧,开始想:等等,我们有智能体,我在干什么?于是我开始思考验证技能:如果我的智能体能自己运行应用、帮我做追踪、理解追踪、找到热点,并基本上自动爬山式地优化我们应用的性能,那会怎样?

So, uh, I wanted to talk a little bit about a story before we begin where six months ago when I first joined Cursor before we were a part of SpaceX AI, I obviously had, you know, no agent skills to to use, right? I just joined the company. It was um a fresh code base and a fresh product that I was working on. So at the time um cursor was building the replacement for the cursor IDE which is the new agents window and uh before I joined the cursor agent window had quite a lot of performance issues. Um and my manager at the time asked if I was able to help them. Um and since I had spent some time on the React team before I joined Cursor uh it seemed like a good fit. Uh but when I first started I quickly realized how manual this process was. Uh obviously I have done performance work before. Um but at the rate at which pull requests were being landed it was just it felt almost an insurmountable wall of pull requests that just kept coming in and I had no idea whether or not the performance of the app would be regressing. Right? So a lot of my early time on the cursor team was spent looking at uh Chrome dev tools and the performance and doing performance traces and taking heap snapshots. Uh and it was extremely extremely manual. It was it it was so manual it it got to the point where um I just got really frustrated and started to think about you know wait we have agents what am I doing? And so I started thinking about verification skills where you know what if my agent could actually run the application itself and take the traces for me, understand the traces and find the hot spots and basically hill climb you know to uh better uh performance in our application automatically.

信任框架 The Trust Framework

Lauren

在 Cursor 和 SpaceX AI 的过去六个月里,你可以明显看到我的产品交付速度飙升。我从未设定过每月提交 2,000 个拉取请求的目标,那根本不是我的目标。但我意识到,我做的所有技能、所有工具和代码库更改,都汇聚成了“信任”这个理念。当时我并不知道,但我脑子里一直有个想法:我是瓶颈,我需要把我作为工程师的所有知识传授给我的智能体团队,这样我就不必成为所有事情的阻碍。你可以清楚地看到这得到了回报。所以我认为这真的归结为信任。但究竟如何建立这种信任,如果你正处于使用智能体的旅程中的任何阶段,该从哪里开始?

And throughout the last six months uh of being at Cursor in SpaceX AI, you can really see that my product PD has skyrocketed. And you know, I never set out to ship 2,000 pull requests a month. That was not a goal of mine at all. But I realized that all of the skills, all of the tools and and codebased changes I were making laded up to this idea of trust. you know, I didn't know it at the time, but um I had this thought in the back of my head head, which was, you know, I am the bottleneck and I need to be able to take all of the knowledge that I have as an engineer and impart them into into my team of agents so that I didn't need to uh be the blocker for everything. And um you can clearly see that it's it's paid off. So I think it really comes down to trust. Um but how exactly do you build that trust and where do you start if you are you know wherever you are in your journey of using agents.

验证层级 Levels of Verification

Lauren

所以当我开始时,显然我处于这个类别,在 1 到 5 个智能体的范围内,你仍然觉得必须照看每一个聊天和结束对话,不断纠正方向,干预、纠正你的智能体,让它做正确的事。如果你不在,基本上什么都不会发生,智能体会做错事。我实际上认为,使用智能体的这个阶段是最难摆脱的,因为如何摆脱并不总是很清楚。再次强调,这归结为信任。你无法从 1 个或 1 到 5 个智能体扩展到 100 个左右,是因为你还不信任智能体的工作。如果你没有信任,却试图生成 100 个子智能体或云端智能体,你很快会发现只会得到大量草率的拉取请求、一堆回退和一堆 bug 被发布,没人会满意。这就引出了问题:如何更信任你的智能体?对我来说,它真正开始于加入 Cursor 团队并开始做性能工作时,我意识到需要验证。当我说验证时,有几个层次。在验证的低端,有我所讲的验证技能,你教智能体如何运行应用,使用 Chrome DevTools 协议或其他调试协议,教它们如何调试应用、做性能追踪、堆快照等。而在另一端,困难得多且仍是开放问题的,是更形式化的验证,你可能依赖形式化方法或 Lean、TLA+ 等语言进行验证,以检查业务逻辑的不变性始终为真,并能形式化验证应用始终处于正确状态。但我想说,即使你没有能力运行形式化方法——很少有人真正能做到——通过验证技能你也可以走得很远。所以当我加入 Cursor 并开始开发 Cursor 智能体窗口时,我构建的第一个技能叫 Control Glass,这是一个验证技能,教智能体如何运行应用并像我提到的那样做追踪,它通过 Chrome DevTools 协议实现。

So uh when I started obviously I was in this category you know in the one to one to five range where um you still feel like you have to babysit every chat uh and end conversation and you're just constantly course correcting you know you're intervening you're correcting your agent so that it does the right thing. Um, and if you're not there, basically nothing gets nothing happens and the agents do the wrong thing. And I would actually argue that this part, this phase of, you know, using agents is actually the hardest to get out of because it's not always very clear how exactly you get out of it. And, um, again, it just comes down to trust. um you know the reason you're unable to go from one one or one to five agents to something more like a 100 um is because you don't have trust in your agents work yet. So if you don't have trust and you try to spawn a 100 sub agents or cloud agents, you're going to quickly find that you're just going to get a ton of slot pull requests and you know a bunch of regressions and a bunch of bugs shipped and no one's going to be very happy with that. So that begs the question, how do you trust your agents more? So for me it came uh it it really started when I uh like I said I meant I joined the cursor team and I was starting to work on performance where I realized the need for verification. So when I say verification uh there are sort of levels to that uh because um you know on the I guess the lower end of the scale for verification you have things like um the verification skills that I talk about where you teach your agent how to run your application um you know and use things like the Chrome DevTools protocol or whatever other protocol that you have for debugging and teach them how to um you know debug the application take performance traces um take heat snapshots and so on. Um and then on the opposite end of spectrum of the spectrum which is much much harder and still very much an open question is like more formal verification where you know maybe you rely on formal methods or you know languages like lean or TLA plus uh to do you know verification so that you can check that you know your business level or business logic uh invariance are you are always um true um and that um uh you can formally verify that your application is always in a correct state. Uh but I would say that you know even if you don't have um the ability to run formal methods and very few people really do um that with verification skills you can get very far. So when I joined cursor uh and started to work on the cursor agent window, the first skill that I built was the skill called control glass which is a verification skill that teaches the agent how to um run the application and take traces like I mentioned and it does that through uh the chrome dev tool protocol.

控制与验证技能 Control and verification skills

Lauren

关于那个技能,有意思的一点是——我是一步步迭代到这里的,它一开始并不是这样。控制或验证技能其实有两个组成部分。第一部分显然是一个 CLI。你希望你的智能体能够可复现地运行应用、收集 trace、收集证据——证明代码能正常工作的经验证据,证明你的性能指标达标。与其让智能体每次都临时写脚本(不同智能体会话之间还会不一样),你其实可以在技能目录里放一个 CLI,让智能体每次都直接用它。当然,你还得真正投入把它做好,让它能处理各种不同的用例,能正确地运行应用。

Something interesting about that skill is, and I kind of iterated my way to this, it didn't start out this way. But the control or verification skill really has two components to it. The first part is obviously a CLI. So you want your agents to be able to reproducibly run the application and collect traces and collect evidence — empirical evidence that code is working, that your performance bar is being met. And rather than have your agents create scripts every time, which can differ between agent sessions, you can actually create a CLI that's within the skill directory, and then your agents will just use that every time. And then of course you need to actually invest in it and make it good so that it can handle all sorts of different use cases and be able to run the application correctly.

Lauren

另一个非常重要的东西是“功能地图”这个想法。功能地图其实是我大概自己造的一个词——我们开始在 Cursor 内部使用这些控制技能,然后很快意识到,Slack 上会来一条报告,用户贴一张非常模糊的截图,对吧,UI 里很小的一块,再加三个问号。而使用我们控制技能的智能体完全不知道该怎么办——它能运行应用,但只能靠猜用户到底是什么意思。于是我就有了做“功能地图”的想法,大概是受站点地图启发。它本质上是一种物化的记忆。比如你的应用到底怎么运作?有哪些功能?用户怎么到达那里——通过哪些键盘快捷键、点哪些 DOM 元素之类的——以及所有功能分别是做什么的。这个功能地图就存在技能本身里,在代码库中作为技能目录的一部分,而且我们还有一个自动化来维护这个功能地图。

Another thing that's also really important is this idea of a feature map. So a feature map really is — something that I kind of coined, I guess — where we started using these control skills within Cursor. Then we quickly realized that a Slack report would come in and a user would post a very vague screenshot, right, like a very small slice of the UI, and just like three question marks. And the agents using our control skills had no idea — like, it could run the application, but it was just guessing at what exactly the user meant. And so I had this idea to create something called a feature map, which is, I guess, kind of inspired by a site map. It essentially is a form of materialized memory. Like, how exactly does your application work? What features does it have? How does a user reach it — in terms of keyboard shortcuts or what DOM elements to click on, things like that — and what all the features do. And this feature map is stored in the skill itself, in the codebase as part of the skill directory, and we have an automation that maintains this feature map as well.

Lauren

但当我们把 CLI 和功能地图结合起来时,我们很快意识到这个组合非常非常强大,因为现在智能体不仅能可复现地控制应用、采集 trace,还能理解来自内部用户和外部用户的请求。所以我们很快意识到,控制验证技能太有用了,它们已经或多或少成了我们团队的关键基础设施,我们一直在维护它。而智能体能够验证自己的工作,这一点极其强大,我们在这个技能上花了很多时间,它对建立信任非常非常有效。

But when we combined the CLI and the feature map, we quickly realized that this combination was very, very powerful, because now agents could not only reproducibly control the application and take traces, but it could also understand requests that came in from internal users as well as external users. And so we very quickly realized that the control verification skills were so useful that they've become more or less critical infrastructure for our team, and we constantly maintain it. But the ability for an agent to verify its own work is extremely powerful, and we have spent a lot of time on this skill, and it's very, very powerful for building that trust.

Lauren

当然,除了验证之外——因为验证真正关乎的是正确性。对我来说,正确性就是:这个功能或代码有没有做你想让它做的事,对吧?比如结账按钮是不是真的能完成结账?验证对此非常重要,因为你能拿到这个功能确实能工作的经验证据,但它并不能告诉你太多关于这个功能的性能或代码质量的信息。于是你就开始思考那些教智能体像真正的软件工程师一样工作的技能。

In addition to verification, of course — because verification is really about correctness. Correctness to me is really about: does the feature or code do the thing that you want it to do, right? Like, does the checkout button actually check out the cart? Verification is really important for that because you get empirical evidence that this feature actually works, but it doesn't tell you much about the performance or the code quality of that feature. And that's where you start thinking about skills that teach agents to work like real software engineers.

Lauren

所以我做了一个叫 pstack 的插件。今天我不打算太多讲这个插件,但这个插件的很多灵感——它是我创建的一组技能的集合——来自我个人在做软件工程时处理各种不同类型任务所用的工作流。比如调试、功能开发、原型设计——pstack 里附带了一大堆不同的操作手册和技能,教你的智能体按照你想要的方式写代码。这正是团队里更有经验的工程师可以真正做出贡献的地方:建立一个团队的技能仓库,让你的智能体聪明得多。

So I've built a plugin called pstack. I'm not going to talk about the plugin too much today, but a lot of the inspiration for that plugin — which is a collection of skills that I've created — is inspired by the kind of workflows that I personally have used in my time doing software engineering for all sorts of different types of tasks. So debugging, feature development, prototyping — there's a whole bunch of different playbooks and skills that ship in pstack that teach your agents how to write code the way that you want them to. And this is where the more experienced engineers on your team can really contribute, to set up a team repository of skills that just make your agents a lot smarter.

Lauren

当你把这些技能和验证技能结合起来,就能达到这样一个状态:你的智能体不仅能验证自己做的工作是正确的,还能验证它是高质量的。而且,因为有验证,你可以收集真实的性能指标,拿到应用性能的真实数字、统计数据和遥测。所以我认为这是非常值得投入的一部分。

And when you combine those skills with verification skills, then you're able to get to a point where your agents are able to not just verify that the work that they're doing is correct, but that it's also high quality. And again, because of verification, you can collect real performance metrics, you can get real numbers and statistics and telemetry on the performance of the application. So I think that's a really important part to invest in.

Lauren

我认为另一件非常重要的事是重构和重写你的架构,让它对智能体更友好。我几乎想说,这是作为一个软件工程团队能做的最重要的事情之一,因为如果你真的相信未来智能体会写所有代码,那我们就需要设计代码库,让它们默认就做正确的事。你会发现,在建立对智能体的信任的这些不同环节之间,存在一个——我几乎想说是一个刻度或连续谱——我这里列了大概五个点——其中代码库其实是最好的记忆形式,因为智能体喜欢扩展它们看到的现有模式。

Another thing I think is really important is refactoring and rewriting your architecture to be more agent friendly. And I almost want to say that this is one of the most important things you can do as a software engineering team, because if you really truly believe that agents are going to be writing all the code in the future, then we need to design our codebases so that they do the right thing by default. And you'll find that there's this — I almost want to say like a scale or continuum between these different pieces of building trust in your agents, where — I have like five of these points here — where the codebase is really the best form of memory, because agents love to extend existing patterns that they see.

Lauren

我觉得这就是 LLM 运作的本质:它们更倾向于用上下文窗口里的东西来做修改。当然,智能体读取和打开的文件就是它上下文窗口的一部分。因此代码库是非常重要的一环,因为智能体不会在每个 PR 里都重构你的代码,它们只会看看已经有什么,然后直接扩展。

And I think this is just the nature of how LLMs work, where they're more likely to use whatever it is in their context window to make changes. And of course, the files that the agents read and open are part of its context window. And therefore the codebase is a really important part, because agents aren't going to just refactor your code in every single PR. They're going to just look at what's already there and just extend.

Lauren

我认为下一个层次是静态分析,包括 linter、编译器诊断、持续集成。这些是你能在代码库里强制执行的准则和约束,这样每当你纠正智能体,却发现它们总是犯同样的错误时——你可以把这些加为 lint 规则,或者更好的是,重构你的代码库,让智能体犯的那个错误在类别上变得不可能发生。

The next level I think is about static analysis, where you have linters, you have compiler diagnostics, you have continuous integration. And these are guidelines and constraints that you can enforce in your codebase so that whenever you correct your agent, you find that they just keep making the same mistake — you can add those as lint rules, or even better, you can refactor your codebase so that the mistake that the agent is making becomes categorically impossible.

Lauren

再往上一个层次,我们就开始从硬性约束和强制执行,更多进入引导的领域,比如规则、Bugbot、技能——你的智能体在做工作时显然有时、而且大多数时候会用到它们,但也有可能因为各种原因忘记读某条规则,或者操控智能体的用户忽略了它们。

And then a step above that, where we're starting to get more into less of a hard constraint and enforcement and more into the realm of guidance, you have things like rules, you have Bugbot, you have skills — which your agents will obviously sometimes and mostly use when they're doing their work, but there's also a chance that it might, for various reasons, forget to read a rule, or maybe the user that is piloting the agent ignores them.

执行与风格指南 Enforcement and the Style Guide

Lauren

呃,这些规则并不那么具有强制性,但也是设置环境的重要部分,这样你才能真正信任你的智能体在做什么。最后还有风格指南,它实际上只能由人类在代码审查中强制执行。我想你也可以把这些放进规则、bug bot 和技能里。但如果你不这样做,那么你的审查流程就会有一个巨大的漏洞,现在人类必须查看每一行被更改的代码并记得评论,而随着拉取请求的涌入,这变得不可能。所以我绝对不建议只依赖风格指南。我认为风格指南或查看人工审查是一个很好的起点,可以找出缺失的部分,但你真的应该花时间思考其他四个部分:你的代码库通过更好的数据结构或算法使事情从根本上不可能发生、静态分析,然后当然你将其与规则、bug bot 和技能叠加起来。

Uh so these aren't quite as enforceable but also an important part of setting up your environment so that you can really trust what your agents are doing. And then finally you have the style guide which is really only enforceable by humans in a code review. I guess you could put these in your rules and bug bot and skills as well. But if you don't, then you have this big glaring hole in your review process where now humans have to look at every single line that's being changed and remember to comment, and with the rate of pull requests that are coming in it just becomes impossible. So I definitely wouldn't recommend relying only on the style guide. I think the style guide or looking at human reviews is a good place to start in terms of what's missing, but you should really invest the time to think about the other four parts: your codebase making things categorically impossible through better data structures or algorithms, static analysis, and then of course you layer that with rules and bug bot and skills.

Dune:智能体友好框架 Dune: Agent-Friendly Framework

Lauren

嗯,在代码库方面,在 Grok Bot 代码库中,我们实际上投入设置了一个我们称之为 Dune 的东西,这是我们的智能体友好框架。所以 Dune 的灵感真的来自于我们在 cursor 智能体窗口中看到的许多性能问题,从那次探索中得到了很多教训,但我们得出的关键原则真的是智能体喜欢走捷径。所以如果我们设计一个框架,使得捷径、轻松的道路对智能体来说是正确的道路,而且也是一个对人类来说可能很烦人的代码库,因为它在你能做什么和不能做什么方面如此锁定。但它实际上为智能体创造了完美的环境,尤其是那些上下文非常少的智能体,因为你的代码库的每个贡献者不再都是工程师。你可以有设计师、产品经理、CEO 进入代码库并发布功能。所以我们真的想了很多关于如何投资和设置我们的代码库,以便即使是由忙碌、上下文不多的人驾驶的智能体也能默认做好工作。

Um on the codebase front, um and in the Grok Bot codebase we actually've invested into setting something up that we call Dune which is our agent-friendly framework. So um the inspiration for Dune really came about from a lot of performance issues we're seeing in the cursor agent window and so a lot of lessons came out of that exploration but um the key principle that we landed on is really that agents love taking shortcuts. So what if we designed a framework such that the shortcut, the easy path, is the right path for agents and also one that would be a codebase that is maybe pretty annoying for humans to work in because it's so locked down in terms of what you can do and what you can't do. But it actually creates the perfect environment for agents especially ones that have very minimal context because not every contributor to your codebase is going to be an engineer anymore. You can have designers, you can have product managers, you can have CEOs going into the codebase and shipping features. So we want to really think a lot about how we invest and set up our code bases so that even agents that are piloted by busy people with not a lot of context can do a good job by default.

代码库即记忆 Codebase as Memory

Lauren

就像我之前提到的,你的代码库实际上是智能体的一种记忆形式,因为它们喜欢扩展它们看到的现有模式。反过来也成立,对吧?你可以花时间设置你的代码库,使得坏模式从根本上不可能发生,或者你有 lint 规则来防止它们。但反过来也成立,如果你有现有的反模式,你实际上会发现这些会像病毒一样传播。比如你有一个小的变通方法或一个解释变通方法的注释,你很快就会发现智能体喜欢复制它,然后在几天或几周内,你会发现变通方法已经到处传播,现在它已经成为所有智能体的事实上的模式,那是一个非常非常糟糕的境地,这又回到了我所说的为什么非常重要。每当你纠正你的智能体时,你都要花时间思考代码库更改和静态分析,当然还要将它们与规则、好的规则、bugbot 和技能叠加起来,因为这个原因。

And like I mentioned before, um your code base is really a form of memory for agents because they love to extend the existing patterns that they see. And the reverse is actually also true, right? You can invest the time to set up your codebase um in a way that things are, you know, bad patterns are categorically impossible or you have like lint rules that prevent them. But the reverse is also true in the sense that um if you have existing anti-patterns, you'll actually find that these will spread kind of like a virus. um where you have like one small workaround or a comment that explains a workaround and you'll quickly find that agents just love to copy that and then in a matter of a few days or a few weeks you'll find that the workaround has spread everywhere and it's now becomes it has become like a de facto pattern for all agents and that's a really really bad place to be in and that goes back to what I was saying about why it's really important And you know whenever you're correcting your agents that you invest the time into thinking about codebased changes and static analysis to and and of course the layering them with rules good rules and bugbot and skills uh because of of that reason.

花园类比 Garden Analogy

Lauren

嗯,除了米其林厨房之外,我喜欢的另一个类比是,你的代码库有点像花园,你有变通方法,它们乍看之下似乎无害,但然后由于智能体的本性,你只是一遍又一遍地复制那个模式,你很快最终得到一个非常 vibecoded 的代码库,维护起来很麻烦,并且有很多性能问题。所以在我看来,完美的智能体代码库是一个如此锁定的代码库,对人类来说写代码真的很烦人,但它是如此传统、如此标准化,以至于即使看起来无害的模式也被禁止。

Um, and another analogy that I like in addition to the Michelin kitchen is this idea that, you know, your code base is kind of like a garden where you have um workarounds uh, you know, that seem seemingly that seem kind of innocent at first, but then because of the nature of agency, you just copy that pattern over and over again and you quickly end up with a very, you know, vibecoded codebase that is a, you know, a pain in the butt to maintain and has a lot of performance issues. So in my opinion, the perfect agent codebase is one that's so locked down that you know it's again it's like really annoying for humans to write code in but it's so conventional it's so standardized that uh you know even innocent looking patterns are just forbidden.

禁止注释 Banning Comments

Lauren

嗯,我有的最好的例子实际上看起来非常非常无害,但当你思考它时,它实际上真的很糟糕。那个模式就是智能体在代码中留下注释。现在,当我第一次看到智能体开始这样做时,我最初并不——好吧,我确实认为很多是懒惰,但我也认为,实际上这并不——这不是坏事,对吧?我想如果智能体在代码中留下注释,因为作为人类,我们在代码中留下注释,每当我们看到边缘情况或我们需要实际做一个变通方法或给自己或同事在代码库中特别棘手的部分留下笔记。但当我很快意识到,当我们在 cursor 代码库中看到这种情况发生时,智能体只是使用代码周围的注释作为理由,说明为什么它不解决实际问题,而是用创可贴或短期解决方案来掩盖它。所以在 Dune 中,再次是驱动 Grok Bot 的框架,我们做出了选择,我们做出了选择,实际上禁止注释,因为这个原因,这样智能体就不会只是复制那个模式并在代码库中到处传播。

Um, and the best example of this I have is actually something that seems very very innocent when you look at it, but when you think about it, it's actually really bad. And that pattern is uh agents leaving comments in the code. Now, you know, when I first saw agents starting to do this, I initially wasn't well, I I did think that a lot of them were slob, but I also thought that, you know, it actually doesn't it's it's not a bad thing, right? I guess if agents are leaving comments in the code because as humans we left comments in the code whenever we saw you know edge cases or we needed to actually make a workaround or you know leave a note to ourselves or a colleague on a particularly tricky part of the codebase. But what I quickly realized when we saw this happening in the cursor codebase was that agents were just using the comments uh around the code as justification for why it wasn't going to solve the actual problem and instead paper over it with a band-aid or a short-term solution. So in Dune, which is again the framework that powers Grok Bot, we made the choice to um we made the choice to actually ban comments for that reason where so that agents would not just copy that pattern and uh you know propagate it everywhere in the codebase.

园丁角色 The Gardener Role

Lauren

所以我的建议是,每个团队真的需要一些东西,一个我称之为园丁的角色。嗯,就像在真正的花园里,你需要有人花很多时间思考那些可能悄悄蔓延并以你不想要的方式生长的事物。比如你有杂草,你有其他类型的有机生长。我不太懂园艺。但你有不想要的害虫之类的东西悄悄进入纯代码库,所以你想尽快将它们扼杀在萌芽状态,在它们开始到处传播之前。嗯,Dune 背后的许多原则真的围绕这三件事。首先,我们想删除我们已经拥有的技术债务,原因我刚才提到。我们想保持或强制执行单一铺平道路,用于大多数受祝福的模式。

So uh my pitch here is that every team really needs something that you know a role that I'm calling a gardener. Um in the same way that uh you know with a real garden you need someone who is thinking a lot about the uh you know things that can kind of creep in and grow in ways that you don't want. like you know you have weeds, you have uh you know just other types of organic growth. I don't really know gardening that well. Um but you have things that you know unwanted pests and and stuff like that that kind of creep in in pure codebased and so you want to nip them in the bud as soon as possible before they start propagating everywhere. Um a lot of the principles behind Dune are really centered around these three things. First of all, we want to delete tech depth that we already have for, you know, for reasons I just mentioned. We want to keep uh or enforce a single pave path for most blessed patterns.

约定与lint规则 Conventions and lint rules

Lauren

应该有一种约定俗成的方式来做某些事情,这样智能体就不需要去猜;代码库、CI、lint 规则里也应该有足够的引导,让智能体照着这条路走。最后,每当你看到技术债或坏模式时,你的本能反应应该是:我得写一条 lint 规则来禁止它。你不一定非得立刻清理干净,因为只要写了 lint 规则,至少能先止血——这不能彻底解决问题,但至少能防止它继续蔓延。所以我强烈建议,认真思考如何防范反模式,别让它们像病毒一样扩散。然后也要花时间让智能体真正把它们清理掉,让你的代码库始终保持在一个状态:如果智能体照着抄,你也会满意。这就是我推荐的心态。

There should be one conventional way to do some things so that agents don't really need to guess, and there should be enough guidance in the codebase, in CI, in lint rules so that the agents are guided to follow that path. And finally, 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 if you write a lint rule, you can at least stop the bleeding, which doesn't solve the problem entirely, but it at least prevents it from growing. So I definitely recommend really thinking a lot about how you can guard against anti-patterns so that they don't spread like a virus. And then also spend time to actually get your agents to clean them up so that your codebase is just constantly kept in a state where you would be happy if an agent were to copy it. That's the kind of mindset that I would recommend having.

Lauren

接下来我不会细讲 Dune 本身的全部细节,只会简单过一些有意思的部分。再提醒一下,Dune 是我们为驱动 Grok Bot 而构建的架构、客户端框架。我们在我刚才说的那些约定上投入了很多。我们有很多约定,规定代码应该放在哪里,以及代码之间应该如何、从哪里导入。所以在 Dune 应用里有不同的概念。比如,功能都放在同一个文件夹里;有一个入口点,位于代码的 React 部分,你可以把它想成一条路由;有在 Grok Bot 应用里显示的转录卡片;有一个运行在 Grok Bot 虚拟机上的 host;当然还有驱动整个应用的 client。

And then I won't actually go through all the details of Dune itself, but I'll just gloss through some interesting parts. So again, as a reminder, Dune is the architecture, the client framework that we built to power Grok Bot. We've invested a lot into all the things I was saying where we have conventions. We have a lot of conventions about where code should live and where and how code should be imported between them. So in Dune applications there's different concepts. For example, features are all co-located in a single folder. You have an entry point that's in the React part of the code that determines — you can kind of think of it like a route. You have transcript cards that show up in the Grok Bot application. You have a host that runs on the Grok Bot virtual machine, and then of course you have your client which powers the overall app.

Lauren

我们在这些部分之间设了很多严格的边界。举个例子,在 Electron 里跑在主进程或主线程上的东西,不允许跑在渲染线程上。我们刻意保持这种隔离,是因为从 Cursor 的智能体窗口里吸取了教训——有时会看到代码意外被导入渲染线程,变成慢代码。而在渲染线程上,你希望 UI 非常流畅、高性能,所以必须确保没有长任务,没有超过 16 毫秒的任务(如果你想要 60 帧每秒),或者超过 8 毫秒的任务(如果你想要 120 帧每秒)。所以渲染线程必须始终处于一种状态:你能把工作切块,而不是一次性全做完。因此 Dune 里有代码通过导入和依赖图来强制这些边界。但这只是一个例子,说明我们见过的一种会导致极差性能的模式,我们通过 Dune 的架构把它彻底消除了。

And we have a lot of strict boundaries between these things. Just as an example, things that run on the main process or the main thread in Electron aren't allowed to be run on the renderer thread. And we keep that separation very intentionally because of lessons we learned from Cursor's agent window, where we would sometimes see code accidentally get imported into the renderer thread — you know, slow code. And since on the renderer thread you want your UI to be very smooth and performant, you need to make sure that you don't have any long tasks or things that take longer than 16 milliseconds if you want 60 frames per second, or 8 milliseconds if you want 120 frames per second. So your renderer has to be constantly in a state where you can really chunk up the work and not do them all at once. And so we have code within Dune that enforces these boundaries through the import and dependency graph. But yeah, that's just an example of a pattern that we saw lead to really bad performance that we categorically eliminated through the architecture of Dune.

Lauren

其他这些部分就没那么有意思了。但核心主题——不是关于 Dune——是这个想法:你自己做一个对智能体友好的框架其实非常非常强大,它能把你和团队里最优秀的工程师所拥有的部落知识全部编码进去。我觉得这里的教训是:过去这些知识存在于风格指南、代码审查流程里,工程师审查其他工程师的工作并留下评论——你如何把这种知识提取出来,编码进框架、编码进代码库本身,让代码库充当记忆?对,这是我反复回到的一个想法:代码库就是你希望智能体去扩展的那个状态的具体化快照。你希望代码库如此纯净、如此优秀,以至于下一个智能体来了之后,很可能就会延续那个模式,让它保持得非常好。

And then all of these other pieces aren't that interesting. But again, the core theme here — it's not about Dune — is the idea that an agent-friendly framework of your own is actually very, very powerful, and it can encode all of the learnings that you and your best engineers on your team have tribal knowledge of. And I think the lesson here is: how do you take that away from what used to be in the style guide process of reviewing code, engineers reviewing other engineers' work and leaving comments — how do you extract almost like that knowledge and encode it into the framework, into the codebase itself, so that the codebase acts as the memory? Right, it's the thing I keep coming back to, this idea that the codebase is just the materialized snapshot of the state in which you want your agents to extend. And you want that codebase to be so pristine, so great, that the next agent that comes along is just very likely to continue that pattern and keep it really, really good.

Lauren

如果你在这个过程上花足够多的时间,就像我说的,你真的可以搭出一个米其林厨房,或者一个软件工厂——因为你花了那么多时间在所有这些让你能信任智能体的部件上:代码库、lint 规则、诊断、规则、bug bot、skills。这些层组合在一起,给你带来很多信任。因为现在,想象一下你在 Grok Bot 代码库里工作。它被锁得非常死,几乎不可能写出坏代码。所以即使是一个上下文很少的智能体,即使是一个推理能力不强的智能体,也能进来写出好代码。

And if you spend enough time on this process, like I mentioned, you can really set up a Michelin kitchen or a software factory where, because you spent so much time on all of these pieces that allow you to trust your agents — whether it's in the codebase, whether it's lint rules, whether it is diagnostics or rules or bug bot or skills — these layers come together and provide you a lot of trust. Because now, just imagine for a moment you're working in the Grok Bot codebase. It's super locked down. It's like almost impossible to write bad code. So even an agent with very little context, even an agent with not a lot of reasoning, can come in and actually write code that's good.

Lauren

回到我那个米其林工厂的例子,我觉得这里有很多可说的。我们在用 skills 和工具装备我们的智能体、我们的机器人,我们在训练它们,我们在以一种合理的方式布置厨房,让智能体和机器人默认就能做对的事。比如在厨房例子里,如果我们注意到某个厨师或洗碗工总是被什么东西绊到,我们当然要修好它,对吧?我们要解决问题,确保其他人也不会被绊到,因为厨房是个很危险的地方,你不想伤到自己。我觉得对待代码库也应该有同样的心态:我们如何布置它,让即使知识不多的智能体也能干得好。

And going back to my example about the Michelin factory, I think there's a lot here, right? We're setting up our agents, our bots with skills and tools, we're training them, we're setting up our kitchen in a way that makes sense for the agents and bots to do the right thing by default. Whenever we see, for example in a kitchen example, if we notice that one of our cooks or dishwashers is constantly tripping over something, of course we need to fix that, right? We need to problem-solve and ensure that others don't trip as well, because in a kitchen it's a very dangerous place and you don't want to hurt yourself. It's the same mindset I think that 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.

Lauren

我觉得 Grok Bot 和 Cursor 在一起扮演了一个有趣的角色:Grok Bot 非常擅长提供我所说的外循环,因为你可以把 Grok Bot 连接到很多不同的连接器——比如 Slack、Datadog、Sentry、PlanetScale,你用到的任何服务——你可以把所有这些信息聚合在一起,用它来为自己做出很好的决策。有人把这叫做公司大脑。我个人不认为这里需要那么复杂的东西,因为智能体非常擅长使用工具。所以如果你把这些工具连接到 Grok Bot,并开始让你的 Grok Bot 自动启动云智能体之类的东西,你会发现其实不需要投入很多基础设施就能搭出一个软件工厂。事实上,我要把这个词划掉,因为我不喜欢这个词。

And I think with Grok Bot, Grok Bot and Cursor play an interesting role together, where Grok Bot is really great at providing what I call the outer loop, because you can connect Grok Bot to lots of different connectors — like Slack, to Datadog, Sentry, PlanetScale, whatever services that you use — and you can aggregate all of that information together and use that to make really good decisions for itself. Some people call this like a company brain. I personally don't think you need anything that sophisticated here, because agents are really good at using tools. And so if you connect these tools to Grok Bot and you start having your Grokbots auto kick off things like cloud agents, you can actually find that you don't really have to invest in a lot of infrastructure to build a software factory. In fact, I'm going to cross out this term because I don't like this term.

打造个人米其林厨房 Building a Personal Michelin Kitchen

Lauren

我觉得你可以通过 Grok Bot 为自己搭建这套私人米其林厨房——比如 Grok Bot 例程,它可以让你订阅 Slack 线程或 Sentry 告警,从而自动触发一些事情。当你把我提到的所有这些——你的代码库、你的规则、你的技能——组合起来,它们会相互叠加,Grok Bot 就能自动响应来自外循环的事件,然后启动云端智能体。

I think you can set up this personal Michelin Kitchen for yourself through Grok Bot — things like Grok Bot routines, which let you subscribe to Slack threads or Sentry alerts that let you kick off things automatically. And when you combine all of these things that I've been mentioning — your codebase, your rules, your skills — they all compound, and Grok Bot will be able to automatically respond to events that come from the outer loop and then kick off cloud agents.

Lauren

你还可以设置 Cursor 自动化,并用我们的 SDK 搭建更多机器人,复用你已经搭好的这些智能体基础设施,让它们去完成复杂得多的任务。

And you can also set up Cursor automations and use our SDK to set up additional bots as well that reuse a lot of these pieces of agent infra that you've set up, and allow them to do much more complicated tasks.

Lauren

所以如果你把这些都做完了,我觉得你就能达到这样一个状态——我这里有几张截图,是我们的一些自动化和在 Cursor 上工作的智能体——我们在自动复现 bug 报告,自动开 pull request,本质上是在为整个团队创造大量价值,因为这一切都会叠加。

So if you've done all this, then I think you can get to a point where — I have some screenshots here of some of our automations and our agents that work on Cursor — where we are automatically reproducing bug reports, we're automatically opening pull requests, we are essentially adding a lot of value to the entire team because all of these things compound.

攀登信任图谱 Ascending the Trust Graph

Lauren

那么,如果我们再拉远一点,回到这张图,作为这场演讲的收尾——如果你花大量时间去思考攀登信任曲线所需的每一个环节,你就会逐渐到达一个状态:你可以真正更信任你的智能体、把工作并行化,也能让整个团队在你为智能体搭好的这些基础设施之上继续构建,让每个人——团队里的每一位工程师、每一位构建者——都极其高效,都能写出高质量的代码。

So if we kind of zoom out again and go back to this graph, I think that to kind of close off the talk — if you spend a lot of time thinking about all of the pieces that you need to be able to ascend the trust graph, you start getting to a place where you can really trust your agents more and parallelize your work, and also empower your entire team to build on top of these pieces of infrastructure for your agents, and empower everyone — every engineer on your team, every builder — to be extremely productive and be able to write high quality code.

唯一要点 The One Takeaway

Lauren

那么我最后想留给大家的,其实是这一页。呃,抱歉,不是那一页,是这一页。我觉得如果这场演讲你只能带走一件事,那应该是这一页幻灯片,也就是:这些活动能帮你逐步构建出一个高信任的环境。

So the last thing I want to leave you with is actually this piece. Uh, sorry, not that piece, but this piece. I think if there's only one thing you take away from my talk, it should be this slide here, which is: these are the activities that will help you build up towards a high trust environment.

Lauren

每当你发现自己在纠正、干预你的智能体时,你都要从这五个环节去思考:在这个序列里,哪一步才是最有效的,能让你的智能体变得可信得多。

Whenever you find yourself correcting and intervening with your agent, you really want to think about it from these five pieces and where is the most effective step in this sequence in order to make your agent much more trustworthy.

Lauren

当然,我强烈建议按这个顺序来思考:要么你投入时间,通过代码库、架构和数据结构让那种模式在根本上不可能发生;要么你先从静态分析这类手段入手,然后再叠加规则、Bugbot 和技能。

And of course I definitely recommend thinking about it in this order, where you either invest the time to make that pattern categorically impossible through your codebase and architecture and data structures, or you start looking at things like static analysis, and then you layer that on with rules and Bugbot and skills.

Lauren

如果你把这些都做到,并且还花些时间从技能的角度去考虑代码质量,你就会到达一个状态:你对这个环境信任到智能体可以放手自由行动,对吧?

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, right?

Lauren

就我个人而言,比如在 Grok Bot 的代码库上,我在这件事上花了大量时间,而这才是真正的秘诀,对吧?嗯,其实也不算秘诀,就是大量的苦功夫。但希望这场演讲对你有用,欢迎在 X 上联系我,我的账号是 potato,结尾带个 E。也祝你在搭建自己的米其林厨房时玩得开心、大获成功。感谢观看。

And personally, I have spent a lot of time on this for Grok Bot's codebase, for example, and this is really the secret, right? Well, it's not really a secret. It's a lot of hard work. But I hope you found this talk useful, and please reach out to me on X. My handle is poteto with an E. And I hope that you'll have a lot of fun and success building your own Michelin Kitchen. Thanks for watching.

互动版:逐字朗读 + 针对本期提问 →