️ (可选) /speckit.constitution - 项目原则
用途:定义项目的核心原则和开发规范
何时使用:项目开始时(可选)
输入示例:
/speckit.constitution
我们的项目遵循:
1. 测试驱动开发(TDD)是强制的
2. 代码必须有详细的文档注释
3. 使用 TypeScript + React
示例提示词:
创建以代码质量、测试标准、用户体验一致性和性能要求为重点的原则。包括指导技术决策和实施选择的治理机制。
输出:
.specify/memory/constitution.md- 项目宪章
1️⃣ /speckit.specify - 规范化
用途:将功能需求转化为清晰的规范文档,创建AI可读需求文档,不要指定技术栈
何时使用:开发新功能的第一步
输入示例:
/speckit.specify
开发一个用户注册功能。用户可以通过邮箱和密码注册账号,
系统需要验证邮箱格式,密码强度至少8位包含字母和数字。
输出:
spec.md- 功能规范文档checklists/requirements.md- 质量检查清单
️ (可选) /speckit.clarify - 需求澄清
用途:解决规范中的模糊和歧义问题
何时使用:规范化后、/speckit.plan 规划前(可选),也可以多次运行
输入示例:
/speckit.clarify
效果:
- 识别需求中的不明确之处
- 提出结构化问题
- 更新规范文档
在这个阶段,还可以让 Claude Code 验证《评审与验收清单》,勾选已验证/符合要求的项目,并保留未勾选的项目。可以使用以下提示:
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.
阅读审查和验收清单,如果功能规范符合标准,请勾选清单中的每一项。如果不符合,请留空。
2️⃣ /speckit.plan - 技术规划
用途:制定功能的技术实现方案,创建技术方案,这步需要你指定技术栈和架构选择
何时使用:规范明确后
输入示例:
/speckit.plan
We are going to generate this using .NET Aspire, using Postgres as the database. The frontend should use
Blazor server with drag-and-drop task boards, real-time updates. There should be a REST API created with a projects API,
tasks API, and a notifications API.
我们将使用 .NET Aspire 来生成这个,使用 Postgres 作为数据库。前端应该使用 Blazor 服务器,并具有拖放任务板和实时更新功能。还应该创建一个 REST API,包括项目 API、任务 API 和通知 API。
输出:
plan.md- 技术实现计划data-model.md- 数据模型contracts/- API 接口定义research.md- 技术决策
如果你选择的技术栈是快速变化的(例如.NET Aspire、JS 框架),你可能想要求 Claude Code 研究其详细信息,使用如下提示:
I want you to go through the implementation plan and implementation details, looking for areas that could benefit from additional research as .NET Aspire is a rapidly changing library. For those areas that you identify that require further research, I want you to update the research document with additional details about the specific versions that we are going to be using in this Taskify application and spawn parallel research tasks to clarify any details using research from the web.
我希望你仔细审查实施计划及实施细节,寻找可能需要额外研究的地方,因为.NET Aspire是一个快速发展的库。对于你识别出的需要进一步研究的地方,我希望你更新研究文档,补充我们在这个Taskify应用程序中将要使用的具体版本信息,并启动并行研究任务,通过网络研究来澄清任何细节。
在这个过程中,你可能会发现 Claude Code 卡在研究错误的事情上——你可以用这样的提示来帮助它朝正确的方向前进:
I think we need to break this down into a series of steps. First, identify a list of tasks that you would need to do during implementation that you're not sure of or would benefit from further research. Write down a list of those tasks. And then for each one of these tasks, I want you to spin up a separate research task so that the net results is we are researching all of those very specific tasks in parallel. What I saw you doing was it looks like you were researching .NET Aspire in general and I don't think that's gonna do much for us in this case. That's way too untargeted research. The research needs to help you solve a specific targeted question.
我认为我们需要将这个问题分解成一系列步骤。首先,确定一个任务清单,这些任务是在实施过程中你不确定或需要进一步研究的。写下这些任务。然后,针对每一个任务,我要你启动一个独立的研究任务,这样最终的结果是我们可以并行研究所有这些非常具体的任务。我看到的你做的是,看起来你在研究.NET Aspire的总体情况,我不认为这在这种情况下对我们有什么帮助。这太不具体了。研究需要帮助你解决一个具体的目标问题。
Claude Code 可能会过于急切,添加你没有要求的功能。要求它解释变更的理由和来源。
有了计划,你应该让 Claude Code 运行一遍以确保没有遗漏的部分。你可以使用这样的提示:
Now I want you to go and audit the implementation plan and the implementation detail files. Read through it with an eye on determining whether or not there is a sequence of tasks that you need to be doing that are obvious from reading this. Because I don't know if there's enough here. For example, when I look at the core implementation, it would be useful to reference the appropriate places in the implementation details where it can find the information as it walks through each step in the core implementation or in the refinement.
现在我要你去审核实施计划和实施细节文件。仔细阅读,看看是否有一系列任务需要你做,这些任务从阅读中应该很明显。因为我不知道这里是否足够。例如,当我查看核心实施时,引用实施细节中适当的位置,以便它在核心实施或细化过程中逐步找到信息,这会很有用。
(可选)/speckit.checklist - 质量检查
用途: 生成质量检查清单以验证需求的完整性、清晰度和一致性
何时使用:在 /speckit.plan 后或其它任何阶段验证质量(可选)
输入示例:
/speckit.checklist
为登录功能创建安全检查清单
输出:
checklists/[名称].md- 定制化检查清单
3️⃣ /speckit.tasks - 任务分解
用途:将技术方案分解为可执行的任务清单, 拆成可执行任务
何时使用:技术方案完成后
输入示例:
/speckit.tasks
输出:
tasks.md- 详细任务清单
(可选)/speckit.analyze - 一致性分析
用途:检查规范、计划、任务的一致性
何时使用:/speckit.tasks 任务分解后、/speckit.implement实现前(可选)
输入示例:
/speckit.analyze
输出:
- 一致性分析报告
- 问题清单和修复建议
4️⃣ /speckit.implement - 实现
用途:代码实现,按任务清单逐步实现功能代码
何时使用:所有准备工作完成后
输入示例:
/speckit.implement
效果:
- 按阶段执行任务
- 遵循 TDD 原则
- 自动跟踪进度