scip-query 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/README.md +115 -58
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-23FVN4Y5.js +2 -0
  4. package/dist/chunk-24PFLKFK.js +2 -0
  5. package/dist/{chunk-A2VTV2QB.js → chunk-27KPKLRJ.js} +2 -2
  6. package/dist/chunk-2NLK4INB.js +2 -0
  7. package/dist/{chunk-6K2JQ2VI.js → chunk-2XKAMW6B.js} +2 -2
  8. package/dist/{chunk-4DAPXOWD.js → chunk-332L7SRO.js} +2 -2
  9. package/dist/chunk-44JOJLMO.js +38 -0
  10. package/dist/{chunk-MCW36F2D.js → chunk-4EAANIWC.js} +2 -2
  11. package/dist/{chunk-FVIKFWUL.js → chunk-4N7LFYSD.js} +2 -2
  12. package/dist/{chunk-4MHT7LKP.js → chunk-5ALI77D7.js} +2 -2
  13. package/dist/{chunk-V76FCF5F.js → chunk-5BZOSICN.js} +2 -2
  14. package/dist/{chunk-IVAIPXNO.js → chunk-5D3BT4B4.js} +2 -2
  15. package/dist/{chunk-ADRYSISR.js → chunk-5HDYAOSF.js} +2 -2
  16. package/dist/{chunk-IC3RC3KJ.js → chunk-5IDEQEM4.js} +2 -2
  17. package/dist/{chunk-NC4IUW25.js → chunk-5VB3WU7K.js} +2 -2
  18. package/dist/chunk-623UQCVG.js +2 -0
  19. package/dist/chunk-62NMBOA5.js +2 -0
  20. package/dist/chunk-64LH2QUP.js +62 -0
  21. package/dist/{chunk-PG3ZI5IH.js → chunk-65UWNXEH.js} +1 -1
  22. package/dist/{chunk-OLCKSG3Y.js → chunk-6TWFT4Y5.js} +2 -2
  23. package/dist/chunk-6U4EODW3.js +2 -0
  24. package/dist/{chunk-MN75T4UB.js → chunk-6YKJSETN.js} +2 -2
  25. package/dist/chunk-A2GVUCZR.js +8 -0
  26. package/dist/{chunk-WEJYUS5O.js → chunk-ADKQX2OY.js} +2 -2
  27. package/dist/{chunk-YWZBKYLS.js → chunk-ADTG377O.js} +2 -2
  28. package/dist/chunk-ATGRITZP.js +20 -0
  29. package/dist/chunk-B3HMRQDA.js +2 -0
  30. package/dist/chunk-B75HZHUP.js +2 -0
  31. package/dist/chunk-BGBBVSH4.js +2 -0
  32. package/dist/chunk-BJ7OHKB5.js +2 -0
  33. package/dist/{chunk-VZRILF2Z.js → chunk-CCB45WDY.js} +2 -2
  34. package/dist/chunk-CFLYMEUS.js +2 -0
  35. package/dist/{chunk-ISCKLDSS.js → chunk-CMGOXDVP.js} +3 -3
  36. package/dist/chunk-DBIG4QAJ.js +2 -0
  37. package/dist/{chunk-4JQFTUKD.js → chunk-DMLPJ75B.js} +2 -2
  38. package/dist/chunk-DRU74YUM.js +71 -0
  39. package/dist/chunk-DTERBKUE.js +7 -0
  40. package/dist/{chunk-4HTJZC6G.js → chunk-E55WCTLH.js} +2 -2
  41. package/dist/{chunk-CMXFASVD.js → chunk-F4PKYBQB.js} +2 -2
  42. package/dist/{chunk-L2KFPRMA.js → chunk-FVX4GEAC.js} +2 -2
  43. package/dist/{chunk-AP5GTKSG.js → chunk-GTNPPGZJ.js} +2 -2
  44. package/dist/{chunk-ZZ2W5P3D.js → chunk-GZXXBDJA.js} +2 -2
  45. package/dist/chunk-HCQ7J2N5.js +3 -0
  46. package/dist/chunk-HQHFMPLJ.js +2 -0
  47. package/dist/{chunk-SCEMECW7.js → chunk-I6PTB2CM.js} +2 -2
  48. package/dist/{chunk-772YYL6I.js → chunk-IJYWCB57.js} +2 -2
  49. package/dist/chunk-JTRY2YRJ.js +2 -0
  50. package/dist/chunk-L77GXANO.js +6 -0
  51. package/dist/{chunk-R6XDPWJA.js → chunk-LT6GJ27X.js} +2 -2
  52. package/dist/chunk-LUBKUISI.js +2 -0
  53. package/dist/{chunk-ZGIK464P.js → chunk-LVYXX7ZW.js} +2 -2
  54. package/dist/{chunk-2WEH5QHC.js → chunk-LWPEZ4FP.js} +2 -2
  55. package/dist/chunk-LWWZBABT.js +2 -0
  56. package/dist/chunk-LXM7AHQG.js +4 -0
  57. package/dist/chunk-LY6NRJPJ.js +2 -0
  58. package/dist/chunk-LYS4SMAQ.js +2 -0
  59. package/dist/{chunk-BNW3Q24R.js → chunk-MESUJJVQ.js} +2 -2
  60. package/dist/{chunk-Y5H7TBVE.js → chunk-MHAQXOZY.js} +2 -2
  61. package/dist/chunk-N2T2GPYQ.js +2 -0
  62. package/dist/chunk-OB6PEVI3.js +2 -0
  63. package/dist/chunk-PNN3D4BE.js +2 -0
  64. package/dist/{chunk-QJWN6LA5.js → chunk-PV4CEDIL.js} +2 -2
  65. package/dist/chunk-QH5GTVVB.js +3 -0
  66. package/dist/{chunk-ZOT3WUZW.js → chunk-QOFKVNFE.js} +2 -2
  67. package/dist/chunk-QUKZ77A6.js +4 -0
  68. package/dist/chunk-R42LZMLX.js +2 -0
  69. package/dist/{chunk-2BMFRBV6.js → chunk-R7S3UCDR.js} +2 -2
  70. package/dist/chunk-RGDUIMNE.js +3 -0
  71. package/dist/{chunk-BGRPMGTD.js → chunk-RNLUCQJB.js} +2 -2
  72. package/dist/chunk-RYBMW2EN.js +2 -0
  73. package/dist/{chunk-VGBSY6N7.js → chunk-SA6B3EGD.js} +2 -2
  74. package/dist/chunk-T67R7V5I.js +2 -0
  75. package/dist/chunk-TMS4JPWY.js +3 -0
  76. package/dist/chunk-TTGWDUJ4.js +5 -0
  77. package/dist/chunk-TUAPDKBI.js +2 -0
  78. package/dist/chunk-UVK3SL4Z.js +2 -0
  79. package/dist/chunk-W3PQRAI4.js +2 -0
  80. package/dist/{chunk-PRVDXGSK.js → chunk-WWFBDM5Y.js} +2 -2
  81. package/dist/{chunk-AQYBOORI.js → chunk-WZVTADY7.js} +1 -1
  82. package/dist/chunk-XGGTESMN.js +2 -0
  83. package/dist/{chunk-NGI4V4AB.js → chunk-Y33GRQK6.js} +2 -2
  84. package/dist/{chunk-QKO474FG.js → chunk-YIE5FZAF.js} +2 -2
  85. package/dist/chunk-YISMWW66.js +7 -0
  86. package/dist/chunk-YVQUQIBM.js +5 -0
  87. package/dist/{chunk-6DEX3XP6.js → chunk-YYCQQBMG.js} +2 -2
  88. package/dist/cli.js +221 -233
  89. package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bok4jrO3.d.ts} +29 -1
  90. package/dist/{db-DdTPetj5.d.ts → db-BkFlkzI3.d.ts} +1 -1
  91. package/dist/{health-C6r2VgpA.d.ts → health-CbGMdRPg.d.ts} +42 -3
  92. package/dist/index.d.ts +7 -6
  93. package/dist/index.js +1 -1
  94. package/dist/postinstall.js +2 -2
  95. package/dist/queries/affected.d.ts +2 -2
  96. package/dist/queries/affected.js +1 -1
  97. package/dist/queries/bottlenecks.d.ts +2 -2
  98. package/dist/queries/bottlenecks.js +1 -1
  99. package/dist/queries/by-kind.d.ts +2 -2
  100. package/dist/queries/by-kind.js +1 -1
  101. package/dist/queries/call-graph.d.ts +2 -2
  102. package/dist/queries/call-graph.js +1 -1
  103. package/dist/queries/change-surface.d.ts +2 -2
  104. package/dist/queries/change-surface.js +1 -1
  105. package/dist/queries/cleanup-plan.d.ts +2 -2
  106. package/dist/queries/cleanup-plan.js +1 -1
  107. package/dist/queries/co-change.d.ts +5 -4
  108. package/dist/queries/co-change.js +1 -1
  109. package/dist/queries/code.d.ts +2 -2
  110. package/dist/queries/code.js +1 -1
  111. package/dist/queries/complexity-hotspots.d.ts +2 -2
  112. package/dist/queries/complexity-hotspots.js +1 -1
  113. package/dist/queries/complexity.d.ts +2 -2
  114. package/dist/queries/complexity.js +1 -1
  115. package/dist/queries/convergence.d.ts +2 -2
  116. package/dist/queries/convergence.js +1 -1
  117. package/dist/queries/coupling.d.ts +2 -2
  118. package/dist/queries/coupling.js +1 -1
  119. package/dist/queries/cycles.d.ts +2 -2
  120. package/dist/queries/cycles.js +1 -1
  121. package/dist/queries/dataflow.d.ts +2 -2
  122. package/dist/queries/dataflow.js +1 -1
  123. package/dist/queries/dead.d.ts +2 -2
  124. package/dist/queries/dead.js +1 -1
  125. package/dist/queries/deep-chains.d.ts +2 -2
  126. package/dist/queries/deep-chains.js +1 -1
  127. package/dist/queries/deps.d.ts +2 -2
  128. package/dist/queries/deps.js +1 -1
  129. package/dist/queries/diff-gate.d.ts +21 -3
  130. package/dist/queries/diff-gate.js +1 -1
  131. package/dist/queries/diff-impact.d.ts +20 -4
  132. package/dist/queries/diff-impact.js +1 -1
  133. package/dist/queries/doc-drift.d.ts +2 -2
  134. package/dist/queries/doc-drift.js +1 -1
  135. package/dist/queries/drift.d.ts +2 -2
  136. package/dist/queries/drift.js +1 -1
  137. package/dist/queries/extract-candidates.d.ts +2 -2
  138. package/dist/queries/extract-candidates.js +1 -1
  139. package/dist/queries/fan.d.ts +2 -2
  140. package/dist/queries/fan.js +1 -1
  141. package/dist/queries/files.d.ts +2 -2
  142. package/dist/queries/files.js +1 -1
  143. package/dist/queries/health.d.ts +3 -3
  144. package/dist/queries/health.js +1 -1
  145. package/dist/queries/hierarchy.d.ts +2 -2
  146. package/dist/queries/hierarchy.js +1 -1
  147. package/dist/queries/hotspots.d.ts +2 -2
  148. package/dist/queries/hotspots.js +1 -1
  149. package/dist/queries/imports.d.ts +2 -2
  150. package/dist/queries/imports.js +1 -1
  151. package/dist/queries/incomplete-migration.d.ts +4 -2
  152. package/dist/queries/incomplete-migration.js +1 -1
  153. package/dist/queries/index.d.ts +10 -4
  154. package/dist/queries/index.js +1 -1
  155. package/dist/queries/isolated.d.ts +2 -2
  156. package/dist/queries/isolated.js +1 -1
  157. package/dist/queries/members.d.ts +2 -2
  158. package/dist/queries/members.js +1 -1
  159. package/dist/queries/methods.d.ts +2 -2
  160. package/dist/queries/methods.js +1 -1
  161. package/dist/queries/outline.d.ts +2 -2
  162. package/dist/queries/outline.js +1 -1
  163. package/dist/queries/passthrough-candidates.d.ts +2 -2
  164. package/dist/queries/passthrough-candidates.js +1 -1
  165. package/dist/queries/plan-context.d.ts +2 -2
  166. package/dist/queries/plan-context.js +1 -1
  167. package/dist/queries/react-component-duplicates.d.ts +31 -0
  168. package/dist/queries/react-component-duplicates.js +2 -0
  169. package/dist/queries/react-hook-candidates.d.ts +34 -0
  170. package/dist/queries/react-hook-candidates.js +2 -0
  171. package/dist/queries/react-large-component-pressure.d.ts +28 -0
  172. package/dist/queries/react-large-component-pressure.js +2 -0
  173. package/dist/queries/recent-duplicates.d.ts +10 -3
  174. package/dist/queries/recent-duplicates.js +1 -1
  175. package/dist/queries/redundant-reexports.d.ts +2 -2
  176. package/dist/queries/redundant-reexports.js +1 -1
  177. package/dist/queries/refs.d.ts +2 -2
  178. package/dist/queries/refs.js +1 -1
  179. package/dist/queries/self-audit.d.ts +2 -2
  180. package/dist/queries/self-audit.js +1 -1
  181. package/dist/queries/similar-chains.d.ts +2 -2
  182. package/dist/queries/similar-chains.js +1 -1
  183. package/dist/queries/similar-files.d.ts +2 -2
  184. package/dist/queries/similar-files.js +1 -1
  185. package/dist/queries/similar-signatures.d.ts +2 -2
  186. package/dist/queries/similar-signatures.js +1 -1
  187. package/dist/queries/similar.d.ts +8 -3
  188. package/dist/queries/similar.js +1 -1
  189. package/dist/queries/slice.d.ts +2 -2
  190. package/dist/queries/slice.js +1 -1
  191. package/dist/queries/stale-abstractions.d.ts +2 -2
  192. package/dist/queries/stale-abstractions.js +1 -1
  193. package/dist/queries/stats.d.ts +2 -2
  194. package/dist/queries/stats.js +1 -1
  195. package/dist/queries/surface.d.ts +2 -2
  196. package/dist/queries/surface.js +1 -1
  197. package/dist/queries/symbols.d.ts +2 -2
  198. package/dist/queries/symbols.js +1 -1
  199. package/dist/queries/system.d.ts +2 -2
  200. package/dist/queries/system.js +1 -1
  201. package/dist/queries/trace.d.ts +2 -2
  202. package/dist/queries/trace.js +1 -1
  203. package/dist/queries/unused-params.d.ts +2 -2
  204. package/dist/queries/unused-params.js +1 -1
  205. package/dist/queries/vue-component-duplicates.d.ts +35 -0
  206. package/dist/queries/vue-component-duplicates.js +2 -0
  207. package/dist/queries/vue-composable-candidates.d.ts +34 -0
  208. package/dist/queries/vue-composable-candidates.js +2 -0
  209. package/dist/queries/vue-large-view-pressure.d.ts +31 -0
  210. package/dist/queries/vue-large-view-pressure.js +2 -0
  211. package/dist/queries/wrapper-candidates.d.ts +2 -2
  212. package/dist/queries/wrapper-candidates.js +1 -1
  213. package/dist/reindex-worker.js +10 -10
  214. package/dist/reindex.d.ts +1 -1
  215. package/dist/reindex.js +22 -22
  216. package/dist/runtime.d.ts +1 -1
  217. package/dist/runtime.js +2 -2
  218. package/docs/AGENT_GUIDE.md +353 -0
  219. package/docs/AI_FAILURE_MODES.md +278 -0
  220. package/docs/API.md +40 -0
  221. package/docs/COMMAND_REFERENCE.md +130 -0
  222. package/docs/DETECTOR_GUIDE.md +119 -0
  223. package/docs/accuracy-hardening-goal.md +54 -0
  224. package/docs/assets/scip-query-logo-dark.svg +21 -0
  225. package/docs/assets/scip-query-logo.svg +24 -0
  226. package/package.json +31 -3
  227. package/skills/scip-maintainability/SKILL.md +24 -3
  228. package/skills/scip-query/SKILL.md +2 -1
  229. package/skills/scip-react-maintainability/SKILL.md +114 -0
  230. package/skills/scip-vue-maintainability/SKILL.md +130 -0
  231. package/dist/chunk-5OHZEO3U.js +0 -3
  232. package/dist/chunk-5QJIEYFB.js +0 -34
  233. package/dist/chunk-6IGXZZQ4.js +0 -4
  234. package/dist/chunk-6QVCPUK6.js +0 -2
  235. package/dist/chunk-6VL4AIEO.js +0 -8
  236. package/dist/chunk-AI2ECT7L.js +0 -2
  237. package/dist/chunk-BUAC4Q4G.js +0 -2
  238. package/dist/chunk-BZ6LCGE6.js +0 -2
  239. package/dist/chunk-CO3AL7NZ.js +0 -2
  240. package/dist/chunk-FVVT7GV6.js +0 -4
  241. package/dist/chunk-HXXRN77A.js +0 -2
  242. package/dist/chunk-ITHQJZTG.js +0 -2
  243. package/dist/chunk-IW7ASGVF.js +0 -2
  244. package/dist/chunk-JODYQDE4.js +0 -2
  245. package/dist/chunk-MX6F756F.js +0 -2
  246. package/dist/chunk-O6KCZPJQ.js +0 -62
  247. package/dist/chunk-OAI5GEIN.js +0 -6
  248. package/dist/chunk-OH5HIAID.js +0 -4
  249. package/dist/chunk-OXKEUWMJ.js +0 -2
  250. package/dist/chunk-PBGTMPJ7.js +0 -2
  251. package/dist/chunk-QYKKTYBN.js +0 -6
  252. package/dist/chunk-R3G6ERW7.js +0 -7
  253. package/dist/chunk-SJR4SB7B.js +0 -2
  254. package/dist/chunk-SYKCO25G.js +0 -16
  255. package/dist/chunk-T22X7WT6.js +0 -2
  256. package/dist/chunk-TH4JVC34.js +0 -71
  257. package/dist/chunk-VDY4HYNK.js +0 -2
  258. package/dist/chunk-VDZIEDJB.js +0 -2
  259. package/dist/chunk-VDZL45XI.js +0 -2
  260. package/dist/chunk-WJIS6BNI.js +0 -3
  261. package/dist/chunk-WN5Z3UVT.js +0 -7
  262. package/dist/chunk-XCW7DYHM.js +0 -2
  263. package/dist/chunk-ZF6P2NAT.js +0 -63
@@ -0,0 +1,130 @@
1
+ # Command Reference
2
+
3
+ <!-- BEGIN GENERATED COMMAND REFERENCE -->
4
+
5
+ This syntax summary is generated from the CLI command descriptors. Keep workflow guidance hand-authored, but keep command syntax, descriptions, and option flags descriptor-owned.
6
+
7
+ ### Indexing
8
+
9
+ | Command | Description | Options |
10
+ |---|---|---|
11
+ | `reindex` | Index the codebase and convert to SQLite | `-l, --language <lang>`<br>`--pnpm-workspaces`<br>`--force`<br>`--allow-partial`<br>`--indexer-concurrency <n>` |
12
+ | `augment-sources` | Add source files skipped by upstream SCIP indexers to the SQLite documents table | - |
13
+ | `augment-vue` | Add compiler-resolved Vue SFC references to the SQLite index using Volar | `--project <tsconfig>` |
14
+
15
+ ### Core
16
+
17
+ | Command | Description | Options |
18
+ |---|---|---|
19
+ | `stats` | Show index statistics | `--json` |
20
+
21
+ ### Navigation
22
+
23
+ | Command | Description | Options |
24
+ |---|---|---|
25
+ | `files <pattern>` | Find files matching a pattern | `--json` |
26
+ | `methods <className>` | List methods of a class (with line ranges) | `--json` |
27
+ | `refs <symbol>` | Find all files referencing a symbol | `--full`<br>`--json` |
28
+ | `trace <symbol>` | Trace a symbol: definition + all references | `--full`<br>`--json` |
29
+ | `deps <file>` | Files this file depends on (internal) | `--json` |
30
+ | `rdeps <file>` | Files that depend on this file/module | `--json` |
31
+ | `system <module>` | Full module map: files, symbols, deps in/out | `--json` |
32
+ | `surface <module>` | What symbols consumers actually use from this module | `--json` |
33
+ | `imports <file>` | What symbols does this file import? | `--full`<br>`--json` |
34
+ | `imported-by <symbol>` | Which files import this symbol? | `--json` |
35
+ | `outline <file>` | Tree view of symbols in a file, with line ranges | `--signatures`<br>`--json` |
36
+ | `members <symbol>` | All children of a symbol (methods, fields, nested types) | `--json` |
37
+ | `by-kind <kind>` | Find symbols by SCIP kind (class, interface, enum, function, etc.) | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
38
+ | `kind-counts` | Histogram of symbol kinds in the codebase | `-s, --scope <path>`<br>`--json` |
39
+ | `hierarchy <symbol>` | Show a symbol's ancestry chain (method → class → module) | `--json` |
40
+ | `code <symbol>` | Read the source code for a symbol (bounded to its definition range) | `-C, --context <n>`<br>`--json` |
41
+ | `dataflow <symbol>` | Reference-level dataflow: definition sites, usage sites, producers, consumers | `--full`<br>`--json` |
42
+ | `slice <symbol>` | Reference-level program slice: what affects this (backward) or what this affects (forward) | `--forward`<br>`--depth <n>`<br>`--full`<br>`--json` |
43
+
44
+ ### Cleanup
45
+
46
+ | Command | Description | Options |
47
+ |---|---|---|
48
+ | `dead [scope]` | Find dead code and file-internal symbols (no cross-file consumers) | `--min-loc <n>`<br>`--include-tests`<br>`--skip-barrels`<br>`--include-members`<br>`--only-dead`<br>`--only-internal`<br>`--full`<br>`--json` |
49
+ | `unused-imports <file>` | Find imports not referenced in the same file | `--full`<br>`--json` |
50
+ | `isolated` | Find completely orphaned symbols (no references at all) | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--full`<br>`--json` |
51
+ | `similar [symbol]` | Find heuristic function similarity candidates from callee fingerprints | `--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-callees <n>`<br>`--cross-file-only`<br>`--full`<br>`--json` |
52
+ | `similar-files [file]` | Find heuristic similar-file candidates from dependency profiles | `--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-deps <n>`<br>`--full`<br>`--json` |
53
+ | `react-component-duplicates [file]` | Find heuristic duplicated React component structure candidates from JSX tags, props, events, and bindings | `--min-similarity <n>`<br>`--min-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
54
+ | `react-hook-candidates [file]` | Find heuristic React hook extraction candidates from shared state, effects, requests, and handlers | `--min-similarity <n>`<br>`--min-shared-behaviors <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
55
+ | `react-large-component-pressure [file]` | Find heuristic large React component pressure candidates from component lines, JSX structure, and hook behavior | `--min-component-lines <n>`<br>`--min-file-lines <n>`<br>`--min-jsx-tokens <n>`<br>`--min-behavior-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
56
+ | `vue-component-duplicates [file]` | Find heuristic duplicated Vue component structure candidates from template tags, bindings, slots, and directives | `--min-similarity <n>`<br>`--min-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
57
+ | `vue-composable-candidates [file]` | Find heuristic Vue composable extraction candidates from shared state, effects, requests, and template bindings | `--min-similarity <n>`<br>`--min-shared-behaviors <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
58
+ | `vue-large-view-pressure [file]` | Find heuristic large Vue view pressure candidates from template, script, style, and external script line counts | `--min-total-lines <n>`<br>`--min-template-lines <n>`<br>`--min-script-lines <n>`<br>`--min-style-lines <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
59
+ | `similar-chains` | Find heuristic similar-chain candidates from dependency flows | `--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-length <n>`<br>`--max-length <n>`<br>`--full`<br>`--json` |
60
+ | `extract-candidates` | Find heuristic extraction candidates from isolated callee clusters | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--min-callees <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
61
+ | `cleanup-plan` | Ordered, batched deletion plan: graph-fact dead code plus the cascade candidates it unlocks | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--max-depth <n>`<br>`--verify`<br>`--patch`<br>`--json`<br>`--full` |
62
+ | `cleanup-apply` | Apply a compiler-verified cleanup-plan batch to the working tree | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--max-depth <n>`<br>`--verified`<br>`--batch <n>`<br>`--all`<br>`--force-dirty`<br>`--full` |
63
+ | `recent-duplicates` | Directional duplicate candidates: recent code that re-implements established callable, React, or Vue code | `--window <n>`<br>`--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
64
+ | `doc-drift [doc]` | Stale-doc candidates: code the doc references or co-changed with kept changing after the doc stopped | `-n, --limit <n>`<br>`--min-coupling <n>`<br>`--full`<br>`--json` |
65
+ | `unused-params` | Speculative-generality candidates: trailing parameters no body ever uses (TS/JS) | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
66
+ | `drift [module]` | Detect heuristic drift candidates: unused imports, layer violations, and pattern deviations | `--min-deviation <n>`<br>`--full`<br>`--json` |
67
+ | `wrapper-candidates` | Find heuristic wrapper candidates only called by one consumer | `-s, --scope <path>`<br>`--max-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
68
+ | `passthrough-candidates` | Find heuristic passthrough candidates that forward to one callee | `-s, --scope <path>`<br>`--max-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
69
+ | `stale-abstractions` | Find heuristic stale abstraction candidates with 0-1 consumers | `-s, --scope <path>`<br>`--min-loc <n>`<br>`-n, --limit <n>`<br>`--include-low-confidence`<br>`--full`<br>`--json` |
70
+ | `complexity-hotspots` | Find heuristic complexity hotspot candidates from LOC x fan-in x fan-out | `-s, --scope <path>`<br>`--min-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
71
+ | `convergence <symbol1> <symbol2>` | Show what a consolidated version of two similar functions would look like | `--full`<br>`--json` |
72
+ | `redundant-reexports` | Find barrel re-exports that nobody imports through | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
73
+ | `similar-signatures` | Find functions with near-identical type signatures (same shape) | `-s, --scope <path>`<br>`--min-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
74
+
75
+ ### Graph
76
+
77
+ | Command | Description | Options |
78
+ |---|---|---|
79
+ | `hotspots` | Most-referenced symbols in the codebase (choke points) | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
80
+ | `fan-in [symbol]` | How many files reference a symbol (or top fan-in across codebase) | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
81
+ | `fan-out [file]` | How many external symbols a file uses (or top fan-out across codebase) | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
82
+ | `coupling [file1] [file2]` | Coupling between two files, or top coupled pairs in codebase | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
83
+ | `cycles` | Detect circular dependency chains between files | `-s, --scope <path>`<br>`--max-depth <n>`<br>`--json` |
84
+ | `bottlenecks` | Find coupling hubs: high fan-in AND high fan-out | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-fan-in <n>`<br>`--min-fan-out <n>`<br>`--full`<br>`--json` |
85
+ | `deep-chains` | Find the longest transitive dependency chains | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-depth <n>`<br>`--full`<br>`--json` |
86
+ | `call-graph <symbol>` | Show incoming callers and outgoing callees for a symbol | `--full`<br>`--json` |
87
+
88
+ ### Impact
89
+
90
+ | Command | Description | Options |
91
+ |---|---|---|
92
+ | `affected <symbol>` | Transitive closure of symbols that could break if this symbol changes | `--max-depth <n>`<br>`-s, --scope <path>`<br>`--json` |
93
+ | `change-surface <file>` | Pre-change briefing: exports, consumers, and blast-radius risk | `--full`<br>`--json` |
94
+ | `co-change [file]` | Files that change together in git history without a dependency edge — hidden coupling candidates | `--min-together <n>`<br>`-n, --limit <n>`<br>`--all`<br>`--full`<br>`--json` |
95
+ | `diff-gate` | Gate the current diff: echo candidates, incomplete migrations, missing co-change partners, uncited doc updates, unused params, new dead symbols; exit 1 on findings | `--base <ref>`<br>`--min-together <n>`<br>`--max-echo-checks <n>`<br>`--max-helpers <n>`<br>`--skip <check>`<br>`--hook`<br>`--json` |
96
+ | `incomplete-migration` | Partially-completed extraction candidates: new helpers in the diff wired into some sites while similar un-migrated sites remain | `--base <ref>`<br>`--min-containment <n>`<br>`--max-helpers <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
97
+ | `diff-impact` | Compute changed symbols and downstream consumers from current git diff | `--base <ref>` |
98
+
99
+ ### Planning
100
+
101
+ | Command | Description | Options |
102
+ |---|---|---|
103
+ | `plan-context <target>` | Pre-edit planning context for a symbol, file, or module | `--impact-depth <n>`<br>`--slice-depth <n>`<br>`-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
104
+
105
+ ### Health
106
+
107
+ | Command | Description | Options |
108
+ |---|---|---|
109
+ | `self-audit` | Score the cheap evidence paths against the TypeScript compiler oracle on sampled symbols | `--samples <n>`<br>`-s, --scope <path>`<br>`--json` |
110
+ | `health` | Composite codebase health report with prioritized action list | `-s, --scope <path>`<br>`--full`<br>`--json`<br>`--baseline`<br>`--write-baseline` |
111
+ | `complexity <symbol>` | Per-symbol complexity: branches, cyclomatic estimate, fan-in/out, callees | `--full`<br>`--json` |
112
+
113
+ ### Maintenance
114
+
115
+ | Command | Description | Options |
116
+ |---|---|---|
117
+ | `install-skills` | Install skills (scip-query, concrete-plan, scip-ai-cleanup, scip-explore, scip-debloat, scip-doc-reconcile, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook) into Claude Code, Codex, and shared agent roots | - |
118
+ | `check-deps` | Check whether scip-query and the detected language indexers are actually runnable | - |
119
+ | `capabilities` | Report which evidence and verification capabilities are available in this project | `--json` |
120
+ | `capability-matrix` | Report the evidence and verification capability matrix by language | `--json` |
121
+ | `init` | Create a .scipquery.json config file for this project | - |
122
+ | `config-validate` | Validate .scipquery.json, including structured suppressions and declared coupling groups | `--json` |
123
+ | `suppress <id>` | Record an accepted finding in .scipquery.json with a required reason | `--reason <text>`<br>`--check <check>`<br>`--file <path>`<br>`--expires-at <iso>`<br>`--json` |
124
+ | `doctor` | Diagnose config, index freshness, dependency readiness, and project capabilities | `--json` |
125
+ | `setup-agent` | Seed agent guidance for this project: AGENTS.md/CLAUDE.md block pointing agents at the scip-query skills and diff gate, plus an optional git pre-commit backstop | `--git-hook` |
126
+ | `setup-ci` | Write a GitHub Actions workflow that runs scip-query reindex and diff-gate on pull requests | `--force`<br>`--dry-run` |
127
+ | `watch` | Watch for file changes and reindex automatically | `--debounce <ms>`<br>`--cooldown <ms>` |
128
+ | `status` | Show index status for this project | `--json`<br>`--capabilities` |
129
+
130
+ <!-- END GENERATED COMMAND REFERENCE -->
@@ -0,0 +1,119 @@
1
+ # Which Detector Do I Want?
2
+
3
+ scip-query has several detectors that sound alike but answer different
4
+ questions. This guide explains what each one actually measures, the
5
+ differences inside each confusable cluster, and which check to run after which
6
+ kind of change. (The companion doc [AI_FAILURE_MODES.md](AI_FAILURE_MODES.md)
7
+ maps these to the agent behaviors that create the problems.)
8
+
9
+ ---
10
+
11
+ ## Cluster 1 — "This structure shouldn't exist" (the speculation family)
12
+
13
+ Same disease — structure built for a future that never came — detected at
14
+ four different altitudes:
15
+
16
+ | Command | Altitude | What it measures | The fix |
17
+ |---|---|---|---|
18
+ | `unused-params` | **parameter** | Trailing parameters no body ever uses. TS/JS only, trailing-run only — removals that are type-safe by construction. `_`-prefixed and externally-published signatures are exempt. | Delete the parameters and their call-site arguments. |
19
+ | `passthrough-candidates` | **function (fan-out view)** | Functions with exactly **one callee** and a small body — they just forward arguments to the real implementation. | Inline it: call the target directly. |
20
+ | `wrapper-candidates` | **function (fan-in view)** | Symbols with exactly **one caller** — indirection that provides no reuse. Strongest when the sole caller is itself widely used. | Fold the body into the caller. |
21
+ | `stale-abstractions` | **type** | Classes, interfaces, and type aliases with 0–1 *real* cross-file consumers (barrel re-exports don't count as consumers). Single-implementation interfaces, misplaced types. | De-abstract: replace the interface with the concrete thing, or move the type to its one consumer. |
22
+
23
+ How to keep them straight:
24
+
25
+ - `passthrough` looks **down** (what does this function call? one thing) —
26
+ `wrapper` looks **up** (who calls this function? one caller). A function can
27
+ be both: a one-line forwarder with a single caller is the purest bloat.
28
+ - `unused-params` is *inside* a signature; the other three are *about whole
29
+ symbols*.
30
+ - `stale-abstractions` is the only one about **types**, not behavior. Note its
31
+ confidence ranking: a single-consumer `class` is usually deliberate
32
+ encapsulation (low), a single-consumer `interface` is worth questioning
33
+ (medium), a zero-consumer type is just dead (high).
34
+
35
+ ## Cluster 2 — "This already exists" (the similarity family)
36
+
37
+ All of these find duplication, but at different granularities and with
38
+ different evidence — and two of them add *direction*:
39
+
40
+ | Command | Granularity | Evidence | Question it answers |
41
+ |---|---|---|---|
42
+ | `similar <symbol>` | function | callee-fingerprint cosine (TF-IDF), source-token fallback | "What else does roughly what this function does?" |
43
+ | `similar-signatures` | function | normalized parameter + return types | "What has the same *shape*, regardless of body?" |
44
+ | `similar-files` | file | Jaccard on import/dependency profiles | "Which files are copy-paste variants of each other?" |
45
+ | `similar-chains` | pipeline | edit distance on infrastructure-filtered dependency chains | "Which end-to-end flows are parallel re-implementations?" |
46
+ | `recent-duplicates` | callable/frontend unit + **git age** | callable, React, and Vue similarity + file-add history | "Which side is the established original, which is the fresh echo?" (ECHO = new copies old; TWIN = both new) |
47
+ | `incomplete-migration` | function + **git diff** | callee *containment* vs new-in-diff helpers | "I just extracted a helper — which call sites still have the logic inline and were never migrated?" |
48
+ | `convergence <a> <b>` | a known pair | shared/unique callees | "I already know these two overlap — give me the merge prescription." |
49
+
50
+ How to keep them straight:
51
+
52
+ - Use `similar` when you have **one symbol** in hand; `similar-files` /
53
+ `similar-chains` for repo-wide sweeps at coarser grain;
54
+ `similar-signatures` when implementations differ but the shape repeats.
55
+ - `recent-duplicates` is duplicate evidence **plus direction in time** - it tells you
56
+ which copy to delete. Run it after agent sessions. It covers generic callables,
57
+ React component structure, React hook behavior, Vue template structure, and
58
+ Vue composable-like behavior.
59
+ - `incomplete-migration` is the **inverse of an echo**: the *new* code is the
60
+ canonical one (the helper you just extracted), and the *established* code is
61
+ what should disappear. It also scores by containment, not symmetric
62
+ similarity, because an un-migrated site holds the helper's logic *plus* its
63
+ own — cosine under-scores exactly those.
64
+ - `extract-candidates` is the **before** picture: seams inside one big
65
+ function that *should* become a helper. `incomplete-migration` is the
66
+ **after** picture: you made the helper but didn't finish moving everyone
67
+ onto it.
68
+
69
+ ## Cluster 3 — "Things drifting apart" (the drift family)
70
+
71
+ Three detectors share the word "drift" or the concept; they watch different
72
+ gaps:
73
+
74
+ | Command | Watches the gap between | Evidence |
75
+ |---|---|---|
76
+ | `drift` | a file and its **siblings/architecture** | reference graph: unused imports, layer violations, "no sibling imports this" deviations |
77
+ | `doc-drift` | **docs** and the code they describe | doc file-citations + doc↔code co-change history; flags broken references and staleness scores |
78
+ | `co-change` | two **files** with an invisible contract | git history: pairs that change together with no dependency edge |
79
+
80
+ How to keep them straight: `drift` is structural and intra-code, `doc-drift`
81
+ is prose-vs-code, `co-change` is code-vs-code where the connection exists only
82
+ in commit history. The diff-gate runs all three angles scoped to your change
83
+ (`doc-reference` and `co-change-partner` checks).
84
+
85
+ ## Cluster 4 — "Nothing uses this" (the deadness family)
86
+
87
+ | Command | Scope | Question |
88
+ |---|---|---|
89
+ | `dead` | symbols | "What has zero consumers?" (evidence-ranked, entrypoint-aware) |
90
+ | `isolated` | callables | "What is fully disconnected — no callers *and* no callees?" |
91
+ | `cleanup-plan` | the cascade | "If I delete the dead stuff, what *becomes* dead next — and will my compiler vouch for the whole batch?" (`--verify`) |
92
+
93
+ `dead` finds candidates; `isolated` finds the most extreme subset;
94
+ `cleanup-plan --verify` turns candidates into a compiler-proven deletion plan.
95
+ Don't hand-delete from `dead` output when `cleanup-plan` can prove it.
96
+
97
+ ---
98
+
99
+ ## After-the-change check matrix
100
+
101
+ The reflex to build (and the one the `scip-query` router skill teaches
102
+ agents): match the check to what the change *did*. `diff-gate` runs the
103
+ broad sweep on every diff; these are the targeted follow-ups.
104
+
105
+ | You just... | Run |
106
+ |---|---|
107
+ | Extracted a helper / created an abstraction | `scip-query incomplete-migration` — did every site migrate? |
108
+ | Wrote a brand-new helper or module | `scip-query similar <it>` and `scip-query recent-duplicates` — did it already exist? |
109
+ | Added parameters, options, or config flags | `scip-query unused-params` — does anything use them yet? |
110
+ | Added a forwarding/wrapper layer | `scip-query wrapper-candidates` and `scip-query passthrough-candidates` — does it earn its indirection? |
111
+ | Added an interface, base class, or type alias | `scip-query stale-abstractions` — does it have more than one real consumer? |
112
+ | Changed a schema, contract, config, or generated file | `scip-query co-change <file>` — who historically moves with it? |
113
+ | Changed code that docs describe | `scip-query doc-drift` — which docs now lie? |
114
+ | Deleted code | `scip-query cleanup-plan --verify` — what else just became dead, and does the compiler agree? |
115
+ | Anything at all, before saying "done" | `scip-query reindex && scip-query diff-gate` |
116
+
117
+ And before any non-trivial change: plan with `scip-query plan-context
118
+ <target>` (or the `concrete-plan` skill, which requires a scip-query citation
119
+ for every claim in the plan).
@@ -0,0 +1,54 @@
1
+ # Accuracy Hardening Goal
2
+
3
+ Make scip-query's command answers reliable across languages and repositories by separating smoke tests from source-backed accuracy checks, fixing lookup/call-graph gaps found by real repos, and labeling heuristic results as candidates rather than exact facts.
4
+
5
+ ## Scope
6
+
7
+ - Keep CI changes out of scope for now.
8
+ - Add committed test coverage that runs locally with `npm test`.
9
+ - Keep real-repo calibration optional because those repositories exist only on some machines.
10
+ - Prefer fixes that improve the shared indexing/query machinery over tuning output for one repository.
11
+
12
+ ## Deliverables
13
+
14
+ 1. Source-backed command accuracy coverage:
15
+ - Add fixture/oracle tests for exact commands such as `symbols`, `code`, `refs`, `trace`, `call-graph`, `complexity`, `dataflow`, and `slice`.
16
+ - Cover TypeScript, Python, Rust, and mixed-index behavior where practical.
17
+ - Assert against source facts: definition text, expected files, expected callees/callers, and line-bounded code snippets.
18
+
19
+ 2. Optional real-repo calibration harness:
20
+ - Add a script that can run against local repositories when they exist.
21
+ - Reindex each repo into a temporary cache.
22
+ - Run source-backed checks for selected known symbols.
23
+ - Print clear PASS/FAIL output with the command and evidence.
24
+ - Never require these private/local repositories in normal test runs.
25
+
26
+ 3. Indexer reliability taxonomy:
27
+ - Preserve the existing fail-closed behavior for failed languages.
28
+ - Keep `--allow-partial` as the explicit opt-in for incomplete mixed-language indexes.
29
+ - Repair malformed SCIP definition occurrences before SQLite conversion when that can be done without inventing symbol metadata.
30
+ - Keep conversion failures actionable and specific.
31
+
32
+ 4. Lookup and call-graph accuracy:
33
+ - Fix path-qualified lookup ranking such as `src/app.rs/run` so it prefers symbols defined in that file.
34
+ - Keep exact call graph facts precise while still recovering real callable edges from SCIP mentions when AST extraction misses them.
35
+ - Add regression tests for Rust qualified path calls.
36
+
37
+ 5. Heuristic output labeling:
38
+ - Label heuristic commands as candidates in CLI output.
39
+ - Make the distinction visible for `similar`, `similar-files`, `similar-chains`, `extract-candidates`, `wrapper-candidates`, `passthrough-candidates`, `stale-abstractions`, `complexity-hotspots`, and `drift`.
40
+ - Avoid implying those commands are exact compiler facts.
41
+
42
+ 6. Performance guardrails:
43
+ - Add an optional local performance/calibration path that records durations and index sizes.
44
+ - Do not fail normal tests on private-repo timing.
45
+
46
+ ## Acceptance Criteria
47
+
48
+ - `npm test` passes.
49
+ - `npm run typecheck` passes.
50
+ - `npm run build` passes.
51
+ - The optional calibration script passes on at least one TypeScript repo, one Python repo, and one Rust repo when those repos exist locally.
52
+ - Path-qualified Rust lookup resolves `src/app.rs/run` to `app:run()`, not an unrelated `run`-named test.
53
+ - `call-graph main` in the Rust fixture reports the qualified `app:run()` callee.
54
+ - Heuristic command output includes explicit candidate/disclaimer language.
@@ -0,0 +1,21 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="560" height="136" viewBox="0 0 560 136" role="img" aria-labelledby="title desc">
2
+ <title id="title">scip-query</title>
3
+ <desc id="desc">A minimal scip-query wordmark with a bright blue underscore cursor for dark backgrounds.</desc>
4
+ <style>
5
+ .wordmark {
6
+ fill: #F8FAFC;
7
+ font-family: Helvetica, Arial, sans-serif;
8
+ font-size: 58px;
9
+ font-weight: 700;
10
+ letter-spacing: 0;
11
+ }
12
+ </style>
13
+ <text
14
+ class="wordmark"
15
+ x="38"
16
+ y="83"
17
+ textLength="372"
18
+ lengthAdjust="spacingAndGlyphs"
19
+ >scip-query</text>
20
+ <rect x="430" y="76" width="50" height="8" rx="4" fill="#60A5FA" />
21
+ </svg>
@@ -0,0 +1,24 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="560" height="136" viewBox="0 0 560 136" role="img" aria-labelledby="title desc">
2
+ <title id="title">scip-query</title>
3
+ <desc id="desc">A minimal scip-query wordmark with a blue underscore cursor.</desc>
4
+ <style>
5
+ .wordmark {
6
+ fill: #111827;
7
+ font-family: Helvetica, Arial, sans-serif;
8
+ font-size: 58px;
9
+ font-weight: 700;
10
+ letter-spacing: 0;
11
+ }
12
+ .cursor {
13
+ fill: #2563EB;
14
+ }
15
+ </style>
16
+ <text
17
+ class="wordmark"
18
+ x="38"
19
+ y="83"
20
+ textLength="372"
21
+ lengthAdjust="spacingAndGlyphs"
22
+ >scip-query</text>
23
+ <rect class="cursor" x="430" y="76" width="50" height="8" rx="4" />
24
+ </svg>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "scip-query",
3
- "version": "0.10.0",
4
- "description": "Language-agnostic code intelligence CLI powered by SCIP indexes",
3
+ "version": "0.10.1",
4
+ "description": "Evidence and verification for AI coding agents: map code, reuse concepts, finish migrations, and gate diffs.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -11,6 +11,8 @@
11
11
  "files": [
12
12
  "dist/**/*.js",
13
13
  "dist/**/*.d.ts",
14
+ "docs/assets/**/*",
15
+ "docs/*.md",
14
16
  "skills/**/SKILL.md"
15
17
  ],
16
18
  "sideEffects": false,
@@ -195,6 +197,30 @@
195
197
  "import": "./dist/queries/similar-files.js",
196
198
  "types": "./dist/queries/similar-files.d.ts"
197
199
  },
200
+ "./queries/react-component-duplicates": {
201
+ "import": "./dist/queries/react-component-duplicates.js",
202
+ "types": "./dist/queries/react-component-duplicates.d.ts"
203
+ },
204
+ "./queries/react-hook-candidates": {
205
+ "import": "./dist/queries/react-hook-candidates.js",
206
+ "types": "./dist/queries/react-hook-candidates.d.ts"
207
+ },
208
+ "./queries/react-large-component-pressure": {
209
+ "import": "./dist/queries/react-large-component-pressure.js",
210
+ "types": "./dist/queries/react-large-component-pressure.d.ts"
211
+ },
212
+ "./queries/vue-component-duplicates": {
213
+ "import": "./dist/queries/vue-component-duplicates.js",
214
+ "types": "./dist/queries/vue-component-duplicates.d.ts"
215
+ },
216
+ "./queries/vue-composable-candidates": {
217
+ "import": "./dist/queries/vue-composable-candidates.js",
218
+ "types": "./dist/queries/vue-composable-candidates.d.ts"
219
+ },
220
+ "./queries/vue-large-view-pressure": {
221
+ "import": "./dist/queries/vue-large-view-pressure.js",
222
+ "types": "./dist/queries/vue-large-view-pressure.d.ts"
223
+ },
198
224
  "./queries/similar-signatures": {
199
225
  "import": "./dist/queries/similar-signatures.js",
200
226
  "types": "./dist/queries/similar-signatures.d.ts"
@@ -245,7 +271,7 @@
245
271
  }
246
272
  },
247
273
  "scripts": {
248
- "build": "tsup",
274
+ "build": "node --max-old-space-size=8192 ./node_modules/tsup/dist/cli-default.js",
249
275
  "dev": "tsup --watch",
250
276
  "test": "vitest run",
251
277
  "test:watch": "vitest",
@@ -280,6 +306,8 @@
280
306
  "dependencies": {
281
307
  "@bufbuild/protobuf": "^2.11.0",
282
308
  "@c4312/scip": "^0.1.0",
309
+ "@vue/compiler-dom": "^3.5.38",
310
+ "@vue/compiler-sfc": "^3.5.38",
283
311
  "better-sqlite3": "^12.9.0",
284
312
  "commander": "^13.1.0",
285
313
  "ignore": "^7.0.3",
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  name: scip-maintainability
3
- description: Principled maintainability review using scip-query. Finds hidden policies, scattered concepts, accidental variation, weak boundaries, and system-compression opportunities, then proposes or executes structural improvements without chasing health scores.
3
+ description: Principled maintainability review using scip-query. Finds hidden policies, scattered concepts, accidental variation, weak boundaries, and system-compression opportunities, then proposes or executes structural improvements and verifies post-change wiring without chasing health scores.
4
4
  allowed-tools: [Bash, Write, Edit, Glob, Agent, TaskCreate, TaskUpdate, TaskGet, TaskList]
5
- keywords: [maintainability, architecture, compression, simplify, principal, staff, smell, hidden-policy, concept-boundary, accidental-variation, refactor]
6
5
  ---
7
6
 
8
7
  # SCIP Maintainability Review
@@ -244,12 +243,34 @@ scip-query passthrough-candidates
244
243
  scip-query similar-files
245
244
  ```
246
245
 
246
+ Then run the post-change checks that match what the fix actually did:
247
+
248
+ | Change made | Required post-check |
249
+ | --- | --- |
250
+ | Extracted a helper, hook, composable, component logic, or named abstraction | `scip-query incomplete-migration`; migrate every unchanged site that still contains the extracted logic or document essential variation |
251
+ | Added a new helper, module, component, hook, or composable | `scip-query similar <new-symbol>` when symbol-like, plus `scip-query recent-duplicates --full`; delete echoes of established code |
252
+ | Consolidated duplicated files, command handlers, adapters, or workflows | rerun the detector that motivated the change: `similar-files`, `similar-chains`, `wrapper-candidates`, `passthrough-candidates`, frontend duplicate commands, or `health --full` |
253
+ | Added parameters, options, config flags, props, or broad option objects | `scip-query unused-params`; remove speculative inputs that no body uses |
254
+ | Added a wrapper, adapter, facade, re-export, or forwarding layer | `scip-query wrapper-candidates`, `scip-query passthrough-candidates`, and `scip-query redundant-reexports` when exports changed |
255
+ | Added an interface, base class, type alias, or abstraction boundary | `scip-query stale-abstractions --include-low-confidence`; prove the abstraction has real consumers and policy |
256
+ | Changed schema, config, generated files, command descriptors, package surface, or docs-backed behavior | `scip-query co-change <file>` and `scip-query doc-drift`; update historical partners and stale docs |
257
+ | Deleted code | `scip-query cleanup-plan --verify`; take the compiler-proven cascade or explain why not |
258
+
259
+ Always finish implemented maintainability work with:
260
+
261
+ ```bash
262
+ scip-query diff-impact
263
+ scip-query reindex && scip-query diff-gate
264
+ ```
265
+
266
+ Treat `diff-gate` findings as unfinished work. Fix them or state a concrete acceptance reason; do not silently report success.
267
+
247
268
  Report:
248
269
 
249
270
  - the named smell addressed
250
271
  - the mechanism introduced, deleted, or simplified
251
272
  - what was deliberately not compressed
252
- - verification results
273
+ - verification results, including the post-change checks that matched the edit
253
274
  - commit hash, when committed
254
275
 
255
276
  ---
@@ -2,7 +2,6 @@
2
2
  name: scip-query
3
3
  description: Router for codebase work in scip-query-indexed projects. Use whenever exploring, planning, implementing, refactoring, extracting helpers, verifying changes, hunting duplication or bloat, fixing stale docs, or cleaning up after an AI coding session — or when unsure which scip-* skill applies. Picks the right specialist skill and the commands that must run for each phase of work.
4
4
  allowed-tools: [Bash, Skill]
5
- keywords: [scip, codebase, explore, plan, implement, refactor, extract, verify, check-work, cleanup, duplication, bloat, drift, route, which-skill]
6
5
  ---
7
6
 
8
7
  # scip-query Router
@@ -39,6 +38,8 @@ When the user asks you to build, change, or fix something non-trivial:
39
38
  | Clean up after AI-assisted coding sessions | `scip-ai-cleanup` | `scip-query recent-duplicates`, `scip-query incomplete-migration` |
40
39
  | Reconcile docs/standards that drifted from the code | `scip-doc-reconcile` | `scip-query doc-drift <doc>` |
41
40
  | Review architecture, boundaries, hidden policies | `scip-maintainability` | `scip-query bottlenecks`, `scip-query coupling` |
41
+ | Review React frontend reuse, components, hooks, or TSX/JSX maintainability | `scip-react-maintainability` | `scip-query react-component-duplicates --full`, `scip-query react-hook-candidates --full` |
42
+ | Review Vue frontend reuse, SFCs, templates, or composables | `scip-vue-maintainability` | `scip-query vue-component-duplicates --full`, `scip-query vue-composable-candidates --full` |
42
43
 
43
44
  Invoke skills by name (Skill tool or slash command). If skill invocation is
44
45
  unavailable in this harness, read `~/.agents/skills/<name>/SKILL.md` and
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: scip-react-maintainability
3
+ description: React frontend maintainability review using scip-query's React component duplicate, hook candidate, large component pressure, recent-duplicate, incomplete-migration, and diff-gate commands. Use when reviewing React, TSX, JSX, or Next.js codebases; investigating duplicated components or hooks; checking frontend health pressure; or verifying agents reused React code correctly after a refactor.
4
+ ---
5
+
6
+ # SCIP React Maintainability Review
7
+
8
+ This skill reviews React frontends by treating components, hooks, JSX structure, and behavior lifecycles as first-class maintainability units. It uses `scip-query` evidence to decide where UI structure, state/effect/request behavior, and large components are carrying duplicated concepts or too many reasons to change.
9
+
10
+ A React component duplicate candidate is a pair or group of rendered interface structures that repeat the same user-facing arrangement, controls, states, props, or data-presentation shape enough that a shared component may reduce future divergence.
11
+
12
+ A React hook candidate is a pair or group of component behaviors that repeat the same state lifecycle, effects, requests, validation, persistence, callback policy, or derived-data rule enough that a shared hook may make the behavior easier to preserve.
13
+
14
+ Large component pressure is a maintainability signal that one React component or file contains several kinds of knowledge that change for different reasons, such as layout structure, state management, data loading, permission policy, and styling.
15
+
16
+ React health is a repo-grounded frontend pressure map. It is useful for ranking review attention, but it is not proof that code is bad and not the goal of a refactor.
17
+
18
+ ## Quick Start
19
+
20
+ Refresh the code intelligence before trusting graph facts:
21
+
22
+ ```bash
23
+ scip-query status
24
+ scip-query reindex
25
+ ```
26
+
27
+ Run the React review commands uncapped when doing a serious frontend pass. Do not combine `--full` with `--limit`.
28
+
29
+ ```bash
30
+ scip-query react-component-duplicates --scope <react-source-scope> --full --json
31
+ scip-query react-hook-candidates --scope <react-source-scope> --full --json
32
+ scip-query react-large-component-pressure --scope <react-source-scope> --full --json
33
+ scip-query recent-duplicates --scope <react-source-scope> --full --json
34
+ scip-query health --scope <react-source-scope> --full --json
35
+ ```
36
+
37
+ ## Workflow
38
+
39
+ 1. Bound the review to a React source root, feature area, or changed files. Prefer the narrowest scope that still includes likely reuse partners.
40
+ 2. Run the three React commands: component duplicates, hook candidates, and large component pressure.
41
+ 3. Use `recent-duplicates` to catch newly added frontend echoes of established code.
42
+ 4. Cross-check the result sets before recommending an extraction:
43
+ - Component duplicate only: inspect for a shared presentational component or an existing component callers should reuse.
44
+ - Hook candidate only: inspect for a shared behavior, lifecycle, request pattern, validation rule, persistence rule, or derived-state policy.
45
+ - Both component and hook candidate: inspect for a feature-level concept that may need both a component boundary and a hook boundary.
46
+ - Large component only: split by reason to change, not by line count alone.
47
+ 5. Open the source files for the top candidates. Similarity is evidence to inspect, not a verdict.
48
+ 6. Check existing exports, imports, and call sites before proposing anything new:
49
+
50
+ ```bash
51
+ scip-query outline <file>
52
+ scip-query deps <file>
53
+ scip-query rdeps <file>
54
+ scip-query similar-files --scope <react-source-scope>
55
+ scip-query similar <closest-existing-component-or-hook>
56
+ ```
57
+
58
+ ## Acting on Findings
59
+
60
+ Prefer reuse before extraction. If an existing component or hook already names the concept, migrate callers to it instead of creating another one.
61
+
62
+ When extracting:
63
+
64
+ - Extract a component when the repeated knowledge is rendered UI structure, props, slots/children, empty/loading/error states, or design-system composition.
65
+ - Extract a hook when the repeated knowledge is state, effects, requests, subscriptions, memoized derivations, callbacks, or persistence policy.
66
+ - Split a large component by reason to change: data loading, permission/policy, layout shell, table/list rendering, form state, and action handling are different reasons.
67
+ - Keep domain-specific variation at the call site when the variation is essential. Do not hide different product rules behind a boolean soup API.
68
+
69
+ ## Post-Change Verification
70
+
71
+ After implementing a component reuse, hook extraction, or large-component split, prove both sides of the work: the new abstraction exists and the old inline copies were migrated.
72
+
73
+ Run the checks that match what changed:
74
+
75
+ ```bash
76
+ scip-query diff-impact
77
+ scip-query react-component-duplicates --scope <react-source-scope> --full --json
78
+ scip-query react-hook-candidates --scope <react-source-scope> --full --json
79
+ scip-query react-large-component-pressure --scope <react-source-scope> --full --json
80
+ scip-query recent-duplicates --scope <react-source-scope> --full --json
81
+ scip-query incomplete-migration
82
+ scip-query unused-params
83
+ scip-query wrapper-candidates --scope <react-source-scope> --full --json
84
+ scip-query passthrough-candidates --scope <react-source-scope> --full --json
85
+ scip-query stale-abstractions --scope <react-source-scope> --include-low-confidence --full --json
86
+ scip-query reindex && scip-query diff-gate
87
+ ```
88
+
89
+ Use the results this way:
90
+
91
+ - `incomplete-migration`: if a new hook/helper was created and wired somewhere, migrate every unchanged site that still contains the same logic or document why it is not the same behavior.
92
+ - `recent-duplicates`: if the new component/hook is still an echo of established code, delete the echo or reuse the established concept.
93
+ - React duplicate commands: the specific candidate pair you acted on should disappear, weaken materially, or be explicitly accepted as essential variation.
94
+ - `unused-params`: remove speculative props/options introduced "for later."
95
+ - wrapper/pass-through/stale checks: remove local wrapper components, hook aliases, or type abstractions that do not enforce a real policy.
96
+ - `diff-gate`: treat every finding as unfinished work unless there is a written reason to accept it.
97
+
98
+ ## False Positive Checks
99
+
100
+ - Shared design-system primitives, icons, labels, route names, or test IDs are not enough to justify an extraction.
101
+ - Similar JSX with different domain lifecycles may justify a presentational component but not a hook.
102
+ - Shared hook usage may mean the right concept is already extracted; look for drift around the shared call, not another extraction.
103
+ - A large file creates review pressure, but it is not proof that behavior is duplicated.
104
+ - A local wrapper is justified only when it names a real product concept, enforces a policy, or prevents drift across callers.
105
+
106
+ ## Reporting Shape
107
+
108
+ Report findings as a frontend maintainability register:
109
+
110
+ - Executive read: whether the React code is consolidating or drifting.
111
+ - Command evidence: exact commands, scope, counts, and whether results were uncapped.
112
+ - Candidate groups: files/components, repeated UI structure, repeated behavior, and large-component pressure.
113
+ - Recommended action: reuse existing API, extract component, extract hook, split view, delete wrapper, or no action.
114
+ - Post-change proof: commands rerun, candidate pairs resolved or accepted, migration completeness checked, and `diff-gate` result.