universal-dev-standards 6.13.1 → 6.14.0-beta.10
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/README.md +13 -3
- package/bin/uds.js +75 -3
- package/bundled/ai/options/code-review/pr-review.ai.yaml +20 -1
- package/bundled/ai/options/commit-message/traditional-chinese.ai.yaml +69 -67
- package/bundled/ai/standards/ai-response-navigation.ai.yaml +43 -3
- package/bundled/ai/standards/checkin-standards.ai.yaml +25 -6
- package/bundled/ai/standards/code-review.ai.yaml +15 -2
- package/bundled/ai/standards/commit-message.ai.yaml +18 -4
- package/bundled/ai/standards/developer-memory.ai.yaml +12 -2
- package/bundled/ai/standards/full-coverage-testing.ai.yaml +86 -7
- package/bundled/ai/standards/open-work-tracking.ai.yaml +254 -4
- package/bundled/ai/standards/pipeline-security-gates.ai.yaml +53 -4
- package/bundled/ai/standards/project-context-memory.ai.yaml +12 -2
- package/bundled/ai/standards/turn-completion-integrity.ai.yaml +14 -7
- package/bundled/core/ai-response-navigation.md +128 -12
- package/bundled/core/code-review-checklist.md +20 -2
- package/bundled/core/commit-message-guide.md +22 -19
- package/bundled/core/developer-memory.md +12 -2
- package/bundled/core/full-coverage-testing.md +99 -5
- package/bundled/core/open-work-tracking.md +251 -8
- package/bundled/core/pipeline-security-gates.md +63 -0
- package/bundled/core/project-context-memory.md +10 -2
- package/bundled/core/turn-completion-integrity.md +58 -11
- package/bundled/extensions/frameworks/fat-free-patterns.md +937 -0
- package/bundled/extensions/languages/csharp-style.md +464 -0
- package/bundled/extensions/languages/php-style.md +700 -0
- package/bundled/extensions/locales/zh-cn.md +717 -0
- package/bundled/extensions/locales/zh-tw.md +717 -0
- package/bundled/hooks/check-turn-completion-agy.mjs +147 -0
- package/bundled/hooks/turn-completion/locales/en.mjs +54 -5
- package/bundled/hooks/turn-completion/locales/zh-TW.mjs +37 -6
- package/bundled/locales/COVERAGE.md +5 -4
- package/bundled/locales/zh-CN/CHANGELOG.md +211 -3
- package/bundled/locales/zh-CN/README.md +3 -3
- package/bundled/locales/zh-CN/SECURITY.md +3 -1
- package/bundled/locales/zh-CN/STANDARDS-MAPPING.md +103 -6
- package/bundled/locales/zh-CN/adoption/ADOPTION-GUIDE.md +81 -101
- package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +2 -1
- package/bundled/locales/zh-CN/adoption/STATIC-DYNAMIC-GUIDE.md +14 -9
- package/bundled/locales/zh-CN/adoption/checklists/enterprise.md +88 -81
- package/bundled/locales/zh-CN/adoption/checklists/minimal.md +31 -17
- package/bundled/locales/zh-CN/adoption/checklists/recommended.md +56 -47
- package/bundled/locales/zh-CN/ai/MAINTENANCE.md +44 -9
- package/bundled/locales/zh-CN/ai/options/commit-message/traditional-chinese.ai.yaml +63 -55
- package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +61 -14
- package/bundled/locales/zh-CN/core/acceptance-test-driven-development.md +2 -1
- package/bundled/locales/zh-CN/core/adr-standards.md +155 -32
- package/bundled/locales/zh-CN/core/agent-communication-protocol.md +2 -1
- package/bundled/locales/zh-CN/core/agent-dispatch.md +68 -33
- package/bundled/locales/zh-CN/core/ai-agreement-standards.md +23 -22
- package/bundled/locales/zh-CN/core/ai-command-behavior.md +2 -1
- package/bundled/locales/zh-CN/core/ai-instruction-standards.md +71 -49
- package/bundled/locales/zh-CN/core/ai-response-navigation.md +111 -12
- package/bundled/locales/zh-CN/core/anti-sycophancy-prompting.md +34 -33
- package/bundled/locales/zh-CN/core/api-design-standards.md +144 -58
- package/bundled/locales/zh-CN/core/behavior-driven-development.md +2 -1
- package/bundled/locales/zh-CN/core/branch-completion.md +75 -20
- package/bundled/locales/zh-CN/core/capability-declaration.md +44 -94
- package/bundled/locales/zh-CN/core/change-batching-standards.md +2 -1
- package/bundled/locales/zh-CN/core/checkin-standards.md +176 -116
- package/bundled/locales/zh-CN/core/circuit-breaker.md +43 -77
- package/bundled/locales/zh-CN/core/code-review-checklist.md +54 -23
- package/bundled/locales/zh-CN/core/context-aware-loading.md +103 -29
- package/bundled/locales/zh-CN/core/database-standards.md +115 -114
- package/bundled/locales/zh-CN/core/developer-memory.md +159 -60
- package/bundled/locales/zh-CN/core/documentation-lifecycle.md +20 -16
- package/bundled/locales/zh-CN/core/dual-phase-output.md +37 -70
- package/bundled/locales/zh-CN/core/execution-history.md +2 -1
- package/bundled/locales/zh-CN/core/failure-source-taxonomy.md +71 -84
- package/bundled/locales/zh-CN/core/full-coverage-testing.md +103 -9
- package/bundled/locales/zh-CN/core/git-workflow.md +148 -262
- package/bundled/locales/zh-CN/core/git-worktree.md +59 -26
- package/bundled/locales/zh-CN/core/guides/file-placement-guide.md +132 -48
- package/bundled/locales/zh-CN/core/guides/performance-guide.md +61 -59
- package/bundled/locales/zh-CN/core/guides/security-guide.md +2 -0
- package/bundled/locales/zh-CN/core/health-check-standards.md +46 -104
- package/bundled/locales/zh-CN/core/immutability-first.md +83 -60
- package/bundled/locales/zh-CN/core/knowledge-transfer-standards.md +94 -31
- package/bundled/locales/zh-CN/core/pipeline-integration-standards.md +2 -1
- package/bundled/locales/zh-CN/core/pipeline-security-gates.md +64 -4
- package/bundled/locales/zh-CN/core/project-context-memory.md +5 -0
- package/bundled/locales/zh-CN/core/recovery-recipe-registry.md +54 -114
- package/bundled/locales/zh-CN/core/refactoring-standards.md +141 -556
- package/bundled/locales/zh-CN/core/requirement-engineering.md +7 -6
- package/bundled/locales/zh-CN/core/retry-standards.md +46 -101
- package/bundled/locales/zh-CN/core/security-decision.md +45 -70
- package/bundled/locales/zh-CN/core/skill-standard-alignment-check.md +105 -71
- package/bundled/locales/zh-CN/core/standard-admission-criteria.md +25 -31
- package/bundled/locales/zh-CN/core/standard-lifecycle-management.md +49 -57
- package/bundled/locales/zh-CN/core/structured-task-definition.md +2 -1
- package/bundled/locales/zh-CN/core/systematic-debugging.md +87 -42
- package/bundled/locales/zh-CN/core/test-completeness-dimensions.md +262 -190
- package/bundled/locales/zh-CN/core/test-driven-development.md +21 -1022
- package/bundled/locales/zh-CN/core/test-governance.md +94 -43
- package/bundled/locales/zh-CN/core/testing-standards.md +83 -37
- package/bundled/locales/zh-CN/core/timeout-standards.md +45 -85
- package/bundled/locales/zh-CN/core/token-budget.md +44 -80
- package/bundled/locales/zh-CN/core/translation-lifecycle-standards.md +48 -36
- package/bundled/locales/zh-CN/core/turn-completion-integrity.md +46 -13
- package/bundled/locales/zh-CN/core/verification-evidence.md +44 -22
- package/bundled/locales/zh-CN/core/virtual-organization-standards.md +30 -29
- package/bundled/locales/zh-CN/core/workflow-enforcement.md +9 -8
- package/bundled/locales/zh-CN/core/workflow-state-protocol.md +9 -8
- package/bundled/locales/zh-CN/docs/AVAILABLE-STANDARDS.md +70 -0
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +11 -2
- package/bundled/locales/zh-CN/docs/CLI-FLOW.md +2 -1
- package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +76 -40
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +32 -15
- package/bundled/locales/zh-CN/docs/STANDARDS-REFERENCE.md +2 -1
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +139 -138
- package/bundled/locales/zh-CN/docs/USER-MANUAL.md +11 -3
- package/bundled/locales/zh-CN/docs/WINDOWS-GUIDE.md +12 -3
- package/bundled/locales/zh-CN/docs/specs/system/memory-adoption-strategy.md +2 -0
- package/bundled/locales/zh-CN/docs/user/FAQ.md +2 -0
- package/bundled/locales/zh-CN/docs/user/GETTING-STARTED.md +46 -0
- package/bundled/locales/zh-CN/docs/user/GLOSSARY.md +2 -0
- package/bundled/locales/zh-CN/docs/user/README.md +4 -2
- package/bundled/locales/zh-CN/docs/user/TROUBLESHOOTING.md +2 -0
- package/bundled/locales/zh-CN/integrations/codex/AGENTS.md +136 -2
- package/bundled/locales/zh-CN/integrations/codex/README.md +62 -10
- package/bundled/locales/zh-CN/integrations/gemini-cli/GEMINI.md +59 -1
- package/bundled/locales/zh-CN/integrations/gemini-cli/README.md +9 -2
- package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +7 -1
- package/bundled/locales/zh-CN/integrations/github-copilot/README.md +8 -2
- package/bundled/locales/zh-CN/integrations/github-copilot/copilot-instructions.md +146 -12
- package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +7 -1
- package/bundled/locales/zh-CN/integrations/google-antigravity/AGENTS.md +110 -3
- package/bundled/locales/zh-CN/integrations/google-antigravity/README.md +7 -1
- package/bundled/locales/zh-CN/integrations/opencode/AGENTS.md +140 -2
- package/bundled/locales/zh-CN/integrations/opencode/README.md +7 -1
- package/bundled/locales/zh-CN/integrations/opencode/skills-mapping.md +8 -2
- package/bundled/locales/zh-CN/integrations/openspec/AGENTS.md +46 -1
- package/bundled/locales/zh-CN/integrations/openspec/README.md +7 -1
- package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +20 -2
- package/bundled/locales/zh-CN/integrations/spec-kit/README.md +7 -1
- package/bundled/locales/zh-CN/options/changelog/auto-generated.md +2 -0
- package/bundled/locales/zh-CN/options/changelog/keep-a-changelog.md +2 -0
- package/bundled/locales/zh-CN/options/code-review/automated-review.md +2 -0
- package/bundled/locales/zh-CN/options/code-review/pair-programming.md +2 -0
- package/bundled/locales/zh-CN/options/code-review/pr-review.md +13 -2
- package/bundled/locales/zh-CN/options/commit-message/bilingual.md +139 -50
- package/bundled/locales/zh-CN/options/commit-message/english.md +159 -42
- package/bundled/locales/zh-CN/options/commit-message/traditional-chinese.md +156 -75
- package/bundled/locales/zh-CN/options/documentation/api-docs.md +3 -1
- package/bundled/locales/zh-CN/options/documentation/markdown-docs.md +2 -0
- package/bundled/locales/zh-CN/options/documentation/wiki-style.md +2 -0
- package/bundled/locales/zh-CN/options/git-workflow/gitflow.md +105 -77
- package/bundled/locales/zh-CN/options/git-workflow/github-flow.md +75 -57
- package/bundled/locales/zh-CN/options/git-workflow/merge-commit.md +155 -44
- package/bundled/locales/zh-CN/options/git-workflow/rebase-ff.md +168 -53
- package/bundled/locales/zh-CN/options/git-workflow/squash-merge.md +122 -37
- package/bundled/locales/zh-CN/options/git-workflow/trunk-based.md +108 -61
- package/bundled/locales/zh-CN/options/project-structure/dotnet.md +266 -47
- package/bundled/locales/zh-CN/options/project-structure/go.md +301 -43
- package/bundled/locales/zh-CN/options/project-structure/java.md +268 -48
- package/bundled/locales/zh-CN/options/project-structure/kotlin.md +2 -0
- package/bundled/locales/zh-CN/options/project-structure/nodejs.md +168 -51
- package/bundled/locales/zh-CN/options/project-structure/php.md +2 -0
- package/bundled/locales/zh-CN/options/project-structure/python.md +210 -52
- package/bundled/locales/zh-CN/options/project-structure/ruby.md +2 -0
- package/bundled/locales/zh-CN/options/project-structure/rust.md +2 -0
- package/bundled/locales/zh-CN/options/project-structure/swift.md +2 -0
- package/bundled/locales/zh-CN/options/testing/contract-testing.md +2 -0
- package/bundled/locales/zh-CN/options/testing/e2e-testing.md +227 -66
- package/bundled/locales/zh-CN/options/testing/industry-pyramid.md +2 -0
- package/bundled/locales/zh-CN/options/testing/integration-testing.md +185 -73
- package/bundled/locales/zh-CN/options/testing/istqb-framework.md +2 -0
- package/bundled/locales/zh-CN/options/testing/performance-testing.md +2 -0
- package/bundled/locales/zh-CN/options/testing/security-testing.md +2 -0
- package/bundled/locales/zh-CN/options/testing/system-testing.md +270 -96
- package/bundled/locales/zh-CN/options/testing/unit-testing.md +185 -71
- package/bundled/locales/zh-CN/skills/CONTRIBUTING.template.md +43 -42
- package/bundled/locales/zh-CN/skills/INTEGRATION-GUIDE.md +2 -1
- package/bundled/locales/zh-CN/skills/README.md +3 -1
- package/bundled/locales/zh-CN/skills/_shared/README.md +2 -1
- package/bundled/locales/zh-CN/skills/adr-assistant/guide.md +240 -4
- package/bundled/locales/zh-CN/skills/agents/README.md +180 -82
- package/bundled/locales/zh-CN/skills/agents/code-architect.md +3 -1
- package/bundled/locales/zh-CN/skills/agents/doc-writer.md +3 -1
- package/bundled/locales/zh-CN/skills/agents/reviewer.md +4 -2
- package/bundled/locales/zh-CN/skills/agents/spec-analyst.md +3 -1
- package/bundled/locales/zh-CN/skills/agents/test-specialist.md +3 -1
- package/bundled/locales/zh-CN/skills/ai-collaboration-standards/SKILL.md +91 -81
- package/bundled/locales/zh-CN/skills/ai-collaboration-standards/anti-hallucination.md +79 -59
- package/bundled/locales/zh-CN/skills/ai-collaboration-standards/certainty-labels.md +66 -40
- package/bundled/locales/zh-CN/skills/ai-friendly-architecture/SKILL.md +23 -36
- package/bundled/locales/zh-CN/skills/api-design-assistant/SKILL.md +13 -2
- package/bundled/locales/zh-CN/skills/atdd-assistant/SKILL.md +16 -2
- package/bundled/locales/zh-CN/skills/atdd-assistant/acceptance-criteria-guide.md +2 -1
- package/bundled/locales/zh-CN/skills/atdd-assistant/atdd-workflow.md +98 -1
- package/bundled/locales/zh-CN/skills/audit-assistant/SKILL.md +5 -2
- package/bundled/locales/zh-CN/skills/bdd-assistant/SKILL.md +16 -2
- package/bundled/locales/zh-CN/skills/bdd-assistant/bdd-workflow.md +2 -1
- package/bundled/locales/zh-CN/skills/bdd-assistant/gherkin-guide.md +2 -1
- package/bundled/locales/zh-CN/skills/changelog-guide/SKILL.md +9 -2
- package/bundled/locales/zh-CN/skills/checkin-assistant/SKILL.md +12 -2
- package/bundled/locales/zh-CN/skills/ci-cd-assistant/SKILL.md +14 -2
- package/bundled/locales/zh-CN/skills/code-review-assistant/SKILL.md +12 -2
- package/bundled/locales/zh-CN/skills/code-review-assistant/checkin-checklist.md +79 -78
- package/bundled/locales/zh-CN/skills/code-review-assistant/review-checklist.md +89 -88
- package/bundled/locales/zh-CN/skills/commands/ac-coverage.md +43 -1
- package/bundled/locales/zh-CN/skills/commands/api-design.md +2 -1
- package/bundled/locales/zh-CN/skills/commands/atdd.md +71 -1
- package/bundled/locales/zh-CN/skills/commands/audit.md +2 -1
- package/bundled/locales/zh-CN/skills/commands/bdd.md +160 -62
- package/bundled/locales/zh-CN/skills/commands/changelog.md +36 -1
- package/bundled/locales/zh-CN/skills/commands/check.md +53 -1
- package/bundled/locales/zh-CN/skills/commands/checkin.md +45 -1
- package/bundled/locales/zh-CN/skills/commands/ci-cd.md +3 -2
- package/bundled/locales/zh-CN/skills/commands/code-review.md +41 -1
- package/bundled/locales/zh-CN/skills/commands/commit.md +56 -1
- package/bundled/locales/zh-CN/skills/commands/config.md +50 -1
- package/bundled/locales/zh-CN/skills/commands/coverage.md +43 -1
- package/bundled/locales/zh-CN/skills/commands/database.md +4 -3
- package/bundled/locales/zh-CN/skills/commands/derive-all.md +42 -1
- package/bundled/locales/zh-CN/skills/commands/derive-atdd.md +35 -1
- package/bundled/locales/zh-CN/skills/commands/derive-bdd.md +41 -1
- package/bundled/locales/zh-CN/skills/commands/derive-tdd.md +42 -1
- package/bundled/locales/zh-CN/skills/commands/derive.md +60 -4
- package/bundled/locales/zh-CN/skills/commands/dev-workflow.md +58 -8
- package/bundled/locales/zh-CN/skills/commands/discover.md +41 -1
- package/bundled/locales/zh-CN/skills/commands/docgen.md +37 -1
- package/bundled/locales/zh-CN/skills/commands/docs.md +136 -5
- package/bundled/locales/zh-CN/skills/commands/durable.md +4 -3
- package/bundled/locales/zh-CN/skills/commands/e2e.md +85 -1
- package/bundled/locales/zh-CN/skills/commands/guide.md +2 -1
- package/bundled/locales/zh-CN/skills/commands/incident.md +5 -4
- package/bundled/locales/zh-CN/skills/commands/init.md +57 -1
- package/bundled/locales/zh-CN/skills/commands/methodology.md +166 -77
- package/bundled/locales/zh-CN/skills/commands/metrics.md +3 -2
- package/bundled/locales/zh-CN/skills/commands/migrate.md +5 -4
- package/bundled/locales/zh-CN/skills/commands/observability.md +48 -3
- package/bundled/locales/zh-CN/skills/commands/pr.md +4 -3
- package/bundled/locales/zh-CN/skills/commands/refactor.md +76 -38
- package/bundled/locales/zh-CN/skills/commands/release.md +82 -1
- package/bundled/locales/zh-CN/skills/commands/requirement.md +40 -1
- package/bundled/locales/zh-CN/skills/commands/reverse-bdd.md +36 -1
- package/bundled/locales/zh-CN/skills/commands/reverse-sdd.md +44 -1
- package/bundled/locales/zh-CN/skills/commands/reverse-tdd.md +42 -1
- package/bundled/locales/zh-CN/skills/commands/reverse.md +43 -1
- package/bundled/locales/zh-CN/skills/commands/runbook.md +50 -3
- package/bundled/locales/zh-CN/skills/commands/scan.md +3 -2
- package/bundled/locales/zh-CN/skills/commands/sdd-retro.md +50 -1
- package/bundled/locales/zh-CN/skills/commands/sdd.md +182 -1
- package/bundled/locales/zh-CN/skills/commands/security.md +3 -2
- package/bundled/locales/zh-CN/skills/commands/slo.md +51 -3
- package/bundled/locales/zh-CN/skills/commands/tdd.md +74 -5
- package/bundled/locales/zh-CN/skills/commands/update.md +70 -8
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/commit-standards/conventional-commits.md +45 -44
- package/bundled/locales/zh-CN/skills/commit-standards/language-options.md +50 -47
- package/bundled/locales/zh-CN/skills/comprehension-ladder/SKILL.md +289 -0
- package/bundled/locales/zh-CN/skills/comprehension-ladder/eval-cases.md +261 -0
- package/bundled/locales/zh-CN/skills/contract-test-assistant/guide.md +76 -1
- package/bundled/locales/zh-CN/skills/database-assistant/SKILL.md +18 -5
- package/bundled/locales/zh-CN/skills/dev-methodology/create-methodology.md +2 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/runtime.md +2 -0
- package/bundled/locales/zh-CN/skills/docs-generator/SKILL.md +16 -2
- package/bundled/locales/zh-CN/skills/documentation-guide/SKILL.md +209 -184
- package/bundled/locales/zh-CN/skills/documentation-guide/documentation-structure.md +73 -72
- package/bundled/locales/zh-CN/skills/documentation-guide/readme-template.md +37 -36
- package/bundled/locales/zh-CN/skills/durable-execution-assistant/SKILL.md +28 -2
- package/bundled/locales/zh-CN/skills/e2e-assistant/SKILL.md +21 -6
- package/bundled/locales/zh-CN/skills/error-code-guide/SKILL.md +76 -95
- package/bundled/locales/zh-CN/skills/git-workflow-guide/SKILL.md +80 -87
- package/bundled/locales/zh-CN/skills/git-workflow-guide/branch-naming.md +44 -43
- package/bundled/locales/zh-CN/skills/git-workflow-guide/git-workflow.md +66 -65
- package/bundled/locales/zh-CN/skills/incident-response-assistant/SKILL.md +31 -13
- package/bundled/locales/zh-CN/skills/metrics-dashboard-assistant/SKILL.md +38 -2
- package/bundled/locales/zh-CN/skills/observability-assistant/SKILL.md +75 -1
- package/bundled/locales/zh-CN/skills/pr-automation-assistant/SKILL.md +32 -6
- package/bundled/locales/zh-CN/skills/project-discovery/SKILL.md +8 -2
- package/bundled/locales/zh-CN/skills/project-structure-guide/SKILL.md +49 -46
- package/bundled/locales/zh-CN/skills/project-structure-guide/language-patterns.md +8 -7
- package/bundled/locales/zh-CN/skills/refactoring-assistant/SKILL.md +22 -2
- package/bundled/locales/zh-CN/skills/release-standards/SKILL.md +66 -23
- package/bundled/locales/zh-CN/skills/release-standards/changelog-format.md +42 -41
- package/bundled/locales/zh-CN/skills/release-standards/release-workflow.md +131 -95
- package/bundled/locales/zh-CN/skills/release-standards/semantic-versioning.md +62 -61
- package/bundled/locales/zh-CN/skills/requirement-assistant/SKILL.md +24 -15
- package/bundled/locales/zh-CN/skills/requirement-assistant/requirement-checklist.md +128 -127
- package/bundled/locales/zh-CN/skills/requirement-assistant/requirement-writing.md +121 -120
- package/bundled/locales/zh-CN/skills/retrospective-assistant/guide.md +206 -2
- package/bundled/locales/zh-CN/skills/reverse-engineer/bdd-extraction.md +2 -1
- package/bundled/locales/zh-CN/skills/reverse-engineer/tdd-analysis.md +2 -1
- package/bundled/locales/zh-CN/skills/reverse-engineer/workflow.md +2 -1
- package/bundled/locales/zh-CN/skills/runbook-assistant/SKILL.md +9 -2
- package/bundled/locales/zh-CN/skills/security-assistant/SKILL.md +24 -6
- package/bundled/locales/zh-CN/skills/security-scan-assistant/SKILL.md +34 -10
- package/bundled/locales/zh-CN/skills/slo-assistant/SKILL.md +2 -1
- package/bundled/locales/zh-CN/skills/spec-driven-dev/guide.md +38 -6
- package/bundled/locales/zh-CN/skills/tdd-assistant/SKILL.md +16 -3
- package/bundled/locales/zh-CN/skills/tdd-assistant/language-examples.md +727 -82
- package/bundled/locales/zh-CN/skills/tdd-assistant/tdd-workflow.md +396 -214
- package/bundled/locales/zh-CN/skills/test-coverage-assistant/SKILL.md +14 -5
- package/bundled/locales/zh-CN/skills/testing-guide/testing-pyramid.md +99 -98
- package/bundled/locales/zh-CN/skills/testing-guide/testing-theory.md +3 -1
- package/bundled/locales/zh-CN/skills/tools/cline/README.md +2 -1
- package/bundled/locales/zh-CN/skills/tools/copilot/README.md +65 -18
- package/bundled/locales/zh-CN/skills/tools/copilot/copilot-instructions.md +2 -1
- package/bundled/locales/zh-CN/skills/tools/cursor/README.md +2 -1
- package/bundled/locales/zh-CN/skills/tools/windsurf/README.md +2 -1
- package/bundled/locales/zh-CN/skills/workflows/README.md +4 -2
- package/bundled/locales/zh-CN/templates/reverse-spec-template.md +50 -1
- package/bundled/locales/zh-TW/CHANGELOG.md +211 -3
- package/bundled/locales/zh-TW/README.md +3 -3
- package/bundled/locales/zh-TW/SECURITY.md +3 -1
- package/bundled/locales/zh-TW/STANDARDS-MAPPING.md +103 -6
- package/bundled/locales/zh-TW/adoption/ADOPTION-GUIDE.md +59 -97
- package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +2 -1
- package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +10 -2
- package/bundled/locales/zh-TW/adoption/checklists/enterprise.md +17 -10
- package/bundled/locales/zh-TW/adoption/checklists/minimal.md +19 -5
- package/bundled/locales/zh-TW/adoption/checklists/recommended.md +14 -5
- package/bundled/locales/zh-TW/ai/MAINTENANCE.md +34 -14
- package/bundled/locales/zh-TW/ai/options/commit-message/traditional-chinese.ai.yaml +48 -40
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +56 -10
- package/bundled/locales/zh-TW/core/acceptance-test-driven-development.md +2 -1
- package/bundled/locales/zh-TW/core/adr-standards.md +2 -1
- package/bundled/locales/zh-TW/core/agent-communication-protocol.md +2 -1
- package/bundled/locales/zh-TW/core/ai-command-behavior.md +2 -1
- package/bundled/locales/zh-TW/core/ai-instruction-standards.md +16 -13
- package/bundled/locales/zh-TW/core/ai-response-navigation.md +111 -13
- package/bundled/locales/zh-TW/core/anti-sycophancy-prompting.md +2 -1
- package/bundled/locales/zh-TW/core/api-design-standards.md +2 -1
- package/bundled/locales/zh-TW/core/behavior-driven-development.md +3 -17
- package/bundled/locales/zh-TW/core/capability-declaration.md +41 -79
- package/bundled/locales/zh-TW/core/change-batching-standards.md +2 -1
- package/bundled/locales/zh-TW/core/changelog-standards.md +14 -9
- package/bundled/locales/zh-TW/core/checkin-standards.md +84 -26
- package/bundled/locales/zh-TW/core/circuit-breaker.md +48 -87
- package/bundled/locales/zh-TW/core/code-review-checklist.md +36 -7
- package/bundled/locales/zh-TW/core/commit-message-guide.md +218 -87
- package/bundled/locales/zh-TW/core/database-standards.md +2 -1
- package/bundled/locales/zh-TW/core/developer-memory.md +111 -12
- package/bundled/locales/zh-TW/core/documentation-lifecycle.md +2 -1
- package/bundled/locales/zh-TW/core/documentation-structure.md +17 -8
- package/bundled/locales/zh-TW/core/dual-phase-output.md +28 -90
- package/bundled/locales/zh-TW/core/error-code-standards.md +17 -6
- package/bundled/locales/zh-TW/core/execution-history.md +2 -1
- package/bundled/locales/zh-TW/core/failure-source-taxonomy.md +59 -117
- package/bundled/locales/zh-TW/core/frontend-design-standards.md +120 -8
- package/bundled/locales/zh-TW/core/full-coverage-testing.md +103 -9
- package/bundled/locales/zh-TW/core/git-workflow.md +197 -37
- package/bundled/locales/zh-TW/core/git-worktree.md +79 -49
- package/bundled/locales/zh-TW/core/guides/file-placement-guide.md +86 -2
- package/bundled/locales/zh-TW/core/guides/performance-guide.md +2 -0
- package/bundled/locales/zh-TW/core/guides/security-guide.md +2 -0
- package/bundled/locales/zh-TW/core/health-check-standards.md +46 -104
- package/bundled/locales/zh-TW/core/immutability-first.md +45 -85
- package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -1
- package/bundled/locales/zh-TW/core/knowledge-transfer-standards.md +103 -40
- package/bundled/locales/zh-TW/core/open-work-tracking.md +164 -9
- package/bundled/locales/zh-TW/core/pipeline-integration-standards.md +2 -1
- package/bundled/locales/zh-TW/core/pipeline-security-gates.md +64 -4
- package/bundled/locales/zh-TW/core/privacy-standards.md +153 -46
- package/bundled/locales/zh-TW/core/project-context-memory.md +215 -31
- package/bundled/locales/zh-TW/core/project-structure.md +240 -19
- package/bundled/locales/zh-TW/core/recovery-recipe-registry.md +54 -114
- package/bundled/locales/zh-TW/core/refactoring-standards.md +153 -48
- package/bundled/locales/zh-TW/core/requirement-engineering.md +8 -37
- package/bundled/locales/zh-TW/core/retrospective-standards.md +127 -7
- package/bundled/locales/zh-TW/core/retry-standards.md +41 -105
- package/bundled/locales/zh-TW/core/reverse-engineering-standards.md +5 -1
- package/bundled/locales/zh-TW/core/security-decision.md +43 -84
- package/bundled/locales/zh-TW/core/security-standards.md +204 -25
- package/bundled/locales/zh-TW/core/self-review-protocol.md +2 -1
- package/bundled/locales/zh-TW/core/skill-standard-alignment-check.md +103 -69
- package/bundled/locales/zh-TW/core/standard-admission-criteria.md +22 -28
- package/bundled/locales/zh-TW/core/standard-lifecycle-management.md +40 -48
- package/bundled/locales/zh-TW/core/structured-task-definition.md +2 -1
- package/bundled/locales/zh-TW/core/supply-chain-security-standards.md +137 -10
- package/bundled/locales/zh-TW/core/systematic-debugging.md +94 -38
- package/bundled/locales/zh-TW/core/tech-debt-standards.md +170 -54
- package/bundled/locales/zh-TW/core/test-completeness-dimensions.md +101 -12
- package/bundled/locales/zh-TW/core/test-data-standards.md +245 -23
- package/bundled/locales/zh-TW/core/test-driven-development.md +4 -1
- package/bundled/locales/zh-TW/core/test-governance.md +92 -32
- package/bundled/locales/zh-TW/core/testing-standards.md +61 -14
- package/bundled/locales/zh-TW/core/timeout-standards.md +45 -85
- package/bundled/locales/zh-TW/core/token-budget.md +41 -112
- package/bundled/locales/zh-TW/core/translation-lifecycle-standards.md +28 -16
- package/bundled/locales/zh-TW/core/turn-completion-integrity.md +46 -13
- package/bundled/locales/zh-TW/core/verification-evidence.md +2 -1
- package/bundled/locales/zh-TW/core/versioning.md +6 -2
- package/bundled/locales/zh-TW/core/virtual-organization-standards.md +42 -36
- package/bundled/locales/zh-TW/core/workflow-enforcement.md +2 -1
- package/bundled/locales/zh-TW/core/workflow-state-protocol.md +2 -1
- package/bundled/locales/zh-TW/docs/AVAILABLE-STANDARDS.md +70 -0
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +11 -2
- package/bundled/locales/zh-TW/docs/CLI-FLOW.md +2 -1
- package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +69 -33
- package/bundled/locales/zh-TW/docs/DEV-WORKFLOW-MAPPING.md +2 -1
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +32 -15
- package/bundled/locales/zh-TW/docs/STANDARDS-REFERENCE.md +2 -1
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +8 -7
- package/bundled/locales/zh-TW/docs/USER-MANUAL.md +9 -1
- package/bundled/locales/zh-TW/docs/WINDOWS-GUIDE.md +11 -2
- package/bundled/locales/zh-TW/docs/specs/system/memory-adoption-strategy.md +2 -0
- package/bundled/locales/zh-TW/docs/user/FAQ.md +2 -0
- package/bundled/locales/zh-TW/docs/user/GETTING-STARTED.md +46 -0
- package/bundled/locales/zh-TW/docs/user/GLOSSARY.md +2 -0
- package/bundled/locales/zh-TW/docs/user/README.md +2 -0
- package/bundled/locales/zh-TW/docs/user/TROUBLESHOOTING.md +2 -0
- package/bundled/locales/zh-TW/integrations/claude-code/README.md +2 -1
- package/bundled/locales/zh-TW/integrations/codex/AGENTS.md +136 -2
- package/bundled/locales/zh-TW/integrations/codex/README.md +7 -1
- package/bundled/locales/zh-TW/integrations/gemini-cli/GEMINI.md +59 -1
- package/bundled/locales/zh-TW/integrations/gemini-cli/README.md +8 -1
- package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +7 -1
- package/bundled/locales/zh-TW/integrations/github-copilot/README.md +9 -3
- package/bundled/locales/zh-TW/integrations/github-copilot/copilot-instructions.md +146 -12
- package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +7 -1
- package/bundled/locales/zh-TW/integrations/google-antigravity/AGENTS.md +110 -3
- package/bundled/locales/zh-TW/integrations/google-antigravity/README.md +7 -1
- package/bundled/locales/zh-TW/integrations/opencode/AGENTS.md +140 -2
- package/bundled/locales/zh-TW/integrations/opencode/README.md +7 -1
- package/bundled/locales/zh-TW/integrations/opencode/skills-mapping.md +8 -2
- package/bundled/locales/zh-TW/integrations/openspec/AGENTS.md +46 -1
- package/bundled/locales/zh-TW/integrations/openspec/README.md +7 -1
- package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +20 -2
- package/bundled/locales/zh-TW/integrations/spec-kit/README.md +7 -1
- package/bundled/locales/zh-TW/options/changelog/auto-generated.md +2 -0
- package/bundled/locales/zh-TW/options/changelog/keep-a-changelog.md +2 -0
- package/bundled/locales/zh-TW/options/code-review/automated-review.md +2 -0
- package/bundled/locales/zh-TW/options/code-review/pair-programming.md +2 -0
- package/bundled/locales/zh-TW/options/code-review/pr-review.md +13 -2
- package/bundled/locales/zh-TW/options/commit-message/bilingual.md +93 -5
- package/bundled/locales/zh-TW/options/commit-message/english.md +118 -1
- package/bundled/locales/zh-TW/options/commit-message/traditional-chinese.md +82 -1
- package/bundled/locales/zh-TW/options/documentation/api-docs.md +2 -0
- package/bundled/locales/zh-TW/options/documentation/markdown-docs.md +2 -0
- package/bundled/locales/zh-TW/options/documentation/wiki-style.md +2 -0
- package/bundled/locales/zh-TW/options/git-workflow/gitflow.md +99 -71
- package/bundled/locales/zh-TW/options/git-workflow/github-flow.md +68 -50
- package/bundled/locales/zh-TW/options/git-workflow/merge-commit.md +131 -20
- package/bundled/locales/zh-TW/options/git-workflow/rebase-ff.md +142 -27
- package/bundled/locales/zh-TW/options/git-workflow/squash-merge.md +100 -15
- package/bundled/locales/zh-TW/options/git-workflow/trunk-based.md +103 -56
- package/bundled/locales/zh-TW/options/project-structure/dotnet.md +233 -14
- package/bundled/locales/zh-TW/options/project-structure/go.md +270 -12
- package/bundled/locales/zh-TW/options/project-structure/java.md +235 -15
- package/bundled/locales/zh-TW/options/project-structure/kotlin.md +2 -0
- package/bundled/locales/zh-TW/options/project-structure/nodejs.md +136 -19
- package/bundled/locales/zh-TW/options/project-structure/php.md +2 -0
- package/bundled/locales/zh-TW/options/project-structure/python.md +177 -19
- package/bundled/locales/zh-TW/options/project-structure/ruby.md +2 -0
- package/bundled/locales/zh-TW/options/project-structure/rust.md +2 -0
- package/bundled/locales/zh-TW/options/project-structure/swift.md +2 -0
- package/bundled/locales/zh-TW/options/testing/contract-testing.md +2 -0
- package/bundled/locales/zh-TW/options/testing/e2e-testing.md +182 -21
- package/bundled/locales/zh-TW/options/testing/industry-pyramid.md +2 -0
- package/bundled/locales/zh-TW/options/testing/integration-testing.md +134 -22
- package/bundled/locales/zh-TW/options/testing/istqb-framework.md +2 -0
- package/bundled/locales/zh-TW/options/testing/performance-testing.md +2 -0
- package/bundled/locales/zh-TW/options/testing/security-testing.md +2 -0
- package/bundled/locales/zh-TW/options/testing/system-testing.md +175 -1
- package/bundled/locales/zh-TW/options/testing/unit-testing.md +123 -9
- package/bundled/locales/zh-TW/skills/CONTRIBUTING.template.md +3 -2
- package/bundled/locales/zh-TW/skills/INTEGRATION-GUIDE.md +2 -1
- package/bundled/locales/zh-TW/skills/README.md +3 -1
- package/bundled/locales/zh-TW/skills/_shared/README.md +2 -1
- package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +15 -4
- package/bundled/locales/zh-TW/skills/adr-assistant/guide.md +123 -3
- package/bundled/locales/zh-TW/skills/agents/README.md +99 -1
- package/bundled/locales/zh-TW/skills/agents/code-architect.md +2 -0
- package/bundled/locales/zh-TW/skills/agents/doc-writer.md +2 -0
- package/bundled/locales/zh-TW/skills/agents/reviewer.md +3 -1
- package/bundled/locales/zh-TW/skills/agents/spec-analyst.md +2 -0
- package/bundled/locales/zh-TW/skills/agents/test-specialist.md +2 -0
- package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +48 -37
- package/bundled/locales/zh-TW/skills/ai-collaboration-standards/anti-hallucination.md +22 -2
- package/bundled/locales/zh-TW/skills/ai-collaboration-standards/certainty-labels.md +29 -3
- package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +23 -36
- package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +12 -36
- package/bundled/locales/zh-TW/skills/api-design-assistant/SKILL.md +21 -5
- package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +40 -15
- package/bundled/locales/zh-TW/skills/atdd-assistant/acceptance-criteria-guide.md +2 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/atdd-workflow.md +98 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/guide.md +24 -8
- package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +8 -2
- package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +29 -6
- package/bundled/locales/zh-TW/skills/bdd-assistant/bdd-workflow.md +2 -1
- package/bundled/locales/zh-TW/skills/bdd-assistant/gherkin-guide.md +2 -1
- package/bundled/locales/zh-TW/skills/bdd-assistant/guide.md +9 -8
- package/bundled/locales/zh-TW/skills/changelog-guide/SKILL.md +12 -3
- package/bundled/locales/zh-TW/skills/changelog-guide/guide.md +11 -7
- package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +19 -3
- package/bundled/locales/zh-TW/skills/checkin-assistant/guide.md +5 -3
- package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +35 -16
- package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +19 -2
- package/bundled/locales/zh-TW/skills/code-review-assistant/checkin-checklist.md +2 -1
- package/bundled/locales/zh-TW/skills/code-review-assistant/guide.md +81 -6
- package/bundled/locales/zh-TW/skills/code-review-assistant/review-checklist.md +2 -1
- package/bundled/locales/zh-TW/skills/commands/ac-coverage.md +47 -2
- package/bundled/locales/zh-TW/skills/commands/api-design.md +3 -2
- package/bundled/locales/zh-TW/skills/commands/atdd.md +80 -10
- package/bundled/locales/zh-TW/skills/commands/audit.md +3 -2
- package/bundled/locales/zh-TW/skills/commands/bdd.md +114 -16
- package/bundled/locales/zh-TW/skills/commands/changelog.md +45 -9
- package/bundled/locales/zh-TW/skills/commands/check.md +74 -21
- package/bundled/locales/zh-TW/skills/commands/checkin.md +56 -11
- package/bundled/locales/zh-TW/skills/commands/ci-cd.md +2 -1
- package/bundled/locales/zh-TW/skills/commands/code-review.md +43 -2
- package/bundled/locales/zh-TW/skills/commands/commit.md +58 -4
- package/bundled/locales/zh-TW/skills/commands/config.md +52 -4
- package/bundled/locales/zh-TW/skills/commands/coverage.md +45 -4
- package/bundled/locales/zh-TW/skills/commands/database.md +3 -2
- package/bundled/locales/zh-TW/skills/commands/derive-all.md +44 -2
- package/bundled/locales/zh-TW/skills/commands/derive-atdd.md +37 -2
- package/bundled/locales/zh-TW/skills/commands/derive-bdd.md +44 -3
- package/bundled/locales/zh-TW/skills/commands/derive-tdd.md +45 -3
- package/bundled/locales/zh-TW/skills/commands/derive.md +62 -5
- package/bundled/locales/zh-TW/skills/commands/dev-workflow.md +60 -9
- package/bundled/locales/zh-TW/skills/commands/discover.md +43 -2
- package/bundled/locales/zh-TW/skills/commands/docgen.md +39 -2
- package/bundled/locales/zh-TW/skills/commands/docs.md +139 -7
- package/bundled/locales/zh-TW/skills/commands/durable.md +3 -2
- package/bundled/locales/zh-TW/skills/commands/e2e.md +86 -3
- package/bundled/locales/zh-TW/skills/commands/guide.md +4 -2
- package/bundled/locales/zh-TW/skills/commands/incident.md +3 -2
- package/bundled/locales/zh-TW/skills/commands/init.md +72 -15
- package/bundled/locales/zh-TW/skills/commands/methodology.md +117 -28
- package/bundled/locales/zh-TW/skills/commands/metrics.md +2 -1
- package/bundled/locales/zh-TW/skills/commands/migrate.md +2 -1
- package/bundled/locales/zh-TW/skills/commands/observability.md +45 -2
- package/bundled/locales/zh-TW/skills/commands/pr.md +2 -1
- package/bundled/locales/zh-TW/skills/commands/refactor.md +54 -13
- package/bundled/locales/zh-TW/skills/commands/release.md +83 -2
- package/bundled/locales/zh-TW/skills/commands/requirement.md +41 -2
- package/bundled/locales/zh-TW/skills/commands/reverse-bdd.md +37 -2
- package/bundled/locales/zh-TW/skills/commands/reverse-sdd.md +45 -2
- package/bundled/locales/zh-TW/skills/commands/reverse-tdd.md +43 -2
- package/bundled/locales/zh-TW/skills/commands/reverse.md +44 -2
- package/bundled/locales/zh-TW/skills/commands/runbook.md +47 -2
- package/bundled/locales/zh-TW/skills/commands/scan.md +3 -2
- package/bundled/locales/zh-TW/skills/commands/sdd-retro.md +52 -3
- package/bundled/locales/zh-TW/skills/commands/sdd.md +209 -28
- package/bundled/locales/zh-TW/skills/commands/security.md +3 -2
- package/bundled/locales/zh-TW/skills/commands/slo.md +48 -2
- package/bundled/locales/zh-TW/skills/commands/tdd.md +71 -2
- package/bundled/locales/zh-TW/skills/commands/update.md +64 -2
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/commit-standards/conventional-commits.md +2 -1
- package/bundled/locales/zh-TW/skills/commit-standards/language-options.md +21 -18
- package/bundled/locales/zh-TW/skills/comprehension-ladder/SKILL.md +289 -0
- package/bundled/locales/zh-TW/skills/comprehension-ladder/eval-cases.md +261 -0
- package/bundled/locales/zh-TW/skills/contract-test-assistant/guide.md +81 -1
- package/bundled/locales/zh-TW/skills/database-assistant/SKILL.md +21 -5
- package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +2 -1
- package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +4 -1
- package/bundled/locales/zh-TW/skills/dev-methodology/create-methodology.md +2 -0
- package/bundled/locales/zh-TW/skills/dev-methodology/runtime.md +2 -0
- package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +19 -2
- package/bundled/locales/zh-TW/skills/documentation-guide/SKILL.md +67 -42
- package/bundled/locales/zh-TW/skills/documentation-guide/documentation-structure.md +2 -1
- package/bundled/locales/zh-TW/skills/documentation-guide/readme-template.md +2 -1
- package/bundled/locales/zh-TW/skills/durable-execution-assistant/SKILL.md +32 -3
- package/bundled/locales/zh-TW/skills/e2e-assistant/SKILL.md +25 -7
- package/bundled/locales/zh-TW/skills/error-code-guide/SKILL.md +17 -34
- package/bundled/locales/zh-TW/skills/git-workflow-guide/SKILL.md +33 -38
- package/bundled/locales/zh-TW/skills/git-workflow-guide/branch-naming.md +2 -1
- package/bundled/locales/zh-TW/skills/git-workflow-guide/git-workflow.md +2 -1
- package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +35 -14
- package/bundled/locales/zh-TW/skills/journey-test-assistant/SKILL.md +2 -14
- package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +6 -2
- package/bundled/locales/zh-TW/skills/metrics-dashboard-assistant/SKILL.md +42 -3
- package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +27 -3
- package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +11 -3
- package/bundled/locales/zh-TW/skills/project-discovery/guide.md +5 -3
- package/bundled/locales/zh-TW/skills/project-discovery/workflow.md +2 -1
- package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +19 -16
- package/bundled/locales/zh-TW/skills/project-structure-guide/language-patterns.md +2 -1
- package/bundled/locales/zh-TW/skills/refactoring-assistant/SKILL.md +26 -3
- package/bundled/locales/zh-TW/skills/refactoring-assistant/guide.md +4 -2
- package/bundled/locales/zh-TW/skills/release-standards/changelog-format.md +4 -3
- package/bundled/locales/zh-TW/skills/release-standards/guide.md +14 -5
- package/bundled/locales/zh-TW/skills/release-standards/release-workflow.md +5 -1
- package/bundled/locales/zh-TW/skills/release-standards/semantic-versioning.md +2 -1
- package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +15 -6
- package/bundled/locales/zh-TW/skills/requirement-assistant/guide.md +18 -8
- package/bundled/locales/zh-TW/skills/requirement-assistant/requirement-checklist.md +2 -1
- package/bundled/locales/zh-TW/skills/requirement-assistant/requirement-writing.md +2 -1
- package/bundled/locales/zh-TW/skills/retrospective-assistant/guide.md +200 -6
- package/bundled/locales/zh-TW/skills/reverse-engineer/bdd-extraction.md +2 -1
- package/bundled/locales/zh-TW/skills/reverse-engineer/guide.md +161 -36
- package/bundled/locales/zh-TW/skills/reverse-engineer/tdd-analysis.md +2 -1
- package/bundled/locales/zh-TW/skills/reverse-engineer/workflow.md +2 -1
- package/bundled/locales/zh-TW/skills/runbook-assistant/SKILL.md +9 -1
- package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +25 -5
- package/bundled/locales/zh-TW/skills/security-scan-assistant/SKILL.md +34 -8
- package/bundled/locales/zh-TW/skills/skill-builder/SKILL.md +3 -21
- package/bundled/locales/zh-TW/skills/slo-assistant/SKILL.md +3 -1
- package/bundled/locales/zh-TW/skills/spec-derivation/SKILL.md +2 -1
- package/bundled/locales/zh-TW/skills/spec-driven-dev/guide.md +35 -2
- package/bundled/locales/zh-TW/skills/sweep/SKILL.md +2 -1
- package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +10 -2
- package/bundled/locales/zh-TW/skills/tdd-assistant/guide.md +68 -9
- package/bundled/locales/zh-TW/skills/tdd-assistant/tdd-workflow.md +183 -1
- package/bundled/locales/zh-TW/skills/test-coverage-assistant/SKILL.md +15 -5
- package/bundled/locales/zh-TW/skills/test-coverage-assistant/guide.md +26 -13
- package/bundled/locales/zh-TW/skills/testing-guide/testing-pyramid.md +2 -1
- package/bundled/locales/zh-TW/skills/testing-guide/testing-theory.md +3 -1
- package/bundled/locales/zh-TW/skills/tools/cline/README.md +2 -1
- package/bundled/locales/zh-TW/skills/tools/copilot/README.md +65 -18
- package/bundled/locales/zh-TW/skills/tools/copilot/copilot-instructions.md +2 -1
- package/bundled/locales/zh-TW/skills/tools/cursor/README.md +2 -1
- package/bundled/locales/zh-TW/skills/tools/windsurf/README.md +2 -1
- package/bundled/locales/zh-TW/skills/workflows/README.md +11 -9
- package/bundled/locales/zh-TW/templates/reverse-spec-template.md +50 -1
- package/bundled/skills/README.md +1 -0
- package/bundled/skills/SKILL_NAMING.md +9 -0
- package/bundled/skills/commit-standards/SKILL.md +2 -2
- package/bundled/skills/commit-standards/guide.md +3 -2
- package/bundled/skills/commit-standards/language-options.md +19 -17
- package/bundled/skills/comprehension-ladder/SKILL.md +283 -0
- package/bundled/skills/comprehension-ladder/eval-cases.md +255 -0
- package/bundled/templates/gates/check-anti-fake-tests.mjs +1291 -0
- package/bundled/templates/gates/check-stubs.mjs +644 -0
- package/package.json +5 -3
- package/src/commands/audit.js +20 -2
- package/src/commands/check.js +155 -28
- package/src/commands/deps.js +31 -1
- package/src/commands/hitl.js +3 -0
- package/src/commands/init.js +173 -49
- package/src/commands/list.js +12 -3
- package/src/commands/mcp.js +2 -3
- package/src/commands/open-work.js +123 -0
- package/src/commands/quickstart.js +29 -13
- package/src/commands/release.js +102 -19
- package/src/commands/run-intent.js +10 -0
- package/src/commands/simulate.js +20 -8
- package/src/commands/skills.js +59 -33
- package/src/commands/spec-split.js +30 -17
- package/src/commands/spec.js +55 -21
- package/src/commands/uninstall.js +146 -32
- package/src/commands/update.js +471 -93
- package/src/core/install-records.js +192 -0
- package/src/core/manifest.js +12 -10
- package/src/core/marketplace-sentinel.js +5 -0
- package/src/core/open-work-config.js +122 -0
- package/src/core/project-config.js +92 -38
- package/src/flows/init-flow.js +10 -0
- package/src/hitl/manager.js +4 -2
- package/src/i18n/messages.js +413 -78
- package/src/installers/hooks-installer.js +320 -24
- package/src/installers/integration-installer.js +5 -1
- package/src/installers/skills-installer.js +3 -1
- package/src/installers/standards-installer.js +16 -23
- package/src/mcp/__tests__/server.test.js +0 -1
- package/src/mcp/server.js +16 -4
- package/src/prompts/init.js +148 -13
- package/src/reconciler/backup-locations.js +80 -0
- package/src/reconciler/backup-manager.js +451 -123
- package/src/reconciler/index.js +86 -10
- package/src/reconciler/install-roots.js +90 -0
- package/src/reconciler/plan-executor.js +37 -15
- package/src/uninstallers/hook-uninstaller.js +323 -33
- package/src/uninstallers/integration-uninstaller.js +35 -5
- package/src/uninstallers/skills-uninstaller.js +95 -16
- package/src/uninstallers/standards-uninstaller.js +56 -7
- package/src/utils/agents-installer.js +10 -17
- package/src/utils/available-standards-report.js +144 -0
- package/src/utils/available-standards.js +216 -0
- package/src/utils/command-hash-ownership.js +103 -0
- package/src/utils/commit-message-judge.js +155 -0
- package/src/utils/copier.js +80 -2
- package/src/utils/deps-applicability.js +25 -0
- package/src/utils/detector.js +46 -1
- package/src/utils/friction-detector.js +27 -0
- package/src/utils/gate-scripts.js +141 -0
- package/src/utils/git-hooks.js +139 -7
- package/src/utils/hasher.js +36 -0
- package/src/utils/health-scorer.js +10 -7
- package/src/utils/installed-names-ownership.js +114 -0
- package/src/utils/integration-generator.js +36 -24
- package/src/utils/legacy-hook-migration.js +112 -0
- package/src/utils/locale.js +19 -0
- package/src/utils/open-work-tracking.mjs +1754 -0
- package/src/utils/prompt-closed.js +18 -0
- package/src/utils/sdd-header.js +66 -0
- package/src/utils/skill-frontmatter.js +102 -0
- package/src/utils/skill-hash-ownership.js +64 -0
- package/src/utils/skill-name-collision.js +169 -0
- package/src/utils/skills-install-paths.js +114 -0
- package/src/utils/skills-installer.js +75 -106
- package/src/utils/standard-validator.js +98 -27
- package/src/utils/test-change-check.js +160 -0
- package/src/utils/test-policy.js +214 -0
- package/src/utils/transient-fs.js +113 -0
- package/src/utils/update-summary.js +29 -0
- package/src/vibe/micro-spec.js +15 -0
- package/standards-registry.json +48 -9
package/src/commands/update.js
CHANGED
|
@@ -4,8 +4,14 @@ import { select, confirm as inquirerConfirm, checkbox, Separator } from '@inquir
|
|
|
4
4
|
import { execSync } from 'child_process';
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'fs';
|
|
6
6
|
import { join, basename, dirname, relative } from 'path';
|
|
7
|
-
import { readManifest, writeManifest, copyStandard, isInitialized, getRepoRoot } from '../utils/copier.js';
|
|
7
|
+
import { readManifest, writeManifest, copyStandard, copyExtension, isInitialized, getRepoRoot } from '../utils/copier.js';
|
|
8
8
|
import { getRepositoryInfo, getAllStandards, getShippableFilenames, getStandardSource } from '../utils/registry.js';
|
|
9
|
+
import { getAvailableStandards } from '../utils/available-standards.js';
|
|
10
|
+
import {
|
|
11
|
+
printAvailableStandardsSection,
|
|
12
|
+
resolveAddStandardRequest,
|
|
13
|
+
findAddStandardConflict
|
|
14
|
+
} from '../utils/available-standards-report.js';
|
|
9
15
|
import { computeFileHash, planStandardsRemovals, refreshIntegrationBlockHashes, pruneIntegrationFileHashes } from '../utils/hasher.js';
|
|
10
16
|
import { AmbiguousMarkerError } from '../utils/marker-locator.js';
|
|
11
17
|
import {
|
|
@@ -25,6 +31,10 @@ import {
|
|
|
25
31
|
getToolFromPath
|
|
26
32
|
} from '../utils/reference-sync.js';
|
|
27
33
|
import { checkForUpdates } from '../utils/npm-registry.js';
|
|
34
|
+
import { pruneForeignSkillHashes } from '../utils/skill-hash-ownership.js';
|
|
35
|
+
import { pruneForeignCommandHashes } from '../utils/command-hash-ownership.js';
|
|
36
|
+
import { pruneForeignSkillNames, pruneForeignCommandNames } from '../utils/installed-names-ownership.js';
|
|
37
|
+
import { commandsUpdatedMessage } from '../utils/update-summary.js';
|
|
28
38
|
import { t, setLanguage, isLanguageExplicitlySet } from '../i18n/messages.js';
|
|
29
39
|
import { config } from '../utils/config-manager.js';
|
|
30
40
|
import {
|
|
@@ -45,7 +55,12 @@ import {
|
|
|
45
55
|
getCommandsDirForAgent
|
|
46
56
|
} from '../config/ai-agent-paths.js';
|
|
47
57
|
import { getMarketplaceSkillsInfo } from '../utils/github.js';
|
|
58
|
+
import { printSkillNameCollisionWarning } from '../utils/skill-name-collision.js';
|
|
48
59
|
import { detectAITools } from '../utils/detector.js';
|
|
60
|
+
import { HOOK_CAPABLE_TOOLS, resolveHookTools, installMissingHooks } from '../installers/hooks-installer.js';
|
|
61
|
+
import { persistRecorder, mergeRecorderInto, newRecorder } from '../core/install-records.js';
|
|
62
|
+
import { installGateScripts, gateStandardInstalled, GATE_SCRIPTS } from '../utils/gate-scripts.js';
|
|
63
|
+
import { migrateLegacyHuskyHook } from '../utils/legacy-hook-migration.js';
|
|
49
64
|
import {
|
|
50
65
|
promptSkillsInstallLocation,
|
|
51
66
|
promptCommandsInstallation
|
|
@@ -55,8 +70,12 @@ import {
|
|
|
55
70
|
plan as reconcilerPlan,
|
|
56
71
|
rollbackLast,
|
|
57
72
|
formatPlan,
|
|
58
|
-
listBackups
|
|
73
|
+
listBackups,
|
|
74
|
+
createStepBackup,
|
|
75
|
+
finalizeBackup,
|
|
76
|
+
cleanupBackups
|
|
59
77
|
} from '../reconciler/index.js';
|
|
78
|
+
import { stepWritePaths } from '../reconciler/install-roots.js';
|
|
60
79
|
import { restoreSingleFile } from './check.js';
|
|
61
80
|
import { guardAgainstSelfAdoption } from '../utils/detect-self-adoption.js';
|
|
62
81
|
import { resolveIntegrationFile, SUPPORTED_AI_TOOLS, getToolFormat } from '../core/constants.js';
|
|
@@ -311,43 +330,11 @@ async function updateCliAndExit(useBeta = false) {
|
|
|
311
330
|
* @returns {{newStandards: Array<{source: string, name: string}>, count: number}}
|
|
312
331
|
*/
|
|
313
332
|
function checkNewStandards(manifest) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
//
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
// Include all reference and skill standards
|
|
320
|
-
const eligibleStandards = registryStandards.filter(s => s.category === 'reference' || s.category === 'skill');
|
|
321
|
-
|
|
322
|
-
// Get installed standard basenames for comparison.
|
|
323
|
-
// Handles both legacy path format ("ai/standards/foo.ai.yaml" → basename "foo.ai.yaml")
|
|
324
|
-
// and v3.4.0 ID format ("foo" → resolve to source path, then get basename).
|
|
325
|
-
const installedBasenames = new Set();
|
|
326
|
-
for (const s of (manifest.standards || [])) {
|
|
327
|
-
if (s.includes('/options/') || s.startsWith('options/')) continue; // Skip option paths
|
|
328
|
-
if (!s.includes('/') && !s.includes('.')) {
|
|
329
|
-
// ID format: resolve to actual source filename via registry
|
|
330
|
-
const entry = registryStandards.find(r => r.id === s);
|
|
331
|
-
if (entry) {
|
|
332
|
-
const sourcePath = getStandardSource(entry, format);
|
|
333
|
-
if (sourcePath) installedBasenames.add(basename(sourcePath));
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
installedBasenames.add(basename(s));
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
// Find standards in registry that are not yet installed
|
|
341
|
-
const newStandards = [];
|
|
342
|
-
for (const std of eligibleStandards) {
|
|
343
|
-
const sourcePath = getStandardSource(std, format);
|
|
344
|
-
if (!sourcePath) continue; // Skip skill-only standards with no source file
|
|
345
|
-
const fileName = basename(sourcePath);
|
|
346
|
-
if (!installedBasenames.has(fileName)) {
|
|
347
|
-
newStandards.push({ source: sourcePath, name: fileName });
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
333
|
+
// One definition of "available but not installed", shared with `update --plan`, `check` and
|
|
334
|
+
// `audit --friction` (XSPEC-458 R1). This function used to hold its own copy of that logic, and the
|
|
335
|
+
// reconciler path (`--plan`/`--apply`) held none — so the two paths disagreed about what was missing.
|
|
336
|
+
const { offered } = getAvailableStandards(manifest);
|
|
337
|
+
const newStandards = offered.map(std => ({ source: std.source, name: std.name }));
|
|
351
338
|
return { newStandards, count: newStandards.length };
|
|
352
339
|
}
|
|
353
340
|
|
|
@@ -442,6 +429,28 @@ export async function updateCommand(options) {
|
|
|
442
429
|
console.log(chalk.bold(msg.title));
|
|
443
430
|
console.log(chalk.gray('─'.repeat(50)));
|
|
444
431
|
|
|
432
|
+
// XSPEC-458 R3: `--add-standard <id>` (repeatable) picks standards UDS ships and this project lacks.
|
|
433
|
+
// Judged here, before any mode runs, so an unknown id stops everything instead of being skipped.
|
|
434
|
+
const addStandardIds = [].concat(options.addStandard || []);
|
|
435
|
+
let addStandards = [];
|
|
436
|
+
if (addStandardIds.length > 0) {
|
|
437
|
+
const conflict = findAddStandardConflict(options);
|
|
438
|
+
if (conflict) {
|
|
439
|
+
console.log(chalk.red(conflict));
|
|
440
|
+
console.log();
|
|
441
|
+
process.exitCode = 1;
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
const request = resolveAddStandardRequest(manifest, addStandardIds);
|
|
445
|
+
if (!request.proceed) return;
|
|
446
|
+
if (request.ids.length === 0) {
|
|
447
|
+
console.log(chalk.gray(t().availableStandards.addNothingDone));
|
|
448
|
+
console.log();
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
addStandards = request.ids;
|
|
452
|
+
}
|
|
453
|
+
|
|
445
454
|
// Handle --claude-target option (XSPEC-418 R4): switch an EXISTING
|
|
446
455
|
// installation's claude-code integration target between CLAUDE.md and
|
|
447
456
|
// CLAUDE.local.md, without a full reinstall. Standalone, like --sync-refs
|
|
@@ -451,6 +460,15 @@ export async function updateCommand(options) {
|
|
|
451
460
|
return;
|
|
452
461
|
}
|
|
453
462
|
|
|
463
|
+
// Handle --with-hooks (added 2026-09-29): install the enforcement hooks that are
|
|
464
|
+
// MISSING from an already-initialized project — the door `uds init --with-hooks`
|
|
465
|
+
// cannot be, because `uds init` refuses to run twice. Standalone like
|
|
466
|
+
// --claude-target and --sync-refs; and like them it honours --plan by writing nothing.
|
|
467
|
+
if (options.withHooks) {
|
|
468
|
+
await updateHooksOnly(projectPath, manifest, options);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
|
|
454
472
|
// Handle --sync-refs option.
|
|
455
473
|
// `--plan` is honoured here too. This branch is above the mode dispatch
|
|
456
474
|
// because sync-refs is its own operation rather than a scope of the
|
|
@@ -488,6 +506,13 @@ export async function updateCommand(options) {
|
|
|
488
506
|
const scopedToSkills = !!options.skills;
|
|
489
507
|
const scopedToCommands = !!options.commands;
|
|
490
508
|
|
|
509
|
+
// A pre-commit line an older UDS wrote asks npm for the bare name `uds`, which
|
|
510
|
+
// is not this project. Fixed here, before any mode below can return early
|
|
511
|
+
// (an up-to-date adopter still has it). Narrowed runs stay narrowed.
|
|
512
|
+
if (!options.rollback && !scopedToSkills && !scopedToCommands && !options.standardsOnly) {
|
|
513
|
+
migrateLegacyPreCommitHook(projectPath, manifest, { plan: !!options.plan });
|
|
514
|
+
}
|
|
515
|
+
|
|
491
516
|
// Handle --rollback option (DSR). It restores a whole backup, so a scope
|
|
492
517
|
// flag cannot narrow it — say so rather than appearing to honour it.
|
|
493
518
|
if (options.rollback) {
|
|
@@ -502,7 +527,7 @@ export async function updateCommand(options) {
|
|
|
502
527
|
// Handle --plan option (DSR dry-run). Nothing below this line writes.
|
|
503
528
|
if (options.plan) {
|
|
504
529
|
if (!scopedToSkills && !scopedToCommands) {
|
|
505
|
-
await handlePlan(projectPath, options, manifest);
|
|
530
|
+
await handlePlan(projectPath, options, manifest, addStandards);
|
|
506
531
|
}
|
|
507
532
|
if (scopedToSkills) await planSkills(projectPath, manifest, options);
|
|
508
533
|
if (scopedToCommands) await planCommands(projectPath, manifest, options);
|
|
@@ -515,10 +540,10 @@ export async function updateCommand(options) {
|
|
|
515
540
|
// files only when the manifest records them, so `--skills` is not redundant.
|
|
516
541
|
if (options.apply || options.force) {
|
|
517
542
|
if (!scopedToSkills && !scopedToCommands) {
|
|
518
|
-
await handleReconcile(projectPath, options, { force: !!options.force });
|
|
543
|
+
await handleReconcile(projectPath, options, { force: !!options.force, addStandards });
|
|
519
544
|
return;
|
|
520
545
|
}
|
|
521
|
-
await handleReconcile(projectPath, options, { force: !!options.force });
|
|
546
|
+
await handleReconcile(projectPath, options, { force: !!options.force, addStandards });
|
|
522
547
|
// These exit the process on completion, so run Skills last.
|
|
523
548
|
if (scopedToCommands) await updateCommandsOnly(projectPath, manifest, options);
|
|
524
549
|
if (scopedToSkills) await updateSkillsOnly(projectPath, manifest, options);
|
|
@@ -600,6 +625,15 @@ export async function updateCommand(options) {
|
|
|
600
625
|
// definition — telling them to run `uds update --prune` and then returning
|
|
601
626
|
// before anything is examined is how the complaint became unclearable.
|
|
602
627
|
const retiredOnLatest = pruneRetiredHashes(manifest, projectPath);
|
|
628
|
+
// XSPEC-454 R2: skill records UDS never owned go the same way (an up-to-date adopter is exactly the
|
|
629
|
+
// one who has nothing else to trigger the correction).
|
|
630
|
+
const foreignSkillsOnLatest = pruneForeignSkillHashes(manifest);
|
|
631
|
+
const foreignCommandsOnLatest = pruneForeignCommandHashes(manifest);
|
|
632
|
+
// XSPEC-456 R4: and the skill / command NAME lists (same reason).
|
|
633
|
+
const namesOnLatestBefore = (manifest.skills?.names?.length ?? 0) + (manifest.commands?.names?.length ?? 0);
|
|
634
|
+
pruneForeignSkillNames(manifest, projectPath);
|
|
635
|
+
pruneForeignCommandNames(manifest, projectPath);
|
|
636
|
+
const foreignNamesOnLatest = namesOnLatestBefore - (manifest.skills?.names?.length ?? 0) - (manifest.commands?.names?.length ?? 0);
|
|
603
637
|
if (retiredOnLatest.length > 0) {
|
|
604
638
|
console.log();
|
|
605
639
|
console.log(chalk.gray(
|
|
@@ -608,6 +642,27 @@ export async function updateCommand(options) {
|
|
|
608
642
|
for (const path of retiredOnLatest) {
|
|
609
643
|
console.log(chalk.gray(` - ${path}`));
|
|
610
644
|
}
|
|
645
|
+
}
|
|
646
|
+
if (foreignSkillsOnLatest.length > 0) {
|
|
647
|
+
console.log();
|
|
648
|
+
console.log(chalk.gray(
|
|
649
|
+
` ${(msg.droppedForeignSkillHashes || 'Dropped {count} skill record(s) that do not describe files UDS installed.').replace('{count}', foreignSkillsOnLatest.length)}`
|
|
650
|
+
));
|
|
651
|
+
}
|
|
652
|
+
if (foreignCommandsOnLatest.length > 0) {
|
|
653
|
+
console.log();
|
|
654
|
+
console.log(chalk.gray(
|
|
655
|
+
` ${(msg.droppedForeignCommandHashes || 'Dropped {count} command record(s) for commands UDS does not ship.').replace('{count}', foreignCommandsOnLatest.length)}`
|
|
656
|
+
));
|
|
657
|
+
}
|
|
658
|
+
if (foreignNamesOnLatest > 0) {
|
|
659
|
+
console.log();
|
|
660
|
+
console.log(chalk.gray(
|
|
661
|
+
` ${(msg.droppedForeignNames || 'Dropped {count} skill/command name(s) from the manifest that UDS does not ship or that are not installed.').replace('{count}', foreignNamesOnLatest)}`
|
|
662
|
+
));
|
|
663
|
+
}
|
|
664
|
+
if (retiredOnLatest.length > 0 || foreignSkillsOnLatest.length > 0 || foreignCommandsOnLatest.length > 0
|
|
665
|
+
|| foreignNamesOnLatest > 0) {
|
|
611
666
|
writeManifest(manifest, projectPath);
|
|
612
667
|
}
|
|
613
668
|
|
|
@@ -719,7 +774,8 @@ export async function updateCommand(options) {
|
|
|
719
774
|
// Update extensions (skip non-string entries like custom-domain objects)
|
|
720
775
|
for (const ext of manifest.extensions) {
|
|
721
776
|
if (typeof ext !== 'string') continue;
|
|
722
|
-
|
|
777
|
+
// Package-only: an extension is never downloaded (XSPEC-452 R2).
|
|
778
|
+
const result = await copyExtension(ext, '.standards', projectPath);
|
|
723
779
|
if (result.success) {
|
|
724
780
|
results.updated.push(ext);
|
|
725
781
|
recordWritten(result);
|
|
@@ -1119,7 +1175,7 @@ export async function updateCommand(options) {
|
|
|
1119
1175
|
manifest.options.coverage_model = manifest.options.coverage_model || 'full-coverage';
|
|
1120
1176
|
console.log();
|
|
1121
1177
|
console.log(chalk.yellow(msg.testParadigmMigrated || '⚠ Testing paradigm migrated: pyramid thresholds (UT≥80%/IT≥70%) → behavior-completeness full coverage (XSPEC-178)'));
|
|
1122
|
-
console.log(chalk.cyan(msg.testParadigmNote || ' full-coverage-testing.ai.yaml installed. Review scripts/check-stubs.
|
|
1178
|
+
console.log(chalk.cyan(msg.testParadigmNote || ' full-coverage-testing.ai.yaml installed. Review scripts/check-stubs.mjs and scripts/check-anti-fake-tests.mjs in your project (`uds update` offers to write them).'));
|
|
1123
1179
|
}
|
|
1124
1180
|
|
|
1125
1181
|
// Update manifest
|
|
@@ -1611,23 +1667,11 @@ export async function updateCommand(options) {
|
|
|
1611
1667
|
console.log(chalk.gray(` ${msg.updateViaMarketplace}`));
|
|
1612
1668
|
console.log(chalk.gray(` • ${msg.autoUpdate}`));
|
|
1613
1669
|
console.log(chalk.gray(` • ${msg.manualUpdate}`));
|
|
1614
|
-
} else if (location === 'user') {
|
|
1615
|
-
console.log(chalk.yellow(` ${msg.manualInstallDeprecated}`));
|
|
1616
|
-
console.log(chalk.gray(` ${msg.recommendedMigrate}`));
|
|
1617
|
-
console.log(chalk.gray(' /plugin add https://github.com/anthropics/claude-code-plugins/blob/main/skills/universal-dev-standards.md'));
|
|
1618
|
-
console.log(chalk.gray(` ${msg.orUpdateManually}`));
|
|
1619
|
-
console.log(chalk.gray(' cd ~/.claude/skills/universal-dev-standards && git pull'));
|
|
1620
|
-
} else if (location === 'project') {
|
|
1621
|
-
console.log(chalk.yellow(` ${msg.manualInstallDeprecated}`));
|
|
1622
|
-
console.log(chalk.gray(` ${msg.recommendedMigrate}`));
|
|
1623
|
-
console.log(chalk.gray(' /plugin add https://github.com/anthropics/claude-code-plugins/blob/main/skills/universal-dev-standards.md'));
|
|
1624
|
-
console.log(chalk.gray(` ${msg.orUpdateManually}`));
|
|
1625
|
-
console.log(chalk.gray(' cd .claude/skills/universal-dev-standards && git pull'));
|
|
1626
1670
|
} else {
|
|
1627
|
-
//
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
console.log(chalk.gray(
|
|
1671
|
+
// XSPEC-462 R1: project level, user level or not known: one way to update them. This used to call
|
|
1672
|
+
// them "deprecated" and point at a generic plugin URL and a `git pull` in the skills folder; neither
|
|
1673
|
+
// is how UDS installs or updates skills (`uds update --apply --skills` is).
|
|
1674
|
+
console.log(chalk.gray(` ${msg.skillsUpdateCommand}`));
|
|
1631
1675
|
}
|
|
1632
1676
|
}
|
|
1633
1677
|
}
|
|
@@ -1637,6 +1681,9 @@ export async function updateCommand(options) {
|
|
|
1637
1681
|
// 錯誤訊息單一出口閘門:問過才寫,而且從不覆寫。
|
|
1638
1682
|
await offerErrorExitGate(projectPath, options);
|
|
1639
1683
|
|
|
1684
|
+
// 假測試與空殼掃描(XSPEC-444 R5):同樣問過才寫、從不覆寫。
|
|
1685
|
+
await offerTestQualityGates(projectPath, options);
|
|
1686
|
+
|
|
1640
1687
|
// Exit explicitly to prevent hanging.
|
|
1641
1688
|
// T11: a partial update exits non-zero so CI / scripts can detect the failure.
|
|
1642
1689
|
process.exit(updateIncomplete ? 1 : 0);
|
|
@@ -1660,29 +1707,71 @@ async function offerErrorExitGate(projectPath, options) {
|
|
|
1660
1707
|
const src = join(getRepoRoot(), 'templates', 'gates', 'check-error-exit.mjs');
|
|
1661
1708
|
if (!existsSync(src)) return; // 範本沒出貨——沉默,不要假裝提供了
|
|
1662
1709
|
|
|
1663
|
-
|
|
1664
|
-
console.log(chalk.
|
|
1665
|
-
console.log(chalk.gray(
|
|
1666
|
-
console.log(chalk.gray(
|
|
1667
|
-
console.log(chalk.gray('
|
|
1668
|
-
console.log(chalk.gray(
|
|
1710
|
+
const m = t().commands.update.errorExitOffer;
|
|
1711
|
+
console.log(chalk.bold(m.title));
|
|
1712
|
+
console.log(chalk.gray(m.guards));
|
|
1713
|
+
console.log(chalk.gray(m.drift));
|
|
1714
|
+
console.log(chalk.gray(m.willWrite.replace('{kb}', String(Math.round(readFileSync(src, 'utf-8').length / 1024)))));
|
|
1715
|
+
console.log(chalk.gray(m.exit2a));
|
|
1716
|
+
console.log(chalk.gray(m.exit2b));
|
|
1669
1717
|
console.log();
|
|
1670
1718
|
|
|
1671
1719
|
const ok = await confirmOrFail({
|
|
1672
|
-
message:
|
|
1720
|
+
message: m.question,
|
|
1673
1721
|
defaultValue: false, // 🔴 預設不寫。沉默不是同意。
|
|
1674
1722
|
options
|
|
1675
1723
|
});
|
|
1676
1724
|
if (!ok) {
|
|
1677
|
-
console.log(chalk.gray(
|
|
1725
|
+
console.log(chalk.gray(m.skipped));
|
|
1678
1726
|
console.log();
|
|
1679
1727
|
return;
|
|
1680
1728
|
}
|
|
1681
1729
|
|
|
1682
1730
|
mkdirSync(dirname(dest), { recursive: true });
|
|
1683
1731
|
writeFileSync(dest, readFileSync(src, 'utf-8'), 'utf-8');
|
|
1684
|
-
console.log(chalk.green(
|
|
1685
|
-
console.log(chalk.gray(
|
|
1732
|
+
console.log(chalk.green(m.written));
|
|
1733
|
+
console.log(chalk.gray(m.next));
|
|
1734
|
+
console.log();
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* Offer the fake-test and stub scanners to an EXISTING installation.
|
|
1739
|
+
* // implements XSPEC-444 R5
|
|
1740
|
+
*
|
|
1741
|
+
* `uds init` writes them for a new project. A project initialised before that has the
|
|
1742
|
+
* full-coverage-testing standard — which asks for these two scripts — but never received them.
|
|
1743
|
+
* Writing files into a repository nobody asked us to touch is a trust problem, so this shows
|
|
1744
|
+
* what is about to be written, asks (default: no), and never overwrites a file that exists.
|
|
1745
|
+
*/
|
|
1746
|
+
async function offerTestQualityGates(projectPath, options) {
|
|
1747
|
+
if (!gateStandardInstalled(projectPath)) return;
|
|
1748
|
+
const wanted = GATE_SCRIPTS.filter(({ file }) => !existsSync(join(projectPath, 'scripts', file)));
|
|
1749
|
+
if (wanted.length === 0) return;
|
|
1750
|
+
const available = wanted.filter(({ file }) => existsSync(join(getRepoRoot(), 'templates', 'gates', file)));
|
|
1751
|
+
if (available.length === 0) return; // templates not shipped in this package — stay silent, do not pretend
|
|
1752
|
+
|
|
1753
|
+
console.log(chalk.bold(' Fake-test and stub scanners'));
|
|
1754
|
+
console.log(chalk.gray(' The full-coverage-testing standard asks for these scripts; this project does not have them yet:'));
|
|
1755
|
+
for (const { file, what } of available) console.log(chalk.gray(` - scripts/${file} (finds ${what})`));
|
|
1756
|
+
console.log(chalk.gray(' Pure Node, no dependencies. `uds check` runs them and prints what they find as a WARNING;'));
|
|
1757
|
+
console.log(chalk.gray(' nothing is blocked unless you set "mode": "block" in .standards/test-policy.json.'));
|
|
1758
|
+
console.log();
|
|
1759
|
+
|
|
1760
|
+
const ok = await confirmOrFail({
|
|
1761
|
+
message: 'Write these scripts into scripts/ ?',
|
|
1762
|
+
defaultValue: false, // silence is not consent
|
|
1763
|
+
options
|
|
1764
|
+
});
|
|
1765
|
+
if (!ok) {
|
|
1766
|
+
console.log(chalk.gray(' Skipped. `uds check` will mention it again, but never writes them on its own.'));
|
|
1767
|
+
console.log();
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
const recorder = newRecorder();
|
|
1771
|
+
const result = installGateScripts(projectPath, recorder);
|
|
1772
|
+
persistRecorder(projectPath, recorder);
|
|
1773
|
+
for (const rel of result.written) console.log(chalk.green(` ✓ ${rel}`));
|
|
1774
|
+
for (const rel of result.kept) console.log(chalk.gray(` · ${rel} already exists — kept as is`));
|
|
1686
1775
|
console.log();
|
|
1687
1776
|
}
|
|
1688
1777
|
|
|
@@ -1827,6 +1916,136 @@ async function switchClaudeTarget(projectPath, manifest, target, options) { // e
|
|
|
1827
1916
|
* @param {Object} manifest - Manifest object (will be mutated with updated hashes)
|
|
1828
1917
|
* @returns {{success: boolean, updated: string[], errors: string[]}}
|
|
1829
1918
|
*/
|
|
1919
|
+
/**
|
|
1920
|
+
* Swap the pre-commit line an older UDS wrote (`npx` + the bare name `uds`) for
|
|
1921
|
+
* the block current UDS writes, and say what was done or why not.
|
|
1922
|
+
*
|
|
1923
|
+
* Runs in every `uds update` mode that is not narrowed to something else, and in
|
|
1924
|
+
* `--with-hooks`, and it runs BEFORE the "already up to date" early return: an
|
|
1925
|
+
* adopter whose standards are current is exactly the one still carrying the old
|
|
1926
|
+
* line. Under `--plan` it reports and writes nothing.
|
|
1927
|
+
*
|
|
1928
|
+
* Only a line UDS can be shown to have written is changed (exact match under
|
|
1929
|
+
* UDS's marker comment — see legacy-hook-migration.js); any other bare-name line
|
|
1930
|
+
* is reported with its line number and left alone.
|
|
1931
|
+
*
|
|
1932
|
+
* @param {string} projectPath
|
|
1933
|
+
* @param {object} manifest - mutated only to carry a refreshed install record
|
|
1934
|
+
* @param {{plan?: boolean}} [opts]
|
|
1935
|
+
* @returns {ReturnType<typeof migrateLegacyHuskyHook>}
|
|
1936
|
+
*/
|
|
1937
|
+
export function migrateLegacyPreCommitHook(projectPath, manifest, { plan = false } = {}) {
|
|
1938
|
+
const msg = t().commands.update;
|
|
1939
|
+
const r = migrateLegacyHuskyHook(projectPath, { plan, manifest });
|
|
1940
|
+
if (r.state === 'error') {
|
|
1941
|
+
console.log(chalk.yellow(` ${msg.hookMigrateFailed.replace('{error}', r.error)}`));
|
|
1942
|
+
console.log();
|
|
1943
|
+
return r;
|
|
1944
|
+
}
|
|
1945
|
+
if (r.state === 'migrated') console.log(chalk.green(` ${msg.hookMigrated}`));
|
|
1946
|
+
if (r.state === 'would-migrate') console.log(chalk.cyan(` ${msg.hookWouldMigrate}`));
|
|
1947
|
+
for (const k of r.kept) {
|
|
1948
|
+
console.log(chalk.yellow(` ${msg.hookLegacyKept.replace('{line}', k.line).replace('{text}', k.text)}`));
|
|
1949
|
+
}
|
|
1950
|
+
if (r.state !== 'none') console.log();
|
|
1951
|
+
if (r.recorder) {
|
|
1952
|
+
persistRecorder(projectPath, r.recorder);
|
|
1953
|
+
// The manifest object is written again later in most update paths; without
|
|
1954
|
+
// this the record persisted just above would be overwritten by the older copy.
|
|
1955
|
+
Object.assign(manifest, mergeRecorderInto(manifest, r.recorder));
|
|
1956
|
+
}
|
|
1957
|
+
return r;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
/**
|
|
1961
|
+
* `uds update --with-hooks [--ai-tool <list>] [--plan] [--force]`
|
|
1962
|
+
*
|
|
1963
|
+
* Adds the enforcement hooks that are missing; a hook that is already there is not
|
|
1964
|
+
* touched, and the adopter's own hooks are never touched (see installMissingHooks).
|
|
1965
|
+
* Exit code 1 only when there is no hook-capable tool to act on, or an install failed:
|
|
1966
|
+
* "nothing to do" is 0, "could not tell which tool" is not.
|
|
1967
|
+
*
|
|
1968
|
+
* @param {string} projectPath
|
|
1969
|
+
* @param {object} manifest
|
|
1970
|
+
* @param {{ plan?: boolean, force?: boolean, aiTool?: string, yes?: boolean }} options
|
|
1971
|
+
* @returns {Promise<void>}
|
|
1972
|
+
*/
|
|
1973
|
+
export async function updateHooksOnly(projectPath, manifest, options = {}) {
|
|
1974
|
+
const ignored = ['skills', 'commands', 'syncRefs', 'integrationsOnly', 'standardsOnly', 'apply', 'rollback', 'prune']
|
|
1975
|
+
.filter((k) => options[k]).map((k) => `--${k.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase())}`);
|
|
1976
|
+
if (ignored.length) {
|
|
1977
|
+
console.log(chalk.yellow(` ! --with-hooks does one thing and does not compose; ${ignored.join(', ')} ignored.`));
|
|
1978
|
+
console.log();
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
// The hook lines UDS wrote in the past belong to this command's subject too.
|
|
1982
|
+
migrateLegacyPreCommitHook(projectPath, manifest, { plan: !!options.plan });
|
|
1983
|
+
|
|
1984
|
+
const capable = HOOK_CAPABLE_TOOLS.join(', ');
|
|
1985
|
+
const resolved = resolveHookTools(projectPath, manifest, { aiTool: options.aiTool });
|
|
1986
|
+
|
|
1987
|
+
if (resolved.unknown.length) {
|
|
1988
|
+
console.log(chalk.red(` ✗ No hook installer for: ${resolved.unknown.join(', ')}`));
|
|
1989
|
+
console.log(chalk.gray(` Tools with hooks: ${capable}`));
|
|
1990
|
+
console.log();
|
|
1991
|
+
process.exitCode = 1;
|
|
1992
|
+
return;
|
|
1993
|
+
}
|
|
1994
|
+
if (resolved.tools.length === 0) {
|
|
1995
|
+
// Both non-interactive and interactive get the same message: there is no prompt to
|
|
1996
|
+
// fall back to here, so the way to say which tool is spelled out instead.
|
|
1997
|
+
console.log(chalk.yellow(' ⚠ Could not tell which AI tool to install hooks for.'));
|
|
1998
|
+
console.log(chalk.gray(' Neither this project\'s manifest nor its files name one of: ' + capable + '.'));
|
|
1999
|
+
console.log(chalk.gray(' Say which one: uds update --with-hooks --ai-tool <tool>[,<tool>...]'));
|
|
2000
|
+
console.log(chalk.gray(' e.g. uds update --with-hooks --ai-tool antigravity'));
|
|
2001
|
+
console.log(chalk.gray(' What is detected: claude-code (.claude/ or CLAUDE.md) · codex (root AGENTS.md) · gemini-cli (GEMINI.md)'));
|
|
2002
|
+
console.log(chalk.gray(' antigravity (.agents/AGENTS.md, .agents/rules/, .agents/workflows/, .agents/plugins/ or .agents/hooks.json; .agents/skills/ is shared with Codex and does not count)'));
|
|
2003
|
+
console.log();
|
|
2004
|
+
process.exitCode = 1;
|
|
2005
|
+
return;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
console.log(chalk.bold(options.plan ? 'Hooks — plan (nothing is written)' : 'Hooks'));
|
|
2009
|
+
for (const tool of resolved.tools) {
|
|
2010
|
+
console.log(chalk.gray(` ${tool}: ${resolved.sources[tool].join(', ')}`));
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
const { results, scripts, artifacts } = installMissingHooks(projectPath, resolved.tools, {
|
|
2014
|
+
plan: !!options.plan,
|
|
2015
|
+
overwriteScripts: !!options.force,
|
|
2016
|
+
});
|
|
2017
|
+
|
|
2018
|
+
// Record what was just written (hook scripts, and folders UDS had to create) in
|
|
2019
|
+
// the manifest, so `uds uninstall` can remove exactly that. Never on --plan: a
|
|
2020
|
+
// plan writes nothing, and the recorder is empty then anyway.
|
|
2021
|
+
if (!options.plan) persistRecorder(projectPath, artifacts);
|
|
2022
|
+
|
|
2023
|
+
let failed = false;
|
|
2024
|
+
for (const r of results) {
|
|
2025
|
+
const rel = r.path ? relative(projectPath, r.path) || r.path : '';
|
|
2026
|
+
if (r.outcome === 'installed') console.log(chalk.green(` ✓ ${r.tool}: installed${r.repaired ? ' (replaced an out-of-date UDS entry)' : ''} — ${rel}`));
|
|
2027
|
+
else if (r.outcome === 'would-install') console.log(chalk.cyan(` + ${r.tool}: would install${r.repaired ? ' (replacing an out-of-date UDS entry)' : ''} — ${rel}`));
|
|
2028
|
+
else if (r.outcome === 'unchanged') console.log(chalk.gray(` · ${r.tool}: already installed, not touched — ${rel}`));
|
|
2029
|
+
else { failed = true; console.log(chalk.yellow(` ⚠ ${r.tool}: not installed — ${r.why}`)); }
|
|
2030
|
+
}
|
|
2031
|
+
const installedAny = results.some((r) => r.outcome === 'installed' || r.outcome === 'would-install');
|
|
2032
|
+
if (installedAny && scripts.kept.length) {
|
|
2033
|
+
console.log(chalk.yellow(` ! ${scripts.kept.length} hook script(s) in scripts/hooks/ differ from this UDS version and were kept: ${scripts.kept.slice(0, 5).join(', ')}${scripts.kept.length > 5 ? ', ...' : ''}`));
|
|
2034
|
+
console.log(chalk.gray(' Add --force to overwrite them with the shipped versions.'));
|
|
2035
|
+
}
|
|
2036
|
+
if (results.some((r) => r.tool === 'antigravity' && r.outcome === 'installed')) {
|
|
2037
|
+
console.log(chalk.yellow(' ⚠ Verified against a real agy session for a single turn without tool calls in `agy -p` mode only; multi-turn, tool-call turns and interactive mode are not yet verified.'));
|
|
2038
|
+
}
|
|
2039
|
+
if (results.some((r) => r.tool === 'codex' && r.outcome === 'installed')) {
|
|
2040
|
+
console.log(chalk.yellow(' ⚠ Codex will not run it until you trust it: open Codex in this project, trust the project, then run /hooks and trust this hook.'));
|
|
2041
|
+
}
|
|
2042
|
+
if (!results.some((r) => r.outcome === 'installed' || r.outcome === 'would-install')) {
|
|
2043
|
+
console.log(chalk.gray(' Nothing to add.'));
|
|
2044
|
+
}
|
|
2045
|
+
console.log();
|
|
2046
|
+
if (failed) process.exitCode = 1;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
1830
2049
|
export function regenerateIntegrations(projectPath, manifest) {
|
|
1831
2050
|
const aiTools = manifest.aiTools || [];
|
|
1832
2051
|
|
|
@@ -2650,6 +2869,16 @@ async function updateSkillsOnly(projectPath, manifest, options) {
|
|
|
2650
2869
|
return;
|
|
2651
2870
|
}
|
|
2652
2871
|
|
|
2872
|
+
// XSPEC-454 R1: this step writes outside the reconciler, so it takes its own rollback point — the skill
|
|
2873
|
+
// folders UDS ships, in each project-level skills folder (new ones are created, old ones rewritten, and
|
|
2874
|
+
// `.manifest.json` replaced), and nothing else: the adopter's own skills are not UDS's to roll back.
|
|
2875
|
+
// No backup, no write: an install that cannot be undone must not start.
|
|
2876
|
+
const skillsBackup = takeStepBackup(projectPath, 'skills', fileBasedInstallations, 'skills');
|
|
2877
|
+
if (!skillsBackup.ok) {
|
|
2878
|
+
process.exit(1);
|
|
2879
|
+
return;
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2653
2882
|
const spinner = createSpinner(msg.installingSkills || 'Installing Skills...').start();
|
|
2654
2883
|
|
|
2655
2884
|
const skillsLocaleForUpdate = resolveLocale(manifest, projectPath, options);
|
|
@@ -2695,6 +2924,18 @@ async function updateSkillsOnly(projectPath, manifest, options) {
|
|
|
2695
2924
|
if (!manifest.skillHashes) manifest.skillHashes = {};
|
|
2696
2925
|
Object.assign(manifest.skillHashes, result.allFileHashes);
|
|
2697
2926
|
}
|
|
2927
|
+
// XSPEC-454 R2: and forget the records that were never UDS's (the manifest this merges into
|
|
2928
|
+
// may come from an installer that hashed the whole skills folder).
|
|
2929
|
+
pruneForeignSkillHashes(manifest);
|
|
2930
|
+
// XSPEC-456 R4: and the names UDS cannot vouch for (not shipped, or not on disk where installed).
|
|
2931
|
+
const skillNamesBefore = manifest.skills.names.length;
|
|
2932
|
+
pruneForeignSkillNames(manifest, projectPath, { checkDisk: true });
|
|
2933
|
+
const droppedSkillNames = skillNamesBefore - manifest.skills.names.length;
|
|
2934
|
+
if (droppedSkillNames > 0) {
|
|
2935
|
+
console.log(chalk.gray(
|
|
2936
|
+
` ${(msg.droppedForeignNames || 'Dropped {count} skill/command name(s) from the manifest that UDS does not ship or that are not installed.').replace('{count}', droppedSkillNames)}`
|
|
2937
|
+
));
|
|
2938
|
+
}
|
|
2698
2939
|
|
|
2699
2940
|
// 🔴 Re-read before writing. `manifest` was loaded at the top of the update
|
|
2700
2941
|
// command, BEFORE the reconciler ran; the reconciler writes its own copy to
|
|
@@ -2716,8 +2957,12 @@ async function updateSkillsOnly(projectPath, manifest, options) {
|
|
|
2716
2957
|
freshForSkills.skills = manifest.skills;
|
|
2717
2958
|
freshForSkills.skillHashes = manifest.skillHashes;
|
|
2718
2959
|
writeManifest(freshForSkills, projectPath);
|
|
2960
|
+
finishStepBackup(projectPath, skillsBackup);
|
|
2719
2961
|
|
|
2720
2962
|
console.log();
|
|
2963
|
+
// XSPEC-465 R1: a personal skill with the same name as one of the UDS skills just written wins silently.
|
|
2964
|
+
// Information only: it does not change what was installed or the exit code.
|
|
2965
|
+
printSkillNameCollisionWarning(projectPath);
|
|
2721
2966
|
process.exit(0);
|
|
2722
2967
|
}
|
|
2723
2968
|
|
|
@@ -2774,6 +3019,13 @@ async function updateCommandsOnly(projectPath, manifest, options) {
|
|
|
2774
3019
|
}
|
|
2775
3020
|
console.log();
|
|
2776
3021
|
|
|
3022
|
+
// XSPEC-454 R1: same as the Skills step — a rollback point first, and no write without one.
|
|
3023
|
+
const commandsBackup = takeStepBackup(projectPath, 'commands', commandsInstallations, 'commands');
|
|
3024
|
+
if (!commandsBackup.ok) {
|
|
3025
|
+
process.exit(1);
|
|
3026
|
+
return;
|
|
3027
|
+
}
|
|
3028
|
+
|
|
2777
3029
|
const spinner = createSpinner(msg.installingCommands || 'Installing commands...').start();
|
|
2778
3030
|
|
|
2779
3031
|
const commandsLocale = resolveLocale(manifest, projectPath, options);
|
|
@@ -2794,9 +3046,8 @@ async function updateCommandsOnly(projectPath, manifest, options) {
|
|
|
2794
3046
|
}).join(', ');
|
|
2795
3047
|
|
|
2796
3048
|
if (result.totalErrors === 0) {
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
.replace('{locations}', locations));
|
|
3049
|
+
// XSPEC-454 R4: tools and commands are different numbers; see commandsUpdatedMessage.
|
|
3050
|
+
spinner.succeed(commandsUpdatedMessage(msg, commandsInstallations, result, locations));
|
|
2800
3051
|
} else {
|
|
2801
3052
|
spinner.warn((msg.commandsUpdatedWithErrors || 'Updated commands with {errors} errors')
|
|
2802
3053
|
.replace('{errors}', result.totalErrors));
|
|
@@ -2821,6 +3072,17 @@ async function updateCommandsOnly(projectPath, manifest, options) {
|
|
|
2821
3072
|
if (!manifest.commandHashes) manifest.commandHashes = {};
|
|
2822
3073
|
replaceCommandHashesForUpdatedAgents(manifest.commandHashes, result.allFileHashes);
|
|
2823
3074
|
}
|
|
3075
|
+
// XSPEC-454 R2: and forget command records for commands UDS does not ship.
|
|
3076
|
+
pruneForeignCommandHashes(manifest);
|
|
3077
|
+
// XSPEC-456 R4: same for the command names.
|
|
3078
|
+
const commandNamesBefore = manifest.commands.names.length;
|
|
3079
|
+
pruneForeignCommandNames(manifest, projectPath, { checkDisk: true });
|
|
3080
|
+
const droppedCommandNames = commandNamesBefore - manifest.commands.names.length;
|
|
3081
|
+
if (droppedCommandNames > 0) {
|
|
3082
|
+
console.log(chalk.gray(
|
|
3083
|
+
` ${(msg.droppedForeignNames || 'Dropped {count} skill/command name(s) from the manifest that UDS does not ship or that are not installed.').replace('{count}', droppedCommandNames)}`
|
|
3084
|
+
));
|
|
3085
|
+
}
|
|
2824
3086
|
|
|
2825
3087
|
// 🔴 Re-read before writing. `manifest` was loaded at the top of the update
|
|
2826
3088
|
// command, BEFORE the reconciler ran; the reconciler writes its own copy to
|
|
@@ -2844,6 +3106,7 @@ async function updateCommandsOnly(projectPath, manifest, options) {
|
|
|
2844
3106
|
freshForCommands.commands = manifest.commands;
|
|
2845
3107
|
freshForCommands.commandHashes = manifest.commandHashes;
|
|
2846
3108
|
writeManifest(freshForCommands, projectPath);
|
|
3109
|
+
finishStepBackup(projectPath, commandsBackup);
|
|
2847
3110
|
|
|
2848
3111
|
console.log();
|
|
2849
3112
|
process.exit(0);
|
|
@@ -3236,7 +3499,82 @@ async function promptNewFeatureInstallation(missingSkills, outdatedSkills, missi
|
|
|
3236
3499
|
// ─── DSR (Declarative State Reconciliation) Handlers ─────────────
|
|
3237
3500
|
|
|
3238
3501
|
/**
|
|
3239
|
-
*
|
|
3502
|
+
* Take the rollback point for a Skills/Commands step (XSPEC-454 R1).
|
|
3503
|
+
* Prints what it did; `ok: false` means the caller must not write anything.
|
|
3504
|
+
*/
|
|
3505
|
+
function takeStepBackup(projectPath, label, installations, kind) {
|
|
3506
|
+
const { paths, outside } = stepWritePaths(projectPath, installations, kind);
|
|
3507
|
+
const backup = createStepBackup(projectPath, { label, paths, notBackedUp: outside });
|
|
3508
|
+
if (backup.errors.length > 0) {
|
|
3509
|
+
console.log(chalk.red(`Could not take a backup before updating ${label}; nothing was changed.`));
|
|
3510
|
+
for (const err of backup.errors) console.log(chalk.red(` ${err}`));
|
|
3511
|
+
console.log();
|
|
3512
|
+
return { ok: false };
|
|
3513
|
+
}
|
|
3514
|
+
return { ok: true, backupId: backup.backupId, cleanup: cleanupBackupsQuietly(projectPath) };
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
/** The step is over (its last manifest write is done): record what it created, and say how to undo it. */
|
|
3518
|
+
function finishStepBackup(projectPath, backup) {
|
|
3519
|
+
finalizeBackup(projectPath, backup.backupId);
|
|
3520
|
+
printBackupLocation(backup.backupId);
|
|
3521
|
+
printBackupCleanup(backup.cleanup);
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
/**
|
|
3525
|
+
* Say where the backup is, how to undo, and what to exclude (XSPEC-456 R7). All backups share one folder,
|
|
3526
|
+
* `.uds-backups/`, so a tool that does not read .gitignore (an indexer, IDE search, grep) can be told to
|
|
3527
|
+
* skip a single name.
|
|
3528
|
+
*/
|
|
3529
|
+
function printBackupLocation(backupId) {
|
|
3530
|
+
console.log(chalk.gray(` Backup: ${backupId}`));
|
|
3531
|
+
console.log(chalk.gray(' Use `uds update --rollback` to undo.'));
|
|
3532
|
+
console.log(chalk.gray(' Tools that do not read .gitignore (indexers, IDE search, grep): exclude `.uds-backups`.'));
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
function cleanupBackupsQuietly(projectPath) {
|
|
3536
|
+
try {
|
|
3537
|
+
return cleanupBackups(projectPath);
|
|
3538
|
+
} catch {
|
|
3539
|
+
// an old backup that cannot be removed is not a reason to stop the update
|
|
3540
|
+
return null;
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
/**
|
|
3545
|
+
* Say what the backup limit did (XSPEC-475 R2). A backup is the adopter's data: one deleted without a word
|
|
3546
|
+
* is how an adopter loses the only copy of something version control cannot give back.
|
|
3547
|
+
* - every backup removed because `.uds-backups/` holds more than the limit is named;
|
|
3548
|
+
* - backups an older UDS left in the project root (`.uds-backup-*`) are never removed by the limit; they
|
|
3549
|
+
* are listed here with a suggestion to move them out themselves.
|
|
3550
|
+
* // implements XSPEC-475 R2
|
|
3551
|
+
*/
|
|
3552
|
+
function printBackupCleanup(cleanup) {
|
|
3553
|
+
if (!cleanup) return;
|
|
3554
|
+
const removed = cleanup.removed || [];
|
|
3555
|
+
const legacy = cleanup.legacyKept || [];
|
|
3556
|
+
if (removed.length > 0) {
|
|
3557
|
+
console.log(chalk.yellow(` Removed ${removed.length} old backup(s) beyond the limit of ${cleanup.keep} in .uds-backups/:`));
|
|
3558
|
+
for (const id of removed) console.log(chalk.yellow(` ✕ ${id}`));
|
|
3559
|
+
}
|
|
3560
|
+
for (const err of cleanup.errors || []) console.log(chalk.red(` ${err}`));
|
|
3561
|
+
if (legacy.length > 0) {
|
|
3562
|
+
console.log(chalk.yellow(` ${legacy.length} backup(s) from an older UDS are still in the project root and were NOT removed by the limit:`));
|
|
3563
|
+
for (const id of legacy) console.log(chalk.yellow(` - ${id}`));
|
|
3564
|
+
console.log(chalk.gray(' UDS never deletes these. If you need them, move them out of the project yourself (for example, to a folder outside the repository).'));
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
/** Print up to `limit` paths, then how many more. */
|
|
3569
|
+
function printPaths(prefix, paths, limit, colour) {
|
|
3570
|
+
for (const p of paths.slice(0, limit)) console.log(colour(` ${prefix} ${p}`));
|
|
3571
|
+
if (paths.length > limit) console.log(colour(` ${prefix} … and ${paths.length - limit} more`));
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
/**
|
|
3575
|
+
* Handle --rollback: undo the newest backup and every earlier one from the same unbroken series of UDS
|
|
3576
|
+
* updates, then say, item by item, what was restored, what was removed, and what was NOT put back.
|
|
3577
|
+
* It never ends in "successful" while any of those lists is not empty (XSPEC-454 R1).
|
|
3240
3578
|
*/
|
|
3241
3579
|
async function handleRollback(projectPath) {
|
|
3242
3580
|
const backups = listBackups(projectPath);
|
|
@@ -3247,22 +3585,46 @@ async function handleRollback(projectPath) {
|
|
|
3247
3585
|
}
|
|
3248
3586
|
|
|
3249
3587
|
const latest = backups[0];
|
|
3250
|
-
console.log(chalk.cyan(`Rolling back
|
|
3588
|
+
console.log(chalk.cyan(`Rolling back from: ${latest.backupId}`));
|
|
3251
3589
|
console.log(chalk.gray(` Created: ${latest.createdAt}`));
|
|
3252
|
-
console.log(chalk.gray(` Actions: ${latest.actionCount}`));
|
|
3253
3590
|
console.log();
|
|
3254
3591
|
|
|
3255
3592
|
const result = rollbackLast(projectPath);
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3593
|
+
|
|
3594
|
+
for (const step of result.steps || []) {
|
|
3595
|
+
console.log(chalk.cyan(`${step.backupId}${step.label ? ` (${step.label})` : ''}`));
|
|
3596
|
+
console.log(chalk.gray(` Restored ${step.restored.length} file(s), removed ${step.removed.length} file(s) the update had created.`));
|
|
3597
|
+
printPaths('←', step.restored, 12, chalk.gray);
|
|
3598
|
+
printPaths('✕', step.removed, 12, chalk.gray);
|
|
3599
|
+
}
|
|
3600
|
+
if (!result.steps) {
|
|
3601
|
+
// a rollbackLast that predates the step report
|
|
3602
|
+
printPaths('←', result.restored || [], 12, chalk.gray);
|
|
3603
|
+
}
|
|
3604
|
+
console.log();
|
|
3605
|
+
|
|
3606
|
+
if ((result.steps || []).length > 1) {
|
|
3607
|
+
console.log(chalk.gray(` ${result.steps.length} consecutive updates were undone together (each one started from where the previous one ended).`));
|
|
3608
|
+
}
|
|
3609
|
+
if (result.olderBackups > 0) {
|
|
3610
|
+
console.log(chalk.gray(` ${result.olderBackups} older backup(s) are not part of that series (something else changed the project in between) and were left alone.`));
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
if (result.errors.length > 0) {
|
|
3614
|
+
process.exitCode = 1;
|
|
3615
|
+
console.log(chalk.red('Rollback did NOT complete. The project may be in a mixed state:'));
|
|
3616
|
+
printPaths('✗', result.errors, 30, chalk.red);
|
|
3617
|
+
console.log(chalk.yellow(' What to do: fix the cause above (permissions, a locked file) and run `uds update --rollback` again —'));
|
|
3618
|
+
console.log(chalk.yellow(' it is safe to repeat. The backups are still in .uds-backups/ (and .uds-backup-* if an older UDS made them) if you need to copy files back by hand.'));
|
|
3619
|
+
}
|
|
3620
|
+
if ((result.notRestored || []).length > 0) {
|
|
3621
|
+
console.log(chalk.yellow('Not restored:'));
|
|
3622
|
+
printPaths('!', result.notRestored, 30, chalk.yellow);
|
|
3623
|
+
}
|
|
3624
|
+
if (result.errors.length === 0 && (result.notRestored || []).length === 0) {
|
|
3625
|
+
console.log(chalk.green(`Rollback successful. Restored ${result.restored.length} file(s), removed ${(result.removed || []).length}.`));
|
|
3626
|
+
} else if (result.errors.length === 0) {
|
|
3627
|
+
console.log(chalk.yellow('Rollback finished for everything inside this project, except the items listed above.'));
|
|
3266
3628
|
}
|
|
3267
3629
|
console.log();
|
|
3268
3630
|
}
|
|
@@ -3270,10 +3632,10 @@ async function handleRollback(projectPath) {
|
|
|
3270
3632
|
/**
|
|
3271
3633
|
* Handle --plan: show what the reconciler would do without executing.
|
|
3272
3634
|
*/
|
|
3273
|
-
async function handlePlan(projectPath, options, manifest) {
|
|
3635
|
+
async function handlePlan(projectPath, options, manifest, addStandards = []) {
|
|
3274
3636
|
const spinner = createSpinner('Calculating reconciliation plan...').start();
|
|
3275
3637
|
|
|
3276
|
-
const result = await reconcilerPlan(projectPath, { force: false });
|
|
3638
|
+
const result = await reconcilerPlan(projectPath, { force: false, addStandards });
|
|
3277
3639
|
|
|
3278
3640
|
spinner.stop();
|
|
3279
3641
|
|
|
@@ -3301,10 +3663,17 @@ async function handlePlan(projectPath, options, manifest) {
|
|
|
3301
3663
|
// the plan above were silently skipped; the files were still on disk
|
|
3302
3664
|
// afterwards. Nor is `--force` the answer for "apply what I just read": it
|
|
3303
3665
|
// recomputes with force:true, a larger plan that rewrites every managed file.
|
|
3304
|
-
|
|
3666
|
+
// A plan made with --add-standard is only applied exactly by an --apply that names the same standards.
|
|
3667
|
+
const addFlags = addStandards.map(id => ` --add-standard ${id}`).join('');
|
|
3668
|
+
console.log(chalk.gray(`Run \`uds update --apply${addFlags}\` to apply exactly these changes.`));
|
|
3305
3669
|
console.log(chalk.gray('Run `uds update --force` to rewrite every managed file (a larger plan than the one above).'));
|
|
3306
3670
|
console.log();
|
|
3307
3671
|
}
|
|
3672
|
+
|
|
3673
|
+
// XSPEC-458 R2: what UDS ships that this project does not have. Information only — it is printed after
|
|
3674
|
+
// the plan is final and nothing above reads it.
|
|
3675
|
+
printAvailableStandardsSection(result.manifest || manifest, { phase: 'plan' });
|
|
3676
|
+
console.log();
|
|
3308
3677
|
}
|
|
3309
3678
|
|
|
3310
3679
|
/**
|
|
@@ -3318,7 +3687,7 @@ async function handlePlan(projectPath, options, manifest) {
|
|
|
3318
3687
|
* @param {Object} options - Command options (uses `yes`)
|
|
3319
3688
|
* @param {{ force: boolean }} mode
|
|
3320
3689
|
*/
|
|
3321
|
-
async function handleReconcile(projectPath, options, { force }) {
|
|
3690
|
+
async function handleReconcile(projectPath, options, { force, addStandards = [] }) {
|
|
3322
3691
|
console.log(chalk.cyan(
|
|
3323
3692
|
force
|
|
3324
3693
|
? 'Running declarative state reconciliation (force mode)...'
|
|
@@ -3327,10 +3696,16 @@ async function handleReconcile(projectPath, options, { force }) {
|
|
|
3327
3696
|
console.log();
|
|
3328
3697
|
|
|
3329
3698
|
// First show the plan
|
|
3330
|
-
const planResult = await reconcilerPlan(projectPath, { force });
|
|
3699
|
+
const planResult = await reconcilerPlan(projectPath, { force, addStandards });
|
|
3331
3700
|
|
|
3332
3701
|
if (planResult.plan.actions.length === 0) {
|
|
3702
|
+
// XSPEC-454 R2: nothing to apply, but the manifest may still list skill files UDS never installed
|
|
3703
|
+
// (they only ever get corrected by a write, and an up-to-date project has none coming).
|
|
3704
|
+
const current = readManifest(projectPath);
|
|
3705
|
+
if (current && (pruneForeignSkillHashes(current).length + pruneForeignCommandHashes(current).length) > 0) writeManifest(current, projectPath);
|
|
3333
3706
|
console.log(chalk.green('Everything is up to date. No changes needed.'));
|
|
3707
|
+
// XSPEC-458 R2: "up to date" is about the files UDS manages; say what UDS ships that is not managed here.
|
|
3708
|
+
printAvailableStandardsSection(planResult.manifest, { phase: 'apply' });
|
|
3334
3709
|
console.log();
|
|
3335
3710
|
return;
|
|
3336
3711
|
}
|
|
@@ -3357,6 +3732,7 @@ async function handleReconcile(projectPath, options, { force }) {
|
|
|
3357
3732
|
const result = await reconcile(projectPath, {
|
|
3358
3733
|
force,
|
|
3359
3734
|
backup: true,
|
|
3735
|
+
addStandards,
|
|
3360
3736
|
onAction: (action, index, total) => {
|
|
3361
3737
|
spinner.text = `[${index + 1}/${total}] ${action.type} ${action.path || action.category}`;
|
|
3362
3738
|
}
|
|
@@ -3369,8 +3745,8 @@ async function handleReconcile(projectPath, options, { force }) {
|
|
|
3369
3745
|
}
|
|
3370
3746
|
|
|
3371
3747
|
if (result.execution?.backupId) {
|
|
3372
|
-
|
|
3373
|
-
|
|
3748
|
+
printBackupLocation(result.execution.backupId);
|
|
3749
|
+
printBackupCleanup(result.execution.backupCleanup);
|
|
3374
3750
|
}
|
|
3375
3751
|
|
|
3376
3752
|
if (result.errors.length > 0) {
|
|
@@ -3381,5 +3757,7 @@ async function handleReconcile(projectPath, options, { force }) {
|
|
|
3381
3757
|
}
|
|
3382
3758
|
}
|
|
3383
3759
|
|
|
3760
|
+
// XSPEC-458 R2: the count of what UDS ships and this project lacks, with the command that installs one.
|
|
3761
|
+
printAvailableStandardsSection(result.manifest || planResult.manifest, { phase: 'apply' });
|
|
3384
3762
|
console.log();
|
|
3385
3763
|
}
|