2025-09-27 Spec-Code-Tests范式-SpecStory背后的方法论介绍

背景

有个小公司出了specstory的cursor增强插件https://specstory.com/

附带方法论白皮书:Beyond Code-Centric Agents Code, but the Problem of Clear Specification Remains

核心观点

当下软件工程的范式已经转移,实现变得非常廉价,但是spec的清晰表达问题依然存在,且随着Agent的加入,协作协调变得更加复杂,所以清晰表达的重要性更加凸显

Implementation becomes the domain of agents. The most valuable people are the clearest thinkers: software composers3 and conductors who will orchestrate agents to build systems once requiring much larger teams.

整洁代码的方法论并没有推翻,整洁代码依然重要,而且新增了的整洁specs要求

代码负责实现,人负责设计、优先级排序和决策,这些AI不能替代

  1. Agents are excellent at implementation given solid specifications.

  2. Humans remain indispensable for design, prioritization, and judgment.

  3. The gap between English language specification and code is narrowing.

提出了一个新的工作流:SpecFlow:

SpecFlow:预规划、路线图分解、工作计划分解、执行、更新与迭代

Plan first, act second. Specflow accomplishes this in five steps:

  1. Pre-plan: PMs define user outcomes; designers add patterns; engineers list constraints. A top reasoning model (Claude 4, GPT-o3) helps synthesize.

  2. Roadmap: Everyone co-authors a markdown roadmap in the repo.

  3. Workplans: Each roadmap phase is broken down into human and AI-executable tasks. This forces implicit knowledge out into the open.

  4. Execute: Agents tackle tasks; anyone can intervene because context lives in git.

  5. Update & R

提出新范式:意图 + 代码 + 测试

我们构想的未来技术栈并非要取代"整洁代码"原则,而是将其演进至一个实现可由智能体廉价完成、而协调成本却日益高昂的新时代。

  • 声明式意图:作为一等规范,它凝聚了产品、设计和架构等各方诉求;

  • 代码:其清晰性、可维护性及运行时行为依然关键,但如今仅作为已声明意图的一种可能实现形式存在;

  • 测试:它既要验证意图本身,也要验证其实现方式,从而确保各利益相关方对解决方案达成一致。

新的职责定义:

• PMs: testable user behaviors (functional intent).

• Designers: coded constraints: spacing, components, interactions (design intent).

• Architects: explicit interfaces, contracts, and dependencies (technical intent).

人类优势(与投资回报)的新所在:

在这一新格局中,优势来源于人类专精于只有人类才能完成的工作。然而,这类工作的本质已然改变。

  • 领域建模与架构仍需人类洞见,尤其是当隐性知识必须为AI明确阐述时。人类能发现语言模型无法察觉的隐藏关联与未言明的需求,但我们必须将这些洞见转化为智能体可执行的规范。

  • 意图定义与细化变得至关重要。编写既足够精确供AI实施,又足够灵活以支持迭代优化的技术规范,已成为一项专业技能。这解决了指导难题:虽然84%的学编程开发者使用AI工具,但资深开发者现在必须传授规范与架构设计,而非语法。

  • 质量评判仍由人类主导,但方式已变。我们不再逐行检查代码

  • 语境维护与演进至关重要,代码库必须构建一条人类与AI智能体皆可追溯的连贯逻辑脉络。

其他洞见:

代码是其中一种实现,并不是唯一实现。标准是Spec

The Sacred Rule: Never Let AI Specify Your Tests. We think its specification that matters. If AI specifies them then control is ceded (验证要掌握在人手里。XTDD是黄金范式)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容