spec-kit-constitution
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpec Kit Constitution
Spec Kit 项目章程
Create or amend the project constitution and keep dependent templates aligned.
创建或修改项目章程,并保持关联模板的一致性。
When to Use
适用场景
- User asks to create the first constitution for a Spec Kit project.
- User asks to amend governance/principles and update constitution versioning.
- is missing or still contains
memory/constitution.mdtokens.[PLACEHOLDER] - Principle changes must be propagated into planning/spec/task templates.
- 用户需要为Spec Kit项目创建首个章程。
- 用户要求修订治理规则/原则并更新章程版本。
- 文件缺失或仍包含
memory/constitution.md占位符。[PLACEHOLDER] - 需要将原则变更同步到规划/规格/任务模板中。
Router Fit
路由适配
- Primary route from when intent is governance/principles.
spec-kit - Run before feature planning when constitutional rules changed.
- Downstream dependency: constitution checks rely on this output.
spec-kit-plan
- 当意图涉及治理/原则时,从发起的主要路由。
spec-kit - 当章程规则变更时,需在功能规划前执行此流程。
- 下游依赖:的章程检查依赖此流程的输出结果。
spec-kit-plan
Preconditions
前置条件
- Work from the target project repository root.
- Treat as the source of truth once created.
memory/constitution.md
- 从目标项目仓库根目录开始操作。
- 章程创建完成后,将视为唯一可信源。
memory/constitution.md
Workflow
工作流程
- Resolve constitution file:
- Target: .
{REPO_ROOT}/memory/constitution.md - If missing, initialize from when present; otherwise use
{REPO_ROOT}/templates/constitution-template.md.assets/constitution-template.md
- Target:
- Capture baseline state from existing constitution (if present):
- Current version.
- Ratified and last amended dates.
- Principle/section titles for diff reporting.
- Any unresolved tokens.
[PLACEHOLDER]
- Fill required values from user input first, then repository context.
- If critical data is unknown, use .
TODO(<FIELD_NAME>): <reason>
- If critical data is unknown, use
- Decide semantic version bump and dates:
- : backward-incompatible governance/principle redefinition or removal.
MAJOR - : new principle/section or materially expanded policy.
MINOR - : clarifications, wording, typo, non-semantic refinements.
PATCH - : keep original adoption date.
RATIFICATION_DATE - : set to today (
LAST_AMENDED_DATE) only when content changes.YYYY-MM-DD
- Draft the constitution:
- Replace placeholders with concrete policy text.
- Keep heading hierarchy from the template.
- Make principles declarative and testable (/
MUSTwith rationale).SHOULD - Keep Governance explicit about amendment process, versioning policy, and compliance review.
- Propagate policy changes to dependent templates in the target repo when present:
templates/plan-template.mdtemplates/spec-template.md- Update constitutional checks, required sections, and task expectations to match revised principles.
templates/tasks-template.md
- Prepend a Sync Impact Report HTML comment to containing:
memory/constitution.md- Version change ().
old -> new - Modified principles (including renames).
- Added/removed sections.
- Template sync status (vs
updated) with file paths.pending - Deferred TODO items.
- Version change (
- Validate before finalizing:
- No unexplained bracket placeholders remain.
- Version/date line matches report and uses format.
YYYY-MM-DD - File path is (not
memory/constitution.md)./memory/constitution.md
- Write and report results to the user.
memory/constitution.md
- 定位章程文件:
- 目标路径:。
{REPO_ROOT}/memory/constitution.md - 若文件缺失,优先从初始化;若该模板也不存在,则使用
{REPO_ROOT}/templates/constitution-template.md。assets/constitution-template.md
- 目标路径:
- 捕获现有章程的基准状态(若存在):
- 当前版本号。
- 批准日期和最后修订日期。
- 用于差异报告的原则/章节标题。
- 所有未解决的占位符。
[PLACEHOLDER]
- 优先从用户输入中填充必填值,其次从仓库上下文获取。
- 若关键数据未知,使用格式标记。
TODO(<FIELD_NAME>): <reason>
- 若关键数据未知,使用
- 确定语义化版本升级类型和日期:
- :治理/原则的定义被修改或移除,且存在向后兼容性问题。
MAJOR - :新增原则/章节,或政策内容大幅扩展。
MINOR - :仅做说明优化、措辞调整、拼写修正等非语义性改进。
PATCH - :保留最初的批准日期。
RATIFICATION_DATE - :仅当内容发生变更时,设置为当前日期(
LAST_AMENDED_DATE格式)。YYYY-MM-DD
- 起草章程:
- 用具体政策文本替换占位符。
- 保留模板的标题层级结构。
- 原则需采用声明式且可验证的表述(使用/
MUST并附上理由)。SHOULD - 治理章节需明确修订流程、版本控制策略和合规审查要求。
- 同步政策变更到目标仓库中的关联模板(若存在):
templates/plan-template.mdtemplates/spec-template.md- 更新章程检查项、必填章节和任务预期,使其与修订后的原则保持一致。
templates/tasks-template.md
- 在文件开头添加同步影响报告的HTML注释,内容包括:
memory/constitution.md- 版本变更()。
旧版本 -> 新版本 - 修改的原则(包括重命名项)。
- 新增/移除的章节。
- 模板同步状态(vs
已更新)及文件路径。待处理 - 延迟处理的TODO项。
- 版本变更(
- 最终确认前进行验证:
- 确保无未解释的括号占位符残留。
- 版本/日期行与报告内容匹配,且使用格式。
YYYY-MM-DD - 文件路径为(而非
memory/constitution.md)。/memory/constitution.md
- 写入文件,并向用户报告结果。
memory/constitution.md
Output
输出结果
- Updated .
memory/constitution.md - Updated template files when present and required.
- Summary including version bump rationale, pending follow-ups, and a suggested commit message.
- 更新后的文件。
memory/constitution.md - 若存在且需要,更新关联模板文件。
- 包含版本升级理由、待跟进事项和建议提交信息的总结报告。
Common Mistakes
常见错误
- Updating principles without updating dependent templates.
- Using a patch bump for material policy changes that require a minor/major bump.
- Leaving unresolved placeholders without explicit TODO annotations.
- Writing to instead of
/memory/constitution.md.memory/constitution.md
- 仅更新原则但未同步关联模板。
- 将需要次要/主要版本升级的实质性政策变更错误标记为补丁版本升级。
- 未使用明确的TODO注释标记未解决的占位符。
- 错误写入路径为而非
/memory/constitution.md。memory/constitution.md
References
参考资料
- for where constitution work fits in the Spec Kit sequence.
references/spec-kit-workflow.dot assets/constitution-template.mdassets/spec-template.mdassets/plan-template.mdassets/tasks-template.mdhttps://github.com/github/spec-kit/blob/9111699cd27879e3e6301651a03e502ecb6dd65d/templates/commands/constitution.md
- :展示章程工作在Spec Kit流程中的位置。
references/spec-kit-workflow.dot assets/constitution-template.mdassets/spec-template.mdassets/plan-template.mdassets/tasks-template.mdhttps://github.com/github/spec-kit/blob/9111699cd27879e3e6301651a03e502ecb6dd65d/templates/commands/constitution.md