create-yss-spec 2.2.2 → 2.2.4
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 +17 -1
- package/package.json +1 -1
- package/src/cli.js +15 -1
- package/src/self-update.js +277 -0
- package/template/.agents/skills/yss-domain/SKILL.md +5 -4
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.agents/skills/yss-router/SKILL.md +5 -3
- package/template/.agents/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.agents/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.agents/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.agents/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.agents/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.agents/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.agents/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.agents/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.agents/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.agents/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.agents/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.agents/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.agents/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.agents/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.agents/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.agents/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.agents/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.agents/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/.claude/skills/yss-domain/SKILL.md +5 -4
- package/template/.claude/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.claude/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.claude/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.claude/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.claude/skills/yss-router/SKILL.md +5 -3
- package/template/.claude/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.claude/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.claude/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.claude/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.claude/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.claude/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.claude/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.claude/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.claude/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.claude/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.claude/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.claude/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.claude/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.claude/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.claude/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.claude/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.claude/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.claude/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.claude/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.claude/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.claude/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.claude/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.claude/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.claude/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.claude/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.claude/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/.codex/skills/yss-domain/SKILL.md +5 -4
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.codex/skills/yss-router/SKILL.md +5 -3
- package/template/.codex/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.codex/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.codex/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.codex/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.codex/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.codex/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.codex/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.codex/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.codex/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.codex/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.codex/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.codex/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.codex/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.codex/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.codex/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.codex/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.codex/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.codex/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/.cursor/skills/yss-domain/SKILL.md +5 -4
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.cursor/skills/yss-router/SKILL.md +5 -3
- package/template/.cursor/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.cursor/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.cursor/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.cursor/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.cursor/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.cursor/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.cursor/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.cursor/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.cursor/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.cursor/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.cursor/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.cursor/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.cursor/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.cursor/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.cursor/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.cursor/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.cursor/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/.hermes/skills/yss-domain/SKILL.md +5 -4
- package/template/.hermes/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.hermes/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.hermes/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.hermes/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.hermes/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.hermes/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.hermes/skills/yss-router/SKILL.md +5 -3
- package/template/.hermes/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.hermes/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.hermes/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.hermes/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.hermes/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.hermes/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.hermes/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.hermes/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.hermes/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.hermes/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.hermes/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.hermes/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.hermes/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.hermes/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.hermes/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.hermes/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.hermes/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.hermes/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.hermes/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.hermes/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.hermes/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.hermes/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.hermes/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.hermes/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.hermes/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.hermes/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/.pi/skills/yss-domain/SKILL.md +5 -4
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.pi/skills/yss-router/SKILL.md +5 -3
- package/template/.pi/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.pi/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.pi/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.pi/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.pi/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.pi/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.pi/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.pi/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.pi/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.pi/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.pi/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.pi/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.pi/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.pi/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.pi/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.pi/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.pi/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.pi/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/.qoder/skills/yss-domain/SKILL.md +5 -4
- package/template/.qoder/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.qoder/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.qoder/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.qoder/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.qoder/skills/yss-router/SKILL.md +5 -3
- package/template/.qoder/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.qoder/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.qoder/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.qoder/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.qoder/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.qoder/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.qoder/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.qoder/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.qoder/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.qoder/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.qoder/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.qoder/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.qoder/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.qoder/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.qoder/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.qoder/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.qoder/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.qoder/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.qoder/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.qoder/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.qoder/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.qoder/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.qoder/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.qoder/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.qoder/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.qoder/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/.trae/skills/yss-domain/SKILL.md +5 -4
- package/template/.trae/skills/yss-product-lifecycle/SKILL.md +9 -9
- package/template/.trae/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
- package/template/.trae/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration.md +8 -5
- package/template/.trae/skills/yss-product-lifecycle/references/state-model.md +9 -4
- package/template/.trae/skills/yss-router/SKILL.md +5 -3
- package/template/.trae/skills/yss-router/references/router-contract.yaml +18 -3
- package/template/.trae/skills/yss-router/references/slice-implementation-contract.md +59 -1
- package/template/.trae/skills/yss-stage-decision/SKILL.md +50 -0
- package/template/.trae/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
- package/template/.trae/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
- package/template/.trae/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
- package/template/.trae/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
- package/template/.trae/skills/yss-stage-decision/references/validation-rules.md +18 -0
- package/template/.trae/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
- package/template/.trae/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
- package/template/.trae/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
- package/template/.trae/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
- package/template/.trae/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
- package/template/.trae/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
- package/template/.trae/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
- package/template/.trae/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
- package/template/.trae/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
- package/template/.trae/skills/yss-tactical-design/SKILL.md +33 -0
- package/template/.trae/skills/yss-tactical-design/agents/openai.yaml +4 -0
- package/template/.trae/skills/yss-tactical-design/references/output-template.md +28 -0
- package/template/.trae/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
- package/template/.trae/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
- package/template/.trae/skills/yss-tactical-design/references/validation-rules.md +13 -0
- package/template/.trae/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
- package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
- package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
- package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
- package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
- package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
- package/template/.trae/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
- package/template/.trae/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
- package/template/AGENTS.md +8 -4
- package/template/CONTEXT.md +14 -2
- package/template/docs/agents/digital-human-roles.md +83 -0
- package/template/docs/agents/digital-human-roles.yaml +259 -0
- package/template/docs/agents/triage-labels.md +5 -5
- package/template/docs/agents/yss-skill-registry.yaml +12 -0
- package/template/docs/architecture/templates/system-overview-design-template.md +1 -0
- package/template/docs/process/lifecycle-artifact-map.md +8 -0
- package/template/docs/process/lifecycle-registry-baseline.json +11 -1
- package/template/docs/process/lifecycle-registry.yaml +46 -2
- package/template/docs/process/schemas/digital-human-task-package.schema.json +107 -0
- package/template/docs/process/schemas/lifecycle-checkpoint.schema.json +2 -1
- package/template/docs/process/schemas/subagent-task-package.schema.json +6 -0
- package/template/docs/process/subagent-collaboration.md +5 -3
- package/template/docs/process/templates/stage-checkpoint-template.md +3 -1
- package/template/docs/templates/approval-record-template.yaml +14 -0
- package/template/docs/templates/digital-human-runtime-profile-template.md +38 -0
- package/template/docs/templates/grok-bot-profile-template.md +24 -0
- package/template/docs/templates/implementation-routing-template.md +3 -3
- package/template/docs/templates/local-parent-ticket-template.md +8 -0
- package/template/docs/templates/subagent-task-package-template.md +43 -1
- package/template/docs/templates/vertical-slice-ticket-template.md +7 -0
- package/template/docs/user-guide//344/272/247/345/223/201/347/240/224/345/217/221/345/205/250/347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +2 -0
- package/template/scripts/lib/approval-record.mjs +123 -0
- package/template/scripts/lib/digital-human-roles.mjs +398 -0
- package/template/scripts/lib/lifecycle-transition.mjs +259 -0
- package/template/scripts/lib/scenario-checks.mjs +96 -2
- package/template/scripts/lib/task-package.mjs +214 -0
- package/template/scripts/verify-approval-record +13 -0
- package/template/scripts/verify-digital-human-roles +10 -0
- package/template/scripts/verify-digital-human-roles-scenarios +147 -0
- package/template/scripts/verify-digital-human-task-package +14 -0
- package/template/scripts/verify-digital-human-task-package-scenarios +8 -0
- package/template/scripts/verify-lifecycle-checkpoint +2 -0
- package/template/scripts/verify-lifecycle-transition-scenarios +105 -0
- package/template/scripts/verify-subagent-task-package +8 -0
- package/template/scripts/verify-subagent-task-package-scenarios +196 -0
- package/template/scripts/verify-template +16 -2
- package/template/skills-lock.json +35 -3
- package/template.snapshot.json +4 -4
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import { parseDocument } from "../../../../scripts/vendor/yaml.mjs";
|
|
5
|
+
|
|
6
|
+
const required = [
|
|
7
|
+
"schema_version", "tactical_design_id", "tactical_version", "status", "context_ref",
|
|
8
|
+
"aggregate_catalog", "entity_catalog", "value_object_catalog", "behavior_catalog",
|
|
9
|
+
"invariant_catalog", "state_transition_catalog", "consistency_policy", "domain_event_catalog",
|
|
10
|
+
"gateway_catalog", "persistence_mapping", "test_seams", "adr_candidates", "upstream_impact",
|
|
11
|
+
"version", "digest", "evidence_refs"
|
|
12
|
+
];
|
|
13
|
+
const statuses = new Set(["draft", "ready-for-human", "approved", "blocked", "stale", "drift", "new_impacts", "not-applicable"]);
|
|
14
|
+
const idPatterns = {
|
|
15
|
+
tactical_design_id: /^tactical-design\.[a-z0-9][a-z0-9-]*$/,
|
|
16
|
+
aggregate_id: /^aggregate\.[a-z0-9][a-z0-9-]*$/,
|
|
17
|
+
entity_id: /^entity\.[a-z0-9][a-z0-9-]*$/,
|
|
18
|
+
value_object_id: /^value-object\.[a-z0-9][a-z0-9-]*$/,
|
|
19
|
+
behavior_id: /^behavior\.[a-z0-9][a-z0-9-]*$/,
|
|
20
|
+
invariant_id: /^invariant\.[a-z0-9][a-z0-9-]*$/,
|
|
21
|
+
transition_id: /^transition\.[a-z0-9][a-z0-9-]*$/,
|
|
22
|
+
event_id: /^domain-event\.[a-z0-9][a-z0-9-]*$/,
|
|
23
|
+
gateway_id: /^gateway\.[a-z0-9][a-z0-9-]*$/,
|
|
24
|
+
seam_id: /^test-seam\.[a-z0-9][a-z0-9-]*$/,
|
|
25
|
+
version: /^v[0-9]+$/
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const isObject = (value) => value && typeof value === "object" && !Array.isArray(value);
|
|
29
|
+
const nonEmpty = (value) => typeof value === "string" && value.trim().length > 0;
|
|
30
|
+
const list = (value) => Array.isArray(value);
|
|
31
|
+
|
|
32
|
+
function unique(items, label, errors) {
|
|
33
|
+
const seen = new Set();
|
|
34
|
+
for (const item of items) {
|
|
35
|
+
if (seen.has(item)) errors.push(`${label} 重复: ${item}`);
|
|
36
|
+
seen.add(item);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function requireField(object, field, path, errors) {
|
|
41
|
+
if (!Object.prototype.hasOwnProperty.call(object ?? {}, field) || object[field] === null || object[field] === undefined) {
|
|
42
|
+
errors.push(`${path}.${field} 缺失`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function requireString(object, field, path, errors) {
|
|
47
|
+
requireField(object, field, path, errors);
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(object ?? {}, field) && !nonEmpty(object[field])) errors.push(`${path}.${field} 必须是非空字符串`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function requireArray(object, field, path, errors, minimum = 0) {
|
|
52
|
+
requireField(object, field, path, errors);
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(object ?? {}, field) && (!list(object[field]) || object[field].length < minimum)) {
|
|
54
|
+
errors.push(`${path}.${field} 必须是至少 ${minimum} 项的数组`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function requireId(value, kind, path, errors) {
|
|
59
|
+
if (value !== undefined && value !== null && !idPatterns[kind].test(String(value))) errors.push(`${path} 格式非法`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function refsExist(values, known, path, errors) {
|
|
63
|
+
for (const [index, value] of (values ?? []).entries()) {
|
|
64
|
+
if (!known.has(value)) errors.push(`${path}[${index}] 引用了未声明对象: ${value}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function validate(data) {
|
|
69
|
+
const errors = [];
|
|
70
|
+
if (!isObject(data)) return ["合同必须是对象"];
|
|
71
|
+
for (const field of required) requireField(data, field, "root", errors);
|
|
72
|
+
if (data.schema_version !== 1) errors.push("schema_version 必须为 1");
|
|
73
|
+
requireId(data.tactical_design_id, "tactical_design_id", "tactical_design_id", errors);
|
|
74
|
+
for (const field of ["tactical_version", "version"]) if (data[field] !== undefined && !idPatterns.version.test(String(data[field]))) errors.push(`${field} 必须形如 v1`);
|
|
75
|
+
if (data.status !== undefined && !statuses.has(data.status)) errors.push(`status 非法: ${data.status}`);
|
|
76
|
+
if (data.digest !== undefined && !/^sha256:[A-Fa-f0-9]{64}$/.test(String(data.digest))) errors.push("digest 必须为 sha256 加 64 位十六进制");
|
|
77
|
+
|
|
78
|
+
for (const field of ["aggregate_catalog", "entity_catalog", "behavior_catalog", "invariant_catalog", "state_transition_catalog", "gateway_catalog", "persistence_mapping", "test_seams"]) {
|
|
79
|
+
requireArray(data, field, "root", errors, 1);
|
|
80
|
+
}
|
|
81
|
+
for (const field of ["value_object_catalog", "domain_event_catalog", "adr_candidates", "evidence_refs"]) requireArray(data, field, "root", errors);
|
|
82
|
+
if (!isObject(data.consistency_policy)) errors.push("consistency_policy 必须是对象");
|
|
83
|
+
if (!isObject(data.upstream_impact)) errors.push("upstream_impact 必须是对象");
|
|
84
|
+
if (isObject(data.consistency_policy)) {
|
|
85
|
+
for (const field of ["transaction_boundary", "concurrency", "idempotency", "cross_aggregate_strategy"]) requireString(data.consistency_policy, field, "consistency_policy", errors);
|
|
86
|
+
}
|
|
87
|
+
if (isObject(data.upstream_impact)) {
|
|
88
|
+
for (const field of ["spec_ref", "strategic_ref", "api_ref", "data_ref"]) requireString(data.upstream_impact, field, "upstream_impact", errors);
|
|
89
|
+
if (data.upstream_impact.upstream_current === false && data.status !== "stale") errors.push("上游已过期时 status 必须为 stale");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const aggregates = list(data.aggregate_catalog) ? data.aggregate_catalog : [];
|
|
93
|
+
const entities = list(data.entity_catalog) ? data.entity_catalog : [];
|
|
94
|
+
const values = list(data.value_object_catalog) ? data.value_object_catalog : [];
|
|
95
|
+
const behaviors = list(data.behavior_catalog) ? data.behavior_catalog : [];
|
|
96
|
+
const invariants = list(data.invariant_catalog) ? data.invariant_catalog : [];
|
|
97
|
+
const transitions = list(data.state_transition_catalog) ? data.state_transition_catalog : [];
|
|
98
|
+
const events = list(data.domain_event_catalog) ? data.domain_event_catalog : [];
|
|
99
|
+
const gateways = list(data.gateway_catalog) ? data.gateway_catalog : [];
|
|
100
|
+
const mappings = list(data.persistence_mapping) ? data.persistence_mapping : [];
|
|
101
|
+
const seams = list(data.test_seams) ? data.test_seams : [];
|
|
102
|
+
const ids = (items, field, kind, label) => {
|
|
103
|
+
const result = new Set();
|
|
104
|
+
unique(items.map((item) => item?.[field]).filter(Boolean), label, errors);
|
|
105
|
+
for (const [index, item] of items.entries()) {
|
|
106
|
+
if (item?.[field]) { requireId(item[field], kind, `${label}[${index}].${field}`, errors); result.add(item[field]); }
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
};
|
|
110
|
+
const aggregateIds = ids(aggregates, "aggregate_id", "aggregate_id", "aggregate_id");
|
|
111
|
+
const entityIds = ids(entities, "entity_id", "entity_id", "entity_id");
|
|
112
|
+
const valueIds = ids(values, "value_object_id", "value_object_id", "value_object_id");
|
|
113
|
+
const behaviorIds = ids(behaviors, "behavior_id", "behavior_id", "behavior_id");
|
|
114
|
+
const invariantIds = ids(invariants, "invariant_id", "invariant_id", "invariant_id");
|
|
115
|
+
const transitionIds = ids(transitions, "transition_id", "transition_id", "transition_id");
|
|
116
|
+
const eventIds = ids(events, "event_id", "event_id", "event_id");
|
|
117
|
+
const gatewayIds = ids(gateways, "gateway_id", "gateway_id", "gateway_id");
|
|
118
|
+
ids(seams, "seam_id", "seam_id", "seam_id");
|
|
119
|
+
|
|
120
|
+
for (const [index, aggregate] of aggregates.entries()) {
|
|
121
|
+
const path = `aggregate_catalog[${index}]`;
|
|
122
|
+
if (!isObject(aggregate)) { errors.push(`${path} 必须是对象`); continue; }
|
|
123
|
+
for (const field of ["aggregate_id", "name", "context_ref", "root_entity", "consistency_boundary"]) requireString(aggregate, field, path, errors);
|
|
124
|
+
requireArray(aggregate, "invariant_refs", path, errors, 1); requireArray(aggregate, "behavior_refs", path, errors, 1);
|
|
125
|
+
if (aggregate.model_origin === "strategic-concept") errors.push(`${path}.model_origin 不得直接把战略概念当作 Aggregate`);
|
|
126
|
+
if (aggregate.api_exposure !== "internal-only") errors.push(`${path}.api_exposure 必须为 internal-only`);
|
|
127
|
+
if (aggregate.root_entity && !entityIds.has(aggregate.root_entity)) errors.push(`${path}.root_entity 未引用 Entity`);
|
|
128
|
+
const rootEntity = entities.find((entity) => entity?.entity_id === aggregate.root_entity);
|
|
129
|
+
if (rootEntity && rootEntity.aggregate_id !== aggregate.aggregate_id) errors.push(`${path}.root_entity 的 aggregate_id 必须与当前 Aggregate 一致`);
|
|
130
|
+
refsExist(aggregate.invariant_refs, invariantIds, `${path}.invariant_refs`, errors);
|
|
131
|
+
refsExist(aggregate.behavior_refs, behaviorIds, `${path}.behavior_refs`, errors);
|
|
132
|
+
}
|
|
133
|
+
for (const [index, entity] of entities.entries()) {
|
|
134
|
+
const path = `entity_catalog[${index}]`;
|
|
135
|
+
if (!isObject(entity)) { errors.push(`${path} 必须是对象`); continue; }
|
|
136
|
+
for (const field of ["entity_id", "name", "aggregate_id", "identity", "lifecycle"]) requireString(entity, field, path, errors);
|
|
137
|
+
if (entity.aggregate_id && !aggregateIds.has(entity.aggregate_id)) errors.push(`${path}.aggregate_id 未引用 Aggregate`);
|
|
138
|
+
}
|
|
139
|
+
for (const [index, value] of values.entries()) {
|
|
140
|
+
const path = `value_object_catalog[${index}]`;
|
|
141
|
+
if (!isObject(value)) { errors.push(`${path} 必须是对象`); continue; }
|
|
142
|
+
for (const field of ["value_object_id", "name", "aggregate_id", "immutable"]) requireField(value, field, path, errors);
|
|
143
|
+
if (typeof value.immutable !== "boolean" || value.immutable !== true) errors.push(`${path}.immutable 必须为 true`);
|
|
144
|
+
if (value.aggregate_id && !aggregateIds.has(value.aggregate_id)) errors.push(`${path}.aggregate_id 未引用 Aggregate`);
|
|
145
|
+
}
|
|
146
|
+
for (const [index, behavior] of behaviors.entries()) {
|
|
147
|
+
const path = `behavior_catalog[${index}]`;
|
|
148
|
+
if (!isObject(behavior)) { errors.push(`${path} 必须是对象`); continue; }
|
|
149
|
+
for (const field of ["behavior_id", "name", "aggregate_id", "command"]) requireString(behavior, field, path, errors);
|
|
150
|
+
for (const field of ["preconditions", "invariant_refs", "postconditions", "event_refs"]) requireArray(behavior, field, path, errors, field === "invariant_refs" ? 1 : 0);
|
|
151
|
+
if (behavior.aggregate_id && !aggregateIds.has(behavior.aggregate_id)) errors.push(`${path}.aggregate_id 未引用 Aggregate`);
|
|
152
|
+
refsExist(behavior.invariant_refs, invariantIds, `${path}.invariant_refs`, errors);
|
|
153
|
+
refsExist(behavior.event_refs, eventIds, `${path}.event_refs`, errors);
|
|
154
|
+
}
|
|
155
|
+
for (const [index, invariant] of invariants.entries()) {
|
|
156
|
+
const path = `invariant_catalog[${index}]`;
|
|
157
|
+
if (!isObject(invariant)) { errors.push(`${path} 必须是对象`); continue; }
|
|
158
|
+
for (const field of ["invariant_id", "aggregate_id", "statement"]) requireString(invariant, field, path, errors);
|
|
159
|
+
if (invariant.aggregate_id && !aggregateIds.has(invariant.aggregate_id)) errors.push(`${path}.aggregate_id 未引用 Aggregate`);
|
|
160
|
+
}
|
|
161
|
+
for (const [index, transition] of transitions.entries()) {
|
|
162
|
+
const path = `state_transition_catalog[${index}]`;
|
|
163
|
+
if (!isObject(transition)) { errors.push(`${path} 必须是对象`); continue; }
|
|
164
|
+
for (const field of ["transition_id", "aggregate_id", "from", "to", "behavior_id"]) requireString(transition, field, path, errors);
|
|
165
|
+
if (transition.aggregate_id && !aggregateIds.has(transition.aggregate_id)) errors.push(`${path}.aggregate_id 未引用 Aggregate`);
|
|
166
|
+
if (transition.behavior_id && !behaviorIds.has(transition.behavior_id)) errors.push(`${path}.behavior_id 未引用行为`);
|
|
167
|
+
}
|
|
168
|
+
for (const [index, event] of events.entries()) {
|
|
169
|
+
const path = `domain_event_catalog[${index}]`;
|
|
170
|
+
if (!isObject(event)) { errors.push(`${path} 必须是对象`); continue; }
|
|
171
|
+
for (const field of ["event_id", "name", "aggregate_id", "delivery"]) requireString(event, field, path, errors);
|
|
172
|
+
requireArray(event, "consumers", path, errors, 0);
|
|
173
|
+
if (event.aggregate_id && !aggregateIds.has(event.aggregate_id)) errors.push(`${path}.aggregate_id 未引用 Aggregate`);
|
|
174
|
+
}
|
|
175
|
+
for (const [index, gateway] of gateways.entries()) {
|
|
176
|
+
const path = `gateway_catalog[${index}]`;
|
|
177
|
+
if (!isObject(gateway)) { errors.push(`${path} 必须是对象`); continue; }
|
|
178
|
+
for (const field of ["gateway_id", "name", "context_ref", "layer"]) requireString(gateway, field, path, errors);
|
|
179
|
+
requireArray(gateway, "capabilities", path, errors, 1);
|
|
180
|
+
if (gateway.layer !== "Domain") errors.push(`${path}.layer 必须为 Domain,Infrastructure 只实现 Gateway`);
|
|
181
|
+
}
|
|
182
|
+
for (const [index, mapping] of mappings.entries()) {
|
|
183
|
+
const path = `persistence_mapping[${index}]`;
|
|
184
|
+
if (!isObject(mapping)) { errors.push(`${path} 必须是对象`); continue; }
|
|
185
|
+
for (const field of ["aggregate_id", "storage_model", "notes"]) requireString(mapping, field, path, errors);
|
|
186
|
+
if (mapping.aggregate_id && !aggregateIds.has(mapping.aggregate_id)) errors.push(`${path}.aggregate_id 未引用 Aggregate`);
|
|
187
|
+
}
|
|
188
|
+
for (const [index, seam] of seams.entries()) {
|
|
189
|
+
const path = `test_seams[${index}]`;
|
|
190
|
+
if (!isObject(seam)) { errors.push(`${path} 必须是对象`); continue; }
|
|
191
|
+
for (const field of ["seam_id", "kind", "subject_ref", "assertion"]) requireString(seam, field, path, errors);
|
|
192
|
+
if (seam.subject_ref && !new Set([...aggregateIds, ...entityIds, ...valueIds, ...behaviorIds, ...invariantIds, ...transitionIds, ...gatewayIds]).has(seam.subject_ref)) errors.push(`${path}.subject_ref 未引用已声明领域对象`);
|
|
193
|
+
}
|
|
194
|
+
if (isObject(data.complexity) && data.complexity.escalate_to_standalone === true && !nonEmpty(data.complexity.standalone_ref)) errors.push("complexity.escalate_to_standalone 为 true 时必须提供 standalone_ref");
|
|
195
|
+
return errors;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async function main() {
|
|
199
|
+
const file = process.argv[2];
|
|
200
|
+
if (!file) throw new Error("用法: validate-tactical-design.mjs <contract.yaml>");
|
|
201
|
+
const source = await readFile(file, "utf8");
|
|
202
|
+
const document = parseDocument(source, { maxAliasCount: 0, uniqueKeys: true });
|
|
203
|
+
if (document.errors.length) throw new Error(`无法解析合同: ${document.errors[0].message}`);
|
|
204
|
+
const errors = validate(document.toJS({ maxAliasCount: 0 }));
|
|
205
|
+
if (errors.length) {
|
|
206
|
+
process.stderr.write(`${JSON.stringify({ result: "blocked", errors }, null, 2)}\n`);
|
|
207
|
+
process.exitCode = 1;
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
process.stdout.write(`${JSON.stringify({ result: "ready-for-lifecycle-review", tactical_design_id: document.get("tactical_design_id"), status: document.get("status") }, null, 2)}\n`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
main().catch((error) => { process.stderr.write(`${error.message}\n`); process.exitCode = 1; });
|
package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
tactical_design_id: tactical-design.invalid-api
|
|
3
|
+
tactical_version: v1
|
|
4
|
+
status: ready-for-human
|
|
5
|
+
context_ref: context.example
|
|
6
|
+
aggregate_catalog: [{aggregate_id: aggregate.example, name: Example, context_ref: context.example, root_entity: entity.example-root, invariant_refs: [invariant.example], behavior_refs: [behavior.example], consistency_boundary: single, api_exposure: public-aggregate}]
|
|
7
|
+
entity_catalog: [{entity_id: entity.example-root, name: Root, aggregate_id: aggregate.example, identity: id, lifecycle: active}]
|
|
8
|
+
value_object_catalog: []
|
|
9
|
+
behavior_catalog: [{behavior_id: behavior.example, name: Do, aggregate_id: aggregate.example, command: do, preconditions: [ready], invariant_refs: [invariant.example], postconditions: [done], event_refs: []}]
|
|
10
|
+
invariant_catalog: [{invariant_id: invariant.example, aggregate_id: aggregate.example, statement: required}]
|
|
11
|
+
state_transition_catalog: [{transition_id: transition.example, aggregate_id: aggregate.example, from: draft, to: done, behavior_id: behavior.example}]
|
|
12
|
+
consistency_policy: {transaction_boundary: single, concurrency: optimistic, idempotency: guarded, cross_aggregate_strategy: none}
|
|
13
|
+
domain_event_catalog: []
|
|
14
|
+
gateway_catalog: [{gateway_id: gateway.example, name: Gateway, context_ref: context.example, layer: Domain, capabilities: [load]}]
|
|
15
|
+
persistence_mapping: [{aggregate_id: aggregate.example, storage_model: example, notes: mapping}]
|
|
16
|
+
test_seams: [{seam_id: test-seam.example, kind: domain, subject_ref: invariant.example, assertion: behavior}]
|
|
17
|
+
adr_candidates: []
|
|
18
|
+
upstream_impact: {spec_ref: spec@v1, strategic_ref: strategy@v1, api_ref: api@draft, data_ref: data@v1, upstream_current: true}
|
|
19
|
+
version: v1
|
|
20
|
+
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
|
21
|
+
evidence_refs: []
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
tactical_design_id: tactical-design.invalid-consistency
|
|
3
|
+
tactical_version: v1
|
|
4
|
+
status: ready-for-human
|
|
5
|
+
context_ref: context.example
|
|
6
|
+
aggregate_catalog: [{aggregate_id: aggregate.example, name: Example, context_ref: context.example, root_entity: entity.example-root, invariant_refs: [invariant.example], behavior_refs: [behavior.example], consistency_boundary: single, api_exposure: internal-only}]
|
|
7
|
+
entity_catalog: [{entity_id: entity.example-root, name: Root, aggregate_id: aggregate.example, identity: id, lifecycle: active}]
|
|
8
|
+
value_object_catalog: []
|
|
9
|
+
behavior_catalog: [{behavior_id: behavior.example, name: Do, aggregate_id: aggregate.example, command: do, preconditions: [ready], invariant_refs: [invariant.example], postconditions: [done], event_refs: []}]
|
|
10
|
+
invariant_catalog: [{invariant_id: invariant.example, aggregate_id: aggregate.example, statement: required}]
|
|
11
|
+
state_transition_catalog: [{transition_id: transition.example, aggregate_id: aggregate.example, from: draft, to: done, behavior_id: behavior.example}]
|
|
12
|
+
consistency_policy: {}
|
|
13
|
+
domain_event_catalog: []
|
|
14
|
+
gateway_catalog: [{gateway_id: gateway.example, name: Gateway, context_ref: context.example, layer: Domain, capabilities: [load]}]
|
|
15
|
+
persistence_mapping: [{aggregate_id: aggregate.example, storage_model: example, notes: mapping}]
|
|
16
|
+
test_seams: [{seam_id: test-seam.example, kind: domain, subject_ref: invariant.example, assertion: behavior}]
|
|
17
|
+
adr_candidates: []
|
|
18
|
+
upstream_impact: {spec_ref: spec@v1, strategic_ref: strategy@v1, api_ref: api@draft, data_ref: data@v1, upstream_current: true}
|
|
19
|
+
version: v1
|
|
20
|
+
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
|
21
|
+
evidence_refs: []
|
package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
tactical_design_id: tactical-design.invalid-missing-invariant
|
|
3
|
+
tactical_version: v1
|
|
4
|
+
status: ready-for-human
|
|
5
|
+
context_ref: context.example
|
|
6
|
+
aggregate_catalog: [{aggregate_id: aggregate.example, name: Example, context_ref: context.example, root_entity: entity.example-root, invariant_refs: [], behavior_refs: [behavior.example], consistency_boundary: single, api_exposure: internal-only}]
|
|
7
|
+
entity_catalog: [{entity_id: entity.example-root, name: Root, aggregate_id: aggregate.example, identity: id, lifecycle: active}]
|
|
8
|
+
value_object_catalog: []
|
|
9
|
+
behavior_catalog: [{behavior_id: behavior.example, name: Do, aggregate_id: aggregate.example, command: do, preconditions: [], invariant_refs: [], postconditions: [], event_refs: []}]
|
|
10
|
+
invariant_catalog: []
|
|
11
|
+
state_transition_catalog: [{transition_id: transition.example, aggregate_id: aggregate.example, from: draft, to: done, behavior_id: behavior.example}]
|
|
12
|
+
consistency_policy: {transaction_boundary: single, concurrency: optimistic, idempotency: guarded, cross_aggregate_strategy: none}
|
|
13
|
+
domain_event_catalog: []
|
|
14
|
+
gateway_catalog: [{gateway_id: gateway.example, name: Gateway, context_ref: context.example, layer: Domain, capabilities: [load]}]
|
|
15
|
+
persistence_mapping: [{aggregate_id: aggregate.example, storage_model: example, notes: mapping}]
|
|
16
|
+
test_seams: [{seam_id: test-seam.example, kind: domain, subject_ref: aggregate.example, assertion: behavior}]
|
|
17
|
+
adr_candidates: []
|
|
18
|
+
upstream_impact: {spec_ref: spec@v1, strategic_ref: strategy@v1, api_ref: api@draft, data_ref: data@v1, upstream_current: true}
|
|
19
|
+
version: v1
|
|
20
|
+
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
|
21
|
+
evidence_refs: []
|
package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
tactical_design_id: tactical-design.invalid-stale
|
|
3
|
+
tactical_version: v1
|
|
4
|
+
status: ready-for-human
|
|
5
|
+
context_ref: context.example
|
|
6
|
+
aggregate_catalog: [{aggregate_id: aggregate.example, name: Example, context_ref: context.example, root_entity: entity.example-root, invariant_refs: [invariant.example], behavior_refs: [behavior.example], consistency_boundary: single, api_exposure: internal-only}]
|
|
7
|
+
entity_catalog: [{entity_id: entity.example-root, name: Root, aggregate_id: aggregate.example, identity: id, lifecycle: active}]
|
|
8
|
+
value_object_catalog: []
|
|
9
|
+
behavior_catalog: [{behavior_id: behavior.example, name: Do, aggregate_id: aggregate.example, command: do, preconditions: [ready], invariant_refs: [invariant.example], postconditions: [done], event_refs: []}]
|
|
10
|
+
invariant_catalog: [{invariant_id: invariant.example, aggregate_id: aggregate.example, statement: required}]
|
|
11
|
+
state_transition_catalog: [{transition_id: transition.example, aggregate_id: aggregate.example, from: draft, to: done, behavior_id: behavior.example}]
|
|
12
|
+
consistency_policy: {transaction_boundary: single, concurrency: optimistic, idempotency: guarded, cross_aggregate_strategy: none}
|
|
13
|
+
domain_event_catalog: []
|
|
14
|
+
gateway_catalog: [{gateway_id: gateway.example, name: Gateway, context_ref: context.example, layer: Domain, capabilities: [load]}]
|
|
15
|
+
persistence_mapping: [{aggregate_id: aggregate.example, storage_model: example, notes: mapping}]
|
|
16
|
+
test_seams: [{seam_id: test-seam.example, kind: domain, subject_ref: invariant.example, assertion: behavior}]
|
|
17
|
+
adr_candidates: []
|
|
18
|
+
upstream_impact: {spec_ref: spec@v1, strategic_ref: strategy@v1, api_ref: api@draft, data_ref: data@v1, upstream_current: false}
|
|
19
|
+
version: v1
|
|
20
|
+
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
|
21
|
+
evidence_refs: []
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
tactical_design_id: tactical-design.invalid-strategic
|
|
3
|
+
tactical_version: v1
|
|
4
|
+
status: ready-for-human
|
|
5
|
+
context_ref: context.example
|
|
6
|
+
aggregate_catalog: [{aggregate_id: aggregate.example, name: Example, context_ref: context.example, root_entity: entity.example-root, model_origin: strategic-concept, invariant_refs: [invariant.example], behavior_refs: [behavior.example], consistency_boundary: single, api_exposure: internal-only}]
|
|
7
|
+
entity_catalog: [{entity_id: entity.example-root, name: Root, aggregate_id: aggregate.example, identity: id, lifecycle: active}]
|
|
8
|
+
value_object_catalog: []
|
|
9
|
+
behavior_catalog: [{behavior_id: behavior.example, name: Do, aggregate_id: aggregate.example, command: do, preconditions: [ready], invariant_refs: [invariant.example], postconditions: [done], event_refs: []}]
|
|
10
|
+
invariant_catalog: [{invariant_id: invariant.example, aggregate_id: aggregate.example, statement: required}]
|
|
11
|
+
state_transition_catalog: [{transition_id: transition.example, aggregate_id: aggregate.example, from: draft, to: done, behavior_id: behavior.example}]
|
|
12
|
+
consistency_policy: {transaction_boundary: single, concurrency: optimistic, idempotency: guarded, cross_aggregate_strategy: none}
|
|
13
|
+
domain_event_catalog: []
|
|
14
|
+
gateway_catalog: [{gateway_id: gateway.example, name: Gateway, context_ref: context.example, layer: Domain, capabilities: [load]}]
|
|
15
|
+
persistence_mapping: [{aggregate_id: aggregate.example, storage_model: example, notes: mapping}]
|
|
16
|
+
test_seams: [{seam_id: test-seam.example, kind: domain, subject_ref: invariant.example, assertion: behavior}]
|
|
17
|
+
adr_candidates: []
|
|
18
|
+
upstream_impact: {spec_ref: spec@v1, strategic_ref: strategy@v1, api_ref: api@draft, data_ref: data@v1, upstream_current: true}
|
|
19
|
+
version: v1
|
|
20
|
+
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
|
21
|
+
evidence_refs: []
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
tactical_design_id: tactical-design.example-feature
|
|
3
|
+
tactical_version: v1
|
|
4
|
+
status: ready-for-human
|
|
5
|
+
context_ref: context.example
|
|
6
|
+
aggregate_catalog:
|
|
7
|
+
- aggregate_id: aggregate.example
|
|
8
|
+
name: ExampleAggregate
|
|
9
|
+
context_ref: context.example
|
|
10
|
+
root_entity: entity.example-root
|
|
11
|
+
invariant_refs: [invariant.example-required]
|
|
12
|
+
behavior_refs: [behavior.example-publish]
|
|
13
|
+
consistency_boundary: single-aggregate-transaction
|
|
14
|
+
api_exposure: internal-only
|
|
15
|
+
entity_catalog:
|
|
16
|
+
- entity_id: entity.example-root
|
|
17
|
+
name: ExampleRoot
|
|
18
|
+
aggregate_id: aggregate.example
|
|
19
|
+
identity: stable-id
|
|
20
|
+
lifecycle: draft-published
|
|
21
|
+
value_object_catalog:
|
|
22
|
+
- value_object_id: value-object.example-code
|
|
23
|
+
name: ExampleCode
|
|
24
|
+
aggregate_id: aggregate.example
|
|
25
|
+
immutable: true
|
|
26
|
+
behavior_catalog:
|
|
27
|
+
- behavior_id: behavior.example-publish
|
|
28
|
+
name: Publish
|
|
29
|
+
aggregate_id: aggregate.example
|
|
30
|
+
command: publish
|
|
31
|
+
preconditions: ["状态为 draft"]
|
|
32
|
+
invariant_refs: [invariant.example-required]
|
|
33
|
+
postconditions: ["状态变为 published"]
|
|
34
|
+
event_refs: [domain-event.example-published]
|
|
35
|
+
invariant_catalog:
|
|
36
|
+
- invariant_id: invariant.example-required
|
|
37
|
+
aggregate_id: aggregate.example
|
|
38
|
+
statement: "发布前必须满足业务前置条件"
|
|
39
|
+
state_transition_catalog:
|
|
40
|
+
- transition_id: transition.example-publish
|
|
41
|
+
aggregate_id: aggregate.example
|
|
42
|
+
from: draft
|
|
43
|
+
to: published
|
|
44
|
+
behavior_id: behavior.example-publish
|
|
45
|
+
consistency_policy:
|
|
46
|
+
transaction_boundary: single aggregate
|
|
47
|
+
concurrency: optimistic version check
|
|
48
|
+
idempotency: repeated publish is rejected by state guard
|
|
49
|
+
cross_aggregate_strategy: domain event with retry
|
|
50
|
+
domain_event_catalog:
|
|
51
|
+
- event_id: domain-event.example-published
|
|
52
|
+
name: ExamplePublished
|
|
53
|
+
aggregate_id: aggregate.example
|
|
54
|
+
consumers: [downstream-context]
|
|
55
|
+
delivery: outbox-at-least-once
|
|
56
|
+
gateway_catalog:
|
|
57
|
+
- gateway_id: gateway.example
|
|
58
|
+
name: ExampleGateway
|
|
59
|
+
context_ref: context.example
|
|
60
|
+
layer: Domain
|
|
61
|
+
capabilities: [save aggregate, load aggregate]
|
|
62
|
+
persistence_mapping:
|
|
63
|
+
- aggregate_id: aggregate.example
|
|
64
|
+
storage_model: example_aggregate_snapshot
|
|
65
|
+
notes: "持久化结构不泄漏到领域模型"
|
|
66
|
+
test_seams:
|
|
67
|
+
- seam_id: test-seam.example-invariant
|
|
68
|
+
kind: domain-behavior
|
|
69
|
+
subject_ref: invariant.example-required
|
|
70
|
+
assertion: "不满足前置条件时 publish 失败"
|
|
71
|
+
adr_candidates: []
|
|
72
|
+
upstream_impact:
|
|
73
|
+
spec_ref: docs/.scratch/example/spec.yaml@v1
|
|
74
|
+
strategic_ref: docs/.scratch/example/domain-strategy.yaml@v1
|
|
75
|
+
api_ref: docs/.scratch/example/openapi.yaml@draft
|
|
76
|
+
data_ref: docs/.scratch/example/data-architecture.md@v1
|
|
77
|
+
upstream_current: true
|
|
78
|
+
version: v1
|
|
79
|
+
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
|
80
|
+
evidence_refs: [docs/.scratch/example/tactical-review.yaml]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
|
|
8
|
+
const root = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const validator = join(root, "..", "scripts", "validate-tactical-design.mjs");
|
|
10
|
+
const fixture = (name) => join(root, "fixtures", name);
|
|
11
|
+
const run = (file) => spawnSync(process.execPath, [validator, file], { encoding: "utf8" });
|
|
12
|
+
const pass = run(fixture("valid-tactical-design.yaml"));
|
|
13
|
+
if (pass.status !== 0) throw new Error(`valid tactical design should pass: ${pass.stderr}`);
|
|
14
|
+
|
|
15
|
+
const blockedCases = [
|
|
16
|
+
["invalid-missing-invariant.yaml", "invariant_refs 必须是至少 1 项的数组"],
|
|
17
|
+
["invalid-api-leaks-aggregate.yaml", "api_exposure 必须为 internal-only"],
|
|
18
|
+
["invalid-stale-upstream-ref.yaml", "status 必须为 stale"],
|
|
19
|
+
["invalid-strategic-as-tactical.yaml", "不得直接把战略概念当作 Aggregate"],
|
|
20
|
+
["invalid-missing-consistency-policy.yaml", "consistency_policy.transaction_boundary 缺失"]
|
|
21
|
+
];
|
|
22
|
+
for (const [name, message] of blockedCases) {
|
|
23
|
+
const result = run(fixture(name));
|
|
24
|
+
if (result.status === 0 || !result.stderr.includes(message)) throw new Error(`${name} should be blocked: ${result.stderr}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const temporaryRoot = await mkdtemp(join(tmpdir(), "yss-tactical-design-pressure-"));
|
|
28
|
+
try {
|
|
29
|
+
const source = await readFile(fixture("valid-tactical-design.yaml"), "utf8");
|
|
30
|
+
const escalated = join(temporaryRoot, "missing-standalone-ref.yaml");
|
|
31
|
+
await writeFile(escalated, `${source}\ncomplexity:\n escalate_to_standalone: true\n`);
|
|
32
|
+
const result = run(escalated);
|
|
33
|
+
if (result.status === 0 || !result.stderr.includes("standalone_ref")) throw new Error("complexity escalation without standalone_ref should be blocked");
|
|
34
|
+
|
|
35
|
+
const wrongGateway = join(temporaryRoot, "wrong-gateway-layer.yaml");
|
|
36
|
+
await writeFile(wrongGateway, source.replace("layer: Domain", "layer: Infrastructure"));
|
|
37
|
+
const gatewayResult = run(wrongGateway);
|
|
38
|
+
if (gatewayResult.status === 0 || !gatewayResult.stderr.includes("layer 必须为 Domain")) throw new Error("Infrastructure gateway should be blocked");
|
|
39
|
+
|
|
40
|
+
const crossAggregateRoot = join(temporaryRoot, "cross-aggregate-root.yaml");
|
|
41
|
+
await writeFile(crossAggregateRoot, source.replace("aggregate_id: aggregate.example\n identity", "aggregate_id: aggregate.other\n identity"));
|
|
42
|
+
const crossAggregateResult = run(crossAggregateRoot);
|
|
43
|
+
if (crossAggregateResult.status === 0 || !crossAggregateResult.stderr.includes("root_entity 的 aggregate_id 必须与当前 Aggregate 一致")) throw new Error("cross-aggregate root should be blocked");
|
|
44
|
+
} finally {
|
|
45
|
+
await rm(temporaryRoot, { recursive: true, force: true });
|
|
46
|
+
}
|
|
47
|
+
process.stdout.write("DDD tactical design scenarios passed\n");
|
|
@@ -5,7 +5,7 @@ description: 用于构建或重构 YSS 领域层代码。当用户要求设计
|
|
|
5
5
|
|
|
6
6
|
# yss-domain
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
这是一个领域实现 skill。核心目标是消费已批准的战术模型,将领域行为落实为代码;战术模型的设计与批准由 `yss-tactical-design` 和 `yss-product-lifecycle` 负责。
|
|
9
9
|
|
|
10
10
|
默认输出是新 DDD target profile;现有 YSS 组件仓库常见 `core/client/repository`、贫血对象和 VO 型 Gateway 只是 legacy profile,不得静默复制成新模块架构。
|
|
11
11
|
|
|
@@ -23,10 +23,10 @@ description: 用于构建或重构 YSS 领域层代码。当用户要求设计
|
|
|
23
23
|
|
|
24
24
|
## 工作方式
|
|
25
25
|
|
|
26
|
-
1.
|
|
26
|
+
1. 先读取批准且版本当前的 tactical-design contract 和 Slice Implementation Contract。
|
|
27
27
|
2. 数据库字段只做补充,不直接决定领域对象结构。
|
|
28
|
-
3.
|
|
29
|
-
4.
|
|
28
|
+
3. 按合同实现领域行为、状态机、不变量和 Gateway 边界。
|
|
29
|
+
4. 规则不清晰或模型需要扩展时,返回 `new_impacts` / `drift` 并停止,不要静默猜测。
|
|
30
30
|
|
|
31
31
|
## 产物范围
|
|
32
32
|
|
|
@@ -63,6 +63,7 @@ description: 用于构建或重构 YSS 领域层代码。当用户要求设计
|
|
|
63
63
|
## 阶段 7 合同
|
|
64
64
|
|
|
65
65
|
- 只消费生命周期已批准的 `Slice Implementation Contract` 和当前 `work_unit`;不得扩大 `allowed_write_paths`。
|
|
66
|
+
- `Slice Implementation Contract` 必须引用批准且版本当前的 `tactical_design_ref`;不得在实现阶段重新批准或替换聚合、不变量和一致性策略。
|
|
66
67
|
- 领域规则、状态机和不变量必须使用 `behavior-tdd`,先形成失败测试,再实现最小行为。
|
|
67
68
|
- 完成后按 `yss-router/references/yss-skill-execution-result.md` 返回统一 `YSS Skill Execution Result`:changed files、领域/测试证据、实际验证结果、偏离和新增影响。
|
|
68
69
|
- 发现新 API、权限、状态机、数据模型或架构影响时填入 `new_impacts` 并暂停,不得静默扩张切片。
|
|
@@ -11,10 +11,10 @@ description: 编排 YSS 产品或模块从机会调研到 Spec、原型、技术
|
|
|
11
11
|
|
|
12
12
|
1. 先读取 `yss-project.yaml`、`CONTEXT.md`、相关 ADR、父 Ticket/checkpoint 和当前资产。
|
|
13
13
|
2. `repository_mode=template-source` 只走模板维护流程;命中产品流程时返回 `blocked: template-source-product-artifact-forbidden`,不得生成产品 Spec、原型、OpenAPI 或切片 Ticket。
|
|
14
|
-
3. `repository_mode=project-instance` 以 `docs/process/lifecycle-registry.yaml`、`harness-process-tailoring.md` 和本目录 references
|
|
14
|
+
3. `repository_mode=project-instance` 以 `docs/process/lifecycle-registry.yaml`、`harness-process-tailoring.md` 和本目录 references 为唯一阶段、门禁和裁剪事实源。数字人角色、阶段协作组、运行时绑定与会签级别以 `docs/agents/digital-human-roles.yaml` 为准;职称实例不另起编排器。
|
|
15
15
|
4. 模式:`route` 只读规划;`orchestrate` 有界推进;`resume` 重建后推进;`audit` 严格只读。未明确时使用 `route`。
|
|
16
16
|
|
|
17
|
-
Matt 的 `grill-with-docs`、`to-spec`、`to-tickets`、`implement` 等保留为显式兼容入口;默认路径是本 skill
|
|
17
|
+
Matt 的 `grill-with-docs`、`to-spec`、`to-tickets`、`implement` 等保留为显式兼容入口;默认路径是本 skill 持有的原生工作单元,由本编排器创建正式资产、维护状态并在会签门禁暂停(级别见数字人角色注册表)。兼容入口不得自动调用它们或代替其创建正式资产;Matt 只导航,不得写生命周期资产或改变门禁/Ticket 状态;任何写入前回交本编排器。
|
|
18
18
|
|
|
19
19
|
## 不可裁剪的主链
|
|
20
20
|
|
|
@@ -27,14 +27,14 @@ Matt 的 `grill-with-docs`、`to-spec`、`to-tickets`、`implement` 等保留为
|
|
|
27
27
|
| 阶段 | 必需产物/门禁 | 工作单元与技能 | 通过条件 |
|
|
28
28
|
|---|---|---|---|
|
|
29
29
|
| 入口分诊 | 身份、影响面、最近可信阶段 | `yss-product-lifecycle` | `yss-project.yaml` 合法且影响面可解释 |
|
|
30
|
-
| 机会调研/需求分析 | Discovery、用户/MVP/非目标/成功标准、测试 seam | `work-unit.discovery-opportunity` + `work-unit.discovery-requirements`;市场/竞品事实用 `competitive-intelligence`,技术/标准事实用 `research`;`grill-with-docs` 为兼容入口 | 未决事实已 research 或 handoff
|
|
31
|
-
| Spec/功能架构 | Spec、产品总体设计、功能架构;必要时 Spec Delta | 原生 `work-unit.spec-synthesis`;`to-spec` 为兼容入口 | 初稿先为 `ready-for-human`;只有 Spec baseline
|
|
30
|
+
| 机会调研/需求分析 | Discovery、用户/MVP/非目标/成功标准、测试 seam;命中 DDD 影响时补充领域战略设计与阶段决策包 | `work-unit.discovery-opportunity` + `work-unit.discovery-requirements` + `work-unit.domain-strategy-design` + `work-unit.stage-decision`;市场/竞品事实用 `competitive-intelligence`,技术/标准事实用 `research`;领域建模用 `domain-modeling`;`grill-with-docs` 为兼容入口 | 未决事实已 research 或 handoff,领域边界和统一语言可审查,阶段决策包完成必要批准 |
|
|
31
|
+
| Spec/功能架构 | Spec、产品总体设计、功能架构;必要时 Spec Delta | 原生 `work-unit.spec-synthesis`;`to-spec` 为兼容入口 | 初稿先为 `ready-for-human`;只有 Spec baseline 会签批准后资产才为 `approved` 并进入下游 |
|
|
32
32
|
| 原型设计 | 交互说明、低保真、状态矩阵、高保真 HTML、评审记录 | `yss-design-system` → `yss-prototype-stage` → `yss-antd-design`(仅原型事实)→ Codex `product-design:index`(非 Codex 交付等价合同)。前端落地改用 `yss-ui` | `gate.prototype-reviewed`、`gate.prototype-verified`、`gate.user-confirmation` 均有证据 |
|
|
33
|
-
| 技术分析 | OpenAPI Draft/Freeze
|
|
33
|
+
| 技术分析 | OpenAPI Draft/Freeze、数据架构、工程基线、架构审查;按领域影响执行 Tactical DDD Check | `yss-openapi-governance` / `yss-openapi-draft-review`、`codebase-design`、`implementation-repo-onboarding`、`yss-tactical-design`、`yss-router` | API/架构契约冻结;无 API 影响有明确记录;战术模型无未解释冲突;脚手架策略满足 |
|
|
34
34
|
| Ticket 正式化 | 功能父 Ticket、垂直切片、Slice Implementation Contract | 原生 `work-unit.ticket-decomposition`;`to-tickets` 为兼容入口;生命周期复算 | 依赖、验收、测试 seam 可执行;合同已批准、持久化且为当前版本 |
|
|
35
|
-
| 技术实现 | 前端/后端代码、TDD 证据、YSS Skill Execution Result | 原生 `work-unit.slice-implementation`;`implement` 为兼容入口;前端按 `yss-ui` + `yss-page-module-development`,后端按 `yss-router` 最小闭包,业务行为统一 `tdd` |
|
|
35
|
+
| 技术实现 | 前端/后端代码、TDD 证据、YSS Skill Execution Result | 原生 `work-unit.slice-implementation`;`implement` 为兼容入口;前端按 `yss-ui` + `yss-page-module-development`,后端按 `yss-router` 最小闭包,业务行为统一 `tdd` | 仅接收已完成 Ticket 正式化、已绑定垂直切片且 `ready-for-agent` 公式通过的输入;只写允许路径;业务行为用 `behavior-tdd`;UI 影响必须有还原计划 |
|
|
36
36
|
| Review/验证 | 不可变候选快照、review 结论、fresh verification | `code-review`(独立于实现者);UI 影响追加 `yss-ui` + `yss-design-system` 的 UI fidelity 轴 | findings 已处理;同一候选快照通过全部审查轴与验证 |
|
|
37
|
-
| 发布/复盘 | 发布/回滚证据、复盘记录 | 生命周期自有工作单元 | fresh verification
|
|
37
|
+
| 发布/复盘 | 发布/回滚证据、复盘记录 | 生命周期自有工作单元 | fresh verification、独立审查和发布裁决齐全;`gate.release-ready` 仍须生物人 |
|
|
38
38
|
|
|
39
39
|
## 前端实现还原硬检查
|
|
40
40
|
|
|
@@ -42,8 +42,8 @@ Matt 的 `grill-with-docs`、`to-spec`、`to-tickets`、`implement` 等保留为
|
|
|
42
42
|
|
|
43
43
|
## 结果与暂停
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
凡主控向数字人角色或独立运行时正式派发生命周期工作单元,都必须通过结构化任务包派发,并返回 `Workflow Execution Result`(workflow reference、skill、changed files、evidence refs、actual verification、deferred seams、drift/new impacts)。任务包使用 `docs/process/schemas/digital-human-task-package.schema.json`,由 `scripts/verify-digital-human-task-package` 校验;其中 `role_id`、`runtime_id`、`execution_state`、`contract.kind/id/version`、允许写路径、预期证据和汇合引用必须完整。`slice-implementation` 任务包额外绑定批准且当前版本的 Slice Implementation Contract;Discovery、Spec、原型、技术分析、Ticket、Review、发布和模板维护分别绑定各自的生命周期资产或维护 checkpoint,不得伪造 Slice Contract。缺少可读证据、`stale`、`violation`、`drift`、`new_impacts` 或阻塞信号时不得标记 completed。实现授权不包含 Git commit/push 授权;“做完提交”等自然语言意向不构成上述结构化 Git 授权。
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
输出固定包含:模式、当前阶段、影响面、资产/门禁状态、证据、Ticket 正式化状态、垂直切片引用、`ready-for-agent` 计算结果、阻塞项、本轮动作、下一工作单元、暂停/继续理由、Ticket 同步和 Git checkpoint 判断。原生路径未出现 `to-tickets` / `implement` 名称本身不构成异常;但没有完成 `work-unit.ticket-decomposition`、垂直切片仍为 `ready-for-human`、引用父 Ticket 或 `next_route` 越过 Ticket 正式化时必须返回 `blocked`。暂停会签时必须输出门禁 ID、指定 `role_id`、`runtime_id` 和会签文件路径(`docs/.scratch/<feature>/gates/<gate-id>-approval.yaml`)。恢复前运行 `scripts/verify-approval-record`;错误会签记为 `blocked`,不得把该门禁标为 `approved`。任务包的 `core_skills` / `forbidden_skills` 必须从 `docs/agents/digital-human-roles.yaml` 复制(`taskPackageDefaults`),禁止手写第二套。
|
|
48
48
|
|
|
49
49
|
详细执行循环、readiness、脚手架(包括 `controlled-generation`)、审查快照、状态传播和 Matt 边界见 [orchestration.md](references/orchestration.md)、[orchestration-contract.yaml](references/orchestration-contract.yaml)、[artifact-dependencies.md](references/artifact-dependencies.md) 和 [state-model.md](references/state-model.md)。
|
|
@@ -7,6 +7,8 @@ Discovery → Spec → Product Overview / Functional Architecture
|
|
|
7
7
|
Spec + Product Overview → Product Design / Requirement Freeze
|
|
8
8
|
Spec + Product Overview → API Impact / OpenAPI Draft
|
|
9
9
|
Spec + Product Overview → System / Data Architecture
|
|
10
|
+
System / Data Architecture + domain impact → Tactical DDD Check / tactical-design contract
|
|
11
|
+
Tactical DDD contract → Architecture Review / Engineering Baseline / Slice Implementation Contract
|
|
10
12
|
API impact = yes: Requirement Freeze + Design Review + Draft Review → OpenAPI Freeze
|
|
11
13
|
API impact = no: API Impact Assessment approved → No-API-Impact record;Draft/Freeze gates = not-applicable
|
|
12
14
|
Frozen Contract → Vertical Slice Tickets
|
|
@@ -30,3 +32,5 @@ Implementation → Independent Review → Fresh Verification → Release
|
|
|
30
32
|
明确写入需求的认证、授权、租户隔离、敏感数据或合规行为变化不使用独立影响类型;按它实际改变的 UI 状态、API schema、状态机、数据模型或服务边界传播。普通 action 注册、SQL / DDL / 迁移和上传 / 下载只使用既有技术影响类型,不增加安全 / 权限传播。
|
|
31
33
|
|
|
32
34
|
OpenAPI Freeze 后发生上游变化时,不得仅因父 Ticket 仍写阶段 6 就继续实现。先做影响分析,再精准更新相关资产和门禁。
|
|
35
|
+
|
|
36
|
+
战术设计合同上游引用发生版本变化时,先将 tactical-design 标记为 `stale`,再传播到 Slice Contract;发现新的聚合、状态、不变量、一致性或 Gateway 影响时标记 `drift` / `new_impacts` 并重新路由。
|
|
@@ -23,7 +23,7 @@ Matt skills 决定如何工作;YSS 生命周期决定是否允许推进;YSS
|
|
|
23
23
|
| 技术事实 | `research` | 一手资料回填 Spec/OpenAPI/架构/ADR |
|
|
24
24
|
| runnable 问题 | `prototype` | 生成单文件可分享 HTML,保留 `prototype/<name>` 分支作为主来源;必须 source/return handoff 和结论回填,不得替代阶段 4 的低保真评审、Ant Design v6 高保真 HTML、AntD CLI 证据和用户确认 |
|
|
25
25
|
| Spec 综合 | 原生 `work-unit.spec-synthesis`;`to-spec`(用户显式兼容) | 初稿进入 `ready-for-human`,不得直接实现 |
|
|
26
|
-
| 切片 | 原生 `work-unit.ticket-decomposition`;`to-tickets`(用户显式兼容) |
|
|
26
|
+
| 切片 | 原生 `work-unit.ticket-decomposition`;`to-tickets`(用户显式兼容) | 仅在冻结/无影响记录后拆垂直切片,初始 Ticket 状态为 `ready-for-human` |
|
|
27
27
|
| 实现 | 原生 `work-unit.slice-implementation`;`implement`(用户显式兼容) | 当前合同批准并持久化后执行;内部使用 `tdd`,结果回交后再次核验 |
|
|
28
28
|
| Bug | `diagnosing-bugs`、`tdd` | 先建立红色反馈;高风险影响升级上游门禁 |
|
|
29
29
|
| 审查 | `code-review` | 唯一默认代码审查入口;审查者独立,结合 Spec、仓库治理规则和 YSS 标准 |
|
|
@@ -69,8 +69,8 @@ Router 状态映射为:`draft → completed`、`blocked → blocked`、`ready-
|
|
|
69
69
|
| Matt flow | 进入条件 | 生命周期结果 |
|
|
70
70
|
|---|---|---|
|
|
71
71
|
| `to-spec`(用户显式) | Discovery work unit 或 `grill-with-docs` 已满足退出条件,且不存在未回流 runnable blocker;用户问题、MVP/非目标、成功标准、测试 seam 和术语审查均有证据 | 生命周期只准备/验收;Spec 初稿为 `ready-for-human`,不等于批准 |
|
|
72
|
-
| `to-tickets`(用户显式) | OpenAPI Freeze 或 `no-api-impact` 记录、必要门禁、垂直切片范围和阻塞边均已明确 | 生命周期只准备/验收;只能生成垂直切片 Ticket,初始统一为 `ready-for-human` |
|
|
73
|
-
| `implement`(用户显式) | `ready-for-agent` 公式、Contract 已批准/持久化/版本一致、Build Architecture Checklist、实现仓库/分支/CI/验证命令/回滚点,以及后端 Contract(适用时)均满足 |
|
|
72
|
+
| `to-tickets`(用户显式) | OpenAPI Freeze 或 `no-api-impact` 记录、必要门禁、垂直切片范围和阻塞边均已明确 | 生命周期只准备/验收;只能生成垂直切片 Ticket,初始统一为 `ready-for-human`;必须留下 `ticket_decomposition_result_ref` 和 `vertical_slice_ticket_ref` |
|
|
73
|
+
| `implement`(用户显式) | `ready-for-agent` 公式、Ticket 正式化结果、垂直切片引用/类型/状态、Contract 已批准/持久化/版本一致、Build Architecture Checklist、实现仓库/分支/CI/验证命令/回滚点,以及后端 Contract(适用时)均满足 | 生命周期只准备/验收;单会话实现同样适用,不得绕过门禁;父 Ticket、`ready-for-human` 切片或跳过 Ticket 正式化的 `next_route` 必须 `blocked` |
|
|
74
74
|
|
|
75
75
|
`grill_exit` 不是“已经聊过”的自然语言声明。它必须同时证明 frontier 为空、事实已解决或分别路由到 `research` / prototype / external input、用户决策已确认、双方共同理解已确认,并且没有未回流的 runnable blocker。
|
|
76
76
|
|