plan-execute
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlan Execute Skill
Plan Execute 技能
Purpose
用途
When the user runs , start the "orchestrated plan execution" workflow:
/plan-execute {plan-file-path}- I (Claude Code) ask Codex to implement the code according to the plan.
- After Codex finishes, I review the generated code.
- I write the review into the directory, then ask Codex to inspect and fix the issues.
reviews/ - 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}- 我(Claude Code)要求Codex根据计划实现代码。
- Codex完成后,我审查生成的代码。
- 我将审查结果写入目录,然后要求Codex检查并修复问题。
reviews/ - 重复上述步骤,直到达到代码质量标准。
核心原则:我不会自行编写或编辑代码。我仅负责两件事:审查代码和编排Codex。所有代码变更,包括实现和修复,均由Codex执行。
Usage
使用方式
/plan-execute plans/my-feature-plan.md/plan-execute plans/my-feature-plan.mdSession Reuse
会话复用
After each Codex invocation, extract from the script output and save it as the session ID for the current task. In later Codex calls for the same task, pass to reuse context so Codex remembers prior implementation and fix history instead of rereading the entire codebase every time.
session_id=xxx--session <id>每次调用Codex后,从脚本输出中提取并保存为当前任务的会话ID。在后续针对同一任务的Codex调用中,传入以复用上下文,这样Codex就能记住之前的实现和修复历史,无需每次重新读取整个代码库。
session_id=xxx--session <id>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 ( / ), 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.
- [ ]- [x]读取指定的计划文件,理解以下内容:
- 计划的整体目标和范围
- 需要创建或修改的文件列表
- 实现步骤的顺序
- 相关的项目约定,尤其是中的内容
CLAUDE.md
如果计划中已包含检查清单( / ),则将这些项作为执行单元。如果计划未定义明确的步骤,则将工作拆分为合理的批次,每批次最多包含5个文件变更。
- [ ]- [x]Step 2: Ask Codex to Implement the Code
步骤2:要求Codex实现代码
Use the skill and give Codex the following instruction:
/codexImplement 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提供以下指令:
/codexImplement 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.
- Read every changed file and review them one by one.
- Compare against the plan to verify the implementation matches the intended design.
- 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
- Run to confirm the compilation status.
pnpm build
Codex完成后,我将执行代码审查。重要提示:我仅读取代码并撰写审查结果,绝不会直接修改源文件。
- 读取所有变更文件,逐一进行审查。
- 与计划对比,验证实现是否符合预期设计。
- 检查代码质量,包括:
- 是否违反代码质量硬限制
- 是否引入安全风险
- 是否缺少错误处理
- 命名和组织是否清晰
- 是否遵循现有项目模式
- **运行**以确认编译状态。
pnpm build
Step 4: Write the Review and Hand Fixes Back to Codex
步骤4:撰写审查结果并将修复任务交还给Codex
Append the review to (shared with ):
reviews/{topic}-review.mdplan-reviewmarkdown
---将审查结果追加到(与共享):
reviews/{topic}-review.mdplan-reviewmarkdown
---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 to confirm compilation succeeds.
List the issues that were fixed and the corresponding code changes.
pnpm build
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 to confirm compilation succeeds.
List the issues that were fixed and the corresponding code changes.
pnpm build
如果判定结果为`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 ( -> ).
If unfinished steps remain, go back to Step 2 for the next batch.
Once all work is complete, move to the wrap-up.
- [ ]- [x]每完成一个批次后,要求Codex更新计划文件中的检查清单( -> )。如果仍有未完成的步骤,则返回步骤2处理下一个批次。所有工作完成后,进入收尾阶段。
- [ ]- [x]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
审查严重程度等级
| Level | Meaning | Must Fix |
|---|---|---|
| Critical | Causes runtime failures or security vulnerabilities | Yes |
| High | Violates project conventions or has obvious design flaws | Yes |
| Medium | Code quality issue that should be improved | Recommended |
| Low | Style or preference issue | Optional |
| Suggestion | Optimization suggestion | Optional |
Verdict rules:
- If any Critical or High issue exists ->
NEEDS_FIX - If all issues are Medium or below -> with optional improvement notes
APPROVED
| 等级 | 含义 | 是否必须修复 |
|---|---|---|
| Critical | 导致运行时故障或安全漏洞 | 是 |
| High | 违反项目约定或存在明显设计缺陷 | 是 |
| Medium | 应改进的代码质量问题 | 建议修复 |
| Low | 风格或偏好问题 | 可选 |
| Suggestion | 优化建议 | 可选 |
判定规则:
- 若存在任何Critical或High等级的问题 ->
NEEDS_FIX - 若所有问题均为Medium或更低等级 -> ,可附带可选的改进说明
APPROVED
File Convention
文件约定
- Share the same review file as :
plan-reviewreviews/{topic}-review.md - is the plan file name without
{topic}.md - Both plan review rounds and code review rounds are appended to the same file
- Distinguish them by heading: for plan review and
## Round {N}for code review## Code Review Round {N}
- 与共享同一审查文件:
plan-reviewreviews/{topic}-review.md - 是不带
{topic}后缀的计划文件名.md - 计划审查轮次和代码审查轮次均追加到同一文件中
- 通过标题区分:计划审查使用,代码审查使用
## Round {N}## Code Review Round {N}