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,47 @@
1
+ # Notes verification map
2
+
3
+ This directory is the maintained source for verifying the user-facing behavior of Notes. Read the index before driving the app, then use the matching feature file as the recipe.
4
+
5
+ ## Baseline preconditions
6
+
7
+ - Launch Notes at `http://127.0.0.1:4173` with a disposable data directory.
8
+ - Set `NOTES_DATA_DIR=/tmp/notes-verify-$RUN_ID` so concurrent runs do not share state.
9
+ - Seed notes titled `Quarterly plan` and `Grocery list`.
10
+ - Put `control-notes` and the `notes` CLI on `PATH`.
11
+ - Run `control-notes doctor` and require the expected URL, data directory, and build revision.
12
+ - Never drive an instance that was not started by this verification run.
13
+
14
+ ## Driving conventions
15
+
16
+ - Start every recipe from the baseline state unless its preconditions say otherwise.
17
+ - Prefer ARIA roles and accessible names over CSS selectors or DOM position.
18
+ - Treat every command as literal. Keep quoted names and flags unchanged.
19
+ - Run browser actions through `control-notes browser`.
20
+ - Run terminal actions through `control-notes cli -- <command>`.
21
+ - Restore seeded data after a mutation. Do not remove proof artifacts during cleanup.
22
+
23
+ ## Proof and skip reporting
24
+
25
+ - Capture the user action and the resulting state, not only the final screen.
26
+ - UI proof includes an ARIA snapshot and a screenshot with the app identity visible.
27
+ - CLI proof includes the command, stdout, stderr, and exit code.
28
+ - Mutation proof includes a read-only second view of the stored value.
29
+ - Record the feature ID and entry point used with every artifact.
30
+ - Report an unreachable path with the attempted command and the unmet precondition.
31
+ - Do not report a skipped entry point as verified through a different path.
32
+
33
+ ## Feature entry contract
34
+
35
+ Each feature file starts with an H1 title and one paragraph describing the user-visible behavior. It then uses exactly four H2 sections in this order.
36
+
37
+ 1. `Sub-features` lists short IDs with one line for each behavior.
38
+ 2. `How to get to it (user POV)` lists every user entry point.
39
+ 3. `Driving it with <harness>` starts with `Preconditions:` and uses labeled bullets that pair each user action with an exact command and observable result.
40
+ 4. `Gotchas` lists traps that can waste or invalidate a verification run.
41
+
42
+ Keep implementation details out of the map. Name only user paths, stable handles, required state, commands, and observable proof.
43
+
44
+ ## Features
45
+
46
+ - [Create a note](./create-note.md) covers browser and CLI creation, cancellation, persistence, and cleanup.
47
+ - [Search notes](./search.md) covers toolbar, keyboard, and CLI search with matching, empty, and clear states.
@@ -0,0 +1,39 @@
1
+ # Create a note
2
+
3
+ Create note lets a user save a titled note from the browser or CLI, cancel an unfinished draft, and confirm the saved note from a second user-facing view.
4
+
5
+ ## Sub-features
6
+
7
+ - `create-open` opens a blank editor from each browser entry point.
8
+ - `create-save` persists a title and body.
9
+ - `create-cancel` discards an unfinished browser draft.
10
+ - `create-cli` creates the same note shape from the terminal.
11
+
12
+ ## How to get to it (user POV)
13
+
14
+ - Choose the `New note` button in the browser toolbar.
15
+ - Press `n` in the browser while focus is outside an editable field.
16
+ - Run `notes create --title <title> --body <body>` in a terminal.
17
+
18
+ ## Driving it with control-notes
19
+
20
+ Preconditions:
21
+
22
+ - Notes is healthy at `http://127.0.0.1:4173`.
23
+ - No note is titled `Release checklist`.
24
+ - `control-notes doctor` reports the expected URL and disposable data directory.
25
+
26
+ - **Open editor.** Choose `New note`. Run `control-notes browser click --role button --name "New note"`. A form named `Note editor` appears with focus in the `Title` textbox.
27
+ - **Enter content.** Type the title and body. Run `control-notes browser fill --role textbox --name "Title" --value "Release checklist"` and `control-notes browser fill --role textbox --name "Body" --value "Tag and publish"`. The `Save note` button becomes enabled.
28
+ - **Save note.** Choose `Save note`. Run `control-notes browser click --role button --name "Save note"`. A status named `Note saved` appears and the heading reads `Release checklist`.
29
+ - **Confirm persistence.** Return to the note list and reopen the note. Run `control-notes browser click --role link --name "All notes"` and `control-notes browser click --role link --name "Release checklist"`. The editor shows both saved values.
30
+ - **Cancel draft.** Open a new note, enter `Discard me`, and choose `Cancel`. Run `control-notes browser click --role button --name "New note"`, `control-notes browser fill --role textbox --name "Title" --value "Discard me"`, and `control-notes browser click --role button --name "Cancel"`. The note list returns and has no `Discard me` link.
31
+ - **CLI entry.** Create a second note. Run `control-notes cli -- notes create --title "CLI note" --body "Created from terminal" --format json`. Exit code `0` and stdout contain the new note ID and title.
32
+ - **Proof.** Reopen both saved notes from `All notes`. Run `control-notes browser snapshot --aria --path artifacts/create-note/list.aria.txt` and `control-notes browser screenshot --path artifacts/create-note/list.png`. The artifacts show `Release checklist` and `CLI note`.
33
+
34
+ ## Gotchas
35
+
36
+ - Pressing `n` while a textbox has focus types the character instead of opening a new editor.
37
+ - Titles are trimmed on save. Assert the rendered title, not the draft input value.
38
+ - A save status alone is insufficient proof. Reopen the note from the list.
39
+ - Remove `Release checklist` and `CLI note` during fixture cleanup, but retain their proof artifacts.
@@ -0,0 +1,45 @@
1
+ # Search notes
2
+
3
+ Search lets a user find notes by title or body text, inspect a matching note, and distinguish no matches from an unavailable search.
4
+
5
+ ## Sub-features
6
+
7
+ - `search-open` opens search from each supported browser entry point.
8
+ - `search-match` returns title and body matches without changing note data.
9
+ - `search-open-result` opens a result in the note editor.
10
+ - `search-empty` shows a complete empty state for a query with no matches.
11
+ - `search-clear` removes the query and restores the recent-notes view.
12
+ - `search-cli` returns the same matching notes from the terminal.
13
+
14
+ ## How to get to it (user POV)
15
+
16
+ - Choose the `Search` button in the browser toolbar.
17
+ - Press `/` in the browser while focus is outside an editable field.
18
+ - Run `notes search <query>` in a terminal.
19
+
20
+ ## Driving it with control-notes
21
+
22
+ Preconditions:
23
+
24
+ - Notes is healthy at `http://127.0.0.1:4173`.
25
+ - The disposable data directory contains `Quarterly plan` with body text `Draft budget`.
26
+ - `control-notes doctor` reports the expected URL and data directory.
27
+
28
+ - **Toolbar entry.** Choose the `Search` button. Run `control-notes browser click --role button --name "Search"`. A dialog named `Search notes` appears with focus in its searchbox.
29
+ - **Keyboard entry.** Close the dialog, focus the page, and press `/`. Run `control-notes browser press --key "/"`. The same dialog appears and the page does not insert a slash.
30
+ - **Title match.** Type `quarterly`. Run `control-notes browser fill --role searchbox --name "Search notes" --value "quarterly"`. The `Search results` list contains `Quarterly plan` and does not contain `Grocery list`.
31
+ - **Body match.** Replace the query with `budget`. Run `control-notes browser fill --role searchbox --name "Search notes" --value "budget"`. The result `Quarterly plan` remains visible with a body-match excerpt.
32
+ - **Open result.** Choose `Quarterly plan`. Run `control-notes browser click --role link --name "Quarterly plan"`. The dialog closes and the editor heading reads `Quarterly plan`.
33
+ - **Empty state.** Reopen search and enter `volcano`. Run `control-notes browser fill --role searchbox --name "Search notes" --value "volcano"`. A status named `No matching notes` appears after search completes.
34
+ - **Clear query.** Choose `Clear search`. Run `control-notes browser click --role button --name "Clear search"`. The searchbox is empty and the `Recent notes` region replaces the result list.
35
+ - **CLI match.** Search from the terminal. Run `control-notes cli -- notes search "quarterly" --format json`. Exit code `0` and stdout contain one object whose title is `Quarterly plan`.
36
+ - **CLI miss.** Search for an absent value. Run `control-notes cli -- notes search "volcano" --format json`. Exit code `0` and stdout are `[]`.
37
+ - **Proof.** Capture the populated result state. Run `control-notes browser snapshot --aria --path artifacts/search/results.aria.txt` and `control-notes browser screenshot --path artifacts/search/results.png`. Both artifacts identify Notes, the query, and `Quarterly plan`.
38
+
39
+ ## Gotchas
40
+
41
+ - Pressing `/` while the editor or searchbox has focus inserts text instead of opening search.
42
+ - Results update after a short debounce. Wait for the results list or empty status, not a fixed sleep.
43
+ - Archived notes are excluded unless the user enables `Include archived`.
44
+ - The CLI defaults to human-readable output. Use `--format json` for stable assertions.
45
+ - Opening a result changes browser state. Reopen search before proving another query.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: figure-it-out
3
+ description: "Design an auditable playbook when no narrower one fits: a large migration, an ambitious multi-part change, or work a human reviews after stepping away. Scales rigor to the task, runs a hypothesis loop, and logs decisions. Use for /figure-it-out or 'figure it out'."
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
+ # Figure it out
10
+
11
+ When the task matches no playbook, design one. The deliverable before any code is the workflow itself: a sequence of phases that scales rigor to the task, runs the scientific method, and leaves a decision trail a human can audit after stepping away.
12
+
13
+ ## Start
14
+
15
+ Call `todo_write` with a list whose first item is to read the Principles section of the **poteto-mode** skill. Then add the phases below as todos.
16
+
17
+ ## Phase A: Frame
18
+
19
+ Ground first, then commit. Don't start the run until you can state:
20
+
21
+ - The definition of done as a falsifiable predicate (the **prove-it-works** principle skill).
22
+ - Scope, quantified: rough units and effort, plus the blockers grounding surfaced.
23
+ - The rigor level, biased high. One-way doors and high blast radius get more. Reversible low-stakes steps get less. Rigor is gates and artifacts, not "try harder".
24
+
25
+ Present the framing and tradeoffs before committing to a long run. Reversible work proceeds (the **never-block-on-the-human** principle skill), but a multi-hour run earns one checkpoint.
26
+
27
+ ## Phase B: Design the workflow
28
+
29
+ Decompose into atomic, independently-landable units. Sequence riskiest-unknown-first. Scaffold and verification come before features (the **foundational-thinking** principle skill).
30
+
31
+ - Build the verification harness before the work, with the baseline captured from the pre-change state, so the check reads as "old value vs new value".
32
+ - For one-way-door design decisions, run the **architect** skill (it runs **arena**). Skip it for mechanical work whose shape is already concrete. A second arena over a settled design is over-engineering (the **laziness-protocol** principle skill).
33
+ - Decide what fans out. Parallelize only across seams, and give each worker its own worktree or branch (the **separate-before-serializing-shared-state** principle skill). Don't over-fan. Pick each subagent's reasoning level and fast or standard speed for the job, per the Subagents section of the **poteto-mode** skill.
34
+ - Write the designed phase list down. That list is what the human reviews.
35
+
36
+ Then execute the design. Add its steps to the todo list as concrete items between the Phase C and Phase D entries. Run each under the Phase C loop discipline, and weave the Phase D log through them, a row as each step lands, rather than saving the whole trail for the end.
37
+
38
+ ## Phase C: Run the loop
39
+
40
+ Each unit is an experiment. State the hypothesis, make the smallest change, measure against the predicate on the real artifact, keep it if it advanced, revert it if it didn't. Apply the **sequence-verifiable-units** principle skill, verifying each unit before starting the next instead of batching checks at the end.
41
+
42
+ - Verify by inspecting the artifact, never a self-report. When something passes too easily, suspect the observation method before the system.
43
+ - Pair delegated work with a judge. If a worker games the gate, reset and harden the contract. If the gate itself is wrong, fix the gate in its own change rather than routing around it.
44
+ - A verdict is VERIFIED, NOT VERIFIED, or INCONCLUSIVE. Inconclusive is not a pass. Don't hide a negative.
45
+
46
+ ## Phase D: Keep the audit trail
47
+
48
+ Log the run via the **show-me-your-work** skill. figure-it-out's work is usually ambitious enough to commit the trail so the reviewer can read it in the PR. The trail plus the diff is what lets the human come back and trust the work.
49
+
50
+ ## Phase E: Verify and hand back
51
+
52
+ Check the whole against the Phase A predicate on the real product, not just the harness. Encode any recurring correction as a gate, a lint rule, a check, or a script (the **encode-lessons-in-structure** principle skill).
53
+
54
+ **Reply:** the playbook you designed, the rigor level and why, the decision-trail path, what's verified against the predicate, and what's still open.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: how
3
+ description: Use for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which package owns this", "is this the right layer"). Explains subsystem architecture, runtime flow, onboarding mental models. Use why for motivation.
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
+ # How
10
+
11
+ Explore the codebase to answer "how does X work?" questions. Produce architectural explanations at the level of a senior engineer onboarding onto a subsystem, enough to build a working mental model, not so much that it reads like annotated source code.
12
+
13
+ Every spawn is a `pstack_subagent` call with `agent: "general"`; tell it not to edit files. Explorers pass `role: "how explorer"` and every explainer passes `role: "how explainer"`; the tool resolves each from `~/.dsh/pstack-models.md`. When the file or line is missing, the child inherits the parent model.
14
+
15
+ ## 1. Assess complexity
16
+
17
+ If the scope is ambiguous, state your interpretation and explore. The user can redirect.
18
+
19
+ - **Simple** (a single module, a small utility, a narrow question such as "how does function X work"): no explorers. Spawn one explainer that explores and explains in one pass, built from `references/explainer-prompt.md` without the explorer-findings section. Go to step 4.
20
+ - **Complex** (a subsystem spanning multiple files or services, a cross-cutting feature, a full architectural overview): go to step 2.
21
+
22
+ When in doubt, take the simple path.
23
+
24
+ ## 2. Explore (complex only)
25
+
26
+ Decompose the question into 2 to 4 angles, each a distinct slice of the subsystem. Spawn all explorers in a single message, each with `references/explorer-prompt.md` and its angle filled in.
27
+
28
+ ## 3. Synthesize (complex only)
29
+
30
+ Once all explorers have returned, spawn one explainer with `references/explainer-prompt.md` and every explorer's findings filled in.
31
+
32
+ ## 4. Present
33
+
34
+ Present the explainer's output. Light edits for clarity or context from the conversation are fine. Do not substantially rewrite it.
35
+
36
+ ## Output format
37
+
38
+ The explanation uses the sections defined in `references/explainer-prompt.md`, dropping any that do not apply: Overview, Key Concepts, How It Works, Where Things Live, Gotchas.
@@ -0,0 +1,55 @@
1
+ # Explainer Prompt Template
2
+
3
+ Build the explainer subagent's prompt from this template. Fill in the placeholders.
4
+
5
+ ---
6
+
7
+ You are writing an architectural explanation for a senior engineer. Multiple explorer agents have traced different slices of the codebase in parallel and gathered findings. Synthesize their findings into one coherent, well-structured explanation.
8
+
9
+ ## Original Question
10
+
11
+ > {QUESTION}
12
+
13
+ ## Explorer Findings
14
+
15
+ {EXPLORER_FINDINGS_ALL}
16
+
17
+ ## Instructions
18
+
19
+ The explorers each investigated a different angle of the same subsystem. Their findings will overlap in places and may occasionally contradict. Reconcile them. Merge overlapping descriptions, resolve contradictions by checking the code yourself, and combine the separate slices into a unified picture.
20
+
21
+ Write an explanation a senior engineer unfamiliar with this area could read and walk away with a solid mental model, understanding the architecture well enough to start working in it confidently.
22
+
23
+ You have read-only access to the codebase to check anything, clarify a detail, or fill a gap. Use Read, `grep`, and `glob` as needed. The explorers did the work, so you shouldn't need to re-explore from scratch.
24
+
25
+ ## Output Format
26
+
27
+ Use this structure, adapted to what makes sense for the question. Not every section is needed for every question.
28
+
29
+ ### Overview
30
+ 1-2 paragraphs. What is this thing, what does it do, why does it exist. Someone should be able to read just this and decide whether to keep reading.
31
+
32
+ ### Key Concepts
33
+ The important types, services, or abstractions needed to follow the rest. Brief definitions, not exhaustive.
34
+
35
+ ### How It Works
36
+ The core of the explanation, and the longest section. Walk through the flow: what triggers it, what happens step by step, where data goes, what the decision points are.
37
+
38
+ Use prose, not pseudocode. Reference specific files and functions so the reader knows where to look, but don't dump large code blocks unless a snippet is essential to a point.
39
+
40
+ When the flow involves multiple components talking to each other, or data transforming through stages, include a diagram. Use mermaid (```mermaid) for structured flows (sequence diagrams, flowcharts, component graphs) or ASCII art for simpler relationships where mermaid would be overkill. Use your judgment. A diagram should clarify, not decorate. If prose covers the flow, skip the diagram.
41
+
42
+ ### Where Things Live
43
+ A brief file/directory map. Just the ones someone would need to start working here.
44
+
45
+ ### Gotchas
46
+ Non-obvious things, surprising behavior, historical context, pitfalls. Skip this section if there's nothing worth calling out.
47
+
48
+ ## Communication Style
49
+
50
+ - Use concrete language, not abstractions-about-abstractions
51
+ - Say "the `UserService` calls `AuthClient.refresh()`" not "the service delegates to the client"
52
+ - When something is complex, explain why it's complex. Don't just describe the complexity
53
+ - When something is simple, don't pad it out
54
+ - If there's a helpful analogy, use it. If there isn't, don't force one
55
+ - If the explorers flagged open questions or gaps, acknowledge them rather than hiding them
@@ -0,0 +1,35 @@
1
+ # Explorer Prompt Template
2
+
3
+ Build each explorer subagent's prompt from this template. Fill in the placeholders.
4
+
5
+ ---
6
+
7
+ Other explorers are investigating different slices of the same subsystem in parallel. Don't try to cover everything. Focus on your assigned angle and go deep.
8
+
9
+ ## Question
10
+
11
+ > {QUESTION}
12
+
13
+ ## Your Exploration Angle
14
+
15
+ {EXPLORATION_ANGLE}
16
+
17
+ ## Output
18
+
19
+ ### Components Found
20
+ The key types, services, classes, and abstractions. For each: name, file path, and a one-sentence description of what it does.
21
+
22
+ ### Flow
23
+ The execution flow step by step. For each step: what function/method runs, what file it's in, what it does, what it calls next. Include the data that flows between steps.
24
+
25
+ ### Files Read
26
+ Every file you read during exploration, so the explainer can reference them.
27
+
28
+ ### Boundaries
29
+ Where this subsystem connects to other parts of the codebase. The inputs and outputs.
30
+
31
+ ### Non-Obvious Things
32
+ Anything surprising, historically motivated, or easy to get wrong. Things that look like they should work one way but work another.
33
+
34
+ ### Open Questions
35
+ Anything you couldn't fully trace or understand. Be honest about gaps.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: in-your-own-words
3
+ description: Restate in your own words what you think the user's goals are and what problem they're trying to solve. Use for /in-your-own-words.
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
+ Restate in your own words what you think the user's goals are and what problem they're trying to solve.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: interrogate
3
+ description: Use for "interrogate", "adversarial review", "multi-model review", "challenge this", "stress test this code", "find blind spots", or "tear this apart". Multiple LLM reviewers challenge changes from independent angles.
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
+ # Interrogate
10
+
11
+ Spawn one reviewer per configured model to adversarially review code changes. The adversarial signal comes from model diversity, not assigned personas. The deliverable is a synthesized verdict. Do NOT auto-apply changes.
12
+
13
+ ## Step 1, Scope
14
+
15
+ Identify what to review from context:
16
+
17
+ - If the user points at specific files or a diff, use that.
18
+ - If on a feature branch, run `git diff main...HEAD` (or the appropriate base branch) for the full changeset.
19
+ - If the user's message references recent work, gather the relevant files.
20
+
21
+ Package the diff or file contents with any surrounding context files the reviewers need to understand the code.
22
+
23
+ ## Step 2, Intent
24
+
25
+ Before spawning reviewers, state the intent in one clear paragraph from the user's message, commit messages, the PR description if one exists, and the code. If you're unsure about the intent, ask the user before proceeding.
26
+
27
+ ## Step 3, Spawn Reviewers
28
+
29
+ Launch all reviewers in a single message with `pstack_subagent`, one per entry on the `interrogate reviewers` line in `~/.dsh/pstack-models.md`, labeled Reviewer A, B, and so on to match the entry count. Pass `agent: "general"` and `role: "interrogate reviewers"`. If the file or line is missing, use the parent model and say so.
30
+
31
+ Each reviewer gets `agent: "general"` and `role: "interrogate reviewers"`, and is told not to edit files. DSH routes each panel entry independently; an `inherit-parent` entry runs on the parent model. If a configured route is unavailable, run that reviewer on the parent model and say so. Do not block the review on the route issue.
32
+
33
+ Read `references/reviewer-prompt.md` and fill in the same template for every reviewer with the stated intent, the diff or file contents, the rubric from `references/rubric.md`, and the code-quality lens from `references/code-quality-review.md`. Pick each subagent's reasoning level and fast or standard speed for the job, per the Subagents section of the **poteto-mode** skill.
34
+
35
+ ## Step 4, Synthesize
36
+
37
+ As results come back, build a unified picture. Parse every reviewer's findings. Merge findings that describe the same issue differently, and note which models raised each one. Findings two or more models raised independently are the highest signal. Read a lone model's finding, but weight it accordingly. Note disagreements. If one model flags something and another explicitly says the opposite, that is context for the verdict.
38
+
39
+ ## Step 5, Lead Judgment
40
+
41
+ You are the lead reviewer, a pragmatic senior engineer, not a neutral aggregator. Read `references/lead-judgment.md` for the full framework. Put every finding in one of four buckets, with the model(s) that raised it and a one-line rationale.
42
+
43
+ - **Act on**. Real issues affecting correctness, security, or maintainability given the actual goals. They would block a real PR.
44
+ - **Consider**. Legitimate, but you're not sure they outweigh the cost of addressing them now. Worth the user's attention.
45
+ - **Noted**. Technically valid but not actionable. Context-dependent, premature optimization, or low-impact at this stage.
46
+ - **Dismissed**. Wrong, nitpicky, or missing context, with a brief reason.
47
+
48
+ ## Output Format
49
+
50
+ ### Intent
51
+ > [The stated intent paragraph from Step 2]
52
+
53
+ ### Reviewers
54
+ - Reviewer [label]: [model name], [N findings] (one bullet per reviewer)
55
+
56
+ ### Act On
57
+ [Each: description, which models raised it, why it matters.]
58
+
59
+ ### Consider
60
+ [Each: description, which models raised it, the tradeoff.]
61
+
62
+ ### Noted
63
+ [Brief list.]
64
+
65
+ ### Dismissed
66
+ [Each with a brief rationale.]
67
+
68
+ ### Agreement Map
69
+ [Where models agreed and diverged, and what that pattern tells us.]
@@ -0,0 +1,47 @@
1
+ # Code Quality Review
2
+
3
+ Each reviewer applies this code-quality lens in addition to the rubric. It is a strict standard focused on implementation quality, maintainability, abstraction quality, and codebase health.
4
+
5
+ Above all, be ambitious about code structure. Do not merely identify local cleanup. Actively search for "code judo" moves, restructurings that preserve behavior while making the implementation dramatically simpler, smaller, more direct, and more elegant.
6
+
7
+ ## Core Prompt
8
+
9
+ Start from this baseline:
10
+
11
+ > Perform a deep code quality audit of the current branch's changes.
12
+ > Rethink how to structure / implement the changes to meaningfully improve code quality without impacting behavior.
13
+ > Work to improve abstractions, modularity, reduce Spaghetti code, improve succinctness and legibility.
14
+ > Be ambitious, if there is a clear path to improving the implementation that involves restructuring some of the codebase, go for it.
15
+ > Be extremely thorough and rigorous. Measure twice, cut once.
16
+
17
+ ## Dimensions
18
+
19
+ Each dimension is stated once. Apply the ones that are relevant.
20
+
21
+ 0. **Be ambitious about structural simplification.** Do not stop at "this could be a bit cleaner." Look for reframings that make whole branches, helpers, modes, conditionals, or layers disappear. Assume a "code judo" move is often available. It uses the existing architecture more effectively and makes the change dramatically simpler. If you can delete complexity rather than rearrange it, push hard for that.
22
+
23
+ 1. **Do not let a PR push a file from under 1k lines to over 1k lines without a very strong reason.** Treat this as a strong smell. Prefer extracting helpers, subcomponents, or modules. If the diff crosses that threshold, ask whether the code should be decomposed first. Waive only for a compelling structural reason where the resulting file stays clearly organized.
24
+
25
+ 2. **Do not allow spaghetti growth in existing code.** Be suspicious of new ad-hoc conditionals, scattered special cases, or one-off branches inserted into unrelated flows. Treat "weird if statements in random places" as a design problem, not a style nit. Prefer pushing the logic into a dedicated helper, state machine, or module instead of tangling an existing path.
26
+
27
+ 3. **Bias toward cleaning the design, not just accepting working code.** If behavior can stay the same while the structure becomes meaningfully cleaner, push for the cleaner version. Prefer simplifications that remove moving pieces over refactors that spread the same complexity around.
28
+
29
+ 4. **Prefer direct, boring, maintainable code over hacky or magical code.** Treat brittle, ad-hoc, or "magic" behavior as a problem. Be skeptical of generic mechanisms that hide simple data-shape assumptions. Flag thin abstractions, identity wrappers, or pass-through helpers that add indirection without buying clarity.
30
+
31
+ 5. **Push on type and boundary cleanliness when it affects maintainability.** Question unnecessary optionality, `unknown`, `any`, or cast-heavy code when a clearer type boundary could exist. Prefer explicit typed models over loosely-shaped ad-hoc objects. If a branch leans on a silent fallback to paper over an unclear invariant, ask whether the boundary should be made explicit.
32
+
33
+ 6. **Keep logic in the canonical layer and reuse existing helpers.** Call out feature logic leaking into shared paths or implementation details leaking through APIs. Prefer existing canonical utilities over bespoke one-offs. Push code toward the right package, service, or module instead of normalizing drift.
34
+
35
+ 7. **Treat unnecessary sequential orchestration and non-atomic updates as design smells when the cleaner structure is obvious.** If independent work is serialized for no reason, ask whether it should run in parallel. If related updates can leave state half-applied, push for a more atomic structure. Do not over-index on micro-optimizations, but do flag avoidable orchestration complexity that makes the code more brittle.
36
+
37
+ ## Output Expectations
38
+
39
+ Prioritize structural code-quality regressions and missed simplifications first, then spaghetti and branching complexity, then boundary, type, and file-size concerns, then smaller modularity and legibility issues.
40
+
41
+ ## Approval Bar
42
+
43
+ Do not approve merely because behavior seems correct. Treat these as presumptive blockers unless the author can justify them: the PR keeps a lot of incidental complexity when a code-judo move would delete it. Pushes a file from below 1000 lines to above 1000 lines. Adds ad-hoc branching that tangles an existing flow. Scatters feature checks across shared code. Adds an unnecessary abstraction, wrapper, or cast-heavy contract, or duplicates an existing helper or puts logic in the wrong layer when there is a clear canonical home. If those conditions are not met, leave explicit, actionable feedback and push for a cleaner decomposition.
44
+
45
+ ## Review Tone
46
+
47
+ Be direct, serious, and demanding about quality. Do not be rude, but do not soften major maintainability issues into mild suggestions. If the code is making the codebase messier, say so. If the implementation missed an obvious dramatic simplification, say that too. Do not be satisfied with "maybe rename this" when the real issue is structural.
@@ -0,0 +1,39 @@
1
+ # Lead Judgment Framework
2
+
3
+ ## Filtering Principles
4
+
5
+ ### Nitpick Gravity
6
+
7
+ Reviewers, especially adversarial ones, tend to fill their review. If they don't find critical issues, they'll inflate nits to fill the space. If a reviewer's findings are all nits and style preferences, the code is probably fine. Say so.
8
+
9
+ ### Hypothetical vs. Actual
10
+
11
+ "What if someone passes null here?" is only a finding if the caller can actually pass null. Trace the call site. If the input is validated upstream or the type system prevents it, dismiss the finding. Reviewers working from a diff can't always see the full call chain. You can.
12
+
13
+ ### Premature Abstraction Warnings
14
+
15
+ Reviewers often suggest extracting functions, adding interfaces, or creating abstractions. Does this code need to change in a second way? If not, the abstraction is premature. Simple inline code that works beats a clean abstraction that's overkill for the current scope.
16
+
17
+ ### "I Would Have Done It Differently"
18
+
19
+ This is the most common false positive in code review. A finding that amounts to "I prefer a different approach" is not a bug, not a design flaw, and not actionable unless the reviewer shows a concrete problem with the current approach. Dismiss these, and say why.
20
+
21
+ ### Missing Context Signals
22
+
23
+ Watch for findings that reveal the reviewer didn't understand the context:
24
+ - Suggesting changes to code the author didn't write or modify
25
+ - Flagging patterns that are consistent with the rest of the codebase (the reviewer just doesn't know that)
26
+ - Recommending approaches that conflict with constraints you know about
27
+
28
+ These are honest mistakes from reviewers working with limited information. Dismiss them gracefully.
29
+
30
+ ## When Reviewers Are Right
31
+
32
+ Don't dismiss findings just because they're uncomfortable. The whole point of adversarial review is to catch things you'd miss. Signs a finding deserves attention:
33
+
34
+ - Multiple models flag the same issue independently (consensus signal)
35
+ - The finding identifies a concrete execution path, not a hypothetical
36
+ - The finding reveals a gap in your mental model of the code
37
+ - You read the finding and think "...yeah, actually"
38
+
39
+ Be especially careful about dismissing security findings and correctness bugs. These deserve more scrutiny even when they come from a single model.
@@ -0,0 +1,62 @@
1
+ # Reviewer Prompt Template
2
+
3
+ Build each reviewer subagent's prompt from this template, filling in the placeholders.
4
+
5
+ ---
6
+
7
+ You are an adversarial code reviewer. Find real problems in the code below: bugs, design flaws, security issues, and maintainability concerns. You are not here to be helpful or encouraging. You are here to stress-test.
8
+
9
+ ## Intent
10
+
11
+ The author's stated intent for this change:
12
+
13
+ > {INTENT}
14
+
15
+ Review whether the code achieves this intent well. Do NOT question the intent itself. Assume the goal is correct and challenge the execution.
16
+
17
+ ## Code Under Review
18
+
19
+ {DIFF_OR_FILES}
20
+
21
+ ## Review Rubric
22
+
23
+ {RUBRIC_CONTENTS}
24
+
25
+ ## Code Quality Lens
26
+
27
+ {CODE_QUALITY_CONTENTS}
28
+
29
+ ## Instructions
30
+
31
+ Review the code through every lens in the rubric and the code-quality lens above that you find relevant. Do not force lenses that don't apply. A simple bug fix does not need paragraphs about architectural integrity.
32
+
33
+ For each finding, provide:
34
+
35
+ 1. **Severity**: `critical` | `warning` | `nit`
36
+ - `critical`: Would cause bugs, data loss, security issues, or fundamentally broken behavior
37
+ - `warning`: Design concern, maintainability risk, or correctness issue that isn't immediately broken but will cause pain
38
+ - `nit`: Style, naming, minor improvement.
39
+ 2. **Finding**: What the problem is, in concrete terms. Reference specific lines/functions.
40
+ 3. **Evidence**: Why you believe this is a problem. Show your reasoning. Don't just assert.
41
+ 4. **Suggestion** (optional): What you'd do instead, only if you have a concrete alternative.
42
+
43
+ A good finding references specific code, not vague concerns ("this could be better"). It distinguishes between "this is broken" and "I would have done this differently". It considers the stated intent. A finding that ignores the context of what's being built is a bad finding.
44
+
45
+ Do not restate what the code does without identifying a problem. Do not praise the code. If you find nothing wrong, say "no findings" and stop. An empty review is a valid outcome.
46
+
47
+ ## Output
48
+
49
+ Return your findings as a structured list:
50
+
51
+ ```
52
+ ## Findings
53
+
54
+ ### 1. [Severity] Short title
55
+ **Location**: file:line or function name
56
+ **Finding**: What's wrong
57
+ **Evidence**: Why this matters
58
+ **Suggestion**: (optional) What to do instead
59
+
60
+ ### 2. [Severity] Short title
61
+ ...
62
+ ```
@@ -0,0 +1,77 @@
1
+ # Review Rubric
2
+
3
+ Review through whichever lenses are relevant. Not every lens applies to every change.
4
+
5
+ ## Correctness
6
+
7
+ Does the code actually do what the intent says it should?
8
+
9
+ - Edge cases: empty inputs, nil/undefined, boundary values, concurrent access
10
+ - Error handling: are errors caught, propagated, or silently swallowed?
11
+ - Off-by-one, type coercion, integer overflow, string encoding
12
+ - State management: race conditions, stale closures, dangling references
13
+ - Do both the happy path and the sad path work?
14
+ - Idempotency: what happens if this operation runs twice, or if a previous run crashed halfway? If the answer is "it depends on what state was left behind," a reconciliation step is missing.
15
+ - Concurrency: if multiple actors can touch the same mutable state (files, branches, shared data), is access serialized structurally (locks, sequential phases, exclusive ownership), or by conventions that won't hold?
16
+
17
+ When you find a potential bug, trace the execution path. Don't just flag "this could be nil". Show the call chain that makes it nil.
18
+
19
+ ## Root Causes vs. Symptoms
20
+
21
+ Is the code fixing the actual problem or papering over a symptom?
22
+
23
+ Answering this often requires looking beyond the changed files. Read the surrounding code (callers, callees, type definitions, sibling modules) and understand the architecture the change lives in. Use the tools available to you (Read, `grep`, `glob`) to follow the call chain, read the types, and understand why the code exists before judging whether the change addresses the right layer.
24
+
25
+ - Guard clauses that mask a deeper invariant violation
26
+ - Retry logic that hides a broken contract
27
+ - Type casts that silence a modeling error
28
+ - A workaround: why is it needed? What would a proper fix look like?
29
+ - A fix in module A that should really be a fix in module B's contract
30
+ - Instructions where structure would be better: if the fix is a comment saying "don't do X" or a convention someone has to remember, ask whether it could instead be a type constraint, a lint rule, or a runtime check that makes the wrong thing impossible
31
+
32
+ ## Structural Integrity
33
+
34
+ Does the code fit well into the system it's part of?
35
+
36
+ - Boundary discipline: is validation at system boundaries, or scattered through business logic? Validate data once where it enters the system, then trust it internally.
37
+ - Abstraction level: is the code mixing high-level orchestration with low-level detail?
38
+ - Coupling: does this change introduce dependencies that will make future changes harder?
39
+ - Data model fit: do the data structures match the actual access patterns?
40
+ - Bolted-on vs. integrated: if the new requirement had been known from the start, would the code look like this, or does the change feel patched onto the existing design?
41
+ - Legacy dual-paths: does the change introduce a new API while keeping the old one alive? If there are no external consumers, migrate callers and delete the old path in the same wave. Don't leave compatibility layers that will become permanent.
42
+
43
+ Don't penalize simple code for lacking abstraction. Premature abstraction is worse than duplication.
44
+
45
+ ## Verification
46
+
47
+ Can you tell that this code works from reading it?
48
+
49
+ - Are there tests? Do they test behavior or implementation details?
50
+ - Are there assertions/invariants that would catch regressions?
51
+ - If this is a bug fix: is there a test for the bug?
52
+ - If this touches an integration boundary: is the full path tested?
53
+ - Check the real thing, not a proxy. If the code checks liveness via file mtime or cached state instead of reading the actual value, that's a verification gap.
54
+ - For delegated or async work: does the code verify actual output artifacts, or does it trust self-reports and summaries?
55
+
56
+ ## Complexity Budget
57
+
58
+ Is the complexity justified by what the code accomplishes?
59
+
60
+ - Code that could be simpler without losing correctness or clarity
61
+ - Abstractions that serve only one call site
62
+ - Configuration or parameterization for cases that don't exist yet
63
+ - Dead code, unused imports, vestigial parameters
64
+ - Over-engineering: "just in case" code paths with no current callers
65
+ - Obsolete compatibility paths kept alive for transitional stability that's no longer needed. If the migration is done, delete the scaffolding
66
+ - Does the user experience justify the complexity? Every feature, control, and option should earn its place. Half-finished features are worse than missing ones.
67
+
68
+ Simpler is better unless simpler is wrong.
69
+
70
+ ## Security
71
+
72
+ For each security finding, trace the input path through the code and show it.
73
+
74
+ - User input flowing to dangerous sinks (SQL, shell, eval, innerHTML) without sanitization
75
+ - Authentication/authorization gaps in new endpoints
76
+ - Secrets in code, logs, or error messages
77
+ - TOCTOU (time-of-check-time-of-use) in security-critical paths