ds-plan-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ds-plan-loop

ds-plan-loop

Plan before coding, check the plan once, then build the task one verified step at a time.
编码前先制定计划,检查计划一次,然后以每步经过验证的方式完成任务。

Steps

步骤

  1. Restate the goal in one sentence. List the files and commands you expect to touch. Read those files before you plan. Do not plan from memory.
  2. Write a numbered plan. Each step gets one action and one acceptance check that a command or a direct observation can confirm, for example "
    npm test -- auth
    passes" or "
    GET /health
    returns 200". Keep each step small enough to verify in a single diff.
  3. Write the plan to a file (PLAN.md, or the PROGRESS.md from ds-context-reset) so later steps and fresh sessions can read it.
  4. Critique the plan in a fresh pass. Reread only the goal and the plan, as a reviewer who did not write it. If you can, run the critique in a subagent or new session. Answer three questions:
    • Which step is missing (setup, migration, config, tests, cleanup)?
    • Which assumption has not been checked against the code or docs?
    • Is there a simpler path that reaches the same goal with fewer steps?
  5. Revise the plan. Check each risky assumption now by reading code or running a command. Do not carry it forward as a guess.
  6. Execute step 1 only. Run its acceptance check and read the real output. Use ds-verify-loop when the check fails.
  7. Mark the step done in the plan file, along with the evidence (command and result). Then move to the next step.
  8. If a step shows that the plan is wrong, stop and revise the remaining steps before continuing. Do not improvise around it.
  1. 用一句话重述目标。列出预计会涉及的文件和命令。制定计划前先阅读这些文件。不要凭记忆制定计划。
  2. 编写编号计划。每一步包含一个操作和一个验收检查,可通过命令或直接观察来确认,例如“
    npm test -- auth
    通过”或“
    GET /health
    返回 200”。每一步应足够小,能够通过单个 diff 验证。
  3. 将计划写入文件(PLAN.md,或 ds-context-reset 使用的 PROGRESS.md),以便后续步骤和新会话读取。
  4. 在一次全新的审查中批评计划。重新阅读时只查看目标和计划,并以未参与计划撰写的审查者视角进行审查。如果可以,在 subagent 或新会话中执行审查。回答以下三个问题:
    • 缺少哪个步骤(设置、迁移、配置、测试、清理)?
    • 哪个假设尚未与代码或文档核对?
    • 是否存在一条步骤更少、但能实现相同目标的更简单路径?
  5. 修订计划。现在通过阅读代码或运行命令,检查每个有风险的假设。不要将未经核实的假设继续保留下去。
  6. 仅执行第 1 步。运行其验收检查,并阅读真实输出。如果检查失败,使用 ds-verify-loop。
  7. 在计划文件中将该步骤标记为已完成,同时记录证据(命令和结果)。然后进入下一步。
  8. 如果某一步表明计划有误,停止执行,并在继续前修订剩余步骤。不要绕过问题即兴处理。

Stop when

停止条件

  • Every step is marked done and its check passed, and the original goal holds when you check it end to end.
  • You have done 2 critique rounds. A third round almost never finds anything new, so execute.
  • A step fails its check twice in a row. Switch to ds-unstick.
  • 每个步骤均已标记为完成且检查通过,并且通过端到端检查确认原始目标已达成。
  • 已完成 2 轮审查。第三轮几乎不会发现任何新问题,因此开始执行。
  • 某一步的检查连续失败两次。切换到 ds-unstick。

Rules

规则

  • No step without a check. "Looks right" is not a check.
  • Do one step per diff. Do not batch steps to save time.
  • Do not add steps that the goal does not need.
  • Keep the plan short: about 3-10 steps. Split bigger work into separate plans.
  • 没有检查步骤不得执行。“看起来没问题”不算检查。
  • 每个 diff 只执行一个步骤。不要为了节省时间而批量执行步骤。
  • 不要添加目标不需要的步骤。
  • 保持计划简短:约 3–10 步。将较大的工作拆分为独立计划。