spec-kit-analyze
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpec Kit Analyze
Spec Kit 分析
Run a non-destructive cross-artifact quality audit before implementation.
在实施前执行无破坏性的跨文档质量审计。
When to Use
适用场景
- exists and you want a pre-implementation consistency check across spec/plan/tasks.
tasks.md - You suspect coverage gaps, requirement drift, ambiguous language, or contradictory artifacts.
- You need a constitution-alignment gate without editing artifacts yet.
- 已存在,且你希望在实施前对spec/plan/tasks进行一致性检查。
tasks.md - 你怀疑存在覆盖缺口、需求偏离、表述模糊或文档矛盾的情况。
- 你需要一个规范对齐检查环节,且暂时不修改文档。
When Not to Use
不适用场景
- Any prerequisite artifact is missing (,
spec-kit-specify, orspec-kit-planfirst).spec-kit-tasks - You need targeted remediation edits now ().
spec-kit-reconcile - You are executing implementation work ().
spec-kit-implement
- 缺少任何前置文档(需先执行、
spec-kit-specify或spec-kit-plan)。spec-kit-tasks - 你现在需要针对性的修正编辑(使用)。
spec-kit-reconcile - 你正在执行实施工作(使用)。
spec-kit-implement
Router Fit
流程适配
- Primary route from after
spec-kit.spec-kit-tasks - Read-only quality gate before .
spec-kit-implement - Default handoff to when findings require coordinated artifact updates.
spec-kit-reconcile
- 是在
spec-kit之后的主要流程节点。spec-kit-tasks - 是之前的只读质量检查环节。
spec-kit-implement - 当发现问题需要协调更新文档时,默认流转到。
spec-kit-reconcile
Critical Constraints
关键约束
- Strictly read-only: do not modify files.
- Treat as authoritative; any MUST-level conflict is
memory/constitution.md.CRITICAL
- 严格只读:不得修改文件。
- 将视为权威文件;任何违反MUST级要求的冲突均为
memory/constitution.md(严重)级别。CRITICAL
Preconditions
前置条件
- Run from repository root (or a subdirectory inside it).
- Active feature context resolves to one feature directory with ,
spec.md, andplan.md.tasks.md
- 从仓库根目录(或其子目录)运行。
- 当前功能上下文指向包含、
spec.md和plan.md的单个功能目录。tasks.md
Workflow
工作流程
-
Resolve artifact paths and enforce prerequisite gate:
- Run exactly once.
scripts/check-prerequisites.sh --json --require-tasks --include-tasks - Parse:
FEATURE_DIRAVAILABLE_DOCS
- Derive:
SPEC = FEATURE_DIR/spec.mdPLAN = FEATURE_DIR/plan.mdTASKS = FEATURE_DIR/tasks.md
- If any required artifact is missing, stop and route to the owning sibling skill.
- Run
-
Load focused sections from:
- : requirements, stories, acceptance criteria, edge cases.
spec.md - : architecture/stack decisions, phases, constraints.
plan.md - : task IDs, phase grouping,
tasks.mdmarkers, referenced paths.[P] - : principle names and normative MUST/SHOULD statements.
memory/constitution.md
-
Build internal maps:
- Requirement inventory (functional + non-functional) with stable keys.
- Story/action inventory with acceptance-test intent.
- Task-to-requirement/story coverage mapping.
- Constitution obligations relevant to spec/plan/tasks scope.
-
Detect and classify issues:
- Duplication: overlapping or near-duplicate requirements.
- Ambiguity/placeholders: vague quality terms, TODO/TKTK/placeholder tokens.
- Underspecification: requirements lacking measurable outcomes or clear objects.
- Constitution conflicts: violations against MUST principles ().
CRITICAL - Coverage gaps: requirements without tasks and tasks without mapped requirement/story.
- Cross-artifact inconsistency: terminology drift, entity mismatch, ordering contradictions.
- Cap findings at 50 rows; summarize overflow counts by category.
-
Assign severity and output a compact report with stable IDs, coverage table, and metrics.
- : constitution MUST violations, missing core coverage that blocks baseline behavior.
CRITICAL - : conflicting/duplicate requirements, untestable or high-risk ambiguity.
HIGH - : terminology drift, non-functional coverage gaps, underspecified edge cases.
MEDIUM - : wording/style cleanup without execution impact.
LOW
-
Recommend next actions:
- If /
CRITICALfindings require cross-artifact edits, blockHIGHand route tospec-kit-implementwith a concise gap summary.spec-kit-reconcile - If only one artifact needs focused updates, route to its owner skill (,
spec-kit-specify, orspec-kit-plan).spec-kit-tasks - Otherwise provide prioritized improvements and whether implementation can proceed.
- If
-
Offer follow-up only:
- Ask whether to run using top findings as the gap report.
spec-kit-reconcile - Do not apply any edits in this skill.
- Ask whether to run
-
解析文档路径并执行前置检查:
- 准确执行一次脚本。
scripts/check-prerequisites.sh --json --require-tasks --include-tasks - 解析以下内容:
FEATURE_DIRAVAILABLE_DOCS
- 推导路径:
SPEC = FEATURE_DIR/spec.mdPLAN = FEATURE_DIR/plan.mdTASKS = FEATURE_DIR/tasks.md
- 如果缺少任何必需文档,停止流程并流转到对应的关联工具。
- 准确执行一次
-
加载以下文档的重点内容:
- :需求、用户故事、验收标准、边缘案例。
spec.md - :架构/技术栈决策、阶段划分、约束条件。
plan.md - :任务ID、阶段分组、
tasks.md标记、引用路径。[P] - :原则名称及规范性的MUST/SHOULD声明。
memory/constitution.md
-
构建内部映射表:
- 需求清单(功能性+非功能性)及稳定键值。
- 用户故事/动作清单及验收测试意图。
- 任务到需求/用户故事的覆盖映射。
- 与spec/plan/tasks范围相关的规范约束。
-
检测并分类问题:
- 重复:重叠或近乎重复的需求。
- 歧义/占位符:模糊的质量术语、TODO/TKTK/占位符标记。
- 规格不足:缺少可衡量结果或明确对象的需求。
- 规范冲突:违反MUST级原则(标记为)。
CRITICAL - 覆盖缺口:未对应任务的需求,以及未映射到需求/用户故事的任务。
- 跨文档不一致:术语偏差、实体不匹配、顺序矛盾。
- 最多显示50条问题;超出部分按类别汇总数量。
-
分配问题严重程度,并输出包含稳定ID、覆盖表和指标的简洁报告:
- (严重):违反MUST级规范、缺失阻碍基线功能的核心覆盖。
CRITICAL - (高):需求冲突/重复、不可测试或高风险的歧义。
HIGH - (中):术语偏差、非功能性需求覆盖缺口、规格不足的边缘案例。
MEDIUM - (低):不影响执行的措辞/风格优化。
LOW
-
推荐后续操作:
- 如果/
CRITICAL级问题需要跨文档编辑,阻止HIGH流程,并流转到spec-kit-implement,同时提供简洁的缺口摘要。spec-kit-reconcile - 如果仅需更新单个文档,流转到对应的工具(、
spec-kit-specify或spec-kit-plan)。spec-kit-tasks - 否则提供优先级排序的改进建议,以及是否可以继续实施。
- 如果
-
仅提供后续操作选项:
- 询问是否使用发现的主要问题作为缺口报告,运行。
spec-kit-reconcile - 本工具不执行任何编辑操作。
- 询问是否使用发现的主要问题作为缺口报告,运行
Output
输出
- Markdown report only (no file writes) containing:
- Findings table:
ID | Category | Severity | Location(s) | Summary | Recommendation - Requirement coverage table:
Requirement Key | Has Task? | Task IDs | Notes - Constitution alignment issues (if any)
- Unmapped tasks (if any)
- Metrics:
- Total requirements
- Total tasks
- Coverage percentage
- Ambiguity count
- Duplication count
- Critical issues count
- Next-step routing recommendation
- Findings table:
- 仅输出Markdown报告(不写入文件),包含:
- 问题表:
ID | 类别 | 严重程度 | 位置 | 摘要 | 建议 - 需求覆盖表:
需求键值 | 是否有对应任务 | 任务ID | 备注 - 规范对齐问题(若有)
- 未映射任务(若有)
- 指标:
- 总需求数
- 总任务数
- 覆盖百分比
- 歧义问题数
- 重复问题数
- 严重问题数
- 后续流程流转建议
- 问题表:
References
参考资料
references/command-analyze.mdscripts/check-prerequisites.shhttps://github.com/github/spec-kit/blob/9111699cd27879e3e6301651a03e502ecb6dd65d/templates/commands/analyze.md
references/command-analyze.mdscripts/check-prerequisites.shhttps://github.com/github/spec-kit/blob/9111699cd27879e3e6301651a03e502ecb6dd65d/templates/commands/analyze.md