返回列表
🧠 阿头学 · 🪞 Uota学

AI软件工厂必然失败,除非人类重返四阶段规划

作者Dex Horthy主张AI编码必须通过产品审查、系统架构、程序设计和垂直切片四阶段人类深度规划才能安全提速2-3倍,但该论证建立在虚构2026年时间线与无来源数据之上,且本质是为其HumanLayer协作平台造势;不过其中“垂直切片反制AI水平计划偏好”与“程序设计层前置对齐”确实击中了当前LLM的结构性工程弱点。
打开原文 ↗

2026-07-26 原文链接 ↗
阅读简报
双语对照
完整翻译
原文
讨论归档

核心观点

  • 产品审查必须用HTML原型对齐:文字PRD容易引发无休止争论,一份基于用户痛点和成功指标、附带粗糙HTML模型的简短文档,才能在前期低成本消除歧义,防止技术细节过早入侵产品决策。
  • 系统架构只能锁定边界但不足以保证代码质量:序列图和端点契约可阻止部分模型坏习惯,但若直接让AI进入编码,仍会产生难以维护的代码,架构阶段的高杠杆必须配合更下沉的干预。
  • 程序设计是被严重低估的杠杆点:在架构与实现之间必须显式定义调用栈树、文件树差异、核心类型与方法签名,将原本在代码审查阶段隐式做出的高代价决策前置到近乎零成本的规划阶段,30分钟规划可换取数小时审查节省。
  • 垂直切片是反模型本能的强制纪律:前沿模型天然倾向于按技术栈水平分层推进(先数据库再服务层最后前端),人类必须强制采用端到端可运行的“曳光弹”切片,确保每步都能用curl或浏览器验证,避免2000行垃圾代码的灾难。
  • 放弃10-100倍虚幻增速,接受2-3倍安全约束:AI无法外包思考的艰苦工作,只能放大它;当前模型能力边界内,重度前置规划是避免事后清理成山垃圾代码的唯一理性选择。

跟我们的关联

  • 对ATou意味着:技术管理者可将“程序设计层”纳入团队SOP,要求AI在生成任何业务代码前必须先输出调用栈树、文件树差异和核心方法签名,把原本消耗情绪带宽的隐性审查决策,转化为低摩擦的前置对齐动作。
  • 对Neta意味着:构建AI Agent工作流时不应追求全自动化,而需按“误解意图的代价”动态路由人机协作深度——40%简单任务可oneshot,中大型任务必须跑完四阶段防线,这是Agent走向生产的唯一可行路径。
  • 对Uota意味着:在产品探索阶段应直接制作粗糙HTML原型替代冗长的飞书/Notion文档,用可交互的低保真模型强制团队先对齐用户痛点与成功指标,防止技术细节过早入侵产品决策。

讨论引子

  • 如果未来6-12个月内模型在架构推理与端到端验证上发生跃升,当前四阶段重度前置规划是否会立即沦为拖慢迭代的流程税?
  • 当AI生成PR的返工率据称接近50%时,团队应该提高前置规划成本,还是直接降低对AI输出代码的验收标准以换取速度?
  • 作者反复强调“人类不可被移出循环”并将其与HumanLayer产品绑定,这究竟是对AI约束的清醒认知,还是为一种商业品类需求制造的稀缺性叙事?

“Why Software Factories Fail”的第一部分在不到 24 小时内获得了 25 万次浏览——现在你可以尽情阅读第二部分了 http://x.com/i/article/2080408648560578560

这是《Why Software Factories Fail》的第二部分

本文的演讲版本已在 youtube 上线:https://www.youtube.com/watch?v=Ib5GBkD555M

重新开灯

在第一部分中,我深入探讨了为什么不能信任模型来长期维护代码库(codebase)质量。为什么再多的测试工具工程(harness engineering)或代币最大化(tokenmaxxing)也无法解决模型训练和基准测试(benchmarks)问题。为什么将“模型作为评判者(model as judge)”来评估代码质量,并不像某些人想告诉你的那样有效。

目前,评判者是你——所以我们要把代码审查(code review)重新加回来。

https://x.com/dillon_mulroy/status/2059985696148849025

我们将采用在 AI 出现之前就一直在做的事情,即在前期做一点规划,以降低漫长而艰难的审查的几率。

我们将寻找杠杆(leverage),并利用 AI 在以下 4 个阶段提供帮助:

  • 产品需求(Product Requirements)

  • 系统架构(System Architecture)

  • 程序设计(Program Design)

  • 垂直切片(Vertical Slices)

产品审查

一切都从产品审查开始:这是一份简短的文档,明确了我们正在构建什么以及为什么构建。目标是能够将两句话或一段冗长的语音备忘录转化为半结构化的内容。

首先,我们在要解决的问题(problem to solve)上达成一致——用用户的术语来说,就是实际的用户痛点。其次,成功是什么样的(what success looks like)——在发布后,我们可以通过查看什么数据来决定这个东西值得构建。理想情况下,这是一个用户结果,比如“能在更短的时间内完成 XYZ 工作流”或“更早达到入职里程碑 ABC”。有时它是更底层的指标,比如错误率或延迟数字,有时仅仅是“关于 X 的支持工单停止了”。

我们尽量让这部分扎根于产品领域,而不是技术领域。作为一个一只脚踏在产品世界、另一只脚踏在技术世界的人,我经常发现自己在这里不知不觉地陷入了技术细节。当这种情况发生时,我尽量只是把它记下来留到后面的阶段,然后回到用户实际体验的内容上。如果技术决策阻碍了产品决策,那么我们就提交现有的内容,进入架构阶段,或者对可行性进行更多的原型研究(prototype research)。

而且,由于这大部分是关于用户看到的内容,我不会去描述它——我会制作模型(mock it up)。一个实际屏幕的粗略 HTML 模型(mockup)就能解决三个段落只会拖延的争论。

这是一个正在进行中的真实案例——该文档用 JSON 大纲确定了功能,然后是实际屏幕的两个粗略 HTML 模型:

https://x.com/dexhorthy/status/2078592010852982977

当然,并非所有事情都需要产品审查。文案调整、一次性脚本、带有明显复现步骤的错误(bug)——我们仍然只是将这些直接一次性(oneshot)交给智能体(agent)。这是针对那些智能体误解我们意图会付出高昂代价的变更。

对于本文以及本系列中的所有文档,我们进行作者选择加入的审查(author-opt-in reviews)。如果你想在审查期间节省时间,你可以选择将要审查 PR 的人,并与他们一起过一遍产品/技术规范(product/tech specs),可以通过文档评论异步进行(我们为此吃自己的狗粮使用了 humanlayer,但你也可以很容易地在 github/notion/plannotator 等工具中完成)。

系统架构

一旦产品审查确定下来,我们就会进行系统架构。这并不是什么特别新奇的事情,甚至连氛围程序员(vibe coders)也开始对此深信不疑。

如果你想在审查期间节省时间,你可以选择将要审查 PR 的人,并在进入编码部分之前与他们一起过一遍产品/技术规范。

在这个阶段,我们在服务(services)、端点(endpoints)、模式(schemas)、队列(queues)和存储(stores)之间如何相互通信方面达成一致,而不涉及程序设计的细节。为了最大化人类与智能体(human<>agent)的通信带宽,我们在这里大量使用可视化——例如序列图(sequence diagrams):

https://www.arthropod.software/p/vibe-coding-our-way-to-disaster#:~:text=The%20methodology%20I%27ve%20outlined%20goes%20beyond%20productivity%20with%20AI%20tools.%20At%20its%20core%2C%20it%20maintains%20the%20discipline%20and%20thoughtfulness%20that%20creates%20maintainable%2C%20understandable%20systems.%20It%20recognizes%20that%20the%20hard%20work%20of%20thinking%20can%27t%20be%20outsourced%20to%20AI%2C%20only%20amplified%20by%20it.

契约 / 端点形态(Contract / endpoint shapes):

mailto:founders@humanlayer.dev

数据模型和转换(Data models and transformations):

https://aider.chat/

Mermaid 在这里是不错的选择,但有时可能会大材小用,有时会让你产生一种已经达成一致的错觉。架构具有相当高的杠杆作用,在这个阶段你可以阻止许多潜在的糟糕模型习惯(model tics)。但这不足以产生高质量的代码。为此,我们需要程序设计(program design)

程序设计

在架构之后,我们要做一件我认为在智能体编码(agentic coding)中被严重低估的事情:程序设计(program design)

大多数人认为,一旦架构正确,模型就可以直接开干了。你可以继续这样做,但你可能不会喜欢你得到的结果。

但我看到行之有效的方法是,在任何人(人类或智能体)编写实现之前,我们从架构向下一层,进入代码形态(shape of code):类型(types)、方法签名(method signatures)、程序布局(program layout)和调用栈(call stacks)。

我们第一版的程序设计技能糟透了。它很难读,令人筋疲力尽。我们尝试了 mermaid,它有它的用武之地,但我们真正喜欢的是伪代码(pseudocode)中的轻量级可视化:

调用栈树(Call-stack trees),用于任何编排(orchestration)或控制流(control-flow)的改变。当有趣的部分是正在发生变化的内容时,使用 diff 语法:

https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/wsff.md#front-loading-alignment

Dillon Mulroy 谈到将调用图(call graphs)作为其规划过程的一部分,我认为这完全正确。

文件树差异(File-tree diffs) - 这样你就可以随时了解代码库的布局以及各个内容的位置

https://www.youtube.com/live/NKu3T9FUjmU?si=6BGnZLOkmuIPTjzh&t=2230

关键新功能的类型和方法签名(Types and method signatures)——这些内容对于架构文档来说过于内部,但智能体仍然可能会弄错

制作这些都不需要很长时间(模型起草它们,你与它争论),而其中每一个都是你原本会在代码审查期间隐式做出的决定——那是在你改变主意时代价最高的时候。

垂直切片

接下来,我们喜欢做我称之为“垂直切片(vertical slices)”的事情——Matt Pocock 和我在 2026 年 1 月的一次直播中聊过垂直切片或“曳光弹(tracer bullets)”——这也被称为——曳光弹

模型喜欢我称之为“水平计划(horizontal plans)”的东西——按技术栈顺序(stack-order)做事:

  1. 数据库迁移(Database Migrations)

  2. 服务层(Service Layer)

  3. API

  4. 前端(Frontend)

https://www.youtube.com/watch?v=qgAny0sEdIk

在实践中,这意味着在进行过程中没有真正的方法来“触摸”解决方案。你可以用代码测试东西,但对于我构建过的几乎任何功能来说,阅读测试只是一个开始,而在工作时在浏览器中打开一些东西,或者用 curl 请求它,始终是工作流中频繁的一部分。

在 AI 出现之前,很少有人会在不检查某些东西的情况下写出 2000 多行甚至 500 行代码。

我花了一段时间才注意到我所习惯的方式的差异——在 AI 出现之前我写代码时,我总是从中间开始,然后向外扩展。大致如下:

  1. 创建 API 契约(API contract)并提供模拟数据(mock data),用 curl 测试

  2. 创建前端以消费模拟数据,在浏览器中迭代+打磨

  3. 将 API 连接到服务层(服务提供模拟数据/行为)

  4. 添加数据库迁移,将服务连接到数据库

  5. 添加大量业务逻辑

  6. 添加大量错误处理

并且我会在每一步进行测试/迭代/打磨。

https://hlyr.dev/discord

如果我非常在乎代码,或者对模型在代码库这部分做好工作的能力持怀疑态度,我也会在每一步审查代码。检查 100-200 行并重新引导(resteering)要便宜得多

在这里,我会的。大多数前沿模型(frontier models)在没有人类引导的情况下不会设计出这样的计划,而且很难针对每个代码库甚至每个任务进行泛化,所以我更喜欢在这里保持在循环中(stay in the loop)。相信我。如果我能外包思考的话

30 分钟的规划可以节省数小时的审查

因此,我认为有一些步骤需要人类参与其中,如果你想保持接近人类水平的质量,而不想在事后为了清理成山的垃圾代码(slop code)而苦苦挣扎。(即你真的想走得快)

  1. 产品设计(Product Design)

  2. 系统架构(System Architecture)

  3. 程序设计(Program Design)

  4. 垂直切片(Vertical Slices)

显然,我们不会对发布的每一项内容都执行整个过程(参见下面的支线任务)。我猜测分布大致如下:

  • 约 40% 的任务是一次性完成(oneshot)或一次性完成并带有 1-2 轮轻量级反馈

  • 对于中等任务,我们在一个计划文档中完成产品/系统设计,并且不费心将工作分成几个阶段

  • 对于大型任务,我们执行所有步骤。对于像大型重构这样没有意义的事情,我们将跳过产品部分。

在大多数情况下,我会派出一个模型一次做 1-3 个切片,并在进行过程中审查代码。在早期重新引导要容易得多,无论是内部结构还是实际功能,总比最终面对 2000 多行代码却不知道哪里坏了要好。

你可能觉得你有太多的拉取请求

你没有太多的 PR。你是有太多糟糕的 PR。

早在 AI 出现之前,我们就都审查过许多需要返工的 PR。

但一个出色的 PR 审查起来是一种享受。你滚动浏览每一个文件,代码很干净,它遵循了你关于软件应该是什么样的所有决定/讨论/来之不易的观点。

另一方面,如果一个拉取请求(Pull Request)甚至需要 20% 的返工(这已经很慷慨了,我敢说大多数 AI 一次性生成的 PR 趋势接近 50%),这对提交者审查者来说都是一种智力负担(intellectual burden)情感负担(emotional burden)。(即使提交者是 AI,也可能有人启动了这项工作,或者对 AI 的结果进行了氛围打磨(vibe polished),或者至少关心结果)。

为了节省你的时间(我们快到结尾了),我在一个支线任务中对此进行了更多漫谈:

“时间都去哪儿了”

约束理论(2026 版)

很容易对这里的核心论点感到有点沮丧:“目前我们只能困在阅读代码中”。

我曾对这样一个世界感到非常兴奋:我们可以直接提出要求,让模型去干活,不用读代码就能得到漂亮的生产软件,这些软件会随着时间的推移而演进,并且不会变得一团糟。

但我在这里尽力展示的不过是各种约束。模型擅长某些事情,而在其他事情上则不那么擅长。鉴于这些约束,你该如何优化你的流程?

模型擅长某些事情,而在其他事情上则不那么擅长。鉴于这些约束,你该如何优化你的流程?

有可能你太忙于试图将速度提高 10-100 倍,并试图说服自己代码质量不再重要,而实际上你可以拥抱这些约束,安全地将速度提高 2-3 倍。

我在这里的结束建议基本上是:

  1. 充分了解约束,通过大量使用模型来培养直觉

  2. 在这些约束的范围内优化系统

  3. 寻找杠杆

  4. 读读那该死的代码

就是这样。如果你想留下来听推销,我想你可以继续往下滚动。我希望这能帮助你避免灾难,或者至少你在观看一些可爱的小动画时获得了乐趣。

感谢阅读

-dex

PS 我们对此非常着迷

我们正在构建 humanlayer.com,这是一个智能体 IDE(agentic IDE)和协作平台,旨在帮助你将速度提高 2-3 倍,同时保持人类(或非常接近人类)水平的代码质量。

我们正朝着两个理念进行构建:“为你的软件工厂提供构建块(building blocks)”和“为软件可维护性提供更好的验证器(verifiers)”(甚至可能是更好的模型)。

HumanLayer 对最多 3 人的小团队免费,如果你需要帮助来开始使用,你可以来我们的 discord 逛逛,或者发邮件至 founders@humanlayer.dev 联系我们

快速感谢 @calvinfo 提供的灵感,感谢我的联合创始人 @0xBlacklight,感谢 @swyx 和 @aiDotEngineer 团队为我提供了一个探索这些想法的舞台,并感谢所有为我们加油的不可思议的客户、投资者、朋友和家人。

如果你想了解更多,我基本上会对这个话题说个不停,所以你可以在下面找到本文的所有链接,以及将这些材料转化为播客、长篇白板等其他形式的内容。

PPS 其他资源

播客和文章:

  • Dex 和 Gergely 在 The Pragmatic Engineer 上谈论上下文工程(context engineering)和软件工厂 - 2026 年 7 月

  • Dex 和 Matt Pocock 谈论常青的 AI 编码建议(以及 ralph 循环) - 2026 年 1 月

AI That Works 剧集:

  • 基准测试(Benchmarks)证明不了什么

  • AI 编码的产品规范(Product Specs)

  • 用于更好背压(backpressure)的学习测试

  • 将 12 因素智能体(12-factor agents)原则应用于 AI 编码

本文链接:

  • Why Software Factories Fail 主题演讲 — AI Engineer World's Fair 2026

  • StrongDM 的熄灯软件工厂(lights-off software factory)

  • OpenAI:测试工具工程(Harness Engineering)(2026 年 2 月)

  • Ryan Lopopolo 谈 Symphony(演讲,2026 年 4 月)

  • Mario 在 AI Engineer Europe:“在充满垃圾代码的世界中构建 pi”

  • FT:编码智能体失误导致 Amazon 宕机

  • Matt Pocock:代码库正在崩溃

  • Faros AI:AI 加速反冲报告(AI acceleration whiplash report)

  • 编码智能体的高级上下文工程(Advanced Context Engineering for Coding Agents)(演讲 8/25)

  • 不允许凭感觉(No Vibes Allowed)(演讲 11/25)

  • 关于 RPI 我们弄错的一切(演讲 3/26)

  • Awesome-RLVR - 强化学习(Reinforcement Learning)资源

  • 编码智能体的高级上下文工程(文章)

  • 12 因素智能体(12-Factor Agents)

  • Addy Osmani 谈氛围编码(vibe-coding)与维护

  • NATO 软件工程会议,1968 年

  • DoD DevSecOps 参考设计(PDF)

  • Ramp 的编码智能体平台

  • Stripe:Minions,一次性端到端编码智能体

  • WorkOS:Project Horizon

  • Brex (Latent Space)

  • Dan Shapiro:软件工厂的五个层级

  • Simon Willison 谈 StrongDM 的软件工厂

  • “煮沸海洋(Boil the ocean)”

  • 散弹式修改(Shotgun surgery) (refactoring.guru)

  • John Ousterhout — 软件设计哲学(A Philosophy of Software Design)

  • Robert C. Martin — 代码整洁之道(Clean Code)

  • Martin Fowler — 重构(Refactoring)

  • aider

  • cline

  • codebuff

  • SWE-Agent 论文 (2024)

  • OpenAI Codex 演讲 (11 月)

  • Calvin French-Owen — AI Council 演讲

  • SWE-bench Multilingual (数据集)

  • AIE Worlds Fair 2026 - 伟大的循环辩论(The Great Loops Debate)(“炒作超越了纪律”)

  • SWE-Marathon (Abundant AI)

  • DeepSWE (Datacurve)

  • Frontier Code (Cognition)

  • 变异测试(Mutation testing) (Wikipedia)

  • Dillon Mulroy 谈规划中的调用图(call graphs)

  • Dex × Matt Pocock:垂直切片(vertical slices) / 曳光弹(tracer bullets)(直播,2026 年 1 月)

part one of "Why Software Factories Fail" hit 250k views in under 24h - now you get to enjoy part two http://x.com/i/article/2080408648560578560

This is part two of Why Software Factories Fail

The talk version of this post is live on youtube: https://www.youtube.com/watch?v=Ib5GBkD555M

“Why Software Factories Fail”的第一部分在不到 24 小时内获得了 25 万次浏览——现在你可以尽情阅读第二部分了 http://x.com/i/article/2080408648560578560

这是《Why Software Factories Fail》的第二部分

本文的演讲版本已在 youtube 上线:https://www.youtube.com/watch?v=Ib5GBkD555M

Turning the lights back on

In part 1, I went deep on why models can't be trusted to maintain codebase quality over time. Why no amount of harness engineering or tokenmaxxing will solve a model-training and benchmarks problem. Why "model as judge" for code quality doesn't work as well as some folks want to tell you.

For now, the judge is you -- so we're gonna put the code review back.

https://x.com/dillon_mulroy/status/2059985696148849025

We're gonna embrace that same thing we've been doing since before AI, which is to do a little bit of planning up front, to reduce the odds of a long and difficult review.

We're gonna find leverage, and we're gonna use AI to help with this, across 4 phases:

  • Product Requirements

  • System Architecture

  • Program Design

  • Vertical Slices

重新开灯

在第一部分中,我深入探讨了为什么不能信任模型来长期维护代码库(codebase)质量。为什么再多的测试工具工程(harness engineering)或代币最大化(tokenmaxxing)也无法解决模型训练和基准测试(benchmarks)问题。为什么将“模型作为评判者(model as judge)”来评估代码质量,并不像某些人想告诉你的那样有效。

目前,评判者是你——所以我们要把代码审查(code review)重新加回来。

https://x.com/dillon_mulroy/status/2059985696148849025

我们将采用在 AI 出现之前就一直在做的事情,即在前期做一点规划,以降低漫长而艰难的审查的几率。

我们将寻找杠杆(leverage),并利用 AI 在以下 4 个阶段提供帮助:

  • 产品需求(Product Requirements)

  • 系统架构(System Architecture)

  • 程序设计(Program Design)

  • 垂直切片(Vertical Slices)

Product review

Everything starts with a product review: a short doc that pins down what we're building and why. The goal is to be able to take two sentences or a long voice note ramble and turn it into something semi-structured.

First, we align on the problem to solve -- the actual user pain, in the user's terms. Second, what success looks like -- what can we read after shipping to decide the thing was worth building. Ideally this is a user outcome like "can do XYZ workflow in less time" or "reaches onboarding milestone ABC earlier". Sometimes it's lower level like an error rate or a latency number, sometimes just "the support tickets about X stop."

We try to keep this pretty grounded in the product space, not the technical. As someone who lives with one foot in the product world and one foot in the tech, I often find myself drifting into the technical details here. When that happens, I try to just jot it down for later phases and get back to what the user actually experiences. If tech decisions are blocking product decisions, then we commit what we have and get into the architecture or do more prototype research on what's feasible

And since most of this is about what the user sees, I don't describe it -- I mock it up. A rough HTML mockup of the actual screen settles an argument that three paragraphs would only prolong.

Here's a real one in progress -- the doc pins down the feature with a JSON outline, then two rough HTML mockups of the actual screens:

https://x.com/dexhorthy/status/2078592010852982977

Of course, not everything gets a product review. A copy tweak, a one-off script, a bug with an obvious repro -- we still just oneshot those straight to the agent. This is for the changes where an agent misunderstanding our intent is expensive.

For this and all docs in the series, we do author-opt-in reviews. If you wanna save time during review, you pick the person who would review the PR, and run through the product/tech specs with them, either async via doc comments (we dogfood humanlayer for this, but you can just as easily do this in github/notion/plannotator/etc).

产品审查

一切都从产品审查开始:这是一份简短的文档,明确了我们正在构建什么以及为什么构建。目标是能够将两句话或一段冗长的语音备忘录转化为半结构化的内容。

首先,我们在要解决的问题(problem to solve)上达成一致——用用户的术语来说,就是实际的用户痛点。其次,成功是什么样的(what success looks like)——在发布后,我们可以通过查看什么数据来决定这个东西值得构建。理想情况下,这是一个用户结果,比如“能在更短的时间内完成 XYZ 工作流”或“更早达到入职里程碑 ABC”。有时它是更底层的指标,比如错误率或延迟数字,有时仅仅是“关于 X 的支持工单停止了”。

我们尽量让这部分扎根于产品领域,而不是技术领域。作为一个一只脚踏在产品世界、另一只脚踏在技术世界的人,我经常发现自己在这里不知不觉地陷入了技术细节。当这种情况发生时,我尽量只是把它记下来留到后面的阶段,然后回到用户实际体验的内容上。如果技术决策阻碍了产品决策,那么我们就提交现有的内容,进入架构阶段,或者对可行性进行更多的原型研究(prototype research)。

而且,由于这大部分是关于用户看到的内容,我不会去描述它——我会制作模型(mock it up)。一个实际屏幕的粗略 HTML 模型(mockup)就能解决三个段落只会拖延的争论。

这是一个正在进行中的真实案例——该文档用 JSON 大纲确定了功能,然后是实际屏幕的两个粗略 HTML 模型:

https://x.com/dexhorthy/status/2078592010852982977

当然,并非所有事情都需要产品审查。文案调整、一次性脚本、带有明显复现步骤的错误(bug)——我们仍然只是将这些直接一次性(oneshot)交给智能体(agent)。这是针对那些智能体误解我们意图会付出高昂代价的变更。

对于本文以及本系列中的所有文档,我们进行作者选择加入的审查(author-opt-in reviews)。如果你想在审查期间节省时间,你可以选择将要审查 PR 的人,并与他们一起过一遍产品/技术规范(product/tech specs),可以通过文档评论异步进行(我们为此吃自己的狗粮使用了 humanlayer,但你也可以很容易地在 github/notion/plannotator 等工具中完成)。

System architecture

Once the product review is settled, we do system architecture. This is not particularly novel and is something even vibe coders are starting to swear by.

系统架构

一旦产品审查确定下来,我们就会进行系统架构。这并不是什么特别新奇的事情,甚至连氛围程序员(vibe coders)也开始对此深信不疑。

If you wanna save time during review, you pick the person who would review the PR, and run through the product/tech specs with them before you get to the coding part.

In this phase we align on how the services, endpoints, schemas, queues, and stores talk to each other, without getting into the details of program design. To maximize human<>agent communication bandwidth, we make heavy use of visualizations here - for example sequence diagrams:

https://www.arthropod.software/p/vibe-coding-our-way-to-disaster#:~:text=The%20methodology%20I%27ve%20outlined%20goes%20beyond%20productivity%20with%20AI%20tools.%20At%20its%20core%2C%20it%20maintains%20the%20discipline%20and%20thoughtfulness%20that%20creates%20maintainable%2C%20understandable%20systems.%20It%20recognizes%20that%20the%20hard%20work%20of%20thinking%20can%27t%20be%20outsourced%20to%20AI%2C%20only%20amplified%20by%20it.

Contract / endpoint shapes:

mailto:founders@humanlayer.dev

Data models and transformations:

https://aider.chat/

Mermaid is fine here but it can sometimes be overkill and sometimes lure you into a false sense that you are aligned. Architecture is fairly high leverage and there's a lot of potentially-bad model tics that you can head off during this phase. But it is insufficient to produce high-quality code. For that we need program design.

如果你想在审查期间节省时间,你可以选择将要审查 PR 的人,并在进入编码部分之前与他们一起过一遍产品/技术规范。

在这个阶段,我们在服务(services)、端点(endpoints)、模式(schemas)、队列(queues)和存储(stores)之间如何相互通信方面达成一致,而不涉及程序设计的细节。为了最大化人类与智能体(human<>agent)的通信带宽,我们在这里大量使用可视化——例如序列图(sequence diagrams):

https://www.arthropod.software/p/vibe-coding-our-way-to-disaster#:~:text=The%20methodology%20I%27ve%20outlined%20goes%20beyond%20productivity%20with%20AI%20tools.%20At%20its%20core%2C%20it%20maintains%20the%20discipline%20and%20thoughtfulness%20that%20creates%20maintainable%2C%20understandable%20systems.%20It%20recognizes%20that%20the%20hard%20work%20of%20thinking%20can%27t%20be%20outsourced%20to%20AI%2C%20only%20amplified%20by%20it.

契约 / 端点形态(Contract / endpoint shapes):

mailto:founders@humanlayer.dev

数据模型和转换(Data models and transformations):

https://aider.chat/

Mermaid 在这里是不错的选择,但有时可能会大材小用,有时会让你产生一种已经达成一致的错觉。架构具有相当高的杠杆作用,在这个阶段你可以阻止许多潜在的糟糕模型习惯(model tics)。但这不足以产生高质量的代码。为此,我们需要程序设计(program design)

Program design

After architecture we do this thing that I think is criminally underemphasized in agentic coding: program design.

Most people assume that once the architecture is right, the model can just cook. You can go ahead and do this, but you might not like what you get back.

But what I see working well is that before anyone (human or agent) writes the implementation, we go a level down from architecture into the shape of code: the types, the method signatures, the program layout, and the call stacks.

The first version of our program design skill sucked. It was hard to read, it was exhausting. We tried mermaid, which has its place, but what we actually love are light visualizations in pseudocode:

Call-stack trees, for any orchestration or control-flow change. Use diff syntax when the interesting part is what's changing:

https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/wsff.md#front-loading-alignment

Dillon Mulroy talks about using call graphs as part of his planning process, and I think that's exactly right.

File-tree diffs - so you can stay in touch with the layout of your codebase and where stuff lives

https://www.youtube.com/live/NKu3T9FUjmU?si=6BGnZLOkmuIPTjzh&t=2230

Types and method signatures for the key new functions -- the stuff that's too internal for an architecture doc but that an agent might still get wrong

None of these take long to produce (the model drafts them, you argue with it), and every one of them is a decision you'd otherwise be making implicitly during code review -- at the most expensive possible time to change your mind.

程序设计

在架构之后,我们要做一件我认为在智能体编码(agentic coding)中被严重低估的事情:程序设计(program design)

大多数人认为,一旦架构正确,模型就可以直接开干了。你可以继续这样做,但你可能不会喜欢你得到的结果。

但我看到行之有效的方法是,在任何人(人类或智能体)编写实现之前,我们从架构向下一层,进入代码形态(shape of code):类型(types)、方法签名(method signatures)、程序布局(program layout)和调用栈(call stacks)。

我们第一版的程序设计技能糟透了。它很难读,令人筋疲力尽。我们尝试了 mermaid,它有它的用武之地,但我们真正喜欢的是伪代码(pseudocode)中的轻量级可视化:

调用栈树(Call-stack trees),用于任何编排(orchestration)或控制流(control-flow)的改变。当有趣的部分是正在发生变化的内容时,使用 diff 语法:

https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/wsff.md#front-loading-alignment

Dillon Mulroy 谈到将调用图(call graphs)作为其规划过程的一部分,我认为这完全正确。

文件树差异(File-tree diffs) - 这样你就可以随时了解代码库的布局以及各个内容的位置

https://www.youtube.com/live/NKu3T9FUjmU?si=6BGnZLOkmuIPTjzh&t=2230

关键新功能的类型和方法签名(Types and method signatures)——这些内容对于架构文档来说过于内部,但智能体仍然可能会弄错

制作这些都不需要很长时间(模型起草它们,你与它争论),而其中每一个都是你原本会在代码审查期间隐式做出的决定——那是在你改变主意时代价最高的时候。

Vertical slices

Next we love doing what I call "vertical slices" - Matt Pocock and I had a

chat about vertical slices or "tracer bullets" on a live stream back in January 2026 - this is also referred to as - tracer bullets

Models love what I call "horizontal plans" - doing things in stack-order:

  1. Database Migrations

  2. Service Layer

  3. API

  4. Frontend

https://www.youtube.com/watch?v=qgAny0sEdIk

In practice, what this means is there's no real way to "touch" the solution as you're going. You can test things with code, but for almost any feature I've ever built, reading the tests was a start but pulling something up in a browser, or hitting it with curl while I was working was always a frequent part of the workflow.

Before AI, it was rare for anyone to write 2000+ lines of code or even 500 lines of code without checking something along the way.

It took me a while to notice the difference in what I was used to - when I wrote code before AI, I would always start in the middle and work outwards. Vaguely:

  1. Create API contract and serve mock data, test with curl

  2. Create frontend to consume mock data, iterate+polish in browser

  3. Wire API to services layer (services serves mock data/behavior)

  4. Add database migrations, wire services to database

  5. Add a bunch of business logic

  6. Add a bunch of error handling

And I'd be testing/iterating/polishing at each step.

https://hlyr.dev/discord

If I care about the code a lot or skeptical about the model's ability to do good work in this part of the codebase, I'm reviewing the code at each step too. Checking 100-200 lines and resteering is a lot cheaper

here, I would.Most frontier models won't design a plan like this without human steering, and it's hard to generalize per codebase or even per task, so I prefer to stay in the loop here. Trust me. If I couldoutsource the thinking

30 minutes of planning saves hours of review

And so we have some steps that I would argue that humans need to be in the loop for, if you want to maintain a near-human level of quality without slaving over mountains of slop code trying to clean it up after the fact. (i.e. you actually wanna go fast)

  1. Product Design

  2. System Architecture

  3. Program Design

  4. Vertical Slices

Obviously we don't do this whole process for everything we ship (see the sidequest below). I would guess the distribution is roughly:

  • ~40% of tasks get oneshot or oneshot w/ 1-2 rounds of light feedback

  • for medium tasks, we do product/system design all in one plan document, and don't bother breaking the work into phases

  • for large things, we do all the steps. we'll skip the product part for things where it doesn't make sense like big refactors.

And in most cases, I'll send off a model to do 1-3 slices at a time, and review the code as I go. It's a lot easier to resteer early on, whether it's the internals or the actual functionality, than to end up on the other side of 2k+ lines of code with no idea what's broken.

垂直切片

接下来,我们喜欢做我称之为“垂直切片(vertical slices)”的事情——Matt Pocock 和我在 2026 年 1 月的一次直播中聊过垂直切片或“曳光弹(tracer bullets)”——这也被称为——曳光弹

模型喜欢我称之为“水平计划(horizontal plans)”的东西——按技术栈顺序(stack-order)做事:

  1. 数据库迁移(Database Migrations)

  2. 服务层(Service Layer)

  3. API

  4. 前端(Frontend)

https://www.youtube.com/watch?v=qgAny0sEdIk

在实践中,这意味着在进行过程中没有真正的方法来“触摸”解决方案。你可以用代码测试东西,但对于我构建过的几乎任何功能来说,阅读测试只是一个开始,而在工作时在浏览器中打开一些东西,或者用 curl 请求它,始终是工作流中频繁的一部分。

在 AI 出现之前,很少有人会在不检查某些东西的情况下写出 2000 多行甚至 500 行代码。

我花了一段时间才注意到我所习惯的方式的差异——在 AI 出现之前我写代码时,我总是从中间开始,然后向外扩展。大致如下:

  1. 创建 API 契约(API contract)并提供模拟数据(mock data),用 curl 测试

  2. 创建前端以消费模拟数据,在浏览器中迭代+打磨

  3. 将 API 连接到服务层(服务提供模拟数据/行为)

  4. 添加数据库迁移,将服务连接到数据库

  5. 添加大量业务逻辑

  6. 添加大量错误处理

并且我会在每一步进行测试/迭代/打磨。

https://hlyr.dev/discord

如果我非常在乎代码,或者对模型在代码库这部分做好工作的能力持怀疑态度,我也会在每一步审查代码。检查 100-200 行并重新引导(resteering)要便宜得多

在这里,我会的。大多数前沿模型(frontier models)在没有人类引导的情况下不会设计出这样的计划,而且很难针对每个代码库甚至每个任务进行泛化,所以我更喜欢在这里保持在循环中(stay in the loop)。相信我。如果我能外包思考的话

30 分钟的规划可以节省数小时的审查

因此,我认为有一些步骤需要人类参与其中,如果你想保持接近人类水平的质量,而不想在事后为了清理成山的垃圾代码(slop code)而苦苦挣扎。(即你真的想走得快)

  1. 产品设计(Product Design)

  2. 系统架构(System Architecture)

  3. 程序设计(Program Design)

  4. 垂直切片(Vertical Slices)

显然,我们不会对发布的每一项内容都执行整个过程(参见下面的支线任务)。我猜测分布大致如下:

  • 约 40% 的任务是一次性完成(oneshot)或一次性完成并带有 1-2 轮轻量级反馈

  • 对于中等任务,我们在一个计划文档中完成产品/系统设计,并且不费心将工作分成几个阶段

  • 对于大型任务,我们执行所有步骤。对于像大型重构这样没有意义的事情,我们将跳过产品部分。

在大多数情况下,我会派出一个模型一次做 1-3 个切片,并在进行过程中审查代码。在早期重新引导要容易得多,无论是内部结构还是实际功能,总比最终面对 2000 多行代码却不知道哪里坏了要好。

You probably feel like you have too many pull requests

You don't have too many PRs. You have too many bad PRs.

We've all reviewed a lot of PRs that needed rework, since long before AI.

But a great PR is a joy to review. You're scrolling through every file, the code is clean, it follows all your decisions/discussions/hard-won opinions about how software should be.

On the other hand, if a Pull Request needs even 20% rework (and that's generous, I'd say most AI oneshot PRs trend closer to 50%), that's both an intellectual burden and an emotional burden on both the submitter and the reviewer. (Even if the submitter is an AI, someone probably kicked off this work or vibe polished the AI result or at the very least, cares about the outcome).

To spare you time (we're almost at the end), I rambled more about this in a side quest:

"where does the time go"

你可能觉得你有太多的拉取请求

你没有太多的 PR。你是有太多糟糕的 PR。

早在 AI 出现之前,我们就都审查过许多需要返工的 PR。

但一个出色的 PR 审查起来是一种享受。你滚动浏览每一个文件,代码很干净,它遵循了你关于软件应该是什么样的所有决定/讨论/来之不易的观点。

另一方面,如果一个拉取请求(Pull Request)甚至需要 20% 的返工(这已经很慷慨了,我敢说大多数 AI 一次性生成的 PR 趋势接近 50%),这对提交者审查者来说都是一种智力负担(intellectual burden)情感负担(emotional burden)。(即使提交者是 AI,也可能有人启动了这项工作,或者对 AI 的结果进行了氛围打磨(vibe polished),或者至少关心结果)。

为了节省你的时间(我们快到结尾了),我在一个支线任务中对此进行了更多漫谈:

“时间都去哪儿了”

a theory of constraints (2026 edition)

It's easy to be a little bummed by the core thesis here: "for now we're stuck reading the code".

I was pretty excited for a world where we could just ask for things and let the models cook and not read the code and get beautiful production software that evolves over time and doesn't go to shit.

But what I've done my best to lay out here are nothing but constraints. Models are good at some things, not so good at others. How do you optimize your process in light of those constraints?

Models are good at some things, not so good at others. How do you optimize your process in light of those constraints?

It is possible you are too busy trying to move 10-100x faster and trying to convince yourself code quality doesn't matter any more, when you could embrace the constraints and move 2-3x faster, safely.

My kind of closing advice here is basically:

  1. Learn the constraints well, develop intuition by working with models a lot

  2. Optimize systems within the arena of these constraints

  3. Seek leverage

  4. Read the dang code

That's it. If you wanna stay for the pitch, keep scrolling I guess. I hope this helps you avoid disaster or at least that you had fun watching some cute little animations.

Thanks for reading

-dex

约束理论(2026 版)

很容易对这里的核心论点感到有点沮丧:“目前我们只能困在阅读代码中”。

我曾对这样一个世界感到非常兴奋:我们可以直接提出要求,让模型去干活,不用读代码就能得到漂亮的生产软件,这些软件会随着时间的推移而演进,并且不会变得一团糟。

但我在这里尽力展示的不过是各种约束。模型擅长某些事情,而在其他事情上则不那么擅长。鉴于这些约束,你该如何优化你的流程?

模型擅长某些事情,而在其他事情上则不那么擅长。鉴于这些约束,你该如何优化你的流程?

有可能你太忙于试图将速度提高 10-100 倍,并试图说服自己代码质量不再重要,而实际上你可以拥抱这些约束,安全地将速度提高 2-3 倍。

我在这里的结束建议基本上是:

  1. 充分了解约束,通过大量使用模型来培养直觉

  2. 在这些约束的范围内优化系统

  3. 寻找杠杆

  4. 读读那该死的代码

就是这样。如果你想留下来听推销,我想你可以继续往下滚动。我希望这能帮助你避免灾难,或者至少你在观看一些可爱的小动画时获得了乐趣。

感谢阅读

-dex

PS We're obsessed with this

We're building humanlayer.com, an agentic IDE and collaboration platform to help you move 2-3x faster while maintaining a human (or pretty-dang-close-to-human) level of code quality.

We're building towards two ideas: "building blocks for your software factory" and "better verifiers for software maintainability" (perhaps better models even).

HumanLayer is free for small teams of up to 3 people, and if you want help getting started, you can come hang in our discord or drop us a line at founders@humanlayer.dev

A quick shout out to @calvinfo for inspiration, to my cofounder @0xBlacklight, to @swyx and the team at @aiDotEngineer for giving me an arena to explore these ideas, and to all our incredible customers, investors, friends, and family cheering us on.

If you wanna learn more, I basically won't shut up about this, so you can find all the links from this post as well as a few other projections of the material into podcasts, long form whiteboard, etc, below.

PS 我们对此非常着迷

我们正在构建 humanlayer.com,这是一个智能体 IDE(agentic IDE)和协作平台,旨在帮助你将速度提高 2-3 倍,同时保持人类(或非常接近人类)水平的代码质量。

我们正朝着两个理念进行构建:“为你的软件工厂提供构建块(building blocks)”和“为软件可维护性提供更好的验证器(verifiers)”(甚至可能是更好的模型)。

HumanLayer 对最多 3 人的小团队免费,如果你需要帮助来开始使用,你可以来我们的 discord 逛逛,或者发邮件至 founders@humanlayer.dev 联系我们

快速感谢 @calvinfo 提供的灵感,感谢我的联合创始人 @0xBlacklight,感谢 @swyx 和 @aiDotEngineer 团队为我提供了一个探索这些想法的舞台,并感谢所有为我们加油的不可思议的客户、投资者、朋友和家人。

如果你想了解更多,我基本上会对这个话题说个不停,所以你可以在下面找到本文的所有链接,以及将这些材料转化为播客、长篇白板等其他形式的内容。

PPS Other resources

Podcasts and Articles:

  • Dex and Gergely talk context engineering and software factories on The Pragmatic Engineer - July 2026

  • Dex and Matt Pocock talk evergreen ai coding advice (and ralph loops) - January 2026

AI That Works Episodes:

  • Benchmarks prove nothing

  • Product Specs for AI Coding

  • Learning Tests for better backpressure

  • Applying 12-factor agents principles to AI coding

Links from this post:

  • Why Software Factories Fail keynote — AI Engineer World's Fair 2026

  • StrongDM's lights-off software factory

  • OpenAI: Harness Engineering (Feb 2026)

  • Ryan Lopopolo on Symphony (talk, Apr 2026)

  • Mario at AI Engineer Europe: "Building pi in a world of slop"

  • FT: Amazon outages from coding-agent mishaps

  • Matt Pocock: codebases falling apart

  • Faros AI: the AI acceleration whiplash report

  • Advanced Context Engineering for Coding Agents (talk 8/25)

  • No Vibes Allowed (talk 11/25)

  • Everything We Got Wrong About RPI (talk 3/26)

  • Awesome-RLVR - Reinforcement Learning resources

  • Advanced Context Engineering for Coding Agents (write-up)

  • 12-Factor Agents

  • Addy Osmani on vibe-coding vs. maintenance

  • NATO Software Engineering Conference, 1968

  • DoD DevSecOps Reference Design (PDF)

  • Ramp's coding-agent platform

  • Stripe: Minions, one-shot end-to-end coding agents

  • WorkOS: Project Horizon

  • Brex (Latent Space)

  • Dan Shapiro: the five levels to the software factory

  • Simon Willison on StrongDM's software factory

  • "Boil the ocean"

  • Shotgun surgery (refactoring.guru)

  • John Ousterhout — A Philosophy of Software Design

  • Robert C. Martin — Clean Code

  • Martin Fowler — Refactoring

  • aider

  • cline

  • codebuff

  • SWE-Agent paper (2024)

  • OpenAI Codex talk (Nov)

  • Calvin French-Owen — AI Council talk

  • SWE-bench Multilingual (dataset)

  • AIE Worlds Fair 2026 - The Great Loops Debate ("the hype is outrunning the discipline")

  • SWE-Marathon (Abundant AI)

  • DeepSWE (Datacurve)

  • Frontier Code (Cognition)

  • Mutation testing (Wikipedia)

  • Dillon Mulroy on call graphs in planning

  • Dex × Matt Pocock: vertical slices / tracer bullets (livestream, Jan 2026)

  • "The hard work of thinking can't be outsourced" (Jake Nations)

PPS 其他资源

播客和文章:

  • Dex 和 Gergely 在 The Pragmatic Engineer 上谈论上下文工程(context engineering)和软件工厂 - 2026 年 7 月

  • Dex 和 Matt Pocock 谈论常青的 AI 编码建议(以及 ralph 循环) - 2026 年 1 月

AI That Works 剧集:

  • 基准测试(Benchmarks)证明不了什么

  • AI 编码的产品规范(Product Specs)

  • 用于更好背压(backpressure)的学习测试

  • 将 12 因素智能体(12-factor agents)原则应用于 AI 编码

本文链接:

  • Why Software Factories Fail 主题演讲 — AI Engineer World's Fair 2026

  • StrongDM 的熄灯软件工厂(lights-off software factory)

  • OpenAI:测试工具工程(Harness Engineering)(2026 年 2 月)

  • Ryan Lopopolo 谈 Symphony(演讲,2026 年 4 月)

  • Mario 在 AI Engineer Europe:“在充满垃圾代码的世界中构建 pi”

  • FT:编码智能体失误导致 Amazon 宕机

  • Matt Pocock:代码库正在崩溃

  • Faros AI:AI 加速反冲报告(AI acceleration whiplash report)

  • 编码智能体的高级上下文工程(Advanced Context Engineering for Coding Agents)(演讲 8/25)

  • 不允许凭感觉(No Vibes Allowed)(演讲 11/25)

  • 关于 RPI 我们弄错的一切(演讲 3/26)

  • Awesome-RLVR - 强化学习(Reinforcement Learning)资源

  • 编码智能体的高级上下文工程(文章)

  • 12 因素智能体(12-Factor Agents)

  • Addy Osmani 谈氛围编码(vibe-coding)与维护

  • NATO 软件工程会议,1968 年

  • DoD DevSecOps 参考设计(PDF)

  • Ramp 的编码智能体平台

  • Stripe:Minions,一次性端到端编码智能体

  • WorkOS:Project Horizon

  • Brex (Latent Space)

  • Dan Shapiro:软件工厂的五个层级

  • Simon Willison 谈 StrongDM 的软件工厂

  • “煮沸海洋(Boil the ocean)”

  • 散弹式修改(Shotgun surgery) (refactoring.guru)

  • John Ousterhout — 软件设计哲学(A Philosophy of Software Design)

  • Robert C. Martin — 代码整洁之道(Clean Code)

  • Martin Fowler — 重构(Refactoring)

  • aider

  • cline

  • codebuff

  • SWE-Agent 论文 (2024)

  • OpenAI Codex 演讲 (11 月)

  • Calvin French-Owen — AI Council 演讲

  • SWE-bench Multilingual (数据集)

  • AIE Worlds Fair 2026 - 伟大的循环辩论(The Great Loops Debate)(“炒作超越了纪律”)

  • SWE-Marathon (Abundant AI)

  • DeepSWE (Datacurve)

  • Frontier Code (Cognition)

  • 变异测试(Mutation testing) (Wikipedia)

  • Dillon Mulroy 谈规划中的调用图(call graphs)

  • Dex × Matt Pocock:垂直切片(vertical slices) / 曳光弹(tracer bullets)(直播,2026 年 1 月)

part one of "Why Software Factories Fail" hit 250k views in under 24h - now you get to enjoy part two http://x.com/i/article/2080408648560578560

This is part two of Why Software Factories Fail

The talk version of this post is live on youtube: https://www.youtube.com/watch?v=Ib5GBkD555M

Turning the lights back on

In part 1, I went deep on why models can't be trusted to maintain codebase quality over time. Why no amount of harness engineering or tokenmaxxing will solve a model-training and benchmarks problem. Why "model as judge" for code quality doesn't work as well as some folks want to tell you.

For now, the judge is you -- so we're gonna put the code review back.

https://x.com/dillon_mulroy/status/2059985696148849025

We're gonna embrace that same thing we've been doing since before AI, which is to do a little bit of planning up front, to reduce the odds of a long and difficult review.

We're gonna find leverage, and we're gonna use AI to help with this, across 4 phases:

  • Product Requirements

  • System Architecture

  • Program Design

  • Vertical Slices

Product review

Everything starts with a product review: a short doc that pins down what we're building and why. The goal is to be able to take two sentences or a long voice note ramble and turn it into something semi-structured.

First, we align on the problem to solve -- the actual user pain, in the user's terms. Second, what success looks like -- what can we read after shipping to decide the thing was worth building. Ideally this is a user outcome like "can do XYZ workflow in less time" or "reaches onboarding milestone ABC earlier". Sometimes it's lower level like an error rate or a latency number, sometimes just "the support tickets about X stop."

We try to keep this pretty grounded in the product space, not the technical. As someone who lives with one foot in the product world and one foot in the tech, I often find myself drifting into the technical details here. When that happens, I try to just jot it down for later phases and get back to what the user actually experiences. If tech decisions are blocking product decisions, then we commit what we have and get into the architecture or do more prototype research on what's feasible

And since most of this is about what the user sees, I don't describe it -- I mock it up. A rough HTML mockup of the actual screen settles an argument that three paragraphs would only prolong.

Here's a real one in progress -- the doc pins down the feature with a JSON outline, then two rough HTML mockups of the actual screens:

https://x.com/dexhorthy/status/2078592010852982977

Of course, not everything gets a product review. A copy tweak, a one-off script, a bug with an obvious repro -- we still just oneshot those straight to the agent. This is for the changes where an agent misunderstanding our intent is expensive.

For this and all docs in the series, we do author-opt-in reviews. If you wanna save time during review, you pick the person who would review the PR, and run through the product/tech specs with them, either async via doc comments (we dogfood humanlayer for this, but you can just as easily do this in github/notion/plannotator/etc).

System architecture

Once the product review is settled, we do system architecture. This is not particularly novel and is something even vibe coders are starting to swear by.

If you wanna save time during review, you pick the person who would review the PR, and run through the product/tech specs with them before you get to the coding part.

In this phase we align on how the services, endpoints, schemas, queues, and stores talk to each other, without getting into the details of program design. To maximize human<>agent communication bandwidth, we make heavy use of visualizations here - for example sequence diagrams:

https://www.arthropod.software/p/vibe-coding-our-way-to-disaster#:~:text=The%20methodology%20I%27ve%20outlined%20goes%20beyond%20productivity%20with%20AI%20tools.%20At%20its%20core%2C%20it%20maintains%20the%20discipline%20and%20thoughtfulness%20that%20creates%20maintainable%2C%20understandable%20systems.%20It%20recognizes%20that%20the%20hard%20work%20of%20thinking%20can%27t%20be%20outsourced%20to%20AI%2C%20only%20amplified%20by%20it.

Contract / endpoint shapes:

mailto:founders@humanlayer.dev

Data models and transformations:

https://aider.chat/

Mermaid is fine here but it can sometimes be overkill and sometimes lure you into a false sense that you are aligned. Architecture is fairly high leverage and there's a lot of potentially-bad model tics that you can head off during this phase. But it is insufficient to produce high-quality code. For that we need program design.

Program design

After architecture we do this thing that I think is criminally underemphasized in agentic coding: program design.

Most people assume that once the architecture is right, the model can just cook. You can go ahead and do this, but you might not like what you get back.

But what I see working well is that before anyone (human or agent) writes the implementation, we go a level down from architecture into the shape of code: the types, the method signatures, the program layout, and the call stacks.

The first version of our program design skill sucked. It was hard to read, it was exhausting. We tried mermaid, which has its place, but what we actually love are light visualizations in pseudocode:

Call-stack trees, for any orchestration or control-flow change. Use diff syntax when the interesting part is what's changing:

https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/wsff.md#front-loading-alignment

Dillon Mulroy talks about using call graphs as part of his planning process, and I think that's exactly right.

File-tree diffs - so you can stay in touch with the layout of your codebase and where stuff lives

https://www.youtube.com/live/NKu3T9FUjmU?si=6BGnZLOkmuIPTjzh&t=2230

Types and method signatures for the key new functions -- the stuff that's too internal for an architecture doc but that an agent might still get wrong

None of these take long to produce (the model drafts them, you argue with it), and every one of them is a decision you'd otherwise be making implicitly during code review -- at the most expensive possible time to change your mind.

Vertical slices

Next we love doing what I call "vertical slices" - Matt Pocock and I had a

chat about vertical slices or "tracer bullets" on a live stream back in January 2026 - this is also referred to as - tracer bullets

Models love what I call "horizontal plans" - doing things in stack-order:

  1. Database Migrations

  2. Service Layer

  3. API

  4. Frontend

https://www.youtube.com/watch?v=qgAny0sEdIk

In practice, what this means is there's no real way to "touch" the solution as you're going. You can test things with code, but for almost any feature I've ever built, reading the tests was a start but pulling something up in a browser, or hitting it with curl while I was working was always a frequent part of the workflow.

Before AI, it was rare for anyone to write 2000+ lines of code or even 500 lines of code without checking something along the way.

It took me a while to notice the difference in what I was used to - when I wrote code before AI, I would always start in the middle and work outwards. Vaguely:

  1. Create API contract and serve mock data, test with curl

  2. Create frontend to consume mock data, iterate+polish in browser

  3. Wire API to services layer (services serves mock data/behavior)

  4. Add database migrations, wire services to database

  5. Add a bunch of business logic

  6. Add a bunch of error handling

And I'd be testing/iterating/polishing at each step.

https://hlyr.dev/discord

If I care about the code a lot or skeptical about the model's ability to do good work in this part of the codebase, I'm reviewing the code at each step too. Checking 100-200 lines and resteering is a lot cheaper

here, I would.Most frontier models won't design a plan like this without human steering, and it's hard to generalize per codebase or even per task, so I prefer to stay in the loop here. Trust me. If I couldoutsource the thinking

30 minutes of planning saves hours of review

And so we have some steps that I would argue that humans need to be in the loop for, if you want to maintain a near-human level of quality without slaving over mountains of slop code trying to clean it up after the fact. (i.e. you actually wanna go fast)

  1. Product Design

  2. System Architecture

  3. Program Design

  4. Vertical Slices

Obviously we don't do this whole process for everything we ship (see the sidequest below). I would guess the distribution is roughly:

  • ~40% of tasks get oneshot or oneshot w/ 1-2 rounds of light feedback

  • for medium tasks, we do product/system design all in one plan document, and don't bother breaking the work into phases

  • for large things, we do all the steps. we'll skip the product part for things where it doesn't make sense like big refactors.

And in most cases, I'll send off a model to do 1-3 slices at a time, and review the code as I go. It's a lot easier to resteer early on, whether it's the internals or the actual functionality, than to end up on the other side of 2k+ lines of code with no idea what's broken.

You probably feel like you have too many pull requests

You don't have too many PRs. You have too many bad PRs.

We've all reviewed a lot of PRs that needed rework, since long before AI.

But a great PR is a joy to review. You're scrolling through every file, the code is clean, it follows all your decisions/discussions/hard-won opinions about how software should be.

On the other hand, if a Pull Request needs even 20% rework (and that's generous, I'd say most AI oneshot PRs trend closer to 50%), that's both an intellectual burden and an emotional burden on both the submitter and the reviewer. (Even if the submitter is an AI, someone probably kicked off this work or vibe polished the AI result or at the very least, cares about the outcome).

To spare you time (we're almost at the end), I rambled more about this in a side quest:

"where does the time go"

a theory of constraints (2026 edition)

It's easy to be a little bummed by the core thesis here: "for now we're stuck reading the code".

I was pretty excited for a world where we could just ask for things and let the models cook and not read the code and get beautiful production software that evolves over time and doesn't go to shit.

But what I've done my best to lay out here are nothing but constraints. Models are good at some things, not so good at others. How do you optimize your process in light of those constraints?

Models are good at some things, not so good at others. How do you optimize your process in light of those constraints?

It is possible you are too busy trying to move 10-100x faster and trying to convince yourself code quality doesn't matter any more, when you could embrace the constraints and move 2-3x faster, safely.

My kind of closing advice here is basically:

  1. Learn the constraints well, develop intuition by working with models a lot

  2. Optimize systems within the arena of these constraints

  3. Seek leverage

  4. Read the dang code

That's it. If you wanna stay for the pitch, keep scrolling I guess. I hope this helps you avoid disaster or at least that you had fun watching some cute little animations.

Thanks for reading

-dex

PS We're obsessed with this

We're building humanlayer.com, an agentic IDE and collaboration platform to help you move 2-3x faster while maintaining a human (or pretty-dang-close-to-human) level of code quality.

We're building towards two ideas: "building blocks for your software factory" and "better verifiers for software maintainability" (perhaps better models even).

HumanLayer is free for small teams of up to 3 people, and if you want help getting started, you can come hang in our discord or drop us a line at founders@humanlayer.dev

A quick shout out to @calvinfo for inspiration, to my cofounder @0xBlacklight, to @swyx and the team at @aiDotEngineer for giving me an arena to explore these ideas, and to all our incredible customers, investors, friends, and family cheering us on.

If you wanna learn more, I basically won't shut up about this, so you can find all the links from this post as well as a few other projections of the material into podcasts, long form whiteboard, etc, below.

PPS Other resources

Podcasts and Articles:

  • Dex and Gergely talk context engineering and software factories on The Pragmatic Engineer - July 2026

  • Dex and Matt Pocock talk evergreen ai coding advice (and ralph loops) - January 2026

AI That Works Episodes:

  • Benchmarks prove nothing

  • Product Specs for AI Coding

  • Learning Tests for better backpressure

  • Applying 12-factor agents principles to AI coding

Links from this post:

  • Why Software Factories Fail keynote — AI Engineer World's Fair 2026

  • StrongDM's lights-off software factory

  • OpenAI: Harness Engineering (Feb 2026)

  • Ryan Lopopolo on Symphony (talk, Apr 2026)

  • Mario at AI Engineer Europe: "Building pi in a world of slop"

  • FT: Amazon outages from coding-agent mishaps

  • Matt Pocock: codebases falling apart

  • Faros AI: the AI acceleration whiplash report

  • Advanced Context Engineering for Coding Agents (talk 8/25)

  • No Vibes Allowed (talk 11/25)

  • Everything We Got Wrong About RPI (talk 3/26)

  • Awesome-RLVR - Reinforcement Learning resources

  • Advanced Context Engineering for Coding Agents (write-up)

  • 12-Factor Agents

  • Addy Osmani on vibe-coding vs. maintenance

  • NATO Software Engineering Conference, 1968

  • DoD DevSecOps Reference Design (PDF)

  • Ramp's coding-agent platform

  • Stripe: Minions, one-shot end-to-end coding agents

  • WorkOS: Project Horizon

  • Brex (Latent Space)

  • Dan Shapiro: the five levels to the software factory

  • Simon Willison on StrongDM's software factory

  • "Boil the ocean"

  • Shotgun surgery (refactoring.guru)

  • John Ousterhout — A Philosophy of Software Design

  • Robert C. Martin — Clean Code

  • Martin Fowler — Refactoring

  • aider

  • cline

  • codebuff

  • SWE-Agent paper (2024)

  • OpenAI Codex talk (Nov)

  • Calvin French-Owen — AI Council talk

  • SWE-bench Multilingual (dataset)

  • AIE Worlds Fair 2026 - The Great Loops Debate ("the hype is outrunning the discipline")

  • SWE-Marathon (Abundant AI)

  • DeepSWE (Datacurve)

  • Frontier Code (Cognition)

  • Mutation testing (Wikipedia)

  • Dillon Mulroy on call graphs in planning

  • Dex × Matt Pocock: vertical slices / tracer bullets (livestream, Jan 2026)

  • "The hard work of thinking can't be outsourced" (Jake Nations)

📋 讨论归档

讨论进行中…