spec-driven-init

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
You are helping the user initialize the spec-driven workflow in a project.
你正在帮助用户在项目中初始化spec-driven工作流。

Steps

步骤

  1. Confirm the target project — ask which project to initialize. If the user is already in the project root, use the current directory. Accept either
    .
    or an explicit path.
  2. Run init — run:
    node {{SKILL_DIR}}/scripts/spec-driven.js init [path]
    Pass the path only if it differs from the current directory.
  3. Draft context — read any existing project files that describe the project (
    README.md
    ,
    AGENTS.md
    ,
    CLAUDE.md
    ,
    package.json
    ,
    pom.xml
    , etc.). Draft a
    context
    value of 3–5 sentences covering:
    • What the project does
    • Tech stack and language(s)
    • Key conventions or constraints worth noting
    Write the draft into the
    context
    field of
    .spec-driven/config.yaml
    , then show it to the user and ask if they want to adjust anything.
  4. Capture existing behavior — ask: "Does this project already have behavior worth documenting?" If yes, help the user write initial spec files under
    .spec-driven/specs/<category>/
    using the standard format:
    • Group by domain area (e.g.
      auth/
      ,
      api/
      ,
      core/
      )
    • Use
      ### Requirement: <name>
      headings with RFC 2119 keywords
    • Describe what the system currently does, not what it should do
    • Add an entry for each new file to
      .spec-driven/specs/INDEX.md
    This step is important for existing projects — without initial specs,
    propose
    has nothing to read and cannot detect conflicts.
  5. Confirm — show the user what was created and suggest running
    /spec-driven-propose
    to create their first change.
  1. 确认目标项目 — 询问用户要初始化哪个项目。如果用户已处于项目根目录,则使用当前目录。接受
    .
    或明确的路径作为输入。
  2. 运行init命令 — 执行以下命令:
    node {{SKILL_DIR}}/scripts/spec-driven.js init [path]
    仅当目标路径与当前目录不同时才需要传入path参数。
  3. 草拟上下文信息 — 读取所有描述项目的现有文件(如
    README.md
    AGENTS.md
    CLAUDE.md
    package.json
    pom.xml
    等)。草拟一段3-5句话的
    context
    内容,涵盖:
    • 项目的功能用途
    • 技术栈与使用的编程语言
    • 需要注意的关键约定或约束条件
    将草拟的内容写入
    .spec-driven/config.yaml
    context
    字段,随后展示给用户并询问是否需要调整。
  4. 记录现有行为 — 询问用户:“该项目是否已有值得记录的行为?”如果是,帮助用户按照标准格式在
    .spec-driven/specs/<category>/
    目录下编写初始规范文件:
    • 按领域分组(例如
      auth/
      api/
      core/
    • 使用
      ### Requirement: <name>
      标题,并采用RFC 2119关键词
    • 描述系统当前的实际行为,而非预期行为
    • 为每个新文件在
      .spec-driven/specs/INDEX.md
      中添加对应的条目
    这一步对已有项目至关重要——如果没有初始规范文件,
    propose
    命令将没有可读取的内容,也就无法检测冲突。
  5. 确认完成 — 向用户展示已创建的内容,并建议运行
    /spec-driven-propose
    命令来创建他们的第一个变更提议。

Rules

规则

  • Do not create any changes — initialization only
  • Keep the context field concise: 3–5 sentences is enough for the AI to work from
  • If .spec-driven/ already exists, do not reinitialize — suggest
    /spec-driven-propose
    instead
  • 不得创建任何变更——仅执行初始化操作
  • 保持context字段简洁:3-5句话足以供AI使用
  • 如果.spec-driven/目录已存在,请勿重新初始化——建议用户使用
    /spec-driven-propose
    命令替代