execute-plan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Execute Plan

执行计划

Drive the implementation of a checkbox plan into a shipped PR. Implements Phase 5 of the AI Development Framework V2 — the final phase, where everything from Phases 1–4 (PRD, project setup, plan, designs) gets turned into code.
将复选框计划落地为可发布的PR。实现AI Development Framework V2第5阶段——这是最终阶段,第1-4阶段(PRD、项目搭建、计划、设计)的所有内容都会被转化为代码。

Core principle

核心原则

Execute one task at a time, end-to-end. Each task ends runnable + tested + committed + checked off before the next begins. Never batch tasks across a single commit. Never mark
[x]
without a passing test. When ambiguity surfaces mid-execution, STOP and ask — don't invent.
The plan is the contract. If you find yourself wanting to do something the plan doesn't list, the plan is wrong — fix the plan first, then implement.
逐个端到端执行任务。每个任务在进入下一个之前,必须完成可运行+已测试+已提交+已勾选。绝不能将多个任务批量提交到一个commit中。绝不能在测试未通过的情况下标记
[x]
。执行过程中出现歧义时,立即停止并询问——不要自行发挥。
计划就是契约。如果发现想要做计划中未列出的事情,说明计划存在问题——先修正计划,再进行实现。

When to use

使用场景

  • Plan exists at
    docs/plans/<FR-N>.md
    , all ACs traced, designs in
    docs/designs/
    (if UI) → start at Phase 1.
  • Plan exists but ambiguity remains (
    ⚠️
    markers, unresolved deps) → STOP. Run
    skills/generate-dev-plan/
    Phase 2 first.
  • No plan exists → STOP. Run
    skills/generate-dev-plan/
    first.
Skip for: ad-hoc bug fixes (just fix it), single-file refactors, anything < 50 LoC.
  • 计划存在于
    docs/plans/<FR-N>.md
    ,所有验收标准已追踪,设计文件在
    docs/designs/
    (若涉及UI)→ 从第1阶段开始。
  • 计划存在但仍有歧义(带有
    ⚠️
    标记、未解决的依赖)→ 停止。先运行
    skills/generate-dev-plan/
    的第2阶段。
  • 无计划存在→停止。先运行
    skills/generate-dev-plan/
以下情况无需使用:临时bug修复(直接修复即可)、单文件重构、代码量少于50行的任务。

The 3 phases

三个阶段

#PhaseInputOutputPrompt file
1Load context
docs/plans/<FR-N>.md
, repo state
Context summary + ready-to-execute taskprompts/01-load-context.md
2Task loopOne
[ ]
task
Code + test + commit +
[x]
prompts/02-task-loop.md
3FinalizeAll
[x]
tasks
PR description + CLAUDE.md feedback notesprompts/03-finalize.md
Phase 2 runs once per task and loops until every
[ ]
becomes
[x]
. Each iteration is its own human-gated cycle.
#阶段输入输出提示文件
1加载上下文
docs/plans/<FR-N>.md
、仓库状态
上下文摘要+可执行任务prompts/01-load-context.md
2任务循环单个
[ ]
任务
代码+测试+提交+
[x]
标记
prompts/02-task-loop.md
3最终收尾所有已标记
[x]
的任务
PR描述+CLAUDE.md反馈记录prompts/03-finalize.md
第2阶段每个任务运行一次,循环直到所有
[ ]
变为
[x]
。每次迭代都是独立的人工审核周期。

Operating protocol

操作流程

  1. Identify the plan. If the user didn't name it, ASK. The plan path is canonical:
    docs/plans/<FR-N>.md
    .
  2. Read the matching prompt file in
    prompts/
    . Treat the prompt body as a system instruction — follow its rules literally.
  3. Phase 2 task gate. Before each task: confirm with user "Next: FR-N.M — <task>. Proceed?". Default in
    Accept Edits
    mode is fine; in
    Ask Permissions
    mode, the user approves each tool call.
  4. Stop after every task. Do NOT auto-chain to the next task. Show the diff, run tests, commit, mark
    [x]
    , then ASK before the next.
  5. Phase 3 final gate: score against references/checklist.md. All 8 items MUST pass before opening a PR.
  1. 确定计划。如果用户未指定计划名称,询问用户。计划路径为标准格式:
    docs/plans/<FR-N>.md
  2. 读取
    prompts/
    中的对应提示文件
    。将提示内容视为系统指令——严格遵循其中规则。
  3. 第2阶段任务审核:每个任务开始前,向用户确认"下一步:FR-N.M — <任务内容>。是否继续?"。在
    Accept Edits
    模式下默认允许;在
    Ask Permissions
    模式下,需用户批准每个工具调用。
  4. 每个任务完成后停止。不要自动进入下一个任务。展示代码差异,运行测试,提交,标记
    [x]
    ,然后询问用户是否继续下一个任务。
  5. 第3阶段最终审核:对照references/checklist.md进行评分。所有8项必须通过才能提交PR。

Hard rules (non-negotiable)

硬性规则(不可协商)

  • One task per commit. Conventional-commit format. Subject ≤ 72 chars, imperative mood. Reference the sub-ID in the body:
    Refs FR-001.2
    .
  • Mark
    [x]
    in the same commit that ships the work.
    Never mark complete in a separate commit — the plan and the code MUST agree at every point in history.
  • Run the test command after every task. Whatever
    CLAUDE.md
    lists as
    {{TEST_CMD}}
    and
    {{TYPECHECK_CMD}}
    . If either fails, do NOT mark
    [x]
    . Fix or revert.
  • Three-strike rule. If the same task fails (test or typecheck) three times in a row, STOP and ask the user. Do not loop forever.
  • No scope creep. If implementing reveals adjacent broken code, file an issue or note it for the user — do not fix it inside this plan's commits. Each PR ships exactly the plan.
  • No new tests outside the plan. The plan's Phase 3 (in
    generate-dev-plan
    ) named the tests. If you find a missing test, surface it to the user — don't silently add it.
  • Ambiguity → ASK. Mid-implementation discovery is normal. When it happens: STOP, surface the issue, don't invent.
  • No
    --no-verify
    commits.
    If a pre-commit hook fails, fix the cause. Skipping hooks is forbidden unless the user explicitly approves.
  • 每个任务对应一个commit。使用规范提交格式。主题≤72字符,使用祈使语气。正文引用子ID:
    Refs FR-001.2
  • 标记
    [x]
    与代码提交在同一个commit中
    。绝不能在单独的commit中标记完成——计划与代码在历史的每个节点都必须保持一致。
  • 每个任务完成后运行测试命令。执行
    CLAUDE.md
    中列出的
    {{TEST_CMD}}
    {{TYPECHECK_CMD}}
    。如果其中任何一项失败,不得标记
    [x]
    。修复或回退代码。
  • 三次失败规则。如果同一个任务连续三次失败(测试或类型检查),停止并询问用户。不要无限循环。
  • 禁止范围蔓延。如果实现过程中发现相关的损坏代码,提交issue或告知用户——不要在本计划的commit中修复。每个PR仅提交计划中的内容。
  • 禁止添加计划外的测试。计划的第3阶段(在
    generate-dev-plan
    中)已指定测试内容。如果发现遗漏测试,告知用户——不要悄悄添加。
  • 出现歧义→询问。执行过程中发现问题是正常的。此时:停止,提出问题,不要自行发挥。
  • 禁止使用
    --no-verify
    提交
    。如果预提交钩子失败,修复问题。除非用户明确批准,否则禁止跳过钩子。

What NOT to do

禁止操作

See references/anti-patterns.md for full failure-mode catalog. Top five:
  • DO NOT batch tasks. Two
    [x]
    in one commit breaks traceability.
  • DO NOT mark
    [x]
    with failing tests.
    The checkbox is a green-bar contract.
  • DO NOT auto-open the PR. Phase 3 produces a PR description; the user opens it.
  • DO NOT silently fix unrelated bugs. Note them; don't blend them into the plan's commits.
  • DO NOT touch
    docs/prd/
    or
    docs/plans/<other-FR>.md
    .
    This skill changes one plan's checkboxes and the implementation files. Other plans are out of scope.
完整的错误模式目录请参见references/anti-patterns.md。前五条禁止操作:
  • 禁止批量处理任务。一个commit中包含两个
    [x]
    标记会破坏可追溯性。
  • 禁止在测试失败时标记
    [x]
    。复选框代表测试通过的契约。
  • 禁止自动打开PR。第3阶段生成PR描述;由用户打开PR。
  • 禁止悄悄修复无关bug。记录问题;不要将其混入本计划的commit中。
  • 禁止修改
    docs/prd/
    docs/plans/<other-FR>.md
    。本技能仅修改一个计划的复选框和实现文件。其他计划不在范围内。

References

参考资料

  • Phase prompts: prompts/01-load-context.md, prompts/02-task-loop.md, prompts/03-finalize.md
  • Per-task execution scaffold: templates/task-execution.md.tmpl
  • 8-point handoff checklist: references/checklist.md
  • Anti-patterns and recovery moves: references/anti-patterns.md
  • Source framework: ../../docs/framework.md
  • Upstream skills:
    generate-dev-plan
    ,
    declarative-design
  • 阶段提示:prompts/01-load-context.mdprompts/02-task-loop.mdprompts/03-finalize.md
  • 单任务执行模板:templates/task-execution.md.tmpl
  • 8项交接检查清单:references/checklist.md
  • 反模式与恢复措施:references/anti-patterns.md
  • 源框架:../../docs/framework.md
  • 上游技能:
    generate-dev-plan
    declarative-design