← 主页
Matt Pocock: Engineering, Not Vibe Coding
返回全景总览 →
AI 时代软件工程范式重构 · Matt Pocock 思想体系

“代码生成越快,严密工程化判断力越稀缺”

面对 AI 催生的 "Vibe Coding" 狂热,Total TypeScript 创始人 Matt Pocock 坚定举起工程主义大旗:盲目依赖 AI 快速生成代码必然产生灾难性的“大泥球 (Big Ball of Mud)”债务。我们必须用严格的类型系统、TDD 测试导轨、反向审问 ("Grill Me") 与垂直切片,驾驭大模型成为可靠的生产力系统。

POINT 01

“工程化,而非氛围编程” ("Engineering, Not Vibe Coding")

拒绝泥球债务 · 坚守严谨边界
// ASD-STE100 精炼思想规约:

1. "Vibe coding" relies on AI without engineering discipline.

2. Unchecked AI code creates a "Big Ball of Mud" that becomes unmaintainable within weeks.

3. Faster code generation makes architecture, boundary design, and testing MORE valuable, not less.

4. Real engineers define rigorous constraints before AI writes a single line.

[PROTOTYPE] Vibe Coding 债务累积模拟器
功能累积数量: 1
代码库混乱熵增: 15%
排查修改预期耗时: 10 分钟
初始状态良好。点击按钮体验在缺乏契约与测试约束下,代码库如何退化为不可挽救的泥球状态。
POINT 02

“审问我”技术 (The "Grill Me" Technique: 需求反向质询闭环)

第一行代码前消灭 90% 返工
// Matt Pocock's "Grill Me" 核心提示规约:

"Do not generate the solution yet. Interrogate me relentlessly. Ask me 4 tough architectural questions about edge cases, state lifecycles, error states, and storage constraints before planning implementation."

[PROTOTYPE] 体验 "Grill Me" 架构审问沙箱
你的模糊功能想法:
点击按钮查看 Agent 会提出哪些隐性边界问题...
POINT 03

垂直切片与严格测试驱动 (Vertical Slices & TDD in Agentic Era)

端到端贯穿 · 测试作为物理导轨
// ASD-STE100 精炼思想规约:

1. Do not ask AI to build broad horizontal layers (e.g. "build the whole database schema").

2. Cut thin "Vertical Slices" spanning Database → Service → API → UI for a single user journey.

3. Write failing unit and integration tests first.

4. Tests provide tight mathematical feedback loops that keep AI agents on track without drift.

POINT 04

“白班规划 vs 夜班执行”工作心智模型 (Day Shift vs. Night Shift)

人类高阶架构 · AI 自主交付
人类的“白班”职责 (Day Shift - Human)
  • • 定义系统边界与业务领域模型 (DDD)
  • • 制定严格的类型契约与接口规范
  • • 编写精准的验收标准与失败测试用例
  • • 裁决架构权衡与技术栈选型
AI 智能体的“夜班”职责 (Night Shift - AI Agent)
  • • 实现样板代码与 CRUD 业务逻辑
  • • 持续运行测试套件,直到全部红灯变绿灯
  • • 消除重复代码并重构实现细节
  • • 编写边缘边界测试用例覆盖
POINT 05

类型系统作为 AI 的安全护栏 (TypeScript as Guardrails)

类型即最强约束 · 零成本纠错裁判
// 为什么严格 TS 能降伏 AI 幻觉?
在纯 JavaScript 环境下,AI 可能会捏造一个不存在的属性 user.address.postalCode,运行时静默返回 undefined;
而在严格 TypeScript 环境下,编译器会在 10 毫秒内抛出类型错误。AI Agent 接收到此报错后,无需人类介入,即可自动重构修正代码。
POINT 06

知识民主化与直觉心智模型 (Total TypeScript Educational Revolution)

消灭学术黑话 · 即时反馈实验
// ASD-STE100 精炼思想规约:

1. Traditional technical education uses obscure academic terminology to gatekeep knowledge.

2. Total TypeScript replaces lectures with 5-second interactive feedback puzzles.

3. Clear mental models allow beginner developers to gain expert intuition rapidly.

POINT 07

定制化智能体技能体系 (Agent Skills as Executable Standards)

结构化技能规范 · 统一团队标准
  • 强制禁止使用 any 或不安全的类型断言 as unknown as T
  • 强制要求每个导出的公共函数显式声明返回值类型
  • 强制要求使用 Zod 校验外部 I/O 边界
POINT 08

执行前的共享设计共识机制 (Establishing Shared Understanding)

轻量级规格对齐 · 拒绝盲目编码

AI 无法读懂开发者脑海中的隐性假设。在敲定任何代码之前,必须强制 AI 产出一份单页轻量设计草案 (One-page RFC):包括数据流向图、核心函数签名、以及它拒绝采用的备选方案及其原因。

POINT 09

防御性类型设计与零运行时开销契约 (Defensive Types & Branded Types)

品牌类型 · 编译期杜绝业务越权
// Matt Pocock 倡导的 Branded Types 工业级实战:
type UserId = string & { readonly __brand: unique symbol };
type OrderId = string & { readonly __brand: unique symbol };

function cancelOrder(userId: UserId, orderId: OrderId) { /* ... */ }

const uId = "usr_102" as UserId;
const oId = "ord_884" as OrderId;

// 编译期直接拦截!防止传反参数导致的越权:
// cancelOrder(oId, uId); // Error: Type 'OrderId' is not assignable to type 'UserId'
POINT 10

从打字员到编排架构师的终极跃迁 (The Shift from Typist to Orchestrator)

品味、系统思维与编排力
// ASD-STE100 精炼思想规约:

1. Remembering syntax and typing boilerplate no longer creates competitive advantage.

2. Future senior engineers win on Taste, Systems Thinking, and Agent Orchestration.

3. Humans define the problem and evaluate aesthetic quality.

4. Machines perform execution and verification.

[PROTOTYPE] 工程师能力权重跃迁图谱
传统初级工程师 (Past / Typist):
• 手写样板语法记忆: 70%
• 查阅 API 文档细节: 20%
• 架构契约与品味审视: 10%
AI 时代顶级编排者 (Future / Orchestrator):
• 手写样板语法记忆: 5% (由 AI 自动生成)
• TDD 测试设计与导轨验证: 35%
• 架构契约、审美品味与需求审问: 60% (核心壁垒)