spec-driven-archive

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
You are helping the user archive a completed spec-driven change.
您正在帮助用户归档已完成的spec-driven变更。

Prerequisites

前提条件

The
.spec-driven/
directory must exist at the project root. Before proceeding, verify:
ls .spec-driven/
If this fails, the project is not initialized. Run
/spec-driven-init
first.
.spec-driven/
目录必须存在于项目根目录下。在开始操作前,请验证:
ls .spec-driven/
如果验证失败,说明项目尚未初始化,请先运行
/spec-driven-init

Steps

步骤

  1. Select the change — run
    node {{SKILL_DIR}}/scripts/spec-driven.js modify
    to list active changes. Ask which change to archive. If already specified, use it.
  2. Check for incomplete tasks — run:
    node {{SKILL_DIR}}/scripts/spec-driven.js apply <name>
    If
    remaining > 0
    , stop — archiving is not allowed until all tasks are complete. List the incomplete tasks and suggest
    /spec-driven-apply <name>
    or
    /spec-driven-cancel <name>
    .
  3. Merge delta specs — list all files in
    .spec-driven/changes/<name>/specs/
    :
    • If
      specs/
      is empty: ask the user to confirm this change has no observable spec impact before continuing.
    • For each delta file (e.g.
      specs/install/install-behavior.md
      ), merge into the corresponding main spec file (e.g.
      .spec-driven/specs/install/install-behavior.md
      ):
      • ADDED: append the
        ### Requirement:
        blocks to the target file (create it if it doesn't exist)
      • MODIFIED: locate the existing
        ### Requirement: <name>
        block by name and replace it in place
      • REMOVED: locate the
        ### Requirement: <name>
        block by name and delete it; remove the file if it becomes empty
    • Briefly summarize what changed in
      specs/
      after merging.
  4. Update specs/INDEX.md — after merging, update
    .spec-driven/specs/INDEX.md
    :
    • Add entries for any newly created spec files (with a one-line description)
    • Remove entries for any deleted spec files
    • Leave existing entries unchanged unless the file's scope changed
  5. Archive the change — run:
    node {{SKILL_DIR}}/scripts/spec-driven.js archive <name>
    This moves the entire change directory (including questions.md) to the archive.
  6. Confirm — report the result:
    • Where the change was moved to (e.g.
      .spec-driven/changes/archive/2024-01-15-<name>/
      )
    • Suggest running
      /spec-driven-propose
      if there's follow-up work
  1. 选择变更 — 运行
    node {{SKILL_DIR}}/scripts/spec-driven.js modify
    列出所有活跃变更。询问用户要归档哪一个变更。如果用户已指定,则直接使用该变更。
  2. 检查未完成任务 — 运行:
    node {{SKILL_DIR}}/scripts/spec-driven.js apply <name>
    如果
    remaining > 0
    ,则停止操作 — 必须等所有任务完成后才能归档。列出未完成的任务,并建议用户运行
    /spec-driven-apply <name>
    /spec-driven-cancel <name>
  3. 合并增量规格 — 列出
    .spec-driven/changes/<name>/specs/
    下的所有文件:
    • 如果
      specs/
      目录为空:在继续操作前,请用户确认该变更对规格没有可见影响。
    • 对于每个增量文件(例如
      specs/install/install-behavior.md
      ),合并到对应的主规格文件(例如
      .spec-driven/specs/install/install-behavior.md
      ):
      • ADDED(新增):将
        ### Requirement:
        块追加到目标文件中(如果文件不存在则创建)
      • MODIFIED(修改):通过名称找到现有的
        ### Requirement: <name>
        块并原地替换
      • REMOVED(移除):通过名称找到
        ### Requirement: <name>
        块并删除;如果文件变为空,则删除该文件
    • 简要总结合并后
      specs/
      目录中的变更内容。
  4. 更新specs/INDEX.md — 合并完成后,更新
    .spec-driven/specs/INDEX.md
    • 为所有新创建的规格文件添加条目(附带一行描述)
    • 删除已删除规格文件的条目
    • 除非文件范围发生变化,否则保留现有条目不变
  5. 归档变更 — 运行:
    node {{SKILL_DIR}}/scripts/spec-driven.js archive <name>
    该命令会将整个变更目录(包括questions.md)移动到归档目录。
  6. 确认结果 — 报告操作结果:
    • 变更被移动到的位置(例如
      .spec-driven/changes/archive/2024-01-15-<name>/
    • 如果有后续工作,建议运行
      /spec-driven-propose

Rules

规则

  • Always check for incomplete tasks before archiving
  • Never archive a change with incomplete tasks
  • Always merge delta specs before archiving — this is a hard gate, not optional
  • If
    changes/<name>/specs/
    is empty, require explicit human confirmation that the change has no observable spec impact
  • Deleting requirements or empty spec files in
    .spec-driven/specs/
    is allowed when applying
    REMOVED
    delta entries
  • Do not delete the change directory manually — archive the change by running the archive command
  • 归档前必须检查未完成任务
  • 绝不允许归档存在未完成任务的变更
  • 归档前必须合并增量规格 — 这是硬性要求,而非可选步骤
  • 如果
    changes/<name>/specs/
    目录为空,必须获得用户的明确确认,确认该变更对规格没有可见影响
  • 应用
    REMOVED
    增量条目时,允许删除
    .spec-driven/specs/
    中的需求或空规格文件
  • 不要手动删除变更目录 — 请通过运行归档命令来完成归档操作