@zeyue0329/xiaoma-cli 1.12.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +24 -14
- package/src/core-skills/module-help.csv +13 -0
- package/src/{core → core-skills}/module.yaml +8 -0
- package/src/{core/skills/xiaoma-advanced-elicitation/workflow.md → core-skills/xiaoma-advanced-elicitation/SKILL.md} +10 -3
- package/src/core-skills/xiaoma-advanced-elicitation/methods.csv +70 -0
- package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-03-technique-execution.md +6 -4
- package/src/{core/skills → core-skills}/xiaoma-brainstorming/workflow.md +1 -1
- package/src/core-skills/xiaoma-customize/SKILL.md +111 -0
- package/src/core-skills/xiaoma-customize/scripts/list_customizable_skills.js +172 -0
- package/src/{core/skills → core-skills}/xiaoma-distillator/resources/distillate-format-reference.md +1 -1
- package/src/{core/skills → core-skills}/xiaoma-distillator/scripts/analyze_sources.py +2 -2
- package/src/{core/skills/xiaoma-editorial-review-prose/workflow.md → core-skills/xiaoma-editorial-review-prose/SKILL.md} +5 -0
- package/src/{core/skills/xiaoma-editorial-review-structure/workflow.md → core-skills/xiaoma-editorial-review-structure/SKILL.md} +5 -0
- package/src/core-skills/xiaoma-help/SKILL.md +75 -0
- package/src/{core/skills/xiaoma-index-docs/workflow.md → core-skills/xiaoma-index-docs/SKILL.md} +5 -0
- package/src/core-skills/xiaoma-party-mode/SKILL.md +128 -0
- package/src/{core/skills/xiaoma-review-adversarial-general/workflow.md → core-skills/xiaoma-review-adversarial-general/SKILL.md} +5 -0
- package/src/{core/skills/xiaoma-review-edge-case-hunter/workflow.md → core-skills/xiaoma-review-edge-case-hunter/SKILL.md} +5 -0
- package/src/{core/skills/xiaoma-shard-doc/workflow.md → core-skills/xiaoma-shard-doc/SKILL.md} +5 -0
- package/src/core-skills/xiaoma-spec/SKILL.md +129 -0
- package/src/core-skills/xiaoma-spec/assets/headless-schemas.md +33 -0
- package/src/core-skills/xiaoma-spec/assets/spec-template.md +49 -0
- package/src/core-skills/xiaoma-spec/customize.toml +53 -0
- package/src/scripts/resolve_config.js +163 -0
- package/src/scripts/resolve_customization.js +188 -0
- package/src/scripts/toml.js +338 -0
- package/src/xmc-skills/1-analysis/research/xiaoma-domain-research/SKILL.md +96 -0
- package/src/xmc-skills/1-analysis/research/xiaoma-domain-research/customize.toml +41 -0
- package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-domain-research/domain-steps/step-06-research-synthesis.md +6 -0
- package/src/xmc-skills/1-analysis/research/xiaoma-market-research/SKILL.md +96 -0
- package/src/xmc-skills/1-analysis/research/xiaoma-market-research/customize.toml +41 -0
- package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-market-research/steps/step-06-research-completion.md +6 -0
- package/src/xmc-skills/1-analysis/research/xiaoma-technical-research/SKILL.md +96 -0
- package/src/xmc-skills/1-analysis/research/xiaoma-technical-research/customize.toml +41 -0
- package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-technical-research/technical-steps/step-06-research-synthesis.md +6 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-analyst/SKILL.md +76 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-analyst/customize.toml +90 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-tech-writer/SKILL.md +76 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-tech-writer/customize.toml +81 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-tech-writer/explain-concept.md +20 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-tech-writer/mermaid-gen.md +20 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-tech-writer/validate-doc.md +19 -0
- package/src/xmc-skills/1-analysis/xiaoma-agent-tech-writer/write-document.md +20 -0
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/checklist.md +5 -2
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/steps/step-01-init-and-validate.md +18 -1
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/steps/step-02-requirements-analysis.md +3 -1
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/steps/step-03-architecture-analysis.md +5 -3
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/steps/step-04-create-prd.md +12 -14
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/steps/step-05-validate-prd.md +18 -15
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/steps/step-06-create-epics.md +9 -5
- package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/steps/step-07-create-architecture.md +10 -7
- package/src/xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline/steps/step-08-finalize.md +184 -0
- package/src/xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline/workflow.md +140 -0
- package/src/xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline/xiaoma-skill-manifest.yaml +24 -0
- package/src/xmc-skills/1-analysis/xiaoma-document-project/SKILL.md +62 -0
- package/src/xmc-skills/1-analysis/xiaoma-document-project/customize.toml +41 -0
- package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/workflows/deep-dive-instructions.md +1 -0
- package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/workflows/full-scan-instructions.md +1 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/SKILL.md +135 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/agents/artifact-analyzer.md +60 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/agents/web-researcher.md +49 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/assets/prfaq-template.md +62 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/customize.toml +41 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/references/customer-faq.md +55 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/references/internal-faq.md +51 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/references/press-release.md +60 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/references/verdict.md +83 -0
- package/src/xmc-skills/1-analysis/xiaoma-prfaq/xiaoma-manifest.json +16 -0
- package/src/xmc-skills/1-analysis/xiaoma-product-brief/SKILL.md +91 -0
- package/src/xmc-skills/1-analysis/xiaoma-product-brief/assets/brief-template.md +41 -0
- package/src/xmc-skills/1-analysis/xiaoma-product-brief/customize.toml +99 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-agent-pm/SKILL.md +76 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-agent-pm/customize.toml +75 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-agent-ux-designer/SKILL.md +76 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-agent-ux-designer/customize.toml +60 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-create-prd/SKILL.md +30 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-create-prd/customize.toml +41 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-edit-prd/SKILL.md +30 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-edit-prd/customize.toml +42 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/SKILL.md +92 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/assets/headless-schemas.md +76 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/assets/prd-template.md +165 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/assets/prd-validation-checklist.md +217 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/assets/validation-report-template.html +325 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/customize.toml +147 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/references/headless.md +39 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-prd/references/validate.md +97 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/SKILL.md +90 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/color-themes.md +9 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/design-directions.md +9 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/design-example-editorial.md +158 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/design-example-mobile.md +93 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/design-example-shadcn.md +109 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/excalidraw-wireframe.md +19 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/experience-example-mobile.md +112 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/experience-example-shadcn.md +133 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/headless-schemas.md +84 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/key-screens.md +29 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/assets/validation-report-template.html +319 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/customize.toml +100 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/references/creative-tools.md +19 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/references/design-md-spec.md +50 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/references/headless.md +37 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-ux/references/validate.md +115 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-validate-prd/SKILL.md +30 -0
- package/src/xmc-skills/2-plan-workflows/xiaoma-validate-prd/customize.toml +31 -0
- package/src/xmc-skills/3-solutioning/xiaoma-agent-architect/SKILL.md +76 -0
- package/src/xmc-skills/3-solutioning/xiaoma-agent-architect/customize.toml +65 -0
- package/src/xmc-skills/3-solutioning/xiaoma-check-implementation-readiness/SKILL.md +91 -0
- package/src/xmc-skills/3-solutioning/xiaoma-check-implementation-readiness/customize.toml +41 -0
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-check-implementation-readiness/steps/step-01-document-discovery.md +1 -1
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-check-implementation-readiness/steps/step-02-prd-analysis.md +1 -1
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +1 -1
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-check-implementation-readiness/steps/step-06-final-assessment.md +6 -0
- package/src/xmc-skills/3-solutioning/xiaoma-create-architecture/SKILL.md +74 -0
- package/src/xmc-skills/3-solutioning/xiaoma-create-architecture/customize.toml +41 -0
- package/src/xmc-skills/3-solutioning/xiaoma-create-architecture/references/headless.md +37 -0
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-07-validation.md +23 -21
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-08-complete.md +6 -0
- package/src/xmc-skills/3-solutioning/xiaoma-create-epics-and-stories/SKILL.md +93 -0
- package/src/xmc-skills/3-solutioning/xiaoma-create-epics-and-stories/customize.toml +41 -0
- package/src/xmc-skills/3-solutioning/xiaoma-create-epics-and-stories/references/headless.md +35 -0
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-epics-and-stories/steps/step-02-design-epics.md +34 -4
- package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-epics-and-stories/steps/step-04-final-validation.md +12 -0
- package/src/xmc-skills/3-solutioning/xiaoma-generate-project-context/SKILL.md +81 -0
- package/src/xmc-skills/3-solutioning/xiaoma-generate-project-context/customize.toml +41 -0
- package/src/{xmc/workflows → xmc-skills/3-solutioning}/xiaoma-generate-project-context/steps/step-03-complete.md +6 -0
- package/src/xmc-skills/4-implementation/xiaoma-agent-dev/SKILL.md +76 -0
- package/src/xmc-skills/4-implementation/xiaoma-agent-dev/customize.toml +131 -0
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline/checklist.md +29 -0
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline → xmc-skills/4-implementation/xiaoma-auto-story-pipeline}/steps/step-01-init-and-validate.md +16 -8
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline/steps/step-02-create-story.md +111 -0
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline → xmc-skills/4-implementation/xiaoma-auto-story-pipeline}/steps/step-03-validate-story.md +4 -2
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline → xmc-skills/4-implementation/xiaoma-auto-story-pipeline}/steps/step-04-develop-story.md +10 -6
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline/steps/step-05-code-review.md +99 -0
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline → xmc-skills/4-implementation/xiaoma-auto-story-pipeline}/steps/step-06-test-story.md +25 -12
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline → xmc-skills/4-implementation/xiaoma-auto-story-pipeline}/steps/step-07-fix-and-retest.md +28 -13
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline/steps/step-08-complete-story.md +174 -0
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline/steps/step-09-finalize.md +145 -0
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline/workflow.md +127 -0
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline/xiaoma-skill-manifest.yaml +27 -0
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline-batch → xmc-skills/4-implementation/xiaoma-auto-story-pipeline-batch}/SKILL.md +2 -2
- package/src/xmc-skills/4-implementation/xiaoma-auto-story-pipeline-batch/checklist.md +45 -0
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline-batch → xmc-skills/4-implementation/xiaoma-auto-story-pipeline-batch}/workflow.md +150 -7
- package/src/{xmc/workflows/4-implementation/auto-story-pipeline-batch → xmc-skills/4-implementation/xiaoma-auto-story-pipeline-batch}/xiaoma-skill-manifest.yaml +2 -2
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/SKILL.md +68 -0
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/customize.toml +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/generate-trail.md +38 -0
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/step-01-orientation.md +105 -0
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/step-02-walkthrough.md +89 -0
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/step-03-detail-pass.md +106 -0
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/step-04-testing.md +74 -0
- package/src/xmc-skills/4-implementation/xiaoma-checkpoint-preview/step-05-wrapup.md +30 -0
- package/src/xmc-skills/4-implementation/xiaoma-code-review/SKILL.md +90 -0
- package/src/xmc-skills/4-implementation/xiaoma-code-review/customize.toml +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-code-review/steps/step-01-gather-context.md +85 -0
- package/src/xmc-skills/4-implementation/xiaoma-code-review/steps/step-02-review.md +35 -0
- package/src/{xmc/workflows → xmc-skills}/4-implementation/xiaoma-code-review/steps/step-03-triage.md +7 -8
- package/src/xmc-skills/4-implementation/xiaoma-code-review/steps/step-04-present.md +132 -0
- package/src/{xmc/workflows/4-implementation/xiaoma-correct-course/workflow.md → xmc-skills/4-implementation/xiaoma-correct-course/SKILL.md} +65 -31
- package/src/{xmc/workflows → xmc-skills}/4-implementation/xiaoma-correct-course/checklist.md +2 -2
- package/src/xmc-skills/4-implementation/xiaoma-correct-course/customize.toml +41 -0
- package/src/{xmc/workflows/4-implementation/xiaoma-create-story/workflow.md → xmc-skills/4-implementation/xiaoma-create-story/SKILL.md} +60 -11
- package/src/xmc-skills/4-implementation/xiaoma-create-story/customize.toml +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-create-story/references/headless.md +32 -0
- package/src/{xmc/workflows/4-implementation/xiaoma-dev-story/workflow.md → xmc-skills/4-implementation/xiaoma-dev-story/SKILL.md} +70 -20
- package/src/xmc-skills/4-implementation/xiaoma-dev-story/customize.toml +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-investigate/SKILL.md +196 -0
- package/src/xmc-skills/4-implementation/xiaoma-investigate/customize.toml +62 -0
- package/src/xmc-skills/4-implementation/xiaoma-investigate/references/case-file-template.md +127 -0
- package/src/{xmc/workflows/xiaoma-qa-generate-e2e-tests/workflow.md → xmc-skills/4-implementation/xiaoma-qa-generate-e2e-tests/SKILL.md} +51 -23
- package/src/{xmc/workflows → xmc-skills/4-implementation}/xiaoma-qa-generate-e2e-tests/checklist.md +1 -5
- package/src/xmc-skills/4-implementation/xiaoma-qa-generate-e2e-tests/customize.toml +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/SKILL.md +111 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/compile-epic-context.md +62 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/customize.toml +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/spec-template.md +88 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/step-01-clarify-and-route.md +100 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/step-02-plan.md +47 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/step-03-implement.md +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/step-04-review.md +50 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/step-05-present.md +78 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/step-oneshot.md +71 -0
- package/src/xmc-skills/4-implementation/xiaoma-quick-dev/sync-sprint-status.md +19 -0
- package/src/{xmc/workflows/4-implementation/xiaoma-retrospective/workflow.md → xmc-skills/4-implementation/xiaoma-retrospective/SKILL.md} +185 -152
- package/src/xmc-skills/4-implementation/xiaoma-retrospective/customize.toml +41 -0
- package/src/{xmc/workflows/4-implementation/xiaoma-sprint-planning/workflow.md → xmc-skills/4-implementation/xiaoma-sprint-planning/SKILL.md} +59 -15
- package/src/xmc-skills/4-implementation/xiaoma-sprint-planning/customize.toml +41 -0
- package/src/xmc-skills/4-implementation/xiaoma-sprint-planning/references/headless.md +28 -0
- package/src/{xmc/workflows → xmc-skills}/4-implementation/xiaoma-sprint-planning/sprint-status-template.yaml +3 -3
- package/src/{xmc/workflows/4-implementation/xiaoma-sprint-status/workflow.md → xmc-skills/4-implementation/xiaoma-sprint-status/SKILL.md} +57 -20
- package/src/xmc-skills/4-implementation/xiaoma-sprint-status/customize.toml +41 -0
- package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/checklist.md +6 -0
- package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/steps/step-01-init-and-validate.md +28 -4
- package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/steps/step-02-run-requirements-pipeline.md +2 -1
- package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/steps/step-03-bridge-sprint-planning.md +63 -9
- package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/steps/step-04-run-story-pipeline.md +2 -1
- package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/steps/step-05-finalize.md +30 -3
- package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/workflow.md +7 -8
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/SKILL.md +6 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/checklist.md +47 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/steps/step-01-init-and-validate.md +156 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/steps/step-02-create-epics.md +157 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/steps/step-03-bridge-sprint-planning.md +197 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/steps/step-04-batch-create-stories.md +310 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/steps/step-05-finalize.md +351 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/workflow.md +104 -0
- package/src/xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories/xiaoma-skill-manifest.yaml +3 -0
- package/src/xmc-skills/module-help.csv +32 -0
- package/src/xmc-skills/module.yaml +95 -0
- package/src/xpm-skills/module-help.csv +3 -0
- package/src/xpm-skills/module.yaml +36 -0
- package/src/xpm-skills/xiaoma-agent-patent-advisor/SKILL.md +75 -0
- package/src/xpm-skills/xiaoma-agent-patent-advisor/customize.toml +46 -0
- package/src/xpm-skills/xiaoma-patent-mining/SKILL.md +6 -0
- package/src/xpm-skills/xiaoma-patent-mining/references/docx-format-spec.md +183 -0
- package/src/xpm-skills/xiaoma-patent-mining/scripts/md2docx.js +777 -0
- package/src/xpm-skills/xiaoma-patent-mining/steps/step-01-project-analysis.md +65 -0
- package/src/xpm-skills/xiaoma-patent-mining/steps/step-02-patent-mining.md +87 -0
- package/src/xpm-skills/xiaoma-patent-mining/steps/step-03-disclosure-writing.md +110 -0
- package/src/xpm-skills/xiaoma-patent-mining/steps/step-04-ai-taste-removal.md +85 -0
- package/src/xpm-skills/xiaoma-patent-mining/steps/step-05-docx-generation.md +111 -0
- package/src/xpm-skills/xiaoma-patent-mining/workflow.md +94 -0
- package/tools/format-workflow-md.js +263 -0
- package/tools/{cli → installer}/README.md +2 -2
- package/tools/installer/cli-utils.js +57 -0
- package/tools/installer/commands/install.js +146 -0
- package/tools/{cli → installer}/commands/status.js +15 -7
- package/tools/{cli → installer}/commands/uninstall.js +7 -7
- package/tools/installer/core/config.js +73 -0
- package/tools/installer/core/existing-install.js +121 -0
- package/tools/installer/core/install-paths.js +132 -0
- package/tools/installer/core/installer.js +1624 -0
- package/tools/installer/core/legacy-warnings.js +156 -0
- package/tools/installer/core/manifest-generator.js +859 -0
- package/tools/installer/core/manifest.js +434 -0
- package/tools/{cli/lib → installer}/file-ops.js +1 -1
- package/tools/installer/fs-native.js +116 -0
- package/tools/installer/ide/_config-driven.js +972 -0
- package/tools/{cli/installers/lib → installer}/ide/manager.js +82 -62
- package/tools/installer/ide/platform-codes.js +80 -0
- package/tools/installer/ide/platform-codes.yaml +322 -0
- package/tools/installer/ide/shared/installed-skills.js +50 -0
- package/tools/{cli/installers/lib → installer}/ide/shared/path-utils.js +0 -145
- package/tools/{cli/installers/lib → installer}/ide/shared/skill-manifest.js +3 -36
- package/tools/installer/list-options.js +210 -0
- package/tools/{cli/installers/lib → installer}/message-loader.js +3 -3
- package/tools/installer/modules/channel-plan.js +203 -0
- package/tools/installer/modules/channel-resolver.js +241 -0
- package/tools/installer/modules/custom-module-manager.js +912 -0
- package/tools/installer/modules/external-manager.js +533 -0
- package/tools/installer/modules/module-help-schema.js +13 -0
- package/tools/{cli/installers/lib/core/config-collector.js → installer/modules/official-modules.js} +1052 -110
- package/tools/installer/modules/plugin-resolver.js +398 -0
- package/tools/installer/modules/version-resolver.js +336 -0
- package/tools/installer/project-root.js +230 -0
- package/tools/{cli/lib → installer}/prompts.js +143 -100
- package/tools/installer/set-overrides.js +330 -0
- package/tools/installer/ui.js +2078 -0
- package/tools/{cli → installer}/xiaoma-cli.js +9 -10
- package/tools/{cli/lib → installer}/yaml-format.js +1 -1
- package/tools/migrate-custom-module-paths.js +124 -0
- package/tools/schema/step.js +855 -0
- package/tools/skill-validator.md +323 -0
- package/tools/validate-file-refs.js +566 -0
- package/tools/validate-frontmatter-prose-routing.js +334 -0
- package/tools/validate-skills.js +702 -0
- package/tools/validate-step-schemas.js +401 -0
- package/tools/validate-svg-changes.sh +1 -1
- package/tools/validate-trigger-column-vs-emits.js +375 -0
- package/tools/validate-warnings-samples.js +261 -0
- package/tools/xiaoma/rebrand.mjs +0 -0
- package/tools/xiaoma-npx-wrapper.js +2 -2
- package/CLAUDE.md +0 -110
- package/README.md +0 -128
- package/demo/xiaoma-bug-circle-resolve/SKILL.md +0 -6
- package/demo/xiaoma-bug-circle-resolve/workflow.md +0 -212
- package/demo/xiaoma-bug-resolve/SKILL.md +0 -6
- package/demo/xiaoma-bug-resolve/workflow.md +0 -269
- package/docs/roadshow/01-/351/241/271/347/233/256/346/246/202/350/247/210/344/270/216/346/236/266/346/236/204.md +0 -189
- package/docs/roadshow/02-/346/231/272/350/203/275/344/275/223/347/263/273/347/273/237/350/257/246/350/247/243.md +0 -464
- package/docs/roadshow/03-/346/231/272/350/203/275/344/275/223/344/272/244/344/272/222/346/265/201/347/250/213/345/233/276.md +0 -334
- package/docs/roadshow/04-/345/267/245/344/275/234/346/265/201/346/211/247/350/241/214/350/257/246/350/247/243.md +0 -1038
- package/docs/roadshow/05-/346/212/200/346/234/257/345/256/236/347/216/260/344/270/216/345/210/233/346/226/260/344/272/256/347/202/271.md +0 -205
- package/docs/roadshow/06-/350/267/257/346/274/224/346/200/273/347/273/223/344/270/216/346/274/224/347/244/272/345/273/272/350/256/256.md +0 -167
- package/patent-disclosure-optimized/SKILL.md +0 -298
- package/src/core/module-help.csv +0 -11
- package/src/core/skills/xiaoma-advanced-elicitation/SKILL.md +0 -6
- package/src/core/skills/xiaoma-advanced-elicitation/methods.csv +0 -51
- package/src/core/skills/xiaoma-editorial-review-prose/SKILL.md +0 -6
- package/src/core/skills/xiaoma-editorial-review-structure/SKILL.md +0 -6
- package/src/core/skills/xiaoma-help/SKILL.md +0 -6
- package/src/core/skills/xiaoma-help/workflow.md +0 -88
- package/src/core/skills/xiaoma-help/xiaoma-skill-manifest.yaml +0 -1
- package/src/core/skills/xiaoma-index-docs/SKILL.md +0 -6
- package/src/core/skills/xiaoma-index-docs/xiaoma-skill-manifest.yaml +0 -1
- package/src/core/skills/xiaoma-party-mode/SKILL.md +0 -6
- package/src/core/skills/xiaoma-party-mode/steps/step-01-agent-loading.md +0 -138
- package/src/core/skills/xiaoma-party-mode/steps/step-02-discussion-orchestration.md +0 -187
- package/src/core/skills/xiaoma-party-mode/steps/step-03-graceful-exit.md +0 -167
- package/src/core/skills/xiaoma-party-mode/workflow.md +0 -190
- package/src/core/skills/xiaoma-party-mode/xiaoma-skill-manifest.yaml +0 -1
- package/src/core/skills/xiaoma-review-adversarial-general/SKILL.md +0 -6
- package/src/core/skills/xiaoma-review-adversarial-general/xiaoma-skill-manifest.yaml +0 -1
- package/src/core/skills/xiaoma-review-edge-case-hunter/SKILL.md +0 -6
- package/src/core/skills/xiaoma-review-edge-case-hunter/xiaoma-skill-manifest.yaml +0 -1
- package/src/core/skills/xiaoma-shard-doc/SKILL.md +0 -6
- package/src/core/skills/xiaoma-shard-doc/xiaoma-skill-manifest.yaml +0 -1
- package/src/core/tasks/xiaoma-create-prd/SKILL.md +0 -6
- package/src/core/tasks/xiaoma-create-prd/data/prd-purpose.md +0 -197
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-01-init.md +0 -178
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-01b-continue.md +0 -161
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-02-discovery.md +0 -208
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-02b-vision.md +0 -142
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-02c-executive-summary.md +0 -158
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-03-success.md +0 -214
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-04-journeys.md +0 -201
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-05-domain.md +0 -194
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-06-innovation.md +0 -211
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-07-project-type.md +0 -222
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-08-scoping.md +0 -216
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-09-functional.md +0 -219
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-10-nonfunctional.md +0 -230
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-11-polish.md +0 -221
- package/src/core/tasks/xiaoma-create-prd/steps-c/step-12-complete.md +0 -115
- package/src/core/tasks/xiaoma-create-prd/templates/prd-template.md +0 -10
- package/src/core/tasks/xiaoma-create-prd/workflow.md +0 -62
- package/src/core/tasks/xiaoma-create-prd/xiaoma-skill-manifest.yaml +0 -1
- package/src/utility/agent-components/activation-rules.txt +0 -6
- package/src/utility/agent-components/activation-steps.txt +0 -14
- package/src/utility/agent-components/agent-command-header.md +0 -1
- package/src/utility/agent-components/agent.customize.template.yaml +0 -41
- package/src/utility/agent-components/handler-action.txt +0 -4
- package/src/utility/agent-components/handler-data.txt +0 -5
- package/src/utility/agent-components/handler-exec.txt +0 -6
- package/src/utility/agent-components/handler-multi.txt +0 -13
- package/src/utility/agent-components/handler-tmpl.txt +0 -5
- package/src/utility/agent-components/menu-handlers.txt +0 -6
- package/src/xmc/agents/analyst.agent.yaml +0 -47
- package/src/xmc/agents/architect.agent.yaml +0 -29
- package/src/xmc/agents/dev.agent.yaml +0 -38
- package/src/xmc/agents/pm.agent.yaml +0 -44
- package/src/xmc/agents/qa.agent.yaml +0 -58
- package/src/xmc/agents/quick-flow-solo-dev.agent.yaml +0 -36
- package/src/xmc/agents/sm.agent.yaml +0 -49
- package/src/xmc/agents/tech-writer/tech-writer-sidecar/documentation-standards.md +0 -224
- package/src/xmc/agents/tech-writer/tech-writer.agent.yaml +0 -46
- package/src/xmc/agents/tech-writer/xiaoma-skill-manifest.yaml +0 -3
- package/src/xmc/agents/ux-designer.agent.yaml +0 -27
- package/src/xmc/agents/xiaoma-skill-manifest.yaml +0 -39
- package/src/xmc/data/project-context-template.md +0 -26
- package/src/xmc/module-help.csv +0 -32
- package/src/xmc/module.yaml +0 -50
- package/src/xmc/teams/default-party.csv +0 -20
- package/src/xmc/teams/team-fullstack.yaml +0 -12
- package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-08-finalize.md +0 -124
- package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/workflow.md +0 -107
- package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/xiaoma-skill-manifest.yaml +0 -3
- package/src/xmc/workflows/1-analysis/research/market-steps/step-01-init.md +0 -182
- package/src/xmc/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +0 -237
- package/src/xmc/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +0 -249
- package/src/xmc/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +0 -259
- package/src/xmc/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +0 -177
- package/src/xmc/workflows/1-analysis/research/market-steps/step-06-research-completion.md +0 -476
- package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/SKILL.md +0 -6
- package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/workflow.md +0 -49
- package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/SKILL.md +0 -6
- package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/workflow.md +0 -49
- package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/SKILL.md +0 -6
- package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/research.template.md +0 -29
- package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/workflow.md +0 -50
- package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/SKILL.md +0 -6
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/product-brief.template.md +0 -10
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-01-init.md +0 -170
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-01b-continue.md +0 -158
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-02-vision.md +0 -193
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-03-users.md +0 -196
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-04-metrics.md +0 -199
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-05-scope.md +0 -213
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-06-complete.md +0 -159
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/workflow.md +0 -55
- package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/2-plan-workflows/create-prd/data/domain-complexity.csv +0 -15
- package/src/xmc/workflows/2-plan-workflows/create-prd/data/prd-purpose.md +0 -197
- package/src/xmc/workflows/2-plan-workflows/create-prd/data/project-types.csv +0 -11
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +0 -224
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-02-format-detection.md +0 -191
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-02b-parity-check.md +0 -209
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-03-density-validation.md +0 -174
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-04-brief-coverage-validation.md +0 -214
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-05-measurability-validation.md +0 -228
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-06-traceability-validation.md +0 -217
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -205
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-08-domain-compliance-validation.md +0 -243
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-09-project-type-validation.md +0 -263
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md +0 -209
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +0 -264
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-12-completeness-validation.md +0 -242
- package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +0 -232
- package/src/xmc/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +0 -65
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/SKILL.md +0 -6
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-01-init.md +0 -135
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-01b-continue.md +0 -127
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-02-discovery.md +0 -190
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-03-core-experience.md +0 -217
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-04-emotional-response.md +0 -220
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-05-inspiration.md +0 -235
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-06-design-system.md +0 -253
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-07-defining-experience.md +0 -255
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-08-visual-foundation.md +0 -225
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-09-design-directions.md +0 -225
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-10-user-journeys.md +0 -242
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-11-component-strategy.md +0 -249
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-12-ux-patterns.md +0 -238
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-13-responsive-accessibility.md +0 -265
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-14-complete.md +0 -171
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/ux-design-template.md +0 -13
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/workflow.md +0 -36
- package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/SKILL.md +0 -6
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-01-discovery.md +0 -242
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-01b-legacy-conversion.md +0 -204
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-02-review.md +0 -245
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-03-edit.md +0 -250
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-04-complete.md +0 -165
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/workflow.md +0 -63
- package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/SKILL.md +0 -6
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/domain-complexity.csv +0 -15
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/prd-purpose.md +0 -197
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/project-types.csv +0 -11
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-01-discovery.md +0 -221
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-02-format-detection.md +0 -188
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-02b-parity-check.md +0 -206
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-03-density-validation.md +0 -171
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +0 -211
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-05-measurability-validation.md +0 -225
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-06-traceability-validation.md +0 -214
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -202
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +0 -240
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-09-project-type-validation.md +0 -260
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-10-smart-validation.md +0 -206
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +0 -261
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-12-completeness-validation.md +0 -239
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-13-report-complete.md +0 -229
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/workflow.md +0 -62
- package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/SKILL.md +0 -6
- package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/workflow.md +0 -49
- package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/SKILL.md +0 -6
- package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/workflow.md +0 -38
- package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/SKILL.md +0 -6
- package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/workflow.md +0 -53
- package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/checklist.md +0 -22
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-02-create-story.md +0 -102
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-05-code-review.md +0 -95
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-08-complete-story.md +0 -114
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-finalize.md +0 -69
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md +0 -89
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/xiaoma-skill-manifest.yaml +0 -3
- package/src/xmc/workflows/4-implementation/xiaoma-code-review/SKILL.md +0 -6
- package/src/xmc/workflows/4-implementation/xiaoma-code-review/checklist.md +0 -23
- package/src/xmc/workflows/4-implementation/xiaoma-code-review/steps/step-01-gather-context.md +0 -61
- package/src/xmc/workflows/4-implementation/xiaoma-code-review/steps/step-02-review.md +0 -41
- package/src/xmc/workflows/4-implementation/xiaoma-code-review/steps/step-04-present.md +0 -38
- package/src/xmc/workflows/4-implementation/xiaoma-code-review/workflow.md +0 -54
- package/src/xmc/workflows/4-implementation/xiaoma-code-review/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/4-implementation/xiaoma-correct-course/SKILL.md +0 -6
- package/src/xmc/workflows/4-implementation/xiaoma-correct-course/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/4-implementation/xiaoma-create-story/SKILL.md +0 -6
- package/src/xmc/workflows/4-implementation/xiaoma-create-story/discover-inputs.md +0 -88
- package/src/xmc/workflows/4-implementation/xiaoma-create-story/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/4-implementation/xiaoma-dev-story/SKILL.md +0 -6
- package/src/xmc/workflows/4-implementation/xiaoma-dev-story/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/4-implementation/xiaoma-retrospective/SKILL.md +0 -6
- package/src/xmc/workflows/4-implementation/xiaoma-retrospective/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/SKILL.md +0 -6
- package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/SKILL.md +0 -6
- package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/xiaoma-document-project/SKILL.md +0 -6
- package/src/xmc/workflows/xiaoma-document-project/workflow.md +0 -27
- package/src/xmc/workflows/xiaoma-document-project/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/xiaoma-generate-project-context/SKILL.md +0 -6
- package/src/xmc/workflows/xiaoma-generate-project-context/workflow.md +0 -43
- package/src/xmc/workflows/xiaoma-generate-project-context/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/SKILL.md +0 -6
- package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/SKILL.md +0 -6
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-01-mode-detection.md +0 -169
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-02-context-gathering.md +0 -114
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-03-execute.md +0 -107
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-04-self-check.md +0 -107
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-05-adversarial-review.md +0 -94
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-06-resolve-findings.md +0 -144
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/workflow.md +0 -38
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/xiaoma-skill-manifest.yaml +0 -1
- package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/xiaoma-skill-manifest.yaml +0 -1
- package/tools/cli/commands/install.js +0 -87
- package/tools/cli/external-official-modules.yaml +0 -4
- package/tools/cli/installers/lib/core/custom-module-cache.js +0 -260
- package/tools/cli/installers/lib/core/dependency-resolver.js +0 -743
- package/tools/cli/installers/lib/core/detector.js +0 -223
- package/tools/cli/installers/lib/core/ide-config-manager.js +0 -157
- package/tools/cli/installers/lib/core/installer.js +0 -3212
- package/tools/cli/installers/lib/core/manifest-generator.js +0 -1374
- package/tools/cli/installers/lib/core/manifest.js +0 -1040
- package/tools/cli/installers/lib/custom/handler.js +0 -358
- package/tools/cli/installers/lib/ide/_base-ide.js +0 -673
- package/tools/cli/installers/lib/ide/_config-driven.js +0 -1058
- package/tools/cli/installers/lib/ide/platform-codes.js +0 -100
- package/tools/cli/installers/lib/ide/platform-codes.yaml +0 -321
- package/tools/cli/installers/lib/ide/shared/agent-command-generator.js +0 -181
- package/tools/cli/installers/lib/ide/shared/module-injections.js +0 -136
- package/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js +0 -368
- package/tools/cli/installers/lib/ide/shared/workflow-command-generator.js +0 -179
- package/tools/cli/installers/lib/ide/shared/xiaoma-artifacts.js +0 -181
- package/tools/cli/installers/lib/ide/templates/agent-command-template.md +0 -14
- package/tools/cli/installers/lib/ide/templates/combined/antigravity.md +0 -8
- package/tools/cli/installers/lib/ide/templates/combined/default-agent.md +0 -15
- package/tools/cli/installers/lib/ide/templates/combined/default-task.md +0 -10
- package/tools/cli/installers/lib/ide/templates/combined/default-tool.md +0 -10
- package/tools/cli/installers/lib/ide/templates/combined/default-workflow.md +0 -6
- package/tools/cli/installers/lib/ide/templates/combined/gemini-agent.toml +0 -14
- package/tools/cli/installers/lib/ide/templates/combined/gemini-task.toml +0 -11
- package/tools/cli/installers/lib/ide/templates/combined/gemini-tool.toml +0 -11
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow-yaml.toml +0 -16
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow.toml +0 -14
- package/tools/cli/installers/lib/ide/templates/combined/kiro-agent.md +0 -16
- package/tools/cli/installers/lib/ide/templates/combined/kiro-task.md +0 -9
- package/tools/cli/installers/lib/ide/templates/combined/kiro-tool.md +0 -9
- package/tools/cli/installers/lib/ide/templates/combined/kiro-workflow.md +0 -7
- package/tools/cli/installers/lib/ide/templates/combined/opencode-agent.md +0 -15
- package/tools/cli/installers/lib/ide/templates/combined/opencode-task.md +0 -13
- package/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md +0 -13
- package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md +0 -16
- package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md +0 -16
- package/tools/cli/installers/lib/ide/templates/combined/rovodev.md +0 -9
- package/tools/cli/installers/lib/ide/templates/combined/trae.md +0 -9
- package/tools/cli/installers/lib/ide/templates/combined/windsurf-workflow.md +0 -10
- package/tools/cli/installers/lib/ide/templates/split/.gitkeep +0 -0
- package/tools/cli/installers/lib/modules/external-manager.js +0 -136
- package/tools/cli/installers/lib/modules/manager.js +0 -1382
- package/tools/cli/lib/activation-builder.js +0 -165
- package/tools/cli/lib/agent/compiler.js +0 -516
- package/tools/cli/lib/agent/installer.js +0 -680
- package/tools/cli/lib/agent/template-engine.js +0 -152
- package/tools/cli/lib/agent-analyzer.js +0 -97
- package/tools/cli/lib/agent-party-generator.js +0 -194
- package/tools/cli/lib/cli-utils.js +0 -182
- package/tools/cli/lib/config.js +0 -213
- package/tools/cli/lib/platform-codes.js +0 -116
- package/tools/cli/lib/project-root.js +0 -77
- package/tools/cli/lib/ui.js +0 -1960
- package/tools/cli/lib/xml-handler.js +0 -177
- package/tools/cli/lib/xml-to-markdown.js +0 -82
- package/tools/cli/lib/yaml-xml-builder.js +0 -570
- package/tools/platform-codes.yaml +0 -157
- package/tools/schema/agent.js +0 -489
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/SKILL.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/brain-methods.csv +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-01-session-setup.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-01b-continue.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-02a-user-selected.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-02b-ai-recommended.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-02c-random-selection.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-02d-progressive-flow.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/steps/step-04-idea-organization.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-brainstorming/template.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-distillator/SKILL.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-distillator/agents/distillate-compressor.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-distillator/agents/round-trip-reconstructor.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-distillator/resources/compression-rules.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-distillator/resources/splitting-strategy.md +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-distillator/scripts/tests/test_analyze_sources.py +0 -0
- /package/src/{core/skills → core-skills}/xiaoma-distillator/xiaoma-skill-manifest.yaml +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-domain-research/domain-steps/step-01-init.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-domain-research/domain-steps/step-02-domain-analysis.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-domain-research/domain-steps/step-03-competitive-landscape.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-domain-research/domain-steps/step-04-regulatory-focus.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-domain-research/domain-steps/step-05-technical-trends.md +0 -0
- /package/src/{xmc/workflows/1-analysis/research → xmc-skills/1-analysis/research/xiaoma-domain-research}/research.template.md +0 -0
- /package/src/{xmc/workflows/1-analysis/research/xiaoma-domain-research → xmc-skills/1-analysis/research/xiaoma-market-research}/research.template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-market-research/steps/step-01-init.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-market-research/steps/step-02-customer-behavior.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-market-research/steps/step-03-customer-pain-points.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-market-research/steps/step-04-customer-decisions.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-market-research/steps/step-05-competitive-analysis.md +0 -0
- /package/src/{xmc/workflows/1-analysis/research/xiaoma-market-research → xmc-skills/1-analysis/research/xiaoma-technical-research}/research.template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-technical-research/technical-steps/step-01-init.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-technical-research/technical-steps/step-02-technical-overview.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-technical-research/technical-steps/step-03-integration-patterns.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-technical-research/technical-steps/step-04-architectural-patterns.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/research/xiaoma-technical-research/technical-steps/step-05-implementation-research.md +0 -0
- /package/src/{xmc/workflows/1-analysis/auto-requirements-pipeline → xmc-skills/1-analysis/xiaoma-auto-requirements-pipeline}/SKILL.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/checklist.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/documentation-requirements.csv +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/instructions.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/templates/deep-dive-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/templates/index-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/templates/project-overview-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/templates/project-scan-report-schema.json +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/templates/source-tree-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/workflows/deep-dive-workflow.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/1-analysis}/xiaoma-document-project/workflows/full-scan-workflow.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/SKILL.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/agents/artifact-analyzer.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/agents/opportunity-reviewer.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/agents/skeptic-reviewer.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/agents/web-researcher.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/prompts/contextual-discovery.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/prompts/draft-and-review.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/prompts/finalize.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/prompts/guided-elicitation.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/resources/brief-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/1-analysis/xiaoma-product-brief-preview/xiaoma-manifest.json +0 -0
- /package/src/{core/skills/xiaoma-advanced-elicitation → xmc-skills/1-analysis/xiaoma-product-brief-preview}/xiaoma-skill-manifest.yaml +0 -0
- /package/src/{core/tasks/xiaoma-create-prd/data → xmc-skills/2-plan-workflows/xiaoma-prd/assets}/domain-complexity.csv +0 -0
- /package/src/{core/tasks/xiaoma-create-prd/data → xmc-skills/2-plan-workflows/xiaoma-prd/assets}/project-types.csv +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-check-implementation-readiness/steps/step-04-ux-alignment.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-check-implementation-readiness/steps/step-05-epic-quality-review.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-check-implementation-readiness/templates/readiness-report-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/architecture-decision-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/data/domain-complexity.csv +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/data/project-types.csv +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-01-init.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-01b-continue.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-02-context.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-03-starter.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-04-decisions.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-05-patterns.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-architecture/steps/step-06-structure.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-epics-and-stories/steps/step-03-create-stories.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/3-solutioning/xiaoma-create-epics-and-stories/templates/epics-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/3-solutioning}/xiaoma-generate-project-context/project-context-template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/3-solutioning}/xiaoma-generate-project-context/steps/step-01-discover.md +0 -0
- /package/src/{xmc/workflows → xmc-skills/3-solutioning}/xiaoma-generate-project-context/steps/step-02-generate.md +0 -0
- /package/src/{xmc/workflows/4-implementation/auto-story-pipeline → xmc-skills/4-implementation/xiaoma-auto-story-pipeline}/SKILL.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/4-implementation/xiaoma-create-story/checklist.md +0 -0
- /package/src/{xmc/workflows/4-implementation/xiaoma-code-review → xmc-skills/4-implementation/xiaoma-create-story}/discover-inputs.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/4-implementation/xiaoma-create-story/template.md +0 -0
- /package/src/{xmc/workflows → xmc-skills}/4-implementation/xiaoma-dev-story/checklist.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/SKILL.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/steps/step-01-clarify-and-route.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/steps/step-02-plan.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/steps/step-03-implement.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/steps/step-04-review.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/steps/step-05-present.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/tech-spec-template.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-dev-new-preview/workflow.md +0 -0
- /package/src/{core/skills/xiaoma-brainstorming → xmc-skills/4-implementation/xiaoma-quick-dev-new-preview}/xiaoma-skill-manifest.yaml +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-spec/SKILL.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-spec/steps/step-01-understand.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-spec/steps/step-02-investigate.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-spec/steps/step-03-generate.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-spec/steps/step-04-review.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-spec/tech-spec-template.md +0 -0
- /package/src/{xmc/workflows/xiaoma-quick-flow → xmc-skills/4-implementation}/xiaoma-quick-spec/workflow.md +0 -0
- /package/src/{core/skills/xiaoma-editorial-review-prose → xmc-skills/4-implementation/xiaoma-quick-spec}/xiaoma-skill-manifest.yaml +0 -0
- /package/src/{xmc/workflows → xmc-skills}/4-implementation/xiaoma-sprint-planning/checklist.md +0 -0
- /package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/SKILL.md +0 -0
- /package/src/{xmc/workflows/5-full-pipeline/auto-full-pipeline → xmc-skills/5-full-pipeline/xiaoma-auto-full-pipeline}/xiaoma-skill-manifest.yaml +0 -0
- /package/{patent-disclosure-optimized → src/xpm-skills/xiaoma-patent-mining}/references/disclosure-template.md +0 -0
- /package/{patent-disclosure-optimized → src/xpm-skills/xiaoma-patent-mining}/references/mining-principles.md +0 -0
- /package/src/{core/skills/xiaoma-editorial-review-structure → xpm-skills/xiaoma-patent-mining}/xiaoma-skill-manifest.yaml +0 -0
- /package/tools/{cli/installers → installer}/install-messages.yaml +0 -0
|
@@ -0,0 +1,912 @@
|
|
|
1
|
+
const fs = require('../fs-native');
|
|
2
|
+
const os = require('node:os');
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { execSync } = require('node:child_process');
|
|
5
|
+
const prompts = require('../prompts');
|
|
6
|
+
|
|
7
|
+
function quoteCustomRef(ref) {
|
|
8
|
+
if (typeof ref !== 'string' || !/^[\w.\-+/]+$/.test(ref)) {
|
|
9
|
+
throw new Error(`Unsafe ref name: ${JSON.stringify(ref)}`);
|
|
10
|
+
}
|
|
11
|
+
return `"${ref}"`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Manages custom modules installed from user-provided sources.
|
|
16
|
+
* Supports any Git host (GitHub, GitLab, Bitbucket, self-hosted) and local file paths.
|
|
17
|
+
* Validates input, clones repos, reads .claude-plugin/marketplace.json, resolves plugins.
|
|
18
|
+
*/
|
|
19
|
+
class CustomModuleManager {
|
|
20
|
+
/** @type {Map<string, Object>} Shared across all instances: module code -> ResolvedModule */
|
|
21
|
+
static _resolutionCache = new Map();
|
|
22
|
+
/** @type {Set<string>} Repo roots refreshed in the current process (dedupe quick-update fetches). */
|
|
23
|
+
static _refreshedRepoPaths = new Set();
|
|
24
|
+
/** @type {Map<string, Promise<void>>} In-flight refresh operations keyed by repo path. */
|
|
25
|
+
static _refreshInFlight = new Map();
|
|
26
|
+
|
|
27
|
+
// ─── Source Parsing ───────────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Parse a user-provided source input into a structured descriptor.
|
|
31
|
+
* Accepts local file paths, HTTPS Git URLs, HTTP Git URLs, and SSH Git URLs.
|
|
32
|
+
* For HTTPS/HTTP URLs with deep paths (e.g., /tree/main/subdir), extracts the subdir.
|
|
33
|
+
* The original protocol (http or https) is preserved in the returned cloneUrl.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} input - URL or local file path
|
|
36
|
+
* @returns {Object} Parsed source descriptor:
|
|
37
|
+
* { type: 'url'|'local', cloneUrl, subdir, localPath, cacheKey, displayName, isValid, error }
|
|
38
|
+
*/
|
|
39
|
+
parseSource(input) {
|
|
40
|
+
if (!input || typeof input !== 'string') {
|
|
41
|
+
return {
|
|
42
|
+
type: null,
|
|
43
|
+
cloneUrl: null,
|
|
44
|
+
subdir: null,
|
|
45
|
+
localPath: null,
|
|
46
|
+
cacheKey: null,
|
|
47
|
+
displayName: null,
|
|
48
|
+
isValid: false,
|
|
49
|
+
error: 'Source is required',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const trimmedRaw = input.trim();
|
|
54
|
+
if (!trimmedRaw) {
|
|
55
|
+
return {
|
|
56
|
+
type: null,
|
|
57
|
+
cloneUrl: null,
|
|
58
|
+
subdir: null,
|
|
59
|
+
localPath: null,
|
|
60
|
+
cacheKey: null,
|
|
61
|
+
displayName: null,
|
|
62
|
+
isValid: false,
|
|
63
|
+
error: 'Source is required',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Extract optional @<tag-or-branch> suffix from the end of the input.
|
|
68
|
+
// Semver-valid characters: letters, digits, dot, hyphen, underscore, plus, slash.
|
|
69
|
+
// Raw commit SHAs are NOT supported here — `git clone --branch` can't take
|
|
70
|
+
// them; use --pin at the module level or check out the SHA manually.
|
|
71
|
+
// Only strip when the tail looks like a ref, so we don't disturb
|
|
72
|
+
// URLs without a version spec or the SSH protocol's `git@host:...` prefix.
|
|
73
|
+
let trimmed = trimmedRaw;
|
|
74
|
+
let versionSuffix = null;
|
|
75
|
+
const lastAt = trimmedRaw.lastIndexOf('@');
|
|
76
|
+
// Skip if @ is part of git@github.com:... (first char cannot be stripped as version)
|
|
77
|
+
// and skip if @ appears before the path rather than after a ref-shaped tail.
|
|
78
|
+
if (lastAt > 0) {
|
|
79
|
+
const candidate = trimmedRaw.slice(lastAt + 1);
|
|
80
|
+
const before = trimmedRaw.slice(0, lastAt);
|
|
81
|
+
// candidate must be ref-shaped and must not itself look like a URL / SSH host
|
|
82
|
+
if (/^[\w.\-+/]+$/.test(candidate) && !candidate.includes(':')) {
|
|
83
|
+
// Avoid consuming the @ in `git@host:owner/repo` — `before` wouldn't end with a path separator
|
|
84
|
+
// in that case. Require that the @ comes after the host/path, not inside the auth segment.
|
|
85
|
+
// Rule: the @ is a version suffix only if `before` looks like a complete URL or local path.
|
|
86
|
+
const beforeLooksLikeRepo =
|
|
87
|
+
before.startsWith('/') ||
|
|
88
|
+
before.startsWith('./') ||
|
|
89
|
+
before.startsWith('../') ||
|
|
90
|
+
before.startsWith('~') ||
|
|
91
|
+
/^https?:\/\//i.test(before) ||
|
|
92
|
+
/^git@[^:]+:.+/.test(before);
|
|
93
|
+
if (beforeLooksLikeRepo) {
|
|
94
|
+
versionSuffix = candidate;
|
|
95
|
+
trimmed = before;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Local path detection: starts with /, ./, ../, or ~
|
|
101
|
+
if (trimmed.startsWith('/') || trimmed.startsWith('./') || trimmed.startsWith('../') || trimmed.startsWith('~')) {
|
|
102
|
+
if (versionSuffix) {
|
|
103
|
+
return {
|
|
104
|
+
type: 'local',
|
|
105
|
+
cloneUrl: null,
|
|
106
|
+
subdir: null,
|
|
107
|
+
localPath: null,
|
|
108
|
+
cacheKey: null,
|
|
109
|
+
displayName: null,
|
|
110
|
+
isValid: false,
|
|
111
|
+
error: 'Local paths do not support @version suffixes',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return this._parseLocalPath(trimmed);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// SSH URL: git@host:owner/repo.git
|
|
118
|
+
const sshMatch = trimmed.match(/^git@([^:]+):(.+?)\/([^/.]+?)(?:\.git)?$/);
|
|
119
|
+
if (sshMatch) {
|
|
120
|
+
const [, host, owner, repo] = sshMatch;
|
|
121
|
+
return {
|
|
122
|
+
type: 'url',
|
|
123
|
+
cloneUrl: trimmed,
|
|
124
|
+
subdir: null,
|
|
125
|
+
localPath: null,
|
|
126
|
+
version: versionSuffix || null,
|
|
127
|
+
rawInput: trimmedRaw,
|
|
128
|
+
cacheKey: `${host}/${owner}/${repo}`,
|
|
129
|
+
displayName: `${owner}/${repo}`,
|
|
130
|
+
isValid: true,
|
|
131
|
+
error: null,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// HTTPS/HTTP URL: generic handling for any Git host.
|
|
136
|
+
// We avoid host-specific parsing — `git clone` will accept whatever URL the
|
|
137
|
+
// user provides. We only need to (a) separate an optional browser-style
|
|
138
|
+
// subdir suffix from the clone URL, (b) extract any embedded ref
|
|
139
|
+
// (branch/tag) from deep-path URLs, and (c) derive a cache key / display
|
|
140
|
+
// name from the path. The original protocol (http or https) is preserved.
|
|
141
|
+
if (/^https?:\/\//i.test(trimmed)) {
|
|
142
|
+
let url;
|
|
143
|
+
try {
|
|
144
|
+
url = new URL(trimmed);
|
|
145
|
+
} catch {
|
|
146
|
+
url = null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (url && url.host) {
|
|
150
|
+
const host = url.host;
|
|
151
|
+
let repoPath = url.pathname.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
152
|
+
let subdir = null;
|
|
153
|
+
let urlRef = null; // branch/tag/commit extracted from deep-path URLs
|
|
154
|
+
|
|
155
|
+
// Detect browser-style deep-path patterns that embed a ref
|
|
156
|
+
// (branch/tag/commit) and optional subdirectory. These appear
|
|
157
|
+
// across many hosts:
|
|
158
|
+
// GitHub /<repo>/tree|blob/<ref>[/<subdir>]
|
|
159
|
+
// GitLab /<repo>/-/tree|blob/<ref>[/<subdir>]
|
|
160
|
+
// Gitea /<repo>/src/<ref>[/<subdir>]
|
|
161
|
+
// Gitea /<repo>/src/(branch|commit|tag)/<ref>[/<subdir>]
|
|
162
|
+
// Group 1 = repo path prefix, Group 2 = ref, Group 3 = subdir (optional).
|
|
163
|
+
const deepPathPatterns = [
|
|
164
|
+
/^(.+?)\/(?:-\/)?(?:tree|blob)\/([^/]+)(?:\/(.+))?$/,
|
|
165
|
+
/^(.+?)\/src\/(?:branch\/|commit\/|tag\/)?([^/]+)(?:\/(.+))?$/,
|
|
166
|
+
];
|
|
167
|
+
for (const pattern of deepPathPatterns) {
|
|
168
|
+
const match = repoPath.match(pattern);
|
|
169
|
+
if (match) {
|
|
170
|
+
repoPath = match[1];
|
|
171
|
+
if (match[2]) urlRef = match[2];
|
|
172
|
+
if (match[3]) {
|
|
173
|
+
const cleaned = match[3].replace(/\/+$/, '');
|
|
174
|
+
if (cleaned) subdir = cleaned;
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Some hosts use ?path=/subdir on browse links to point at a file or
|
|
181
|
+
// directory. Honor it when no deep-path marker matched above.
|
|
182
|
+
if (!subdir) {
|
|
183
|
+
const pathParam = url.searchParams.get('path');
|
|
184
|
+
if (pathParam) {
|
|
185
|
+
const cleaned = pathParam.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
186
|
+
if (cleaned) subdir = cleaned;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Strip a single trailing .git for a stable cacheKey/displayName.
|
|
191
|
+
const repoPathClean = repoPath.replace(/\.git$/i, '');
|
|
192
|
+
if (!repoPathClean) {
|
|
193
|
+
return {
|
|
194
|
+
type: null,
|
|
195
|
+
cloneUrl: null,
|
|
196
|
+
subdir: null,
|
|
197
|
+
localPath: null,
|
|
198
|
+
cacheKey: null,
|
|
199
|
+
displayName: null,
|
|
200
|
+
isValid: false,
|
|
201
|
+
error: 'Not a valid Git URL or local path',
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const cloneUrl = `${url.protocol}//${host}/${repoPathClean}`;
|
|
206
|
+
const cacheKey = `${host}/${repoPathClean}`;
|
|
207
|
+
|
|
208
|
+
// Display name: prefer "<owner>/<repo>" using the last two meaningful
|
|
209
|
+
// path segments.
|
|
210
|
+
const segments = repoPathClean.split('/').filter(Boolean);
|
|
211
|
+
const repoSeg = segments.at(-1);
|
|
212
|
+
const ownerSeg = segments.at(-2);
|
|
213
|
+
const displayName = ownerSeg ? `${ownerSeg}/${repoSeg}` : repoSeg;
|
|
214
|
+
|
|
215
|
+
// Precedence: explicit @version suffix > URL /tree/<ref> path segment.
|
|
216
|
+
const version = versionSuffix || urlRef || null;
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
type: 'url',
|
|
220
|
+
cloneUrl,
|
|
221
|
+
subdir,
|
|
222
|
+
localPath: null,
|
|
223
|
+
version,
|
|
224
|
+
rawInput: trimmedRaw,
|
|
225
|
+
cacheKey,
|
|
226
|
+
displayName,
|
|
227
|
+
isValid: true,
|
|
228
|
+
error: null,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return {
|
|
234
|
+
type: null,
|
|
235
|
+
cloneUrl: null,
|
|
236
|
+
subdir: null,
|
|
237
|
+
localPath: null,
|
|
238
|
+
cacheKey: null,
|
|
239
|
+
displayName: null,
|
|
240
|
+
isValid: false,
|
|
241
|
+
error: 'Not a valid Git URL or local path',
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Parse a local filesystem path.
|
|
247
|
+
* @param {string} rawPath - Path string (may contain ~ for home)
|
|
248
|
+
* @returns {Object} Parsed source descriptor
|
|
249
|
+
*/
|
|
250
|
+
_parseLocalPath(rawPath) {
|
|
251
|
+
const expanded = rawPath.startsWith('~') ? path.join(os.homedir(), rawPath.slice(1)) : rawPath;
|
|
252
|
+
const resolved = path.resolve(expanded);
|
|
253
|
+
|
|
254
|
+
if (!fs.pathExistsSync(resolved)) {
|
|
255
|
+
return {
|
|
256
|
+
type: 'local',
|
|
257
|
+
cloneUrl: null,
|
|
258
|
+
subdir: null,
|
|
259
|
+
localPath: resolved,
|
|
260
|
+
cacheKey: null,
|
|
261
|
+
displayName: path.basename(resolved),
|
|
262
|
+
isValid: false,
|
|
263
|
+
error: `Path does not exist: ${resolved}`,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return {
|
|
268
|
+
type: 'local',
|
|
269
|
+
cloneUrl: null,
|
|
270
|
+
subdir: null,
|
|
271
|
+
localPath: resolved,
|
|
272
|
+
cacheKey: null,
|
|
273
|
+
displayName: path.basename(resolved),
|
|
274
|
+
isValid: true,
|
|
275
|
+
error: null,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// ─── Marketplace JSON ─────────────────────────────────────────────────────
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Read .claude-plugin/marketplace.json from a local directory.
|
|
283
|
+
* @param {string} dirPath - Directory to read from
|
|
284
|
+
* @returns {Object|null} Parsed marketplace.json or null if not found
|
|
285
|
+
*/
|
|
286
|
+
async readMarketplaceJsonFromDisk(dirPath) {
|
|
287
|
+
const marketplacePath = path.join(dirPath, '.claude-plugin', 'marketplace.json');
|
|
288
|
+
if (!(await fs.pathExists(marketplacePath))) return null;
|
|
289
|
+
try {
|
|
290
|
+
return JSON.parse(await fs.readFile(marketplacePath, 'utf8'));
|
|
291
|
+
} catch {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// ─── Discovery ────────────────────────────────────────────────────────────
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Discover modules from pre-read marketplace.json data.
|
|
300
|
+
* @param {Object} marketplaceData - Parsed marketplace.json content
|
|
301
|
+
* @param {string|null} sourceUrl - Source URL for tracking (null for local paths)
|
|
302
|
+
* @returns {Array<Object>} Normalized plugin list
|
|
303
|
+
*/
|
|
304
|
+
async discoverModules(marketplaceData, sourceUrl) {
|
|
305
|
+
const plugins = marketplaceData?.plugins;
|
|
306
|
+
|
|
307
|
+
if (!Array.isArray(plugins) || plugins.length === 0) {
|
|
308
|
+
throw new Error('marketplace.json contains no plugins');
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return plugins.map((plugin) => this._normalizeCustomModule(plugin, sourceUrl, marketplaceData));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// ─── Source Resolution ────────────────────────────────────────────────────
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* High-level coordinator: parse input, clone if URL, determine discovery vs direct mode.
|
|
318
|
+
* @param {string} input - URL or local path
|
|
319
|
+
* @param {Object} [options] - Options passed to cloneRepo
|
|
320
|
+
* @returns {Object} { parsed, rootDir, repoPath, sourceUrl, marketplace, mode: 'discovery'|'direct' }
|
|
321
|
+
*/
|
|
322
|
+
async resolveSource(input, options = {}) {
|
|
323
|
+
const parsed = this.parseSource(input);
|
|
324
|
+
if (!parsed.isValid) throw new Error(parsed.error);
|
|
325
|
+
|
|
326
|
+
let rootDir;
|
|
327
|
+
let repoPath;
|
|
328
|
+
let sourceUrl;
|
|
329
|
+
|
|
330
|
+
if (parsed.type === 'local') {
|
|
331
|
+
rootDir = parsed.localPath;
|
|
332
|
+
repoPath = null;
|
|
333
|
+
sourceUrl = null;
|
|
334
|
+
} else {
|
|
335
|
+
repoPath = await this.cloneRepo(input, options);
|
|
336
|
+
sourceUrl = parsed.cloneUrl;
|
|
337
|
+
rootDir = parsed.subdir ? path.join(repoPath, parsed.subdir) : repoPath;
|
|
338
|
+
|
|
339
|
+
if (parsed.subdir && !(await fs.pathExists(rootDir))) {
|
|
340
|
+
throw new Error(`Subdirectory '${parsed.subdir}' not found in cloned repository`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const marketplace = await this.readMarketplaceJsonFromDisk(rootDir);
|
|
345
|
+
const mode = marketplace ? 'discovery' : 'direct';
|
|
346
|
+
|
|
347
|
+
return { parsed, rootDir, repoPath, sourceUrl, marketplace, mode };
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// ─── Clone ────────────────────────────────────────────────────────────────
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Get the cache directory for custom modules.
|
|
354
|
+
* @returns {string} Path to the custom modules cache directory
|
|
355
|
+
*/
|
|
356
|
+
getCacheDir() {
|
|
357
|
+
return path.join(os.homedir(), '.xiaoma', 'cache', 'custom-modules');
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Clone a custom module repository to cache.
|
|
362
|
+
* Supports any Git host (GitHub, GitLab, Bitbucket, self-hosted, etc.).
|
|
363
|
+
* @param {string} sourceInput - Git URL (HTTPS, HTTP, or SSH)
|
|
364
|
+
* @param {Object} [options] - Clone options
|
|
365
|
+
* @param {boolean} [options.silent] - Suppress spinner output
|
|
366
|
+
* @param {boolean} [options.skipInstall] - Skip npm install (for browsing before user confirms)
|
|
367
|
+
* @returns {string} Path to the cloned repository
|
|
368
|
+
*/
|
|
369
|
+
async cloneRepo(sourceInput, options = {}) {
|
|
370
|
+
const parsed = this.parseSource(sourceInput);
|
|
371
|
+
if (!parsed.isValid) throw new Error(parsed.error);
|
|
372
|
+
if (parsed.type === 'local') throw new Error('cloneRepo does not accept local paths');
|
|
373
|
+
|
|
374
|
+
const cacheDir = this.getCacheDir();
|
|
375
|
+
const repoCacheDir = path.join(cacheDir, ...parsed.cacheKey.split('/'));
|
|
376
|
+
const silent = options.silent || false;
|
|
377
|
+
const displayName = parsed.displayName;
|
|
378
|
+
|
|
379
|
+
// Pin override: --pin CODE=TAG resolved at module-selection time overrides
|
|
380
|
+
// any @version suffix present in the URL.
|
|
381
|
+
const effectiveVersion = options.pinOverride || parsed.version || null;
|
|
382
|
+
|
|
383
|
+
await fs.ensureDir(path.dirname(repoCacheDir));
|
|
384
|
+
|
|
385
|
+
const createSpinner = async () => {
|
|
386
|
+
if (silent) {
|
|
387
|
+
return { start() {}, stop() {}, error() {} };
|
|
388
|
+
}
|
|
389
|
+
return await prompts.spinner();
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
// If an existing cache exists but was cloned at a different version, re-clone.
|
|
393
|
+
// Tracked via .xiaoma-source.json's recorded version.
|
|
394
|
+
if (await fs.pathExists(repoCacheDir)) {
|
|
395
|
+
let cachedVersion = null;
|
|
396
|
+
try {
|
|
397
|
+
const existing = await fs.readJson(path.join(repoCacheDir, '.xiaoma-source.json'));
|
|
398
|
+
cachedVersion = existing?.version || null;
|
|
399
|
+
} catch {
|
|
400
|
+
// no metadata; treat as mismatched to be safe if a version was requested
|
|
401
|
+
}
|
|
402
|
+
if ((effectiveVersion || null) !== (cachedVersion || null)) {
|
|
403
|
+
await fs.remove(repoCacheDir);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if (await fs.pathExists(repoCacheDir)) {
|
|
408
|
+
// Update existing clone (same version as before)
|
|
409
|
+
const fetchSpinner = await createSpinner();
|
|
410
|
+
fetchSpinner.start(`Updating ${displayName}...`);
|
|
411
|
+
try {
|
|
412
|
+
execSync('git fetch origin --depth 1', {
|
|
413
|
+
cwd: repoCacheDir,
|
|
414
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
415
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
|
416
|
+
});
|
|
417
|
+
if (effectiveVersion) {
|
|
418
|
+
// Fetch the ref as either a tag or a branch — `origin <ref>` works
|
|
419
|
+
// for both, whereas `origin tag <ref>` fails for branch refs parsed
|
|
420
|
+
// out of /tree/<branch>/... URLs.
|
|
421
|
+
execSync(`git fetch --depth 1 origin ${quoteCustomRef(effectiveVersion)} --no-tags`, {
|
|
422
|
+
cwd: repoCacheDir,
|
|
423
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
424
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
|
425
|
+
});
|
|
426
|
+
execSync(`git checkout --quiet FETCH_HEAD`, {
|
|
427
|
+
cwd: repoCacheDir,
|
|
428
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
429
|
+
});
|
|
430
|
+
} else {
|
|
431
|
+
// Resolve the default branch (origin/HEAD) and fetch it explicitly.
|
|
432
|
+
// With shallow clones, `origin/HEAD` is stale and `git reset --hard
|
|
433
|
+
// origin/HEAD` never picks up new commits on the default branch.
|
|
434
|
+
let defaultBranch = 'main';
|
|
435
|
+
try {
|
|
436
|
+
defaultBranch = execSync('git symbolic-ref refs/remotes/origin/HEAD --short', {
|
|
437
|
+
cwd: repoCacheDir,
|
|
438
|
+
stdio: 'pipe',
|
|
439
|
+
})
|
|
440
|
+
.toString()
|
|
441
|
+
.trim()
|
|
442
|
+
.replace('origin/', '');
|
|
443
|
+
} catch {
|
|
444
|
+
// Fallback if origin/HEAD is not set
|
|
445
|
+
}
|
|
446
|
+
execSync(`git fetch --depth 1 origin ${quoteCustomRef(defaultBranch)}`, {
|
|
447
|
+
cwd: repoCacheDir,
|
|
448
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
449
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
|
450
|
+
});
|
|
451
|
+
execSync(`git reset --hard origin/${quoteCustomRef(defaultBranch)}`, {
|
|
452
|
+
cwd: repoCacheDir,
|
|
453
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
fetchSpinner.stop(`Updated ${displayName}`);
|
|
457
|
+
} catch {
|
|
458
|
+
// Fetch failed against an existing cache — most often the remote is
|
|
459
|
+
// unreachable (network down, repo deleted/moved, auth revoked).
|
|
460
|
+
// Preserve the previous clone so re-deploy still works from cached
|
|
461
|
+
// content; surface a warning so the user knows the cache is stale.
|
|
462
|
+
fetchSpinner.error(`Could not refresh ${displayName} — keeping cached copy`);
|
|
463
|
+
await prompts.log.warn(`Custom module ${displayName} was not refreshed (remote unreachable). Using cached copy.`);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
if (!(await fs.pathExists(repoCacheDir))) {
|
|
468
|
+
const fetchSpinner = await createSpinner();
|
|
469
|
+
fetchSpinner.start(`Cloning ${displayName}${effectiveVersion ? ` @ ${effectiveVersion}` : ''}...`);
|
|
470
|
+
try {
|
|
471
|
+
if (effectiveVersion) {
|
|
472
|
+
execSync(`git clone --depth 1 --branch ${quoteCustomRef(effectiveVersion)} "${parsed.cloneUrl}" "${repoCacheDir}"`, {
|
|
473
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
474
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
|
475
|
+
});
|
|
476
|
+
} else {
|
|
477
|
+
execSync(`git clone --depth 1 "${parsed.cloneUrl}" "${repoCacheDir}"`, {
|
|
478
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
479
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
fetchSpinner.stop(`Cloned ${displayName}`);
|
|
483
|
+
} catch (error_) {
|
|
484
|
+
fetchSpinner.error(`Failed to clone ${displayName}`);
|
|
485
|
+
const refSuffix = effectiveVersion ? `@${effectiveVersion}` : '';
|
|
486
|
+
throw new Error(`Failed to clone ${parsed.cloneUrl}${refSuffix}: ${error_.message}`);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// Record the resolved SHA for the manifest writer.
|
|
491
|
+
let resolvedSha = null;
|
|
492
|
+
try {
|
|
493
|
+
resolvedSha = execSync('git rev-parse HEAD', { cwd: repoCacheDir, stdio: 'pipe' }).toString().trim();
|
|
494
|
+
} catch {
|
|
495
|
+
// swallow — a non-git repo (local path) wouldn't reach here anyway
|
|
496
|
+
}
|
|
497
|
+
// Best-effort: capture the remote default branch name so channel marker
|
|
498
|
+
// metadata for "next" reflects the actual tracked ref (not always "main").
|
|
499
|
+
let defaultRef = 'main';
|
|
500
|
+
if (!effectiveVersion) {
|
|
501
|
+
try {
|
|
502
|
+
const symbolic = execSync('git symbolic-ref --short refs/remotes/origin/HEAD', {
|
|
503
|
+
cwd: repoCacheDir,
|
|
504
|
+
stdio: 'pipe',
|
|
505
|
+
})
|
|
506
|
+
.toString()
|
|
507
|
+
.trim();
|
|
508
|
+
if (symbolic.startsWith('origin/')) {
|
|
509
|
+
defaultRef = symbolic.slice('origin/'.length) || defaultRef;
|
|
510
|
+
}
|
|
511
|
+
} catch {
|
|
512
|
+
// Fallback to previous marker value when symbolic ref is unavailable.
|
|
513
|
+
try {
|
|
514
|
+
const existingMarker = await fs.readJson(path.join(repoCacheDir, '.xiaoma-channel.json'));
|
|
515
|
+
if (existingMarker?.channel === 'next' && typeof existingMarker.version === 'string' && existingMarker.version.trim()) {
|
|
516
|
+
defaultRef = existingMarker.version.trim();
|
|
517
|
+
}
|
|
518
|
+
} catch {
|
|
519
|
+
// Keep default fallback.
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// Write source metadata for later URL reconstruction
|
|
525
|
+
const metadataPath = path.join(repoCacheDir, '.xiaoma-source.json');
|
|
526
|
+
await fs.writeJson(metadataPath, {
|
|
527
|
+
cloneUrl: parsed.cloneUrl,
|
|
528
|
+
cacheKey: parsed.cacheKey,
|
|
529
|
+
displayName: parsed.displayName,
|
|
530
|
+
version: effectiveVersion || null,
|
|
531
|
+
rawInput: parsed.rawInput || sourceInput,
|
|
532
|
+
sha: resolvedSha,
|
|
533
|
+
clonedAt: new Date().toISOString(),
|
|
534
|
+
});
|
|
535
|
+
// Keep a channel marker in custom cache too so update paths that rely on
|
|
536
|
+
// channel metadata (same as official-module cache) can treat this clone as
|
|
537
|
+
// refreshable. URL + no explicit ref => next, explicit ref => pinned.
|
|
538
|
+
await fs.writeJson(path.join(repoCacheDir, '.xiaoma-channel.json'), {
|
|
539
|
+
channel: effectiveVersion ? 'pinned' : 'next',
|
|
540
|
+
version: effectiveVersion || defaultRef,
|
|
541
|
+
sha: resolvedSha,
|
|
542
|
+
writtenAt: new Date().toISOString(),
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
// Install dependencies if package.json exists (skip during browsing/analysis)
|
|
546
|
+
const packageJsonPath = path.join(repoCacheDir, 'package.json');
|
|
547
|
+
if (!options.skipInstall && (await fs.pathExists(packageJsonPath))) {
|
|
548
|
+
const installSpinner = await createSpinner();
|
|
549
|
+
installSpinner.start(`Installing dependencies for ${displayName}...`);
|
|
550
|
+
try {
|
|
551
|
+
execSync('npm install --omit=dev --no-audit --no-fund --no-progress --legacy-peer-deps', {
|
|
552
|
+
cwd: repoCacheDir,
|
|
553
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
554
|
+
timeout: 120_000,
|
|
555
|
+
});
|
|
556
|
+
installSpinner.stop(`Installed dependencies for ${displayName}`);
|
|
557
|
+
} catch (error_) {
|
|
558
|
+
installSpinner.error(`Failed to install dependencies for ${displayName}`);
|
|
559
|
+
if (!silent) await prompts.log.warn(` ${error_.message}`);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return repoCacheDir;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// ─── Plugin Resolution ────────────────────────────────────────────────────
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Resolve a plugin to determine installation strategy and module registration files.
|
|
570
|
+
* Results are cached in _resolutionCache keyed by module code.
|
|
571
|
+
* @param {string} repoPath - Absolute path to the cloned repository or local directory
|
|
572
|
+
* @param {Object} plugin - Raw plugin object from marketplace.json
|
|
573
|
+
* @param {string} [sourceUrl] - Original URL for manifest tracking (null for local)
|
|
574
|
+
* @param {string} [localPath] - Local source path for manifest tracking (null for URLs)
|
|
575
|
+
* @returns {Promise<Array<Object>>} Array of ResolvedModule objects
|
|
576
|
+
*/
|
|
577
|
+
async resolvePlugin(repoPath, plugin, sourceUrl, localPath) {
|
|
578
|
+
const { PluginResolver } = require('./plugin-resolver');
|
|
579
|
+
const resolver = new PluginResolver();
|
|
580
|
+
const resolved = await resolver.resolve(repoPath, plugin);
|
|
581
|
+
|
|
582
|
+
// Read clone metadata (written by cloneRepo) so we can pick up the
|
|
583
|
+
// resolved git ref + SHA for manifest recording.
|
|
584
|
+
let cloneMetadata = null;
|
|
585
|
+
if (sourceUrl) {
|
|
586
|
+
try {
|
|
587
|
+
cloneMetadata = await fs.readJson(path.join(repoPath, '.xiaoma-source.json'));
|
|
588
|
+
} catch {
|
|
589
|
+
// no metadata — local-source or legacy cache
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// Stamp source info onto each resolved module for manifest tracking
|
|
594
|
+
for (const mod of resolved) {
|
|
595
|
+
if (sourceUrl) mod.repoUrl = sourceUrl;
|
|
596
|
+
if (localPath) mod.localPath = localPath;
|
|
597
|
+
if (cloneMetadata) {
|
|
598
|
+
mod.cloneRef = cloneMetadata.version || null;
|
|
599
|
+
mod.cloneSha = cloneMetadata.sha || null;
|
|
600
|
+
mod.rawInput = cloneMetadata.rawInput || null;
|
|
601
|
+
}
|
|
602
|
+
CustomModuleManager._resolutionCache.set(mod.code, mod);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return resolved;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Get a cached resolution result by module code.
|
|
610
|
+
* @param {string} moduleCode - Module code to look up
|
|
611
|
+
* @returns {Object|null} ResolvedModule or null if not cached
|
|
612
|
+
*/
|
|
613
|
+
getResolution(moduleCode) {
|
|
614
|
+
return CustomModuleManager._resolutionCache.get(moduleCode) || null;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// ─── Source Finding ───────────────────────────────────────────────────────
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Find the module source path within a cached or local source directory.
|
|
621
|
+
* @param {string} sourceInput - Git URL or local path (used to locate cached clone)
|
|
622
|
+
* @param {string} [pluginSource] - Plugin source path from marketplace.json
|
|
623
|
+
* @returns {string|null} Path to directory containing module.yaml
|
|
624
|
+
*/
|
|
625
|
+
async findModuleSource(sourceInput, pluginSource) {
|
|
626
|
+
const parsed = this.parseSource(sourceInput);
|
|
627
|
+
if (!parsed.isValid) return null;
|
|
628
|
+
|
|
629
|
+
let baseDir;
|
|
630
|
+
if (parsed.type === 'local') {
|
|
631
|
+
baseDir = parsed.localPath;
|
|
632
|
+
} else {
|
|
633
|
+
baseDir = path.join(this.getCacheDir(), ...parsed.cacheKey.split('/'));
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
if (!(await fs.pathExists(baseDir))) return null;
|
|
637
|
+
|
|
638
|
+
// Try plugin source path first (e.g., "./src/pro-skills")
|
|
639
|
+
if (pluginSource) {
|
|
640
|
+
const sourcePath = path.join(baseDir, pluginSource);
|
|
641
|
+
const moduleYaml = path.join(sourcePath, 'module.yaml');
|
|
642
|
+
if (await fs.pathExists(moduleYaml)) {
|
|
643
|
+
return sourcePath;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
// Fallback: search skills/ and src/ directories
|
|
648
|
+
for (const dir of ['skills', 'src']) {
|
|
649
|
+
const rootCandidate = path.join(baseDir, dir, 'module.yaml');
|
|
650
|
+
if (await fs.pathExists(rootCandidate)) {
|
|
651
|
+
return path.dirname(rootCandidate);
|
|
652
|
+
}
|
|
653
|
+
const dirPath = path.join(baseDir, dir);
|
|
654
|
+
if (await fs.pathExists(dirPath)) {
|
|
655
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
656
|
+
for (const entry of entries) {
|
|
657
|
+
if (entry.isDirectory()) {
|
|
658
|
+
const subCandidate = path.join(dirPath, entry.name, 'module.yaml');
|
|
659
|
+
if (await fs.pathExists(subCandidate)) {
|
|
660
|
+
return path.dirname(subCandidate);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// Check base directory root
|
|
668
|
+
const rootCandidate = path.join(baseDir, 'module.yaml');
|
|
669
|
+
if (await fs.pathExists(rootCandidate)) {
|
|
670
|
+
return baseDir;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Find module source by module code, searching the custom cache.
|
|
678
|
+
* Handles both new 3-level cache structure (host/owner/repo) and
|
|
679
|
+
* legacy 2-level structure (owner/repo).
|
|
680
|
+
* @param {string} moduleCode - Module code to search for
|
|
681
|
+
* @param {Object} [options] - Options
|
|
682
|
+
* @returns {string|null} Path to the module source or null
|
|
683
|
+
*/
|
|
684
|
+
async findModuleSourceByCode(moduleCode, options = {}) {
|
|
685
|
+
// Check resolution cache first (populated by resolvePlugin)
|
|
686
|
+
const resolved = CustomModuleManager._resolutionCache.get(moduleCode);
|
|
687
|
+
if (resolved) {
|
|
688
|
+
// For strategies 1-2: the common parent or setup skill's parent has the module files
|
|
689
|
+
if (resolved.moduleYamlPath) {
|
|
690
|
+
return path.dirname(resolved.moduleYamlPath);
|
|
691
|
+
}
|
|
692
|
+
// For strategy 5 (synthesized): return the first skill's parent as a reference path
|
|
693
|
+
if (resolved.skillPaths && resolved.skillPaths.length > 0) {
|
|
694
|
+
return path.dirname(resolved.skillPaths[0]);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const cacheDir = this.getCacheDir();
|
|
699
|
+
if (!(await fs.pathExists(cacheDir))) return null;
|
|
700
|
+
|
|
701
|
+
// Search through all cached repo roots
|
|
702
|
+
try {
|
|
703
|
+
const { PluginResolver } = require('./plugin-resolver');
|
|
704
|
+
const resolver = new PluginResolver();
|
|
705
|
+
const repoRoots = await this._findCacheRepoRoots(cacheDir);
|
|
706
|
+
|
|
707
|
+
for (const { repoPath, metadata } of repoRoots) {
|
|
708
|
+
// Quick-update path: refresh URL-backed cached repos before reading
|
|
709
|
+
// files from them so re-deploy uses latest commits for `next` and
|
|
710
|
+
// the pinned ref for `pinned`.
|
|
711
|
+
if (options.xiaomaDir && metadata?.rawInput) {
|
|
712
|
+
await this._refreshRepoCacheOnce(repoPath, metadata);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// Check marketplace.json for matching module code
|
|
716
|
+
const marketplacePath = path.join(repoPath, '.claude-plugin', 'marketplace.json');
|
|
717
|
+
if (!(await fs.pathExists(marketplacePath))) continue;
|
|
718
|
+
|
|
719
|
+
try {
|
|
720
|
+
const data = JSON.parse(await fs.readFile(marketplacePath, 'utf8'));
|
|
721
|
+
for (const plugin of data.plugins || []) {
|
|
722
|
+
// Direct name match (legacy behavior)
|
|
723
|
+
if (plugin.name === moduleCode) {
|
|
724
|
+
const sourcePath = plugin.source ? path.join(repoPath, plugin.source) : repoPath;
|
|
725
|
+
const moduleYaml = path.join(sourcePath, 'module.yaml');
|
|
726
|
+
if (await fs.pathExists(moduleYaml)) {
|
|
727
|
+
return sourcePath;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// Resolve plugin to check if any module.yaml code matches
|
|
732
|
+
if (plugin.skills && plugin.skills.length > 0) {
|
|
733
|
+
try {
|
|
734
|
+
const resolvedMods = await resolver.resolve(repoPath, plugin);
|
|
735
|
+
for (const mod of resolvedMods) {
|
|
736
|
+
if (mod.code === moduleCode) {
|
|
737
|
+
// Use metadata for URL reconstruction instead of deriving from path
|
|
738
|
+
mod.repoUrl = metadata?.cloneUrl || null;
|
|
739
|
+
CustomModuleManager._resolutionCache.set(mod.code, mod);
|
|
740
|
+
if (mod.moduleYamlPath) {
|
|
741
|
+
return path.dirname(mod.moduleYamlPath);
|
|
742
|
+
}
|
|
743
|
+
if (mod.skillPaths && mod.skillPaths.length > 0) {
|
|
744
|
+
return path.dirname(mod.skillPaths[0]);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
} catch {
|
|
749
|
+
// Skip unresolvable plugins
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
} catch {
|
|
754
|
+
// Skip malformed marketplace.json
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
} catch {
|
|
758
|
+
// Cache doesn't exist or is inaccessible
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
// Fallback: check manifest for localPath (local-source modules not in cache)
|
|
762
|
+
return this._findLocalSourceFromManifest(moduleCode, options);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Refresh one cached repo at most once per process with in-flight dedupe.
|
|
767
|
+
* Prevents concurrent quick-update callers from racing the same cache path.
|
|
768
|
+
* @param {string} repoPath - Absolute cache repo path
|
|
769
|
+
* @param {Object} metadata - Parsed .xiaoma-source.json metadata
|
|
770
|
+
*/
|
|
771
|
+
async _refreshRepoCacheOnce(repoPath, metadata) {
|
|
772
|
+
if (CustomModuleManager._refreshedRepoPaths.has(repoPath)) return;
|
|
773
|
+
|
|
774
|
+
const existing = CustomModuleManager._refreshInFlight.get(repoPath);
|
|
775
|
+
if (existing) {
|
|
776
|
+
await existing;
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
const refreshPromise = (async () => {
|
|
781
|
+
try {
|
|
782
|
+
await this.cloneRepo(metadata.rawInput, {
|
|
783
|
+
silent: true,
|
|
784
|
+
pinOverride: metadata.version || undefined,
|
|
785
|
+
});
|
|
786
|
+
CustomModuleManager._refreshedRepoPaths.add(repoPath);
|
|
787
|
+
} catch (error_) {
|
|
788
|
+
// cloneRepo only throws here for unrecoverable cases (no cache present
|
|
789
|
+
// and a fresh clone failed, or an unexpected internal error). The
|
|
790
|
+
// common "remote unreachable but cache exists" case is handled inside
|
|
791
|
+
// cloneRepo, which preserves the clone and returns normally. Reaching
|
|
792
|
+
// this catch means we have no usable cache — surface a warning so the
|
|
793
|
+
// failure isn't silent.
|
|
794
|
+
await prompts.log.warn(`Refresh of cached custom module at ${path.basename(repoPath)} failed: ${error_?.message || error_}`);
|
|
795
|
+
} finally {
|
|
796
|
+
CustomModuleManager._refreshInFlight.delete(repoPath);
|
|
797
|
+
}
|
|
798
|
+
})();
|
|
799
|
+
|
|
800
|
+
CustomModuleManager._refreshInFlight.set(repoPath, refreshPromise);
|
|
801
|
+
await refreshPromise;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Check the installation manifest for a localPath entry for this module.
|
|
806
|
+
* Used as fallback when the module was installed from a local source (no cache entry).
|
|
807
|
+
* Returns the path only if it still exists on disk; never removes installed files.
|
|
808
|
+
* @param {string} moduleCode - Module code to search for
|
|
809
|
+
* @param {Object} [options] - Options (must include xiaomaDir or will search common locations)
|
|
810
|
+
* @returns {string|null} Path to the local module source or null
|
|
811
|
+
*/
|
|
812
|
+
async _findLocalSourceFromManifest(moduleCode, options = {}) {
|
|
813
|
+
try {
|
|
814
|
+
const { Manifest } = require('../core/manifest');
|
|
815
|
+
const manifestObj = new Manifest();
|
|
816
|
+
|
|
817
|
+
// Try to find xiaomaDir from options or common locations
|
|
818
|
+
const xiaomaDir = options.xiaomaDir;
|
|
819
|
+
if (!xiaomaDir) return null;
|
|
820
|
+
|
|
821
|
+
const manifestData = await manifestObj.read(xiaomaDir);
|
|
822
|
+
if (!manifestData?.modulesDetailed) return null;
|
|
823
|
+
|
|
824
|
+
const moduleEntry = manifestData.modulesDetailed.find((m) => m.name === moduleCode);
|
|
825
|
+
if (!moduleEntry?.localPath) return null;
|
|
826
|
+
|
|
827
|
+
// Only return the path if it still exists (source not removed)
|
|
828
|
+
if (await fs.pathExists(moduleEntry.localPath)) {
|
|
829
|
+
return moduleEntry.localPath;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
return null;
|
|
833
|
+
} catch {
|
|
834
|
+
return null;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Recursively find repo root directories within the cache.
|
|
840
|
+
* A repo root is identified by containing .xiaoma-source.json (new) or .claude-plugin/ (legacy).
|
|
841
|
+
* Handles both 3-level (host/owner/repo) and legacy 2-level (owner/repo) cache layouts.
|
|
842
|
+
* @param {string} dir - Directory to search
|
|
843
|
+
* @param {number} [depth=0] - Current recursion depth
|
|
844
|
+
* @param {number} [maxDepth=4] - Maximum recursion depth
|
|
845
|
+
* @returns {Promise<Array<{repoPath: string, metadata: Object|null}>>}
|
|
846
|
+
*/
|
|
847
|
+
async _findCacheRepoRoots(dir, depth = 0, maxDepth = 4) {
|
|
848
|
+
const results = [];
|
|
849
|
+
|
|
850
|
+
// Check if this directory is a repo root
|
|
851
|
+
const metadataPath = path.join(dir, '.xiaoma-source.json');
|
|
852
|
+
const claudePluginDir = path.join(dir, '.claude-plugin');
|
|
853
|
+
|
|
854
|
+
if (await fs.pathExists(metadataPath)) {
|
|
855
|
+
try {
|
|
856
|
+
const metadata = JSON.parse(await fs.readFile(metadataPath, 'utf8'));
|
|
857
|
+
results.push({ repoPath: dir, metadata });
|
|
858
|
+
} catch {
|
|
859
|
+
results.push({ repoPath: dir, metadata: null });
|
|
860
|
+
}
|
|
861
|
+
return results; // Don't recurse into repo contents
|
|
862
|
+
}
|
|
863
|
+
if (await fs.pathExists(claudePluginDir)) {
|
|
864
|
+
results.push({ repoPath: dir, metadata: null });
|
|
865
|
+
return results;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// Recurse into subdirectories
|
|
869
|
+
if (depth >= maxDepth) return results;
|
|
870
|
+
try {
|
|
871
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
872
|
+
for (const entry of entries) {
|
|
873
|
+
if (!entry.isDirectory() || entry.name.startsWith('.')) continue;
|
|
874
|
+
const subResults = await this._findCacheRepoRoots(path.join(dir, entry.name), depth + 1, maxDepth);
|
|
875
|
+
results.push(...subResults);
|
|
876
|
+
}
|
|
877
|
+
} catch {
|
|
878
|
+
// Directory not readable
|
|
879
|
+
}
|
|
880
|
+
return results;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
// ─── Normalization ────────────────────────────────────────────────────────
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Normalize a plugin from marketplace.json to a consistent shape.
|
|
887
|
+
* @param {Object} plugin - Plugin object from marketplace.json
|
|
888
|
+
* @param {string|null} sourceUrl - Source URL (null for local paths)
|
|
889
|
+
* @param {Object} data - Full marketplace.json data
|
|
890
|
+
* @returns {Object} Normalized module info
|
|
891
|
+
*/
|
|
892
|
+
_normalizeCustomModule(plugin, sourceUrl, data) {
|
|
893
|
+
return {
|
|
894
|
+
code: plugin.name,
|
|
895
|
+
name: plugin.name,
|
|
896
|
+
displayName: plugin.name,
|
|
897
|
+
description: plugin.description || '',
|
|
898
|
+
version: plugin.version || null,
|
|
899
|
+
author: plugin.author || data.owner || '',
|
|
900
|
+
url: sourceUrl || null,
|
|
901
|
+
source: plugin.source || null,
|
|
902
|
+
skills: plugin.skills || [],
|
|
903
|
+
rawPlugin: plugin,
|
|
904
|
+
type: 'custom',
|
|
905
|
+
trustTier: 'unverified',
|
|
906
|
+
builtIn: false,
|
|
907
|
+
isExternal: true,
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
module.exports = { CustomModuleManager };
|