with one click
speckit-specify
根据自然语言功能描述创建或更新功能规范。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
根据自然语言功能描述创建或更新功能规范。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
在任务生成后, 对 spec.md, plan.md 和 tasks.md 执行非破坏性的跨制品一致性和质量分析.
基于用户需求为当前功能生成自定义检查清单.
通过提出最多 5 个高度针对性的澄清问题, 识别当前功能规范中未充分说明的领域, 并将答案编码回规范中.
从交互式或提供的原则输入创建或更新项目章程, 确保所有依赖模板保持同步.
通过处理并执行 tasks.md 中定义的所有任务来执行实施计划
使用计划模板执行实施计划工作流, 生成设计制品.
| name | speckit-specify |
| description | 根据自然语言功能描述创建或更新功能规范。 |
| compatibility | Requires spec-kit project structure with .specify/ directory |
| metadata | {"author":"github-spec-kit","source":"templates/commands/specify.md"} |
| disable-model-invocation | true |
$ARGUMENTS
在继续之前, 你必须考虑用户输入(如果不为空)。
检查扩展钩子(规范创建前):
.specify/extensions.ymlhooks.before_specify 键下的条目enabled 明确为 false 的钩子。没有 enabled 字段的钩子默认视为已启用condition 表达式:
condition 字段, 或者为 null/空, 将该钩子视为可执行condition, 跳过该钩子并将条件评估留给 HookExecutor 实现optional 标志输出以下内容:
optional: true):
## 扩展钩子
**Optional Pre-Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
optional: false):
## 扩展钩子
**Automatic Pre-Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
Wait for the result of the hook command before proceeding to the Outline.
.specify/extensions.yml 不存在, 静默跳过用户在触发消息中 /speckit.specify 之后输入的文本就是功能描述。假设你在这个对话中始终可以获取到它, 即使下面 $ARGUMENTS 字面上显示为空。除非用户提供了空命令, 否则不要要求用户重复输入。
根据该功能描述, 执行以下操作:
生成简洁的短名称(2-4 个单词)用于分支:
创建功能分支, 通过运行带有 --short-name(和 --json)的脚本来创建。在顺序模式下, 不要传递 --number — 脚本会自动检测下一个可用编号。在时间戳模式下, 脚本会自动生成 YYYYMMDD-HHMMSS 前缀:
分支编号模式: 在运行脚本之前, 检查 .specify/init-options.json 是否存在并读取 branch_numbering 值。
如果是 "timestamp", 在脚本调用中添加 --timestamp(Bash)或 -Timestamp(PowerShell)
如果是 "sequential" 或不存在, 不添加任何额外标志(默认行为)
Bash 示例: .specify/scripts/bash/create-new-feature.sh "$ARGUMENTS" --json --short-name "user-auth" "Add user authentication"
Bash(时间戳): .specify/scripts/bash/create-new-feature.sh "$ARGUMENTS" --json --timestamp --short-name "user-auth" "Add user authentication"
PowerShell 示例: .specify/scripts/bash/create-new-feature.sh "$ARGUMENTS" -Json -ShortName "user-auth" "Add user authentication"
PowerShell(时间戳): .specify/scripts/bash/create-new-feature.sh "$ARGUMENTS" -Json -Timestamp -ShortName "user-auth" "Add user authentication"
重要:
--number — 脚本会自动确定正确的下一个编号--json, PowerShell 用 -Json), 以便输出可以被可靠地解析加载 .specify/templates/spec-template.md 以了解所需的章节。
按照此执行流程:
使用模板结构将规范写入 SPEC_FILE, 用从功能描述(参数)派生的具体细节替换占位符, 同时保留章节顺序和标题。
规范质量验证: 编写初始规范后, 根据质量标准进行验证:
a. 创建规范质量清单: 在 FEATURE_DIR/checklists/requirements.md 生成清单文件, 使用清单模板结构包含以下验证项:
# Specification Quality Checklist: [FEATURE NAME]
**Purpose**: 在进入规划阶段之前验证规范的完整性和质量
**Created**: [DATE]
**Feature**: [Link to spec.md]
## Content Quality
- [ ] No implementation details (languages, frameworks, APIs)
- [ ] Focused on user value and business needs
- [ ] Written for non-technical stakeholders
- [ ] All mandatory sections completed
## Requirement Completeness
- [ ] No [NEEDS CLARIFICATION] markers remain
- [ ] Requirements are testable and unambiguous
- [ ] Success criteria are measurable
- [ ] Success criteria are technology-agnostic (no implementation details)
- [ ] All acceptance scenarios are defined
- [ ] Edge cases are identified
- [ ] Scope is clearly bounded
- [ ] Dependencies and assumptions identified
## Feature Readiness
- [ ] All functional requirements have clear acceptance criteria
- [ ] User scenarios cover primary flows
- [ ] Feature meets measurable outcomes defined in Success Criteria
- [ ] No implementation details leak into specification
## Notes
- Items marked incomplete require spec updates before `/speckit.clarify` or `/speckit.plan`
b. 运行验证检查: 根据每个清单项审查规范:
c. 处理验证结果:
如果所有项都通过: 标记清单完成并继续第 7 步
如果有项失败(不包括 [NEEDS CLARIFICATION]):
如果仍有 [NEEDS CLARIFICATION] 标记:
从规范中提取所有 [NEEDS CLARIFICATION: ...] 标记
限制检查: 如果超过 3 个标记, 只保留 3 个最关键的(按范围/安全/用户体验影响排序), 对其余的进行合理推测
对于每个需要澄清的问题(最多 3 个), 以此格式向用户展示选项:
## 问题 [N]: [主题]
**上下文**: [引用相关规范章节]
**需要了解**: [来自 NEEDS CLARIFICATION 标记的具体问题]
**建议答案**:
| 选项 | 答案 | 影响 |
|------|------|------|
| A | [第一个建议答案] | [这对功能意味着什么] |
| B | [第二个建议答案] | [这对功能意味着什么] |
| C | [第三个建议答案] | [这对功能意味着什么] |
| 自定义 | 提供你自己的答案 | [说明如何提供自定义输入] |
**你的选择**: _[等待用户响应]_
关键 - 表格格式: 确保 markdown 表格格式正确:
| Content | 而不是 |Content||--------|按顺序编号问题(Q1, Q2, Q3 - 最多 3 个)
在等待响应之前一起展示所有问题
等待用户对所有问题的选择做出回应(例如, "Q1: A, Q2: Custom - [details], Q3: B")
通过用用户选择或提供的答案替换每个 [NEEDS CLARIFICATION] 标记来更新规范
在所有澄清问题解决后重新运行验证
d. 更新清单: 每次验证迭代后, 用当前的通过/失败状态更新清单文件
报告完成情况, 包括分支名称、规范文件路径、清单结果, 以及准备好进入下一阶段(/speckit.clarify 或 /speckit.plan)。
检查扩展钩子: 报告完成后, 检查项目根目录下是否存在 .specify/extensions.yml。
hooks.after_specify 键下的条目enabled 明确为 false 的钩子。没有 enabled 字段的钩子默认视为已启用condition 表达式:
condition 字段, 或者为 null/空, 将该钩子视为可执行condition, 跳过该钩子并将条件评估留给 HookExecutor 实现optional 标志输出以下内容:
optional: true):
## 扩展钩子
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
optional: false):
## 扩展钩子
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
.specify/extensions.yml 不存在, 静默跳过注意: 脚本会创建并切换到新分支, 在写入之前初始化规范文件。
从用户提示创建此规范时:
合理默认值示例(不要询问这些):
成功标准必须:
好的示例:
不好的示例(以实现为中心):