create-yss-spec 3.5.5 → 3.5.8
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 +2 -0
- package/bin/create-yss-spec.js +3 -1
- package/cli-core.lock.json +11 -7
- package/package.json +4 -1
- package/src/api/_sync-service.js +3 -1
- package/src/command-runner.mjs +44 -9
- package/src/content-identity.js +111 -0
- package/src/runtime-store.mjs +650 -0
- package/src/template/asset-runtime.js +7 -2
- package/src/template/instance-runtime.js +27 -9
- package/src/validation/metadata.js +8 -0
- package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
- package/template/.agents/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.agents/skills/archify/SKILL.md +2 -2
- package/template/.agents/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.agents/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.agents/skills/code-review/SKILL.md +19 -11
- package/template/.agents/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.agents/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.agents/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.agents/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.agents/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.agents/skills/file-export-download/SKILL.md +4 -73
- package/template/.agents/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.agents/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.agents/skills/formily-foundation/SKILL.md +6 -105
- package/template/.agents/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.agents/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.agents/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.agents/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.agents/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.agents/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.agents/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.agents/skills/handoff/SKILL.md +3 -1
- package/template/.agents/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.agents/skills/implement/SKILL.md +2 -2
- package/template/.agents/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.agents/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.agents/skills/lombok/SKILL.md +2 -0
- package/template/.agents/skills/mapstruct/SKILL.md +2 -0
- package/template/.agents/skills/tdd/SKILL.md +2 -2
- package/template/.agents/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.agents/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.agents/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.agents/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.agents/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.agents/skills/yss-application/SKILL.md +11 -5
- package/template/.agents/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.agents/skills/yss-audit-log/references/README.md +5 -5
- package/template/.agents/skills/yss-cache/SKILL.md +4 -4
- package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
- package/template/.agents/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.agents/skills/yss-dto/SKILL.md +9 -9
- package/template/.agents/skills/yss-dto/references/README.md +4 -4
- package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.agents/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.agents/skills/yss-exception/SKILL.md +42 -48
- package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.agents/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
- package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.agents/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.agents/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.agents/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.agents/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.agents/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +23 -21
- package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +35 -12
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.agents/skills/yss-repository/SKILL.md +2 -2
- package/template/.agents/skills/yss-research/SKILL.md +39 -48
- package/template/.agents/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.agents/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.agents/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.agents/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.agents/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.agents/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.agents/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.agents/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.agents/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.agents/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- 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 +2 -5
- package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.agents/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.agents/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.agents/skills/yss-ui/SKILL.md +7 -1
- package/template/.agents/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.agents/skills/yss-ui/references/checklist.md +38 -96
- package/template/.agents/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.agents/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.agents/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.agents/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.agents/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.agents/skills/yss-validation/SKILL.md +26 -32
- package/template/.agents/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.agents/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
- package/template/.agents/skills/ytree-usage/SKILL.md +2 -80
- package/template/.agents/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.codex/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.codex/skills/archify/SKILL.md +2 -2
- package/template/.codex/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.codex/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.codex/skills/code-review/SKILL.md +19 -11
- package/template/.codex/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.codex/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.codex/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.codex/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.codex/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.codex/skills/file-export-download/SKILL.md +4 -73
- package/template/.codex/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.codex/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.codex/skills/formily-foundation/SKILL.md +6 -105
- package/template/.codex/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.codex/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.codex/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.codex/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.codex/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.codex/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.codex/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.codex/skills/handoff/SKILL.md +3 -1
- package/template/.codex/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.codex/skills/implement/SKILL.md +2 -2
- package/template/.codex/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.codex/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.codex/skills/lombok/SKILL.md +2 -0
- package/template/.codex/skills/mapstruct/SKILL.md +2 -0
- package/template/.codex/skills/product-design/references/communication-protocol.md +3 -3
- package/template/.codex/skills/product-design/references/critical-overrides.md +4 -5
- package/template/.codex/skills/product-design/skills/audit/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/get-context/SKILL.md +6 -8
- package/template/.codex/skills/product-design/skills/ideate/SKILL.md +3 -3
- package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +3 -5
- package/template/.codex/skills/product-design/skills/index/SKILL.md +1 -1
- package/template/.codex/skills/product-design/skills/prototype/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/research/SKILL.md +4 -6
- package/template/.codex/skills/product-design/skills/research/assets/research-brief-template.md +3 -3
- package/template/.codex/skills/product-design/skills/share/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
- package/template/.codex/skills/tdd/SKILL.md +2 -2
- package/template/.codex/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.codex/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.codex/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.codex/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.codex/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.codex/skills/yss-application/SKILL.md +11 -5
- package/template/.codex/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.codex/skills/yss-audit-log/references/README.md +5 -5
- package/template/.codex/skills/yss-cache/SKILL.md +4 -4
- package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
- package/template/.codex/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.codex/skills/yss-dto/SKILL.md +9 -9
- package/template/.codex/skills/yss-dto/references/README.md +4 -4
- package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.codex/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.codex/skills/yss-exception/SKILL.md +42 -48
- package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.codex/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
- package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.codex/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.codex/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.codex/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.codex/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.codex/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +23 -21
- package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +35 -12
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.codex/skills/yss-repository/SKILL.md +2 -2
- package/template/.codex/skills/yss-research/SKILL.md +39 -48
- package/template/.codex/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.codex/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.codex/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.codex/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.codex/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.codex/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.codex/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.codex/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.codex/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.codex/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- 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 +2 -5
- package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.codex/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.codex/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.codex/skills/yss-ui/SKILL.md +7 -1
- package/template/.codex/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.codex/skills/yss-ui/references/checklist.md +38 -96
- package/template/.codex/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.codex/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.codex/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.codex/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.codex/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.codex/skills/yss-validation/SKILL.md +26 -32
- package/template/.codex/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.codex/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
- package/template/.codex/skills/ytree-usage/SKILL.md +2 -80
- package/template/.codex/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.cursor/skills/archify/SKILL.md +2 -2
- package/template/.cursor/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.cursor/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.cursor/skills/code-review/SKILL.md +19 -11
- package/template/.cursor/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.cursor/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.cursor/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.cursor/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.cursor/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.cursor/skills/file-export-download/SKILL.md +4 -73
- package/template/.cursor/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.cursor/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.cursor/skills/formily-foundation/SKILL.md +6 -105
- package/template/.cursor/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.cursor/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.cursor/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.cursor/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.cursor/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.cursor/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.cursor/skills/handoff/SKILL.md +3 -1
- package/template/.cursor/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.cursor/skills/implement/SKILL.md +2 -2
- package/template/.cursor/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.cursor/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.cursor/skills/lombok/SKILL.md +2 -0
- package/template/.cursor/skills/mapstruct/SKILL.md +2 -0
- package/template/.cursor/skills/tdd/SKILL.md +2 -2
- package/template/.cursor/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.cursor/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.cursor/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.cursor/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.cursor/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.cursor/skills/yss-application/SKILL.md +11 -5
- package/template/.cursor/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.cursor/skills/yss-audit-log/references/README.md +5 -5
- package/template/.cursor/skills/yss-cache/SKILL.md +4 -4
- package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
- package/template/.cursor/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.cursor/skills/yss-dto/SKILL.md +9 -9
- package/template/.cursor/skills/yss-dto/references/README.md +4 -4
- package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.cursor/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.cursor/skills/yss-exception/SKILL.md +42 -48
- package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.cursor/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.cursor/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.cursor/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.cursor/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.cursor/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.cursor/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +23 -21
- package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +35 -12
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
- package/template/.cursor/skills/yss-research/SKILL.md +39 -48
- package/template/.cursor/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.cursor/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.cursor/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.cursor/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.cursor/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.cursor/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.cursor/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.cursor/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.cursor/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.cursor/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- 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 +2 -5
- package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.cursor/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.cursor/skills/yss-ui/SKILL.md +7 -1
- package/template/.cursor/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.cursor/skills/yss-ui/references/checklist.md +38 -96
- package/template/.cursor/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.cursor/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.cursor/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.cursor/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.cursor/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.cursor/skills/yss-validation/SKILL.md +26 -32
- package/template/.cursor/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.cursor/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
- package/template/.cursor/skills/ytree-usage/SKILL.md +2 -80
- package/template/.cursor/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.pi/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.pi/skills/archify/SKILL.md +2 -2
- package/template/.pi/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.pi/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.pi/skills/code-review/SKILL.md +19 -11
- package/template/.pi/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.pi/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.pi/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.pi/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.pi/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.pi/skills/file-export-download/SKILL.md +4 -73
- package/template/.pi/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.pi/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.pi/skills/formily-foundation/SKILL.md +6 -105
- package/template/.pi/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.pi/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.pi/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.pi/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.pi/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.pi/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.pi/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.pi/skills/handoff/SKILL.md +3 -1
- package/template/.pi/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.pi/skills/implement/SKILL.md +2 -2
- package/template/.pi/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.pi/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.pi/skills/lombok/SKILL.md +2 -0
- package/template/.pi/skills/mapstruct/SKILL.md +2 -0
- package/template/.pi/skills/tdd/SKILL.md +2 -2
- package/template/.pi/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.pi/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.pi/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.pi/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.pi/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.pi/skills/yss-application/SKILL.md +11 -5
- package/template/.pi/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.pi/skills/yss-audit-log/references/README.md +5 -5
- package/template/.pi/skills/yss-cache/SKILL.md +4 -4
- package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
- package/template/.pi/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.pi/skills/yss-dto/SKILL.md +9 -9
- package/template/.pi/skills/yss-dto/references/README.md +4 -4
- package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.pi/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.pi/skills/yss-exception/SKILL.md +42 -48
- package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.pi/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
- package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.pi/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.pi/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.pi/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.pi/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.pi/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +23 -21
- package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +35 -12
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.pi/skills/yss-repository/SKILL.md +2 -2
- package/template/.pi/skills/yss-research/SKILL.md +39 -48
- package/template/.pi/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.pi/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.pi/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.pi/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.pi/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.pi/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.pi/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.pi/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.pi/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.pi/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- 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 +2 -5
- package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.pi/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.pi/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.pi/skills/yss-ui/SKILL.md +7 -1
- package/template/.pi/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.pi/skills/yss-ui/references/checklist.md +38 -96
- package/template/.pi/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.pi/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.pi/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.pi/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.pi/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.pi/skills/yss-validation/SKILL.md +26 -32
- package/template/.pi/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.pi/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
- package/template/.pi/skills/ytree-usage/SKILL.md +2 -80
- package/template/.pi/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.template-spec/agents/backend-architecture-profiles.md +1 -1
- package/template/.template-spec/agents/digital-human-roles.md +5 -1
- package/template/.template-spec/agents/digital-human-roles.yaml +49 -1
- package/template/.template-spec/engineering/backend-platforms.json +1 -1
- package/template/.template-spec/plan/templates/competitive-analysis-template.md +38 -36
- package/template/.template-spec/plan/templates/competitive-matrix-template.md +37 -17
- package/template/.template-spec/process/document-writing.md +22 -3
- package/template/.template-spec/process/harness-process-tailoring.md +5 -1
- package/template/.template-spec/process/implementation-repo-integration.md +26 -8
- package/template/.template-spec/process/research-completion.md +2 -0
- package/template/.template-spec/process/runtime-storage.md +78 -0
- package/template/.template-spec/process/schemas/approval-context.schema.json +67 -0
- package/template/.template-spec/process/schemas/approval-record.schema.json +179 -16
- package/template/.template-spec/process/schemas/backend-delivery.schema.json +16 -0
- package/template/.template-spec/process/schemas/delivery-preflight-input.schema.json +4 -0
- package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +236 -1
- package/template/.template-spec/process/schemas/implementation-repository-preparation-result.schema.json +335 -52
- package/template/.template-spec/process/schemas/lifecycle-checkpoint.schema.json +11 -0
- package/template/.template-spec/process/schemas/project-scaffold-contract.schema.json +3 -0
- package/template/.template-spec/process/schemas/review-bundle.schema.json +347 -35
- package/template/.template-spec/process/schemas/strategic-design-handoff-v3.schema.json +504 -0
- package/template/.template-spec/process/schemas/strategic-design-handoff-v4.schema.json +544 -8
- package/template/.template-spec/process/schemas/strategic-design-handoff-v5.schema.json +616 -0
- package/template/.template-spec/process/schemas/strategic-design-handoff.schema.json +616 -0
- package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +712 -109
- package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json +595 -90
- package/template/.template-spec/process/schemas/strategic-handoff-export-v2.schema.json +448 -0
- package/template/.template-spec/process/schemas/strategic-handoff-export.schema.json +392 -0
- package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +556 -83
- package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json +418 -57
- package/template/.template-spec/process/subagent-collaboration.md +7 -1
- package/template/.template-spec/templates/approval-record-template.json +7 -3
- package/template/.template-spec/templates/approval-record-template.yaml +8 -2
- package/template/.template-spec/templates/examples/lifecycle-writing-examples.md +92 -2
- package/template/.template-spec/templates/retro-report-template.md +10 -3
- package/template/.template-spec/templates/review-bundle-template.yaml +19 -10
- package/template/AGENTS.md +4 -3
- package/template/CONTEXT.md +2 -2
- package/template/README.md +2 -2
- package/template/scripts/advance-maintenance-iteration +51 -0
- package/template/scripts/lib/approval-checkpoint-discovery.mjs +26 -0
- package/template/scripts/lib/approval-consumption.mjs +35 -0
- package/template/scripts/lib/approval-current.mjs +111 -0
- package/template/scripts/lib/approval-record-io.mjs +56 -0
- package/template/scripts/lib/approval-record.mjs +79 -184
- package/template/scripts/lib/approved-execution-context.mjs +8 -6
- package/template/scripts/lib/asset-transactions.mjs +5 -1
- package/template/scripts/lib/backend-delivery.mjs +1 -1
- package/template/scripts/lib/backend-review.mjs +2 -1
- package/template/scripts/lib/backend-scaffold-prerequisites.mjs +3 -2
- package/template/scripts/lib/business-ticket-lifecycle.mjs +2 -1
- package/template/scripts/lib/checkpoint-commit.mjs +50 -0
- package/template/scripts/lib/command-runner.mjs +44 -9
- package/template/scripts/lib/content-identity.mjs +273 -0
- package/template/scripts/lib/delivery-preflight.mjs +2 -1
- package/template/scripts/lib/digital-human-roles.mjs +12 -5
- package/template/scripts/lib/drift-report.mjs +110 -0
- package/template/scripts/lib/existing-backend-architecture.mjs +4 -1
- package/template/scripts/lib/lifecycle-context-query.mjs +172 -11
- package/template/scripts/lib/lifecycle-controls.mjs +9 -19
- package/template/scripts/lib/lifecycle-presentation.mjs +5 -0
- package/template/scripts/lib/lifecycle-status.mjs +63 -12
- package/template/scripts/lib/lifecycle-transition.mjs +2 -1
- package/template/scripts/lib/maintenance-candidate.mjs +24 -30
- package/template/scripts/lib/maintenance-research.mjs +52 -8
- package/template/scripts/lib/maintenance-storage.mjs +81 -0
- package/template/scripts/lib/plan-spec-entry.mjs +2 -1
- package/template/scripts/lib/project-governance.mjs +2 -1
- package/template/scripts/lib/read-only-intake.mjs +44 -9
- package/template/scripts/lib/review-capabilities.mjs +234 -0
- package/template/scripts/lib/review-package.mjs +100 -0
- package/template/scripts/lib/runtime-store.mjs +650 -0
- package/template/scripts/lib/skill-registry.mjs +4 -4
- package/template/scripts/lib/strategic-handoff.mjs +22 -9
- package/template/scripts/lib/task-package.mjs +47 -16
- package/template/scripts/lifecycle-status +26 -1
- package/template/scripts/maintenance-path +11 -0
- package/template/scripts/prepare-review-package +8 -0
- package/template/scripts/project-ci +13 -3
- package/template/scripts/query-lifecycle-context +8 -1
- package/template/scripts/run-read-only-intake +2 -2
- package/template/scripts/runtime-store +40 -0
- package/template/scripts/verify-approval-record +21 -13
- package/template/scripts/verify-lifecycle-checkpoint +7 -3
- package/template/scripts/verify-project-instance +21 -1
- package/template/skills-lock.json +62 -61
- package/template.snapshot.json +4 -4
- package/vendor/cli-core/cli.mjs +2 -0
- package/vendor/cli-core/command-runner.mjs +44 -9
- package/vendor/cli-core/package.json +1 -1
- package/vendor/cli-core/runtime-store.mjs +650 -0
- package/vendor/cli-core/scaffold.mjs +4 -2
- package/vendor/cli-core/tests/package-contract.mjs +14 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { spawnSync } from 'node:child_process';
|
|
8
|
+
import { competitiveVerificationFiles, validateCompetitiveAnalysis } from '../scripts/lib/competitive-analysis.mjs';
|
|
9
|
+
|
|
10
|
+
const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
|
+
const validator = path.join(skillRoot, 'scripts/validate-research-package.mjs');
|
|
12
|
+
const renderer = path.join(skillRoot, 'scripts/render-competitive-outputs.mjs');
|
|
13
|
+
const repoRoot = path.resolve(skillRoot, '../../..');
|
|
14
|
+
const headings = ['Research Scope', 'Executive Read', 'Findings', 'Counter-Signals', 'Source Map', 'Decision Handoff', 'Evidence Limitations'];
|
|
15
|
+
|
|
16
|
+
test('竞品扩展的非法状态必须由完整 Schema 拒绝', () => {
|
|
17
|
+
const directory = mkdtempSync(path.join(tmpdir(), 'yss-competitive-'));
|
|
18
|
+
try {
|
|
19
|
+
const data = JSON.parse(readFileSync(path.join(skillRoot, 'assets/evidence-template.yaml'), 'utf8'));
|
|
20
|
+
data.competitive_analysis = { schema_version: 1, output_selection: 'matrix', as_of: '2026-10-02', comparison_scope: '固定产品资料', competitors: [{ id: 'alpha', name: 'Alpha', type: 'direct', product: 'Alpha', version: '1', edition: 'Pro', region: 'CN' }], capabilities: [{ id: 'export', module: '数据', name: '导出', definition: '用户导出 CSV', user_value: '复用数据' }], assessments: [{ competitor_id: 'alpha', capability_id: 'export', status: 'invented', claim_refs: ['claim-001'], limitations: [], gap: null }], artifacts: { matrix: 'sample-competitive-matrix.md' } };
|
|
21
|
+
const brief = path.join(directory, 'sample-research-brief.md');
|
|
22
|
+
const evidence = path.join(directory, 'sample-evidence.yaml');
|
|
23
|
+
writeFileSync(brief, `${headings.map(heading => `## ${heading}`).join('\n\n')}\nclaim-001\n`);
|
|
24
|
+
writeFileSync(evidence, JSON.stringify(data));
|
|
25
|
+
const result = spawnSync(process.execPath, [validator, brief, evidence], { encoding: 'utf8' });
|
|
26
|
+
assert.equal(result.status, 1, `非法竞品状态被接受:${result.stdout}${result.stderr}`);
|
|
27
|
+
assert.match(result.stderr, /competitive_analysis.*status|assessments.*status/s);
|
|
28
|
+
} finally {
|
|
29
|
+
rmSync(directory, { recursive: true, force: true });
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function payload(selection = 'both') {
|
|
34
|
+
const data = JSON.parse(readFileSync(path.join(skillRoot, 'assets/evidence-template.yaml'), 'utf8'));
|
|
35
|
+
data.scope.topic = '固定资料 CSV 导出比较';
|
|
36
|
+
data.scope.audience = '产品规划负责人';
|
|
37
|
+
data.scope.time_horizon = '2026-10-02 截至资料';
|
|
38
|
+
data.scope.research_questions = ['哪些产品在本次版本、套餐与地区内支持 CSV 导出?'];
|
|
39
|
+
data.scope.inclusion_criteria = ['固定的一手产品说明'];
|
|
40
|
+
data.scope.exclusion_criteria = ['无日期的转载'];
|
|
41
|
+
data.ownership.downstream_owner = 'yss-stage-decision';
|
|
42
|
+
data.search_log[0] = { id: 'search-001', channel: 'fixture-docs', query_or_corpus: 'Alpha 产品说明', searched_at: '2026-10-02', result: 'results-found' };
|
|
43
|
+
data.search_log[1] = { id: 'search-002', channel: 'fixture-docs', query_or_corpus: 'Alpha 导出限制与 Beta 导出说明', searched_at: '2026-10-02', result: 'none-found' };
|
|
44
|
+
data.evidence_items[0] = { id: 'evidence-001', source_level: 'primary', visibility: 'internal', source_class: 'official-docs', source_ref: 'fixture://alpha/v1/pro/cn', locator: 'section CSV', stance: 'support', observed_at: '2026-10-02', evidence_date: '2026-10-01', observation: 'Alpha v1 Pro CN supports CSV export.', limitations: ['固定资料不代表其他版本、套餐或地区'] };
|
|
45
|
+
data.claims[0].claim_kind = 'business-constraint';
|
|
46
|
+
data.claims[0].statement = 'Alpha v1 Pro CN 支持 CSV 导出。';
|
|
47
|
+
data.competitive_analysis = {
|
|
48
|
+
schema_version: 1, output_selection: selection, as_of: '2026-10-02', comparison_scope: 'Alpha 与 Beta,v1 Pro CN,CSV 导出;仅固定资料',
|
|
49
|
+
competitors: [{ id: 'alpha', name: 'Alpha', type: 'direct', product: 'Alpha', version: '1', edition: 'Pro', region: 'CN' }, { id: 'beta', name: 'Beta', type: 'adjacent', product: 'Beta', version: '1', edition: 'Pro', region: 'CN' }],
|
|
50
|
+
capabilities: [{ id: 'csv-export', module: '数据', name: 'CSV 导出', definition: '用户将所选数据导出为 CSV 文件', user_value: '在下游工具中复用数据' }],
|
|
51
|
+
assessments: [{ competitor_id: 'alpha', capability_id: 'csv-export', status: 'supported', claim_refs: ['claim-001'], limitations: ['仅固定资料中的 v1 Pro CN'], gap: null }, { competitor_id: 'beta', capability_id: 'csv-export', status: 'unknown', claim_refs: [], limitations: [], gap: { reason: 'Beta 的导出说明不可获得', next_step: '获取 Beta v1 Pro CN 官方功能说明后重验' } }],
|
|
52
|
+
artifacts: { ...(selection !== 'report' ? { matrix: 'sample-competitive-matrix.md' } : {}), ...(selection !== 'matrix' ? { report: 'sample-competitive-analysis.md' } : {}) }
|
|
53
|
+
};
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
function fixture(t, data = payload()) {
|
|
57
|
+
const directory = mkdtempSync(path.join(tmpdir(), 'yss-competitive-'));
|
|
58
|
+
t.after(() => rmSync(directory, { recursive: true, force: true }));
|
|
59
|
+
const brief = path.join(directory, 'sample-research-brief.md');
|
|
60
|
+
const evidence = path.join(directory, 'sample-evidence.yaml');
|
|
61
|
+
writeFileSync(brief, `${headings.map(heading => `## ${heading}`).join('\n\n')}\n${data.claims.map(claim => claim.id).join(' ')}\n`);
|
|
62
|
+
writeFileSync(evidence, JSON.stringify(data, null, 2));
|
|
63
|
+
return { directory, brief, evidence, data };
|
|
64
|
+
}
|
|
65
|
+
function execute(file, args, status = 0, expected = '') {
|
|
66
|
+
const result = spawnSync(process.execPath, [file, ...args], { encoding: 'utf8' });
|
|
67
|
+
assert.equal(result.status, status, `${result.stdout}${result.stderr}`);
|
|
68
|
+
if (expected) assert.match(`${result.stdout}${result.stderr}`, expected);
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
function reject(data, evidence, expected) {
|
|
72
|
+
assert.throws(() => validateCompetitiveAnalysis(data, evidence, { checkArtifacts: false }), expected);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
test('旧无扩展研究入口保留两参数,独立副本无需加载新库', t => {
|
|
76
|
+
const data = payload();
|
|
77
|
+
delete data.competitive_analysis;
|
|
78
|
+
const f = fixture(t, data);
|
|
79
|
+
const isolated = path.join(f.directory, 'validator.mjs');
|
|
80
|
+
copyFileSync(validator, isolated);
|
|
81
|
+
execute(isolated, [f.brief, f.evidence], 0, /research package valid/);
|
|
82
|
+
assert.deepEqual(competitiveVerificationFiles(f.evidence), []);
|
|
83
|
+
execute(path.join(skillRoot, 'tests/run-scenarios.mjs'), [], 0, /scenarios passed \(8\)/);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
for (const selection of ['matrix', 'report', 'both']) test(`${selection} 输出生成后通过研究包校验`, t => {
|
|
87
|
+
const f = fixture(t, payload(selection));
|
|
88
|
+
execute(renderer, [f.evidence], 0, /outputs rendered/);
|
|
89
|
+
execute(validator, [f.brief, f.evidence], 0, /research package valid/);
|
|
90
|
+
const files = competitiveVerificationFiles(f.evidence);
|
|
91
|
+
assert.equal(files.length, (selection === 'both' ? 2 : 1) + 7);
|
|
92
|
+
assert.ok(files.every(path.isAbsolute));
|
|
93
|
+
if (selection !== 'matrix') {
|
|
94
|
+
const content = readFileSync(path.join(f.directory, 'sample-competitive-analysis.md'), 'utf8');
|
|
95
|
+
if (selection === 'both') assert.match(content, /完整功能矩阵:\[sample-competitive-matrix.md\]\(<sample-competitive-matrix.md>\)/);
|
|
96
|
+
else assert.match(content, /### 功能比较/);
|
|
97
|
+
assert.match(content, /❓ 未知/);
|
|
98
|
+
assert.match(content, /Alpha v1 Pro CN 支持 CSV 导出/);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('扩展完整 Schema 执行嵌套必填、额外字段、日期格式和输出选择', t => {
|
|
103
|
+
const f = fixture(t);
|
|
104
|
+
const invalids = [
|
|
105
|
+
[data => delete data.competitive_analysis.capabilities[0].user_value, /Schema.*user_value/s],
|
|
106
|
+
[data => { data.competitive_analysis.competitors[0].unregistered = true; }, /Schema.*Additional properties/s],
|
|
107
|
+
[data => { data.competitive_analysis.as_of = '2026-02-30'; }, /Schema.*date/s],
|
|
108
|
+
[data => { data.competitive_analysis.output_selection = 'matrix'; }, /Schema.*False schema/s],
|
|
109
|
+
[data => { data.competitive_analysis.schema_version = 2; }, /Schema.*1 was expected/s]
|
|
110
|
+
];
|
|
111
|
+
for (const [mutate, expected] of invalids) { const data = payload(); mutate(data); reject(data, f.evidence, expected); }
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test('稳定 ID 和比较覆盖必须完整且唯一', t => {
|
|
115
|
+
const f = fixture(t);
|
|
116
|
+
const invalids = [
|
|
117
|
+
[data => data.competitive_analysis.competitors.push(structuredClone(data.competitive_analysis.competitors[0])), /duplicate id: alpha/],
|
|
118
|
+
[data => data.competitive_analysis.capabilities.push(structuredClone(data.competitive_analysis.capabilities[0])), /duplicate id: csv-export/],
|
|
119
|
+
[data => data.competitive_analysis.assessments.push(structuredClone(data.competitive_analysis.assessments[0])), /duplicate pair/],
|
|
120
|
+
[data => data.competitive_analysis.assessments.pop(), /missing assessment coverage: beta\/csv-export/],
|
|
121
|
+
[data => { data.competitive_analysis.assessments[0].competitor_id = 'missing'; }, /unknown competitor_id/],
|
|
122
|
+
[data => { data.competitive_analysis.assessments[0].capability_id = 'missing'; }, /unknown capability_id/]
|
|
123
|
+
];
|
|
124
|
+
for (const [mutate, expected] of invalids) { const data = payload(); mutate(data); reject(data, f.evidence, expected); }
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('确定状态要求已审计且可解析的支持 Claim', t => {
|
|
128
|
+
const f = fixture(t);
|
|
129
|
+
const invalids = [
|
|
130
|
+
[data => { data.competitive_analysis.assessments[0].claim_refs = ['missing']; }, /unresolved claim ref/],
|
|
131
|
+
[data => { data.audit_summary.audited_claim_ids = []; }, /audited supported claim/],
|
|
132
|
+
[data => { data.audit_summary.status = 'incomplete'; }, /audited supported claim/],
|
|
133
|
+
[data => { data.claims[0].audit_status = 'not-audited'; }, /audited supported claim/],
|
|
134
|
+
[data => { data.claims[0].audit_status = 'partially-supported'; }, /must use qualify/],
|
|
135
|
+
[data => { data.evidence_items[0].source_level = 'lead-only'; }, /invalid supporting evidence/],
|
|
136
|
+
[data => { data.evidence_items[0].stance = 'counter'; }, /invalid supporting evidence/]
|
|
137
|
+
];
|
|
138
|
+
for (const [mutate, expected] of invalids) { const data = payload(); mutate(data); reject(data, f.evidence, expected); }
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test('策略包引用技术 Claim 的确定状态也要求一手支持,独立于 decision_bearing', t => {
|
|
142
|
+
const f = fixture(t);
|
|
143
|
+
for (const decisionBearing of [true, false]) {
|
|
144
|
+
const data = payload();
|
|
145
|
+
data.claims[0].claim_kind = 'technical-fact';
|
|
146
|
+
data.claims[0].decision_bearing = decisionBearing;
|
|
147
|
+
data.evidence_items[0].source_level = 'secondary';
|
|
148
|
+
reject(data, f.evidence, /technical-fact claim requires primary supporting evidence/);
|
|
149
|
+
data.evidence_items[0].source_level = 'primary';
|
|
150
|
+
assert.equal(validateCompetitiveAnalysis(data, f.evidence, { checkArtifacts: false }).enabled, true);
|
|
151
|
+
}
|
|
152
|
+
const unknown = payload();
|
|
153
|
+
unknown.claims[0].claim_kind = 'technical-fact';
|
|
154
|
+
unknown.evidence_items[0].source_level = 'secondary';
|
|
155
|
+
unknown.competitive_analysis.assessments[0].status = 'unknown';
|
|
156
|
+
unknown.competitive_analysis.assessments[0].gap = { reason: '技术 Claim 缺少一手材料', next_step: '获取相应官方说明后重新确认状态' };
|
|
157
|
+
assert.equal(validateCompetitiveAnalysis(unknown, f.evidence, { checkArtifacts: false }).enabled, true);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
test('部分支持和未知适用范围保留限定条件', t => {
|
|
161
|
+
const f = fixture(t);
|
|
162
|
+
const partial = payload();
|
|
163
|
+
partial.competitive_analysis.assessments[0].status = 'partial';
|
|
164
|
+
partial.claims[0].audit_status = 'partially-supported';
|
|
165
|
+
partial.claims[0].disposition = 'qualify';
|
|
166
|
+
assert.equal(validateCompetitiveAnalysis(partial, f.evidence, { checkArtifacts: false }).enabled, true);
|
|
167
|
+
partial.competitive_analysis.assessments[0].limitations = [];
|
|
168
|
+
reject(partial, f.evidence, /Schema.*limitations/s);
|
|
169
|
+
const unknownScope = payload();
|
|
170
|
+
unknownScope.competitive_analysis.competitors[0].version = 'unknown';
|
|
171
|
+
unknownScope.competitive_analysis.assessments[0].limitations = [];
|
|
172
|
+
reject(unknownScope, f.evidence, /unknown version\/edition\/region requires limitations/);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
test('未知允许空 Claim,但必须有来源缺口和补证计划', t => {
|
|
176
|
+
const f = fixture(t);
|
|
177
|
+
assert.equal(validateCompetitiveAnalysis(f.data, f.evidence, { checkArtifacts: false }).enabled, true);
|
|
178
|
+
for (const mutate of [data => { data.competitive_analysis.assessments[1].gap = null; }, data => { data.competitive_analysis.assessments[1].gap.next_step = ' '; }]) {
|
|
179
|
+
const data = payload(); mutate(data); reject(data, f.evidence, /Schema.*gap/s);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test('不支持要求明确证据,none-found 与搜索记录不能冒充', t => {
|
|
184
|
+
const f = fixture(t);
|
|
185
|
+
const absent = payload();
|
|
186
|
+
absent.competitive_analysis.assessments[0].status = 'absent';
|
|
187
|
+
absent.claims[0].statement = 'Alpha v1 Pro CN 明确不支持 CSV。';
|
|
188
|
+
absent.evidence_items[0].observation = 'Alpha v1 Pro CN: CSV is explicitly unavailable.';
|
|
189
|
+
assert.equal(validateCompetitiveAnalysis(absent, f.evidence, { checkArtifacts: false }).enabled, true);
|
|
190
|
+
absent.evidence_items[0].source_ref = 'search-002';
|
|
191
|
+
reject(absent, f.evidence, /absent cannot use none-found/);
|
|
192
|
+
absent.evidence_items[0].source_ref = 'fixture://search';
|
|
193
|
+
absent.evidence_items[0].source_class = 'search-log';
|
|
194
|
+
reject(absent, f.evidence, /absent cannot use none-found/);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
test('缺失输出、表格漂移和证据摘要漂移均拒绝', t => {
|
|
198
|
+
const f = fixture(t);
|
|
199
|
+
assert.throws(() => validateCompetitiveAnalysis(f.data, f.evidence), /missing output artifact/);
|
|
200
|
+
execute(renderer, [f.evidence]);
|
|
201
|
+
const matrix = path.join(f.directory, 'sample-competitive-matrix.md');
|
|
202
|
+
writeFileSync(matrix, readFileSync(matrix, 'utf8').replace('✅ 明确支持;Claim:', '❌ 明确不支持;Claim:'));
|
|
203
|
+
assert.throws(() => validateCompetitiveAnalysis(f.data, f.evidence), /managed content drift/);
|
|
204
|
+
execute(renderer, [f.evidence]);
|
|
205
|
+
f.data.claims[0].statement = '修改后的 Claim 正文';
|
|
206
|
+
assert.throws(() => validateCompetitiveAnalysis(f.data, f.evidence), /managed content drift/);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
test('渲染仅修改管理区并保留人工正文,第二份非法时不写第一份', t => {
|
|
210
|
+
const f = fixture(t);
|
|
211
|
+
const matrix = path.join(f.directory, 'sample-competitive-matrix.md');
|
|
212
|
+
const report = path.join(f.directory, 'sample-competitive-analysis.md');
|
|
213
|
+
const original = '人工前言\n<!-- YSS-COMPETITIVE:START -->\n旧受控内容\n<!-- YSS-COMPETITIVE:END -->\n人工结论\n';
|
|
214
|
+
writeFileSync(matrix, original);
|
|
215
|
+
writeFileSync(report, '没有标记的历史报告\n');
|
|
216
|
+
execute(renderer, [f.evidence], 1, /refusing to overwrite an unmarked legacy file/);
|
|
217
|
+
assert.equal(readFileSync(matrix, 'utf8'), original);
|
|
218
|
+
assert.equal(readFileSync(report, 'utf8'), '没有标记的历史报告\n');
|
|
219
|
+
rmSync(report);
|
|
220
|
+
execute(renderer, [f.evidence]);
|
|
221
|
+
const content = readFileSync(matrix, 'utf8');
|
|
222
|
+
assert.ok(content.startsWith('人工前言\n'));
|
|
223
|
+
assert.ok(content.endsWith('\n人工结论\n'));
|
|
224
|
+
validateCompetitiveAnalysis(f.data, f.evidence);
|
|
225
|
+
writeFileSync(report, readFileSync(report, 'utf8').replace('<!-- YSS-COMPETITIVE:END -->', '<!-- YSS-COMPETITIVE:END -->\n<!-- YSS-COMPETITIVE:END -->'));
|
|
226
|
+
execute(renderer, [f.evidence], 1, /exactly one complete managed region/);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
test('路径越界、错误 slug 和符号链接输出直接拒绝', t => {
|
|
230
|
+
const f = fixture(t, payload('matrix'));
|
|
231
|
+
for (const filename of ['../sample-competitive-matrix.md', 'other-competitive-matrix.md', 'nested\\sample-competitive-matrix.md']) {
|
|
232
|
+
const data = payload('matrix'); data.competitive_analysis.artifacts.matrix = filename;
|
|
233
|
+
reject(data, f.evidence, /Schema|adjacent same-slug filename/);
|
|
234
|
+
}
|
|
235
|
+
const outside = path.join(f.directory, 'outside.md');
|
|
236
|
+
writeFileSync(outside, '外部文件');
|
|
237
|
+
symlinkSync(outside, path.join(f.directory, 'sample-competitive-matrix.md'));
|
|
238
|
+
execute(renderer, [f.evidence], 1, /symbolic link is not allowed/);
|
|
239
|
+
assert.equal(readFileSync(outside, 'utf8'), '外部文件');
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
test('输出文本转义不会注入管理标记或破坏 Markdown 表格', t => {
|
|
243
|
+
const data = payload('matrix');
|
|
244
|
+
data.competitive_analysis.competitors[0].name = 'Alpha | <tag>\n<!-- YSS-COMPETITIVE:START -->';
|
|
245
|
+
const f = fixture(t, data);
|
|
246
|
+
execute(renderer, [f.evidence]);
|
|
247
|
+
const content = readFileSync(path.join(f.directory, 'sample-competitive-matrix.md'), 'utf8');
|
|
248
|
+
assert.equal(content.split('<!-- YSS-COMPETITIVE:START -->').length, 2);
|
|
249
|
+
assert.match(content, /Alpha \\\| <tag><br>/);
|
|
250
|
+
validateCompetitiveAnalysis(data, f.evidence);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
test('验证依赖可绑定指定 repo 根,缺依赖不能跳过', t => {
|
|
254
|
+
const f = fixture(t, payload('matrix'));
|
|
255
|
+
execute(renderer, [f.evidence]);
|
|
256
|
+
const files = competitiveVerificationFiles(f.evidence);
|
|
257
|
+
const fixtureRoot = path.join(f.directory, 'root');
|
|
258
|
+
for (const dependency of files.slice(1)) {
|
|
259
|
+
const target = path.join(fixtureRoot, path.relative(repoRoot, dependency));
|
|
260
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
261
|
+
copyFileSync(dependency, target);
|
|
262
|
+
}
|
|
263
|
+
const bound = competitiveVerificationFiles(f.evidence, { root: fixtureRoot });
|
|
264
|
+
assert.equal(bound[0], path.join(f.directory, 'sample-competitive-matrix.md'));
|
|
265
|
+
assert.ok(bound.slice(1).every(file => file.startsWith(`${fixtureRoot}${path.sep}`)));
|
|
266
|
+
const schema = path.join(fixtureRoot, '.agents/skills/yss-research/references/competitive-analysis.schema.json');
|
|
267
|
+
assert.ok(existsSync(schema));
|
|
268
|
+
rmSync(schema);
|
|
269
|
+
assert.throws(() => competitiveVerificationFiles(f.evidence, { root: fixtureRoot }), /ENOENT/);
|
|
270
|
+
});
|
|
@@ -5,46 +5,40 @@ description: "接入或排查 YSS Resilience4j starter、网关熔断、限流
|
|
|
5
5
|
|
|
6
6
|
# yss-resilience4j
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
处理 YSS 网关断路器、fallback 响应和韧性配置;阈值、状态与恢复行为按服务 SLO 和当前 API 契约核验。
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Source Index First
|
|
13
|
-
|
|
14
|
-
- Backend source location is environment-specific; resolve it with `yss-skill-source-index-refresh/references/source-location.md`.
|
|
15
|
-
- Generated index: `references/source-index.md`
|
|
16
|
-
- Component path hints: `yss-microservice-components/yss-component-resilience4j-starter`
|
|
10
|
+
## 平台与源码门禁
|
|
17
11
|
|
|
18
|
-
|
|
12
|
+
接入、修改、代码生成或提供精确类名/配置前,必须读取并执行 [共享平台与源码门禁](../yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md),以 `--skill yss-resilience4j` 校验批准的平台线及匹配源码根。缺失、错配或漂移返回 `blocked`;不跨代回退,不在业务实现中升级、降级或替换组件。只读分诊可继续,但须标注未完成源码核验,不能据此宣称跨 Boot/JDK 兼容。
|
|
19
13
|
|
|
20
|
-
##
|
|
14
|
+
## 源码定位
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
2. Identify whether the task is gateway circuit breaker configuration, fallback response, global circuit exception handling, or resilience troubleshooting.
|
|
24
|
-
3. Inspect `GatewayConfiguration` for route/filter wiring and `GlobalCircuitExceptionAdvice` for exception response behavior.
|
|
25
|
-
4. Tune thresholds/timeouts in configuration rather than hardcoding resilience behavior in business handlers.
|
|
26
|
-
5. Keep fallback responses consistent with gateway/API response contracts.
|
|
16
|
+
按 [源码定位策略](../yss-skill-source-index-refresh/references/source-location.md) 确认真实位置,再从 [平台索引](references/source-index.md) 定位当前任务需要的源码。`yss-microservice-components/yss-component-resilience4j-starter` 仅是模块路径提示。
|
|
27
17
|
|
|
28
|
-
##
|
|
18
|
+
## 工作流
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
1. 按平台索引定位当前组件源码与 `readme.md`。
|
|
21
|
+
2. 区分网关断路器配置、fallback 响应、全局 circuit 异常映射与韧性排障。
|
|
22
|
+
3. 装配问题核验 `GatewayConfiguration` 的 route/filter;异常响应核验 `GlobalCircuitExceptionAdvice`。
|
|
23
|
+
4. 阈值和超时在配置中调整,不硬编码到业务 handler。
|
|
24
|
+
5. fallback 状态和正文与网关/API 合同一致。
|
|
33
25
|
|
|
34
|
-
##
|
|
26
|
+
## 能力边界
|
|
35
27
|
|
|
36
|
-
-
|
|
37
|
-
- Circuit
|
|
38
|
-
-
|
|
39
|
-
- Timeout, slow-call, and failure thresholds match service SLOs.
|
|
40
|
-
- Logs/metrics make open/half-open/recovered states diagnosable.
|
|
28
|
+
- 网关韧性装配:`GatewayConfiguration`。
|
|
29
|
+
- Circuit 异常映射:`GlobalCircuitExceptionAdvice`。
|
|
30
|
+
- 运行指引:README“轻量微服务断路器”。
|
|
41
31
|
|
|
42
|
-
##
|
|
32
|
+
## 验收
|
|
43
33
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
34
|
+
- 核验所需依赖或 starter 已进入实际工程。
|
|
35
|
+
- 断路器名称和 route ID 与网关配置一致。
|
|
36
|
+
- fallback 状态/正文符合前端与 API 消费方契约。
|
|
37
|
+
- 超时、慢调用与失败阈值符合服务 SLO。
|
|
38
|
+
- 日志/指标可诊断 open、half-open 和 recovered 状态。
|
|
47
39
|
|
|
48
|
-
##
|
|
40
|
+
## 修改边界
|
|
49
41
|
|
|
50
|
-
|
|
42
|
+
- 类名和配置 key 先核验当前索引与源码,不凭记忆补造。
|
|
43
|
+
- 使用组件已有扩展 seam,不以业务本地框架代码替换。
|
|
44
|
+
- 保持当前组件任务范围;扩展到其他组件须有用户要求或重新路由依据。
|
|
@@ -5,17 +5,7 @@ description: "审查、迁移或排查既有 YSS 加解密、JWT/JWK、密码编
|
|
|
5
5
|
|
|
6
6
|
# yss-security-algorithm
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
中文说明:本技能用于 YSS 安全算法组件。执行时优先读取源码索引,避免凭记忆猜类名、配置项或接入方式。
|
|
11
|
-
|
|
12
|
-
## Source Index First
|
|
13
|
-
|
|
14
|
-
- Backend source location is environment-specific; resolve it with `yss-skill-source-index-refresh/references/source-location.md`.
|
|
15
|
-
- Generated index: `references/source-index.md`
|
|
16
|
-
- Component path hints: `yss-microservice-components/yss-component-security-algorithm`
|
|
17
|
-
|
|
18
|
-
Read `references/source-index.md` as a path-hint index whenever the task depends on exact modules, annotations, auto configuration, properties, controllers, clients, repositories, DTOs, handlers, or troubleshooting.
|
|
8
|
+
作为既有 YSS 安全算法组件的盘点、分诊、风险收敛和迁移入口。当前组件禁止新生产接入;准入结论不因源码可读或可编译而改变。
|
|
19
9
|
|
|
20
10
|
## 当前准入结论
|
|
21
11
|
|
|
@@ -25,7 +15,15 @@ Read `references/source-index.md` as a path-hint index whenever the task depends
|
|
|
25
15
|
- 只有平台目录中的 `component.security-algorithm` 对目标架构为 `verified`,精确构件绑定仍有效,并且外部 KMS / Secret Manager、轮换撤销、兼容迁移、行为测试和安全责任人审查全部闭合后,才能通过独立决策重新开放新接入;本 Skill 不自行修改该状态。
|
|
26
16
|
- 新接入请求返回 `component-new-adoption-forbidden` / `blocked-for-production`,并给出迁移或外部密钥服务方案;不得生成基于遗留工具类的生产代码。
|
|
27
17
|
|
|
28
|
-
##
|
|
18
|
+
## 平台与源码门禁
|
|
19
|
+
|
|
20
|
+
接入、修改、代码生成或提供精确类名/配置前,必须读取并执行 [共享平台与源码门禁](../yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md),以 `--skill yss-security-algorithm` 校验批准的平台线及匹配源码根。缺失、错配或漂移返回 `blocked`;不跨代回退,不在业务实现中升级、降级或替换组件。只读分诊可继续,但须标注未完成源码核验,不能据此宣称跨 Boot/JDK 兼容。
|
|
21
|
+
|
|
22
|
+
## 源码定位
|
|
23
|
+
|
|
24
|
+
按 [源码定位策略](../yss-skill-source-index-refresh/references/source-location.md) 确认真实位置,再从 [平台索引](references/source-index.md) 定位当前任务需要的源码。`yss-microservice-components/yss-component-security-algorithm` 仅是模块路径提示。
|
|
25
|
+
|
|
26
|
+
## 工作流
|
|
29
27
|
|
|
30
28
|
1. 识别任务是新接入、既有故障、风险止血还是迁移;新接入直接按上述准入结论阻断。
|
|
31
29
|
2. 读取 `references/source-index.md`,再按需检查 `CryptoType`、`SecurityCryptoUtil`、`KeyGeneratorUtils` 和 `DefaultJwtConfiguration`,记录实际算法、模式、编码、key id、密钥来源、调用方和持久化数据范围。
|
|
@@ -39,38 +37,34 @@ Read `references/source-index.md` as a path-hint index whenever the task depends
|
|
|
39
37
|
10. JWT 必须验证 signature、issuer、audience、expiry 和允许算法,payload parsing 不能充当认证。
|
|
40
38
|
11. 输出迁移清单、数据/调用方影响、回滚点、验证结果和安全审查引用;缺任一生产前提时保持 `blocked-for-production`。
|
|
41
39
|
|
|
42
|
-
##
|
|
40
|
+
## 安全与兼容
|
|
43
41
|
|
|
44
42
|
- Boot 2 历史实现中的硬编码 RSA 私钥、固定 key id、临时 JWK 与 noop 默认值必须视为已暴露风险并进入轮换/撤销盘点;不得把这些历史事实误写成 Boot 3 当前实现。
|
|
45
43
|
- Boot 3 `Jwks` fail closed,`DefaultJwtConfiguration` 只提供 `PasswordEncoderFactories` 的 delegating encoder;JWT/JWK 必须由应用安全层或外部 KMS 提供。
|
|
46
44
|
- 兼容适配器只保留公开类型和方法契约,不恢复旧密钥、旧密文解密或隐式 provider。存量兼容仍需代表性 ciphertext/JWT/password fixtures、回滚点和安全责任人审查。
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- JWT
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- `Jwks`
|
|
62
|
-
- Deprecated
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
##
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
## 平台与源码门禁
|
|
75
|
-
|
|
76
|
-
接入、修改、代码生成或给出精确类名/配置前,读取 [后端组件平台与源码门禁](../yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md),从批准的 `platform_configuration.component_platform_line` 选择 `source-index.boot2-java8.md` 或 `source-index.boot3-java17.md`,并以 `--skill yss-security-algorithm --platform-line <line> --source-root <matching-root>` 运行统一 freshness 校验。平台线与源码根不匹配、组件 tree 不一致、组件子树 dirty、索引缺少平台信号,或 Manifest / 组件 GAV 缺少 verified 兼容证据时返回 `blocked`;不得回退另一代索引,也不在业务实现中升级、降级或替换 YSS 组件。既有工程只读分诊可继续,但不得据此宣称跨 Boot/JDK 兼容。
|
|
45
|
+
- 区分存储加密、传输、签名与兼容需要,再按批准合同选择算法和密钥生命周期。
|
|
46
|
+
- 可部署实现消费批准的受控密钥服务和 key reference,不从示例推导密钥来源。
|
|
47
|
+
- API 合同明确明文/密文、编码格式和密钥类型。
|
|
48
|
+
|
|
49
|
+
## 验收
|
|
50
|
+
|
|
51
|
+
- 核验所需依赖或 starter 已进入实际工程。
|
|
52
|
+
- 算法选择明确并与调用方兼容。
|
|
53
|
+
- 生产前提包含密钥来源与轮换方案。
|
|
54
|
+
- JWT 验签覆盖 issuer/audience/expiry 策略,payload 解析不构成认证。
|
|
55
|
+
- 编码格式明确区分 Base64、hex、UTF-8 string 和 raw bytes。
|
|
56
|
+
- 解密使用匹配算法与密钥类型。
|
|
57
|
+
- 源码不新增密码、私钥或长期 secret。
|
|
58
|
+
- 外部密钥存储、轮换撤销、算法参数、兼容测试或安全责任人审查缺任一项时,返回 `blocked-for-production`,不生成生产加密代码。
|
|
59
|
+
- `Jwks` 缺 managed source、`SecurityCryptoUtil` 缺批准的 `SecurityCryptoProvider` 时均 fail closed。
|
|
60
|
+
- Deprecated 兼容适配器只保留公开签名并委派批准 provider,不恢复新接入资格。
|
|
61
|
+
- 禁用旧 key 或 encoder 前,用代表性 fixture 证明存量 ciphertext/JWT/password 兼容。
|
|
62
|
+
- 日志与证据只包含 key reference 和脱敏 metadata,不包含明文、私钥、seed、shared secret 或完整 token。
|
|
63
|
+
|
|
64
|
+
## 修改边界
|
|
65
|
+
|
|
66
|
+
- 类名和配置 key 先核验当前索引与源码,不凭记忆补造。
|
|
67
|
+
- 使用组件已有扩展 seam,不以业务本地框架代码替换。
|
|
68
|
+
- 保持当前组件任务范围;扩展到其他组件须有用户要求或重新路由依据。
|
|
69
|
+
- 组件编译、索引 fresh 或既有工程依赖不解除新接入禁令。
|
|
70
|
+
- Agent 输出不得复制、打印、就地轮换或重新签发密钥材料。
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yss-skill-source-index-refresh
|
|
3
|
-
description:
|
|
3
|
+
description: 后端组件源码或前端 YSS UI 文档变化后,刷新技能来源索引并核验平台线、组件摘要与引用。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# YSS
|
|
6
|
+
# YSS 技能来源索引维护
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
本 Skill 维护后端组件与前端文档的来源索引;索引用于定位和核验,不代替组件兼容认证。只读取或排障时使用现有索引及 freshness 门禁,不因每次调用自动刷新。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## 来源定位
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
- 后端源码按平台线区分,信任生成路径前读取 [源码定位策略](references/source-location.md)。
|
|
13
|
+
- 刷新时设置 `YSS_SOURCE_ROOT_BOOT2_JAVA8` 与 `YSS_SOURCE_ROOT_BOOT3_JAVA17`,分别指向匹配平台的干净源码树;不能使用同一 checkout 或从分支名推断平台线。
|
|
14
|
+
- 前端 YSS UI 组件: `http://192.168.164.27:3200/components`
|
|
15
|
+
- 前端 YSS UI hooks: `http://192.168.164.27:3200/hooks`
|
|
16
|
+
- 前端 YSS UI 技能文档: `http://192.168.164.27:3200/skills`
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
- Set both `YSS_SOURCE_ROOT_BOOT2_JAVA8` and `YSS_SOURCE_ROOT_BOOT3_JAVA17` to clean source trees. Do not point both variables at the same checkout or infer a platform line from a branch name.
|
|
16
|
-
- Frontend YSS UI components: `http://192.168.164.27:3200/components`
|
|
17
|
-
- Frontend YSS UI hooks: `http://192.168.164.27:3200/hooks`
|
|
18
|
-
- Frontend YSS UI skill docs: `http://192.168.164.27:3200/skills`
|
|
18
|
+
## 刷新
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Run:
|
|
20
|
+
源码输入与刷新范围确定后运行:
|
|
23
21
|
|
|
24
22
|
```bash
|
|
25
23
|
export YSS_SKILLS_ROOT="/path/to/.agents/skills"
|
|
@@ -28,42 +26,37 @@ export YSS_SOURCE_ROOT_BOOT3_JAVA17="/path/to/boot3-java17/yss-cloud-microservic
|
|
|
28
26
|
node "$YSS_SKILLS_ROOT/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs"
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
Use `YSS_REFRESH_BACKEND_SKILLS=yss-mybatis` (comma-separated) to refresh only selected backend indexes and avoid unrelated component churn.
|
|
29
|
+
仅后端刷新时设置 `YSS_REFRESH_FRONTEND=false`,避免无关前端时间戳变化;用 `YSS_REFRESH_BACKEND_SKILLS=yss-mybatis`(多个 ID 逗号分隔)限定组件范围。所选组件仍刷新两条平台线,因此两个源码根都必须齐备。
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
后端输出稳定选择页 `references/source-index.md` 与两条平台生成索引;前端输出 `references/frontend-docs.md`。需要新增或调整技能到来源的映射时读取 [映射配置](references/source-map-config.md)。
|
|
35
32
|
|
|
36
33
|
所有后端组件 Skill 共用 [平台与源码门禁](references/backend-component-platform-compatibility.md)。`references/source-index.md` 是稳定选择页;真实生成索引分别为 `source-index.boot2-java8.md` 与 `source-index.boot3-java17.md`。刷新后使用批准的 `platform_configuration.component_platform_line` 运行 `scripts/check-backend-skill-source-index.mjs --skill <skill-id> --platform-line <line> --source-root <matching-root>`,确认组件 tree、组件子树状态和 v2 平台信号与所选源码行一致。
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
The refresh command requires both generation-specific roots. A targeted refresh may still use `YSS_REFRESH_BACKEND_SKILLS`, but it updates both platform tracks for every selected Skill.
|
|
35
|
+
脚本不复制大段源码;通用组件生成入口索引,持久化组件另生成公开 API、配置开关和能力边界矩阵,供按需定位真实源码。
|
|
41
36
|
|
|
42
|
-
##
|
|
37
|
+
## 输出合同
|
|
43
38
|
|
|
44
|
-
|
|
39
|
+
生成索引保留以下来源与定位信息:
|
|
45
40
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- Maven
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
41
|
+
- 明确的平台线、生成时间与仅作追踪的 source Git commit
|
|
42
|
+
- 组件相对 tree hash 与组件子树工作区状态
|
|
43
|
+
- 组件目录与文档文件
|
|
44
|
+
- Maven 模块
|
|
45
|
+
- 源文件 hash 与可重定位路径
|
|
46
|
+
- 能力敏感组件的公开签名、配置 key/默认值、启用条件与能力边界,均从源码提取
|
|
47
|
+
- 其他组件的关键 Java 入口,包括注解、自动配置、属性、切面、拦截器、handler、Repository、DTO 和结果类型
|
|
53
48
|
- local Maven lineage、精确组件 GAV,以及继承的 Java/Spring Boot、`javax`/`jakarta` 和自动配置注册信号;这些是源码观察,不是兼容认证
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
Do not paste full component source into `SKILL.md`. Keep `SKILL.md` short and let specialists read generated indexes or targeted assets only when needed.
|
|
49
|
+
- 当前实现或排障需要继续读取的来源
|
|
57
50
|
|
|
58
|
-
|
|
51
|
+
`SKILL.md` 保留任务入口,不粘贴完整组件源码;专项任务按需读取生成索引或对应资产。
|
|
59
52
|
|
|
60
|
-
|
|
53
|
+
## Freshness 门禁
|
|
61
54
|
|
|
62
|
-
|
|
55
|
+
提供精确类名、配置或安全结论前,必须执行 [共享平台与源码门禁](references/backend-component-platform-compatibility.md),按批准平台选择索引与干净源码根。平台缺失或错配、组件 tree 漂移、子树 dirty 返回 `stale` / `blocked`,不回退另一代;历史路径提示只能定位。仅仓库 commit 不同但组件 tree 未变,不使索引过期。
|
|
63
56
|
|
|
64
|
-
##
|
|
57
|
+
## 刷新后验证
|
|
65
58
|
|
|
66
|
-
|
|
59
|
+
修改刷新器或完成索引刷新后,运行现有 Node 检查:
|
|
67
60
|
|
|
68
61
|
```bash
|
|
69
62
|
node --test "$YSS_SKILLS_ROOT/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 执行入口
|
|
6
6
|
|
|
7
|
-
1. 接入、修改、代码生成或给出精确类名/配置前,从批准的 `platform_configuration.component_platform_line` 选择目标 Skill 的 `references/source-index.boot2-java8.md` 或 `references/source-index.boot3-java17.md
|
|
7
|
+
1. 接入、修改、代码生成或给出精确类名/配置前,从批准的 `platform_configuration.component_platform_line` 选择目标 Skill 的 `references/source-index.boot2-java8.md` 或 `references/source-index.boot3-java17.md`。以下命令从目标组件 Skill 根目录执行:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
node ../yss-skill-source-index-refresh/scripts/check-backend-skill-source-index.mjs \
|
|
@@ -9,11 +9,9 @@ description: 编排 Plan 到 Spec 入口的方案决策与业务边界、协作
|
|
|
9
9
|
|
|
10
10
|
`yss-stage-decision` 是由生命周期主控调度的上游决策技能,负责把需求、产品、商务输入和业务边界与规则设计结果整理成可审查、可版本化、可被下游消费的方案决策包。它不替代生命周期主控,也不生成产品代码、原型、OpenAPI 或垂直切片 Ticket。
|
|
11
11
|
|
|
12
|
-
文档输出时按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `.template-spec/process/document-writing.md`;作用域仅限当前产物,派发时传递条件及引用。
|
|
13
|
-
|
|
14
12
|
## 文档写作
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
撰写方案决策包和业务边界说明时,按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `.template-spec/process/document-writing.md` 的共用写法及 Plan 指引;原业务规则、决定依据和未决项完整保留。作用域仅限当前产物,派发时传递条件及引用。
|
|
17
15
|
|
|
18
16
|
## 适用边界
|
|
19
17
|
|
|
@@ -41,10 +39,9 @@ Plan 成功标准在既有 `success_criteria[].statement` 细化指标定义、
|
|
|
41
39
|
- 新建领域战略、阶段决策包使用 JSON;存量 YAML 保持只读兼容,显式迁移见 `.template-spec/process/structured-assets.md`。使用 `scripts/contract plan-write/apply-write` 结构化落盘,不对合同作字符串拼接。校验器必须执行权威 Schema 后再检查跨文件语义。
|
|
42
40
|
- 复用 Plan 原始决定编号,不自行重排;批准前用 `scripts/check-plan-stage-coverage` 生成绑定 Plan、决定记录和阶段包摘要的逐项对照证据,非目标使用显式映射。无法提取、缺项或映射歧义必须补齐;语义等价仍由独立评审确认,覆盖检查不构成批准。
|
|
43
41
|
|
|
44
|
-
- 用户决定遵循 [用户决定协议](../yss-product-lifecycle/references/user-decisions.md)
|
|
42
|
+
- 用户决定遵循 [用户决定协议](../yss-product-lifecycle/references/user-decisions.md):决定绑定资产、版本、范围和证据。字节摘要变化先使旧验证过期,再核验差异;决定依据与授权范围未变时,按协议延续原回复并重新绑定当前审查和验证。实质范围、关键规则、风险接受或失效条件变化时,展示差异后取得新的真实回复。
|
|
45
43
|
- checkpoint 是唯一机器状态源,业务 Ticket 只保存追踪引用,不复制阶段状态。
|
|
46
44
|
- 每次批准、重发和消费者流转前执行 `context_reconciliation`,核验 `CONTEXT.md` 的全文与引用术语双摘要。
|
|
47
|
-
- 技术事实与第三方行为走 `yss-research` 的 `technical-evidence`;产品策略依据走 `strategy-evidence`;市场与竞品判断走 `competitive-intelligence`。
|
|
48
45
|
- 修改本 Skill 时只编辑 `.agents/skills` 权威副本,再由 `maintaining-skills` 生成投影和 `skills-lock.json`。
|
|
49
46
|
- 本 Skill 只能标记影响、提出待解决问题和选择消费者能力;不得预选后端架构族,不得进入技术设计或实现流程,也不得授权实现。
|
|
50
47
|
|
|
@@ -34,7 +34,7 @@ description: 在 YSS 技术分析阶段将批准的战略领域输入细化为
|
|
|
34
34
|
|
|
35
35
|
批准且版本当前的战术设计合同由 `Slice Implementation Contract` 引用,再由 `yss-domain` 使用 `behavior-tdd` 实现。`yss-domain` 不得静默重新定义聚合或不变量;发现新的 API、状态、数据或架构影响时必须返回 `new_impacts` / `drift` 并重新路由。
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
起草 DDD `design` 时读取 [战术合同](references/tactical-design-contract.md),按 [验证规则](references/validation-rules.md) 执行 `scripts/validate-tactical-design.mjs` 的只读校验;需要正文结构时读取 [输出模板](references/output-template.md),不批量加载整个 references 目录。该 Skill 不生成 Java、Repository、Controller、DTO、OpenAPI Freeze、实现 Ticket 或生产代码。
|
|
38
38
|
|
|
39
39
|
## 战略交接快照包
|
|
40
40
|
|
|
@@ -5,7 +5,7 @@ owner: ai
|
|
|
5
5
|
|
|
6
6
|
# <功能名称> Tactical DDD Design
|
|
7
7
|
|
|
8
|
-
仅用于已确认 domain-driven 分支的阅读视图;引用 Technical Design Contract v2 的 design
|
|
8
|
+
仅用于已确认 domain-driven 分支的阅读视图;引用 Technical Design Contract v2 的 design,不复制共同输入与审批状态。交接来源及可接受版本按 [输入合同](tactical-design-contract.md) 核对并绑定实际 ref/version/digest。MVC 使用 `yss-technical-design` 的 `layered-mvc` 分支。
|
|
9
9
|
|
|
10
10
|
## 上游引用
|
|
11
11
|
|
|
@@ -13,8 +13,8 @@ owner: ai
|
|
|
13
13
|
|---|---|---|---|
|
|
14
14
|
| Spec | | | |
|
|
15
15
|
| Strategic DDD | | | |
|
|
16
|
-
| Strategic Design Handoff
|
|
17
|
-
|
|
|
16
|
+
| Strategic Design Handoff / 交付包(适用时) | | | |
|
|
17
|
+
| 原型或 existing UI baseline(按交接来源) | | | |
|
|
18
18
|
| Strategic Context Import / Context Reconciliation | | | |
|
|
19
19
|
| 状态矩阵 | | | |
|
|
20
20
|
| OpenAPI / 无 API 影响记录 | | | |
|