create-yss-spec 3.4.10 → 3.5.2
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 +8 -4
- package/package.json +1 -1
- package/src/api/_sync-service.js +141 -23
- package/src/cli/args.js +3 -0
- package/src/cli/help.js +14 -2
- package/src/cli/index.js +3 -0
- package/src/cli/prompts.js +5 -1
- package/src/cli/router.js +2 -0
- package/src/commands/attach.js +21 -5
- package/src/commands/diff.js +1 -0
- package/src/commands/doctor.js +1 -0
- package/src/commands/init.js +4 -1
- package/src/commands/skills.js +253 -0
- package/src/commands/sync.js +4 -0
- package/src/family-identity.js +2 -2
- package/src/template/asset-runtime.js +228 -0
- package/src/template/attach-planner.js +1 -1
- package/src/template/distribution-runtime.js +165 -0
- package/src/template/instance-runtime.js +76 -29
- package/src/template/layout-migration.js +160 -0
- package/src/template/migration-runtime.js +2 -2
- package/src/template/ownership-policy.js +17 -1
- package/src/template/prune-planner.js +6 -1
- package/src/template/sync-planner.js +4 -1
- package/src/template/verification-runtime.js +56 -1
- package/src/validation/metadata.js +24 -1
- package/template/.agents/rules/yss-ai-skills.md +1 -1
- package/template/.agents/skills/.strategic-design-skills-manifest.json +7 -8
- package/template/.agents/skills/.yss-skills-manifest.json +2 -2
- package/template/.agents/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.agents/skills/code-review/SKILL.md +6 -6
- package/template/.agents/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.agents/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.agents/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.agents/skills/llm-wiki/references/discover.md +3 -3
- package/template/.agents/skills/prototype-review/SKILL.md +4 -4
- package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.agents/skills/triage/SKILL.md +1 -1
- package/template/.agents/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.agents/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.agents/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.agents/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.agents/skills/yss-cache/SKILL.md +6 -5
- package/template/.agents/skills/yss-cache/references/annotations.md +3 -1
- package/template/.agents/skills/yss-cache/references/architecture.md +4 -2
- package/template/.agents/skills/yss-cache/references/configuration.md +6 -3
- package/template/.agents/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.agents/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.agents/skills/yss-cache/references/verification.md +10 -4
- package/template/.agents/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.agents/skills/yss-design-system/SKILL.md +10 -10
- package/template/.agents/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.agents/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.agents/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.agents/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.agents/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.agents/skills/yss-exception/SKILL.md +1 -1
- package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.agents/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.agents/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.agents/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.agents/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.agents/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.agents/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.agents/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.agents/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.agents/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.agents/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.agents/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.agents/skills/yss-repository/SKILL.md +3 -2
- package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.agents/skills/yss-research/SKILL.md +2 -2
- package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.agents/skills/yss-stage-decision/SKILL.md +5 -5
- package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.agents/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.agents/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.agents/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.agents/skills/yss-ui/SKILL.md +1 -1
- package/template/.agents/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.agents/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/.codex/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.codex/skills/code-review/SKILL.md +6 -6
- package/template/.codex/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.codex/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.codex/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.codex/skills/llm-wiki/references/discover.md +3 -3
- package/template/.codex/skills/prototype-review/SKILL.md +4 -4
- package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.codex/skills/triage/SKILL.md +1 -1
- package/template/.codex/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.codex/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.codex/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.codex/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.codex/skills/yss-cache/SKILL.md +6 -5
- package/template/.codex/skills/yss-cache/references/annotations.md +3 -1
- package/template/.codex/skills/yss-cache/references/architecture.md +4 -2
- package/template/.codex/skills/yss-cache/references/configuration.md +6 -3
- package/template/.codex/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.codex/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.codex/skills/yss-cache/references/verification.md +10 -4
- package/template/.codex/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.codex/skills/yss-design-system/SKILL.md +10 -10
- package/template/.codex/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.codex/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.codex/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.codex/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.codex/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.codex/skills/yss-exception/SKILL.md +1 -1
- package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.codex/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.codex/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.codex/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.codex/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.codex/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.codex/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.codex/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.codex/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.codex/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.codex/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.codex/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.codex/skills/yss-repository/SKILL.md +3 -2
- package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.codex/skills/yss-research/SKILL.md +2 -2
- package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.codex/skills/yss-stage-decision/SKILL.md +5 -5
- package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.codex/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.codex/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.codex/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.codex/skills/yss-ui/SKILL.md +1 -1
- package/template/.codex/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.codex/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.cursor/skills/code-review/SKILL.md +6 -6
- package/template/.cursor/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.cursor/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.cursor/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.cursor/skills/llm-wiki/references/discover.md +3 -3
- package/template/.cursor/skills/prototype-review/SKILL.md +4 -4
- package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.cursor/skills/triage/SKILL.md +1 -1
- package/template/.cursor/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursor/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.cursor/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.cursor/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.cursor/skills/yss-cache/SKILL.md +6 -5
- package/template/.cursor/skills/yss-cache/references/annotations.md +3 -1
- package/template/.cursor/skills/yss-cache/references/architecture.md +4 -2
- package/template/.cursor/skills/yss-cache/references/configuration.md +6 -3
- package/template/.cursor/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.cursor/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.cursor/skills/yss-cache/references/verification.md +10 -4
- package/template/.cursor/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.cursor/skills/yss-design-system/SKILL.md +10 -10
- package/template/.cursor/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.cursor/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.cursor/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.cursor/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.cursor/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.cursor/skills/yss-exception/SKILL.md +1 -1
- package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.cursor/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.cursor/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.cursor/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.cursor/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.cursor/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.cursor/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.cursor/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.cursor/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.cursor/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.cursor/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.cursor/skills/yss-repository/SKILL.md +3 -2
- package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.cursor/skills/yss-research/SKILL.md +2 -2
- package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.cursor/skills/yss-stage-decision/SKILL.md +5 -5
- package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.cursor/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.cursor/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
- package/template/.cursor/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.cursor/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursorrules +1 -1
- package/template/.pi/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.pi/skills/code-review/SKILL.md +6 -6
- package/template/.pi/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.pi/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.pi/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.pi/skills/llm-wiki/references/discover.md +3 -3
- package/template/.pi/skills/prototype-review/SKILL.md +4 -4
- package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.pi/skills/triage/SKILL.md +1 -1
- package/template/.pi/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.pi/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.pi/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.pi/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.pi/skills/yss-cache/SKILL.md +6 -5
- package/template/.pi/skills/yss-cache/references/annotations.md +3 -1
- package/template/.pi/skills/yss-cache/references/architecture.md +4 -2
- package/template/.pi/skills/yss-cache/references/configuration.md +6 -3
- package/template/.pi/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.pi/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.pi/skills/yss-cache/references/verification.md +10 -4
- package/template/.pi/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.pi/skills/yss-design-system/SKILL.md +10 -10
- package/template/.pi/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.pi/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.pi/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.pi/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.pi/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.pi/skills/yss-exception/SKILL.md +1 -1
- package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.pi/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.pi/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.pi/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.pi/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.pi/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.pi/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.pi/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.pi/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.pi/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.pi/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.pi/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.pi/skills/yss-repository/SKILL.md +3 -2
- package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.pi/skills/yss-research/SKILL.md +2 -2
- package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.pi/skills/yss-stage-decision/SKILL.md +5 -5
- package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.pi/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.pi/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.pi/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.pi/skills/yss-ui/SKILL.md +1 -1
- package/template/.pi/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.pi/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/{docs → .template-spec}/adr/README.md +1 -1
- package/template/{docs → .template-spec}/agents/README.md +1 -1
- package/template/{docs → .template-spec}/agents/backend-architecture-profiles.md +2 -2
- package/template/{docs → .template-spec}/agents/digital-human-roles.md +6 -6
- package/template/{docs → .template-spec}/agents/digital-human-roles.yaml +5 -5
- package/template/{docs → .template-spec}/agents/gitlab-workflow-skills.md +2 -2
- package/template/{docs → .template-spec}/agents/issue-tracker.md +1 -1
- package/template/{docs → .template-spec}/agents/skill-migrations.md +6 -2
- package/template/{docs → .template-spec}/agents/triage-labels.md +1 -1
- package/template/{docs → .template-spec}/agents/yss-skill-registry.yaml +9 -8
- package/template/{docs → .template-spec}/architecture/README.md +3 -3
- package/template/{docs → .template-spec}/architecture/templates/tech-design-template.md +3 -1
- package/template/{docs → .template-spec}/design/README.md +12 -12
- package/template/{docs → .template-spec}/design/design.md +20 -20
- package/template/{docs/design/templates/interaction-spec-template.md → .template-spec/design/templates/examples/model-publishing-interaction.example.md} +6 -4
- package/template/{docs/design/templates/state-matrix-template.md → .template-spec/design/templates/examples/model-publishing-state-matrix.example.md} +3 -1
- package/template/.template-spec/design/templates/interaction-spec-template.md +61 -0
- package/template/{docs → .template-spec}/design/templates/product-overview-design-template.md +11 -11
- package/template/{docs → .template-spec}/design/templates/prototype-evidence-template.yaml +4 -4
- package/template/{docs → .template-spec}/design/templates/prototype-review-checklist.md +1 -1
- package/template/.template-spec/design/templates/state-matrix-template.md +29 -0
- package/template/.template-spec/design/tokens/.design-md-projection.json +13 -0
- package/template/{docs → .template-spec}/engineering/backend-platforms.md +1 -1
- package/template/{docs → .template-spec}/plan/entry-review.md +8 -4
- package/template/{docs → .template-spec}/plan/templates/plan-template.md +1 -1
- package/template/{docs → .template-spec}/process/contract-reading.md +1 -1
- package/template/{docs → .template-spec}/process/lifecycle-artifact-map.md +5 -5
- package/template/.template-spec/process/lifecycle-registry-baseline.json +253 -0
- package/template/{docs → .template-spec}/process/lifecycle-registry.yaml +19 -12
- package/template/{docs → .template-spec}/process/plan-migration.md +1 -1
- package/template/{docs → .template-spec}/process/schemas/digital-human-task-package.schema.json +14 -1
- package/template/{docs → .template-spec}/process/schemas/lifecycle-checkpoint.schema.json +15 -0
- package/template/{docs → .template-spec}/process/schemas/lifecycle-registry.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v3.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v4.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v5.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff.schema.json +1 -1
- package/template/{docs → .template-spec}/process/stage-tracking.md +1 -1
- package/template/{docs → .template-spec}/process/subagent-collaboration.md +2 -2
- package/template/{docs → .template-spec}/templates/build-architecture-checklist-template.md +2 -2
- package/template/{docs → .template-spec}/templates/digital-human-runtime-profile-template.md +2 -2
- package/template/{docs → .template-spec}/templates/grok-bot-profile-template.md +1 -1
- package/template/{docs → .template-spec}/templates/local-parent-ticket-template.md +1 -1
- package/template/.template-spec/templates/release-note-template.md +29 -0
- package/template/.template-spec/templates/retro-report-template.md +24 -0
- package/template/{docs → .template-spec}/templates/subagent-task-package-template.md +3 -3
- package/template/.template-spec/templates/verification-record-template.md +64 -0
- package/template/{docs → .template-spec}/templates/vertical-slice-ticket-template.md +5 -10
- package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
- package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +4 -4
- package/template/AGENTS.md +12 -12
- package/template/CONTEXT.md +3 -3
- package/template/README.md +22 -25
- package/template/scripts/backend-delivery +1 -1
- package/template/scripts/design-md +2 -0
- package/template/scripts/lib/api-contract-decision.mjs +1 -1
- package/template/scripts/lib/approved-execution-context.mjs +5 -5
- package/template/scripts/lib/backend-delivery.mjs +4 -4
- package/template/scripts/lib/backend-platform.mjs +1 -1
- package/template/scripts/lib/backend-review.mjs +1 -1
- package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
- package/template/scripts/lib/backend-standards-coverage.mjs +2 -2
- package/template/scripts/lib/context-reconciliation.mjs +1 -1
- package/template/scripts/lib/contract-views.mjs +9 -9
- package/template/scripts/lib/delivery-preflight.mjs +6 -6
- package/template/scripts/lib/design-md.mjs +230 -0
- package/template/scripts/lib/digital-human-roles.mjs +2 -2
- package/template/scripts/lib/existing-backend-architecture.mjs +1 -1
- package/template/scripts/lib/existing-ui-baseline.mjs +1 -1
- package/template/scripts/lib/frontend-delivery.mjs +2 -2
- package/template/scripts/lib/governance-layout.mjs +74 -0
- package/template/scripts/lib/harness-execution-scope.mjs +2 -2
- package/template/scripts/lib/lifecycle-context-query.mjs +11 -3
- package/template/scripts/lib/lifecycle-registry.mjs +46 -7
- package/template/scripts/lib/lifecycle-status.mjs +111 -0
- package/template/scripts/lib/lifecycle-transition.mjs +71 -10
- package/template/scripts/lib/openapi-draft-validation.mjs +1 -1
- package/template/scripts/lib/plan-spec-entry-view.mjs +48 -0
- package/template/scripts/lib/plan-spec-entry.mjs +3 -3
- package/template/scripts/lib/skill-registry.mjs +16 -9
- package/template/scripts/lib/skill-supply-chain.mjs +34 -15
- package/template/scripts/lib/slice-contract-preparation.mjs +3 -3
- package/template/scripts/lib/slice-contract.mjs +1 -1
- package/template/scripts/lib/slice-repositories.mjs +1 -1
- package/template/scripts/lib/slice-task-package.mjs +3 -3
- package/template/scripts/lib/stage-tracking-migration.mjs +2 -2
- package/template/scripts/lib/stage-tracking.mjs +5 -5
- package/template/scripts/lib/strategic-feedback.mjs +2 -2
- package/template/scripts/lib/strategic-handoff-routing.mjs +2 -2
- package/template/scripts/lib/strategic-handoff.mjs +15 -15
- package/template/scripts/lib/task-package-schema.mjs +2 -2
- package/template/scripts/lib/task-package.mjs +1 -1
- package/template/scripts/lib/technical-design-boundary.mjs +1 -1
- package/template/scripts/lib/user-decision.mjs +2 -1
- package/template/scripts/lifecycle-status +14 -0
- package/template/scripts/plan-spec-entry +21 -0
- package/template/scripts/strategic-consumer-entry +1 -1
- package/template/scripts/strategic-handoff +1 -1
- package/template/scripts/verify-frontend-implementation-evidence +1 -1
- package/template/scripts/verify-governance-layout +15 -0
- package/template/scripts/verify-lifecycle-checkpoint +1 -1
- package/template/scripts/verify-project-instance +13 -10
- package/template/scripts/verify-scaffold-architecture-decisions +1 -1
- package/template/scripts/verify-strategic-context-import +3 -3
- package/template/skills-lock.json +80 -95
- package/template.manifest.json +30 -15
- package/template.snapshot.json +5 -5
- package/template/.agents/skills/grill-me/SKILL.md +0 -7
- package/template/.agents/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.agents/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.agents/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.agents/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.codex/skills/grill-me/SKILL.md +0 -7
- package/template/.codex/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.codex/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.codex/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.codex/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.cursor/skills/grill-me/SKILL.md +0 -7
- package/template/.cursor/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.cursor/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.cursor/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.cursor/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.pi/skills/grill-me/SKILL.md +0 -7
- package/template/.pi/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.pi/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.pi/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.pi/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/docs/agents/archify-integration.md +0 -19
- package/template/docs/agents/yss-plugin-dependency-contract.md +0 -45
- package/template/docs/api/.gitkeep +0 -0
- package/template/docs/api/specs/.gitkeep +0 -0
- package/template/docs/architecture/.gitkeep +0 -0
- package/template/docs/design/design-system-sync.yaml +0 -13
- package/template/docs/design/facts/antdv-next/1.5.2/cli-help.txt +0 -38
- package/template/docs/design/facts/antdv-next/1.5.2/component-list.json +0 -434
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/info.json +0 -246
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/semantic.json +0 -40
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/token.json +0 -32
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/info.json +0 -190
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/semantic.json +0 -20
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/token.json +0 -256
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/info.json +0 -460
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/token.json +0 -123
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/info.json +0 -646
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/semantic.json +0 -50
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/token.json +0 -130
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/info.json +0 -640
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/token.json +0 -172
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/info.json +0 -1010
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/token.json +0 -263
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/info.json +0 -321
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/semantic.json +0 -25
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/token.json +0 -25
- package/template/docs/design/facts/antdv-next/1.5.2/design-md.json +0 -3
- package/template/docs/design/facts/antdv-next/1.5.2/manifest.json +0 -215
- package/template/docs/design/facts/antdv-next/1.5.2/resolution-probe.json +0 -5
- package/template/docs/design/preview-dark.html +0 -178
- package/template/docs/design/preview.css +0 -730
- package/template/docs/design/preview.html +0 -178
- package/template/docs/design/preview.js +0 -71
- package/template/docs/design/prototypes/.gitkeep +0 -1
- package/template/docs/design/tokens/.design-md-projection.json +0 -13
- package/template/docs/implementation/.gitkeep +0 -1
- package/template/docs/plan/IDEATION.md +0 -96
- package/template/docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md +0 -13
- package/template/docs/process/PDCA-SCRUM.md +0 -10
- package/template/docs/process/github-workflows.md +0 -52
- package/template/docs/process/harness-executive-blueprint.md +0 -10
- package/template/docs/releases/.gitkeep +0 -1
- package/template/docs/requirements/README.md +0 -85
- package/template/docs/requirements/tickets/.gitkeep +0 -1
- package/template/docs/templates/agent-brief-template.md +0 -46
- package/template/docs/templates/architecture-proposal-template.md +0 -18
- package/template/docs/templates/implementation-plan-template.md +0 -16
- package/template/docs/templates/implementation-routing-template.md +0 -350
- package/template/docs/templates/release-note-template.md +0 -14
- package/template/docs/templates/requirement-freeze-template.md +0 -63
- package/template/docs/templates/retro-report-template.md +0 -16
- package/template/docs/templates/risk-register-template.md +0 -11
- package/template/docs/templates/user-story-template.md +0 -20
- package/template/docs/templates/verification-record-template.md +0 -53
- package/template/docs/testing/README.md +0 -110
- /package/template/{docs → .template-spec}/agents/domain.md +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-draft-review-checklist.md +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-draft-validation-record-template.yaml +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-freeze-record-template.md +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-json-export-record-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/architecture-deepening-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/architecture-review-checklist.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/business-architecture-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/data-architecture-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/engineering-baseline-review-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/functional-architecture-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/system-overview-design-template.md +0 -0
- /package/template/{docs → .template-spec}/design/diagrams/README.md +0 -0
- /package/template/{docs → .template-spec}/design/schemas/visual-baseline.schema.json +0 -0
- /package/template/{docs → .template-spec}/design/templates/prototype-confirmation-template.md +0 -0
- /package/template/{docs → .template-spec}/design/templates/visual-baseline-template.yaml +0 -0
- /package/template/{docs → .template-spec}/design/tokens/theme.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/tokens.compact.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/tokens.dark.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/tokens.default.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/variables.css +0 -0
- /package/template/{docs → .template-spec}/design/tokens/variables.dark.css +0 -0
- /package/template/{docs → .template-spec}/engineering/backend-platforms.json +0 -0
- /package/template/{docs → .template-spec}/plan/README.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/competitive-analysis-template.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/competitive-matrix-template.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/market-analysis-template.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/user-pain-points-template.md +0 -0
- /package/template/{docs → .template-spec}/process/delivery-preflight.md +0 -0
- /package/template/{docs → .template-spec}/process/document-writing.md +0 -0
- /package/template/{docs → .template-spec}/process/existing-backend-architecture.md +0 -0
- /package/template/{docs → .template-spec}/process/existing-ui-baseline.md +0 -0
- /package/template/{docs → .template-spec}/process/frontend-backend-delivery.md +0 -0
- /package/template/{docs → .template-spec}/process/harness-process-tailoring.md +0 -0
- /package/template/{docs → .template-spec}/process/implementation-repo-integration.md +0 -0
- /package/template/{docs/process/lifecycle-registry-baseline.json → .template-spec/process/lifecycle-registry-baseline-v1.json} +0 -0
- /package/template/{docs → .template-spec}/process/schemas/api-contract-decision-v2.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/api-contract-decision.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/backend-architecture-identity.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/backend-delivery-verification.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/backend-delivery.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/context-reconciliation.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/data-architecture-decision.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-input.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-result.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/existing-ui-baseline.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v1.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-implementation-evidence.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight-v2.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/implementation-repository-preparation-result.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/openapi-draft-validation-record.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/project-scaffold-contract.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/review-bundle.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/scaffold-architecture-decisions.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/slice-implementation-contract-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/stage-tracking.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-consumer-feedback.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-feedback-adjudication.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery-verification.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export-v2.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-package.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/subagent-task-package.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/user-decision.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/strategic-handoff-package.md +0 -0
- /package/template/{docs → .template-spec}/process/templates/context-reconciliation-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/frontend-implementation-plan-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/frontend-implementation-verification-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/lifecycle-checkpoint-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/scaffold-architecture-decisions-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/stage-checkpoint-template.md +0 -0
- /package/template/{docs → .template-spec}/process/templates/user-decision-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/adr-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/approval-record-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/cross-repo-slice-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/examples/lifecycle-writing-examples.md +0 -0
- /package/template/{docs → .template-spec}/templates/implementation-repo-registry-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/openapi-spec-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/review-bundle-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/review-report-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/spec-delta-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/spec-template.md +0 -0
- /package/template/{docs → .template-spec}/user-guide/yss-ui-mcp.md +0 -0
- /package/template/{docs → .template-spec}/user-guide//346/212/200/346/234/257/350/256/276/350/256/241/347/224/250/346/210/267/346/214/207/345/215/227.md" +0 -0
- /package/template/{docs → .template-spec}/user-guide//350/256/276/345/244/207/345/200/237/347/224/250/350/264/257/347/251/277/346/241/210/344/276/213.md" +0 -0
- /package/template/{docs → .template-spec}/user-guide//351/230/266/346/256/265/346/216/245/345/205/245/344/270/216/344/272/247/347/211/251/345/244/215/347/224/250/344/275/277/347/224/250/346/211/213/345/206/214.md" +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const { ASSET_PROFILE, INITIAL_STAGES } = require("./asset-runtime");
|
|
6
|
+
|
|
7
|
+
const RUNTIMES = Object.freeze({ codex: ".codex/skills", cursor: ".cursor/skills", pi: ".pi/skills" });
|
|
8
|
+
const OMIT_INSTANCE_PATHS = [
|
|
9
|
+
".template-source/process/github-workflows.md",
|
|
10
|
+
".template-spec/process/harness-executive-blueprint.md",
|
|
11
|
+
".template-spec/process/PDCA-SCRUM.md",
|
|
12
|
+
".template-spec/design/preview.html", ".template-spec/design/preview.css", ".template-spec/design/preview.js", ".template-spec/design/preview-dark.html",
|
|
13
|
+
".template-spec/design/facts/antdv-next", ".template-spec/user-guide/设备借用贯穿案例.md",
|
|
14
|
+
".template-spec/design/design-system-sync.yaml",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
function readDistributionRegistry(templateRoot) {
|
|
18
|
+
const registry = fs.readFileSync(path.join(templateRoot, ".template-spec/agents/yss-skill-registry.yaml"), "utf8");
|
|
19
|
+
const match = registry.match(/^instance_distribution:\n([\s\S]*?)(?=^[^\s#][^\n]*:\s*$)/m);
|
|
20
|
+
if (!match) throw new Error("Skill 注册表缺少 instance_distribution");
|
|
21
|
+
const initial = match[1].match(/^ initial_skills: \[([^\]]+)\]/m);
|
|
22
|
+
if (!initial) throw new Error("Skill 注册表缺少 initial_skills");
|
|
23
|
+
return {
|
|
24
|
+
initialSkills: initial[1].split(",").map((item) => item.trim()),
|
|
25
|
+
text: registry,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function assertRuntime(runtime) {
|
|
30
|
+
if (!Object.hasOwn(RUNTIMES, runtime)) throw new Error(`--agent-runtime 必须是 ${Object.keys(RUNTIMES).join("| ")}`);
|
|
31
|
+
return runtime;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function distributionForVariables(variables, templateRoot) {
|
|
35
|
+
if (variables.distribution?.mode === "legacy-all") return { mode: "legacy-all" };
|
|
36
|
+
if (variables.distribution?.mode === "selected") return variables.distribution;
|
|
37
|
+
const runtime = assertRuntime(variables.agentRuntime);
|
|
38
|
+
return {
|
|
39
|
+
mode: "selected",
|
|
40
|
+
runtimes: [runtime],
|
|
41
|
+
installedSkills: [...readDistributionRegistry(templateRoot).initialSkills],
|
|
42
|
+
assetProfile: ASSET_PROFILE,
|
|
43
|
+
installedStages: [...INITIAL_STAGES],
|
|
44
|
+
resourceSkills: [],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function isIncludedInstancePath(relativePath, distribution) {
|
|
49
|
+
if (distribution.mode === "legacy-all") return true;
|
|
50
|
+
if (relativePath === ".cursorrules" && !distribution.runtimes.includes("cursor")) return false;
|
|
51
|
+
if (OMIT_INSTANCE_PATHS.some((excluded) => relativePath === excluded || relativePath.startsWith(`${excluded}/`))) return false;
|
|
52
|
+
if (distribution.assetProfile === ASSET_PROFILE &&
|
|
53
|
+
(relativePath.startsWith(".template-spec/") || relativePath.startsWith("scripts/") || relativePath.startsWith(".vscode/"))) {
|
|
54
|
+
return distribution.assetPaths.has(relativePath) ||
|
|
55
|
+
[...distribution.assetPaths].some((ref) => ref.startsWith(`${relativePath}/`));
|
|
56
|
+
}
|
|
57
|
+
for (const [runtime, root] of Object.entries(RUNTIMES)) {
|
|
58
|
+
const runtimeRoot = root.split("/")[0];
|
|
59
|
+
if (relativePath === runtimeRoot || relativePath.startsWith(`${runtimeRoot}/`)) {
|
|
60
|
+
if (!distribution.runtimes.includes(runtime)) return false;
|
|
61
|
+
if (relativePath.startsWith(`${root}/`)) {
|
|
62
|
+
const name = relativePath.slice(root.length + 1).split("/")[0];
|
|
63
|
+
if (name && !name.startsWith(".") && !distribution.installedSkills.includes(name)) return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (relativePath.startsWith(".agents/skills/")) {
|
|
68
|
+
const name = relativePath.slice(".agents/skills/".length).split("/")[0];
|
|
69
|
+
if (name && !name.startsWith(".") && !distribution.installedSkills.includes(name)) return false;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function selectedSkillLock(sourceText, distribution) {
|
|
75
|
+
if (distribution.mode === "legacy-all") return sourceText;
|
|
76
|
+
const source = JSON.parse(sourceText);
|
|
77
|
+
const roots = distribution.runtimes.map((runtime) => RUNTIMES[assertRuntime(runtime)]);
|
|
78
|
+
source.projectionRoots = roots;
|
|
79
|
+
source.skills.shared = Object.fromEntries(Object.entries(source.skills.shared).filter(([name]) => distribution.installedSkills.includes(name)).map(([name, record]) => [name, { ...record, targets: [".agents/skills", ...roots] }]));
|
|
80
|
+
source.skills.platform = Object.fromEntries(roots.map((root) => [root, Object.fromEntries(Object.entries(source.skills.platform?.[root] || {}).filter(([name]) => distribution.installedSkills.includes(name)))]).filter(([, entries]) => Object.keys(entries).length));
|
|
81
|
+
return `${JSON.stringify(source, null, 2)}\n`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function renderInstanceSkillSupplyChain(sourceText) {
|
|
85
|
+
const additions = `\nfunction projectionRootsFor(lock) {
|
|
86
|
+
const identityPath = path.join(ROOT, "yss-project.yaml");
|
|
87
|
+
const isInstance = existsSync(identityPath) && /^repository_mode:\\s*project-instance\\s*$/m.test(readFileSync(identityPath, "utf8"));
|
|
88
|
+
if (!isInstance) return PROJECTION_ROOTS;
|
|
89
|
+
const roots = lock?.projectionRoots;
|
|
90
|
+
if (!Array.isArray(roots) || !roots.length || roots.some((root) => !PROJECTION_ROOTS.includes(root))) throw new TypeError("project-instance skills-lock.json 缺少有效 projectionRoots");
|
|
91
|
+
return [...new Set(roots)];
|
|
92
|
+
}\n`;
|
|
93
|
+
const marker = 'export const PROJECTION_ROOTS = [".codex/skills", ".cursor/skills", ".pi/skills"];';
|
|
94
|
+
if (!sourceText.includes(marker)) throw new Error("Skill 投影脚本分发基线已变化");
|
|
95
|
+
return sourceText.replace(marker, marker + additions)
|
|
96
|
+
.replace(" const shared = sharedFromLock(lock);", " const shared = sharedFromLock(lock);\n const projectionRoots = projectionRootsFor(lock);")
|
|
97
|
+
.replace(" const oldLock = parseLock(); const previous = priorMetadata(oldLock);", " const oldLock = parseLock(); const projectionRoots = projectionRootsFor(oldLock); const previous = priorMetadata(oldLock);")
|
|
98
|
+
.replaceAll("for (const root of PROJECTION_ROOTS) {", "for (const root of projectionRoots) {")
|
|
99
|
+
.replace("const targets = [\".agents/skills\", ...PROJECTION_ROOTS];", "const targets = [\".agents/skills\", ...projectionRoots];")
|
|
100
|
+
.replace("projectionRoots: PROJECTION_ROOTS, sources, skills", "projectionRoots, sources, skills");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function renderInstanceDesignSkillFile(sourceText) {
|
|
104
|
+
return sourceText
|
|
105
|
+
.replaceAll("node .template-source/tooling/node/scripts/design-md.mjs", "scripts/design-md")
|
|
106
|
+
.replace("运行前先更新 `.template-spec/design/design-system-sync.yaml` 的规范源摘要。", "项目实例无需模板间的 design-system-sync 摘要。")
|
|
107
|
+
.replace("修改根 DESIGN.md → 更新 design-system-sync.yaml 摘要 →", "修改根 DESIGN.md →");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function linkedSkillDependencies(templateRoot, name) {
|
|
111
|
+
const skillRoot = path.join(templateRoot, ".agents/skills");
|
|
112
|
+
const current = path.join(skillRoot, name);
|
|
113
|
+
const result = new Set();
|
|
114
|
+
function visitDir(directory) {
|
|
115
|
+
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
|
|
116
|
+
const file = path.join(directory, entry.name);
|
|
117
|
+
if (entry.isDirectory()) visitDir(file);
|
|
118
|
+
else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
119
|
+
const content = fs.readFileSync(file, "utf8");
|
|
120
|
+
for (const match of content.matchAll(/\[[^\]]+\]\(([^)]+)\)/g)) {
|
|
121
|
+
const ref = match[1].split("#")[0];
|
|
122
|
+
if (!ref || ref.startsWith("/") || ref.includes("://")) continue;
|
|
123
|
+
const resolved = path.resolve(path.dirname(file), ref);
|
|
124
|
+
const relative = path.relative(skillRoot, resolved).split(path.sep);
|
|
125
|
+
if (relative.length > 1 && relative[0] !== name && !relative[0].startsWith(".") && !relative[0].includes("..") && fs.existsSync(resolved)) result.add(relative[0]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
visitDir(current);
|
|
131
|
+
return [...result];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function requiredSkills(registryText, requested, triggers = [], templateRoot = null) {
|
|
135
|
+
const skillBlock = registryText.split(/^skills:\s*$/m)[1]?.split(/^platform_skills:\s*$/m)[0] || "";
|
|
136
|
+
const available = new Set([...skillBlock.matchAll(/^ - (?:\{ )?id: ([a-z][a-z0-9-]+)/gm)].map((match) => match[1]));
|
|
137
|
+
const platformBlock = registryText.split(/^platform_skills:\s*$/m)[1]?.split(/^external_skills:\s*$/m)[0] || "";
|
|
138
|
+
const platformSkills = new Set([...platformBlock.matchAll(/^ - id: ([a-z][a-z0-9-]+)/gm)].map((match) => match[1]));
|
|
139
|
+
const block = registryText.split(/^skill_dependencies:\s*$/m)[1]?.split(/^[^\s#][^\n]*:\s*$/m)[0] || "";
|
|
140
|
+
const dependencies = new Map();
|
|
141
|
+
let current = null;
|
|
142
|
+
for (const line of block.split("\n")) {
|
|
143
|
+
const header = line.match(/^ ([a-z][a-z0-9-]+):\s*$/);
|
|
144
|
+
if (header) { current = header[1]; continue; }
|
|
145
|
+
const item = line.match(/^ - \{ skill: ([a-z][a-z0-9-]+), type: ([a-z-]+)(?:, when: ([a-z0-9-]+))? \}/);
|
|
146
|
+
if (current && item) {
|
|
147
|
+
if (!dependencies.has(current)) dependencies.set(current, []);
|
|
148
|
+
dependencies.get(current).push({ name: item[1], type: item[2], when: item[3] });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const result = new Set();
|
|
152
|
+
function visit(name) {
|
|
153
|
+
if (!available.has(name)) throw new Error(platformSkills.has(name) ? `平台专属 Skill 不可作为共享 Skill 补装:${name}` : `Skill 未在注册表登记:${name}`);
|
|
154
|
+
if (result.has(name)) return;
|
|
155
|
+
result.add(name);
|
|
156
|
+
for (const dep of dependencies.get(name) || []) {
|
|
157
|
+
if (dep.type === "context-required" || (dep.type === "context-conditional" && triggers.includes(dep.when))) visit(dep.name);
|
|
158
|
+
}
|
|
159
|
+
if (templateRoot) for (const linked of linkedSkillDependencies(templateRoot, name)) visit(linked);
|
|
160
|
+
}
|
|
161
|
+
requested.forEach(visit);
|
|
162
|
+
return [...result].sort();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
module.exports = { RUNTIMES, assertRuntime, readDistributionRegistry, distributionForVariables, isIncludedInstancePath, selectedSkillLock, renderInstanceSkillSupplyChain, renderInstanceDesignSkillFile, requiredSkills };
|
|
@@ -8,6 +8,8 @@ const { treeHash } = require("../template-hash");
|
|
|
8
8
|
const { targetPath, pathKind, normalizeRelativePath } = require("../filesystem/path-utils");
|
|
9
9
|
const { validateTemplateSnapshot } = require("../validation/snapshot");
|
|
10
10
|
const { validateTemplateMetadata } = require("../validation/metadata");
|
|
11
|
+
const { distributionForVariables, isIncludedInstancePath, selectedSkillLock, renderInstanceSkillSupplyChain, renderInstanceDesignSkillFile } = require("./distribution-runtime");
|
|
12
|
+
const { ASSET_PROFILE, assetPaths } = require("./asset-runtime");
|
|
11
13
|
const {
|
|
12
14
|
extractManagedGitignoreBlock,
|
|
13
15
|
mergeManagedGitignoreBlock,
|
|
@@ -29,7 +31,7 @@ const TEMPLATE_MANIFEST_TEXT = fs.readFileSync(BUNDLED_MANIFEST_PATH, "utf8");
|
|
|
29
31
|
const TEMPLATE_MANIFEST = JSON.parse(TEMPLATE_MANIFEST_TEXT);
|
|
30
32
|
const TEMPLATE_METADATA_FILENAME = ".yss-template.json";
|
|
31
33
|
const TEMPLATE_SOURCE = "github:iloveZzz/yss-spec-project-template";
|
|
32
|
-
const METADATA_SCHEMA_VERSION =
|
|
34
|
+
const METADATA_SCHEMA_VERSION = 3;
|
|
33
35
|
|
|
34
36
|
const ROOT_EXCLUDED_ENTRIES = new Set(TEMPLATE_MANIFEST.excludeRootEntries);
|
|
35
37
|
const ROOT_EXCLUDED_FILES = new Set(TEMPLATE_MANIFEST.excludeRootFiles);
|
|
@@ -47,8 +49,6 @@ const INIT_EXCLUDED_RELATIVE_PATHS = new Set(
|
|
|
47
49
|
const RENDERED_RELATIVE_PATHS = new Set(TEMPLATE_MANIFEST.renderPaths);
|
|
48
50
|
const EXAMPLE_DOC_PATHS = new Set(TEMPLATE_MANIFEST.exampleDocPaths);
|
|
49
51
|
|
|
50
|
-
let bundledPathToLogicalPath = null;
|
|
51
|
-
|
|
52
52
|
function sha256(value) {
|
|
53
53
|
return crypto.createHash("sha256").update(value).digest("hex");
|
|
54
54
|
}
|
|
@@ -79,16 +79,16 @@ function readTemplateSnapshot() {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
function logicalPathMap(snapshot) {
|
|
83
|
+
return new Map(
|
|
84
|
+
Object.entries(snapshot.encodedPaths || {}).map(([logicalPath, encodedPath]) => [
|
|
85
|
+
normalizeRelativePath(encodedPath),
|
|
86
|
+
normalizeRelativePath(logicalPath),
|
|
87
|
+
]),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function logicalTemplatePath(bundledPath, bundledPathToLogicalPath) {
|
|
92
92
|
return (
|
|
93
93
|
bundledPathToLogicalPath.get(normalizeRelativePath(bundledPath)) ||
|
|
94
94
|
normalizeRelativePath(bundledPath)
|
|
@@ -143,12 +143,35 @@ function readTargetIdentity(targetDir) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
function renderTemplateFile(relativePath, content, variables) {
|
|
146
|
+
const distribution = variables.distribution || distributionForVariables(variables, BUNDLED_TEMPLATE_ROOT);
|
|
147
|
+
if (relativePath === "skills-lock.json") return selectedSkillLock(content, distribution);
|
|
148
|
+
if (relativePath === "scripts/lib/skill-supply-chain.mjs" && distribution.mode === "selected") return renderInstanceSkillSupplyChain(content);
|
|
149
|
+
if (distribution.mode === "selected" && /^\.(agents|codex|cursor|pi)\/skills\/yss-design-system\/(SKILL\.md|references\/data-quality-theme\.md)$/.test(relativePath)) return renderInstanceDesignSkillFile(content);
|
|
150
|
+
if (relativePath === ".template-spec/engineering/backend-platforms.json" && distribution.mode === "selected") {
|
|
151
|
+
return content.replaceAll(".template-source/evidence/maintenance/2026-09-18-yss-backend-components/aliyun-artifact-resolution.json", "docs/engineering/evidence/aliyun-artifact-resolution.json");
|
|
152
|
+
}
|
|
153
|
+
if (relativePath === ".template-spec/agents/backend-architecture-profiles.md" && distribution.mode === "selected") {
|
|
154
|
+
return content.replace(/;依据见 `\.template-source\/evidence\/maintenance\/2026-09-12-existing-project-delivery\/maven-adapters-04\.json`/, ";适配验证证据保留在模板源,项目实例须对自身工程重新验证");
|
|
155
|
+
}
|
|
156
|
+
if (relativePath === ".template-spec/user-guide/用户手册.md" && distribution.mode === "selected") {
|
|
157
|
+
if (distribution.assetProfile !== ASSET_PROFILE) {
|
|
158
|
+
return `# ${variables.projectName} 用户手册\n\n本仓是 \`project-instance\`,用于 ${variables.businessDomain} 的研发资产。先阅读根 [AGENTS.md](../../AGENTS.md)、[CONTEXT.md](../../CONTEXT.md) 与 [生命周期资产索引](../process/lifecycle-artifact-map.md)。\n\n阶段派发前,由 Agent 运行 \`create-yss-spec skills ensure <skill-id...> --plan\` 核对依赖,再运行 \`--apply\` 安装。旧实例继续沿用既有文件分发范围;增加平台使用 \`create-yss-spec skills runtime add <codex|cursor|pi> --plan/--apply\`。CLI 快照必须与实例记录的模板提交一致;升级 CLI 后先运行 \`create-yss-spec sync\`。\n\n项目校验运行 \`scripts/verify-project-instance\`。\n`;
|
|
159
|
+
}
|
|
160
|
+
return `# ${variables.projectName} 用户手册\n\n本仓是 \`project-instance\`,用于 ${variables.businessDomain} 的研发资产。先阅读根 [AGENTS.md](../../AGENTS.md)、[CONTEXT.md](../../CONTEXT.md) 与 [生命周期资产索引](../process/lifecycle-artifact-map.md)。\n\n初始化安装分诊与 Plan 入口资产、三项入口 Skill 与所选 Agent 平台。进入后续阶段前,运行 \`create-yss-spec assets ensure <stage-id> --plan\` 核对文件,再运行 \`--apply\` 原子安装;专项 Skill 使用 \`create-yss-spec skills ensure <skill-id...> --plan/--apply\`,会补齐该 Skill 引用的实例文件。增加平台使用 \`create-yss-spec skills runtime add <codex|cursor|pi> --plan/--apply\`。CLI 快照必须与实例记录的模板提交一致;升级 CLI 后先运行 \`create-yss-spec sync\`。\n\n项目校验运行 \`scripts/verify-project-instance\`;实例 CI 应执行该命令和项目实际的构建、测试。\n`;
|
|
161
|
+
}
|
|
162
|
+
if (distribution.mode === "selected" && relativePath === ".template-spec/design/README.md") {
|
|
163
|
+
return content.replace(/^.*design-system-sync\.yaml.*\n/m, "");
|
|
164
|
+
}
|
|
165
|
+
if (distribution.mode === "selected" && relativePath.startsWith(".template-spec/user-guide/") && relativePath.endsWith(".md")) {
|
|
166
|
+
return content.replaceAll("[设备借用贯穿案例](设备借用贯穿案例.md)", "[项目用户手册](用户手册.md)")
|
|
167
|
+
.replaceAll("本仓是 `template-source`", "模板源是 `template-source`");
|
|
168
|
+
}
|
|
146
169
|
if (relativePath === "yss-project.yaml") {
|
|
147
170
|
return convertTemplateSourceToInstance(content);
|
|
148
171
|
}
|
|
149
172
|
|
|
150
173
|
if (relativePath === "AGENTS.md") {
|
|
151
|
-
|
|
174
|
+
const rendered = content
|
|
152
175
|
.replace(
|
|
153
176
|
/(\*\*项目名称:\*\*\s*)\[填写\]/,
|
|
154
177
|
(_, prefix) => `${prefix}${variables.projectName}`,
|
|
@@ -161,10 +184,20 @@ function renderTemplateFile(relativePath, content, variables) {
|
|
|
161
184
|
/(\*\*团队规模:\*\*\s*)\[填写\]/,
|
|
162
185
|
(_, prefix) => `${prefix}${variables.teamSize}`,
|
|
163
186
|
);
|
|
187
|
+
if (distribution.mode !== "selected") return rendered;
|
|
188
|
+
const base = rendered.replace(/## 4\. \`template-source\` 模板维护路由[\s\S]*?(?=## 5\.)/, "")
|
|
189
|
+
.replace(/\| 影响面、\`not-applicable\`、模板维护强度 \|[^\n]*\n/, "| 影响面与 `not-applicable` | `.template-spec/process/harness-process-tailoring.md` |\n");
|
|
190
|
+
const guidance = distribution.assetProfile === ASSET_PROFILE
|
|
191
|
+
? "## 按需阶段资产与 Skill\n\n进入后续生命周期阶段前,运行 `create-yss-spec assets ensure <stage-id> --plan` 查看完整依赖,核对后运行 `--apply`。专项任务根据 .template-spec/agents/yss-skill-registry.yaml 选定 Skill,运行 `create-yss-spec skills ensure <skill-id...> --plan`,核对后运行 `--apply`。缺少阶段资产时先补装,不以缺文件推定门禁不适用。若 CLI 快照与实例模板提交不一致,先运行 `create-yss-spec sync`。\n"
|
|
192
|
+
: "## 按需 Skill\n\n此实例继续沿用原文件分发范围。阶段派发或专项任务开始前,根据 .template-spec/agents/yss-skill-registry.yaml 选定 Skill,运行 `create-yss-spec skills ensure <skill-id...> --plan`,核对后运行 `--apply`。若 CLI 快照与实例模板提交不一致,先运行 `create-yss-spec sync`。\n";
|
|
193
|
+
return `${base}\n${guidance}`;
|
|
164
194
|
}
|
|
165
195
|
|
|
166
196
|
if (relativePath === "README.md") {
|
|
167
|
-
|
|
197
|
+
const assetGuidance = distribution.assetProfile === ASSET_PROFILE
|
|
198
|
+
? "后续阶段先运行 `create-yss-spec assets ensure <stage-id> --plan` 核对依赖,再运行 `--apply`;专项 Skill 使用 `create-yss-spec skills ensure <skill-id> --plan/--apply`。"
|
|
199
|
+
: "专项 Skill 使用 `create-yss-spec skills ensure <skill-id> --plan/--apply`。";
|
|
200
|
+
return `# ${variables.projectName}\n\n本仓库用于管理 ${variables.businessDomain} 的研发资产。\n\n- 默认 Issue Tracker:${variables.issueTracker}\n- Agent 平台:${distribution.mode === "selected" ? distribution.runtimes.join(", ") : "legacy-all"}\n- 协作入口:[AGENTS.md](./AGENTS.md)\n- 业务词汇:[CONTEXT.md](./CONTEXT.md)\n- 用户指南:[.template-spec/user-guide/用户手册.md](./.template-spec/user-guide/用户手册.md)\n\n项目校验:\`scripts/verify-project-instance\`。${assetGuidance}\n`;
|
|
168
201
|
}
|
|
169
202
|
|
|
170
203
|
if (relativePath === ".gitignore") return extractManagedGitignoreBlock(content);
|
|
@@ -178,6 +211,8 @@ function buildCopyPlan(
|
|
|
178
211
|
variables,
|
|
179
212
|
relativeDir = "",
|
|
180
213
|
mode = "managed",
|
|
214
|
+
bundledPathToLogicalPath,
|
|
215
|
+
distribution = { mode: "legacy-all" },
|
|
181
216
|
) {
|
|
182
217
|
const operations = [];
|
|
183
218
|
const entries = fs.readdirSync(sourceDir, { withFileTypes: true });
|
|
@@ -188,9 +223,10 @@ function buildCopyPlan(
|
|
|
188
223
|
const bundledRelativePath = relativeDir
|
|
189
224
|
? path.posix.join(relativeDir, entry.name)
|
|
190
225
|
: entry.name;
|
|
191
|
-
const relativePath = logicalTemplatePath(bundledRelativePath);
|
|
226
|
+
const relativePath = logicalTemplatePath(bundledRelativePath, bundledPathToLogicalPath);
|
|
192
227
|
|
|
193
228
|
if (shouldExcludeRelativePath(relativePath, mode)) continue;
|
|
229
|
+
if (!isIncludedInstancePath(relativePath, distribution)) continue;
|
|
194
230
|
if (!variables.includeExampleDocs && EXAMPLE_DOC_PATHS.has(relativePath)) continue;
|
|
195
231
|
|
|
196
232
|
const sourcePath = path.join(sourceDir, entry.name);
|
|
@@ -205,6 +241,8 @@ function buildCopyPlan(
|
|
|
205
241
|
variables,
|
|
206
242
|
bundledRelativePath,
|
|
207
243
|
mode,
|
|
244
|
+
bundledPathToLogicalPath,
|
|
245
|
+
distribution,
|
|
208
246
|
),
|
|
209
247
|
);
|
|
210
248
|
continue;
|
|
@@ -235,8 +273,9 @@ function buildSyncVariables(metadata) {
|
|
|
235
273
|
issueTracker: variables.issueTracker || "github",
|
|
236
274
|
includeExampleDocs:
|
|
237
275
|
variables.includeExampleDocs === undefined
|
|
238
|
-
?
|
|
276
|
+
? !(metadata.metadataSchemaVersion >= 3)
|
|
239
277
|
: Boolean(variables.includeExampleDocs),
|
|
278
|
+
distribution: metadata.metadataSchemaVersion >= 3 ? metadata.distribution : { mode: "legacy-all" },
|
|
240
279
|
};
|
|
241
280
|
}
|
|
242
281
|
|
|
@@ -254,15 +293,18 @@ function buildDesiredManagedFile(operation, variables) {
|
|
|
254
293
|
};
|
|
255
294
|
}
|
|
256
295
|
|
|
296
|
+
const desiredContent = fs.readFileSync(operation.sourcePath);
|
|
257
297
|
return {
|
|
258
298
|
...operation,
|
|
259
|
-
desiredContent
|
|
260
|
-
desiredHash:
|
|
299
|
+
desiredContent,
|
|
300
|
+
desiredHash: sha256(desiredContent),
|
|
261
301
|
};
|
|
262
302
|
}
|
|
263
303
|
|
|
264
|
-
function buildDesiredManagedOperations(targetDir, variables, mode = "managed") {
|
|
265
|
-
|
|
304
|
+
function buildDesiredManagedOperations(targetDir, variables, mode = "managed", snapshot = readTemplateSnapshot()) {
|
|
305
|
+
const distribution = variables.distribution || distributionForVariables(variables, BUNDLED_TEMPLATE_ROOT);
|
|
306
|
+
const effectiveDistribution = { ...distribution, assetPaths: assetPaths(BUNDLED_TEMPLATE_ROOT, distribution) };
|
|
307
|
+
return buildCopyPlan(BUNDLED_TEMPLATE_ROOT, targetDir, { ...variables, distribution }, "", mode, logicalPathMap(snapshot), effectiveDistribution)
|
|
266
308
|
.filter((operation) => operation.type === "copy" || operation.type === "render")
|
|
267
309
|
.map((operation) => buildDesiredManagedFile(operation, variables));
|
|
268
310
|
}
|
|
@@ -297,9 +339,9 @@ function adaptGitignoreOperation(
|
|
|
297
339
|
};
|
|
298
340
|
}
|
|
299
341
|
|
|
300
|
-
function buildSyncDesiredOperations(targetDir, metadata, identity) {
|
|
342
|
+
function buildSyncDesiredOperations(targetDir, metadata, identity, snapshot = readTemplateSnapshot()) {
|
|
301
343
|
const variables = buildSyncVariables(metadata);
|
|
302
|
-
return buildDesiredManagedOperations(targetDir, variables, "init")
|
|
344
|
+
return buildDesiredManagedOperations(targetDir, variables, "init", snapshot)
|
|
303
345
|
.filter((operation) => operation.relativePath !== "README.md")
|
|
304
346
|
.map((operation) =>
|
|
305
347
|
adaptGitignoreOperation(operation, targetDir, {
|
|
@@ -327,7 +369,7 @@ function buildSyncDesiredOperations(targetDir, metadata, identity) {
|
|
|
327
369
|
}
|
|
328
370
|
|
|
329
371
|
function buildAttachDesiredOperations(targetDir, variables, identity) {
|
|
330
|
-
return buildDesiredManagedOperations(targetDir, variables, "
|
|
372
|
+
return buildDesiredManagedOperations(targetDir, variables, "init")
|
|
331
373
|
.filter((operation) => operation.relativePath !== "README.md")
|
|
332
374
|
.map((operation) => adaptGitignoreOperation(operation, targetDir, { attach: true }))
|
|
333
375
|
.map((operation) => {
|
|
@@ -396,6 +438,7 @@ function collectManagedFiles(desiredOperations) {
|
|
|
396
438
|
|
|
397
439
|
function buildMetadata(variables, desiredOperations, timestamp = nowIsoString()) {
|
|
398
440
|
const snapshot = readTemplateSnapshot();
|
|
441
|
+
const distribution = variables.distribution || distributionForVariables(variables, BUNDLED_TEMPLATE_ROOT);
|
|
399
442
|
return {
|
|
400
443
|
metadataSchemaVersion: METADATA_SCHEMA_VERSION,
|
|
401
444
|
templateName: PACKAGE_MANIFEST.name,
|
|
@@ -408,6 +451,7 @@ function buildMetadata(variables, desiredOperations, timestamp = nowIsoString())
|
|
|
408
451
|
initializedAt: timestamp,
|
|
409
452
|
lastSyncedAt: timestamp,
|
|
410
453
|
managedFilesManifestVersion: TEMPLATE_MANIFEST_VERSION,
|
|
454
|
+
distribution,
|
|
411
455
|
variables: {
|
|
412
456
|
projectName: variables.projectName,
|
|
413
457
|
businessDomain: variables.businessDomain,
|
|
@@ -429,19 +473,21 @@ function writeTemplateMetadata(targetDir, metadata, transaction = null) {
|
|
|
429
473
|
fs.writeFileSync(metadataPath, content, "utf8");
|
|
430
474
|
}
|
|
431
475
|
|
|
432
|
-
function buildNextSyncMetadata(metadata, syncPlan
|
|
433
|
-
|
|
476
|
+
function buildNextSyncMetadata(metadata, syncPlan, {
|
|
477
|
+
snapshot = readTemplateSnapshot(),
|
|
478
|
+
currentHashes = null,
|
|
479
|
+
} = {}) {
|
|
434
480
|
const nextManagedFiles = { ...(metadata.managedFiles || {}) };
|
|
435
481
|
delete nextManagedFiles["README.md"];
|
|
436
482
|
for (const relativePath of syncPlan.alreadyMissing || []) delete nextManagedFiles[relativePath];
|
|
437
483
|
for (const relativePath of syncPlan.pruned || []) delete nextManagedFiles[relativePath];
|
|
438
484
|
for (const operation of syncPlan.desiredOperations) {
|
|
439
485
|
if (pathKind(operation.targetPath) !== "file") continue;
|
|
440
|
-
const currentHash = fileHash(operation.targetPath);
|
|
441
|
-
if (currentHash === operation.desiredHash) {
|
|
486
|
+
const currentHash = currentHashes?.[operation.relativePath] ?? fileHash(operation.targetPath);
|
|
487
|
+
if (currentHash === operation.desiredHash || operation.relativePath === "skills-lock.json") {
|
|
442
488
|
nextManagedFiles[operation.relativePath] = {
|
|
443
489
|
type: operation.type,
|
|
444
|
-
contentHash:
|
|
490
|
+
contentHash: currentHash,
|
|
445
491
|
};
|
|
446
492
|
}
|
|
447
493
|
}
|
|
@@ -449,6 +495,7 @@ function buildNextSyncMetadata(metadata, syncPlan) {
|
|
|
449
495
|
return {
|
|
450
496
|
...metadata,
|
|
451
497
|
metadataSchemaVersion: METADATA_SCHEMA_VERSION,
|
|
498
|
+
distribution: metadata.metadataSchemaVersion >= 3 ? metadata.distribution : { mode: "legacy-all" },
|
|
452
499
|
templateName: PACKAGE_MANIFEST.name,
|
|
453
500
|
cliVersion: PACKAGE_MANIFEST.version,
|
|
454
501
|
templateVersion: PACKAGE_MANIFEST.version,
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const crypto = require("node:crypto");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
|
|
6
|
+
const { targetPath, pathKind } = require("../filesystem/path-utils");
|
|
7
|
+
const {
|
|
8
|
+
createMigrationPlan,
|
|
9
|
+
addUnsafe,
|
|
10
|
+
addConflict,
|
|
11
|
+
addRemove,
|
|
12
|
+
} = require("./migration-planner");
|
|
13
|
+
|
|
14
|
+
const TRACKER_FROM = "docs/agents/issue-tracker.md";
|
|
15
|
+
const TRACKER_TO = ".template-spec/agents/issue-tracker.md";
|
|
16
|
+
const STATIC_DIRECTORIES = [
|
|
17
|
+
"docs/agents", "docs/process", "docs/templates", "docs/user-guide",
|
|
18
|
+
"docs/plan/templates", "docs/api/templates", "docs/architecture/templates",
|
|
19
|
+
"docs/design/templates", "docs/design/tokens", "docs/design/schemas",
|
|
20
|
+
"docs/design/diagrams", "docs/discovery/templates",
|
|
21
|
+
];
|
|
22
|
+
const STATIC_FILES = [
|
|
23
|
+
"docs/adr/README.md", "docs/architecture/README.md",
|
|
24
|
+
"docs/plan/README.md", "docs/plan/entry-review.md",
|
|
25
|
+
"docs/discovery/README.md", "docs/discovery/IDEATION.md",
|
|
26
|
+
"docs/design/README.md", "docs/design/design.md",
|
|
27
|
+
"docs/design/design-system-sync.yaml", "docs/design/preview.html",
|
|
28
|
+
"docs/design/preview-dark.html", "docs/design/preview.css",
|
|
29
|
+
"docs/design/preview.js", "docs/engineering/backend-platforms.json",
|
|
30
|
+
"docs/engineering/backend-platforms.md",
|
|
31
|
+
];
|
|
32
|
+
const RETIRED_SOURCE_ONLY = new Set([
|
|
33
|
+
"docs/agents/archify-integration.md", "docs/agents/skills-maintenance.md",
|
|
34
|
+
"docs/agents/strategic-design-skills-integration.md",
|
|
35
|
+
"docs/agents/yss-ui-skills-integration.md",
|
|
36
|
+
"docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md",
|
|
37
|
+
"docs/process/github-workflows.md", "docs/process/maintenance-intensity.yaml",
|
|
38
|
+
"docs/process/template-engineering-overview.md",
|
|
39
|
+
"docs/process/template-verification-profiles.yaml",
|
|
40
|
+
"docs/process/schemas/maintenance-review-record.schema.json",
|
|
41
|
+
"docs/process/templates/maintenance-checkpoint-template.yaml",
|
|
42
|
+
"docs/design/design-system-sync.yaml", "docs/design/preview.html",
|
|
43
|
+
"docs/design/preview-dark.html", "docs/design/preview.css",
|
|
44
|
+
"docs/design/preview.js",
|
|
45
|
+
]);
|
|
46
|
+
const SEPARATE_LEGACY_MAPPINGS = new Set([
|
|
47
|
+
"docs/templates/prd-template.md",
|
|
48
|
+
"docs/templates/vertical-slice-issue-template.md",
|
|
49
|
+
]);
|
|
50
|
+
|
|
51
|
+
function digest(bytes) {
|
|
52
|
+
return crypto.createHash("sha256").update(bytes).digest("hex");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function legacyStaticPath(ref) {
|
|
56
|
+
return STATIC_FILES.includes(ref) ||
|
|
57
|
+
STATIC_DIRECTORIES.some((directory) => ref.startsWith(`${directory}/`));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function collectLegacyFiles(targetDir, desiredOperations, managedFiles, plan) {
|
|
61
|
+
const found = new Set();
|
|
62
|
+
function inspect(ref) {
|
|
63
|
+
let kind;
|
|
64
|
+
try { kind = pathKind(targetPath(targetDir, ref)); }
|
|
65
|
+
catch (error) { addUnsafe(plan, ref, error.message); return; }
|
|
66
|
+
if (kind === "missing") return;
|
|
67
|
+
if (kind === "other") { addUnsafe(plan, ref, "旧治理路径是符号链接或特殊文件"); return; }
|
|
68
|
+
if (kind === "file") { found.add(ref); return; }
|
|
69
|
+
for (const entry of fs.readdirSync(targetPath(targetDir, ref))) {
|
|
70
|
+
if (entry === ".DS_Store") continue;
|
|
71
|
+
inspect(`${ref}/${entry}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const directory of STATIC_DIRECTORIES) inspect(directory);
|
|
75
|
+
for (const ref of STATIC_FILES) inspect(ref);
|
|
76
|
+
for (const ref of Object.keys(managedFiles || {})) {
|
|
77
|
+
if (legacyStaticPath(ref)) inspect(ref);
|
|
78
|
+
}
|
|
79
|
+
for (const operation of desiredOperations) {
|
|
80
|
+
if (operation.relativePath.startsWith(".template-spec/")) {
|
|
81
|
+
inspect(`docs/${operation.relativePath.slice(".template-spec/".length)}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return [...found].filter((ref) => !SEPARATE_LEGACY_MAPPINGS.has(ref)).sort();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function prepareLayoutMigration({ targetDir, desiredOperations, managedFiles = {}, explicit = false }) {
|
|
88
|
+
const plan = createMigrationPlan(targetDir);
|
|
89
|
+
const legacyFiles = collectLegacyFiles(targetDir, desiredOperations, managedFiles, plan);
|
|
90
|
+
const desiredByPath = new Map(desiredOperations.map((operation) => [operation.relativePath, operation]));
|
|
91
|
+
const operations = [...desiredOperations];
|
|
92
|
+
|
|
93
|
+
for (const from of legacyFiles) {
|
|
94
|
+
const to = `.template-spec/${from.slice("docs/".length)}`;
|
|
95
|
+
if (!explicit) {
|
|
96
|
+
addConflict(plan, from, to, "旧治理目录布局需显式 --migrate-layout;普通 attach/sync 不写入");
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const source = targetPath(targetDir, from);
|
|
100
|
+
const destination = targetPath(targetDir, to);
|
|
101
|
+
const sourceBytes = fs.readFileSync(source);
|
|
102
|
+
const destinationKind = pathKind(destination);
|
|
103
|
+
if (destinationKind !== "missing" && destinationKind !== "file") {
|
|
104
|
+
addUnsafe(plan, to, "迁移目标不是普通文件");
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (from === TRACKER_FROM) {
|
|
108
|
+
if (destinationKind === "file" && !sourceBytes.equals(fs.readFileSync(destination))) {
|
|
109
|
+
addConflict(plan, from, to, "项目 tracker 的新旧配置不一致,需人工处理");
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const index = operations.findIndex((operation) => operation.relativePath === TRACKER_TO);
|
|
113
|
+
if (index < 0) {
|
|
114
|
+
addConflict(plan, from, to, "当前阶段缺少 tracker 目标资产");
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (destinationKind === "missing") {
|
|
118
|
+
operations[index] = {
|
|
119
|
+
...operations[index], type: "render", desiredContent: sourceBytes,
|
|
120
|
+
desiredHash: digest(sourceBytes),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
addRemove(plan, from, "保留项目 tracker 原内容并退出旧路径", { action: "preserve-project-config", to });
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const recordedHash = managedFiles[from]?.contentHash;
|
|
127
|
+
if (!recordedHash || digest(sourceBytes) !== recordedHash) {
|
|
128
|
+
addConflict(plan, from, to, "缺少可信受管摘要或旧治理文件已被项目修改");
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const desired = desiredByPath.get(to);
|
|
132
|
+
if (!desired && !RETIRED_SOURCE_ONLY.has(from)) {
|
|
133
|
+
addConflict(plan, from, to, "目标阶段未安装对应治理资产,不能静默丢弃");
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (destinationKind === "file" && (!desired || digest(fs.readFileSync(destination)) !== desired.desiredHash)) {
|
|
137
|
+
addConflict(plan, from, to, "目标路径已存在且与当前模板不一致");
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
addRemove(plan, from, desired ? "可信旧治理文件由新模板取代" : "可信模板专用文件退出实例", {
|
|
141
|
+
action: desired ? "replace-with-current-template" : "retire-template-only",
|
|
142
|
+
to: desired ? to : null,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return { desiredOperations: operations, plan, legacyFiles };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function combineMigrationPlans(...plans) {
|
|
149
|
+
const targetDir = plans[0]?.targetDir;
|
|
150
|
+
const combined = createMigrationPlan(targetDir);
|
|
151
|
+
for (const plan of plans) {
|
|
152
|
+
combined.operations.push(...plan.operations);
|
|
153
|
+
combined.legacy.push(...plan.legacy);
|
|
154
|
+
combined.conflicts.push(...plan.conflicts);
|
|
155
|
+
combined.unsafe.push(...plan.unsafe);
|
|
156
|
+
}
|
|
157
|
+
return combined;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
module.exports = { prepareLayoutMigration, combineMigrationPlans, TRACKER_FROM, TRACKER_TO };
|
|
@@ -28,10 +28,10 @@ const LEGACY_SKILL_MAPPINGS = [
|
|
|
28
28
|
];
|
|
29
29
|
|
|
30
30
|
const LEGACY_FILE_MAPPINGS = [
|
|
31
|
-
["docs/templates/prd-template.md", "
|
|
31
|
+
["docs/templates/prd-template.md", ".template-spec/templates/spec-template.md"],
|
|
32
32
|
[
|
|
33
33
|
"docs/templates/vertical-slice-issue-template.md",
|
|
34
|
-
"
|
|
34
|
+
".template-spec/templates/vertical-slice-ticket-template.md",
|
|
35
35
|
],
|
|
36
36
|
];
|
|
37
37
|
|
|
@@ -124,10 +124,25 @@ function isWriteProtectedOwnership(ownership) {
|
|
|
124
124
|
return ownership === "user-owned" || ownership === "protected";
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
function projectAssetWriteViolation(relativePath) {
|
|
128
|
+
const path = normalizePolicyPath(relativePath);
|
|
129
|
+
if (path === "docs/implementation/.gitkeep" || path === "docs/requirements/tickets/.gitkeep") return null;
|
|
130
|
+
if (
|
|
131
|
+
path === "scaffold-architecture-decisions.yaml" ||
|
|
132
|
+
path.startsWith("docs/implementation/") ||
|
|
133
|
+
path.startsWith("docs/requirements/tickets/")
|
|
134
|
+
) {
|
|
135
|
+
return `${path} 是项目合同或决策资产,CLI 同步不得写入或清理`;
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
127
140
|
function ownershipWriteViolation(operation) {
|
|
141
|
+
const path = operation?.relativePath || operation?.path || "unknown";
|
|
142
|
+
const projectAssetViolation = projectAssetWriteViolation(path);
|
|
143
|
+
if (projectAssetViolation) return projectAssetViolation;
|
|
128
144
|
const ownership = operation?.ownership || "managed";
|
|
129
145
|
if (!isWriteProtectedOwnership(ownership)) return null;
|
|
130
|
-
const path = operation?.relativePath || operation?.path || "unknown";
|
|
131
146
|
return ownership === "protected"
|
|
132
147
|
? `${path} 被 ownership policy 标记为 protected,CLI 不得写入或覆盖`
|
|
133
148
|
: `${path} 被 ownership policy 标记为 user-owned,不属于受管模板文件`;
|
|
@@ -145,5 +160,6 @@ module.exports = {
|
|
|
145
160
|
resolveOwnership,
|
|
146
161
|
isTemplateManagedOwnership,
|
|
147
162
|
isWriteProtectedOwnership,
|
|
163
|
+
projectAssetWriteViolation,
|
|
148
164
|
ownershipWriteViolation,
|
|
149
165
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { isTemplateManagedOwnership } = require("./ownership-policy");
|
|
3
|
+
const { isTemplateManagedOwnership, projectAssetWriteViolation } = require("./ownership-policy");
|
|
4
4
|
const { resolveTemplateOwnership } = require("./ownership-runtime");
|
|
5
5
|
|
|
6
6
|
function classifyRemovedFiles({
|
|
@@ -29,6 +29,11 @@ function classifyRemovedFiles({
|
|
|
29
29
|
retainedRemoved.push({ path: relativePath, reason: "缺少可信受管基线" });
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
32
|
+
const projectAssetViolation = projectAssetWriteViolation(relativePath);
|
|
33
|
+
if (projectAssetViolation) {
|
|
34
|
+
retainedRemoved.push({ path: relativePath, reason: projectAssetViolation });
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
32
37
|
const recordedOwnership = record.ownership || getCurrentOwnership(relativePath);
|
|
33
38
|
const currentOwnership = getCurrentOwnership(relativePath);
|
|
34
39
|
if (
|