.codebuddy/commands/speckit.checklist.md
核心概念: 清单是需求编写的单元测试 - 它们验证特定领域中需求的质量、清晰度和完整性.
不用于验证/测试:
用于需求质量验证:
比喻: 如果你的规范是用英文编写的代码, 那么清单就是它的单元测试套件. 你测试的是需求是否编写良好、完整、明确并准备好实施 - 而不是实现是否有效.
$ARGUMENTS
在继续之前, 你必须考虑用户输入(如果不为空).
设置: 从仓库根目录运行 .specify/scripts/bash/check-prerequisites.sh --json 并解析JSON以获取FEATURE_DIR和AVAILABLE_DOCS列表.
澄清意图(动态): 推导最多三个初始上下文澄清问题(无预编目录). 它们必须:
$ARGUMENTS中已经明确, 则单独跳过Generation algorithm:
Question formatting rules:
Defaults when interaction impossible:
Output the questions (label Q1/Q2/Q3). After answers: if ≥2 scenario classes (Alternate / Exception / Recovery / Non-Functional domain) remain unclear, you MAY ask up to TWO more targeted follow‑ups (Q4/Q5) with a one-line justification each (e.g., "Unresolved recovery path risk"). Do not exceed five total questions. Skip escalation if user explicitly declines more.
理解用户请求: 结合 $ARGUMENTS + 澄清答案:
加载功能上下文: 从 FEATURE_DIR 读取:
上下文加载策略:
生成清单 - 创建"需求的单元测试":
FEATURE_DIR/checklists/ directory if it doesn't existux.md, api.md, security.md)[domain].md/speckit.checklist run creates a NEW file (never overwrites existing checklists)核心原则 - 测试需求, 而非实现: 每个清单项目必须评估需求本身, 检查:
类别结构 - 按需求质量维度分组项目:
如何编写清单项目 - "需求编写的单元测试":
❌ WRONG (Testing implementation):
✅ CORRECT (Testing requirements quality):
项目结构: Each item should follow this pattern:
[Spec §X.Y] when checking existing requirements[Gap] marker when checking for missing requirements按质量维度分类的示例:
完整性:
清晰度:
一致性:
覆盖度:
可测量性:
场景分类与覆盖度(需求质量焦点):
可追溯性要求:
[Spec §X.Y], or use markers: [Gap], [Ambiguity], [Conflict], [Assumption]发现和解决问题(需求质量问题): Ask questions about the requirements themselves:
内容整合:
🚫 ABSOLUTELY PROHIBITED - These make it an implementation test, not a requirements test:
✅ REQUIRED PATTERNS - These test requirements quality:
结构参考: 按照 .specify/templates/checklist-template.md 中的规范模板生成清单, 包括标题、元部分、类别标题和 ID 格式. 如果模板不可用, 使用: H1 标题、purpose/created 元行、包含 - [ ] CHK### <requirement item> 行的 ## 类别部分, ID 从 CHK001 开始全局递增.
报告: 输出创建清单的完整路径、项目数量, 并提醒用户每次运行都会创建新文件. 总结:
重要说明: 每次 /speckit.checklist 命令调用都会创建一个使用简短描述性名称的清单文件, 除非文件已存在. 这允许:
ux.md, test.md, security.md)checklists/ 文件夹中轻松识别和导航为避免混乱, 请使用描述性类型, 并在完成后清理过时的清单.
UX 需求质量: ux.md
示例项目(测试需求, 而非实现):
API 需求质量: api.md
示例项目:
性能需求质量: performance.md
示例项目:
安全需求质量: security.md
示例项目:
**❌ 错误 - 这些测试实现, 而非需求: **
- [ ] CHK001 - Verify landing page displays 3 episode cards [Spec §FR-001]
- [ ] CHK002 - Test hover states work correctly on desktop [Spec §FR-003]
- [ ] CHK003 - Confirm logo click navigates to home page [Spec §FR-010]
- [ ] CHK004 - Check that related episodes section shows 3-5 items [Spec §FR-005]
**✅ 正确 - 这些测试需求质量: **
- [ ] CHK001 - Are the number and layout of featured episodes explicitly specified? [Completeness, Spec §FR-001]
- [ ] CHK002 - Are hover state requirements consistently defined for all interactive elements? [Consistency, Spec §FR-003]
- [ ] CHK003 - Are navigation requirements clear for all clickable brand elements? [Clarity, Spec §FR-010]
- [ ] CHK004 - Is the selection criteria for related episodes documented? [Gap, Spec §FR-005]
- [ ] CHK005 - Are loading state requirements defined for asynchronous episode data? [Gap]
- [ ] CHK006 - Can "visual hierarchy" requirements be objectively measured? [Measurability, Spec §FR-001]
**关键区别: **