gsd-pi 2.79.0-dev.ece5fd8ba → 2.80.0-dev.4ea7d80e7

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 (681) hide show
  1. package/dist/resources/.managed-resources-content-hash +1 -1
  2. package/dist/resources/extensions/github-sync/templates.js +90 -74
  3. package/dist/resources/extensions/gsd/auto/contracts.js +1 -0
  4. package/dist/resources/extensions/gsd/auto/custom-verify-retry-store.js +53 -0
  5. package/dist/resources/extensions/gsd/auto/loop.js +365 -522
  6. package/dist/resources/extensions/gsd/auto/orchestrator.js +146 -0
  7. package/dist/resources/extensions/gsd/auto/phases.js +55 -6
  8. package/dist/resources/extensions/gsd/auto/run-unit.js +19 -15
  9. package/dist/resources/extensions/gsd/auto/session.js +8 -0
  10. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.js +12 -0
  11. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-iteration.js +24 -0
  12. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.js +33 -0
  13. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.js +26 -0
  14. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-retry.js +49 -0
  15. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.js +25 -0
  16. package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +48 -0
  17. package/dist/resources/extensions/gsd/auto/workflow-dispatch-ledger.js +26 -0
  18. package/dist/resources/extensions/gsd/auto/workflow-iteration-completion.js +10 -0
  19. package/dist/resources/extensions/gsd/auto/workflow-journal-reporter.js +16 -0
  20. package/dist/resources/extensions/gsd/auto/workflow-kernel.js +263 -0
  21. package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +36 -0
  22. package/dist/resources/extensions/gsd/auto/workflow-phase-reporter.js +9 -0
  23. package/dist/resources/extensions/gsd/auto/workflow-session-lock.js +35 -0
  24. package/dist/resources/extensions/gsd/auto/workflow-sidecar-iteration.js +24 -0
  25. package/dist/resources/extensions/gsd/auto/workflow-sidecar-queue.js +26 -0
  26. package/dist/resources/extensions/gsd/auto/workflow-turn-reporter.js +36 -0
  27. package/dist/resources/extensions/gsd/auto/workflow-unit-dispatch.js +44 -0
  28. package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +15 -0
  29. package/dist/resources/extensions/gsd/auto-dashboard.js +54 -15
  30. package/dist/resources/extensions/gsd/auto-dispatch.js +10 -0
  31. package/dist/resources/extensions/gsd/auto-prompts.js +168 -3
  32. package/dist/resources/extensions/gsd/auto-recovery.js +198 -59
  33. package/dist/resources/extensions/gsd/auto-runtime-state.js +4 -0
  34. package/dist/resources/extensions/gsd/auto-start.js +2 -3
  35. package/dist/resources/extensions/gsd/auto-verification.js +2 -11
  36. package/dist/resources/extensions/gsd/auto-worktree.js +87 -38
  37. package/dist/resources/extensions/gsd/auto.js +168 -3
  38. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +24 -2
  39. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -0
  40. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +22 -6
  41. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +129 -1
  42. package/dist/resources/extensions/gsd/commands-extract-learnings.js +17 -12
  43. package/dist/resources/extensions/gsd/commands-ship.js +23 -46
  44. package/dist/resources/extensions/gsd/commands-workflow-templates.js +12 -7
  45. package/dist/resources/extensions/gsd/component-loader.js +5 -11
  46. package/dist/resources/extensions/gsd/custom-workflow-engine.js +25 -1
  47. package/dist/resources/extensions/gsd/db-adapter.js +47 -0
  48. package/dist/resources/extensions/gsd/db-base-schema.js +351 -0
  49. package/dist/resources/extensions/gsd/db-connection-cache.js +31 -0
  50. package/dist/resources/extensions/gsd/db-coordination-schema.js +104 -0
  51. package/dist/resources/extensions/gsd/db-decision-requirement-rows.js +71 -0
  52. package/dist/resources/extensions/gsd/db-gate-rows.js +16 -0
  53. package/dist/resources/extensions/gsd/db-lightweight-query-rows.js +29 -0
  54. package/dist/resources/extensions/gsd/db-memory-fts-schema.js +56 -0
  55. package/dist/resources/extensions/gsd/db-migration-backup.js +22 -0
  56. package/dist/resources/extensions/gsd/db-migration-steps.js +410 -0
  57. package/dist/resources/extensions/gsd/db-milestone-artifact-rows.js +35 -0
  58. package/dist/resources/extensions/gsd/db-open-state.js +32 -0
  59. package/dist/resources/extensions/gsd/db-provider.js +108 -0
  60. package/dist/resources/extensions/gsd/db-runtime-kv-schema.js +27 -0
  61. package/dist/resources/extensions/gsd/db-schema-metadata.js +23 -0
  62. package/dist/resources/extensions/gsd/db-task-slice-rows.js +86 -0
  63. package/dist/resources/extensions/gsd/db-transaction.js +63 -0
  64. package/dist/resources/extensions/gsd/db-verification-evidence-rows.js +3 -0
  65. package/dist/resources/extensions/gsd/db-verification-evidence-schema.js +19 -0
  66. package/dist/resources/extensions/gsd/escalation.js +2 -0
  67. package/dist/resources/extensions/gsd/graph.js +9 -3
  68. package/dist/resources/extensions/gsd/gsd-db.js +316 -1520
  69. package/dist/resources/extensions/gsd/guided-flow.js +2 -2
  70. package/dist/resources/extensions/gsd/legacy-telemetry.js +70 -0
  71. package/dist/resources/extensions/gsd/markdown-renderer.js +2 -0
  72. package/dist/resources/extensions/gsd/model-router.js +9 -6
  73. package/dist/resources/extensions/gsd/notification-widget.js +21 -3
  74. package/dist/resources/extensions/gsd/post-execution-checks.js +27 -6
  75. package/dist/resources/extensions/gsd/pr-evidence.js +117 -0
  76. package/dist/resources/extensions/gsd/pre-execution-checks.js +2 -0
  77. package/dist/resources/extensions/gsd/process-task-path.js +61 -0
  78. package/dist/resources/extensions/gsd/prompt-loader.js +9 -5
  79. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +32 -30
  80. package/dist/resources/extensions/gsd/prompts/complete-slice.md +23 -34
  81. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
  82. package/dist/resources/extensions/gsd/prompts/discuss.md +81 -181
  83. package/dist/resources/extensions/gsd/prompts/execute-task.md +40 -67
  84. package/dist/resources/extensions/gsd/prompts/forensics.md +41 -84
  85. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
  86. package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
  87. package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
  88. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
  89. package/dist/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
  90. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +45 -59
  91. package/dist/resources/extensions/gsd/prompts/plan-slice.md +25 -87
  92. package/dist/resources/extensions/gsd/prompts/queue.md +46 -53
  93. package/dist/resources/extensions/gsd/prompts/refine-slice.md +23 -23
  94. package/dist/resources/extensions/gsd/prompts/research-slice.md +23 -23
  95. package/dist/resources/extensions/gsd/prompts/rethink.md +10 -10
  96. package/dist/resources/extensions/gsd/prompts/system.md +65 -107
  97. package/dist/resources/extensions/gsd/prompts/triage-captures.md +15 -15
  98. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
  99. package/dist/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
  100. package/dist/resources/extensions/gsd/state.js +4 -0
  101. package/dist/resources/extensions/gsd/tools/complete-milestone.js +14 -9
  102. package/dist/resources/extensions/gsd/tools/complete-task.js +2 -0
  103. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +6 -1
  104. package/dist/resources/extensions/gsd/unit-context-composer.js +1 -1
  105. package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
  106. package/dist/resources/extensions/gsd/uok/plan-v2.js +2 -0
  107. package/dist/resources/extensions/gsd/workflow-logger.js +13 -13
  108. package/dist/resources/extensions/gsd/workflow-manifest.js +2 -0
  109. package/dist/resources/extensions/gsd/workflow-projections.js +2 -0
  110. package/dist/resources/extensions/gsd/workflow-templates.js +9 -0
  111. package/dist/resources/extensions/gsd/working-output-messages.js +64 -0
  112. package/dist/resources/extensions/shared/interview-ui.js +15 -4
  113. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  114. package/dist/web/standalone/.next/BUILD_ID +1 -1
  115. package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
  116. package/dist/web/standalone/.next/build-manifest.json +3 -3
  117. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  118. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  119. package/dist/web/standalone/.next/required-server-files.json +1 -1
  120. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  121. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  122. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  123. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  124. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  125. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  126. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  127. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  128. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  129. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  130. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  131. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  132. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  133. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  134. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  135. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  136. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  138. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  140. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  142. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  144. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  146. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  148. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  150. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  152. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  154. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  156. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  158. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  160. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  162. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  164. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  166. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  168. package/dist/web/standalone/.next/server/app/api/notifications/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  170. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  172. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  174. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  176. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  178. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  180. package/dist/web/standalone/.next/server/app/api/session/events/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  182. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  184. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  186. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  188. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  190. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  192. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  194. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  196. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  197. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  198. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  200. package/dist/web/standalone/.next/server/app/index.html +1 -1
  201. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  202. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  203. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  204. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  205. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  206. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  207. package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
  208. package/dist/web/standalone/.next/server/chunks/167.js +2 -0
  209. package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
  210. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  211. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  212. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  213. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  214. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  215. package/dist/web/standalone/.next/static/chunks/{8336.6f6f30e410419aff.js → 8336.631939fb583761fa.js} +1 -1
  216. package/dist/web/standalone/.next/static/chunks/{webpack-d82dbee6356c1733.js → webpack-0481f1221120a7c6.js} +1 -1
  217. package/dist/web/standalone/package.json +1 -0
  218. package/dist/web/standalone/server.js +1 -1
  219. package/package.json +18 -7
  220. package/packages/contracts/dist/index.d.ts +3 -0
  221. package/packages/contracts/dist/index.d.ts.map +1 -0
  222. package/packages/contracts/dist/index.js +5 -0
  223. package/packages/contracts/dist/index.js.map +1 -0
  224. package/packages/contracts/dist/rpc.d.ts +549 -0
  225. package/packages/contracts/dist/rpc.d.ts.map +1 -0
  226. package/packages/contracts/dist/rpc.js +53 -0
  227. package/packages/contracts/dist/rpc.js.map +1 -0
  228. package/packages/contracts/dist/rpc.test.d.ts +2 -0
  229. package/packages/contracts/dist/rpc.test.d.ts.map +1 -0
  230. package/packages/contracts/dist/rpc.test.js +47 -0
  231. package/packages/contracts/dist/rpc.test.js.map +1 -0
  232. package/packages/contracts/dist/workflow.d.ts +180 -0
  233. package/packages/contracts/dist/workflow.d.ts.map +1 -0
  234. package/packages/contracts/dist/workflow.js +201 -0
  235. package/packages/contracts/dist/workflow.js.map +1 -0
  236. package/packages/contracts/package.json +39 -0
  237. package/packages/contracts/src/index.ts +5 -0
  238. package/packages/contracts/src/rpc.test.ts +72 -0
  239. package/packages/contracts/src/rpc.ts +286 -0
  240. package/packages/contracts/src/workflow.ts +213 -0
  241. package/packages/contracts/tsconfig.json +25 -0
  242. package/packages/daemon/package.json +3 -2
  243. package/packages/daemon/src/event-bridge.test.ts +2 -1
  244. package/packages/daemon/src/event-bridge.ts +1 -1
  245. package/packages/daemon/src/event-formatter.test.ts +1 -2
  246. package/packages/daemon/src/event-formatter.ts +1 -2
  247. package/packages/daemon/src/session-manager.ts +2 -2
  248. package/packages/daemon/src/types.ts +3 -18
  249. package/packages/mcp-server/dist/server.d.ts +13 -0
  250. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  251. package/packages/mcp-server/dist/server.js +77 -0
  252. package/packages/mcp-server/dist/server.js.map +1 -1
  253. package/packages/mcp-server/dist/session-manager.js +1 -1
  254. package/packages/mcp-server/dist/session-manager.js.map +1 -1
  255. package/packages/mcp-server/dist/types.d.ts +3 -11
  256. package/packages/mcp-server/dist/types.d.ts.map +1 -1
  257. package/packages/mcp-server/dist/types.js.map +1 -1
  258. package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
  259. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  260. package/packages/mcp-server/dist/workflow-tools.js +2 -40
  261. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  262. package/packages/mcp-server/package.json +3 -2
  263. package/packages/mcp-server/src/mcp-server.test.ts +138 -0
  264. package/packages/mcp-server/src/server.ts +99 -1
  265. package/packages/mcp-server/src/session-manager.ts +2 -2
  266. package/packages/mcp-server/src/types.ts +7 -18
  267. package/packages/mcp-server/src/workflow-tools.ts +2 -40
  268. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  269. package/packages/native/package.json +1 -1
  270. package/packages/pi-agent-core/package.json +1 -1
  271. package/packages/pi-ai/dist/models/fake-model.d.ts +12 -0
  272. package/packages/pi-ai/dist/models/fake-model.d.ts.map +1 -0
  273. package/packages/pi-ai/dist/models/fake-model.js +27 -0
  274. package/packages/pi-ai/dist/models/fake-model.js.map +1 -0
  275. package/packages/pi-ai/dist/models/index.d.ts.map +1 -1
  276. package/packages/pi-ai/dist/models/index.js +8 -0
  277. package/packages/pi-ai/dist/models/index.js.map +1 -1
  278. package/packages/pi-ai/dist/providers/fake.d.ts +42 -0
  279. package/packages/pi-ai/dist/providers/fake.d.ts.map +1 -0
  280. package/packages/pi-ai/dist/providers/fake.js +319 -0
  281. package/packages/pi-ai/dist/providers/fake.js.map +1 -0
  282. package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
  283. package/packages/pi-ai/dist/providers/register-builtins.js +24 -0
  284. package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
  285. package/packages/pi-ai/package.json +1 -1
  286. package/packages/pi-ai/src/models/fake-model.ts +30 -0
  287. package/packages/pi-ai/src/models/index.ts +9 -0
  288. package/packages/pi-ai/src/providers/fake.ts +376 -0
  289. package/packages/pi-ai/src/providers/register-builtins.ts +23 -0
  290. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  291. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +74 -0
  292. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
  293. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -0
  294. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  295. package/packages/pi-coding-agent/dist/core/extensions/runner.js +14 -1
  296. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  297. package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +97 -0
  298. package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
  299. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  300. package/packages/pi-coding-agent/dist/core/model-registry.js +5 -0
  301. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  302. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +4 -0
  303. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  304. package/packages/pi-coding-agent/dist/core/settings-manager.js +8 -0
  305. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  306. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  307. package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
  308. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  309. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +6 -4
  310. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
  311. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +67 -14
  312. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  313. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +26 -0
  314. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -0
  315. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +112 -0
  316. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -0
  317. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts +2 -0
  318. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts.map +1 -0
  319. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +51 -0
  320. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -0
  321. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  322. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
  323. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
  324. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +10 -9
  325. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
  326. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -0
  327. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  328. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +11 -0
  329. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  330. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +27 -6
  331. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
  332. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +16 -0
  333. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  334. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +112 -18
  335. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  336. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  337. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +60 -1
  338. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  339. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +40 -1
  340. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
  341. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +1 -0
  342. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
  343. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
  344. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
  345. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
  346. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +12 -1
  347. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  348. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +54 -10
  349. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  350. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
  351. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +20 -0
  352. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  353. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts +2 -0
  354. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts.map +1 -0
  355. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js +79 -0
  356. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js.map +1 -0
  357. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
  358. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  359. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +13 -0
  360. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  361. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
  362. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  363. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +18 -1
  364. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  365. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  366. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
  367. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  368. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts +11 -0
  369. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts.map +1 -0
  370. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js +18 -0
  371. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js.map +1 -0
  372. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts +2 -0
  373. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts.map +1 -0
  374. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +48 -0
  375. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -0
  376. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -512
  377. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  378. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js +3 -7
  379. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
  380. package/packages/pi-coding-agent/package.json +2 -1
  381. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +87 -0
  382. package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +108 -0
  383. package/packages/pi-coding-agent/src/core/extensions/runner.ts +16 -1
  384. package/packages/pi-coding-agent/src/core/model-registry.ts +4 -0
  385. package/packages/pi-coding-agent/src/core/settings-manager.ts +12 -0
  386. package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
  387. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +7 -5
  388. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +100 -16
  389. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +59 -0
  390. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +160 -0
  391. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
  392. package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +10 -9
  393. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
  394. package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +41 -9
  395. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +124 -18
  396. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +43 -1
  397. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +75 -1
  398. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +1 -0
  399. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -1
  400. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +75 -9
  401. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.test.ts +95 -0
  402. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +24 -1
  403. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +13 -0
  404. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +32 -2
  405. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
  406. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +65 -0
  407. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.ts +29 -0
  408. package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +3 -336
  409. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  410. package/packages/pi-tui/dist/__tests__/style.test.d.ts +2 -0
  411. package/packages/pi-tui/dist/__tests__/style.test.d.ts.map +1 -0
  412. package/packages/pi-tui/dist/__tests__/style.test.js +63 -0
  413. package/packages/pi-tui/dist/__tests__/style.test.js.map +1 -0
  414. package/packages/pi-tui/dist/__tests__/tui.test.js +24 -3
  415. package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
  416. package/packages/pi-tui/dist/index.d.ts +1 -0
  417. package/packages/pi-tui/dist/index.d.ts.map +1 -1
  418. package/packages/pi-tui/dist/index.js +2 -0
  419. package/packages/pi-tui/dist/index.js.map +1 -1
  420. package/packages/pi-tui/dist/style.d.ts +41 -0
  421. package/packages/pi-tui/dist/style.d.ts.map +1 -0
  422. package/packages/pi-tui/dist/style.js +158 -0
  423. package/packages/pi-tui/dist/style.js.map +1 -0
  424. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  425. package/packages/pi-tui/dist/tui.js +1 -0
  426. package/packages/pi-tui/dist/tui.js.map +1 -1
  427. package/packages/pi-tui/package.json +1 -1
  428. package/packages/pi-tui/src/__tests__/style.test.ts +76 -0
  429. package/packages/pi-tui/src/__tests__/tui.test.ts +29 -3
  430. package/packages/pi-tui/src/index.ts +9 -0
  431. package/packages/pi-tui/src/style.ts +225 -0
  432. package/packages/pi-tui/src/tui.ts +1 -0
  433. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  434. package/packages/rpc-client/README.md +3 -3
  435. package/packages/rpc-client/dist/index.d.ts +1 -1
  436. package/packages/rpc-client/dist/index.d.ts.map +1 -1
  437. package/packages/rpc-client/dist/index.js.map +1 -1
  438. package/packages/rpc-client/dist/rpc-client.d.ts +2 -6
  439. package/packages/rpc-client/dist/rpc-client.d.ts.map +1 -1
  440. package/packages/rpc-client/dist/rpc-client.js.map +1 -1
  441. package/packages/rpc-client/dist/rpc-types.d.ts +1 -565
  442. package/packages/rpc-client/dist/rpc-types.d.ts.map +1 -1
  443. package/packages/rpc-client/dist/rpc-types.js +3 -11
  444. package/packages/rpc-client/dist/rpc-types.js.map +1 -1
  445. package/packages/rpc-client/package.json +4 -1
  446. package/packages/rpc-client/src/index.ts +1 -1
  447. package/packages/rpc-client/src/rpc-client.ts +3 -6
  448. package/packages/rpc-client/src/rpc-types.ts +3 -398
  449. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  450. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
  451. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  452. package/pkg/dist/modes/interactive/theme/theme-schema.js +13 -0
  453. package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  454. package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
  455. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  456. package/pkg/dist/modes/interactive/theme/theme.js +18 -1
  457. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  458. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  459. package/pkg/dist/modes/interactive/theme/themes.js +36 -27
  460. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  461. package/pkg/package.json +1 -1
  462. package/src/resources/extensions/github-sync/templates.ts +93 -88
  463. package/src/resources/extensions/github-sync/tests/inline-code.test.ts +66 -0
  464. package/src/resources/extensions/github-sync/tests/templates.test.ts +10 -2
  465. package/src/resources/extensions/gsd/auto/contracts.ts +87 -0
  466. package/src/resources/extensions/gsd/auto/custom-verify-retry-store.ts +72 -0
  467. package/src/resources/extensions/gsd/auto/loop-deps.ts +10 -3
  468. package/src/resources/extensions/gsd/auto/loop.ts +416 -596
  469. package/src/resources/extensions/gsd/auto/orchestrator.ts +161 -0
  470. package/src/resources/extensions/gsd/auto/phases.ts +82 -8
  471. package/src/resources/extensions/gsd/auto/run-unit.ts +24 -14
  472. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  473. package/src/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.ts +28 -0
  474. package/src/resources/extensions/gsd/auto/workflow-custom-engine-iteration.ts +52 -0
  475. package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.ts +58 -0
  476. package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.ts +71 -0
  477. package/src/resources/extensions/gsd/auto/workflow-custom-engine-retry.ts +90 -0
  478. package/src/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.ts +50 -0
  479. package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +97 -0
  480. package/src/resources/extensions/gsd/auto/workflow-dispatch-ledger.ts +45 -0
  481. package/src/resources/extensions/gsd/auto/workflow-iteration-completion.ts +26 -0
  482. package/src/resources/extensions/gsd/auto/workflow-journal-reporter.ts +33 -0
  483. package/src/resources/extensions/gsd/auto/workflow-kernel.ts +520 -0
  484. package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +58 -0
  485. package/src/resources/extensions/gsd/auto/workflow-phase-reporter.ts +22 -0
  486. package/src/resources/extensions/gsd/auto/workflow-session-lock.ts +68 -0
  487. package/src/resources/extensions/gsd/auto/workflow-sidecar-iteration.ts +46 -0
  488. package/src/resources/extensions/gsd/auto/workflow-sidecar-queue.ts +46 -0
  489. package/src/resources/extensions/gsd/auto/workflow-turn-reporter.ts +68 -0
  490. package/src/resources/extensions/gsd/auto/workflow-unit-dispatch.ts +89 -0
  491. package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +38 -0
  492. package/src/resources/extensions/gsd/auto-dashboard.ts +61 -8
  493. package/src/resources/extensions/gsd/auto-dispatch.ts +17 -0
  494. package/src/resources/extensions/gsd/auto-prompts.ts +170 -3
  495. package/src/resources/extensions/gsd/auto-recovery.ts +194 -56
  496. package/src/resources/extensions/gsd/auto-runtime-state.ts +7 -0
  497. package/src/resources/extensions/gsd/auto-start.ts +7 -6
  498. package/src/resources/extensions/gsd/auto-verification.ts +5 -1
  499. package/src/resources/extensions/gsd/auto-worktree.ts +85 -36
  500. package/src/resources/extensions/gsd/auto.ts +179 -2
  501. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +30 -2
  502. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +11 -0
  503. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +30 -6
  504. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +135 -1
  505. package/src/resources/extensions/gsd/commands-extract-learnings.ts +17 -12
  506. package/src/resources/extensions/gsd/commands-ship.ts +24 -51
  507. package/src/resources/extensions/gsd/commands-workflow-templates.ts +13 -0
  508. package/src/resources/extensions/gsd/component-loader.ts +5 -11
  509. package/src/resources/extensions/gsd/custom-workflow-engine.ts +29 -0
  510. package/src/resources/extensions/gsd/db-adapter.ts +75 -0
  511. package/src/resources/extensions/gsd/db-base-schema.ts +383 -0
  512. package/src/resources/extensions/gsd/db-connection-cache.ts +45 -0
  513. package/src/resources/extensions/gsd/db-coordination-schema.ts +109 -0
  514. package/src/resources/extensions/gsd/db-decision-requirement-rows.ts +77 -0
  515. package/src/resources/extensions/gsd/db-gate-rows.ts +19 -0
  516. package/src/resources/extensions/gsd/db-lightweight-query-rows.ts +50 -0
  517. package/src/resources/extensions/gsd/db-memory-fts-schema.ts +66 -0
  518. package/src/resources/extensions/gsd/db-migration-backup.ts +34 -0
  519. package/src/resources/extensions/gsd/db-migration-steps.ts +451 -0
  520. package/src/resources/extensions/gsd/db-milestone-artifact-rows.ts +70 -0
  521. package/src/resources/extensions/gsd/db-open-state.ts +47 -0
  522. package/src/resources/extensions/gsd/db-provider.ts +148 -0
  523. package/src/resources/extensions/gsd/db-runtime-kv-schema.ts +30 -0
  524. package/src/resources/extensions/gsd/db-schema-metadata.ts +33 -0
  525. package/src/resources/extensions/gsd/db-task-slice-rows.ts +146 -0
  526. package/src/resources/extensions/gsd/db-transaction.ts +76 -0
  527. package/src/resources/extensions/gsd/db-verification-evidence-rows.ts +14 -0
  528. package/src/resources/extensions/gsd/db-verification-evidence-schema.ts +22 -0
  529. package/src/resources/extensions/gsd/escalation.ts +3 -1
  530. package/src/resources/extensions/gsd/graph.ts +12 -5
  531. package/src/resources/extensions/gsd/gsd-db.ts +379 -1660
  532. package/src/resources/extensions/gsd/guided-flow.ts +2 -2
  533. package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
  534. package/src/resources/extensions/gsd/legacy-telemetry.ts +99 -0
  535. package/src/resources/extensions/gsd/markdown-renderer.ts +4 -1
  536. package/src/resources/extensions/gsd/model-router.ts +10 -6
  537. package/src/resources/extensions/gsd/notification-widget.ts +25 -4
  538. package/src/resources/extensions/gsd/post-execution-checks.ts +35 -7
  539. package/src/resources/extensions/gsd/pr-evidence.ts +182 -0
  540. package/src/resources/extensions/gsd/pre-execution-checks.ts +4 -1
  541. package/src/resources/extensions/gsd/process-task-path.ts +81 -0
  542. package/src/resources/extensions/gsd/prompt-loader.ts +9 -5
  543. package/src/resources/extensions/gsd/prompts/complete-milestone.md +32 -30
  544. package/src/resources/extensions/gsd/prompts/complete-slice.md +23 -34
  545. package/src/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
  546. package/src/resources/extensions/gsd/prompts/discuss.md +81 -181
  547. package/src/resources/extensions/gsd/prompts/execute-task.md +40 -67
  548. package/src/resources/extensions/gsd/prompts/forensics.md +41 -84
  549. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
  550. package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
  551. package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
  552. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
  553. package/src/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
  554. package/src/resources/extensions/gsd/prompts/plan-milestone.md +45 -59
  555. package/src/resources/extensions/gsd/prompts/plan-slice.md +25 -87
  556. package/src/resources/extensions/gsd/prompts/queue.md +46 -53
  557. package/src/resources/extensions/gsd/prompts/refine-slice.md +23 -23
  558. package/src/resources/extensions/gsd/prompts/research-slice.md +23 -23
  559. package/src/resources/extensions/gsd/prompts/rethink.md +10 -10
  560. package/src/resources/extensions/gsd/prompts/system.md +65 -107
  561. package/src/resources/extensions/gsd/prompts/triage-captures.md +15 -15
  562. package/src/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
  563. package/src/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
  564. package/src/resources/extensions/gsd/state.ts +6 -3
  565. package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +38 -0
  566. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +98 -0
  567. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +117 -0
  568. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +353 -0
  569. package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +19 -0
  570. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +170 -1
  571. package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +39 -0
  572. package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +3 -0
  573. package/src/resources/extensions/gsd/tests/commands-eval-review.test.ts +2 -2
  574. package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +9 -0
  575. package/src/resources/extensions/gsd/tests/commands-ship-eval-warn.test.ts +3 -2
  576. package/src/resources/extensions/gsd/tests/complete-milestone-prompt-rendering.test.ts +47 -0
  577. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +19 -5
  578. package/src/resources/extensions/gsd/tests/component-loader.test.ts +2 -9
  579. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +144 -0
  580. package/src/resources/extensions/gsd/tests/custom-verify-retry-store.test.ts +139 -0
  581. package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +50 -0
  582. package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +3 -3
  583. package/src/resources/extensions/gsd/tests/db-adapter.test.ts +82 -0
  584. package/src/resources/extensions/gsd/tests/db-base-schema.test.ts +62 -0
  585. package/src/resources/extensions/gsd/tests/db-connection-cache.test.ts +60 -0
  586. package/src/resources/extensions/gsd/tests/db-coordination-schema.test.ts +39 -0
  587. package/src/resources/extensions/gsd/tests/db-decision-requirement-rows.test.ts +135 -0
  588. package/src/resources/extensions/gsd/tests/db-gate-rows.test.ts +53 -0
  589. package/src/resources/extensions/gsd/tests/db-lightweight-query-rows.test.ts +45 -0
  590. package/src/resources/extensions/gsd/tests/db-memory-fts-schema.test.ts +86 -0
  591. package/src/resources/extensions/gsd/tests/db-migration-backup.test.ts +105 -0
  592. package/src/resources/extensions/gsd/tests/db-migration-steps.integration.test.ts +428 -0
  593. package/src/resources/extensions/gsd/tests/db-migration-steps.test.ts +159 -0
  594. package/src/resources/extensions/gsd/tests/db-milestone-artifact-rows.test.ts +53 -0
  595. package/src/resources/extensions/gsd/tests/db-open-state.test.ts +56 -0
  596. package/src/resources/extensions/gsd/tests/db-provider.test.ts +105 -0
  597. package/src/resources/extensions/gsd/tests/db-runtime-kv-schema.test.ts +37 -0
  598. package/src/resources/extensions/gsd/tests/db-schema-metadata.test.ts +115 -0
  599. package/src/resources/extensions/gsd/tests/db-task-slice-rows.test.ts +128 -0
  600. package/src/resources/extensions/gsd/tests/db-transaction.test.ts +110 -0
  601. package/src/resources/extensions/gsd/tests/db-verification-evidence-schema.test.ts +76 -0
  602. package/src/resources/extensions/gsd/tests/discuss-headless-rendering.test.ts +37 -0
  603. package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +59 -0
  604. package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-basic.md +52 -0
  605. package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-empty-optionals.md +42 -0
  606. package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +55 -0
  607. package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +60 -0
  608. package/src/resources/extensions/gsd/tests/forensics-prompt-rendering.test.ts +36 -0
  609. package/src/resources/extensions/gsd/tests/graph-operations.test.ts +10 -0
  610. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +139 -0
  611. package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +43 -0
  612. package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +41 -0
  613. package/src/resources/extensions/gsd/tests/guided-discuss-requirements-prompt-rendering.test.ts +45 -0
  614. package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
  615. package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +79 -0
  616. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +37 -0
  617. package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +5 -3
  618. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +134 -0
  619. package/src/resources/extensions/gsd/tests/legacy-component-format-telemetry.test.ts +62 -0
  620. package/src/resources/extensions/gsd/tests/legacy-telemetry.test.ts +144 -0
  621. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +40 -16
  622. package/src/resources/extensions/gsd/tests/model-router.test.ts +33 -12
  623. package/src/resources/extensions/gsd/tests/notification-store.test.ts +8 -0
  624. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +40 -1
  625. package/src/resources/extensions/gsd/tests/paused-session-via-db.test.ts +2 -0
  626. package/src/resources/extensions/gsd/tests/plan-milestone-rendering.test.ts +45 -0
  627. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +65 -16
  628. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +27 -0
  629. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +46 -0
  630. package/src/resources/extensions/gsd/tests/pr-evidence-equivalence.test.ts +102 -0
  631. package/src/resources/extensions/gsd/tests/pr-evidence-hardening.test.ts +165 -0
  632. package/src/resources/extensions/gsd/tests/pr-evidence.test.ts +79 -0
  633. package/src/resources/extensions/gsd/tests/process-task-path.test.ts +51 -0
  634. package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +16 -1
  635. package/src/resources/extensions/gsd/tests/queue-prompt-rendering.test.ts +37 -0
  636. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +46 -2
  637. package/src/resources/extensions/gsd/tests/tool-naming.test.ts +32 -9
  638. package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +6 -6
  639. package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +12 -0
  640. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
  641. package/src/resources/extensions/gsd/tests/workflow-custom-engine-dispatch-outcome.test.ts +55 -0
  642. package/src/resources/extensions/gsd/tests/workflow-custom-engine-iteration.test.ts +93 -0
  643. package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile-outcome.test.ts +108 -0
  644. package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile.test.ts +146 -0
  645. package/src/resources/extensions/gsd/tests/workflow-custom-engine-retry.test.ts +136 -0
  646. package/src/resources/extensions/gsd/tests/workflow-custom-engine-verify-outcome.test.ts +95 -0
  647. package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +158 -0
  648. package/src/resources/extensions/gsd/tests/workflow-dispatch-ledger.test.ts +82 -0
  649. package/src/resources/extensions/gsd/tests/workflow-iteration-completion.test.ts +44 -0
  650. package/src/resources/extensions/gsd/tests/workflow-journal-reporter.test.ts +49 -0
  651. package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +607 -0
  652. package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +20 -4
  653. package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +71 -0
  654. package/src/resources/extensions/gsd/tests/workflow-phase-reporter.test.ts +40 -0
  655. package/src/resources/extensions/gsd/tests/workflow-session-lock.test.ts +135 -0
  656. package/src/resources/extensions/gsd/tests/workflow-sidecar-iteration.test.ts +110 -0
  657. package/src/resources/extensions/gsd/tests/workflow-sidecar-queue.test.ts +116 -0
  658. package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +21 -0
  659. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +32 -0
  660. package/src/resources/extensions/gsd/tests/workflow-turn-reporter.test.ts +87 -0
  661. package/src/resources/extensions/gsd/tests/workflow-unit-dispatch.test.ts +160 -0
  662. package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +123 -0
  663. package/src/resources/extensions/gsd/tests/working-output-messages.test.ts +93 -0
  664. package/src/resources/extensions/gsd/tests/worktree-submodule-safety.test.ts +17 -33
  665. package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +179 -0
  666. package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
  667. package/src/resources/extensions/gsd/tools/complete-task.ts +4 -1
  668. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +6 -1
  669. package/src/resources/extensions/gsd/unit-context-composer.ts +1 -1
  670. package/src/resources/extensions/gsd/uok/kernel.ts +10 -3
  671. package/src/resources/extensions/gsd/uok/plan-v2.ts +5 -1
  672. package/src/resources/extensions/gsd/workflow-logger.ts +13 -13
  673. package/src/resources/extensions/gsd/workflow-manifest.ts +6 -15
  674. package/src/resources/extensions/gsd/workflow-projections.ts +5 -1
  675. package/src/resources/extensions/gsd/workflow-templates.ts +11 -0
  676. package/src/resources/extensions/gsd/working-output-messages.ts +120 -0
  677. package/src/resources/extensions/shared/interview-ui.ts +18 -5
  678. package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +41 -0
  679. package/dist/web/standalone/.next/server/chunks/6336.js +0 -1
  680. /package/dist/web/standalone/.next/static/{TzEVJ1Lh8vbez4n4Q9TqQ → vIAZSyxIuvqNkCvXt9oqb}/_buildManifest.js +0 -0
  681. /package/dist/web/standalone/.next/static/{TzEVJ1Lh8vbez4n4Q9TqQ → vIAZSyxIuvqNkCvXt9oqb}/_ssgManifest.js +0 -0
@@ -1,8 +1,8 @@
1
- **Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` to any other directory. For `.gsd` files in this prompt, use absolute paths rooted at `{{workingDirectory}}` instead of discovering them with `Glob`.
1
+ **Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` elsewhere. For `.gsd` files, use absolute paths rooted at `{{workingDirectory}}`, not `Glob`.
2
2
 
3
- Discuss the **project** as a whole. Identify gray areas at the project level — vision, users, anti-goals, key constraints ask the user about them, and write `.gsd/PROJECT.md` with the decisions. Use the **Project** output template below. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow; do not override required artifact rules.
3
+ Discuss the **project** as a whole: vision, users, anti-goals, constraints, and rough milestone sequence. Ask only real gray areas, then write `.gsd/PROJECT.md` with the **Project** template below. If a `GSD Skill Preferences` block exists, use it; artifact rules still apply.
4
4
 
5
- This stage runs ONCE per project, before any milestone-level discussion. It produces the project-level context that all subsequent milestones, requirements, and roadmaps will reference.
5
+ This runs once before milestone discussion. Later milestones, requirements, and roadmaps depend on it.
6
6
 
7
7
  **Structured questions available: {{structuredQuestionsAvailable}}**
8
8
 
@@ -22,115 +22,80 @@ Before your first action, print this banner verbatim in chat:
22
22
 
23
23
  ### Open the conversation
24
24
 
25
- Ask the user a single freeform question in plain text, not structured: **"What do you want to build?"**
26
-
27
- Wait for their response. This grounds every follow-up in their own terminology.
25
+ Ask the user a single freeform question in plain text, not structured: **"What do you want to build?"** Wait for the response so follow-ups use their terminology.
28
26
 
29
27
  ### Classify project shape
30
28
 
31
- After the opening answer, classify the project as **`simple`** or **`complex`** before continuing. Print the verdict in chat as one line: `Project shape: simple` or `Project shape: complex` followed by a one-line rationale.
29
+ After the opening answer, classify project shape as **`simple`** or **`complex`**. Print exactly one verdict line, `Project shape: simple` or `Project shape: complex`, plus a one-line rationale.
32
30
 
33
- **`simple`** — most of these apply: single primary user (the user themselves or one immediate team), no external integrations beyond well-known SDKs/libs, greenfield or self-contained, scope describable in 12 sentences without ambiguity, no compliance/regulatory needs, 5 distinct capabilities.
31
+ **`simple`** — most apply: single primary user/team, no integrations beyond common SDKs/libs, greenfield/self-contained, scope fits 1-2 sentences, no compliance/regulatory needs, <=5 capabilities.
34
32
 
35
- **`complex`** — any of these apply: multi-user with roles/permissions, non-trivial brownfield codebase, external integrations with auth/data exchange, compliance/security/regulated domain (PII, payments, healthcare), >5 capabilities or unclear scope, cross-team/cross-org coordination, novel domain where assumptions need validation.
33
+ **`complex`** — any apply: roles/permissions, non-trivial brownfield codebase, auth/data integrations, compliance/security/regulated domain such as PII/payments/healthcare, >5 capabilities or unclear scope, cross-team/org work, novel domain needing validation.
36
34
 
37
35
  **Default to `complex` when uncertain.** The user can override the verdict in plain text; if they do, accept it and proceed.
38
36
 
39
- The verdict drives the rest of this stage and gets persisted to PROJECT.md `## Project Shape`. Downstream stages (`discuss-requirements`, `discuss-milestone`, `discuss-slice`) read it from there.
37
+ Persist the verdict to PROJECT.md -> `## Project Shape`; downstream `discuss-requirements`, `discuss-milestone`, and `discuss-slice` read it from there.
40
38
 
41
39
  ### Before deeper rounds
42
40
 
43
- Do a lightweight targeted investigation so your questions are grounded in reality:
44
- - Scout the codebase (`rg`, `find`, or `scout`) is this greenfield or brownfield? What language/framework signals exist?
45
- - Identify any prior `.planning/` or `.gsd/` artifacts hinting at history
46
- - Use `resolve_library` / `get_library_docs` for unfamiliar libraries the user mentions
47
-
48
- **Web search budget:** typically 3–5 per turn. Prefer `resolve_library` / `get_library_docs` for library docs. Target 2–3 web searches in the investigation pass; distribute remaining searches across follow-up rounds.
41
+ Investigate enough to avoid assumption-driven questions:
42
+ - Scout code with `rg`, `find`, or `scout` for greenfield/brownfield and framework signals.
43
+ - Check prior `.planning/` or `.gsd/` artifacts.
44
+ - Use `resolve_library` / `get_library_docs` for unfamiliar mentioned libraries.
49
45
 
50
- Do **not** go deep just enough that your follow-ups reflect what's actually true rather than what you assume.
46
+ **Web search budget:** typically 3-5 per turn. Prefer docs tools; use 2-3 searches first and save the rest.
51
47
 
52
48
  ### Question rounds
53
49
 
54
- Ask **1–3 questions per round**. Each round targets one of:
55
- - **What they're building** — concrete enough to describe to a stranger
56
- - **Who it's for** — primary users, secondary users, internal vs external
57
- - **The core value** — the ONE thing that must work even if everything else is cut
58
- - **Anti-goals** — what they explicitly don't want, what would disappoint them
59
- - **Constraints** — budget, timeline, tech limitations, irreversible architectural choices
60
- - **Existing context** — prior work, brownfield state, decisions already made
61
- - **Milestone shape** — rough version sequence (v1 / v1.1 / ...) and what differentiates them
50
+ Ask **1–3 questions per round**, one focus at a time: what, who, core value, anti-goals, constraints, existing context, or milestone shape.
62
51
 
63
52
  **Never fabricate or simulate user input.** Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
64
53
 
65
- **Cadence is shape-dependent:**
66
- - **`simple`** — favor 12 plain-text rounds. Skip `ask_user_questions` unless you are presenting concrete alternatives. Get to the depth checklist fast.
67
- - **`complex`** full investigation, multiple rounds, structured questions when meaningful alternatives exist.
54
+ **Shape-dependent cadence:**
55
+ - **`simple`**: 1-2 plain-text rounds; use `ask_user_questions` only for concrete alternatives; reach the depth checklist quickly.
56
+ - **`complex`**: full investigation, multiple rounds, structured questions when meaningful alternatives exist.
68
57
 
69
- **If `{{structuredQuestionsAvailable}}` is `true` and you use `ask_user_questions`:** ask 13 questions per call. Every question object MUST include a stable lowercase `id`. Keep option labels short (35 words). In **`complex`** mode, each multi-choice question MUST present **3 or 4 concrete, researched options** plus a final **"Other — let me discuss"** option; options must be grounded in your investigation (codebase signals, library docs, prior `.gsd/` artifacts), not generic placeholders. In **`simple`** mode, 2 options is fine. Binary depth-check / wrap-up gates are exempt from the 3-or-4 rule. Wait for each tool result before asking the next round.
58
+ **If `{{structuredQuestionsAvailable}}` is `true` and you use `ask_user_questions`:** ask 1-3 questions per call. Every question needs stable lowercase `id`. Keep labels short (3-5 words). In **`complex`** mode, multi-choice questions MUST offer **3 or 4 concrete, researched options** plus **"Other — let me discuss"**; options must be grounded in the investigation, not placeholders. In **`simple`** mode, 2 options is fine. Binary depth-check/wrap-up gates are exempt. Wait for each tool result before the next round.
70
59
 
71
60
  **If `{{structuredQuestionsAvailable}}` is `false`:** ask questions in plain text. Keep each round to 1–3 focused questions.
72
61
 
73
- After each round, investigate further if any answer opens a new unknown, then ask the next round.
62
+ After each round, investigate only new unknowns, then ask the next round.
74
63
 
75
64
  ### Round cadence
76
65
 
77
- After each round, decide whether you have enough depth to write a strong PROJECT.md.
66
+ After each round, decide whether PROJECT.md would be strong enough.
78
67
 
79
- - **Incremental persistence:** After every 2 question rounds, silently save `.gsd/PROJECT-DRAFT.md` using `gsd_summary_save` with `artifact_type: "PROJECT-DRAFT"` and no `milestone_id`. Crash protection. Do NOT mention this save to the user.
68
+ - **Incremental persistence:** After every 2 question rounds, silently save `.gsd/PROJECT-DRAFT.md` via `gsd_summary_save` with `artifact_type: "PROJECT-DRAFT"` and no `milestone_id`. Do NOT mention this save to the user.
80
69
  - If not ready, continue to the next round.
81
- - Use a wrap-up prompt only when you believe the depth checklist below is satisfied or the user signals they want to stop.
70
+ - Use a wrap-up prompt only when the depth checklist is satisfied or the user wants to stop.
82
71
 
83
72
  ---
84
73
 
85
74
  ## Questioning philosophy
86
75
 
87
- **Start open, follow energy.** Let the user's enthusiasm guide where you dig deeper.
88
-
89
- **Challenge vagueness.** When the user says "it should be smart" or "good UX", push for specifics.
76
+ Start open and follow the user's language. Challenge vague phrases with specifics. Use position-first framing when useful: "I'd lean toward X because Y — does that match your thinking?" Ask what would disappoint them and what they do not want.
90
77
 
91
- **Position-first framing.** Have opinions. "I'd lean toward X because Y does that match your thinking?" is better than "what do you think about X vs Y?"
92
-
93
- **Negative constraints.** Ask what would disappoint them. What they explicitly don't want. Negative constraints are sharper than positive wishes.
94
-
95
- **Anti-patterns — never do these:**
96
- - Checklist walking through predetermined topics regardless of what the user said
97
- - Canned generic questions ("What are your key success metrics?")
98
- - Rapid-fire questions without acknowledging answers
99
- - Asking about technical skill level
100
- - Asking about specific milestone implementations — that's the next stage
78
+ **Anti-patterns never do these:** checklist walking, canned questions ("What are your key success metrics?"), rapid-fire interrogation, asking about technical skill level, or asking milestone implementation details.
101
79
 
102
80
  ---
103
81
 
104
82
  ## Depth Verification
105
83
 
106
- Before moving to the wrap-up gate, verify you have covered:
107
-
108
- - [ ] What they're building — concrete enough to describe to a stranger
109
- - [ ] Who it's for
110
- - [ ] Core value (the ONE thing that must work)
111
- - [ ] Anti-goals / explicit non-wants
112
- - [ ] Constraints (budget, time, tech, architecture)
113
- - [ ] Greenfield vs brownfield state
114
- - [ ] Rough milestone sequence (at least M001's intent)
84
+ Before the wrap-up gate, verify coverage: what they're building, who it's for, core value, anti-goals, constraints, greenfield/brownfield state, and rough milestone sequence.
115
85
 
116
- **Print a structured depth summary in chat first** using the user's own terminology. Cover what you understood, what shaped your understanding, and any areas of remaining uncertainty.
86
+ **Print a structured depth summary in chat first** using the user's terminology: what you understood, what shaped it, and remaining uncertainty.
117
87
 
118
88
  **Then confirm:**
119
89
 
120
- **If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions` with:
121
- - header: "Depth Check"
122
- - id: "depth_verification_project_confirm"
123
- - question: "Did I capture the depth right?"
124
- - options: "Yes, you got it (Recommended)", "Not quite — let me clarify"
125
- - **The question ID must contain `depth_verification_project`** — this enables the write-gate downstream.
90
+ **If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions` with header "Depth Check", id "depth_verification_project_confirm", question "Did I capture the depth right?", and options "Yes, you got it (Recommended)" / "Not quite — let me clarify". **The question ID must contain `depth_verification_project`** so the write-gate can detect it.
126
91
 
127
- **If `{{structuredQuestionsAvailable}}` is `false`:** ask in plain text: "Did I capture that correctly? If not, tell me what I missed." Wait for explicit confirmation. **The same non-bypassable gate applies to the plain-text path** if the user does not respond, gives an ambiguous answer, or does not explicitly confirm, you MUST re-ask.
92
+ **If `{{structuredQuestionsAvailable}}` is `false`:** ask in plain text: "Did I capture that correctly? If not, tell me what I missed." Wait for explicit confirmation. **The same non-bypassable gate applies to the plain-text path**: if the user does not respond, gives an ambiguous answer, or does not explicitly confirm, re-ask.
128
93
 
129
94
  If they clarify, absorb the correction and re-verify.
130
95
 
131
96
  The depth verification is the only required confirmation gate. Do not add a second "ready to proceed?" gate after it.
132
97
 
133
- **CRITICAL — Confirmation gate:** Do not write final PROJECT.md until the user selects the "(Recommended)" option (structured path) or explicitly confirms (plain-text path). If the user declines, cancels, does not respond, or the tool fails, you MUST re-ask — never rationalize past the block.
98
+ **CRITICAL — Confirmation gate:** Do not write final PROJECT.md until the user selects the "(Recommended)" option (structured path) or explicitly confirms (plain-text path). If the user declines, cancels, does not respond, or the tool fails, re-ask.
134
99
 
135
100
  ---
136
101
 
@@ -139,7 +104,7 @@ The depth verification is the only required confirmation gate. Do not add a seco
139
104
  Once the user confirms depth:
140
105
 
141
106
  1. Use the **Project** output template (inlined above).
142
- 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and the full project markdown as `content`; omit `milestone_id`. The tool writes `.gsd/PROJECT.md` to disk and persists to DB. Preserve the user's exact terminology, emphasis, and framing.
107
+ 2. Call `gsd_summary_save` with `artifact_type: "PROJECT"` and full project markdown as `content`; omit `milestone_id`. The tool writes `.gsd/PROJECT.md` and persists to DB. Preserve the user's terms and framing.
143
108
  3. The `## Project Shape` section MUST contain `**Complexity:** simple` or `**Complexity:** complex` (matching the verdict you announced) plus a one-line `**Why:**` rationale. Downstream stages read this line.
144
109
  4. The `## Capability Contract` section MUST reference `.gsd/REQUIREMENTS.md` — that file does not yet exist; the next stage (`discuss-requirements`) will produce it.
145
110
  5. The `## Milestone Sequence` MUST list at least M001 with title and one-liner. Subsequent milestones may be listed as known intents; they will be elaborated in their own discuss-milestone stages.
@@ -1,8 +1,8 @@
1
- **Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` to any other directory. For `.gsd` files in this prompt, use absolute paths rooted at `{{workingDirectory}}` instead of discovering them with `Glob`.
1
+ **Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` elsewhere. For `.gsd` files, use absolute paths rooted at `{{workingDirectory}}`, not `Glob`.
2
2
 
3
- Discuss **project-level requirements**. Read `.gsd/PROJECT.md` first it is the authoritative source for vision, core value, anti-goals, and milestone sequence. All requirements must trace back to it. Identify gray areas about what capabilities the project must deliver, ask the user, and write `.gsd/REQUIREMENTS.md` using the v2 structured `R###` format. Use the **Requirements** output template below.
3
+ Discuss **project-level requirements**. Read `.gsd/PROJECT.md` first; it is authoritative for vision, core value, anti-goals, and milestone sequence. Requirements must trace to it. Ask capability gray areas, then write `.gsd/REQUIREMENTS.md` using v2 `R###` format and the **Requirements** template.
4
4
 
5
- This stage runs ONCE per project, after `discuss-project` and before any milestone-level work. It produces the explicit capability contract that all milestones, slices, and verification will reference.
5
+ This runs once after `discuss-project` and before milestone work, creating the capability contract for milestones, slices, and verification.
6
6
 
7
7
  **Structured questions available: {{structuredQuestionsAvailable}}**
8
8
 
@@ -20,13 +20,13 @@ Before your first action, print this banner verbatim in chat:
20
20
 
21
21
  ## Pre-flight
22
22
 
23
- 1. Read `.gsd/PROJECT.md` end-to-end. If it does not exist, STOP and emit: `"PROJECT.md missing — run discuss-project first."`
24
- 2. Extract: Core Value, Anti-goals, Constraints, Milestone Sequence, and the project shape verdict — read the `## Project Shape` section and look for `**Complexity:**` (verdict is either `simple` or `complex`; default to `complex` if the section is missing or unclear).
25
- 3. Check for existing `.gsd/REQUIREMENTS.md` — if present, this is a refinement pass, not a fresh write. Read existing requirements and treat them as the working set.
23
+ 1. Read `.gsd/PROJECT.md` end-to-end. If missing, STOP and emit: `"PROJECT.md missing — run discuss-project first."`
24
+ 2. Extract Core Value, Anti-goals, Constraints, Milestone Sequence, and project shape from `## Project Shape` -> `**Complexity:**` (`simple` or `complex`; default to `complex` if missing/unclear).
25
+ 3. If `.gsd/REQUIREMENTS.md` exists, read it as the working set.
26
26
 
27
27
  **Shape-dependent cadence:**
28
- - **`simple`** favor a single fast pass: extract requirements directly from PROJECT.md, ask 12 plain-text clarifying questions only if a class or status assignment is genuinely ambiguous, then write REQUIREMENTS.md.
29
- - **`complex`** — full multi-round questioning with structured 34-option questions where alternatives matter.
28
+ - **`simple`**: one fast pass. Extract from PROJECT.md, ask 1-2 plain-text clarifiers only when class/status is ambiguous, then write REQUIREMENTS.md.
29
+ - **`complex`**: multi-round questioning with structured 3-4-option questions where alternatives matter.
30
30
 
31
31
  ---
32
32
 
@@ -34,75 +34,48 @@ Before your first action, print this banner verbatim in chat:
34
34
 
35
35
  ### Before your first question round
36
36
 
37
- Investigate to ground requirements in reality:
38
- - Scout the codebase for existing capabilities (anything already built counts as `Validated` or `Active`)
39
- - Cross-check the project's milestone sequence every milestone must have at least one Active requirement it owns
40
- - Use `resolve_library` / `get_library_docs` for libraries that imply capabilities (auth library → auth requirements)
41
- - Identify table-stakes capabilities for the domain (research the domain only if PROJECT.md confidence is low)
37
+ Before questioning, investigate enough to avoid assumption-driven requirements:
38
+ - Scout existing capabilities; already-built work is `Validated` or `Active`.
39
+ - Cross-check milestone sequence; every milestone needs at least one owned Active requirement.
40
+ - Use `resolve_library` / `get_library_docs` for libraries that imply capabilities.
41
+ - Identify domain table-stakes only when PROJECT.md confidence is low.
42
42
 
43
- **Web search budget:** 3–5 per turn. Target 1–2 web searches in this pre-investigation; reserve the rest for follow-ups.
43
+ **Web search budget:** 3–5 per turn. Use 1–2 in pre-investigation; reserve the rest for follow-ups.
44
44
 
45
45
  ### Question rounds
46
46
 
47
- Ask **1–3 questions per round**. Each round targets one dimension:
48
-
49
- - **Capability scoping** — what must the project DO at the capability level? (Not features, capabilities. "User can recover account" not "Forgot-password button")
50
- - **Class assignment** — for each capability, which class? (`core-capability`, `primary-user-loop`, `launchability`, `continuity`, `failure-visibility`, `integration`, `quality-attribute`, `operability`, `admin/support`, `compliance/security`, `differentiator`, `constraint`, `anti-feature`)
51
- - **Milestone ownership** — which milestone in the sequence will own this capability? Provisional ownership for later milestones is fine.
52
- - **Status** — Active (must build), Deferred (later), Out of Scope (explicit no), Validated (already proven)
53
- - **Anti-features** — what capabilities are explicitly excluded? Capture as `out-of-scope` with rationale.
54
- - **Quality attributes** — performance, reliability, observability, security thresholds. These are requirements too.
47
+ Ask **1–3 questions per round**, one dimension at a time: capability scoping, class assignment, milestone ownership, status, anti-features, or quality attributes. Keep capabilities testable: "User can recover account", not "Forgot-password button".
55
48
 
56
49
  **Never fabricate or simulate user input.** Wait for actual responses.
57
50
 
58
- **If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions`. Every question object MUST include a stable lowercase `id`. For class assignments, present the allowed classes as multi-select options. For status, present the four statuses as exclusive options. In **`complex`** mode, any free-form question MUST present **3 or 4 concrete, researched options** plus a final **"Other — let me discuss"** option grounded in the investigation above. The class-assignment and status questions are exempt they have fixed enumerations. Ask 13 questions per call. Wait for each tool result before asking the next round.
51
+ **If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions`. Every question needs stable lowercase `id`. For class assignments, present allowed classes as multi-select options. For status, present the four statuses as exclusive options. In **`complex`** mode, free-form questions MUST offer **3 or 4 concrete, researched options** plus **"Other — let me discuss"** grounded in investigation. class-assignment and status questions are exempt because they have fixed enumerations. Ask 1-3 questions per call and wait.
59
52
 
60
53
  **If `{{structuredQuestionsAvailable}}` is `false`:** ask in plain text. Keep each round to 1–3 questions.
61
54
 
62
55
  ### Round cadence
63
56
 
64
- - **Incremental persistence:** After every 2 question rounds, silently save the current requirements draft using `gsd_summary_save` with `artifact_type: "REQUIREMENTS-DRAFT"` and no `milestone_id`. Crash protection. Do NOT mention this save.
57
+ - **Incremental persistence:** After every 2 question rounds, silently save the draft using `gsd_summary_save` with `artifact_type: "REQUIREMENTS-DRAFT"` and no `milestone_id`. Do NOT mention this save to the user.
65
58
  - Continue rounds until the depth checklist is satisfied or the user signals stop.
66
59
 
67
60
  ---
68
61
 
69
62
  ## Questioning philosophy
70
63
 
71
- **Capability-oriented, not feature-oriented.** "User can authenticate" is a capability. "Sign-up button shows on landing page" is implementation. Push back when users describe implementation extract the underlying capability.
72
-
73
- **Position-first framing.** Have opinions. "I'd suggest making this Active because the milestone goal can't ship without it — sound right?"
64
+ Stay capability-oriented, not feature-oriented: "User can authenticate" is a capability; "Sign-up button shows on landing page" is implementation. Use position-first framing: "I'd suggest making this Active because the milestone goal can't ship without it — sound right?" Make each requirement atomic and testable.
74
65
 
75
- **Atomic and testable.** Each requirement should be one verifiable thing. Reject "user can sign up and manage profile" split it.
76
-
77
- **Anti-patterns — never do these:**
78
- - Listing every conceivable feature ("requirement inflation")
79
- - Vague verbs ("Handle", "Support") — push for "User can X" or "System emits Y when Z"
80
- - Skipping anti-features — explicit out-of-scope is part of the contract
81
- - Mapping requirements to slices that don't exist yet — use `M###/none yet` with the milestone id required
66
+ **Anti-patterns never do these:** requirement inflation; vague verbs ("Handle", "Support"); skipping anti-features; mapping to slices that do not exist yet. Use `M###/none yet` with the milestone id required, never bare `none yet`.
82
67
 
83
68
  ---
84
69
 
85
70
  ## Depth Verification
86
71
 
87
- Before the wrap-up gate, verify:
88
-
89
- - [ ] Every milestone in PROJECT.md has at least one Active requirement
90
- - [ ] Core Value (from PROJECT.md) is covered by at least one Active requirement
91
- - [ ] Each Active requirement has: ID, title, class, status, description, why-it-matters, source, primary owner (`M###/S##` or `M###/none yet`; never bare `none yet`), validation, notes
92
- - [ ] At least one explicit Out of Scope entry per major capability area (anti-features captured)
93
- - [ ] Quality attributes (performance, reliability, etc.) captured where the user has stated thresholds
94
- - [ ] No requirement is implementation-flavored ("button", "endpoint", "table") — all are capability-flavored
72
+ Before the wrap-up gate, verify: every milestone has an Active requirement; Core Value is covered; each Active requirement has all fields and owner (`M###/S##` or `M###/none yet`; never bare `none yet`); anti-features are captured; stated quality thresholds are captured; no requirement is implementation-flavored.
95
73
 
96
- **Print a structured requirements table in chat first** markdown table with columns: ID, Title, Class, Status, Owner, Source. Group by status (Active / Deferred / Out of Scope / Validated). This is the user's audit trail.
74
+ **Print a structured requirements table in chat first**: markdown table with ID, Title, Class, Status, Owner, Source. Group by status (Active / Deferred / Out of Scope / Validated). This is the user's audit trail.
97
75
 
98
76
  **Then confirm:**
99
77
 
100
- **If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions` with:
101
- - header: "Depth Check"
102
- - id: "depth_verification_requirements_confirm"
103
- - question: "Are these the right requirements at the right scope?"
104
- - options: "Yes, ship it (Recommended)", "Not quite — let me adjust"
105
- - **The question ID must contain `depth_verification_requirements`** — enables the write-gate.
78
+ **If `{{structuredQuestionsAvailable}}` is `true`:** use `ask_user_questions` with header "Depth Check", id "depth_verification_requirements_confirm", question "Are these the right requirements at the right scope?", and options "Yes, ship it (Recommended)" / "Not quite — let me adjust". **The question ID must contain `depth_verification_requirements`**.
106
79
 
107
80
  **If `{{structuredQuestionsAvailable}}` is `false`:** ask in plain text: "Are these requirements right? Tell me anything to add, remove, or reclassify." Wait for explicit confirmation.
108
81
 
@@ -116,9 +89,9 @@ If they adjust, absorb and re-verify.
116
89
 
117
90
  Once the user confirms:
118
91
 
119
- 1. Use the **Requirements** output template (inlined above) to render the final markdown in working memory.
120
- 2. Every entry must conform to the `R###` format with all listed fields. Use `gsd_requirement_save` (NOT plain file edit) for each requirement so DB state is saved first.
121
- 3. After all `gsd_requirement_save` calls complete, call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"`; omit `milestone_id`. The requirements table is the source of truth, and this tool renders `.gsd/REQUIREMENTS.md` from DB state. Pass the rendered markdown as `content` for audit context only; do not rely on markdown to update DB rows.
92
+ 1. Use the **Requirements** output template to render final markdown in memory.
93
+ 2. Every entry must use `R###` and all fields. Use `gsd_requirement_save` for each requirement so DB state is saved first.
94
+ 3. After all `gsd_requirement_save` calls, call `gsd_summary_save` with `artifact_type: "REQUIREMENTS"`; omit `milestone_id`. The requirements table is source of truth, and this tool renders `.gsd/REQUIREMENTS.md` from DB state. Pass markdown as audit context only; do not rely on markdown to update DB rows.
122
95
  4. The file MUST contain all required sections: `## Active`, `## Validated`, `## Deferred`, `## Out of Scope`, `## Traceability`, `## Coverage Summary`. Empty sections are OK; missing sections are not.
123
96
  5. Print the final coverage summary in chat: `Active: N | Validated: N | Deferred: N | Out of Scope: N | Mapped to slices: N | Unmapped active: N`.
124
97
  6. Do NOT use `artifact_type: "CONTEXT"` and do NOT pass `milestone_id: "REQUIREMENTS"`; that creates a fake milestone instead of `.gsd/REQUIREMENTS.md`.
@@ -1,6 +1,6 @@
1
- You are interviewing the user to surface behavioural, UX, and usage grey areas for slice **{{sliceId}}: {{sliceTitle}}** of milestone **{{milestoneId}}**.
1
+ You are interviewing the user to surface behavioural, UX, and usage grey areas for slice **{{sliceId}}: {{sliceTitle}}** in milestone **{{milestoneId}}**.
2
2
 
3
- Your goal is **not** to center the discussion on tech stack trivia, naming conventions, or speculative architecture. Your goal is to produce a context file that captures the human decisions: what this slice should feel like, how it should behave, what edge cases matter, where scope begins and ends, and what the user cares about that won't be obvious from the roadmap entry alone. If a technical choice materially changes scope, proof, or integration behavior, ask it directly and capture it.
3
+ Do **not** center the discussion on tech stack trivia, naming, or speculative architecture. Produce a context file with the human decisions: feel, behaviour, important edge cases, scope boundaries, and user priorities not obvious from the roadmap. If a technical choice materially changes scope, proof, or integration, ask and capture it.
4
4
 
5
5
  {{inlinedContext}}
6
6
 
@@ -8,47 +8,47 @@ Your goal is **not** to center the discussion on tech stack trivia, naming conve
8
8
 
9
9
  ## Interview Protocol
10
10
 
11
- ### Read project shape
11
+ ### Project Shape
12
12
 
13
- Before your first question round, read `.gsd/PROJECT.md` and look for `## Project Shape` → `**Complexity:**`. The verdict is either **`simple`** or **`complex`** (default to `complex` if the section is missing or unclear).
13
+ Before the first question round, read `.gsd/PROJECT.md` and look for `## Project Shape` → `**Complexity:**`. Verdicts are **`simple`** or **`complex`**; default to `complex` if missing or unclear.
14
14
 
15
- - **`simple`** — favor 1–2 plain-text rounds, write the slice context fast. Skip parallel-research investigation.
16
- - **`complex`** — full investigation with structured 3–4-option questions.
15
+ - **`simple`** — use 1–2 plain-text rounds, then write context. Skip parallel-research investigation.
16
+ - **`complex`** — investigate first, then ask structured 3–4-option questions.
17
17
 
18
- ### Before your first question round
18
+ ### Investigation
19
19
 
20
- Do a lightweight targeted investigation so your questions are grounded in reality:
21
- - Scout the codebase (`rg`, `find`, or `scout` for broad unfamiliar areas) to understand what already exists that this slice touches or builds on
22
- - Check the roadmap context above to understand what surrounds this slice — what comes before, what depends on it
23
- - Use `resolve_library` / `get_library_docs` for unfamiliar libraries — prefer this over `search-the-web` for library documentation
24
- - Identify the 3–5 biggest behavioural unknowns: things where the user's answer will materially change what gets built
20
+ Do enough targeted investigation that questions reflect reality:
21
+ - Scout touched code with `rg`, `find`, or `scout` for broad unfamiliar areas.
22
+ - Check roadmap context for predecessor and dependent work.
23
+ - For unfamiliar libraries, prefer `resolve_library` / `get_library_docs` over `search-the-web`.
24
+ - Identify the 3–5 biggest behavioural unknowns where the user's answer materially changes the build.
25
25
 
26
- **Web search budget:** You have a limited number of web searches per turn (typically 3-5). Prefer `resolve_library` / `get_library_docs` for library documentation and `search_and_read` for one-shot topic research — they are more budget-efficient. Target 2-3 web searches in the investigation pass. Distribute remaining searches across subsequent question rounds rather than clustering them.
26
+ **Web search budget:** You typically have 3-5 searches per turn. Use `resolve_library` / `get_library_docs` for library docs and `search_and_read` for one-shot topic research. Target 2-3 searches in investigation; keep the rest for later rounds.
27
27
 
28
- Do **not** go deep just enough that your questions reflect what's actually true rather than what you assume.
28
+ Do **not** go deep; stop when you can ask grounded questions.
29
29
 
30
30
  ### Question rounds
31
31
 
32
32
  **Never fabricate or simulate user input.** Never generate fake transcript markers like `[User]`, `[Human]`, or `User:`. Ask one question round, then wait for the user's actual response before continuing.
33
33
 
34
- **If `{{structuredQuestionsAvailable}}` is `true`:** Ask **1–3 questions per round** using `ask_user_questions`. In **`complex`** mode, each multi-choice question MUST present **3 or 4 concrete, researched options** plus a final **"Other — let me discuss"** option; options must be grounded in the investigation above (codebase signals, library docs, prior `.gsd/` artifacts), not generic placeholders. In **`simple`** mode, 2 options is fine. Binary wrap-up gates are exempt from the 3-or-4 rule. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.**
35
- **If `{{structuredQuestionsAvailable}}` is `false`:** Ask **1–3 questions per round** in plain text. Number them and wait for the user's response before asking the next round.
36
- Keep each question focused on one of:
37
- - **UX and user-facing behaviour** — what does the user see, click, trigger, or experience?
38
- - **Edge cases and failure states** — what happens when things go wrong or are in unusual states?
39
- - **Scope boundaries** — what is explicitly in vs out for this slice? What deferred to later?
40
- - **Feel and experience** — tone, responsiveness, feedback, transitions, what "done" feels like to the user
34
+ **If `{{structuredQuestionsAvailable}}` is `true`:** Ask **1–3 questions per round** using `ask_user_questions`. In **`complex`** mode, each multi-choice question MUST present **3 or 4 concrete, researched options** plus final **"Other — let me discuss"** option; options must be grounded in the investigation above (codebase signals, library docs, prior `.gsd/` artifacts), not placeholders. In **`simple`** mode, 2 options is fine. Binary wrap-up gates are exempt. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.**
35
+ **If `{{structuredQuestionsAvailable}}` is `false`:** Ask **1–3 numbered plain-text questions per round**, then wait.
36
+ Focus questions on:
37
+ - **UX and user-facing behaviour** — what users see, click, trigger, or experience.
38
+ - **Edge cases and failure states** — what happens in unusual or broken states.
39
+ - **Scope boundaries** — what is in, out, or deferred.
40
+ - **Feel and experience** — tone, responsiveness, feedback, transitions, and what "done" feels like.
41
41
 
42
- After the user answers, investigate further if any answer opens a new unknown, then ask the next round.
42
+ After answers, investigate new unknowns if needed, then ask the next round.
43
43
 
44
44
  ### Round cadence
45
45
 
46
- After each round of answers, decide whether you already have enough signal to write the slice context cleanly.
46
+ After each answer round, decide whether you have enough signal to write context cleanly.
47
47
 
48
- - **Incremental persistence:** After every 2 question rounds, silently save a draft `{{sliceId}}-CONTEXT-DRAFT.md` in `{{sliceDirPath}}` using `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "CONTEXT-DRAFT"`. This protects against session crashes losing confirmed work. Do NOT mention this to the user. The final context file will replace it.
49
- - If not, investigate any new unknowns and continue to the next round immediately. Do **not** ask a meta "ready to wrap up?" question after every round.
50
- - Ask a single wrap-up question only when you genuinely believe the slice is well understood or the user signals they want to stop.
51
- - When you do ask it, offer two choices: "Write the context file" *(recommended when the slice is well understood)* or "One more pass". Use `ask_user_questions` if available, otherwise ask in plain text.
48
+ - **Incremental persistence:** After every 2 question rounds, silently save `{{sliceId}}-CONTEXT-DRAFT.md` in `{{sliceDirPath}}` using `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "CONTEXT-DRAFT"`. Do NOT mention this to the user. Final context replaces it.
49
+ - If more signal is needed, investigate new unknowns and continue. Do **not** ask a meta "ready to wrap up?" question after every round.
50
+ - Ask one wrap-up question only when the slice is well understood or the user wants to stop.
51
+ - Offer exactly two choices: "Write the context file" *(recommended when understood)* or "One more pass". Use `ask_user_questions` if available; otherwise ask in plain text.
52
52
 
53
53
  **CRITICAL — Non-bypassable gate:** Do NOT write the context file until the user explicitly selects "Write the context file." If `ask_user_questions` fails, errors, returns no response, or the user's response does not match a provided option, you MUST re-ask — never rationalize past the block. "Tool not responding, I'll proceed," "auth issues," or "the slice seems well understood, I'll write it" are all **forbidden**. The gate exists to protect the user's work; treat a block as an instruction to wait, not an obstacle to work around.
54
54
 
@@ -58,16 +58,16 @@ After each round of answers, decide whether you already have enough signal to wr
58
58
 
59
59
  Once the user has explicitly confirmed they are ready to write the context file:
60
60
 
61
- 1. Use the **Slice Context** output template below
61
+ 1. Use the **Slice Context** template below.
62
62
  2. `mkdir -p {{sliceDirPath}}`
63
- 3. Call `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "CONTEXT"`, and the context as `content` the tool writes the file to disk and persists to DB. Use the template structure, filling in:
64
- - **Goal** — one sentence: what this slice delivers
65
- - **Why this Slice** — why now, what it unblocks
66
- - **Scope / In Scope** — what was confirmed in scope during the interview
67
- - **Scope / Out of Scope** — what was explicitly deferred or excluded
68
- - **Constraints** — anything the user flagged as a hard constraint
69
- - **Integration Points** — what this slice consumes and produces
70
- - **Open Questions** — anything still unresolved, with current thinking
63
+ 3. Call `gsd_summary_save` with `milestone_id: {{milestoneId}}`, `slice_id: {{sliceId}}`, `artifact_type: "CONTEXT"`, and context as `content`; the tool writes to disk and DB. Fill:
64
+ - **Goal** — one sentence.
65
+ - **Why this Slice** — why now and what it unblocks.
66
+ - **Scope / In Scope** — confirmed scope.
67
+ - **Scope / Out of Scope** — deferred or excluded work.
68
+ - **Constraints** — hard constraints.
69
+ - **Integration Points** — consumed and produced interfaces/artifacts.
70
+ - **Open Questions** — unresolved items with current thinking.
71
71
  4. {{commitInstruction}}
72
72
  5. Say exactly: `"{{sliceId}} context written."` — nothing else.
73
73
 
@@ -1,6 +1,6 @@
1
1
  **Working directory:** `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` to any other directory.
2
2
 
3
- Run **project-level domain research** in 4 parallel dimensions. Read `.gsd/PROJECT.md` and `.gsd/REQUIREMENTS.md` first — they define the scope of what to research. Then spawn 4 parallel `Task` calls (one per dimension) using agent class `scout`, each writing its findings to `.gsd/research/`. This stage runs ONCE per project, after `discuss-requirements` and the `research-decision` gate, before any milestone-level work.
3
+ Run one-time **project-level domain research** after `discuss-requirements` and the `research-decision` gate, before milestone work. Read `.gsd/PROJECT.md` and `.gsd/REQUIREMENTS.md`, then spawn 4 parallel `Task` calls with agent class `scout`, one per research dimension, each writing exactly one file under `.gsd/research/`.
4
4
 
5
5
  **Structured questions available: {{structuredQuestionsAvailable}}**
6
6
 
@@ -18,8 +18,8 @@ Then say: "Spawning 4 research agents in parallel: stack, features, architecture
18
18
 
19
19
  ## Pre-flight
20
20
 
21
- 1. Read `.gsd/PROJECT.md` end-to-end. Extract: domain, vision, current state, milestone sequence.
22
- 2. Read `.gsd/REQUIREMENTS.md` end-to-end. Extract: Active requirement classes (focus research on what the project must deliver).
21
+ 1. Read `.gsd/PROJECT.md` end-to-end. Extract domain, vision, current state, milestone sequence, scale, project type, and tech constraints.
22
+ 2. Read `.gsd/REQUIREMENTS.md` end-to-end. Extract Active requirement classes; focus research on required deliverables.
23
23
  3. `mkdir -p .gsd/research/`
24
24
 
25
25
  If either file is missing, STOP and emit: `"PROJECT.md or REQUIREMENTS.md missing — research-project cannot run."`
@@ -28,7 +28,7 @@ If either file is missing, STOP and emit: `"PROJECT.md or REQUIREMENTS.md missin
28
28
 
29
29
  ## Fan-out
30
30
 
31
- Issue **4 `Task` tool calls in a single assistant response** (one tool block containing four `Task` invocations). Use `agent: "scout"` for every task. Do not use `agent: "researcher"` this unit runs under the `planning-dispatch` tools-policy and only `scout` is permitted for project research. The tool runtime executes the calls concurrently — that is the parallelism mechanism here. Do not split them across multiple turns; do not chain them sequentially. After issuing the four calls, wait for ALL of their tool results to come back before doing anything in the "After fan-out completes" step below.
31
+ Issue **4 `Task` tool calls in one assistant response** (one block with four calls). Use `agent: "scout"` for every task. Do not use `agent: "researcher"`. Runtime parallelizes them, so do not chain calls across turns. Wait for ALL results before "After fan-out completes."
32
32
 
33
33
  Each task gets its own focused prompt. Each task writes one file.
34
34
 
@@ -36,15 +36,11 @@ Each task gets its own focused prompt. Each task writes one file.
36
36
 
37
37
  Prompt:
38
38
 
39
- > Research the standard stack for [domain] as of today. Identify the dominant libraries, frameworks, runtimes, and infrastructure tools used by [domain] products. For each: current stable version, primary alternatives, why teams pick it, when to avoid it.
39
+ > Research the standard stack for [domain] as of today: dominant libraries, frameworks, runtimes, and infrastructure tools. For each: stable version, alternatives, selection rationale, and avoid-when guidance.
40
40
  >
41
- > Constraints from PROJECT.md: [list any tech constraints / required frameworks the user already specified].
41
+ > Constraints from PROJECT.md: [list any tech constraints / required frameworks the user specified].
42
42
  >
43
- > Deliverable: `.gsd/research/STACK.md` with sections:
44
- > - **Recommended Stack** (with versions and rationale)
45
- > - **Alternatives Considered** (and why not)
46
- > - **What NOT to use** (and why)
47
- > - **Open questions** (anything where the user's choice will materially shape the architecture)
43
+ > Deliver `.gsd/research/STACK.md` with: **Recommended Stack** (versions/rationale), **Alternatives Considered**, **What NOT to use**, **Open questions**.
48
44
  >
49
45
  > Use `resolve_library` / `get_library_docs` for library docs. Use web search sparingly (2–3 queries). Cite sources where versions matter. Mark confidence per recommendation: high / medium / low.
50
46
 
@@ -52,32 +48,23 @@ Prompt:
52
48
 
53
49
  Prompt:
54
50
 
55
- > Research what features [domain] products typically have. Categorize as **table stakes** (users expect this; missing it breaks the product) vs **differentiators** (compelling but optional).
51
+ > Research typical [domain] product features. Categorize as **table stakes** (expected; missing breaks the product) vs **differentiators** (compelling but optional).
56
52
  >
57
53
  > Active requirements from REQUIREMENTS.md to cross-check: [list R### IDs and titles].
58
54
  >
59
- > Deliverable: `.gsd/research/FEATURES.md` with sections per category (Authentication, Content, Notifications, etc.):
60
- > - **Table stakes** — bullet list of expected capabilities, with one-sentence justification each
61
- > - **Differentiators** — bullet list of optional capabilities
62
- > - **Anti-features** — what successful [domain] products explicitly avoid
63
- > - **Cross-check vs REQUIREMENTS.md** — which active requirements are covered, which features are missing from REQUIREMENTS, which REQUIREMENTS look excessive
55
+ > Deliver `.gsd/research/FEATURES.md` with sections per category (Authentication, Content, Notifications, etc.): **Table stakes** with one-sentence justifications, **Differentiators**, **Anti-features**, and **Cross-check vs REQUIREMENTS.md** (covered, missing, excessive).
64
56
  >
65
- > Use web search to surface 3–5 representative competitors / examples in the space. Don't go deep aim for coverage breadth.
57
+ > Use web search to surface 3–5 representative competitors / examples. Don't go deep; aim for breadth.
66
58
 
67
59
  ### Task 3 — Architecture research → `.gsd/research/ARCHITECTURE.md`
68
60
 
69
61
  Prompt:
70
62
 
71
- > Research the typical architecture for [domain] products at the project's scale. Surface common patterns, data models, integration points, and scaling considerations.
63
+ > Research typical architecture for [domain] products at this project's scale: patterns, data models, integrations, and scaling considerations.
72
64
  >
73
- > Vision/scale signals from PROJECT.md: [extract scale-relevant phrases solo / small team / enterprise / planned user count].
65
+ > Vision/scale signals from PROJECT.md: [extract scale-relevant phrases: solo / small team / enterprise / planned user count].
74
66
  >
75
- > Deliverable: `.gsd/research/ARCHITECTURE.md` with sections:
76
- > - **Recommended Architecture** — diagram-friendly description (data flow, services, key boundaries)
77
- > - **Data Model Sketch** — core entities, relationships, where state lives
78
- > - **Integration Points** — external services typically required (auth, payments, email, etc.)
79
- > - **Scaling Tier** — what works at this project's scale, what to defer
80
- > - **Reversibility risk** — which architectural choices are hardest to walk back later
67
+ > Deliver `.gsd/research/ARCHITECTURE.md` with: **Recommended Architecture** (diagram-friendly data flow, services, boundaries), **Data Model Sketch**, **Integration Points**, **Scaling Tier**, **Reversibility risk**.
81
68
  >
82
69
  > Use `resolve_library` for library-specific architecture docs. Mark confidence per recommendation.
83
70
 
@@ -85,18 +72,13 @@ Prompt:
85
72
 
86
73
  Prompt:
87
74
 
88
- > Research common failure modes, gotchas, and footguns for [domain] products. Things experienced builders wish they'd known earlier.
75
+ > Research common failure modes, gotchas, and footguns for [domain] products: things experienced builders wish they had known earlier.
89
76
  >
90
77
  > Project type from PROJECT.md: [greenfield / brownfield / migration].
91
78
  >
92
- > Deliverable: `.gsd/research/PITFALLS.md` with sections:
93
- > - **Domain Pitfalls** — failure modes specific to this domain (e.g., for auth: session fixation, password reset flows, token rotation)
94
- > - **Stack Pitfalls** — known footguns of the recommended stack from STACK.md (or domain norm if STACK isn't ready)
95
- > - **Scope Traps** — features that look small but are huge ("just add notifications", "just add search")
96
- > - **Compliance / Security gotchas** — surfaces where regulators or attackers tend to bite
97
- > - **Migration pitfalls** (only if brownfield) — common breakage when retrofitting [domain] capability into existing systems
79
+ > Deliver `.gsd/research/PITFALLS.md` with: **Domain Pitfalls**, **Stack Pitfalls** from the recommended/domain-norm stack, **Scope Traps**, **Compliance / Security gotchas**, and **Migration pitfalls** only if brownfield.
98
80
  >
99
- > Web search for postmortems, incident reports, and "lessons learned" content. Sources matter prefer specific writeups over generic listicles.
81
+ > Web search for postmortems, incident reports, and "lessons learned" content. Sources matter; prefer specific writeups over generic listicles.
100
82
 
101
83
  ---
102
84
 
@@ -104,17 +86,17 @@ Prompt:
104
86
 
105
87
  Once all 4 tasks return:
106
88
 
107
- 1. Verify all 4 files exist: `STACK.md`, `FEATURES.md`, `ARCHITECTURE.md`, `PITFALLS.md` in `.gsd/research/`. If any are missing, retry that task once.
108
- 2. Print a concise summary in chat: one sentence per dimension, what each found or why it was blocked. The runtime clears the dispatch marker after this unit exits.
89
+ 1. Verify `.gsd/research/STACK.md`, `FEATURES.md`, `ARCHITECTURE.md`, and `PITFALLS.md` exist. If any are missing, retry that task once.
90
+ 2. Print a concise summary in chat: one sentence per dimension, what each found or why blocked. The runtime clears the dispatch marker after this unit exits.
109
91
  3. Say exactly: `"Project research complete."` — nothing else.
110
92
 
111
93
  ---
112
94
 
113
95
  ## Critical rules
114
96
 
115
- - **Issue all 4 `Task` calls in a single assistant response** (one block of four tool calls). The tool runtime parallelizes them; do NOT chain them across turns or await them individually.
97
+ - **Issue all 4 `Task` calls in one assistant response** (one block of four tool calls). The runtime parallelizes them; do NOT chain calls or await them individually.
116
98
  - **Each task writes exactly one file** to `.gsd/research/`. No cross-writes.
117
99
  - **Research is informational, not prescriptive** — it surfaces options; the user / requirements stage already chose what to build.
118
100
  - **Stay within scope** — don't research milestones or slices. That's a different stage.
119
101
  - **Budget:** ~3–5 web searches per dimension. Prefer `resolve_library` / `get_library_docs` for library questions.
120
- - If any task fails twice, write a placeholder `.gsd/research/{DIMENSION}-BLOCKER.md` with the failure reason and continue. If all four dimensions are blockers, the runtime will stop before milestone planning because no usable research exists.
102
+ - If any task fails twice, write `.gsd/research/{DIMENSION}-BLOCKER.md` with the failure reason and continue. If all four dimensions are blockers, runtime stops before milestone planning because no usable research exists.