scip-query 0.10.12 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
  3. package/README.md +164 -49
  4. package/dist/augment-vue-worker.js +1 -1
  5. package/dist/{chunk-RUV5IY25.js → chunk-2LQWMYG4.js} +2 -2
  6. package/dist/{chunk-KZ4MG5NY.js → chunk-2QGE5AEP.js} +2 -2
  7. package/dist/chunk-4D54JIU3.js +2 -0
  8. package/dist/{chunk-2GLNBCHB.js → chunk-52Q4JFDW.js} +2 -2
  9. package/dist/chunk-5AAAEZ2Z.js +2 -0
  10. package/dist/chunk-64PRNLKP.js +2 -0
  11. package/dist/chunk-6XA4LDHY.js +2 -0
  12. package/dist/chunk-72MFTCU5.js +38 -0
  13. package/dist/chunk-75X52JTA.js +2 -0
  14. package/dist/{chunk-LEHVP4DY.js → chunk-7ITCOJGD.js} +2 -2
  15. package/dist/chunk-7JZRFDCU.js +2 -0
  16. package/dist/{chunk-XRUGSM76.js → chunk-AZLKLZ5S.js} +2 -2
  17. package/dist/chunk-B4VYXRCQ.js +26 -0
  18. package/dist/chunk-BCNT6ODA.js +5 -0
  19. package/dist/chunk-BP2NAIAZ.js +2 -0
  20. package/dist/chunk-BVNO67DB.js +2 -0
  21. package/dist/{chunk-XHMVZFA6.js → chunk-CW3KZ7UF.js} +2 -2
  22. package/dist/{chunk-6BN3EHQE.js → chunk-D64L53WX.js} +2 -2
  23. package/dist/{chunk-T3AEVJBG.js → chunk-D7J6GZAG.js} +2 -2
  24. package/dist/chunk-ECVXWZ4Q.js +3 -0
  25. package/dist/chunk-EDB7Y442.js +2 -0
  26. package/dist/{chunk-4ISHQ7UW.js → chunk-ETU2I5JM.js} +4 -4
  27. package/dist/chunk-EXKLAEB4.js +18 -0
  28. package/dist/chunk-EZ5WDZ2Q.js +3 -0
  29. package/dist/{chunk-S2MRVIJ5.js → chunk-F5BJSNU5.js} +6 -6
  30. package/dist/chunk-FBCOFKEC.js +2 -0
  31. package/dist/chunk-FERAXG6Y.js +72 -0
  32. package/dist/chunk-FXG3PHVW.js +9 -0
  33. package/dist/{chunk-XUCZ3RQ5.js → chunk-G2UBOONK.js} +4 -4
  34. package/dist/chunk-GNG622H3.js +3 -0
  35. package/dist/{chunk-JS6B76AQ.js → chunk-H2NMIZFD.js} +2 -2
  36. package/dist/chunk-H7NSJ7L2.js +5 -0
  37. package/dist/chunk-HSU3M25J.js +21 -0
  38. package/dist/chunk-HXXMPYEF.js +2 -0
  39. package/dist/chunk-IRJDYTNZ.js +3 -0
  40. package/dist/chunk-ISLWJ4PY.js +10 -0
  41. package/dist/chunk-J5WVNZ6O.js +2 -0
  42. package/dist/{chunk-UVPY3RUZ.js → chunk-K6UI6EBZ.js} +2 -2
  43. package/dist/{chunk-MNCQPMCH.js → chunk-KJCDEDQW.js} +2 -2
  44. package/dist/{chunk-ELC77ZDE.js → chunk-KMVGRIO2.js} +2 -2
  45. package/dist/chunk-KSUZS77X.js +16 -0
  46. package/dist/{chunk-A4UTLKHU.js → chunk-L2CX5GHZ.js} +2 -2
  47. package/dist/chunk-LFM3O5KX.js +2 -0
  48. package/dist/{chunk-ZUUNREKS.js → chunk-M72ZFN6E.js} +5 -5
  49. package/dist/chunk-MBKJ7GHT.js +102 -0
  50. package/dist/chunk-MJKJMWIM.js +2 -0
  51. package/dist/chunk-MKM7NBZK.js +43 -0
  52. package/dist/chunk-MTDBHTSF.js +2 -0
  53. package/dist/chunk-NAH5EAZS.js +6 -0
  54. package/dist/chunk-NJJ7AS4F.js +2 -0
  55. package/dist/{chunk-EOLGSSDR.js → chunk-NKT5EMEX.js} +2 -2
  56. package/dist/{chunk-ANUEY5WV.js → chunk-NLMRJ7SI.js} +2 -2
  57. package/dist/chunk-NQ75OVUU.js +40 -0
  58. package/dist/{chunk-TBCHRDAC.js → chunk-O3WDE26W.js} +2 -2
  59. package/dist/{chunk-VB2EZZPA.js → chunk-OPE5YXFE.js} +2 -2
  60. package/dist/chunk-ORBRX2QJ.js +2 -0
  61. package/dist/{chunk-OFXN2BCT.js → chunk-OSWF3HSF.js} +2 -2
  62. package/dist/{chunk-JJ5SAWBT.js → chunk-OVMUVXKQ.js} +2 -2
  63. package/dist/{chunk-NTSR6SRP.js → chunk-PH7ZFK6L.js} +2 -2
  64. package/dist/chunk-PXHPCWX5.js +2 -0
  65. package/dist/chunk-Q3B3FNCU.js +3 -0
  66. package/dist/{chunk-SQNHOOJ5.js → chunk-Q7S2DADC.js} +2 -2
  67. package/dist/{chunk-3XSNW5XB.js → chunk-QARYU7R3.js} +2 -2
  68. package/dist/chunk-QZ4JVECJ.js +2 -0
  69. package/dist/{chunk-FX6ULETZ.js → chunk-R5336VHZ.js} +2 -2
  70. package/dist/chunk-RA5MTIOO.js +2 -0
  71. package/dist/{chunk-RXINFVBN.js → chunk-RIQED5OU.js} +2 -2
  72. package/dist/chunk-T2FQ4GHD.js +9 -0
  73. package/dist/chunk-T6NGEV5I.js +2 -0
  74. package/dist/chunk-T7VQG55Q.js +2 -0
  75. package/dist/chunk-TFWDJDGO.js +2 -0
  76. package/dist/chunk-TG7QSYCJ.js +2 -0
  77. package/dist/{chunk-DQ6433ZG.js → chunk-TTMKELT7.js} +17 -8
  78. package/dist/{chunk-DDQONX6B.js → chunk-U7I373V4.js} +2 -2
  79. package/dist/chunk-UAHZ57BR.js +2 -0
  80. package/dist/chunk-URSSPS5H.js +2 -0
  81. package/dist/chunk-V3Z3IOWO.js +2 -0
  82. package/dist/{chunk-7C6JBBE4.js → chunk-V7CVBPWX.js} +2 -2
  83. package/dist/{chunk-PWAK75BU.js → chunk-VYF5HA76.js} +2 -2
  84. package/dist/chunk-WIBFXSYB.js +6 -0
  85. package/dist/chunk-WS3Z6W3M.js +65 -0
  86. package/dist/chunk-WXVGNFAO.js +2 -0
  87. package/dist/chunk-XEMQUN3Z.js +20 -0
  88. package/dist/chunk-YCPASUCX.js +2 -0
  89. package/dist/chunk-YDDGCJJG.js +3 -0
  90. package/dist/{chunk-2UVCH7CQ.js → chunk-YPKBZ77R.js} +2 -2
  91. package/dist/chunk-YZXV3CU3.js +60 -0
  92. package/dist/chunk-Z3IPJKJP.js +4 -0
  93. package/dist/chunk-ZMGBWSFZ.js +2 -0
  94. package/dist/{chunk-GKB4JJDU.js → chunk-ZOIPAYRP.js} +2 -2
  95. package/dist/chunk-ZRIOGL7F.js +8 -0
  96. package/dist/cli.js +446 -280
  97. package/dist/{config-types-dvHOz0zU.d.ts → config-types-BrHl3Bge.d.ts} +57 -0
  98. package/dist/{db-rMZO5JFK.d.ts → db-_Bdx0E1W.d.ts} +1 -1
  99. package/dist/diff-gate-types-CG2YQ_ei.d.ts +4 -0
  100. package/dist/{frontend-behavior-evidence-BxKpKWUu.d.ts → frontend-behavior-evidence-EfM4_9bc.d.ts} +1 -1
  101. package/dist/{health-CtTIGh6H.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
  102. package/dist/index.d.ts +4 -68
  103. package/dist/index.js +1 -1
  104. package/dist/postinstall.js +1 -4
  105. package/dist/queries/affected.d.ts +2 -2
  106. package/dist/queries/affected.js +1 -1
  107. package/dist/queries/bottlenecks.d.ts +2 -2
  108. package/dist/queries/bottlenecks.js +1 -1
  109. package/dist/queries/by-kind.d.ts +2 -2
  110. package/dist/queries/by-kind.js +1 -1
  111. package/dist/queries/call-graph.d.ts +2 -2
  112. package/dist/queries/call-graph.js +1 -1
  113. package/dist/queries/change-surface.d.ts +2 -2
  114. package/dist/queries/change-surface.js +1 -1
  115. package/dist/queries/cleanup-plan.d.ts +2 -2
  116. package/dist/queries/cleanup-plan.js +1 -1
  117. package/dist/queries/co-change.d.ts +12 -2
  118. package/dist/queries/co-change.js +1 -1
  119. package/dist/queries/code.d.ts +2 -2
  120. package/dist/queries/code.js +1 -1
  121. package/dist/queries/complexity-hotspots.d.ts +7 -3
  122. package/dist/queries/complexity-hotspots.js +1 -1
  123. package/dist/queries/complexity.d.ts +42 -4
  124. package/dist/queries/complexity.js +1 -1
  125. package/dist/queries/convergence.d.ts +2 -2
  126. package/dist/queries/convergence.js +1 -1
  127. package/dist/queries/coupling.d.ts +2 -2
  128. package/dist/queries/coupling.js +1 -1
  129. package/dist/queries/cycles.d.ts +12 -3
  130. package/dist/queries/cycles.js +1 -1
  131. package/dist/queries/dataflow.d.ts +2 -2
  132. package/dist/queries/dataflow.js +1 -1
  133. package/dist/queries/dead.d.ts +3 -3
  134. package/dist/queries/dead.js +1 -1
  135. package/dist/queries/deep-chains.d.ts +2 -2
  136. package/dist/queries/deep-chains.js +1 -1
  137. package/dist/queries/deps.d.ts +2 -2
  138. package/dist/queries/deps.js +1 -1
  139. package/dist/queries/diff-gate.d.ts +65 -8
  140. package/dist/queries/diff-gate.js +1 -1
  141. package/dist/queries/diff-impact.d.ts +21 -3
  142. package/dist/queries/diff-impact.js +1 -1
  143. package/dist/queries/doc-drift.d.ts +29 -2
  144. package/dist/queries/doc-drift.js +1 -1
  145. package/dist/queries/drift.d.ts +15 -3
  146. package/dist/queries/drift.js +1 -1
  147. package/dist/queries/duplicate-bodies.d.ts +55 -0
  148. package/dist/queries/duplicate-bodies.js +2 -0
  149. package/dist/queries/extract-candidates.d.ts +2 -2
  150. package/dist/queries/extract-candidates.js +1 -1
  151. package/dist/queries/fan.d.ts +2 -2
  152. package/dist/queries/fan.js +1 -1
  153. package/dist/queries/files.d.ts +4 -3
  154. package/dist/queries/files.js +1 -1
  155. package/dist/queries/health.d.ts +3 -3
  156. package/dist/queries/health.js +1 -1
  157. package/dist/queries/hierarchy.d.ts +2 -2
  158. package/dist/queries/hierarchy.js +1 -1
  159. package/dist/queries/hotspots.d.ts +2 -2
  160. package/dist/queries/hotspots.js +1 -1
  161. package/dist/queries/imports.d.ts +2 -2
  162. package/dist/queries/imports.js +1 -1
  163. package/dist/queries/incomplete-migration.d.ts +3 -2
  164. package/dist/queries/incomplete-migration.js +1 -1
  165. package/dist/queries/index.d.ts +12 -7
  166. package/dist/queries/index.js +1 -1
  167. package/dist/queries/isolated.d.ts +2 -2
  168. package/dist/queries/isolated.js +1 -1
  169. package/dist/queries/locality-candidates.d.ts +2 -2
  170. package/dist/queries/locality-candidates.js +1 -1
  171. package/dist/queries/members.d.ts +2 -2
  172. package/dist/queries/members.js +1 -1
  173. package/dist/queries/methods.d.ts +2 -2
  174. package/dist/queries/methods.js +1 -1
  175. package/dist/queries/outline.d.ts +2 -2
  176. package/dist/queries/outline.js +1 -1
  177. package/dist/queries/passthrough-candidates.d.ts +11 -3
  178. package/dist/queries/passthrough-candidates.js +1 -1
  179. package/dist/queries/plan-context.d.ts +3 -2
  180. package/dist/queries/plan-context.js +1 -1
  181. package/dist/queries/react-component-duplicates.d.ts +7 -2
  182. package/dist/queries/react-component-duplicates.js +1 -1
  183. package/dist/queries/react-hook-candidates.d.ts +3 -3
  184. package/dist/queries/react-hook-candidates.js +1 -1
  185. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  186. package/dist/queries/react-large-component-pressure.js +1 -1
  187. package/dist/queries/recent-duplicates.d.ts +2 -2
  188. package/dist/queries/recent-duplicates.js +1 -1
  189. package/dist/queries/redundant-reexports.d.ts +2 -2
  190. package/dist/queries/redundant-reexports.js +1 -1
  191. package/dist/queries/refs.d.ts +2 -2
  192. package/dist/queries/refs.js +1 -1
  193. package/dist/queries/self-audit.d.ts +4 -2
  194. package/dist/queries/self-audit.js +1 -1
  195. package/dist/queries/similar-chains.d.ts +2 -2
  196. package/dist/queries/similar-chains.js +1 -1
  197. package/dist/queries/similar-files.d.ts +2 -2
  198. package/dist/queries/similar-files.js +1 -1
  199. package/dist/queries/similar-signatures.d.ts +17 -10
  200. package/dist/queries/similar-signatures.js +1 -1
  201. package/dist/queries/similar.d.ts +42 -3
  202. package/dist/queries/similar.js +1 -1
  203. package/dist/queries/slice.d.ts +2 -2
  204. package/dist/queries/slice.js +1 -1
  205. package/dist/queries/stale-abstractions.d.ts +2 -2
  206. package/dist/queries/stale-abstractions.js +1 -1
  207. package/dist/queries/stats.d.ts +2 -2
  208. package/dist/queries/surface.d.ts +2 -2
  209. package/dist/queries/surface.js +1 -1
  210. package/dist/queries/symbols.d.ts +2 -2
  211. package/dist/queries/symbols.js +1 -1
  212. package/dist/queries/system.d.ts +2 -2
  213. package/dist/queries/system.js +1 -1
  214. package/dist/queries/trace.d.ts +2 -2
  215. package/dist/queries/trace.js +1 -1
  216. package/dist/queries/twin-ab.d.ts +55 -0
  217. package/dist/queries/twin-ab.js +2 -0
  218. package/dist/queries/twin-drift.d.ts +97 -0
  219. package/dist/queries/twin-drift.js +2 -0
  220. package/dist/queries/unused-imports.d.ts +2 -2
  221. package/dist/queries/unused-imports.js +1 -1
  222. package/dist/queries/unused-params.d.ts +2 -2
  223. package/dist/queries/unused-params.js +1 -1
  224. package/dist/queries/vue-component-duplicates.d.ts +7 -2
  225. package/dist/queries/vue-component-duplicates.js +1 -1
  226. package/dist/queries/vue-composable-candidates.d.ts +3 -3
  227. package/dist/queries/vue-composable-candidates.js +1 -1
  228. package/dist/queries/vue-large-view-pressure.d.ts +6 -2
  229. package/dist/queries/vue-large-view-pressure.js +1 -1
  230. package/dist/queries/wrapper-candidates.d.ts +2 -2
  231. package/dist/queries/wrapper-candidates.js +1 -1
  232. package/dist/reindex-worker.js +9 -9
  233. package/dist/reindex.d.ts +23 -4
  234. package/dist/reindex.js +19 -19
  235. package/dist/runtime.d.ts +11 -6
  236. package/dist/runtime.js +2 -2
  237. package/dist/{scip-cli-trnNvymv.d.ts → scip-cli-C7cg4ZHR.d.ts} +1 -1
  238. package/dist/symbol-types-DaoeXKUt.d.ts +66 -0
  239. package/docs/AGENT_GUIDE.md +20 -18
  240. package/docs/AI_FAILURE_MODES.md +36 -13
  241. package/docs/API.md +1 -1
  242. package/docs/COMMAND_REFERENCE.md +57 -14
  243. package/docs/DETECTOR_GUIDE.md +20 -3
  244. package/docs/REGEX_POLICY.md +34 -0
  245. package/docs/analyzer-inventory.md +40 -3
  246. package/docs/analyzer-validation-ledger.md +34 -6
  247. package/package.json +39 -7
  248. package/scripts/build-scip-windows.mjs +10 -7
  249. package/skills/_shared/SKILL.md +243 -0
  250. package/skills/_shared/agents/openai.yaml +4 -0
  251. package/skills/scip-api-impact/SKILL.md +55 -71
  252. package/skills/scip-claim-audit/SKILL.md +105 -0
  253. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  254. package/skills/scip-cleanup-audit/SKILL.md +122 -0
  255. package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
  256. package/skills/scip-cleanup-improve/SKILL.md +84 -0
  257. package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
  258. package/skills/scip-concrete-plan/SKILL.md +181 -0
  259. package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
  260. package/skills/scip-conductor/SKILL.md +133 -0
  261. package/skills/scip-conductor/agents/openai.yaml +4 -0
  262. package/skills/scip-debug/SKILL.md +60 -58
  263. package/skills/scip-diagram/SKILL.md +64 -94
  264. package/skills/scip-directory-architecture/SKILL.md +65 -107
  265. package/skills/scip-doc-reconcile/SKILL.md +56 -67
  266. package/skills/scip-explore/SKILL.md +78 -210
  267. package/skills/scip-hyper-optimization/SKILL.md +124 -198
  268. package/skills/scip-integrity-audit/SKILL.md +103 -0
  269. package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
  270. package/skills/scip-language-playbook/SKILL.md +56 -326
  271. package/skills/scip-maintainability/SKILL.md +80 -219
  272. package/skills/scip-probe-reachability/SKILL.md +92 -0
  273. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  274. package/skills/scip-query/SKILL.md +108 -124
  275. package/skills/scip-react-maintainability/SKILL.md +64 -82
  276. package/skills/scip-setup/SKILL.md +121 -0
  277. package/skills/scip-setup/agents/openai.yaml +4 -0
  278. package/skills/scip-tla-model-system/SKILL.md +150 -0
  279. package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
  280. package/skills/scip-triage-issue/SKILL.md +53 -41
  281. package/skills/scip-twin-drift/SKILL.md +107 -0
  282. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  283. package/skills/scip-verify/SKILL.md +70 -88
  284. package/skills/scip-vue-maintainability/SKILL.md +67 -94
  285. package/dist/chunk-2DOW7QCA.js +0 -71
  286. package/dist/chunk-2FMFF4RI.js +0 -2
  287. package/dist/chunk-5GXTUANY.js +0 -2
  288. package/dist/chunk-5JHEN5VN.js +0 -25
  289. package/dist/chunk-62ULXMQ7.js +0 -18
  290. package/dist/chunk-63CI3IXR.js +0 -102
  291. package/dist/chunk-7EK7OSWS.js +0 -2
  292. package/dist/chunk-7IWIMNHI.js +0 -2
  293. package/dist/chunk-7XTO4YXB.js +0 -8
  294. package/dist/chunk-AOWFUGDL.js +0 -2
  295. package/dist/chunk-AREANYIA.js +0 -3
  296. package/dist/chunk-AZBELWZQ.js +0 -7
  297. package/dist/chunk-B32FX5KB.js +0 -2
  298. package/dist/chunk-B6MJ5VQV.js +0 -2
  299. package/dist/chunk-CXWCLVYL.js +0 -2
  300. package/dist/chunk-CYHIKTJN.js +0 -3
  301. package/dist/chunk-DFSEARAU.js +0 -2
  302. package/dist/chunk-DVFP6PZI.js +0 -2
  303. package/dist/chunk-E3ADDB43.js +0 -2
  304. package/dist/chunk-F6IXELII.js +0 -20
  305. package/dist/chunk-FMGVZBS2.js +0 -2
  306. package/dist/chunk-GG5LHT27.js +0 -2
  307. package/dist/chunk-H7JF2CKK.js +0 -2
  308. package/dist/chunk-HHOMJCP5.js +0 -4
  309. package/dist/chunk-HRDSU5FN.js +0 -9
  310. package/dist/chunk-HWVYTJOV.js +0 -2
  311. package/dist/chunk-JNMLBL36.js +0 -2
  312. package/dist/chunk-L446VQYQ.js +0 -2
  313. package/dist/chunk-LDJUB7XW.js +0 -2
  314. package/dist/chunk-MYTUWXHK.js +0 -4
  315. package/dist/chunk-N25HPUOK.js +0 -2
  316. package/dist/chunk-NABVR6B7.js +0 -2
  317. package/dist/chunk-NBNEVLRC.js +0 -3
  318. package/dist/chunk-ONPCQ2PM.js +0 -6
  319. package/dist/chunk-Q5P7NOVM.js +0 -2
  320. package/dist/chunk-RGKRYO22.js +0 -4
  321. package/dist/chunk-RM2WQ75T.js +0 -2
  322. package/dist/chunk-ROGZXWN2.js +0 -2
  323. package/dist/chunk-RSSXKJ6J.js +0 -38
  324. package/dist/chunk-RVGEZYMQ.js +0 -2
  325. package/dist/chunk-SA3DPTHT.js +0 -7
  326. package/dist/chunk-SGTKURU6.js +0 -52
  327. package/dist/chunk-T4N2ZRVY.js +0 -21
  328. package/dist/chunk-THB6AM3V.js +0 -11
  329. package/dist/chunk-ULHLDOD6.js +0 -4
  330. package/dist/chunk-UQ73QF5D.js +0 -43
  331. package/dist/chunk-UUBMFL3F.js +0 -59
  332. package/dist/chunk-V5FGK3DZ.js +0 -2
  333. package/dist/chunk-WTY5FERW.js +0 -2
  334. package/dist/chunk-WUOB4DHH.js +0 -6
  335. package/dist/chunk-YFQIKYOP.js +0 -2
  336. package/dist/chunk-Z2LDWIJV.js +0 -5
  337. package/dist/chunk-ZNWWVYQL.js +0 -3
  338. package/skills/concrete-plan/SKILL.md +0 -372
  339. package/skills/concrete-plan/agents/openai.yaml +0 -4
  340. package/skills/scip-adoption/SKILL.md +0 -122
  341. package/skills/scip-adoption/agents/openai.yaml +0 -4
  342. package/skills/scip-ai-cleanup/SKILL.md +0 -153
  343. package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
  344. package/skills/scip-debloat/SKILL.md +0 -439
  345. package/skills/scip-debloat/agents/openai.yaml +0 -4
  346. package/skills/scip-health-audit/SKILL.md +0 -162
  347. package/skills/scip-health-audit/agents/openai.yaml +0 -4
  348. package/skills/scip-health-improve/SKILL.md +0 -155
  349. package/skills/scip-health-improve/agents/openai.yaml +0 -4
  350. package/skills/scip-query-setup/SKILL.md +0 -170
  351. package/skills/scip-query-setup/agents/openai.yaml +0 -3
  352. package/vendor/scip/README.md +0 -6
  353. package/vendor/scip/win32-arm64/scip.exe +0 -0
  354. package/vendor/scip/win32-x64/scip.exe +0 -0
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: scip-tla-model-system
3
+ description: Model TypeScript systems with TLA+ and scip-query evidence. Use to scaffold, verify, instrument, or trace-check TLA+ specs, mapping files, configs, regression models, counterexample loops, or code/model conformance for an existing system.
4
+ commands:
5
+ - template: 'scip-query tla scaffold <file>'
6
+ when: 'Start here for a new model: derive a draft spec, config, and mapping from indexed code.'
7
+ - template: 'scip-query tla verify <spec>'
8
+ when: 'Mechanical conformance: referents, reads/writes, calls, and the model checker.'
9
+ - template: 'scip-query tla instrument <spec>'
10
+ when: 'Generate a trace recorder plus wiring sites for each mapped action.'
11
+ - template: 'scip-query tla trace-check <spec> --trace <file>'
12
+ when: "Semantic conformance: check a recorded execution against the model's Next relation."
13
+ - template: 'scip-query tla fetch-tools'
14
+ when: 'Download the pinned tla2tools.jar into the cache when the checker is unavailable.'
15
+ ---
16
+
17
+ # scip-tla-model-system
18
+
19
+ Use this skill when a TypeScript system needs a TLA+ model tied to code evidence. A modeled slice is the bounded part of the real system represented by the model: state, transitions, inputs, outputs, and failure modes.
20
+
21
+ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
22
+
23
+ <!-- BEGIN GENERATED SKILL COMMANDS -->
24
+
25
+ ## Commands for this skill
26
+
27
+ | Command | Purpose | When |
28
+ | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
29
+ | `scip-query tla scaffold <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Start here for a new model: derive a draft spec, config, and mapping from indexed code. |
30
+ | `scip-query tla verify <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Mechanical conformance: referents, reads/writes, calls, and the model checker. |
31
+ | `scip-query tla instrument <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Generate a trace recorder plus wiring sites for each mapped action. |
32
+ | `scip-query tla trace-check <spec> --trace <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Semantic conformance: check a recorded execution against the model's Next relation. |
33
+ | `scip-query tla fetch-tools` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Download the pinned tla2tools.jar into the cache when the checker is unavailable. |
34
+
35
+ Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
36
+
37
+ <!-- END GENERATED SKILL COMMANDS -->
38
+
39
+ ## Choose the Slice
40
+
41
+ Model the part with the most dangerous interleavings — retries, concurrency, partial failure, money, state machines with guards. Never model a linear happy path: a model that cannot meaningfully fail verifies nothing. If the state space would exceed roughly a million states, the model is too concrete; collapse data you never branch on and replace unbounded values with small symbolic sets. `scaffold` requires the target file to own mutable module-level state (a `let`/const plus a writer function) or, failing that, a class whose instance fields a method of that same class writes; a file of pure functions or constants is rejected — pick the file that holds the state, not the file that only computes over it.
42
+
43
+ **Known boundary: files where the indexer emitted no member rows at all are invisible to `scaffold`.** `scaffold` calls `getDefinitionsForFile(db, file, { includeClassMemberFallbacks: true })`, which surfaces class-member fallback rows (`ClassName#field.` symbols with a real definition mention) alongside primary rows even when the file has other primary-indexed definitions — a concurrency class like a lock, connection pool, or watcher (verified live: `Watcher` in `src/runtime/watch.ts` — 26 instance fields and 10 state-writing actions discovered, previously 0) now scaffolds correctly. What remains genuinely invisible is narrower: a file where the indexer emitted **no** member row for a class at all — neither a primary `defn_enclosing_ranges` row nor a role=1 definition mention — has nothing for either query to return, and `scaffold` reports "no mutable state discovered" because there is nothing in the index to find. When you hit that: model by hand from `plan-context`/`trace` evidence instead of via `scaffold`. See `docs/plans/2026-07-02-catalog-class-members.md` for the K3 survey of whether other commands (`members`, `refs`, `trace`, `health`, `dead`) should opt in too — no decision has been made there yet, so this remains scaffold-only.
44
+
45
+ ## Loop
46
+
47
+ 1. Explore the target with `scip-query plan-context <target>`, `system`, `trace`, `call-graph`, and `dataflow` until state and transitions are concrete.
48
+ 2. Run `scip-query tla scaffold <file>` to generate the draft spec, config, and mapping (`--out` must stay inside the project root). Resolve every `TODO` it emits: guards, domains, initial values. The scaffold derives _what_ changes; you supply _when_ it may. TRIAGE the output first: if the discovered variables are mostly constants and the system's real state lives in files or a database (locks, caches, published artifacts), keep the mapping referents but discard the scaffolded variable set — hand-model the protocol's conceptual state and bind it with `resource` aliases instead. `tla verify` does not detect unfilled `TODO`s and will report PASS on a placeholder model — grep the spec for `TODO` before trusting a green run.
49
+ 3. Strengthen the model per the quality rules below.
50
+ 4. Run `scip-query tla verify <spec> --map <map> --config <cfg>`. Read the Proof line: every waiver must carry a reason you would defend in review. `--map` is usually unnecessary: if no `Spec.scip-tla.json` sits next to `Spec.tla`, `tla verify` scans sibling `*.scip-tla.json` files for one whose `module` field names this spec (the project-relative `.tla` path, bare filename, or the TLA `MODULE` identifier are all accepted) and uses it automatically, printing `(matched by module field)` — this is what makes bare `tla verify Foo.tla` work even when the only mapping on disk is named `FooHardened.scip-tla.json`. Two or more mappings naming the same module is a hard error listing every candidate; pass `--map` explicitly to disambiguate.
51
+ 5. Wire the recorder from `scip-query tla instrument`, run the existing tests with `SCIP_TLA_TRACE=<path>`, then run `scip-query tla trace-check <spec> --trace <path>`. Acceptance means the code's observed behavior is a behavior of the model; divergence names the step to investigate. Modeling a fix-vs-regression pair as two named `Next` relations in one spec (e.g. `NextCurrent`/`NextVulnerable`)? Pass `--next <operator>` to pick which one the trace must satisfy — the harness defaults to a bare `Next`, which such specs deliberately don't define.
52
+ 6. Classify every finding as code bug, model bug, mapping bug, insufficient trace/alias evidence, or accepted non-modeled behavior.
53
+ 7. Patch code, model, or mapping and rerun until only explicitly waived uncertainty remains.
54
+
55
+ The loop is complete only when `tla verify` passes with reasoned waivers, at least one recorded trace passes `tla trace-check`, and unexercised actions are listed as accepted gaps.
56
+
57
+ ## Model Quality Rules
58
+
59
+ - **TypeOK first.** Write the type invariant before any property; it catches most modeling mistakes at the lowest checking cost.
60
+ - **Every invariant needs a failure story.** Before running TLC, write down the concrete scenario that would violate it. If no scenario exists, the invariant is decorative — delete or replace it.
61
+ - **Falsify every invariant individually.** One break-test is not enough: for EACH invariant there must be a documented variant or mutation under which TLC refutes it (the CurrentSpec/VulnerableSpec pattern makes this permanent instead of a throwaway edit). An invariant no variant can violate is decorative — delete or redesign it.
62
+ - **Break the model on purpose.** After the first green run, remove one guard or widen one domain and confirm TLC catches it. A spec that cannot fail proves nothing. Restore it afterward.
63
+ - **Safety before liveness.** Add fairness only when a liveness property demands it; check deadlock unless termination is intended.
64
+ - **Bound the space deliberately.** Small symbolic constant sets, symmetry where sound, sequences kept short. Nondeterministic `\in` transitions from the scaffold are permissive placeholders — tighten them to concrete transitions as you learn the code.
65
+ - **Trace divergence taxonomy.** When `trace-check` diverges: a missing model transition means the model is too strict; an impossible recorded state means instrumentation projects the wrong slice; a genuinely illegal code transition is a bug — write the regression model before fixing it.
66
+
67
+ ## Fast Regression Models
68
+
69
+ A regression model is a small TLA+ module or checker config derived from a counterexample, production bug, or suspected transition.
70
+
71
+ 1. Preserve the full model as source of truth.
72
+ 2. Create a companion regression spec/config named for the failure, seeded from the exact counterexample trace (a diverging `trace-check` output is already that trace).
73
+ 3. Prefer bounded constants and narrowed action sets over weakening the main model.
74
+ 4. Run the regression first after each patch; run the full model after it passes.
75
+ 5. Keep the regression if it protects future behavior.
76
+
77
+ ## Mapping Contract
78
+
79
+ ```json
80
+ {
81
+ "module": "specs/Queue.tla",
82
+ "config": "specs/Queue.cfg",
83
+ "scope": ["src/queue"],
84
+ "variables": {
85
+ "queue": { "code": ["src/queue/store.ts/queue"], "aliases": ["queue"] },
86
+ "lockOwner": {
87
+ "code": ["src/queue/lock.ts/LockMetadata#pid"],
88
+ "aliases": ["pid"],
89
+ "resource": { "path": "lockPath" }
90
+ },
91
+ "status": {
92
+ "code": ["src/queue/lock.ts/LockMetadata#lifecycleStage"],
93
+ "aliases": ["lifecycleStage"],
94
+ "selfAlias": false
95
+ },
96
+ "phase": {
97
+ "code": ["src/queue/lock.ts/__phase_no_stored_field__"],
98
+ "aliases": ["__phase_unmatchable__"],
99
+ "waive": { "reason": "phase is a pure control-flow position; no code field stores it" }
100
+ }
101
+ },
102
+ "actions": {
103
+ "Enqueue": {
104
+ "code": ["src/queue/commands.ts/enqueue"],
105
+ "reads": ["queue"],
106
+ "writes": ["queue"],
107
+ "waive": { "reason": "required only when a declared fact cannot be statically proven" }
108
+ }
109
+ },
110
+ "invariants": ["TypeOK"],
111
+ "traces": ["specs/queue-run.trace.json"]
112
+ }
113
+ ```
114
+
115
+ `code` entries must resolve through `scip-query trace`; variables must map to value-like symbols (a const, let, field, or property holding runtime state — never a type). Waivers are per-fact and require a reason; blanket `allowUnknown` is legacy. Waivers cover write facts symmetrically with reads: `actions.<name>.waive.writes` exempts `model-code-write`, `undeclared-write`, and `missing-write-evidence` findings the same way `waive.reads` exempts the read-side equivalents, and a variable-level `waive` on `actions.<name>.writes` also exempts the corresponding `model-mapping-write` mismatch against the SANY-derived model text. A waived write still shows up in the Proof line's waiver ledger with its reason — it never silently vanishes.
116
+
117
+ An action `code` entry can narrow itself to a line window, `"file#function@L<start>-L<end>"` (C3) — when several guard/branch actions share one function, whole-function `code` forces every sibling to claim every write in it; a window scopes fact collection to that sub-range instead, so each branch action attributes only its own write. The window must fall entirely inside the referent's actual resolved span or `tla verify` reports a hard `invalid-line-window` error naming the file, function, and actual span — never a silent clamp back to the whole function. Windows are line-number-brittle by design: a later refactor that shifts lines is caught loudly (the containment check plus `tla verify`'s referent resolution), not silently mis-scanned.
118
+
119
+ `resource` binds a variable to filesystem state — a lock file, a published artifact — anything the model treats as owned state but that code only touches through path-taking calls, never a plain assignment. The conformance scanner classifies `writeFileSync`/`rmSync`/`renameSync`/`mkdirSync`/`unlinkSync` calls whose first argument's text contains the declared `path` as writes of the variable, and `readFileSync`/`existsSync`/`statSync` calls the same way as reads. The match is textual containment, not a resolved value — evidence tier stays `static-action`, and a resource-bound variable still needs a value-like `code` referent for the kind check.
120
+
121
+ `statements` (Q2) binds a variable to SQL-backed state — prepared statements, table rows behind `db.prepare(...)`/`.exec(...)`/tagged templates. Each entry is `{ "pattern": "<substring or regex>" }`, compiled as a RegExp. Any call expression argument whose static string text (a string literal, or the static fragments of a template literal — `${...}` interpolations excluded) matches `pattern` is classified by its leading SQL verb: `INSERT`/`UPDATE`/`DELETE`/`REPLACE` is a write, `SELECT` is a read. Matching is not restricted to a callee allowlist (SQL APIs vary too much) — classification comes entirely from the matched text's leading verb. Two variables sharing a `statements` pattern is a mapping-load error, same as a shared `resource` path. Evidence tier stays `static-action`. Dynamic SQL built by string concatenation has no static text to match and still falls through to a waiver.
122
+
123
+ `ormCalls` (C1) binds a variable to ORM-backed state when there is no literal SQL text to match at all — Drizzle-style query builders (`db.update(t).set(...)`, `db.insert(t).values(...)`, `db.select().from(t)`, `db.delete(t)`). Each entry is `{ "table": "<identifier>", "methods"?: [...] }`. A call chain whose own method name is in the write set (`update`/`insert`/`delete` by default) or read set (`select`/`query`/`findFirst`/`findMany` by default) AND whose own table argument (or, for `select`, the `.from(t)` chain segment) names `table` attributes to the variable — matching never looks at the receiver (`db`, `tx`, ...), only the method + table-arg shape. `methods` narrows the effective set to a subset of that seven-name vocabulary; an unrecognized name fails to load. Two variables binding the same `(table, method)` pair is a mapping-load error, same category as a shared `statements` pattern — but a write-only binding and a read-only binding on the same table do not collide. Evidence tier stays `static-action`.
124
+
125
+ `variables.<v>.selfAlias: false` opts out of the automatic self-name alias (default `true`, fully backward compatible): normally a variable's own TLA+ name is always added to its alias list, which means an object-literal key or identifier that merely echoes the variable's name — but means something unrelated elsewhere in scope — becomes an unavoidable false write/read attribution. Set it `false` and give a precise, unambiguous alias instead (as `status` does above, aliased only to `lifecycleStage`); a `selfAlias: false` variable with no other alias, no `resource`, no `statements`, and no `waive` is a load error, since it would otherwise be silently unattributable.
126
+
127
+ `variables.<v>.waive: {reason}` exempts that one variable's `missing-referent`/`invalid-referent-kind` findings — for state that genuinely has no code twin (a pure control-flow position, a derived decision, a value observable only through `process.exitCode`). It does not exempt read/write facts; those stay on the action's own `waive`. Prefer this over the old workaround of citing an unrelated real symbol just to satisfy the value-like-kind check — name a referent that plainly does not resolve (or does resolve but to the wrong kind) and waive it honestly; a reader should never have to guess that a `code[]` entry is a decoy.
128
+
129
+ Top-level `"unmappedWriteScope": "actions" | "scope-files"` (default `"scope-files"`) controls how strictly `scope` is enforced: the default requires every function anywhere in `scope` that touches a modeled variable to be mapped as an action, or its write is a hard `unmapped-write` error. Set `"actions"` to opt out of that whole-file sweep when `scope` legitimately contains code the mapping was never meant to cover in full — only the per-action write/read checks still run.
130
+
131
+ Top-level `"init": { "codeRefs": ["file#function", ...], "waive"?: {"reason": ...} }` (Q3) binds the model's `Init` to the code referent(s) that materialize initial state — most often a lazy-init factory. `codeRefs` resolves and kind-checks like an action's `code` (function-like, `missing-referent`/`invalid-referent-kind` findings apply, `waive` exempts both). Writes statically found inside an Init referent's own range are Init-attributed: they are excluded from `unmapped-write` findings without needing `unmappedWriteScope: "actions"`. `init.codeRefs` must not overlap any action's `code` referents — that is a mapping-load error, same category as a variable-alias collision.
132
+
133
+ ## Mapping Discipline
134
+
135
+ - **Alias selection is the sharpest knife.** Never alias a variable to a ubiquitous local identifier (`connection`, `result`, `data`) — every function touching that local gets misattributed across actions. For state with no code twin, use a deliberately unmatchable alias (e.g. `evidenceRowsModelOnly`) so the static layer neither proves nor pollutes, and let the reasoned waiver carry the fact.
136
+ - **Turn off the forced self-alias when the variable's own name is a common word.** A TLA+ variable named `status`, `phase`, or `state` gets its own name auto-included as an alias by default — and object literals elsewhere in scope (`{ status: 'ok' }` in an unrelated response shape) will match it. If the variable's own name is common enough to collide, set `selfAlias: false` and give a precise alias that names the actual stored field instead.
137
+ - **Know the four state backings.** Program variables: normal aliases. Filesystem-backed state (locks, published artifacts): `resource: { "path": ... }` bindings make fs calls provable. SQL-backed state (prepared statements, table rows behind literal SQL text): `statements: [{ "pattern": ... }]` bindings make it provable too (Q2) — a call argument's static SQL text matching `pattern` is classified as a write or read by its leading verb. ORM-backed state with no literal SQL to match (Drizzle-style query builders): `ormCalls: [{ "table": ... }]` bindings (C1) classify by the call chain's own method + table-arg shape instead. Only genuinely dynamic SQL (built by string concatenation, no static text to match) or an ORM shape the method/table matcher cannot see still needs a waiver naming the residual class; never fake attribution.
138
+ - **Lazy initialization is Init, not an action.** A factory that lazily builds state corresponds to the model's `Init`. Top-level `"init": { "codeRefs": ["file#function", ...] }` (Q3) binds it: writes statically found inside an Init referent are Init-attributed and excluded from `unmapped-write` findings without needing `unmappedWriteScope: "actions"` as a whole-file workaround. `init.codeRefs` must not overlap any action's `code` referents — map the factory to `init`, never to an action.
139
+ - **Design for traces early.** The trace encoder pins scalar (and scalar-array) variables only; a model whose state is all functions and tuple-sets cannot be trace-validated. If trace-check matters for the slice, add scalar projection variables (counts, last outcomes, a phase) alongside the structured state.
140
+ - **Trace until covered.** One accepted trace proves one path, not the mapping. Record traces until every Current action with a code twin is exercised by at least one accepted trace, or is explicitly classified with why it cannot be (unreachable without fault injection, environment-gated, model-only). An action no trace ever exercises is a conformance claim resting on static mapping alone. `tla trace-check ... --coverage` (C2) mechanizes the check: it reports steps-exercised-per-action, counted from accepted steps only (a step that never proved a legal transition — checker unavailable, or past the divergence point of a rejected trace — does not count), and names every action still unexercised. `--trace` is repeatable (merged and deduped with the mapping's own `traces` list) so recording another trace to cover a gap is additive, not a rewrite. Coverage is informational — it does not change `trace-check`'s exit code — so it never substitutes for actually closing the gap.
141
+
142
+ ## Accuracy Rules
143
+
144
+ - `tla verify` is the mechanical checker; `tla trace-check` is the semantic one. Only the pair justifies the word "conforms".
145
+ - A PASS with waivers is a conditional claim — the Proof line says exactly what was and was not proven. Never summarize it as unconditional.
146
+ - A PASS on a scaffold with unresolved `TODO`s is meaningless, not conditional: the checker has no TODO detector and will pass a placeholder model. Never report a PASS without confirming step 2 of the Loop is actually done.
147
+ - If code changed but the model did not, inspect whether the mapped transition changed meaning; `diff-gate` flags the changed referents.
148
+ - If the model checker fails, fix the TLA+ model before relying on conformance output.
149
+ - Use `--checker none` only when intentionally checking the mapping without SANY, TLC, or Apalache.
150
+ - The write/read scanner follows one call hop from a mapped action's referent (no recursion) — a callee's effect on a _declared_ fact counts as evidence, marked `(via <callee>, one call hop...)` in findings. It never asserts a new, undeclared fact: a callee shared by several actions cannot make one action silently inherit another's write. If a variable's waiver becomes provable this way, update the waiver reason to name the real call chain instead of deleting the explanation — the evidence is still approximate (which specific runtime call path executes is not proven, only that the code family does).
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "TLA Model System"
3
+ short_description: "Model TypeScript systems with TLA+"
4
+ default_prompt: "Use $scip-tla-model-system to model or verify a TypeScript system with TLA+ and scip-query evidence."
@@ -1,49 +1,71 @@
1
1
  ---
2
2
  name: scip-triage-issue
3
- description: Triage bug reports and issues with scip-query evidence. Use when the user shares a GitHub issue, bug report, failing test, support report, TODO, vague defect, or asks to investigate, classify, root-cause, write an issue, or produce a test-first fix plan before implementation.
3
+ description: Triage issues with scip-query evidence. Use for bug reports, GitHub issues, failing tests, support reports, TODOs, vague defects, root-cause packets, issue bodies, or test-first fix plans.
4
+ commands:
5
+ - template: "scip-query files <issue-term>"
6
+ when: "Map ownership: locate files for the reported term."
7
+ - template: "scip-query trace <entry-or-error-symbol>"
8
+ when: "Trace the failing path: definition plus every reference."
9
+ - template: "scip-query code <entry-or-error-symbol>"
10
+ when: "Trace the failing path: read the exact source."
11
+ - template: "scip-query call-graph <entry-symbol>"
12
+ when: "Trace the failing path: callers and callees."
13
+ - template: "scip-query similar <suspect-symbol> --json --full"
14
+ when: "Compare and bound: nearby implementations for missing handling."
15
+ - template: "scip-query affected <symbol> --json"
16
+ when: "Compare and bound: transitive impact bound for the fix plan."
4
17
  ---
5
18
 
6
- # SCIP Issue Triage
19
+ # scip-triage-issue
7
20
 
8
- Use this skill to turn a report into a grounded fix plan. An issue is a described mismatch between expected and observed behavior that needs a tracked decision or code change. Triage is the evidence pass that determines whether the issue is reproducible, where it enters the codebase, what root cause is most likely, and what test should fail before the fix.
21
+ Use this skill to turn a report into a grounded fix packet. Triage is the evidence pass that determines whether the issue is reproducible, where it enters the codebase, what root cause is likely, and what test should fail before the fix.
22
+
23
+ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
24
+
25
+ <!-- BEGIN GENERATED SKILL COMMANDS -->
26
+ ## Commands for this skill
27
+
28
+ | Command | Purpose | When |
29
+ | --- | --- | --- |
30
+ | `scip-query files <issue-term>` | Find files matching a pattern | Map ownership: locate files for the reported term. |
31
+ | `scip-query trace <entry-or-error-symbol>` | Trace a symbol: definition + all references | Trace the failing path: definition plus every reference. |
32
+ | `scip-query code <entry-or-error-symbol>` | Read the source code for a symbol (bounded to its definition range) | Trace the failing path: read the exact source. |
33
+ | `scip-query call-graph <entry-symbol>` | Show incoming callers and outgoing callees for a symbol | Trace the failing path: callers and callees. |
34
+ | `scip-query similar <suspect-symbol> --json --full` | Find heuristic function similarity candidates from callee fingerprints | Compare and bound: nearby implementations for missing handling. |
35
+ | `scip-query affected <symbol> --json` | Transitive closure of symbols that could break if this symbol changes | Compare and bound: transitive impact bound for the fix plan. |
36
+
37
+ Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
38
+ <!-- END GENERATED SKILL COMMANDS -->
9
39
 
10
40
  ## Rules
11
41
 
12
- 1. Do not file or implement from the title alone. Extract concrete observed behavior, expected behavior, scope, and reproduction first.
42
+ 1. Do not file or implement from the title alone.
13
43
  2. Use scip-query for code evidence: entry points, references, call flow, data flow, blast radius, and similar implementations.
14
- 3. Prefer a failing test plan before a code plan. If no test harness exists, name the smoke command or manual check that will prove the fix.
15
- 4. If the user asks only for triage, stop at the triage packet. If they asked to fix it too, implement after the packet is clear.
44
+ 3. Prefer a failing test plan before a code plan.
45
+ 4. If the user asks only for triage, stop at the packet. If they asked to fix it too, implement after the packet is clear.
16
46
 
17
47
  ## Workflow
18
48
 
19
49
  ### 1. Normalize the report
20
50
 
21
- Record:
51
+ Record summary, observed behavior, expected behavior, reproduction, affected surface, severity, user impact, and logs/screenshots/tests/links.
22
52
 
23
- - title or short summary;
24
- - observed behavior;
25
- - expected behavior;
26
- - reproduction steps or missing reproduction data;
27
- - affected surface: CLI command, API route, UI view, job, library export, docs, or config;
28
- - severity and user impact;
29
- - known logs, stack traces, screenshots, failing tests, or issue links.
53
+ Ask the user only for product intent, credentials, private data, or external system state the repo cannot answer.
30
54
 
31
- If key facts are missing but the repo can answer them, investigate. Ask the user only when the missing fact is product intent, credentials, private data, or an external system state you cannot inspect.
55
+ This step is complete only when missing facts are either recovered or named.
32
56
 
33
- ### 2. Map likely code ownership
57
+ ### 2. Map ownership
34
58
 
35
59
  ```bash
36
- scip-query status --capabilities
37
- scip-query status --capabilities
38
- # If freshness is stale, missing, or unknown:
39
- # scip-query reindex
40
60
  scip-query files <issue-term>
41
61
  scip-query outline <candidate-file>
42
62
  scip-query system <module-or-scope>
43
63
  scip-query surface <module-or-scope>
44
64
  ```
45
65
 
46
- Use `scip-query kind-counts --scope <scope>` and `scip-query by-kind function --scope <scope>` when the issue names a broad subsystem and you need an inventory.
66
+ Use `kind-counts` and `by-kind` for broad subsystems.
67
+
68
+ This step is complete only when likely owner files and surfaces are named.
47
69
 
48
70
  ### 3. Trace the failing path
49
71
 
@@ -55,32 +77,24 @@ scip-query dataflow <state-or-input-symbol>
55
77
  scip-query slice <state-or-input-symbol>
56
78
  ```
57
79
 
58
- If a stack trace names a file and line, use `scip-query code '<file>:<start>-<end>'` to read the exact region before following symbols.
80
+ For stack traces, read the exact range with `scip-query code 'file:start-end'`.
81
+
82
+ This step is complete only when a suspected root cause is tied to source evidence or labeled unproven.
59
83
 
60
- ### 4. Look for known-good comparisons
84
+ ### 4. Compare and bound
61
85
 
62
86
  ```bash
63
87
  scip-query similar <suspect-symbol> --json --full
64
- scip-query convergence <suspect-symbol> <comparison-symbol>
88
+ scip-query similar <suspect-symbol> <comparison-symbol> --plan
65
89
  scip-query similar-files <suspect-file> --json --full
66
90
  scip-query co-change <suspect-file> --json --full
67
- ```
68
-
69
- Use comparisons to identify a missing guard, validation step, conversion, docs partner, generated artifact, or test fixture.
70
-
71
- ### 5. Bound impact and test shape
72
-
73
- ```bash
74
91
  scip-query change-surface <suspect-file> --json --full
75
92
  scip-query affected <suspect-symbol> --json
76
- scip-query diff-impact --json
77
93
  ```
78
94
 
79
- Choose the narrowest failing test that proves the bug. If the issue crosses a public API or generated contract, include `scip-query co-change <file> --json --full` in the plan.
80
-
81
- ## Triage Packet
95
+ This step is complete only when the packet has a narrow test shape and impact bound.
82
96
 
83
- Write the packet before filing or fixing:
97
+ ## Packet
84
98
 
85
99
  ```markdown
86
100
  ## Issue
@@ -97,18 +111,16 @@ Write the packet before filing or fixing:
97
111
 
98
112
  ## Impact
99
113
  - users/surfaces affected
100
- - blast radius from `scip-query affected` or `change-surface`
114
+ - blast radius
101
115
 
102
116
  ## Fix Plan
103
117
  1. Add or update failing test/smoke check.
104
118
  2. Make the smallest code change.
105
119
  3. Run targeted test.
106
- 4. Run `scip-query status --capabilities`; if freshness is `stale`, `missing`, or `unknown`, run `scip-query reindex`.
107
- 5. Run `scip-query diff-gate --json`.
108
- 6. Invoke `scip-verify`.
120
+ 4. Invoke `scip-verify`.
109
121
 
110
122
  ## Open Questions
111
123
  - <product intent or external state only>
112
124
  ```
113
125
 
114
- If creating a GitHub issue, use the packet as the issue body and include exact file/symbol references. If no root cause is proven, label the result as `needs reproduction` or `needs product decision`, not as ready to implement.
126
+ If no root cause is proven, label the issue `needs reproduction` or `needs product decision`.
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: scip-twin-drift
3
+ description: Find and resolve twin drift with scip-query. Use for same-name or near-name functions across files with diverged bodies, drifted policy thresholds, one-sided fixes, or consolidating a duplicated concept into one canonical helper.
4
+ commands:
5
+ - template: "scip-query twin-drift --json --full"
6
+ when: "Run the detector: every DIVERGENT and near-name group in scope."
7
+ - template: "scip-query duplicate-bodies --json --full"
8
+ when: "Cross-check: IDENTICAL groups are duplicate-bodies' job, not this skill's."
9
+ - template: "scip-query code <symbol>"
10
+ when: "Classify a divergent group: read every member's body."
11
+ - template: "scip-query refs <symbol>"
12
+ when: "Pick the canonical twin: consumer count per member."
13
+ - template: "scip-query diff-gate --json"
14
+ when: "Verify: the twin-partner check must not flag a one-sided fix."
15
+ ---
16
+
17
+ # scip-twin-drift
18
+
19
+ Use this skill when the same concept exists in more than one place under the same or a near-name (case-insensitive, or edit-distance ≤ 2 for names ≥ 8 characters) and the bodies have silently diverged. A twin drift group is a same-leaf-name family of callables spanning at least two files whose normalized-token bodies are neither identical (that is `duplicate-bodies`' job) nor unrelated (a homonym like `render` or `parse`) but partially overlapping — the signature of a concept that was copied once and then edited independently in only some of its copies.
20
+
21
+ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
22
+
23
+ <!-- BEGIN GENERATED SKILL COMMANDS -->
24
+ ## Commands for this skill
25
+
26
+ | Command | Purpose | When |
27
+ | --- | --- | --- |
28
+ | `scip-query twin-drift --json --full` | Twin drift candidates: same-name (or near-name) functions across files with diverged bodies | Run the detector: every DIVERGENT and near-name group in scope. |
29
+ | `scip-query duplicate-bodies --json --full` | Find exact duplicate small-body candidates across files | Cross-check: IDENTICAL groups are duplicate-bodies' job, not this skill's. |
30
+ | `scip-query code <symbol>` | Read the source code for a symbol (bounded to its definition range) | Classify a divergent group: read every member's body. |
31
+ | `scip-query refs <symbol>` | Find all files referencing a symbol | Pick the canonical twin: consumer count per member. |
32
+ | `scip-query diff-gate --json` | Gate the current diff: echo candidates, incomplete migrations, missing co-change partners, unedited twin partners (advisory), uncited doc updates, unused params, new dead symbols; exit 1 on blocking findings | Verify: the twin-partner check must not flag a one-sided fix. |
33
+
34
+ Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
35
+ <!-- END GENERATED SKILL COMMANDS -->
36
+
37
+ ## Rules
38
+
39
+ 1. `IDENTICAL` groups defer to `duplicate-bodies`; do not re-report them here.
40
+ 2. Homonyms (similarity below `--min-similarity`, default 0.3) are noise unless `--include-homonyms` was requested; do not chase them.
41
+ 3. Every `DIVERGENT` group in scope gets a classification before this skill reports done.
42
+ 4. Prefer consolidation to one exported helper over leaving parallel copies; when consolidation is unsafe or premature, record the intent gap explicitly (comment or waiver) rather than silently accepting drift.
43
+ 5. A twin-partner `diff-gate` finding on a change you are making is the live version of this same defect class — treat it as a signal to run this skill, not just to suppress.
44
+
45
+ ## Workflow
46
+
47
+ ### 1. Run the detector
48
+
49
+ ```bash
50
+ scip-query twin-drift --json --full
51
+ ```
52
+
53
+ Scope with `-s/--scope <path>` when the review is bounded to a module. Record group count, member count, and `maxDivergence` per group.
54
+
55
+ This step is complete only when every group in scope is enumerated with its relationship (`divergent` vs suppressed homonym).
56
+
57
+ ### 2. Classify each DIVERGENT group
58
+
59
+ For each group, read every member with `scip-query code <symbol-or-file:range>` and use the group's `firstDivergentTokens` as a starting point for where the bodies diverge. Classify the group as one of:
60
+
61
+ - **Intentional variation**: the copies differ because the domains genuinely differ (for example a React-specific vs Vue-specific structural comparator that must branch on framework-specific overlap checks). Essential variation stays; record why.
62
+ - **Drifted policy**: the copies encode what should be one policy (a threshold, a normalization rule, an edge-case guard) that only some copies received when it last changed. This is a bug: pick the correct value and propagate it, or extract the policy into one named function/constant.
63
+ - **One-sided fix**: one copy was bugfixed or hardened and its twin(s) were not. This is also a bug: apply the same fix to every member, or consolidate.
64
+
65
+ This step is complete only when every DIVERGENT group in scope has one of these three labels with a one-line reason.
66
+
67
+ ### 3. Pick the canonical twin and act
68
+
69
+ For groups getting consolidated, pick the canonical member by consumer count:
70
+
71
+ ```bash
72
+ scip-query refs <symbol-in-file-A>
73
+ scip-query refs <symbol-in-file-B>
74
+ ```
75
+
76
+ Prefer the member with the most consumers, or the one in the more general/shared location when counts tie. Extract or move the canonical body to one exported helper; update the other member(s) to call it, or delete them if they were pure duplication with different names for the caller's convenience. Preserve any classified-essential variation as a parameter or a thin caller-side branch, not as a second copy of the whole body.
77
+
78
+ For groups marked intentional variation, do not force consolidation; record the reason in a comment near one of the members so the next `twin-drift` run and the next reader both see it was considered.
79
+
80
+ This step is complete only when every DIVERGENT group is either consolidated (with the old copies gone or forwarding) or has a recorded reason it stays separate.
81
+
82
+ ### 4. Verify
83
+
84
+ Rerun the detector to confirm consolidated groups no longer appear as DIVERGENT, then run the routed postchecks from the shared reference and:
85
+
86
+ ```bash
87
+ scip-query diff-gate --json
88
+ ```
89
+
90
+ The `twin-partner` check is advisory (it never blocks the gate by itself) but a finding here on your own diff means you just reproduced the exact defect class this skill exists to catch — fix or explicitly accept it before finishing.
91
+
92
+ This step is complete only when `twin-drift` shows no unclassified `DIVERGENT` groups in scope and `diff-gate` findings are resolved or explained.
93
+
94
+ ## Report
95
+
96
+ ```markdown
97
+ Scope:
98
+ Groups found: N (M divergent, K suppressed homonyms)
99
+
100
+ Divergent groups:
101
+ - <leaf name> (<files>) — classification: intentional variation / drifted policy / one-sided fix
102
+ - action: consolidated into <canonical file:symbol> / reason kept separate
103
+
104
+ Verification:
105
+ - `scip-query twin-drift --json --full`: <result>
106
+ - `scip-query diff-gate --json`: <result>
107
+ ```
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "SCIP Twin Drift"
3
+ short_description: "Find and resolve same-name twins that have silently diverged"
4
+ default_prompt: "Use scip-query twin-drift to find same-name or near-name functions that have diverged across files, classify each divergence, and consolidate or record the intent gap."