SuperAPI AI Directory

executing-plans

Coding & development

View repository

Updated 10-14 14:35

About this skill

Execute the plan

In this session, personally execute the plan, one task after another: do not dispatch an implementer subagent for each task, nor a reviewer for each task. Only at the end, do a single fresh-context review of the entire branch.

Why inline: Subagent-driven development pays for a fresh implementer and a fresh reviewer for each task, each of which must reread the codebase from scratch. Inline execution pays for only one context (your own) plus a final reviewer. What it gives up is a fresh context per task and a second pair of eyes per task. This skill preserves the benefits those two things buy by other means: the brief is the spec, the ledger is your memory, TDD is the gate for each task, and the final reviewer is the second pair of eyes.

Core principles: The plan has already done the thinking. Execute it strictly, prove every step with a test you watch fail and then watch pass, and leave a record that will still exist after you yourself have forgotten.

Narration: Say at most one brief sentence of narration between tool calls—the ledger and the tool results are the record.

Continuous execution: Do not stop between tasks to check with your human partner. They chose inline execution to spend less money, not to answer "should I continue?" after every task. Execute all tasks in the plan without interruption.

Make rulings, don't stall. Conflicts, ambiguities, plan defects—you decide. The spec is the binding authority, the plan is its argument, and whatever neither can answer is decided by your judgment. Record every decision in the ledger as Ruling: <你决定了什么> — <为什么> — <如果错了代价是什么> , then continue. A ruling not recorded in the ledger deviates from the plan and is equivalent to a decision made in secret.

Only four things stop you, and only these four: irreversible or destructive operations; security-related actions; side effects outside this worktree that by convention should be asked about first (merging, pushing to a shared branch, releasing); and a plan so bad that every path forward can only be guessed at. When you hit these four, stop and ask.

When to use

  • You have a plan from writing-plans, and your human partner chose inline execution at handoff.
  • Your runtime has no subagent tool (see the platform references under ../using-superpowers/references/ ). Never fabricate a dispatch; execute the plan right here.
  • The tasks are largely independent of one another—the same premise as subagent-driven-development.

A fully written plan turns inline execution into "copy + test": it runs well on a mid-tier session model, and the only place the strongest model earns its cost is the final review—which this skill dispatches separately. When your human partner chooses inline, tell them this.

When your human partner wants a review gate for every task, or the plan is long enough that later tasks will run on compressed context, prefer subagent-driven-development. Inline execution is still viable on long plans—the ledger makes it resumable—but the last few tasks get the least of you.

Process

digraph process {
    rankdir=TB;

    subgraph cluster_per_task {
        label="每个任务";
        "task-start: 简报 + BASE; 读简报" [shape=box];
        "按顺序做各步: TDD, 跑每个验证, 读每份输出" [shape=box];
        "步骤输出与计划的 Expected 一致?" [shape=diamond];
        "计划错了? 裁决并记账。代码错了? systematic-debugging" [shape=box];
        "按计划的提交步骤提交" [shape=box];
        "完成契约满足?" [shape=diamond];
        "task-done: 跑测试, 结果记进账本; 标记待办完成" [shape=box];
    }

    "准备: 工作树、工作区 + 账本、读计划 + 规格、起飞前扫描" [shape=box];
    "还有任务?" [shape=diamond];
    "最终整分支审查 (有条件就用全新审查者)" [shape=box];
    "重新定级, 然后: Critical/Important → 一轮修复, 每个修复 RED→GREEN + 全套件绿; Minor → 账本" [shape=box];
    "最终审查干净: 删除本计划的工作区" [shape=box];
    "使用 finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];

    "准备: 工作树、工作区 + 账本、读计划 + 规格、起飞前扫描" -> "task-start: 简报 + BASE; 读简报";
    "task-start: 简报 + BASE; 读简报" -> "按顺序做各步: TDD, 跑每个验证, 读每份输出";
    "按顺序做各步: TDD, 跑每个验证, 读每份输出" -> "步骤输出与计划的 Expected 一致?";
    "步骤输出与计划的 Expected 一致?" -> "计划错了? 裁决并记账。代码错了? systematic-debugging" [label="否"];
    "计划错了? 裁决并记账。代码错了? systematic-debugging" -> "按顺序做各步: TDD, 跑每个验证, 读每份输出";
    "步骤输出与计划的 Expected 一致?" -> "按计划的提交步骤提交" [label="是, 最后一步"];
    "按计划的提交步骤提交" -> "完成契约满足?";
    "完成契约满足?" -> "按顺序做各步: TDD, 跑每个验证, 读每份输出" [label="否 - 把任务做完"];
    "完成契约满足?" -> "task-done: 跑测试, 结果记进账本; 标记待办完成" [label="是"];
    "task-done: 跑测试, 结果记进账本; 标记待办完成" -> "还有任务?";
    "还有任务?" -> "task-start: 简报 + BASE; 读简报" [label="是"];
    "还有任务?" -> "最终整分支审查 (有条件就用全新审查者)" [label="否"];
    "最终整分支审查 (有条件就用全新审查者)" -> "重新定级, 然后: Critical/Important → 一轮修复, 每个修复 RED→GREEN + 全套件绿; Minor → 账本";
    "重新定级, 然后: Critical/Important → 一轮修复, 每个修复 RED→GREEN + 全套件绿; Minor → 账本" -> "最终审查干净: 删除本计划的工作区";
    "最终审查干净: 删除本计划的工作区" -> "使用 finishing-a-development-branch";
}

Prepare

Ensure the work happens in an isolated workspace: create one with using-git-worktrees, or verify the one that already exists. Never start implementation on the main/master branch without the explicit consent of your human partner.

Session memory does not survive context compaction. An inline executor that has lost its place will re-implement tasks whose commits already exist — the same failure as the controller re-dispatching them, only the cost is paid in your own context. Record progress in a ledger file, not just in the todo list. The runtime's todo list is only a live view; the ledger is the record.

The workspace and ledger are shared with subagent-driven-development — the same directory, the same format — so a plan can switch execution modes mid-execution, and a new executor picks up from the same ledger.

  • Each plan has its own workspace: When the skill starts, run ../subagent-driven-development/scripts/sdd-workspace PLAN_FILE— it prints the plan-specific, git-ignored directory (<repo-root>/.superpowers/sdd/<计划文件名>/),this planall artifacts go there: the ledger, briefs, review packages. Other plans' directories are not yours; do not read or write them.
  • Go to <工作区>/progress.md to look up this plan's ledger. If its first line names your plan file, then tasks with a Task <N>: complete line arecompleted— do not redo them; continue from the first task that lacks that line. Even if your context no longer remembers doing them, their commits really do exist in git: after compaction, trust the ledger and git log, not your own memory. If the ledger's first line names a different plan file, that is another plan's progress: stay put and start your own new ledger.
  • When creating the ledger, write its identity on the first line:# SDD ledger — plan: <计划文件路径>。
  • git clean -fdx will destroy the workspace (it is a git-ignored scratch area); if that happens, recover from git log .

Read the planthrough, note its context and global constraints, and create a todo for each task. If the plan names a spec (Spec), read the spec too: the spec is the authority against which the plan argues, and conflicts within the plan are adjudicated by it. If no reachable spec can be found for the plan, record a note in the ledger — any ruling made without a spec is provisional.

Required sub-skill: Now, before task 1, load test-driven-development. It governs every step of every task below; a plan whose steps already say "write the failing test first" does not exempt you from reading it.

Before task 1, scan the plan for conflicts between tasks. The plan's Interfaces block tells you where to look: each task that consumes output from an earlier task corresponds to a line in the ledger — the two tasks, what one produces versus what the other consumes, and what you find. Tasks that share nothing do not get a line; a plan in which the tasks share nothing gets just one line: Pre-flight: no shared interfaces. With the spec as the binding authority, adjudicate each conflict that a line turns up, record the ruling next to that line, and then start task 1. Each task's own text is checked when you read its brief, not here.

Task loop

Everything you print, every tool result, stays resident in your context for the rest of the session. Redirect verbose test output to a file in the workspace and read only its tail; read the briefing, not the whole plan.

1. Take on the task

  • Run this skill's scripts/task-start PLAN_FILE N. A single call prints the briefing path and BASE (the commit this task's scope is cut from). Read the briefing for every task, including the ones you remember from the preparation phase: what you remember is a summary, the briefing has the exact values, signatures, and test cases.
  • Mark that task's todo as in_progress.

Every tool call is a round, and it re-reads your entire context. Do the bookkeeping alongside the work—ledger appends and commits go in the same call, never in a call of their own.

2. Do the steps

The plan's steps are already in RED-GREEN order; under test-driven-development, which was loaded in the preparation phase, do them in that order. Write the test step's code first and run it first. Watching it fail is a step, not a formality—a test that passes when the implementation does not yet exist is itself a finding about that test.

Every step that runs a command has a line Expected:. Run the command, read its output, then compare. Three outcomes:

  • Match. Next step.
  • The code is wrong. Use systematic-debugging. Find the cause; never patch the symptom just to make the step's output line up.
  • The plan is wrong—a step contradicts the spec, an earlier task's interface does not match what this task consumes, a command that simply cannot work. Rule on the smallest change that satisfies the spec, record it in the ledger as Task <N>: Ruling: <发现> — <你决定了什么,以及为什么> , then continue. Rulings are carried, not remembered: a later task that touches the same interface reads it from the ledger.

Commit per the plan's commit step. One task spanning several commits is fine; the review scope is cut from BASE, never use HEAD~1。

3. Completion contract

Before a task writes a ledger line, every item below must be true and have evidence in this session—not be inferred just because the diff looks fine:

  • Every test the briefing names exists, was run in this task, and you read the output.
  • This task's last test run passed—task-done is that run, and it writes the command and result into the ledger line.
  • Every line in the briefing Expected: was compared against real output.
  • Every deviation from the briefing has a line in the ledger Ruling:。

Required sub-skill: This declaration is governed by verification-before-completion. If any item is missing, the task is not complete: finish it.

4. Complete the task

Run this skill's scripts/task-done PLAN_FILE N BASE -- <测试命令>, using the test command the briefing names for the whole task. It runs the tests, saves the full output in the workspace, prints the tail, and—only if the tests pass—appends a completion line to the ledger:

Task <N>: complete (commits <base7>..<head7>, tests: <command> → <result>)

A failed run records nothing; the task is not complete. After a successful record, mark the todo as complete and pick up the next task.

Final review

Run ../subagent-driven-development/scripts/review-package PLAN_FILE MERGE_BASE HEAD(MERGE_BASE = the commit at the branch's start point, e.g. git merge-base main HEAD), and review based on the files it prints.

When a subagent tool is available: dispatch the reviewer on the strongest available model—full-branch review is a judgment task—using requesting-code-review's code-reviewer.md, attaching the review package path, the paths of the plan and spec, the plan's "Review Focus" section (if any) verbatim (i.e., the input categories and failure modes the plan's tests do not cover—the reviewer will deliberately check each one), and a pointer to the Ruling: line in the ledger so it can weigh the decisions you made. Specify the model explicitly; omitting the model inherits the session's model, and that is not necessarily the strongest. This is the only fresh context bought for the entire run. Do not skip it, and do not substitute your own reading of the diff for it.

When no subagent tool is available: read code-reviewer.md, and after the last task's ledger line, as a separate round, do that review yourself against the review package. Write Final review: self-review (no subagent tool)to the ledger, and state in your final message: author self-review is weaker than a fresh reviewer, and whether that is sufficient before merging is for your human partner to decide.

Before acting on any finding, triage them first. The reviewer's severity labels are only suggestions; the gate is in your hands. Its "Declined to judge" list is also yours: each line there is a ruling you must make and record in the ledger, exactly like a plan conflict—Final: Ruling: <审查者搁置的行为> — <使用这个软件的一个合理的人会得到什么,以及为什么维持原样、或为什么现在它算一条发现> — <如果错了代价是什么>. First re-rate by impact: the spec is a vision document, and a finding's level depends on what a reasonable person using this software after it ships would encounter, not on whether the spec named the input that triggers it—because a reviewer who rates a finding Minor just because the spec does not mention it is rating the spec, not the impact. Then:

  • Critical and Important enter the fix round.
  • Minor are recorded in the ledger as Final: minor (deferred): <一句话> , and written into the "Deferred Minor" section of your final message. Minor never enters the fix round, and never becomes a ruling—a ruling is a decision about a conflict, not a note saying "I did not adopt this polish suggestion."

Critical and Important findings you fix yourself—here you are the implementer—one roundto fix them. Each fix is verified by TDD, not by a second reviewer: write the test that reproduces the finding, watch it fail, make it pass, then run the entire suite. Each one is recorded in the ledger as Final: fixed <发现> — <测试名> RED→GREEN, suite <N>/<N> . A fix without a test that failed first does not count as verified; if the suite is not all green after the fix round, the round is not over. Do not dispatch a re-review: the diff it would have to reread—the tests covering it have already answered "is it resolved," and the suite run has already answered "did it break anything else."

A finding you decide not to fix is a ruling—Final: Ruling: <发现> — <为什么代码可以维持原样> — <如果错了代价是什么>—it will be brought before your human partner via the rulings checklist. There is no second fix round.

Wrap-up

Before deleting anything, collect all lines in the ledger containing Ruling: into the "Rulings I Made" section of your final message in the order you made them, each with the cost if it is wrong; collect every minor (deferred) line into the "Deferred Minor" section. Both lists must be complete. Your final message is the only place where the decisions you made on behalf of your human partner—and the findings you chose not to address—are brought before them.

Once the final review is clean and its fixes are committed, delete this plan's workspace directory—the git history is now the record. Sibling directories belong to other plans; don't touch them.

Use finishing-a-development-branch.

Common rationalizations

Excuse Reality
"I remember what task N said" What you remember is the summary. The brief has the exact values. Go read it.
"The code in the plan is correct, skip the step of watching the test fail" A test you've never seen fail proves nothing. It's one step. Run it.
"I'll run the full suite at the end, I don't need to run it at every step" Run it at every step, and you'll know which step broke it. The run at the end of the task is the contract, not a substitute.
"The plan is wrong here, I'll just do the right thing" Do the right thing, and record the ruling in the ledger. An unrecorded deviation is a decision made in secret.
"I'll make up the ledger rows after I finish a few tasks" Compaction won't pick a convenient time. One row per task, in the same message as the commit.
"Let me confirm before the next task" They chose inline to spend less money. Progress check-ins cost them their time. Only those four categories can make you stop.
"I've carefully read my own diff, a final reviewer is redundant" The same author, the same blind spots. The reviewer is the only fresh context this run buys.
"The change is small, the tests should pass" "Should" is not evidence. The contract requires the command and its output.
"Subagents are slow and expensive, I'll skip the final review too" Inline has already removed the reviewer for each task. One review of the whole branch is the floor, not the ceiling.
"The reviewer says it's Minor, so it's Minor" That label rates the spec's silence. Rate what the user will get. Re-rate first, then pass the gate.
"The fix is obvious, no need to write a failing test first" The failing test is the only proof that this finding really existed and is now gone. Without it, all you have is a diff and a hope.
"I'll fix the Minor ones too while I'm at it" Every Minor you fix is a test, a fix, and a suite run your partner didn't ask for. Record it in the ledger; let your partner decide.

Example workflow

你:我正在使用 executing-plans 技能以内联方式实现这份计划。

[准备:工作树已核实]
[读计划一次:docs/superpowers/plans/feature-plan.md;规格已读]
[解析工作区:sdd-workspace docs/superpowers/plans/feature-plan.md —— 里面没有账本,全新开始]
[起飞前扫描:2 行共享接口、4 行自洽性,均无问题;已写入账本]
[为所有任务创建待办]

任务 1:钩子安装脚本

[task-start plan 1 → 简报已读;BASE a1b2c3d]
[步骤 1:写失败的测试 —— 已写]
[步骤 2:运行 —— FAIL:install_hook not defined。与 Expected 一致。]
[步骤 3:实现 —— 已写]
[步骤 4:运行 —— PASS 1/1。与 Expected 一致。]
[步骤 5:提交 —— d4e5f6a]
[契约:测试已运行,输出已读,无偏离]
[task-done plan 1 a1b2c3d -- npm test -- hooks → 账本:Task 1: complete (commits a1b2c3d..d4e5f6a, tests: npm test -- hooks → 1/1 pass)]

任务 2:恢复模式

[task-start plan 2 → 简报已读;BASE d4e5f6a]
[步骤 2:运行失败的测试 —— FAIL,但是导入错误:任务 1 导出的是
 installHook,简报消费的是 install_hook]
[裁决:简报里的消费方名称相对于任务 1 的 Produces 块是笔误;
 用 installHook —— 账本:Task 2: Ruling: install_hook → installHook — matches Task 1 Produces — cost if wrong: one rename]
[步骤 2-5 按计划进行;提交 b7c8d9e]
[task-done plan 2 d4e5f6a -- npm test -- recovery → 账本:Task 2: complete (commits d4e5f6a..b7c8d9e, tests: npm test -- recovery → 8/8 pass)]

...

[所有任务之后:review-package plan MERGE_BASE HEAD;分派 code-reviewer,最强模型]
审查者:一条 Important 发现 —— 进度上报间隔被写死了。两条 Minor。
[重新定级:Important 成立;Minor → 作为延后项记进账本]
[修复轮:test_progress_interval_configurable RED → 抽出 PROGRESS_INTERVAL → GREEN;套件 12/12;提交]
[账本:Final: fixed hardcoded interval — test_progress_interval_configurable RED→GREEN, suite 12/12]

我作出的裁决:
- 任务 2:install_hook → installHook(简报笔误;如果错了的代价:一次重命名)

延后的 Minor:
- README 缺少用法示例
- recovery.js 可以把 verify/repair 拆成两个文件

[删除本计划的工作区 —— 记录现在在 git 里]

正在使用 finishing-a-development-branch。