@vpxa/kb 0.1.13 → 0.1.16

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 (490) hide show
  1. package/README.md +65 -12
  2. package/package.json +14 -7
  3. package/packages/analyzers/dist/blast-radius-analyzer.d.ts +17 -21
  4. package/packages/analyzers/dist/blast-radius-analyzer.js +5 -12
  5. package/packages/analyzers/dist/dependency-analyzer.d.ts +31 -28
  6. package/packages/analyzers/dist/dependency-analyzer.js +6 -9
  7. package/packages/analyzers/dist/diagram-generator.d.ts +12 -9
  8. package/packages/analyzers/dist/diagram-generator.js +2 -4
  9. package/packages/analyzers/dist/entry-point-analyzer.d.ts +39 -36
  10. package/packages/analyzers/dist/entry-point-analyzer.js +4 -6
  11. package/packages/analyzers/dist/index.d.ts +12 -14
  12. package/packages/analyzers/dist/index.js +1 -1
  13. package/packages/analyzers/dist/knowledge-producer.d.ts +34 -26
  14. package/packages/analyzers/dist/knowledge-producer.js +17 -15
  15. package/packages/analyzers/dist/pattern-analyzer.d.ts +14 -11
  16. package/packages/analyzers/dist/pattern-analyzer.js +2 -5
  17. package/packages/analyzers/dist/regex-call-graph.d.ts +6 -13
  18. package/packages/analyzers/dist/regex-call-graph.js +1 -1
  19. package/packages/analyzers/dist/structure-analyzer.d.ts +13 -10
  20. package/packages/analyzers/dist/structure-analyzer.js +2 -4
  21. package/packages/analyzers/dist/symbol-analyzer.d.ts +13 -9
  22. package/packages/analyzers/dist/symbol-analyzer.js +9 -13
  23. package/packages/analyzers/dist/ts-call-graph.d.ts +16 -14
  24. package/packages/analyzers/dist/ts-call-graph.js +1 -1
  25. package/packages/analyzers/dist/types.d.ts +82 -80
  26. package/packages/analyzers/dist/types.js +1 -0
  27. package/packages/chunker/dist/call-graph-extractor.d.ts +15 -12
  28. package/packages/chunker/dist/call-graph-extractor.js +1 -1
  29. package/packages/chunker/dist/chunker-factory.d.ts +16 -4
  30. package/packages/chunker/dist/chunker-factory.js +1 -1
  31. package/packages/chunker/dist/chunker.interface.d.ts +8 -5
  32. package/packages/chunker/dist/chunker.interface.js +1 -0
  33. package/packages/chunker/dist/code-chunker.d.ts +16 -13
  34. package/packages/chunker/dist/code-chunker.js +11 -14
  35. package/packages/chunker/dist/extractors/call-extractor.d.ts +24 -0
  36. package/packages/chunker/dist/extractors/call-extractor.js +1 -0
  37. package/packages/chunker/dist/extractors/entry-point-detector.d.ts +14 -0
  38. package/packages/chunker/dist/extractors/entry-point-detector.js +1 -0
  39. package/packages/chunker/dist/extractors/import-extractor.d.ts +14 -0
  40. package/packages/chunker/dist/extractors/import-extractor.js +1 -0
  41. package/packages/chunker/dist/extractors/pattern-detector.d.ts +14 -0
  42. package/packages/chunker/dist/extractors/pattern-detector.js +1 -0
  43. package/packages/chunker/dist/extractors/scope-resolver.d.ts +26 -0
  44. package/packages/chunker/dist/extractors/scope-resolver.js +1 -0
  45. package/packages/chunker/dist/extractors/symbol-extractor.d.ts +14 -0
  46. package/packages/chunker/dist/extractors/symbol-extractor.js +1 -0
  47. package/packages/chunker/dist/extractors/types.d.ts +36 -0
  48. package/packages/chunker/dist/extractors/types.js +1 -0
  49. package/packages/chunker/dist/generic-chunker.d.ts +14 -11
  50. package/packages/chunker/dist/generic-chunker.js +5 -5
  51. package/packages/chunker/dist/index.d.ts +19 -8
  52. package/packages/chunker/dist/index.js +1 -1
  53. package/packages/chunker/dist/markdown-chunker.d.ts +16 -13
  54. package/packages/chunker/dist/markdown-chunker.js +3 -10
  55. package/packages/chunker/dist/wasm/languages.d.ts +18 -0
  56. package/packages/chunker/dist/wasm/languages.js +1 -0
  57. package/packages/chunker/dist/wasm/query-executor.d.ts +70 -0
  58. package/packages/chunker/dist/wasm/query-executor.js +1 -0
  59. package/packages/chunker/dist/wasm/runtime.d.ts +44 -0
  60. package/packages/chunker/dist/wasm/runtime.js +1 -0
  61. package/packages/chunker/dist/wasm/types.d.ts +84 -0
  62. package/packages/chunker/dist/wasm/types.js +1 -0
  63. package/packages/chunker/dist/wasm-chunker.d.ts +23 -0
  64. package/packages/chunker/dist/wasm-chunker.js +6 -0
  65. package/packages/chunker/src/queries/go/calls.scm +11 -0
  66. package/packages/chunker/src/queries/go/entry-points.scm +20 -0
  67. package/packages/chunker/src/queries/go/imports.scm +6 -0
  68. package/packages/chunker/src/queries/go/patterns.scm +25 -0
  69. package/packages/chunker/src/queries/go/symbols.scm +26 -0
  70. package/packages/chunker/src/queries/java/calls.scm +10 -0
  71. package/packages/chunker/src/queries/java/entry-points.scm +27 -0
  72. package/packages/chunker/src/queries/java/imports.scm +11 -0
  73. package/packages/chunker/src/queries/java/patterns.scm +27 -0
  74. package/packages/chunker/src/queries/java/symbols.scm +28 -0
  75. package/packages/chunker/src/queries/javascript/calls.scm +21 -0
  76. package/packages/chunker/src/queries/javascript/entry-points.scm +31 -0
  77. package/packages/chunker/src/queries/javascript/imports.scm +32 -0
  78. package/packages/chunker/src/queries/javascript/patterns.scm +28 -0
  79. package/packages/chunker/src/queries/javascript/symbols.scm +52 -0
  80. package/packages/chunker/src/queries/python/calls.scm +11 -0
  81. package/packages/chunker/src/queries/python/entry-points.scm +21 -0
  82. package/packages/chunker/src/queries/python/imports.scm +14 -0
  83. package/packages/chunker/src/queries/python/patterns.scm +25 -0
  84. package/packages/chunker/src/queries/python/symbols.scm +17 -0
  85. package/packages/chunker/src/queries/rust/calls.scm +20 -0
  86. package/packages/chunker/src/queries/rust/entry-points.scm +7 -0
  87. package/packages/chunker/src/queries/rust/imports.scm +26 -0
  88. package/packages/chunker/src/queries/rust/patterns.scm +18 -0
  89. package/packages/chunker/src/queries/rust/symbols.scm +73 -0
  90. package/packages/chunker/src/queries/typescript/calls.scm +21 -0
  91. package/packages/chunker/src/queries/typescript/entry-points.scm +48 -0
  92. package/packages/chunker/src/queries/typescript/imports.scm +35 -0
  93. package/packages/chunker/src/queries/typescript/patterns.scm +47 -0
  94. package/packages/chunker/src/queries/typescript/symbols.scm +79 -0
  95. package/packages/chunker/wasm/tree-sitter-go.wasm +0 -0
  96. package/packages/chunker/wasm/tree-sitter-java.wasm +0 -0
  97. package/packages/chunker/wasm/tree-sitter-javascript.wasm +0 -0
  98. package/packages/chunker/wasm/tree-sitter-python.wasm +0 -0
  99. package/packages/chunker/wasm/tree-sitter-rust.wasm +0 -0
  100. package/packages/chunker/wasm/tree-sitter-typescript.wasm +0 -0
  101. package/packages/chunker/wasm/tree-sitter.wasm +0 -0
  102. package/packages/cli/dist/commands/analyze.d.ts +6 -3
  103. package/packages/cli/dist/commands/analyze.js +2 -3
  104. package/packages/cli/dist/commands/context-cmds.d.ts +6 -3
  105. package/packages/cli/dist/commands/context-cmds.js +1 -1
  106. package/packages/cli/dist/commands/environment.d.ts +6 -3
  107. package/packages/cli/dist/commands/environment.js +1 -2
  108. package/packages/cli/dist/commands/execution.d.ts +6 -3
  109. package/packages/cli/dist/commands/execution.js +1 -1
  110. package/packages/cli/dist/commands/graph.d.ts +6 -3
  111. package/packages/cli/dist/commands/graph.js +5 -6
  112. package/packages/cli/dist/commands/init/adapters.d.ts +28 -0
  113. package/packages/cli/dist/commands/init/adapters.js +1 -0
  114. package/packages/cli/dist/commands/init/config.d.ts +10 -0
  115. package/packages/cli/dist/commands/init/config.js +3 -0
  116. package/packages/cli/dist/commands/init/constants.d.ts +18 -0
  117. package/packages/cli/dist/commands/init/constants.js +1 -0
  118. package/packages/cli/dist/commands/init/curated.d.ts +7 -0
  119. package/packages/cli/dist/commands/init/curated.js +1 -0
  120. package/packages/cli/dist/commands/init/global.d.ts +34 -0
  121. package/packages/cli/dist/commands/init/global.js +5 -0
  122. package/packages/cli/dist/commands/init/index.d.ts +28 -0
  123. package/packages/cli/dist/commands/init/index.js +5 -0
  124. package/packages/cli/dist/commands/init/scaffold.d.ts +23 -0
  125. package/packages/cli/dist/commands/init/scaffold.js +1 -0
  126. package/packages/cli/dist/commands/init/templates.d.ts +9 -0
  127. package/packages/cli/dist/commands/init/templates.js +165 -0
  128. package/packages/cli/dist/commands/knowledge.d.ts +6 -3
  129. package/packages/cli/dist/commands/knowledge.js +1 -1
  130. package/packages/cli/dist/commands/search.d.ts +6 -3
  131. package/packages/cli/dist/commands/search.js +1 -8
  132. package/packages/cli/dist/commands/system.d.ts +6 -3
  133. package/packages/cli/dist/commands/system.js +4 -7
  134. package/packages/cli/dist/commands/workspace.d.ts +6 -3
  135. package/packages/cli/dist/commands/workspace.js +1 -2
  136. package/packages/cli/dist/context.d.ts +7 -5
  137. package/packages/cli/dist/context.js +1 -1
  138. package/packages/cli/dist/helpers.d.ts +51 -48
  139. package/packages/cli/dist/helpers.js +5 -5
  140. package/packages/cli/dist/index.d.ts +4 -2
  141. package/packages/cli/dist/index.js +2 -2
  142. package/packages/cli/dist/kb-init.d.ts +48 -51
  143. package/packages/cli/dist/kb-init.js +1 -1
  144. package/packages/cli/dist/types.d.ts +8 -6
  145. package/packages/cli/dist/types.js +1 -0
  146. package/packages/core/dist/constants.d.ts +58 -34
  147. package/packages/core/dist/constants.js +1 -1
  148. package/packages/core/dist/content-detector.d.ts +8 -8
  149. package/packages/core/dist/content-detector.js +1 -1
  150. package/packages/core/dist/errors.d.ts +15 -13
  151. package/packages/core/dist/errors.js +1 -1
  152. package/packages/core/dist/global-registry.d.ts +62 -0
  153. package/packages/core/dist/global-registry.js +1 -0
  154. package/packages/core/dist/index.d.ts +7 -6
  155. package/packages/core/dist/index.js +1 -1
  156. package/packages/core/dist/logger.d.ts +19 -8
  157. package/packages/core/dist/logger.js +1 -1
  158. package/packages/core/dist/types.d.ts +107 -92
  159. package/packages/core/dist/types.js +1 -0
  160. package/packages/embeddings/dist/embedder.interface.d.ts +22 -20
  161. package/packages/embeddings/dist/embedder.interface.js +1 -0
  162. package/packages/embeddings/dist/index.d.ts +3 -3
  163. package/packages/embeddings/dist/index.js +1 -1
  164. package/packages/embeddings/dist/onnx-embedder.d.ts +21 -23
  165. package/packages/embeddings/dist/onnx-embedder.js +1 -1
  166. package/packages/enterprise-bridge/dist/cache.d.ts +28 -0
  167. package/packages/enterprise-bridge/dist/cache.js +1 -0
  168. package/packages/enterprise-bridge/dist/er-client.d.ts +37 -0
  169. package/packages/enterprise-bridge/dist/er-client.js +1 -0
  170. package/packages/enterprise-bridge/dist/evolution-collector.d.ts +62 -0
  171. package/packages/enterprise-bridge/dist/evolution-collector.js +1 -0
  172. package/packages/enterprise-bridge/dist/index.d.ts +8 -0
  173. package/packages/enterprise-bridge/dist/index.js +1 -0
  174. package/packages/enterprise-bridge/dist/policy-store.d.ts +45 -0
  175. package/packages/enterprise-bridge/dist/policy-store.js +1 -0
  176. package/packages/enterprise-bridge/dist/push-adapter.d.ts +23 -0
  177. package/packages/enterprise-bridge/dist/push-adapter.js +1 -0
  178. package/packages/enterprise-bridge/dist/result-merger.d.ts +14 -0
  179. package/packages/enterprise-bridge/dist/result-merger.js +1 -0
  180. package/packages/enterprise-bridge/dist/types.d.ts +81 -0
  181. package/packages/enterprise-bridge/dist/types.js +1 -0
  182. package/packages/indexer/dist/file-hasher.d.ts +5 -3
  183. package/packages/indexer/dist/file-hasher.js +1 -1
  184. package/packages/indexer/dist/filesystem-crawler.d.ts +23 -21
  185. package/packages/indexer/dist/filesystem-crawler.js +1 -1
  186. package/packages/indexer/dist/graph-extractor.d.ts +9 -13
  187. package/packages/indexer/dist/graph-extractor.js +1 -1
  188. package/packages/indexer/dist/incremental-indexer.d.ts +49 -44
  189. package/packages/indexer/dist/incremental-indexer.js +1 -1
  190. package/packages/indexer/dist/index.d.ts +5 -5
  191. package/packages/indexer/dist/index.js +1 -1
  192. package/packages/server/dist/api.d.ts +3 -8
  193. package/packages/server/dist/api.js +1 -1
  194. package/packages/server/dist/config.d.ts +6 -3
  195. package/packages/server/dist/config.js +1 -1
  196. package/packages/server/dist/cross-workspace.d.ts +43 -0
  197. package/packages/server/dist/cross-workspace.js +1 -0
  198. package/packages/server/dist/curated-manager.d.ts +80 -78
  199. package/packages/server/dist/curated-manager.js +5 -10
  200. package/packages/server/dist/index.d.ts +1 -2
  201. package/packages/server/dist/index.js +1 -1
  202. package/packages/server/dist/replay-interceptor.d.ts +6 -7
  203. package/packages/server/dist/replay-interceptor.js +1 -1
  204. package/packages/server/dist/resources/resources.d.ts +7 -4
  205. package/packages/server/dist/resources/resources.js +2 -2
  206. package/packages/server/dist/server.d.ts +37 -25
  207. package/packages/server/dist/server.js +1 -1
  208. package/packages/server/dist/tools/analyze.tools.d.ts +14 -11
  209. package/packages/server/dist/tools/analyze.tools.js +1 -3
  210. package/packages/server/dist/tools/audit.tool.d.ts +8 -5
  211. package/packages/server/dist/tools/audit.tool.js +1 -4
  212. package/packages/server/dist/tools/bridge.tools.d.ts +34 -0
  213. package/packages/server/dist/tools/bridge.tools.js +15 -0
  214. package/packages/server/dist/tools/evolution.tools.d.ts +7 -0
  215. package/packages/server/dist/tools/evolution.tools.js +5 -0
  216. package/packages/server/dist/tools/forge.tools.d.ts +13 -12
  217. package/packages/server/dist/tools/forge.tools.js +10 -13
  218. package/packages/server/dist/tools/forget.tool.d.ts +7 -4
  219. package/packages/server/dist/tools/forget.tool.js +1 -7
  220. package/packages/server/dist/tools/graph.tool.d.ts +7 -4
  221. package/packages/server/dist/tools/graph.tool.js +4 -5
  222. package/packages/server/dist/tools/list.tool.d.ts +7 -4
  223. package/packages/server/dist/tools/list.tool.js +2 -8
  224. package/packages/server/dist/tools/lookup.tool.d.ts +7 -4
  225. package/packages/server/dist/tools/lookup.tool.js +2 -9
  226. package/packages/server/dist/tools/onboard.tool.d.ts +8 -5
  227. package/packages/server/dist/tools/onboard.tool.js +2 -2
  228. package/packages/server/dist/tools/policy.tools.d.ts +7 -0
  229. package/packages/server/dist/tools/policy.tools.js +2 -0
  230. package/packages/server/dist/tools/produce.tool.d.ts +6 -3
  231. package/packages/server/dist/tools/produce.tool.js +2 -2
  232. package/packages/server/dist/tools/read.tool.d.ts +7 -4
  233. package/packages/server/dist/tools/read.tool.js +2 -6
  234. package/packages/server/dist/tools/reindex.tool.d.ts +10 -7
  235. package/packages/server/dist/tools/reindex.tool.js +3 -2
  236. package/packages/server/dist/tools/remember.tool.d.ts +8 -4
  237. package/packages/server/dist/tools/remember.tool.js +3 -5
  238. package/packages/server/dist/tools/replay.tool.d.ts +6 -3
  239. package/packages/server/dist/tools/replay.tool.js +2 -6
  240. package/packages/server/dist/tools/search.tool.d.ts +10 -5
  241. package/packages/server/dist/tools/search.tool.js +6 -22
  242. package/packages/server/dist/tools/status.tool.d.ts +12 -4
  243. package/packages/server/dist/tools/status.tool.js +2 -3
  244. package/packages/server/dist/tools/toolkit.tools.d.ts +36 -35
  245. package/packages/server/dist/tools/toolkit.tools.js +20 -24
  246. package/packages/server/dist/tools/update.tool.d.ts +7 -4
  247. package/packages/server/dist/tools/update.tool.js +1 -6
  248. package/packages/server/dist/tools/utility.tools.d.ts +15 -15
  249. package/packages/server/dist/tools/utility.tools.js +10 -23
  250. package/packages/server/dist/version-check.d.ts +5 -2
  251. package/packages/server/dist/version-check.js +1 -1
  252. package/packages/store/dist/graph-store.interface.d.ts +89 -87
  253. package/packages/store/dist/graph-store.interface.js +1 -0
  254. package/packages/store/dist/index.d.ts +6 -6
  255. package/packages/store/dist/index.js +1 -1
  256. package/packages/store/dist/lance-store.d.ts +37 -31
  257. package/packages/store/dist/lance-store.js +1 -1
  258. package/packages/store/dist/sqlite-graph-store.d.ts +43 -47
  259. package/packages/store/dist/sqlite-graph-store.js +13 -13
  260. package/packages/store/dist/store-factory.d.ts +11 -8
  261. package/packages/store/dist/store-factory.js +1 -1
  262. package/packages/store/dist/store.interface.d.ts +47 -47
  263. package/packages/store/dist/store.interface.js +1 -0
  264. package/packages/tools/dist/audit.d.ts +61 -62
  265. package/packages/tools/dist/audit.js +4 -5
  266. package/packages/tools/dist/batch.d.ts +20 -18
  267. package/packages/tools/dist/batch.js +1 -1
  268. package/packages/tools/dist/changelog.d.ts +29 -27
  269. package/packages/tools/dist/changelog.js +2 -2
  270. package/packages/tools/dist/check.d.ts +42 -39
  271. package/packages/tools/dist/check.js +2 -2
  272. package/packages/tools/dist/checkpoint.d.ts +17 -15
  273. package/packages/tools/dist/checkpoint.js +1 -2
  274. package/packages/tools/dist/codemod.d.ts +35 -33
  275. package/packages/tools/dist/codemod.js +2 -2
  276. package/packages/tools/dist/compact.d.ts +34 -38
  277. package/packages/tools/dist/compact.js +2 -2
  278. package/packages/tools/dist/data-transform.d.ts +10 -8
  279. package/packages/tools/dist/data-transform.js +1 -1
  280. package/packages/tools/dist/dead-symbols.d.ts +29 -26
  281. package/packages/tools/dist/dead-symbols.js +2 -2
  282. package/packages/tools/dist/delegate.d.ts +26 -24
  283. package/packages/tools/dist/delegate.js +1 -5
  284. package/packages/tools/dist/diff-parse.d.ts +24 -22
  285. package/packages/tools/dist/diff-parse.js +3 -3
  286. package/packages/tools/dist/digest.d.ts +43 -46
  287. package/packages/tools/dist/digest.js +4 -5
  288. package/packages/tools/dist/dogfood-log.d.ts +49 -0
  289. package/packages/tools/dist/dogfood-log.js +2 -0
  290. package/packages/tools/dist/encode.d.ts +11 -9
  291. package/packages/tools/dist/encode.js +1 -1
  292. package/packages/tools/dist/env-info.d.ts +25 -23
  293. package/packages/tools/dist/env-info.js +1 -1
  294. package/packages/tools/dist/eval.d.ts +13 -11
  295. package/packages/tools/dist/eval.js +2 -3
  296. package/packages/tools/dist/evidence-map.d.ts +64 -62
  297. package/packages/tools/dist/evidence-map.js +2 -3
  298. package/packages/tools/dist/file-cache.d.ts +41 -0
  299. package/packages/tools/dist/file-cache.js +3 -0
  300. package/packages/tools/dist/file-summary.d.ts +50 -30
  301. package/packages/tools/dist/file-summary.js +2 -2
  302. package/packages/tools/dist/file-walk.d.ts +6 -4
  303. package/packages/tools/dist/file-walk.js +1 -1
  304. package/packages/tools/dist/find-examples.d.ts +26 -22
  305. package/packages/tools/dist/find-examples.js +3 -3
  306. package/packages/tools/dist/find.d.ts +39 -41
  307. package/packages/tools/dist/find.js +1 -1
  308. package/packages/tools/dist/forge-classify.d.ts +35 -39
  309. package/packages/tools/dist/forge-classify.js +2 -2
  310. package/packages/tools/dist/forge-ground.d.ts +58 -61
  311. package/packages/tools/dist/forge-ground.js +1 -1
  312. package/packages/tools/dist/git-context.d.ts +22 -20
  313. package/packages/tools/dist/git-context.js +3 -3
  314. package/packages/tools/dist/graph-query.d.ts +75 -79
  315. package/packages/tools/dist/graph-query.js +1 -1
  316. package/packages/tools/dist/guide.d.ts +14 -12
  317. package/packages/tools/dist/guide.js +1 -1
  318. package/packages/tools/dist/health.d.ts +13 -11
  319. package/packages/tools/dist/health.js +2 -2
  320. package/packages/tools/dist/http-request.d.ts +20 -18
  321. package/packages/tools/dist/http-request.js +1 -1
  322. package/packages/tools/dist/index.d.ts +55 -53
  323. package/packages/tools/dist/index.js +1 -1
  324. package/packages/tools/dist/lane.d.ts +28 -26
  325. package/packages/tools/dist/lane.js +6 -7
  326. package/packages/tools/dist/measure.d.ts +34 -30
  327. package/packages/tools/dist/measure.js +2 -2
  328. package/packages/tools/dist/onboard.d.ts +29 -27
  329. package/packages/tools/dist/onboard.js +17 -41
  330. package/packages/tools/dist/parse-output.d.ts +48 -46
  331. package/packages/tools/dist/parse-output.js +2 -2
  332. package/packages/tools/dist/path-resolver.d.ts +4 -2
  333. package/packages/tools/dist/path-resolver.js +1 -1
  334. package/packages/tools/dist/process-manager.d.ts +18 -16
  335. package/packages/tools/dist/process-manager.js +1 -1
  336. package/packages/tools/dist/queue.d.ts +28 -26
  337. package/packages/tools/dist/queue.js +1 -2
  338. package/packages/tools/dist/regex-test.d.ts +26 -24
  339. package/packages/tools/dist/regex-test.js +1 -1
  340. package/packages/tools/dist/rename.d.ts +28 -26
  341. package/packages/tools/dist/rename.js +2 -2
  342. package/packages/tools/dist/replay.d.ts +33 -31
  343. package/packages/tools/dist/replay.js +4 -6
  344. package/packages/tools/dist/response-envelope.d.ts +32 -30
  345. package/packages/tools/dist/response-envelope.js +1 -1
  346. package/packages/tools/dist/schema-validate.d.ts +15 -13
  347. package/packages/tools/dist/schema-validate.js +1 -1
  348. package/packages/tools/dist/scope-map.d.ts +45 -48
  349. package/packages/tools/dist/scope-map.js +1 -1
  350. package/packages/tools/dist/snippet.d.ts +26 -25
  351. package/packages/tools/dist/snippet.js +1 -1
  352. package/packages/tools/dist/stash.d.ts +13 -11
  353. package/packages/tools/dist/stash.js +1 -2
  354. package/packages/tools/dist/stratum-card.d.ts +27 -28
  355. package/packages/tools/dist/stratum-card.js +3 -5
  356. package/packages/tools/dist/symbol.d.ts +31 -26
  357. package/packages/tools/dist/symbol.js +3 -3
  358. package/packages/tools/dist/test-run.d.ts +19 -16
  359. package/packages/tools/dist/test-run.js +2 -2
  360. package/packages/tools/dist/text-utils.d.ts +6 -4
  361. package/packages/tools/dist/text-utils.js +2 -2
  362. package/packages/tools/dist/time-utils.d.ts +15 -13
  363. package/packages/tools/dist/time-utils.js +1 -1
  364. package/packages/tools/dist/trace.d.ts +26 -21
  365. package/packages/tools/dist/trace.js +2 -2
  366. package/packages/tools/dist/truncation.d.ts +6 -4
  367. package/packages/tools/dist/truncation.js +6 -13
  368. package/packages/tools/dist/watch.d.ts +28 -26
  369. package/packages/tools/dist/watch.js +1 -1
  370. package/packages/tools/dist/web-fetch.d.ts +35 -33
  371. package/packages/tools/dist/web-fetch.js +6 -12
  372. package/packages/tools/dist/web-search.d.ts +16 -14
  373. package/packages/tools/dist/web-search.js +1 -1
  374. package/packages/tools/dist/workset.d.ts +19 -17
  375. package/packages/tools/dist/workset.js +1 -2
  376. package/packages/tui/dist/App-CYLNJLr6.js +2 -0
  377. package/packages/tui/dist/App.d.ts +11 -6
  378. package/packages/tui/dist/App.js +1 -450
  379. package/packages/tui/dist/CuratedPanel-sYdZAICX.js +2 -0
  380. package/packages/tui/dist/LogPanel-DtMnoyXT.js +3 -0
  381. package/packages/tui/dist/SearchPanel-DREo6zgt.js +2 -0
  382. package/packages/tui/dist/StatusPanel-2ex8fLOO.js +2 -0
  383. package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
  384. package/packages/tui/dist/devtools-DUyj952l.js +7 -0
  385. package/packages/tui/dist/embedder.interface-D4ew0HPW.d.ts +28 -0
  386. package/packages/tui/dist/index-B9VpfVPP.d.ts +13 -0
  387. package/packages/tui/dist/index.d.ts +3 -19
  388. package/packages/tui/dist/index.js +1 -476
  389. package/packages/tui/dist/jsx-runtime-Cof-kwFn.js +316 -0
  390. package/packages/tui/dist/panels/CuratedPanel.d.ts +11 -6
  391. package/packages/tui/dist/panels/CuratedPanel.js +1 -371
  392. package/packages/tui/dist/panels/LogPanel.d.ts +7 -3
  393. package/packages/tui/dist/panels/LogPanel.js +1 -449
  394. package/packages/tui/dist/panels/SearchPanel.d.ts +14 -8
  395. package/packages/tui/dist/panels/SearchPanel.js +1 -372
  396. package/packages/tui/dist/panels/StatusPanel.d.ts +11 -6
  397. package/packages/tui/dist/panels/StatusPanel.js +1 -371
  398. package/packages/tui/dist/store.interface-CnY6SPOH.d.ts +150 -0
  399. package/scaffold/adapters/claude-code.mjs +20 -0
  400. package/scaffold/adapters/copilot.mjs +320 -0
  401. package/scaffold/copilot/agents/Architect-Reviewer-Alpha.agent.md +21 -0
  402. package/scaffold/copilot/agents/Architect-Reviewer-Beta.agent.md +21 -0
  403. package/scaffold/copilot/agents/Documenter.agent.md +42 -0
  404. package/scaffold/copilot/agents/Orchestrator.agent.md +104 -0
  405. package/scaffold/copilot/agents/Planner.agent.md +54 -0
  406. package/scaffold/copilot/agents/Refactor.agent.md +36 -0
  407. package/scaffold/copilot/agents/Researcher-Alpha.agent.md +20 -0
  408. package/scaffold/copilot/agents/Researcher-Beta.agent.md +20 -0
  409. package/scaffold/copilot/agents/Researcher-Delta.agent.md +20 -0
  410. package/scaffold/copilot/agents/Researcher-Gamma.agent.md +20 -0
  411. package/scaffold/definitions/agents.mjs +165 -0
  412. package/scaffold/definitions/bodies.mjs +292 -0
  413. package/scaffold/definitions/hooks.mjs +43 -0
  414. package/scaffold/definitions/models.mjs +56 -0
  415. package/scaffold/definitions/plugins.mjs +24 -0
  416. package/scaffold/definitions/prompts.mjs +145 -0
  417. package/scaffold/definitions/protocols.mjs +322 -0
  418. package/scaffold/definitions/tools.mjs +176 -0
  419. package/scaffold/general/agents/Architect-Reviewer-Alpha.agent.md +21 -0
  420. package/scaffold/general/agents/Architect-Reviewer-Beta.agent.md +21 -0
  421. package/scaffold/general/agents/Code-Reviewer-Alpha.agent.md +12 -0
  422. package/scaffold/general/agents/Code-Reviewer-Beta.agent.md +12 -0
  423. package/scaffold/general/agents/Debugger.agent.md +31 -0
  424. package/scaffold/general/agents/Documenter.agent.md +42 -0
  425. package/scaffold/general/agents/Explorer.agent.md +50 -0
  426. package/scaffold/general/agents/Frontend.agent.md +29 -0
  427. package/scaffold/general/agents/Implementer.agent.md +31 -0
  428. package/scaffold/general/agents/Orchestrator.agent.md +104 -0
  429. package/scaffold/general/agents/Planner.agent.md +55 -0
  430. package/scaffold/general/agents/README.md +57 -0
  431. package/scaffold/general/agents/Refactor.agent.md +36 -0
  432. package/scaffold/general/agents/Researcher-Alpha.agent.md +20 -0
  433. package/scaffold/general/agents/Researcher-Beta.agent.md +20 -0
  434. package/scaffold/general/agents/Researcher-Delta.agent.md +20 -0
  435. package/scaffold/general/agents/Researcher-Gamma.agent.md +20 -0
  436. package/scaffold/general/agents/Security.agent.md +42 -0
  437. package/scaffold/general/agents/_shared/adr-protocol.md +91 -0
  438. package/scaffold/general/agents/_shared/architect-reviewer-base.md +50 -0
  439. package/scaffold/general/agents/_shared/code-agent-base.md +88 -0
  440. package/scaffold/general/agents/_shared/code-reviewer-base.md +54 -0
  441. package/scaffold/general/agents/_shared/decision-protocol.md +27 -0
  442. package/scaffold/general/agents/_shared/forge-protocol.md +46 -0
  443. package/scaffold/general/agents/_shared/researcher-base.md +61 -0
  444. package/scaffold/general/agents/templates/adr-template.md +27 -0
  445. package/scaffold/general/agents/templates/execution-state.md +25 -0
  446. package/scaffold/general/prompts/ask.prompt.md +20 -0
  447. package/scaffold/general/prompts/debug.prompt.md +25 -0
  448. package/scaffold/general/prompts/design.prompt.md +22 -0
  449. package/scaffold/general/prompts/implement.prompt.md +26 -0
  450. package/scaffold/general/prompts/plan.prompt.md +24 -0
  451. package/scaffold/general/prompts/review.prompt.md +31 -0
  452. package/scaffold/generate.mjs +74 -0
  453. package/skills/adr-skill/SKILL.md +329 -0
  454. package/skills/adr-skill/assets/templates/adr-madr.md +89 -0
  455. package/skills/adr-skill/assets/templates/adr-readme.md +20 -0
  456. package/skills/adr-skill/assets/templates/adr-simple.md +46 -0
  457. package/skills/adr-skill/references/adr-conventions.md +95 -0
  458. package/skills/adr-skill/references/examples.md +193 -0
  459. package/skills/adr-skill/references/review-checklist.md +77 -0
  460. package/skills/adr-skill/references/template-variants.md +52 -0
  461. package/skills/adr-skill/scripts/bootstrap_adr.js +259 -0
  462. package/skills/adr-skill/scripts/new_adr.js +391 -0
  463. package/skills/adr-skill/scripts/set_adr_status.js +169 -0
  464. package/skills/brainstorming/SKILL.md +259 -0
  465. package/skills/brainstorming/scripts/frame-template.html +365 -0
  466. package/skills/brainstorming/scripts/helper.js +216 -0
  467. package/skills/brainstorming/scripts/server.cjs +9 -0
  468. package/skills/brainstorming/scripts/server.src.cjs +249 -0
  469. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  470. package/skills/brainstorming/visual-companion.md +430 -0
  471. package/skills/c4-architecture/SKILL.md +295 -0
  472. package/skills/c4-architecture/references/advanced-patterns.md +552 -0
  473. package/skills/c4-architecture/references/c4-syntax.md +492 -0
  474. package/skills/c4-architecture/references/common-mistakes.md +437 -0
  475. package/skills/knowledge-base/SKILL.md +100 -10
  476. package/skills/lesson-learned/SKILL.md +105 -0
  477. package/skills/lesson-learned/references/anti-patterns.md +55 -0
  478. package/skills/lesson-learned/references/se-principles.md +109 -0
  479. package/skills/requirements-clarity/SKILL.md +324 -0
  480. package/skills/session-handoff/SKILL.md +189 -0
  481. package/skills/session-handoff/references/handoff-template.md +139 -0
  482. package/skills/session-handoff/references/resume-checklist.md +80 -0
  483. package/skills/session-handoff/scripts/check_staleness.js +269 -0
  484. package/skills/session-handoff/scripts/create_handoff.js +299 -0
  485. package/skills/session-handoff/scripts/list_handoffs.js +113 -0
  486. package/skills/session-handoff/scripts/validate_handoff.js +241 -0
  487. package/packages/chunker/dist/treesitter-chunker.d.ts +0 -47
  488. package/packages/chunker/dist/treesitter-chunker.js +0 -8
  489. package/packages/cli/dist/commands/init.d.ts +0 -10
  490. package/packages/cli/dist/commands/init.js +0 -308
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: lesson-learned
3
+ description: "Analyze recent code changes via git history and extract software engineering lessons. Use when the user asks 'what is the lesson here?', 'what can I learn from this?', 'engineering takeaway', 'what did I just learn?', 'reflect on this code', or wants to extract principles from recent work."
4
+ ---
5
+
6
+ # Lesson Learned
7
+
8
+ Extract specific, grounded software engineering lessons from actual code changes. Not a lecture -- a mirror. Show the user what their code already demonstrates.
9
+
10
+ ## Before You Begin
11
+
12
+ **Load the principles reference first.**
13
+
14
+ 1. Read `references/se-principles.md` to have the principle catalog available
15
+ 2. Optionally read `references/anti-patterns.md` if you suspect the changes include areas for improvement
16
+ 3. Determine the scope of analysis (see Phase 1)
17
+
18
+ **Do not proceed until you've loaded at least `se-principles.md`.**
19
+
20
+ ## Phase 1: Determine Scope
21
+
22
+ Ask the user or infer from context what to analyze.
23
+
24
+ | Scope | Git Commands | When to Use |
25
+ |-------|-------------|-------------|
26
+ | Feature branch | `git log main..HEAD --oneline` + `git diff main...HEAD` | User is on a non-main branch (default) |
27
+ | Last N commits | `git log --oneline -N` + `git diff HEAD~N..HEAD` | User specifies a range, or on main (default N=5) |
28
+ | Specific commit | `git show <sha>` | User references a specific commit |
29
+ | Working changes | `git diff` + `git diff --cached` | User says "what about these changes?" before committing |
30
+
31
+ **Default behavior:**
32
+ - If on a feature branch: analyze branch commits vs main
33
+ - If on main: analyze the last 5 commits
34
+ - If the user provides a different scope, use that
35
+
36
+ ## Phase 2: Gather Changes
37
+
38
+ 1. Run `git log` with the determined scope to get the commit list and messages
39
+ 2. Run `git diff` for the full diff of the scope
40
+ 3. If the diff is large (>500 lines), use `git diff --stat` first, then selectively read the top 3-5 most-changed files
41
+ 4. **Read commit messages carefully** -- they contain intent that raw diffs miss
42
+ 5. Only read changed files. Do not read the entire repo.
43
+
44
+ ## Phase 3: Analyze
45
+
46
+ Identify the **dominant pattern** -- the single most instructive thing about these changes.
47
+
48
+ Look for:
49
+ - **Structural decisions** -- How was the code organized? Why those boundaries?
50
+ - **Trade-offs made** -- What was gained vs. sacrificed? (readability vs. performance, DRY vs. clarity, speed vs. correctness)
51
+ - **Problems solved** -- What was the before/after? What made the "after" better?
52
+ - **Missed opportunities** -- Where could the code improve? (present gently as "next time, consider...")
53
+
54
+ Map findings to specific principles from `references/se-principles.md`. Be specific -- quote actual code, reference actual file names and line changes.
55
+
56
+ ## Phase 4: Present the Lesson
57
+
58
+ Use this template:
59
+
60
+ ```markdown
61
+ ## Lesson: [Principle Name]
62
+
63
+ **What happened in the code:**
64
+ [2-3 sentences describing the specific change, referencing files and commits]
65
+
66
+ **The principle at work:**
67
+ [1-2 sentences explaining the SE principle]
68
+
69
+ **Why it matters:**
70
+ [1-2 sentences on the practical consequence -- what would go wrong without this, or what goes right because of it]
71
+
72
+ **Takeaway for next time:**
73
+ [One concrete, actionable sentence the user can apply to future work]
74
+ ```
75
+
76
+ If there is a second lesson worth noting (maximum 2 additional):
77
+
78
+ ```markdown
79
+ ---
80
+
81
+ ### Also worth noting: [Principle Name]
82
+
83
+ **In the code:** [1 sentence]
84
+ **The principle:** [1 sentence]
85
+ **Takeaway:** [1 sentence]
86
+ ```
87
+
88
+ ## What NOT to Do
89
+
90
+ | Avoid | Why | Instead |
91
+ |-------|-----|---------|
92
+ | Listing every principle that vaguely applies | Overwhelming and generic | Pick the 1-2 most relevant |
93
+ | Analyzing files that were not changed | Scope creep | Stick to the diff |
94
+ | Ignoring commit messages | They contain intent that diffs miss | Read them as primary context |
95
+ | Abstract advice disconnected from the code | Not actionable | Always reference specific files/lines |
96
+ | Negative-only feedback | Demoralizing | Lead with what works, then suggest improvements |
97
+ | More than 3 lessons | Dilutes the insight | One well-grounded lesson beats seven vague ones |
98
+
99
+ ## Conversation Style
100
+
101
+ - **Reflective, not prescriptive.** Use the user's own code as primary evidence.
102
+ - **Never say "you should have..."** -- instead use "the approach here shows..." or "next time you face this, consider..."
103
+ - **If the code is good, say so.** Not every lesson is about what went wrong. Recognizing good patterns reinforces them.
104
+ - **If the changes are trivial** (a single config tweak, a typo fix), say so honestly rather than forcing a lesson. "These changes are straightforward -- no deep lesson here, just good housekeeping."
105
+ - **Be specific.** Generic advice is worthless. Every claim must point to a concrete code change.
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: Common anti-patterns to detect in code diffs. Use alongside se-principles.md for balanced analysis -- principles show what's good, anti-patterns show what to watch for.
3
+ ---
4
+
5
+ # Anti-Patterns
6
+
7
+ When analyzing a diff, check for these signals. Present findings gently -- as opportunities, not failures.
8
+
9
+ ## God Object / God Class
10
+
11
+ One module doing too much.
12
+ **Diff signals:** A single file with many unrelated changes. One class/module imported everywhere. A file over 500 lines that keeps growing.
13
+ **Suggest:** Extract responsibilities into focused modules (SRP).
14
+
15
+ ## Shotgun Surgery
16
+
17
+ One logical change scattered across many files.
18
+ **Diff signals:** 10+ files changed for a single feature or fix. The same type of edit repeated in many places. A rename or config change touching dozens of files.
19
+ **Suggest:** Consolidate the scattered logic. If one change requires editing many files, the abstraction boundaries may be wrong.
20
+
21
+ ## Feature Envy
22
+
23
+ A function that uses another module's data more than its own.
24
+ **Diff signals:** Heavy cross-module imports. A function reaching deep into another object's properties. Utility functions that only serve one caller in a different module.
25
+ **Suggest:** Move the function closer to the data it uses.
26
+
27
+ ## Premature Abstraction
28
+
29
+ Abstracting before there are multiple concrete cases.
30
+ **Diff signals:** An interface with exactly one implementation. A factory that creates only one type. A generic solution for a problem that exists only once.
31
+ **Suggest:** Wait for the second or third use case before abstracting (Rule of Three).
32
+
33
+ ## Copy-Paste Programming
34
+
35
+ Duplicated code blocks with minor variations.
36
+ **Diff signals:** Similar code appearing in multiple places in the diff. Functions that differ by only a parameter or two. Repeated patterns that could be parameterized.
37
+ **Suggest:** Extract shared logic, parameterize the differences.
38
+
39
+ ## Magic Numbers / Strings
40
+
41
+ Literal values without explanation.
42
+ **Diff signals:** Hardcoded numbers in conditions (`if (retries > 3)`). String literals used as keys or identifiers. Timeouts, limits, or thresholds without named constants.
43
+ **Suggest:** Extract to named constants that explain the "why."
44
+
45
+ ## Long Method
46
+
47
+ Functions that do too much.
48
+ **Diff signals:** New functions over 40-50 lines. Functions with multiple levels of nesting. Functions that require scrolling to read.
49
+ **Suggest:** Extract sub-steps into named functions. Each function should do one thing.
50
+
51
+ ## Excessive Comments
52
+
53
+ Comments explaining "what" instead of "why."
54
+ **Diff signals:** Comments restating the code (`// increment counter`). Large comment blocks before straightforward code. Commented-out code left in place.
55
+ **Suggest:** Make the code self-documenting through better naming. Use comments only for "why" -- intent, trade-offs, non-obvious constraints.
@@ -0,0 +1,109 @@
1
+ ---
2
+ description: Curated catalog of software engineering principles. Load this before analyzing code changes so you can map observations to named principles.
3
+ ---
4
+
5
+ # Software Engineering Principles
6
+
7
+ Use this as a lookup table. When you spot a pattern in a diff, find the matching principle here. Each entry includes **code signals** -- what to look for in actual changes.
8
+
9
+ ## Design Principles (SOLID)
10
+
11
+ **Single Responsibility Principle (SRP)**
12
+ A module should have one reason to change.
13
+ Code signals: A class/file was split into two. A function was extracted. A component stopped handling both UI and data fetching.
14
+
15
+ **Open/Closed Principle (OCP)**
16
+ Open for extension, closed for modification.
17
+ Code signals: New behavior added without changing existing code. A plugin/hook/callback system introduced. Strategy pattern or configuration used instead of conditionals.
18
+
19
+ **Liskov Substitution Principle (LSP)**
20
+ Subtypes must be substitutable for their base types.
21
+ Code signals: An interface was introduced to unify implementations. A subclass override changed behavior in a way that broke callers (violation). Type narrowing or guards added.
22
+
23
+ **Interface Segregation Principle (ISP)**
24
+ No client should depend on methods it doesn't use.
25
+ Code signals: A large interface was split into smaller ones. Optional methods removed from an interface. A "fat" props object was broken into focused ones.
26
+
27
+ **Dependency Inversion Principle (DIP)**
28
+ Depend on abstractions, not concretions.
29
+ Code signals: A concrete dependency replaced with an interface/injection. A factory or provider pattern introduced. Import paths changed from specific implementations to abstract layers.
30
+
31
+ **Composition over Inheritance**
32
+ Favor object composition over class inheritance.
33
+ Code signals: Inheritance hierarchy replaced with delegation. Mixins or HOCs replaced with hooks or composition. A "base class" was removed.
34
+
35
+ ## Simplicity Principles
36
+
37
+ **DRY (Don't Repeat Yourself)**
38
+ Every piece of knowledge should have a single representation.
39
+ Code signals: Duplicate code extracted into a shared function. A constant replaced repeated literals. A template/generator replaced copy-pasted boilerplate.
40
+
41
+ **KISS (Keep It Simple, Stupid)**
42
+ The simplest solution that works is the best.
43
+ Code signals: A complex abstraction replaced with a straightforward implementation. Unnecessary indirection removed. A clever one-liner replaced with readable code.
44
+
45
+ **YAGNI (You Aren't Gonna Need It)**
46
+ Don't build it until you actually need it.
47
+ Code signals: Speculative features removed. Unused configuration options deleted. An over-engineered solution simplified to match actual requirements.
48
+
49
+ **Rule of Three**
50
+ Wait until the third duplication before abstracting.
51
+ Code signals: Similar code exists in 2 places and was left alone (good). A premature abstraction was introduced after only one use (violation). Third occurrence triggered extraction (textbook application).
52
+
53
+ **Principle of Least Surprise**
54
+ Code should behave the way most users would expect.
55
+ Code signals: A function renamed to better describe what it does. Return types made consistent. Side effects made explicit or removed.
56
+
57
+ ## Structural Principles
58
+
59
+ **Separation of Concerns**
60
+ Different responsibilities should live in different modules.
61
+ Code signals: Business logic extracted from UI components. Data access separated from domain logic. Configuration separated from behavior. A "god file" split into focused modules.
62
+
63
+ **High Cohesion**
64
+ Related functionality should live together.
65
+ Code signals: Scattered related functions gathered into one module. A utility file broken up so each piece lives near its consumers. A feature folder created.
66
+
67
+ **Loose Coupling**
68
+ Modules should depend on each other as little as possible.
69
+ Code signals: Direct imports replaced with events/callbacks. A shared dependency removed. Modules communicate through well-defined interfaces instead of reaching into internals.
70
+
71
+ **Encapsulation**
72
+ Hide internal details, expose only what's necessary.
73
+ Code signals: Public methods reduced. Internal helpers made private. A module's API surface shrunk. Implementation details hidden behind a facade.
74
+
75
+ **Information Hiding**
76
+ Modules should not expose their internal data structures.
77
+ Code signals: Raw data structures wrapped in accessor methods. Internal state made private. A data transformation moved inside the module that owns the data.
78
+
79
+ ## Pragmatic Principles
80
+
81
+ **Boy Scout Rule**
82
+ Leave the code better than you found it.
83
+ Code signals: Small cleanups alongside a feature change. A renamed variable for clarity. A dead code path removed. An outdated comment updated.
84
+
85
+ **Fail Fast**
86
+ Detect and report errors as early as possible.
87
+ Code signals: Input validation added at entry points. Assertions added for invariants. Early returns replacing deep nesting. Error handling moved closer to the source.
88
+
89
+ **Defensive Programming**
90
+ Anticipate and handle unexpected inputs gracefully.
91
+ Code signals: Null checks added. Default values provided. Edge cases handled. Error boundaries introduced.
92
+
93
+ **Premature Optimization (avoiding it)**
94
+ Don't optimize until you've measured.
95
+ Code signals: A simple implementation chosen over a "faster" complex one. Readability prioritized over micro-performance. A profiling step added before optimization work.
96
+
97
+ ## Refactoring Patterns
98
+
99
+ **Extract Method/Function**
100
+ Code signals: A long function split into named sub-functions. Inline logic replaced with a well-named call.
101
+
102
+ **Extract Class/Module**
103
+ Code signals: A file split into multiple files. A class split into two with distinct responsibilities.
104
+
105
+ **Replace Conditional with Polymorphism**
106
+ Code signals: A switch/if-else chain replaced with a strategy pattern or subclass dispatch. A type map introduced.
107
+
108
+ **Introduce Parameter Object**
109
+ Code signals: Multiple related parameters grouped into a single options/config object. Function signatures simplified.
@@ -0,0 +1,324 @@
1
+ ---
2
+ name: requirements-clarity
3
+ description: Clarify ambiguous requirements through focused dialogue before implementation. Use when requirements are unclear, features are complex (>2 days), or involve cross-team coordination. Ask two core questions - Why? (YAGNI check) and Simpler? (KISS check) - to ensure clarity before coding.
4
+ ---
5
+
6
+ # Requirements Clarity Skill
7
+
8
+ ## Description
9
+
10
+ Automatically transforms vague requirements into actionable PRDs through systematic clarification with a 100-point scoring system.
11
+
12
+
13
+ ## Instructions
14
+
15
+ When invoked, detect vague requirements:
16
+
17
+ 1. **Vague Feature Requests**
18
+ - User says: "add login feature", "implement payment", "create dashboard"
19
+ - Missing: How, with what technology, what constraints?
20
+
21
+ 2. **Missing Technical Context**
22
+ - No technology stack mentioned
23
+ - No integration points identified
24
+ - No performance/security constraints
25
+
26
+ 3. **Incomplete Specifications**
27
+ - No acceptance criteria
28
+ - No success metrics
29
+ - No edge cases considered
30
+ - No error handling mentioned
31
+
32
+ 4. **Ambiguous Scope**
33
+ - Unclear boundaries ("user management" - what exactly?)
34
+ - No distinction between MVP and future enhancements
35
+ - Missing "what's NOT included"
36
+
37
+ **Do NOT activate when**:
38
+ - Specific file paths mentioned (e.g., "auth.go:45")
39
+ - Code snippets included
40
+ - Existing functions/classes referenced
41
+ - Bug fixes with clear reproduction steps
42
+
43
+ ## Core Principles
44
+
45
+ 1. **Systematic Questioning**
46
+ - Ask focused, specific questions
47
+ - One category at a time (2-3 questions per round)
48
+ - Build on previous answers
49
+ - Avoid overwhelming users
50
+
51
+ 2. **Quality-Driven Iteration**
52
+ - Continuously assess clarity score (0-100)
53
+ - Identify gaps systematically
54
+ - Iterate until ≥ 90 points
55
+ - Document all clarification rounds
56
+
57
+ 3. **Actionable Output**
58
+ - Generate concrete specifications
59
+ - Include measurable acceptance criteria
60
+ - Provide executable phases
61
+ - Enable direct implementation
62
+
63
+ ## Clarification Process
64
+
65
+ ### Step 1: Initial Requirement Analysis
66
+
67
+ **Input**: User's requirement description
68
+
69
+ **Tasks**:
70
+ 1. Parse and understand core requirement
71
+ 2. Generate feature name (kebab-case format)
72
+ 3. Determine document version (default `1.0` unless user specifies otherwise)
73
+ 4. Ensure `./docs/prds/` exists for PRD output
74
+ 5. Perform initial clarity assessment (0-100)
75
+
76
+ **Assessment Rubric**:
77
+ ```
78
+ Functional Clarity: /30 points
79
+ - Clear inputs/outputs: 10 pts
80
+ - User interaction defined: 10 pts
81
+ - Success criteria stated: 10 pts
82
+
83
+ Technical Specificity: /25 points
84
+ - Technology stack mentioned: 8 pts
85
+ - Integration points identified: 8 pts
86
+ - Constraints specified: 9 pts
87
+
88
+ Implementation Completeness: /25 points
89
+ - Edge cases considered: 8 pts
90
+ - Error handling mentioned: 9 pts
91
+ - Data validation specified: 8 pts
92
+
93
+ Business Context: /20 points
94
+ - Problem statement clear: 7 pts
95
+ - Target users identified: 7 pts
96
+ - Success metrics defined: 6 pts
97
+ ```
98
+
99
+ **Initial Response Format**:
100
+ ```markdown
101
+ I understand your requirement. Let me help you refine this specification.
102
+
103
+ **Current Clarity Score**: X/100
104
+
105
+ **Clear Aspects**:
106
+ - [List what's clear]
107
+
108
+ **Needs Clarification**:
109
+ - [List gaps]
110
+
111
+ Let me systematically clarify these points...
112
+ ```
113
+
114
+ ### Step 2: Gap Analysis
115
+
116
+ Identify missing information across four dimensions:
117
+
118
+ **1. Functional Scope**
119
+ - What is the core functionality?
120
+ - What are the boundaries?
121
+ - What is out of scope?
122
+ - What are edge cases?
123
+
124
+ **2. User Interaction**
125
+ - How do users interact?
126
+ - What are the inputs?
127
+ - What are the outputs?
128
+ - What are success/failure scenarios?
129
+
130
+ **3. Technical Constraints**
131
+ - Performance requirements?
132
+ - Compatibility requirements?
133
+ - Security considerations?
134
+ - Scalability needs?
135
+
136
+ **4. Business Value**
137
+ - What problem does this solve?
138
+ - Who are the target users?
139
+ - What are success metrics?
140
+ - What is the priority?
141
+
142
+ ### Step 3: Interactive Clarification
143
+
144
+ **Question Strategy**:
145
+ 1. Start with highest-impact gaps
146
+ 2. Ask 2-3 questions per round
147
+ 3. Build context progressively
148
+ 4. Use user's language
149
+ 5. Provide examples when helpful
150
+
151
+ **Question Format**:
152
+ ```markdown
153
+ I need to clarify the following points to complete the requirements document:
154
+
155
+ 1. **[Category]**: [Specific question]?
156
+ - For example: [Example if helpful]
157
+
158
+ 2. **[Category]**: [Specific question]?
159
+
160
+ 3. **[Category]**: [Specific question]?
161
+
162
+ Please provide your answers, and I'll continue refining the PRD.
163
+ ```
164
+
165
+ **After Each User Response**:
166
+ 1. Update clarity score
167
+ 2. Capture new information in the working PRD outline
168
+ 3. Identify remaining gaps
169
+ 4. If score < 90: Continue with next round of questions
170
+ 5. If score ≥ 90: Proceed to PRD generation
171
+
172
+ **Score Update Format**:
173
+ ```markdown
174
+ Thank you for the additional information!
175
+
176
+ **Clarity Score Update**: X/100 → Y/100
177
+
178
+ **New Clarified Content**:
179
+ - [Summarize new information]
180
+
181
+ **Remaining Points to Clarify**:
182
+ - [List remaining gaps if score < 90]
183
+
184
+ [If score < 90: Continue with next round of questions]
185
+ [If score ≥ 90: "Perfect! I will now generate the complete PRD document..."]
186
+ ```
187
+
188
+ ### Step 4: PRD Generation
189
+
190
+ Once clarity score ≥ 90, generate comprehensive PRD.
191
+
192
+ **Output File**:
193
+
194
+ 1. **Final PRD**: `./docs/prds/{feature_name}-v{version}-prd.md`
195
+
196
+ Use the `Write` tool to create or update this file. Derive `{version}` from the document version recorded in the PRD (default `1.0`).
197
+
198
+ ## PRD Document Structure
199
+
200
+ ```markdown
201
+ # {Feature Name} - Product Requirements Document (PRD)
202
+
203
+ ## Requirements Description
204
+
205
+ ### Background
206
+ - **Business Problem**: [Describe the business problem to solve]
207
+ - **Target Users**: [Target user groups]
208
+ - **Value Proposition**: [Value this feature brings]
209
+
210
+ ### Feature Overview
211
+ - **Core Features**: [List of main features]
212
+ - **Feature Boundaries**: [What is and isn't included]
213
+ - **User Scenarios**: [Typical usage scenarios]
214
+
215
+ ### Detailed Requirements
216
+ - **Input/Output**: [Specific input/output specifications]
217
+ - **User Interaction**: [User operation flow]
218
+ - **Data Requirements**: [Data structures and validation rules]
219
+ - **Edge Cases**: [Edge case handling]
220
+
221
+ ## Design Decisions
222
+
223
+ ### Technical Approach
224
+ - **Architecture Choice**: [Technical architecture decisions and rationale]
225
+ - **Key Components**: [List of main technical components]
226
+ - **Data Storage**: [Data models and storage solutions]
227
+ - **Interface Design**: [API/interface specifications]
228
+
229
+ ### Constraints
230
+ - **Performance Requirements**: [Response time, throughput, etc.]
231
+ - **Compatibility**: [System compatibility requirements]
232
+ - **Security**: [Security considerations]
233
+ - **Scalability**: [Future expansion considerations]
234
+
235
+ ### Risk Assessment
236
+ - **Technical Risks**: [Potential technical risks and mitigation plans]
237
+ - **Dependency Risks**: [External dependencies and alternatives]
238
+ - **Schedule Risks**: [Timeline risks and response strategies]
239
+
240
+ ## Acceptance Criteria
241
+
242
+ ### Functional Acceptance
243
+ - [ ] Feature 1: [Specific acceptance conditions]
244
+ - [ ] Feature 2: [Specific acceptance conditions]
245
+ - [ ] Feature 3: [Specific acceptance conditions]
246
+
247
+ ### Quality Standards
248
+ - [ ] Code Quality: [Code standards and review requirements]
249
+ - [ ] Test Coverage: [Testing requirements and coverage]
250
+ - [ ] Performance Metrics: [Performance test pass criteria]
251
+ - [ ] Security Review: [Security review requirements]
252
+
253
+ ### User Acceptance
254
+ - [ ] User Experience: [UX acceptance criteria]
255
+ - [ ] Documentation: [Documentation delivery requirements]
256
+ - [ ] Training Materials: [If needed, training material requirements]
257
+
258
+ ## Execution Phases
259
+
260
+ ### Phase 1: Preparation
261
+ **Goal**: Environment preparation and technical validation
262
+ - [ ] Task 1: [Specific task description]
263
+ - [ ] Task 2: [Specific task description]
264
+ - **Deliverables**: [Phase deliverables]
265
+ - **Time**: [Estimated time]
266
+
267
+ ### Phase 2: Core Development
268
+ **Goal**: Implement core functionality
269
+ - [ ] Task 1: [Specific task description]
270
+ - [ ] Task 2: [Specific task description]
271
+ - **Deliverables**: [Phase deliverables]
272
+ - **Time**: [Estimated time]
273
+
274
+ ### Phase 3: Integration & Testing
275
+ **Goal**: Integration and quality assurance
276
+ - [ ] Task 1: [Specific task description]
277
+ - [ ] Task 2: [Specific task description]
278
+ - **Deliverables**: [Phase deliverables]
279
+ - **Time**: [Estimated time]
280
+
281
+ ### Phase 4: Deployment
282
+ **Goal**: Release and monitoring
283
+ - [ ] Task 1: [Specific task description]
284
+ - [ ] Task 2: [Specific task description]
285
+ - **Deliverables**: [Phase deliverables]
286
+ - **Time**: [Estimated time]
287
+
288
+ ---
289
+
290
+ **Document Version**: 1.0
291
+ **Created**: {timestamp}
292
+ **Clarification Rounds**: {clarification_rounds}
293
+ **Quality Score**: {quality_score}/100
294
+ ```
295
+
296
+ ## Behavioral Guidelines
297
+
298
+ ### DO
299
+ - Ask specific, targeted questions
300
+ - Build on previous answers
301
+ - Provide examples to guide users
302
+ - Maintain conversational tone
303
+ - Summarize clarification rounds within the PRD
304
+ - Use clear, professional English
305
+ - Generate concrete specifications
306
+ - Stay in clarification mode until score ≥ 90
307
+
308
+ ### DON'T
309
+ - Ask all questions at once
310
+ - Make assumptions without confirmation
311
+ - Generate PRD before 90+ score
312
+ - Skip any required sections
313
+ - Use vague or abstract language
314
+ - Proceed without user responses
315
+ - Exit skill mode prematurely
316
+
317
+ ## Success Criteria
318
+
319
+ - Clarity score ≥ 90/100
320
+ - All PRD sections complete with substance
321
+ - Acceptance criteria checklistable (using `- [ ]` format)
322
+ - Execution phases actionable with concrete tasks
323
+ - User approves final PRD
324
+ - Ready for development handoff