cmd-speckit-constitution

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/speckit.constitution

/speckit.constitution

Agent skill wrapper for the Claude command
/speckit.constitution
.
When the original command text references
{{INPUT}}
,
$1
, or named arguments, map them from the user's current request.
Claude命令
/speckit.constitution
的Agent技能包装器。
当原始命令文本引用
{{INPUT}}
$1
或命名参数时,从用户当前请求中映射对应的值。

Command Instructions

命令说明

Establish or update the project constitution — the single source of truth for governing principles that all specs and implementations must follow.
建立或更新项目治理准则——这是所有规范和实现必须遵循的治理原则的唯一真实来源。

Steps

步骤

  1. Locate the constitution:
    • Check for
      .specify/memory/constitution.md
      .
    • If it does not exist and
      .specify/
      is absent, tell the user to run
      /speckit.init
      first and stop.
    • If the file exists, load its current content and note the current version.
  2. Identify placeholders and gaps: Scan for:
    • Bracketed tokens:
      [PROJECT_NAME]
      ,
      [YYYY-MM-DD]
      ,
      [Describe the project...]
    • Non-declarative or untestable principles
    • Missing sections (MUST, SHOULD, SHOULD NOT are required at minimum)
  3. Collect values:
    • PROJECT_NAME
      : Detect from
      git remote get-url origin
      (extract repo name),
      package.json
      ,
      mix.exs
      , or ask the user.
    • Date: Today's date in ISO format (YYYY-MM-DD).
    • Project context: Ask the user — "Briefly describe this project's purpose, primary users, and key constraints."
  4. Present the proposed constitution (full text for new files, or a diff for updates). Ask for confirmation before writing.
  5. Write the updated constitution: Replace all placeholder tokens. Ensure:
    • Principles are declarative and testable ("All features..." not "We try to...")
    • Dates use ISO format (YYYY-MM-DD)
    • MUST = non-negotiable; SHOULD = strong default; SHOULD NOT = strong prohibition
    • No trailing whitespace or unresolved bracketed tokens
  6. Version bump (updates to existing constitutions only):
    • MAJOR: removing or fundamentally changing a MUST principle
    • MINOR: adding new principles
    • PATCH: clarifying wording without changing intent
  7. Report: File written, version, and a suggested commit message (e.g.,
    docs: ratify project constitution v0.1.0
    ).
Next step: Run
/speckit.specify
to write your first feature specification.
  1. 定位治理准则文件:
    • 检查是否存在
      .specify/memory/constitution.md
    • 如果该文件不存在且
      .specify/
      目录也不存在,请告知用户先运行
      /speckit.init
      并终止操作。
    • 如果文件存在,加载其当前内容并记录当前版本。
  2. 识别占位符和缺失内容: 扫描以下内容:
    • 括号标记:
      [PROJECT_NAME]
      [YYYY-MM-DD]
      [Describe the project...]
    • 非声明式或不可测试的原则
    • 缺失的章节(至少必须包含MUST、SHOULD、SHOULD NOT部分)
  3. 收集所需值:
    • PROJECT_NAME
      :从
      git remote get-url origin
      (提取仓库名称)、
      package.json
      mix.exs
      中自动检测,或询问用户。
    • 日期:采用ISO格式的今日日期(YYYY-MM-DD)。
    • 项目背景:询问用户——“请简要描述该项目的目标、主要用户和关键约束条件。”
  4. 展示拟议的治理准则(新文件展示完整文本,更新则展示差异内容)。写入前需征得用户确认。
  5. 写入更新后的治理准则:替换所有占位符标记。确保:
    • 原则为声明式且可测试(例如“所有功能……”而非“我们尝试……”)
    • 日期采用ISO格式(YYYY-MM-DD)
    • MUST = 不可协商;SHOULD = 强烈默认要求;SHOULD NOT = 强烈禁止
    • 无尾随空格或未解析的括号标记
  6. 版本升级(仅适用于现有治理准则的更新):
    • MAJOR:移除或根本性修改MUST级原则
    • MINOR:添加新的原则
    • PATCH:在不改变原意的前提下澄清措辞
  7. 报告:告知用户文件已写入、版本号,并提供建议的提交信息(例如:
    docs: ratify project constitution v0.1.0
    )。
下一步: 运行
/speckit.specify
来编写你的第一个功能规范。