首页 AI系列87:规范驱动开发
文章
取消

AI系列87:规范驱动开发

先安装 specify-cli

安装uv

在ps运行

powershell -ExecutionPolicy ByPass -c “irm https://astral.sh/uv/install.ps1 | iex” uv tool install specify-cn-cli –from git+https://github.com/linfee/spec-kit-cn.git 升级

uv tool install specify-cn-cli –force –from git+https://github.com/linfee/spec-kit-cn.git

specify-cn init

使用 specify init

常用

//.当前目录 –no-git 不创建.git目录,

specify-cn init . –no-git –ai copilot –script sh

确立项目原则

创建项目的管理原则和开发指南,指导后续开发

/speckit.constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements

会创建一个.specify/memory/constitution.md

创建需求

/speckit.specify Build an application that can help me organize my photos in separate photo albums. Albums are grouped by date and can be re-organized by dragging and dropping on the main page. Albums are never in other nested albums. Within each album, photos are previewed in a tile-like interface. 描述你想构建的内容。关注 what and why,需求和用户故事之类,而不是技术栈。

制定技术实施计划

可选的 /speckit.clarify 澄清未明确的领域,还可以让cc验证下你的checklist: Read the review and acceptance checklist, and check off each item in the checklist if the feature spec meets the criteria. Leave it empty if it does not.

然后提供你的技术栈和架构选择 /speckit.plan The application uses Vite with minimal number of libraries. Use vanilla HTML, CSS, and JavaScript as much as possible. Images are not uploaded anywhere and metadata is stored in a local SQLite database. 执行后要检查 research.md 是否使用了正确的技术栈

任务拆解

/speckit.tasks

会创建 tasks.md 每个用户故事都拥有自己的一组任务

执行

/speckit.constitution - 建立项目原则

/speckit.specify - 创建基线规范

/speckit.clarify (可选) - 在规划前询问结构化问题以降低模糊区域的风险 (如果使用,在 /speckit.plan 前运行,也可以在任何阶段运行)

/speckit.plan - 创建实施计划

/speckit.checklist (可选) - 生成质量检查清单以验证需求的完整性、清晰度和一致性 (在 /speckit.plan 后)

/speckit.tasks - 生成可执行任务

/speckit.analyze (可选) - 交叉制品一致性和对齐报告 (在 /speckit.tasks 后,/speckit.implement 前)

/speckit.implement - 执行实施

其实是使用prompt功能实现的

支持从vibe-coding to AI-native development开发新范式 参考 https://github.com/github/spec-kit

本文由作者按照 CC BY 4.0 进行授权