@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.
- package/CHANGELOG.md +179 -0
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/bin/ukit +30 -0
- package/manifests/platform.full.yaml +1194 -0
- package/package.json +71 -0
- package/scripts/bug/triage.mjs +37 -0
- package/scripts/index/build-index.mjs +35 -0
- package/scripts/index/query-index.mjs +92 -0
- package/scripts/index/refresh-index.mjs +85 -0
- package/scripts/release/verify-release.mjs +56 -0
- package/src/bug/triageBug.js +123 -0
- package/src/cli/adapters.js +148 -0
- package/src/cli/commands/diff.js +51 -0
- package/src/cli/commands/doctor.js +125 -0
- package/src/cli/commands/indexArgs.js +73 -0
- package/src/cli/commands/indexTools.js +509 -0
- package/src/cli/commands/install.js +293 -0
- package/src/cli/commands/memory.js +126 -0
- package/src/cli/commands/status.js +8 -0
- package/src/cli/commands/uninstall.js +51 -0
- package/src/cli/index.js +109 -0
- package/src/context/detectProjectContext.js +49 -0
- package/src/context/detectProviders.js +12 -0
- package/src/core/applyPlan.js +89 -0
- package/src/core/buildPlan.js +228 -0
- package/src/core/compact/index.js +294 -0
- package/src/core/compact/threshold.js +936 -0
- package/src/core/diffPlan.js +73 -0
- package/src/core/ensureGitignore.js +117 -0
- package/src/core/fileOps.js +188 -0
- package/src/core/memory/hygiene.js +160 -0
- package/src/core/memory/index.js +2 -0
- package/src/core/memory/retrieval.js +476 -0
- package/src/core/memory/store.js +202 -0
- package/src/core/metadata.js +132 -0
- package/src/core/migrateLegacy.js +139 -0
- package/src/core/output/index.js +1309 -0
- package/src/core/paths.js +13 -0
- package/src/core/report.js +17 -0
- package/src/core/router/advisor.js +42 -0
- package/src/core/router/index.js +2 -0
- package/src/core/router/router.js +164 -0
- package/src/core/runInstallPipeline.js +365 -0
- package/src/core/runtimeConfig.js +190 -0
- package/src/core/runtimePaths.js +24 -0
- package/src/core/status.js +186 -0
- package/src/core/token/index.js +328 -0
- package/src/core/uninstall.js +246 -0
- package/src/core/validation/confidence.js +89 -0
- package/src/core/validation/index.js +2 -0
- package/src/core/validation/validator.js +165 -0
- package/src/index/buildIndex.js +1392 -0
- package/src/index/gitHooks.js +109 -0
- package/src/index/importResolution.js +377 -0
- package/src/index/languageTools.js +127 -0
- package/src/index/paths.js +27 -0
- package/src/index/queryIndex.js +637 -0
- package/src/index/relatedTests.js +237 -0
- package/src/index/resolveContext.js +345 -0
- package/src/index/routeCatalog.js +258 -0
- package/src/index/taskRouting.js +677 -0
- package/src/index/verificationPlan.js +437 -0
- package/src/manifest/loadManifest.js +22 -0
- package/src/manifest/selectItems.js +78 -0
- package/src/manifest/validateManifest.js +115 -0
- package/src/render/buildVariables.js +39 -0
- package/src/render/renderTemplate.js +44 -0
- package/src/stack/detectStack.js +213 -0
- package/templates/.claude/agents/bug-debugger.md +57 -0
- package/templates/.claude/agents/feature-implementer.md +55 -0
- package/templates/.claude/config/providers.md +25 -0
- package/templates/.claude/hooks/auto-allow-bash.sh +155 -0
- package/templates/.claude/hooks/auto-prune-bash.sh +75 -0
- package/templates/.claude/hooks/block-dangerous.sh +54 -0
- package/templates/.claude/hooks/compress-output.sh +17 -0
- package/templates/.claude/hooks/protect-files.sh +37 -0
- package/templates/.claude/hooks/reinject-context.sh +28 -0
- package/templates/.claude/hooks/session-start.md +13 -0
- package/templates/.claude/hooks/skill-router.sh +1681 -0
- package/templates/.claude/hooks/verification-guard.sh +271 -0
- package/templates/.claude/settings.json +144 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/mce/mc.xsd +75 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/pack.py +159 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/unpack.py +29 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validate.py +69 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/base.py +951 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/docx.py +274 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/.claude/skills/backend-api/SKILL.md +26 -0
- package/templates/.claude/skills/canvas-design/LICENSE.txt +202 -0
- package/templates/.claude/skills/canvas-design/SKILL.md +130 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/templates/.claude/skills/code-review/SKILL.md +97 -0
- package/templates/.claude/skills/debugging-toolkit/SKILL.md +156 -0
- package/templates/.claude/skills/delivery/SKILL.md +92 -0
- package/templates/.claude/skills/discover-security/SKILL.md +86 -0
- package/templates/.claude/skills/docker-packaging/SKILL.md +60 -0
- package/templates/.claude/skills/docs-manager/SKILL.md +465 -0
- package/templates/.claude/skills/docs-manager/init-project-docs.sh +70 -0
- package/templates/.claude/skills/docs-manager/templates/README.md.template +50 -0
- package/templates/.claude/skills/docs-manager/templates/agent-roles.md.template +24 -0
- package/templates/.claude/skills/docs-manager/templates/coding-conventions.md.template +28 -0
- package/templates/.claude/skills/docs-manager/templates/memory.md.template +30 -0
- package/templates/.claude/skills/docs-manager/templates/onboarding.md.template +20 -0
- package/templates/.claude/skills/docs-manager/templates/project.md.template +26 -0
- package/templates/.claude/skills/docs-quality/SKILL.md +148 -0
- package/templates/.claude/skills/docx/LICENSE.txt +30 -0
- package/templates/.claude/skills/docx/SKILL.md +197 -0
- package/templates/.claude/skills/docx/docx-js.md +350 -0
- package/templates/.claude/skills/docx/ooxml.md +610 -0
- package/templates/.claude/skills/docx/scripts/__init__.py +1 -0
- package/templates/.claude/skills/docx/scripts/document.py +1276 -0
- package/templates/.claude/skills/docx/scripts/templates/comments.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/people.xml +3 -0
- package/templates/.claude/skills/docx/scripts/utilities.py +374 -0
- package/templates/.claude/skills/duraone/SKILL.md +204 -0
- package/templates/.claude/skills/duraone/references/backend.md +636 -0
- package/templates/.claude/skills/duraone/references/frontend.md +1506 -0
- package/templates/.claude/skills/duraone/references/sql.md +631 -0
- package/templates/.claude/skills/duraone/references/workflow.md +520 -0
- package/templates/.claude/skills/executing-plans/SKILL.md +76 -0
- package/templates/.claude/skills/file-organizer/SKILL.md +433 -0
- package/templates/.claude/skills/frontend/SKILL.md +26 -0
- package/templates/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/.claude/skills/frontend-design/SKILL.md +42 -0
- package/templates/.claude/skills/frontend-vue/SKILL.md +127 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Box.vue +137 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Button.vue +93 -0
- package/templates/.claude/skills/frontend-vue/components/Control/ButtonBar.vue +29 -0
- package/templates/.claude/skills/frontend-vue/components/Control/ButtonFloat.vue +62 -0
- package/templates/.claude/skills/frontend-vue/components/Control/CheckButton.vue +75 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Checkbox.vue +58 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Datetime.vue +148 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Dropdownlist.vue +156 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Input.vue +106 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Label.vue +38 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Master/BoxColumn.vue +24 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/Confirm.vue +33 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/Info.vue +32 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/ModalInfo.vue +39 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/Reject.vue +64 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Tag.vue +82 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Upload.vue +61 -0
- package/templates/.claude/skills/frontend-vue/components/ControlMobile/Dropdownlist.vue +103 -0
- package/templates/.claude/skills/frontend-vue/components/ControlMobile/PagingBar.vue +108 -0
- package/templates/.claude/skills/frontend-vue/components/ControlMobile/UploadImage.vue +137 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/AG.vue +806 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/AntTable.vue +253 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditor.vue +43 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditorEnable.vue +55 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/HtmlTable.vue +40 -0
- package/templates/.claude/skills/frontend-vue/components/PDFViewer.vue +25 -0
- package/templates/.claude/skills/frontend-vue/components/Panel/FormView.vue +309 -0
- package/templates/.claude/skills/frontend-vue/components/Partial/Footer.vue +23 -0
- package/templates/.claude/skills/frontend-vue/components/Partial/Header.vue +265 -0
- package/templates/.claude/skills/frontend-vue/components/Partial/Sidebar.vue +122 -0
- package/templates/.claude/skills/frontend-vue/components/Template.vue +16 -0
- package/templates/.claude/skills/frontend-vue/components/View/Form.vue +89 -0
- package/templates/.claude/skills/frontend-vue/composables/indexDBStore.js +140 -0
- package/templates/.claude/skills/frontend-vue/composables/masterApi.js +362 -0
- package/templates/.claude/skills/frontend-vue/composables/state.js +578 -0
- package/templates/.claude/skills/frontend-vue/composables/useRequest.js +221 -0
- package/templates/.claude/skills/frontend-vue/composables/useSession.js +179 -0
- package/templates/.claude/skills/frontend-vue/composables/useTranslation.js +54 -0
- package/templates/.claude/skills/frontend-vue/composables/useWebSocket.js +257 -0
- package/templates/.claude/skills/frontend-vue/composables/userObj.js +111 -0
- package/templates/.claude/skills/frontend-vue/composables/utils.js +322 -0
- package/templates/.claude/skills/frontend-vue/reference/composables-example.vue +320 -0
- package/templates/.claude/skills/frontend-vue/reference/form-example.vue +183 -0
- package/templates/.claude/skills/frontend-vue/reference/grid-example.vue +147 -0
- package/templates/.claude/skills/frontend-vue/reference/masterdata-example/[id].vue +106 -0
- package/templates/.claude/skills/frontend-vue/reference/masterdata-example/index.vue +58 -0
- package/templates/.claude/skills/frontend-vue/reference/popup-example.vue +159 -0
- package/templates/.claude/skills/pdf/LICENSE.txt +30 -0
- package/templates/.claude/skills/pdf/SKILL.md +294 -0
- package/templates/.claude/skills/pdf/forms.md +205 -0
- package/templates/.claude/skills/pdf/reference.md +612 -0
- package/templates/.claude/skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/templates/.claude/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/templates/.claude/skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/templates/.claude/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/templates/.claude/skills/pdf/scripts/create_validation_image.py +41 -0
- package/templates/.claude/skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/templates/.claude/skills/pdf/scripts/fill_fillable_fields.py +114 -0
- package/templates/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/templates/.claude/skills/pdf-processing/SKILL.md +107 -0
- package/templates/.claude/skills/pdf-processing-pro/FORMS.md +610 -0
- package/templates/.claude/skills/pdf-processing-pro/OCR.md +137 -0
- package/templates/.claude/skills/pdf-processing-pro/SKILL.md +296 -0
- package/templates/.claude/skills/pdf-processing-pro/TABLES.md +626 -0
- package/templates/.claude/skills/pdf-processing-pro/scripts/analyze_form.py +307 -0
- package/templates/.claude/skills/postgres/SKILL.md +69 -0
- package/templates/.claude/skills/postgres/reference/fn_get_examples.sql +208 -0
- package/templates/.claude/skills/postgres/reference/fn_rpt_examples.sql +239 -0
- package/templates/.claude/skills/postgres/reference/utility_functions.sql +94 -0
- package/templates/.claude/skills/pptx/LICENSE.txt +30 -0
- package/templates/.claude/skills/pptx/SKILL.md +484 -0
- package/templates/.claude/skills/pptx/html2pptx.md +625 -0
- package/templates/.claude/skills/pptx/ooxml.md +427 -0
- package/templates/.claude/skills/pptx/scripts/html2pptx.js +979 -0
- package/templates/.claude/skills/pptx/scripts/inventory.py +1020 -0
- package/templates/.claude/skills/pptx/scripts/rearrange.py +231 -0
- package/templates/.claude/skills/pptx/scripts/replace.py +385 -0
- package/templates/.claude/skills/pptx/scripts/thumbnail.py +450 -0
- package/templates/.claude/skills/repo-maintenance/SKILL.md +97 -0
- package/templates/.claude/skills/research/EXAMPLES.md +434 -0
- package/templates/.claude/skills/research/REFERENCE.md +399 -0
- package/templates/.claude/skills/research/SKILL.md +136 -0
- package/templates/.claude/skills/root-cause-tracing/SKILL.md +174 -0
- package/templates/.claude/skills/root-cause-tracing/find-polluter.sh +63 -0
- package/templates/.claude/skills/sharing-skills/SKILL.md +194 -0
- package/templates/.claude/skills/sql-optimization-patterns/SKILL.md +493 -0
- package/templates/.claude/skills/subagent-driven-development/SKILL.md +189 -0
- package/templates/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/templates/.claude/skills/systematic-debugging/SKILL.md +295 -0
- package/templates/.claude/skills/systematic-debugging/test-academic.md +14 -0
- package/templates/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/templates/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/templates/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/templates/.claude/skills/test-driven-development/SKILL.md +364 -0
- package/templates/.claude/skills/testing-anti-patterns/SKILL.md +302 -0
- package/templates/.claude/skills/testing-quality/SKILL.md +97 -0
- package/templates/.claude/skills/verification-before-completion/SKILL.md +139 -0
- package/templates/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/templates/.claude/skills/webapp-testing/SKILL.md +96 -0
- package/templates/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/templates/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/templates/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/templates/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/templates/.claude/ukit/index/build-index.mjs +28 -0
- package/templates/.claude/ukit/index/cache-utils.mjs +140 -0
- package/templates/.claude/ukit/index/lib/index-core.mjs +2800 -0
- package/templates/.claude/ukit/index/query-index.mjs +150 -0
- package/templates/.claude/ukit/index/refresh-index.mjs +57 -0
- package/templates/.claude/ukit/index/reset-auto-permissions.mjs +76 -0
- package/templates/.claude/ukit/index/resolve-context.mjs +279 -0
- package/templates/.claude/ukit/index/route-catalog.mjs +258 -0
- package/templates/.claude/ukit/index/route-task.mjs +1994 -0
- package/templates/.claude/ukit/index/triage.mjs +133 -0
- package/templates/.claude/ukit/index/verify-context.mjs +689 -0
- package/templates/.claude/ukit/runtime/compact-threshold.mjs +1013 -0
- package/templates/.claude/ukit/runtime/output-compression.mjs +1340 -0
- package/templates/.claude/ukit/runtime/reinject-context.mjs +874 -0
- package/templates/.claude/ukit/runtime/token-utils.mjs +500 -0
- package/templates/.codex/README.md +83 -0
- package/templates/.codex/settings.json +187 -0
- package/templates/.gitignore +75 -0
- package/templates/AGENTS.md +116 -0
- package/templates/CLAUDE.md +93 -0
- package/templates/adapter-presets/antigravity/README.md +22 -0
- package/templates/adapter-presets/antigravity/rules.md +49 -0
- package/templates/adapter-presets/claude/settings.local.json +42 -0
- package/templates/adapter-presets/codex/settings.local.json +6 -0
- package/templates/adapter-presets/opencode/opencode.template.json +1 -0
- package/templates/docs/BUGFIX.md +20 -0
- package/templates/docs/BUG_INDEX.md +12 -0
- package/templates/docs/BUG_METRICS.md +7 -0
- package/templates/docs/BUG_TEMPLATE.md +13 -0
- package/templates/docs/CODE_MAP.md +35 -0
- package/templates/docs/INSTALL.md +113 -0
- package/templates/docs/MEMORY.md +49 -0
- package/templates/docs/PROJECT.md +50 -0
- package/templates/docs/UKIT_USAGE_GUIDE.md +147 -0
- package/templates/docs/WORKLOG.md +10 -0
- package/templates/ukit/README.md +14 -0
- package/templates/ukit/storage/cache/compact-history.json +3 -0
- package/templates/ukit/storage/cache/compact-pressure.json +1 -0
- package/templates/ukit/storage/cache/output-history.json +3 -0
- package/templates/ukit/storage/cache/prompt-cache.json +3 -0
- package/templates/ukit/storage/config.json +37 -0
- package/templates/ukit/storage/memory/projects/.gitkeep +2 -0
- package/templates/ukit/storage/memory/sessions/.gitkeep +0 -0
- package/templates/ukit/storage/memory/user.json +5 -0
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ngockhoale/ukit",
|
|
3
|
+
"version": "1.1.6",
|
|
4
|
+
"description": "Install/update an index-first AI workspace for Claude Code, Antigravity, OpenAI Codex, and OpenCode.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ukit",
|
|
9
|
+
"claude",
|
|
10
|
+
"codex",
|
|
11
|
+
"antigravity",
|
|
12
|
+
"claude-code",
|
|
13
|
+
"opencode",
|
|
14
|
+
"skills",
|
|
15
|
+
"agents",
|
|
16
|
+
"ai",
|
|
17
|
+
"ai-workspace",
|
|
18
|
+
"cli",
|
|
19
|
+
"developer-tools"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/lengockhoa/UKit.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/lengockhoa/UKit#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/lengockhoa/UKit/issues"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin/",
|
|
31
|
+
"src/",
|
|
32
|
+
"scripts/",
|
|
33
|
+
"templates/",
|
|
34
|
+
"CHANGELOG.md",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"templates/CLAUDE.md",
|
|
37
|
+
"templates/AGENTS.md",
|
|
38
|
+
"templates/.gitignore",
|
|
39
|
+
"manifests/",
|
|
40
|
+
"templates/adapter-presets/opencode/opencode.template.json"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"bin": {
|
|
46
|
+
"ukit": "bin/ukit"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"start": "node ./bin/ukit",
|
|
50
|
+
"doctor": "node ./bin/ukit doctor",
|
|
51
|
+
"diff": "node ./bin/ukit diff",
|
|
52
|
+
"index:build": "node ./scripts/index/build-index.mjs",
|
|
53
|
+
"index:refresh": "node ./scripts/index/refresh-index.mjs",
|
|
54
|
+
"index:query": "node ./scripts/index/query-index.mjs",
|
|
55
|
+
"bug:triage": "node ./scripts/bug/triage.mjs",
|
|
56
|
+
"test:artifact": "vitest run tests/integration/packageArtifact.test.js",
|
|
57
|
+
"test:release-core": "vitest run --exclude tests/integration/packageArtifact.test.js",
|
|
58
|
+
"release:verify": "node ./scripts/release/verify-release.mjs",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:watch": "vitest"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=20"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"yaml": "^2.8.2"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"vitest": "^2"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { triageBug } from '../../src/bug/triageBug.js';
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const rootArg = readFlagValue(args, '--root');
|
|
8
|
+
const rootDir = rootArg ? path.resolve(rootArg) : process.cwd();
|
|
9
|
+
|
|
10
|
+
const signature = args.filter((arg) => !arg.startsWith('--')).join(' ').trim();
|
|
11
|
+
|
|
12
|
+
if (!signature) {
|
|
13
|
+
console.error('Usage: yarn bug:triage -- "<error signature>"');
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
} else {
|
|
16
|
+
const result = await triageBug({ rootDir, signature });
|
|
17
|
+
console.log('[bug:triage]');
|
|
18
|
+
console.log(`lane: ${result.lane}`);
|
|
19
|
+
console.log(`confidence: ${result.confidence.toFixed(2)}`);
|
|
20
|
+
console.log(`signature: ${result.signature}`);
|
|
21
|
+
console.log(`suspects: ${result.suspectFiles.join(', ') || 'none'}`);
|
|
22
|
+
console.log(`test: ${result.recommendedTestCommand}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function readFlagValue(argv, flag) {
|
|
26
|
+
const exact = argv.indexOf(flag);
|
|
27
|
+
if (exact >= 0 && argv[exact + 1]) {
|
|
28
|
+
return argv[exact + 1];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const withEquals = argv.find((item) => item.startsWith(`${flag}=`));
|
|
32
|
+
if (withEquals) {
|
|
33
|
+
return withEquals.slice(flag.length + 1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { buildCodeIndex } from '../../src/index/buildIndex.js';
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const rootArg = readFlagValue(args, '--root');
|
|
8
|
+
const rootDir = rootArg ? path.resolve(rootArg) : process.cwd();
|
|
9
|
+
|
|
10
|
+
const summary = await buildCodeIndex({ rootDir });
|
|
11
|
+
|
|
12
|
+
console.log('[index:build] completed');
|
|
13
|
+
console.log(`root: ${rootDir}`);
|
|
14
|
+
console.log(`files: ${summary.fileCount}`);
|
|
15
|
+
console.log(`symbols: ${summary.symbolCount}`);
|
|
16
|
+
console.log(`imports: ${summary.importCount}`);
|
|
17
|
+
console.log(`tests-map: ${summary.testsMapCount}`);
|
|
18
|
+
console.log(`hotspots: ${summary.hotspotCount}`);
|
|
19
|
+
console.log(`parsed: ${summary.parsedCodeFileCount}`);
|
|
20
|
+
console.log(`reused: ${summary.reusedCodeFileCount}`);
|
|
21
|
+
console.log(`indexDir: ${summary.indexDir}`);
|
|
22
|
+
|
|
23
|
+
function readFlagValue(argv, flag) {
|
|
24
|
+
const exact = argv.indexOf(flag);
|
|
25
|
+
if (exact >= 0 && argv[exact + 1]) {
|
|
26
|
+
return argv[exact + 1];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const withEquals = argv.find((item) => item.startsWith(`${flag}=`));
|
|
30
|
+
if (withEquals) {
|
|
31
|
+
return withEquals.slice(flag.length + 1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
queryCodeIndex,
|
|
6
|
+
} from '../../src/index/queryIndex.js';
|
|
7
|
+
import {
|
|
8
|
+
buildCodeIndex,
|
|
9
|
+
isIndexStale,
|
|
10
|
+
DEFAULT_INDEX_CACHE_MAX_AGE_MS,
|
|
11
|
+
} from '../../src/index/buildIndex.js';
|
|
12
|
+
import { parseIndexArgs, QUERY_FLAG_DEFINITIONS } from '../../src/cli/commands/indexArgs.js';
|
|
13
|
+
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
const { value: rootArg, args: afterRootArgs } = extractFlagValue(args, '--root');
|
|
16
|
+
const { value: changedArg, args: remainingArgs } = extractFlagValue(afterRootArgs, '--changed');
|
|
17
|
+
const changedFiles = changedArg
|
|
18
|
+
? changedArg.split(',').map((item) => item.trim()).filter(Boolean)
|
|
19
|
+
: [];
|
|
20
|
+
const rootDir = rootArg ? path.resolve(rootArg) : process.cwd();
|
|
21
|
+
|
|
22
|
+
const { tokens, flags } = parseIndexArgs(remainingArgs, QUERY_FLAG_DEFINITIONS);
|
|
23
|
+
const query = tokens.join(' ').trim();
|
|
24
|
+
if (!query) {
|
|
25
|
+
console.error('Usage: yarn index:query -- "<error|symbol|path>" [--limit N] [--changed fileA,fileB]');
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
} else {
|
|
28
|
+
const stale = await isIndexStale({ rootDir, maxAgeMs: DEFAULT_INDEX_CACHE_MAX_AGE_MS });
|
|
29
|
+
if (stale) {
|
|
30
|
+
await buildCodeIndex({ rootDir });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const limit = Number.parseInt(flags.get('--limit') ?? '5', 10);
|
|
34
|
+
const results = await queryCodeIndex({
|
|
35
|
+
rootDir,
|
|
36
|
+
query,
|
|
37
|
+
limit: Number.isNaN(limit) ? 5 : limit,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (changedFiles.length > 0) {
|
|
41
|
+
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (results.length === 0) {
|
|
45
|
+
console.log('[index:query] no matches');
|
|
46
|
+
} else {
|
|
47
|
+
console.log(`[index:query] top ${results.length} matches for: ${query}`);
|
|
48
|
+
for (const [idx, item] of results.entries()) {
|
|
49
|
+
console.log(`${idx + 1}. ${item.filePath} (score=${item.score})`);
|
|
50
|
+
if ((item.tests ?? []).length > 0) {
|
|
51
|
+
console.log(` tests: ${item.tests.slice(0, 2).join(', ')}`);
|
|
52
|
+
}
|
|
53
|
+
if ((item.reasons ?? []).length > 0) {
|
|
54
|
+
console.log(` reasons: ${item.reasons.join(', ')}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function extractFlagValue(argv, flag) {
|
|
61
|
+
let value = null;
|
|
62
|
+
const nextArgs = [];
|
|
63
|
+
|
|
64
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
65
|
+
const arg = argv[i];
|
|
66
|
+
|
|
67
|
+
if (arg === flag) {
|
|
68
|
+
if (value !== null) {
|
|
69
|
+
nextArgs.push(arg);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const maybeValue = argv[i + 1];
|
|
73
|
+
if (!maybeValue || maybeValue.startsWith('--')) {
|
|
74
|
+
throw new Error(`Missing value for ${flag}.`);
|
|
75
|
+
}
|
|
76
|
+
value = maybeValue;
|
|
77
|
+
i += 1;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (arg.startsWith(`${flag}=`)) {
|
|
82
|
+
if (value === null) {
|
|
83
|
+
value = arg.slice(flag.length + 1);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
nextArgs.push(arg);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return { value, args: nextArgs };
|
|
92
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
buildCodeIndex,
|
|
7
|
+
isIndexStale,
|
|
8
|
+
DEFAULT_INDEX_CACHE_MAX_AGE_MS,
|
|
9
|
+
} from '../../src/index/buildIndex.js';
|
|
10
|
+
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
const rootArg = readFlagValue(args, '--root');
|
|
13
|
+
const rootDir = rootArg ? path.resolve(rootArg) : process.cwd();
|
|
14
|
+
|
|
15
|
+
const changedArg = readFlagValue(args, '--changed');
|
|
16
|
+
const changedFiles = changedArg
|
|
17
|
+
? changedArg.split(',').map((item) => item.trim()).filter(Boolean)
|
|
18
|
+
: [];
|
|
19
|
+
|
|
20
|
+
const force = readBooleanFlag(args, '--force');
|
|
21
|
+
const lastRefreshMs = await getLastRefreshTime(rootDir);
|
|
22
|
+
const stale = force
|
|
23
|
+
? true
|
|
24
|
+
: await isIndexStale({ rootDir, maxAgeMs: DEFAULT_INDEX_CACHE_MAX_AGE_MS });
|
|
25
|
+
|
|
26
|
+
if (!stale) {
|
|
27
|
+
console.log('[index:refresh] skipped (cache fresh)');
|
|
28
|
+
if (lastRefreshMs !== null) {
|
|
29
|
+
console.log(`lastRefresh: ${new Date(lastRefreshMs).toISOString()}`);
|
|
30
|
+
}
|
|
31
|
+
if (changedFiles.length > 0) {
|
|
32
|
+
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
33
|
+
}
|
|
34
|
+
console.log(`root: ${rootDir}`);
|
|
35
|
+
} else {
|
|
36
|
+
const summary = await buildCodeIndex({ rootDir });
|
|
37
|
+
|
|
38
|
+
console.log('[index:refresh] completed');
|
|
39
|
+
if (lastRefreshMs !== null) {
|
|
40
|
+
console.log(`lastRefreshBefore: ${new Date(lastRefreshMs).toISOString()}`);
|
|
41
|
+
}
|
|
42
|
+
if (changedFiles.length > 0) {
|
|
43
|
+
console.log(`changed-files-hint: ${changedFiles.join(', ')}`);
|
|
44
|
+
}
|
|
45
|
+
console.log(`root: ${rootDir}`);
|
|
46
|
+
console.log(`files: ${summary.fileCount}`);
|
|
47
|
+
console.log(`parsed: ${summary.parsedCodeFileCount}`);
|
|
48
|
+
console.log(`reused: ${summary.reusedCodeFileCount}`);
|
|
49
|
+
console.log(`indexDir: ${summary.indexDir}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function readFlagValue(argv, flag) {
|
|
53
|
+
const exact = argv.indexOf(flag);
|
|
54
|
+
if (exact >= 0 && argv[exact + 1]) {
|
|
55
|
+
return argv[exact + 1];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const withEquals = argv.find((item) => item.startsWith(`${flag}=`));
|
|
59
|
+
if (withEquals) {
|
|
60
|
+
return withEquals.slice(flag.length + 1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function readBooleanFlag(argv, flag) {
|
|
67
|
+
return argv.includes(flag);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function getLastRefreshTime(rootDir) {
|
|
71
|
+
const filesPath = path.join(rootDir, '.cache', 'index', 'files.json');
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const raw = await fs.readFile(filesPath, 'utf8');
|
|
75
|
+
const artifact = JSON.parse(raw);
|
|
76
|
+
const generatedAtRaw = String(artifact?.generatedAt ?? '').trim();
|
|
77
|
+
if (!generatedAtRaw) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const generatedAtMs = Date.parse(generatedAtRaw);
|
|
81
|
+
return Number.isNaN(generatedAtMs) ? null : generatedAtMs;
|
|
82
|
+
} catch {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
const rootDir = process.cwd();
|
|
6
|
+
const npmCacheDir = path.join(os.tmpdir(), 'ukit-npm-cache');
|
|
7
|
+
|
|
8
|
+
const steps = [
|
|
9
|
+
{
|
|
10
|
+
label: 'Artifact smoke',
|
|
11
|
+
command: 'yarn',
|
|
12
|
+
args: ['test:artifact'],
|
|
13
|
+
env: process.env,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: 'Core test suite',
|
|
17
|
+
command: 'yarn',
|
|
18
|
+
args: ['test:release-core'],
|
|
19
|
+
env: process.env,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: 'Local package dry-run',
|
|
23
|
+
command: 'npm',
|
|
24
|
+
args: ['pack', '--dry-run', '--json', '--cache', npmCacheDir],
|
|
25
|
+
env: {
|
|
26
|
+
...process.env,
|
|
27
|
+
npm_config_cache: npmCacheDir,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
for (const step of steps) {
|
|
33
|
+
console.log(`\n[release:verify] ${step.label}`);
|
|
34
|
+
console.log(`[release:verify] > ${step.command} ${step.args.join(' ')}`);
|
|
35
|
+
|
|
36
|
+
const exitCode = await runStep(step);
|
|
37
|
+
if (exitCode !== 0) {
|
|
38
|
+
console.error(`[release:verify] FAILED at step: ${step.label}`);
|
|
39
|
+
process.exit(exitCode ?? 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log('\n[release:verify] All release checks passed.');
|
|
44
|
+
|
|
45
|
+
function runStep({ command, args, env }) {
|
|
46
|
+
return new Promise((resolve) => {
|
|
47
|
+
const child = spawn(command, args, {
|
|
48
|
+
cwd: rootDir,
|
|
49
|
+
env,
|
|
50
|
+
stdio: 'inherit',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
child.on('close', (code) => resolve(code ?? 1));
|
|
54
|
+
child.on('error', () => resolve(1));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { queryCodeIndex } from '../index/queryIndex.js';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { inferRelatedTestsFromArtifacts, loadRelatedTestArtifacts } from '../index/relatedTests.js';
|
|
5
|
+
|
|
6
|
+
const DEEP_KEYWORDS = ['race', 'flaky', 'intermittent', 'timeout', 'deadlock'];
|
|
7
|
+
|
|
8
|
+
export async function triageBug({ rootDir = process.cwd(), signature } = {}) {
|
|
9
|
+
if (!signature || !signature.trim()) {
|
|
10
|
+
throw new Error('Bug signature is required. Usage: yarn bug:triage -- "<error signature>"');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const queryResults = await queryCodeIndex({ rootDir, query: signature, limit: 3 });
|
|
14
|
+
const prioritizedResults = [...queryResults].sort((a, b) => {
|
|
15
|
+
const aIsSource = a.filePath.startsWith('src/') ? 1 : 0;
|
|
16
|
+
const bIsSource = b.filePath.startsWith('src/') ? 1 : 0;
|
|
17
|
+
if (aIsSource !== bIsSource) {
|
|
18
|
+
return bIsSource - aIsSource;
|
|
19
|
+
}
|
|
20
|
+
return b.score - a.score;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const topResult = prioritizedResults[0] ?? null;
|
|
24
|
+
|
|
25
|
+
const deepByKeyword = DEEP_KEYWORDS.some((keyword) => signature.toLowerCase().includes(keyword));
|
|
26
|
+
const fastByScore = Boolean(topResult && topResult.score >= 8);
|
|
27
|
+
const directRecommendedTestFile = prioritizedResults
|
|
28
|
+
.flatMap((item) => item.tests ?? [])
|
|
29
|
+
.find(Boolean);
|
|
30
|
+
const shouldLoadRelatedArtifacts = Boolean(topResult) || !directRecommendedTestFile;
|
|
31
|
+
const relatedArtifacts = shouldLoadRelatedArtifacts
|
|
32
|
+
? await loadRelatedTestArtifacts({ rootDir })
|
|
33
|
+
: null;
|
|
34
|
+
const inferredRecommendedTests = directRecommendedTestFile
|
|
35
|
+
? []
|
|
36
|
+
: inferRelatedTestsFromArtifacts({
|
|
37
|
+
candidateFiles: prioritizedResults.map((item) => item.filePath),
|
|
38
|
+
analogsMap: relatedArtifacts?.analogsMap,
|
|
39
|
+
relationsMap: relatedArtifacts?.relationsMap,
|
|
40
|
+
limit: 3,
|
|
41
|
+
});
|
|
42
|
+
const recommendedTestFile = directRecommendedTestFile
|
|
43
|
+
?? inferredRecommendedTests[0]?.filePath
|
|
44
|
+
?? '<target-test-file>';
|
|
45
|
+
|
|
46
|
+
const lane = deepByKeyword ? 'deep' : (fastByScore ? 'fast' : 'deep');
|
|
47
|
+
const confidence = topResult ? Math.min(topResult.score / 20, 1) : 0;
|
|
48
|
+
|
|
49
|
+
const recommendedTest = await buildTestCommand(rootDir, recommendedTestFile);
|
|
50
|
+
|
|
51
|
+
const analogFiles = topResult
|
|
52
|
+
? (relatedArtifacts?.analogsMap.get(topResult.filePath) ?? []).slice(0, 2)
|
|
53
|
+
: [];
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
signature,
|
|
57
|
+
lane,
|
|
58
|
+
confidence,
|
|
59
|
+
suspectFiles: prioritizedResults.map((item) => item.filePath),
|
|
60
|
+
analogFiles: analogFiles.map((a) => a.filePath),
|
|
61
|
+
reasons: topResult?.reasons ?? [],
|
|
62
|
+
recommendedTestCommand: recommendedTest,
|
|
63
|
+
suggestedLoop: [
|
|
64
|
+
'Reproduce exactly once with the failing command',
|
|
65
|
+
'Open only top 1-3 suspect files from index output',
|
|
66
|
+
'If analogs found, open 1 analog file for pattern reference',
|
|
67
|
+
'Run one 15-minute loop: hypothesis -> patch -> targeted test',
|
|
68
|
+
'If two loops fail, switch to deep debugging lane',
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function buildTestCommand(rootDir, testFile) {
|
|
74
|
+
const packageManager = await detectPackageManager(rootDir);
|
|
75
|
+
|
|
76
|
+
if (packageManager === 'pnpm') {
|
|
77
|
+
return `pnpm test ${testFile}`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (packageManager === 'yarn') {
|
|
81
|
+
return `yarn test ${testFile}`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (packageManager === 'bun') {
|
|
85
|
+
return `bun test ${testFile}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// npm default
|
|
89
|
+
return `npm test -- ${testFile}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async function detectPackageManager(rootDir) {
|
|
93
|
+
const packageJsonPath = path.join(rootDir, 'package.json');
|
|
94
|
+
try {
|
|
95
|
+
const raw = await fs.readFile(packageJsonPath, 'utf8');
|
|
96
|
+
const pkg = JSON.parse(raw);
|
|
97
|
+
const declared = String(pkg?.packageManager ?? '').toLowerCase();
|
|
98
|
+
if (declared.startsWith('pnpm')) return 'pnpm';
|
|
99
|
+
if (declared.startsWith('yarn')) return 'yarn';
|
|
100
|
+
if (declared.startsWith('bun')) return 'bun';
|
|
101
|
+
if (declared.startsWith('npm')) return 'npm';
|
|
102
|
+
} catch {
|
|
103
|
+
// fall through to lockfile detection
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const checks = [
|
|
107
|
+
['pnpm-lock.yaml', 'pnpm'],
|
|
108
|
+
['yarn.lock', 'yarn'],
|
|
109
|
+
['bun.lockb', 'bun'],
|
|
110
|
+
['package-lock.json', 'npm'],
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
for (const [lockfile, pm] of checks) {
|
|
114
|
+
try {
|
|
115
|
+
await fs.access(path.join(rootDir, lockfile));
|
|
116
|
+
return pm;
|
|
117
|
+
} catch {
|
|
118
|
+
// continue
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return 'npm';
|
|
123
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export const OPTIONAL_ADAPTERS = [
|
|
2
|
+
{
|
|
3
|
+
key: 'antigravity',
|
|
4
|
+
label: 'Antigravity',
|
|
5
|
+
itemIds: [
|
|
6
|
+
'multi-antigravity-skills-link',
|
|
7
|
+
'multi-antigravity-ukit-link',
|
|
8
|
+
'multi-antigravity-rules',
|
|
9
|
+
'multi-antigravity-readme',
|
|
10
|
+
],
|
|
11
|
+
managedPaths: [
|
|
12
|
+
'.antigravity/skills',
|
|
13
|
+
'.antigravity/ukit',
|
|
14
|
+
'.antigravity/rules/rules.md',
|
|
15
|
+
'.antigravity/README.md',
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: 'codex',
|
|
20
|
+
label: 'OpenAI Codex',
|
|
21
|
+
itemIds: [
|
|
22
|
+
'multi-codex-skills-link',
|
|
23
|
+
'multi-codex-ukit-link',
|
|
24
|
+
'multi-codex-readme',
|
|
25
|
+
'multi-codex-settings-json',
|
|
26
|
+
'multi-codex-settings-local',
|
|
27
|
+
],
|
|
28
|
+
managedPaths: [
|
|
29
|
+
'.codex/skills',
|
|
30
|
+
'.codex/ukit',
|
|
31
|
+
'.codex/README.md',
|
|
32
|
+
'.codex/settings.json',
|
|
33
|
+
'.codex/settings.local.json',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'opencode',
|
|
38
|
+
label: 'OpenCode',
|
|
39
|
+
itemIds: [
|
|
40
|
+
'multi-opencode-config',
|
|
41
|
+
],
|
|
42
|
+
managedPaths: [
|
|
43
|
+
'opencode.json',
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export const ADAPTER_BY_KEY = new Map(OPTIONAL_ADAPTERS.map((adapter) => [adapter.key, adapter]));
|
|
49
|
+
export const DEFAULT_OPTIONAL_TOOL_KEYS = OPTIONAL_ADAPTERS.map((adapter) => adapter.key);
|
|
50
|
+
|
|
51
|
+
export const TOOL_ALIASES = new Map([
|
|
52
|
+
['claude', 'claude'],
|
|
53
|
+
['claude-code', 'claude'],
|
|
54
|
+
['antigravity', 'antigravity'],
|
|
55
|
+
['codex', 'codex'],
|
|
56
|
+
['openai-codex', 'codex'],
|
|
57
|
+
['opencode', 'opencode'],
|
|
58
|
+
['open-code', 'opencode'],
|
|
59
|
+
]);
|
|
60
|
+
|
|
61
|
+
export const TOOLS_FLAG_HELP = 'all|none|claude,antigravity,codex,opencode';
|
|
62
|
+
|
|
63
|
+
export function parseToolsArg(argv = []) {
|
|
64
|
+
let toolsArg = null;
|
|
65
|
+
|
|
66
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
67
|
+
const arg = argv[index];
|
|
68
|
+
|
|
69
|
+
if (arg === '--tools') {
|
|
70
|
+
const value = argv[index + 1];
|
|
71
|
+
if (!value || value.startsWith('--')) {
|
|
72
|
+
throw new Error(`Missing value for --tools. Use --tools=${TOOLS_FLAG_HELP}`);
|
|
73
|
+
}
|
|
74
|
+
toolsArg = value;
|
|
75
|
+
index += 1;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (arg.startsWith('--tools=')) {
|
|
80
|
+
toolsArg = arg.slice('--tools='.length);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
throw new Error(`Unknown option: ${arg}. Supported: --tools=${TOOLS_FLAG_HELP}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return toolsArg;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function resolveOptionalToolKeys(toolsArg) {
|
|
91
|
+
if (toolsArg === null) {
|
|
92
|
+
return [...DEFAULT_OPTIONAL_TOOL_KEYS];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const normalized = toolsArg.trim().toLowerCase();
|
|
96
|
+
|
|
97
|
+
if (normalized === 'all') {
|
|
98
|
+
return [...DEFAULT_OPTIONAL_TOOL_KEYS];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (normalized === 'none') {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const selectedOptional = new Set();
|
|
106
|
+
for (const rawToken of toolsArg.split(',')) {
|
|
107
|
+
const token = rawToken.trim();
|
|
108
|
+
if (!token) continue;
|
|
109
|
+
|
|
110
|
+
const normalizedTool = TOOL_ALIASES.get(token.toLowerCase()) ?? null;
|
|
111
|
+
if (!normalizedTool) {
|
|
112
|
+
throw new Error(`Unknown tool '${token}'. Allowed: ${TOOLS_FLAG_HELP}`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (normalizedTool !== 'claude') {
|
|
116
|
+
selectedOptional.add(normalizedTool);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return OPTIONAL_ADAPTERS
|
|
121
|
+
.map((adapter) => adapter.key)
|
|
122
|
+
.filter((adapterKey) => selectedOptional.has(adapterKey));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function toSelectedAdapterItemIds(optionalToolKeys) {
|
|
126
|
+
const itemIds = [];
|
|
127
|
+
|
|
128
|
+
for (const key of optionalToolKeys) {
|
|
129
|
+
const adapter = ADAPTER_BY_KEY.get(key);
|
|
130
|
+
if (!adapter) {
|
|
131
|
+
throw new Error(`Unsupported adapter key: ${key}`);
|
|
132
|
+
}
|
|
133
|
+
itemIds.push(...adapter.itemIds);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return itemIds;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function formatSelectedTools(optionalToolKeys) {
|
|
140
|
+
const optionalLabels = optionalToolKeys
|
|
141
|
+
.map((key) => ADAPTER_BY_KEY.get(key))
|
|
142
|
+
.filter(Boolean)
|
|
143
|
+
.map((adapter) => adapter.label);
|
|
144
|
+
|
|
145
|
+
return optionalLabels.length > 0
|
|
146
|
+
? `Claude Code, ${optionalLabels.join(', ')}`
|
|
147
|
+
: 'Claude Code';
|
|
148
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { buildPathConfig } from '../../core/paths.js';
|
|
3
|
+
import { runInstallPipeline } from '../../core/runInstallPipeline.js';
|
|
4
|
+
import { parseToolsArg, resolveOptionalToolKeys, toSelectedAdapterItemIds, formatSelectedTools } from '../adapters.js';
|
|
5
|
+
|
|
6
|
+
export async function runDiff({ packageRoot, projectRoot, packageVersion, argv = [] }) {
|
|
7
|
+
if (argv.includes('--help') || argv.includes('-h')) {
|
|
8
|
+
console.log('Usage: ukit diff [options]');
|
|
9
|
+
console.log('');
|
|
10
|
+
console.log('Preview install actions without writing any files.');
|
|
11
|
+
console.log('');
|
|
12
|
+
console.log('Options:');
|
|
13
|
+
console.log(' --tools=<list> Adapters to include (default: all). Same as install.');
|
|
14
|
+
console.log(' --help, -h Show this help message');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const toolsArg = parseToolsArg(argv);
|
|
19
|
+
const selectedOptionalTools = resolveOptionalToolKeys(toolsArg);
|
|
20
|
+
const selectedAdapterItemIds = toSelectedAdapterItemIds(selectedOptionalTools);
|
|
21
|
+
|
|
22
|
+
const pathConfig = buildPathConfig({ packageRoot, projectRoot });
|
|
23
|
+
|
|
24
|
+
const result = await runInstallPipeline({
|
|
25
|
+
packageVersion,
|
|
26
|
+
pathConfig,
|
|
27
|
+
dryRun: true,
|
|
28
|
+
selectedAdapterItemIds,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
console.log('[UKit] Diff preview:');
|
|
32
|
+
console.log(`[UKit] Manifest: ${result.manifest.name}`);
|
|
33
|
+
console.log(`[UKit] Tools selected: ${formatSelectedTools(selectedOptionalTools)}`);
|
|
34
|
+
console.log(`[UKit] Detected packs: ${result.stackContext.detectedPacks.join(', ')}`);
|
|
35
|
+
|
|
36
|
+
for (const row of result.rows) {
|
|
37
|
+
const relPath = path.relative(projectRoot, row.targetPath);
|
|
38
|
+
console.log(`- [${row.action}] ${row.id} -> ${relPath}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
console.log(
|
|
42
|
+
`[UKit] Summary: create=${result.summary.create}, update=${result.summary.update}, unchanged=${result.summary.unchanged}, skip=${result.summary.skip}`,
|
|
43
|
+
);
|
|
44
|
+
const providerNames = Object.keys(result.providerContext.providers);
|
|
45
|
+
const providerStatus = providerNames
|
|
46
|
+
.map((name) => `${name}=${result.providerContext.providers[name].supported}`)
|
|
47
|
+
.join(', ');
|
|
48
|
+
console.log(
|
|
49
|
+
`[UKit] Providers: ${providerStatus}, all=${result.providerContext.allSupported}`,
|
|
50
|
+
);
|
|
51
|
+
}
|