@zeyue0329/xiaoma-cli 1.13.0 → 1.15.1
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 +20 -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 +152 -9
- 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/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/checklist.md +4 -0
- package/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/steps/step-01-init-and-validate.md +8 -7
- package/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/steps/step-02-create-epics.md +3 -2
- package/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/steps/step-03-bridge-sprint-planning.md +68 -14
- package/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/steps/step-04-batch-create-stories.md +9 -7
- package/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/steps/step-05-finalize.md +48 -8
- package/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/workflow.md +7 -8
- 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/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 +367 -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/.playwright-cli/console-2026-05-13T06-36-26-793Z.log +0 -2
- package/.playwright-cli/page-2026-05-13T06-36-27-725Z.yml +0 -1
- package/CLAUDE.md +0 -111
- package/README.md +0 -128
- package/XiaoMa-CLI-2026H2-/350/277/255/344/273/243/350/247/204/345/210/222.pptx +0 -0
- package/demo/xiaoma-bug-circle-resolve/SKILL.md +0 -6
- package/demo/xiaoma-bug-circle-resolve/workflow.md +0 -254
- package/demo/xiaoma-bug-resolve/SKILL.md +0 -6
- package/demo/xiaoma-bug-resolve/workflow.md +0 -269
- package/demo/xiaoma-prd-saas-zh/README.md +0 -57
- package/demo/xiaoma-prd-saas-zh/domain-research.md +0 -128
- package/demo/xiaoma-prd-saas-zh/epics.md +0 -303
- package/demo/xiaoma-prd-saas-zh/market-research-2026-q1.md +0 -183
- package/demo/xiaoma-prd-saas-zh/prd-bad-examples.md +0 -268
- package/demo/xiaoma-prd-saas-zh/prd.md +0 -409
- package/demo/xiaoma-prd-saas-zh/product-brief.md +0 -97
- package/demo/xiaoma-prd-saas-zh/validation-report.md +0 -279
- 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/media/doc1_fig1.png +0 -0
- package/media/doc1_fig2.png +0 -0
- package/media/doc1_fig3.png +0 -0
- package/media/doc1_fig4.png +0 -0
- package/media/doc2_fig1.png +0 -0
- package/media/doc2_fig2.png +0 -0
- package/media/doc2_fig3.png +0 -0
- package/media/doc2_fig4.png +0 -0
- package/media/doc3_fig1.png +0 -0
- package/media/doc3_fig2.png +0 -0
- package/media/doc3_fig3.png +0 -0
- package/media/doc3_fig4.png +0 -0
- package/media/doc4_fig1.png +0 -0
- package/media/doc4_fig2.png +0 -0
- package/media/doc4_fig3.png +0 -0
- package/media/doc5_fig1.png +0 -0
- package/media/doc5_fig2.png +0 -0
- package/media/doc5_fig3.png +0 -0
- package/patent-disclosure-optimized/SKILL.md +0 -416
- 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 -354
- package/src/core/tasks/xiaoma-create-prd/data/upstream-input-contract.md +0 -168
- 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-skeleton-reference.md +0 -428
- package/src/core/tasks/xiaoma-create-prd/templates/prd-template.md +0 -108
- 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 -53
- 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/prd-quality-rubric.csv +0 -14
- 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//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_1_/351/235/242/345/220/221AI/346/231/272/350/203/275/344/275/223/347/232/204/345/244/232/351/200/232/351/201/223/344/276/235/350/265/226_20260318.md +0 -483
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_2_/345/237/272/344/272/216/351/205/215/347/275/256/351/251/261/345/212/250/347/232/204/350/267/250/345/271/263/345/217/260IDE/346/231/272/350/203/275_20260318.md +0 -592
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_3_AI/346/231/272/350/203/275/344/275/223/345/243/260/346/230/216/345/274/217/345/256/232/344/271/211/347/232/204/347/274/226/350/257/221/346/265/201/346/260/264_20260318.md +0 -624
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_4_/345/237/272/344/272/216/345/223/210/345/270/214/346/214/207/347/272/271/347/232/204/346/231/272/350/203/275/344/275/223/351/231/204/345/261/236/350/265/204/346/272/220/351/200/211_20260318.md +0 -628
- package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_5_AI/346/231/272/350/203/275/344/275/223/350/247/246/345/217/221/346/214/207/344/273/244/347/232/204/345/244/215/345/220/210/346/240/274/345/274/217/346/240/241_20260318.md +0 -652
- /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/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/SKILL.md +0 -0
- /package/src/{xmc/workflows/5-full-pipeline/auto-prd-to-stories → xmc-skills/5-full-pipeline/xiaoma-auto-prd-to-stories}/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/docx-format-spec.md +0 -0
- /package/{patent-disclosure-optimized → src/xpm-skills/xiaoma-patent-mining}/references/mining-principles.md +0 -0
- /package/{patent-disclosure-optimized → src/xpm-skills/xiaoma-patent-mining}/scripts/md2docx.js +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,972 @@
|
|
|
1
|
+
const path = require('node:path');
|
|
2
|
+
const fs = require('../fs-native');
|
|
3
|
+
const yaml = require('yaml');
|
|
4
|
+
const prompts = require('../prompts');
|
|
5
|
+
const csv = require('csv-parse/sync');
|
|
6
|
+
const { XiaoMa_FOLDER_NAME } = require('./shared/path-utils');
|
|
7
|
+
const { getInstalledCanonicalIds, isXiaomaOwnedEntry } = require('./shared/installed-skills');
|
|
8
|
+
|
|
9
|
+
// Reserved OpenCode slash commands. A skill whose canonicalId collides with
|
|
10
|
+
// one of these is skipped during command-pointer generation so it doesn't
|
|
11
|
+
// shadow a built-in.
|
|
12
|
+
const RESERVED_OPENCODE_COMMANDS = new Set([
|
|
13
|
+
'review',
|
|
14
|
+
'commit',
|
|
15
|
+
'init',
|
|
16
|
+
'help',
|
|
17
|
+
'skills',
|
|
18
|
+
'fast',
|
|
19
|
+
'compact',
|
|
20
|
+
'clear',
|
|
21
|
+
'undo',
|
|
22
|
+
'redo',
|
|
23
|
+
'edit',
|
|
24
|
+
'editor',
|
|
25
|
+
'exit',
|
|
26
|
+
'quit',
|
|
27
|
+
'theme',
|
|
28
|
+
'config',
|
|
29
|
+
'model',
|
|
30
|
+
'session',
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
// Wrap a description for safe insertion into single-line YAML frontmatter.
|
|
34
|
+
// Leaves plain values untouched; double-quotes (and escapes) anything that
|
|
35
|
+
// could break YAML parsing or span multiple lines.
|
|
36
|
+
function yamlSafeSingleLine(value) {
|
|
37
|
+
const collapsed = String(value)
|
|
38
|
+
.replaceAll(/[\r\n]+/g, ' ')
|
|
39
|
+
.trim();
|
|
40
|
+
const needsQuoting = /[:#'"\\]/.test(collapsed) || /^[!&*?|>%@`[{]/.test(collapsed);
|
|
41
|
+
if (!needsQuoting) return collapsed;
|
|
42
|
+
const escaped = collapsed.replaceAll('\\', '\\\\').replaceAll('"', String.raw`\"`);
|
|
43
|
+
return `"${escaped}"`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Validate that a canonicalId is a safe basename — no path separators, no
|
|
47
|
+
// parent-dir traversal, no leading dots, only the character set we expect.
|
|
48
|
+
// Defense-in-depth: the manifest is trusted today, but the value flows
|
|
49
|
+
// directly into a file path and a malformed entry should not write outside
|
|
50
|
+
// the commands directory.
|
|
51
|
+
function isSafeCanonicalId(value) {
|
|
52
|
+
return typeof value === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/.test(value) && !value.includes('..');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Default body template for command pointer files. Used when a platform's
|
|
56
|
+
// installer config doesn't override `commands_body_template`. Matches
|
|
57
|
+
// OpenCode's native `@skills/<id>` skill-reference syntax.
|
|
58
|
+
const DEFAULT_COMMANDS_BODY_TEMPLATE = '@skills/{canonicalId}';
|
|
59
|
+
|
|
60
|
+
// Is this skill a persona agent (vs. a workflow/tool/standalone skill)?
|
|
61
|
+
// Used by platforms that surface only persona agents (e.g. Copilot's Custom
|
|
62
|
+
// Agents picker). Signal: the skill's source `customize.toml` has an
|
|
63
|
+
// `[agent]` section. This is the actual configuration source of truth —
|
|
64
|
+
// every XiaoMa persona is configured via [agent] in its customize.toml,
|
|
65
|
+
// every workflow uses [workflow], every standalone skill has no
|
|
66
|
+
// customize.toml at all. Verified against the full installed manifest:
|
|
67
|
+
// catches exactly the 20 description-confirmed personas across XMC, CIS,
|
|
68
|
+
// GDS, WDS, TEA, and correctly excludes meta-skills like
|
|
69
|
+
// `xiaoma-agent-builder` (a skill-builder workflow whose canonical id
|
|
70
|
+
// contains `-agent-` but which has no [agent] section because it isn't a
|
|
71
|
+
// persona itself).
|
|
72
|
+
//
|
|
73
|
+
// Reading the source toml — at install time the source skill directory
|
|
74
|
+
// (resolved from manifest record.path) still exists; cleanup runs later
|
|
75
|
+
// in the install flow.
|
|
76
|
+
async function isAgentSkill(record, xiaomaDir) {
|
|
77
|
+
if (!record?.path || !xiaomaDir) return false;
|
|
78
|
+
const xiaomaFolderName = path.basename(xiaomaDir);
|
|
79
|
+
const xiaomaPrefix = xiaomaFolderName + '/';
|
|
80
|
+
const relativePath = record.path.startsWith(xiaomaPrefix) ? record.path.slice(xiaomaPrefix.length) : record.path;
|
|
81
|
+
const tomlPath = path.join(xiaomaDir, path.dirname(relativePath), 'customize.toml');
|
|
82
|
+
if (!(await fs.pathExists(tomlPath))) return false;
|
|
83
|
+
try {
|
|
84
|
+
const content = await fs.readFile(tomlPath, 'utf8');
|
|
85
|
+
return /^\[agent\]/m.test(content);
|
|
86
|
+
} catch {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Resolve placeholders in a body template. Supported placeholders:
|
|
92
|
+
// {canonicalId} — the skill's canonical id
|
|
93
|
+
// {target_dir} — the platform's skill install directory (e.g. .agents/skills)
|
|
94
|
+
// {project-root} — left as a literal placeholder for the model/tool to expand
|
|
95
|
+
// at runtime; consistent with PR #1769's templates.
|
|
96
|
+
function expandBodyTemplate(template, { canonicalId, targetDir }) {
|
|
97
|
+
return template.replaceAll('{canonicalId}', canonicalId).replaceAll('{target_dir}', targetDir);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// The exact body the installer would generate for a given description and
|
|
101
|
+
// canonicalId, given the platform's body template. Centralised so both the
|
|
102
|
+
// write and the freshness-check paths agree on the canonical form.
|
|
103
|
+
function buildCommandPointerBody(description, canonicalId, { template, targetDir }) {
|
|
104
|
+
const bodyText = expandBodyTemplate(template, { canonicalId, targetDir });
|
|
105
|
+
return `---\ndescription: ${yamlSafeSingleLine(description)}\n---\n\n${bodyText}\n`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Heuristic: does an existing pointer file look like our generator's output
|
|
109
|
+
// (and therefore safe to refresh) versus a user-modified file (which we
|
|
110
|
+
// preserve)? We check the body shape rather than full equality so that
|
|
111
|
+
// description-only edits in the manifest can propagate without trampling
|
|
112
|
+
// hand edits to the body.
|
|
113
|
+
function looksLikeGeneratorOutput(content, canonicalId, { template, targetDir }) {
|
|
114
|
+
if (typeof content !== 'string') return false;
|
|
115
|
+
const trimmed = content.trim();
|
|
116
|
+
const expectedTail = expandBodyTemplate(template, { canonicalId, targetDir }).trim();
|
|
117
|
+
// Must end with the exact body our generator writes (post-expansion).
|
|
118
|
+
if (!trimmed.endsWith(expectedTail)) return false;
|
|
119
|
+
// Must start with frontmatter containing exactly one description: line.
|
|
120
|
+
const fmMatch = trimmed.match(/^---\n([\S\s]*?)\n---\n/);
|
|
121
|
+
if (!fmMatch) return false;
|
|
122
|
+
const fmLines = fmMatch[1].split('\n').filter((l) => l.length > 0);
|
|
123
|
+
if (fmLines.length !== 1) return false;
|
|
124
|
+
if (!fmLines[0].startsWith('description:')) return false;
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Config-driven IDE setup handler
|
|
130
|
+
*
|
|
131
|
+
* This class provides a standardized way to install XiaoMa artifacts to IDEs
|
|
132
|
+
* based on configuration in platform-codes.yaml. It eliminates the need for
|
|
133
|
+
* individual installer files for each IDE.
|
|
134
|
+
*
|
|
135
|
+
* Features:
|
|
136
|
+
* - Config-driven from platform-codes.yaml
|
|
137
|
+
* - Verbatim skill installation from skill-manifest.csv
|
|
138
|
+
* - IDE-specific marker removal (copilot-instructions, kilo modes, rovodev prompts)
|
|
139
|
+
*/
|
|
140
|
+
class ConfigDrivenIdeSetup {
|
|
141
|
+
constructor(platformCode, platformConfig) {
|
|
142
|
+
this.name = platformCode;
|
|
143
|
+
this.displayName = platformConfig.name || platformCode;
|
|
144
|
+
this.preferred = platformConfig.preferred || false;
|
|
145
|
+
this.platformConfig = platformConfig;
|
|
146
|
+
this.installerConfig = platformConfig.installer || null;
|
|
147
|
+
this.xiaomaFolderName = XiaoMa_FOLDER_NAME;
|
|
148
|
+
|
|
149
|
+
// Set configDir from target_dir so detect() works
|
|
150
|
+
this.configDir = this.installerConfig?.target_dir || null;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
setXiaomaFolderName(xiaomaFolderName) {
|
|
154
|
+
this.xiaomaFolderName = xiaomaFolderName;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Detect whether this IDE already has configuration in the project.
|
|
159
|
+
* Checks for xiaoma-prefixed entries in target_dir.
|
|
160
|
+
* @param {string} projectDir - Project directory
|
|
161
|
+
* @returns {Promise<boolean>}
|
|
162
|
+
*/
|
|
163
|
+
async detect(projectDir) {
|
|
164
|
+
if (!this.configDir) return false;
|
|
165
|
+
|
|
166
|
+
const root = projectDir || process.cwd();
|
|
167
|
+
const dir = path.join(root, this.configDir);
|
|
168
|
+
if (!(await fs.pathExists(dir))) return false;
|
|
169
|
+
|
|
170
|
+
let entries;
|
|
171
|
+
try {
|
|
172
|
+
entries = await fs.readdir(dir);
|
|
173
|
+
} catch {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const xiaomaDir = await this._findXiaomaDir(root);
|
|
178
|
+
const canonicalIds = await getInstalledCanonicalIds(xiaomaDir);
|
|
179
|
+
return entries.some((e) => isXiaomaOwnedEntry(e, canonicalIds));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Main setup method - called by IdeManager
|
|
184
|
+
* @param {string} projectDir - Project directory
|
|
185
|
+
* @param {string} xiaomaDir - XiaoMa installation directory
|
|
186
|
+
* @param {Object} options - Setup options
|
|
187
|
+
* @returns {Promise<Object>} Setup result
|
|
188
|
+
*/
|
|
189
|
+
async setup(projectDir, xiaomaDir, options = {}) {
|
|
190
|
+
// Check for XiaoMa files in ancestor directories that would cause duplicates
|
|
191
|
+
if (this.installerConfig?.ancestor_conflict_check) {
|
|
192
|
+
const conflict = await this.findAncestorConflict(projectDir);
|
|
193
|
+
if (conflict) {
|
|
194
|
+
await prompts.log.error(
|
|
195
|
+
`Found existing XiaoMa skills in ancestor installation: ${conflict}\n` +
|
|
196
|
+
` ${this.name} inherits skills from parent directories, so this would cause duplicates.\n` +
|
|
197
|
+
` Please remove the XiaoMa files from that directory first:\n` +
|
|
198
|
+
` rm -rf "${conflict}"/xiaoma*`,
|
|
199
|
+
);
|
|
200
|
+
return {
|
|
201
|
+
success: false,
|
|
202
|
+
reason: 'ancestor-conflict',
|
|
203
|
+
error: `Ancestor conflict: ${conflict}`,
|
|
204
|
+
conflictDir: conflict,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`);
|
|
210
|
+
|
|
211
|
+
// Clean up any old XiaoMa installation first
|
|
212
|
+
await this.cleanup(projectDir, options, xiaomaDir);
|
|
213
|
+
|
|
214
|
+
if (!this.installerConfig) {
|
|
215
|
+
return { success: false, reason: 'no-config' };
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// When a peer platform in the same install batch owns this target_dir,
|
|
219
|
+
// skip the skill write — the peer has already populated it. Command
|
|
220
|
+
// pointers, however, write to a separate per-IDE directory and must
|
|
221
|
+
// still be generated for this IDE; they are not deduped across peers.
|
|
222
|
+
if (options.skipTarget) {
|
|
223
|
+
const results = { skills: 0, sharedTargetHandledByPeer: true };
|
|
224
|
+
if (this.installerConfig.commands_target_dir) {
|
|
225
|
+
results.commands = await this.installCommandPointers(projectDir, xiaomaDir, this.installerConfig, options);
|
|
226
|
+
}
|
|
227
|
+
return { success: true, results };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (this.installerConfig.target_dir) {
|
|
231
|
+
return this.installToTarget(projectDir, xiaomaDir, this.installerConfig, options);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return { success: false, reason: 'invalid-config' };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Install to a single target directory
|
|
239
|
+
* @param {string} projectDir - Project directory
|
|
240
|
+
* @param {string} xiaomaDir - XiaoMa installation directory
|
|
241
|
+
* @param {Object} config - Installation configuration
|
|
242
|
+
* @param {Object} options - Setup options
|
|
243
|
+
* @returns {Promise<Object>} Installation result
|
|
244
|
+
*/
|
|
245
|
+
async installToTarget(projectDir, xiaomaDir, config, options) {
|
|
246
|
+
const { target_dir } = config;
|
|
247
|
+
const targetPath = path.join(projectDir, target_dir);
|
|
248
|
+
await fs.ensureDir(targetPath);
|
|
249
|
+
|
|
250
|
+
this.skillWriteTracker = new Set();
|
|
251
|
+
const results = { skills: 0 };
|
|
252
|
+
|
|
253
|
+
results.skills = await this.installVerbatimSkills(projectDir, xiaomaDir, targetPath, config);
|
|
254
|
+
results.skillDirectories = this.skillWriteTracker.size;
|
|
255
|
+
|
|
256
|
+
if (config.commands_target_dir) {
|
|
257
|
+
results.commands = await this.installCommandPointers(projectDir, xiaomaDir, config, options);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
await this.printSummary(results, target_dir, options);
|
|
261
|
+
this.skillWriteTracker = null;
|
|
262
|
+
return { success: true, results };
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Generate per-skill command pointer files for IDEs that surface commands
|
|
267
|
+
* separately from skills (e.g. OpenCode's `.opencode/commands/<name>.md`).
|
|
268
|
+
*
|
|
269
|
+
* Each pointer is a tiny markdown file whose body is `@skills/<canonicalId>`
|
|
270
|
+
* so invoking `/<canonicalId>` routes the user straight to the skill instead
|
|
271
|
+
* of forcing them through a `/skills` menu.
|
|
272
|
+
*
|
|
273
|
+
* Skips:
|
|
274
|
+
* - Names that collide with reserved built-in slash commands.
|
|
275
|
+
* - canonicalIds that aren't safe basename-only identifiers (defense
|
|
276
|
+
* against path traversal even though the manifest is currently trusted).
|
|
277
|
+
* - Existing files whose body looks user-modified (preserves hand edits);
|
|
278
|
+
* pointer files matching the generator pattern get overwritten so that
|
|
279
|
+
* description changes in skill-manifest.csv propagate on re-install.
|
|
280
|
+
*
|
|
281
|
+
* Per-file write failures are recorded and reported but do not abort the
|
|
282
|
+
* rest of the install — pointer files are a non-essential adjunct to the
|
|
283
|
+
* skill copy that already succeeded.
|
|
284
|
+
*
|
|
285
|
+
* @param {string} projectDir
|
|
286
|
+
* @param {string} xiaomaDir
|
|
287
|
+
* @param {Object} config - Installer config; reads commands_target_dir.
|
|
288
|
+
* @param {Object} options - Setup options. forceCommands overwrites existing
|
|
289
|
+
* files unconditionally (including hand-modified ones).
|
|
290
|
+
* @returns {Promise<Object>} { created, updated, skippedExisting, skippedCollision, skippedInvalidId, writeFailures, fallbackDescription }
|
|
291
|
+
*/
|
|
292
|
+
async installCommandPointers(projectDir, xiaomaDir, config, options = {}) {
|
|
293
|
+
const result = {
|
|
294
|
+
created: 0,
|
|
295
|
+
updated: 0,
|
|
296
|
+
skippedExisting: 0,
|
|
297
|
+
skippedCollision: 0,
|
|
298
|
+
skippedInvalidId: 0,
|
|
299
|
+
skippedFiltered: 0,
|
|
300
|
+
writeFailures: 0,
|
|
301
|
+
fallbackDescription: 0,
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const csvPath = path.join(xiaomaDir, '_config', 'skill-manifest.csv');
|
|
305
|
+
if (!(await fs.pathExists(csvPath))) return result;
|
|
306
|
+
|
|
307
|
+
const commandsPath = path.join(projectDir, config.commands_target_dir);
|
|
308
|
+
await fs.ensureDir(commandsPath);
|
|
309
|
+
|
|
310
|
+
// Per-platform pointer-file shape, all overrideable in platform-codes.yaml.
|
|
311
|
+
const extension = config.commands_extension || '.md';
|
|
312
|
+
const template = config.commands_body_template || DEFAULT_COMMANDS_BODY_TEMPLATE;
|
|
313
|
+
const targetDir = config.target_dir;
|
|
314
|
+
const filter = config.commands_filter || null;
|
|
315
|
+
|
|
316
|
+
const csvContent = await fs.readFile(csvPath, 'utf8');
|
|
317
|
+
const records = csv.parse(csvContent, { columns: true, skip_empty_lines: true });
|
|
318
|
+
|
|
319
|
+
for (const record of records) {
|
|
320
|
+
const canonicalId = record.canonicalId;
|
|
321
|
+
if (!canonicalId) continue;
|
|
322
|
+
|
|
323
|
+
// Defensive basename validation. canonicalId comes from a trusted
|
|
324
|
+
// manifest today, but the value flows directly into a file path —
|
|
325
|
+
// reject anything that could escape commands_target_dir.
|
|
326
|
+
if (!isSafeCanonicalId(canonicalId)) {
|
|
327
|
+
result.skippedInvalidId++;
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Optional per-platform filter: surfaces that should only show
|
|
332
|
+
// persona agents (e.g. Copilot's Custom Agents picker) skip
|
|
333
|
+
// workflow/tool skills here so the picker isn't cluttered with
|
|
334
|
+
// 90+ unrelated entries.
|
|
335
|
+
if (filter === 'agents-only' && !(await isAgentSkill(record, xiaomaDir))) {
|
|
336
|
+
result.skippedFiltered++;
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// Reserved-name guard is OpenCode-specific. Other adapters that opt
|
|
341
|
+
// into commands_target_dir later should declare their own reserved
|
|
342
|
+
// set rather than inheriting OpenCode's.
|
|
343
|
+
if (this.name === 'opencode' && RESERVED_OPENCODE_COMMANDS.has(canonicalId)) {
|
|
344
|
+
result.skippedCollision++;
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
let description = (record.description || '').trim();
|
|
349
|
+
if (!description) {
|
|
350
|
+
description = `Run the ${canonicalId} skill`;
|
|
351
|
+
result.fallbackDescription++;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const body = buildCommandPointerBody(description, canonicalId, { template, targetDir });
|
|
355
|
+
const commandFile = path.join(commandsPath, `${canonicalId}${extension}`);
|
|
356
|
+
|
|
357
|
+
// If a pointer file already exists, decide whether to overwrite based
|
|
358
|
+
// on whether it looks like generator output (description-only diff) or
|
|
359
|
+
// a user-modified file. forceCommands overrides this protection.
|
|
360
|
+
if (!options.forceCommands && (await fs.pathExists(commandFile))) {
|
|
361
|
+
let existing;
|
|
362
|
+
try {
|
|
363
|
+
existing = await fs.readFile(commandFile, 'utf8');
|
|
364
|
+
} catch {
|
|
365
|
+
// Treat unreadable as user-owned and skip — safer than overwriting.
|
|
366
|
+
result.skippedExisting++;
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (existing === body) {
|
|
371
|
+
// No-op idempotent re-run.
|
|
372
|
+
result.skippedExisting++;
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
if (looksLikeGeneratorOutput(existing, canonicalId, { template, targetDir })) {
|
|
376
|
+
// Description (or other generated bit) has changed; refresh in place.
|
|
377
|
+
try {
|
|
378
|
+
await fs.writeFile(commandFile, body, 'utf8');
|
|
379
|
+
result.updated++;
|
|
380
|
+
} catch (error) {
|
|
381
|
+
result.writeFailures++;
|
|
382
|
+
if (!options.silent) {
|
|
383
|
+
await prompts.log.warn(`Failed to update command pointer ${canonicalId}${extension}: ${error.message}`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
// Hand-modified pointer — preserve it.
|
|
389
|
+
result.skippedExisting++;
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
try {
|
|
394
|
+
await fs.writeFile(commandFile, body, 'utf8');
|
|
395
|
+
result.created++;
|
|
396
|
+
} catch (error) {
|
|
397
|
+
result.writeFailures++;
|
|
398
|
+
if (!options.silent) {
|
|
399
|
+
await prompts.log.warn(`Failed to write command pointer ${canonicalId}${extension}: ${error.message}`);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return result;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Install verbatim native SKILL.md directories from skill-manifest.csv.
|
|
409
|
+
* Copies the entire source directory as-is into the IDE skill directory.
|
|
410
|
+
* The source SKILL.md is used directly — no frontmatter transformation or file generation.
|
|
411
|
+
* @param {string} projectDir - Project directory
|
|
412
|
+
* @param {string} xiaomaDir - XiaoMa installation directory
|
|
413
|
+
* @param {string} targetPath - Target skills directory
|
|
414
|
+
* @param {Object} config - Installation configuration
|
|
415
|
+
* @returns {Promise<number>} Count of skills installed
|
|
416
|
+
*/
|
|
417
|
+
async installVerbatimSkills(projectDir, xiaomaDir, targetPath, config) {
|
|
418
|
+
const xiaomaFolderName = path.basename(xiaomaDir);
|
|
419
|
+
const xiaomaPrefix = xiaomaFolderName + '/';
|
|
420
|
+
const csvPath = path.join(xiaomaDir, '_config', 'skill-manifest.csv');
|
|
421
|
+
|
|
422
|
+
if (!(await fs.pathExists(csvPath))) return 0;
|
|
423
|
+
|
|
424
|
+
const csvContent = await fs.readFile(csvPath, 'utf8');
|
|
425
|
+
const records = csv.parse(csvContent, {
|
|
426
|
+
columns: true,
|
|
427
|
+
skip_empty_lines: true,
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
let count = 0;
|
|
431
|
+
|
|
432
|
+
for (const record of records) {
|
|
433
|
+
const canonicalId = record.canonicalId;
|
|
434
|
+
if (!canonicalId) continue;
|
|
435
|
+
|
|
436
|
+
// Derive source directory from path column
|
|
437
|
+
// path is like "_xiaoma/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/SKILL.md"
|
|
438
|
+
// Strip xiaomaFolderName prefix and join with xiaomaDir, then get dirname
|
|
439
|
+
const relativePath = record.path.startsWith(xiaomaPrefix) ? record.path.slice(xiaomaPrefix.length) : record.path;
|
|
440
|
+
const sourceFile = path.join(xiaomaDir, relativePath);
|
|
441
|
+
const sourceDir = path.dirname(sourceFile);
|
|
442
|
+
|
|
443
|
+
if (!(await fs.pathExists(sourceDir))) continue;
|
|
444
|
+
|
|
445
|
+
// Clean target before copy to prevent stale files
|
|
446
|
+
const skillDir = path.join(targetPath, canonicalId);
|
|
447
|
+
await fs.remove(skillDir);
|
|
448
|
+
await fs.ensureDir(skillDir);
|
|
449
|
+
this.skillWriteTracker?.add(canonicalId);
|
|
450
|
+
|
|
451
|
+
// Copy all skill files, filtering OS/editor artifacts recursively
|
|
452
|
+
const skipPatterns = new Set(['.DS_Store', 'Thumbs.db', 'desktop.ini']);
|
|
453
|
+
const skipSuffixes = ['~', '.swp', '.swo', '.bak'];
|
|
454
|
+
const filter = (src) => {
|
|
455
|
+
const name = path.basename(src);
|
|
456
|
+
if (src === sourceDir) return true;
|
|
457
|
+
if (skipPatterns.has(name)) return false;
|
|
458
|
+
if (name.startsWith('.') && name !== '.gitkeep') return false;
|
|
459
|
+
if (skipSuffixes.some((s) => name.endsWith(s))) return false;
|
|
460
|
+
return true;
|
|
461
|
+
};
|
|
462
|
+
await fs.copy(sourceDir, skillDir, { filter });
|
|
463
|
+
|
|
464
|
+
count++;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return count;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Print installation summary
|
|
472
|
+
* @param {Object} results - Installation results
|
|
473
|
+
* @param {string} targetDir - Target directory (relative)
|
|
474
|
+
*/
|
|
475
|
+
async printSummary(results, targetDir, options = {}) {
|
|
476
|
+
if (options.silent) return;
|
|
477
|
+
const count = results.skillDirectories || results.skills || 0;
|
|
478
|
+
if (count > 0) {
|
|
479
|
+
await prompts.log.success(`${this.name} configured: ${count} skills → ${targetDir}`);
|
|
480
|
+
}
|
|
481
|
+
const cmd = results.commands;
|
|
482
|
+
if (cmd && (cmd.created > 0 || cmd.updated > 0) && this.installerConfig?.commands_target_dir) {
|
|
483
|
+
const total = cmd.created + cmd.updated;
|
|
484
|
+
const detail = cmd.updated > 0 ? `${cmd.created} new, ${cmd.updated} refreshed` : `${total}`;
|
|
485
|
+
await prompts.log.success(`${this.name} commands: ${detail} → ${this.installerConfig.commands_target_dir}`);
|
|
486
|
+
if (cmd.skippedCollision > 0) {
|
|
487
|
+
await prompts.log.message(` (${cmd.skippedCollision} skipped — name collides with reserved slash command)`);
|
|
488
|
+
}
|
|
489
|
+
if (cmd.writeFailures > 0) {
|
|
490
|
+
await prompts.log.warn(` (${cmd.writeFailures} pointer writes failed — see warnings above)`);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Cleanup IDE configuration
|
|
497
|
+
* @param {string} projectDir - Project directory
|
|
498
|
+
*/
|
|
499
|
+
async cleanup(projectDir, options = {}, xiaomaDir = null) {
|
|
500
|
+
const resolvedXiaomaDir = xiaomaDir || (await this._findXiaomaDir(projectDir));
|
|
501
|
+
|
|
502
|
+
// Build removal set: previously installed skills + removals.txt entries
|
|
503
|
+
let removalSet;
|
|
504
|
+
if (options.previousSkillIds) {
|
|
505
|
+
// Install/update flow: use pre-captured skill IDs (before manifest was overwritten)
|
|
506
|
+
removalSet = new Set(options.previousSkillIds);
|
|
507
|
+
if (resolvedXiaomaDir) {
|
|
508
|
+
const removals = await this.loadRemovalLists(resolvedXiaomaDir);
|
|
509
|
+
for (const entry of removals) removalSet.add(entry);
|
|
510
|
+
}
|
|
511
|
+
} else if (resolvedXiaomaDir) {
|
|
512
|
+
// Uninstall flow: read from current skill-manifest.csv + removals.txt
|
|
513
|
+
removalSet = await this._buildUninstallSet(resolvedXiaomaDir);
|
|
514
|
+
} else {
|
|
515
|
+
removalSet = new Set();
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
// Strip XiaoMa markers from copilot-instructions.md if present
|
|
519
|
+
if (this.name === 'github-copilot') {
|
|
520
|
+
await this.cleanupCopilotInstructions(projectDir, options);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// Strip XiaoMa modes from .kilocodemodes if present
|
|
524
|
+
if (this.name === 'kilo') {
|
|
525
|
+
await this.cleanupKiloModes(projectDir, options);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// Strip XiaoMa entries from .rovodev/prompts.yml if present
|
|
529
|
+
if (this.name === 'rovo-dev') {
|
|
530
|
+
await this.cleanupRovoDevPrompts(projectDir, options);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// Clean generated command pointer files in commands_target_dir.
|
|
534
|
+
// Mirrors target_dir cleanup so uninstalls and skill removals don't
|
|
535
|
+
// leave dangling /<canonicalId> commands pointing at missing skills.
|
|
536
|
+
// Runs regardless of skipTarget — command pointers live in a per-IDE
|
|
537
|
+
// directory and are not deduped across peers, so a peer-owned shared
|
|
538
|
+
// skills directory does not protect this IDE's command pointers from
|
|
539
|
+
// cleanup. The "currently active" set is passed so install-flow cleanup
|
|
540
|
+
// (where removalSet contains skills that will be re-added moments later)
|
|
541
|
+
// doesn't trample hand-edited pointers; install-flow cleanup will only
|
|
542
|
+
// delete pointers for skills that are not in the new manifest.
|
|
543
|
+
if (this.installerConfig?.commands_target_dir) {
|
|
544
|
+
// In the install/update flow (signal: previousSkillIds was passed),
|
|
545
|
+
// spare pointers whose canonicalId is still in the manifest so hand
|
|
546
|
+
// edits survive a routine reinstall. In the uninstall flow (no
|
|
547
|
+
// previousSkillIds — full uninstall or per-IDE removal via
|
|
548
|
+
// cleanupByList), don't spare anything; the IDE itself is going away,
|
|
549
|
+
// so its pointers should go with it.
|
|
550
|
+
const isInstallFlow = !!options.previousSkillIds;
|
|
551
|
+
const activeSkillIds = isInstallFlow ? await this._readActiveSkillIds(resolvedXiaomaDir) : new Set();
|
|
552
|
+
const extension = this.installerConfig.commands_extension || '.md';
|
|
553
|
+
await this.cleanupCommandPointers(
|
|
554
|
+
projectDir,
|
|
555
|
+
this.installerConfig.commands_target_dir,
|
|
556
|
+
options,
|
|
557
|
+
removalSet,
|
|
558
|
+
activeSkillIds,
|
|
559
|
+
extension,
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// Skip target_dir cleanup when a peer platform owns this directory
|
|
564
|
+
// (set during dedup'd install or when uninstalling one of several
|
|
565
|
+
// platforms that share the same target_dir).
|
|
566
|
+
if (options.skipTarget) return;
|
|
567
|
+
|
|
568
|
+
// Clean current target directory
|
|
569
|
+
if (this.installerConfig?.target_dir) {
|
|
570
|
+
await this.cleanupTarget(projectDir, this.installerConfig.target_dir, options, removalSet);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Find the _xiaoma directory in a project
|
|
576
|
+
* @param {string} projectDir - Project directory
|
|
577
|
+
* @returns {string|null} Path to xiaoma dir or null
|
|
578
|
+
*/
|
|
579
|
+
async _findXiaomaDir(projectDir) {
|
|
580
|
+
const xiaomaDir = path.join(projectDir, XiaoMa_FOLDER_NAME);
|
|
581
|
+
return (await fs.pathExists(xiaomaDir)) ? xiaomaDir : null;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Build the full set of entries to remove for uninstall.
|
|
586
|
+
* Reads skill-manifest.csv to know exactly what was installed, plus removal lists.
|
|
587
|
+
* @param {string} xiaomaDir - XiaoMa installation directory
|
|
588
|
+
* @returns {Set<string>} Set of entries to remove
|
|
589
|
+
*/
|
|
590
|
+
async _buildUninstallSet(xiaomaDir) {
|
|
591
|
+
const removals = await this.loadRemovalLists(xiaomaDir);
|
|
592
|
+
|
|
593
|
+
// Also add all currently installed skills from skill-manifest.csv
|
|
594
|
+
const csvPath = path.join(xiaomaDir, '_config', 'skill-manifest.csv');
|
|
595
|
+
try {
|
|
596
|
+
if (await fs.pathExists(csvPath)) {
|
|
597
|
+
const content = await fs.readFile(csvPath, 'utf8');
|
|
598
|
+
const records = csv.parse(content, { columns: true, skip_empty_lines: true });
|
|
599
|
+
for (const record of records) {
|
|
600
|
+
if (record.canonicalId) {
|
|
601
|
+
removals.add(record.canonicalId);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
} catch {
|
|
606
|
+
// If we can't read the manifest, we still have the removal lists
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return removals;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Load removal lists from all module sources in the xiaoma directory.
|
|
614
|
+
* Each module can have an optional removals.txt listing entries to remove.
|
|
615
|
+
* @param {string} xiaomaDir - XiaoMa installation directory
|
|
616
|
+
* @returns {Set<string>} Set of entries to remove
|
|
617
|
+
*/
|
|
618
|
+
async loadRemovalLists(xiaomaDir) {
|
|
619
|
+
const removals = new Set();
|
|
620
|
+
const { getProjectRoot } = require('../project-root');
|
|
621
|
+
|
|
622
|
+
// Read project-level removals.txt (covers core and xmc)
|
|
623
|
+
const projectRemovalsPath = path.join(getProjectRoot(), 'removals.txt');
|
|
624
|
+
await this._readRemovalFile(projectRemovalsPath, removals);
|
|
625
|
+
|
|
626
|
+
// Read per-module removals.txt from installed module directories
|
|
627
|
+
try {
|
|
628
|
+
const entries = await fs.readdir(xiaomaDir);
|
|
629
|
+
for (const entry of entries) {
|
|
630
|
+
if (entry.startsWith('_')) continue;
|
|
631
|
+
const removalPath = path.join(xiaomaDir, entry, 'removals.txt');
|
|
632
|
+
await this._readRemovalFile(removalPath, removals);
|
|
633
|
+
}
|
|
634
|
+
} catch {
|
|
635
|
+
// xiaomaDir may not exist yet on fresh install
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
return removals;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Read a removals.txt file and add entries to the set
|
|
643
|
+
* @param {string} filePath - Path to removals.txt
|
|
644
|
+
* @param {Set<string>} removals - Set to add entries to
|
|
645
|
+
*/
|
|
646
|
+
async _readRemovalFile(filePath, removals) {
|
|
647
|
+
try {
|
|
648
|
+
if (await fs.pathExists(filePath)) {
|
|
649
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
650
|
+
for (const line of content.split('\n')) {
|
|
651
|
+
const trimmed = line.trim();
|
|
652
|
+
if (trimmed && !trimmed.startsWith('#')) {
|
|
653
|
+
removals.add(trimmed);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
} catch {
|
|
658
|
+
// Optional file — ignore errors
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Cleanup generated command pointer files for entries in removalSet.
|
|
664
|
+
* Symmetric counterpart to installCommandPointers — removes
|
|
665
|
+
* `<canonicalId><extension>` files whose canonicalId is in the set. Removes
|
|
666
|
+
* the commands directory entirely if it ends up empty.
|
|
667
|
+
* @param {string} projectDir
|
|
668
|
+
* @param {string} commandsTargetDir - Relative dir (e.g. .opencode/commands)
|
|
669
|
+
* @param {Object} options
|
|
670
|
+
* @param {Set<string>} removalSet - canonicalIds whose pointer files to remove
|
|
671
|
+
* @param {Set<string>} [activeSkillIds] - canonicalIds present in the
|
|
672
|
+
* current manifest. Pointers for IDs in this set are spared so an
|
|
673
|
+
* install-flow cleanup (where removalSet === previousSkillIds and the
|
|
674
|
+
* same skills are about to be re-installed) doesn't wipe hand-edited
|
|
675
|
+
* pointer files. Pass an empty set or omit to delete every match in
|
|
676
|
+
* removalSet (uninstall flow).
|
|
677
|
+
* @param {string} [extension] - Pointer file extension (default '.md');
|
|
678
|
+
* matches the platform's commands_extension config value so cleanup
|
|
679
|
+
* correctly identifies pointer files for IDEs whose convention isn't .md
|
|
680
|
+
* (e.g. Copilot's `.agent.md`).
|
|
681
|
+
*/
|
|
682
|
+
async cleanupCommandPointers(
|
|
683
|
+
projectDir,
|
|
684
|
+
commandsTargetDir,
|
|
685
|
+
options = {},
|
|
686
|
+
removalSet = new Set(),
|
|
687
|
+
activeSkillIds = new Set(),
|
|
688
|
+
extension = '.md',
|
|
689
|
+
) {
|
|
690
|
+
if (!removalSet || removalSet.size === 0) return;
|
|
691
|
+
|
|
692
|
+
const commandsPath = path.join(projectDir, commandsTargetDir);
|
|
693
|
+
if (!(await fs.pathExists(commandsPath))) return;
|
|
694
|
+
|
|
695
|
+
let entries;
|
|
696
|
+
try {
|
|
697
|
+
entries = await fs.readdir(commandsPath);
|
|
698
|
+
} catch {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
for (const entry of entries) {
|
|
703
|
+
if (!entry.endsWith(extension)) continue;
|
|
704
|
+
const canonicalId = entry.slice(0, -extension.length);
|
|
705
|
+
if (!removalSet.has(canonicalId)) continue;
|
|
706
|
+
// Spare pointers for skills that are still in the manifest; the
|
|
707
|
+
// install pass will refresh them in place if their content has gone
|
|
708
|
+
// stale, while preserving hand edits.
|
|
709
|
+
if (activeSkillIds.has(canonicalId)) continue;
|
|
710
|
+
try {
|
|
711
|
+
await fs.remove(path.join(commandsPath, entry));
|
|
712
|
+
} catch {
|
|
713
|
+
// Skip files we can't remove.
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// Remove the commands directory if we emptied it.
|
|
718
|
+
try {
|
|
719
|
+
const remaining = await fs.readdir(commandsPath);
|
|
720
|
+
if (remaining.length === 0) {
|
|
721
|
+
await fs.remove(commandsPath);
|
|
722
|
+
}
|
|
723
|
+
} catch {
|
|
724
|
+
// Directory may already be gone.
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Read the canonicalIds currently present in the skill-manifest.csv.
|
|
730
|
+
* Used by cleanup to distinguish "re-install of an existing skill"
|
|
731
|
+
* (preserve pointer) from "skill truly being removed" (delete pointer).
|
|
732
|
+
* @param {string|null} xiaomaDir
|
|
733
|
+
* @returns {Promise<Set<string>>}
|
|
734
|
+
*/
|
|
735
|
+
async _readActiveSkillIds(xiaomaDir) {
|
|
736
|
+
const ids = new Set();
|
|
737
|
+
if (!xiaomaDir) return ids;
|
|
738
|
+
const csvPath = path.join(xiaomaDir, '_config', 'skill-manifest.csv');
|
|
739
|
+
if (!(await fs.pathExists(csvPath))) return ids;
|
|
740
|
+
try {
|
|
741
|
+
const content = await fs.readFile(csvPath, 'utf8');
|
|
742
|
+
const records = csv.parse(content, { columns: true, skip_empty_lines: true });
|
|
743
|
+
for (const record of records) {
|
|
744
|
+
if (record.canonicalId) ids.add(record.canonicalId);
|
|
745
|
+
}
|
|
746
|
+
} catch {
|
|
747
|
+
// Manifest unreadable — return an empty set so cleanup falls back to
|
|
748
|
+
// the conservative "delete what removalSet says" behavior.
|
|
749
|
+
}
|
|
750
|
+
return ids;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* Cleanup a specific target directory.
|
|
755
|
+
* When removalSet is provided, only removes entries in that set.
|
|
756
|
+
* When removalSet is null (legacy dirs), removes all xiaoma-prefixed entries.
|
|
757
|
+
* @param {string} projectDir - Project directory
|
|
758
|
+
* @param {string} targetDir - Target directory to clean
|
|
759
|
+
* @param {Object} options - Cleanup options
|
|
760
|
+
* @param {Set<string>|null} removalSet - Entries to remove, or null for legacy prefix matching
|
|
761
|
+
*/
|
|
762
|
+
async cleanupTarget(projectDir, targetDir, options = {}, removalSet = new Set()) {
|
|
763
|
+
const targetPath = path.join(projectDir, targetDir);
|
|
764
|
+
|
|
765
|
+
if (!(await fs.pathExists(targetPath))) {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
if (removalSet && removalSet.size === 0) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
let entries;
|
|
774
|
+
try {
|
|
775
|
+
entries = await fs.readdir(targetPath);
|
|
776
|
+
} catch {
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
if (!entries || !Array.isArray(entries)) {
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
let removedCount = 0;
|
|
785
|
+
|
|
786
|
+
for (const entry of entries) {
|
|
787
|
+
if (!entry || typeof entry !== 'string') continue;
|
|
788
|
+
|
|
789
|
+
// Always preserve xiaoma-os-* utility skills regardless of cleanup mode
|
|
790
|
+
if (entry.startsWith('xiaoma-os-')) continue;
|
|
791
|
+
|
|
792
|
+
// Surgical removal from set, or fallback to manifest+prefix detection when null
|
|
793
|
+
const shouldRemove = removalSet ? removalSet.has(entry) : isXiaomaOwnedEntry(entry, null);
|
|
794
|
+
|
|
795
|
+
if (shouldRemove) {
|
|
796
|
+
try {
|
|
797
|
+
await fs.remove(path.join(targetPath, entry));
|
|
798
|
+
removedCount++;
|
|
799
|
+
} catch {
|
|
800
|
+
// Skip entries that can't be removed
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// Only log cleanup when it's not a routine reinstall (legacy dir cleanup or actual removals)
|
|
806
|
+
// Suppress for current target_dir since it's always cleaned before a fresh write
|
|
807
|
+
|
|
808
|
+
// Remove empty directory after cleanup
|
|
809
|
+
if (removedCount > 0) {
|
|
810
|
+
try {
|
|
811
|
+
const remaining = await fs.readdir(targetPath);
|
|
812
|
+
if (remaining.length === 0) {
|
|
813
|
+
await fs.remove(targetPath);
|
|
814
|
+
}
|
|
815
|
+
} catch {
|
|
816
|
+
// Directory may already be gone or in use
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Strip XiaoMa-owned content from .github/copilot-instructions.md.
|
|
823
|
+
* The old custom installer injected content between <!-- XiaoMa:START --> and <!-- XiaoMa:END --> markers.
|
|
824
|
+
* Deletes the file if nothing remains. Restores .bak backup if one exists.
|
|
825
|
+
*/
|
|
826
|
+
async cleanupCopilotInstructions(projectDir, options = {}) {
|
|
827
|
+
const filePath = path.join(projectDir, '.github', 'copilot-instructions.md');
|
|
828
|
+
|
|
829
|
+
if (!(await fs.pathExists(filePath))) return;
|
|
830
|
+
|
|
831
|
+
try {
|
|
832
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
833
|
+
const startIdx = content.indexOf('<!-- XiaoMa:START -->');
|
|
834
|
+
const endIdx = content.indexOf('<!-- XiaoMa:END -->');
|
|
835
|
+
|
|
836
|
+
if (startIdx === -1 || endIdx === -1 || endIdx <= startIdx) return;
|
|
837
|
+
|
|
838
|
+
const cleaned = content.slice(0, startIdx) + content.slice(endIdx + '<!-- XiaoMa:END -->'.length);
|
|
839
|
+
|
|
840
|
+
if (cleaned.trim().length === 0) {
|
|
841
|
+
await fs.remove(filePath);
|
|
842
|
+
const backupPath = `${filePath}.bak`;
|
|
843
|
+
if (await fs.pathExists(backupPath)) {
|
|
844
|
+
await fs.rename(backupPath, filePath);
|
|
845
|
+
if (!options.silent) await prompts.log.message(' Restored copilot-instructions.md from backup');
|
|
846
|
+
}
|
|
847
|
+
} else {
|
|
848
|
+
await fs.writeFile(filePath, cleaned, 'utf8');
|
|
849
|
+
const backupPath = `${filePath}.bak`;
|
|
850
|
+
if (await fs.pathExists(backupPath)) await fs.remove(backupPath);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
if (!options.silent) await prompts.log.message(' Cleaned XiaoMa markers from copilot-instructions.md');
|
|
854
|
+
} catch {
|
|
855
|
+
if (!options.silent) await prompts.log.warn(' Warning: Could not clean XiaoMa markers from copilot-instructions.md');
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Strip XiaoMa-owned modes from .kilocodemodes.
|
|
861
|
+
* The old custom kilo.js installer added modes with slug starting with 'xiaoma-'.
|
|
862
|
+
* Parses YAML, filters out XiaoMa modes, rewrites. Leaves file as-is on parse failure.
|
|
863
|
+
*/
|
|
864
|
+
async cleanupKiloModes(projectDir, options = {}) {
|
|
865
|
+
const kiloModesPath = path.join(projectDir, '.kilocodemodes');
|
|
866
|
+
|
|
867
|
+
if (!(await fs.pathExists(kiloModesPath))) return;
|
|
868
|
+
|
|
869
|
+
const content = await fs.readFile(kiloModesPath, 'utf8');
|
|
870
|
+
|
|
871
|
+
let config;
|
|
872
|
+
try {
|
|
873
|
+
config = yaml.parse(content) || {};
|
|
874
|
+
} catch {
|
|
875
|
+
if (!options.silent) await prompts.log.warn(' Warning: Could not parse .kilocodemodes for cleanup');
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
if (!Array.isArray(config.customModes)) return;
|
|
880
|
+
|
|
881
|
+
const originalCount = config.customModes.length;
|
|
882
|
+
config.customModes = config.customModes.filter((mode) => mode && (!mode.slug || !mode.slug.startsWith('xiaoma-')));
|
|
883
|
+
const removedCount = originalCount - config.customModes.length;
|
|
884
|
+
|
|
885
|
+
if (removedCount > 0) {
|
|
886
|
+
try {
|
|
887
|
+
await fs.writeFile(kiloModesPath, yaml.stringify(config, { lineWidth: 0 }));
|
|
888
|
+
if (!options.silent) await prompts.log.message(` Removed ${removedCount} XiaoMa modes from .kilocodemodes`);
|
|
889
|
+
} catch {
|
|
890
|
+
if (!options.silent) await prompts.log.warn(' Warning: Could not write .kilocodemodes during cleanup');
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Strip XiaoMa-owned entries from .rovodev/prompts.yml.
|
|
897
|
+
* The old custom rovodev.js installer registered workflows in prompts.yml.
|
|
898
|
+
* Parses YAML, filters out entries with name starting with 'xiaoma-', rewrites.
|
|
899
|
+
* Removes the file if no entries remain.
|
|
900
|
+
*/
|
|
901
|
+
async cleanupRovoDevPrompts(projectDir, options = {}) {
|
|
902
|
+
const promptsPath = path.join(projectDir, '.rovodev', 'prompts.yml');
|
|
903
|
+
|
|
904
|
+
if (!(await fs.pathExists(promptsPath))) return;
|
|
905
|
+
|
|
906
|
+
const content = await fs.readFile(promptsPath, 'utf8');
|
|
907
|
+
|
|
908
|
+
let config;
|
|
909
|
+
try {
|
|
910
|
+
config = yaml.parse(content) || {};
|
|
911
|
+
} catch {
|
|
912
|
+
if (!options.silent) await prompts.log.warn(' Warning: Could not parse prompts.yml for cleanup');
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
if (!Array.isArray(config.prompts)) return;
|
|
917
|
+
|
|
918
|
+
const originalCount = config.prompts.length;
|
|
919
|
+
config.prompts = config.prompts.filter((entry) => entry && (!entry.name || !entry.name.startsWith('xiaoma-')));
|
|
920
|
+
const removedCount = originalCount - config.prompts.length;
|
|
921
|
+
|
|
922
|
+
if (removedCount > 0) {
|
|
923
|
+
try {
|
|
924
|
+
if (config.prompts.length === 0) {
|
|
925
|
+
await fs.remove(promptsPath);
|
|
926
|
+
} else {
|
|
927
|
+
await fs.writeFile(promptsPath, yaml.stringify(config, { lineWidth: 0 }));
|
|
928
|
+
}
|
|
929
|
+
if (!options.silent) await prompts.log.message(` Removed ${removedCount} XiaoMa entries from prompts.yml`);
|
|
930
|
+
} catch {
|
|
931
|
+
if (!options.silent) await prompts.log.warn(' Warning: Could not write prompts.yml during cleanup');
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
/**
|
|
937
|
+
* Check ancestor directories for existing XiaoMa files in the same target_dir.
|
|
938
|
+
* IDEs like Claude Code inherit commands from parent directories, so an existing
|
|
939
|
+
* installation in an ancestor would cause duplicate commands.
|
|
940
|
+
* @param {string} projectDir - Project directory being installed to
|
|
941
|
+
* @returns {Promise<string|null>} Path to conflicting directory, or null if clean
|
|
942
|
+
*/
|
|
943
|
+
async findAncestorConflict(projectDir) {
|
|
944
|
+
const targetDir = this.installerConfig?.target_dir;
|
|
945
|
+
if (!targetDir) return null;
|
|
946
|
+
|
|
947
|
+
const resolvedProject = await fs.realpath(path.resolve(projectDir));
|
|
948
|
+
let current = path.dirname(resolvedProject);
|
|
949
|
+
const root = path.parse(current).root;
|
|
950
|
+
|
|
951
|
+
while (current !== root && current.length > root.length) {
|
|
952
|
+
const candidatePath = path.join(current, targetDir);
|
|
953
|
+
try {
|
|
954
|
+
if (await fs.pathExists(candidatePath)) {
|
|
955
|
+
const entries = await fs.readdir(candidatePath);
|
|
956
|
+
const ancestorXiaomaDir = await this._findXiaomaDir(current);
|
|
957
|
+
const canonicalIds = await getInstalledCanonicalIds(ancestorXiaomaDir);
|
|
958
|
+
if (entries.some((e) => isXiaomaOwnedEntry(e, canonicalIds))) {
|
|
959
|
+
return candidatePath;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
} catch {
|
|
963
|
+
// Can't read directory — skip
|
|
964
|
+
}
|
|
965
|
+
current = path.dirname(current);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
return null;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
module.exports = { ConfigDrivenIdeSetup };
|