resolve-todo-parallel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Resolve all TODO comments using parallel processing, document lessons learned, then clean up completed todos.
使用并行处理解决所有TODO注释,记录经验教训,然后清理已完成的待办事项。

Workflow

工作流

1. Analyze

1. 分析

Get all unresolved TODOs from the /todos/*.md directory
If any todo recommends deleting, removing, or gitignoring files in
docs/brainstorms/
,
docs/plans/
, or
docs/solutions/
, skip it and mark it as
wont_fix
. These are compound-engineering pipeline artifacts that are intentional and permanent.
从/todos/*.md目录中获取所有未解决的TODO事项
如果某个待办事项建议删除、移除或通过gitignore忽略
docs/brainstorms/
docs/plans/
docs/solutions/
中的文件,则跳过该事项并标记为
wont_fix
。这些是复合工程流水线的产物,属于有意保留的永久文件。

2. Plan

2. 规划

Create a task list of all unresolved items grouped by type (e.g.,
TaskCreate
in Claude Code,
update_plan
in Codex). Analyze dependencies and prioritize items that others depend on. For example, if a rename is needed, it must complete before dependent items. Output a mermaid flow diagram showing execution order — what can run in parallel, and what must run first.
创建按类型分组的所有未解决事项的任务列表(例如Claude Code中的
TaskCreate
、Codex中的
update_plan
)。分析依赖关系,优先处理其他事项所依赖的任务。例如,如果需要重命名操作,则必须在依赖它的任务之前完成。输出一个Mermaid流程图,展示执行顺序——哪些任务可以并行运行,哪些必须优先执行。

3. Implement (PARALLEL)

3. 实施(并行)

Spawn a
compound-engineering:workflow:pr-comment-resolver
agent for each unresolved item.
If there are 3 items, spawn 3 agents — one per item. Prefer running all agents in parallel; if the platform does not support parallel dispatch, run them sequentially respecting the dependency order from step 2.
Keep parent-context pressure bounded:
  • If there are 1-4 unresolved items, direct parallel returns are fine
  • If there are 5+ unresolved items, launch in batches of at most 4 agents at a time
  • Require each resolver agent to return only a short status summary to the parent: todo handled, files changed, tests run or skipped, and any blocker that still needs follow-up
If the todo set is large enough that even batched short returns are likely to get noisy, use a per-run scratch directory such as
.context/compound-engineering/resolve-todo-parallel/<run-id>/
:
  • Have each resolver write a compact artifact for its todo there
  • Return only a completion summary to the parent
  • Re-read only the artifacts that are needed to summarize outcomes, document learnings, or decide whether a todo is truly resolved
为每个未解决的事项启动一个
compound-engineering:workflow:pr-comment-resolver
Agent。
如果有3个事项,则启动3个Agent——每个事项对应一个。优先让所有Agent并行运行;若平台不支持并行调度,则按照步骤2中的依赖顺序依次运行。
控制父上下文的压力:
  • 如果有1-4个未解决事项,直接并行返回即可
  • 如果有5个及以上未解决事项,每次最多启动4个Agent的批次
  • 要求每个Resolver Agent仅向父级返回简短的状态摘要:待办事项已处理、文件已修改、已运行或跳过测试,以及任何仍需跟进的阻塞问题
如果待办事项集大到即使是分批的简短返回也可能产生过多噪音,则使用每次运行的临时目录,例如
.context/compound-engineering/resolve-todo-parallel/<run-id>/
  • 让每个Resolver为其处理的待办事项在该目录中写入一个简洁的产物
  • 仅向父级返回完成摘要
  • 仅重新读取那些用于总结结果、记录经验或判断待办事项是否真正解决所需的产物

4. Commit & Resolve

4. 提交与标记完成

  • Commit changes
  • Remove the TODO from the file, and mark it as resolved.
  • Push to remote
GATE: STOP. Verify that todos have been resolved and changes committed. Do NOT proceed to step 5 if no todos were resolved.
  • 提交更改
  • 从文件中移除TODO标记,并将其标记为已解决
  • 推送到远程仓库
关卡:停止。验证待办事项已解决且更改已提交。如果没有待办事项被解决,请勿进入步骤5。

5. Compound on Lessons Learned

5. 总结经验教训

Load the
ce:compound
skill to document what was learned from resolving the todos.
The todo resolutions often surface patterns, recurring issues, or architectural insights worth capturing. This step ensures that knowledge compounds rather than being lost.
GATE: STOP. Verify that the compound skill produced a solution document in
docs/solutions/
. If no document was created (user declined or no non-trivial learnings), continue to step 6.
加载
ce:compound
技能,记录解决待办事项过程中学到的内容。
待办事项的解决过程通常会浮现出值得记录的模式、反复出现的问题或架构见解。此步骤确保知识得到沉淀而非流失。
关卡:停止。验证复合技能已在
docs/solutions/
目录中生成解决方案文档。如果未创建文档(用户拒绝或无重要经验可总结),则继续执行步骤6。

6. Clean Up Completed Todos

6. 清理已完成的待办事项

List all todos and identify those with
done
or
resolved
status, then delete them to keep the todo list clean and actionable.
If a scratch directory was used and the user did not ask to inspect it, clean it up after todo cleanup succeeds.
After cleanup, output a summary:
Todos resolved: [count]
Lessons documented: [path to solution doc, or "skipped"]
Todos cleaned up: [count deleted]
列出所有待办事项,识别出状态为
done
resolved
的事项,然后删除它们,以保持待办事项列表整洁且可操作。
如果使用了临时目录且用户未要求检查,则在待办清理成功后清理该目录。
清理完成后,输出以下摘要:
已解决的待办事项数量:[count]
已记录的经验教训:[解决方案文档路径,或“已跳过”]
已清理的待办事项数量:[已删除的数量]