@ngockhoale/ukit 1.1.6

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 (344) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/LICENSE +21 -0
  3. package/README.md +189 -0
  4. package/bin/ukit +30 -0
  5. package/manifests/platform.full.yaml +1194 -0
  6. package/package.json +71 -0
  7. package/scripts/bug/triage.mjs +37 -0
  8. package/scripts/index/build-index.mjs +35 -0
  9. package/scripts/index/query-index.mjs +92 -0
  10. package/scripts/index/refresh-index.mjs +85 -0
  11. package/scripts/release/verify-release.mjs +56 -0
  12. package/src/bug/triageBug.js +123 -0
  13. package/src/cli/adapters.js +148 -0
  14. package/src/cli/commands/diff.js +51 -0
  15. package/src/cli/commands/doctor.js +125 -0
  16. package/src/cli/commands/indexArgs.js +73 -0
  17. package/src/cli/commands/indexTools.js +509 -0
  18. package/src/cli/commands/install.js +293 -0
  19. package/src/cli/commands/memory.js +126 -0
  20. package/src/cli/commands/status.js +8 -0
  21. package/src/cli/commands/uninstall.js +51 -0
  22. package/src/cli/index.js +109 -0
  23. package/src/context/detectProjectContext.js +49 -0
  24. package/src/context/detectProviders.js +12 -0
  25. package/src/core/applyPlan.js +89 -0
  26. package/src/core/buildPlan.js +228 -0
  27. package/src/core/compact/index.js +294 -0
  28. package/src/core/compact/threshold.js +936 -0
  29. package/src/core/diffPlan.js +73 -0
  30. package/src/core/ensureGitignore.js +117 -0
  31. package/src/core/fileOps.js +188 -0
  32. package/src/core/memory/hygiene.js +160 -0
  33. package/src/core/memory/index.js +2 -0
  34. package/src/core/memory/retrieval.js +476 -0
  35. package/src/core/memory/store.js +202 -0
  36. package/src/core/metadata.js +132 -0
  37. package/src/core/migrateLegacy.js +139 -0
  38. package/src/core/output/index.js +1309 -0
  39. package/src/core/paths.js +13 -0
  40. package/src/core/report.js +17 -0
  41. package/src/core/router/advisor.js +42 -0
  42. package/src/core/router/index.js +2 -0
  43. package/src/core/router/router.js +164 -0
  44. package/src/core/runInstallPipeline.js +365 -0
  45. package/src/core/runtimeConfig.js +190 -0
  46. package/src/core/runtimePaths.js +24 -0
  47. package/src/core/status.js +186 -0
  48. package/src/core/token/index.js +328 -0
  49. package/src/core/uninstall.js +246 -0
  50. package/src/core/validation/confidence.js +89 -0
  51. package/src/core/validation/index.js +2 -0
  52. package/src/core/validation/validator.js +165 -0
  53. package/src/index/buildIndex.js +1392 -0
  54. package/src/index/gitHooks.js +109 -0
  55. package/src/index/importResolution.js +377 -0
  56. package/src/index/languageTools.js +127 -0
  57. package/src/index/paths.js +27 -0
  58. package/src/index/queryIndex.js +637 -0
  59. package/src/index/relatedTests.js +237 -0
  60. package/src/index/resolveContext.js +345 -0
  61. package/src/index/routeCatalog.js +258 -0
  62. package/src/index/taskRouting.js +677 -0
  63. package/src/index/verificationPlan.js +437 -0
  64. package/src/manifest/loadManifest.js +22 -0
  65. package/src/manifest/selectItems.js +78 -0
  66. package/src/manifest/validateManifest.js +115 -0
  67. package/src/render/buildVariables.js +39 -0
  68. package/src/render/renderTemplate.js +44 -0
  69. package/src/stack/detectStack.js +213 -0
  70. package/templates/.claude/agents/bug-debugger.md +57 -0
  71. package/templates/.claude/agents/feature-implementer.md +55 -0
  72. package/templates/.claude/config/providers.md +25 -0
  73. package/templates/.claude/hooks/auto-allow-bash.sh +155 -0
  74. package/templates/.claude/hooks/auto-prune-bash.sh +75 -0
  75. package/templates/.claude/hooks/block-dangerous.sh +54 -0
  76. package/templates/.claude/hooks/compress-output.sh +17 -0
  77. package/templates/.claude/hooks/protect-files.sh +37 -0
  78. package/templates/.claude/hooks/reinject-context.sh +28 -0
  79. package/templates/.claude/hooks/session-start.md +13 -0
  80. package/templates/.claude/hooks/skill-router.sh +1681 -0
  81. package/templates/.claude/hooks/verification-guard.sh +271 -0
  82. package/templates/.claude/settings.json +144 -0
  83. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  84. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  85. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  86. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  87. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  88. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  89. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  90. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  91. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  92. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  93. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  94. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  95. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  96. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  97. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  98. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  99. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  100. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  101. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  102. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  103. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  104. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  105. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  106. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  107. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  108. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  109. package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  110. package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  111. package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  112. package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  113. package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  114. package/templates/.claude/skills/_shared/ooxml/schemas/mce/mc.xsd +75 -0
  115. package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  116. package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  117. package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  118. package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  119. package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  120. package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  121. package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  122. package/templates/.claude/skills/_shared/ooxml/scripts/pack.py +159 -0
  123. package/templates/.claude/skills/_shared/ooxml/scripts/unpack.py +29 -0
  124. package/templates/.claude/skills/_shared/ooxml/scripts/validate.py +69 -0
  125. package/templates/.claude/skills/_shared/ooxml/scripts/validation/__init__.py +15 -0
  126. package/templates/.claude/skills/_shared/ooxml/scripts/validation/base.py +951 -0
  127. package/templates/.claude/skills/_shared/ooxml/scripts/validation/docx.py +274 -0
  128. package/templates/.claude/skills/_shared/ooxml/scripts/validation/pptx.py +315 -0
  129. package/templates/.claude/skills/_shared/ooxml/scripts/validation/redlining.py +279 -0
  130. package/templates/.claude/skills/backend-api/SKILL.md +26 -0
  131. package/templates/.claude/skills/canvas-design/LICENSE.txt +202 -0
  132. package/templates/.claude/skills/canvas-design/SKILL.md +130 -0
  133. package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  134. package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  135. package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  136. package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  137. package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  138. package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  139. package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  140. package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  141. package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  142. package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  143. package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  144. package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  145. package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  146. package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  147. package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  148. package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  149. package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  150. package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  151. package/templates/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  152. package/templates/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  153. package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  154. package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  155. package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  156. package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  157. package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  158. package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  159. package/templates/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  160. package/templates/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  161. package/templates/.claude/skills/code-review/SKILL.md +97 -0
  162. package/templates/.claude/skills/debugging-toolkit/SKILL.md +156 -0
  163. package/templates/.claude/skills/delivery/SKILL.md +92 -0
  164. package/templates/.claude/skills/discover-security/SKILL.md +86 -0
  165. package/templates/.claude/skills/docker-packaging/SKILL.md +60 -0
  166. package/templates/.claude/skills/docs-manager/SKILL.md +465 -0
  167. package/templates/.claude/skills/docs-manager/init-project-docs.sh +70 -0
  168. package/templates/.claude/skills/docs-manager/templates/README.md.template +50 -0
  169. package/templates/.claude/skills/docs-manager/templates/agent-roles.md.template +24 -0
  170. package/templates/.claude/skills/docs-manager/templates/coding-conventions.md.template +28 -0
  171. package/templates/.claude/skills/docs-manager/templates/memory.md.template +30 -0
  172. package/templates/.claude/skills/docs-manager/templates/onboarding.md.template +20 -0
  173. package/templates/.claude/skills/docs-manager/templates/project.md.template +26 -0
  174. package/templates/.claude/skills/docs-quality/SKILL.md +148 -0
  175. package/templates/.claude/skills/docx/LICENSE.txt +30 -0
  176. package/templates/.claude/skills/docx/SKILL.md +197 -0
  177. package/templates/.claude/skills/docx/docx-js.md +350 -0
  178. package/templates/.claude/skills/docx/ooxml.md +610 -0
  179. package/templates/.claude/skills/docx/scripts/__init__.py +1 -0
  180. package/templates/.claude/skills/docx/scripts/document.py +1276 -0
  181. package/templates/.claude/skills/docx/scripts/templates/comments.xml +3 -0
  182. package/templates/.claude/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  183. package/templates/.claude/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  184. package/templates/.claude/skills/docx/scripts/templates/commentsIds.xml +3 -0
  185. package/templates/.claude/skills/docx/scripts/templates/people.xml +3 -0
  186. package/templates/.claude/skills/docx/scripts/utilities.py +374 -0
  187. package/templates/.claude/skills/duraone/SKILL.md +204 -0
  188. package/templates/.claude/skills/duraone/references/backend.md +636 -0
  189. package/templates/.claude/skills/duraone/references/frontend.md +1506 -0
  190. package/templates/.claude/skills/duraone/references/sql.md +631 -0
  191. package/templates/.claude/skills/duraone/references/workflow.md +520 -0
  192. package/templates/.claude/skills/executing-plans/SKILL.md +76 -0
  193. package/templates/.claude/skills/file-organizer/SKILL.md +433 -0
  194. package/templates/.claude/skills/frontend/SKILL.md +26 -0
  195. package/templates/.claude/skills/frontend-design/LICENSE.txt +177 -0
  196. package/templates/.claude/skills/frontend-design/SKILL.md +42 -0
  197. package/templates/.claude/skills/frontend-vue/SKILL.md +127 -0
  198. package/templates/.claude/skills/frontend-vue/components/Control/Box.vue +137 -0
  199. package/templates/.claude/skills/frontend-vue/components/Control/Button.vue +93 -0
  200. package/templates/.claude/skills/frontend-vue/components/Control/ButtonBar.vue +29 -0
  201. package/templates/.claude/skills/frontend-vue/components/Control/ButtonFloat.vue +62 -0
  202. package/templates/.claude/skills/frontend-vue/components/Control/CheckButton.vue +75 -0
  203. package/templates/.claude/skills/frontend-vue/components/Control/Checkbox.vue +58 -0
  204. package/templates/.claude/skills/frontend-vue/components/Control/Datetime.vue +148 -0
  205. package/templates/.claude/skills/frontend-vue/components/Control/Dropdownlist.vue +156 -0
  206. package/templates/.claude/skills/frontend-vue/components/Control/Input.vue +106 -0
  207. package/templates/.claude/skills/frontend-vue/components/Control/Label.vue +38 -0
  208. package/templates/.claude/skills/frontend-vue/components/Control/Master/BoxColumn.vue +24 -0
  209. package/templates/.claude/skills/frontend-vue/components/Control/Popup/Confirm.vue +33 -0
  210. package/templates/.claude/skills/frontend-vue/components/Control/Popup/Info.vue +32 -0
  211. package/templates/.claude/skills/frontend-vue/components/Control/Popup/ModalInfo.vue +39 -0
  212. package/templates/.claude/skills/frontend-vue/components/Control/Popup/Reject.vue +64 -0
  213. package/templates/.claude/skills/frontend-vue/components/Control/Tag.vue +82 -0
  214. package/templates/.claude/skills/frontend-vue/components/Control/Upload.vue +61 -0
  215. package/templates/.claude/skills/frontend-vue/components/ControlMobile/Dropdownlist.vue +103 -0
  216. package/templates/.claude/skills/frontend-vue/components/ControlMobile/PagingBar.vue +108 -0
  217. package/templates/.claude/skills/frontend-vue/components/ControlMobile/UploadImage.vue +137 -0
  218. package/templates/.claude/skills/frontend-vue/components/Grid/AG.vue +806 -0
  219. package/templates/.claude/skills/frontend-vue/components/Grid/AntTable.vue +253 -0
  220. package/templates/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditor.vue +43 -0
  221. package/templates/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditorEnable.vue +55 -0
  222. package/templates/.claude/skills/frontend-vue/components/Grid/HtmlTable.vue +40 -0
  223. package/templates/.claude/skills/frontend-vue/components/PDFViewer.vue +25 -0
  224. package/templates/.claude/skills/frontend-vue/components/Panel/FormView.vue +309 -0
  225. package/templates/.claude/skills/frontend-vue/components/Partial/Footer.vue +23 -0
  226. package/templates/.claude/skills/frontend-vue/components/Partial/Header.vue +265 -0
  227. package/templates/.claude/skills/frontend-vue/components/Partial/Sidebar.vue +122 -0
  228. package/templates/.claude/skills/frontend-vue/components/Template.vue +16 -0
  229. package/templates/.claude/skills/frontend-vue/components/View/Form.vue +89 -0
  230. package/templates/.claude/skills/frontend-vue/composables/indexDBStore.js +140 -0
  231. package/templates/.claude/skills/frontend-vue/composables/masterApi.js +362 -0
  232. package/templates/.claude/skills/frontend-vue/composables/state.js +578 -0
  233. package/templates/.claude/skills/frontend-vue/composables/useRequest.js +221 -0
  234. package/templates/.claude/skills/frontend-vue/composables/useSession.js +179 -0
  235. package/templates/.claude/skills/frontend-vue/composables/useTranslation.js +54 -0
  236. package/templates/.claude/skills/frontend-vue/composables/useWebSocket.js +257 -0
  237. package/templates/.claude/skills/frontend-vue/composables/userObj.js +111 -0
  238. package/templates/.claude/skills/frontend-vue/composables/utils.js +322 -0
  239. package/templates/.claude/skills/frontend-vue/reference/composables-example.vue +320 -0
  240. package/templates/.claude/skills/frontend-vue/reference/form-example.vue +183 -0
  241. package/templates/.claude/skills/frontend-vue/reference/grid-example.vue +147 -0
  242. package/templates/.claude/skills/frontend-vue/reference/masterdata-example/[id].vue +106 -0
  243. package/templates/.claude/skills/frontend-vue/reference/masterdata-example/index.vue +58 -0
  244. package/templates/.claude/skills/frontend-vue/reference/popup-example.vue +159 -0
  245. package/templates/.claude/skills/pdf/LICENSE.txt +30 -0
  246. package/templates/.claude/skills/pdf/SKILL.md +294 -0
  247. package/templates/.claude/skills/pdf/forms.md +205 -0
  248. package/templates/.claude/skills/pdf/reference.md +612 -0
  249. package/templates/.claude/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  250. package/templates/.claude/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  251. package/templates/.claude/skills/pdf/scripts/check_fillable_fields.py +12 -0
  252. package/templates/.claude/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  253. package/templates/.claude/skills/pdf/scripts/create_validation_image.py +41 -0
  254. package/templates/.claude/skills/pdf/scripts/extract_form_field_info.py +152 -0
  255. package/templates/.claude/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  256. package/templates/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  257. package/templates/.claude/skills/pdf-processing/SKILL.md +107 -0
  258. package/templates/.claude/skills/pdf-processing-pro/FORMS.md +610 -0
  259. package/templates/.claude/skills/pdf-processing-pro/OCR.md +137 -0
  260. package/templates/.claude/skills/pdf-processing-pro/SKILL.md +296 -0
  261. package/templates/.claude/skills/pdf-processing-pro/TABLES.md +626 -0
  262. package/templates/.claude/skills/pdf-processing-pro/scripts/analyze_form.py +307 -0
  263. package/templates/.claude/skills/postgres/SKILL.md +69 -0
  264. package/templates/.claude/skills/postgres/reference/fn_get_examples.sql +208 -0
  265. package/templates/.claude/skills/postgres/reference/fn_rpt_examples.sql +239 -0
  266. package/templates/.claude/skills/postgres/reference/utility_functions.sql +94 -0
  267. package/templates/.claude/skills/pptx/LICENSE.txt +30 -0
  268. package/templates/.claude/skills/pptx/SKILL.md +484 -0
  269. package/templates/.claude/skills/pptx/html2pptx.md +625 -0
  270. package/templates/.claude/skills/pptx/ooxml.md +427 -0
  271. package/templates/.claude/skills/pptx/scripts/html2pptx.js +979 -0
  272. package/templates/.claude/skills/pptx/scripts/inventory.py +1020 -0
  273. package/templates/.claude/skills/pptx/scripts/rearrange.py +231 -0
  274. package/templates/.claude/skills/pptx/scripts/replace.py +385 -0
  275. package/templates/.claude/skills/pptx/scripts/thumbnail.py +450 -0
  276. package/templates/.claude/skills/repo-maintenance/SKILL.md +97 -0
  277. package/templates/.claude/skills/research/EXAMPLES.md +434 -0
  278. package/templates/.claude/skills/research/REFERENCE.md +399 -0
  279. package/templates/.claude/skills/research/SKILL.md +136 -0
  280. package/templates/.claude/skills/root-cause-tracing/SKILL.md +174 -0
  281. package/templates/.claude/skills/root-cause-tracing/find-polluter.sh +63 -0
  282. package/templates/.claude/skills/sharing-skills/SKILL.md +194 -0
  283. package/templates/.claude/skills/sql-optimization-patterns/SKILL.md +493 -0
  284. package/templates/.claude/skills/subagent-driven-development/SKILL.md +189 -0
  285. package/templates/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  286. package/templates/.claude/skills/systematic-debugging/SKILL.md +295 -0
  287. package/templates/.claude/skills/systematic-debugging/test-academic.md +14 -0
  288. package/templates/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  289. package/templates/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  290. package/templates/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  291. package/templates/.claude/skills/test-driven-development/SKILL.md +364 -0
  292. package/templates/.claude/skills/testing-anti-patterns/SKILL.md +302 -0
  293. package/templates/.claude/skills/testing-quality/SKILL.md +97 -0
  294. package/templates/.claude/skills/verification-before-completion/SKILL.md +139 -0
  295. package/templates/.claude/skills/webapp-testing/LICENSE.txt +202 -0
  296. package/templates/.claude/skills/webapp-testing/SKILL.md +96 -0
  297. package/templates/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
  298. package/templates/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
  299. package/templates/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
  300. package/templates/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
  301. package/templates/.claude/ukit/index/build-index.mjs +28 -0
  302. package/templates/.claude/ukit/index/cache-utils.mjs +140 -0
  303. package/templates/.claude/ukit/index/lib/index-core.mjs +2800 -0
  304. package/templates/.claude/ukit/index/query-index.mjs +150 -0
  305. package/templates/.claude/ukit/index/refresh-index.mjs +57 -0
  306. package/templates/.claude/ukit/index/reset-auto-permissions.mjs +76 -0
  307. package/templates/.claude/ukit/index/resolve-context.mjs +279 -0
  308. package/templates/.claude/ukit/index/route-catalog.mjs +258 -0
  309. package/templates/.claude/ukit/index/route-task.mjs +1994 -0
  310. package/templates/.claude/ukit/index/triage.mjs +133 -0
  311. package/templates/.claude/ukit/index/verify-context.mjs +689 -0
  312. package/templates/.claude/ukit/runtime/compact-threshold.mjs +1013 -0
  313. package/templates/.claude/ukit/runtime/output-compression.mjs +1340 -0
  314. package/templates/.claude/ukit/runtime/reinject-context.mjs +874 -0
  315. package/templates/.claude/ukit/runtime/token-utils.mjs +500 -0
  316. package/templates/.codex/README.md +83 -0
  317. package/templates/.codex/settings.json +187 -0
  318. package/templates/.gitignore +75 -0
  319. package/templates/AGENTS.md +116 -0
  320. package/templates/CLAUDE.md +93 -0
  321. package/templates/adapter-presets/antigravity/README.md +22 -0
  322. package/templates/adapter-presets/antigravity/rules.md +49 -0
  323. package/templates/adapter-presets/claude/settings.local.json +42 -0
  324. package/templates/adapter-presets/codex/settings.local.json +6 -0
  325. package/templates/adapter-presets/opencode/opencode.template.json +1 -0
  326. package/templates/docs/BUGFIX.md +20 -0
  327. package/templates/docs/BUG_INDEX.md +12 -0
  328. package/templates/docs/BUG_METRICS.md +7 -0
  329. package/templates/docs/BUG_TEMPLATE.md +13 -0
  330. package/templates/docs/CODE_MAP.md +35 -0
  331. package/templates/docs/INSTALL.md +113 -0
  332. package/templates/docs/MEMORY.md +49 -0
  333. package/templates/docs/PROJECT.md +50 -0
  334. package/templates/docs/UKIT_USAGE_GUIDE.md +147 -0
  335. package/templates/docs/WORKLOG.md +10 -0
  336. package/templates/ukit/README.md +14 -0
  337. package/templates/ukit/storage/cache/compact-history.json +3 -0
  338. package/templates/ukit/storage/cache/compact-pressure.json +1 -0
  339. package/templates/ukit/storage/cache/output-history.json +3 -0
  340. package/templates/ukit/storage/cache/prompt-cache.json +3 -0
  341. package/templates/ukit/storage/config.json +37 -0
  342. package/templates/ukit/storage/memory/projects/.gitkeep +2 -0
  343. package/templates/ukit/storage/memory/sessions/.gitkeep +0 -0
  344. package/templates/ukit/storage/memory/user.json +5 -0
@@ -0,0 +1,293 @@
1
+ import { buildPathConfig } from '../../core/paths.js';
2
+ import { runInstallPipeline } from '../../core/runInstallPipeline.js';
3
+ import { buildCodeIndex } from '../../index/buildIndex.js';
4
+ import { installIndexRefreshHooks } from '../../index/gitHooks.js';
5
+ import fs from 'node:fs/promises';
6
+ import { pathExists, readJsonIfExists, removeFileOrLinkOnly } from '../../core/fileOps.js';
7
+ import { removeTrackedPathsFromMetadata } from '../../core/metadata.js';
8
+ import {
9
+ ADAPTER_BY_KEY,
10
+ DEFAULT_OPTIONAL_TOOL_KEYS,
11
+ parseToolsArg,
12
+ resolveOptionalToolKeys,
13
+ toSelectedAdapterItemIds,
14
+ formatSelectedTools,
15
+ } from '../adapters.js';
16
+ import readline from 'node:readline/promises';
17
+ import { stdin as input, stdout as output } from 'node:process';
18
+ import path from 'node:path';
19
+
20
+ function getDeselectedAdapterKeys(optionalToolKeys) {
21
+ const selected = new Set(optionalToolKeys);
22
+ return DEFAULT_OPTIONAL_TOOL_KEYS.filter((key) => !selected.has(key));
23
+ }
24
+
25
+ async function adapterHasManagedFiles(projectRoot, adapter) {
26
+ const existingPaths = await getExistingManagedPaths(projectRoot, adapter);
27
+ return existingPaths.length > 0;
28
+ }
29
+
30
+ async function getExistingManagedPaths(projectRoot, adapter) {
31
+ const existingPaths = [];
32
+ for (const relativePath of adapter.managedPaths) {
33
+ const absolutePath = path.join(projectRoot, relativePath);
34
+ try {
35
+ // Use lstat (not access) so broken symlinks are also detected.
36
+ // fs.access follows the link and throws on a broken symlink;
37
+ // fs.lstat returns info about the link itself regardless of target.
38
+ await fs.lstat(absolutePath);
39
+ existingPaths.push(relativePath);
40
+ } catch {
41
+ // path does not exist at all
42
+ }
43
+ }
44
+ return existingPaths;
45
+ }
46
+
47
+ function normalizeTrackedPath(value) {
48
+ if (typeof value !== 'string') {
49
+ return null;
50
+ }
51
+
52
+ const trimmed = value.trim();
53
+ if (!trimmed) {
54
+ return null;
55
+ }
56
+
57
+ return trimmed.replace(/\\/g, '/');
58
+ }
59
+
60
+ function isSameOrDescendantPath(candidatePath, parentPath) {
61
+ if (!candidatePath || !parentPath) {
62
+ return false;
63
+ }
64
+
65
+ return candidatePath === parentPath || candidatePath.startsWith(`${parentPath}/`);
66
+ }
67
+
68
+ async function loadTrackedManagedPathSet(projectRoot) {
69
+ const installMetaPath = path.join(projectRoot, '.claude', 'ukit', '.ukit', 'install.json');
70
+ const installMeta = await readJsonIfExists(installMetaPath);
71
+ if (installMeta?.tool !== 'ukit' || !Array.isArray(installMeta.files)) {
72
+ return null;
73
+ }
74
+
75
+ return new Set(
76
+ installMeta.files
77
+ .map((entry) => normalizeTrackedPath(typeof entry === 'string' ? entry : entry?.p))
78
+ .filter(Boolean),
79
+ );
80
+ }
81
+
82
+ async function promptYesNo(line, question) {
83
+ while (true) {
84
+ const answer = (await line.question(question)).trim().toLowerCase();
85
+
86
+ if (answer === '') {
87
+ return false;
88
+ }
89
+
90
+ if (answer === 'y' || answer === 'yes') {
91
+ return true;
92
+ }
93
+
94
+ if (answer === 'n' || answer === 'no') {
95
+ return false;
96
+ }
97
+
98
+ console.log('[UKit] Please answer y/yes or n/no.');
99
+ }
100
+ }
101
+
102
+ export async function pruneDeselectedAdapters({
103
+ projectRoot,
104
+ optionalToolKeys,
105
+ io = { input, output },
106
+ createInterface = readline.createInterface,
107
+ }) {
108
+ const retainedManagedPaths = [];
109
+ const installMetaPath = path.join(projectRoot, '.claude', 'ukit', '.ukit', 'install.json');
110
+ const deselectedKeys = getDeselectedAdapterKeys(optionalToolKeys);
111
+ if (deselectedKeys.length === 0) {
112
+ return { retainedManagedPaths };
113
+ }
114
+ const trackedManagedPathSet = await loadTrackedManagedPathSet(projectRoot);
115
+ if (!trackedManagedPathSet || trackedManagedPathSet.size === 0) {
116
+ return { retainedManagedPaths };
117
+ }
118
+
119
+ const existingDeselectedAdapters = [];
120
+ for (const key of deselectedKeys) {
121
+ const adapter = ADAPTER_BY_KEY.get(key);
122
+ if (!adapter) {
123
+ continue;
124
+ }
125
+
126
+ const existingManagedPaths = (await getExistingManagedPaths(projectRoot, adapter))
127
+ .filter((relativePath) =>
128
+ [...trackedManagedPathSet].some((trackedPath) => isSameOrDescendantPath(trackedPath, relativePath)),
129
+ );
130
+ if (existingManagedPaths.length > 0) {
131
+ existingDeselectedAdapters.push({ adapter, existingManagedPaths });
132
+ }
133
+ }
134
+
135
+ if (existingDeselectedAdapters.length === 0) {
136
+ return { retainedManagedPaths };
137
+ }
138
+
139
+ const { input: inputStream, output: outputStream } = io;
140
+ if (!inputStream?.isTTY || !outputStream?.isTTY) {
141
+ const adapterNames = existingDeselectedAdapters.map(({ adapter }) => adapter.label).join(', ');
142
+ await removeTrackedPathsFromMetadata({
143
+ installMetaPath,
144
+ projectRoot,
145
+ removeRelativePaths: existingDeselectedAdapters.flatMap(({ existingManagedPaths }) => existingManagedPaths),
146
+ });
147
+ console.log(
148
+ `[UKit] Deselected adapters with existing files detected (${adapterNames}). Skipping removal in non-interactive mode.`,
149
+ );
150
+ return { retainedManagedPaths: [...new Set(retainedManagedPaths)] };
151
+ }
152
+
153
+ const line = createInterface({ input: inputStream, output: outputStream });
154
+
155
+ try {
156
+ for (const { adapter, existingManagedPaths } of existingDeselectedAdapters) {
157
+ const shouldRemove = await promptYesNo(
158
+ line,
159
+ `[UKit] ${adapter.label} is deselected, but existing files were found. Remove now? (y/N): `,
160
+ );
161
+
162
+ if (!shouldRemove) {
163
+ await removeTrackedPathsFromMetadata({
164
+ installMetaPath,
165
+ projectRoot,
166
+ removeRelativePaths: existingManagedPaths,
167
+ });
168
+ continue;
169
+ }
170
+
171
+ let removedCount = 0;
172
+ for (const relativePath of adapter.managedPaths) {
173
+ const absolutePath = path.join(projectRoot, relativePath);
174
+ const removed = await removeFileOrLinkOnly(absolutePath);
175
+ if (removed) {
176
+ removedCount += 1;
177
+ await removeTrackedPathsFromMetadata({
178
+ installMetaPath,
179
+ projectRoot,
180
+ removeRelativePaths: [relativePath],
181
+ });
182
+ } else if (await pathExists(absolutePath)) {
183
+ console.log(
184
+ `[UKit] Skipping removal of ${relativePath} because it is not a symlink. Remove it manually if intended.`,
185
+ );
186
+ await removeTrackedPathsFromMetadata({
187
+ installMetaPath,
188
+ projectRoot,
189
+ removeRelativePaths: [relativePath],
190
+ });
191
+ }
192
+ }
193
+
194
+ console.log(`[UKit] Removed ${removedCount} ${adapter.label} path(s).`);
195
+ }
196
+ } finally {
197
+ line.close();
198
+ }
199
+
200
+ return { retainedManagedPaths: [...new Set(retainedManagedPaths)] };
201
+ }
202
+
203
+ export async function runInstall({ packageRoot, projectRoot, packageVersion, argv = [] }) {
204
+ const toolsArg = parseToolsArg(argv);
205
+ const selectedOptionalTools = resolveOptionalToolKeys(toolsArg);
206
+
207
+ const pruneResult = await pruneDeselectedAdapters({
208
+ projectRoot,
209
+ optionalToolKeys: selectedOptionalTools,
210
+ });
211
+
212
+ const selectedAdapterItemIds = toSelectedAdapterItemIds(selectedOptionalTools);
213
+ const pathConfig = buildPathConfig({ packageRoot, projectRoot });
214
+
215
+ const result = await runInstallPipeline({
216
+ packageVersion,
217
+ pathConfig,
218
+ dryRun: false,
219
+ selectedAdapterItemIds,
220
+ retainedManagedRelativePaths: pruneResult?.retainedManagedPaths ?? [],
221
+ });
222
+
223
+ const { create, update, unchanged, skip } = result.summary;
224
+
225
+ console.log(`[UKit] Project: ${result.projectContext.project.name}`);
226
+ console.log(`[UKit] Manifest: ${result.manifest.name} (v${result.manifest.version})`);
227
+ console.log(`[UKit] Detected packs: ${result.stackContext.detectedPacks.join(', ')}`);
228
+ console.log(`[UKit] Tools selected: ${formatSelectedTools(selectedOptionalTools)}`);
229
+
230
+ if (create === 0 && update === 0) {
231
+ console.log(`[UKit] Already up to date. (unchanged=${unchanged}, skip=${skip})`);
232
+ } else {
233
+ console.log(
234
+ `[UKit] Summary: create=${create}, update=${update}, unchanged=${unchanged}, skip=${skip} (user files, not overwritten)`,
235
+ );
236
+ }
237
+
238
+ const providerNames = Object.keys(result.providerContext.providers);
239
+ const providerStatus = providerNames
240
+ .map((name) => `${name}=${result.providerContext.providers[name]?.supported ?? 'unknown'}`)
241
+ .join(', ');
242
+ console.log(`[UKit] Providers: ${providerStatus}, all=${result.providerContext.allSupported}`);
243
+
244
+ const docsPaths = [
245
+ path.join(projectRoot, 'docs', 'PROJECT.md'),
246
+ path.join(projectRoot, 'docs', 'MEMORY.md'),
247
+ path.join(projectRoot, 'docs', 'WORKLOG.md'),
248
+ ];
249
+ const docsLabels = ['docs/PROJECT.md', 'docs/MEMORY.md', 'docs/WORKLOG.md'];
250
+ const missingDocs = [];
251
+ for (let i = 0; i < docsPaths.length; i++) {
252
+ if (!(await pathExists(docsPaths[i]))) {
253
+ missingDocs.push(docsLabels[i]);
254
+ }
255
+ }
256
+
257
+ if (missingDocs.length > 0) {
258
+ console.log(`[UKit] Missing docs — fill these in before first use: ${missingDocs.join(', ')}`);
259
+ } else {
260
+ console.log('[UKit] Docs baseline ready: docs/PROJECT.md, docs/MEMORY.md, docs/WORKLOG.md');
261
+ console.log('[UKit] Fill them once with real project context for the best results.');
262
+ }
263
+
264
+ let indexSummary;
265
+ try {
266
+ indexSummary = await buildCodeIndex({ rootDir: projectRoot });
267
+ } catch (error) {
268
+ console.log('[UKit] Install files synced, but source index build failed.');
269
+ console.log('[UKit] Fix the repo state, then rerun `ukit install` so the AI can index source code first.');
270
+ throw error;
271
+ }
272
+
273
+ console.log(
274
+ `[UKit] Index cache ready: files=${indexSummary.fileCount}, symbols=${indexSummary.symbolCount}, cache=${indexSummary.indexDir}`,
275
+ );
276
+
277
+ try {
278
+ const hookResult = await installIndexRefreshHooks({ projectRoot });
279
+ console.log(
280
+ `[UKit] Index auto-refresh hooks: installed=${hookResult.installed}, unchanged=${hookResult.unchanged}`,
281
+ );
282
+ } catch (error) {
283
+ console.log(
284
+ `[UKit] Index auto-refresh hooks skipped: ${error?.message ?? String(error)}`,
285
+ );
286
+ }
287
+
288
+ console.log('[UKit] Install completed.');
289
+ console.log('[UKit] Team rule: remember only `ukit install`.');
290
+ console.log(
291
+ '[UKit] Next: if this is the first install, fill the docs baseline once. Then open your AI tool and give a natural-language task.',
292
+ );
293
+ }
@@ -0,0 +1,126 @@
1
+ import {
2
+ exportMemory,
3
+ forgetMemoryItem,
4
+ listMemoryItems,
5
+ } from '../../core/memory/store.js';
6
+ import { getContextInjection, search } from '../../core/memory/retrieval.js';
7
+ import { inspectRuntimeConfig } from '../../core/runtimeConfig.js';
8
+ import { buildRuntimePaths } from '../../core/runtimePaths.js';
9
+ import { pathExists } from '../../core/fileOps.js';
10
+ import { detectProjectContext } from '../../context/detectProjectContext.js';
11
+
12
+ const HELP_FLAGS = new Set(['--help', '-h', 'help']);
13
+
14
+ export async function runMemory({ projectRoot, argv = [] }) {
15
+ const runtimePaths = buildRuntimePaths(projectRoot);
16
+ if (!(await pathExists(runtimePaths.runtimeRoot))) {
17
+ throw new Error('Shared UKit runtime not found. Run `ukit install` first.');
18
+ }
19
+
20
+ const [subcommandRaw, ...rest] = argv;
21
+ const subcommand = (subcommandRaw ?? 'list').toLowerCase();
22
+
23
+ if (HELP_FLAGS.has(subcommand)) {
24
+ printMemoryHelp();
25
+ return;
26
+ }
27
+
28
+ if (subcommand === 'list') {
29
+ const items = await listMemoryItems(projectRoot);
30
+ if (items.length === 0) {
31
+ console.log('[UKit] No memory items found.');
32
+ return;
33
+ }
34
+
35
+ for (const item of items) {
36
+ console.log(`${item.id} — ${item.summary}`);
37
+ }
38
+ return;
39
+ }
40
+
41
+ if (subcommand === 'search') {
42
+ const query = rest.join(' ').trim();
43
+ if (!query) {
44
+ throw new Error('Missing query. Usage: ukit memory search <query>');
45
+ }
46
+
47
+ const results = await search(query, 'all', 10, { projectRoot });
48
+ if (results.length === 0) {
49
+ console.log('[UKit] No memory matches found.');
50
+ return;
51
+ }
52
+
53
+ for (const result of results) {
54
+ console.log(`${result.id} — ${result.summary}`);
55
+ }
56
+ return;
57
+ }
58
+
59
+ if (subcommand === 'recall') {
60
+ const query = rest.join(' ').trim();
61
+ if (!query) {
62
+ throw new Error('Missing task/query. Usage: ukit memory recall <task>');
63
+ }
64
+
65
+ const runtimeConfigInspection = await inspectRuntimeConfig(projectRoot);
66
+ if (!runtimeConfigInspection.valid) {
67
+ throw new Error('Runtime config is invalid. Run `ukit doctor` or rerun `ukit install`.');
68
+ }
69
+
70
+ const runtimeConfig = runtimeConfigInspection.config;
71
+ if (!runtimeConfig.memory?.enabled || !runtimeConfig.memory?.progressiveRetrieval) {
72
+ throw new Error('Memory recall is disabled in .ukit/storage/config.json.');
73
+ }
74
+
75
+ const projectContext = await detectProjectContext(projectRoot);
76
+ const injection = await getContextInjection(query, projectContext.project.name, {
77
+ projectRoot,
78
+ maxTokens: runtimeConfig.memory.maxInjectionTokens,
79
+ promptCache: Boolean(runtimeConfig.tokenPipeline?.promptCache),
80
+ inputCompression: Boolean(runtimeConfig.tokenPipeline?.inputCompression),
81
+ });
82
+
83
+ if (!injection) {
84
+ console.log('[UKit] No relevant memory context found.');
85
+ return;
86
+ }
87
+
88
+ console.log(injection);
89
+ return;
90
+ }
91
+
92
+ if (subcommand === 'forget') {
93
+ const memoryId = rest.join(' ').trim();
94
+ if (!memoryId) {
95
+ throw new Error('Missing memory id. Usage: ukit memory forget <id>');
96
+ }
97
+
98
+ const result = await forgetMemoryItem(projectRoot, memoryId);
99
+ if (!result.removed) {
100
+ throw new Error(`Memory item not found: ${memoryId}`);
101
+ }
102
+
103
+ console.log(`[UKit] Forgot ${memoryId}.`);
104
+ return;
105
+ }
106
+
107
+ if (subcommand === 'export') {
108
+ const data = await exportMemory(projectRoot);
109
+ console.log(JSON.stringify(data, null, 2));
110
+ return;
111
+ }
112
+
113
+ throw new Error(`Unknown memory subcommand: ${subcommand}. Run "ukit memory help".`);
114
+ }
115
+
116
+ export function printMemoryHelp() {
117
+ console.log('UKit Memory Commands');
118
+ console.log('Usage: ukit memory <list|search|recall|forget|export> [args]');
119
+ console.log('');
120
+ console.log('Subcommands:');
121
+ console.log(' list List memory items in shared .ukit/storage/memory');
122
+ console.log(' search <query> Search memory summaries and content');
123
+ console.log(' recall <task> Print a compact previous-context block for the current task');
124
+ console.log(' forget <id> Remove one memory item by id');
125
+ console.log(' export Print all memory as JSON');
126
+ }
@@ -0,0 +1,8 @@
1
+ import { buildStatusReport, formatStatusReport } from '../../core/status.js';
2
+
3
+ export async function runStatus({ projectRoot }) {
4
+ const report = await buildStatusReport(projectRoot);
5
+ for (const line of formatStatusReport(report)) {
6
+ console.log(line);
7
+ }
8
+ }
@@ -0,0 +1,51 @@
1
+ import path from 'node:path';
2
+ import { uninstallUkit } from '../../core/uninstall.js';
3
+
4
+ const KNOWN_UNINSTALL_FLAGS = new Set(['--dry-run', '--help', '-h']);
5
+
6
+ export async function runUninstall({ projectRoot, argv = [] }) {
7
+ if (argv.includes('--help') || argv.includes('-h')) {
8
+ console.log('Usage: ukit uninstall [options]');
9
+ console.log('');
10
+ console.log('Remove all UKit-managed assets from the current project.');
11
+ console.log('');
12
+ console.log('Options:');
13
+ console.log(' --dry-run Preview what would be removed without deleting anything');
14
+ console.log(' --help, -h Show this help message');
15
+ return;
16
+ }
17
+
18
+ const unknownFlags = argv.filter((a) => a.startsWith('-') && !KNOWN_UNINSTALL_FLAGS.has(a));
19
+ if (unknownFlags.length > 0) {
20
+ throw new Error(
21
+ `Unknown option(s): ${unknownFlags.join(', ')}. Run \`ukit uninstall --help\` for usage.`,
22
+ );
23
+ }
24
+
25
+ const positionalArgs = argv.filter((a) => !a.startsWith('-'));
26
+ if (positionalArgs.length > 0) {
27
+ throw new Error(
28
+ `Unexpected argument(s): ${positionalArgs.join(', ')}. Run \`ukit uninstall --help\` for usage.`,
29
+ );
30
+ }
31
+
32
+ const dryRun = argv.includes('--dry-run');
33
+ const result = await uninstallUkit({ projectRoot, dryRun });
34
+
35
+ if (!result.wasInstalled) {
36
+ console.log('[UKit] UKit does not appear to be installed in this project. Nothing to remove.');
37
+ return;
38
+ }
39
+
40
+ if (dryRun) {
41
+ console.log('[UKit] Dry-run: the following paths would be removed:');
42
+ for (const p of result.wouldRemove) {
43
+ console.log(` - ${path.relative(projectRoot, p)}`);
44
+ }
45
+ console.log(`[UKit] Would remove ${result.wouldRemove.length} path(s). Run without --dry-run to actually uninstall.`);
46
+ return;
47
+ }
48
+
49
+ console.log(`[UKit] Uninstall complete. Removed ${result.removed}/${result.attempted} managed paths.`);
50
+ console.log('[UKit] Note: docs/PROJECT.md, docs/MEMORY.md, docs/WORKLOG.md contain user content and were preserved. Delete manually if needed.');
51
+ }
@@ -0,0 +1,109 @@
1
+ import { runInstall } from './commands/install.js';
2
+ import { runDiff } from './commands/diff.js';
3
+ import { runDoctor, printDoctorHelp, DOCTOR_HELP_FLAGS } from './commands/doctor.js';
4
+ import { runUninstall } from './commands/uninstall.js';
5
+ import { runIndexTools } from './commands/indexTools.js';
6
+ import { runStatus } from './commands/status.js';
7
+ import { runMemory } from './commands/memory.js';
8
+
9
+ const GLOBAL_FLAGS = new Set(['--help', '-h', '--version', '-v']);
10
+
11
+ export async function runCli({ argv, packageRoot, projectRoot, packageVersion }) {
12
+ // Global flags take priority — never default-route them to install.
13
+ // After that, if argv[0] is missing or starts with -- it is an install-specific flag
14
+ // (e.g. --tools=none), so treat it as the default `install` command.
15
+ const first = argv[0];
16
+ const isGlobalFlag = first && GLOBAL_FLAGS.has(first);
17
+ const isDefaultCommand = !isGlobalFlag && (!first || first.startsWith('--'));
18
+ const command = isDefaultCommand ? 'install' : (first ?? '').toLowerCase();
19
+ const commandArgv = isDefaultCommand ? argv : argv.slice(1);
20
+
21
+ if (command === 'install') {
22
+ await runInstall({ packageRoot, projectRoot, packageVersion, argv: commandArgv });
23
+ return;
24
+ }
25
+
26
+ if (command === 'diff') {
27
+ await runDiff({ packageRoot, projectRoot, packageVersion, argv: commandArgv });
28
+ return;
29
+ }
30
+
31
+ if (command === 'doctor') {
32
+ if (commandArgv.some((flag) => DOCTOR_HELP_FLAGS.has(flag))) {
33
+ printDoctorHelp();
34
+ return;
35
+ }
36
+
37
+ await runDoctor({ packageRoot, projectRoot, argv: commandArgv });
38
+ return;
39
+ }
40
+
41
+ if (command === 'uninstall') {
42
+ await runUninstall({ projectRoot, argv: commandArgv });
43
+ return;
44
+ }
45
+
46
+ if (command === 'index') {
47
+ await runIndexTools({ projectRoot, argv: commandArgv });
48
+ return;
49
+ }
50
+
51
+ if (command === 'status') {
52
+ await runStatus({ projectRoot, argv: commandArgv });
53
+ return;
54
+ }
55
+
56
+ if (command === 'memory') {
57
+ await runMemory({ projectRoot, argv: commandArgv });
58
+ return;
59
+ }
60
+
61
+ if (command === 'build' && (commandArgv[0] ?? '').toLowerCase() === 'index') {
62
+ await runIndexTools({ projectRoot, argv: ['build', ...commandArgv.slice(1)] });
63
+ return;
64
+ }
65
+
66
+ if (command === 'version' || command === '--version' || command === '-v') {
67
+ console.log(`ukit ${packageVersion}`);
68
+ return;
69
+ }
70
+
71
+ if (command === 'help' || command === '--help' || command === '-h') {
72
+ console.log('UKit CLI');
73
+ console.log('Usage: ukit [command] [options]');
74
+ console.log('');
75
+ console.log('Team workflow: remember only `ukit install`.');
76
+ console.log('After the first install, fill the docs baseline once, then open your AI tool and work in natural language.');
77
+ console.log('');
78
+ console.log('Primary command:');
79
+ console.log(' install (default) Install/update UKit assets into the current project');
80
+ console.log('');
81
+ console.log('Advanced / maintainer commands:');
82
+ console.log(' diff Preview install actions without writing any files');
83
+ console.log(' doctor Validate manifest, stack, docs, and UKit state');
84
+ console.log(' uninstall Remove all UKit-managed assets');
85
+ console.log(' index Codebase index tools (build/query/triage)');
86
+ console.log(' status Show UKit runtime status');
87
+ console.log(' memory Inspect shared UKit memory');
88
+ console.log(' version Show UKit version');
89
+ console.log('');
90
+ console.log('Options (install / diff):');
91
+ console.log(' --tools=<list> Comma-separated adapters to enable (default: all)');
92
+ console.log(' Values: claude, antigravity, codex, opencode');
93
+ console.log(' Example: ukit install --tools=claude,codex,opencode');
94
+ console.log(' Use --tools=none to disable all optional adapters');
95
+ console.log('');
96
+ console.log('Maintainer / debug examples:');
97
+ console.log(' ukit index build');
98
+ console.log(' ukit index query "writeFileAtomic EACCES"');
99
+ console.log(' ukit index triage "writeFileAtomic EACCES"');
100
+ console.log(' ukit index hooks install');
101
+ console.log(' ukit build index # alias');
102
+ console.log('');
103
+ console.log('Options (uninstall):');
104
+ console.log(' --dry-run Preview what would be removed without deleting anything');
105
+ return;
106
+ }
107
+
108
+ throw new Error(`Unknown command: ${command}. Run ukit help for usage.`);
109
+ }
@@ -0,0 +1,49 @@
1
+ import path from 'node:path';
2
+ import { pathExists, readJsonIfExists } from '../core/fileOps.js';
3
+
4
+ async function inferPackageManager(projectRoot, packageJson) {
5
+ // packageManager field takes priority over lockfiles — it is an explicit
6
+ // declaration of intent, while lockfiles may be stale (e.g. old yarn.lock
7
+ // leftover after switching to npm).
8
+ const declared = packageJson?.packageManager;
9
+ if (typeof declared === 'string') {
10
+ if (declared.startsWith('yarn@')) return 'yarn';
11
+ if (declared.startsWith('pnpm@')) return 'pnpm';
12
+ if (declared.startsWith('npm@')) return 'npm';
13
+ }
14
+
15
+ if (await pathExists(path.join(projectRoot, 'yarn.lock'))) {
16
+ return 'yarn';
17
+ }
18
+
19
+ if (await pathExists(path.join(projectRoot, 'pnpm-lock.yaml'))) {
20
+ return 'pnpm';
21
+ }
22
+
23
+ return 'npm';
24
+ }
25
+
26
+ function inferProjectName(projectRoot, packageJson) {
27
+ if (typeof packageJson?.name === 'string' && packageJson.name.trim() !== '') {
28
+ return packageJson.name;
29
+ }
30
+
31
+ return path.basename(projectRoot);
32
+ }
33
+
34
+ export async function detectProjectContext(projectRoot) {
35
+ const packageJsonPath = path.join(projectRoot, 'package.json');
36
+ const packageJson = await readJsonIfExists(packageJsonPath);
37
+
38
+ return {
39
+ project: {
40
+ root: projectRoot,
41
+ name: inferProjectName(projectRoot, packageJson),
42
+ },
43
+ runtime: {
44
+ packageManager: await inferPackageManager(projectRoot, packageJson),
45
+ os: process.platform,
46
+ nodeVersion: process.version,
47
+ },
48
+ };
49
+ }
@@ -0,0 +1,12 @@
1
+ export async function detectProviders(_projectRoot) {
2
+ const providers = {
3
+ unic: {
4
+ supported: true,
5
+ },
6
+ };
7
+
8
+ return {
9
+ providers,
10
+ allSupported: true,
11
+ };
12
+ }