@joshuafolkken/kit 1.872.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 (1108) hide show
  1. package/.claude/.claude-plugin/plugin.json +11 -0
  2. package/.claude/settings.json +110 -0
  3. package/.claude/skills/dependency-update/SKILL.md +76 -0
  4. package/.claude/skills/epic-commands/SKILL.md +463 -0
  5. package/.claude/skills/verify-ui/SKILL.md +96 -0
  6. package/.claude/skills/workflow-commands/SKILL.md +265 -0
  7. package/.claude/skills/workflow-commands/background-commands.md +130 -0
  8. package/.claude/skills/workflow-commands/backlogrun-child.md +364 -0
  9. package/.claude/skills/workflow-commands/backlogrun-lanes.md +345 -0
  10. package/.claude/skills/workflow-commands/backlogrun-park.md +179 -0
  11. package/.claude/skills/workflow-commands/backlogrun-progress.md +600 -0
  12. package/.claude/skills/workflow-commands/backlogrun-steps.md +604 -0
  13. package/.claude/skills/workflow-commands/backlogrun.md +109 -0
  14. package/.claude/skills/workflow-commands/chain-rule.md +98 -0
  15. package/.claude/skills/workflow-commands/delegation.md +52 -0
  16. package/.claude/skills/workflow-commands/followup-reference.md +118 -0
  17. package/.claude/skills/workflow-commands/followup.md +222 -0
  18. package/.claude/skills/workflow-commands/fullrun-steps.md +93 -0
  19. package/.claude/skills/workflow-commands/fullrun.md +82 -0
  20. package/.claude/skills/workflow-commands/halfrun.md +73 -0
  21. package/.claude/skills/workflow-commands/into-target.md +48 -0
  22. package/.claude/skills/workflow-commands/issue-comments.md +109 -0
  23. package/.claude/skills/workflow-commands/issue-fold-existing.md +27 -0
  24. package/.claude/skills/workflow-commands/issue-scout.md +45 -0
  25. package/.claude/skills/workflow-commands/kickoff.md +82 -0
  26. package/.claude/skills/workflow-commands/latest-gate.md +85 -0
  27. package/.claude/skills/workflow-commands/needs-human-review.md +64 -0
  28. package/.claude/skills/workflow-commands/observation-filing.md +349 -0
  29. package/.claude/skills/workflow-commands/pre-gate-cut.md +340 -0
  30. package/.claude/skills/workflow-commands/prerequisite.md +62 -0
  31. package/.claude/skills/workflow-commands/retrospective.md +81 -0
  32. package/.claude/skills/workflow-commands/rule-residency.md +267 -0
  33. package/.claude/skills/workflow-commands/split-assessment.md +130 -0
  34. package/.claude/skills/workflow-commands/target-repository.md +58 -0
  35. package/.claude/skills/workflow-commands/working-tree-hold.md +66 -0
  36. package/.claude-plugin/marketplace.json +15 -0
  37. package/.coderabbit.yaml +50 -0
  38. package/.codex/config.toml +8 -0
  39. package/.codex/hooks.json +71 -0
  40. package/.cursorrules +45 -0
  41. package/.gitattributes +7 -0
  42. package/.github/dependabot.yml +19 -0
  43. package/.github/pull_request_template.md +1 -0
  44. package/.github/release.yml +18 -0
  45. package/.github/workflows/auto-tag.yml +111 -0
  46. package/.github/workflows/ci.yml +681 -0
  47. package/.github/workflows/dependabot-auto-merge.yml +55 -0
  48. package/.github/workflows/production.yml +47 -0
  49. package/.github/workflows/publish.yml +39 -0
  50. package/.github/workflows/sonar-qube.yml +34 -0
  51. package/.mcp.json +8 -0
  52. package/.ncurc.json +3 -0
  53. package/.prettierignore +20 -0
  54. package/.vscode/extensions.json +21 -0
  55. package/.vscode/settings.json +41 -0
  56. package/AGENTS.md +29 -0
  57. package/CLAUDE.md +207 -0
  58. package/CODE_OF_CONDUCT.md +132 -0
  59. package/GEMINI.md +30 -0
  60. package/LICENSE +21 -0
  61. package/README.md +41 -0
  62. package/SECURITY.md +34 -0
  63. package/cspell/index.yaml +177 -0
  64. package/dist/CLAUDE.md +207 -0
  65. package/dist/config-merge/index.d.ts +29 -0
  66. package/dist/config-merge/index.js +459 -0
  67. package/dist/hooks/batch-guard.js +28 -0
  68. package/dist/hooks/chunk-25JL6FMS.js +4970 -0
  69. package/dist/hooks/chunk-2ANGT3XM.js +375 -0
  70. package/dist/hooks/chunk-2EI5GBSW.js +42 -0
  71. package/dist/hooks/chunk-2OT5XE2N.js +5014 -0
  72. package/dist/hooks/chunk-2RUPMGGV.js +137 -0
  73. package/dist/hooks/chunk-2XIGZQMQ.js +3299 -0
  74. package/dist/hooks/chunk-33ELOKEV.js +910 -0
  75. package/dist/hooks/chunk-33YRTKM7.js +230 -0
  76. package/dist/hooks/chunk-36JQU5NN.js +77 -0
  77. package/dist/hooks/chunk-3EJBTWVS.js +1769 -0
  78. package/dist/hooks/chunk-3FK5SFAC.js +432 -0
  79. package/dist/hooks/chunk-3PWPYDD2.js +240 -0
  80. package/dist/hooks/chunk-3TQU7TDH.js +375 -0
  81. package/dist/hooks/chunk-3TVLSFZ6.js +432 -0
  82. package/dist/hooks/chunk-3VXYCB4E.js +77 -0
  83. package/dist/hooks/chunk-44M6JXGV.js +3398 -0
  84. package/dist/hooks/chunk-46EEEHC3.js +240 -0
  85. package/dist/hooks/chunk-4A7UVP2P.js +364 -0
  86. package/dist/hooks/chunk-4LFQEZS4.js +137 -0
  87. package/dist/hooks/chunk-4OCX3V2T.js +469 -0
  88. package/dist/hooks/chunk-4OHA5DE7.js +49 -0
  89. package/dist/hooks/chunk-4PMDW3YD.js +68 -0
  90. package/dist/hooks/chunk-4QHBNAI4.js +68 -0
  91. package/dist/hooks/chunk-4SSB3FEE.js +3273 -0
  92. package/dist/hooks/chunk-5A2WQ2CQ.js +5390 -0
  93. package/dist/hooks/chunk-5EVA2JQB.js +5390 -0
  94. package/dist/hooks/chunk-5P7VF5VE.js +3230 -0
  95. package/dist/hooks/chunk-5QWJGGZP.js +49 -0
  96. package/dist/hooks/chunk-5U5EZYG6.js +77 -0
  97. package/dist/hooks/chunk-5VUUF3ZV.js +240 -0
  98. package/dist/hooks/chunk-5WA7UBT3.js +374 -0
  99. package/dist/hooks/chunk-6EBGRQ3Q.js +301 -0
  100. package/dist/hooks/chunk-6TVHWMD3.js +432 -0
  101. package/dist/hooks/chunk-6V5OPIUU.js +13 -0
  102. package/dist/hooks/chunk-6VAGLEMB.js +68 -0
  103. package/dist/hooks/chunk-75BTXKFJ.js +3424 -0
  104. package/dist/hooks/chunk-75RHN67S.js +137 -0
  105. package/dist/hooks/chunk-76KC3BDD.js +3414 -0
  106. package/dist/hooks/chunk-76SLS7CZ.js +898 -0
  107. package/dist/hooks/chunk-7DHZ4DWT.js +5015 -0
  108. package/dist/hooks/chunk-7INSJDGE.js +458 -0
  109. package/dist/hooks/chunk-7VJ4FTDX.js +268 -0
  110. package/dist/hooks/chunk-7XCYNHQK.js +77 -0
  111. package/dist/hooks/chunk-A5YJ3H7E.js +375 -0
  112. package/dist/hooks/chunk-AAEXXUUL.js +268 -0
  113. package/dist/hooks/chunk-ABVEVV2M.js +432 -0
  114. package/dist/hooks/chunk-ACN3YXFL.js +68 -0
  115. package/dist/hooks/chunk-AD3XE3QZ.js +397 -0
  116. package/dist/hooks/chunk-AENFZPZH.js +230 -0
  117. package/dist/hooks/chunk-AFKRFQ6W.js +68 -0
  118. package/dist/hooks/chunk-AHD5IPWI.js +375 -0
  119. package/dist/hooks/chunk-AMK5JGV7.js +77 -0
  120. package/dist/hooks/chunk-ARN7NCQI.js +425 -0
  121. package/dist/hooks/chunk-AUFY653N.js +3425 -0
  122. package/dist/hooks/chunk-AXQBNFEF.js +375 -0
  123. package/dist/hooks/chunk-AYC7R6U4.js +3316 -0
  124. package/dist/hooks/chunk-AYEA2FJ7.js +5015 -0
  125. package/dist/hooks/chunk-B2LIXYFL.js +77 -0
  126. package/dist/hooks/chunk-B4HPNY2I.js +375 -0
  127. package/dist/hooks/chunk-B4YNCUGB.js +469 -0
  128. package/dist/hooks/chunk-B57S3VWT.js +922 -0
  129. package/dist/hooks/chunk-BINZ3PLI.js +364 -0
  130. package/dist/hooks/chunk-BIWLABFK.js +432 -0
  131. package/dist/hooks/chunk-BODUSXKK.js +410 -0
  132. package/dist/hooks/chunk-BQBAT2YK.js +375 -0
  133. package/dist/hooks/chunk-BUJEBW75.js +391 -0
  134. package/dist/hooks/chunk-BVNWORKA.js +72 -0
  135. package/dist/hooks/chunk-BWI47LQS.js +5205 -0
  136. package/dist/hooks/chunk-C25HRMJX.js +137 -0
  137. package/dist/hooks/chunk-CBFZNC74.js +375 -0
  138. package/dist/hooks/chunk-CECYXS4Y.js +3424 -0
  139. package/dist/hooks/chunk-CELGUP5F.js +49 -0
  140. package/dist/hooks/chunk-CMHANU3F.js +3442 -0
  141. package/dist/hooks/chunk-CMN372LI.js +68 -0
  142. package/dist/hooks/chunk-CPGZLMMK.js +3299 -0
  143. package/dist/hooks/chunk-CTQKXDC7.js +268 -0
  144. package/dist/hooks/chunk-CYAT4RIT.js +68 -0
  145. package/dist/hooks/chunk-CYTWYCH2.js +5014 -0
  146. package/dist/hooks/chunk-CZSOLRBA.js +77 -0
  147. package/dist/hooks/chunk-D2PIDYJR.js +3438 -0
  148. package/dist/hooks/chunk-DE57HI6T.js +137 -0
  149. package/dist/hooks/chunk-DGXDGAPG.js +5306 -0
  150. package/dist/hooks/chunk-DNYRSYQG.js +5014 -0
  151. package/dist/hooks/chunk-DTAXH2A2.js +240 -0
  152. package/dist/hooks/chunk-E2IZUWI5.js +375 -0
  153. package/dist/hooks/chunk-E4L2K2BL.js +397 -0
  154. package/dist/hooks/chunk-E55NKX5F.js +68 -0
  155. package/dist/hooks/chunk-ECXVCCVD.js +3079 -0
  156. package/dist/hooks/chunk-EPHO443D.js +68 -0
  157. package/dist/hooks/chunk-EUFK2BI2.js +375 -0
  158. package/dist/hooks/chunk-EYCD5ZAV.js +137 -0
  159. package/dist/hooks/chunk-F2SDYJU4.js +240 -0
  160. package/dist/hooks/chunk-F4B5D5TF.js +68 -0
  161. package/dist/hooks/chunk-FGEO3NDX.js +432 -0
  162. package/dist/hooks/chunk-FJYI52RE.js +137 -0
  163. package/dist/hooks/chunk-FXAKJKTB.js +18 -0
  164. package/dist/hooks/chunk-FYTZHIY4.js +3085 -0
  165. package/dist/hooks/chunk-G7JL2A5K.js +375 -0
  166. package/dist/hooks/chunk-GA3ITDBW.js +42 -0
  167. package/dist/hooks/chunk-GDR4H4SV.js +469 -0
  168. package/dist/hooks/chunk-GFKDXPSM.js +2855 -0
  169. package/dist/hooks/chunk-GIMRTKFU.js +566 -0
  170. package/dist/hooks/chunk-GOPHRLGO.js +240 -0
  171. package/dist/hooks/chunk-GX4HO7SJ.js +230 -0
  172. package/dist/hooks/chunk-GXKKK23T.js +240 -0
  173. package/dist/hooks/chunk-GZ6FUVIK.js +566 -0
  174. package/dist/hooks/chunk-H5HPY5M5.js +2869 -0
  175. package/dist/hooks/chunk-HCF3OGEE.js +1829 -0
  176. package/dist/hooks/chunk-HDEXAOUM.js +469 -0
  177. package/dist/hooks/chunk-HM2TY3TN.js +469 -0
  178. package/dist/hooks/chunk-HOA7NXA2.js +55 -0
  179. package/dist/hooks/chunk-HOFEWH6H.js +240 -0
  180. package/dist/hooks/chunk-HUUI6S5J.js +2669 -0
  181. package/dist/hooks/chunk-I4D3NVUD.js +469 -0
  182. package/dist/hooks/chunk-I4Q6WAJE.js +68 -0
  183. package/dist/hooks/chunk-IB6N4CR2.js +432 -0
  184. package/dist/hooks/chunk-IFLDYJMD.js +469 -0
  185. package/dist/hooks/chunk-IGU466YD.js +77 -0
  186. package/dist/hooks/chunk-IJCQUHKY.js +375 -0
  187. package/dist/hooks/chunk-IKUMBDJB.js +230 -0
  188. package/dist/hooks/chunk-IM3BDIBJ.js +5005 -0
  189. package/dist/hooks/chunk-IMYMAODK.js +3431 -0
  190. package/dist/hooks/chunk-IN2ZVGXA.js +5005 -0
  191. package/dist/hooks/chunk-ITVJ2MKQ.js +18 -0
  192. package/dist/hooks/chunk-J5RIJYTM.js +2669 -0
  193. package/dist/hooks/chunk-JFLMH4K5.js +3460 -0
  194. package/dist/hooks/chunk-JR25IFML.js +77 -0
  195. package/dist/hooks/chunk-JT5AUXFI.js +432 -0
  196. package/dist/hooks/chunk-JY5YVN6N.js +3234 -0
  197. package/dist/hooks/chunk-K5Q4ETVI.js +391 -0
  198. package/dist/hooks/chunk-K67V2F24.js +137 -0
  199. package/dist/hooks/chunk-KABG6AEW.js +3460 -0
  200. package/dist/hooks/chunk-KATZESEC.js +3273 -0
  201. package/dist/hooks/chunk-KFH4H7W7.js +469 -0
  202. package/dist/hooks/chunk-KMUEI6RX.js +910 -0
  203. package/dist/hooks/chunk-KMV4OY77.js +3438 -0
  204. package/dist/hooks/chunk-KQAZNWEY.js +137 -0
  205. package/dist/hooks/chunk-KZZR6JER.js +5015 -0
  206. package/dist/hooks/chunk-LAR6DREP.js +77 -0
  207. package/dist/hooks/chunk-LNCJWEZD.js +5015 -0
  208. package/dist/hooks/chunk-LRYD2GLM.js +6 -0
  209. package/dist/hooks/chunk-LXBKYHDV.js +77 -0
  210. package/dist/hooks/chunk-LYLKIUNE.js +5024 -0
  211. package/dist/hooks/chunk-LZKCFOVC.js +432 -0
  212. package/dist/hooks/chunk-M4FCIYRI.js +77 -0
  213. package/dist/hooks/chunk-M5M7327Q.js +3425 -0
  214. package/dist/hooks/chunk-MF72MHSX.js +3455 -0
  215. package/dist/hooks/chunk-MK56LKDO.js +397 -0
  216. package/dist/hooks/chunk-N3MJADY7.js +240 -0
  217. package/dist/hooks/chunk-NFQSUDBN.js +458 -0
  218. package/dist/hooks/chunk-NHREKY45.js +137 -0
  219. package/dist/hooks/chunk-NP5TTAAW.js +375 -0
  220. package/dist/hooks/chunk-NQTLTKTJ.js +2993 -0
  221. package/dist/hooks/chunk-NVRCZPBZ.js +391 -0
  222. package/dist/hooks/chunk-O46HMMLJ.js +469 -0
  223. package/dist/hooks/chunk-OFJGH2L4.js +240 -0
  224. package/dist/hooks/chunk-OLFMCZH5.js +240 -0
  225. package/dist/hooks/chunk-OMCZS46I.js +49 -0
  226. package/dist/hooks/chunk-OQZEZW5G.js +469 -0
  227. package/dist/hooks/chunk-P2MDAT2Y.js +1897 -0
  228. package/dist/hooks/chunk-P3M2JJIF.js +68 -0
  229. package/dist/hooks/chunk-PDVHQITQ.js +3453 -0
  230. package/dist/hooks/chunk-PNT2AMDH.js +391 -0
  231. package/dist/hooks/chunk-PR2LVSY6.js +3445 -0
  232. package/dist/hooks/chunk-PRR5R4JK.js +137 -0
  233. package/dist/hooks/chunk-PXT44QVN.js +566 -0
  234. package/dist/hooks/chunk-PZLWJLAP.js +469 -0
  235. package/dist/hooks/chunk-Q2FEAZJ2.js +77 -0
  236. package/dist/hooks/chunk-Q32WETDO.js +3265 -0
  237. package/dist/hooks/chunk-Q45DUBLE.js +3600 -0
  238. package/dist/hooks/chunk-Q7NZSWQ5.js +240 -0
  239. package/dist/hooks/chunk-QH2JNAMK.js +3085 -0
  240. package/dist/hooks/chunk-QNNWYQ2R.js +375 -0
  241. package/dist/hooks/chunk-QPU5H2OS.js +68 -0
  242. package/dist/hooks/chunk-QRAHZ5TO.js +1829 -0
  243. package/dist/hooks/chunk-QUZ5HPIE.js +469 -0
  244. package/dist/hooks/chunk-QVCRG34O.js +2893 -0
  245. package/dist/hooks/chunk-R3MY4E3S.js +1675 -0
  246. package/dist/hooks/chunk-R6TXJJXP.js +77 -0
  247. package/dist/hooks/chunk-REJU6VT7.js +1829 -0
  248. package/dist/hooks/chunk-REQAQLRC.js +2993 -0
  249. package/dist/hooks/chunk-RFCXPAHH.js +391 -0
  250. package/dist/hooks/chunk-RHI6Y22X.js +137 -0
  251. package/dist/hooks/chunk-RKZVOBBS.js +469 -0
  252. package/dist/hooks/chunk-RL57TT2Y.js +566 -0
  253. package/dist/hooks/chunk-RORDOD4S.js +3321 -0
  254. package/dist/hooks/chunk-RZKYW5P2.js +77 -0
  255. package/dist/hooks/chunk-SJPJ6VSI.js +391 -0
  256. package/dist/hooks/chunk-SKSIJQQQ.js +432 -0
  257. package/dist/hooks/chunk-SSQDZKXG.js +268 -0
  258. package/dist/hooks/chunk-SSX23SJ2.js +89 -0
  259. package/dist/hooks/chunk-SYHFKE4C.js +77 -0
  260. package/dist/hooks/chunk-TCGNI2ZY.js +42 -0
  261. package/dist/hooks/chunk-TG3WXJF5.js +137 -0
  262. package/dist/hooks/chunk-TH7IJAY5.js +77 -0
  263. package/dist/hooks/chunk-TLZ27PCY.js +240 -0
  264. package/dist/hooks/chunk-U652FXTN.js +566 -0
  265. package/dist/hooks/chunk-UEK47YUF.js +268 -0
  266. package/dist/hooks/chunk-UIO45H3O.js +432 -0
  267. package/dist/hooks/chunk-UNLZEEVH.js +5005 -0
  268. package/dist/hooks/chunk-UNRVF3SZ.js +432 -0
  269. package/dist/hooks/chunk-USLFAFOI.js +3453 -0
  270. package/dist/hooks/chunk-VAEELMLL.js +442 -0
  271. package/dist/hooks/chunk-VALSWLDQ.js +3453 -0
  272. package/dist/hooks/chunk-VC5JEPNY.js +3398 -0
  273. package/dist/hooks/chunk-VEZVK6C7.js +230 -0
  274. package/dist/hooks/chunk-VK5JKFAR.js +49 -0
  275. package/dist/hooks/chunk-VNF2KP7Z.js +469 -0
  276. package/dist/hooks/chunk-VWWCUMW6.js +2669 -0
  277. package/dist/hooks/chunk-W4JARUQV.js +137 -0
  278. package/dist/hooks/chunk-WCYPBPJC.js +5014 -0
  279. package/dist/hooks/chunk-WEOBMNJG.js +2993 -0
  280. package/dist/hooks/chunk-WKJU3J5Y.js +5390 -0
  281. package/dist/hooks/chunk-WMN4TSVF.js +3299 -0
  282. package/dist/hooks/chunk-WNON54PT.js +3469 -0
  283. package/dist/hooks/chunk-WOVKBPPX.js +137 -0
  284. package/dist/hooks/chunk-WRVFORYJ.js +432 -0
  285. package/dist/hooks/chunk-WUBVYGQZ.js +240 -0
  286. package/dist/hooks/chunk-WWULTUOM.js +68 -0
  287. package/dist/hooks/chunk-WXHKKB45.js +4962 -0
  288. package/dist/hooks/chunk-XAI3YTHJ.js +469 -0
  289. package/dist/hooks/chunk-XFZH6JZJ.js +77 -0
  290. package/dist/hooks/chunk-XGPWX6IA.js +137 -0
  291. package/dist/hooks/chunk-XIXXIVGY.js +566 -0
  292. package/dist/hooks/chunk-XKDOYJGA.js +922 -0
  293. package/dist/hooks/chunk-YALTVBHM.js +432 -0
  294. package/dist/hooks/chunk-YEBEPBFK.js +5014 -0
  295. package/dist/hooks/chunk-YI2BQ3DK.js +3441 -0
  296. package/dist/hooks/chunk-YVNBCFGG.js +1829 -0
  297. package/dist/hooks/chunk-YXBN3RGG.js +432 -0
  298. package/dist/hooks/chunk-Z2OOJSW3.js +3163 -0
  299. package/dist/hooks/chunk-ZA3HVBOY.js +2644 -0
  300. package/dist/hooks/chunk-ZKID46U3.js +137 -0
  301. package/dist/hooks/chunk-ZPMU2JV6.js +49 -0
  302. package/dist/hooks/chunk-ZRKY4W7O.js +432 -0
  303. package/dist/hooks/chunk-ZTMRB7LJ.js +268 -0
  304. package/dist/hooks/chunk-ZVPPBQ3L.js +3413 -0
  305. package/dist/hooks/codex-hook-adapter.js +164 -0
  306. package/dist/hooks/duplicate-read-guard.js +29 -0
  307. package/dist/hooks/format-edited.js +37 -0
  308. package/dist/hooks/investigation-guard.js +31 -0
  309. package/dist/hooks/pretool-guard.js +21 -0
  310. package/dist/hooks/session-lang.js +34 -0
  311. package/dist/hooks/stop-guard.js +1597 -0
  312. package/dist/josh.js +1795 -0
  313. package/dist/managed-marker/index.d.ts +10 -0
  314. package/dist/managed-marker/index.js +32 -0
  315. package/dist/self-sync-guard/index.d.ts +10 -0
  316. package/dist/self-sync-guard/index.js +49 -0
  317. package/dist/version/index.d.ts +93 -0
  318. package/dist/version/index.js +1024 -0
  319. package/env/index.d.ts +7 -0
  320. package/env/index.js +62 -0
  321. package/eslint/base.js +233 -0
  322. package/eslint/checkout-rooted-parser.js +34 -0
  323. package/eslint/config-fingerprint.js +103 -0
  324. package/eslint/rules/code-quality.js +292 -0
  325. package/eslint/rules/english-only-prose.js +135 -0
  326. package/eslint/rules/formatting.js +44 -0
  327. package/eslint/rules/import.js +83 -0
  328. package/eslint/rules/namespace-object-export.js +107 -0
  329. package/eslint/rules/naming-convention.js +109 -0
  330. package/eslint/rules/promise.js +17 -0
  331. package/eslint/rules/sonarjs.js +45 -0
  332. package/eslint/rules/test-filename.js +91 -0
  333. package/eslint/rules/typescript.js +186 -0
  334. package/eslint/rules/unicorn.js +191 -0
  335. package/eslint/vanilla.js +1 -0
  336. package/evals/scenarios/consult-not-execute.json +20 -0
  337. package/evals/scenarios/no-implicit-workflow.json +26 -0
  338. package/evals/scenarios/overrides-both-locations.json +29 -0
  339. package/evals/scenarios/upstream-interrupt.json +23 -0
  340. package/evals/scenarios/workflow-skill-loaded.json +16 -0
  341. package/lefthook/base.yml +131 -0
  342. package/lefthook/vanilla.yml +7 -0
  343. package/package.json +169 -0
  344. package/playwright.config.ts +160 -0
  345. package/pnpm-workspace.yaml +41 -0
  346. package/ports/index.d.ts +17 -0
  347. package/ports/index.js +256 -0
  348. package/prettier/index.d.ts +3 -0
  349. package/prettier/index.js +31 -0
  350. package/prompts/agent-lint-protocol.json +79 -0
  351. package/prompts/agent-rules.md +63 -0
  352. package/prompts/coding-standards.md +382 -0
  353. package/prompts/collaboration-workflow/consultation-vs-execution.md +8 -0
  354. package/prompts/collaboration-workflow/cross-repo-epic.md +54 -0
  355. package/prompts/collaboration-workflow/distributed-docs.md +7 -0
  356. package/prompts/collaboration-workflow/durable-rules.md +24 -0
  357. package/prompts/collaboration-workflow/epic-audit.md +56 -0
  358. package/prompts/collaboration-workflow/epic-bundle.md +109 -0
  359. package/prompts/collaboration-workflow/file-edits.md +124 -0
  360. package/prompts/collaboration-workflow/gh-rest.md +57 -0
  361. package/prompts/collaboration-workflow/issue-citation.md +38 -0
  362. package/prompts/collaboration-workflow/issue-template.md +190 -0
  363. package/prompts/collaboration-workflow/latest-first.md +14 -0
  364. package/prompts/collaboration-workflow/no-clones.md +11 -0
  365. package/prompts/collaboration-workflow/operating-rules.md +123 -0
  366. package/prompts/collaboration-workflow/output-bounds.md +107 -0
  367. package/prompts/collaboration-workflow/overview.md +35 -0
  368. package/prompts/collaboration-workflow/plan-comment.md +85 -0
  369. package/prompts/collaboration-workflow/proposal-request.md +23 -0
  370. package/prompts/collaboration-workflow/report-format.md +206 -0
  371. package/prompts/collaboration-workflow/residency.md +94 -0
  372. package/prompts/collaboration-workflow/rule-delivery.md +146 -0
  373. package/prompts/collaboration-workflow/shell-body.md +82 -0
  374. package/prompts/collaboration-workflow/simplicity-first.md +9 -0
  375. package/prompts/collaboration-workflow/single-source-rules.md +13 -0
  376. package/prompts/collaboration-workflow/turn-batching.md +137 -0
  377. package/prompts/collaboration-workflow/upstream-interrupt.md +51 -0
  378. package/prompts/collaboration-workflow/wip-cap.md +118 -0
  379. package/prompts/collaboration-workflow.md +52 -0
  380. package/prompts/refactoring.md +103 -0
  381. package/prompts/review-rubric.md +338 -0
  382. package/prompts/review.md +217 -0
  383. package/prompts/sonar-hotspot-handling.md +77 -0
  384. package/prompts/testing-guide.md +277 -0
  385. package/scripts/adopt/adopt-logic.ts +107 -0
  386. package/scripts/adopt/adopt-toolkits.ts +181 -0
  387. package/scripts/adopt/adopt.ts +171 -0
  388. package/scripts/agent/agent-argv.ts +140 -0
  389. package/scripts/agent/agent-diagnostics.ts +120 -0
  390. package/scripts/agent/agent-event.ts +173 -0
  391. package/scripts/agent/agent-exit-record.ts +32 -0
  392. package/scripts/agent/agent-launch-environment.ts +71 -0
  393. package/scripts/agent/agent-role-profile.ts +329 -0
  394. package/scripts/agent/api-outage.ts +51 -0
  395. package/scripts/agent/claude-agent-argv.ts +151 -0
  396. package/scripts/agent/claude-result-event.ts +98 -0
  397. package/scripts/agent/codex-agent-argv.ts +94 -0
  398. package/scripts/agent/codex-home-source.ts +11 -0
  399. package/scripts/agent/interactive-ask.ts +91 -0
  400. package/scripts/auto-ok/auto-ok-cli.ts +516 -0
  401. package/scripts/backlog/backlog-arrival.ts +147 -0
  402. package/scripts/backlog/backlog-budget-cli.ts +220 -0
  403. package/scripts/backlog/backlog-budget.ts +284 -0
  404. package/scripts/backlog/backlog-defect-priority.ts +77 -0
  405. package/scripts/backlog/backlog-drive-cli.ts +377 -0
  406. package/scripts/backlog/backlog-drive-finish.ts +23 -0
  407. package/scripts/backlog/backlog-drive-named-offer.ts +81 -0
  408. package/scripts/backlog/backlog-drive-named.ts +101 -0
  409. package/scripts/backlog/backlog-drive-offer-argv.ts +29 -0
  410. package/scripts/backlog/backlog-drive-owner.ts +22 -0
  411. package/scripts/backlog/backlog-drive-restore.ts +67 -0
  412. package/scripts/backlog/backlog-drive.ts +322 -0
  413. package/scripts/backlog/backlog-named.ts +164 -0
  414. package/scripts/backlog/backlog-next.ts +376 -0
  415. package/scripts/backlog/backlog-offer-cli.ts +279 -0
  416. package/scripts/backlog/backlog-offer.ts +93 -0
  417. package/scripts/backlog/backlog-plan-cli.ts +235 -0
  418. package/scripts/backlog/backlog-plan.ts +231 -0
  419. package/scripts/backlog/backlog-pool.ts +322 -0
  420. package/scripts/backlog/backlog-ready.ts +146 -0
  421. package/scripts/backlog/backlog-scope.ts +144 -0
  422. package/scripts/backlog/backlog-stalled-cli.ts +30 -0
  423. package/scripts/backlog/backlog-stalled-detect.ts +143 -0
  424. package/scripts/backlog/backlog-stalled.ts +118 -0
  425. package/scripts/behavior/behavior-assertion.ts +87 -0
  426. package/scripts/behavior/behavior-cli.ts +88 -0
  427. package/scripts/behavior/behavior-rules.ts +128 -0
  428. package/scripts/build/build-bin.ts +36 -0
  429. package/scripts/build/build-claude-md.ts +42 -0
  430. package/scripts/build/build-config-merge.ts +26 -0
  431. package/scripts/build/build-hooks.ts +79 -0
  432. package/scripts/build/build-library.ts +83 -0
  433. package/scripts/build/build-managed-marker.ts +26 -0
  434. package/scripts/build/build-self-sync-guard.ts +26 -0
  435. package/scripts/build/build-version.ts +25 -0
  436. package/scripts/build/local-bin.ts +97 -0
  437. package/scripts/build/shim-shell.ts +25 -0
  438. package/scripts/bytes/bytes-command.ts +181 -0
  439. package/scripts/cases/cases-cli.ts +48 -0
  440. package/scripts/cases/cases-logic.ts +100 -0
  441. package/scripts/claude/skill-meta.ts +37 -0
  442. package/scripts/claude/workflow-destination.ts +13 -0
  443. package/scripts/clone/clone-aggregate.ts +76 -0
  444. package/scripts/clone/clone-fingerprint.ts +96 -0
  445. package/scripts/clone/clone-scan-cli.ts +39 -0
  446. package/scripts/clone/clone-scan.ts +158 -0
  447. package/scripts/config-merge/index.ts +19 -0
  448. package/scripts/config-merge/json-format.ts +128 -0
  449. package/scripts/config-merge/list-patch.ts +61 -0
  450. package/scripts/config-merge/parse-jsonc.ts +14 -0
  451. package/scripts/config-merge/patch-json-key.ts +439 -0
  452. package/scripts/config-merge/patch-json-list.ts +38 -0
  453. package/scripts/config-merge/patch-yaml-list.ts +107 -0
  454. package/scripts/cost-runtime/codex-usage.ts +119 -0
  455. package/scripts/cost-runtime/context-cut-payback.ts +77 -0
  456. package/scripts/cost-runtime/context-cut-threshold.ts +21 -0
  457. package/scripts/cost-runtime/cost-attribute.ts +168 -0
  458. package/scripts/cost-runtime/cost-blocks.ts +149 -0
  459. package/scripts/cost-runtime/cost-cli.ts +318 -0
  460. package/scripts/cost-runtime/cost-corpus.ts +278 -0
  461. package/scripts/cost-runtime/cost-format.ts +32 -0
  462. package/scripts/cost-runtime/cost-pricing.ts +176 -0
  463. package/scripts/cost-runtime/cost-tokens.ts +84 -0
  464. package/scripts/cost-runtime/cost-transcript.ts +531 -0
  465. package/scripts/cost-runtime/cost-usage.ts +287 -0
  466. package/scripts/cost-runtime/cost-verdict.ts +89 -0
  467. package/scripts/cost-runtime/own-session.ts +58 -0
  468. package/scripts/cost-runtime/transcript-cwd.ts +14 -0
  469. package/scripts/delegation/delegation-cli.ts +91 -0
  470. package/scripts/delegation/delegation-policy.ts +178 -0
  471. package/scripts/delegation/duplicate-read-guard.ts +244 -0
  472. package/scripts/delegation/fanout-cli.ts +61 -0
  473. package/scripts/delegation/fanout.ts +95 -0
  474. package/scripts/delegation/investigation-guard.ts +131 -0
  475. package/scripts/delegation/investigation-reads.ts +637 -0
  476. package/scripts/discovery/repo-discovery.ts +166 -0
  477. package/scripts/discovery/repo-map-logic.ts +102 -0
  478. package/scripts/discovery/repo-origin.ts +153 -0
  479. package/scripts/discovery/repo-party-cli.ts +69 -0
  480. package/scripts/discovery/repo-party.ts +46 -0
  481. package/scripts/doctor/doctor-consumer.ts +181 -0
  482. package/scripts/doctor/doctor-io.ts +210 -0
  483. package/scripts/doctor/doctor-logic.ts +122 -0
  484. package/scripts/doctor/doctor-ports.ts +117 -0
  485. package/scripts/doctor/doctor.ts +232 -0
  486. package/scripts/document/backlogrun-parent-read-set.ts +48 -0
  487. package/scripts/document/bash-output-cap.ts +45 -0
  488. package/scripts/document/document-byte-budget.ts +183 -0
  489. package/scripts/document/document-byte-check.ts +131 -0
  490. package/scripts/document/document-reachability.ts +131 -0
  491. package/scripts/document/document-read-cli.ts +82 -0
  492. package/scripts/document/document-scan.ts +108 -0
  493. package/scripts/document/document-section-cli.ts +101 -0
  494. package/scripts/document/document-section.ts +156 -0
  495. package/scripts/document/edit-files-cli.ts +280 -0
  496. package/scripts/document/entry-read-budget.ts +154 -0
  497. package/scripts/document/entry-read-set.ts +471 -0
  498. package/scripts/document/generate-catalog.ts +69 -0
  499. package/scripts/document/lane-child-read-set.ts +88 -0
  500. package/scripts/document/read-files-cli.ts +135 -0
  501. package/scripts/document/read-set-cli.ts +295 -0
  502. package/scripts/document/read-set-point-of-use.ts +89 -0
  503. package/scripts/document/read-set-pricing.ts +52 -0
  504. package/scripts/document/read-set-trim.ts +78 -0
  505. package/scripts/document/retired-phrases.ts +143 -0
  506. package/scripts/document/review-agent-type.ts +46 -0
  507. package/scripts/document/single-source.ts +73 -0
  508. package/scripts/epic/epic-audit-checks.ts +452 -0
  509. package/scripts/epic/epic-audit-cli.ts +374 -0
  510. package/scripts/epic/epic-audit-orphans.ts +142 -0
  511. package/scripts/epic/epic-audit-rationale.ts +191 -0
  512. package/scripts/epic/epic-audit-report.ts +101 -0
  513. package/scripts/epic/epic-audit.ts +240 -0
  514. package/scripts/epic/epic-bundle-cli.ts +472 -0
  515. package/scripts/epic/epic-bundle-evidence.ts +147 -0
  516. package/scripts/epic/epic-bundle-gaps.ts +86 -0
  517. package/scripts/epic/epic-bundle-referenced.ts +195 -0
  518. package/scripts/epic/epic-bundle.ts +309 -0
  519. package/scripts/epic/epic-busy.ts +204 -0
  520. package/scripts/epic/epic-candidate-confirm.ts +279 -0
  521. package/scripts/epic/epic-classify.ts +294 -0
  522. package/scripts/epic/epic-cross-repo.ts +366 -0
  523. package/scripts/epic/epic-fetch.ts +370 -0
  524. package/scripts/epic/epic-graph.ts +279 -0
  525. package/scripts/epic/epic-index.ts +209 -0
  526. package/scripts/epic/epic-issue.ts +172 -0
  527. package/scripts/epic/epic-lane-offer.ts +207 -0
  528. package/scripts/epic/epic-nested.ts +37 -0
  529. package/scripts/epic/epic-next-read.ts +141 -0
  530. package/scripts/epic/epic-next-views.ts +144 -0
  531. package/scripts/epic/epic-next.ts +477 -0
  532. package/scripts/epic/epic-outside-blocker.ts +113 -0
  533. package/scripts/epic/epic-relation-recheck.ts +108 -0
  534. package/scripts/epic/epic-report.ts +200 -0
  535. package/scripts/gate/core-budget.ts +292 -0
  536. package/scripts/gate/gate-log.ts +95 -0
  537. package/scripts/gate/gate-plan.ts +356 -0
  538. package/scripts/gate/gate-report.ts +207 -0
  539. package/scripts/gate/gate-skip.ts +123 -0
  540. package/scripts/gate/gate-tree.ts +49 -0
  541. package/scripts/gate/hook-gate-reuse.ts +130 -0
  542. package/scripts/gate/pre-commit-type-check.ts +187 -0
  543. package/scripts/gate/scoped-green.ts +260 -0
  544. package/scripts/gate/type-check-step.ts +90 -0
  545. package/scripts/gate/verification-gate.ts +531 -0
  546. package/scripts/gh/fix-gh-packages-logic.ts +232 -0
  547. package/scripts/gh/fix-gh-packages.ts +129 -0
  548. package/scripts/gh/gh-cli-token.ts +18 -0
  549. package/scripts/gh/gh-spawn.ts +44 -0
  550. package/scripts/git/animation-helpers.ts +81 -0
  551. package/scripts/git/change-base.ts +26 -0
  552. package/scripts/git/changed-file-scope.ts +209 -0
  553. package/scripts/git/changed-paths.ts +30 -0
  554. package/scripts/git/constants.ts +41 -0
  555. package/scripts/git/git-ai-review-scan.ts +154 -0
  556. package/scripts/git/git-animation.ts +41 -0
  557. package/scripts/git/git-branch.ts +127 -0
  558. package/scripts/git/git-command.ts +587 -0
  559. package/scripts/git/git-commit.ts +27 -0
  560. package/scripts/git/git-common-directory.ts +38 -0
  561. package/scripts/git/git-epic-add-body.ts +365 -0
  562. package/scripts/git/git-epic-add-plan.ts +421 -0
  563. package/scripts/git/git-epic-add.ts +249 -0
  564. package/scripts/git/git-epic-body.ts +150 -0
  565. package/scripts/git/git-epic-chains.ts +411 -0
  566. package/scripts/git/git-epic-close-comment.ts +199 -0
  567. package/scripts/git/git-epic-close.ts +393 -0
  568. package/scripts/git/git-epic-decision.ts +171 -0
  569. package/scripts/git/git-epic-parse.ts +351 -0
  570. package/scripts/git/git-epic-promote.ts +102 -0
  571. package/scripts/git/git-epic-read.ts +73 -0
  572. package/scripts/git/git-epic-reconcile.ts +246 -0
  573. package/scripts/git/git-epic-reference.ts +98 -0
  574. package/scripts/git/git-epic-relations.ts +78 -0
  575. package/scripts/git/git-epic-remove-plan.ts +152 -0
  576. package/scripts/git/git-epic-remove.ts +101 -0
  577. package/scripts/git/git-epic-run.ts +223 -0
  578. package/scripts/git/git-epic-sections.ts +98 -0
  579. package/scripts/git/git-epic-shape.ts +81 -0
  580. package/scripts/git/git-epic-validate.ts +155 -0
  581. package/scripts/git/git-error.ts +78 -0
  582. package/scripts/git/git-execa-error.ts +35 -0
  583. package/scripts/git/git-fixture-workspace.ts +88 -0
  584. package/scripts/git/git-followup-cleanup.ts +88 -0
  585. package/scripts/git/git-followup-flush.ts +63 -0
  586. package/scripts/git/git-followup-label.ts +67 -0
  587. package/scripts/git/git-followup-pending.ts +95 -0
  588. package/scripts/git/git-followup-stages.ts +149 -0
  589. package/scripts/git/git-gh-api-path.ts +118 -0
  590. package/scripts/git/git-gh-check.ts +21 -0
  591. package/scripts/git/git-gh-command.ts +17 -0
  592. package/scripts/git/git-gh-exec.ts +344 -0
  593. package/scripts/git/git-gh-failure.ts +103 -0
  594. package/scripts/git/git-gh-helpers.ts +44 -0
  595. package/scripts/git/git-gh-issue-list.ts +257 -0
  596. package/scripts/git/git-gh-issue-read.ts +457 -0
  597. package/scripts/git/git-gh-issue-rest.ts +238 -0
  598. package/scripts/git/git-gh-issue-write.ts +285 -0
  599. package/scripts/git/git-gh-issue.ts +161 -0
  600. package/scripts/git/git-gh-pr-auto-merge.ts +85 -0
  601. package/scripts/git/git-gh-pr-read.ts +322 -0
  602. package/scripts/git/git-gh-pr-rest.ts +172 -0
  603. package/scripts/git/git-gh-pr-review.ts +103 -0
  604. package/scripts/git/git-gh-pr-rollup.ts +91 -0
  605. package/scripts/git/git-gh-pr-snapshot.ts +138 -0
  606. package/scripts/git/git-gh-pr.ts +219 -0
  607. package/scripts/git/git-gh-reachability.ts +56 -0
  608. package/scripts/git/git-gh-repo.ts +37 -0
  609. package/scripts/git/git-gh-rest-state.ts +14 -0
  610. package/scripts/git/git-issue.ts +168 -0
  611. package/scripts/git/git-location-environment.ts +62 -0
  612. package/scripts/git/git-ls-remote.ts +28 -0
  613. package/scripts/git/git-next-issues.ts +98 -0
  614. package/scripts/git/git-notify.ts +104 -0
  615. package/scripts/git/git-pr-ai-review.ts +180 -0
  616. package/scripts/git/git-pr-checks-eval.ts +265 -0
  617. package/scripts/git/git-pr-checks-parse.ts +153 -0
  618. package/scripts/git/git-pr-checks-watch.ts +184 -0
  619. package/scripts/git/git-pr-checks.ts +387 -0
  620. package/scripts/git/git-pr-coderabbit.ts +129 -0
  621. package/scripts/git/git-pr-confirmation.ts +64 -0
  622. package/scripts/git/git-pr-error.ts +25 -0
  623. package/scripts/git/git-pr-followup-wrapup.ts +225 -0
  624. package/scripts/git/git-pr-followup.ts +436 -0
  625. package/scripts/git/git-pr-managed-config.ts +69 -0
  626. package/scripts/git/git-pr-messages.ts +37 -0
  627. package/scripts/git/git-pr.ts +181 -0
  628. package/scripts/git/git-prompt-display.ts +22 -0
  629. package/scripts/git/git-prompt.ts +207 -0
  630. package/scripts/git/git-push-transport.ts +173 -0
  631. package/scripts/git/git-push.ts +27 -0
  632. package/scripts/git/git-remote-branch.ts +40 -0
  633. package/scripts/git/git-spawn.ts +47 -0
  634. package/scripts/git/git-staging.ts +128 -0
  635. package/scripts/git/git-stash.ts +124 -0
  636. package/scripts/git/git-status.ts +198 -0
  637. package/scripts/git/git-worktree.ts +110 -0
  638. package/scripts/git/github-issue-url.ts +105 -0
  639. package/scripts/git/gone-branch.ts +113 -0
  640. package/scripts/git/issue-labels.ts +279 -0
  641. package/scripts/git/listing-cutoff.ts +51 -0
  642. package/scripts/git/main-merge-guard.ts +134 -0
  643. package/scripts/git/main-merge.ts +120 -0
  644. package/scripts/git/main-sync.ts +121 -0
  645. package/scripts/git/parse-json-array.ts +102 -0
  646. package/scripts/git/schemas.ts +166 -0
  647. package/scripts/git/stash-orphans.ts +91 -0
  648. package/scripts/git/stash-pop-args.ts +59 -0
  649. package/scripts/git/stash-pop-cli.ts +105 -0
  650. package/scripts/git/telegram-notify.ts +404 -0
  651. package/scripts/hooks/batch-guard.ts +144 -0
  652. package/scripts/hooks/check-commit-message.ts +134 -0
  653. package/scripts/hooks/codex-hook-adapter.ts +155 -0
  654. package/scripts/hooks/edited-cspell.ts +128 -0
  655. package/scripts/hooks/format-edited-file-fixtures.ts +109 -0
  656. package/scripts/hooks/format-edited-file.ts +510 -0
  657. package/scripts/hooks/format-rewrite-notice.ts +99 -0
  658. package/scripts/hooks/pre-push-unit.ts +146 -0
  659. package/scripts/hooks/pretool-guard.ts +96 -0
  660. package/scripts/hooks/prevent-main-commit.ts +38 -0
  661. package/scripts/hooks/prompt-hooks.ts +38 -0
  662. package/scripts/hooks/reserved-run.ts +90 -0
  663. package/scripts/hooks/stop-guard.ts +135 -0
  664. package/scripts/init/claude-plugin-config.ts +51 -0
  665. package/scripts/init/distributed-paths.ts +100 -0
  666. package/scripts/init/hook-command-rewrite.ts +85 -0
  667. package/scripts/init/hook-launch.ts +31 -0
  668. package/scripts/init/init-actions.ts +147 -0
  669. package/scripts/init/init-ai-copy.ts +235 -0
  670. package/scripts/init/init-copy-content.ts +50 -0
  671. package/scripts/init/init-logic-deploy-vps.ts +43 -0
  672. package/scripts/init/init-logic-json-merge.ts +340 -0
  673. package/scripts/init/init-logic-migrate.ts +62 -0
  674. package/scripts/init/init-logic-package-key-order.ts +50 -0
  675. package/scripts/init/init-logic-secretlint.ts +36 -0
  676. package/scripts/init/init-logic-sonar.ts +197 -0
  677. package/scripts/init/init-logic-templates.ts +142 -0
  678. package/scripts/init/init-logic-workspace.ts +59 -0
  679. package/scripts/init/init-logic-yaml-merge.ts +57 -0
  680. package/scripts/init/init-logic.ts +474 -0
  681. package/scripts/init/init-paths.ts +11 -0
  682. package/scripts/init/init-sonar.ts +32 -0
  683. package/scripts/init/init.ts +219 -0
  684. package/scripts/init/kit-base-preset.ts +60 -0
  685. package/scripts/init/plugin-install-hint.ts +47 -0
  686. package/scripts/init/tsconfig-preset-migration.ts +67 -0
  687. package/scripts/issue/baseline-measure.ts +105 -0
  688. package/scripts/issue/behavior-change-lint.ts +122 -0
  689. package/scripts/issue/defect-rate-cli.ts +167 -0
  690. package/scripts/issue/defect-rate.ts +145 -0
  691. package/scripts/issue/issue-backlinks-cli.ts +97 -0
  692. package/scripts/issue/issue-backlinks.ts +164 -0
  693. package/scripts/issue/issue-cite-cli.ts +158 -0
  694. package/scripts/issue/issue-cite.ts +102 -0
  695. package/scripts/issue/issue-comment-cli.ts +95 -0
  696. package/scripts/issue/issue-fold-cli.ts +104 -0
  697. package/scripts/issue/issue-fold-existing-cli.ts +81 -0
  698. package/scripts/issue/issue-fold-existing.ts +73 -0
  699. package/scripts/issue/issue-fold.ts +42 -0
  700. package/scripts/issue/issue-lint-cli.ts +60 -0
  701. package/scripts/issue/issue-lint.ts +26 -0
  702. package/scripts/issue/issue-logic.ts +50 -0
  703. package/scripts/issue/issue-read-cli.ts +190 -0
  704. package/scripts/issue/issue-read.ts +145 -0
  705. package/scripts/issue/issue-scout-cli.ts +482 -0
  706. package/scripts/issue/issue-scout.ts +244 -0
  707. package/scripts/issue/issue-state-cli.ts +260 -0
  708. package/scripts/issue/issue-state.ts +109 -0
  709. package/scripts/issue/markdown-section.ts +39 -0
  710. package/scripts/issue/measure-rerun-cli.ts +98 -0
  711. package/scripts/issue/reproduction-measure.ts +59 -0
  712. package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +1171 -0
  713. package/scripts/josh/agent-session-environment.ts +188 -0
  714. package/scripts/josh/cli-body.ts +96 -0
  715. package/scripts/josh/command-suggest.ts +57 -0
  716. package/scripts/josh/file-map-stamp.ts +264 -0
  717. package/scripts/josh/hook-decision.ts +479 -0
  718. package/scripts/josh/josh-command-map.ts +196 -0
  719. package/scripts/josh/josh-command-types.ts +226 -0
  720. package/scripts/josh/josh-commands-ai.ts +327 -0
  721. package/scripts/josh/josh-commands-backlog.ts +54 -0
  722. package/scripts/josh/josh-commands-clone.ts +18 -0
  723. package/scripts/josh/josh-commands-development.ts +206 -0
  724. package/scripts/josh/josh-commands-document.ts +45 -0
  725. package/scripts/josh/josh-commands-guard.ts +38 -0
  726. package/scripts/josh/josh-commands-hooks.ts +42 -0
  727. package/scripts/josh/josh-commands-issue.ts +69 -0
  728. package/scripts/josh/josh-commands-lane.ts +75 -0
  729. package/scripts/josh/josh-commands-lint.ts +37 -0
  730. package/scripts/josh/josh-commands-maintenance.ts +80 -0
  731. package/scripts/josh/josh-commands-project.ts +53 -0
  732. package/scripts/josh/josh-commands-split.ts +20 -0
  733. package/scripts/josh/josh-commands-versioning.ts +48 -0
  734. package/scripts/josh/josh-commands-workflow.ts +116 -0
  735. package/scripts/josh/josh-composite-arguments.ts +55 -0
  736. package/scripts/josh/josh-environment-file.ts +31 -0
  737. package/scripts/josh/josh-in-process.ts +80 -0
  738. package/scripts/josh/josh-logic.ts +308 -0
  739. package/scripts/josh/josh-run.ts +53 -0
  740. package/scripts/josh/josh-script-reader.ts +11 -0
  741. package/scripts/josh/josh-verdict.ts +111 -0
  742. package/scripts/josh/josh.ts +60 -0
  743. package/scripts/josh/kit-only.ts +33 -0
  744. package/scripts/josh/path-decision.ts +104 -0
  745. package/scripts/josh/platform-temporary.ts +66 -0
  746. package/scripts/josh/process-identity.ts +335 -0
  747. package/scripts/josh/session-language-cli.ts +51 -0
  748. package/scripts/josh/session-language.ts +30 -0
  749. package/scripts/josh/stamp-file.ts +194 -0
  750. package/scripts/lane/lane-await.ts +165 -0
  751. package/scripts/lane/lane-cache-run.ts +39 -0
  752. package/scripts/lane/lane-cache.ts +135 -0
  753. package/scripts/lane/lane-capacity.ts +69 -0
  754. package/scripts/lane/lane-child-invocation.ts +73 -0
  755. package/scripts/lane/lane-child-marker.ts +58 -0
  756. package/scripts/lane/lane-cli.ts +410 -0
  757. package/scripts/lane/lane-close.ts +197 -0
  758. package/scripts/lane/lane-dispatch-log.ts +13 -0
  759. package/scripts/lane/lane-dispatch.ts +458 -0
  760. package/scripts/lane/lane-environment.ts +253 -0
  761. package/scripts/lane/lane-guard-policy.ts +136 -0
  762. package/scripts/lane/lane-install.ts +94 -0
  763. package/scripts/lane/lane-launch-cli.ts +133 -0
  764. package/scripts/lane/lane-occupancy.ts +112 -0
  765. package/scripts/lane/lane-open.ts +275 -0
  766. package/scripts/lane/lane-output.ts +124 -0
  767. package/scripts/lane/lane-paths.ts +96 -0
  768. package/scripts/lane/lane-reap.ts +137 -0
  769. package/scripts/lane/lane-registry.ts +261 -0
  770. package/scripts/lane/lane-relaunch.ts +68 -0
  771. package/scripts/lane/lane-report.ts +95 -0
  772. package/scripts/lane/lane-resume.ts +61 -0
  773. package/scripts/lane/lane-seed.ts +44 -0
  774. package/scripts/lane/lane-start-point.ts +175 -0
  775. package/scripts/lane/openai-lane-supervisor-cli.ts +32 -0
  776. package/scripts/lane/openai-lane-supervisor-decision.ts +63 -0
  777. package/scripts/lane/openai-lane-supervisor.ts +337 -0
  778. package/scripts/lib/bounded-pool.ts +109 -0
  779. package/scripts/lib/buffered-process.ts +82 -0
  780. package/scripts/lib/caddy-logs.sh +45 -0
  781. package/scripts/lib/cli-flags.ts +19 -0
  782. package/scripts/lib/json-value.ts +24 -0
  783. package/scripts/lib/poll.ts +57 -0
  784. package/scripts/lib/read-file.ts +16 -0
  785. package/scripts/lib/schemas.ts +67 -0
  786. package/scripts/lib/spawn-exit.ts +45 -0
  787. package/scripts/lib/status-icons.ts +24 -0
  788. package/scripts/lines/effective-limit.ts +156 -0
  789. package/scripts/lines/line-budget.ts +404 -0
  790. package/scripts/lines/line-targets.ts +80 -0
  791. package/scripts/lines/lines-command.ts +174 -0
  792. package/scripts/lint/cspell-cached.ts +41 -0
  793. package/scripts/lint/lint-parallel.ts +72 -0
  794. package/scripts/lint/lint-related-scope.ts +128 -0
  795. package/scripts/lint/lint-related.ts +104 -0
  796. package/scripts/managed-marker/index.ts +5 -0
  797. package/scripts/managed-marker/managed-marker-logic.ts +67 -0
  798. package/scripts/observations/observation-ledger-home.ts +32 -0
  799. package/scripts/observations/observation-ledger-line.ts +93 -0
  800. package/scripts/observations/observation-ledger.ts +35 -0
  801. package/scripts/observations/observations-flush-cli.ts +42 -0
  802. package/scripts/observations/observations-flush-landing.ts +97 -0
  803. package/scripts/observations/observations-flush.ts +420 -0
  804. package/scripts/overrides/lockfile-overrides.ts +105 -0
  805. package/scripts/overrides/overrides-check.ts +84 -0
  806. package/scripts/overrides/overrides-files.ts +19 -0
  807. package/scripts/overrides/overrides-logic.ts +211 -0
  808. package/scripts/overrides/schemas.ts +49 -0
  809. package/scripts/package/package-scout-cli.ts +195 -0
  810. package/scripts/package/package-scout-format.ts +151 -0
  811. package/scripts/package/package-scout.ts +121 -0
  812. package/scripts/ports/port-command.ts +87 -0
  813. package/scripts/propagate/propagate-git-failure.ts +191 -0
  814. package/scripts/propagate/propagate-git.ts +224 -0
  815. package/scripts/propagate/propagate-publish.ts +181 -0
  816. package/scripts/propagate/propagate-run.ts +201 -0
  817. package/scripts/propagate/propagate-steps.ts +421 -0
  818. package/scripts/propagate/propagate-targets.ts +160 -0
  819. package/scripts/propagate/propagate.ts +216 -0
  820. package/scripts/refactor/import-graph.ts +187 -0
  821. package/scripts/refactor/refactor-lint.ts +250 -0
  822. package/scripts/refactor/refactor-scan-cli.ts +10 -0
  823. package/scripts/refactor/refactor-scan.ts +124 -0
  824. package/scripts/refactor/refactor-targets.ts +103 -0
  825. package/scripts/release/release-cli.ts +88 -0
  826. package/scripts/release/release-history.ts +132 -0
  827. package/scripts/release/release-plan.ts +130 -0
  828. package/scripts/release/release-publish.ts +152 -0
  829. package/scripts/release/release-scope-cli.ts +103 -0
  830. package/scripts/release/release-tag.ts +93 -0
  831. package/scripts/release/release-worktree.ts +71 -0
  832. package/scripts/repo/auto-merge-setting-logic.ts +100 -0
  833. package/scripts/repo/auto-merge-setting.ts +37 -0
  834. package/scripts/repo/repo-setting.ts +112 -0
  835. package/scripts/report/report-lint-cli.ts +49 -0
  836. package/scripts/report/report-lint.ts +250 -0
  837. package/scripts/retrospective/retrospective-cli.ts +97 -0
  838. package/scripts/retrospective/retrospective.ts +127 -0
  839. package/scripts/review/disposition-cli.ts +44 -0
  840. package/scripts/review/disposition-logic.ts +45 -0
  841. package/scripts/review/live-evidence.ts +62 -0
  842. package/scripts/review/review-attest-cli.ts +115 -0
  843. package/scripts/review/review-attest.ts +319 -0
  844. package/scripts/review/review-brief-cli.ts +290 -0
  845. package/scripts/review/review-brief.ts +440 -0
  846. package/scripts/review/review-checkout.ts +56 -0
  847. package/scripts/review/review-finding-ledger.ts +167 -0
  848. package/scripts/review/review-findings-cli.ts +57 -0
  849. package/scripts/review/review-level.ts +86 -0
  850. package/scripts/review/review-record-cli.ts +196 -0
  851. package/scripts/review/review-record.ts +74 -0
  852. package/scripts/review/review-round2-cli.ts +84 -0
  853. package/scripts/review/review-round2.ts +139 -0
  854. package/scripts/review/review-stamps.ts +113 -0
  855. package/scripts/review/review-tree.ts +58 -0
  856. package/scripts/rules/bash-triggers.ts +44 -0
  857. package/scripts/rules/decision-oracle.ts +342 -0
  858. package/scripts/rules/delivered-rules-harness.ts +72 -0
  859. package/scripts/rules/delivered-rules.ts +793 -0
  860. package/scripts/rules/early-heartbeat.ts +241 -0
  861. package/scripts/rules/file-body.ts +150 -0
  862. package/scripts/rules/filing-cap.ts +133 -0
  863. package/scripts/rules/filing-offer.ts +81 -0
  864. package/scripts/rules/firing-point.ts +63 -0
  865. package/scripts/rules/gh-api.ts +65 -0
  866. package/scripts/rules/git-argv.ts +129 -0
  867. package/scripts/rules/git-force.ts +104 -0
  868. package/scripts/rules/implementation-cut-verdict.ts +84 -0
  869. package/scripts/rules/implementation-cut.ts +202 -0
  870. package/scripts/rules/issue-citation.ts +242 -0
  871. package/scripts/rules/issue-fold.ts +73 -0
  872. package/scripts/rules/issue-scout.ts +64 -0
  873. package/scripts/rules/josh-git-bare.ts +80 -0
  874. package/scripts/rules/lane-carry-conflict.ts +96 -0
  875. package/scripts/rules/lane-interactive-ask.ts +71 -0
  876. package/scripts/rules/lane-park.ts +122 -0
  877. package/scripts/rules/lane-switch-main.ts +139 -0
  878. package/scripts/rules/oracle-consulted.ts +81 -0
  879. package/scripts/rules/oracle-firing.ts +151 -0
  880. package/scripts/rules/oracle-list-cli.ts +81 -0
  881. package/scripts/rules/piped-verification.ts +126 -0
  882. package/scripts/rules/poll-loop.ts +125 -0
  883. package/scripts/rules/pre-gate-cut.ts +207 -0
  884. package/scripts/rules/prior-comment-read.ts +106 -0
  885. package/scripts/rules/raw-field-body.ts +56 -0
  886. package/scripts/rules/reply-language.ts +116 -0
  887. package/scripts/rules/rule-body-guard.ts +206 -0
  888. package/scripts/rules/rule-guard.ts +23 -0
  889. package/scripts/rules/rule-value-cli.ts +129 -0
  890. package/scripts/rules/rule-value.ts +397 -0
  891. package/scripts/rules/run-tail.ts +178 -0
  892. package/scripts/rules/shell-body-trigger.ts +204 -0
  893. package/scripts/rules/shell-segments.ts +45 -0
  894. package/scripts/rules/stop-rules.ts +329 -0
  895. package/scripts/rules/tail-commands.ts +35 -0
  896. package/scripts/rules/test-declared-commit.ts +51 -0
  897. package/scripts/rules/third-party-write.ts +90 -0
  898. package/scripts/rules/top-level-scripts-guard.ts +47 -0
  899. package/scripts/rules/worktree-guard.ts +130 -0
  900. package/scripts/run/detached-launch.ts +360 -0
  901. package/scripts/run/run-carry-args.ts +264 -0
  902. package/scripts/run/run-carry-change.ts +69 -0
  903. package/scripts/run/run-carry-cli.ts +441 -0
  904. package/scripts/run/run-carry-flush.ts +63 -0
  905. package/scripts/run/run-carry-stash.ts +71 -0
  906. package/scripts/run/run-carry-streak.ts +113 -0
  907. package/scripts/run/run-carry.ts +550 -0
  908. package/scripts/run/run-cut-args.ts +132 -0
  909. package/scripts/run/run-cut-cli.ts +461 -0
  910. package/scripts/run/run-cut-handoff.ts +126 -0
  911. package/scripts/run/run-cut.ts +531 -0
  912. package/scripts/run/run-ending-cli.ts +111 -0
  913. package/scripts/run/run-ending.ts +239 -0
  914. package/scripts/run/run-entry-cli.ts +135 -0
  915. package/scripts/run/run-entry.ts +95 -0
  916. package/scripts/run/run-event-cli.ts +210 -0
  917. package/scripts/run/run-event-follow.ts +65 -0
  918. package/scripts/run/run-event-render.ts +75 -0
  919. package/scripts/run/run-event-scope.ts +127 -0
  920. package/scripts/run/run-event-stream-emit.ts +140 -0
  921. package/scripts/run/run-event-stream.ts +258 -0
  922. package/scripts/run/run-event-watch.ts +37 -0
  923. package/scripts/run/run-headless.ts +105 -0
  924. package/scripts/run/run-hold-cli.ts +310 -0
  925. package/scripts/run/run-hold.ts +264 -0
  926. package/scripts/run/run-invocation.ts +237 -0
  927. package/scripts/run/run-issue-number.ts +19 -0
  928. package/scripts/run/run-liveness-cli.ts +169 -0
  929. package/scripts/run/run-liveness.ts +424 -0
  930. package/scripts/run/run-merge-cli.ts +385 -0
  931. package/scripts/run/run-merge-steps.ts +326 -0
  932. package/scripts/run/run-merge.ts +158 -0
  933. package/scripts/run/run-next-cli.ts +48 -0
  934. package/scripts/run/run-next.ts +80 -0
  935. package/scripts/run/run-preflight.ts +337 -0
  936. package/scripts/run/run-prep-cli.ts +151 -0
  937. package/scripts/run/run-prep.ts +84 -0
  938. package/scripts/run/run-progress-args.ts +65 -0
  939. package/scripts/run/run-progress-cli.ts +508 -0
  940. package/scripts/run/run-progress-clock.ts +320 -0
  941. package/scripts/run/run-progress-config.ts +119 -0
  942. package/scripts/run/run-progress-read.ts +199 -0
  943. package/scripts/run/run-progress.ts +366 -0
  944. package/scripts/run/run-report-cli.ts +71 -0
  945. package/scripts/run/run-report.ts +78 -0
  946. package/scripts/run/run-review-cli.ts +130 -0
  947. package/scripts/run/run-review-steps.ts +161 -0
  948. package/scripts/run/run-review.ts +121 -0
  949. package/scripts/run/run-ship-cli.ts +431 -0
  950. package/scripts/run/run-ship-detach.ts +200 -0
  951. package/scripts/run/run-ship-probe.ts +103 -0
  952. package/scripts/run/run-ship-return.ts +75 -0
  953. package/scripts/run/run-ship-review-steps.ts +227 -0
  954. package/scripts/run/run-ship-review.ts +177 -0
  955. package/scripts/run/run-ship-stage.ts +150 -0
  956. package/scripts/run/run-ship.ts +78 -0
  957. package/scripts/run/run-status-cli.ts +175 -0
  958. package/scripts/run/run-status.ts +77 -0
  959. package/scripts/run/run-step-cli.ts +111 -0
  960. package/scripts/run/run-step.ts +292 -0
  961. package/scripts/run/run-stop-notify.ts +52 -0
  962. package/scripts/run/run-stranded-cli.ts +31 -0
  963. package/scripts/run/run-stranded-detect.ts +134 -0
  964. package/scripts/run/run-stranded.ts +120 -0
  965. package/scripts/run/run-tail-cli.ts +105 -0
  966. package/scripts/run/run-tail.ts +61 -0
  967. package/scripts/run/run-transcript.golden.txt +57 -0
  968. package/scripts/run/run-wake-cli.ts +428 -0
  969. package/scripts/run/run-wake-describe.ts +97 -0
  970. package/scripts/run/run-wake-driver.ts +80 -0
  971. package/scripts/run/run-wake-handoff.ts +29 -0
  972. package/scripts/run/run-wake-loop.ts +223 -0
  973. package/scripts/run/run-wake-session.ts +150 -0
  974. package/scripts/run/run-wake-work.ts +104 -0
  975. package/scripts/run/run-wake.ts +607 -0
  976. package/scripts/run/run-watcher-guard-cli.ts +37 -0
  977. package/scripts/run/run-watcher-guard.ts +59 -0
  978. package/scripts/run/run-watcher-hook.ts +86 -0
  979. package/scripts/security/secretlint-scan.ts +86 -0
  980. package/scripts/security/security-audit-logic.ts +51 -0
  981. package/scripts/security/security-audit-provision-logic.ts +217 -0
  982. package/scripts/security/security-audit-provision.ts +186 -0
  983. package/scripts/security/security-audit.ts +132 -0
  984. package/scripts/security/security-updates-logic.ts +131 -0
  985. package/scripts/security/security-updates.ts +38 -0
  986. package/scripts/security/sonar-file.ts +44 -0
  987. package/scripts/self-sync-guard/index.ts +5 -0
  988. package/scripts/self-sync-guard/self-sync-guard-logic.ts +98 -0
  989. package/scripts/self-sync-guard/self-sync-refusal.ts +22 -0
  990. package/scripts/sonar/sonar-hotspots-cli.ts +149 -0
  991. package/scripts/sonar/sonar-hotspots.ts +111 -0
  992. package/scripts/split/split-assess-cli.ts +52 -0
  993. package/scripts/split/split-assess.ts +124 -0
  994. package/scripts/sync/dependabot-pin-logic.ts +135 -0
  995. package/scripts/sync/directory-copy-guard.ts +187 -0
  996. package/scripts/sync/file-content.ts +49 -0
  997. package/scripts/sync/managed-config-scope-cli.ts +64 -0
  998. package/scripts/sync/managed-config-scope.ts +123 -0
  999. package/scripts/sync/plugin-skill-directories.ts +15 -0
  1000. package/scripts/sync/reconcile-templates.ts +53 -0
  1001. package/scripts/sync/removed-skill-manifest.ts +27 -0
  1002. package/scripts/sync/skill-migration.ts +192 -0
  1003. package/scripts/sync/sync-configs.ts +156 -0
  1004. package/scripts/sync/sync-hook-safety.ts +82 -0
  1005. package/scripts/sync/sync.ts +417 -0
  1006. package/scripts/sync/synced-paths.ts +52 -0
  1007. package/scripts/sync/template-source-logic.ts +122 -0
  1008. package/scripts/sync/workflow-pin-logic.ts +240 -0
  1009. package/scripts/test/classify-isolation.ts +149 -0
  1010. package/scripts/test/e2e-retry-check.ts +150 -0
  1011. package/scripts/test/http-fault-injection.ts +79 -0
  1012. package/scripts/test/josh-harness-environment.ts +260 -0
  1013. package/scripts/test/josh-harness.ts +96 -0
  1014. package/scripts/test/pilot-files.ts +457 -0
  1015. package/scripts/test/pilot-measure.ts +78 -0
  1016. package/scripts/test/test-declared-changed.ts +99 -0
  1017. package/scripts/test/test-declared-logic.ts +91 -0
  1018. package/scripts/test/test-declared-match.ts +106 -0
  1019. package/scripts/test/test-declared.ts +180 -0
  1020. package/scripts/test/test-e2e-guard.ts +86 -0
  1021. package/scripts/test/test-network-guard.ts +453 -0
  1022. package/scripts/test/test-red-commit.ts +51 -0
  1023. package/scripts/test/test-red-logic.ts +76 -0
  1024. package/scripts/test/test-red.ts +154 -0
  1025. package/scripts/test/test-related-scope.ts +115 -0
  1026. package/scripts/test/test-related.ts +73 -0
  1027. package/scripts/test/test-repository-guard.ts +317 -0
  1028. package/scripts/test/test-state-guard.ts +85 -0
  1029. package/scripts/test/test-stdout-guard.ts +54 -0
  1030. package/scripts/test/test-telegram-guard.ts +90 -0
  1031. package/scripts/test/test-type-logic.ts +31 -0
  1032. package/scripts/test/test-unit-guard.ts +185 -0
  1033. package/scripts/test/unit-guard-environment.ts +12 -0
  1034. package/scripts/test/unit-projects.ts +139 -0
  1035. package/scripts/test/unit-worker-share.ts +251 -0
  1036. package/scripts/test/vitest-include-globs.ts +12 -0
  1037. package/scripts/time-runtime/time-agent-bundles.ts +128 -0
  1038. package/scripts/time-runtime/time-background.ts +300 -0
  1039. package/scripts/time-runtime/time-batch-guard-fixtures.ts +66 -0
  1040. package/scripts/time-runtime/time-batch-guard.ts +529 -0
  1041. package/scripts/time-runtime/time-bundle-call.ts +575 -0
  1042. package/scripts/time-runtime/time-bundles.ts +536 -0
  1043. package/scripts/time-runtime/time-call-identity.ts +37 -0
  1044. package/scripts/time-runtime/time-command-key.ts +35 -0
  1045. package/scripts/time-runtime/time-density-hook.ts +166 -0
  1046. package/scripts/time-runtime/time-density.ts +147 -0
  1047. package/scripts/time-runtime/time-followup-stage.ts +107 -0
  1048. package/scripts/time-runtime/time-format.ts +186 -0
  1049. package/scripts/time-runtime/time-hook-transcript.ts +82 -0
  1050. package/scripts/time-runtime/time-instant.ts +20 -0
  1051. package/scripts/time-runtime/time-markers.ts +228 -0
  1052. package/scripts/time-runtime/time-phase-names.ts +123 -0
  1053. package/scripts/time-runtime/time-reported-failure.ts +227 -0
  1054. package/scripts/time-runtime/time-round-trips.ts +279 -0
  1055. package/scripts/time-runtime/time-shell.ts +286 -0
  1056. package/scripts/time-runtime/time-single-check.ts +65 -0
  1057. package/scripts/time-runtime/time-spans.ts +545 -0
  1058. package/scripts/time-runtime/time-transcript-line.ts +253 -0
  1059. package/scripts/time-runtime/time-writes.ts +71 -0
  1060. package/scripts/ui/ui-routes-cli.ts +122 -0
  1061. package/scripts/ui/ui-routes.ts +102 -0
  1062. package/scripts/version/bump-version.ts +71 -0
  1063. package/scripts/version/effective-upstream.ts +93 -0
  1064. package/scripts/version/index.ts +25 -0
  1065. package/scripts/version/kit-descriptor.ts +10 -0
  1066. package/scripts/version/kit-version-config.ts +30 -0
  1067. package/scripts/version/latest-corepack.ts +404 -0
  1068. package/scripts/version/latest-lane-guard.ts +49 -0
  1069. package/scripts/version/latest-regression.ts +93 -0
  1070. package/scripts/version/latest-scope-cli.ts +147 -0
  1071. package/scripts/version/latest-stamp.ts +107 -0
  1072. package/scripts/version/latest-update.ts +198 -0
  1073. package/scripts/version/package-manager-version.ts +95 -0
  1074. package/scripts/version/parse-json.ts +13 -0
  1075. package/scripts/version/preinstall-version-update.ts +84 -0
  1076. package/scripts/version/publishable-range-check.ts +74 -0
  1077. package/scripts/version/publishable-range.ts +123 -0
  1078. package/scripts/version/release-age.ts +146 -0
  1079. package/scripts/version/release-hold.ts +142 -0
  1080. package/scripts/version/running-binary.ts +42 -0
  1081. package/scripts/version/upgrade-command-guard.ts +49 -0
  1082. package/scripts/version/upgrade-shell-command.ts +30 -0
  1083. package/scripts/version/version-check-logic.ts +333 -0
  1084. package/scripts/version/version-check.ts +14 -0
  1085. package/scripts/version/version-command-config.ts +177 -0
  1086. package/scripts/version/version-commands.ts +296 -0
  1087. package/scripts/version/version-remote.ts +86 -0
  1088. package/scripts/version/version-targets.ts +81 -0
  1089. package/scripts/yaml/yaml-document.ts +46 -0
  1090. package/scripts-ai/completion-gate.ts +13 -0
  1091. package/scripts-ai/environment-loader.ts +9 -0
  1092. package/scripts-ai/epic-check.ts +34 -0
  1093. package/scripts-ai/epic-cli-argv.ts +77 -0
  1094. package/scripts-ai/epic-cli-remove.ts +71 -0
  1095. package/scripts-ai/epic-cli.ts +413 -0
  1096. package/scripts-ai/epic.ts +192 -0
  1097. package/scripts-ai/followup-issue-number.ts +31 -0
  1098. package/scripts-ai/git-followup-finish.ts +217 -0
  1099. package/scripts-ai/git-followup-workflow.ts +252 -0
  1100. package/scripts-ai/git-workflow.ts +246 -0
  1101. package/scripts-ai/telegram-test-logic.ts +88 -0
  1102. package/scripts-ai/telegram-test.ts +130 -0
  1103. package/templates/gitignore +76 -0
  1104. package/templates/sonar-project.properties +52 -0
  1105. package/templates/workflows/ci.yml +639 -0
  1106. package/templates/workflows/dependabot-auto-merge.yml +428 -0
  1107. package/tsconfig/base.json +50 -0
  1108. package/tsconfig.sonar.json +34 -0
package/dist/josh.js ADDED
@@ -0,0 +1,1795 @@
1
+ #!/usr/bin/env node
2
+
3
+ // scripts/doctor/doctor-consumer.ts
4
+ import { existsSync, readFileSync } from "node:fs";
5
+ import path from "node:path";
6
+
7
+ // scripts/lib/spawn-exit.ts
8
+ var SPAWN_ERROR_EXIT_CODE = 2;
9
+ var SIGNAL_KILL_EXIT_CODE = 1;
10
+ function resolve_spawn_exit(executable, result) {
11
+ if (result.exitCode !== void 0) return result.exitCode;
12
+ if (result.isTerminated === true) return SIGNAL_KILL_EXIT_CODE;
13
+ console.error(`Failed to execute ${executable}: ${result.shortMessage ?? "spawn failed"}`);
14
+ return SPAWN_ERROR_EXIT_CODE;
15
+ }
16
+ function read_spawn_stdout(result) {
17
+ return result.stdout ?? "";
18
+ }
19
+
20
+ // scripts/version/kit-descriptor.ts
21
+ var KIT_PACKAGE_NAME = "@joshuafolkken/kit";
22
+
23
+ // scripts/version/parse-json.ts
24
+ function safe_json_parse(raw) {
25
+ try {
26
+ return JSON.parse(raw);
27
+ } catch {
28
+ return void 0;
29
+ }
30
+ }
31
+
32
+ // scripts/doctor/doctor-consumer.ts
33
+ import { execaSync } from "execa";
34
+ import { z } from "zod";
35
+ var NODE_MODULES = "node_modules";
36
+ var SETTINGS_PATH = path.join(".claude", "settings.json");
37
+ var CLAUDE_MD = "CLAUDE.md";
38
+ var PLUGIN_ID = "kit@kit";
39
+ var CLAUDE_MD_POINTER = `@${NODE_MODULES}/${KIT_PACKAGE_NAME}/dist/${CLAUDE_MD}`;
40
+ var SECRETLINT_BIN = path.join(NODE_MODULES, ".bin", "secretlint");
41
+ var GIT_TIMEOUT_MS = 2e3;
42
+ var manifest_schema = z.object({
43
+ name: z.string().optional(),
44
+ dependencies: z.record(z.string(), z.string()).optional(),
45
+ devDependencies: z.record(z.string(), z.string()).optional()
46
+ });
47
+ var settings_schema = z.object({
48
+ enabledPlugins: z.record(z.string(), z.boolean()).optional()
49
+ });
50
+ var STATE_OK = "ok";
51
+ var STATE_TARGET_MISSING = "target-missing";
52
+ var STATE_MISSING = "missing";
53
+ function read_optional(file_path) {
54
+ try {
55
+ return existsSync(file_path) ? readFileSync(file_path, "utf8") : void 0;
56
+ } catch {
57
+ return void 0;
58
+ }
59
+ }
60
+ function parse_manifest(root) {
61
+ const content = read_optional(path.join(root, "package.json"));
62
+ if (content === void 0) return void 0;
63
+ const parsed = manifest_schema.safeParse(safe_json_parse(content));
64
+ return parsed.success ? parsed.data : void 0;
65
+ }
66
+ function lists_kit_dependency(manifest) {
67
+ if (manifest === void 0) return false;
68
+ return Object.hasOwn(manifest.dependencies ?? {}, KIT_PACKAGE_NAME) || Object.hasOwn(manifest.devDependencies ?? {}, KIT_PACKAGE_NAME);
69
+ }
70
+ function is_kit_consumer(root) {
71
+ const manifest = parse_manifest(root);
72
+ if (manifest?.name === KIT_PACKAGE_NAME) return false;
73
+ return lists_kit_dependency(manifest) || existsSync(path.join(root, NODE_MODULES, KIT_PACKAGE_NAME));
74
+ }
75
+ function is_plugin_declared(root) {
76
+ const content = read_optional(path.join(root, SETTINGS_PATH));
77
+ if (content === void 0) return false;
78
+ const parsed = settings_schema.safeParse(safe_json_parse(content));
79
+ return parsed.success && parsed.data.enabledPlugins?.[PLUGIN_ID] === true;
80
+ }
81
+ function configured_hooks_path(root) {
82
+ const result = execaSync("git", ["-C", root, "config", "--get", "core.hooksPath"], {
83
+ reject: false,
84
+ timeout: GIT_TIMEOUT_MS
85
+ });
86
+ const value = read_spawn_stdout(result).trim();
87
+ return value === "" ? void 0 : value;
88
+ }
89
+ function claude_md_state(root) {
90
+ const content = read_optional(path.join(root, CLAUDE_MD));
91
+ if (content === void 0) return STATE_MISSING;
92
+ if (!content.includes(CLAUDE_MD_POINTER)) return STATE_OK;
93
+ return existsSync(path.join(root, NODE_MODULES, KIT_PACKAGE_NAME, "dist", CLAUDE_MD)) ? STATE_OK : STATE_TARGET_MISSING;
94
+ }
95
+ function is_secretlint_runnable(root) {
96
+ return existsSync(path.join(root, SECRETLINT_BIN));
97
+ }
98
+ function status_line(is_ok, ok_text, warn_text) {
99
+ return is_ok ? ` \u2713 ${ok_text}` : ` \u26A0 ${warn_text}`;
100
+ }
101
+ function plugin_line(is_declared) {
102
+ return status_line(
103
+ is_declared,
104
+ `kit plugin declared (run \`claude plugin install ${PLUGIN_ID}\` once if skills are missing)`,
105
+ "kit plugin not declared in .claude/settings.json \u2014 run `pnpm josh sync`"
106
+ );
107
+ }
108
+ function hooks_path_line(hooks_path) {
109
+ return status_line(
110
+ hooks_path === void 0,
111
+ "git hooks install normally (core.hooksPath unset)",
112
+ `core.hooksPath is set (${hooks_path ?? ""}) \u2014 lefthook installs no git hooks; unset it`
113
+ );
114
+ }
115
+ function claude_md_line(state) {
116
+ if (state === STATE_OK) return " \u2713 CLAUDE.md resolves to the installed kit rules";
117
+ if (state === STATE_TARGET_MISSING) {
118
+ return " \u26A0 CLAUDE.md points at rules that are not installed \u2014 run `pnpm install`";
119
+ }
120
+ return " \u26A0 CLAUDE.md is missing \u2014 run `pnpm josh init`";
121
+ }
122
+ function secretlint_line(is_runnable) {
123
+ return status_line(
124
+ is_runnable,
125
+ "secretlint is runnable",
126
+ "secretlint is not installed \u2014 run `pnpm install`"
127
+ );
128
+ }
129
+ function consumer_setup_lines(root) {
130
+ return [
131
+ plugin_line(is_plugin_declared(root)),
132
+ hooks_path_line(configured_hooks_path(root)),
133
+ claude_md_line(claude_md_state(root)),
134
+ secretlint_line(is_secretlint_runnable(root))
135
+ ];
136
+ }
137
+ function report_consumer_setup(root) {
138
+ if (!is_kit_consumer(root)) return;
139
+ console.info("");
140
+ console.info("Consumer setup:");
141
+ for (const line of consumer_setup_lines(root)) console.info(line);
142
+ }
143
+ var doctor_consumer = {
144
+ claude_md_line,
145
+ claude_md_state,
146
+ configured_hooks_path,
147
+ consumer_setup_lines,
148
+ hooks_path_line,
149
+ is_kit_consumer,
150
+ is_plugin_declared,
151
+ is_secretlint_runnable,
152
+ plugin_line,
153
+ report_consumer_setup,
154
+ secretlint_line
155
+ };
156
+
157
+ // scripts/josh/josh-logic.ts
158
+ import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
159
+ import path3 from "node:path";
160
+ import { fileURLToPath } from "node:url";
161
+
162
+ // scripts/build/local-bin.ts
163
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
164
+ import { createRequire } from "node:module";
165
+ import path2 from "node:path";
166
+
167
+ // scripts/lib/schemas.ts
168
+ import { z as z2 } from "zod";
169
+ var overrides_snapshot_schema = z2.record(z2.string(), z2.string());
170
+ var package_version_schema = z2.object({ version: z2.string() });
171
+ var package_named_version_schema = z2.looseObject({ name: z2.string(), version: z2.string() });
172
+ var package_with_version_schema = z2.looseObject({ version: z2.string() });
173
+ var ls_global_dependency_schema = z2.looseObject({ version: z2.string() });
174
+ var ls_global_dependencies_schema = z2.record(z2.string(), ls_global_dependency_schema).optional();
175
+ var pnpm_ls_global_schema = z2.array(
176
+ z2.looseObject({
177
+ dependencies: ls_global_dependencies_schema
178
+ })
179
+ );
180
+ var vscode_settings_schema = z2.record(z2.string(), z2.unknown());
181
+ var with_scripts_schema = z2.looseObject({
182
+ scripts: z2.record(z2.string(), z2.string()).optional()
183
+ });
184
+ var with_development_deps_schema = z2.looseObject({
185
+ devDependencies: z2.record(z2.string(), z2.string()).optional()
186
+ });
187
+ var with_package_manager_schema = z2.looseObject({
188
+ packageManager: z2.string().optional()
189
+ });
190
+ var with_development_engine_schema = z2.looseObject({
191
+ devEngines: z2.record(z2.string(), z2.unknown()).optional()
192
+ });
193
+ var bin_entry_schema = z2.union([z2.string(), z2.record(z2.string(), z2.string())]).optional();
194
+ var package_bin_schema = z2.looseObject({ bin: bin_entry_schema });
195
+ var json_object_schema = z2.record(z2.string(), z2.unknown());
196
+ var string_array_schema = z2.array(z2.string());
197
+ var string_record_schema = z2.record(z2.string(), z2.string());
198
+
199
+ // scripts/build/local-bin.ts
200
+ var NODE_MODULES2 = "node_modules";
201
+ var BIN_DIR = ".bin";
202
+ var WINDOWS_PLATFORM = "win32";
203
+ var WINDOWS_SHIM_SUFFIX = ".cmd";
204
+ var PACKAGE_JSON = "package.json";
205
+ function resolve_local_bin(project_root, bin_name) {
206
+ const shim = process.platform === WINDOWS_PLATFORM ? `${bin_name}${WINDOWS_SHIM_SUFFIX}` : bin_name;
207
+ return path2.join(project_root, NODE_MODULES2, BIN_DIR, shim);
208
+ }
209
+ function read_bin_entry(manifest_path, package_name, bin_name) {
210
+ const { bin } = package_bin_schema.parse(JSON.parse(readFileSync2(manifest_path, "utf8")));
211
+ if (typeof bin === "string") return bin_name === path2.basename(package_name) ? bin : void 0;
212
+ return bin?.[bin_name];
213
+ }
214
+ function resolve_package_bin(base_directory, package_name, bin_name) {
215
+ try {
216
+ const resolve_from = createRequire(path2.join(base_directory, PACKAGE_JSON));
217
+ const manifest_path = resolve_from.resolve(`${package_name}/${PACKAGE_JSON}`);
218
+ const bin_entry = read_bin_entry(manifest_path, package_name, bin_name);
219
+ if (bin_entry === void 0) return void 0;
220
+ const cli_entry = path2.join(path2.dirname(manifest_path), bin_entry);
221
+ return existsSync2(cli_entry) ? cli_entry : void 0;
222
+ } catch {
223
+ return void 0;
224
+ }
225
+ }
226
+
227
+ // scripts/josh/josh-logic.ts
228
+ import { execaSync as execaSync2 } from "execa";
229
+
230
+ // scripts/josh/command-suggest.ts
231
+ var MAX_SUGGESTION_DISTANCE = 3;
232
+ function at(values, index) {
233
+ return values[index] ?? 0;
234
+ }
235
+ function fill_distance_row(source, target, row, previous) {
236
+ const current = [row];
237
+ for (let col = 1; col <= target.length; col++) {
238
+ const cost = source[row - 1] === target[col - 1] ? 0 : 1;
239
+ const deletion = at(previous, col) + 1;
240
+ const insertion = at(current, col - 1) + 1;
241
+ const substitution = at(previous, col - 1) + cost;
242
+ current.push(Math.min(deletion, insertion, substitution));
243
+ }
244
+ return current;
245
+ }
246
+ function edit_distance(source, target) {
247
+ let previous = Array.from({ length: target.length + 1 }, (_unused, index) => index);
248
+ for (let row = 1; row <= source.length; row++) {
249
+ previous = fill_distance_row(source, target, row, previous);
250
+ }
251
+ return at(previous, target.length);
252
+ }
253
+ function closest_command(input, commands) {
254
+ const within = commands.map((command) => ({ command, distance: edit_distance(input, command) })).filter((scored) => scored.distance <= MAX_SUGGESTION_DISTANCE).toSorted((left, right) => left.distance - right.distance);
255
+ return within[0]?.command;
256
+ }
257
+ var command_suggest = { closest_command, edit_distance };
258
+
259
+ // ports/index.js
260
+ var ENV_FILE_NAME = ".env";
261
+
262
+ // scripts/josh/josh-command-types.ts
263
+ var OPTIONAL_ENV_FILE_FLAGS = [`--env-file-if-exists=${ENV_FILE_NAME}`];
264
+ var GATE_COMMAND = "gate";
265
+ var PE = ["pnpm", "exec"];
266
+ var ESLINT_CACHE_FILE = ".eslintcache";
267
+ var TS_BUILD_INFO_FILE = ".tsbuildinfo";
268
+ var CSPELL_CACHE_FILE = ".cspellcache";
269
+ var ESLINT_EDIT_CACHE_FILE = ".eslintcache.edit";
270
+ var ESLINT_RELATED_CACHE_FILE = ".eslintcache.related";
271
+ var ROOTED_JSON_PORTABILITY = "rooted-json";
272
+ var ESLINT_CACHE_SPEC = {
273
+ cache_file: ESLINT_CACHE_FILE,
274
+ portability: ROOTED_JSON_PORTABILITY
275
+ };
276
+ var TS_CACHE_SPEC = {
277
+ cache_file: TS_BUILD_INFO_FILE,
278
+ portability: "raw"
279
+ };
280
+ var CSPELL_CACHE_SPEC = {
281
+ cache_file: CSPELL_CACHE_FILE,
282
+ portability: "raw"
283
+ };
284
+ var GATE_CACHE_SPECS = [
285
+ ESLINT_CACHE_SPEC,
286
+ TS_CACHE_SPEC,
287
+ CSPELL_CACHE_SPEC
288
+ ];
289
+ var GATE_CACHE_FILES = GATE_CACHE_SPECS.map((spec) => spec.cache_file);
290
+ var IGNORED_CACHE_FILES = [
291
+ ...GATE_CACHE_FILES,
292
+ ESLINT_EDIT_CACHE_FILE,
293
+ ESLINT_RELATED_CACHE_FILE
294
+ ];
295
+ var CONTENT_CACHE_FLAGS = ["--cache", "--cache-strategy", "content"];
296
+ var CACHE_LOCATION_FLAG = "--cache-location";
297
+ function content_cache_flags(cache_file) {
298
+ return [...CONTENT_CACHE_FLAGS, CACHE_LOCATION_FLAG, cache_file];
299
+ }
300
+ var ESLINT_CACHE_FLAGS = content_cache_flags(ESLINT_CACHE_FILE);
301
+ var ESLINT_EDIT_CACHE_FLAGS = content_cache_flags(ESLINT_EDIT_CACHE_FILE);
302
+ var ESLINT_RELATED_CACHE_FLAGS = content_cache_flags(ESLINT_RELATED_CACHE_FILE);
303
+ var TS_CACHE_FLAGS = ["--incremental", "--tsBuildInfoFile", TS_BUILD_INFO_FILE];
304
+ var CSPELL_CACHE_FLAGS = content_cache_flags(CSPELL_CACHE_FILE);
305
+
306
+ // scripts/josh/josh-commands-backlog.ts
307
+ var BACKLOG_COMMANDS = {
308
+ "backlog:next": {
309
+ script: "scripts/backlog/backlog-next.ts",
310
+ description: "Order the whole opted-in backlog: auto-ok issues and the descendants of auto-ok epics, transitively through nested epics",
311
+ category: "AI tools",
312
+ reference: ["[--exclude <n>[,<n>...]] [--repo <owner/repo>]", "automation", ["network"]]
313
+ },
314
+ "backlog:offer": {
315
+ script: "scripts/backlog/backlog-offer-cli.ts",
316
+ description: "Collapse a backlogrun loop-head event into one call: read backlog:next, ask backlog:budget, return the verdict and any issues to start",
317
+ category: "AI tools",
318
+ reference: ["[options]", "automation", ["network"]]
319
+ },
320
+ "backlog:drive": {
321
+ script: "scripts/backlog/backlog-drive-cli.ts",
322
+ description: "Drive backlogrun through offer, launch and merge; restore this run\u2019s lanes and report when complete",
323
+ category: "AI tools",
324
+ reference: ["--owner <pid> [options]", "automation", ["network"]]
325
+ },
326
+ "backlog:plan": {
327
+ script: "scripts/backlog/backlog-plan-cli.ts",
328
+ description: "Print the whole backlog as a plan: ready now, waiting on what, waiting on a person, out of scope",
329
+ category: "AI tools",
330
+ reference: ["[issue...] [--only]", "automation", ["network"]]
331
+ },
332
+ "backlog:stalled": {
333
+ script: "scripts/backlog/backlog-stalled-cli.ts",
334
+ description: "Report whether ready backlog work is sitting undispatched with a free lane and no recent dispatch",
335
+ category: "AI tools",
336
+ reference: ["", "automation", ["network"]]
337
+ },
338
+ "backlog:budget": {
339
+ script: "scripts/backlog/backlog-budget-cli.ts",
340
+ description: "Say whether a backlogrun may start more work, keep watching, or finish",
341
+ category: "AI tools",
342
+ reference: ["[options]", "automation", ["none"]]
343
+ }
344
+ };
345
+
346
+ // scripts/josh/josh-commands-document.ts
347
+ var DOCUMENT_COMMANDS = {
348
+ "doc:section": {
349
+ script: "scripts/document/document-section-cli.ts",
350
+ description: 'Print one section of a markdown document, for a `file.md` \u2192 "Heading" reference',
351
+ category: "AI tools",
352
+ reference: ["<file> <heading>", "automation", ["none"]]
353
+ },
354
+ "read:set": {
355
+ script: "scripts/document/read-set-cli.ts",
356
+ description: "Print what an entry point reads before it starts, and what that read costs",
357
+ category: "AI tools",
358
+ reference: ["[<entry>] [--json]", "automation", ["none"]]
359
+ },
360
+ "doc:read": {
361
+ script: "scripts/document/document-read-cli.ts",
362
+ description: "Read a whole document safely: print it, or point at the Read tool when over the Bash cap",
363
+ category: "AI tools",
364
+ reference: ["<file>", "automation", ["none"]]
365
+ },
366
+ "read:files": {
367
+ script: "scripts/document/read-files-cli.ts",
368
+ description: "Read several files in one call so edit targets fold into one turn",
369
+ category: "AI tools",
370
+ reference: ["<path> [<path> ...]", "automation", ["none"]]
371
+ },
372
+ "edit:files": {
373
+ script: "scripts/document/edit-files-cli.ts",
374
+ description: "Apply several content-addressed edits from a plan in one call",
375
+ category: "AI tools",
376
+ reference: ["<plan-path | ->", "automation", ["none"]]
377
+ }
378
+ };
379
+
380
+ // scripts/josh/josh-commands-guard.ts
381
+ var GUARD_COMMANDS = {
382
+ "investigation:guard": {
383
+ script: "scripts/delegation/investigation-guard.ts",
384
+ description: "Claude Code hook: refuse a read once the unedited-read threshold is reached again (reads the tool call on stdin)",
385
+ category: "AI tools",
386
+ reference: ["", "automation", ["none"]]
387
+ },
388
+ "duplicate-read:guard": {
389
+ script: "scripts/delegation/duplicate-read-guard.ts",
390
+ description: "Claude Code hook: refuse a second whole-file read of a path whose content has not changed since the run last read it (reads the tool call on stdin)",
391
+ category: "AI tools",
392
+ reference: ["", "automation", ["none"]]
393
+ },
394
+ "rule:guard": {
395
+ script: "scripts/rules/rule-guard.ts",
396
+ description: "Claude Code hook: deliver a trigger-delivered rule at the call that binds it (reads the tool call on stdin)",
397
+ category: "AI tools",
398
+ reference: ["", "automation", ["none"]]
399
+ }
400
+ };
401
+
402
+ // scripts/josh/josh-commands-issue.ts
403
+ var ISSUES_WITH_REPO = "<issue...> [--repo <owner/repo>]";
404
+ var ISSUE_COMMANDS = {
405
+ "issue:read": {
406
+ script: "scripts/issue/issue-read-cli.ts",
407
+ description: "Print each issue's title, body and every comment on it, in one call",
408
+ category: "AI tools",
409
+ reference: ["<issue...>", "automation", ["network"]]
410
+ },
411
+ "issue:state": {
412
+ script: "scripts/issue/issue-state-cli.ts",
413
+ description: "Print each issue's state and labels, in the spelling the documents compare against",
414
+ category: "AI tools",
415
+ reference: [ISSUES_WITH_REPO, "automation", ["network"]]
416
+ },
417
+ "issue:scout": {
418
+ script: "scripts/issue/issue-scout-cli.ts",
419
+ description: "Before filing: say whether an issue like this exists and which epic it belongs to",
420
+ category: "AI tools",
421
+ reference: ["<title> [--body <summary>]", "automation", ["network"]]
422
+ },
423
+ "defect:rate": {
424
+ script: "scripts/issue/defect-rate-cli.ts",
425
+ description: "Print the defect rate of merged work: defects filed per behavior change completed",
426
+ category: "AI tools",
427
+ reference: ["[--days <n>]", "automation", ["network"]]
428
+ },
429
+ "issue:fold": {
430
+ script: "scripts/issue/issue-fold-cli.ts",
431
+ description: "Before a second filing: say whether findings from this session fold into one issue",
432
+ category: "AI tools",
433
+ reference: ["<title>... [--not-separable] [--json]", "automation", ["none"]]
434
+ },
435
+ "issue:fold-existing": {
436
+ script: "scripts/issue/issue-fold-existing-cli.ts",
437
+ description: "Assess whether a complete draft can join an unstarted issue",
438
+ category: "AI tools",
439
+ reference: ["<assessment.json>", "automation", ["none"]]
440
+ },
441
+ "issue:cite": {
442
+ script: "scripts/issue/issue-cite-cli.ts",
443
+ description: "Print the paste-ready number-link citation line for each issue, in one call",
444
+ category: "AI tools",
445
+ reference: [ISSUES_WITH_REPO, "automation", ["network"]]
446
+ },
447
+ "issue:comment": {
448
+ script: "scripts/issue/issue-comment-cli.ts",
449
+ description: "Post one comment to an issue from a file, so no shell expands the body",
450
+ category: "AI tools",
451
+ reference: ["<issue> --body <text> | --body-file <path>", "automation", ["network"]]
452
+ }
453
+ };
454
+
455
+ // scripts/josh/josh-commands-lane.ts
456
+ var LANE_SCRIPT = "scripts/lane/lane-cli.ts";
457
+ var LANE_ARGUMENTS = { script: LANE_SCRIPT, tsx_arguments: OPTIONAL_ENV_FILE_FLAGS };
458
+ var ISSUE_WITH_OPTIONS = "<issue> [options]";
459
+ var LANE_COMMANDS = {
460
+ "lane:open": {
461
+ ...LANE_ARGUMENTS,
462
+ description: "Open a lane: a linked work tree with its own branch and its own port seed",
463
+ category: "AI tools",
464
+ reference: [ISSUE_WITH_OPTIONS, "automation", ["files", "git"]],
465
+ default_script_arguments: ["open"]
466
+ },
467
+ "lane:close": {
468
+ ...LANE_ARGUMENTS,
469
+ description: "Close a lane, leaving no work tree, branch or directory behind",
470
+ category: "AI tools",
471
+ reference: ["<issue>", "automation", ["files", "git"]],
472
+ default_script_arguments: ["close"]
473
+ },
474
+ "lane:list": {
475
+ ...LANE_ARGUMENTS,
476
+ description: "List the open lanes: which issue, which ports, and where each one is",
477
+ category: "AI tools",
478
+ reference: ["", "automation", ["none"]],
479
+ default_script_arguments: ["list"]
480
+ },
481
+ "lane:prune": {
482
+ ...LANE_ARGUMENTS,
483
+ description: "Close every lane an interruption left without its work tree",
484
+ category: "AI tools",
485
+ reference: ["", "automation", ["files", "git"]],
486
+ default_script_arguments: ["prune"]
487
+ },
488
+ "lane:output": {
489
+ ...LANE_ARGUMENTS,
490
+ description: "Record, or read back, where the unit running a lane\u2019s child writes",
491
+ category: "AI tools",
492
+ reference: ["<issue> [path]", "automation", ["files"]],
493
+ default_script_arguments: ["output"]
494
+ },
495
+ "lane:dispatch": {
496
+ ...LANE_ARGUMENTS,
497
+ description: "Start a lane\u2019s child as a detached process that outlives this session",
498
+ category: "AI tools",
499
+ reference: ["<issue> <prompt>", "automation", ["processes"]],
500
+ default_script_arguments: ["dispatch"]
501
+ },
502
+ "lane:await": {
503
+ ...LANE_ARGUMENTS,
504
+ description: "Block until any of the named in-flight lane children completes; prints which one finished",
505
+ category: "AI tools",
506
+ reference: ["<issue> [<issue>...]", "automation", ["processes"]],
507
+ default_script_arguments: ["await"]
508
+ },
509
+ "lane:launch": {
510
+ script: "scripts/lane/lane-launch-cli.ts",
511
+ description: "Collapse a backlogrun lane-start event into one call: open the lane, pop and re-install on the first, dispatch the child",
512
+ category: "AI tools",
513
+ reference: ["<issue> [--stash <message>]", "automation", ["files", "git", "processes"]]
514
+ }
515
+ };
516
+
517
+ // scripts/josh/josh-commands-split.ts
518
+ var SPLIT_COMMANDS = {
519
+ "split:assess": {
520
+ script: "scripts/split/split-assess-cli.ts",
521
+ description: "Measure the branch change size (tests excluded) and answer the split assessment size question: split | single",
522
+ category: "AI tools",
523
+ reference: ["[--json]", "automation", ["none"]]
524
+ }
525
+ };
526
+
527
+ // scripts/josh/josh-commands-ai.ts
528
+ var RUN_HOLD_SCRIPT = "scripts/run/run-hold-cli.ts";
529
+ var ISSUE_WITH_OPTIONS2 = "<issue> [options]";
530
+ var AI_COMMANDS = {
531
+ ...ISSUE_COMMANDS,
532
+ "pkg:scout": {
533
+ script: "scripts/package/package-scout-cli.ts",
534
+ description: "Rank package candidates by measured metrics so the Package-First tier decision is read, not judged",
535
+ category: "AI tools",
536
+ reference: ["<keywords> [--size <n>]", "automation", ["network"]]
537
+ },
538
+ "stash:pop": {
539
+ script: "scripts/git/stash-pop-cli.ts",
540
+ description: "Pop the stash matching this message, not whichever a shared stack has on top",
541
+ category: "AI tools",
542
+ reference: ["<message>", "automation", ["git"]]
543
+ },
544
+ epic: {
545
+ script: "scripts-ai/epic.ts",
546
+ description: "Create an epic issue from its child issue numbers",
547
+ category: "AI tools",
548
+ reference: ["<title> <issue...> [--ordered]", "automation", ["network"]]
549
+ },
550
+ "epic:next": {
551
+ script: "scripts/epic/epic-next.ts",
552
+ description: "List an epic's runnable children, bundled per repository",
553
+ category: "AI tools",
554
+ reference: ["<epic>", "automation", ["network"]]
555
+ },
556
+ "epic:bundle": {
557
+ script: "scripts/epic/epic-bundle-cli.ts",
558
+ description: "Say whether a newly filed issue belongs with ones already in the backlog",
559
+ category: "AI tools",
560
+ reference: ["<issue>", "automation", ["network"]]
561
+ },
562
+ "epic:audit": {
563
+ script: "scripts/epic/epic-audit-cli.ts",
564
+ description: "Audit an epic's children against each other for contradictions",
565
+ category: "AI tools",
566
+ reference: ["<epic>", "automation", ["network"]]
567
+ },
568
+ "epic:check": {
569
+ script: "scripts-ai/epic-check.ts",
570
+ description: "Check an epic issue against the tracking requirements",
571
+ category: "AI tools",
572
+ reference: ["<epic>", "automation", ["network"]]
573
+ },
574
+ "auto-ok:next": {
575
+ script: "scripts/auto-ok/auto-ok-cli.ts",
576
+ description: "Print the next opted-in issue an unattended run may pick up outside an epic",
577
+ category: "AI tools",
578
+ reference: ["[--exclude <n>[,<n>...]] [--label <name>]", "automation", ["network"]]
579
+ },
580
+ ...BACKLOG_COMMANDS,
581
+ cost: {
582
+ script: "scripts/cost-runtime/cost-cli.ts",
583
+ description: "Report a run's token and credit cost from Claude Code's session transcripts",
584
+ category: "AI tools",
585
+ reference: ["[--cut|--over]", "automation", ["none"]]
586
+ },
587
+ ...DOCUMENT_COMMANDS,
588
+ time: {
589
+ script: "scripts/time/time-cli.ts",
590
+ description: "Report where a run's wall clock went: model wait, tool execution, human wait",
591
+ category: "AI tools",
592
+ reference: ["[options]", "maintainer", ["none"]],
593
+ // Kit-only: it measures kit's own development runs and its report modules live under the
594
+ // undistributed `scripts/time/`, so it means nothing in a consumer project and is dropped from a
595
+ // consumer's help (joshuafolkken/kit#1997). The runtime analysis hooks and guards rely on stays
596
+ // distributed under `scripts/time-runtime/`.
597
+ is_kit_only: true
598
+ },
599
+ // The tool-calls-per-round-trip density the batching guard is measured on, aggregated across the
600
+ // recent lane sessions (joshuafolkken/kit#2405). Kit-only for the same reason `time` is: it reads
601
+ // kit's own lane transcripts and means nothing in a consumer project.
602
+ "time:density": {
603
+ script: "scripts/time/time-density-cli.ts",
604
+ description: "Report tool calls per round trip across the recent lane sessions",
605
+ category: "AI tools",
606
+ reference: ["[--lanes <n>] [--path <dir>]", "maintainer", ["none"]],
607
+ is_kit_only: true
608
+ },
609
+ retrospective: {
610
+ script: "scripts/retrospective/retrospective-cli.ts",
611
+ description: "Aggregate a finished run's cost, review findings, observation ledger and events into one digest",
612
+ category: "AI tools",
613
+ reference: ["", "maintainer", ["none"]],
614
+ // Kit-only: it reads kit's own development run — the transcript store, the review ledger and the
615
+ // run event stream — so it means nothing in a consumer project and is dropped from a consumer's
616
+ // help (joshuafolkken/kit#2328), through the same declaration `josh time` uses for the same reason.
617
+ is_kit_only: true
618
+ },
619
+ "review:brief": {
620
+ script: "scripts/review/review-brief-cli.ts",
621
+ description: "Print the whole /code-review invocation: level, what the gate already proved, target (--level-only for the level alone)",
622
+ category: "AI tools",
623
+ reference: ["[--round <1|2>] | --level-only [--staged] [--json]", "automation", ["files"]]
624
+ },
625
+ "review:attest": {
626
+ script: "scripts/review/review-attest-cli.ts",
627
+ description: "Record, or verify, which checkout a /code-review actually read",
628
+ category: "AI tools",
629
+ reference: ["<nonce> | --check", "automation", ["files"]]
630
+ },
631
+ "review:round2": {
632
+ script: "scripts/review/review-round2-cli.ts",
633
+ description: "Say whether the second /code-review round is due, or may be skipped entirely",
634
+ category: "AI tools",
635
+ reference: ["[--round-1-closed] [--json]", "automation", ["none"]]
636
+ },
637
+ delegate: {
638
+ script: "scripts/delegation/delegation-cli.ts",
639
+ description: "Say whether a run step may go to a cheaper execution tier",
640
+ category: "AI tools",
641
+ reference: ["<step> | --list", "automation", ["none"]]
642
+ },
643
+ fanout: {
644
+ script: "scripts/delegation/fanout-cli.ts",
645
+ description: "Say whether proposed implementation units are file-disjoint, so they may run in parallel",
646
+ category: "AI tools",
647
+ reference: ["<unit-files> <unit-files> [<unit-files> \u2026]", "automation", ["none"]]
648
+ },
649
+ "run:hold": {
650
+ script: RUN_HOLD_SCRIPT,
651
+ description: "Claim this working tree for a run, or say which run already holds it",
652
+ category: "AI tools",
653
+ reference: ["[issue]", "automation", ["files"]]
654
+ },
655
+ "run:release": {
656
+ script: RUN_HOLD_SCRIPT,
657
+ description: "Release this working tree's run record",
658
+ category: "AI tools",
659
+ reference: ["[issue|--force]", "automation", ["files"]],
660
+ default_script_arguments: ["--release"]
661
+ },
662
+ "run:carry": {
663
+ script: "scripts/run/run-carry-cli.ts",
664
+ description: "Carry one invocation\u2019s budget across its own session cuts",
665
+ category: "AI tools",
666
+ reference: ["<operation> [arguments...]", "automation", ["files"]]
667
+ },
668
+ "run:wake": {
669
+ script: "scripts/run/run-wake-cli.ts",
670
+ // `.env` rather than the ambient environment:
671
+ // the failure warning needs the Telegram credentials, the same
672
+ // reasons `notify` and `followup` carry these flags.
673
+ tsx_arguments: OPTIONAL_ENV_FILE_FLAGS,
674
+ description: "Wake the next session of a cut backlogrun from outside the conversation",
675
+ category: "AI tools",
676
+ reference: ["[options]", "automation", ["processes", "notifications"]]
677
+ },
678
+ "run:cut": {
679
+ script: "scripts/run/run-cut-cli.ts",
680
+ description: "Cut a lane child before the gate and resume a fresh process",
681
+ category: "AI tools",
682
+ reference: ["[--resume] <issue> [--impl] [--handoff <path>]", "automation", ["files"]]
683
+ },
684
+ "run:liveness": {
685
+ script: "scripts/run/run-liveness-cli.ts",
686
+ description: "Say whether a delegated unit is still working, or stopped without reporting",
687
+ category: "AI tools",
688
+ reference: ["<issue> --output <path> [options]", "automation", ["processes"]]
689
+ },
690
+ "run:ending": {
691
+ script: "scripts/run/run-ending-cli.ts",
692
+ description: "Classify how a dispatched lane child ended (merged, cut, abandoned, unreadable)",
693
+ category: "AI tools",
694
+ reference: ["<issue> --output <path> [--repo <owner/repo>]", "automation", ["network"]]
695
+ },
696
+ "run:progress": {
697
+ script: "scripts/run/run-progress-cli.ts",
698
+ description: "Report an unattended run\u2019s progress once it has gone quiet for an interval",
699
+ category: "AI tools",
700
+ reference: ["[--wait|--mark]", "automation", ["files"]]
701
+ },
702
+ "run:prep": {
703
+ script: "scripts/run/run-prep-cli.ts",
704
+ description: "Bundle a run\u2019s pre-edit reads: body, comments, state, dependency scope",
705
+ category: "AI tools",
706
+ reference: ["<issue>", "automation", ["network"]]
707
+ },
708
+ // The entry sequence a lane opened on, folded into one call (joshuafolkken/kit#2372): claim the tree,
709
+ // read the budget, gather the issue reads and decide the pre-implementation step. `run:hold`,
710
+ // `cost --cut`, `run:prep` and `run:step` were four round trips re-billing a lane's full context each.
711
+ "run:entry": {
712
+ script: "scripts/run/run-entry-cli.ts",
713
+ description: "Open a run in one call: claim the tree, read the budget, bundle the reads, decide the pre-implementation step",
714
+ category: "AI tools",
715
+ reference: ["<issue>", "automation", ["git", "network", "files"]]
716
+ },
717
+ "run:status": {
718
+ script: "scripts/run/run-status-cli.ts",
719
+ description: "Bundle a run\u2019s read-only status: issue state, cost verdict, carry counters",
720
+ category: "AI tools",
721
+ reference: ["<issue> [--repo <owner/repo>]", "automation", ["network"]]
722
+ },
723
+ "run:next": {
724
+ script: "scripts/run/run-next-cli.ts",
725
+ description: "Print the next step a fullrun takes, computed from the run\u2019s state",
726
+ category: "AI tools",
727
+ reference: ["<issue>", "automation", ["network"]]
728
+ },
729
+ "run:step": {
730
+ script: "scripts/run/run-step-cli.ts",
731
+ description: "Print the run\u2019s next single action, computed from the event stream, carry record and issue state",
732
+ category: "AI tools",
733
+ reference: ["<issue>", "automation", ["network", "files"]]
734
+ },
735
+ "repo:party": {
736
+ script: "scripts/discovery/repo-party-cli.ts",
737
+ description: "Say whether a repository is first-party or third-party by owner equality (computed, not judged)",
738
+ category: "AI tools",
739
+ reference: ["[<owner/repo>]", "automation", ["none"]]
740
+ },
741
+ "run:merge": {
742
+ script: "scripts/run/run-merge-cli.ts",
743
+ description: "Collapse a backlogrun merge event into one call: confirm the child, do the post-merge steps, offer the next child",
744
+ category: "AI tools",
745
+ reference: [ISSUE_WITH_OPTIONS2, "automation", ["git", "network"]]
746
+ },
747
+ "run:review": {
748
+ script: "scripts/run/run-review-cli.ts",
749
+ description: "Start the gate in the background and print the /code-review brief in one call so the two overlap (--join to join the gate and check its verdict)",
750
+ category: "AI tools",
751
+ reference: ["[--join]", "automation", ["processes", "files"]]
752
+ },
753
+ // The post-merge sequence a run closed on, folded into one call (joshuafolkken/kit#2372): commit the
754
+ // observation ledger, read the completion citations and decide the release scope. `observations:flush`,
755
+ // `issue:cite` and `release:scope` were three round trips re-billing the run's full context each.
756
+ "run:tail": {
757
+ script: "scripts/run/run-tail-cli.ts",
758
+ description: "Close a run in one call: commit the observation ledger, read the citations, decide the release scope",
759
+ category: "AI tools",
760
+ reference: ["[<issue> ...]", "automation", ["git", "network"]]
761
+ },
762
+ // The commit-to-report region a run ships a change on, folded into one call (joshuafolkken/kit#2398):
763
+ // the gate, the commit/push/PR (`git -y`), the CI-wait merge (`followup`) and the report bookkeeping
764
+ // (`run:tail`) were four round trips re-billing the run's full context each. It stops at the first
765
+ // failed step and names it, so the run reads only the step to fix.
766
+ ship: {
767
+ script: "scripts/run/run-ship-cli.ts",
768
+ description: "Ship a change in one call: gate, commit/push/PR, the CI-wait merge and the report bookkeeping, stopping at the first failed step",
769
+ category: "AI tools",
770
+ reference: [
771
+ '"<title> #<N>" [<follow-up-N> ...] [--cite <N>] [--review] [--detach] [--notify-message <text> | --notify-message-file <path>] | --log <N>',
772
+ "automation",
773
+ ["git", "network"]
774
+ ]
775
+ },
776
+ "run:event": {
777
+ script: "scripts/run/run-event-cli.ts",
778
+ description: "Append to, read or watch the run\u2019s append-only event stream (--append <kind> <text> | --from|--follow <n> | --watch [<n>] | --last)",
779
+ category: "AI tools",
780
+ reference: [
781
+ "--append <kind> <text> | --from|--follow <n> | --watch [<n>] | --last",
782
+ "automation",
783
+ ["files"]
784
+ ]
785
+ },
786
+ "run:report": {
787
+ script: "scripts/run/run-report-cli.ts",
788
+ description: "Generate the session-facing report for this invocation from the run\u2019s event stream (merges, parks, cuts) with the release tail \u2014 the same text josh notify sends",
789
+ category: "AI tools",
790
+ reference: ["", "automation", ["files", "network"]]
791
+ },
792
+ ...LANE_COMMANDS,
793
+ ...GUARD_COMMANDS,
794
+ "run:watcher:guard": {
795
+ script: "scripts/run/run-watcher-guard-cli.ts",
796
+ description: "Guard: exits non-zero when lane children are in-flight but the watcher has not pinged recently",
797
+ category: "AI tools",
798
+ reference: ["", "automation", ["none"]]
799
+ },
800
+ "run:stranded": {
801
+ script: "scripts/run/run-stranded-cli.ts",
802
+ // `.env` rather than the ambient environment: the strand notification needs the Telegram
803
+ // credentials, the same reason `run:wake` carries these flags.
804
+ tsx_arguments: OPTIONAL_ENV_FILE_FLAGS,
805
+ description: "Report whether the run is stranded \u2014 budget handed off, owner gone, and no supervisor watching",
806
+ category: "AI tools",
807
+ reference: ["", "automation", ["processes", "notifications"]]
808
+ },
809
+ ...SPLIT_COMMANDS,
810
+ "oracle:list": {
811
+ script: "scripts/rules/oracle-list-cli.ts",
812
+ description: "Print the decision oracles \u2014 commands that answer a rule question mechanically",
813
+ category: "AI tools",
814
+ reference: ["", "automation", ["none"]]
815
+ },
816
+ eval: {
817
+ script: "scripts/eval/eval-run.ts",
818
+ description: "Run the agent rule-compliance scenarios (real Claude sessions)",
819
+ category: "AI tools",
820
+ reference: ["[scenario...]", "maintainer", ["processes", "network"]],
821
+ // Kit-only: it replays kit's own distributed rules against real Claude sessions, so it means
822
+ // nothing in a consumer project and is dropped from a consumer's help (joshuafolkken/kit#1988).
823
+ is_kit_only: true
824
+ }
825
+ };
826
+
827
+ // scripts/josh/josh-commands-clone.ts
828
+ var CLONE_COMMANDS = {
829
+ "clone:scan": {
830
+ script: "scripts/clone/clone-scan-cli.ts",
831
+ description: "Count code duplication across files and first-party repositories, printing each clone as file:line pairs",
832
+ category: "AI tools",
833
+ reference: ["", "automation", ["files"]]
834
+ }
835
+ };
836
+
837
+ // scripts/josh/josh-commands-development.ts
838
+ var FILE_ARGUMENTS = "[files...]";
839
+ var REQUIRED_FILE_ARGUMENTS = "<files...>";
840
+ var FILTER_ARGUMENTS = "[filters...]";
841
+ var MATCH_ARGUMENTS = "[--match]";
842
+ var PATH_ARGUMENTS = "<path...>";
843
+ var DEV_COMMANDS = {
844
+ [GATE_COMMAND]: {
845
+ script: "scripts/gate/verification-gate.ts",
846
+ description: "Run lint, type check, spell check and unit tests concurrently",
847
+ category: "Development",
848
+ reference: ["[--verbose|--force|--no-unit]", "developer", ["files", "processes"]]
849
+ },
850
+ lint: {
851
+ script: "scripts/lint/lint-parallel.ts",
852
+ description: "Check code with prettier and eslint",
853
+ category: "Development",
854
+ reference: ["", "developer", ["processes"]]
855
+ },
856
+ "lint:related": {
857
+ script: "scripts/lint/lint-related.ts",
858
+ description: "Check only the changed files with prettier and eslint (whole tree on fallback)",
859
+ category: "Development",
860
+ reference: [FILE_ARGUMENTS, "developer", ["processes"]]
861
+ },
862
+ lines: {
863
+ script: "scripts/lines/lines-command.ts",
864
+ description: "Print a file's code lines against the max-lines limit and the headroom left",
865
+ category: "Development",
866
+ reference: [REQUIRED_FILE_ARGUMENTS, "developer", ["none"]]
867
+ },
868
+ "refactor:scan": {
869
+ script: "scripts/refactor/refactor-scan-cli.ts",
870
+ description: "List refactoring candidates in the changed scope by category and answer clear/candidates",
871
+ category: "Development",
872
+ reference: ["", "automation", ["processes"]]
873
+ },
874
+ bytes: {
875
+ script: "scripts/bytes/bytes-command.ts",
876
+ description: "Print an agent-read document's byte size against its ceiling and the headroom left",
877
+ category: "Development",
878
+ reference: [REQUIRED_FILE_ARGUMENTS, "developer", ["none"]]
879
+ },
880
+ "rule:value": {
881
+ script: "scripts/rules/rule-value-cli.ts",
882
+ description: "Print each delivered rule's unaided compliance \u2014 runs reached, kept rate, refusals",
883
+ category: "AI tools",
884
+ reference: ["", "developer", ["none"]]
885
+ },
886
+ format: {
887
+ // prettier first here, unlike `format:edited`, and deliberately: `eslint --fix` exits 1
888
+ // whenever a non-autofixable error remains, so putting it first behind `&&` would mean one
889
+ // unused variable anywhere in the tree stops prettier from running at all.
890
+ shell: [
891
+ "sh",
892
+ "-c",
893
+ `pnpm exec prettier --write . && pnpm exec eslint . --fix ${ESLINT_CACHE_FLAGS.join(" ")}`
894
+ ],
895
+ description: "Format code with prettier and eslint",
896
+ category: "Development",
897
+ reference: ["", "developer", ["files", "processes"]]
898
+ },
899
+ "format:edited": {
900
+ script: "scripts/hooks/format-edited-file.ts",
901
+ description: "Claude Code hook: format the file just edited (reads the tool call on stdin)",
902
+ category: "Development",
903
+ reference: ["", "automation", ["files", "processes"]]
904
+ },
905
+ "batch:guard": {
906
+ script: "scripts/hooks/batch-guard.ts",
907
+ description: "Claude Code hook: refuse a third consecutive single-call turn (reads the tool call on stdin)",
908
+ category: "Development",
909
+ reference: ["", "automation", ["none"]]
910
+ // **No `tsx_arguments`, deliberately.** `JOSH_BATCH_GUARD` is a per-machine preference kept in
911
+ // `.env`, which every other command reads through `OPTIONAL_ENV_FILE_FLAGS` — but declaring any
912
+ // `tsx_arguments` disqualifies a command from in-process dispatch (`josh-in-process.ts`), and
913
+ // this one runs before every `Bash` call. That is the hot path joshuafolkken/kit#1342 took a
914
+ // second ~0.16 s tsx start off. The script calls `process.loadEnvFile` itself instead, which is
915
+ // node's own `--env-file` parser with node's own precedence.
916
+ },
917
+ "pretool:guard": {
918
+ script: "scripts/hooks/pretool-guard.ts",
919
+ description: "Claude Code hook: the batch, investigation and rule guards in one process (reads the tool call on stdin)",
920
+ category: "Development",
921
+ reference: ["", "automation", ["none"]]
922
+ // **No `tsx_arguments`, deliberately**, the same as `batch:guard` above: this is the one
923
+ // PreToolUse hook consumers run before every guarded call, so it must stay eligible for
924
+ // in-process dispatch rather than pay a second tsx start. Each guard it composes loads `.env`
925
+ // through the shared loader.
926
+ },
927
+ "stop:guard": {
928
+ script: "scripts/hooks/stop-guard.ts",
929
+ description: "Claude Code Stop hook: deliver the three stop-time rules \u2014 hold notify/release and issue citation (reads the Stop payload on stdin)",
930
+ category: "Development",
931
+ reference: ["", "automation", ["none"]]
932
+ // **No `tsx_arguments`, deliberately**, the same as `pretool:guard` above: this runs at every
933
+ // turn end, so it must stay eligible for in-process dispatch rather than pay a second tsx start.
934
+ // It loads `.env` through the shared `hook-decision.ts` loader.
935
+ },
936
+ "session:lang": {
937
+ script: "scripts/josh/session-language-cli.ts",
938
+ description: "Claude Code hook: print the resolved JOSH_SESSION_LANG (defaults to ja) for the session context",
939
+ category: "Development",
940
+ reference: ["", "automation", ["none"]]
941
+ // **No `tsx_arguments`, deliberately**, the same as `batch:guard` above: this runs on every
942
+ // `UserPromptSubmit`, so it must stay eligible for in-process dispatch rather than pay a second
943
+ // tsx start each turn. It calls `process.loadEnvFile` itself through the shared loader.
944
+ },
945
+ "cspell:dot": {
946
+ script: "scripts/lint/cspell-cached.ts",
947
+ description: "Run spell check including dotfiles",
948
+ category: "Development",
949
+ reference: ["", "developer", ["processes"]]
950
+ },
951
+ behavior: {
952
+ script: "scripts/behavior/behavior-cli.ts",
953
+ description: "Check the current run's recorded transcript against the behavior assertions (no model call)",
954
+ category: "Development",
955
+ reference: ["", "developer", ["files"]]
956
+ },
957
+ "test:unit": {
958
+ script: "scripts/test/test-unit-guard.ts",
959
+ description: "Run unit tests with Vitest (skips when Vitest is absent; fails when it has no tests)",
960
+ category: "Development",
961
+ reference: [FILTER_ARGUMENTS, "developer", ["processes"]]
962
+ },
963
+ "test:related": {
964
+ script: "scripts/test/test-related.ts",
965
+ description: "Run only the unit tests related to the changed files (full suite on fallback)",
966
+ category: "Development",
967
+ reference: [FILE_ARGUMENTS, "developer", ["processes"]]
968
+ },
969
+ "test:declared": {
970
+ script: "scripts/test/test-declared.ts",
971
+ description: "Report whether the working-tree change needs a test (required/exempt/satisfied); --match checks Step 0 declarations on stdin",
972
+ category: "Development",
973
+ reference: [MATCH_ARGUMENTS, "developer", ["processes"]]
974
+ },
975
+ "test:red": {
976
+ script: "scripts/test/test-red.ts",
977
+ description: "Run the changed unit tests against the pre-fix tree (merge-base worktree) and report red/green/no-test",
978
+ category: "Development",
979
+ reference: ["", "developer", ["git", "processes"]]
980
+ },
981
+ disposition: {
982
+ script: "scripts/review/disposition-cli.ts",
983
+ description: "Say whether a review finding reaches a runtime path (runtime) or is inert (non-runtime)",
984
+ category: "AI tools",
985
+ reference: [PATH_ARGUMENTS, "automation", ["none"]]
986
+ },
987
+ "e2e:retry-check": {
988
+ script: "scripts/test/e2e-retry-check.ts",
989
+ description: "Report whether the preview server crashed during a failed E2E attempt (CI)",
990
+ category: "Development",
991
+ reference: ["", "automation", ["none"]]
992
+ },
993
+ "test:e2e": {
994
+ script: "scripts/test/test-e2e-guard.ts",
995
+ description: "Run E2E tests with Playwright (skips when absent or no e2e files)",
996
+ category: "Development",
997
+ reference: [FILTER_ARGUMENTS, "developer", ["processes"]]
998
+ },
999
+ test: {
1000
+ shell: ["sh", "-c", "pnpm josh test:unit && pnpm josh test:e2e"],
1001
+ description: "Run unit and E2E tests",
1002
+ category: "Development",
1003
+ reference: ["", "developer", ["processes"]],
1004
+ argument_targets: ["test:unit", "test:e2e"]
1005
+ },
1006
+ check: {
1007
+ shell: [...PE, "tsc", "--noEmit", ...TS_CACHE_FLAGS],
1008
+ description: "Type-check TypeScript project",
1009
+ category: "Development",
1010
+ reference: ["[arguments...]", "developer", ["processes"]]
1011
+ },
1012
+ port: {
1013
+ script: "scripts/ports/port-command.ts",
1014
+ description: "Print the PORT_SEED-resolved dev or preview port",
1015
+ category: "Development",
1016
+ reference: ["<dev|preview>", "developer", ["none"]]
1017
+ }
1018
+ };
1019
+
1020
+ // scripts/josh/josh-commands-hooks.ts
1021
+ var HOOKS_COMMANDS = {
1022
+ "prevent-main-commit": {
1023
+ script: "scripts/hooks/prevent-main-commit.ts",
1024
+ description: "Git hook: block commits to main",
1025
+ category: "Git hooks",
1026
+ reference: ["", "automation", ["none"]]
1027
+ },
1028
+ "check-commit-message": {
1029
+ script: "scripts/hooks/check-commit-message.ts",
1030
+ description: "Git hook: validate commit message",
1031
+ category: "Git hooks",
1032
+ reference: ["[<message-file>]", "automation", ["none"]]
1033
+ },
1034
+ "secretlint-scan": {
1035
+ script: "scripts/security/secretlint-scan.ts",
1036
+ description: "Git hook: scan staged files for secrets",
1037
+ category: "Git hooks",
1038
+ reference: ["[paths...]", "automation", ["none"]]
1039
+ },
1040
+ "pre-push-unit": {
1041
+ script: "scripts/hooks/pre-push-unit.ts",
1042
+ description: "Git hook: run unit tests, reusing a green gate recorded on the pushed tree",
1043
+ category: "Git hooks",
1044
+ reference: ["", "automation", ["processes"]]
1045
+ },
1046
+ "reserved-run": {
1047
+ script: "scripts/hooks/reserved-run.ts",
1048
+ description: "Git hook: run a command while holding a place in the machine-wide core budget",
1049
+ category: "Git hooks",
1050
+ reference: ["<weight> -- <command...>", "automation", ["processes"]]
1051
+ },
1052
+ "pre-commit-type-check": {
1053
+ script: "scripts/gate/pre-commit-type-check.ts",
1054
+ description: "Git hook: type-check, reusing a green gate recorded on the committed tree",
1055
+ category: "Git hooks",
1056
+ reference: ["", "automation", ["processes"]]
1057
+ }
1058
+ };
1059
+
1060
+ // scripts/josh/josh-commands-lint.ts
1061
+ var LINT_COMMANDS = {
1062
+ "issue:lint": {
1063
+ script: "scripts/issue/issue-lint-cli.ts",
1064
+ description: "Check an issue body file for the template's required headings",
1065
+ category: "AI tools",
1066
+ reference: ["<path>", "automation", ["files"]]
1067
+ },
1068
+ "issue:backlinks": {
1069
+ script: "scripts/issue/issue-backlinks-cli.ts",
1070
+ description: "Classify an origin issue\u2019s upstream backlinks: ok, missing, or wrong heading",
1071
+ category: "AI tools",
1072
+ reference: ["<issue>", "automation", ["network"]]
1073
+ },
1074
+ "report:lint": {
1075
+ script: "scripts/report/report-lint-cli.ts",
1076
+ description: "Check a two-layer work summary on stdin against its mechanical format rules",
1077
+ category: "AI tools",
1078
+ reference: ["(reads stdin)", "automation", ["none"]]
1079
+ },
1080
+ cases: {
1081
+ script: "scripts/cases/cases-cli.ts",
1082
+ description: "Read changed paths and print the I/O boundaries crossed and their mandatory abnormal cases: network | process | fs | none",
1083
+ category: "AI tools",
1084
+ reference: ["<path...>", "automation", ["files"]]
1085
+ }
1086
+ };
1087
+
1088
+ // scripts/josh/josh-commands-maintenance.ts
1089
+ var MAINTENANCE_COMMANDS = {
1090
+ doctor: {
1091
+ script: "scripts/doctor/doctor.ts",
1092
+ description: "Diagnose PATH shadowing of the global josh and show the discovered repository map (--fix reclaims a stale shim)",
1093
+ category: "Maintenance",
1094
+ reference: ["[--fix]", "developer", ["files"]],
1095
+ tsx_arguments: OPTIONAL_ENV_FILE_FLAGS
1096
+ },
1097
+ overrides: {
1098
+ script: "scripts/overrides/overrides-check.ts",
1099
+ description: "Check pnpm overrides for drift",
1100
+ category: "Maintenance",
1101
+ reference: ["[--save]", "maintainer", ["files"]]
1102
+ },
1103
+ audit: {
1104
+ script: "scripts/security/security-audit.ts",
1105
+ description: "Run security audit",
1106
+ category: "Maintenance",
1107
+ reference: ["", "developer", ["processes"]]
1108
+ },
1109
+ "audit:provision": {
1110
+ script: "scripts/security/security-audit-provision.ts",
1111
+ description: "Install the pinned osv-scanner when the audit cannot find one (no-op if present)",
1112
+ category: "Maintenance",
1113
+ reference: ["", "automation", ["files", "network"]]
1114
+ },
1115
+ "reconcile-templates": {
1116
+ script: "scripts/sync/reconcile-templates.ts",
1117
+ description: "Record template source hashes (--check to verify drift)",
1118
+ category: "Maintenance",
1119
+ reference: ["", "maintainer", ["files"]]
1120
+ },
1121
+ latest: {
1122
+ shell: [
1123
+ "sh",
1124
+ "-c",
1125
+ "export NODE_AUTH_TOKEN=$(gh auth token) && pnpm josh latest:guard && pnpm josh latest:corepack && pnpm josh latest:update && pnpm josh ranges && pnpm josh audit && pnpm josh latest:scope --record"
1126
+ ],
1127
+ description: "Update pnpm, dependencies, and run security audit",
1128
+ category: "Maintenance",
1129
+ reference: ["", "maintainer", ["files", "network", "processes"]],
1130
+ argument_targets: ["latest:corepack", "latest:update", "audit"]
1131
+ },
1132
+ "latest:scope": {
1133
+ script: "scripts/version/latest-scope-cli.ts",
1134
+ description: "Say whether this run has to update dependencies, from when josh latest last finished (--record notes a run)",
1135
+ category: "Maintenance",
1136
+ reference: ["[--record] [--json]", "automation", ["files"]],
1137
+ // `JOSH_LATEST_MAX_AGE_HOURS` is documented as a project setting, so it has to be readable
1138
+ // where the project keeps its settings — a variable that only works when exported from the
1139
+ // shell is one a user follows the documentation for and gets the default from, silently.
1140
+ tsx_arguments: OPTIONAL_ENV_FILE_FLAGS
1141
+ },
1142
+ "latest:guard": {
1143
+ script: "scripts/version/latest-lane-guard.ts",
1144
+ description: "Refuse josh latest inside a lane (the update stamp is keyed to the project root)",
1145
+ category: "Maintenance",
1146
+ reference: ["", "automation", ["files"]]
1147
+ },
1148
+ "latest:corepack": {
1149
+ script: "scripts/version/latest-corepack.ts",
1150
+ description: "Update pnpm on the current major while preserving the integrity pin",
1151
+ category: "Maintenance",
1152
+ reference: ["", "maintainer", ["files", "network"]]
1153
+ },
1154
+ "latest:update": {
1155
+ script: "scripts/version/latest-update.ts",
1156
+ description: "Update all dependencies to latest",
1157
+ category: "Maintenance",
1158
+ reference: ["", "maintainer", ["files", "network"]]
1159
+ }
1160
+ };
1161
+
1162
+ // scripts/josh/josh-commands-project.ts
1163
+ var PROJECT_COMMANDS = {
1164
+ init: {
1165
+ script: "scripts/init/init.ts",
1166
+ description: "Initialize config in a new project",
1167
+ category: "Project",
1168
+ reference: ["", "developer", ["files", "processes"]]
1169
+ },
1170
+ sync: {
1171
+ script: "scripts/sync/sync.ts",
1172
+ description: "Sync config files",
1173
+ category: "Project",
1174
+ reference: ["", "developer", ["files"]]
1175
+ },
1176
+ "sync:scope": {
1177
+ script: "scripts/sync/managed-config-scope-cli.ts",
1178
+ description: "Say whether this change touches a file josh sync distributes",
1179
+ category: "Project",
1180
+ reference: ["[--staged] [--json]", "automation", ["none"]]
1181
+ },
1182
+ "sonar:hotspots": {
1183
+ script: "scripts/sonar/sonar-hotspots-cli.ts",
1184
+ description: "Fetch SonarCloud hotspots on a pull request and print each one's Step B disposition",
1185
+ category: "Project",
1186
+ reference: ["<PR>", "automation", ["network"]]
1187
+ },
1188
+ "ui:routes": {
1189
+ script: "scripts/ui/ui-routes-cli.ts",
1190
+ description: "List the screenshot-target routes the current change touches",
1191
+ category: "Project",
1192
+ reference: ["[--staged]", "automation", ["none"]]
1193
+ },
1194
+ propagate: {
1195
+ script: "scripts/propagate/propagate.ts",
1196
+ description: "Carry the published release into every consumer repository next to this one",
1197
+ category: "Project",
1198
+ reference: ["[--dry-run] [--skip-publish-wait]", "maintainer", ["files", "network"]]
1199
+ },
1200
+ adopt: {
1201
+ script: "scripts/adopt/adopt.ts",
1202
+ description: "Upgrade every installed @joshuafolkken toolkit here and open the pull request",
1203
+ category: "Project",
1204
+ reference: ["[--dry-run]", "developer", ["files", "git", "network", "processes"]]
1205
+ }
1206
+ };
1207
+
1208
+ // scripts/josh/josh-commands-versioning.ts
1209
+ var VERSIONING_COMMANDS = {
1210
+ bump: {
1211
+ script: "scripts/version/bump-version.ts",
1212
+ description: "Bump package version",
1213
+ category: "Versioning",
1214
+ reference: ["[major|minor|patch]", "maintainer", ["files"]]
1215
+ },
1216
+ version: {
1217
+ script: "scripts/version/version-check.ts",
1218
+ description: "Show kit versions; --upgrade updates the global and project install",
1219
+ category: "Versioning",
1220
+ reference: ["[--upgrade]", "developer", ["files", "network", "processes"]]
1221
+ },
1222
+ // A `script` entry, not a shell one: script paths resolve against the kit package root, so this
1223
+ // keeps working from a consumer repo where the file lives under node_modules. The registry
1224
+ // probes need NODE_AUTH_TOKEN for any `@joshuafolkken/*` dependency; `josh latest` exports it
1225
+ // before chaining here, exactly as it already does for `latest:update`.
1226
+ ranges: {
1227
+ script: "scripts/version/publishable-range-check.ts",
1228
+ description: "Check that every published dependency range still resolves for a consumer",
1229
+ category: "Versioning",
1230
+ reference: ["", "developer", ["network"]]
1231
+ },
1232
+ // The one place that decides a version (joshuafolkken/kit#1169). A `script` entry for the same
1233
+ // reason `ranges` is one: script paths resolve against the kit package root, so it keeps working
1234
+ // from a consumer repository where the file lives under node_modules.
1235
+ release: {
1236
+ script: "scripts/release/release-cli.ts",
1237
+ description: "Release the merges main has taken since the version last changed",
1238
+ category: "Versioning",
1239
+ reference: ["[version]", "maintainer", ["git", "network", "release"]]
1240
+ },
1241
+ // The read-only half of the one above (joshuafolkken/kit#1582). `release --dry-run` cannot
1242
+ // answer this question: it refuses off the default branch and on a dirty tree, which is every
1243
+ // position a run asks it from. A `script` entry for the same reason `release` is one.
1244
+ "release:scope": {
1245
+ script: "scripts/release/release-scope-cli.ts",
1246
+ description: "Say whether a release is owed, from the unreleased merges on main",
1247
+ category: "Versioning",
1248
+ reference: ["[--json]", "automation", ["none"]]
1249
+ }
1250
+ };
1251
+
1252
+ // scripts/josh/josh-commands-workflow.ts
1253
+ var GIT_WORKFLOW_SCRIPT = "scripts-ai/git-workflow.ts";
1254
+ var GIT_MESSAGE_ARGUMENTS = "[-y] <message>";
1255
+ var WORKFLOW_COMMANDS = {
1256
+ git: {
1257
+ script: GIT_WORKFLOW_SCRIPT,
1258
+ description: "Git workflow helper",
1259
+ category: "Workflow",
1260
+ reference: [GIT_MESSAGE_ARGUMENTS, "developer", ["git", "network"]]
1261
+ },
1262
+ pr: {
1263
+ script: GIT_WORKFLOW_SCRIPT,
1264
+ description: "Create PR only (skip commit and push)",
1265
+ category: "Workflow",
1266
+ // Not `GIT_MESSAGE_ARGUMENTS`: `-y` is already in the default arguments below, so advertising
1267
+ // it would document a flag that cannot change what this command does.
1268
+ reference: ["<message>", "developer", ["network"]],
1269
+ default_script_arguments: ["-y", "--skip-commit", "--skip-push"]
1270
+ },
1271
+ // **The optional form, on both** (joshuafolkken/kit#1564). These two were the last commands
1272
+ // passing the mandatory `--env-file=.env`, which node resolves before the script's first line: on
1273
+ // a machine with no `.env` they died as `.env: not found` with exit code 9, even where
1274
+ // `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` existed as real environment variables — a cloud
1275
+ // session, and `followup` with them the merge step of every `fullrun` there. `doctor` was moved to
1276
+ // this form for the same reason in joshuafolkken/kit#869.
1277
+ //
1278
+ // Nothing is lost by relaxing it: both scripts already call `load_optional_environment()`
1279
+ // themselves, so the file is read either way and node's precedence — an existing environment
1280
+ // variable wins over the file — is node's own in both spellings.
1281
+ //
1282
+ // **What the mandatory flag was accidentally providing was noise**, and that is replaced rather
1283
+ // than dropped: `telegram_notify.send` now throws on missing credentials and on a failed send, so
1284
+ // `josh notify` exits non-zero instead of warning and answering 0.
1285
+ followup: {
1286
+ script: "scripts-ai/git-followup-workflow.ts",
1287
+ description: "Follow-up git workflow",
1288
+ category: "Workflow",
1289
+ reference: [
1290
+ "<title> [--notify-message <text>]",
1291
+ "automation",
1292
+ ["git", "network", "notifications"]
1293
+ ],
1294
+ tsx_arguments: OPTIONAL_ENV_FILE_FLAGS
1295
+ },
1296
+ notify: {
1297
+ script: "scripts-ai/telegram-test.ts",
1298
+ description: "Send Telegram notification",
1299
+ category: "Workflow",
1300
+ reference: ["--task-type <type> --body <text>", "automation", ["notifications"]],
1301
+ tsx_arguments: OPTIONAL_ENV_FILE_FLAGS
1302
+ },
1303
+ // The observation ledger's only commit path (joshuafolkken/kit#1756). `pnpm josh git` excludes the
1304
+ // ledger from what it stages, so without this command a parent's appended line has no route to the
1305
+ // default branch at all — and the recurrence count the promotion rule reads is a count of main.
1306
+ "observations:flush": {
1307
+ script: "scripts/observations/observations-flush-cli.ts",
1308
+ description: "Commit the observation ledger as a pull request of its own, and merge it",
1309
+ category: "Workflow",
1310
+ reference: ["", "automation", ["git", "network"]]
1311
+ },
1312
+ // The one write path for a `/code-review` round's findings (joshuafolkken/kit#2325), plus the
1313
+ // `--check` gate `followup` runs before it merges (joshuafolkken/kit#2343). It appends a `- rf:`
1314
+ // line per finding — or one zero-finding line for a clean round — to the observation ledger, so
1315
+ // `observations:flush` commits them and the recurrence count survives the run.
1316
+ "review:record": {
1317
+ script: "scripts/review/review-record-cli.ts",
1318
+ description: "Record a review round\u2019s findings, or check a round was recorded",
1319
+ category: "Workflow",
1320
+ reference: [
1321
+ "--issue <N> [<category>:<severity>:<file> ...] | --check --issue <N>",
1322
+ "automation",
1323
+ ["files"]
1324
+ ]
1325
+ },
1326
+ // The reader over what `review:record` wrote (joshuafolkken/kit#2325): each recurring category’s
1327
+ // count, and the number of zero-finding rounds that distinguishes a quiet category from an unwatched one.
1328
+ "review:findings": {
1329
+ script: "scripts/review/review-findings-cli.ts",
1330
+ description: "Count review findings by category from the observation ledger",
1331
+ category: "Workflow",
1332
+ reference: ["", "developer", ["files"]]
1333
+ },
1334
+ // After a behavior-change Issue merges, re-run its declared baseline and print before/after; a value
1335
+ // that did not move appends a refuted-premise line to the observation ledger (joshuafolkken/kit#2212).
1336
+ "measure:rerun": {
1337
+ script: "scripts/issue/measure-rerun-cli.ts",
1338
+ description: "Re-run a merged issue\u2019s baseline command and print the before/after pair",
1339
+ category: "Workflow",
1340
+ reference: ["<path>", "automation", ["processes", "files"]]
1341
+ },
1342
+ // A script rather than an `sh -c` chain, because it has a precondition to enforce: run inside a
1343
+ // linked work tree it would hijack the default branch from every other one (joshuafolkken/kit#1535).
1344
+ "main:sync": {
1345
+ script: "scripts/git/main-sync.ts",
1346
+ description: "Checkout default branch, pull latest, and prune merged remote-gone branches (refuses inside a lane)",
1347
+ category: "Workflow",
1348
+ reference: ["", "developer", ["git", "network"]]
1349
+ },
1350
+ // A script rather than an `sh -c` chain, because the strategy has to be named rather than left to
1351
+ // the caller's git configuration: the `git pull` this replaced aborted with `Need to specify how
1352
+ // to reconcile divergent branches` on exactly the diverged branch the command exists for
1353
+ // (joshuafolkken/kit#1659).
1354
+ "main:merge": {
1355
+ script: "scripts/git/main-merge.ts",
1356
+ description: "Merge origin default branch into the current branch",
1357
+ category: "Workflow",
1358
+ reference: ["", "developer", ["git", "network"]]
1359
+ }
1360
+ };
1361
+
1362
+ // scripts/josh/josh-command-map.ts
1363
+ var CATEGORY_ORDER = [
1364
+ "Development",
1365
+ "Project",
1366
+ "Workflow",
1367
+ "Versioning",
1368
+ "Maintenance",
1369
+ "Git hooks",
1370
+ "AI tools"
1371
+ ];
1372
+ var COMMAND_MAP = {
1373
+ ...DEV_COMMANDS,
1374
+ ...PROJECT_COMMANDS,
1375
+ ...WORKFLOW_COMMANDS,
1376
+ ...VERSIONING_COMMANDS,
1377
+ ...MAINTENANCE_COMMANDS,
1378
+ ...HOOKS_COMMANDS,
1379
+ ...AI_COMMANDS,
1380
+ ...LINT_COMMANDS,
1381
+ ...CLONE_COMMANDS
1382
+ };
1383
+ var ALIASES = {
1384
+ ga: "gate",
1385
+ l: "lint",
1386
+ lr: "lint:related",
1387
+ ln: "lines",
1388
+ by: "bytes",
1389
+ f: "format",
1390
+ fd: "format:edited",
1391
+ bg: "batch:guard",
1392
+ sd: "cspell:dot",
1393
+ bh: "behavior",
1394
+ t: "test",
1395
+ tu: "test:unit",
1396
+ tr: "test:related",
1397
+ td: "test:declared",
1398
+ trd: "test:red",
1399
+ te: "test:e2e",
1400
+ er: "e2e:retry-check",
1401
+ sl: "session:lang",
1402
+ c: "check",
1403
+ pt: "port",
1404
+ i: "init",
1405
+ sy: "sync",
1406
+ sys: "sync:scope",
1407
+ g: "git",
1408
+ gp: "pr",
1409
+ fu: "followup",
1410
+ nf: "notify",
1411
+ obf: "observations:flush",
1412
+ mrr: "measure:rerun",
1413
+ ms: "main:sync",
1414
+ mm: "main:merge",
1415
+ bp: "bump",
1416
+ re: "release",
1417
+ res: "release:scope",
1418
+ v: "version",
1419
+ r: "ranges",
1420
+ dr: "doctor",
1421
+ pg: "propagate",
1422
+ ad: "adopt",
1423
+ ov: "overrides",
1424
+ a: "audit",
1425
+ ap: "audit:provision",
1426
+ rt: "reconcile-templates",
1427
+ u: "latest",
1428
+ lg: "latest:guard",
1429
+ lc: "latest:corepack",
1430
+ lu: "latest:update",
1431
+ ls: "latest:scope",
1432
+ pm: "prevent-main-commit",
1433
+ cm: "check-commit-message",
1434
+ ss: "secretlint-scan",
1435
+ ppu: "pre-push-unit",
1436
+ rer: "reserved-run",
1437
+ ptc: "pre-commit-type-check",
1438
+ ird: "issue:read",
1439
+ ist: "issue:state",
1440
+ isc: "issue:scout",
1441
+ isf: "issue:fold",
1442
+ isfe: "issue:fold-existing",
1443
+ dfr: "defect:rate",
1444
+ ici: "issue:cite",
1445
+ icm: "issue:comment",
1446
+ pks: "pkg:scout",
1447
+ iln: "issue:lint",
1448
+ ibl: "issue:backlinks",
1449
+ rl: "report:lint",
1450
+ ep: "epic",
1451
+ ec: "epic:check",
1452
+ en: "epic:next",
1453
+ ea: "epic:audit",
1454
+ eb: "epic:bundle",
1455
+ ao: "auto-ok:next",
1456
+ bl: "backlog:next",
1457
+ blo: "backlog:offer",
1458
+ bld: "backlog:drive",
1459
+ blp: "backlog:plan",
1460
+ bls: "backlog:stalled",
1461
+ bb: "backlog:budget",
1462
+ co: "cost",
1463
+ ds: "doc:section",
1464
+ rs: "read:set",
1465
+ dcr: "doc:read",
1466
+ rf: "read:files",
1467
+ ef: "edit:files",
1468
+ rfs: "refactor:scan",
1469
+ tm: "time",
1470
+ tmd: "time:density",
1471
+ rtr: "retrospective",
1472
+ rb: "review:brief",
1473
+ r2: "review:round2",
1474
+ ra: "review:attest",
1475
+ rvr: "review:record",
1476
+ rvf: "review:findings",
1477
+ dp: "disposition",
1478
+ dg: "delegate",
1479
+ fo: "fanout",
1480
+ rh: "run:hold",
1481
+ rr: "run:release",
1482
+ rc: "run:carry",
1483
+ rw: "run:wake",
1484
+ rct: "run:cut",
1485
+ rv: "run:liveness",
1486
+ red: "run:ending",
1487
+ rg: "run:progress",
1488
+ rp: "run:prep",
1489
+ ren: "run:entry",
1490
+ rtl: "run:tail",
1491
+ shp: "ship",
1492
+ rst: "run:status",
1493
+ rn: "run:next",
1494
+ rsp: "run:step",
1495
+ rpy: "repo:party",
1496
+ rmg: "run:merge",
1497
+ rrp: "run:report",
1498
+ rrv: "run:review",
1499
+ rev: "run:event",
1500
+ sp: "stash:pop",
1501
+ lno: "lane:open",
1502
+ lnc: "lane:close",
1503
+ lnl: "lane:list",
1504
+ lnp: "lane:prune",
1505
+ lnv: "lane:output",
1506
+ lnd: "lane:dispatch",
1507
+ lna: "lane:await",
1508
+ lnla: "lane:launch",
1509
+ rwg: "run:watcher:guard",
1510
+ rsd: "run:stranded",
1511
+ ig: "investigation:guard",
1512
+ drg: "duplicate-read:guard",
1513
+ rug: "rule:guard",
1514
+ ruv: "rule:value",
1515
+ ptg: "pretool:guard",
1516
+ sg: "stop:guard",
1517
+ ev: "eval",
1518
+ ol: "oracle:list",
1519
+ sa: "split:assess",
1520
+ shs: "sonar:hotspots",
1521
+ uir: "ui:routes",
1522
+ cs: "clone:scan",
1523
+ ca: "cases"
1524
+ };
1525
+
1526
+ // scripts/josh/josh-composite-arguments.ts
1527
+ var SHELL_INTERPRETERS = /* @__PURE__ */ new Set(["sh", "bash", "zsh", "dash"]);
1528
+ var SHELL_COMMAND_FLAG = "-c";
1529
+ var PATH_SEPARATOR = "/";
1530
+ var USAGE_ERROR_EXIT_CODE = 1;
1531
+ function is_shell_interpreter(executable) {
1532
+ return SHELL_INTERPRETERS.has(executable.split(PATH_SEPARATOR).at(-1) ?? executable);
1533
+ }
1534
+ function is_composite_shell(shell) {
1535
+ const [executable, flag] = shell ?? [];
1536
+ if (executable === void 0) return false;
1537
+ return is_shell_interpreter(executable) && flag === SHELL_COMMAND_FLAG;
1538
+ }
1539
+ function format_targets(targets) {
1540
+ return targets.map((target) => `josh ${target}`).join(" or ");
1541
+ }
1542
+ function format_rejection(cmd, targets) {
1543
+ const hint = targets.length > 0 ? `pass them to ${format_targets(targets)} instead` : "it runs a fixed sequence and forwards nothing";
1544
+ return `josh ${cmd} takes no extra arguments \u2014 ${hint}`;
1545
+ }
1546
+ function reject_extra_arguments(cmd, entry, extra) {
1547
+ if (extra.length === 0 || !is_composite_shell(entry.shell)) return void 0;
1548
+ return format_rejection(cmd, entry.argument_targets ?? []);
1549
+ }
1550
+ var composite_arguments = { format_rejection, is_composite_shell, reject_extra_arguments };
1551
+
1552
+ // scripts/josh/josh-in-process.ts
1553
+ import { realpathSync } from "node:fs";
1554
+ import { pathToFileURL } from "node:url";
1555
+ var TYPESCRIPT_EXTENSION = ".ts";
1556
+ var FAILURE_EXIT_CODE = 1;
1557
+ function is_typescript_dispatcher(dispatcher_url) {
1558
+ return dispatcher_url.endsWith(TYPESCRIPT_EXTENSION);
1559
+ }
1560
+ function can_run_in_process(entry, dispatcher_url) {
1561
+ if (entry.script === void 0 || entry.tsx_arguments !== void 0) return false;
1562
+ return is_typescript_dispatcher(dispatcher_url);
1563
+ }
1564
+ function read_exit_code() {
1565
+ const code = process.exitCode;
1566
+ return typeof code === "number" ? code : 0;
1567
+ }
1568
+ function resolve_real_path(script_path) {
1569
+ try {
1570
+ return realpathSync(script_path);
1571
+ } catch {
1572
+ return script_path;
1573
+ }
1574
+ }
1575
+ async function run_in_process(script_path, script_arguments) {
1576
+ const resolved_path = resolve_real_path(script_path);
1577
+ process.argv = [process.execPath, resolved_path, ...script_arguments];
1578
+ try {
1579
+ await import(pathToFileURL(resolved_path).href);
1580
+ } catch (error) {
1581
+ console.error(error);
1582
+ return FAILURE_EXIT_CODE;
1583
+ }
1584
+ return read_exit_code();
1585
+ }
1586
+ var josh_in_process = { can_run_in_process, run_in_process };
1587
+
1588
+ // scripts/josh/kit-only.ts
1589
+ function kit_only_notice(cmd) {
1590
+ return `\`josh ${cmd}\` is a kit-only command \u2014 run it from the kit repository (joshuafolkken/kit), not from a consumer project.`;
1591
+ }
1592
+ function is_kit_only(entry) {
1593
+ return entry.is_kit_only === true;
1594
+ }
1595
+ function kit_only_command_names() {
1596
+ return Object.entries(COMMAND_MAP).filter(([, entry]) => is_kit_only(entry)).map(([name]) => name);
1597
+ }
1598
+ var kit_only = {
1599
+ is_kit_only,
1600
+ command_names: kit_only_command_names,
1601
+ notice: kit_only_notice
1602
+ };
1603
+
1604
+ // scripts/josh/josh-logic.ts
1605
+ var COLUMN_WIDTH = 26;
1606
+ var ALIAS_PAD_WIDTH = 2;
1607
+ var TSX_BIN = "tsx";
1608
+ var TSX_PACKAGE = "tsx";
1609
+ var PACKAGE_JSON2 = "package.json";
1610
+ var UNKNOWN_COMMAND_EXIT_CODE = -1;
1611
+ function find_package_directory(start_directory) {
1612
+ let current = start_directory;
1613
+ while (!existsSync3(path3.join(current, PACKAGE_JSON2))) {
1614
+ const parent = path3.dirname(current);
1615
+ if (parent === current) return start_directory;
1616
+ current = parent;
1617
+ }
1618
+ return current;
1619
+ }
1620
+ var PACKAGE_DIR = find_package_directory(path3.dirname(fileURLToPath(import.meta.url)));
1621
+ function resolve_tsx_executable() {
1622
+ const candidates = [
1623
+ resolve_local_bin(PACKAGE_DIR, TSX_BIN),
1624
+ resolve_local_bin(process.cwd(), TSX_BIN)
1625
+ ];
1626
+ return candidates.find(existsSync3) ?? TSX_BIN;
1627
+ }
1628
+ function resolve_tsx_cli_entry() {
1629
+ for (const base_directory of [PACKAGE_DIR, process.cwd()]) {
1630
+ const cli_entry = resolve_package_bin(base_directory, TSX_PACKAGE, TSX_BIN);
1631
+ if (cli_entry !== void 0) return cli_entry;
1632
+ }
1633
+ return void 0;
1634
+ }
1635
+ function resolve_tsx_runner() {
1636
+ const cli_entry = resolve_tsx_cli_entry();
1637
+ if (cli_entry !== void 0) {
1638
+ return { executable: process.execPath, leading_arguments: [cli_entry] };
1639
+ }
1640
+ return { executable: resolve_tsx_executable(), leading_arguments: [] };
1641
+ }
1642
+ function read_package_version() {
1643
+ const raw = readFileSync3(path3.join(PACKAGE_DIR, PACKAGE_JSON2), "utf8");
1644
+ return package_version_schema.parse(JSON.parse(raw)).version;
1645
+ }
1646
+ var HEADER = `josh v${read_package_version()} \u2014 Joshua Folkken's dev toolkit`;
1647
+ var USAGE = "Usage: josh <command> [options]";
1648
+ var ALL_HINT = "Run 'josh --all' to list every available command.";
1649
+ function build_alias_lookup() {
1650
+ const lookup = /* @__PURE__ */ new Map();
1651
+ for (const [alias, cmd] of Object.entries(ALIASES)) lookup.set(cmd, alias);
1652
+ return lookup;
1653
+ }
1654
+ function resolve_alias(cmd) {
1655
+ return Object.hasOwn(ALIASES, cmd) ? ALIASES[cmd] ?? cmd : cmd;
1656
+ }
1657
+ function format_command_line(cmd, entry, alias) {
1658
+ const prefix = alias ? `${alias}, `.padEnd(ALIAS_PAD_WIDTH + ALIAS_PAD_WIDTH) : "";
1659
+ return ` ${(prefix + cmd).padEnd(COLUMN_WIDTH)}${entry.description}`;
1660
+ }
1661
+ function format_category_section(category, entries, alias_lookup) {
1662
+ const lines = entries.map(
1663
+ ([cmd, entry]) => format_command_line(cmd, entry, alias_lookup.get(cmd))
1664
+ );
1665
+ return [`${category}:`, ...lines].join("\n");
1666
+ }
1667
+ function is_visible_command(entry, is_all, is_consumer) {
1668
+ if (is_consumer && kit_only.is_kit_only(entry)) return false;
1669
+ return is_all || entry.reference[1] === "developer";
1670
+ }
1671
+ function collect_visible(is_all, is_consumer) {
1672
+ const by_category = new Map(
1673
+ CATEGORY_ORDER.map((cat) => [cat, []])
1674
+ );
1675
+ for (const [cmd, entry] of Object.entries(COMMAND_MAP)) {
1676
+ if (is_visible_command(entry, is_all, is_consumer)) {
1677
+ by_category.get(entry.category)?.push([cmd, entry]);
1678
+ }
1679
+ }
1680
+ return by_category;
1681
+ }
1682
+ function format_help(is_all = false, is_consumer = false) {
1683
+ const by_category = collect_visible(is_all, is_consumer);
1684
+ const alias_lookup = build_alias_lookup();
1685
+ const sections = CATEGORY_ORDER.map((cat) => [cat, by_category.get(cat) ?? []]).filter(([, entries]) => entries.length > 0).map(([cat, entries]) => format_category_section(cat, entries, alias_lookup));
1686
+ const footer = is_all ? USAGE : `${USAGE}
1687
+ ${ALL_HINT}`;
1688
+ return [HEADER, "", sections.join("\n\n"), "", footer].join("\n");
1689
+ }
1690
+ function all_command_names() {
1691
+ return [...Object.keys(COMMAND_MAP), ...Object.keys(ALIASES)];
1692
+ }
1693
+ function format_unknown_command(cmd) {
1694
+ const suggestion = command_suggest.closest_command(cmd, all_command_names());
1695
+ const hint = suggestion === void 0 ? "" : ` Did you mean '${suggestion}'?`;
1696
+ return `Unknown command: ${cmd}.${hint} Run 'josh --help' for common commands or 'josh --all' for the full list.`;
1697
+ }
1698
+ function should_use_shell(executable) {
1699
+ return process.platform === "win32" && executable !== process.execPath;
1700
+ }
1701
+ function spawn_script(tsx_executable, script_arguments) {
1702
+ const result = execaSync2(tsx_executable, script_arguments, {
1703
+ stdio: "inherit",
1704
+ shell: should_use_shell(tsx_executable),
1705
+ reject: false
1706
+ });
1707
+ return resolve_spawn_exit(tsx_executable, result);
1708
+ }
1709
+ function run_shell_command(shell, extra) {
1710
+ const [executable = "", ...rest_arguments] = shell;
1711
+ const result = execaSync2(executable, [...rest_arguments, ...extra], {
1712
+ stdio: "inherit",
1713
+ reject: false
1714
+ });
1715
+ return resolve_spawn_exit(executable, result);
1716
+ }
1717
+ function spawn_script_entry(entry, script_path, script_arguments) {
1718
+ const runner = resolve_tsx_runner();
1719
+ return spawn_script(runner.executable, [
1720
+ ...runner.leading_arguments,
1721
+ ...entry.tsx_arguments ?? [],
1722
+ script_path,
1723
+ ...script_arguments
1724
+ ]);
1725
+ }
1726
+ async function run_script_entry(entry, subcommand_arguments) {
1727
+ const script_path = path3.join(PACKAGE_DIR, entry.script ?? "");
1728
+ const script_arguments = [...entry.default_script_arguments ?? [], ...subcommand_arguments];
1729
+ if (josh_in_process.can_run_in_process(entry, import.meta.url)) {
1730
+ return await josh_in_process.run_in_process(script_path, script_arguments);
1731
+ }
1732
+ return spawn_script_entry(entry, script_path, script_arguments);
1733
+ }
1734
+ function pre_dispatch_exit(resolved, entry, subcommand_arguments, is_consumer) {
1735
+ if (is_consumer && kit_only.is_kit_only(entry)) {
1736
+ console.error(kit_only.notice(resolved));
1737
+ return USAGE_ERROR_EXIT_CODE;
1738
+ }
1739
+ const rejection = composite_arguments.reject_extra_arguments(
1740
+ resolved,
1741
+ entry,
1742
+ subcommand_arguments
1743
+ );
1744
+ if (rejection === void 0) return void 0;
1745
+ console.error(rejection);
1746
+ return USAGE_ERROR_EXIT_CODE;
1747
+ }
1748
+ async function dispatch_entry(entry, subcommand_arguments) {
1749
+ if (entry.shell) return run_shell_command(entry.shell, subcommand_arguments);
1750
+ return await run_script_entry(entry, subcommand_arguments);
1751
+ }
1752
+ async function run_command(cmd, subcommand_arguments, is_consumer = false) {
1753
+ const resolved = resolve_alias(cmd);
1754
+ const entry = Object.hasOwn(COMMAND_MAP, resolved) ? COMMAND_MAP[resolved] : void 0;
1755
+ if (!entry) return UNKNOWN_COMMAND_EXIT_CODE;
1756
+ const early_exit = pre_dispatch_exit(resolved, entry, subcommand_arguments, is_consumer);
1757
+ if (early_exit !== void 0) return early_exit;
1758
+ return await dispatch_entry(entry, subcommand_arguments);
1759
+ }
1760
+ var josh_logic = {
1761
+ format_help,
1762
+ format_unknown_command,
1763
+ run_command,
1764
+ spawn_script,
1765
+ run_shell_command
1766
+ };
1767
+
1768
+ // scripts/josh/josh.ts
1769
+ var ARGV_OFFSET = 2;
1770
+ var HELP_COMMANDS = /* @__PURE__ */ new Set(["help", "--help", "-h"]);
1771
+ var ALL_FLAG = "--all";
1772
+ function print_help(is_all, is_consumer) {
1773
+ console.info(josh_logic.format_help(is_all, is_consumer));
1774
+ }
1775
+ function handle_unknown(cmd) {
1776
+ console.error(josh_logic.format_unknown_command(cmd));
1777
+ process.exit(1);
1778
+ }
1779
+ function record_exit_code(exit_code) {
1780
+ if (exit_code !== 0) process.exitCode = exit_code;
1781
+ }
1782
+ async function main() {
1783
+ const cmd = process.argv[ARGV_OFFSET];
1784
+ const is_all = process.argv.includes(ALL_FLAG);
1785
+ const is_consumer = doctor_consumer.is_kit_consumer(find_package_directory(process.cwd()));
1786
+ if (!cmd || cmd === ALL_FLAG || HELP_COMMANDS.has(cmd)) {
1787
+ print_help(is_all, is_consumer);
1788
+ return;
1789
+ }
1790
+ const subcommand_arguments = process.argv.slice(ARGV_OFFSET + 1);
1791
+ const exit_code = await josh_logic.run_command(cmd, subcommand_arguments, is_consumer);
1792
+ if (exit_code === UNKNOWN_COMMAND_EXIT_CODE) handle_unknown(cmd);
1793
+ record_exit_code(exit_code);
1794
+ }
1795
+ await main();