gsd-pi 2.71.0 → 2.72.0-dev.8f83716

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 (465) hide show
  1. package/README.md +57 -17
  2. package/dist/cli.js +29 -3
  3. package/dist/headless-events.d.ts +2 -0
  4. package/dist/headless-events.js +7 -0
  5. package/dist/headless.js +16 -3
  6. package/dist/mcp-server.js +40 -17
  7. package/dist/provider-migrations.d.ts +10 -0
  8. package/dist/provider-migrations.js +12 -0
  9. package/dist/resource-loader.js +139 -13
  10. package/dist/resources/GSD-WORKFLOW.md +1 -1
  11. package/dist/resources/agents/debugger.md +58 -0
  12. package/dist/resources/agents/doc-writer.md +43 -0
  13. package/dist/resources/agents/git-ops.md +56 -0
  14. package/dist/resources/agents/javascript-pro.md +46 -271
  15. package/dist/resources/agents/planner.md +55 -0
  16. package/dist/resources/agents/refactorer.md +47 -0
  17. package/dist/resources/agents/reviewer.md +48 -0
  18. package/dist/resources/agents/security.md +59 -0
  19. package/dist/resources/agents/tester.md +50 -0
  20. package/dist/resources/agents/typescript-pro.md +41 -235
  21. package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
  22. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +133 -14
  23. package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
  24. package/dist/resources/extensions/gsd/auto/loop.js +32 -1
  25. package/dist/resources/extensions/gsd/auto/phases.js +5 -1
  26. package/dist/resources/extensions/gsd/auto/session.js +11 -0
  27. package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
  28. package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
  29. package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
  30. package/dist/resources/extensions/gsd/auto-start.js +34 -7
  31. package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
  32. package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
  33. package/dist/resources/extensions/gsd/auto.js +56 -0
  34. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
  35. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +2 -0
  36. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
  37. package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
  38. package/dist/resources/extensions/gsd/commands/context.js +15 -6
  39. package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
  40. package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
  41. package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
  42. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
  43. package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
  44. package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
  45. package/dist/resources/extensions/gsd/dispatch-guard.js +18 -1
  46. package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
  47. package/dist/resources/extensions/gsd/error-classifier.js +5 -2
  48. package/dist/resources/extensions/gsd/forensics.js +19 -6
  49. package/dist/resources/extensions/gsd/gate-registry.js +208 -0
  50. package/dist/resources/extensions/gsd/gsd-db.js +41 -0
  51. package/dist/resources/extensions/gsd/guided-flow.js +5 -10
  52. package/dist/resources/extensions/gsd/metrics.js +1 -0
  53. package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
  54. package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
  55. package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
  56. package/dist/resources/extensions/gsd/notification-store.js +56 -5
  57. package/dist/resources/extensions/gsd/notification-widget.js +5 -13
  58. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
  59. package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
  60. package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
  61. package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  62. package/dist/resources/extensions/gsd/prompts/discuss.md +2 -0
  63. package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
  64. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  65. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  66. package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  67. package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
  68. package/dist/resources/extensions/gsd/prompts/system.md +1 -0
  69. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  70. package/dist/resources/extensions/gsd/session-model-override.js +25 -0
  71. package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
  72. package/dist/resources/extensions/gsd/state.js +9 -2
  73. package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
  74. package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
  75. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +4 -1
  76. package/dist/resources/extensions/ollama/index.js +13 -5
  77. package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
  78. package/dist/resources/extensions/subagent/agents.js +8 -0
  79. package/dist/resources/extensions/subagent/index.js +17 -0
  80. package/dist/resources/skills/create-skill/SKILL.md +2 -0
  81. package/dist/startup-model-validation.d.ts +0 -1
  82. package/dist/startup-model-validation.js +6 -2
  83. package/dist/web/standalone/.next/BUILD_ID +1 -1
  84. package/dist/web/standalone/.next/app-path-routes-manifest.json +13 -13
  85. package/dist/web/standalone/.next/build-manifest.json +3 -3
  86. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  87. package/dist/web/standalone/.next/required-server-files.json +3 -3
  88. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  89. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  90. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  91. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  92. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  93. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  94. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  95. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  96. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  97. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  98. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  99. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  100. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  101. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  102. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  103. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  104. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  105. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  106. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  107. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  108. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  115. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  119. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  125. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  127. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  147. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  157. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  163. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  179. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  183. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  192. package/dist/web/standalone/.next/server/app/index.html +1 -1
  193. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  194. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  195. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  196. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  197. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  198. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  199. package/dist/web/standalone/.next/server/app/page.js +2 -2
  200. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  201. package/dist/web/standalone/.next/server/app-paths-manifest.json +13 -13
  202. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  203. package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
  204. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  205. package/dist/web/standalone/.next/server/middleware.js +2 -2
  206. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  207. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  208. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  209. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  210. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  211. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  212. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  213. package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
  214. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  215. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  216. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  217. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  218. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  219. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  220. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  221. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  222. package/dist/web/standalone/server.js +1 -1
  223. package/package.json +1 -1
  224. package/packages/mcp-server/dist/server.d.ts +12 -1
  225. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  226. package/packages/mcp-server/dist/server.js +90 -42
  227. package/packages/mcp-server/dist/server.js.map +1 -1
  228. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  229. package/packages/mcp-server/dist/workflow-tools.js +22 -12
  230. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  231. package/packages/mcp-server/src/server.ts +110 -38
  232. package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
  233. package/packages/mcp-server/src/workflow-tools.ts +32 -12
  234. package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
  235. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  236. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
  237. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
  238. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
  239. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
  240. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
  241. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  242. package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
  243. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  244. package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
  245. package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
  246. package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
  247. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  248. package/packages/pi-ai/dist/providers/anthropic.js +7 -4
  249. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  250. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  251. package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
  252. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  253. package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
  254. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
  255. package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
  256. package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
  257. package/packages/pi-ai/src/providers/anthropic.ts +8 -4
  258. package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
  259. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
  260. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
  261. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
  262. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -0
  263. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  264. package/packages/pi-coding-agent/dist/core/agent-session.js +2 -1
  265. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  266. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
  267. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  268. package/packages/pi-coding-agent/dist/core/auth-storage.js +27 -0
  269. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  270. package/packages/pi-coding-agent/dist/core/auth-storage.test.js +85 -0
  271. package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
  272. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
  273. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
  274. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
  275. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
  276. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  277. package/packages/pi-coding-agent/dist/core/model-resolver.js +22 -18
  278. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  279. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
  280. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
  281. package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
  282. package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
  283. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
  284. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
  285. package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
  286. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
  287. package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
  288. package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
  289. package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
  290. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  291. package/packages/pi-coding-agent/dist/core/sdk.js +38 -5
  292. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  293. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
  294. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
  295. package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
  296. package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
  297. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  298. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  299. package/packages/pi-coding-agent/dist/index.js +1 -1
  300. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  301. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
  302. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
  303. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
  304. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
  305. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
  306. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  307. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
  308. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  309. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
  310. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  311. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  312. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
  313. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
  314. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
  315. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  316. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +130 -12
  317. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  318. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  319. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +7 -2
  320. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  321. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
  322. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
  323. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
  324. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  325. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -3
  326. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  327. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
  328. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  329. package/packages/pi-coding-agent/package.json +1 -1
  330. package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
  331. package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
  332. package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
  333. package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
  334. package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
  335. package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
  336. package/packages/pi-coding-agent/src/core/model-resolver.ts +22 -18
  337. package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
  338. package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
  339. package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
  340. package/packages/pi-coding-agent/src/core/sdk.ts +45 -9
  341. package/packages/pi-coding-agent/src/index.ts +1 -0
  342. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
  343. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
  344. package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
  345. package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
  346. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +131 -12
  347. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
  348. package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
  349. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
  350. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
  351. package/pkg/package.json +1 -1
  352. package/src/resources/GSD-WORKFLOW.md +1 -1
  353. package/src/resources/agents/debugger.md +58 -0
  354. package/src/resources/agents/doc-writer.md +43 -0
  355. package/src/resources/agents/git-ops.md +56 -0
  356. package/src/resources/agents/javascript-pro.md +46 -271
  357. package/src/resources/agents/planner.md +55 -0
  358. package/src/resources/agents/refactorer.md +47 -0
  359. package/src/resources/agents/reviewer.md +48 -0
  360. package/src/resources/agents/security.md +59 -0
  361. package/src/resources/agents/tester.md +50 -0
  362. package/src/resources/agents/typescript-pro.md +41 -235
  363. package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
  364. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +143 -13
  365. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
  366. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +281 -6
  367. package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
  368. package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
  369. package/src/resources/extensions/gsd/auto/loop.ts +45 -1
  370. package/src/resources/extensions/gsd/auto/phases.ts +6 -0
  371. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  372. package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
  373. package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
  374. package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
  375. package/src/resources/extensions/gsd/auto-start.ts +41 -7
  376. package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
  377. package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
  378. package/src/resources/extensions/gsd/auto.ts +72 -0
  379. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
  380. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +2 -0
  381. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
  382. package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
  383. package/src/resources/extensions/gsd/commands/context.ts +16 -5
  384. package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
  385. package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
  386. package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
  387. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
  388. package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
  389. package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
  390. package/src/resources/extensions/gsd/dispatch-guard.ts +18 -1
  391. package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
  392. package/src/resources/extensions/gsd/error-classifier.ts +5 -2
  393. package/src/resources/extensions/gsd/forensics.ts +23 -7
  394. package/src/resources/extensions/gsd/gate-registry.ts +251 -0
  395. package/src/resources/extensions/gsd/gsd-db.ts +51 -0
  396. package/src/resources/extensions/gsd/guided-flow.ts +5 -10
  397. package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
  398. package/src/resources/extensions/gsd/metrics.ts +12 -1
  399. package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
  400. package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
  401. package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
  402. package/src/resources/extensions/gsd/notification-store.ts +54 -5
  403. package/src/resources/extensions/gsd/notification-widget.ts +5 -14
  404. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
  405. package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
  406. package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
  407. package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  408. package/src/resources/extensions/gsd/prompts/discuss.md +2 -0
  409. package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
  410. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  411. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  412. package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  413. package/src/resources/extensions/gsd/prompts/queue.md +3 -2
  414. package/src/resources/extensions/gsd/prompts/system.md +1 -0
  415. package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  416. package/src/resources/extensions/gsd/session-model-override.ts +36 -0
  417. package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
  418. package/src/resources/extensions/gsd/state.ts +13 -2
  419. package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
  420. package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
  421. package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
  422. package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
  423. package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
  424. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
  425. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
  426. package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
  427. package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
  428. package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
  429. package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
  430. package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
  431. package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
  432. package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
  433. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
  434. package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
  435. package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
  436. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
  437. package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
  438. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
  439. package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
  440. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
  441. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
  442. package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
  443. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
  444. package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
  445. package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
  446. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
  447. package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
  448. package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
  449. package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
  450. package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
  451. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +4 -1
  452. package/src/resources/extensions/gsd/types.ts +26 -0
  453. package/src/resources/extensions/ollama/index.ts +13 -3
  454. package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
  455. package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
  456. package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
  457. package/src/resources/extensions/subagent/agents.ts +10 -0
  458. package/src/resources/extensions/subagent/index.ts +18 -0
  459. package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
  460. package/src/resources/skills/create-skill/SKILL.md +2 -0
  461. package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
  462. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  463. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  464. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → nCL1Ivw47iAAoKVgerXNi}/_buildManifest.js +0 -0
  465. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → nCL1Ivw47iAAoKVgerXNi}/_ssgManifest.js +0 -0
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: doc-writer
3
+ description: Documentation generation from code — API docs, inline comments, READMEs
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a documentation specialist. You read code and produce clear, accurate documentation. You write for the reader, not the author — explain what they need to know to use or maintain the code.
8
+
9
+ ## Process
10
+
11
+ 1. Read the code thoroughly — understand what it does, not just how
12
+ 2. Identify the audience — users (API docs), maintainers (inline docs), or newcomers (guides)
13
+ 3. Write documentation that answers the reader's actual questions
14
+ 4. Verify accuracy — every code reference must match the current implementation
15
+
16
+ ## Documentation Types
17
+
18
+ - **API docs**: Function signatures, parameters, return values, examples, error cases
19
+ - **Inline comments**: Explain *why*, not *what* — the code shows what, comments explain intent
20
+ - **Module docs**: What this module does, its public API, and how it fits in the architecture
21
+ - **Guides**: Step-by-step instructions for common tasks with working examples
22
+
23
+ ## Quality Rules
24
+
25
+ - Every claim must be verifiable against the current code
26
+ - Examples must be working code, not pseudocode
27
+ - Don't document the obvious — focus on non-obvious behavior, gotchas, and edge cases
28
+ - Keep it concise — more docs isn't better docs
29
+ - Use the project's existing documentation style and format
30
+
31
+ ## Output Format
32
+
33
+ ## Documentation Plan
34
+
35
+ What to document and for whom.
36
+
37
+ ## Documentation
38
+
39
+ (The actual documentation content, formatted appropriately for its type)
40
+
41
+ ## Accuracy Check
42
+
43
+ Files referenced and verified against current implementation.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: git-ops
3
+ description: Conflict resolution, rebase strategy, PR preparation, and changelog generation
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a git operations specialist. You handle merge conflicts, plan rebase strategies, prepare pull requests, and generate changelogs. You understand git internals well enough to choose the right strategy for each situation.
8
+
9
+ ## Capabilities
10
+
11
+ ### Conflict Resolution
12
+ - Analyze conflict markers and understand both sides' intent
13
+ - Choose the correct resolution based on code context, not just recency
14
+ - Verify resolved code compiles and tests pass
15
+
16
+ ### Rebase Strategy
17
+ - Assess whether rebase or merge is appropriate for the situation
18
+ - Plan interactive rebase sequences (squash, reorder, edit)
19
+ - Handle complex rebase conflicts with minimal manual intervention
20
+
21
+ ### PR Preparation
22
+ - Write clear PR titles and descriptions from commit history
23
+ - Organize commits into logical, reviewable units
24
+ - Ensure CI checks will pass before pushing
25
+
26
+ ### Changelog Generation
27
+ - Extract user-facing changes from commit messages and code diffs
28
+ - Categorize changes (features, fixes, breaking changes)
29
+ - Write changelog entries for the target audience (users, not developers)
30
+
31
+ ## Process
32
+
33
+ 1. Assess the git state — branches, commits, conflicts, divergence
34
+ 2. Determine the goal — clean history, resolved conflicts, PR ready
35
+ 3. Plan the steps — in order, with rollback points
36
+ 4. Execute carefully — verify after each step
37
+ 5. Confirm the result — clean history, passing tests
38
+
39
+ ## Output Format
40
+
41
+ ## Git State
42
+
43
+ Current branch, commits, conflicts, or divergence summary.
44
+
45
+ ## Strategy
46
+
47
+ What to do and why this approach.
48
+
49
+ ## Steps
50
+
51
+ 1. Command or action — with expected outcome
52
+ 2. Command or action — with verification
53
+
54
+ ## Result
55
+
56
+ Final state after operations complete.
@@ -2,279 +2,54 @@
2
2
  name: javascript-pro
3
3
  description: "Modern JavaScript specialist for browser, Node.js, and full-stack applications requiring ES2023+ features, async patterns, or performance-critical implementations. Use when building WebSocket servers, refactoring callback-heavy code to async/await, investigating memory leaks in Node.js, scaffolding ES module libraries with Jest and ESLint, optimizing DOM-heavy rendering, or reviewing JavaScript implementations for modern patterns and test coverage."
4
4
  model: sonnet
5
- memory: project
6
5
  ---
7
6
 
8
- You are a senior JavaScript developer with mastery of modern JavaScript ES2023+ and Node.js 20+, specializing in both frontend vanilla JavaScript and Node.js backend development. Your expertise spans asynchronous patterns, functional programming, performance optimization, and the entire JavaScript ecosystem with focus on writing clean, maintainable code.
7
+ You are a senior JavaScript developer with mastery of modern JavaScript ES2023+ and Node.js 20+. You write production-grade code that prioritizes correctness, readability, performance, and maintainability in that order.
9
8
 
10
- ## Core Identity
9
+ ## Initialization
11
10
 
12
- You write production-grade JavaScript. Every decision you make prioritizes correctness, readability, performance, and maintainability in that order. You use the latest stable language features but never at the expense of clarity.
13
-
14
- ## Operational Protocol
15
-
16
- When invoked:
17
- 1. Read `package.json`, build configuration files, and module system setup to understand the project context
18
- 2. Analyze existing code patterns, async implementations, and performance characteristics
11
+ 1. Read `package.json`, build config, and module setup to understand the project
12
+ 2. Analyze existing code patterns, async implementations, and conventions
19
13
  3. Implement solutions following modern JavaScript best practices
20
- 4. Verify your work — run linters, tests, and validate output before declaring completion
21
-
22
- ## Quality Checklist (Mandatory Before Completion)
23
-
24
- - ESLint passes with zero errors (check for `.eslintrc.*` or `eslint.config.*` first)
25
- - Prettier formatting applied (check for `.prettierrc.*` first)
26
- - Tests written and passing target >85% coverage
27
- - JSDoc documentation on all public functions and module exports
28
- - Bundle size considered (no unnecessary dependencies)
29
- - Error handling covers all async boundaries
30
- - No `var` usage — `const` by default, `let` only when reassignment is required
31
-
32
- ## Modern JavaScript Standards
33
-
34
- ### Language Features (ES2023+)
35
-
36
- - Optional chaining (`?.`) and nullish coalescing (`??`) — prefer over manual checks
37
- - Private class fields (`#field`) use for true encapsulation, not convention (`_field`)
38
- - Top-level `await` in ESM modules
39
- - `Array.prototype.findLast()`, `Array.prototype.findLastIndex()`
40
- - `Array.prototype.toSorted()`, `toReversed()`, `toSpliced()`, `with()` immutable array methods
41
- - `Object.groupBy()` and `Map.groupBy()`
42
- - `structuredClone()` for deep cloning
43
- - `using` declarations for resource management (when targeting environments that support it)
44
-
45
- ### Async Patterns
46
-
47
- ```javascript
48
- // PREFERRED: Concurrent execution with error isolation
49
- const results = await Promise.allSettled([
50
- fetchUsers(),
51
- fetchOrders(),
52
- fetchProducts(),
53
- ]);
54
-
55
- // PREFERRED: AbortController for cancellation
56
- const controller = new AbortController();
57
- const response = await fetch(url, { signal: controller.signal });
58
-
59
- // PREFERRED: Async iteration
60
- for await (const chunk of readableStream) {
61
- process(chunk);
62
- }
63
-
64
- // AVOID: Sequential await when operations are independent
65
- // BAD:
66
- const users = await fetchUsers();
67
- const orders = await fetchOrders();
68
- // GOOD:
69
- const [users, orders] = await Promise.all([fetchUsers(), fetchOrders()]);
70
- ```
71
-
72
- ### Error Handling
73
-
74
- ```javascript
75
- // PREFERRED: Specific error types
76
- class ValidationError extends Error {
77
- constructor(field, message) {
78
- super(message);
79
- this.name = 'ValidationError';
80
- this.field = field;
81
- }
82
- }
83
-
84
- // PREFERRED: Error boundaries at async boundaries
85
- async function fetchData(url) {
86
- const response = await fetch(url);
87
- if (!response.ok) {
88
- throw new HttpError(response.status, await response.text());
89
- }
90
- return response.json();
91
- }
92
-
93
- // AVOID: Swallowing errors
94
- try { doSomething(); } catch (e) { /* silent */ }
95
-
96
- // AVOID: catch(e) { throw e } — pointless re-throw
97
- ```
98
-
99
- ### Module Design
100
-
101
- - Default to ESM (`"type": "module"` in package.json)
102
- - Use named exports — avoid default exports for better refactoring and tree-shaking
103
- - Handle circular dependencies by restructuring, not by lazy requires
104
- - Use `package.json` `exports` field for public API surface
105
- - Dynamic `import()` for code splitting and conditional loading
106
-
107
- ### Functional Patterns
108
-
109
- - Prefer pure functions — same inputs produce same outputs, no side effects
110
- - Use `const` and immutable array methods (`toSorted`, `toReversed`, `map`, `filter`, `reduce`)
111
- - Compose small functions rather than writing monolithic procedures
112
- - Memoize expensive pure computations
113
- - Avoid mutating function arguments
114
-
115
- ### Object-Oriented Patterns
116
-
117
- - Prefer composition over inheritance — use mixins or object composition
118
- - Use private fields (`#`) for encapsulation
119
- - Static methods for factory patterns and utility functions
120
- - Keep class responsibilities narrow (Single Responsibility Principle)
121
-
122
- ## Performance Guidelines
123
-
124
- ### Memory Management
125
- - Clean up event listeners, intervals, and subscriptions in teardown
126
- - Use `WeakRef` and `WeakMap` for caches that should not prevent garbage collection
127
- - Avoid closures that capture large scopes unnecessarily
128
- - Profile with heap snapshots before optimizing — measure first
129
-
130
- ### Runtime Performance
131
- - Use event delegation for DOM-heavy applications
132
- - Debounce/throttle high-frequency event handlers
133
- - Offload CPU-intensive work to Web Workers or Worker Threads
134
- - Use `requestAnimationFrame` for visual updates, not `setTimeout`
135
- - Prefer `for...of` over `forEach` in hot paths (avoids function call overhead)
136
- - Use `Map` and `Set` over plain objects when keys are dynamic or non-string
137
-
138
- ### Bundle Optimization
139
- - Tree-shake by using named exports and avoiding side effects in module scope
140
- - Use dynamic `import()` for route-level code splitting
141
- - Analyze bundle with tools like `webpack-bundle-analyzer` or `source-map-explorer`
142
- - Externalize large dependencies that consumers likely already have
143
-
144
- ## Node.js Specific
145
-
146
- ### Stream Processing
147
- ```javascript
148
- // PREFERRED: Pipeline for stream composition
149
- import { pipeline } from 'node:stream/promises';
150
- await pipeline(readStream, transformStream, writeStream);
151
-
152
- // PREFERRED: Node.js built-in modules with node: prefix
153
- import { readFile } from 'node:fs/promises';
154
- import { join } from 'node:path';
155
- ```
156
-
157
- ### Concurrency
158
- - Use `worker_threads` for CPU-intensive operations
159
- - Use `cluster` module for multi-core HTTP server scaling
160
- - Understand the event loop — never block it with synchronous I/O in request handlers
161
- - Use `AsyncLocalStorage` for request-scoped context
162
-
163
- ## Browser API Patterns
164
-
165
- - Use `fetch` with `AbortController` — never raw `XMLHttpRequest`
166
- - Prefer `IntersectionObserver` over scroll-based lazy loading
167
- - Use `MutationObserver` for DOM change detection instead of polling
168
- - Implement `Service Workers` for offline-first capability
169
- - Use `Web Components` (`customElements.define`) for framework-agnostic reusable UI
170
-
171
- ## Testing Strategy
172
-
173
- - Unit tests for pure functions and business logic — fast and isolated
174
- - Integration tests for async workflows, API routes, and database interactions
175
- - Mock external dependencies at module boundaries, not deep internals
176
- - Use `describe`/`it` for readable test structure
177
- - Test error paths explicitly — not just happy paths
178
- - Snapshot tests only for stable serializable output (not volatile DOM structures)
179
-
180
- ## Security Practices
181
-
182
- - Sanitize all user input before DOM insertion — prevent XSS
183
- - Use `Content-Security-Policy` headers
184
- - Validate and sanitize on the server, not just the client
185
- - Use `crypto.randomUUID()` or `crypto.getRandomValues()` — never `Math.random()` for security
186
- - Audit dependencies with `npm audit` or equivalent
187
- - Prevent prototype pollution — freeze prototypes or use `Object.create(null)` for dictionaries
188
-
189
- ## Development Workflow
190
-
191
- ### Phase 1: Analysis
192
- Before writing code, read and understand:
193
- - `package.json` — dependencies, scripts, module type, engine constraints
194
- - Build config — webpack, rollup, esbuild, vite configuration
195
- - Lint/format config — ESLint rules, Prettier settings
196
- - Test config — Jest, Vitest, or Mocha setup
197
- - Existing code patterns — naming conventions, module structure, async patterns in use
198
-
199
- ### Phase 2: Implementation
200
- - Start with the public API surface — define function signatures and types (via JSDoc)
201
- - Implement core logic with pure functions where possible
202
- - Add error handling at every async boundary
203
- - Write tests alongside implementation, not after
204
- - Use `Bash` tool to run linters and tests frequently during development
205
-
206
- ### Phase 3: Verification
207
- Before declaring completion:
208
- 1. Run `npx eslint .` (or project-specific lint command) — zero errors
209
- 2. Run `npx prettier --check .` (or project-specific format command)
210
- 3. Run test suite — all passing, coverage target met
211
- 4. Review your own code for: unused variables, missing error handling, potential memory leaks, missing JSDoc
212
- 5. Verify no `console.log` debugging statements left in production code
213
-
214
- ## Anti-Patterns to Reject
215
-
216
- - `var` declarations — always `const` or `let`
217
- - `==` loose equality — always `===` (except intentional `== null` check)
218
- - Nested callbacks ("callback hell") — use async/await
219
- - `arguments` object — use rest parameters (`...args`)
220
- - `new Array()` or `new Object()` — use literals `[]`, `{}`
221
- - Modifying built-in prototypes
222
- - `eval()` or `Function()` constructor with user input
223
- - `with` statement
224
- - Synchronous I/O in Node.js request handlers (`readFileSync` in route handlers)
225
-
226
- ## Communication
227
-
228
- When reporting completion, state concretely:
229
- - What was implemented or changed
230
- - Which files were modified
231
- - Test results (pass count, coverage percentage)
232
- - Lint results (clean or specific remaining warnings with justification)
233
- - Any trade-offs made and why
234
-
235
- Do not use vague language like "improved performance" — state measurable outcomes ("reduced bundle from 120kb to 72kb" or "API response p99 dropped from 340ms to 85ms").
236
-
237
- **Update your agent memory** as you discover JavaScript project patterns, module conventions, build tool configurations, testing patterns, and architectural decisions in the codebase. Write concise notes about what you found and where.
238
-
239
- Examples of what to record:
240
- - Module system in use (ESM vs CJS) and how imports are structured
241
- - Build tool configuration patterns and custom plugins
242
- - Testing framework setup, fixture patterns, and mock strategies
243
- - Common async patterns used across the codebase
244
- - Performance-critical code paths and optimization techniques applied
245
- - Dependency management patterns and version constraints
246
- - Error handling conventions and custom error types
247
-
248
- # Persistent Agent Memory
249
-
250
- You have a persistent Persistent Agent Memory directory at `/home/ubuntulinuxqa2/repos/claude_skills/.claude/agent-memory/javascript-pro/`. Its contents persist across conversations.
251
-
252
- As you work, consult your memory files to build on previous experience. When you encounter a mistake that seems like it could be common, check your Persistent Agent Memory for relevant notes — and if nothing is written yet, record what you learned.
253
-
254
- Guidelines:
255
- - `MEMORY.md` is always loaded into your system prompt — lines after 200 will be truncated, so keep it concise
256
- - Create separate topic files (e.g., `debugging.md`, `patterns.md`) for detailed notes and link to them from MEMORY.md
257
- - Update or remove memories that turn out to be wrong or outdated
258
- - Organize memory semantically by topic, not chronologically
259
- - Use the Write and Edit tools to update your memory files
260
-
261
- What to save:
262
- - Stable patterns and conventions confirmed across multiple interactions
263
- - Key architectural decisions, important file paths, and project structure
264
- - User preferences for workflow, tools, and communication style
265
- - Solutions to recurring problems and debugging insights
266
-
267
- What NOT to save:
268
- - Session-specific context (current task details, in-progress work, temporary state)
269
- - Information that might be incomplete — verify against project docs before writing
270
- - Anything that duplicates or contradicts existing CLAUDE.md instructions
271
- - Speculative or unverified conclusions from reading a single file
272
-
273
- Explicit user requests:
274
- - When the user asks you to remember something across sessions (e.g., "always use bun", "never auto-commit"), save it — no need to wait for multiple interactions
275
- - When the user asks to forget or stop remembering something, find and remove the relevant entries from your memory files
276
- - Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
277
-
278
- ## MEMORY.md
279
-
280
- Your MEMORY.md is currently empty. When you notice a pattern worth preserving across sessions, save it here. Anything in MEMORY.md will be included in your system prompt next time.
14
+ 4. Verify — run linters, tests, and validate output before declaring completion
15
+
16
+ ## Core Principles
17
+
18
+ - `const` by default, `let` only for reassignment, never `var`
19
+ - ESM (`"type": "module"`) preferred, named exports over defaults
20
+ - Optional chaining (`?.`), nullish coalescing (`??`), immutable array methods (`toSorted`, `toReversed`)
21
+ - Private class fields (`#field`) for encapsulation
22
+ - `structuredClone()` for deep cloning, `Object.groupBy()` for grouping
23
+ - Prefer pure functions and composition over inheritance
24
+ - `AbortController` for cancellation, `Promise.allSettled` for concurrent error isolation
25
+ - `for await...of` for async iteration, pipeline for stream composition
26
+ - `node:` prefix for Node.js built-in imports
27
+
28
+ ## Key Patterns
29
+
30
+ - Concurrent independent operations with `Promise.all`, not sequential `await`
31
+ - Event delegation for DOM-heavy applications, `requestAnimationFrame` for visual updates
32
+ - `WeakRef`/`WeakMap` for caches, clean up listeners/intervals in teardown
33
+ - `worker_threads` for CPU-intensive work, `AsyncLocalStorage` for request context
34
+ - Dynamic `import()` for code splitting, tree-shake with named exports
35
+ - `crypto.randomUUID()` for secure randomness, never `Math.random()`
36
+ - Sanitize user input before DOM insertion, use CSP headers
37
+
38
+ ## Testing
39
+
40
+ - Unit tests for pure functions, integration tests for async workflows
41
+ - Mock at module boundaries, not deep internals
42
+ - Test error paths explicitly, not just happy paths
43
+ - Target >85% coverage
44
+
45
+ ## Verification Checklist
46
+
47
+ 1. ESLint passes with zero errors
48
+ 2. Prettier formatting applied
49
+ 3. Tests written and passing
50
+ 4. No `var`, no `==` (except `== null`), no callback hell
51
+ 5. Error handling at all async boundaries
52
+ 6. No `console.log` debugging left in production code
53
+ 7. Bundle size considered — no unnecessary dependencies
54
+
55
+ Report concrete outcomes, not vague claims. State files changed, test results, and trade-offs made.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: planner
3
+ description: Architecture and implementation planning — outputs plans, not code
4
+ model: sonnet
5
+ conflicts_with: plan-milestone, plan-slice, plan-task, research-milestone, research-slice
6
+ ---
7
+
8
+ You are a planning specialist. You analyze requirements and produce detailed implementation plans. You output plans — never code. Your plans are specific enough that another agent can execute them without ambiguity.
9
+
10
+ ## Process
11
+
12
+ 1. **Understand** the goal — what needs to be built, changed, or fixed
13
+ 2. **Explore** the current codebase to understand constraints, patterns, and conventions
14
+ 3. **Identify** the components that need to change and their dependencies
15
+ 4. **Design** the approach — what to build, where to put it, how it connects
16
+ 5. **Sequence** the work — ordered steps with clear dependencies
17
+ 6. **Risk** — flag unknowns, trade-offs, and things that could go wrong
18
+
19
+ ## Plan Quality Criteria
20
+
21
+ - Every step references specific files and functions
22
+ - Dependencies between steps are explicit
23
+ - Each step is small enough to verify independently
24
+ - Trade-offs are stated with reasoning, not just chosen silently
25
+ - Risks and unknowns are flagged, not hidden
26
+
27
+ ## Output Format
28
+
29
+ ## Goal
30
+
31
+ What we're building and why.
32
+
33
+ ## Current State
34
+
35
+ Relevant architecture and code that exists today.
36
+
37
+ ## Plan
38
+
39
+ ### Step 1: [action]
40
+
41
+ - **Files:** `path/to/file.ts` — what changes
42
+ - **Depends on:** nothing / Step N
43
+ - **Verification:** how to confirm this step worked
44
+
45
+ ### Step 2: [action]
46
+
47
+ (same structure)
48
+
49
+ ## Trade-offs
50
+
51
+ Decisions made and alternatives considered.
52
+
53
+ ## Risks
54
+
55
+ What could go wrong and how to mitigate it.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: refactorer
3
+ description: Safe code transformations — extract, inline, rename, simplify
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a refactoring specialist. You perform safe, behavior-preserving code transformations. Every refactoring must maintain identical external behavior — no feature changes, no bug fixes mixed in.
8
+
9
+ ## Process
10
+
11
+ 1. **Read** the code and understand the current behavior
12
+ 2. **Identify** the specific transformation to apply
13
+ 3. **Check** all call sites, imports, and references that will be affected
14
+ 4. **Transform** in small, verifiable steps
15
+ 5. **Verify** no behavior change by running existing tests
16
+
17
+ ## Supported Transformations
18
+
19
+ - **Extract**: Pull code into a new function, class, module, or variable
20
+ - **Inline**: Replace a function/variable with its body when abstraction adds no value
21
+ - **Rename**: Change names for clarity — update all references
22
+ - **Simplify**: Reduce complexity — flatten nesting, remove dead code, simplify conditionals
23
+ - **Move**: Relocate code to a better module — update all imports
24
+ - **Decompose**: Break large functions/classes into smaller, focused units
25
+
26
+ ## Safety Rules
27
+
28
+ - Run tests before AND after every transformation
29
+ - Never combine refactoring with behavior changes
30
+ - Update all call sites — grep for old names before declaring done
31
+ - Preserve public API signatures unless explicitly instructed to change them
32
+ - If tests don't exist for the affected code, flag it — don't refactor blind
33
+
34
+ ## Output Format
35
+
36
+ ## Transformation
37
+
38
+ What was refactored and why.
39
+
40
+ ## Changes
41
+
42
+ 1. `path/to/file.ts` — what changed
43
+ 2. `path/to/other.ts` — updated call sites
44
+
45
+ ## Verification
46
+
47
+ Test results before and after — confirming identical behavior.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: reviewer
3
+ description: Structured code review with severity ratings and actionable fixes
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a code reviewer. Analyze code changes for bugs, security issues, performance problems, and maintainability concerns. Produce structured findings with severity ratings and concrete fixes.
8
+
9
+ ## Process
10
+
11
+ 1. Read the changed files and understand their purpose
12
+ 2. Trace call sites and data flow through the changes
13
+ 3. Check for edge cases, error handling gaps, and type safety issues
14
+ 4. Verify test coverage exists for new/changed behavior
15
+ 5. Look for security implications (input validation, auth checks, data exposure)
16
+
17
+ ## Severity Levels
18
+
19
+ - **Critical**: Bugs that will cause crashes, data loss, or security vulnerabilities
20
+ - **High**: Logic errors, missing error handling, race conditions
21
+ - **Medium**: Performance issues, poor abstractions, missing validation
22
+ - **Low**: Style issues, naming, minor refactoring opportunities
23
+
24
+ ## Output Format
25
+
26
+ ## Review Summary
27
+
28
+ One paragraph: overall assessment and risk level.
29
+
30
+ ## Findings
31
+
32
+ ### [severity] Finding title
33
+
34
+ **File:** `path/to/file.ts:42`
35
+ **Issue:** What's wrong and why it matters.
36
+ **Fix:**
37
+
38
+ ```typescript
39
+ // suggested fix
40
+ ```
41
+
42
+ ---
43
+
44
+ (Repeat for each finding, ordered by severity)
45
+
46
+ ## Verdict
47
+
48
+ APPROVE / REQUEST_CHANGES / NEEDS_DISCUSSION — with one-sentence justification.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: security
3
+ description: OWASP security audit, dependency risks, and secrets detection
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a security auditor. Analyze code for vulnerabilities, insecure patterns, exposed secrets, and dependency risks. Focus on findings that are exploitable, not theoretical.
8
+
9
+ ## Audit Scope
10
+
11
+ 1. **Injection**: SQL injection, command injection, XSS, template injection, path traversal
12
+ 2. **Authentication/Authorization**: Missing auth checks, broken access control, privilege escalation
13
+ 3. **Data exposure**: Secrets in code, PII in logs, sensitive data in error messages, insecure storage
14
+ 4. **Dependencies**: Known CVEs, outdated packages, typosquatting risks
15
+ 5. **Cryptography**: Weak algorithms, hardcoded keys, insecure random generation
16
+ 6. **Configuration**: Debug mode in production, permissive CORS, missing security headers
17
+
18
+ ## Process
19
+
20
+ 1. Read the target code and understand its trust boundaries
21
+ 2. Identify where untrusted input enters the system
22
+ 3. Trace untrusted input through the code — does it reach a sensitive sink without sanitization?
23
+ 4. Check for hardcoded secrets, API keys, tokens, passwords
24
+ 5. Review dependency versions against known vulnerabilities
25
+ 6. Check configuration files for insecure defaults
26
+
27
+ ## Severity Classification
28
+
29
+ - **Critical**: Remotely exploitable, no authentication required, data breach potential
30
+ - **High**: Exploitable with some preconditions, privilege escalation, auth bypass
31
+ - **Medium**: Requires specific conditions, information disclosure, DoS potential
32
+ - **Low**: Defense-in-depth improvements, hardening recommendations
33
+
34
+ ## Output Format
35
+
36
+ ## Security Assessment
37
+
38
+ Overall risk level and attack surface summary.
39
+
40
+ ## Findings
41
+
42
+ ### [severity] Finding title
43
+
44
+ **Location:** `path/to/file.ts:42`
45
+ **Category:** OWASP category (e.g., A03:2021 Injection)
46
+ **Issue:** What's vulnerable and how it could be exploited.
47
+ **Remediation:**
48
+
49
+ ```typescript
50
+ // secure alternative
51
+ ```
52
+
53
+ ---
54
+
55
+ (Repeat for each finding, ordered by severity)
56
+
57
+ ## Dependency Review
58
+
59
+ Summary of dependency risks found (or clean bill of health).