build

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

build — implement spec

build — 实现规格说明

Single-thread native plan→execute. You are main Claude. No swarm.
采用原生单线程的规划→执行流程。你是主Claude,无集群(swarm)。

LOAD

加载(LOAD)

  1. Read
    SPEC.md
    . If missing → tell user to invoke the spec skill first. Stop.
  2. Read
    FORMAT.md
    once if not loaded.
  3. Parse invocation args:
    • §T.n
      → that task only
    • --next
      → lowest-numbered row with status
      .
      or
      ~
    • --all
      or empty → every
      .
      row in §T order
  1. 读取
    SPEC.md
    文件。若文件缺失→告知用户先调用spec技能。停止操作。
  2. 若未加载过
    FORMAT.md
    ,则读取一次。
  3. 解析调用参数:
    • §T.n
      → 仅处理该任务
    • --next
      → 处理状态为
      .
      ~
      的编号最小的任务行
    • --all
      或无参数 → 按§T顺序处理所有状态为
      .
      的任务行

PLAN

规划(PLAN)

Native plan mode. For chosen task(s):
  1. Cite every §V invariant that applies. Plan must respect all.
  2. Cite every §I interface touched. Plan must preserve shape.
  3. List files to create / edit.
  4. List tests to add or update (one per invariant touched).
  5. Name verification command (test, build, lint).
Show plan. Wait for user OK unless auto mode.
原生规划模式。针对选定的任务:
  1. 引用所有适用的§V约束。规划必须遵守所有约束。
  2. 引用所有涉及的§I接口。规划必须保留接口结构。
  3. 列出需要创建/编辑的文件。
  4. 列出需要添加或更新的测试(每个涉及的约束对应一个测试)。
  5. 指定验证命令(测试、构建、代码检查)。
展示规划方案。除非处于自动模式,否则需等待用户确认。

EXECUTE

执行(EXECUTE)

Per task in order:
  1. Flip §T.n status cell
    .
    ~
    . Just write to SPEC.md.
  2. Edit code per plan.
  3. Run verification command.
  4. Pass → flip
    ~
    x
    . Next task.
  5. Fail → invoke backprop skill. Do NOT retry blindly.
按顺序处理每个任务:
  1. 将§T.n的状态单元格从
    .
    改为
    ~
    。仅写入SPEC.md文件。
  2. 按照规划方案编辑代码。
  3. 运行验证命令。
  4. 通过 → 将
    ~
    改为
    x
    。处理下一个任务。
  5. 失败 → 调用backprop技能。切勿盲目重试。

FAIL → BACKPROP

失败→反向传播(BACKPROP)

On test/build failure:
  1. Read failure output.
  2. Ask: is failure (a) my code bug, (b) spec wrong, or (c) unspecified edge case?
  3. If (a) → fix code, re-run. No spec change.
  4. If (b) or (c) → invoke spec skill with
    bug: <cause>
    first, let it update §V and §B, then resume build against updated spec.
Rule: never silently fix root-cause without considering backprop. §B is the memory that stops recurrence.
测试/构建失败时:
  1. 读取失败输出。
  2. 询问:失败原因是(a)我的代码错误,(b)规格说明有误,还是(c)未明确的边缘情况?
  3. 若为(a) → 修复代码,重新运行。不修改规格说明。
  4. 若为(b)或(c) → 先调用spec技能并传入
    bug: <原因>
    ,待其更新§V和§B后,再基于更新后的规格说明继续构建。
规则:永远不要在未考虑反向传播的情况下悄悄修复根本原因。§B是防止问题再次发生的记忆模块。

WRITE POLICY

写入策略(WRITE POLICY)

  • Only flip §T status. No other SPEC.md edits from build.
  • Other spec edits → invoke spec skill.
  • Commit after each §T completes. Message:
    T<n>: <goal line>
    + §V cites.
  • 仅修改§T的状态。构建过程中不得对SPEC.md进行其他编辑。
  • 其他规格说明编辑→调用spec技能。
  • 完成每个§T任务后提交。提交信息:
    T<n>: <目标行>
    + §V引用内容。

VERIFICATION

验证(VERIFICATION)

Task
x
only if:
  • Verification command exits 0.
  • New test(s) added per plan.
  • No §V invariant regressed (run full test suite at end).
仅当满足以下条件时,任务标记为
x
  • 验证命令退出码为0。
  • 已按照规划添加新测试。
  • 无§V约束被违反(最后运行完整测试套件)。

NON-GOALS

非目标(NON-GOALS)

  • No sub-agents. No parallel workers. Main thread only.
  • No progress dashboards.
    cat SPEC.md | grep §T
    is the dashboard.
  • No speculative work beyond chosen task scope.
  • 无子Agent。无并行工作线程。仅主线程运行。
  • 无进度仪表盘。
    cat SPEC.md | grep §T
    即为仪表盘。
  • 不得进行超出选定任务范围的推测性工作。