ramstack 0.1.0

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 (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/agents/comment-sicko.md +32 -0
  4. package/agents/poteto-agent.md +9 -0
  5. package/cli/rstack.mjs +539 -0
  6. package/package.json +29 -0
  7. package/skills/architect/README.md +25 -0
  8. package/skills/architect/SKILL.md +83 -0
  9. package/skills/architect/agents/openai.yaml +5 -0
  10. package/skills/architect/references/design-red-flags.md +33 -0
  11. package/skills/architect/references/rationale-template.md +35 -0
  12. package/skills/architect/references/runner-prompt.md +20 -0
  13. package/skills/arena/README.md +21 -0
  14. package/skills/arena/SKILL.md +71 -0
  15. package/skills/arena/agents/openai.yaml +5 -0
  16. package/skills/automate-me/README.md +21 -0
  17. package/skills/automate-me/SKILL.md +109 -0
  18. package/skills/automate-me/agents/openai.yaml +5 -0
  19. package/skills/blast-radius/README.md +21 -0
  20. package/skills/blast-radius/SKILL.md +50 -0
  21. package/skills/blast-radius/agents/openai.yaml +5 -0
  22. package/skills/bro/README.md +16 -0
  23. package/skills/bro/SKILL.md +7 -0
  24. package/skills/bro/agents/openai.yaml +5 -0
  25. package/skills/create-verification-skill/README.md +22 -0
  26. package/skills/create-verification-skill/SKILL.md +44 -0
  27. package/skills/create-verification-skill/agents/openai.yaml +5 -0
  28. package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  29. package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  30. package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  31. package/skills/figure-it-out/README.md +22 -0
  32. package/skills/figure-it-out/SKILL.md +55 -0
  33. package/skills/figure-it-out/agents/openai.yaml +5 -0
  34. package/skills/how/README.md +25 -0
  35. package/skills/how/SKILL.md +134 -0
  36. package/skills/how/agents/openai.yaml +3 -0
  37. package/skills/how/references/critic-prompt.md +59 -0
  38. package/skills/how/references/critique-rubric.md +58 -0
  39. package/skills/how/references/explainer-prompt.md +55 -0
  40. package/skills/how/references/explorer-prompt.md +52 -0
  41. package/skills/interrogate/README.md +21 -0
  42. package/skills/interrogate/SKILL.md +112 -0
  43. package/skills/interrogate/agents/openai.yaml +5 -0
  44. package/skills/interrogate/references/code-quality-review.md +47 -0
  45. package/skills/interrogate/references/lead-judgment.md +58 -0
  46. package/skills/interrogate/references/reviewer-prompt.md +72 -0
  47. package/skills/interrogate/references/rubric.md +77 -0
  48. package/skills/maintain-verification-skill/README.md +21 -0
  49. package/skills/maintain-verification-skill/SKILL.md +39 -0
  50. package/skills/maintain-verification-skill/agents/openai.yaml +5 -0
  51. package/skills/no-comments/README.md +22 -0
  52. package/skills/no-comments/SKILL.md +24 -0
  53. package/skills/no-comments/agents/openai.yaml +5 -0
  54. package/skills/poteto-mode/README.md +26 -0
  55. package/skills/poteto-mode/SKILL.md +140 -0
  56. package/skills/poteto-mode/agents/openai.yaml +5 -0
  57. package/skills/poteto-mode/playbooks/authoring-a-skill.md +13 -0
  58. package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  59. package/skills/poteto-mode/playbooks/autopilot-full.md +13 -0
  60. package/skills/poteto-mode/playbooks/autopilot-stack.md +16 -0
  61. package/skills/poteto-mode/playbooks/babysit.md +27 -0
  62. package/skills/poteto-mode/playbooks/bug-fix.md +17 -0
  63. package/skills/poteto-mode/playbooks/eval.md +27 -0
  64. package/skills/poteto-mode/playbooks/feature.md +21 -0
  65. package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  66. package/skills/poteto-mode/playbooks/investigation.md +14 -0
  67. package/skills/poteto-mode/playbooks/multi-phase-plan.md +3 -0
  68. package/skills/poteto-mode/playbooks/opening-a-pr.md +11 -0
  69. package/skills/poteto-mode/playbooks/orchestrate.md +113 -0
  70. package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
  71. package/skills/poteto-mode/playbooks/perf-issue.md +24 -0
  72. package/skills/poteto-mode/playbooks/prototype.md +14 -0
  73. package/skills/poteto-mode/playbooks/refactoring.md +16 -0
  74. package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  75. package/skills/poteto-mode/playbooks/session-pickup.md +13 -0
  76. package/skills/poteto-mode/playbooks/shipping.md +20 -0
  77. package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  78. package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  79. package/skills/poteto-mode/playbooks/worktree-cleanup.md +14 -0
  80. package/skills/poteto-mode/references/bugbot-triage.md +142 -0
  81. package/skills/poteto-mode/references/plan.md +105 -0
  82. package/skills/poteto-mode/scripts/bootstrap.ts +62 -0
  83. package/skills/poteto-mode/scripts/bun.lock +67 -0
  84. package/skills/poteto-mode/scripts/orch/orch.test.ts +634 -0
  85. package/skills/poteto-mode/scripts/orch/orch.ts +578 -0
  86. package/skills/poteto-mode/scripts/orch/store.ts +1607 -0
  87. package/skills/poteto-mode/scripts/package.json +16 -0
  88. package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  89. package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  90. package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +118 -0
  91. package/skills/poteto-mode/scripts/watch-pr/github.test.ts +306 -0
  92. package/skills/poteto-mode/scripts/watch-pr/github.ts +699 -0
  93. package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
  94. package/skills/poteto-mode/scripts/watch-pr/policy.ts +832 -0
  95. package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  96. package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  97. package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  98. package/skills/poteto-mode/scripts/watch-pr/types.ts +401 -0
  99. package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  100. package/skills/poteto-mode/scripts/worktree-audit.sh +86 -0
  101. package/skills/principle-boundary-discipline/README.md +17 -0
  102. package/skills/principle-boundary-discipline/SKILL.md +34 -0
  103. package/skills/principle-boundary-discipline/agents/openai.yaml +5 -0
  104. package/skills/principle-build-the-lever/README.md +17 -0
  105. package/skills/principle-build-the-lever/SKILL.md +23 -0
  106. package/skills/principle-build-the-lever/agents/openai.yaml +5 -0
  107. package/skills/principle-encode-lessons-in-structure/README.md +17 -0
  108. package/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
  109. package/skills/principle-encode-lessons-in-structure/agents/openai.yaml +5 -0
  110. package/skills/principle-exhaust-the-design-space/README.md +17 -0
  111. package/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
  112. package/skills/principle-exhaust-the-design-space/agents/openai.yaml +5 -0
  113. package/skills/principle-experience-first/README.md +17 -0
  114. package/skills/principle-experience-first/SKILL.md +19 -0
  115. package/skills/principle-experience-first/agents/openai.yaml +5 -0
  116. package/skills/principle-fix-root-causes/README.md +17 -0
  117. package/skills/principle-fix-root-causes/SKILL.md +23 -0
  118. package/skills/principle-fix-root-causes/agents/openai.yaml +5 -0
  119. package/skills/principle-foundational-thinking/README.md +17 -0
  120. package/skills/principle-foundational-thinking/SKILL.md +21 -0
  121. package/skills/principle-foundational-thinking/agents/openai.yaml +5 -0
  122. package/skills/principle-guard-the-context-window/README.md +17 -0
  123. package/skills/principle-guard-the-context-window/SKILL.md +17 -0
  124. package/skills/principle-guard-the-context-window/agents/openai.yaml +5 -0
  125. package/skills/principle-laziness-protocol/README.md +17 -0
  126. package/skills/principle-laziness-protocol/SKILL.md +18 -0
  127. package/skills/principle-laziness-protocol/agents/openai.yaml +5 -0
  128. package/skills/principle-make-operations-idempotent/README.md +17 -0
  129. package/skills/principle-make-operations-idempotent/SKILL.md +24 -0
  130. package/skills/principle-make-operations-idempotent/agents/openai.yaml +5 -0
  131. package/skills/principle-migrate-callers-then-delete-legacy-apis/README.md +17 -0
  132. package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
  133. package/skills/principle-migrate-callers-then-delete-legacy-apis/agents/openai.yaml +5 -0
  134. package/skills/principle-minimize-reader-load/README.md +17 -0
  135. package/skills/principle-minimize-reader-load/SKILL.md +23 -0
  136. package/skills/principle-minimize-reader-load/agents/openai.yaml +5 -0
  137. package/skills/principle-model-the-domain/README.md +17 -0
  138. package/skills/principle-model-the-domain/SKILL.md +26 -0
  139. package/skills/principle-model-the-domain/agents/openai.yaml +5 -0
  140. package/skills/principle-never-block-on-the-human/README.md +16 -0
  141. package/skills/principle-never-block-on-the-human/SKILL.md +23 -0
  142. package/skills/principle-never-block-on-the-human/agents/openai.yaml +5 -0
  143. package/skills/principle-outcome-oriented-execution/README.md +16 -0
  144. package/skills/principle-outcome-oriented-execution/SKILL.md +22 -0
  145. package/skills/principle-outcome-oriented-execution/agents/openai.yaml +5 -0
  146. package/skills/principle-prove-it-works/README.md +18 -0
  147. package/skills/principle-prove-it-works/SKILL.md +33 -0
  148. package/skills/principle-prove-it-works/agents/openai.yaml +5 -0
  149. package/skills/principle-redesign-from-first-principles/README.md +16 -0
  150. package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
  151. package/skills/principle-redesign-from-first-principles/agents/openai.yaml +5 -0
  152. package/skills/principle-separate-before-serializing-shared-state/README.md +16 -0
  153. package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
  154. package/skills/principle-separate-before-serializing-shared-state/agents/openai.yaml +5 -0
  155. package/skills/principle-sequence-verifiable-units/README.md +18 -0
  156. package/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
  157. package/skills/principle-sequence-verifiable-units/agents/openai.yaml +5 -0
  158. package/skills/principle-subtract-before-you-add/README.md +17 -0
  159. package/skills/principle-subtract-before-you-add/SKILL.md +22 -0
  160. package/skills/principle-subtract-before-you-add/agents/openai.yaml +5 -0
  161. package/skills/principle-type-system-discipline/README.md +19 -0
  162. package/skills/principle-type-system-discipline/SKILL.md +31 -0
  163. package/skills/principle-type-system-discipline/agents/openai.yaml +5 -0
  164. package/skills/recall/README.md +23 -0
  165. package/skills/recall/SKILL.md +35 -0
  166. package/skills/recall/agents/openai.yaml +5 -0
  167. package/skills/reflect/README.md +24 -0
  168. package/skills/reflect/SKILL.md +77 -0
  169. package/skills/reflect/agents/openai.yaml +5 -0
  170. package/skills/reflect/references/divergent-reviewer.md +43 -0
  171. package/skills/reflect/references/judgment-reviewer.md +42 -0
  172. package/skills/reflect/references/synthesizer.md +56 -0
  173. package/skills/reflect/references/tooling-reviewer.md +57 -0
  174. package/skills/setup-rstack/README.md +25 -0
  175. package/skills/setup-rstack/SKILL.md +81 -0
  176. package/skills/setup-rstack/agents/openai.yaml +3 -0
  177. package/skills/show-me-your-work/README.md +23 -0
  178. package/skills/show-me-your-work/SKILL.md +82 -0
  179. package/skills/show-me-your-work/agents/openai.yaml +5 -0
  180. package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  181. package/skills/show-me-your-work/scripts/log.sh +40 -0
  182. package/skills/swarm/README.md +21 -0
  183. package/skills/swarm/SKILL.md +46 -0
  184. package/skills/swarm/agents/openai.yaml +5 -0
  185. package/skills/tdd/README.md +21 -0
  186. package/skills/tdd/SKILL.md +44 -0
  187. package/skills/tdd/agents/openai.yaml +5 -0
  188. package/skills/teach/README.md +22 -0
  189. package/skills/teach/SKILL.md +21 -0
  190. package/skills/teach/agents/openai.yaml +5 -0
  191. package/skills/technical-writing/README.md +23 -0
  192. package/skills/technical-writing/SKILL.md +130 -0
  193. package/skills/technical-writing/agents/openai.yaml +5 -0
  194. package/skills/typescript-best-practices/README.md +22 -0
  195. package/skills/typescript-best-practices/SKILL.md +28 -0
  196. package/skills/typescript-best-practices/agents/openai.yaml +3 -0
  197. package/skills/typescript-best-practices/references/patterns.md +292 -0
  198. package/skills/unslop/README.md +21 -0
  199. package/skills/unslop/SKILL.md +80 -0
  200. package/skills/unslop/agents/openai.yaml +3 -0
  201. package/skills/why/README.md +26 -0
  202. package/skills/why/SKILL.md +229 -0
  203. package/skills/why/agents/openai.yaml +3 -0
  204. package/skills/why/references/epistemics.md +144 -0
  205. package/skills/why/references/investigator-prompt.md +103 -0
  206. package/skills/why/references/source-playbook.md +17 -0
  207. package/skills/why/references/sources/code-archaeology.md +88 -0
  208. package/skills/why/references/sources/databricks.md +70 -0
  209. package/skills/why/references/sources/datadog.md +99 -0
  210. package/skills/why/references/sources/incident-postmortem.md +15 -0
  211. package/skills/why/references/sources/linear.md +48 -0
  212. package/skills/why/references/sources/notion.md +55 -0
  213. package/skills/why/references/sources/sentry.md +100 -0
  214. package/skills/why/references/sources/slack.md +54 -0
  215. package/skills/why/references/synthesizer-prompt.md +135 -0
@@ -0,0 +1,14 @@
1
+ ### Prototype
2
+
3
+ **You own the design decision, not the code. The prototype is a throwaway instrument; the real build follows Feature.** For "prototype", "mock it up", "sketch this", "try this layout", or exploring a UI, interaction, or layout before committing. Also for settling an empirical fork (which behavior, which timing, which approach) by observing it run, when you would otherwise ask the human a question a quick sketch could answer for you.
4
+
5
+ The one playbook where the Laziness Protocol's "smallest change" and the verification bar invert. Speed over polish, code quality does not matter, no planning. The rigor is in picking the right design cheaply. Be bold: propose variations the user didn't ask for, throw an approach away and try another.
6
+
7
+ 1. Scope the decision the prototype exists to make: which layout, which interaction, which density, or for an empirical fork which behavior, timing, or approach. No decision means no prototype; route to Feature.
8
+ 2. Gather references when the design space is open. Search for prior art, summarize a moodboard of themes, palettes, and layouts, let the user pick directions before building. Skip when the direction is set.
9
+ 3. Build throwaway in an isolated scratch dir, separate from production source. For a visual decision, vanilla HTML/CSS/JS or the lightest stack that renders the idea, CDN deps, a dev server with hot reload. For a behavioral or timing decision, the smallest script that exercises the question. No production framework, no tests, no abstractions.
10
+ 4. When comparing alternatives, build them behind one switcher (buttons or a keypress), each variant labeled so the user can name it. This is the **exhaust-the-design-space** principle skill made cheap.
11
+ 5. Verify on the matching surface. For a visual decision, screenshot each variant via the control skill and drive the interaction; the eye is the test. For a behavioral or timing decision, observe the thing you are deciding by logging the timing, printing the output, or watching the render. The observation is the test here, not an assertion.
12
+ 6. Present alternatives, tradeoffs, and a recommendation. The output is the decision plus the throwaway artifact, not shippable code. Hand the chosen direction to **Feature** (or `architect` for the shape) for the real build.
13
+
14
+ **Reply:** the variants explored, the evidence (screenshots for a visual decision, the observed output or timing for a behavioral one), tradeoffs, your recommendation, and the scratch path. Say plainly that the prototype is throwaway.
@@ -0,0 +1,16 @@
1
+ ### Refactoring
2
+
3
+ **You own the contract. The structure changes; the behavior does not.** For "refactor", "rename", "extract", "inline", "dedupe", "restructure", "move this module", "tidy up this area". Distinct from Feature, which adds behavior, and Bug fix, which corrects it.
4
+
5
+ A refactor that smuggles in a behavior change loses its safety net. If the cleanup reveals a missing feature or a real bug, split it out and ship the structural change first against the pinned contract. A redesign is allowed, but name it and route to Feature. Large or cross-cutting structural work (a migration across many call sites, a coordinated reshape of many subsystems) belongs to the **figure-it-out** skill; this playbook is the focused-to-medium change.
6
+
7
+ 1. Pin the behavior contract first. Run the **how** skill over the affected subsystem to learn the contract, then write a characterization test, snapshot, or equivalence harness that captures current behavior before any structure moves. The harness makes "refactor" a checkable claim (**principle-prove-it-works**). If the area has no coverage, write the pin before touching structure. Type check and lint are not a pin.
8
+ 2. Name the structure the code is missing per **principle-model-the-domain**: a state machine over scattered booleans, a table or registry over spread-out branching, a typed model over repeated shape assumptions, a reducer over ad hoc mutations. Boring code stays when the shape is already clear and local; the reshape must delete branches or invalid states, not add indirection.
9
+ 3. Name the target shape. State what the module layout, types, and call graph should be if built today (**principle-foundational-thinking**, **principle-redesign-from-first-principles**). If the target crosses a function boundary, run the **architect** skill for parallel design exploration of the shape before the move.
10
+ 4. Subtract before you add. Delete dead weight, collapse one-caller wrappers, drop redundant validators, and remove orphan references before introducing the new shape (**principle-subtract-before-you-add**). The smallest change that reaches the target shape ships (**principle-laziness-protocol**). A speculative cleanup that "might help" gets reverted, not left to ride.
11
+ 5. Move in small behavior-preserving steps, each keeping the pin green. For API reshapes, migrate every caller and delete the old API in the same wave (**principle-migrate-callers-then-delete-legacy-apis**). No compatibility shims, no parallel old-and-new paths. Spot-check every rename against the actual files; renames silently miss usages in strings, prose, and back-references. Delegate the mechanical edits to a subagent using your configured refactoring model (default `sonnet`) with a specific scope (file paths, the names being moved, the behavior to hold); review the diff yourself.
12
+ 6. Prove behavior is unchanged on the real artifact, not "it compiles" (**principle-prove-it-works**). For larger reshapes, run an equivalence check: a script that diffs old-vs-new outputs, a recorded baseline replayed against the new code, or a smoke run on the matching surface via the relevant control skill. Own the verification yourself; do not trust a delegate's "looks good" summary.
13
+ 7. Confirm the change earns its place. The success measure is reduced reader load (**principle-minimize-reader-load**): fewer layers between question and answer, less hidden state, fewer indirections without a second consumer. If the diff does not lower reader load somewhere, revert it.
14
+ 8. Rebase into small ordered commits that tell the story. A subtraction commit, then the reshape, then any follow-on cleanup, so a single revert undoes one slice. Shape them with the **sequence-verifiable-units** principle skill, so each behavior-preserving slice stays green before the next. Run **Opening a PR**.
15
+
16
+ **Reply:** the structure that changed, the pin you held it against, the equivalence proof, the reader-load delta, what shipped and what got reverted. No new behavior.
@@ -0,0 +1,11 @@
1
+ ### Runtime forensics
2
+
3
+ **You own the diagnosis. Instrument the live process, don't theorize from source.** For "why is X leaking / spinning / slow at runtime", heap snapshots, idle-but-busy processes, intermittent glitches. The deliverable is a cited diagnosis, not a fix.
4
+
5
+ 1. Capture the live signal on the matching surface via the control skill: a CPU profile for a spinning process, a heap snapshot for a leak, a CDP trace for a visual glitch. A real artifact, not a guess.
6
+ 2. Reduce the artifact to the smoking gun: the function on the hot path, the retainer chain from the leaked object to a GC root, the loop firing without input. Parse large artifacts in a subagent (the **guard-the-context-window** principle skill), keep the reduced finding in the main thread.
7
+ 3. Prove the mechanism before believing it. Inject instrumentation via CDP eval on the running process, or hotfix the live code without reloading, to confirm the hypothesis cheaply. A plausible-but-unconfirmed cause can be wrong while the real one sits one layer over.
8
+ 4. Map the finding back to source: file, symbol, the line that allocates or schedules.
9
+ 5. Throughput checkpoint stays one line: `throughput checkpoint: n/a, read-only forensics`.
10
+
11
+ **Reply:** the signal captured, the reduced finding, how you proved the mechanism, the source location, artifact paths. No fix unless asked; hand back to Bug fix or Perf once the cause is known.
@@ -0,0 +1,13 @@
1
+ ### Session pickup
2
+
3
+ **You own the resume point. Read the prior trail, don't redo it.** For "take over this", "resume this conversation", "continue from <transcript path>", "you're taking over", "pick up where X left off", a cloud-agent URL handoff, or a pushed branch you're meant to continue.
4
+
5
+ A pickup is inheritance. The prior agent already paid the cost of reading the code, running the repros, making the design choices. Redoing loses the bias check and burns context. Resist the urge to re-derive; read.
6
+
7
+ 1. Locate the prior trail. A local transcript in the workspace's transcript directory (Claude Code: `~/.claude/projects/<slug>/`; Codex: `~/.codex/sessions/`; do not glob across other projects' directories, that crosses workspace boundaries and reads private chats from unrelated projects), a cloud-agent URL, or a pushed branch. Read the metadata overview and last messages first, then scan back for the decision points. Parse a long transcript in a subagent and keep the reduced timeline in the main thread (the **principle-guard-the-context-window** skill).
8
+ 2. Reconstruct operational state. The branch and worktree, what already landed (`git log`, `git diff` against the base), the open todos, the decisions made. The prior trail is authoritative input. Resist the bias to re-derive it.
9
+ 3. Diff done vs pending. Compare what shipped against what was planned, name the resume point, do not re-run the prior repro or redo completed work. A "let me verify from scratch" pass is the tell that you're treating the trail as untrustworthy when it's actually authoritative.
10
+ 4. Route the remaining work to the matching playbook and pick the verdict: continue the execution, ship a finished recommendation, ratify or override a prior conclusion, or postmortem a failed run. The pickup playbook ends here; the routed playbook owns the rest.
11
+ 5. Verify the inherited claims against the original goal on the real artifact (the **principle-prove-it-works** skill). A passing prior self-report is not the proof.
12
+
13
+ **Reply:** where the prior agent stopped, what you inherited vs redid (ideally nothing redone), the resume point, and the outcome.
@@ -0,0 +1,20 @@
1
+ ### Shipping
2
+
3
+ **You own what lands. Verify each PR independently, land only the verified run from the root, then keep your hands off the queue.** For "land the stack", "ship it", "enable merge when ready", or the second half of a stack that **Babysit** already drove to green.
4
+
5
+ This is the half after `playbooks/babysit.md`. Babysit makes a stack mergeable. Shipping decides what is actually safe to merge and lets Graphite drain it. Green is not safe, and the gap between those two words is where this playbook lives.
6
+
7
+ 1. **Verify every PR independently before arming anything.** One subagent per PR, not batched, each a cloud or background subagent, each exercising the real surface (browser automation for UIs, the real binary for CLIs, or the project's `verify-*` skill) against parent versus head. Each returns `PASS`, `PASS+NOTES` or `FAIL` and posts that verdict on its own PR so the record outlives the chat. Safe means a verdict from an agent that did not write the code. CI green is not a verdict, and an approving bot review is not a verdict.
8
+ 2. **Land only the contiguous verified run rooted at the bottom.** Walk up from the lowest unmerged PR and stop at the first one without a passing verdict, where both `PASS` and `PASS+NOTES` pass. A verified PR sitting above an unverified one is not landable, because merging it would pull the gap in underneath it. Report the ceiling as a PR number and say what breaks the chain.
9
+ 3. **Re-check that the verdicts still describe the code.** A restack rewrites every SHA above it and silently invalidates every verdict without touching a single check. Compare `git patch-id` at the verdict SHA against the current head before trusting an older verdict, and re-verify anything that actually drifted. Twenty-one verdicts went stale this way in one run with no signal at all.
10
+ 4. **Arm merge-when-ready through Graphite, and pass `--always`.** A no-op submit skips the Graphite update and silently arms nothing, which reads exactly like success.
11
+ ```bash
12
+ gt submit --merge-when-ready --always --update-only --no-interactive
13
+ ```
14
+ 5. **Never enable GitHub auto-merge on a stack.** Only the root targets protected trunk. Every child targets its unprotected parent branch and already reads `CLEAN`, so GitHub would merge children into parents immediately and collapse the stack into itself. Graphite is what makes the merges sequential. If a previous agent armed it, disarm with `gh pr merge <n> --disable-auto` and confirm the field is back off.
15
+ 6. **Do not read `autoMergeRequest` as proof that MWR is armed.** It stays off until Graphite reaches that PR at the queue front, so an unarmed reading is meaningless and acting on it leads to re-submitting branches that were already fine. Confirm arming from Graphite's own state, and if you cannot, say so rather than inferring it.
16
+ 7. **Once the queue is draining, stop touching the stack.** No `gt sync`, no restack, no speculative pushes, and no `gt submit --stack`, which reaches downstack into PRs that are mid-merge. Even a plain `gt submit` can retarget a base if local Graphite tracking has diverged, so never run `gt` from a worktree whose parentage you have not just checked. Independent work gets re-parented onto trunk and shipped on its own.
17
+ 8. **Watch the drain, do not drive it.** Arm the watcher in queued mode over the verified run and hold it under `/loop` in dynamic mode, re-armed after any verdict you act on, until COMPLETE at the ceiling. ADVANCE is progress, not termination. Bases retarget and `graphite-base/*` refs get cut as each PR merges; that is Graphite working, not damage. Report each merge and the new ceiling. If the queue stalls, diagnose before mutating, because a stalled queue and a broken stack look identical from the outside.
18
+ 9. **Stop at the ceiling.** When the verified run is merged, report what landed, what the next unverified PR is, and what verifying it would take. Extending the run is a new pass through step 1, not a judgment call you make at 3am.
19
+
20
+ **Reply:** the verified run and its ceiling, each PR's verdict and who produced it, what you armed and how you confirmed it, what landed, and what the next gap needs.
@@ -0,0 +1,14 @@
1
+ ### Trace forensics
2
+
3
+ **You own the diagnosis from the artifact. Load it, shape it, narrow to the cause, attribute to source.** For a dropped `.cpuprofile`, `Trace-*.json.gz`, `Spindump.txt`, or `.heapsnapshot` paired with "why is this slow / unresponsive / leaking / crashing".
4
+
5
+ Distinct from **Runtime forensics**, which instruments the live process. Here the capture already exists; the artifact is a fixed dataset, read it, don't re-run it. Keep tooling generic so the playbook stays portable: a DevTools or trace parser for cpuprofile and `.json.gz`, a text editor for a spindump, your heap tooling for a heapsnapshot.
6
+
7
+ 1. Identify the format and load it with the right tool. Parse large artifacts in a subagent (the **principle-guard-the-context-window** skill) and keep the reduced finding in the main thread.
8
+ 2. Transform the raw artifact into a form you can query. Dump the trace or heap snapshot into sqlite, one row per sample, frame, or node. Reach the queryable shape before you read.
9
+ 3. Narrow to the cause. Query for the frames that hold the most time and walk the call tree to the hot path. For a leak, follow the retainer chain from the leaked object to a GC root. For a spindump, find the thread stuck on-CPU or blocked and its wait reason.
10
+ 4. Attribute to source. Map the hot frame to file, symbol, and line via the artifact's own symbols. A frame with no source mapping is not yet a diagnosis; resolve the symbols, or say plainly the artifact does not carry them.
11
+ 5. Confirm against a paired capture when you have one. Diff a before and after artifact so the attribution is the real regression, not background noise. Without one, mark the finding as the strongest hypothesis the artifact supports, not a confirmed cause.
12
+ 6. Hand back a cited diagnosis, no fix unless asked. Route to Bug fix or Perf issue once the cause is known. Throughput checkpoint stays one line: `throughput checkpoint: n/a, read-only forensics`.
13
+
14
+ **Reply:** the artifact and format, the reduced finding, the source location, the artifact paths, and whether a paired capture confirmed it.
@@ -0,0 +1,11 @@
1
+ ### Visual parity
2
+
3
+ **You own pixel-exact equivalence. The baseline is the spec; you do not touch it.** For "make X match Y exactly", styling-system migrations, porting a UI across frameworks. Equivalence is verified by image diff, not by eye.
4
+
5
+ 1. Establish the baseline first, before any migration: a visual regression harness that screenshots the current component across its states, plus the target when matching two implementations. No baseline, no parity claim. A blocking prerequisite, not a follow-up.
6
+ 2. Anti-shortcut clauses, stated and held: no harness modifications, no baseline tampering, no component restructuring to make a diff pass. If the baseline looks wrong, stop and ask, don't edit it.
7
+ 3. Migrate one component at a time. Each is an independent artifact, so parallelize across worktrees, one owner per component (the **separate-before-serializing-shared-state** principle skill). Shared primitives migrate first as a blocking phase.
8
+ 4. Verify each component against its baseline via image diff on the matching surface via the control skill. A nonzero diff is a fail; investigate the pixel delta, don't wave it through. `/loop` per component until the diff is zero.
9
+ 5. Run **Opening a PR** per component or per safe batch.
10
+
11
+ **Reply:** components migrated, the diff result for each, the baseline harness location, what's left.
@@ -0,0 +1,14 @@
1
+ ### Worktree and simulator cleanup
2
+
3
+ **You own the disk and the safety gate.** Prune merged or abandoned git worktrees and stale iOS simulators to reclaim space. Deletion is irreversible, so every step guards against deleting something in use or holding uncommitted work.
4
+
5
+ 1. Snapshot and audit. Record `df -h /`, then run `scripts/worktree-audit.sh` (principle-build-the-lever). It reads paths from `git worktree list`, never hand-typed, since a hand-typed `myrepo-worktrees/x` misses one that lives at a tool-managed path like `.cursor/worktrees/myrepo/x` or a worktree the host created itself (principle-encode-lessons-in-structure). It classifies each worktree by size, age, merge state, uncommitted work, PR state, and the newest chat that touched it, then suggests a bucket. The transcript scan is slow, so background it.
6
+ 2. The bucket is advice, not permission. The pinned and active chats are the real artifact (principle-prove-it-works). Get that set from the user or sidebar and cross-check every candidate. The lever has marked `safe` a worktree the user had pinned, so the pinned set wins.
7
+ 3. Verify usage before deleting. For every `verify-recent-chat` row, or anything you doubt, fan subagents out to read the transcripts and report whether the chat is pinned or ongoing and which worktrees it touches (principle-guard-the-context-window, transcripts are bulk). A pinned chat spawns arena and repro trees into sibling worktrees via background subagents, and those are in use even when their names never hit the sidebar.
8
+ 4. Pause on irreversible loss. `wip:N` is N tracked uncommitted edits. Show the diff and get a decision first, since removing a clean worktree is recoverable from its branch but uncommitted work is gone. `scratch:N` is untracked throwaway, safe to drop, but name the files. Per Autonomy, clean and merged and not-in-use proceeds; `wip` and in-use pause.
9
+ 5. Prune the confirmed set. Per path, `git worktree remove --force <path>`; if the dir survives on ignored build artifacts, `rm -rf` it, then `git worktree prune`. Branch refs survive, so no commits are lost. Confirm with `df -h /` and re-list.
10
+ 6. Simulators and other reclaimers. Simulators are usually the next-biggest win. `xcrun simctl --set testing delete all` (XCTestDevices clones), `xcrun simctl delete unavailable`, and `xcrun simctl runtime list` then `runtime delete <id>` for old runtimes. More when needed: Xcode `DerivedData` and `iOS DeviceSupport`; the host editor's data directory, e.g. `~/Library/Application Support/Cursor` (`state.vscdb.backup`, and `snapshots/roots/<root>` where a `<root>` named for a folder you opened as a workspace balloons); package caches (pnpm, uv, brew, yarn). Clear only caches the user has not said to keep.
11
+
12
+ This is the one playbook that deletes user state with no code review to catch a slip, so the gates above are the review.
13
+
14
+ **Reply:** `df -h /` before and after with space reclaimed, the worktrees pruned, and a one-line reason for each held back (in-use by which chat, or uncommitted work).
@@ -0,0 +1,142 @@
1
+ # Bugbot triage
2
+
3
+ Use this reference when the Babysit playbook (`../playbooks/babysit.md`) handles Bugbot or review-automation comments. The goal is not to ignore Bugbot by default. The goal is to stop treating every comment as a required code change.
4
+
5
+ ## Decision rubric
6
+
7
+ Classify each Bugbot thread before acting:
8
+
9
+ - `fix`: The comment identifies a plausible correctness, security, privacy, data loss, auth, billing, migration, idempotency, race, or shipped-behavior issue. Fix it in the lowest owning PR, then reply with the commit SHA and resolve the thread.
10
+ - `dismiss`: The comment matches a documented low-risk noisy pattern, and the current code/context proves the concern does not need a code change. Reply with a short reason and resolve the thread.
11
+ - `ask`: The comment is novel, high-severity, security/privacy/data-related, or ambiguous. Ask the user instead of guessing.
12
+
13
+ When in doubt, ask. Skipping a noisy code-quality comment is cheap; skipping a real data or security bug is not.
14
+
15
+ ## Learned pattern format
16
+
17
+ Add future patterns in this shape:
18
+
19
+ ```markdown
20
+ ### <short pattern name>
21
+
22
+ - Confidence: candidate | recurring | strong
23
+ - Skip when: <conditions that must be true>
24
+ - Do not skip when: <risk boundaries>
25
+ - Example signal: <phrases or code context that identify the pattern>
26
+ - Source: <PR/comment URL or short historical note>
27
+ ```
28
+
29
+ Use `candidate` for one or two examples. Use `recurring` after multiple real dismissals. Use `strong` only when the pattern is narrow, repeatedly verified, and low-risk.
30
+
31
+ ## Recurring skip candidates
32
+
33
+ ### Intentional UI or design-system visual changes
34
+
35
+ - Confidence: candidate
36
+ - Skip when: The PR description, screenshots, design review, or nearby code makes the visual change explicit, and the Bugbot comment is only restating that a shared visual default changed.
37
+ - Do not skip when: The comment points to accessibility, focus visibility, keyboard navigation, color contrast, or a component API contract that the PR did not intentionally change.
38
+ - Example signal: Comments about focus outlines, button sizes, spacing, or shared component visual defaults where the owner replies "intentional" or "intended".
39
+
40
+ ### Upstack or stack-local usage Bugbot cannot see
41
+
42
+ - Confidence: candidate
43
+ - Skip when: Bugbot flags an export, component, helper, or file as unused, and `gt ls -s`, upper-stack diffs, or PR context shows it is used by a later PR in the stack.
44
+ - Do not skip when: The current PR is not part of a stack, the symbol is public API, or the supposed upstack use cannot be verified.
45
+ - Example signal: "Exported component is never used" with a human reply like "used upstack".
46
+
47
+ ### Temporary duplication during parallel implementation
48
+
49
+ - Confidence: candidate
50
+ - Skip when: The PR intentionally duplicates a small amount of code to keep a new path parallel to an old path that is being deleted, replaced, or proven out.
51
+ - Do not skip when: The duplicated code changes security, billing, data access, API behavior, or a long-lived shared abstraction would clearly reduce risk.
52
+ - Example signal: "Significant duplication" or "duplicated validation logic" where the owner explains the old path will be deleted or the duplicate logic is intentionally local.
53
+
54
+ ### Existing framework or component invariant covers the warning
55
+
56
+ - Confidence: candidate
57
+ - Skip when: The concern is already guaranteed by a shared component, framework contract, type invariant, or single source of truth visible in the current diff or nearby code.
58
+ - Do not skip when: The invariant is assumed but not enforced, depends on timing, or crosses async/state boundaries where values can diverge.
59
+ - Example signal: Comments about missing max-height on an inner popover when the shared popover enforces viewport bounds, or nullable values where the local checked value and passed value share the same source.
60
+
61
+ ### Owner-declared follow-up or deferred cleanup
62
+
63
+ - Confidence: candidate
64
+ - Skip when: The PR owner explicitly says the issue is a known follow-up, the behavior is not made worse by the current PR, and the comment is not about a high-risk area.
65
+ - Do not skip when: The agent is acting without owner input, the issue is medium/high severity product behavior, or deferring would merge a new regression.
66
+ - Example signal: "I'll worry about that later" or "we'll delete this eventually".
67
+
68
+ ### Self-withdrawn or explicit false-positive rule comments
69
+
70
+ - Confidence: recurring
71
+ - Skip when: The comment body or a later Bugbot reply explicitly says the finding is withdrawn, compliant, or a false positive, and the agent can verify the relevant rule locally.
72
+ - Do not skip when: The only evidence is a human saying "false positive" on a high-risk issue without explanation.
73
+ - Example signal: A file-naming rule comment whose body says the file is already compliant.
74
+
75
+ ## Ask by default
76
+
77
+ Do not auto-skip these categories, even if a previous PR dismissed something similar:
78
+
79
+ - Security, privacy, auth, billing, data retention, training-data, and permission-boundary findings.
80
+ - High-severity findings.
81
+ - Migration, schema, idempotency, concurrency, and cross-system behavior findings.
82
+ - Comments where the suggested fix is small and clearly reduces risk without changing product intent.
83
+
84
+ Historical data showed humans sometimes dismiss security/data-flow comments. Treat those as owner judgment calls, not team-wide skip rules.
85
+
86
+ ## Candidate learnings from recent babysits
87
+
88
+ Append new candidate learnings here during or after babysitting when they look team-useful but not yet mature. Prefer promoting recurring candidates into the section above once several PRs confirm the pattern.
89
+
90
+ ### Manual reimplementations of native browser behavior
91
+
92
+ - Confidence: candidate
93
+ - Skip when: Practically never. When a diff replaces native browser behavior with a manual equivalent (native sticky → JS-positioned clones, native scroll targeting → forwarded wheel/touch events, paint-order occlusion → masks/clip-path), Bugbot's logic-bug findings against that code have been consistently legitimate.
94
+ - Do not skip when: The finding concerns event-forwarding gaps (wheel deltaMode, touch pans, scroll-chaining at edges, tap slop), mask/clip hit-testing divergence, or observer-vs-React state timing races in such code. Default to fix.
95
+ - Example signal: "masks do not affect hit-testing", "overlay blocks wheel scroll", "ignores deltaMode", "runs in the IntersectionObserver callback before React applies state".
96
+ - Source: one sticky-occlusion PR: six Bugbot passes, roughly eighteen findings, every one fixed rather than dismissed.
97
+
98
+ ### Contract-test drift claims are cheaply verifiable — run the test first
99
+
100
+ - Confidence: candidate
101
+ - Skip when: Never skip the verification itself; it costs one command. When a PR
102
+ ships a contract test that pins protocol or documentation prose (regexes over
103
+ a SKILL.md, snapshot of doc wording), and Bugbot claims "the test no longer
104
+ matches the doc" (or vice versa), run that test on the PR tip before
105
+ classifying. A red run confirms the claim empirically; a green run is a
106
+ concrete disproof for the dismissal reply.
107
+ - Do not skip when: n/a — this is a verification shortcut, not a dismissal
108
+ pattern. Note that repeat-pass lean-dismiss heuristics would misfire here:
109
+ prose-pinning tests drift precisely BECAUSE earlier fix rounds edit the prose.
110
+ - Example signal: "Contract test omits the pre-fix wait" on a PR whose earlier
111
+ fix commits reworded the pinned passage; the test run on the tip failed on
112
+ exactly the cited assertion.
113
+ - Source: one prose-pinning PR with eight Bugbot passes; the claim was real on
114
+ pass 7 despite every earlier pass being fixed-and-resolved.
115
+
116
+ ### Stale security-review finding already fixed later in the same PR
117
+
118
+ - Confidence: candidate
119
+ - Skip when: An agentic security review (or similar) claims a missing authz/validation call, and the current PR tip clearly includes that exact gate (with tests), typically added in a later hardening commit after the review ran.
120
+ - Do not skip when: The cited helper is a no-op for the principal under discussion, the check runs after the side effect it guards, or coverage for the claimed principal is missing.
121
+ - Example signal: A HIGH "missing authorization check" finding while the exact guard is already called before the side effect on the tip.
122
+ - Source: one webhook-endpoint PR whose hardening commit postdated the review run.
123
+
124
+ ### Widening a deliberately narrow error condition would mask the real error
125
+
126
+ - Confidence: candidate
127
+ - Skip when: The finding asks to broaden a narrow error condition (a specific
128
+ `errno`, error code, or status class) into a catch-all, and that narrowness
129
+ encodes a real distinction. The canonical shape is a dependency fallback
130
+ gated on `ENOENT`: "binary is not installed" is a different situation from
131
+ "the command ran and failed". Retrying on any non-zero exit would re-run a
132
+ legitimate failure (not found, expired auth, network) against the fallback
133
+ and then report the fallback's error, hiding the true one.
134
+ - Do not skip when: The narrow condition misses a case in the SAME category
135
+ (another "binary unusable" errno such as `EACCES`, another transport-level
136
+ failure), the unhandled path loses data or leaves partial state, or the retry
137
+ is idempotent AND the original error is still surfaced.
138
+ - Example signal: "only retries when X fails with ENOENT … never tries the
139
+ fallback even when a working Y exists", pointing at code whose fallback
140
+ exists for a missing dependency rather than a failed operation.
141
+ - Source: one CLI-rename PR whose fallback existed for a missing binary rather
142
+ than a failed command.
@@ -0,0 +1,105 @@
1
+ # Plan
2
+
3
+ Produce a phased implementation plan grounded in the **Principles** section of the `poteto-mode` skill. The plan is the deliverable. Do not implement.
4
+
5
+ Open a todolist with one item per step below.
6
+
7
+ ## 0. Triage
8
+
9
+ Skip the plan when the change is one or two files with an obvious approach. Say so and stop.
10
+
11
+ Plan when the change spans three or more files, introduces architecture, has competing approaches or unclear scope, or the user asked for one.
12
+
13
+ ## 1. Re-read principles
14
+
15
+ Read the **Principles** section of the `poteto-mode` skill end to end, and the leaf `principle-*` skills it indexes. The principles govern every plan decision; cross-link them.
16
+
17
+ ## 2. Scope and constraints
18
+
19
+ State your read of scope and constraints in one paragraph. Use `AskUserQuestion` only for genuinely ambiguous intent (the **never-block-on-the-human** principle skill); give concrete options with each open question.
20
+
21
+ Resolve what is in scope vs explicitly out, technical or platform constraints, patterns to preserve, and the definition of done.
22
+
23
+ ## 3. Explore in subagents
24
+
25
+ Delegate codebase exploration (the **guard-the-context-window** principle skill).
26
+
27
+ - Prefer `subagent_type: "poteto-agent"`. `general-purpose` is the fallback. Never use the built-in `plan` subagent_type; it ignores this skill.
28
+ - Pass `model:` explicitly per the configured roles (defaults `sonnet` for code, `fable` for judgment).
29
+
30
+ Each explorer returns file pointers, conventions, dependencies, test infrastructure, and entry points. No inlined dumps.
31
+
32
+ ## 4. Write the plan
33
+
34
+ The user specifies where the plan lives.
35
+
36
+ Single file `NN-slug.md` for small plans. For three or more phases, a directory with `overview.md` plus phase files:
37
+
38
+ ```
39
+ NN-slug/
40
+ ├── overview.md
41
+ ├── phase-1-scaffold.md
42
+ ├── phase-2-...md
43
+ └── testing.md
44
+ ```
45
+
46
+ ### Phase sizing
47
+
48
+ - One function or type plus tests, or one bug fix. Not "one file".
49
+ - Two to three files touched, max.
50
+ - Prefer eight to ten small phases over three to four large ones to preserve option value (the **foundational-thinking** principle skill).
51
+ - Split if a phase has more than five test cases or three functions.
52
+
53
+ ### Overview file
54
+
55
+ - **Context.** Problem and why now.
56
+ - **Scope.** Included; explicitly excluded.
57
+ - **Constraints.** Technical, platform, dependency, pattern.
58
+ - **Alternatives.** Two or three approaches sketched, choice and rationale (the **exhaust-the-design-space** principle skill). Skip when constraints dictate one.
59
+ - **Applicable skills.** Domain skills the implementer should invoke, by name.
60
+ - **Phases.** Ordered standard-markdown links to phase files.
61
+ - **Verification.** Project-level commands.
62
+ - **Implementation guidance.** Per section 6.
63
+
64
+ ### Phase files
65
+
66
+ - Back-link to overview.
67
+ - **Goal.** What the phase accomplishes.
68
+ - **Changes.** Files affected and the change at a high level. What and why, not how. No code snippets.
69
+ - **Data structures.** Name the key types or schemas. One-line sketch only (the **foundational-thinking** principle skill).
70
+ - **Verification.** Per section 6.
71
+
72
+ Order phases so infrastructure and shared types land first (the **foundational-thinking** principle skill). Each phase should be independently shippable.
73
+
74
+ For changes touching existing code, apply the **redesign-from-first-principles** principle skill: if we'd built this with the new requirement on day one, what would it look like? Redesign holistically; deliver incrementally.
75
+
76
+ If a phase creates or edits a skill, the phase instructs the implementer to use the host's skill-authoring skill when one is installed, and otherwise to author the SKILL.md directly (frontmatter `name` and `description`, imperative body).
77
+
78
+ ## 5. Verification per phase
79
+
80
+ Each phase needs both:
81
+
82
+ **Static.** Type check, lint, project tests pass.
83
+
84
+ **Runtime.** Exercise the feature on the matching surface:
85
+
86
+ - Browser / Electron / Web UIs: the project's `verify-*` skill when one exists, otherwise browser automation.
87
+ - CLIs and TUIs: the project's `verify-*` skill, otherwise run the real binary in a scripted harness.
88
+ - Native mobile: whatever simulator-driving skill your team has.
89
+ - No way to drive the touched surface: flag it in the plan (and consider `/create-verification-skill`).
90
+
91
+ For bug fixes, the loop is reproduce on the surface, fix, verify on the same surface. Unit tests show a branch behaves a certain way; they do not prove the bug is gone (the **prove-it-works** principle skill).
92
+
93
+ ## 6. Implementation guidance
94
+
95
+ In the overview, name which poteto-mode non-negotiables the implementer must apply, by name:
96
+
97
+ - the **how** skill over each unfamiliar subsystem before changing it.
98
+ - the **interrogate** skill for adversarial review on contested designs before shipping.
99
+ - a deslop pass over each diff before commit (no narration comments, dead code, or workaround sermons). the **unslop** skill over any prose surface.
100
+ - the **show-me-your-work** skill to keep a decision trail when the plan is large enough to need an auditable record.
101
+ - the **Babysit** playbook after opening the PR.
102
+
103
+ ## 7. Hand back
104
+
105
+ Summarize phases, scope boundaries, applicable skills, and verification. Stop. The user decides when implementation starts.
@@ -0,0 +1,62 @@
1
+ import { createHash } from "node:crypto";
2
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+
5
+ const scriptsDirectory = import.meta.dir;
6
+ const nodeModulesDirectory = join(scriptsDirectory, "node_modules");
7
+ const commanderPackagePath = join(
8
+ nodeModulesDirectory,
9
+ "commander",
10
+ "package.json"
11
+ );
12
+ const installKeyPath = join(
13
+ nodeModulesDirectory,
14
+ ".poteto-mode-tools-install-key"
15
+ );
16
+
17
+ function currentInstallKey(): string {
18
+ return createHash("sha256")
19
+ .update(readFileSync(join(scriptsDirectory, "package.json")))
20
+ .update("\0")
21
+ .update(readFileSync(join(scriptsDirectory, "bun.lock")))
22
+ .digest("hex");
23
+ }
24
+
25
+ export function ensureDependenciesInstalled(): void {
26
+ const installKey = currentInstallKey();
27
+ if (
28
+ existsSync(commanderPackagePath) &&
29
+ existsSync(installKeyPath) &&
30
+ readFileSync(installKeyPath, "utf8").trim() === installKey
31
+ ) {
32
+ return;
33
+ }
34
+
35
+ const result = Bun.spawnSync(
36
+ [process.execPath, "install", "--frozen-lockfile"],
37
+ { cwd: scriptsDirectory }
38
+ );
39
+ if (result.exitCode !== 0) {
40
+ process.stdout.write(result.stdout);
41
+ process.stderr.write(result.stderr);
42
+ throw new Error(
43
+ `bun install --frozen-lockfile exited with status ${result.exitCode}`
44
+ );
45
+ }
46
+ if (!existsSync(commanderPackagePath)) {
47
+ throw new Error(
48
+ "bun install --frozen-lockfile completed without installing commander"
49
+ );
50
+ }
51
+
52
+ writeFileSync(installKeyPath, `${installKey}\n`);
53
+
54
+ const restarted = Bun.spawnSync([process.execPath, ...process.argv.slice(1)], {
55
+ cwd: process.cwd(),
56
+ env: process.env,
57
+ stdin: "inherit",
58
+ stdout: "inherit",
59
+ stderr: "inherit",
60
+ });
61
+ process.exit(restarted.exitCode ?? 1);
62
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "configVersion": 1,
4
+ "workspaces": {
5
+ "": {
6
+ "name": "@cursor-skill/poteto-mode-tools",
7
+ "dependencies": {
8
+ "commander": "14.0.0",
9
+ },
10
+ "devDependencies": {
11
+ "bun-types": "latest",
12
+ "typescript": "latest",
13
+ },
14
+ },
15
+ },
16
+ "packages": {
17
+ "@types/node": ["@types/node@26.1.2", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg=="],
18
+
19
+ "@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="],
20
+
21
+ "@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="],
22
+
23
+ "@typescript/typescript-darwin-x64": ["@typescript/typescript-darwin-x64@7.0.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA=="],
24
+
25
+ "@typescript/typescript-freebsd-arm64": ["@typescript/typescript-freebsd-arm64@7.0.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ=="],
26
+
27
+ "@typescript/typescript-freebsd-x64": ["@typescript/typescript-freebsd-x64@7.0.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw=="],
28
+
29
+ "@typescript/typescript-linux-arm": ["@typescript/typescript-linux-arm@7.0.2", "", { "os": "linux", "cpu": "arm" }, "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ=="],
30
+
31
+ "@typescript/typescript-linux-arm64": ["@typescript/typescript-linux-arm64@7.0.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ=="],
32
+
33
+ "@typescript/typescript-linux-loong64": ["@typescript/typescript-linux-loong64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ=="],
34
+
35
+ "@typescript/typescript-linux-mips64el": ["@typescript/typescript-linux-mips64el@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA=="],
36
+
37
+ "@typescript/typescript-linux-ppc64": ["@typescript/typescript-linux-ppc64@7.0.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA=="],
38
+
39
+ "@typescript/typescript-linux-riscv64": ["@typescript/typescript-linux-riscv64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ=="],
40
+
41
+ "@typescript/typescript-linux-s390x": ["@typescript/typescript-linux-s390x@7.0.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw=="],
42
+
43
+ "@typescript/typescript-linux-x64": ["@typescript/typescript-linux-x64@7.0.2", "", { "os": "linux", "cpu": "x64" }, "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A=="],
44
+
45
+ "@typescript/typescript-netbsd-arm64": ["@typescript/typescript-netbsd-arm64@7.0.2", "", { "os": "none", "cpu": "arm64" }, "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA=="],
46
+
47
+ "@typescript/typescript-netbsd-x64": ["@typescript/typescript-netbsd-x64@7.0.2", "", { "os": "none", "cpu": "x64" }, "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA=="],
48
+
49
+ "@typescript/typescript-openbsd-arm64": ["@typescript/typescript-openbsd-arm64@7.0.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ=="],
50
+
51
+ "@typescript/typescript-openbsd-x64": ["@typescript/typescript-openbsd-x64@7.0.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg=="],
52
+
53
+ "@typescript/typescript-sunos-x64": ["@typescript/typescript-sunos-x64@7.0.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g=="],
54
+
55
+ "@typescript/typescript-win32-arm64": ["@typescript/typescript-win32-arm64@7.0.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ=="],
56
+
57
+ "@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="],
58
+
59
+ "bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
60
+
61
+ "commander": ["commander@14.0.0", "", {}, "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA=="],
62
+
63
+ "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="],
64
+
65
+ "undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
66
+ }
67
+ }