dsh-pstack 0.0.0-stage → 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 (311) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +158 -2
  3. package/assets/agents/comment-sicko.md +32 -0
  4. package/assets/agents/poteto-agent.md +8 -0
  5. package/assets/docs/guide/01-setup.md +64 -0
  6. package/assets/docs/guide/02-poteto-mode.md +139 -0
  7. package/assets/docs/guide/03-understand.md +79 -0
  8. package/assets/docs/guide/04-design.md +133 -0
  9. package/assets/docs/guide/05-build-and-clean.md +83 -0
  10. package/assets/docs/guide/06-verify-and-ship.md +152 -0
  11. package/assets/docs/guide/07-overnight.md +122 -0
  12. package/assets/docs/guide/08-principles.md +72 -0
  13. package/assets/docs/guide/09-make-it-yours.md +100 -0
  14. package/assets/docs/guide/10-recipes-and-pitfalls.md +180 -0
  15. package/assets/docs/guide/README.md +38 -0
  16. package/assets/docs/harness/dsh.md +65 -0
  17. package/assets/docs/pstack-models.example.md +23 -0
  18. package/assets/skills/architect/SKILL.md +81 -0
  19. package/assets/skills/architect/references/design-red-flags.md +57 -0
  20. package/assets/skills/architect/references/rationale-template.md +35 -0
  21. package/assets/skills/architect/references/runner-prompt.md +20 -0
  22. package/assets/skills/arena/SKILL.md +50 -0
  23. package/assets/skills/automate-me/SKILL.md +105 -0
  24. package/assets/skills/benchmark-checklist/SKILL.md +41 -0
  25. package/assets/skills/blast-radius/SKILL.md +52 -0
  26. package/assets/skills/bro/SKILL.md +9 -0
  27. package/assets/skills/correct/SKILL.md +34 -0
  28. package/assets/skills/create-formal-verification-skill/SKILL.md +43 -0
  29. package/assets/skills/create-verification-skill/SKILL.md +46 -0
  30. package/assets/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  31. package/assets/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  32. package/assets/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  33. package/assets/skills/figure-it-out/SKILL.md +54 -0
  34. package/assets/skills/how/SKILL.md +38 -0
  35. package/assets/skills/how/references/explainer-prompt.md +55 -0
  36. package/assets/skills/how/references/explorer-prompt.md +35 -0
  37. package/assets/skills/in-your-own-words/SKILL.md +9 -0
  38. package/assets/skills/interrogate/SKILL.md +69 -0
  39. package/assets/skills/interrogate/references/code-quality-review.md +47 -0
  40. package/assets/skills/interrogate/references/lead-judgment.md +39 -0
  41. package/assets/skills/interrogate/references/reviewer-prompt.md +62 -0
  42. package/assets/skills/interrogate/references/rubric.md +77 -0
  43. package/assets/skills/ketchup/SKILL.md +45 -0
  44. package/assets/skills/maintain-formal-verification-skill/SKILL.md +60 -0
  45. package/assets/skills/maintain-verification-skill/SKILL.md +41 -0
  46. package/assets/skills/no-comments/SKILL.md +26 -0
  47. package/assets/skills/poteto-help/SKILL.md +161 -0
  48. package/assets/skills/poteto-help/references/prompting.md +51 -0
  49. package/assets/skills/poteto-help/references/recipes.md +51 -0
  50. package/assets/skills/poteto-mode/SKILL.md +153 -0
  51. package/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
  52. package/assets/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  53. package/assets/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
  54. package/assets/skills/poteto-mode/playbooks/autopilot-stack.md +12 -0
  55. package/assets/skills/poteto-mode/playbooks/babysit.md +23 -0
  56. package/assets/skills/poteto-mode/playbooks/bug-fix.md +15 -0
  57. package/assets/skills/poteto-mode/playbooks/eval.md +25 -0
  58. package/assets/skills/poteto-mode/playbooks/feature.md +21 -0
  59. package/assets/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  60. package/assets/skills/poteto-mode/playbooks/investigation.md +14 -0
  61. package/assets/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
  62. package/assets/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
  63. package/assets/skills/poteto-mode/playbooks/orchestrate.md +112 -0
  64. package/assets/skills/poteto-mode/playbooks/pause-safely.md +10 -0
  65. package/assets/skills/poteto-mode/playbooks/perf-issue.md +25 -0
  66. package/assets/skills/poteto-mode/playbooks/prototype.md +14 -0
  67. package/assets/skills/poteto-mode/playbooks/refactoring.md +16 -0
  68. package/assets/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  69. package/assets/skills/poteto-mode/playbooks/session-pickup.md +11 -0
  70. package/assets/skills/poteto-mode/playbooks/shipping.md +12 -0
  71. package/assets/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  72. package/assets/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  73. package/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
  74. package/assets/skills/poteto-mode/references/bugbot-triage.md +142 -0
  75. package/assets/skills/poteto-mode/scripts/bootstrap.ts +62 -0
  76. package/assets/skills/poteto-mode/scripts/bun.lock +67 -0
  77. package/assets/skills/poteto-mode/scripts/check-plan.mjs +205 -0
  78. package/assets/skills/poteto-mode/scripts/check-plan.test.ts +96 -0
  79. package/assets/skills/poteto-mode/scripts/orch/orch.test.ts +761 -0
  80. package/assets/skills/poteto-mode/scripts/orch/orch.ts +590 -0
  81. package/assets/skills/poteto-mode/scripts/orch/store.ts +1677 -0
  82. package/assets/skills/poteto-mode/scripts/package.json +16 -0
  83. package/assets/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  84. package/assets/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  85. package/assets/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +129 -0
  86. package/assets/skills/poteto-mode/scripts/watch-pr/github.test.ts +436 -0
  87. package/assets/skills/poteto-mode/scripts/watch-pr/github.ts +718 -0
  88. package/assets/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
  89. package/assets/skills/poteto-mode/scripts/watch-pr/policy.ts +836 -0
  90. package/assets/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  91. package/assets/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  92. package/assets/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  93. package/assets/skills/poteto-mode/scripts/watch-pr/types.ts +413 -0
  94. package/assets/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  95. package/assets/skills/poteto-mode/scripts/worktree-audit.sh +127 -0
  96. package/assets/skills/principle-attack-the-premise/SKILL.md +23 -0
  97. package/assets/skills/principle-boundary-discipline/SKILL.md +36 -0
  98. package/assets/skills/principle-build-the-lever/SKILL.md +26 -0
  99. package/assets/skills/principle-encode-lessons-in-structure/SKILL.md +13 -0
  100. package/assets/skills/principle-exhaust-the-design-space/SKILL.md +11 -0
  101. package/assets/skills/principle-experience-first/SKILL.md +21 -0
  102. package/assets/skills/principle-explain-the-number/SKILL.md +19 -0
  103. package/assets/skills/principle-fix-root-causes/SKILL.md +23 -0
  104. package/assets/skills/principle-foundational-thinking/SKILL.md +23 -0
  105. package/assets/skills/principle-guard-the-context-window/SKILL.md +14 -0
  106. package/assets/skills/principle-laziness-protocol/SKILL.md +12 -0
  107. package/assets/skills/principle-make-operations-idempotent/SKILL.md +24 -0
  108. package/assets/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +16 -0
  109. package/assets/skills/principle-minimize-reader-load/SKILL.md +20 -0
  110. package/assets/skills/principle-model-the-domain/SKILL.md +26 -0
  111. package/assets/skills/principle-never-block-on-the-human/SKILL.md +17 -0
  112. package/assets/skills/principle-outcome-oriented-execution/SKILL.md +23 -0
  113. package/assets/skills/principle-prove-it-works/SKILL.md +24 -0
  114. package/assets/skills/principle-redesign-from-first-principles/SKILL.md +18 -0
  115. package/assets/skills/principle-separate-before-serializing-shared-state/SKILL.md +18 -0
  116. package/assets/skills/principle-sequence-verifiable-units/SKILL.md +19 -0
  117. package/assets/skills/principle-subtract-before-you-add/SKILL.md +20 -0
  118. package/assets/skills/principle-test-behavior-not-implementation/SKILL.md +22 -0
  119. package/assets/skills/principle-type-system-discipline/SKILL.md +15 -0
  120. package/assets/skills/recall/SKILL.md +37 -0
  121. package/assets/skills/reflect/SKILL.md +70 -0
  122. package/assets/skills/reflect/references/divergent-reviewer.md +38 -0
  123. package/assets/skills/reflect/references/judgment-reviewer.md +37 -0
  124. package/assets/skills/reflect/references/synthesizer.md +56 -0
  125. package/assets/skills/reflect/references/tooling-reviewer.md +48 -0
  126. package/assets/skills/setup-pstack/SKILL.md +76 -0
  127. package/assets/skills/sharpen/SKILL.md +18 -0
  128. package/assets/skills/show-me-your-work/SKILL.md +84 -0
  129. package/assets/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  130. package/assets/skills/show-me-your-work/scripts/log.sh +42 -0
  131. package/assets/skills/swarm/SKILL.md +41 -0
  132. package/assets/skills/tdd/SKILL.md +44 -0
  133. package/assets/skills/teach/SKILL.md +23 -0
  134. package/assets/skills/technical-writing/SKILL.md +108 -0
  135. package/assets/skills/typescript-best-practices/SKILL.md +32 -0
  136. package/assets/skills/typescript-best-practices/references/patterns.md +328 -0
  137. package/assets/skills/unslop/SKILL.md +64 -0
  138. package/assets/skills/why/SKILL.md +100 -0
  139. package/assets/skills/why/references/epistemics.md +71 -0
  140. package/assets/skills/why/references/investigator-prompt.md +84 -0
  141. package/assets/skills/why/references/source-playbook.md +17 -0
  142. package/assets/skills/why/references/sources/code-archaeology.md +51 -0
  143. package/assets/skills/why/references/sources/databricks.md +70 -0
  144. package/assets/skills/why/references/sources/datadog.md +97 -0
  145. package/assets/skills/why/references/sources/incident-postmortem.md +5 -0
  146. package/assets/skills/why/references/sources/linear.md +48 -0
  147. package/assets/skills/why/references/sources/notion.md +55 -0
  148. package/assets/skills/why/references/sources/sentry.md +66 -0
  149. package/assets/skills/why/references/sources/slack.md +17 -0
  150. package/assets/skills/why/references/synthesizer-prompt.md +129 -0
  151. package/cordis.patch.yml +20 -0
  152. package/dist/LICENSE +22 -0
  153. package/dist/README.md +159 -0
  154. package/dist/assets/agents/comment-sicko.md +32 -0
  155. package/dist/assets/agents/poteto-agent.md +8 -0
  156. package/dist/assets/docs/guide/01-setup.md +64 -0
  157. package/dist/assets/docs/guide/02-poteto-mode.md +139 -0
  158. package/dist/assets/docs/guide/03-understand.md +79 -0
  159. package/dist/assets/docs/guide/04-design.md +133 -0
  160. package/dist/assets/docs/guide/05-build-and-clean.md +83 -0
  161. package/dist/assets/docs/guide/06-verify-and-ship.md +152 -0
  162. package/dist/assets/docs/guide/07-overnight.md +122 -0
  163. package/dist/assets/docs/guide/08-principles.md +72 -0
  164. package/dist/assets/docs/guide/09-make-it-yours.md +100 -0
  165. package/dist/assets/docs/guide/10-recipes-and-pitfalls.md +180 -0
  166. package/dist/assets/docs/guide/README.md +38 -0
  167. package/dist/assets/docs/harness/dsh.md +65 -0
  168. package/dist/assets/docs/pstack-models.example.md +23 -0
  169. package/dist/assets/skills/architect/SKILL.md +81 -0
  170. package/dist/assets/skills/architect/references/design-red-flags.md +57 -0
  171. package/dist/assets/skills/architect/references/rationale-template.md +35 -0
  172. package/dist/assets/skills/architect/references/runner-prompt.md +20 -0
  173. package/dist/assets/skills/arena/SKILL.md +50 -0
  174. package/dist/assets/skills/automate-me/SKILL.md +105 -0
  175. package/dist/assets/skills/benchmark-checklist/SKILL.md +41 -0
  176. package/dist/assets/skills/blast-radius/SKILL.md +52 -0
  177. package/dist/assets/skills/bro/SKILL.md +9 -0
  178. package/dist/assets/skills/correct/SKILL.md +34 -0
  179. package/dist/assets/skills/create-formal-verification-skill/SKILL.md +43 -0
  180. package/dist/assets/skills/create-verification-skill/SKILL.md +46 -0
  181. package/dist/assets/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  182. package/dist/assets/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  183. package/dist/assets/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  184. package/dist/assets/skills/figure-it-out/SKILL.md +54 -0
  185. package/dist/assets/skills/how/SKILL.md +38 -0
  186. package/dist/assets/skills/how/references/explainer-prompt.md +55 -0
  187. package/dist/assets/skills/how/references/explorer-prompt.md +35 -0
  188. package/dist/assets/skills/in-your-own-words/SKILL.md +9 -0
  189. package/dist/assets/skills/interrogate/SKILL.md +69 -0
  190. package/dist/assets/skills/interrogate/references/code-quality-review.md +47 -0
  191. package/dist/assets/skills/interrogate/references/lead-judgment.md +39 -0
  192. package/dist/assets/skills/interrogate/references/reviewer-prompt.md +62 -0
  193. package/dist/assets/skills/interrogate/references/rubric.md +77 -0
  194. package/dist/assets/skills/ketchup/SKILL.md +45 -0
  195. package/dist/assets/skills/maintain-formal-verification-skill/SKILL.md +60 -0
  196. package/dist/assets/skills/maintain-verification-skill/SKILL.md +41 -0
  197. package/dist/assets/skills/no-comments/SKILL.md +26 -0
  198. package/dist/assets/skills/poteto-help/SKILL.md +161 -0
  199. package/dist/assets/skills/poteto-help/references/prompting.md +51 -0
  200. package/dist/assets/skills/poteto-help/references/recipes.md +51 -0
  201. package/dist/assets/skills/poteto-mode/SKILL.md +153 -0
  202. package/dist/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
  203. package/dist/assets/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  204. package/dist/assets/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
  205. package/dist/assets/skills/poteto-mode/playbooks/autopilot-stack.md +12 -0
  206. package/dist/assets/skills/poteto-mode/playbooks/babysit.md +23 -0
  207. package/dist/assets/skills/poteto-mode/playbooks/bug-fix.md +15 -0
  208. package/dist/assets/skills/poteto-mode/playbooks/eval.md +25 -0
  209. package/dist/assets/skills/poteto-mode/playbooks/feature.md +21 -0
  210. package/dist/assets/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  211. package/dist/assets/skills/poteto-mode/playbooks/investigation.md +14 -0
  212. package/dist/assets/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
  213. package/dist/assets/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
  214. package/dist/assets/skills/poteto-mode/playbooks/orchestrate.md +112 -0
  215. package/dist/assets/skills/poteto-mode/playbooks/pause-safely.md +10 -0
  216. package/dist/assets/skills/poteto-mode/playbooks/perf-issue.md +25 -0
  217. package/dist/assets/skills/poteto-mode/playbooks/prototype.md +14 -0
  218. package/dist/assets/skills/poteto-mode/playbooks/refactoring.md +16 -0
  219. package/dist/assets/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  220. package/dist/assets/skills/poteto-mode/playbooks/session-pickup.md +11 -0
  221. package/dist/assets/skills/poteto-mode/playbooks/shipping.md +12 -0
  222. package/dist/assets/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  223. package/dist/assets/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  224. package/dist/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
  225. package/dist/assets/skills/poteto-mode/references/bugbot-triage.md +142 -0
  226. package/dist/assets/skills/poteto-mode/scripts/bootstrap.ts +62 -0
  227. package/dist/assets/skills/poteto-mode/scripts/bun.lock +67 -0
  228. package/dist/assets/skills/poteto-mode/scripts/check-plan.mjs +205 -0
  229. package/dist/assets/skills/poteto-mode/scripts/check-plan.test.ts +96 -0
  230. package/dist/assets/skills/poteto-mode/scripts/orch/orch.test.ts +761 -0
  231. package/dist/assets/skills/poteto-mode/scripts/orch/orch.ts +590 -0
  232. package/dist/assets/skills/poteto-mode/scripts/orch/store.ts +1677 -0
  233. package/dist/assets/skills/poteto-mode/scripts/package.json +16 -0
  234. package/dist/assets/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  235. package/dist/assets/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  236. package/dist/assets/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +129 -0
  237. package/dist/assets/skills/poteto-mode/scripts/watch-pr/github.test.ts +436 -0
  238. package/dist/assets/skills/poteto-mode/scripts/watch-pr/github.ts +718 -0
  239. package/dist/assets/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
  240. package/dist/assets/skills/poteto-mode/scripts/watch-pr/policy.ts +836 -0
  241. package/dist/assets/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  242. package/dist/assets/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  243. package/dist/assets/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  244. package/dist/assets/skills/poteto-mode/scripts/watch-pr/types.ts +413 -0
  245. package/dist/assets/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  246. package/dist/assets/skills/poteto-mode/scripts/worktree-audit.sh +127 -0
  247. package/dist/assets/skills/principle-attack-the-premise/SKILL.md +23 -0
  248. package/dist/assets/skills/principle-boundary-discipline/SKILL.md +36 -0
  249. package/dist/assets/skills/principle-build-the-lever/SKILL.md +26 -0
  250. package/dist/assets/skills/principle-encode-lessons-in-structure/SKILL.md +13 -0
  251. package/dist/assets/skills/principle-exhaust-the-design-space/SKILL.md +11 -0
  252. package/dist/assets/skills/principle-experience-first/SKILL.md +21 -0
  253. package/dist/assets/skills/principle-explain-the-number/SKILL.md +19 -0
  254. package/dist/assets/skills/principle-fix-root-causes/SKILL.md +23 -0
  255. package/dist/assets/skills/principle-foundational-thinking/SKILL.md +23 -0
  256. package/dist/assets/skills/principle-guard-the-context-window/SKILL.md +14 -0
  257. package/dist/assets/skills/principle-laziness-protocol/SKILL.md +12 -0
  258. package/dist/assets/skills/principle-make-operations-idempotent/SKILL.md +24 -0
  259. package/dist/assets/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +16 -0
  260. package/dist/assets/skills/principle-minimize-reader-load/SKILL.md +20 -0
  261. package/dist/assets/skills/principle-model-the-domain/SKILL.md +26 -0
  262. package/dist/assets/skills/principle-never-block-on-the-human/SKILL.md +17 -0
  263. package/dist/assets/skills/principle-outcome-oriented-execution/SKILL.md +23 -0
  264. package/dist/assets/skills/principle-prove-it-works/SKILL.md +24 -0
  265. package/dist/assets/skills/principle-redesign-from-first-principles/SKILL.md +18 -0
  266. package/dist/assets/skills/principle-separate-before-serializing-shared-state/SKILL.md +18 -0
  267. package/dist/assets/skills/principle-sequence-verifiable-units/SKILL.md +19 -0
  268. package/dist/assets/skills/principle-subtract-before-you-add/SKILL.md +20 -0
  269. package/dist/assets/skills/principle-test-behavior-not-implementation/SKILL.md +22 -0
  270. package/dist/assets/skills/principle-type-system-discipline/SKILL.md +15 -0
  271. package/dist/assets/skills/recall/SKILL.md +37 -0
  272. package/dist/assets/skills/reflect/SKILL.md +70 -0
  273. package/dist/assets/skills/reflect/references/divergent-reviewer.md +38 -0
  274. package/dist/assets/skills/reflect/references/judgment-reviewer.md +37 -0
  275. package/dist/assets/skills/reflect/references/synthesizer.md +56 -0
  276. package/dist/assets/skills/reflect/references/tooling-reviewer.md +48 -0
  277. package/dist/assets/skills/setup-pstack/SKILL.md +76 -0
  278. package/dist/assets/skills/sharpen/SKILL.md +18 -0
  279. package/dist/assets/skills/show-me-your-work/SKILL.md +84 -0
  280. package/dist/assets/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  281. package/dist/assets/skills/show-me-your-work/scripts/log.sh +42 -0
  282. package/dist/assets/skills/swarm/SKILL.md +41 -0
  283. package/dist/assets/skills/tdd/SKILL.md +44 -0
  284. package/dist/assets/skills/teach/SKILL.md +23 -0
  285. package/dist/assets/skills/technical-writing/SKILL.md +108 -0
  286. package/dist/assets/skills/typescript-best-practices/SKILL.md +32 -0
  287. package/dist/assets/skills/typescript-best-practices/references/patterns.md +328 -0
  288. package/dist/assets/skills/unslop/SKILL.md +64 -0
  289. package/dist/assets/skills/why/SKILL.md +100 -0
  290. package/dist/assets/skills/why/references/epistemics.md +71 -0
  291. package/dist/assets/skills/why/references/investigator-prompt.md +84 -0
  292. package/dist/assets/skills/why/references/source-playbook.md +17 -0
  293. package/dist/assets/skills/why/references/sources/code-archaeology.md +51 -0
  294. package/dist/assets/skills/why/references/sources/databricks.md +70 -0
  295. package/dist/assets/skills/why/references/sources/datadog.md +97 -0
  296. package/dist/assets/skills/why/references/sources/incident-postmortem.md +5 -0
  297. package/dist/assets/skills/why/references/sources/linear.md +48 -0
  298. package/dist/assets/skills/why/references/sources/notion.md +55 -0
  299. package/dist/assets/skills/why/references/sources/sentry.md +66 -0
  300. package/dist/assets/skills/why/references/sources/slack.md +17 -0
  301. package/dist/assets/skills/why/references/synthesizer-prompt.md +129 -0
  302. package/dist/cordis.patch.yml +20 -0
  303. package/dist/index.d.mts +16 -0
  304. package/dist/index.mjs +172 -0
  305. package/dist/index.mjs.map +1 -0
  306. package/dist/paths-Bbai4CaT.mjs +16 -0
  307. package/dist/paths-Bbai4CaT.mjs.map +1 -0
  308. package/dist/subagent.d.mts +130 -0
  309. package/dist/subagent.mjs +436 -0
  310. package/dist/subagent.mjs.map +1 -0
  311. package/package.json +92 -3
@@ -0,0 +1,180 @@
1
+ # Recipes and pitfalls
2
+
3
+ Prompts worth copying, then the mistakes everyone makes once. Swap in your own paths and finish conditions. The recipes are deliberately informal. That's how they get typed in practice, and the skills read intent fine.
4
+
5
+ ![She tastes a finished dish while robots cook from a recipe box, with pinned cards reading /how, /tdd, and /loop above the counter.](./images/recipes.jpg)
6
+
7
+ ## Understand an unfamiliar subsystem
8
+
9
+ ```text
10
+ use /how first to understand how this initialization works. then use /why to figure out why it broke recently.
11
+ ```
12
+
13
+ Mechanics first, history second. Each skill's report tells you which sources it searched, so you know what the answer is grounded in.
14
+
15
+ ## Restate a noisy report before touching code
16
+
17
+ ```text
18
+ /poteto-mode read this thread. restate the underlying issue in your own words, in plain english. don't change any code yet.
19
+ ```
20
+
21
+ A misreading shows up in the restatement, where it costs one message to correct. Keep your own theory to yourself until the agent has stated its own. `/in-your-own-words` asks for the restatement alone, with no playbook.
22
+
23
+ ## Sharpen a prompt before you send it
24
+
25
+ ```text
26
+ /sharpen write the onboarding doc for the new billing service.
27
+ ```
28
+
29
+ The agent names what an expert would do that you didn't ask for, the raw material they'd start from, their methods and tools, and an outside check that the result is right. It hands back your prompt rewritten to ask for that and doesn't do the task. Send the rewrite when it reads right.
30
+
31
+ ## Prototype before you pick
32
+
33
+ ```text
34
+ /poteto-mode prototype a few options for the settings layout. put them behind a switcher and send me screenshots of each.
35
+ ```
36
+
37
+ You pick from things that run, not from descriptions. The agent answers its own layout and timing questions along the way.
38
+
39
+ ## Turn a settled design into a plan
40
+
41
+ ```text
42
+ /poteto-mode turn this design into a plan. small verifiable PRs, each with its own proof.
43
+ ```
44
+
45
+ Ask only after the design settles. The plan is the deliverable, and it names the playbook that will execute it.
46
+
47
+ ## Get a second opinion on a design
48
+
49
+ ```text
50
+ ask /arena for a second opinion on this thread and our approach
51
+ ```
52
+
53
+ Your current design becomes one candidate among several, and the synthesis tells you whether the panel found something better or confirmed what you had. It costs little next to a design that is expensive to reverse.
54
+
55
+ ## Check independent slices in parallel
56
+
57
+ ```text
58
+ /swarm check every package under packages/ against its check.sh. one worker per package. one report.
59
+ ```
60
+
61
+ Each worker owns one package. The parent waits for every slice and returns one `PASS`, `ISSUES`, or `BLOCKED` report instead of raw worker dumps.
62
+
63
+ ## Review a branch skeptically
64
+
65
+ ```text
66
+ /interrogate the whole branch, but skeptically. don't change anything yet. no nitpicks unless it's an actual bug or regression in behavior.
67
+ ```
68
+
69
+ The qualifiers do real work. "don't change anything yet" keeps it read-only, and the nitpick rule pre-filters the noise so `Act on` findings are worth your time.
70
+
71
+ ## Fix a bug through a failing test
72
+
73
+ ```text
74
+ /poteto-mode repro the duplicate write first. if there's a cheap test path, /tdd it. then fix and rerun.
75
+ ```
76
+
77
+ "if there's a cheap test path" matters. Forcing a test through brittle mocks proves less than running the real command, and the playbook is allowed to say so.
78
+
79
+ ## Repro and fix a report with proof
80
+
81
+ ```text
82
+ /poteto-mode repro this with /verify-<app>. if it repros on main, fix it and show me a video as proof.
83
+ ```
84
+
85
+ "if it repros on main" lets the run stop early when the bug is already gone. The video lets you check the fix before you read the diff.
86
+
87
+ ## Prove a property tests rarely reach
88
+
89
+ ```text
90
+ /create-formal-verification-skill the retry queue. a message must never be delivered twice.
91
+ ```
92
+
93
+ You get one property checked in every case within a stated scope, a counterexample in your code's terms if the code already breaks it, and a project skill the next agent runs on any change to that code.
94
+
95
+ ## Vet a number before you post it
96
+
97
+ ```text
98
+ /benchmark-checklist vet this 40% speedup before it goes in the pr description
99
+ ```
100
+
101
+ You get faster, slower, no measurable difference, or inconclusive, with the run count, the range, and what limits the number.
102
+
103
+ ## Stop correcting the same mistake
104
+
105
+ ```text
106
+ /correct agents keep adding new config flags without registering them in the schema
107
+ ```
108
+
109
+ The fix lands in the repo as architecture, a type, a lint, or a test, so the next agent can't make the mistake.
110
+
111
+ ## Ask how without starting the work
112
+
113
+ ```text
114
+ /poteto-help how do i get poteto-mode to stay on every turn?
115
+ ```
116
+
117
+ You get an answer, a prompt to send, and a link to the source. Nothing runs until you send that prompt.
118
+
119
+ ## Keep a run honest while you're away
120
+
121
+ ```text
122
+ im going to bed, keep going autonomously until every fixture passes. do not stop. keep a decision log i can audit in the morning.
123
+ ```
124
+
125
+ The full contract is on the [overnight page](./07-overnight.md). The short form works once the task and finish condition are already in the conversation.
126
+
127
+ ## Redirect a drifting run
128
+
129
+ Steering prompts are one line:
130
+
131
+ ```text
132
+ i said the goal is to repro. i did not ask for a fix yet.
133
+ ```
134
+
135
+ ```text
136
+ apply prove it works. show me the real output, not the build log.
137
+ ```
138
+
139
+ ```text
140
+ /unslop that, no emdashes
141
+ ```
142
+
143
+ You rarely need more words. You need the right name, and [the principles page](./08-principles.md) is the vocabulary.
144
+
145
+ ## Get the reply in plain words
146
+
147
+ ```text
148
+ /bro
149
+ ```
150
+
151
+ That's the whole prompt. [`/bro`](../../skills/bro/SKILL.md) restates the last message like one human talking to another, no jargon, shorter. Use it when a reply is technically thorough and you still don't know what it said.
152
+
153
+ ## Catch up on a chat you left running
154
+
155
+ ```text
156
+ /ketchup
157
+ ```
158
+
159
+ [`/ketchup`](../../skills/ketchup/SKILL.md) tells you in plain words what changed since your last message, then lists each call waiting on you with its pick, evidence, and risk. It changes nothing while it reports.
160
+
161
+ ## The pitfalls
162
+
163
+ - **Enumerating skills in the prompt.** "use /how then /architect then /arena" reorders steps the playbook already sequences. State the goal and constraints. Name a skill only to override a default.
164
+ - **A vague finish condition.** "make it better" gives the loop nothing to check. Give a command or artifact that can pass or fail.
165
+ - **Leading with your theory of the cause.** The agent searches wherever you pointed. Ask it to restate the problem first, then share your hunch.
166
+ - **Taking the first design.** One attempt locks in the first shape the model thought of. Ask for prototypes or `/architect` and pick from evidence.
167
+ - **Polishing an abstract plan.** Adversarial review of a plan with no code behind it invents risks that will never happen. Settle the open questions with prototypes, then review what got built.
168
+ - **Parallel agents in one worktree.** They overwrite each other, and nobody can tell which agent changed what. Run them as worktree subagents, or say "own worktree per attempt".
169
+ - **Looping before you trust the loop.** A loop that can't verify its own work only makes unchecked work faster. Get the verification skill working first.
170
+ - **Trusting an unvetted number.** A warm cache or a skipped code path can fake a speedup. Run `/benchmark-checklist` before the number goes anywhere.
171
+ - **Correcting the same mistake by hand.** A correction in chat helps one run. `/correct` fixes the repo so no later run repeats it.
172
+ - **Using `/arena` for coverage.** `/arena` repeats one design or code brief, then picks a base and grafts the best parts. `/swarm` partitions slices or declared race arms and aggregates one report.
173
+ - **Accepting every review comment.** Bots and humans both file real catches and noise in one list. `/interrogate` sorts findings into act-on and dismissed buckets with reasons, and you can override either way.
174
+ - **Treating `auto` as a model slug.** `auto` and `inherit-parent` mean "omit the model field so the subagent inherits the parent chat model." [Setup](./01-setup.md) covers the roles.
175
+ - **Reporting success off a green build.** A build proves it compiles. Ask for the real command, flow, stored value, or profile, and expect the evidence in the reply.
176
+ - **Writing a `SKILL.md` freehand.** Route it through the [Authoring or modifying a skill playbook](../../skills/poteto-mode/playbooks/authoring-a-skill.md) so validation and review happen.
177
+
178
+ That's the guide. If you skipped ahead, go back to [setup](./01-setup.md) and run one real task. The habits stick from use, not from reading.
179
+
180
+ Back to the [guide index](./README.md).
@@ -0,0 +1,38 @@
1
+ # The pstack guide
2
+
3
+ pstack works best when you stop micromanaging the agent. You describe what you want and how you'll know it's done. `/poteto-mode` picks the playbook, runs the other skills as the steps need them, and shows you the evidence. This guide teaches that habit with realistic prompts.
4
+
5
+ Here's what you'll learn:
6
+
7
+ 1. [Set up pstack](./01-setup.md). Install the plugin and pick your models.
8
+ 2. [Route work through `/poteto-mode`](./02-poteto-mode.md). Give it a goal and watch it pick a playbook.
9
+ 3. [Understand the code](./03-understand.md). A read-only investigation, then `/how`, `/why`, `/teach`, and `/recall` before you edit anything.
10
+ 4. [Design the change](./04-design.md). `/architect`, `/arena`, `/swarm`, `/interrogate`, prototypes, and plans before code locks in a shape.
11
+ 5. [Build and clean the change](./05-build-and-clean.md). The build playbooks, `/tdd`, `/unslop`, and `/no-comments`.
12
+ 6. [Verify and ship](./06-verify-and-ship.md). Prove behavior on the real app, formally verify what tests rarely reach, vet numbers with `/benchmark-checklist`, then open a focused PR and drive it to merged.
13
+ 7. [Run work while you sleep](./07-overnight.md). Trust before loops, an overnight contract, a decision log you can audit, and Projects and automations that scale past one agent.
14
+ 8. [Steer with principle names](./08-principles.md). The 24 names that redirect an agent mid-task.
15
+ 9. [Make it yours](./09-make-it-yours.md). Your own mode, `/correct` for repeated mistakes, and how to test a skill change.
16
+ 10. [Recipes and pitfalls](./10-recipes-and-pitfalls.md). Prompts to copy and mistakes to skip.
17
+
18
+ Read the pages in order the first time. After that, each page stands alone.
19
+
20
+ When you're stuck, or can't tell which skill fits, type [`/poteto-help`](../../skills/poteto-help/SKILL.md) with your question:
21
+
22
+ ```text
23
+ /poteto-help which skill should i use to review this branch?
24
+ ```
25
+
26
+ It answers, hands you a prompt to send, and links the skill or guide page the answer came from. It doesn't start the work, because a pstack run spends real tokens, so you send the prompt when you're ready. It runs only when you type it.
27
+
28
+ ## If you only remember one thing
29
+
30
+ Give the agent a goal and a way to check it, in your own words:
31
+
32
+ ```text
33
+ /poteto-mode the export writes duplicate rows when a retry lands mid-run. repro first, then fix and verify.
34
+ ```
35
+
36
+ You don't need to name a playbook or list skills. "repro first" and a checkable outcome are all the routing signal `/poteto-mode` needs. It matches the Bug fix playbook, copies the steps into a todo list, and calls the right skills as each step fires.
37
+
38
+ Next: [Set up pstack](./01-setup.md).
@@ -0,0 +1,65 @@
1
+ # pstack in DeepSeek Harness
2
+
3
+ This is the DSH adapter for pstack. It is the single source of truth for how a Cursor-shaped skill maps onto DSH. Read it once per session when a skill asks for a Cursor feature that DSH does not have.
4
+
5
+ ## Tools
6
+
7
+ | Cursor | DSH |
8
+ | --- | --- |
9
+ | `Task` | `pstack_subagent`. Starts a background child and returns its id; the runtime sends a completion notice. |
10
+ | `subagent_type: "poteto-agent"` | `agent: "poteto-agent"`. The tool prepends the poteto-agent instructions. |
11
+ | `subagent_type: generalPurpose` | `agent: "general"`. No preamble; the prompt stands alone. |
12
+ | `subagent_type: "comment-sicko"` | `agent: "comment-sicko"`. |
13
+ | `run_in_background: true` | Always on. Every child is a managed background activation. |
14
+ | `readonly: true` / `readonly: false` | No separate mode. Say "do not edit files" in the prompt, and check `git status` afterward. |
15
+ | `resume` | `send_message` to the child id. Prefer a fresh child with consolidated scope, per `poteto-mode`. |
16
+ | `AskQuestion` | `ask_user_question`. In non-interactive runs it is absent, so ask in plain text. |
17
+ | `TodoWrite` | `todo_write` with the whole list. |
18
+ | `Grep` / `Glob` | `grep` / `glob`. |
19
+ | `Read` / `Write` / `Edit` | `read` / `write` / `edit`. |
20
+ | `Shell` | `bash` (or `pwsh` on Windows). |
21
+
22
+ ## Paths
23
+
24
+ | Cursor | DSH |
25
+ | --- | --- |
26
+ | `~/.cursor/rules/pstack-models.mdc` | `~/.dsh/pstack-models.md` |
27
+ | `.cursor/skills/`, `~/.cursor/skills/` | `.dsh/skills/`, `~/.dsh/skills/` |
28
+ | `~/.cursor/plugins/`, `.cursor-plugin/plugin.json` | `~/.dsh/plugins/`, `package.json` |
29
+ | `~/.cursor/projects/<slug>/agent-transcripts/` | `$DSH_HOME/sessions/<workspace-slug>/<session-id>/` |
30
+
31
+ ## Models
32
+
33
+ | Cursor | DSH |
34
+ | --- | --- |
35
+ | `model` slug, such as `claude-opus-5-5-xhigh` | `role: "<role line>"`. The tool resolves provider, model, and effort from `~/.dsh/pstack-models.md` at call time. |
36
+
37
+ ## Role configuration
38
+
39
+ `/setup-pstack` writes `~/.dsh/pstack-models.md`. One role per line:
40
+
41
+ ```text
42
+ # pstack model configuration. One line per role.
43
+ # Value is `inherit-parent` or `<provider>/<model>` with an optional effort token.
44
+ feature, refactoring: deepseek-official/deepseek-reasoner high
45
+ judgment and prose: inherit-parent
46
+ ```
47
+
48
+ A missing file or line means every role inherits the parent's route. To discover valid routes, call `list_subagent_models`; never invent a provider or model id. The shipped defaults are in `docs/pstack-models.example.md`.
49
+
50
+ ## Cursor-only features
51
+
52
+ | Cursor | DSH |
53
+ | --- | --- |
54
+ | Cursor's built-in `create-skill` | No built-in authoring skill. Follow the `authoring-a-skill` playbook in `poteto-mode`. |
55
+ | Custom Modes | No persistent mode. Start each task with `/poteto-mode`. |
56
+ | Cursor Automations, routines, `SendToUser` secret requests | No equivalent. Use `schedule_create` for time-based follow-ups; skip the step with one line. |
57
+ | `environment: "cloud"` | A `pstack_subagent` with its own git worktree. DSH has no per-agent VM. |
58
+ | `/loop` | `schedule_create` plus `create_goal` for long autonomous runs. |
59
+ | `/deslop`, `control-cli`, `control-ui` from `cursor-team-kit` | Not shipped. Ask for the same outcome in plain words: remove narrating comments, unsupported guards, dead compatibility paths, and unrelated edits. `/no-comments` covers the comment half. |
60
+ | `cursor-team-kit` | Not shipped with pstack. Install it separately, or ask for the same outcome in plain words. |
61
+ | Bugbot | Comments arrive as ordinary forge review threads; triage them with `gh`. If a PR has no bot check or comment, skip the step. |
62
+
63
+ ## Subagent completion
64
+
65
+ `pstack_subagent` returns `started subagent <id>` immediately. The child's final answer arrives later as a completion notice. Do not poll. If you need to steer it, call `send_message` with that id. To list children, call `list_agents`.
@@ -0,0 +1,23 @@
1
+ # ~/.dsh/pstack-models.md
2
+ #
3
+ # One line per role. Delete a line to inherit the parent chat's route.
4
+ # Value: inherit-parent | <provider>/<model> [effort]
5
+ # Discover routes with the list_subagent_models tool.
6
+ # budget: large (xhigh)
7
+ feature, refactoring: inherit-parent
8
+ bug-fix: inherit-parent
9
+ perf-issue: inherit-parent
10
+ hillclimb: inherit-parent
11
+ judgment and prose: inherit-parent
12
+ hardest tasks: inherit-parent
13
+ how explorer: inherit-parent
14
+ how explainer: inherit-parent
15
+ why investigators: inherit-parent
16
+ why synthesizer: inherit-parent
17
+ reflect tooling: inherit-parent
18
+ reflect judgment, divergent, synthesizer: inherit-parent
19
+ arena runners: inherit-parent, inherit-parent
20
+ arena cross-judge pool: inherit-parent, inherit-parent
21
+ swarm workers: inherit-parent
22
+ architect runners: inherit-parent, inherit-parent
23
+ interrogate reviewers: inherit-parent, inherit-parent
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: architect
3
+ description: Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for /architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ > DSH port of pstack. `pstack_subagent` replaces Cursor's `Task` tool, and `role` replaces Cursor model slugs. Full mapping: `../../docs/harness/dsh.md`.
8
+
9
+ # Architect
10
+
11
+ Sketch types, function signatures, class shapes, and module boundaries with `not implemented` bodies and pseudocode. Synthesize across multiple model perspectives, then fill in code against the chosen sketch.
12
+
13
+ ## Start
14
+
15
+ Call `todo_write` with one entry per phase before starting.
16
+
17
+ 1. Ground
18
+ 2. Sketch
19
+ 3. Agree
20
+ 4. Implement
21
+ 5. Scrap
22
+
23
+ ## Phase A: Ground the problem
24
+
25
+ Build a real mental model of every system the new code touches. Run the **how** skill over the relevant subsystems. Naming a file isn't grounding. Produce the architectural explanation `how` prescribes. If the design redefines ownership or layering, also run the **why** skill on the existing shape so the rationale becomes a constraint, not a guess.
26
+
27
+ Skip Phase A only when the work is genuinely greenfield with no surrounding system to integrate.
28
+
29
+ ## Phase B: Sketch
30
+
31
+ Run the **arena** skill with the design-sketch task and the Phase A grounding artifacts. Pass `references/runner-prompt.md` as each runner's prompt.
32
+
33
+ Take the runners from the `architect runners` line in the `pstack-models.md` rule, in place of the `arena runners` line. If the rule or that line is missing, both runners inherit the parent model. Alias and rejected entries follow the runner rules in the **arena** skill's Phase A.
34
+
35
+ Design it twice. Require at least two structurally distinct candidates before synthesis, even when the first looks sufficient. This is the **exhaust-the-design-space** principle skill made concrete. Whole-shape alternatives, not point fixes inside one shape.
36
+
37
+ Screen every candidate against [`references/design-red-flags.md`](references/design-red-flags.md) before synthesis. Assume the next contributor is an agent that sees only the files it opened, copies the nearest example, and takes the shortest path that compiles. Prefer the design where a change that looks right from one file is right for the whole repo.
38
+
39
+ Compare viable candidates on interface depth. Prefer the design that hides more complexity behind a smaller, simpler public surface. A rich interface can keep call chains short by concentrating capability instead of scattering it across layers.
40
+
41
+ Arena returns one synthesized design package. Its synthesis decision fills the rationale's "Synthesis decision" section.
42
+
43
+ ## Phase C: Agree (opt-in)
44
+
45
+ Default: proceed directly to implementation with the synthesized design. No human checkpoint.
46
+
47
+ Opt in to a checkpoint when the invoker explicitly asks: "/architect with checkpoint," "stop and show me before implementing," or similar. Then surface the synthesized design and pause for sign-off.
48
+
49
+ The synthesis can ship as its own commit either way, as the "scaffold first" mode of the **foundational-thinking** principle skill. Planned and scoped breakage during fill-in is fine, per the **outcome-oriented-execution** principle skill. For adversarial pressure on the design before implementing, run the **interrogate** skill on the synthesized sketch.
50
+
51
+ If the human pushes back on the shape (in a checkpoint or after the fact), treat that as Phase A evidence. Re-ground and re-run Phase B before writing more code.
52
+
53
+ ## Phase D: Implement against the sketch
54
+
55
+ Replace `not implemented` bodies with code, pseudocode with logic. The synthesized sketch is the contract. Deviations from it are signal to surface, not friction to absorb silently. If a function needs a parameter the sketch didn't anticipate, ask whether the sketch was wrong, the requirement was missed, or the implementation is overreaching.
56
+
57
+ ## Phase E: Scrap when the architecture is wrong
58
+
59
+ If implementation keeps producing friction the sketch can't absorb, throw the sketch out. Don't bolt fixes onto a wrong design, per the **redesign-from-first-principles** and **fix-root-causes** principle skills.
60
+
61
+ The signal is a *pattern*, not single instances. Tells:
62
+
63
+ - The same shape of workaround appearing repeatedly across unrelated code.
64
+ - Multiple unrelated edge cases that all need special-case branches.
65
+ - Types that need escape hatches (`any`, casts, optional fields always set in practice) to compile.
66
+ - The "we need a lock" reflex when the sketch said the state wasn't shared.
67
+ - Callers having to know the abstraction's internal rules to use it.
68
+ - Two or more independent Phase D deviations of the same shape across the implementation.
69
+
70
+ Use judgment. A few edge cases don't condemn an architecture. Some problems are legitimately complex. Complexity in the data is not complexity in the design.
71
+
72
+ When you scrap:
73
+
74
+ 1. Re-run the **how** skill over what's been built.
75
+ 2. Redesign as if the new constraints had been day-one assumptions, per redesign-from-first-principles.
76
+ 3. Subtract before adding, per the **subtract-before-you-add** principle skill. The new sketch should be smaller than the old one before it grows.
77
+ 4. Return to Phase B and re-run arena.
78
+
79
+ ## Outputs
80
+
81
+ The caller's usage is written first and the type sketch derived from it. One file with new types and signatures for small changes. Module map plus type definitions for larger work. The rationale ships alongside, shaped per `references/rationale-template.md`, including the usage sketch and the synthesis decision.
@@ -0,0 +1,57 @@
1
+ # Design red flags
2
+
3
+ Screen every candidate before synthesis. A red flag is a reason to revise or reject the shape.
4
+
5
+ ## Shallow module
6
+
7
+ A shallow module exposes a large interface while hiding little complexity. Judge depth by the capability and policy hidden behind the public surface relative to the size of that surface. Prefer a simple interface backed by substantial behavior.
8
+
9
+ Do not confuse a deep module with a deep call chain. A deep call chain scatters understanding across layers. A deep module concentrates capability behind one interface.
10
+
11
+ Look for these signs:
12
+
13
+ - Callers coordinate several methods to complete one operation.
14
+ - Public options expose internal stages or implementation choices.
15
+ - Learning the interface does not save the caller from learning the implementation.
16
+
17
+ ## Information leakage
18
+
19
+ Information leakage makes multiple modules depend on the same internal decision. A representation, policy, or protocol detail appears in more than one place, so changing it requires coordinated edits.
20
+
21
+ Public re-exports of transport or wire types are leakage. Parse external data into domain types behind the interface. Keep storage schemas, framework objects, and protocol details private.
22
+
23
+ ## Temporal decomposition
24
+
25
+ Temporal decomposition organizes modules by execution order instead of the knowledge they own. Separate load, validate, transform, and save stages often repeat one representation and its invariants across several boundaries.
26
+
27
+ Group code around domain knowledge and ownership. Methods that run at different times can still belong to one module when they protect the same decisions.
28
+
29
+ ## Pass-through method
30
+
31
+ A pass-through method forwards the same arguments to another method with the same shape. It adds a layer without hiding complexity.
32
+
33
+ Remove it or move responsibility to the module that can complete the operation. Keep a forwarding boundary only when it adds policy, adaptation, or a distinct abstraction.
34
+
35
+ ## Split ownership
36
+
37
+ More than one module writes the same state or keeps its own copy of it. An agent that edits one writer can't see the others, so their rules diverge.
38
+
39
+ Give each piece of state one owner. Other modules read it or ask the owner to change it.
40
+
41
+ ## Two ways to do one task
42
+
43
+ The design supports more than one way to do the same task. An agent copies whichever way it finds first, so every way keeps gaining callers.
44
+
45
+ Keep one way. Move callers off the others and delete them in the same change.
46
+
47
+ ## Importable internals
48
+
49
+ A caller can import a module's internals. An agent takes the shortest path that compiles, so it imports them directly and they become part of the interface.
50
+
51
+ Make internals unreachable from outside the module, so an import from outside fails the build.
52
+
53
+ ## Hand-synced list
54
+
55
+ Two or more places list the same items, and adding an item means editing every list. An agent that sees one list updates only that one.
56
+
57
+ Keep one list and derive the others from it. If a list can't be derived, make the build fail when the lists disagree.
@@ -0,0 +1,35 @@
1
+ # Rationale template
2
+
3
+ The prose that ships alongside the type sketch. One page. Sentence-case headings, no boilerplate. Replace the italic notes with actual content.
4
+
5
+ ## Problem
6
+
7
+ *One paragraph. What we're trying to do, and what about the existing system or constraints makes the shape non-obvious. If [Phase A](../SKILL.md#phase-a-ground-the-problem) surfaced constraints the design must honor (existing types to interop with, callers we can't break, invariants that crossed our boundary), name them here so the reader sees the same constraints you saw.*
8
+
9
+ ## Usage (caller's view)
10
+
11
+ *Write this first, before the type sketch. Show the README or quickstart the consumer reads, plus two or three realistic call sites in their own code. What they import, what they call, what comes back. The type sketch in [Shape](#shape) is derived from this. The two must agree. When they diverge, reconcile the sketch to the usage, not the reverse. The caller's experience is the spec. The types serve it.*
12
+
13
+ ## Shape
14
+
15
+ *The recommended architecture. Data structures first. Then how data flows through the signatures. Name the load-bearing decisions. State which invariants are encoded in types, where validation lives, and what the system deliberately does not do. Judge interface depth explicitly. State what complexity the public surface hides, what remains exposed to callers, and why the interface is no larger than needed. Cite the principle behind each decision (e.g., `per boundary-discipline`). Don't restate it.*
16
+
17
+ ## Synthesis decision
18
+
19
+ *Filled in by [arena](../../arena/SKILL.md). Records which candidate became the base and why, what was adapted from each of the others, and what was rejected and why.*
20
+
21
+ ## Tradeoffs accepted
22
+
23
+ *One bullet per tradeoff the chosen shape makes. Form: "we accept X in exchange for Y." Name anything a future reader might mistake for an oversight, including things that look like premature optimization or premature simplification.*
24
+
25
+ ## Alternatives considered
26
+
27
+ *Required. Name at least one concrete alternative shape, with one line on why it lost. Judge each alternative on interface depth, not implementation simplicity alone. Name the complexity it exposes to callers and the complexity it hides. Two or three alternatives belong here when the design space had real contenders. One is fine when the constraints forced the answer, with the conclusion phrased as "this was the only viable shape because..." Avoid listing flavors of the same shape. This section covers design alternatives the chosen shape considered and rejected, not other runner candidates.*
28
+
29
+ ## Open questions and risks
30
+
31
+ *Things you noticed during the sketch that the human needs to weigh in on, and risks worth flagging before implementation starts. Phrase as questions, not assertions, so the human's answer is the resolution rather than a comment.*
32
+
33
+ ## Next implementation step
34
+
35
+ *The first thing to build against the sketch. One sentence. What you'd start writing immediately after synthesis (or after Phase D sign-off, if a checkpoint was opted into).*
@@ -0,0 +1,20 @@
1
+ # Architect runner prompt
2
+
3
+ The orchestrator passes this file through to every parallel candidate runner during Phase B and fills in the variable inputs around it: the task, the Phase A grounding artifacts, the isolated working directory, and the path to write outputs. The working directory is a git worktree when available, otherwise a per-runner subdirectory under the sketch dir. What matters is independence between candidates.
4
+
5
+ You are producing one candidate design in architect's parallel exploration. Read the **architect** skill in full first. That's the workflow you're inside. Output a candidate design package: type sketch, function signatures, module map, and prose rationale shaped per [`rationale-template.md`](rationale-template.md).
6
+
7
+ Apply the following discipline. The orchestrator compares candidates on these axes to pick a base.
8
+
9
+ - Caller's usage first. Write the README-style usage and two or three real call sites before the types, then derive the type sketch from them. The usage is the spec. The two must agree, so reconcile the sketch to the usage, not the reverse.
10
+ - Data structures first. Get the core types right and the code becomes obvious. Trace each dominant access pattern through the proposed structure. If the answer is "we'll add a map / index / cache later," the structure is wrong.
11
+ - Interface depth. Compare the capability hidden behind the public surface relative to the size of that surface. Prefer a simple interface that pulls complexity into the callee, even when the implementation becomes less simple. Do not put transport or wire types on the public API. Parse into domain types behind the interface.
12
+ - Shared state: if two actors might both write, ask "what happens?" If the answer isn't "nothing," default to per-actor state with a merge at the read boundary, per the **separate-before-serializing-shared-state** principle skill.
13
+ - Make boundaries visible. `not implemented` errors for bodies, `// TODO` pseudocode for tricky logic, doc comments stating intent and invariants. A reader should trace data from input to output by reading types and signatures alone.
14
+ - Encode invariants in types: hard-to-misuse types > runtime checks > prose comments, per the **encode-lessons-in-structure** principle skill.
15
+ - Validate at boundaries, trust types inside, per the **boundary-discipline** principle skill. Business logic as pure functions. The shell stays thin.
16
+ - Single source of truth per invariant. Derive instead of sync.
17
+ - Idempotent state transitions where applicable, per the **make-operations-idempotent** principle skill. Ask what happens if the operation runs twice or crashes halfway.
18
+ - Short call chains. If tracing the flow needs more than three files, flatten the hierarchy, per the **laziness-protocol** and **minimize-reader-load** principle skills.
19
+
20
+ You are one of the parallel runners, each on a different model. Produce the best design your model can make. Don't hedge against the others. Differences between candidates are the signal used to pick a base and graft. Converging on a safe-looking middle defeats the exploration.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: arena
3
+ description: Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ > DSH port of pstack. `pstack_subagent` replaces Cursor's `Task` tool, and `role` replaces Cursor model slugs. Full mapping: `../../docs/harness/dsh.md`.
8
+
9
+ # Arena
10
+
11
+ Call `todo_write` with one entry per phase (Frame, Fan out, Cross-judge, Pick, Graft, Verify) before launching anything.
12
+
13
+ ## Phase A: Frame
14
+
15
+ Every candidate gets the same prompt, so the prompt is the contract.
16
+
17
+ 1. State the artifact each candidate is producing.
18
+ 2. Derive the rubric, 3-6 concrete gradeable criteria for what success looks like on *this* task. It is the picker's tool in Phase D. Candidates only see the task.
19
+ 3. Pick the runners with `role: "arena runners"`. The role is a list in `~/.dsh/pstack-models.md`; one child runs per entry, and an `inherit-parent` entry runs on the parent model. When the file or line is missing, run one child on the parent model. Spawn more runners when the arena covers multiple design directions. Use the same route N times when the work is generation-bound rather than judgment-sensitive. Pick each subagent's reasoning level and fast or standard speed for the job, per the Subagents section of the **poteto-mode** skill.
20
+ 4. Give each candidate its own output location (a git worktree where possible, otherwise `/tmp/arena-<slug>/candidate-<n>/`), per the **separate-before-serializing-shared-state** principle skill.
21
+
22
+ ## Phase B: Fan out
23
+
24
+ Spawn all N subagents in one message each with the task, the path to the shared grounding, its own output path, and instructions to produce the artifact and a short rationale naming the alternatives it considered and what it rejected.
25
+
26
+ If a candidate produces no output, proceed with N-1 and note the dropout.
27
+
28
+ ## Phase C: Cross-judge
29
+
30
+ After all Phase B candidates complete, spawn one `pstack_subagent` with `role: "arena cross-judge pool"` and `agent: "general"`, and tell it not to edit files. Prefer a route whose family differs from the parent's; when the role is missing, use the parent model. It sees the rubric and the candidates by path label, scores each criterion, and recommends a base with rationale. It runs in parallel with your reading in Phase D. Don't spawn it while candidates are still writing.
31
+
32
+ ## Phase D: Pick a base
33
+
34
+ Read every candidate end to end before picking. Score each against the rubric criterion by criterion, not on holistic feel, and compare with the cross-judge. Agreement on the base confirms the pick. Disagreement means one of you is biased or the rubric was ambiguous. Read both rationales before deciding.
35
+
36
+ Pick the base a future maintainer can extend most easily without breaking invariants. When two feel tied, prefer the cleaner boundary or smaller API, per the Laziness Protocol.
37
+
38
+ ## Phase E: Graft
39
+
40
+ Walk each losing candidate once more for what is worth porting into the base, usually one or two things per candidate, not most of it. Fold each graft in by hand, per the **redesign-from-first-principles** principle skill, so the result stays coherent under one mental model. Don't paste mechanically.
41
+
42
+ If the candidates converge on one shape, that is strong agreement. Note it and ship the consensus shape. No graft is needed. If they wildly diverge, Phase A was under-specified. Reframe and re-run rather than averaging the divergence.
43
+
44
+ ## Phase F: Verify
45
+
46
+ Verify the synthesized artifact like any other output, per the **prove-it-works** principle skill. If verification finds a problem the arena missed, either Phase A was wrong (re-frame and re-run) or a candidate caught it and you missed the graft (go back to Phase E). Don't paper over it.
47
+
48
+ ## Outputs
49
+
50
+ One synthesized artifact, with a short synthesis note alongside naming the base and why, the cross-judge's verdict, each graft with its source candidate, what was rejected and why, any convergence or dropouts, and the verification result.