@draht/coding-agent 2026.7.30 → 2026.9.5-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (459) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/README.md +46 -2
  3. package/agents/debugger.md +12 -1
  4. package/agents/git-committer.md +1 -0
  5. package/agents/implementer.md +20 -0
  6. package/agents/investigator.md +75 -0
  7. package/agents/reviewer.md +7 -0
  8. package/agents/spec-reviewer.md +66 -0
  9. package/agents/verifier.md +4 -3
  10. package/bin/draht-tools.cjs +472 -41
  11. package/dist/agents/debugger.md +12 -1
  12. package/dist/agents/git-committer.md +1 -0
  13. package/dist/agents/implementer.md +20 -0
  14. package/dist/agents/investigator.md +75 -0
  15. package/dist/agents/reviewer.md +7 -0
  16. package/dist/agents/spec-reviewer.md +66 -0
  17. package/dist/agents/verifier.md +4 -3
  18. package/dist/cli/args.d.ts +10 -0
  19. package/dist/cli/args.d.ts.map +1 -1
  20. package/dist/cli/args.js +69 -2
  21. package/dist/cli/args.js.map +1 -1
  22. package/dist/cli/attach-mode.d.ts +61 -0
  23. package/dist/cli/attach-mode.d.ts.map +1 -1
  24. package/dist/cli/attach-mode.js +243 -5
  25. package/dist/cli/attach-mode.js.map +1 -1
  26. package/dist/cli/credential-print.d.ts +1 -1
  27. package/dist/cli/credential-print.d.ts.map +1 -1
  28. package/dist/cli/credential-print.js +5 -4
  29. package/dist/cli/credential-print.js.map +1 -1
  30. package/dist/config.d.ts +9 -0
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/config.js +31 -4
  33. package/dist/config.js.map +1 -1
  34. package/dist/core/agent-session-runtime.d.ts +17 -1
  35. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  36. package/dist/core/agent-session-runtime.js +87 -30
  37. package/dist/core/agent-session-runtime.js.map +1 -1
  38. package/dist/core/agent-session-services.d.ts +1 -1
  39. package/dist/core/agent-session-services.d.ts.map +1 -1
  40. package/dist/core/agent-session-services.js +1 -0
  41. package/dist/core/agent-session-services.js.map +1 -1
  42. package/dist/core/agent-session.d.ts +35 -16
  43. package/dist/core/agent-session.d.ts.map +1 -1
  44. package/dist/core/agent-session.js +149 -64
  45. package/dist/core/agent-session.js.map +1 -1
  46. package/dist/core/auth-storage.d.ts +5 -1
  47. package/dist/core/auth-storage.d.ts.map +1 -1
  48. package/dist/core/auth-storage.js +72 -15
  49. package/dist/core/auth-storage.js.map +1 -1
  50. package/dist/core/builtins/checkpoints.d.ts +20 -0
  51. package/dist/core/builtins/checkpoints.d.ts.map +1 -0
  52. package/dist/core/builtins/checkpoints.js +161 -0
  53. package/dist/core/builtins/checkpoints.js.map +1 -0
  54. package/dist/core/builtins/duet.d.ts +26 -0
  55. package/dist/core/builtins/duet.d.ts.map +1 -0
  56. package/dist/core/builtins/duet.js +660 -0
  57. package/dist/core/builtins/duet.js.map +1 -0
  58. package/dist/core/builtins/index.d.ts.map +1 -1
  59. package/dist/core/builtins/index.js +7 -1
  60. package/dist/core/builtins/index.js.map +1 -1
  61. package/dist/core/builtins/subagent.d.ts +24 -4
  62. package/dist/core/builtins/subagent.d.ts.map +1 -1
  63. package/dist/core/builtins/subagent.js +278 -35
  64. package/dist/core/builtins/subagent.js.map +1 -1
  65. package/dist/core/checkpoints/checkpoint-cli.d.ts +17 -0
  66. package/dist/core/checkpoints/checkpoint-cli.d.ts.map +1 -0
  67. package/dist/core/checkpoints/checkpoint-cli.js +78 -0
  68. package/dist/core/checkpoints/checkpoint-cli.js.map +1 -0
  69. package/dist/core/checkpoints/checkpoint-manager.d.ts +294 -0
  70. package/dist/core/checkpoints/checkpoint-manager.d.ts.map +1 -0
  71. package/dist/core/checkpoints/checkpoint-manager.js +865 -0
  72. package/dist/core/checkpoints/checkpoint-manager.js.map +1 -0
  73. package/dist/core/checkpoints/rewind.d.ts +141 -0
  74. package/dist/core/checkpoints/rewind.d.ts.map +1 -0
  75. package/dist/core/checkpoints/rewind.js +246 -0
  76. package/dist/core/checkpoints/rewind.js.map +1 -0
  77. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  78. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  79. package/dist/core/compaction/branch-summarization.js +9 -4
  80. package/dist/core/compaction/branch-summarization.js.map +1 -1
  81. package/dist/core/compaction/compaction.d.ts +5 -0
  82. package/dist/core/compaction/compaction.d.ts.map +1 -1
  83. package/dist/core/compaction/compaction.js +25 -4
  84. package/dist/core/compaction/compaction.js.map +1 -1
  85. package/dist/core/extensions/index.d.ts +1 -1
  86. package/dist/core/extensions/index.d.ts.map +1 -1
  87. package/dist/core/extensions/index.js.map +1 -1
  88. package/dist/core/extensions/loader.d.ts.map +1 -1
  89. package/dist/core/extensions/loader.js +83 -20
  90. package/dist/core/extensions/loader.js.map +1 -1
  91. package/dist/core/extensions/runner.d.ts +13 -2
  92. package/dist/core/extensions/runner.d.ts.map +1 -1
  93. package/dist/core/extensions/runner.js +37 -2
  94. package/dist/core/extensions/runner.js.map +1 -1
  95. package/dist/core/extensions/types.d.ts +189 -6
  96. package/dist/core/extensions/types.d.ts.map +1 -1
  97. package/dist/core/extensions/types.js.map +1 -1
  98. package/dist/core/http-dispatcher.d.ts.map +1 -1
  99. package/dist/core/http-dispatcher.js +7 -0
  100. package/dist/core/http-dispatcher.js.map +1 -1
  101. package/dist/core/index.d.ts +1 -1
  102. package/dist/core/index.d.ts.map +1 -1
  103. package/dist/core/index.js.map +1 -1
  104. package/dist/core/keybindings.d.ts +5 -0
  105. package/dist/core/keybindings.d.ts.map +1 -1
  106. package/dist/core/keybindings.js +1 -0
  107. package/dist/core/keybindings.js.map +1 -1
  108. package/dist/core/model-registry.d.ts +3 -2
  109. package/dist/core/model-registry.d.ts.map +1 -1
  110. package/dist/core/model-registry.js +8 -8
  111. package/dist/core/model-registry.js.map +1 -1
  112. package/dist/core/model-resolver.d.ts.map +1 -1
  113. package/dist/core/model-resolver.js +34 -7
  114. package/dist/core/model-resolver.js.map +1 -1
  115. package/dist/core/model-runtime.d.ts +7 -1
  116. package/dist/core/model-runtime.d.ts.map +1 -1
  117. package/dist/core/model-runtime.js +30 -10
  118. package/dist/core/model-runtime.js.map +1 -1
  119. package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
  120. package/dist/core/multi-agent/permission-gate.js +4 -3
  121. package/dist/core/multi-agent/permission-gate.js.map +1 -1
  122. package/dist/core/multi-agent/worktree.d.ts +2 -0
  123. package/dist/core/multi-agent/worktree.d.ts.map +1 -1
  124. package/dist/core/multi-agent/worktree.js +2 -2
  125. package/dist/core/multi-agent/worktree.js.map +1 -1
  126. package/dist/core/package-manager.d.ts +7 -1
  127. package/dist/core/package-manager.d.ts.map +1 -1
  128. package/dist/core/package-manager.js +21 -44
  129. package/dist/core/package-manager.js.map +1 -1
  130. package/dist/core/permission-relay/index.d.ts +19 -0
  131. package/dist/core/permission-relay/index.d.ts.map +1 -0
  132. package/dist/core/permission-relay/index.js +49 -0
  133. package/dist/core/permission-relay/index.js.map +1 -0
  134. package/dist/core/permission-relay/relay-ui-context.d.ts +39 -0
  135. package/dist/core/permission-relay/relay-ui-context.d.ts.map +1 -0
  136. package/dist/core/permission-relay/relay-ui-context.js +788 -0
  137. package/dist/core/permission-relay/relay-ui-context.js.map +1 -0
  138. package/dist/core/permission-relay/types.d.ts +222 -0
  139. package/dist/core/permission-relay/types.d.ts.map +1 -0
  140. package/dist/core/permission-relay/types.js +15 -0
  141. package/dist/core/permission-relay/types.js.map +1 -0
  142. package/dist/core/pi-manifest.d.ts +14 -0
  143. package/dist/core/pi-manifest.d.ts.map +1 -0
  144. package/dist/core/pi-manifest.js +35 -0
  145. package/dist/core/pi-manifest.js.map +1 -0
  146. package/dist/core/project-trust.js +2 -2
  147. package/dist/core/project-trust.js.map +1 -1
  148. package/dist/core/resource-loader.d.ts +21 -0
  149. package/dist/core/resource-loader.d.ts.map +1 -1
  150. package/dist/core/resource-loader.js +101 -24
  151. package/dist/core/resource-loader.js.map +1 -1
  152. package/dist/core/sandbox/bash-operations.d.ts +149 -0
  153. package/dist/core/sandbox/bash-operations.d.ts.map +1 -0
  154. package/dist/core/sandbox/bash-operations.js +163 -0
  155. package/dist/core/sandbox/bash-operations.js.map +1 -0
  156. package/dist/core/sandbox/env.d.ts +83 -0
  157. package/dist/core/sandbox/env.d.ts.map +1 -0
  158. package/dist/core/sandbox/env.js +123 -0
  159. package/dist/core/sandbox/env.js.map +1 -0
  160. package/dist/core/sandbox/executor.d.ts +104 -0
  161. package/dist/core/sandbox/executor.d.ts.map +1 -0
  162. package/dist/core/sandbox/executor.js +92 -0
  163. package/dist/core/sandbox/executor.js.map +1 -0
  164. package/dist/core/sandbox/index.d.ts +36 -0
  165. package/dist/core/sandbox/index.d.ts.map +1 -0
  166. package/dist/core/sandbox/index.js +36 -0
  167. package/dist/core/sandbox/index.js.map +1 -0
  168. package/dist/core/sandbox/linux.d.ts +121 -0
  169. package/dist/core/sandbox/linux.d.ts.map +1 -0
  170. package/dist/core/sandbox/linux.js +260 -0
  171. package/dist/core/sandbox/linux.js.map +1 -0
  172. package/dist/core/sandbox/policy.d.ts +142 -0
  173. package/dist/core/sandbox/policy.d.ts.map +1 -0
  174. package/dist/core/sandbox/policy.js +297 -0
  175. package/dist/core/sandbox/policy.js.map +1 -0
  176. package/dist/core/sandbox/real-path.d.ts +112 -0
  177. package/dist/core/sandbox/real-path.d.ts.map +1 -0
  178. package/dist/core/sandbox/real-path.js +158 -0
  179. package/dist/core/sandbox/real-path.js.map +1 -0
  180. package/dist/core/sandbox/seatbelt-profile.d.ts +95 -0
  181. package/dist/core/sandbox/seatbelt-profile.d.ts.map +1 -0
  182. package/dist/core/sandbox/seatbelt-profile.js +239 -0
  183. package/dist/core/sandbox/seatbelt-profile.js.map +1 -0
  184. package/dist/core/sandbox/seatbelt.d.ts +95 -0
  185. package/dist/core/sandbox/seatbelt.d.ts.map +1 -0
  186. package/dist/core/sandbox/seatbelt.js +154 -0
  187. package/dist/core/sandbox/seatbelt.js.map +1 -0
  188. package/dist/core/sandbox/self-test.d.ts +109 -0
  189. package/dist/core/sandbox/self-test.d.ts.map +1 -0
  190. package/dist/core/sandbox/self-test.js +369 -0
  191. package/dist/core/sandbox/self-test.js.map +1 -0
  192. package/dist/core/sandbox/spawn.d.ts +33 -0
  193. package/dist/core/sandbox/spawn.d.ts.map +1 -0
  194. package/dist/core/sandbox/spawn.js +87 -0
  195. package/dist/core/sandbox/spawn.js.map +1 -0
  196. package/dist/core/sdk.d.ts.map +1 -1
  197. package/dist/core/sdk.js +3 -1
  198. package/dist/core/sdk.js.map +1 -1
  199. package/dist/core/session-manager.d.ts +60 -1
  200. package/dist/core/session-manager.d.ts.map +1 -1
  201. package/dist/core/session-manager.js +53 -6
  202. package/dist/core/session-manager.js.map +1 -1
  203. package/dist/core/settings-manager.d.ts +21 -0
  204. package/dist/core/settings-manager.d.ts.map +1 -1
  205. package/dist/core/settings-manager.js +36 -16
  206. package/dist/core/settings-manager.js.map +1 -1
  207. package/dist/core/skills.d.ts +3 -1
  208. package/dist/core/skills.d.ts.map +1 -1
  209. package/dist/core/skills.js +19 -6
  210. package/dist/core/skills.js.map +1 -1
  211. package/dist/core/slash-commands.d.ts.map +1 -1
  212. package/dist/core/slash-commands.js +1 -0
  213. package/dist/core/slash-commands.js.map +1 -1
  214. package/dist/core/soak/soak-log.d.ts +298 -0
  215. package/dist/core/soak/soak-log.d.ts.map +1 -0
  216. package/dist/core/soak/soak-log.js +660 -0
  217. package/dist/core/soak/soak-log.js.map +1 -0
  218. package/dist/core/soak/soak-reader.d.ts +60 -0
  219. package/dist/core/soak/soak-reader.d.ts.map +1 -0
  220. package/dist/core/soak/soak-reader.js +106 -0
  221. package/dist/core/soak/soak-reader.js.map +1 -0
  222. package/dist/core/socket-server/discovery.d.ts +78 -1
  223. package/dist/core/socket-server/discovery.d.ts.map +1 -1
  224. package/dist/core/socket-server/discovery.js +356 -37
  225. package/dist/core/socket-server/discovery.js.map +1 -1
  226. package/dist/core/socket-server/index.d.ts +10 -4
  227. package/dist/core/socket-server/index.d.ts.map +1 -1
  228. package/dist/core/socket-server/index.js +6 -3
  229. package/dist/core/socket-server/index.js.map +1 -1
  230. package/dist/core/socket-server/permission-delivery.d.ts +125 -0
  231. package/dist/core/socket-server/permission-delivery.d.ts.map +1 -0
  232. package/dist/core/socket-server/permission-delivery.js +152 -0
  233. package/dist/core/socket-server/permission-delivery.js.map +1 -0
  234. package/dist/core/socket-server/permission-registry.d.ts +301 -0
  235. package/dist/core/socket-server/permission-registry.d.ts.map +1 -0
  236. package/dist/core/socket-server/permission-registry.js +410 -0
  237. package/dist/core/socket-server/permission-registry.js.map +1 -0
  238. package/dist/core/socket-server/permission-relay.d.ts +81 -0
  239. package/dist/core/socket-server/permission-relay.d.ts.map +1 -0
  240. package/dist/core/socket-server/permission-relay.js +528 -0
  241. package/dist/core/socket-server/permission-relay.js.map +1 -0
  242. package/dist/core/socket-server/safe-text.d.ts +83 -0
  243. package/dist/core/socket-server/safe-text.d.ts.map +1 -0
  244. package/dist/core/socket-server/safe-text.js +277 -0
  245. package/dist/core/socket-server/safe-text.js.map +1 -0
  246. package/dist/core/socket-server/session-integration.d.ts +65 -2
  247. package/dist/core/socket-server/session-integration.d.ts.map +1 -1
  248. package/dist/core/socket-server/session-integration.js +434 -32
  249. package/dist/core/socket-server/session-integration.js.map +1 -1
  250. package/dist/core/socket-server/socket-client.d.ts +21 -2
  251. package/dist/core/socket-server/socket-client.d.ts.map +1 -1
  252. package/dist/core/socket-server/socket-client.js +52 -1
  253. package/dist/core/socket-server/socket-client.js.map +1 -1
  254. package/dist/core/socket-server/socket-server.d.ts +152 -1
  255. package/dist/core/socket-server/socket-server.d.ts.map +1 -1
  256. package/dist/core/socket-server/socket-server.js +775 -26
  257. package/dist/core/socket-server/socket-server.js.map +1 -1
  258. package/dist/core/socket-server/types.d.ts +106 -2
  259. package/dist/core/socket-server/types.d.ts.map +1 -1
  260. package/dist/core/socket-server/types.js +13 -1
  261. package/dist/core/socket-server/types.js.map +1 -1
  262. package/dist/core/system-prompt.d.ts.map +1 -1
  263. package/dist/core/system-prompt.js +8 -9
  264. package/dist/core/system-prompt.js.map +1 -1
  265. package/dist/core/tools/bash.d.ts +1 -1
  266. package/dist/core/tools/bash.d.ts.map +1 -1
  267. package/dist/core/tools/bash.js +5 -2
  268. package/dist/core/tools/bash.js.map +1 -1
  269. package/dist/core/tools/edit.d.ts.map +1 -1
  270. package/dist/core/tools/edit.js +17 -2
  271. package/dist/core/tools/edit.js.map +1 -1
  272. package/dist/core/tools/find.d.ts +3 -0
  273. package/dist/core/tools/find.d.ts.map +1 -1
  274. package/dist/core/tools/find.js +11 -18
  275. package/dist/core/tools/find.js.map +1 -1
  276. package/dist/core/trust-manager.d.ts +6 -4
  277. package/dist/core/trust-manager.d.ts.map +1 -1
  278. package/dist/core/trust-manager.js +55 -21
  279. package/dist/core/trust-manager.js.map +1 -1
  280. package/dist/extensions/index.d.ts.map +1 -1
  281. package/dist/extensions/index.js +5 -1
  282. package/dist/extensions/index.js.map +1 -1
  283. package/dist/extensions/llama/provider.d.ts.map +1 -1
  284. package/dist/extensions/llama/provider.js +5 -1
  285. package/dist/extensions/llama/provider.js.map +1 -1
  286. package/dist/extensions/stub-provider/index.d.ts +9 -0
  287. package/dist/extensions/stub-provider/index.d.ts.map +1 -0
  288. package/dist/extensions/stub-provider/index.js +13 -0
  289. package/dist/extensions/stub-provider/index.js.map +1 -0
  290. package/dist/extensions/stub-provider/provider.d.ts +77 -0
  291. package/dist/extensions/stub-provider/provider.d.ts.map +1 -0
  292. package/dist/extensions/stub-provider/provider.js +193 -0
  293. package/dist/extensions/stub-provider/provider.js.map +1 -0
  294. package/dist/hooks/gsd/draht-quality-gate.js +3 -3
  295. package/dist/index.d.ts +1 -1
  296. package/dist/index.d.ts.map +1 -1
  297. package/dist/index.js.map +1 -1
  298. package/dist/main.d.ts.map +1 -1
  299. package/dist/main.js +242 -45
  300. package/dist/main.js.map +1 -1
  301. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  302. package/dist/modes/interactive/components/config-selector.js +3 -2
  303. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  304. package/dist/modes/interactive/components/extension-selector.d.ts +49 -0
  305. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  306. package/dist/modes/interactive/components/extension-selector.js +202 -5
  307. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  308. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  309. package/dist/modes/interactive/components/session-selector.js +10 -2
  310. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  311. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  312. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  313. package/dist/modes/interactive/components/settings-selector.js +10 -0
  314. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  315. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  316. package/dist/modes/interactive/components/tool-execution.js +10 -1
  317. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  318. package/dist/modes/interactive/components/tree-selector.d.ts +20 -2
  319. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  320. package/dist/modes/interactive/components/tree-selector.js +21 -5
  321. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  322. package/dist/modes/interactive/interactive-mode.d.ts +97 -3
  323. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  324. package/dist/modes/interactive/interactive-mode.js +394 -24
  325. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  326. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  327. package/dist/modes/rpc/rpc-mode.js +165 -7
  328. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  329. package/dist/modes/rpc/rpc-types.d.ts +68 -1
  330. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  331. package/dist/modes/rpc/rpc-types.js.map +1 -1
  332. package/dist/prompts/commands/atomic-commit.md +1 -12
  333. package/dist/prompts/commands/brainstorm.md +12 -15
  334. package/dist/prompts/commands/create-verification-skill.md +108 -0
  335. package/dist/prompts/commands/discuss-phase.md +3 -14
  336. package/dist/prompts/commands/execute-phase.md +3 -11
  337. package/dist/prompts/commands/fix.md +41 -18
  338. package/dist/prompts/commands/grill.md +66 -0
  339. package/dist/prompts/commands/init-project.md +5 -15
  340. package/dist/prompts/commands/map-codebase.md +1 -13
  341. package/dist/prompts/commands/new-project.md +5 -15
  342. package/dist/prompts/commands/next-milestone.md +1 -13
  343. package/dist/prompts/commands/orchestrate.md +1 -1
  344. package/dist/prompts/commands/pause-work.md +1 -13
  345. package/dist/prompts/commands/plan-phase.md +2 -11
  346. package/dist/prompts/commands/progress.md +0 -13
  347. package/dist/prompts/commands/quick.md +3 -11
  348. package/dist/prompts/commands/resolve-conflicts.md +71 -0
  349. package/dist/prompts/commands/resume-work.md +0 -13
  350. package/dist/prompts/commands/review.md +4 -13
  351. package/dist/prompts/commands/triage.md +159 -0
  352. package/dist/prompts/commands/verify-work.md +4 -14
  353. package/dist/prompts/commands/why.md +135 -0
  354. package/dist/skills/atomic-reasoning/SKILL.md +115 -0
  355. package/dist/skills/blast-radius/SKILL.md +55 -0
  356. package/dist/skills/epistemics/SKILL.md +99 -0
  357. package/dist/skills/hexagon-animation/SKILL.md +49 -0
  358. package/dist/skills/hexagon-animation/generate.mjs +81 -0
  359. package/dist/skills/hexagon-animation/template.html +361 -0
  360. package/dist/skills/typescript-discipline/SKILL.md +50 -0
  361. package/dist/skills/typescript-discipline/references/patterns.md +294 -0
  362. package/dist/skills/unslop/SKILL.md +101 -0
  363. package/dist/utils/canonical-path.d.ts +28 -0
  364. package/dist/utils/canonical-path.d.ts.map +1 -0
  365. package/dist/utils/canonical-path.js +90 -0
  366. package/dist/utils/canonical-path.js.map +1 -0
  367. package/dist/utils/child-process.d.ts +12 -1
  368. package/dist/utils/child-process.d.ts.map +1 -1
  369. package/dist/utils/child-process.js +25 -8
  370. package/dist/utils/child-process.js.map +1 -1
  371. package/dist/utils/clipboard.d.ts +1 -1
  372. package/dist/utils/clipboard.d.ts.map +1 -1
  373. package/dist/utils/clipboard.js +22 -2
  374. package/dist/utils/clipboard.js.map +1 -1
  375. package/dist/utils/exif-orientation.d.ts.map +1 -1
  376. package/dist/utils/exif-orientation.js +2 -3
  377. package/dist/utils/exif-orientation.js.map +1 -1
  378. package/dist/utils/paths.d.ts +2 -7
  379. package/dist/utils/paths.d.ts.map +1 -1
  380. package/dist/utils/paths.js +13 -15
  381. package/dist/utils/paths.js.map +1 -1
  382. package/dist/utils/shell.d.ts.map +1 -1
  383. package/dist/utils/shell.js +6 -4
  384. package/dist/utils/shell.js.map +1 -1
  385. package/dist/utils/tools-manager.d.ts.map +1 -1
  386. package/dist/utils/tools-manager.js +3 -5
  387. package/dist/utils/tools-manager.js.map +1 -1
  388. package/docs/attachable-sessions.md +79 -0
  389. package/docs/compaction.md +21 -21
  390. package/docs/containerization.md +23 -23
  391. package/docs/custom-provider.md +16 -16
  392. package/docs/development.md +9 -9
  393. package/docs/docs.json +6 -2
  394. package/docs/duet.md +42 -0
  395. package/docs/extensions.md +58 -58
  396. package/docs/index.md +10 -10
  397. package/docs/json.md +7 -7
  398. package/docs/keybindings.md +6 -5
  399. package/docs/llama-cpp.md +6 -6
  400. package/docs/models.md +6 -6
  401. package/docs/packages.md +43 -43
  402. package/docs/prompt-templates.md +4 -4
  403. package/docs/providers.md +12 -12
  404. package/docs/quickstart.md +32 -32
  405. package/docs/rpc.md +83 -12
  406. package/docs/sdk.md +15 -15
  407. package/docs/security.md +18 -18
  408. package/docs/session-format.md +35 -13
  409. package/docs/sessions.md +17 -14
  410. package/docs/settings.md +25 -18
  411. package/docs/shell-aliases.md +2 -2
  412. package/docs/skills.md +12 -11
  413. package/docs/terminal-setup.md +12 -12
  414. package/docs/termux.md +6 -6
  415. package/docs/themes.md +11 -11
  416. package/docs/tmux.md +4 -4
  417. package/docs/tui.md +5 -5
  418. package/docs/usage.md +50 -50
  419. package/docs/windows.md +2 -2
  420. package/examples/extensions/overlay-qa-tests.ts +3 -3
  421. package/hooks/gsd/draht-quality-gate.js +3 -3
  422. package/package.json +11 -10
  423. package/prompts/commands/atomic-commit.md +1 -12
  424. package/prompts/commands/brainstorm.md +12 -15
  425. package/prompts/commands/create-verification-skill.md +108 -0
  426. package/prompts/commands/discuss-phase.md +3 -14
  427. package/prompts/commands/execute-phase.md +3 -11
  428. package/prompts/commands/fix.md +41 -18
  429. package/prompts/commands/grill.md +66 -0
  430. package/prompts/commands/init-project.md +5 -15
  431. package/prompts/commands/map-codebase.md +1 -13
  432. package/prompts/commands/new-project.md +5 -15
  433. package/prompts/commands/next-milestone.md +1 -13
  434. package/prompts/commands/orchestrate.md +1 -1
  435. package/prompts/commands/pause-work.md +1 -13
  436. package/prompts/commands/plan-phase.md +2 -11
  437. package/prompts/commands/progress.md +0 -13
  438. package/prompts/commands/quick.md +3 -11
  439. package/prompts/commands/resolve-conflicts.md +71 -0
  440. package/prompts/commands/resume-work.md +0 -13
  441. package/prompts/commands/review.md +4 -13
  442. package/prompts/commands/triage.md +159 -0
  443. package/prompts/commands/verify-work.md +4 -14
  444. package/prompts/commands/why.md +135 -0
  445. package/skills/atomic-reasoning/SKILL.md +115 -0
  446. package/skills/blast-radius/SKILL.md +55 -0
  447. package/skills/epistemics/SKILL.md +99 -0
  448. package/skills/hexagon-animation/SKILL.md +49 -0
  449. package/skills/hexagon-animation/generate.mjs +81 -0
  450. package/skills/hexagon-animation/template.html +361 -0
  451. package/skills/typescript-discipline/SKILL.md +50 -0
  452. package/skills/typescript-discipline/references/patterns.md +294 -0
  453. package/skills/unslop/SKILL.md +101 -0
  454. package/dist/prompts/agents/build.md +0 -86
  455. package/dist/prompts/agents/plan.md +0 -79
  456. package/dist/prompts/agents/verify.md +0 -69
  457. package/prompts/agents/build.md +0 -86
  458. package/prompts/agents/plan.md +0 -79
  459. package/prompts/agents/verify.md +0 -69
@@ -18,25 +18,13 @@ For greenfield projects, use `/new-project` instead.
18
18
 
19
19
  ## Atomic Reasoning
20
20
 
21
- Before initializing, decompose project understanding into atomic reasoning units:
22
-
23
- **For each aspect of the existing project:**
24
- 1. **State the logical component** — What does this project do? Who are the users? What problems does it solve?
25
- 2. **Validate independence** — What bounded contexts exist in the code? What domain concepts are already present? Can they be separated cleanly?
26
- 3. **Verify correctness** — What works well that we must preserve? What pain points exist? What constraints limit changes?
27
-
28
- **Synthesize initialization strategy:**
29
- - Map existing architecture and conventions
30
- - Extract domain model from code (bounded contexts, aggregates, ubiquitous language)
31
- - Identify test strategy and coverage
32
- - Define requirements that align with existing structure
33
- - Create roadmap that respects what already works
21
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
34
22
 
35
23
  ## Steps
36
24
  1. Run `draht-tools init` to check preconditions (git repo, etc.)
37
25
  2. Run `draht-tools map-codebase` to build a structural map of the existing code
38
26
  3. Analyze the codebase map to understand architecture, tech stack, and conventions
39
- 4. Deep questioning phase (3-7 rounds, 1-2 questions at a time):
27
+ 4. Deep questioning phase (3-7 rounds — each round asks the whole frontier: settled-prerequisite questions only, numbered, each with a recommended answer):
40
28
  - What is this project? Who uses it?
41
29
  - What are the current pain points or goals?
42
30
  - What is MVP vs aspirational scope?
@@ -74,7 +62,9 @@ After project initialization, phases are executed one at a time in new sessions:
74
62
  Each step runs in its own session (`/new` between steps). Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
75
63
 
76
64
  ## Rules
77
- - Ask 1-2 questions at a time, never dump 10 at once
65
+ - Ask the whole frontier per round — numbered, each with a recommended answer; the user replies by number, and accepted-by-number counts as decided
66
+ - Questions that depend on still-open answers wait for a later round
67
+ - Finding facts is your job, never the user's — dispatch a subagent for anything the environment can answer and keep asking the rest of the frontier while it runs
78
68
  - Follow threads based on answers
79
69
  - Use examples ("Like Stripe Checkout, or custom?")
80
70
  - Confirm, don't assume
@@ -15,19 +15,7 @@ Directory: $1
15
15
 
16
16
  ## Atomic Reasoning
17
17
 
18
- Before analyzing, decompose codebase understanding into atomic reasoning units:
19
-
20
- **For each architectural layer:**
21
- 1. **State the logical component** — What is this directory/module's responsibility? What concepts does it encapsulate?
22
- 2. **Validate independence** — Is this a bounded context? What are its dependencies? Does it leak abstractions across boundaries?
23
- 3. **Verify correctness** — What domain terms appear in code? What aggregates exist? What test infrastructure is present?
24
-
25
- **Synthesize analysis strategy:**
26
- - Map directory structure to bounded contexts
27
- - Extract domain language from identifiers (classes, functions, types)
28
- - Identify context relationships (upstream/downstream, shared kernel)
29
- - Document test strategy and coverage
30
- - Note architectural concerns and patterns
18
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
31
19
 
32
20
  ## Steps
33
21
  1. Run `draht-tools map-codebase $1` (graph artifacts are always whole-repo — see below)
@@ -15,24 +15,12 @@ Description: $ARGUMENTS
15
15
 
16
16
  ## Atomic Reasoning
17
17
 
18
- Before questioning, decompose project vision into atomic reasoning units:
19
-
20
- **For each aspect of the new project:**
21
- 1. **State the logical component** — What problem does this solve? Who are the users? What is core vs peripheral?
22
- 2. **Validate independence** — What bounded contexts will exist? What domain concepts are central? Can features be built independently?
23
- 3. **Verify correctness** — What defines MVP success? What constraints exist (time, tech, team)? What is explicitly out of scope?
24
-
25
- **Synthesize project strategy:**
26
- - Define bounded contexts and ubiquitous language upfront
27
- - Establish test strategy before writing code
28
- - Create requirements mapped to domain contexts
29
- - Build roadmap with testable phase goals
30
- - Ensure each phase delivers verifiable user value
18
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
31
19
 
32
20
  ## Steps
33
21
  1. Run `draht-tools init` to check preconditions
34
22
  2. If existing code detected, run `draht-tools map-codebase` first
35
- 3. Deep questioning phase (3-7 rounds, 1-2 questions at a time)
23
+ 3. Deep questioning phase (3-7 rounds — each round asks the whole frontier: every question whose prerequisites are settled, numbered, each with a recommended answer)
36
24
  4. Run `draht-tools create-project` with gathered info
37
25
  5. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
38
26
  6. Create `.planning/DOMAIN.md` with:
@@ -66,7 +54,9 @@ After project initialization, phases are executed one at a time in new sessions:
66
54
  Each step runs in its own session (`/new` between steps). Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
67
55
 
68
56
  ## Rules
69
- - Ask 1-2 questions at a time, never dump 10 at once
57
+ - Ask the whole frontier per round — numbered, each with a recommended answer; the user replies by number, and accepted-by-number counts as decided
58
+ - Questions that depend on still-open answers wait for a later round
59
+ - Finding facts is your job, never the user's — dispatch a subagent for anything the environment can answer and keep asking the rest of the frontier while it runs
70
60
  - Follow threads based on answers
71
61
  - Use examples ("Like Stripe Checkout, or custom?")
72
62
  - Confirm, don't assume
@@ -13,19 +13,7 @@ Plan the next milestone after ALL phases in the current one are complete.
13
13
 
14
14
  ## Atomic Reasoning
15
15
 
16
- Before planning the next milestone, decompose progress into atomic reasoning units:
17
-
18
- **For each completed phase:**
19
- 1. **State the logical component** — What was built? What user value was delivered? What requirements were satisfied?
20
- 2. **Validate independence** — What worked well? What had issues? What assumptions proved wrong?
21
- 3. **Verify correctness** — What tests passed? What domain model evolved? What new knowledge emerged?
22
-
23
- **Synthesize next milestone:**
24
- - Assess which v1 requirements remain vs are complete
25
- - Identify requirements that should be promoted or descoped based on learning
26
- - Define 3-5 new phases with clear, testable goals
27
- - Order phases by dependency and risk
28
- - Map each phase to specific requirements and domain contexts
16
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
29
17
 
30
18
  ## Prerequisites
31
19
  - `.planning/ROADMAP.md` must exist
@@ -13,7 +13,7 @@ Task: $ARGUMENTS
13
13
 
14
14
  ## Atomic Reasoning
15
15
 
16
- Before delegating, decompose the task into atomic work units:
16
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
17
17
 
18
18
  1. **State the logical components** — What sub-tasks make up this work? Which are independent? A sub-task is well-cut only if its success can be checked without reference to the others.
19
19
  2. **Match agents to work** — Which specialist is right for each sub-task?
@@ -11,20 +11,8 @@ Create a handoff document for session continuity.
11
11
  /pause-work
12
12
  ```
13
13
 
14
- ## Atomic Reasoning
15
-
16
- Before pausing, decompose session state into atomic reasoning units:
17
-
18
- 1. **State the logical component** — What was accomplished this session? What is in-progress? What is the current phase/task?
19
- 2. **Validate independence** — Are there uncommitted changes? Are there blockers? What decisions were made?
20
- 3. **Verify correctness** — Is the current state stable? Can work resume cleanly? What context needs to be captured?
21
-
22
- **Synthesize handoff document:**
23
- - Capture current phase and status
24
- - Document decisions and blockers
25
- - Note next steps for resumption
26
-
27
14
  ## Steps
28
15
  1. Run `draht-tools pause` — creates CONTINUE-HERE.md
29
16
  2. **Distill lessons before the context is lost**: for anything this session tried that failed, or an approach that worked against expectations, append one dated bullet to `.planning/STATE.md` under `## Lessons` (create the section before `## Blockers` if missing). Lessons name what to do differently — "runner hits TLS issue in PowerShell, use bash", not "had problems with tests".
17
+ - Handoff and lesson prose follows the `unslop` skill — plain words, no filler, specifics over vibes; commands, paths, and quoted output stay verbatim.
30
18
  3. Commit: `draht-tools commit-docs "pause work"`
@@ -29,21 +29,12 @@ Run `draht-tools validate-plans $1` after saving. Fix any issues it reports befo
29
29
 
30
30
  ## Atomic Reasoning
31
31
 
32
- Before creating plans, decompose this phase goal into atomic reasoning units:
33
-
34
- **For each observable truth (user-visible outcome):**
35
- 1. **State the logical component** — What must be true for the user? What can they do/see/verify?
36
- 2. **Validate independence** — Which artifacts (files, endpoints, schemas) prove this truth exists? Can it be built independently?
37
- 3. **Verify correctness** — What test scenarios would prove this observable truth? What are the specific inputs → expected outputs?
32
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
38
33
 
39
34
  **Atomicity test:** a task is atomic only if its `<verify>` can fail while every other task passes. If two tasks can only be checked together, they are one task.
40
35
 
41
- **Synthesize planning strategy:**
42
- - Group related observable truths into cohesive plans (2-5 tasks each)
43
- - Identify which plans can be created in parallel vs sequentially
44
- - Map each plan to specific bounded contexts and domain concepts
45
- - Ensure each plan produces testable, verifiable outcomes
46
36
  - **Order risk-first**: score each truth by uncertainty (has this codebase done it before?) × blast radius (how much becomes invalid if it's wrong?). The plan proving the highest-scoring truth executes first; boilerplate goes last. Boilerplate never invalidates a phase — the risky part regularly does.
37
+
47
38
  - Write every assumption a plan rests on as an explicit `Assumes:` line (with how to confirm it) in the plan header. Unwritten assumptions become the executor's bugs.
48
39
 
49
40
  ## Steps
@@ -11,19 +11,6 @@ Show current project status.
11
11
  /progress
12
12
  ```
13
13
 
14
- ## Atomic Reasoning
15
-
16
- Before checking progress, decompose project state into atomic reasoning units:
17
-
18
- 1. **State the logical component** — What milestone are we in? What phase is active? What work is complete vs in-progress?
19
- 2. **Validate independence** — Are there blockers? Are phases in the correct sequence? Is anything waiting on external input?
20
- 3. **Verify correctness** — Does the reported state match reality? Are all verified phases truly complete? Are there unreported issues?
21
-
22
- **Synthesize status understanding:**
23
- - Identify where we are in the roadmap
24
- - Assess momentum and blockers
25
- - Determine next action
26
-
27
14
  ## Steps
28
15
  1. Run `draht-tools progress` — outputs formatted status
29
16
  2. Display the result as-is
@@ -19,17 +19,7 @@ Before planning, verify the task is actually quick: grep the blast radius (calle
19
19
 
20
20
  ## Atomic Reasoning
21
21
 
22
- Before executing, decompose this task into atomic reasoning units:
23
-
24
- 1. **State the logical component** — What is the single, concrete outcome? What files need to change? What behavior needs to work?
25
- 2. **Validate independence** — Can this be done without touching other features? What dependencies exist? What could break?
26
- 3. **Verify correctness** — What test proves this works? What edge cases matter? Is this testable behavior or pure config?
27
-
28
- **Synthesize execution plan:**
29
- - Define specific files to modify
30
- - Write failing test (if testable behavior)
31
- - Implement minimal solution
32
- - Verify and document
22
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
33
23
 
34
24
  ## Steps
35
25
  1. Run `draht-tools next-quick-number` to get task number
@@ -49,6 +39,8 @@ Before executing, decompose this task into atomic reasoning units:
49
39
  - REFACTOR — Clean up while keeping the test green
50
40
  Exception: skip the TDD cycle only for pure config or documentation-only tasks that have no testable behaviour.
51
41
 
42
+ Comment discipline: comments exist ONLY for constraints the code cannot express — a protocol quirk, a deliberate deviation, a non-obvious invariant. If code needs comments to be understood, rewrite the code until it doesn't. Never narrate steps, restate the diff, or leave "removed X" / "this handles Y" breadcrumbs. Comment density above the surrounding file's norm is a defect — fix it before committing. A heavily-commented solution signals the design is wrong: redesign, don't annotate.
43
+
52
44
  After completion, report: files changed, tests written, and verification results.
53
45
 
54
46
  End your response with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED` per the agent contract.
@@ -0,0 +1,71 @@
1
+ ---
2
+ description: "Resolve an in-progress git merge or rebase conflict by reconstructing both sides' intent"
3
+ argument-hint: "[branch or context, e.g. agent/<taskId>]"
4
+ ---
5
+
6
+ # /resolve-conflicts
7
+
8
+ Resolve an in-progress git merge, rebase, or cherry-pick conflict by reconstructing the intent of both sides — never by picking a side blind.
9
+
10
+ ## Usage
11
+ ```
12
+ /resolve-conflicts [branch or context]
13
+ ```
14
+
15
+ Context: $ARGUMENTS
16
+
17
+ ## When This Applies
18
+
19
+ - `git status` reports unmerged paths — a merge, rebase, or cherry-pick is mid-flight.
20
+ - The `subagent` tool reported a failed worktree merge-back (its failure notice points here): the agent's work sits on an unmerged `agent/<taskId>` branch. Run `git merge agent/<taskId>` first to enter the conflict, then continue here.
21
+
22
+ ## The Iron Law
23
+
24
+ > **EVERY HUNK RESOLUTION MUST BE JUSTIFIED BY THE RECOVERED INTENT OF BOTH SIDES. NO INTENT, NO RESOLUTION.**
25
+
26
+ A conflict is two changes with a reason each. Until you can state both reasons, you are not resolving — you are guessing.
27
+
28
+ ## Phase 1 — Map the Conflict
29
+
30
+ 1. `git status` — list every conflicted file.
31
+ 2. Classify the operation: merge, rebase, or cherry-pick. Identify which ref is "ours" and which is "theirs" — a rebase swaps the intuitive meaning.
32
+ 3. State the operation's goal in one sentence: what is this merge or rebase trying to bring in?
33
+ 4. Read every conflict marker in full — all of them — before resolving any.
34
+
35
+ ## Phase 2 — Intent Archaeology
36
+
37
+ For each side of each conflicted area, recover why the change was made:
38
+
39
+ - Commit messages: `git log --merge -p -- <file>` shows the commits touching the conflicted file from both sides.
40
+ - Each side's diff against the merge base: `git diff <base> <side> -- <file>`.
41
+ - PRs, issues, or tickets referenced in those commit messages.
42
+ - Planning documents (for example under `.planning/`) when the project keeps them.
43
+
44
+ Exit criterion: a one-sentence intent statement per side, per conflicted area. If an intent cannot be determined, STOP and ask the user — do not guess.
45
+
46
+ ## Phase 3 — Resolve Hunk by Hunk
47
+
48
+ - Preserve both intents wherever they are compatible.
49
+ - Where they are incompatible, pick the side that matches the operation's stated goal and RECORD the trade-off — every recorded trade-off must appear in the merge commit message in Phase 5.
50
+ - Never invent behaviour that exists on neither side.
51
+ - If no stated goal decides an incompatibility, STOP and ask the user.
52
+ - Do not run `--abort` on your own. Aborting can be the right escape hatch — draht's own worktree isolator aborts failed merge-backs to keep the base branch clean — but it discards resolution work, so it is the user's call. Stop and ask instead.
53
+
54
+ ## Phase 4 — Run the Project's Checks
55
+
56
+ Discover the project's own gates — package scripts, Makefile, CI config — and run them in order: typecheck, then tests, then lint/format. Fix what the merge broke, under the same rule: no invented behaviour.
57
+
58
+ ## Phase 5 — Finish the Operation
59
+
60
+ - Merge: stage the resolved files and commit. The merge commit message names each recorded trade-off — which intent won where, and why.
61
+ - Rebase or cherry-pick: `git rebase --continue` / `git cherry-pick --continue` until every commit is replayed.
62
+ - Never `--no-verify`.
63
+
64
+ ## Red Flags — STOP
65
+
66
+ Stop immediately if you catch yourself:
67
+ - Resolving a hunk whose "why" you cannot state for both sides
68
+ - Taking one side wholesale because it is newer, bigger, or yours
69
+ - Introducing behaviour that exists on neither side
70
+ - Finishing with failing checks, or reaching for `--no-verify`
71
+ - Running `--abort` without explicit user sign-off
@@ -11,19 +11,6 @@ Resume from last session state.
11
11
  /resume-work
12
12
  ```
13
13
 
14
- ## Atomic Reasoning
15
-
16
- Before resuming, decompose handoff context into atomic reasoning units:
17
-
18
- 1. **State the logical component** — What phase/task was active? What was the last accomplishment? What decisions were made?
19
- 2. **Validate independence** — Are there blockers? What changed since the pause? Is the codebase in the expected state?
20
- 3. **Verify correctness** — Is the handoff document complete? Does the current state match what was documented? Can work continue safely?
21
-
22
- **Synthesize resumption plan:**
23
- - Understand current context
24
- - Identify next action
25
- - Confirm no conflicts or state drift
26
-
27
14
  ## Steps
28
15
  1. Run `draht-tools resume` — loads CONTINUE-HERE.md or STATE.md
29
16
  2. Display context and ask to continue
@@ -17,18 +17,9 @@ If no scope given, reviews all recent uncommitted changes.
17
17
 
18
18
  ## Atomic Reasoning
19
19
 
20
- Before reviewing, decompose code changes into atomic reasoning units:
20
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
21
21
 
22
- **For each changed file:**
23
- 1. **State the logical component** — What does this change do? What problem does it solve? What behavior does it add/modify?
24
- 2. **Validate independence** — Does this change have side effects? Does it affect other modules? Are there hidden dependencies?
25
- 3. **Verify correctness** — Is this change correct? Type-safe? Secure? Does it follow conventions? What could go wrong?
26
-
27
- **Synthesize review strategy:**
28
- - Group changes by concern (correctness, security, style, spec compliance)
29
- - Prioritize findings (critical, important, minor)
30
- - Identify patterns across multiple files
31
- - Check domain language compliance and bounded context boundaries
22
+ Check domain language compliance and bounded context boundaries.
32
23
 
33
24
  ## Steps
34
25
  1. Identify the scope:
@@ -41,13 +32,13 @@ Before reviewing, decompose code changes into atomic reasoning units:
41
32
  - If no plan applies → spec-reviewer is skipped
42
33
  4. **Delegate to subagents in parallel:**
43
34
  Use the `subagent` tool in **parallel mode** with these tasks:
44
- - `reviewer` agent: "Review the following code changes for correctness, type safety, conventions, and potential issues. Scope: <scope summary and file list>. Read each changed file. For each finding: cite the exact file and line, explain the issue, suggest the fix. Prioritize: Critical / Important / Minor. End with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`. Do NOT run draht, draht-tools, or pi commands."
35
+ - `reviewer` agent: "Review the following code changes for correctness, type safety, conventions, and potential issues. Scope: <scope summary and file list>. Read each changed file. For each finding: cite the exact file and line, explain the issue, suggest the fix. Prioritize: Critical / Important / Minor. Treat comment-heavy new code as a design defect, not a style nit: comments exist only for constraints the code cannot express — if new code needed narration to be understood (step-by-step comments, diff restatements, 'removed X' / 'this handles Y' breadcrumbs), report the finding as 'code needed narration' at Important or higher; the fix is rewriting the code until the comments are unnecessary, not deleting the comments. End with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`. Do NOT run draht, draht-tools, or pi commands."
45
36
  - `security-auditor` agent: "Audit the following code changes for security vulnerabilities. Scope: <scope summary and file list>. Check injection, auth bypass, secrets, unsafe deserialization, path traversal, prototype pollution. Report severity / file / line / fix. End with `STATUS: ...`. Do NOT run draht, draht-tools, or pi commands."
46
37
  - **(If spec context exists)** `spec-reviewer` agent: "Review the diff against plan at <plan file path>. ONLY spec compliance — does the diff implement exactly what the <test>/<action>/<done> sections asked? Flag omissions and over-builds. End with `STATUS: ...`."
47
38
 
48
39
  5. Read each subagent's final `STATUS:` line.
49
40
  6. Collect and merge results.
50
- 7. **Refute before reporting.** For each Critical or Important finding, attempt to kill it yourself before it reaches the report: read the code path that would make it a false positive — an upstream guard clause, a type constraint, an existing test that covers the case. A finding that survives an honest refutation attempt is **confirmed** (you traced the failing path); one you couldn't confirm is downgraded and labeled **suspected**. Reporting unattacked findings trains readers to ignore the report.
41
+ 7. **Refute before reporting.** For each Critical or Important finding, attempt to kill it yourself before it reaches the report: read the code path that would make it a false positive — an upstream guard clause, a type constraint, an existing test that covers the case. A finding that survives an honest refutation attempt is **confirmed** (you traced the failing path); one you couldn't confirm is downgraded and labeled **suspected**. Reporting unattacked findings trains readers to ignore the report. A Critical finding whose refutation hinges on library or runtime behavior gets a rung-4 script, not an argument: write and run a small script or test against the real code yourself — this proof stays with the orchestrator; the review subagents are scoped to reading the diff — per the `blast-radius` skill.
51
42
  8. Produce a unified, prioritized findings report. Verdict first: one line — mergeable or not, and why. Then findings:
52
43
  - **Critical** — must fix before merge (security `BLOCKED`, spec gaps for required deliverables, correctness issues that cause data loss / crashes)
53
44
  - **Important** — should fix (bugs, type issues, spec over-builds, missing error handling)
@@ -0,0 +1,159 @@
1
+ ---
2
+ description: "Triage an external issue report — classify, bounded cause trace, GitHub Issues dedupe, fail-closed ticket creation, one typed verdict"
3
+ ---
4
+
5
+ # /triage
6
+
7
+ Classify one external issue report and end with one useful verdict. Create a tracker issue only for a clear, new bug. Do not reproduce or fix anything here — `/fix` owns that, and a `[triage:bug]` verdict is its entry ticket.
8
+
9
+ Report: $ARGUMENTS
10
+
11
+ > **Tool note**: For the bounded cause trace, use the `subagent` tool with the `debugger` agent — findings-only diagnosis (no fixes, no writes); classification and every tracker write stay with the orchestrator.
12
+
13
+ ## Fail-Closed Rules
14
+
15
+ - One report, one run, one verdict. Do not narrate progress into the tracker.
16
+ - **Prefer no ticket over a guessed or duplicate ticket.**
17
+ - The `debugger` dispatch is findings-only: it diagnoses and reports; it fixes nothing, writes nothing, and never touches the tracker.
18
+ - No repository access → no cause trace: continue with a conservative classification and say in the verdict that cause tracing was unavailable.
19
+ - No confident dedupe → no ticket.
20
+ - Never create an issue that cannot link back to the source report.
21
+ - If a `gh` operation the creation gate requires is unavailable (not installed, unauthenticated, wrong repo), fail closed for that write and say so — the verdict still lands.
22
+
23
+ ## 1 — Freeze the source coordinates
24
+
25
+ Pin what "the report" is before delegating or searching, and store it immutably for the rest of the run:
26
+
27
+ - A pasted report → quote its first line verbatim and record where it came from (chat, e-mail, support tool) as the user stated it.
28
+ - An issue URL or `gh issue view` output → store `owner/repo` + issue number, then read it whole: `gh issue view <n> --repo <owner/repo> --json url,title,state,body,comments`.
29
+ - Resolve the target repo for dedupe and creation: the current repo unless the report names another. Ambiguous target → ask; never guess where a ticket lands.
30
+
31
+ Every later read, search, and write uses these stored values. A reply, a cross-link, or a search hit never replaces them.
32
+
33
+ ## 2 — Read the whole report
34
+
35
+ Capture before judging:
36
+
37
+ - Reporter wording, verbatim
38
+ - Product version, build, environment, platform when present
39
+ - Expected behavior vs observed behavior
40
+ - Frequency and trigger
41
+ - Error text or stack signature
42
+ - Existing issue, commit, or PR links
43
+ - Any explicit statement that someone is already fixing it
44
+
45
+ If the report references an attachment, screenshot, or recording you cannot read, say so in the verdict — do not invent what it shows.
46
+
47
+ ## 3 — Trace cause before routing
48
+
49
+ A bounded source-and-history pass, before choosing a category or an owner. Dispatch the `debugger` agent with this prompt:
50
+
51
+ ```
52
+ Investigate this external issue report using root-cause discipline. FINDINGS ONLY: do NOT fix anything, do NOT write or edit files, do NOT create or comment on tracker issues.
53
+
54
+ Report (frozen — do not reinterpret):
55
+ <reporter wording, expected/observed, error text or stack signature, version/environment, trigger>
56
+
57
+ Bounded pass — report on each step:
58
+ 1. Identify the likely code path from the reported action to the observed result (file:line anchors).
59
+ 2. Check whether the visible symptom belongs to that code path or to a dependency below it.
60
+ 3. If the report looks like a regression: `git log --oneline -20` and recent diffs on the affected files — name candidate commits.
61
+ 4. Check whether a merged commit or open PR already addresses the same symptom.
62
+ 5. Separate confirmed facts from hypotheses — label every statement observed, derived, or assumed.
63
+
64
+ Stop at diagnosis strength sufficient for routing — a complete root cause is /fix's job, not yours. Do not build a reproduction unless one command is already obvious from the report itself.
65
+
66
+ End with STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
67
+ ```
68
+
69
+ The pass does not need a complete root cause — it must be strong enough to avoid routing a visible symptom to the wrong component. A keyword match between the report and a module name is not a trace; a visible symptom alone is not enough when cause tracing points to a dependency below it. When the report smells like a regression and design intent matters ("was this behaviour a decision or an accident?"), a bounded `/why` consult can supplement the trace — not a full archaeology run.
70
+
71
+ If the repository cannot be read, skip the dispatch, classify conservatively, and record "cause tracing unavailable" for the verdict.
72
+
73
+ ## 4 — Classify
74
+
75
+ Choose exactly one:
76
+
77
+ - **Bug** — something violates intended behavior: wrong output, broken state, error, crash, hang, silent no-op, regression.
78
+ - **Performance** — measurable slowness, excess memory, jank, resource drain. Treat as a bug; preserve every measurement and profile the reporter supplied.
79
+ - **Feature request** — current behavior looks intentional; the reporter wants different behavior or a new affordance.
80
+ - **Question or feedback** — asks how something works, or expresses a preference without a concrete defect.
81
+ - **Reroute** — cause tracing shows another repo or team owns it. A route needs evidence from the report or the trace. Say where the report belongs in the verdict; never file it here.
82
+
83
+ When the bug-versus-feature line is unclear, do not file. Ask one focused question in the verdict and close with the `other` marker.
84
+
85
+ ## 5 — Dedupe against GitHub Issues
86
+
87
+ GitHub Issues via `gh` is the one tracker this command speaks: search (`gh issue list --search`, `gh search issues`), read (`gh issue view`), update (`gh issue comment`), create (`gh issue create`), compensate (`gh issue close`). Preflight once: `gh auth status` and the resolved target repo.
88
+
89
+ For bug and performance reports, search open AND closed issues before creating anything:
90
+
91
+ ```
92
+ gh issue list --repo <owner/repo> --state all --search "<exact error or crash signature>"
93
+ gh issue list --repo <owner/repo> --state all --search "<area> <trigger> <symptom>"
94
+ gh issue list --repo <owner/repo> --state all --search "<version or date window, suspected regression commit>"
95
+ gh search issues --repo <owner/repo> "<source URL or distinctive reporter phrase>"
96
+ ```
97
+
98
+ Choose one typed outcome and name it in the verdict:
99
+
100
+ - **Confident duplicate** — same signature, or same area + trigger + symptom, or a confirmed shared cause. Add the source reference and one short recurrence note to the existing issue (`gh issue comment`); do not reopen, relabel, or reassign it. Create nothing.
101
+ - **Possibly related** — a shared cause is plausible but not proven. Link it in the verdict as uncertain. Create nothing.
102
+ - **Weak resemblance** — similarity is superficial. Record it as checked; it does not block creation.
103
+ - **No match.**
104
+
105
+ A long-closed issue is a regression lead, not automatically a live duplicate — feed it back into the cause trace instead of linking it as the answer.
106
+
107
+ ## 6 — Decide whether to create
108
+
109
+ Create only when ALL of these hold:
110
+
111
+ 1. The classification is bug or performance.
112
+ 2. The behavior is clearly broken — a violated intent, not a preference.
113
+ 3. The issue is still live: no merged commit or open PR from step 3 already addresses it.
114
+ 4. Dedupe ran and found no confident duplicate and no plausibly-related live match.
115
+ 5. The frozen source coordinates are in hand, so the new issue links back to where the report came from.
116
+ 6. `gh` is authenticated against the resolved target repo and title/body/labels resolve — never invent labels, milestones, assignees, or priority.
117
+ 7. The run can still compensate: `gh issue close` on its own creation remains possible if the verdict fails to land.
118
+
119
+ Never create for a feature request, question, feedback item, reroute, possible duplicate, confident duplicate, or already-fixed report. If a condition fails, the verdict names which one.
120
+
121
+ The new issue must be self-contained:
122
+
123
+ - Plain title naming the area and the symptom — no guessed root cause in the title
124
+ - Reporter quote
125
+ - Expected and observed behavior
126
+ - Version and environment, or `unknown`
127
+ - Trigger and frequency
128
+ - Source reference (issue URL, or where the pasted report came from)
129
+ - Short cause-trace findings with hypotheses labeled as hypotheses
130
+ - Links to any artifacts (logs, screenshots, profiles)
131
+
132
+ **Compensation**: if this run created an issue and the verdict then cannot be delivered — the run aborts, or the creation turns out wrong before the verdict lands — close the created issue with `gh issue close <n> --comment "triage compensation: verdict did not land"`. An orphaned guess in the tracker is worse than no ticket.
133
+
134
+ ## 7 — One verdict
135
+
136
+ Lead with the outcome. Link the existing or new issue when there is one. Name the dedupe outcome. Mention the reroute destination or the one missing fact when needed. Keep it short — the `unslop` bar applies, and every claim follows the `epistemics` labeling the trace carried.
137
+
138
+ End the report with exactly one marker line, the last line of the response:
139
+
140
+ ```text
141
+ [triage:bug]
142
+ [triage:bug] tracker=https://github.com/OWNER/REPO/issues/N
143
+ [triage:performance]
144
+ [triage:performance] tracker=https://github.com/OWNER/REPO/issues/N
145
+ [triage:other]
146
+ ```
147
+
148
+ `bug` and `performance` carry `tracker=` only when this run matched or created a live issue. Everything else — feature request, question, feedback, reroute, unclear — closes with `[triage:other]`. Never emit two markers; never bury the marker mid-report. A follow-up `/fix` run takes the marker plus its tracker link as the issue input.
149
+
150
+ ## Rationalization Table
151
+
152
+ | Excuse | Reality |
153
+ |---|---|
154
+ | "The report names the component, route it there" | A keyword match is not a trace. Route on a confirmed code path or signature, or say the owner is unclear. |
155
+ | "Probably a duplicate of #123" | Probably means possibly related: link it as uncertain and create nothing. |
156
+ | "Filing a ticket is harmless" | A guessed or duplicate ticket costs a maintainer two triages. Prefer no ticket. |
157
+ | "The old closed issue matches, done" | A long-closed issue is a regression lead — trace what re-broke it. |
158
+ | "No repo access, but the cause is obvious" | Reading a report yields hypotheses. Classify conservatively and say the trace was unavailable. |
159
+ | "I'll fix it while I'm here" | Triage ends at the verdict. Hand `[triage:bug]` to `/fix`. |
@@ -15,25 +15,14 @@ Phase: $1
15
15
 
16
16
  ## Atomic Reasoning
17
17
 
18
- Before verifying, decompose phase acceptance into atomic reasoning units:
19
-
20
- **For each deliverable:**
21
- 1. **State the logical component** — What was this deliverable meant to produce? What user value does it provide?
22
- 2. **Validate independence** — Can this deliverable be tested independently? What are its dependencies?
23
- 3. **Verify correctness** — What tests prove it works? What edge cases must pass? What security concerns exist?
24
-
25
- **Synthesize verification strategy:**
26
- - Group parallel verification tasks (test suite, security audit, code review, spec compliance, domain compliance)
27
- - Map each deliverable to its plan file (the spec)
28
- - Identify critical vs optional checks
29
- - Plan fix strategies for potential failures
18
+ Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
30
19
 
31
20
  ## Steps
32
21
  1. Run `draht-tools extract-deliverables $1` to get testable items
33
22
  2. Discover the phase's plan files (`.planning/phases/<N>-*/<N>-NN-PLAN.md`). Each plan is the spec the spec-reviewer evaluates against.
34
23
  3. **Run parallel verification via subagents:**
35
24
  Use the `subagent` tool in **parallel mode** with these tasks:
36
- - `verifier` agent: "Run the full test suite for this project. Check package.json for the test command. Record pass/fail counts. Then run any available lint and typecheck commands (e.g. npm run check, npm run lint, npx tsc --noEmit). Report all results with error details. End with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`. Do NOT run draht, draht-tools, or pi commands."
25
+ - `verifier` agent: "Run the full test suite for this project. Check package.json for the test command. Record pass/fail counts. Then run any available lint and typecheck commands (e.g. npm run check, npm run lint, npx tsc --noEmit). Report all results with error details. If a project verification skill exists (a `verify-<app>` skill under `.draht/skills/`, generated by /create-verification-skill), drive the app with it: launch, run its Doctor check, drive ONE mapped feature from its feature map the way a user would, capture the evidence artifacts it names, and clean up per its Cleanup section — cleanup never removes the evidence. Report which feature you drove and where the evidence lives; this is observed evidence of user-visible behaviour. If no such skill exists, say so: test output is then the ceiling of the evidence. End with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`. Do NOT run draht, draht-tools, or pi commands (launching and driving the target app itself is in scope)."
37
26
  - `security-auditor` agent: "Audit the recent code changes (use git log and git diff, scoped to this phase's commits). Check for injection risks, auth bypasses, secrets in code, unsafe patterns. Report findings by severity. End with `STATUS: ...`. Do NOT run draht, draht-tools, or pi commands."
38
27
  - `reviewer` agent: "Review the recent code changes for this phase. Check domain language compliance against `.planning/DOMAIN.md` if it exists — scan for identifiers not in the glossary and cross-context boundary violations. Report Must fix / Should fix / Consider. End with `STATUS: ...`. Do NOT run draht, draht-tools, or pi commands."
39
28
  - `spec-reviewer` agent: "Phase-level spec compliance check for phase $1. The phase has these plan files (each is a spec): <list of .planning/phases/<N>-*/<N>-NN-PLAN.md paths>. For each plan, evaluate whether the phase's commits implement exactly what the plan's <task> elements asked — no missing tasks, no over-builds. Use git log and git diff against the phase commit range. Output a per-plan compliance verdict with omissions and over-builds. End with `STATUS: ...`."
@@ -49,10 +38,11 @@ Before verifying, decompose phase acceptance into atomic reasoning units:
49
38
  6. Collect results and walk user through each deliverable, incorporating findings.
50
39
  7. Record results (pass/fail/partially/skip). Label each: **observed** (you or a subagent ran it and quoted output), **derived** (follows necessarily from something observed), or **assumed** (unchecked). Verdicts inherit the weakest label they rest on.
51
40
  8. For failures: diagnose and create fix plans via `draht-tools create-fix-plan $1 P`
52
- - Fix plans MUST include a reproducing test that demonstrates the failure before any implementation
41
+ - Fix plans MUST include a reproducing test that demonstrates the failure before any implementation — held to the /fix Phase 1 red-capable standard: one named command, already run once, invocation and output shown, asserting the exact failing symptom (red now, green once fixed)
53
42
  - Spec-reviewer omissions become explicit fix-plan tasks (one task per omission)
54
43
  9. Write UAT report: `draht-tools write-uat $1`
55
44
  - Order: **verdict first** (phase pass/fail, X/Y deliverables, in the first line), **evidence second** (test health summary with pass/fail/coverage, security audit results, spec compliance summary per plan, domain model status, deliverable results with labels), **risk last** (what was NOT tested and how it could bite). Never bury a failure under passes.
45
+ - Report prose follows the `unslop` skill — plain words, active voice, no filler; quoted command output and the verdict-first ordering stay untouched.
56
46
  10. If all passed: mark phase complete.
57
47
  - If more phases remain in the milestone: tell the user to start a new session and run `/discuss-phase N+1`.
58
48
  - If ALL phases in the milestone are complete: tell the user to start a new session and run `/next-milestone`.