首页 / 全部技能 / 基础工具与工作流 / spec-driven-development
基础工具与工作流 · addyosmani/agent-skills

spec-driven-development

Creates specs before coding. Use when starting a new project, feature, or significant change and no specification exists yet. Use when drafting a PRD or requirements document with objectives and scope, or when requirements are unclear, ambiguous, or only exist as a vague idea. Use when a single requirement spans several independently testable capabilities and needs decomposing into a capability map of modules before specifying.

L1 基础 · 登记来源即可V1 已固定Dual-pass Audit
💬 对话试用 (预览)
Author addyosmaniGitHub addyosmani/agent-skills ↗Stars 113872License MITCommit 301b02b12b
管控等级描述 skill 的能力与建议配套的管控措施,不代表质量或安全认证,也不表示可用或不可用。是否使用由用户和管理者决定。不同 agent 宿主对权限的约束各不相同,请勿假定宿主一定会提供安全兜底。第三方 skill 版权归原作者,使用风险由使用者自行承担。

1实现原理 · 为什么它能做到

实施严格的四阶段门禁工作流(Specify → Plan → Tasks → Implement),并在多能力复合需求前置 Phase 0 范围检查,每一步必须经人类评审核准后方可进入下一阶段。

skills/spec-driven-development/SKILL.md
Spec-driven development has four phases, preceded by a scope check (Phase 0) that activates only when one request bundles several independently testable capabilities. Do not advance to the next phase until the current one is validated.
这里在做什么:确立核心流程门禁纪律,杜绝跳步直接写代码,把每一步的设计意图都显式暴露给人类评审。

在编写具体规格前引入能力映射(Capability Map),以稳定 kebab-case 模块 ID 与单向依赖图切分多模块边界,各模块独立编写 SPEC-{id}.md。

skills/spec-driven-development/SKILL.md
**Propose a capability map before writing any spec.** Small and reviewable — a module table plus a build order, not a project plan:
这里在做什么:对捆绑了多个可独立测试功能的大型需求前置解耦,先由人类评审 10 行以内的模块关系与构建次序,避免编写庞大无序的单体 Spec。

规格撰写前强制立即公开暴露所有假设(Surface Assumptions),禁止智能体在需求模糊时自行脑补与静默决策。

skills/spec-driven-development/SKILL.md
**Surface assumptions immediately.** Before writing any spec content, list what you're assuming:
这里在做什么:把架构选型、技术栈范围、浏览器兼容性等隐性假设提前抛给人类确认,从源头杜绝因误解导致的返工。

规格说明书统一覆盖六大核心要素:明确目标、完整可执行命令、工程目录布局、真实代码风格切片、测试策略与三级行为边界。

skills/spec-driven-development/SKILL.md
Write a spec document covering these six core areas: … 1. **Objective** … 2. **Commands** … 3. **Project Structure** … 4. **Code Style** … 5. **Testing Strategy** … 6. **Boundaries**
这里在做什么:标准化规格文档结构模板,以明确的上下文边界取代自然语言的漫无边际描述。

将模糊需求重构翻译为具体、可测试的验收条件(Success Criteria),为后续验证建立确定性指标。

skills/spec-driven-development/SKILL.md
**Reframe instructions as success criteria.** When receiving vague requirements, translate them into concrete conditions:
这里在做什么:把“让仪表盘更快”等主观描述转化为“LCP < 2.5s、初始加载 < 500ms”等硬性指标,让优化和实现闭环具备客观衡量基准。

规格保存后必须硬性强制立即停轮(CRITICAL STOP),严禁在同轮会话中直接进入 Plan 或编写代码。

skills/spec-driven-development/SKILL.md
**Stop after writing the spec (CRITICAL).** Once the spec is saved: … **STOP YOUR TURN IMMEDIATELY.** Do NOT start Phase 2, invoke `planning-and-task-breakdown`, or write code in this turn.
这里在做什么:设置不可逾越的人机交互物理门禁,确保人类必须在后置回合中明确批准规格后,才可调动计划与执行流程。

保持格式无关性并兼容现有规范体系,可无缝对接 OpenSpec 等第三方规格系统而无需创建冗余副本。

skills/spec-driven-development/SKILL.md
**External spec tools:** This workflow is format-agnostic. If the project already uses OpenSpec or another specification system, keep that system's artifact format and storage conventions
这里在做什么:明确自身定位是流程控制与澄清门禁,兼容既有项目的资产结构,避免工具生态冲突。

规划产物规范化落盘:计划保存至 tasks/plan.md,任务清单写入 tasks/todo.md,为下游构建与执行命令提供标准契约。

skills/spec-driven-development/SKILL.md
Save the plan to `tasks/plan.md` and record the task list in the task list target defined by `planning-and-task-breakdown` (default `tasks/todo.md`; projects may designate an external tracker instead).
这里在做什么:确立跨技能协同的产物路径标准,使 planning-and-task-breakdown 与 incremental-implementation 等下游流程平滑衔接。

2核心能力

01Phase 0 复合需求解耦与模块依赖能力图(Capability Map)编制
02未决假设暴露清单(Surface Assumptions)前置确认
03六维规格说明书(Spec)标准模板化撰写与归档
04三级行为红线定义(Always do / Ask first / Never do)
05模糊需求重构为客观量化的验收标准(Success Criteria)
06技术实施计划制定与细粒度单会话任务拆解(Task Template)
07活文档维护纪律(决策或范围变更时同步先改 Spec 并入库版本管理)

4管控建议与判定依据

建议配套管控措施
面向 Agent
可自动加载
面向管理者
登记来源与版本
审计说明: skill 自身仅包含单个 SKILL.md 文档,无任何代码、自带脚本、二进制程序、网络端点或凭证读取操作。其指引的落盘行为属于标准项目文档输出,符合 green 档(纯指令与知识规范)判级口径。

5第二遍独立确认

  • [ok] 自身目录零代码与零网络外发 — 经检查,skills/spec-driven-development/ 下仅有 SKILL.md(13099 bytes),全量扫描无网络请求端点、无环境变量读取、无任何可执行脚本。
  • [ok] Phase 0 能力图(Capability Map)与稳定 ID 机制真实存在 — SKILL.md Phase 0 明确给出 Capability Map 表格规范(Module id / Responsibility / Depends on)与 Build order 依赖次序示例,并要求模块 ID 一经选定不可中途重命名。
  • [ok] 六大核心规格维度与模板一一对应 — SKILL.md 明确列出 Objective、Commands、Project Structure、Code Style、Testing Strategy、Boundaries 六大核心领域,并在下方给出了对齐的 Markdown Spec Template。
  • [ok] 强制停轮门禁(Critical Stop)具有绝对约束力 — SKILL.md 显式写明 'Stop after writing the spec (CRITICAL)' 并大写强调 'STOP YOUR TURN IMMEDIATELY. Do NOT start Phase 2, invoke planning-and-task-breakdown, or write code in this turn'。
  • [ok] 与下游规划技能的产物对接约定明确 — Phase 2 明确规定规划结果保存至 tasks/plan.md,任务清单录入 tasks/todo.md,并声明以 planning-and-task-breakdown 作为权威依据。

6结论

  • 首创强制停轮(Stop Your Turn Immediately)物理级人机门禁,彻底断绝了自主智能体在产出规格同轮直接偷跑编码的失控行为。
  • 前置 Phase 0 能力图拆解与假设暴露机制,把复杂的单体巨型需求和隐性认知误解化解在编写具体规格之前,大幅节省沟通与重构成本。
  • 三级行为边界(Always / Ask first / Never)为自动化任务划定了清晰的操作红线,给数据库变更、引入依赖等高危操作强制套上审批缰绳。
  • 适合: 适合中大型项目立项、全新功能模块开发、跨多文件或组件的架构级重构,以及任何需求较为模糊、涉及多方依赖且开发耗时预期超过 30 分钟的工程任务。
    不适合: 不适合单行 Bug 修复、文案拼写纠正、极度清晰自洽的微小变更,或者处于极早期、追求几分钟内快速实验扔弃的原型验证阶段。
    💬 Online Trial Chat Sandbox

    Preview this skill in an interactive chat playground. Generic LLM evaluation trial.

    💬 Open Chat Trial (Preview)
    Under construction · Generic sandbox trial
    Install Agent-Ready
    ① Accelerated Distribution dl.bestaiskill.com
    Option A · Direct Zip Download⚡ Download spec-driven-development (Zip)
    Edge-accelerated mirror via dl.bestaiskill.com
    Option B · Copy Guide for Agent
    install.json
    agent 读 JSON 指南后会自动从本站下载安装,无需更多说明。
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 301b02b12b.