implement

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implement

实施

Goal

目标

  • All changes applied and committed.
  • Verification pass.
  • 所有变更已应用并提交。
  • 验证通过。

Prerequisites

前提条件

  • Input already specifies exact code changes, not vague requirements.
  • 输入已明确指定具体的代码变更,而非模糊需求。

Input

输入

  • Stages
    : ordered implementation stages (see the
    Stages
    shape). Each stage MAY carry
    id
    tag(s).
  • fixup mode
    (optional): a stage may carry a
    fixup-of
    originating commit to fix up instead of committing fresh.
  • Stages
    :有序的实施阶段(参见
    Stages
    结构)。每个阶段可携带
    id
    标签。
  • fixup mode
    (可选):某个阶段可携带
    fixup-of
    源提交,用于修正而非新建提交。

Steps

步骤

Step 1: Execute Plan

步骤1:执行计划

  • Follow the
    Stages
    from the plan in order.
  • Within each stage:
    • Apply the stage's code changes, lint/format, and verify against immediate scope.
    • Commit changes - if the stage is tagged for fixup mode, commit as
      git commit --fixup <originating-commit>
      instead of a plain commit.
  • 按计划中的
    Stages
    顺序执行。
  • 在每个阶段内:
    • 应用该阶段的代码变更,进行lint/格式化,并针对当前范围进行验证。
    • 提交变更 - 如果阶段标记为fixup模式,则使用
      git commit --fixup <originating-commit>
      提交,而非普通提交。

Step 2: Verify

步骤2:验证

  • Check all changes committed, each stage as a separate commit.
  • Run relevant static checks.
  • Run relevant runtime tests.
  • Validate against Success Criteria if provided.
  • 检查所有变更是否已提交,每个阶段对应一个独立提交。
  • 运行相关静态检查。
  • 运行相关运行时测试。
  • 如果提供了成功标准,则进行验证。

Step 3: Handle Deviations

步骤3:处理偏差

If Step 2 checks passed, skip this step.
When an unexpected deviation occurs:
  1. Assess the deviation and determine the root cause.
  2. Confirm it implies a simple fix. If it's suspected to be a significant change of the initial plan, or the same check has now failed 3 times in a row, stop and ask the user how to proceed.
  3. Apply and commit the fix as
    git commit --fixup <hash>
    against the offending Stage's own commit from Step 1 (never the fixup-mode originating commit, even if the Stage itself was committed in fixup mode), then
    git rebase --autosquash <commit before Step 1's first Stage commit>
    once done.
  4. Return to Step 2 and re-run - repeat until all pass.
No Stage ends in a failed or skipped state.
如果步骤2的检查通过,则跳过此步骤。
当出现意外偏差时:
  1. 评估偏差并确定根本原因。
  2. 确认是否只需简单修复。如果怀疑需要对初始计划进行重大变更,或同一检查已连续失败3次,请停止并询问用户如何继续。
  3. git commit --fixup <hash>
    的方式针对步骤1中对应问题阶段的提交应用并提交修复(即使该阶段本身是以fixup模式提交的,也绝不能针对fixup模式的源提交),完成后执行
    git rebase --autosquash <步骤1中第一个阶段提交之前的提交>
  4. 返回步骤2重新运行 - 重复此过程直至所有检查通过。
任何阶段都不能以失败或跳过状态结束。

Output

输出

Markdown format:
  • Commits: per input
    Stage
    , its
    id
    tag(s) (if any), commit hash(es), message(s), affected files.
  • Deviations: Unexpected changes from original plan and how they were resolved. Each entry echoes the
    id
    (s) carried by the
    Stage
    .
  • Verification Results: Stages, commits, quality checks status. Entries echo the
    id
    (s) of the stages they cover, if tagged.
Markdown格式:
  • 提交记录:对应输入的每个
    Stage
    ,包含其
    id
    标签(如有)、提交哈希、提交信息、受影响文件。
  • 偏差记录:与原始计划不符的意外变更及其解决方式。每条记录需关联对应
    Stage
    id
  • 验证结果:阶段、提交、质量检查状态。条目需关联其所覆盖阶段的
    id
    (如有标签)。