【AI原生研发转型·第4篇】没有计划不写码,机构知识变成文件
系列导语:本系列基于 Anthropic《The AI-Native SDLC Playbook》改写,保留 Claude Code / Claude Tag / MCP 等原品牌名。前几篇讲了意图和设计,这篇进第三阶段Build——最"重"的一个,也是最值得啃的。
《The AI-Native SDLC Playbook》相关文章链接:https://blog.csdn.net/justlookxia/article/details/164093318
agent 唰一下吐出大半个 diff,你敢直接合吗?
AI-native 的 Build 阶段,核心就一句话:没有"被接受的计划"就不实现;机构知识变成文件;护栏跑在代码层。
a) plan mode 当默认起点
传统:工程师读设计直接写码,计划只在脑中或工单里,评审看到 diff 才改。
AI-native:开plan mode,让 Claude 产出plan.md——可以查代码、但不改代码。
你审的是"计划",不是"改完的 diff"。审完提交,再去实现。
一份plan.md长这样:
# Plan: claims status self-service (from intent.md 2026-06-02) ## Files that change portal/src/claims/StatusPanel.tsx (new), claims-api/routes/status.py, claims-api/tests/test_status.py ## Order of work 1. Add the status endpoint behind existing auth. 2. Panel against the endpoint. 3. Wire into the portal nav. ## Risks The claims-core API rate-limits at 50 rps; the panel must cache. ## Proof test_status.py covers the four claim states; screenshot matches the approved mock.b) auto mode:护栏成熟后默认自动
计划被批准后,Claude 可以进入auto mode自动改代码。
前提是护栏已经调熟——CLAUDE.md、skills、hooks、测试都到位。
成熟之后,例常工作默认 auto-accept,再配合worktrees并行推进多个特性。
c) 旁注:定好"事实源"
每个 artifact 都要声明"哪个系统是唯一事实源":repo 为源 / 旧系统(如 Jira)为源(通过 MCP connector 写回)/ 或只放最低限度链接。不要让两份东西"都算数"。
d) CLAUDE.md:给 agent 的"新人手册"
把"新人不说就懂"的上下文写进去——命令、架构、易错点。
用/init生成 → 剪到一页以内→ 提交仓库根 → 凡 Claude 错两次的,写进文件。
# Payments service ## Commands - Build: make build - Test: make test (unit), make itest (integration, needs docker) - Lint: make lint (runs in CI; fix before pushing) ## Conventions - Java 21, Spring Boot 3. No new Lombok. - Money is always BigDecimal, never double. - Every endpoint needs an integration test in src/itest. ## Architecture - api/ holds REST controllers, core/ holds domain logic, adapters/ talks to external systems. - Kafka events are defined in schemas/; never edit generated classes. ## Things Claude gets wrong - Do not bump dependency versions; the platform team owns them. - The legacy v1/ package is frozen; changes go in v2/.e) Skills 即机构知识
把"我们怎么做 XX"封装进SKILL.md,放.claude/skills/<name>/或走插件分发。
例如一个 API 安全审查 skill:
--- name: secure-api-review description: Apply the API security standard. Use whenever creating or modifying an external-facing endpoint, reviewing API code, or generating an OpenAPI spec. --- # Secure API review When you create or change an API endpoint: 1. Authentication: every endpoint requires the gateway JWT; no anonymous routes outside /health. 2. Input validation: validate request bodies against the OpenAPI schema and reject unknown fields. 3. Audit: every state-changing endpoint emits an audit event with actor, action, entity and timestamp. 4. Data classification: fields tagged pii in the schema must never appear in logs or error messages. Run scripts/check-endpoints.sh and include its output in your summary.f) Hooks:构建期的确定性护栏
挡住对保护路径的编辑、跑 formatter/linter、挡住密钥进 diff。被"背书"的 skill,必须有 hook 或 PR 复查兜底。
g) 并行会话与子智能体
并行会话 = 独立的 Claude Code 实例 + git worktree(claude --worktree feature-auth)。子智能体在.claude/agents/定义,比如一个只"验工不修"的 verifier:
--- name: verifier description: Runs the app and checks the change works before the session reports done tools: Bash, Read --- Start the app with make run. Exercise the changed behavior and the two nearest neighboring flows. Report what you ran, what you saw, and any behavior that does not match plan.md. Do not fix anything; report only.下篇预告
第 5 篇Test:怎么让 agent 在把成果交给你之前,自己先验收一遍——反馈回路 + CI 里的持续 evals。
系列文快链:
- 【AI原生研发转型·第1篇】为什么你的AI写码很快,团队却还是慢?
- 【AI原生研发转型·第2篇】想法不该等人写文档:用intent.md把意图一次性钉死
- 【AI原生研发转型·第3篇】需求与设计合体:一次会话出spec.md
- 【AI原生研发转型·第4篇】没有计划不写码,机构知识变成文件
- 05-08待发布
原文出处:https://claude.com/blog/the-ai-native-sdlc-playbook (Louis Claxton, 2026-08-21, Anthropic)
系列索引:① 总论 · ② Plan · ③ Design · ④ Build(本篇)· ⑤ Test · ⑥ Deploy · ⑦ Maintain · ⑧ 番外
本系列为外部技术博客的改写,保留原品牌名,仅供团队学习交流。
