
Full Walkthrough: Workflow for AI Coding — Matt Pocock
别把 AI 当新范式:Matt Pocock 的 AI 编码完整工作流
133 分钟阅读2 次阅读AI
【AI 编程实战】如何让 AI 智能体真正交付功能:从拷问需求到垂直切片的全流程 这是 Matt Pocock 在 AI Engineer 活动上的一场约 96 分钟实战工作坊。他认为,软件工程的基本功同样适用于 AI 编码。他借用“聪明区/愚笨区”概念,主张把任务拆小,并清空上下文而非压缩。全流程依次是:用 Grill Me 技能拷问需求,生成 PRD,借“曳光弹”理念拆成可并行领取的垂直切片,再用 Ralph 循环配合 TDD 让 AI 无人值守地实现,最后做清空上下文的审查和人工 QA。他也讲了深模块设计和编码规范的推与拉。适合想从聊天式辅助走向自主智能体交付的工程师。 🎙️ 主讲人介绍 Matt Pocock:自称教师的开发者与讲师,本场工作坊主讲人。他系统讲解 AI 编码工作流,并演示自建的 TypeScript 库 Sandcastle。 核心议题:聪明区与愚笨区的上下文管理、Grill Me 拷问式需求对齐、PRD 与垂直切片任务拆分、Ralph 循环与 TDD 自主实现、人工 QA 与代码审查、面向 AI 的深模块代码库设计。 关键词:AI 编码、智能体、PRD、曳光弹、TDD、深模块
章节 1:开场:软件工程基本功依然适用于 AI 编码
📝 本节摘要:
Matt Pocock 开场自我介绍,说明这场约两小时的工作坊的练习链接和异步问答方式。他的核心论点是:人们常把 AI 视为全新范式,却忘了与人协作时至关重要的软件工程基本功同样非常适用于 AI。随后他引入 HumanLayer 创始人 Dex Horthy 提出的“聪明区/愚笨区”概念:上下文越长,注意力关系呈平方级增长,模型在约 100K token 后会明显变笨,因此任务规模应控制在聪明区内。
[原文] [Matt Pocock]: Yeah, we're good. Okay, folks. We're at capacity. Let's kick off. I don't want you waiting here for 25 more minutes before we some arbitrary deadline. So, welcome. My name's Matt, I'm a teacher, and I suppose now I teach AI. We have a link up here, if you've not already been to this, which has the exercises for the stuff we're going to do today. This is going to be around 2 hours, so we might just sort of kick off 2 hours from now. Is that all right, Mike?
[译文] [Matt Pocock]: 好,可以了。好的,各位,现场已经满员了,我们开始吧。我不想让大家为了某个随意定下的时间点,在这儿再干等 25 分钟。那么,欢迎大家。我叫 Matt,是一名老师,现在嘛,大概算是教 AI 的老师了。这上面有个链接,如果你还没打开过,里面是我们今天要做的练习。整个工作坊大约两小时,所以我们就从现在开始算两小时吧。这样可以吗,Mike?
[原文] [Matt Pocock]: Yeah, perfect. And the theory behind this talk, or at least the thesis under which I've been operating for the last kind of 6 months or so, is that we all think that AI is a new paradigm, right? AI is obviously changing a lot of things. You guys are obviously interested in this, and that's why you've come to this talk. And I feel that when we talk about AI being a new paradigm, we forget that actually software engineering fundamentals, the stuff that's really crucial to working with humans, also works super well with AI.
[译文] [Matt Pocock]: 好,完美。这场分享背后的理论,或者说我过去大约六个月来一直秉持的核心论点是:我们都觉得 AI 是一种新范式,对吧?AI 显然正在改变很多东西。大家显然也对此很感兴趣,所以才来听这场分享。但我觉得,当我们说 AI 是新范式时,往往忘了:软件工程的基本功——那些与人协作时至关重要的东西——用在 AI 身上同样非常管用。
[原文] [Matt Pocock]: And this is what my keynote is on tomorrow, really. I'm going to sort of be fleshing that out a lot more. And in this workshop, I'm hopefully going to be able to direct your attention to those things, and hopefully show you that I'm right. But we'll see. Can I get a quick heads-up first? How many of you guys are coding, have ever coded with AI? Raise your hand if you've ever coded with AI. Perfect. Okay. Keep your hand raised. Let's all share those armpits with the world. How many of you code every day with AI?
[译文] [Matt Pocock]: 这其实也是我明天主题演讲的内容,到时我会展开讲得更充分。而在这个工作坊里,我希望能把大家的注意力引到这些方面上,也希望能向你们证明我是对的。不过咱们走着瞧。先快速做个小调查:你们当中有多少人用 AI 写过代码?用 AI 写过代码的请举手。很好。好,手先别放下,让我们一起向全世界展示一下腋窝吧。你们当中有多少人每天都用 AI 写代码?
[原文] [Matt Pocock]: Cool. Okay. Right, keep your hand raised if you've ever been frustrated with AI. Okay, very good. You can put your hands down. Thank you for that show of obedience. I really appreciate that. And we are also being live-streamed to the Gielgud room as well. I've not... Did we send someone up to the Gielgud room to just check they're okay? Don't know. But I see you, and there is a way that you can participate, which is we have a Q&A. We're going to be doing... I kind of have a sort of hatred of Q&As cuz they're not very democratic. They're mostly the sort of most talkative people get to participate and share. And so, we're going to be going through this Q&A here. So, "Why do we have to wait till 3:45? The room is packed, the doors
[译文] [Matt Pocock]: 不错。好的。那么,被 AI 搞得很抓狂过的,手继续举着。好,非常好,可以把手放下了。谢谢大家这么听话,我真的很感激。另外,我们这场也在向 Gielgud 厅同步直播。我还没……我们有派人上去 Gielgud 厅看看那边是否一切正常吗?不知道。不过我看得到你们,你们也有办法参与进来,那就是我们的问答区。我们会……我其实有点讨厌现场问答,因为它不太民主,基本上都是最能说的那几个人有机会参与和发言。所以我们会用这里的问答区。比如这条:“为什么非得等到 3:45?房间已经满了,门也
[原文] [Matt Pocock]: are closed." 100% agree. And so, if you want to ask a question, I would like you to pile into this async, and then we can vote on each other's questions, and hopefully get the best questions surfaced for the entire room to enjoy. So, I want to talk about first the kind of weird constraints that LLMs have. And those weird constraints are sort of what we have to base a lot of our work around. Now, there's a guy called Dex Horthy who runs a company called HumanLayer, and he came up with this idea, which is that when you're working with LLMs, they have a smart zone and a dumb zone.
[译文] [Matt Pocock]: 关上了。”百分之百同意。所以,如果你想提问,希望大家都以异步的方式发到这里,然后我们可以给彼此的问题投票,让最好的问题浮上来,供全场一起探讨。那么,我想先聊聊大语言模型(LLM)那些有点古怪的限制。我们的很多工作,基本上都得围绕这些古怪的限制来展开。有个叫 Dex Horthy 的人,他经营着一家名叫 HumanLayer 的公司,他提出了一个观点:在使用 LLM 时,它们存在一个“聪明区”和一个“愚笨区”。
[原文] [Matt Pocock]: When you're first kind of like working with an LLM, and it's like you've just started a new conversation, you start from nothing, that's when the LLM is going to do its best work. Because in that situation, the attention relationships are the least strained. Every time you add a token to an LLM, it's kind of like you're adding a team to a football league. You think of the number of matches that get added every time you add a team to a football league, it just goes... it scales quadratically. And that's because you have attention relationships going from essentially each token to the other that are positional and the sort of meaning of the individual token.
[译文] [Matt Pocock]: 当你刚开始和 LLM 打交道,比如刚开了一个新对话、一切从零开始时,就是 LLM 表现最好的时候。因为这时注意力关系的负担最轻。每往 LLM 里加一个 token,就有点像往足球联赛里加一支球队。想想每加一支球队,要新增多少场比赛——它是按平方级增长的。这是因为基本上每个 token 和其他每个 token 之间都存在注意力关系,涉及位置信息,也涉及单个 token 本身的含义。
[原文] [Matt Pocock]: And so, this means that by around sort of 40%, or around... I would say around 100K is kind of my new marker for this. Cuz it doesn't matter whether you're using 1 million context window or 200K, it's always going to be about this. It starts to just get dumber. So, as you continually keep adding stuff to the same context window, it just gets dumber and dumber until it's making kind of stupid decisions. Raise your hand if that feels familiar to you. Yeah, cool. So, this means that we kind of want to size our tasks in a way that sticks within the smart zone.
[译文] [Matt Pocock]: 这意味着,到了大约 40% 左右,或者说……我现在大致以 100K 作为新的分界线。因为不管你用的是 100 万还是 20 万的上下文窗口,差不多都在这个位置,模型就开始变笨了。所以,当你不断往同一个上下文窗口里塞东西,它就会越来越笨,直到开始做出一些很蠢的决定。觉得这很眼熟的请举手。嗯,好。所以这意味着,我们在划分任务规模时,要让它始终处在聪明区之内。
- 章节 2:拆分任务、上下文管理与 Grill Me 技能
- 章节 3:第二阶段:用 grill me 技能与 AI 逐题对齐需求
- 章节 4:从拷问会话到 PRD:自主规划与人在回路
- 章节 5:从PRD到垂直切片:拆分可独立领取的任务
- 章节 6:交给 AI 实施:看板、Ralph 循环与现场答疑
- 章节 7:清空上下文审查、人工QA与深模块设计
- 章节 8:深模块设计、文档腐烂与编码规范的推拉之道
- 章节 9:面向 AI 设计代码库:代码规范的推与拉及 Sandcastle 并行流程
- 章节 10:最终要点总结:意图明确的 AI 编码工作流
正在加载后续章节…







