@loneexile/omp-superpowers 6.4.2-omp.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/.pi/extensions/superpowers.ts +123 -0
  2. package/CHANGELOG.md +28 -0
  3. package/LICENSE +21 -0
  4. package/README.md +187 -0
  5. package/agents/sdd-escalation-implementer.md +18 -0
  6. package/agents/sdd-final-reviewer.md +23 -0
  7. package/agents/sdd-implementer.md +23 -0
  8. package/agents/sdd-rereviewer.md +69 -0
  9. package/agents/sdd-reviewer.md +83 -0
  10. package/package.json +40 -0
  11. package/skills/brainstorming/SKILL.md +285 -0
  12. package/skills/brainstorming/scripts/frame-template.html +213 -0
  13. package/skills/brainstorming/scripts/helper.js +167 -0
  14. package/skills/brainstorming/scripts/server.cjs +723 -0
  15. package/skills/brainstorming/scripts/start-server.sh +209 -0
  16. package/skills/brainstorming/scripts/stop-server.sh +120 -0
  17. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  18. package/skills/brainstorming/visual-companion.md +299 -0
  19. package/skills/diagnosing-superpowers/SKILL.md +120 -0
  20. package/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
  21. package/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
  22. package/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
  23. package/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
  24. package/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
  25. package/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
  26. package/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
  27. package/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
  28. package/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
  29. package/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
  30. package/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
  31. package/skills/diagnosing-superpowers/references/context-safety.md +22 -0
  32. package/skills/diagnosing-superpowers/references/github-issues.md +47 -0
  33. package/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
  34. package/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
  35. package/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
  36. package/skills/diagnosing-superpowers/templates/case.md +64 -0
  37. package/skills/diagnosing-superpowers/templates/issue.md +51 -0
  38. package/skills/diagnosing-superpowers/templates/report.md +82 -0
  39. package/skills/dispatching-parallel-agents/SKILL.md +167 -0
  40. package/skills/executing-plans/SKILL.md +373 -0
  41. package/skills/executing-plans/scripts/task-done +52 -0
  42. package/skills/executing-plans/scripts/task-start +28 -0
  43. package/skills/finishing-a-development-branch/SKILL.md +225 -0
  44. package/skills/receiving-code-review/SKILL.md +205 -0
  45. package/skills/requesting-code-review/SKILL.md +95 -0
  46. package/skills/requesting-code-review/code-reviewer.md +198 -0
  47. package/skills/subagent-driven-development/SKILL.md +681 -0
  48. package/skills/subagent-driven-development/implementer-prompt.md +157 -0
  49. package/skills/subagent-driven-development/re-review-prompt.md +110 -0
  50. package/skills/subagent-driven-development/scripts/review-package +53 -0
  51. package/skills/subagent-driven-development/scripts/sdd-workspace +82 -0
  52. package/skills/subagent-driven-development/scripts/task-brief +43 -0
  53. package/skills/subagent-driven-development/task-reviewer-prompt.md +205 -0
  54. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  55. package/skills/systematic-debugging/SKILL.md +283 -0
  56. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  57. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  58. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  59. package/skills/systematic-debugging/find-polluter.sh +72 -0
  60. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  61. package/skills/systematic-debugging/test-academic.md +14 -0
  62. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  63. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  64. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  65. package/skills/test-driven-development/SKILL.md +330 -0
  66. package/skills/test-driven-development/writing-good-tests.md +198 -0
  67. package/skills/using-git-worktrees/SKILL.md +194 -0
  68. package/skills/using-superpowers/SKILL.md +65 -0
  69. package/skills/using-superpowers/references/antigravity-tools.md +23 -0
  70. package/skills/using-superpowers/references/claude-code-tools.md +29 -0
  71. package/skills/using-superpowers/references/codex-tools.md +108 -0
  72. package/skills/using-superpowers/references/gemini-tools.md +63 -0
  73. package/skills/using-superpowers/references/hermes-tools.md +56 -0
  74. package/skills/using-superpowers/references/muse-tools.md +35 -0
  75. package/skills/using-superpowers/references/pi-tools.md +41 -0
  76. package/skills/verification-before-completion/SKILL.md +120 -0
  77. package/skills/writing-plans/SKILL.md +204 -0
  78. package/skills/writing-skills/SKILL.md +681 -0
  79. package/skills/writing-skills/anthropic-best-practices.md +1150 -0
  80. package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  81. package/skills/writing-skills/graphviz-conventions.dot +172 -0
  82. package/skills/writing-skills/persuasion-principles.md +187 -0
  83. package/skills/writing-skills/render-graphs.js +169 -0
  84. package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
@@ -0,0 +1,373 @@
1
+ ---
2
+ name: executing-plans
3
+ description: Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
4
+ ---
5
+
6
+ # Executing Plans
7
+
8
+ Execute the plan yourself, task by task, in this session: no implementer
9
+ subagent per task, no reviewer per task. One fresh-context review of the
10
+ whole branch at the end.
11
+
12
+ **Why inline:** Subagent-driven development pays for a fresh implementer
13
+ and a fresh reviewer on every task, each re-reading the codebase from zero.
14
+ Inline execution pays for one context (yours) plus one reviewer at the end.
15
+ What it gives up is a fresh context per task and a second pair of eyes per
16
+ task. This skill keeps what those two things bought, by other means: the
17
+ brief is the spec, the ledger is your memory, TDD is the per-task gate, and
18
+ the final reviewer is the second pair of eyes.
19
+
20
+ **Core principle:** The plan already did the thinking. Execute it exactly,
21
+ prove each step with a test you watched fail and then pass, and leave a
22
+ record that survives your own forgetting.
23
+
24
+ **Narration:** between tool calls, narrate at most one short line — the
25
+ ledger and the tool results carry the record.
26
+
27
+ **Continuous execution:** Do not pause to check in with your human partner
28
+ between tasks. They chose inline execution to spend less, not to answer
29
+ "should I continue?" after every task. Execute all tasks from the plan
30
+ without stopping.
31
+
32
+ **Rulings, not stalls.** Conflicts, ambiguities, plan defects — decide them.
33
+ The spec is the binding authority, the plan is its argument, and your
34
+ judgment settles what neither answers. Record every decision in the ledger
35
+ as `Ruling: <what you decided> — <why> — <what it costs if wrong>`, and keep
36
+ going. Deviating from the plan without a ledgered ruling is a decision made
37
+ in secret.
38
+
39
+ Four things stop you, and only these: an irreversible or destructive
40
+ operation; a security-sensitive action; a side effect outside this worktree
41
+ that norms say you ask about first (a merge, a push to a shared branch, a
42
+ publish); and a plan so broken that every path forward is a guess. For
43
+ those, stop and ask.
44
+
45
+ ## When to Use
46
+
47
+ - You have a plan from superpowers:writing-plans and your human partner
48
+ chose inline execution at the handoff.
49
+ - Your harness has no subagent tool (see the per-platform references in
50
+ `../using-superpowers/references/`). Never fabricate a dispatch; run
51
+ the plan here.
52
+ - Tasks are mostly independent — the same precondition as
53
+ superpowers:subagent-driven-development.
54
+
55
+ A fully specified plan makes inline execution transcription plus testing:
56
+ it runs well on a mid-tier session model, and the one place the most
57
+ capable model earns its cost is the final review, which this skill
58
+ dispatches separately. Tell your human partner so when they choose inline.
59
+
60
+ Prefer superpowers:subagent-driven-development when your human partner
61
+ wants a review gate on every task, or when the plan is long enough that
62
+ its later tasks would run on a compacted context. Inline execution over a
63
+ long plan still works — the ledger is what makes it recoverable — but the
64
+ last tasks get the least of you.
65
+
66
+ ## The Process
67
+
68
+ ```dot
69
+ digraph process {
70
+ rankdir=TB;
71
+
72
+ subgraph cluster_per_task {
73
+ label="Per Task";
74
+ "task-start: brief + BASE; read the brief" [shape=box];
75
+ "Work the steps in order: TDD, run every verification, read every output" [shape=box];
76
+ "Step output matches plan's Expected?" [shape=diamond];
77
+ "Plan wrong? Rule and ledger. Code wrong? systematic-debugging" [shape=box];
78
+ "Commit as the plan's commit steps say" [shape=box];
79
+ "Completion contract met?" [shape=diamond];
80
+ "task-done: run tests, ledger the result; mark todo complete" [shape=box];
81
+ }
82
+
83
+ "Setup: worktree, workspace + ledger, read plan + spec, pre-flight scan" [shape=box];
84
+ "More tasks remain?" [shape=diamond];
85
+ "Final whole-branch review (fresh reviewer if you have one)" [shape=box];
86
+ "Re-grade, then: Critical/Important → ONE fix pass, each fix RED→GREEN + green suite; Minor → ledger" [shape=box];
87
+ "Final review clean: delete this plan's workspace" [shape=box];
88
+ "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
89
+
90
+ "Setup: worktree, workspace + ledger, read plan + spec, pre-flight scan" -> "task-start: brief + BASE; read the brief";
91
+ "task-start: brief + BASE; read the brief" -> "Work the steps in order: TDD, run every verification, read every output";
92
+ "Work the steps in order: TDD, run every verification, read every output" -> "Step output matches plan's Expected?";
93
+ "Step output matches plan's Expected?" -> "Plan wrong? Rule and ledger. Code wrong? systematic-debugging" [label="no"];
94
+ "Plan wrong? Rule and ledger. Code wrong? systematic-debugging" -> "Work the steps in order: TDD, run every verification, read every output";
95
+ "Step output matches plan's Expected?" -> "Commit as the plan's commit steps say" [label="yes, last step"];
96
+ "Commit as the plan's commit steps say" -> "Completion contract met?";
97
+ "Completion contract met?" -> "Work the steps in order: TDD, run every verification, read every output" [label="no - finish the task"];
98
+ "Completion contract met?" -> "task-done: run tests, ledger the result; mark todo complete" [label="yes"];
99
+ "task-done: run tests, ledger the result; mark todo complete" -> "More tasks remain?";
100
+ "More tasks remain?" -> "task-start: brief + BASE; read the brief" [label="yes"];
101
+ "More tasks remain?" -> "Final whole-branch review (fresh reviewer if you have one)" [label="no"];
102
+ "Final whole-branch review (fresh reviewer if you have one)" -> "Re-grade, then: Critical/Important → ONE fix pass, each fix RED→GREEN + green suite; Minor → ledger";
103
+ "Re-grade, then: Critical/Important → ONE fix pass, each fix RED→GREEN + green suite; Minor → ledger" -> "Final review clean: delete this plan's workspace";
104
+ "Final review clean: delete this plan's workspace" -> "Use superpowers:finishing-a-development-branch";
105
+ }
106
+ ```
107
+
108
+ ## Setup
109
+
110
+ Ensure the work happens in an isolated workspace: use
111
+ superpowers:using-git-worktrees to create one or verify the existing one.
112
+ Never start implementation on a main/master branch without your human
113
+ partner's explicit consent.
114
+
115
+ Conversation memory does not survive compaction. An inline executor that
116
+ loses its place re-implements tasks whose commits already exist — the same
117
+ failure as a controller re-dispatching them, paid for in your own context.
118
+ Track progress in a ledger file, not only in todos. Harness todos are a
119
+ live view; the ledger is the record.
120
+
121
+ The workspace and ledger are shared with superpowers:subagent-driven-development
122
+ — same directory, same format — so a plan can change executors mid-flight
123
+ and the new one resumes from the same ledger.
124
+
125
+ - Each plan owns a workspace: at skill start, run
126
+ `../subagent-driven-development/scripts/sdd-workspace PLAN_FILE` — it
127
+ prints the plan's git-ignored directory
128
+ (`<repo-root>/.superpowers/sdd/<plan-basename>/`), home to every
129
+ artifact for THIS plan: ledger, briefs, review packages. Another plan's
130
+ directory is never yours to read or write.
131
+ - Check for this plan's ledger at `<workspace>/progress.md`. If its first
132
+ line names your plan file, tasks with a `Task <N>: complete` line are
133
+ DONE — do not redo them; resume at the first task without one. Their
134
+ commits exist in git even when your context no longer remembers making
135
+ them: after compaction, trust the ledger and `git log` over your own
136
+ recollection. A ledger whose first line names a different plan file is
137
+ another plan's progress: leave it and start your own, fresh.
138
+ - Create the ledger with its identity as the first line:
139
+ `# SDD ledger — plan: <plan file path>`.
140
+ - `git clean -fdx` will destroy the workspace (it's git-ignored scratch);
141
+ if that happens, recover from `git log`.
142
+
143
+ Read the plan once, note its context and Global Constraints, and create a
144
+ todo per task. If the plan names a Spec, read that too: the spec is the
145
+ authority the plan argues from, and conflicts inside the plan resolve
146
+ against it. A plan with no reachable spec gets a ledger note saying so —
147
+ rulings made without one are provisional.
148
+
149
+ **REQUIRED SUB-SKILL:** load superpowers:test-driven-development now,
150
+ before Task 1. It governs every step of every task below; a plan whose
151
+ steps already say "write the failing test first" does not exempt you
152
+ from reading it.
153
+
154
+ Before Task 1, scan the plan for conflicts between tasks. The plan's
155
+ Interfaces blocks tell you where to look: for every task that consumes
156
+ what an earlier task produces, one ledger row — the two tasks, what one
157
+ produces against what the other consumes, and what you found. Tasks that
158
+ share nothing get no row; a plan whose tasks share nothing gets the single
159
+ line `Pre-flight: no shared interfaces`. Rule on each conflict a row
160
+ surfaces with the spec as the binding authority, record the ruling beside
161
+ its row, and start Task 1. Each task's own text is checked when you read
162
+ its brief, not here.
163
+
164
+ ## The Task Loop
165
+
166
+ Everything you print, and every tool result, stays resident in your
167
+ context for the rest of the session. Redirect long test output to a file
168
+ in the workspace and read its tail; read a brief, not the whole plan.
169
+
170
+ ### 1. Take the task
171
+
172
+ - Run this skill's `scripts/task-start PLAN_FILE N`. It prints the brief
173
+ path and BASE (the commit the task's range is cut from) in one call.
174
+ Read the brief for every task, including ones you remember from setup:
175
+ what you remember is a summary, the brief has the exact values,
176
+ signatures, and test cases.
177
+ - Mark the task's todo in_progress.
178
+
179
+ Every tool call is a turn that re-reads your whole context. Bookkeeping
180
+ rides along with work — a ledger append in the same call as the commit,
181
+ never in a call of its own.
182
+
183
+ ### 2. Work the steps
184
+
185
+ The plan's steps are already in RED-GREEN order; follow them in that
186
+ order under superpowers:test-driven-development, loaded at setup. A test
187
+ step's code is written first and run first. Watching it fail is a step,
188
+ not a formality — a test that passes before the implementation exists is
189
+ a finding about the test.
190
+
191
+ Every step that runs a command has an `Expected:` line. Run the command,
192
+ read its output, and compare. Three outcomes:
193
+
194
+ - **Matches.** Next step.
195
+ - **The code is wrong.** Use superpowers:systematic-debugging. Find the
196
+ cause; never patch the symptom to make the step's output match.
197
+ - **The plan is wrong** — a step contradicts the spec, an interface from an
198
+ earlier task doesn't match what this task consumes, a command that
199
+ cannot work. Rule on the smallest change that satisfies the spec, ledger
200
+ it as `Task <N>: Ruling: <finding> — <what you decided and why>`, and
201
+ continue. The ruling is carried, not remembered: later tasks that touch
202
+ the same interface read it from the ledger.
203
+
204
+ Commit as the plan's commit steps say. A task that spans several commits
205
+ is fine; BASE is what the review range is cut from, never `HEAD~1`.
206
+
207
+ ### 3. The completion contract
208
+
209
+ Before a task's ledger line, all of the following are true, with evidence
210
+ in this session — not inferred from the diff looking right:
211
+
212
+ - Every test the brief names exists and ran in this task, and you read
213
+ the output.
214
+ - The final test run for the task passed — `task-done` is that run, and
215
+ it writes the command and result into the ledger line.
216
+ - Every `Expected:` line in the brief was compared against real output.
217
+ - Every deviation from the brief has a `Ruling:` line in the ledger.
218
+
219
+ **REQUIRED SUB-SKILL:** superpowers:verification-before-completion governs
220
+ the claim. If any item is missing, the task is not complete: finish it.
221
+
222
+ ### 4. Complete the task
223
+
224
+ Run this skill's `scripts/task-done PLAN_FILE N BASE -- <test command>`
225
+ with the test command the brief names for the whole task. It runs the
226
+ tests, keeps the full output in the workspace, prints the tail, and — only
227
+ if they pass — appends the completion line to the ledger:
228
+
229
+ `Task <N>: complete (commits <base7>..<head7>, tests: <command> → <result>)`
230
+
231
+ A failing run records nothing; the task is not complete. When it records,
232
+ mark the todo complete and take the next task.
233
+
234
+ ## Final Review
235
+
236
+ Run `../subagent-driven-development/scripts/review-package PLAN_FILE MERGE_BASE HEAD`
237
+ (MERGE_BASE = the commit the branch started from, e.g.
238
+ `git merge-base main HEAD`) and review from the file it prints.
239
+
240
+ **With a subagent tool:** dispatch the reviewer on the most capable
241
+ available model — the whole-branch review is a judgment task — using
242
+ superpowers:requesting-code-review's
243
+ [code-reviewer.md](../requesting-code-review/code-reviewer.md), with the
244
+ package path, the plan and spec paths, the plan's Review Focus section
245
+ verbatim if it has one (the input classes and failure modes the plan's
246
+ tests do not exercise — the reviewer checks each deliberately), and a
247
+ pointer to the ledger's `Ruling:` lines so it can weigh the calls you
248
+ made. Specify the model
249
+ explicitly; an omitted model inherits the session's, which may not be the
250
+ most capable. This is the one fresh context the whole run buys. Do not
251
+ skip it, and do not replace it with your own read of the diff.
252
+
253
+ **Without a subagent tool:** read code-reviewer.md and perform that review
254
+ yourself against the package, as a separate pass after the last task's
255
+ ledger line. Write `Final review: self-review (no subagent tool)` to the
256
+ ledger, and say so in your final message: a self-review by the author is
257
+ weaker than a fresh reviewer, and your human partner decides whether that
258
+ is enough before merge.
259
+
260
+ Sort the findings before you act on any of them. The reviewer's severity
261
+ labels are advice; the gate is yours. Its "Declined to judge" list is
262
+ yours too: every line there is a ruling you make and ledger, exactly like
263
+ a plan conflict — `Final: Ruling: <behavior the reviewer set aside> —
264
+ <what a reasonable person using this software gets, and why that stands
265
+ or why it is now a finding> — <cost if wrong>`. Re-grade first, by effect: the
266
+ spec is a vision document, and a finding's grade is what a reasonable
267
+ person using this software gets if it ships, not whether the spec names
268
+ the input that triggers it — a reviewer who set a finding at Minor
269
+ because the spec was silent has graded the spec, not the effect. Then:
270
+
271
+ - **Critical and Important** enter the fix pass.
272
+ - **Minor** goes to the ledger as `Final: minor (deferred): <one-liner>`
273
+ and to your final message under "Deferred minors". Minors never enter
274
+ the fix pass, and never become rulings — a ruling is a decision about a
275
+ conflict, not a note that you declined a polish suggestion.
276
+
277
+ Fix the Critical and Important findings yourself — you are the
278
+ implementer here — in ONE pass. Each fix is verified by TDD, not by a
279
+ second reviewer: write the test that reproduces the finding, watch it
280
+ fail, make it pass, then run the whole suite. Record each in the ledger as
281
+ `Final: fixed <finding> — <test name> RED→GREEN, suite <N>/<N>`. A fix
282
+ without a test that failed first is not verified; a suite that is not
283
+ green after the pass means the pass is not over. Do not dispatch a
284
+ re-review: it would re-read a diff whose covering tests already answer
285
+ "addressed" and whose suite run already answers "broke nothing".
286
+
287
+ A finding you decide not to fix is a ruling — `Final: Ruling: <finding> —
288
+ <why the code stands> — <cost if wrong>` — and reaches your human partner
289
+ in the rulings list. There is no second fix pass.
290
+
291
+ ## Finish
292
+
293
+ Before you delete anything, collect every ledger line containing
294
+ `Ruling:` into your final message under "Rulings I made", in the order you
295
+ made them, each with what it costs if wrong, and every `minor (deferred)`
296
+ line under "Deferred minors". Both lists are exhaustive. Your final
297
+ message is the only place the decisions you took on your human partner's
298
+ behalf — and the findings you chose not to act on — reach them.
299
+
300
+ When the final review is clean and its fixes are committed, delete this
301
+ plan's workspace directory — the git history is the record now. Sibling
302
+ directories belong to other plans; leave them alone.
303
+
304
+ Use superpowers:finishing-a-development-branch.
305
+
306
+ ## Common Rationalizations
307
+
308
+ | Excuse | Reality |
309
+ |--------|---------|
310
+ | "I remember what Task N says" | You remember a summary. The brief has the exact values. Read it. |
311
+ | "The plan's code is right, skip watching the test fail" | A test you never saw fail proves nothing. It is one step. Run it. |
312
+ | "I'll run the full suite at the end instead of per step" | Per-step runs are how you learn which step broke it. The end-of-task run is the contract, not a substitute. |
313
+ | "The plan is wrong here, I'll just do the right thing" | Do the right thing and ledger the ruling. Unledgered deviation is a decision made in secret. |
314
+ | "I'll write the ledger lines after a few tasks" | Compaction does not wait for a convenient moment. One line per task, in the same message as the commit. |
315
+ | "Let me check in before the next task" | They chose inline to spend less. Progress prompts spend their time instead. Only the four stops stop you. |
316
+ | "I read my own diff carefully; the final reviewer is redundant" | Same author, same blind spots. The reviewer is the only fresh context this run buys. |
317
+ | "Tests should pass, the change was trivial" | "Should" is not evidence. The contract requires the command and its output. |
318
+ | "Subagents are slow and expensive, I'll skip the final review too" | Inline already removed the per-task reviewers. One review of the whole branch is the floor, not the ceiling. |
319
+ | "The reviewer said Minor, so it's Minor" | The label graded the spec's silence. Grade what the person gets. Re-grade, then gate. |
320
+ | "The fix is obvious, no need for a failing test first" | The failing test is the only proof the finding was real and is now gone. Without it you have a diff and a hope. |
321
+ | "I'll fix the minors too while I'm in there" | Every minor you fix is a test, a fix, and a suite run your partner did not ask for. Ledger them; your partner decides. |
322
+
323
+ ## Example Workflow
324
+
325
+ ```
326
+ You: I'm using the executing-plans skill to implement this plan inline.
327
+
328
+ [Setup: worktree verified]
329
+ [Read plan once: docs/superpowers/plans/feature-plan.md; spec read]
330
+ [Resolve workspace: sdd-workspace docs/superpowers/plans/feature-plan.md — no ledger inside, fresh start]
331
+ [Pre-flight scan: 2 shared-interface rows, 4 self-consistency rows, clean; written to ledger]
332
+ [Create todos for all tasks]
333
+
334
+ Task 1: Hook installation script
335
+
336
+ [task-start plan 1 → brief read; BASE a1b2c3d]
337
+ [Step 1: write failing test — written]
338
+ [Step 2: run it — FAIL: install_hook not defined. Matches Expected.]
339
+ [Step 3: implement — written]
340
+ [Step 4: run it — PASS 1/1. Matches Expected.]
341
+ [Step 5: commit — d4e5f6a]
342
+ [Contract: tests ran, output read, no deviations]
343
+ [task-done plan 1 a1b2c3d -- npm test -- hooks → ledger: Task 1: complete (commits a1b2c3d..d4e5f6a, tests: npm test -- hooks → 1/1 pass)]
344
+
345
+ Task 2: Recovery modes
346
+
347
+ [task-start plan 2 → brief read; BASE d4e5f6a]
348
+ [Step 2: run failing test — FAIL, but on an import error: Task 1 exported
349
+ installHook, brief consumes install_hook]
350
+ [Ruling: brief's consumer name is a typo against Task 1's Produces block;
351
+ use installHook — Ledger: Task 2: Ruling: install_hook → installHook — matches Task 1 Produces — cost if wrong: one rename]
352
+ [Steps 2-5 as planned; commit b7c8d9e]
353
+ [task-done plan 2 d4e5f6a -- npm test -- recovery → ledger: Task 2: complete (commits d4e5f6a..b7c8d9e, tests: npm test -- recovery → 8/8 pass)]
354
+
355
+ ...
356
+
357
+ [After all tasks: review-package plan MERGE_BASE HEAD; dispatch code-reviewer, most capable model]
358
+ Reviewer: One Important finding — progress reporting interval hardcoded. Two Minor.
359
+ [Re-grade: Important stands; minors → ledger as deferred]
360
+ [Fix pass: test_progress_interval_configurable RED → extract PROGRESS_INTERVAL → GREEN; suite 12/12; commit]
361
+ [Ledger: Final: fixed hardcoded interval — test_progress_interval_configurable RED→GREEN, suite 12/12]
362
+
363
+ Rulings I made:
364
+ - Task 2: install_hook → installHook (brief typo; cost if wrong: one rename)
365
+
366
+ Deferred minors:
367
+ - README lacks a usage example
368
+ - recovery.js could split verify/repair into two files
369
+
370
+ [Delete this plan's workspace — the record now lives in git]
371
+
372
+ Using superpowers:finishing-a-development-branch.
373
+ ```
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env bash
2
+ # Close one task of an inline plan execution in a single call: run the task's
3
+ # test command, keep its full output in the workspace, print the tail, and —
4
+ # only if the command succeeded — append the completion line to the ledger.
5
+ # A failing command records nothing: the task is not complete.
6
+ #
7
+ # Usage: task-done PLAN_FILE TASK_NUMBER BASE -- TEST_COMMAND [ARGS...]
8
+ # BASE is the SHA task-start printed; the completion line records BASE..HEAD.
9
+ # Exit: the test command's exit status.
10
+ set -euo pipefail
11
+
12
+ if [ $# -lt 5 ] || [ "$4" != "--" ]; then
13
+ echo "usage: task-done PLAN_FILE TASK_NUMBER BASE -- TEST_COMMAND [ARGS...]" >&2
14
+ exit 2
15
+ fi
16
+
17
+ plan=$1
18
+ n=$2
19
+ base=$3
20
+ shift 4
21
+ sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)"
22
+
23
+ git rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; }
24
+
25
+ dir=$("$sdd/sdd-workspace" "$plan")
26
+ log="$dir/task-${n}-tests.log"
27
+ ledger="$dir/progress.md"
28
+
29
+ # Render the command the way a person would type it, for the ledger line.
30
+ cmd=""
31
+ for a in "$@"; do
32
+ case "$a" in
33
+ *[[:space:]\"\;\|\&]*) cmd="$cmd '$a'" ;;
34
+ *) cmd="$cmd $a" ;;
35
+ esac
36
+ done
37
+ cmd=${cmd# }
38
+
39
+ rc=0
40
+ "$@" > "$log" 2>&1 || rc=$?
41
+
42
+ tail -n 5 "$log"
43
+ if [ "$rc" -ne 0 ]; then
44
+ echo "task-done: test command exited $rc; Task $n NOT recorded (full output: $log)" >&2
45
+ exit "$rc"
46
+ fi
47
+
48
+ last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1)
49
+ [ -f "$ledger" ] || printf '# SDD ledger — plan: %s\n' "$plan" > "$ledger"
50
+ line="Task $n: complete (commits $(git rev-parse --short=7 "$base")..$(git rev-parse --short=7 HEAD), tests: $cmd → $last)"
51
+ printf '%s\n' "$line" >> "$ledger"
52
+ echo "ledger: $line"
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+ # Begin one task of an inline plan execution in a single call: extract the
3
+ # task's brief (via subagent-driven-development's task-brief, so both skills
4
+ # share one workspace) and record BASE, the commit the task's review range is
5
+ # cut from. One tool call instead of two, because every call in an inline
6
+ # session is a turn that re-reads the whole context.
7
+ #
8
+ # Usage: task-start PLAN_FILE TASK_NUMBER
9
+ # Prints:
10
+ # brief: <path to the task's brief file>
11
+ # base: <full SHA of HEAD>
12
+ set -euo pipefail
13
+
14
+ if [ $# -ne 2 ]; then
15
+ echo "usage: task-start PLAN_FILE TASK_NUMBER" >&2
16
+ exit 2
17
+ fi
18
+
19
+ plan=$1
20
+ n=$2
21
+ sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)"
22
+
23
+ out=$("$sdd/task-brief" "$plan" "$n")
24
+ brief=$(printf '%s\n' "$out" | sed -n 's/^wrote \(.*\): [0-9][0-9]* lines$/\1/p')
25
+ [ -n "$brief" ] || { echo "task-brief did not report a path: $out" >&2; exit 1; }
26
+
27
+ echo "brief: $brief"
28
+ echo "base: $(git rev-parse HEAD)"
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: finishing-a-development-branch
3
+ description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
4
+ ---
5
+
6
+ # Finishing a Development Branch
7
+
8
+ ## Overview
9
+
10
+ **Core principle:** Verify tests → Detect environment → Present options → Execute choice → Clean up.
11
+
12
+ **Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
13
+
14
+ ## Step 1: Verify Tests
15
+
16
+ Run the project's full test suite (`npm test` / `cargo test` / `pytest` / `go test ./...`).
17
+
18
+ **If tests fail**, report the failures and stop — the menu comes after a green suite:
19
+
20
+ ```
21
+ Tests failing (<N> failures). Must fix before completing:
22
+
23
+ [Show failures]
24
+ ```
25
+
26
+ **If tests pass:** continue to Step 2.
27
+
28
+ ## Step 2: Detect Environment
29
+
30
+ ```bash
31
+ GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
32
+ GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
33
+ # Capture now, while still inside the workspace — Step 5 changes directory
34
+ # before cleanup (Step 6) needs this value
35
+ WORKTREE_PATH=$(git rev-parse --show-toplevel)
36
+ ```
37
+
38
+ This determines which menu to show and how cleanup works:
39
+
40
+ | State | Menu | Cleanup |
41
+ |-------|------|---------|
42
+ | `GIT_DIR == GIT_COMMON` (normal repo) | Standard 3 options | No worktree to clean up |
43
+ | `GIT_DIR != GIT_COMMON`, named branch | Standard 3 options | Provenance-based (see Step 6) |
44
+ | `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 2 options (no merge) | Externally managed — leave in place |
45
+
46
+ ## Step 3: Determine Base Branch
47
+
48
+ The base branch is whatever this work forked from — usually named in the
49
+ plan, the conversation, or the branch's upstream. If it is not already
50
+ known, ask: "This branch split from <your best guess> - is that correct?"
51
+ Confirm before merging: merging into the wrong base is expensive to undo.
52
+
53
+ ## Step 4: Present Options
54
+
55
+ **Normal repo and named-branch worktree — present exactly these 3 options:**
56
+
57
+ ```
58
+ Implementation complete. What would you like to do?
59
+
60
+ 1. Merge back to <base-branch> locally
61
+ 2. Push and create a Pull Request
62
+ 3. Keep the branch as-is (I'll handle it later)
63
+
64
+ Which option?
65
+ ```
66
+
67
+ **Detached HEAD — present exactly these 2 options:**
68
+
69
+ ```
70
+ Implementation complete. You're on a detached HEAD (externally managed workspace).
71
+
72
+ 1. Push as new branch and create a Pull Request
73
+ 2. Keep as-is (I'll handle it later)
74
+
75
+ Which option?
76
+ ```
77
+
78
+ Present the menu exactly as written — concise, with every option coming
79
+ from the list above. Discarding the work happens only in response to your
80
+ human partner explicitly asking for it (see "If your human partner asks to
81
+ discard the work" below). Wait for their answer; the integration decision
82
+ is theirs.
83
+
84
+ ## Step 5: Execute Choice
85
+
86
+ ### Option 1: Merge Locally
87
+
88
+ ```bash
89
+ # Get main repo root for CWD safety
90
+ MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
91
+ cd "$MAIN_ROOT"
92
+
93
+ # Merge first — verify success before removing anything
94
+ git checkout <base-branch>
95
+ git pull
96
+ git merge <feature-branch>
97
+
98
+ # Verify tests on merged result
99
+ <test command>
100
+ ```
101
+
102
+ If tests fail on the merged result: stop, leave the worktree and branch in
103
+ place, and investigate — nothing has been pushed, so the merge is local
104
+ and recoverable.
105
+
106
+ Once the merged result is green: clean up the worktree (Step 6), then
107
+ delete the branch:
108
+
109
+ ```bash
110
+ git branch -d <feature-branch>
111
+ ```
112
+
113
+ ### Option 2: Push and Create PR
114
+
115
+ ```bash
116
+ git push -u origin <feature-branch>
117
+ # From a detached HEAD, name the new branch on the remote:
118
+ # git push origin HEAD:refs/heads/<new-branch>
119
+ ```
120
+
121
+ Then create the pull/merge request against <base-branch> with the forge's
122
+ tooling — its CLI if one is available, or the creation URL most forges
123
+ print when you push — following the repo's PR template and conventions if
124
+ present, and report the URL to your human partner.
125
+
126
+ Keep the worktree — your human partner iterates on PR feedback there.
127
+
128
+ ### Option 3: Keep As-Is
129
+
130
+ Report: "Keeping branch <name>. Worktree preserved at <path>."
131
+
132
+ ### If your human partner asks to discard the work
133
+
134
+ This path exists only as a response to an explicit request to throw the
135
+ work away. Confirm first:
136
+
137
+ ```
138
+ This will permanently delete:
139
+ - Branch <name>
140
+ - All commits: <commit-list>
141
+ - Worktree at <path>
142
+
143
+ Type 'discard' to confirm.
144
+ ```
145
+
146
+ Wait for that exact confirmation. When it arrives:
147
+
148
+ ```bash
149
+ MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
150
+ cd "$MAIN_ROOT"
151
+ ```
152
+
153
+ Then clean up the worktree (Step 6) and force-delete the branch:
154
+
155
+ ```bash
156
+ git branch -D <feature-branch>
157
+ ```
158
+
159
+ ## Step 6: Cleanup Workspace
160
+
161
+ **Runs for Option 1 and confirmed discards.** Options 2 and 3 always
162
+ preserve the worktree. Both callers have already changed directory to the
163
+ main repo root — worktree removal must run from outside the worktree —
164
+ and use the `GIT_DIR`/`GIT_COMMON`/`WORKTREE_PATH` values captured in
165
+ Step 2, from before that directory change.
166
+
167
+ **If `GIT_DIR == GIT_COMMON`:** Normal repo, no worktree to clean up. Done.
168
+
169
+ **If `WORKTREE_PATH` is under `.worktrees/` or `worktrees/`:** Superpowers
170
+ created this worktree — we own cleanup:
171
+
172
+ ```bash
173
+ git worktree remove "$WORKTREE_PATH"
174
+ git worktree prune # Self-healing: clean up any stale registrations
175
+ ```
176
+
177
+ **If removal is refused** (`contains modified or untracked files`): the
178
+ worktree holds files that exist nowhere else — uncommitted plans, notes,
179
+ or scratch work. Never `--force` on your own initiative. Show your human
180
+ partner what is at stake and ask:
181
+
182
+ ```bash
183
+ git -C "$WORKTREE_PATH" status --porcelain -uall
184
+ ```
185
+
186
+ ```
187
+ Worktree removal refused — these files were never committed:
188
+
189
+ <file list>
190
+
191
+ 1. Commit them to <branch> before cleanup
192
+ 2. Move them into <main repo root>
193
+ 3. Delete them (unrecoverable)
194
+
195
+ Which?
196
+ ```
197
+
198
+ Carry out the choice, then remove the worktree.
199
+
200
+ **Otherwise:** The host environment owns this workspace — leave it in
201
+ place. If your platform provides a workspace-exit tool, use it.
202
+
203
+ ## Quick Reference
204
+
205
+ | Option | Merge | Push | Keep Worktree | Cleanup Branch |
206
+ |--------|-------|------|---------------|----------------|
207
+ | 1. Merge locally | yes | - | - | yes |
208
+ | 2. Create PR | - | yes | yes | - |
209
+ | 3. Keep as-is | - | - | yes | - |
210
+ | Discard (explicit request only) | - | - | - | yes (force) |
211
+
212
+ ## Common Rationalizations
213
+
214
+ | Excuse | Reality |
215
+ |--------|---------|
216
+ | "Tests passed earlier this session" | Run the suite on the tree you are about to integrate. A green run only proves the tree it ran on. |
217
+ | "They obviously want it merged" | Integration is your human partner's decision. Present the menu and wait. |
218
+ | "They seem done with this feature — I'll offer to discard it" | The menu is complete as written. Discard happens only when your human partner asks for it in so many words. |
219
+ | "'Yeah, get rid of it' counts as confirmation" | Only the typed word `discard` authorizes deletion. |
220
+ | "The PR is up, so the worktree is clutter now" | PR feedback gets fixed in that worktree. It stays until the work lands. |
221
+ | "This other worktree looks stale — I'll clean it too" | Clean up only worktrees under `.worktrees/` or `worktrees/`. Everything else belongs to the host. |
222
+ | "Removal refused — `--force` is just finishing the cleanup" | The refusal means files exist only in that worktree. `--force` destroys them permanently. Show your human partner and ask. |
223
+ | "The merged-result failure is probably flaky" | A failing merged result stops everything. Branch and worktree stay put while you investigate. |
224
+ | "The base branch is obviously main" | Confirm the fork point or ask. Merging into the wrong base is expensive to undo. |
225
+ | "The push was rejected — force-push will fix it" | A rejected push means the remote moved. Investigate; force-push only on your human partner's explicit request. |