spec-kit-plan
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpec Kit Plan
Spec Kit 规划
Generate implementation design artifacts from the approved feature specification.
从已获批的功能规格说明书生成实现设计工件。
When to Use
使用场景
- exists and you need
spec.mdplus Phase 0/1 design outputs for task generation.plan.md - is missing, stale, or invalid after changes to
plan.mdorspec.md.memory/constitution.md - The next step is , but technical context and design decisions are not yet documented.
spec-kit-tasks
- 已存在,且需要
spec.md以及用于任务生成的第0/1阶段设计输出。plan.md - 在或
spec.md变更后,memory/constitution.md缺失、过时或无效。plan.md - 下一步是执行,但技术背景和设计决策尚未形成文档。
spec-kit-tasks
When Not to Use
不适用场景
- No usable exists yet (
spec.mdfirst).spec-kit-specify - High-impact ambiguity in still blocks architecture or validation decisions (
spec.mdfirst).spec-kit-clarify - You are decomposing design into executable work items ().
spec-kit-tasks - You only need a read-only consistency audit ().
spec-kit-analyze - You are reconciling cross-artifact drift discovered mid-work ().
spec-kit-reconcile
- 尚无可用的(需先执行
spec.md)。spec-kit-specify - 中存在高影响的歧义,仍会阻碍架构或验证决策(需先执行
spec.md)。spec-kit-clarify - 正在将设计分解为可执行的工作项(应使用)。
spec-kit-tasks - 仅需进行只读一致性审计(应使用)。
spec-kit-analyze - 正在协调工作过程中发现的跨工件偏差(应使用)。
spec-kit-reconcile
Router Fit
工作流适配
- Primary route from after
spec-kit/spec-kit-specify.spec-kit-clarify - Must complete before .
spec-kit-tasks - Depends on constitution output from .
spec-kit-constitution
- 是在
spec-kit/spec-kit-specify之后的主要流程环节。spec-kit-clarify - 必须在之前完成。
spec-kit-tasks - 依赖输出的constitution文件。
spec-kit-constitution
Preconditions
前置条件
- Work from the target repository root.
- Active feature branch resolves to a spec directory (format when git is available).
NNN-feature-name - exists and is current for planning gates.
memory/constitution.md
- 在目标仓库根目录下开展工作。
- 活跃功能分支对应到一个规格目录(当Git可用时,格式为)。
NNN-feature-name - 已存在,且针对规划检查项是最新的。
memory/constitution.md
Workflow
工作流程
-
Resolve active feature paths and initialize:
plan.md- Run exactly once.
scripts/setup-plan.sh --json - Parse and retain: ,
FEATURE_SPEC,IMPL_PLAN,SPECS_DIR.BRANCH - If the script exits non-zero (for example branch gate failure), stop and report the blocking error.
- Run
-
Enforce artifact gates before writing design outputs:
- If (
FEATURE_SPEC) is missing, stop and route tospec.md.spec-kit-specify - If is missing, stop and route to
memory/constitution.md.spec-kit-constitution - If has unresolved high-impact ambiguity that can change architecture, data model, testing, UX, operations, or compliance, stop and route to
spec.md.spec-kit-clarify
- If
-
Load planning inputs with template fallback:
- Required: ,
spec.md.memory/constitution.md - Preferred plan template: .
{REPO_ROOT}/.specify/templates/plan-template.md - Fallback template: .
assets/plan-template.md - Preserve template heading order; replace placeholders rather than adding parallel structures.
- Required:
-
Draftcore sections:
plan.md- Complete Summary and Technical Context.
- Mark unknown technical decisions as .
NEEDS CLARIFICATION - Fill Constitution Check from with explicit pass/fail status.
memory/constitution.md - Select one concrete project structure and remove unused template options.
- Use Complexity Tracking only when a constitutional violation remains and is explicitly justified.
-
Run Phase 0 research ():
research.md- Turn each in Technical Context into a focused research question.
NEEDS CLARIFICATION - Record outcomes as:
DecisionRationaleAlternatives considered
- Resolve all blockers needed for design decisions before continuing.
- Turn each
-
Run Phase 1 design outputs:
- Create/update with entities, fields, relationships, validation rules, and state transitions where relevant.
data-model.md - Create/update for externally visible interfaces that the feature introduces or modifies.
contracts/ - Create/update with concrete validation flow for the designed feature.
quickstart.md - Reflect final decisions back into so downstream task generation has a single source of truth.
plan.md
- Create/update
-
Update agent context (explicit user approval required):
- Before running the script, ask for explicit approval to update agent context files (for example ,
AGENTS.md,CLAUDE.md,GEMINI.md)..github/agents/copilot-instructions.md - Run from repository root only after user approval.
scripts/update-agent-context.sh - If an agent type is provided by the user, pass it as the first argument.
- If approval is declined or unavailable, skip this step and report it as skipped.
- Report script failures explicitly; do not silently skip context updates.
- Before running the script, ask for explicit approval to update agent context files (for example
-
Re-check gates and report completion:
- Re-evaluate Constitution Check after Phase 1 outputs.
- Stop with if unresolved constitutional violations or unresolved blocking clarifications remain.
ERROR - Report , absolute artifact paths, and readiness for
BRANCH.spec-kit-tasks
-
解析活跃功能路径并初始化:
plan.md- 准确执行一次。
scripts/setup-plan.sh --json - 解析并保留以下变量:、
FEATURE_SPEC、IMPL_PLAN、SPECS_DIR。BRANCH - 如果脚本非零退出(例如分支检查项失败),停止操作并报告阻塞错误。
- 准确执行一次
-
在编写设计输出前强制执行工件检查项:
- 如果(即
FEATURE_SPEC)缺失,停止操作并引导至spec.md。spec-kit-specify - 如果缺失,停止操作并引导至
memory/constitution.md。spec-kit-constitution - 如果中存在未解决的高影响歧义,可能会改变架构、数据模型、测试、UX、运维或合规性,停止操作并引导至
spec.md。spec-kit-clarify
- 如果
-
加载规划输入并使用模板回退:
- 必需文件:、
spec.md。memory/constitution.md - 首选规划模板:。
{REPO_ROOT}/.specify/templates/plan-template.md - 回退模板:。
assets/plan-template.md - 保留模板的标题顺序;替换占位符而非添加并行结构。
- 必需文件:
-
编写核心章节:
plan.md- 完成“摘要”和“技术背景”部分。
- 将未知的技术决策标记为。
NEEDS CLARIFICATION - 从中填充“合规性检查”部分,并明确标记通过/失败状态。
memory/constitution.md - 选择一种具体的项目结构,并移除未使用的模板选项。
- 仅当存在合规性违规且已明确说明理由时,才使用复杂度跟踪。
-
执行第0阶段研究(生成):
research.md- 将“技术背景”中的每个转换为聚焦的研究问题。
NEEDS CLARIFICATION - 按以下格式记录结果:
- (决策)
Decision - (理由)
Rationale - (考虑过的替代方案)
Alternatives considered
- 在继续之前解决所有设计决策所需的阻塞问题。
- 将“技术背景”中的每个
-
执行第1阶段设计输出:
- 创建/更新,包含实体、字段、关系、验证规则和相关的状态转换(如适用)。
data-model.md - 创建/更新目录,用于该功能引入或修改的外部可见接口。
contracts/ - 创建/更新,包含所设计功能的具体验证流程。
quickstart.md - 将最终决策反馈到中,以便下游任务生成有单一的事实来源。
plan.md
- 创建/更新
-
更新Agent上下文(需要明确的用户批准):
- 在运行脚本前,请求明确批准以更新Agent上下文文件(例如、
AGENTS.md、CLAUDE.md、GEMINI.md)。.github/agents/copilot-instructions.md - 仅在获得用户批准后,从仓库根目录执行。
scripts/update-agent-context.sh - 如果用户提供了Agent类型,将其作为第一个参数传递。
- 如果被拒绝或无法获得批准,跳过此步骤并报告已跳过。
- 明确报告脚本执行失败;不要静默跳过上下文更新。
- 在运行脚本前,请求明确批准以更新Agent上下文文件(例如
-
重新检查检查项并报告完成:
- 在第1阶段输出后重新评估合规性检查。
- 如果存在未解决的合规性违规或未解决的阻塞性澄清需求,以状态停止操作。
ERROR - 报告、工件的绝对路径,以及是否已准备好执行
BRANCH。spec-kit-tasks
Output
输出结果
- :
plan.md- Fully populated from the selected plan template.
- Technical Context reflects final decisions from Phase 0.
- Constitution Check is explicit (,
pass, or justified exception).fail - Project Structure shows one concrete layout (no placeholder option blocks).
- :
research.md- One entry per planning unknown using:
DecisionRationaleAlternatives considered
- Resolves all blocking items required for design.
NEEDS CLARIFICATION
- One entry per planning unknown using:
- :
data-model.md- Captures entities, fields, relationships, validation constraints, and relevant state transitions.
- Maps model decisions back to spec requirements where practical.
- (when applicable):
contracts/*- Defines each new/changed external interface (endpoint/event/schema).
- Includes input/output shape, validation/error behavior, and compatibility notes.
- :
quickstart.md- Describes a concrete validation flow for the designed feature.
- Covers primary success path plus key error/edge behavior from the spec.
- Updated agent context file(s) from (only when user-approved):
scripts/update-agent-context.sh- Contains newly introduced technologies from the final plan.
- Preserves user-maintained manual sections.
- If the user does not approve context updates:
- Report that agent context sync was intentionally skipped.
- :
plan.md- 从所选规划模板完全填充。
- 技术背景反映了第0阶段的最终决策。
- 合规性检查明确标记(、
pass或有正当理由的例外)。fail - 项目结构显示一种具体的布局(无占位符选项阻塞)。
- :
research.md- 每个规划未知项对应一个条目,格式为:
DecisionRationaleAlternatives considered
- 解决了设计所需的所有阻塞性项。
NEEDS CLARIFICATION
- 每个规划未知项对应一个条目,格式为:
- :
data-model.md- 记录实体、字段、关系、验证约束和相关的状态转换。
- 尽可能将模型决策映射回规格需求。
- (如适用):
contracts/*- 定义每个新增/修改的外部接口(端点/事件/ schema)。
- 包含输入/输出格式、验证/错误行为和兼容性说明。
- :
quickstart.md- 描述所设计功能的具体验证流程。
- 覆盖主要成功路径以及规格中关键的错误/边缘行为。
- 经用户批准后,由生成的更新后的Agent上下文文件:
scripts/update-agent-context.sh- 包含最终规划中引入的新技术。
- 保留用户维护的手动章节。
- 如果用户未批准上下文更新:
- 报告Agent上下文同步已被有意跳过。
Key rules
关键规则
- Use absolute paths in completion reporting.
- Treat missing prerequisites as hard stops with reroutes to the owning sibling skill.
- Do not generate or implementation code in this skill.
tasks.md - Keep plan artifacts at design granularity: architecture, data model, interfaces/contracts, constraints, and validation approach.
- Do not include execution-level content such as code snippets, patch-style file edits, command runbooks, or checklist task breakdowns.
- Do not leave blocking unresolved by completion.
NEEDS CLARIFICATION - Emit for unresolved constitution gates without justification.
ERROR - Never run without explicit user approval in the current session.
scripts/update-agent-context.sh
- 在完成报告中使用绝对路径。
- 将缺失的前置条件视为硬停止,并引导至对应的关联工具。
- 不要在本工具中生成或实现代码。
tasks.md - 保持规划工件处于设计粒度:架构、数据模型、接口/契约、约束和验证方法。
- 不要包含执行级内容,如代码片段、补丁式文件编辑、命令手册或清单任务分解。
- 完成时不要留下未解决的阻塞性项。
NEEDS CLARIFICATION - 对于未说明理由的未解决合规性检查项,输出。
ERROR - 切勿在当前会话未获得用户明确批准的情况下运行。
scripts/update-agent-context.sh
Common Mistakes
常见错误
- Planning without an approved spec — the plan will lack stable requirements and churn.
- Using the wrong template source path (instead of
spec-template).plan-template - Keeping placeholder project-structure options in instead of selecting one concrete layout.
plan.md - Including execution details in plan artifacts (code snippets, exact commands, patch-level file changes, or task checklists) — design belongs in ; execution belongs to
spec-kit-planandspec-kit-tasks.spec-kit-implement - Skipping the post-design constitution re-check before handing off to .
spec-kit-tasks - Running context-file updates automatically without asking the user to approve changes to /
AGENTS.md/related files.CLAUDE.md
- 在没有获批规格的情况下进行规划——规划将缺乏稳定的需求并会不断变动。
- 使用错误的模板源路径(而非
spec-template)。plan-template - 在中保留占位符项目结构选项,而非选择一种具体的布局。
plan.md - 在规划工件中包含执行细节(代码片段、确切命令、补丁级文件更改或任务清单)——设计属于;执行属于
spec-kit-plan和spec-kit-tasks。spec-kit-implement - 在交接给之前跳过设计后的合规性重新检查。
spec-kit-tasks - 自动运行上下文文件更新,而未请求用户批准对/
AGENTS.md/相关文件的更改。CLAUDE.md
References
参考资料
- for overall context of where planning fits in the Spec Kit sequence.
references/spec-kit-workflow.dot scripts/setup-plan.shscripts/update-agent-context.shassets/plan-template.mdhttps://github.com/github/spec-kit/blob/9111699cd27879e3e6301651a03e502ecb6dd65d/templates/commands/plan.md
- :了解规划在Spec Kit序列中的整体上下文。
references/spec-kit-workflow.dot scripts/setup-plan.shscripts/update-agent-context.shassets/plan-template.mdhttps://github.com/github/spec-kit/blob/9111699cd27879e3e6301651a03e502ecb6dd65d/templates/commands/plan.md