plan-execute

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Plan Execute Skill

Plan Execute 技能

Purpose

用途

When the user runs
/plan-execute {plan-file-path}
, start the "orchestrated plan execution" workflow:
  1. I (Claude Code) ask Codex to implement the code according to the plan.
  2. After Codex finishes, I review the generated code.
  3. I write the review into the
    reviews/
    directory, then ask Codex to inspect and fix the issues.
  4. Repeat until the code quality bar is met.
Core principle: I do not write or edit code myself. I only do two things: review code and orchestrate Codex. All code changes, including implementation and fixes, are performed by Codex.
当用户运行
/plan-execute {plan-file-path}
时,启动「编排式计划执行」工作流:
  1. 我(Claude Code)要求Codex根据计划实现代码。
  2. Codex完成后,我审查生成的代码。
  3. 我将审查结果写入
    reviews/
    目录,然后要求Codex检查并修复问题。
  4. 重复上述步骤,直到达到代码质量标准。
核心原则:我不会自行编写或编辑代码。我仅负责两件事:审查代码和编排Codex。所有代码变更,包括实现和修复,均由Codex执行。

Usage

使用方式

/plan-execute plans/my-feature-plan.md
/plan-execute plans/my-feature-plan.md

Session Reuse

会话复用

After each Codex invocation, extract
session_id=xxx
from the script output and save it as the session ID for the current task. In later Codex calls for the same task, pass
--session <id>
to reuse context so Codex remembers prior implementation and fix history instead of rereading the entire codebase every time.
每次调用Codex后,从脚本输出中提取
session_id=xxx
并保存为当前任务的会话ID。在后续针对同一任务的Codex调用中,传入
--session <id>
以复用上下文,这样Codex就能记住之前的实现和修复历史,无需每次重新读取整个代码库。

My Workflow (Claude Code)

我的工作流(Claude Code)

Step 1: Read the Plan and Split Execution Steps

步骤1:读取计划并拆分执行步骤

Read the specified plan file and understand:
  • The overall goal and scope of the plan
  • The list of files to create or modify
  • The order of implementation steps
  • Relevant project conventions, especially from
    CLAUDE.md
If the plan already contains a checklist (
- [ ]
/
- [x]
), use those items as execution units. If it does not define clear steps, split the work into reasonable batches, with no more than 5 file changes per batch.
读取指定的计划文件,理解以下内容:
  • 计划的整体目标和范围
  • 需要创建或修改的文件列表
  • 实现步骤的顺序
  • 相关的项目约定,尤其是
    CLAUDE.md
    中的内容
如果计划中已包含检查清单(
- [ ]
/
- [x]
),则将这些项作为执行单元。如果计划未定义明确的步骤,则将工作拆分为合理的批次,每批次最多包含5个文件变更。

Step 2: Ask Codex to Implement the Code

步骤2:要求Codex实现代码

Use the
/codex
skill and give Codex the following instruction:
Implement the code according to the plan in {plan-file-path}.

Current execution scope: {specific step or batch description}

Requirements:
- Follow the design in the plan exactly. Do not improvise beyond it.
- Obey the Code Quality Hard Limits defined in `CLAUDE.md`.
- Single file <= 800 lines, single function <= 50 lines, nesting <= 3 levels
- Run `pnpm build` after implementation to confirm compilation succeeds
- If the plan includes a checklist, mark completed steps as `[x]`

After implementation, list all changed files and provide a summary of each change.
使用
/codex
技能,并向Codex提供以下指令:
Implement the code according to the plan in {plan-file-path}.

Current execution scope: {specific step or batch description}

Requirements:
- Follow the design in the plan exactly. Do not improvise beyond it.
- Obey the Code Quality Hard Limits defined in `CLAUDE.md`.
- Single file <= 800 lines, single function <= 50 lines, nesting <= 3 levels
- Run `pnpm build` after implementation to confirm compilation succeeds
- If the plan includes a checklist, mark completed steps as `[x]`

After implementation, list all changed files and provide a summary of each change.

Step 3: Review Codex Output (My Core Responsibility)

步骤3:审查Codex的输出(我的核心职责)

After Codex finishes, I perform a code review. Important: I only read code and write reviews. I never directly modify source files.
  1. Read every changed file and review them one by one.
  2. Compare against the plan to verify the implementation matches the intended design.
  3. Check code quality, including:
    • Whether it violates the Code Quality Hard Limits
    • Whether it introduces security risks
    • Whether error handling is missing
    • Whether naming and organization are clear
    • Whether it follows existing project patterns
  4. Run
    pnpm build
    to confirm the compilation status.
Codex完成后,我将执行代码审查。重要提示:我仅读取代码并撰写审查结果,绝不会直接修改源文件。
  1. 读取所有变更文件,逐一进行审查。
  2. 与计划对比,验证实现是否符合预期设计。
  3. 检查代码质量,包括:
    • 是否违反代码质量硬限制
    • 是否引入安全风险
    • 是否缺少错误处理
    • 命名和组织是否清晰
    • 是否遵循现有项目模式
  4. **运行
    pnpm build
    **以确认编译状态。

Step 4: Write the Review and Hand Fixes Back to Codex

步骤4:撰写审查结果并将修复任务交还给Codex

Append the review to
reviews/{topic}-review.md
(shared with
plan-review
):
markdown
---
将审查结果追加到
reviews/{topic}-review.md
(与
plan-review
共享):
markdown
---

Code Review Round {N} — {YYYY-MM-DD}

Code Review Round {N} — {YYYY-MM-DD}

Scope: {code scope covered in this review} Build Status: PASS / FAIL
Scope: {code scope covered in this review} Build Status: PASS / FAIL

Issues

Issues

Issue 1 ({severity}): {title}

Issue 1 ({severity}): {title}

File: {file-path:line} {issue description} Fix: {specific fix recommendation}
...
File: {file-path:line} {issue description} Fix: {specific fix recommendation}
...

Verdict: NEEDS_FIX / APPROVED

Verdict: NEEDS_FIX / APPROVED


If `Verdict: NEEDS_FIX`, call `/codex` and have Codex fix the issues instead of editing them myself:
Read the latest Code Review round in {review-file-path}. Check each issue one by one. Fix the valid issues, and explain why any disputed item is not actually a problem. After making fixes, run
pnpm build
to confirm compilation succeeds. List the issues that were fixed and the corresponding code changes.

If `Verdict: APPROVED`, skip to Step 6.

如果判定结果为`Verdict: NEEDS_FIX`,则调用`/codex`让Codex修复问题,而非自行编辑:
Read the latest Code Review round in {review-file-path}. Check each issue one by one. Fix the valid issues, and explain why any disputed item is not actually a problem. After making fixes, run
pnpm build
to confirm compilation succeeds. List the issues that were fixed and the corresponding code changes.

如果判定结果为`Verdict: APPROVED`,则跳至步骤6。

Step 5: Verify Fixes and Iterate

步骤5:验证修复并迭代

After Codex applies fixes, I review again, still without editing code directly:
  • Check whether each issue was truly fixed
  • Check whether the fixes introduced new problems
  • If issues remain, write a new review round and hand it back to Codex for another fix pass (repeat Step 4)
  • If everything passes, mark the review as
    Verdict: APPROVED
Codex应用修复后,我将再次进行审查,仍不会直接编辑代码:
  • 检查每个问题是否真的被修复
  • 检查修复是否引入了新问题
  • 如果仍有问题,撰写新的审查轮次并交还给Codex进行下一轮修复(重复步骤4)
  • 如果所有内容都通过,将审查标记为
    Verdict: APPROVED

Step 6: Update Plan Progress

步骤6:更新计划进度

After each batch is completed, ask Codex to update the checklist in the plan file (
- [ ]
->
- [x]
). If unfinished steps remain, go back to Step 2 for the next batch. Once all work is complete, move to the wrap-up.
每完成一个批次后,要求Codex更新计划文件中的检查清单(
- [ ]
->
- [x]
)。如果仍有未完成的步骤,则返回步骤2处理下一个批次。所有工作完成后,进入收尾阶段。

Step 7: Wrap Up

步骤7:收尾

Report the following to the user:
  • Which steps were completed
  • How many code review rounds were needed
  • Which major issues were fixed
  • Final build status
  • List of changed files
  • Path to the review log file
向用户报告以下内容:
  • 已完成的步骤
  • 所需的代码审查轮次
  • 已修复的主要问题
  • 最终编译状态
  • 变更文件列表
  • 审查日志文件的路径

Review Severity Levels

审查严重程度等级

LevelMeaningMust Fix
CriticalCauses runtime failures or security vulnerabilitiesYes
HighViolates project conventions or has obvious design flawsYes
MediumCode quality issue that should be improvedRecommended
LowStyle or preference issueOptional
SuggestionOptimization suggestionOptional
Verdict rules:
  • If any Critical or High issue exists ->
    NEEDS_FIX
  • If all issues are Medium or below ->
    APPROVED
    with optional improvement notes
等级含义是否必须修复
Critical导致运行时故障或安全漏洞
High违反项目约定或存在明显设计缺陷
Medium应改进的代码质量问题建议修复
Low风格或偏好问题可选
Suggestion优化建议可选
判定规则:
  • 若存在任何Critical或High等级的问题 ->
    NEEDS_FIX
  • 若所有问题均为Medium或更低等级 ->
    APPROVED
    ,可附带可选的改进说明

File Convention

文件约定

  • Share the same review file as
    plan-review
    :
    reviews/{topic}-review.md
  • {topic}
    is the plan file name without
    .md
  • Both plan review rounds and code review rounds are appended to the same file
  • Distinguish them by heading:
    ## Round {N}
    for plan review and
    ## Code Review Round {N}
    for code review
  • plan-review
    共享同一审查文件:
    reviews/{topic}-review.md
  • {topic}
    是不带
    .md
    后缀的计划文件名
  • 计划审查轮次和代码审查轮次均追加到同一文件中
  • 通过标题区分:计划审查使用
    ## Round {N}
    ,代码审查使用
    ## Code Review Round {N}