cmd-speckit-init-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/speckit.init.update

/speckit.init.update

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

Command Instructions

命令说明

Refresh the
.specify/
scripts and templates in the current project by downloading the latest versions from
github/spec-kit
. Never overwrites user-governed files.
通过从
github/spec-kit
下载最新版本,刷新当前项目中的
.specify/
脚本和模板。绝不覆盖用户管理的文件。

Protected paths (never overwrite)

受保护路径(绝不覆盖)

  • .specify/memory/
    — all files including
    constitution.md
  • .specify/specs/
    — all feature artifacts
  • .specify/memory/
    — 所有文件,包括
    constitution.md
  • .specify/specs/
    — 所有功能制品

Steps

步骤

  1. Verify setup: Check that
    .specify/
    exists in the project root. If not, stop and tell the user to run
    /speckit.init
    first.
  2. Clone upstream:
    bash
    UPSTREAM_DIR=$(mktemp -d)
    git clone --depth 1 https://github.com/github/spec-kit.git "$UPSTREAM_DIR"
    If the clone fails, report the error and stop.
  3. Update files by copying from upstream, skipping protected paths. For each file in the upstream
    .specify/
    directory:
    Upstream sourceLocal destinationProtected?
    .specify/memory/constitution.md
    .specify/memory/constitution.md
    YES — skip
    .specify/scripts/bash/common.sh
    .specify/scripts/bash/common.sh
    update
    .specify/scripts/bash/setup-plan.sh
    .specify/scripts/bash/setup-plan.sh
    update
    .specify/scripts/bash/check-prerequisites.sh
    .specify/scripts/bash/check-prerequisites.sh
    update
    .specify/scripts/bash/update-agent-context.sh
    .specify/scripts/bash/update-agent-context.sh
    update
    .specify/scripts/bash/create-new-feature.sh
    .specify/scripts/bash/create-new-feature.sh
    update
    .specify/templates/agent-file-template.md
    .specify/templates/agent-file-template.md
    update
    .specify/templates/checklist-template.md
    .specify/templates/checklist-template.md
    update
    .specify/templates/tasks-template.md
    .specify/templates/tasks-template.md
    update
    .specify/templates/spec-template.md
    .specify/templates/spec-template.md
    update
    .specify/templates/plan-template.md
    .specify/templates/plan-template.md
    update
    Also copy any additional
    .specify/scripts/
    or
    .specify/templates/
    files found in upstream that are not listed above (new upstream additions). Preserve file permissions.
  4. Clean up:
    bash
    rm -rf "$UPSTREAM_DIR"
  5. Report a summary table:
    Status   | File                                        | Reason
    UPDATED  | .specify/templates/spec-template.md         | Content changed
    ADDED    | .specify/scripts/bash/new-script.sh         | New upstream file
    SKIPPED  | .specify/memory/constitution.md             | User-governed
    SKIPPED  | .specify/specs/                             | User-governed
  6. Next step: Review any updated templates before running
    /speckit.specify
    or
    /speckit.plan
    in case template changes affect expected output format.
  1. 验证环境: 检查项目根目录中是否存在
    .specify/
    。如果不存在,停止操作并告知用户先运行
    /speckit.init
  2. 克隆上游仓库:
    bash
    UPSTREAM_DIR=$(mktemp -d)
    git clone --depth 1 https://github.com/github/spec-kit.git "$UPSTREAM_DIR"
    如果克隆失败,报告错误并停止操作。
  3. 更新文件: 从上游仓库复制文件,跳过受保护路径。对于上游
    .specify/
    目录中的每个文件:
    Upstream sourceLocal destinationProtected?
    .specify/memory/constitution.md
    .specify/memory/constitution.md
    YES — skip
    .specify/scripts/bash/common.sh
    .specify/scripts/bash/common.sh
    update
    .specify/scripts/bash/setup-plan.sh
    .specify/scripts/bash/setup-plan.sh
    update
    .specify/scripts/bash/check-prerequisites.sh
    .specify/scripts/bash/check-prerequisites.sh
    update
    .specify/scripts/bash/update-agent-context.sh
    .specify/scripts/bash/update-agent-context.sh
    update
    .specify/scripts/bash/create-new-feature.sh
    .specify/scripts/bash/create-new-feature.sh
    update
    .specify/templates/agent-file-template.md
    .specify/templates/agent-file-template.md
    update
    .specify/templates/checklist-template.md
    .specify/templates/checklist-template.md
    update
    .specify/templates/tasks-template.md
    .specify/templates/tasks-template.md
    update
    .specify/templates/spec-template.md
    .specify/templates/spec-template.md
    update
    .specify/templates/plan-template.md
    .specify/templates/plan-template.md
    update
    同时复制上游仓库中未在上述列表中列出的所有额外
    .specify/scripts/
    .specify/templates/
    文件(上游新增文件)。保留文件权限。
  4. 清理:
    bash
    rm -rf "$UPSTREAM_DIR"
  5. 报告: 生成汇总表格:
    Status   | File                                        | Reason
    UPDATED  | .specify/templates/spec-template.md         | Content changed
    ADDED    | .specify/scripts/bash/new-script.sh         | New upstream file
    SKIPPED  | .specify/memory/constitution.md             | User-governed
    SKIPPED  | .specify/specs/                             | User-governed
  6. 下一步: 在运行
    /speckit.specify
    /speckit.plan
    之前,检查所有更新后的模板,以防模板更改影响预期的输出格式。