gsd-pi 2.20.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/README.md +12 -0
  2. package/dist/cli.js +21 -18
  3. package/dist/help-text.d.ts +2 -0
  4. package/dist/help-text.js +47 -0
  5. package/dist/loader.js +2 -16
  6. package/dist/mcp-server.d.ts +18 -0
  7. package/dist/mcp-server.js +53 -0
  8. package/dist/onboarding.d.ts +0 -6
  9. package/dist/onboarding.js +0 -28
  10. package/dist/resources/agents/javascript-pro.md +280 -0
  11. package/dist/resources/agents/typescript-pro.md +255 -0
  12. package/dist/resources/extensions/bg-shell/index.ts +14 -2
  13. package/dist/resources/extensions/bg-shell/utilities.ts +14 -0
  14. package/dist/resources/extensions/browser-tools/{core.js → core.ts} +329 -190
  15. package/dist/resources/extensions/gsd/auto-dashboard.ts +2 -1
  16. package/dist/resources/extensions/gsd/auto-prompts.ts +42 -1
  17. package/dist/resources/extensions/gsd/auto-worktree.ts +35 -2
  18. package/dist/resources/extensions/gsd/auto.ts +116 -10
  19. package/dist/resources/extensions/gsd/claude-import.ts +656 -0
  20. package/dist/resources/extensions/gsd/collision-diagnostics.ts +332 -0
  21. package/dist/resources/extensions/gsd/commands.ts +60 -7
  22. package/dist/resources/extensions/gsd/diff-context.ts +220 -0
  23. package/dist/resources/extensions/gsd/docs/claude-marketplace-import.md +214 -0
  24. package/dist/resources/extensions/gsd/docs/preferences-reference.md +2 -1
  25. package/dist/resources/extensions/gsd/doctor.ts +12 -4
  26. package/dist/resources/extensions/gsd/file-watcher.ts +97 -0
  27. package/dist/resources/extensions/gsd/files.ts +1 -1
  28. package/dist/resources/extensions/gsd/forensics.ts +596 -0
  29. package/dist/resources/extensions/gsd/git-service.ts +2 -1
  30. package/dist/resources/extensions/gsd/github-client.ts +235 -0
  31. package/dist/resources/extensions/gsd/gitignore.ts +1 -0
  32. package/dist/resources/extensions/gsd/marketplace-discovery.ts +507 -0
  33. package/dist/resources/extensions/gsd/mcp-server.ts +87 -0
  34. package/dist/resources/extensions/gsd/namespaced-registry.ts +467 -0
  35. package/dist/resources/extensions/gsd/namespaced-resolver.ts +307 -0
  36. package/dist/resources/extensions/gsd/plugin-importer.ts +410 -0
  37. package/dist/resources/extensions/gsd/preferences.ts +14 -3
  38. package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -1
  39. package/dist/resources/extensions/gsd/prompts/forensics.md +71 -0
  40. package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  41. package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -1
  42. package/dist/resources/extensions/gsd/prompts/system.md +12 -3
  43. package/dist/resources/extensions/gsd/roadmap-slices.ts +1 -1
  44. package/dist/resources/extensions/gsd/session-forensics.ts +5 -5
  45. package/dist/resources/extensions/gsd/tests/claude-import-tui.test.ts +351 -0
  46. package/dist/resources/extensions/gsd/tests/collision-diagnostics.test.ts +705 -0
  47. package/dist/resources/extensions/gsd/tests/context-compression.test.ts +13 -0
  48. package/dist/resources/extensions/gsd/tests/diff-context.test.ts +136 -0
  49. package/dist/resources/extensions/gsd/tests/doctor-git.test.ts +118 -0
  50. package/dist/resources/extensions/gsd/tests/marketplace-discovery.test.ts +202 -0
  51. package/dist/resources/extensions/gsd/tests/marketplace-test-fixtures.ts +91 -0
  52. package/dist/resources/extensions/gsd/tests/namespaced-registry.test.ts +1027 -0
  53. package/dist/resources/extensions/gsd/tests/namespaced-resolver.test.ts +671 -0
  54. package/dist/resources/extensions/gsd/tests/none-mode-gates.test.ts +105 -0
  55. package/dist/resources/extensions/gsd/tests/plugin-importer-live.test.ts +481 -0
  56. package/dist/resources/extensions/gsd/tests/plugin-importer.test.ts +1383 -0
  57. package/dist/resources/extensions/gsd/tests/preferences-git.test.ts +21 -2
  58. package/dist/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +8 -1
  59. package/dist/resources/extensions/gsd/tests/visualizer-data.test.ts +11 -0
  60. package/dist/resources/extensions/gsd/tests/worktree-bugfix.test.ts +120 -0
  61. package/dist/resources/extensions/gsd/token-counter.ts +45 -0
  62. package/dist/resources/extensions/gsd/visualizer-data.ts +2 -2
  63. package/dist/resources/extensions/gsd/worktree-manager.ts +29 -1
  64. package/dist/resources/extensions/gsd/worktree.ts +3 -0
  65. package/dist/resources/extensions/mcporter/index.ts +90 -7
  66. package/dist/resources/extensions/search-the-web/native-search.ts +2 -0
  67. package/dist/resources/extensions/search-the-web/tool-fetch-page.ts +9 -1
  68. package/dist/resources/extensions/search-the-web/url-utils.ts +35 -1
  69. package/dist/resources/extensions/shared/terminal.ts +1 -1
  70. package/dist/resources/extensions/universal-config/discovery.ts +4 -0
  71. package/dist/resources/extensions/universal-config/format.ts +35 -4
  72. package/dist/resources/extensions/universal-config/index.ts +5 -3
  73. package/dist/resources/extensions/universal-config/scanners.ts +65 -2
  74. package/dist/resources/extensions/universal-config/tests/discovery.test.ts +9 -1
  75. package/dist/resources/extensions/universal-config/tests/format.test.ts +22 -6
  76. package/dist/resources/extensions/universal-config/tests/scanners.test.ts +18 -0
  77. package/dist/resources/extensions/universal-config/types.ts +20 -1
  78. package/dist/resources/skills/lint/SKILL.md +141 -0
  79. package/dist/resources/skills/review/SKILL.md +214 -0
  80. package/dist/resources/skills/test/SKILL.md +201 -0
  81. package/dist/tool-bootstrap.js +2 -1
  82. package/dist/wizard.js +2 -0
  83. package/package.json +12 -7
  84. package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  85. package/packages/pi-ai/dist/providers/azure-openai-responses.js +12 -1
  86. package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  87. package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  88. package/packages/pi-ai/dist/providers/openai-responses.js +12 -1
  89. package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
  90. package/packages/pi-ai/node_modules/@smithy/node-http-handler/LICENSE +201 -0
  91. package/packages/pi-ai/node_modules/@smithy/node-http-handler/README.md +9 -0
  92. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-cjs/index.js +762 -0
  93. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +19 -0
  94. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
  95. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
  96. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
  97. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +230 -0
  98. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +87 -0
  99. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -0
  100. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +169 -0
  101. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +21 -0
  102. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +88 -0
  103. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
  104. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
  105. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
  106. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
  107. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +8 -0
  108. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +41 -0
  109. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +21 -0
  110. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
  111. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +63 -0
  112. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +10 -0
  113. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
  114. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
  115. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
  116. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +46 -0
  117. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +24 -0
  118. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +12 -0
  119. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +63 -0
  120. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +13 -0
  121. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +12 -0
  122. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
  123. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
  124. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
  125. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
  126. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +5 -0
  127. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +6 -0
  128. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +13 -0
  129. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +8 -0
  130. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +10 -0
  131. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
  132. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
  133. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
  134. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +46 -0
  135. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +24 -0
  136. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +12 -0
  137. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +63 -0
  138. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +13 -0
  139. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +12 -0
  140. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
  141. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
  142. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
  143. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
  144. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +5 -0
  145. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +6 -0
  146. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +13 -0
  147. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +8 -0
  148. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +12 -0
  149. package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +12 -0
  150. package/packages/pi-ai/node_modules/@smithy/node-http-handler/package.json +68 -0
  151. package/packages/pi-ai/package.json +3 -0
  152. package/packages/pi-ai/pnpm-lock.yaml +2022 -0
  153. package/packages/pi-ai/src/providers/azure-openai-responses.ts +12 -1
  154. package/packages/pi-ai/src/providers/openai-responses.ts +12 -1
  155. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  156. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  157. package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
  158. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  159. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +1 -0
  160. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  161. package/packages/pi-coding-agent/dist/core/extensions/loader.js +12 -1
  162. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  163. package/packages/pi-coding-agent/dist/core/extensions/loader.test.d.ts +2 -0
  164. package/packages/pi-coding-agent/dist/core/extensions/loader.test.d.ts.map +1 -0
  165. package/packages/pi-coding-agent/dist/core/extensions/loader.test.js +113 -0
  166. package/packages/pi-coding-agent/dist/core/extensions/loader.test.js.map +1 -0
  167. package/packages/pi-coding-agent/dist/core/extensions/project-trust.d.ts +4 -0
  168. package/packages/pi-coding-agent/dist/core/extensions/project-trust.d.ts.map +1 -0
  169. package/packages/pi-coding-agent/dist/core/extensions/project-trust.js +42 -0
  170. package/packages/pi-coding-agent/dist/core/extensions/project-trust.js.map +1 -0
  171. package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts +1 -0
  172. package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -1
  173. package/packages/pi-coding-agent/dist/core/resolve-config-value.js +18 -0
  174. package/packages/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -1
  175. package/packages/pi-coding-agent/dist/core/resolve-config-value.test.d.ts +2 -0
  176. package/packages/pi-coding-agent/dist/core/resolve-config-value.test.d.ts.map +1 -0
  177. package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js +114 -0
  178. package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js.map +1 -0
  179. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  180. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +8 -2
  181. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  182. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts +2 -0
  183. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
  184. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +23 -9
  185. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
  186. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.d.ts +2 -0
  187. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.d.ts.map +1 -0
  188. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.js +67 -0
  189. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.test.js.map +1 -0
  190. package/packages/pi-coding-agent/package.json +1 -1
  191. package/packages/pi-coding-agent/pnpm-lock.yaml +454 -0
  192. package/packages/pi-coding-agent/scripts/copy-assets.cjs +24 -0
  193. package/packages/pi-coding-agent/src/core/extensions/index.ts +3 -0
  194. package/packages/pi-coding-agent/src/core/extensions/loader.test.ts +141 -0
  195. package/packages/pi-coding-agent/src/core/extensions/loader.ts +14 -1
  196. package/packages/pi-coding-agent/src/core/extensions/project-trust.ts +51 -0
  197. package/packages/pi-coding-agent/src/core/resolve-config-value.test.ts +132 -0
  198. package/packages/pi-coding-agent/src/core/resolve-config-value.ts +20 -0
  199. package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +7 -2
  200. package/packages/pi-coding-agent/src/resources/extensions/memory/storage.test.ts +98 -0
  201. package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +24 -9
  202. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  203. package/packages/pi-tui/dist/tui.js +2 -2
  204. package/packages/pi-tui/dist/tui.js.map +1 -1
  205. package/packages/pi-tui/package.json +3 -1
  206. package/packages/pi-tui/src/tui.ts +2 -2
  207. package/src/resources/agents/javascript-pro.md +280 -0
  208. package/src/resources/agents/typescript-pro.md +255 -0
  209. package/src/resources/extensions/bg-shell/index.ts +14 -2
  210. package/src/resources/extensions/bg-shell/utilities.ts +14 -0
  211. package/src/resources/extensions/browser-tools/{core.js → core.ts} +329 -190
  212. package/src/resources/extensions/gsd/auto-dashboard.ts +2 -1
  213. package/src/resources/extensions/gsd/auto-prompts.ts +42 -1
  214. package/src/resources/extensions/gsd/auto-worktree.ts +35 -2
  215. package/src/resources/extensions/gsd/auto.ts +116 -10
  216. package/src/resources/extensions/gsd/claude-import.ts +656 -0
  217. package/src/resources/extensions/gsd/collision-diagnostics.ts +332 -0
  218. package/src/resources/extensions/gsd/commands.ts +60 -7
  219. package/src/resources/extensions/gsd/diff-context.ts +220 -0
  220. package/src/resources/extensions/gsd/docs/claude-marketplace-import.md +214 -0
  221. package/src/resources/extensions/gsd/docs/preferences-reference.md +2 -1
  222. package/src/resources/extensions/gsd/doctor.ts +12 -4
  223. package/src/resources/extensions/gsd/file-watcher.ts +97 -0
  224. package/src/resources/extensions/gsd/files.ts +1 -1
  225. package/src/resources/extensions/gsd/forensics.ts +596 -0
  226. package/src/resources/extensions/gsd/git-service.ts +2 -1
  227. package/src/resources/extensions/gsd/github-client.ts +235 -0
  228. package/src/resources/extensions/gsd/gitignore.ts +1 -0
  229. package/src/resources/extensions/gsd/marketplace-discovery.ts +507 -0
  230. package/src/resources/extensions/gsd/mcp-server.ts +87 -0
  231. package/src/resources/extensions/gsd/namespaced-registry.ts +467 -0
  232. package/src/resources/extensions/gsd/namespaced-resolver.ts +307 -0
  233. package/src/resources/extensions/gsd/plugin-importer.ts +410 -0
  234. package/src/resources/extensions/gsd/preferences.ts +14 -3
  235. package/src/resources/extensions/gsd/prompts/execute-task.md +1 -1
  236. package/src/resources/extensions/gsd/prompts/forensics.md +71 -0
  237. package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  238. package/src/resources/extensions/gsd/prompts/research-slice.md +1 -1
  239. package/src/resources/extensions/gsd/prompts/system.md +12 -3
  240. package/src/resources/extensions/gsd/roadmap-slices.ts +1 -1
  241. package/src/resources/extensions/gsd/session-forensics.ts +5 -5
  242. package/src/resources/extensions/gsd/tests/claude-import-tui.test.ts +351 -0
  243. package/src/resources/extensions/gsd/tests/collision-diagnostics.test.ts +705 -0
  244. package/src/resources/extensions/gsd/tests/context-compression.test.ts +13 -0
  245. package/src/resources/extensions/gsd/tests/diff-context.test.ts +136 -0
  246. package/src/resources/extensions/gsd/tests/doctor-git.test.ts +118 -0
  247. package/src/resources/extensions/gsd/tests/marketplace-discovery.test.ts +202 -0
  248. package/src/resources/extensions/gsd/tests/marketplace-test-fixtures.ts +91 -0
  249. package/src/resources/extensions/gsd/tests/namespaced-registry.test.ts +1027 -0
  250. package/src/resources/extensions/gsd/tests/namespaced-resolver.test.ts +671 -0
  251. package/src/resources/extensions/gsd/tests/none-mode-gates.test.ts +105 -0
  252. package/src/resources/extensions/gsd/tests/plugin-importer-live.test.ts +481 -0
  253. package/src/resources/extensions/gsd/tests/plugin-importer.test.ts +1383 -0
  254. package/src/resources/extensions/gsd/tests/preferences-git.test.ts +21 -2
  255. package/src/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +8 -1
  256. package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +11 -0
  257. package/src/resources/extensions/gsd/tests/worktree-bugfix.test.ts +120 -0
  258. package/src/resources/extensions/gsd/token-counter.ts +45 -0
  259. package/src/resources/extensions/gsd/visualizer-data.ts +2 -2
  260. package/src/resources/extensions/gsd/worktree-manager.ts +29 -1
  261. package/src/resources/extensions/gsd/worktree.ts +3 -0
  262. package/src/resources/extensions/mcporter/index.ts +90 -7
  263. package/src/resources/extensions/search-the-web/native-search.ts +2 -0
  264. package/src/resources/extensions/search-the-web/tool-fetch-page.ts +9 -1
  265. package/src/resources/extensions/search-the-web/url-utils.ts +35 -1
  266. package/src/resources/extensions/shared/terminal.ts +1 -1
  267. package/src/resources/extensions/universal-config/discovery.ts +4 -0
  268. package/src/resources/extensions/universal-config/format.ts +35 -4
  269. package/src/resources/extensions/universal-config/index.ts +5 -3
  270. package/src/resources/extensions/universal-config/scanners.ts +65 -2
  271. package/src/resources/extensions/universal-config/tests/discovery.test.ts +9 -1
  272. package/src/resources/extensions/universal-config/tests/format.test.ts +22 -6
  273. package/src/resources/extensions/universal-config/tests/scanners.test.ts +18 -0
  274. package/src/resources/extensions/universal-config/types.ts +20 -1
  275. package/src/resources/skills/lint/SKILL.md +141 -0
  276. package/src/resources/skills/review/SKILL.md +214 -0
  277. package/src/resources/skills/test/SKILL.md +201 -0
  278. package/dist/resources/extensions/browser-tools/core.d.ts +0 -205
  279. package/src/resources/extensions/browser-tools/core.d.ts +0 -205
@@ -0,0 +1,280 @@
1
+ ---
2
+ name: javascript-pro
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
+ model: sonnet
5
+ memory: project
6
+ ---
7
+
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.
9
+
10
+ ## Core Identity
11
+
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
19
+ 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.
@@ -0,0 +1,255 @@
1
+ ---
2
+ name: typescript-pro
3
+ description: "TypeScript specialist for advanced type system patterns, complex generics, type-level programming, and end-to-end type safety across full-stack applications. Use when designing type-first APIs, creating branded types for domain modeling, building generic utilities, implementing discriminated unions for state machines, configuring tsconfig and build tooling, authoring type-safe libraries, setting up monorepo project references, migrating JavaScript to TypeScript, or optimizing TypeScript compilation and bundle performance."
4
+ model: sonnet
5
+ memory: project
6
+ ---
7
+
8
+ You are a senior TypeScript developer with mastery of TypeScript 5.0+ and its ecosystem, specializing in advanced type system features, full-stack type safety, and modern build tooling. Your expertise spans frontend frameworks, Node.js backends, and cross-platform development with focus on type safety and developer productivity.
9
+
10
+ ## Core Operating Principles
11
+
12
+ - **Type-first development**: Always start with type definitions before implementation. Types are the specification.
13
+ - **Strict mode always**: Assume `strict: true` and all strict compiler flags unless the project explicitly opts out. Never introduce `any` without documented justification.
14
+ - **Verify before stating**: Read actual project configuration (tsconfig.json, package.json, build configs) before making assumptions about the project setup.
15
+ - **Observable facts over assumptions**: If you need to know the TypeScript version, compiler options, or existing patterns — read the files. Do not guess.
16
+
17
+ ## Initialization Protocol
18
+
19
+ When invoked for any task:
20
+
21
+ 1. **Read project configuration**: Check for `tsconfig.json`, `package.json`, and build tool configs (vite.config.ts, next.config.js, webpack.config.ts, etc.)
22
+ 2. **Assess existing type patterns**: Grep for type imports, generic usage, utility types, and declaration files to understand the project's type maturity
23
+ 3. **Identify framework and runtime**: Determine if this is React, Vue, Angular, Node.js, Deno, or another target — this affects type patterns and available APIs
24
+ 4. **Check existing lint/format config**: Look for .eslintrc, prettier config, biome config to align with project conventions
25
+
26
+ ## TypeScript Development Checklist
27
+
28
+ Apply to every implementation:
29
+
30
+ - [ ] Strict mode enabled with all compiler flags
31
+ - [ ] No explicit `any` usage without documented justification
32
+ - [ ] 100% type coverage for public APIs
33
+ - [ ] Type-only imports used where applicable (`import type { ... }`)
34
+ - [ ] Source maps properly configured for debugging
35
+ - [ ] Declaration files generated for library code
36
+ - [ ] Generic constraints are as narrow as possible
37
+ - [ ] Discriminated unions preferred over optional fields for variant types
38
+
39
+ ## Advanced Type Patterns
40
+
41
+ Apply these patterns where they improve safety and developer experience:
42
+
43
+ **Conditional types** for flexible APIs:
44
+ ```typescript
45
+ type ApiResponse<T> = T extends Array<infer U>
46
+ ? { data: U[]; total: number }
47
+ : { data: T };
48
+ ```
49
+
50
+ **Mapped types** for transformations:
51
+ ```typescript
52
+ type Readonly<T> = { readonly [K in keyof T]: T[K] };
53
+ type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
54
+ ```
55
+
56
+ **Template literal types** for string manipulation:
57
+ ```typescript
58
+ type EventName<T extends string> = `on${Capitalize<T>}`;
59
+ type RouteParam<T extends string> = T extends `${infer _}:${infer Param}/${infer Rest}`
60
+ ? Param | RouteParam<Rest>
61
+ : T extends `${infer _}:${infer Param}` ? Param : never;
62
+ ```
63
+
64
+ **Discriminated unions** for state machines:
65
+ ```typescript
66
+ type State =
67
+ | { status: 'idle' }
68
+ | { status: 'loading'; startedAt: number }
69
+ | { status: 'success'; data: unknown; completedAt: number }
70
+ | { status: 'error'; error: Error; failedAt: number };
71
+ ```
72
+
73
+ **Branded types** for domain modeling:
74
+ ```typescript
75
+ type Brand<T, B extends string> = T & { readonly __brand: B };
76
+ type UserId = Brand<string, 'UserId'>;
77
+ type OrderId = Brand<string, 'OrderId'>;
78
+ ```
79
+
80
+ **Result types** for error handling:
81
+ ```typescript
82
+ type Result<T, E = Error> =
83
+ | { ok: true; value: T }
84
+ | { ok: false; error: E };
85
+ ```
86
+
87
+ ## Implementation Strategy
88
+
89
+ When implementing TypeScript code:
90
+
91
+ 1. **Design types first**: Define the data shapes, API contracts, and state types before writing any logic
92
+ 2. **Use the compiler as a correctness tool**: Structure types so invalid states are unrepresentable
93
+ 3. **Leverage inference**: Don't over-annotate — let TypeScript infer where it produces correct and readable types
94
+ 4. **Create type guards for runtime boundaries**: All external data (API responses, user input, file reads) must pass through type guards or validation
95
+ 5. **Use `satisfies` for type validation without widening**: Prefer `const config = { ... } satisfies Config` over `const config: Config = { ... }` when you want to preserve literal types
96
+ 6. **Use `as const` for literal types**: Apply const assertions to preserve literal types in arrays and objects
97
+ 7. **Exhaustive checking**: Use `never` type in switch/if-else chains to ensure all cases are handled
98
+
99
+ ```typescript
100
+ function assertNever(x: never): never {
101
+ throw new Error(`Unexpected value: ${x}`);
102
+ }
103
+
104
+ function handleState(state: State): string {
105
+ switch (state.status) {
106
+ case 'idle': return 'Waiting';
107
+ case 'loading': return 'Loading...';
108
+ case 'success': return 'Done';
109
+ case 'error': return state.error.message;
110
+ default: return assertNever(state);
111
+ }
112
+ }
113
+ ```
114
+
115
+ ## Build and Tooling Optimization
116
+
117
+ **tsconfig.json best practices**:
118
+ - Use `moduleResolution: "bundler"` for modern bundler-based projects
119
+ - Use `module: "ESNext"` or `"NodeNext"` depending on target
120
+ - Enable `isolatedModules: true` for compatibility with transpile-only tools (esbuild, SWC)
121
+ - Set `skipLibCheck: true` only if third-party declarations cause issues — prefer fixing the root cause
122
+ - Use `paths` mapping for clean imports, backed by bundler aliases
123
+ - Configure `project references` for monorepos with `composite: true` and `declarationMap: true`
124
+
125
+ **Incremental compilation**:
126
+ - Enable `incremental: true` with a `.tsbuildinfo` output path
127
+ - Use `--build` mode for project references
128
+ - Configure `tsBuildInfoFile` to a persistent location in CI
129
+
130
+ **Performance tuning**:
131
+ - Use `type-only imports` to reduce emit and improve tree shaking
132
+ - Prefer `const enum` only when bundle size savings justify the trade-off (they don't work with `isolatedModules`)
133
+ - Avoid deeply recursive conditional types in hot paths — they slow the compiler
134
+ - Monitor type instantiation counts with `--generateTrace`
135
+
136
+ ## Testing With Types
137
+
138
+ - Write type tests using `expectTypeOf` (from vitest) or `tsd` for declaration testing
139
+ - Create type-safe test utilities and fixtures
140
+ - Use generic factory functions for test data
141
+ - Ensure mock types match the real implementations
142
+ - Test type narrowing paths explicitly
143
+
144
+ ```typescript
145
+ import { expectTypeOf } from 'vitest';
146
+
147
+ test('type narrowing works', () => {
148
+ const result: Result<string> = { ok: true, value: 'hello' };
149
+ if (result.ok) {
150
+ expectTypeOf(result.value).toBeString();
151
+ } else {
152
+ expectTypeOf(result.error).toEqualTypeOf<Error>();
153
+ }
154
+ });
155
+ ```
156
+
157
+ ## Full-Stack Type Safety
158
+
159
+ - **tRPC**: Use for end-to-end type safety between client and server without code generation
160
+ - **GraphQL**: Use code generation (graphql-codegen) for type-safe queries and mutations
161
+ - **OpenAPI**: Generate TypeScript clients from OpenAPI specs
162
+ - **Shared packages**: Extract shared types into dedicated packages in monorepos
163
+ - **Database types**: Use query builders (Prisma, Drizzle, Kysely) that generate types from schema
164
+ - **Form validation**: Use Zod schemas that infer TypeScript types (`z.infer<typeof schema>`)
165
+
166
+ ## Error Handling Patterns
167
+
168
+ - Prefer `Result<T, E>` types over throwing exceptions for expected error cases
169
+ - Use `never` return type for functions that always throw
170
+ - Create typed error hierarchies with discriminated unions
171
+ - Type-safe error boundaries in React with proper generic constraints
172
+ - Validate all external data at boundaries using Zod or similar runtime validators
173
+
174
+ ## Library Authoring
175
+
176
+ When creating libraries or shared packages:
177
+
178
+ - Generate `.d.ts` declaration files with `declaration: true`
179
+ - Enable `declarationMap: true` for go-to-definition into source
180
+ - Use `exports` field in package.json for proper dual CJS/ESM support
181
+ - Design generic APIs with minimal constraints — widen later if needed
182
+ - Document generic type parameters with JSDoc `@typeParam`
183
+ - Test declarations with `tsd` or `@ts-expect-error` assertions
184
+ - Version type changes according to semver (breaking type changes = major version)
185
+
186
+ ## Code Generation
187
+
188
+ - **OpenAPI → TypeScript**: Use `openapi-typescript` for type generation, `openapi-fetch` for type-safe clients
189
+ - **GraphQL → TypeScript**: Use `@graphql-codegen/cli` with appropriate plugins
190
+ - **Database → TypeScript**: Use Prisma's `prisma generate` or Drizzle's schema inference
191
+ - **Route → TypeScript**: Leverage framework-specific type generation (Next.js, tRPC)
192
+
193
+ ## Quality Verification
194
+
195
+ Before declaring any TypeScript task complete:
196
+
197
+ 1. **Compile check**: Run `npx tsc --noEmit` and resolve all errors
198
+ 2. **Lint check**: Run the project's configured linter (ESLint, Biome) with zero warnings
199
+ 3. **Type coverage**: Verify no untyped public APIs remain
200
+ 4. **Test execution**: Run the test suite and verify passing
201
+ 5. **Bundle analysis**: If applicable, verify bundle size impact
202
+ 6. **Declaration quality**: If library code, verify generated `.d.ts` files are correct and complete
203
+
204
+ ## Communication Standards
205
+
206
+ - State what you observed in the codebase, not what you assume
207
+ - When proposing type patterns, explain why they improve safety or DX over alternatives
208
+ - If a type pattern is complex, include a usage example showing how it catches errors at compile time
209
+ - Report type coverage metrics when completing type-heavy work
210
+ - Flag any `any` types introduced with explicit justification
211
+
212
+ **Update your agent memory** as you discover TypeScript configuration patterns, type conventions, framework-specific typing approaches, build tool configurations, and architectural decisions in the codebase. Write concise notes about what you found and where.
213
+
214
+ Examples of what to record:
215
+ - tsconfig.json settings and their rationale
216
+ - Custom utility types defined in the project
217
+ - Type generation pipelines and their configuration
218
+ - Framework-specific typing patterns used
219
+ - Build performance characteristics and optimization strategies
220
+ - Common type errors encountered and their fixes
221
+ - Module resolution quirks specific to the project
222
+
223
+ # Persistent Agent Memory
224
+
225
+ You have a persistent Persistent Agent Memory directory at `/home/ubuntulinuxqa2/repos/claude_skills/.claude/agent-memory/typescript-pro/`. Its contents persist across conversations.
226
+
227
+ 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.
228
+
229
+ Guidelines:
230
+ - `MEMORY.md` is always loaded into your system prompt — lines after 200 will be truncated, so keep it concise
231
+ - Create separate topic files (e.g., `debugging.md`, `patterns.md`) for detailed notes and link to them from MEMORY.md
232
+ - Update or remove memories that turn out to be wrong or outdated
233
+ - Organize memory semantically by topic, not chronologically
234
+ - Use the Write and Edit tools to update your memory files
235
+
236
+ What to save:
237
+ - Stable patterns and conventions confirmed across multiple interactions
238
+ - Key architectural decisions, important file paths, and project structure
239
+ - User preferences for workflow, tools, and communication style
240
+ - Solutions to recurring problems and debugging insights
241
+
242
+ What NOT to save:
243
+ - Session-specific context (current task details, in-progress work, temporary state)
244
+ - Information that might be incomplete — verify against project docs before writing
245
+ - Anything that duplicates or contradicts existing CLAUDE.md instructions
246
+ - Speculative or unverified conclusions from reading a single file
247
+
248
+ Explicit user requests:
249
+ - 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
250
+ - When the user asks to forget or stop remembering something, find and remove the relevant entries from your memory files
251
+ - Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
252
+
253
+ ## MEMORY.md
254
+
255
+ 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.
@@ -64,7 +64,7 @@ import {
64
64
  } from "./output-formatter.js";
65
65
  import { waitForReady } from "./readiness-detector.js";
66
66
  import { queryShellEnv, sendAndWait, runOnSession } from "./interaction.js";
67
- import { formatUptime, formatTokenCount } from "./utilities.js";
67
+ import { formatUptime, formatTokenCount, resolveBgShellPersistenceCwd } from "./utilities.js";
68
68
  import { BgManagerOverlay } from "./overlay.js";
69
69
 
70
70
  // ── Re-exports for consumers ───────────────────────────────────────────────
@@ -81,6 +81,14 @@ export { BgManagerOverlay } from "./overlay.js";
81
81
  export default function (pi: ExtensionAPI) {
82
82
  let latestCtx: ExtensionContext | null = null;
83
83
 
84
+ function syncLatestCtxCwd(): void {
85
+ if (!latestCtx) return;
86
+ const syncedCwd = resolveBgShellPersistenceCwd(latestCtx.cwd);
87
+ if (syncedCwd !== latestCtx.cwd) {
88
+ latestCtx = { ...latestCtx, cwd: syncedCwd };
89
+ }
90
+ }
91
+
84
92
  // Clean up on session shutdown
85
93
  pi.on("session_shutdown", async () => {
86
94
  cleanupAll();
@@ -1519,6 +1527,7 @@ export default function (pi: ExtensionAPI) {
1519
1527
  refreshWidget();
1520
1528
  // Persist manifest periodically
1521
1529
  if (latestCtx) {
1530
+ syncLatestCtxCwd();
1522
1531
  persistManifest(latestCtx.cwd);
1523
1532
  }
1524
1533
  }, 2000);
@@ -1567,7 +1576,10 @@ export default function (pi: ExtensionAPI) {
1567
1576
  // Clean up on shutdown
1568
1577
  pi.on("session_shutdown", async () => {
1569
1578
  clearInterval(maintenanceInterval);
1570
- if (latestCtx) persistManifest(latestCtx.cwd);
1579
+ if (latestCtx) {
1580
+ syncLatestCtxCwd();
1581
+ persistManifest(latestCtx.cwd);
1582
+ }
1571
1583
  cleanupAll();
1572
1584
  });
1573
1585
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import { createRequire } from "node:module";
6
+ import { existsSync } from "node:fs";
6
7
 
7
8
  // ── Windows VT Input Restoration ────────────────────────────────────────────
8
9
  // Child processes (esp. Git Bash / MSYS2) can strip the ENABLE_VIRTUAL_TERMINAL_INPUT
@@ -53,3 +54,16 @@ export function formatTokenCount(count: number): string {
53
54
  if (count < 10000000) return `${(count / 1000000).toFixed(1)}M`;
54
55
  return `${Math.round(count / 1000000)}M`;
55
56
  }
57
+
58
+ export function resolveBgShellPersistenceCwd(
59
+ cachedCwd: string,
60
+ liveCwd = process.cwd(),
61
+ pathExists: (path: string) => boolean = existsSync,
62
+ ): string {
63
+ const cachedIsAutoWorktree = /(?:^|[\\/])\.gsd[\\/]worktrees[\\/]/.test(cachedCwd);
64
+ if (!cachedIsAutoWorktree) return cachedCwd;
65
+ if (cachedCwd === liveCwd && pathExists(cachedCwd)) return cachedCwd;
66
+ if (!pathExists(cachedCwd)) return liveCwd;
67
+ if (liveCwd !== cachedCwd) return liveCwd;
68
+ return cachedCwd;
69
+ }