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.
Files changed (554) hide show
  1. package/README.md +2 -0
  2. package/bin/create-yss-spec.js +3 -1
  3. package/cli-core.lock.json +11 -7
  4. package/package.json +4 -1
  5. package/src/api/_sync-service.js +3 -1
  6. package/src/command-runner.mjs +44 -9
  7. package/src/content-identity.js +111 -0
  8. package/src/runtime-store.mjs +650 -0
  9. package/src/template/asset-runtime.js +7 -2
  10. package/src/template/instance-runtime.js +27 -9
  11. package/src/validation/metadata.js +8 -0
  12. package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
  13. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +30 -36
  14. package/template/.agents/skills/archify/SKILL.md +2 -2
  15. package/template/.agents/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  16. package/template/.agents/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  17. package/template/.agents/skills/code-review/SKILL.md +19 -11
  18. package/template/.agents/skills/code-review/references/candidate-capture.md +1 -1
  19. package/template/.agents/skills/code-review/references/legacy-convergence.md +3 -1
  20. package/template/.agents/skills/code-review/references/review-axis-checklists.md +2 -0
  21. package/template/.agents/skills/code-review/references/yss-review-standards.md +4 -2
  22. package/template/.agents/skills/competitive-intelligence/SKILL.md +32 -74
  23. package/template/.agents/skills/file-export-download/SKILL.md +4 -73
  24. package/template/.agents/skills/file-export-download/references/binary-contract-example.md +26 -0
  25. package/template/.agents/skills/file-export-download/references/download-call-example.md +45 -0
  26. package/template/.agents/skills/formily-foundation/SKILL.md +6 -105
  27. package/template/.agents/skills/formily-foundation/references/async-save-example.md +57 -0
  28. package/template/.agents/skills/formily-foundation/references/query-layout.md +50 -0
  29. package/template/.agents/skills/formily-linkage-effects/SKILL.md +3 -116
  30. package/template/.agents/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  31. package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +3 -81
  32. package/template/.agents/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  33. package/template/.agents/skills/formily-step-flow/SKILL.md +3 -143
  34. package/template/.agents/skills/formily-step-flow/references/step-flow-example.md +143 -0
  35. package/template/.agents/skills/handoff/SKILL.md +3 -1
  36. package/template/.agents/skills/i-have-adhd/SKILL.md +2 -2
  37. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  38. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  39. package/template/.agents/skills/implement/SKILL.md +2 -2
  40. package/template/.agents/skills/llm-wiki/references/transactions.md +2 -2
  41. package/template/.agents/skills/llm-wiki/scripts/core.mjs +40 -2
  42. package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +30 -27
  43. package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  44. package/template/.agents/skills/lombok/SKILL.md +2 -0
  45. package/template/.agents/skills/mapstruct/SKILL.md +2 -0
  46. package/template/.agents/skills/tdd/SKILL.md +2 -2
  47. package/template/.agents/skills/theme-token-usage/SKILL.md +6 -5
  48. package/template/.agents/skills/wayfinder/references/chart-map.md +2 -2
  49. package/template/.agents/skills/wayfinder/references/ticket-types.md +1 -1
  50. package/template/.agents/skills/yss-api-integration/SKILL.md +13 -50
  51. package/template/.agents/skills/yss-api-integration/references/orval-list-example.md +38 -0
  52. package/template/.agents/skills/yss-application/SKILL.md +11 -5
  53. package/template/.agents/skills/yss-audit-log/SKILL.md +8 -6
  54. package/template/.agents/skills/yss-audit-log/references/README.md +5 -5
  55. package/template/.agents/skills/yss-cache/SKILL.md +4 -4
  56. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  57. package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  58. package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  59. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  60. package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
  61. package/template/.agents/skills/yss-distributed-id/SKILL.md +4 -4
  62. package/template/.agents/skills/yss-dto/SKILL.md +9 -9
  63. package/template/.agents/skills/yss-dto/references/README.md +4 -4
  64. package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  65. package/template/.agents/skills/yss-excel-mvc/SKILL.md +4 -4
  66. package/template/.agents/skills/yss-exception/SKILL.md +42 -48
  67. package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +26 -170
  68. package/template/.agents/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  69. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  70. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  71. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  72. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  73. package/template/.agents/skills/yss-mybatis/SKILL.md +4 -4
  74. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +6 -4
  75. package/template/.agents/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  76. package/template/.agents/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  77. package/template/.agents/skills/yss-openapi-governance/SKILL.md +5 -7
  78. package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +2 -0
  79. package/template/.agents/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  80. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +23 -21
  81. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  82. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  83. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  84. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  85. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -1
  86. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  87. package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
  88. package/template/.agents/skills/yss-repository/SKILL.md +2 -2
  89. package/template/.agents/skills/yss-research/SKILL.md +39 -48
  90. package/template/.agents/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  91. package/template/.agents/skills/yss-research/references/competitive-analysis.md +76 -0
  92. package/template/.agents/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  93. package/template/.agents/skills/yss-research/references/evidence-contract.md +8 -0
  94. package/template/.agents/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  95. package/template/.agents/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  96. package/template/.agents/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  97. package/template/.agents/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  98. package/template/.agents/skills/yss-resilience4j/SKILL.md +25 -31
  99. package/template/.agents/skills/yss-security-algorithm/SKILL.md +37 -43
  100. package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  101. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  102. package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -5
  103. package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -1
  104. package/template/.agents/skills/yss-tactical-design/references/output-template.md +3 -3
  105. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  106. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -5
  107. package/template/.agents/skills/yss-ui/SKILL.md +7 -1
  108. package/template/.agents/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  109. package/template/.agents/skills/yss-ui/references/checklist.md +38 -96
  110. package/template/.agents/skills/yss-ui/references/component-routing.md +3 -1
  111. package/template/.agents/skills/yss-ui/references/quick-recipes.md +17 -272
  112. package/template/.agents/skills/yss-ui/references/specialized-components.md +3 -3
  113. package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  114. package/template/.agents/skills/yss-up-springboot3/SKILL.md +19 -21
  115. package/template/.agents/skills/yss-userinfo/SKILL.md +27 -33
  116. package/template/.agents/skills/yss-validation/SKILL.md +26 -32
  117. package/template/.agents/skills/yss-web-controller/SKILL.md +11 -44
  118. package/template/.agents/skills/yss-web-controller/references/crud-generation.md +38 -0
  119. package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
  120. package/template/.agents/skills/ytree-usage/SKILL.md +2 -80
  121. package/template/.agents/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  122. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +30 -36
  123. package/template/.codex/skills/archify/SKILL.md +2 -2
  124. package/template/.codex/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  125. package/template/.codex/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  126. package/template/.codex/skills/code-review/SKILL.md +19 -11
  127. package/template/.codex/skills/code-review/references/candidate-capture.md +1 -1
  128. package/template/.codex/skills/code-review/references/legacy-convergence.md +3 -1
  129. package/template/.codex/skills/code-review/references/review-axis-checklists.md +2 -0
  130. package/template/.codex/skills/code-review/references/yss-review-standards.md +4 -2
  131. package/template/.codex/skills/competitive-intelligence/SKILL.md +32 -74
  132. package/template/.codex/skills/file-export-download/SKILL.md +4 -73
  133. package/template/.codex/skills/file-export-download/references/binary-contract-example.md +26 -0
  134. package/template/.codex/skills/file-export-download/references/download-call-example.md +45 -0
  135. package/template/.codex/skills/formily-foundation/SKILL.md +6 -105
  136. package/template/.codex/skills/formily-foundation/references/async-save-example.md +57 -0
  137. package/template/.codex/skills/formily-foundation/references/query-layout.md +50 -0
  138. package/template/.codex/skills/formily-linkage-effects/SKILL.md +3 -116
  139. package/template/.codex/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  140. package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +3 -81
  141. package/template/.codex/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  142. package/template/.codex/skills/formily-step-flow/SKILL.md +3 -143
  143. package/template/.codex/skills/formily-step-flow/references/step-flow-example.md +143 -0
  144. package/template/.codex/skills/handoff/SKILL.md +3 -1
  145. package/template/.codex/skills/i-have-adhd/SKILL.md +2 -2
  146. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  147. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  148. package/template/.codex/skills/implement/SKILL.md +2 -2
  149. package/template/.codex/skills/llm-wiki/references/transactions.md +2 -2
  150. package/template/.codex/skills/llm-wiki/scripts/core.mjs +40 -2
  151. package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +30 -27
  152. package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  153. package/template/.codex/skills/lombok/SKILL.md +2 -0
  154. package/template/.codex/skills/mapstruct/SKILL.md +2 -0
  155. package/template/.codex/skills/product-design/references/communication-protocol.md +3 -3
  156. package/template/.codex/skills/product-design/references/critical-overrides.md +4 -5
  157. package/template/.codex/skills/product-design/skills/audit/SKILL.md +2 -4
  158. package/template/.codex/skills/product-design/skills/get-context/SKILL.md +6 -8
  159. package/template/.codex/skills/product-design/skills/ideate/SKILL.md +3 -3
  160. package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +3 -5
  161. package/template/.codex/skills/product-design/skills/index/SKILL.md +1 -1
  162. package/template/.codex/skills/product-design/skills/prototype/SKILL.md +2 -4
  163. package/template/.codex/skills/product-design/skills/research/SKILL.md +4 -6
  164. package/template/.codex/skills/product-design/skills/research/assets/research-brief-template.md +3 -3
  165. package/template/.codex/skills/product-design/skills/share/SKILL.md +2 -4
  166. package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +2 -4
  167. package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
  168. package/template/.codex/skills/tdd/SKILL.md +2 -2
  169. package/template/.codex/skills/theme-token-usage/SKILL.md +6 -5
  170. package/template/.codex/skills/wayfinder/references/chart-map.md +2 -2
  171. package/template/.codex/skills/wayfinder/references/ticket-types.md +1 -1
  172. package/template/.codex/skills/yss-api-integration/SKILL.md +13 -50
  173. package/template/.codex/skills/yss-api-integration/references/orval-list-example.md +38 -0
  174. package/template/.codex/skills/yss-application/SKILL.md +11 -5
  175. package/template/.codex/skills/yss-audit-log/SKILL.md +8 -6
  176. package/template/.codex/skills/yss-audit-log/references/README.md +5 -5
  177. package/template/.codex/skills/yss-cache/SKILL.md +4 -4
  178. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  179. package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  180. package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  181. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  182. package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
  183. package/template/.codex/skills/yss-distributed-id/SKILL.md +4 -4
  184. package/template/.codex/skills/yss-dto/SKILL.md +9 -9
  185. package/template/.codex/skills/yss-dto/references/README.md +4 -4
  186. package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  187. package/template/.codex/skills/yss-excel-mvc/SKILL.md +4 -4
  188. package/template/.codex/skills/yss-exception/SKILL.md +42 -48
  189. package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +26 -170
  190. package/template/.codex/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  191. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  192. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  193. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  194. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  195. package/template/.codex/skills/yss-mybatis/SKILL.md +4 -4
  196. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +6 -4
  197. package/template/.codex/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  198. package/template/.codex/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  199. package/template/.codex/skills/yss-openapi-governance/SKILL.md +5 -7
  200. package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +2 -0
  201. package/template/.codex/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  202. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +23 -21
  203. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  204. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  205. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  206. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  207. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -1
  208. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  209. package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
  210. package/template/.codex/skills/yss-repository/SKILL.md +2 -2
  211. package/template/.codex/skills/yss-research/SKILL.md +39 -48
  212. package/template/.codex/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  213. package/template/.codex/skills/yss-research/references/competitive-analysis.md +76 -0
  214. package/template/.codex/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  215. package/template/.codex/skills/yss-research/references/evidence-contract.md +8 -0
  216. package/template/.codex/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  217. package/template/.codex/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  218. package/template/.codex/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  219. package/template/.codex/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  220. package/template/.codex/skills/yss-resilience4j/SKILL.md +25 -31
  221. package/template/.codex/skills/yss-security-algorithm/SKILL.md +37 -43
  222. package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  223. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  224. package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -5
  225. package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -1
  226. package/template/.codex/skills/yss-tactical-design/references/output-template.md +3 -3
  227. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  228. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -5
  229. package/template/.codex/skills/yss-ui/SKILL.md +7 -1
  230. package/template/.codex/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  231. package/template/.codex/skills/yss-ui/references/checklist.md +38 -96
  232. package/template/.codex/skills/yss-ui/references/component-routing.md +3 -1
  233. package/template/.codex/skills/yss-ui/references/quick-recipes.md +17 -272
  234. package/template/.codex/skills/yss-ui/references/specialized-components.md +3 -3
  235. package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  236. package/template/.codex/skills/yss-up-springboot3/SKILL.md +19 -21
  237. package/template/.codex/skills/yss-userinfo/SKILL.md +27 -33
  238. package/template/.codex/skills/yss-validation/SKILL.md +26 -32
  239. package/template/.codex/skills/yss-web-controller/SKILL.md +11 -44
  240. package/template/.codex/skills/yss-web-controller/references/crud-generation.md +38 -0
  241. package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
  242. package/template/.codex/skills/ytree-usage/SKILL.md +2 -80
  243. package/template/.codex/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  244. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +30 -36
  245. package/template/.cursor/skills/archify/SKILL.md +2 -2
  246. package/template/.cursor/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  247. package/template/.cursor/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  248. package/template/.cursor/skills/code-review/SKILL.md +19 -11
  249. package/template/.cursor/skills/code-review/references/candidate-capture.md +1 -1
  250. package/template/.cursor/skills/code-review/references/legacy-convergence.md +3 -1
  251. package/template/.cursor/skills/code-review/references/review-axis-checklists.md +2 -0
  252. package/template/.cursor/skills/code-review/references/yss-review-standards.md +4 -2
  253. package/template/.cursor/skills/competitive-intelligence/SKILL.md +32 -74
  254. package/template/.cursor/skills/file-export-download/SKILL.md +4 -73
  255. package/template/.cursor/skills/file-export-download/references/binary-contract-example.md +26 -0
  256. package/template/.cursor/skills/file-export-download/references/download-call-example.md +45 -0
  257. package/template/.cursor/skills/formily-foundation/SKILL.md +6 -105
  258. package/template/.cursor/skills/formily-foundation/references/async-save-example.md +57 -0
  259. package/template/.cursor/skills/formily-foundation/references/query-layout.md +50 -0
  260. package/template/.cursor/skills/formily-linkage-effects/SKILL.md +3 -116
  261. package/template/.cursor/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  262. package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +3 -81
  263. package/template/.cursor/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  264. package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -143
  265. package/template/.cursor/skills/formily-step-flow/references/step-flow-example.md +143 -0
  266. package/template/.cursor/skills/handoff/SKILL.md +3 -1
  267. package/template/.cursor/skills/i-have-adhd/SKILL.md +2 -2
  268. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  269. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  270. package/template/.cursor/skills/implement/SKILL.md +2 -2
  271. package/template/.cursor/skills/llm-wiki/references/transactions.md +2 -2
  272. package/template/.cursor/skills/llm-wiki/scripts/core.mjs +40 -2
  273. package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +30 -27
  274. package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  275. package/template/.cursor/skills/lombok/SKILL.md +2 -0
  276. package/template/.cursor/skills/mapstruct/SKILL.md +2 -0
  277. package/template/.cursor/skills/tdd/SKILL.md +2 -2
  278. package/template/.cursor/skills/theme-token-usage/SKILL.md +6 -5
  279. package/template/.cursor/skills/wayfinder/references/chart-map.md +2 -2
  280. package/template/.cursor/skills/wayfinder/references/ticket-types.md +1 -1
  281. package/template/.cursor/skills/yss-api-integration/SKILL.md +13 -50
  282. package/template/.cursor/skills/yss-api-integration/references/orval-list-example.md +38 -0
  283. package/template/.cursor/skills/yss-application/SKILL.md +11 -5
  284. package/template/.cursor/skills/yss-audit-log/SKILL.md +8 -6
  285. package/template/.cursor/skills/yss-audit-log/references/README.md +5 -5
  286. package/template/.cursor/skills/yss-cache/SKILL.md +4 -4
  287. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  288. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  289. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  290. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  291. package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
  292. package/template/.cursor/skills/yss-distributed-id/SKILL.md +4 -4
  293. package/template/.cursor/skills/yss-dto/SKILL.md +9 -9
  294. package/template/.cursor/skills/yss-dto/references/README.md +4 -4
  295. package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  296. package/template/.cursor/skills/yss-excel-mvc/SKILL.md +4 -4
  297. package/template/.cursor/skills/yss-exception/SKILL.md +42 -48
  298. package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +26 -170
  299. package/template/.cursor/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  300. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  301. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  302. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  303. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  304. package/template/.cursor/skills/yss-mybatis/SKILL.md +4 -4
  305. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +6 -4
  306. package/template/.cursor/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  307. package/template/.cursor/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  308. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +5 -7
  309. package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +2 -0
  310. package/template/.cursor/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  311. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +23 -21
  312. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  313. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  314. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  315. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  316. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -1
  317. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  318. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
  319. package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
  320. package/template/.cursor/skills/yss-research/SKILL.md +39 -48
  321. package/template/.cursor/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  322. package/template/.cursor/skills/yss-research/references/competitive-analysis.md +76 -0
  323. package/template/.cursor/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  324. package/template/.cursor/skills/yss-research/references/evidence-contract.md +8 -0
  325. package/template/.cursor/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  326. package/template/.cursor/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  327. package/template/.cursor/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  328. package/template/.cursor/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  329. package/template/.cursor/skills/yss-resilience4j/SKILL.md +25 -31
  330. package/template/.cursor/skills/yss-security-algorithm/SKILL.md +37 -43
  331. package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  332. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  333. package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -5
  334. package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -1
  335. package/template/.cursor/skills/yss-tactical-design/references/output-template.md +3 -3
  336. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  337. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -5
  338. package/template/.cursor/skills/yss-ui/SKILL.md +7 -1
  339. package/template/.cursor/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  340. package/template/.cursor/skills/yss-ui/references/checklist.md +38 -96
  341. package/template/.cursor/skills/yss-ui/references/component-routing.md +3 -1
  342. package/template/.cursor/skills/yss-ui/references/quick-recipes.md +17 -272
  343. package/template/.cursor/skills/yss-ui/references/specialized-components.md +3 -3
  344. package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  345. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +19 -21
  346. package/template/.cursor/skills/yss-userinfo/SKILL.md +27 -33
  347. package/template/.cursor/skills/yss-validation/SKILL.md +26 -32
  348. package/template/.cursor/skills/yss-web-controller/SKILL.md +11 -44
  349. package/template/.cursor/skills/yss-web-controller/references/crud-generation.md +38 -0
  350. package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
  351. package/template/.cursor/skills/ytree-usage/SKILL.md +2 -80
  352. package/template/.cursor/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  353. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +30 -36
  354. package/template/.pi/skills/archify/SKILL.md +2 -2
  355. package/template/.pi/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  356. package/template/.pi/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  357. package/template/.pi/skills/code-review/SKILL.md +19 -11
  358. package/template/.pi/skills/code-review/references/candidate-capture.md +1 -1
  359. package/template/.pi/skills/code-review/references/legacy-convergence.md +3 -1
  360. package/template/.pi/skills/code-review/references/review-axis-checklists.md +2 -0
  361. package/template/.pi/skills/code-review/references/yss-review-standards.md +4 -2
  362. package/template/.pi/skills/competitive-intelligence/SKILL.md +32 -74
  363. package/template/.pi/skills/file-export-download/SKILL.md +4 -73
  364. package/template/.pi/skills/file-export-download/references/binary-contract-example.md +26 -0
  365. package/template/.pi/skills/file-export-download/references/download-call-example.md +45 -0
  366. package/template/.pi/skills/formily-foundation/SKILL.md +6 -105
  367. package/template/.pi/skills/formily-foundation/references/async-save-example.md +57 -0
  368. package/template/.pi/skills/formily-foundation/references/query-layout.md +50 -0
  369. package/template/.pi/skills/formily-linkage-effects/SKILL.md +3 -116
  370. package/template/.pi/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  371. package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +3 -81
  372. package/template/.pi/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  373. package/template/.pi/skills/formily-step-flow/SKILL.md +3 -143
  374. package/template/.pi/skills/formily-step-flow/references/step-flow-example.md +143 -0
  375. package/template/.pi/skills/handoff/SKILL.md +3 -1
  376. package/template/.pi/skills/i-have-adhd/SKILL.md +2 -2
  377. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  378. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  379. package/template/.pi/skills/implement/SKILL.md +2 -2
  380. package/template/.pi/skills/llm-wiki/references/transactions.md +2 -2
  381. package/template/.pi/skills/llm-wiki/scripts/core.mjs +40 -2
  382. package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +30 -27
  383. package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  384. package/template/.pi/skills/lombok/SKILL.md +2 -0
  385. package/template/.pi/skills/mapstruct/SKILL.md +2 -0
  386. package/template/.pi/skills/tdd/SKILL.md +2 -2
  387. package/template/.pi/skills/theme-token-usage/SKILL.md +6 -5
  388. package/template/.pi/skills/wayfinder/references/chart-map.md +2 -2
  389. package/template/.pi/skills/wayfinder/references/ticket-types.md +1 -1
  390. package/template/.pi/skills/yss-api-integration/SKILL.md +13 -50
  391. package/template/.pi/skills/yss-api-integration/references/orval-list-example.md +38 -0
  392. package/template/.pi/skills/yss-application/SKILL.md +11 -5
  393. package/template/.pi/skills/yss-audit-log/SKILL.md +8 -6
  394. package/template/.pi/skills/yss-audit-log/references/README.md +5 -5
  395. package/template/.pi/skills/yss-cache/SKILL.md +4 -4
  396. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  397. package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  398. package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  399. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  400. package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
  401. package/template/.pi/skills/yss-distributed-id/SKILL.md +4 -4
  402. package/template/.pi/skills/yss-dto/SKILL.md +9 -9
  403. package/template/.pi/skills/yss-dto/references/README.md +4 -4
  404. package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  405. package/template/.pi/skills/yss-excel-mvc/SKILL.md +4 -4
  406. package/template/.pi/skills/yss-exception/SKILL.md +42 -48
  407. package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +26 -170
  408. package/template/.pi/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  409. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  410. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  411. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  412. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  413. package/template/.pi/skills/yss-mybatis/SKILL.md +4 -4
  414. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +6 -4
  415. package/template/.pi/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  416. package/template/.pi/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  417. package/template/.pi/skills/yss-openapi-governance/SKILL.md +5 -7
  418. package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +2 -0
  419. package/template/.pi/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  420. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +23 -21
  421. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  422. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  423. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  424. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  425. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -1
  426. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  427. package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
  428. package/template/.pi/skills/yss-repository/SKILL.md +2 -2
  429. package/template/.pi/skills/yss-research/SKILL.md +39 -48
  430. package/template/.pi/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  431. package/template/.pi/skills/yss-research/references/competitive-analysis.md +76 -0
  432. package/template/.pi/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  433. package/template/.pi/skills/yss-research/references/evidence-contract.md +8 -0
  434. package/template/.pi/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  435. package/template/.pi/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  436. package/template/.pi/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  437. package/template/.pi/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  438. package/template/.pi/skills/yss-resilience4j/SKILL.md +25 -31
  439. package/template/.pi/skills/yss-security-algorithm/SKILL.md +37 -43
  440. package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  441. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  442. package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -5
  443. package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -1
  444. package/template/.pi/skills/yss-tactical-design/references/output-template.md +3 -3
  445. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  446. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -5
  447. package/template/.pi/skills/yss-ui/SKILL.md +7 -1
  448. package/template/.pi/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  449. package/template/.pi/skills/yss-ui/references/checklist.md +38 -96
  450. package/template/.pi/skills/yss-ui/references/component-routing.md +3 -1
  451. package/template/.pi/skills/yss-ui/references/quick-recipes.md +17 -272
  452. package/template/.pi/skills/yss-ui/references/specialized-components.md +3 -3
  453. package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  454. package/template/.pi/skills/yss-up-springboot3/SKILL.md +19 -21
  455. package/template/.pi/skills/yss-userinfo/SKILL.md +27 -33
  456. package/template/.pi/skills/yss-validation/SKILL.md +26 -32
  457. package/template/.pi/skills/yss-web-controller/SKILL.md +11 -44
  458. package/template/.pi/skills/yss-web-controller/references/crud-generation.md +38 -0
  459. package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
  460. package/template/.pi/skills/ytree-usage/SKILL.md +2 -80
  461. package/template/.pi/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  462. package/template/.template-spec/agents/backend-architecture-profiles.md +1 -1
  463. package/template/.template-spec/agents/digital-human-roles.md +5 -1
  464. package/template/.template-spec/agents/digital-human-roles.yaml +49 -1
  465. package/template/.template-spec/engineering/backend-platforms.json +1 -1
  466. package/template/.template-spec/plan/templates/competitive-analysis-template.md +38 -36
  467. package/template/.template-spec/plan/templates/competitive-matrix-template.md +37 -17
  468. package/template/.template-spec/process/document-writing.md +22 -3
  469. package/template/.template-spec/process/harness-process-tailoring.md +5 -1
  470. package/template/.template-spec/process/implementation-repo-integration.md +26 -8
  471. package/template/.template-spec/process/research-completion.md +2 -0
  472. package/template/.template-spec/process/runtime-storage.md +78 -0
  473. package/template/.template-spec/process/schemas/approval-context.schema.json +67 -0
  474. package/template/.template-spec/process/schemas/approval-record.schema.json +179 -16
  475. package/template/.template-spec/process/schemas/backend-delivery.schema.json +16 -0
  476. package/template/.template-spec/process/schemas/delivery-preflight-input.schema.json +4 -0
  477. package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +236 -1
  478. package/template/.template-spec/process/schemas/implementation-repository-preparation-result.schema.json +335 -52
  479. package/template/.template-spec/process/schemas/lifecycle-checkpoint.schema.json +11 -0
  480. package/template/.template-spec/process/schemas/project-scaffold-contract.schema.json +3 -0
  481. package/template/.template-spec/process/schemas/review-bundle.schema.json +347 -35
  482. package/template/.template-spec/process/schemas/strategic-design-handoff-v3.schema.json +504 -0
  483. package/template/.template-spec/process/schemas/strategic-design-handoff-v4.schema.json +544 -8
  484. package/template/.template-spec/process/schemas/strategic-design-handoff-v5.schema.json +616 -0
  485. package/template/.template-spec/process/schemas/strategic-design-handoff.schema.json +616 -0
  486. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +712 -109
  487. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json +595 -90
  488. package/template/.template-spec/process/schemas/strategic-handoff-export-v2.schema.json +448 -0
  489. package/template/.template-spec/process/schemas/strategic-handoff-export.schema.json +392 -0
  490. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +556 -83
  491. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json +418 -57
  492. package/template/.template-spec/process/subagent-collaboration.md +7 -1
  493. package/template/.template-spec/templates/approval-record-template.json +7 -3
  494. package/template/.template-spec/templates/approval-record-template.yaml +8 -2
  495. package/template/.template-spec/templates/examples/lifecycle-writing-examples.md +92 -2
  496. package/template/.template-spec/templates/retro-report-template.md +10 -3
  497. package/template/.template-spec/templates/review-bundle-template.yaml +19 -10
  498. package/template/AGENTS.md +4 -3
  499. package/template/CONTEXT.md +2 -2
  500. package/template/README.md +2 -2
  501. package/template/scripts/advance-maintenance-iteration +51 -0
  502. package/template/scripts/lib/approval-checkpoint-discovery.mjs +26 -0
  503. package/template/scripts/lib/approval-consumption.mjs +35 -0
  504. package/template/scripts/lib/approval-current.mjs +111 -0
  505. package/template/scripts/lib/approval-record-io.mjs +56 -0
  506. package/template/scripts/lib/approval-record.mjs +79 -184
  507. package/template/scripts/lib/approved-execution-context.mjs +8 -6
  508. package/template/scripts/lib/asset-transactions.mjs +5 -1
  509. package/template/scripts/lib/backend-delivery.mjs +1 -1
  510. package/template/scripts/lib/backend-review.mjs +2 -1
  511. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +3 -2
  512. package/template/scripts/lib/business-ticket-lifecycle.mjs +2 -1
  513. package/template/scripts/lib/checkpoint-commit.mjs +50 -0
  514. package/template/scripts/lib/command-runner.mjs +44 -9
  515. package/template/scripts/lib/content-identity.mjs +273 -0
  516. package/template/scripts/lib/delivery-preflight.mjs +2 -1
  517. package/template/scripts/lib/digital-human-roles.mjs +12 -5
  518. package/template/scripts/lib/drift-report.mjs +110 -0
  519. package/template/scripts/lib/existing-backend-architecture.mjs +4 -1
  520. package/template/scripts/lib/lifecycle-context-query.mjs +172 -11
  521. package/template/scripts/lib/lifecycle-controls.mjs +9 -19
  522. package/template/scripts/lib/lifecycle-presentation.mjs +5 -0
  523. package/template/scripts/lib/lifecycle-status.mjs +63 -12
  524. package/template/scripts/lib/lifecycle-transition.mjs +2 -1
  525. package/template/scripts/lib/maintenance-candidate.mjs +24 -30
  526. package/template/scripts/lib/maintenance-research.mjs +52 -8
  527. package/template/scripts/lib/maintenance-storage.mjs +81 -0
  528. package/template/scripts/lib/plan-spec-entry.mjs +2 -1
  529. package/template/scripts/lib/project-governance.mjs +2 -1
  530. package/template/scripts/lib/read-only-intake.mjs +44 -9
  531. package/template/scripts/lib/review-capabilities.mjs +234 -0
  532. package/template/scripts/lib/review-package.mjs +100 -0
  533. package/template/scripts/lib/runtime-store.mjs +650 -0
  534. package/template/scripts/lib/skill-registry.mjs +4 -4
  535. package/template/scripts/lib/strategic-handoff.mjs +22 -9
  536. package/template/scripts/lib/task-package.mjs +47 -16
  537. package/template/scripts/lifecycle-status +26 -1
  538. package/template/scripts/maintenance-path +11 -0
  539. package/template/scripts/prepare-review-package +8 -0
  540. package/template/scripts/project-ci +13 -3
  541. package/template/scripts/query-lifecycle-context +8 -1
  542. package/template/scripts/run-read-only-intake +2 -2
  543. package/template/scripts/runtime-store +40 -0
  544. package/template/scripts/verify-approval-record +21 -13
  545. package/template/scripts/verify-lifecycle-checkpoint +7 -3
  546. package/template/scripts/verify-project-instance +21 -1
  547. package/template/skills-lock.json +62 -61
  548. package/template.snapshot.json +4 -4
  549. package/vendor/cli-core/cli.mjs +2 -0
  550. package/vendor/cli-core/command-runner.mjs +44 -9
  551. package/vendor/cli-core/package.json +1 -1
  552. package/vendor/cli-core/runtime-store.mjs +650 -0
  553. package/vendor/cli-core/scaffold.mjs +4 -2
  554. 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 \\\| &lt;tag&gt;<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
- Use this skill for YSS Resilience4j 组件. Keep implementation grounded in the local project and resolvable YSS backend component source.
8
+ 处理 YSS 网关断路器、fallback 响应和韧性配置;阈值、状态与恢复行为按服务 SLO 和当前 API 契约核验。
9
9
 
10
- 中文说明:本技能用于 YSS Resilience4j 组件。执行时优先读取源码索引,避免凭记忆猜类名、配置项或接入方式。
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
- 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.
12
+ 接入、修改、代码生成或提供精确类名/配置前,必须读取并执行 [共享平台与源码门禁](../yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md),以 `--skill yss-resilience4j` 校验批准的平台线及匹配源码根。缺失、错配或漂移返回 `blocked`;不跨代回退,不在业务实现中升级、降级或替换组件。只读分诊可继续,但须标注未完成源码核验,不能据此宣称跨 Boot/JDK 兼容。
19
13
 
20
- ## Workflow
14
+ ## 源码定位
21
15
 
22
- 1. Read `references/source-index.md`, then read component `readme.md`.
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
- ## Capability Split
18
+ ## 工作流
29
19
 
30
- - Gateway resilience wiring: `GatewayConfiguration`.
31
- - Circuit exception mapping: `GlobalCircuitExceptionAdvice`.
32
- - Operational guidance: README "轻量微服务断路器".
20
+ 1. 按平台索引定位当前组件源码与 `readme.md`。
21
+ 2. 区分网关断路器配置、fallback 响应、全局 circuit 异常映射与韧性排障。
22
+ 3. 装配问题核验 `GatewayConfiguration` 的 route/filter;异常响应核验 `GlobalCircuitExceptionAdvice`。
23
+ 4. 阈值和超时在配置中调整,不硬编码到业务 handler。
24
+ 5. fallback 状态和正文与网关/API 合同一致。
33
25
 
34
- ## Checklist
26
+ ## 能力边界
35
27
 
36
- - Required dependency or starter module is present.
37
- - Circuit breaker names and route IDs match gateway configuration.
38
- - Fallback status/body are acceptable for frontend/API consumers.
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
- ## Do Not
32
+ ## 验收
43
33
 
44
- - Do not invent class names or configuration keys without checking the source index.
45
- - Do not replace component extension points with business-local framework code.
46
- - Do not broaden the task into unrelated YSS components unless the user asks.
34
+ - 核验所需依赖或 starter 已进入实际工程。
35
+ - 断路器名称和 route ID 与网关配置一致。
36
+ - fallback 状态/正文符合前端与 API 消费方契约。
37
+ - 超时、慢调用与失败阈值符合服务 SLO。
38
+ - 日志/指标可诊断 open、half-open 和 recovered 状态。
47
39
 
48
- ## 平台与源码门禁
40
+ ## 修改边界
49
41
 
50
- 接入、修改、代码生成或给出精确类名/配置前,读取 [后端组件平台与源码门禁](../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-resilience4j --platform-line <line> --source-root <matching-root>` 运行统一 freshness 校验。平台线与源码根不匹配、组件 tree 不一致、组件子树 dirty、索引缺少平台信号,或 Manifest / 组件 GAV 缺少 verified 兼容证据时返回 `blocked`;不得回退另一代索引,也不在业务实现中升级、降级或替换 YSS 组件。既有工程只读分诊可继续,但不得据此宣称跨 Boot/JDK 兼容。
42
+ - 类名和配置 key 先核验当前索引与源码,不凭记忆补造。
43
+ - 使用组件已有扩展 seam,不以业务本地框架代码替换。
44
+ - 保持当前组件任务范围;扩展到其他组件须有用户要求或重新路由依据。
@@ -5,17 +5,7 @@ description: "审查、迁移或排查既有 YSS 加解密、JWT/JWK、密码编
5
5
 
6
6
  # yss-security-algorithm
7
7
 
8
- Use this skill as the governance, migration, and troubleshooting entry for the existing YSS 安全算法组件. Keep conclusions grounded in the local project, the approved platform catalog, and resolvable component source.
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
- ## Workflow
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
- ## Security Notes
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
- - Verify whether callers need encryption for storage, transport, signing, or compatibility; choose algorithm and key lifecycle accordingly.
48
- - Prefer environment/config/secret-manager backed keys for deployable code.
49
- - Keep plaintext, ciphertext, encoding format, and key type explicit in API contracts.
50
-
51
- ## Checklist
52
-
53
- - Required dependency or starter module is present.
54
- - Algorithm choice is explicit and compatible with the caller.
55
- - Key source and rotation story are documented for production code.
56
- - JWT signatures are verified with issuer/audience/expiry policy; payload parsing alone is never authentication.
57
- - Encoding format is clear: Base64, hex, UTF-8 string, or raw bytes.
58
- - Decrypt path uses the matching algorithm/key type.
59
- - No passwords, private keys, or long-lived secrets are added to source files.
60
- - If external key storage, rotation/revocation, algorithm parameters, compatibility tests, or security-owner review is missing, return `blocked-for-production` instead of generating crypto code.
61
- - `Jwks` without a managed source and `SecurityCryptoUtil` without an approved `SecurityCryptoProvider` both fail closed.
62
- - Deprecated compatibility adapters delegate to the approved provider and preserve public signatures only; they do not make the component eligible for new adoption.
63
- - Existing ciphertext/JWT/password compatibility is demonstrated with representative fixtures before disabling an old key or encoder.
64
- - Logs and verification evidence contain only key references and redacted metadata, never plaintext, private keys, seeds, shared secrets, or complete tokens.
65
-
66
- ## Do Not
67
-
68
- - Do not invent class names or configuration keys without checking the source index.
69
- - Do not replace component extension points with business-local framework code.
70
- - Do not broaden the task into unrelated YSS components unless the user asks.
71
- - Do not approve a new integration because the component compiles, a source index is fresh, or an existing project already depends on it.
72
- - Do not copy, print, rotate in place, or reissue any key material through Agent output.
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: Use when YSS backend component source or frontend UI documentation changes and skill source indexes need refreshing.
3
+ description: 后端组件源码或前端 YSS UI 文档变化后,刷新技能来源索引并核验平台线、组件摘要与引用。
4
4
  ---
5
5
 
6
- # YSS Skill Source Index Refresh
6
+ # YSS 技能来源索引维护
7
7
 
8
- Use this maintenance skill to keep YSS skills grounded in current source and documentation.
8
+ 本 Skill 维护后端组件与前端文档的来源索引;索引用于定位和核验,不代替组件兼容认证。只读取或排障时使用现有索引及 freshness 门禁,不因每次调用自动刷新。
9
9
 
10
- 中文说明:这个技能用于维护 YSS skills 的“源码索引”。后端组件库或前端文档入口变化后,运行脚本刷新引用文件。
10
+ ## 来源定位
11
11
 
12
- ## Source Location Policy
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
- - Backend component source is generation-specific. Use `references/source-location.md` before trusting any generated path.
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
- ## Refresh Workflow
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
- Backend-only refreshes may set `YSS_REFRESH_FRONTEND=false` to avoid unrelated frontend timestamp churn.
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
- The script updates `references/source-index.md` for backend component skills and `references/frontend-docs.md` for frontend YSS UI skills. Read `references/source-map-config.md` for the full skill-to-source mapping.
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
- 中文说明:脚本不会复制大段源码;通用组件生成可追踪的入口索引,持久化组件额外生成公开 API、配置开关和能力边界矩阵,方便 Agent 按需读取真实源码。
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
- ## Output Contract
37
+ ## 输出合同
43
38
 
44
- Generated source indexes should contain:
39
+ 生成索引保留以下来源与定位信息:
45
40
 
46
- - explicit platform line, generated timestamp and trace-only source Git commit
47
- - component-relative tree hashes and component-scoped worktree state
48
- - component directories and documentation files
49
- - Maven modules
50
- - source file hashes and relocatable paths
51
- - for capability-sensitive components, concise public signatures, configuration keys/defaults, conditional activation and capability boundaries extracted from source
52
- - for other components, key Java classes matched by names such as annotations, auto configurations, properties, aspects, interceptors, handlers, repositories, DTOs, and result objects
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
- - recommended next reads for Agent when performing implementation or troubleshooting
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
- ## Freshness Gate
51
+ `SKILL.md` 保留任务入口,不粘贴完整组件源码;专项任务按需读取生成索引或对应资产。
59
52
 
60
- Before exact class/config/security guidance, choose the index track from the approved platform configuration, compare each indexed `Component tree` with `git -C "$MATCHING_SOURCE_ROOT" rev-parse HEAD:<component-path>` and check `git status --porcelain -- <component-path>`. A missing platform line, wrong-generation root, tree mismatch or component-local dirty state means `stale`: refresh the matching track or return `blocked`; do not fall back to the other generation. A repository commit difference alone is trace metadata and does not make the index stale when the component tree is unchanged. Historical path hints may still be used only to locate current source.
53
+ ## Freshness 门禁
61
54
 
62
- 中文说明:`SKILL.md` 保持短小,细节放到 `references/`,这是为了降低每次触发技能时的上下文成本。
55
+ 提供精确类名、配置或安全结论前,必须执行 [共享平台与源码门禁](references/backend-component-platform-compatibility.md),按批准平台选择索引与干净源码根。平台缺失或错配、组件 tree 漂移、子树 dirty 返回 `stale` / `blocked`,不回退另一代;历史路径提示只能定位。仅仓库 commit 不同但组件 tree 未变,不使索引过期。
63
56
 
64
- ## After Refresh
57
+ ## 刷新后验证
65
58
 
66
- Validate the migrated Node helper with:
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
- 撰写方案决策包和业务边界说明前,读取 `.template-spec/process/document-writing.md` 的共用写法及 Plan 指引;原业务规则、决定依据和未决项完整保留。
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
- 合同、Schema、校验规则和示例见 `references/`;使用 `scripts/validate-tactical-design.mjs` 做只读验证。该 skill 不生成 Java、Repository、Controller、DTO、OpenAPI Freeze、实现 Ticket 或生产代码。
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,不复制共同输入与审批状态。MVC 使用 `yss-technical-design` 的 `layered-mvc` 分支。
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 v3 | | | |
17
- | Visual Baseline Bundle v1 | | | |
16
+ | Strategic Design Handoff / 交付包(适用时) | | | |
17
+ | 原型或 existing UI baseline(按交接来源) | | | |
18
18
  | Strategic Context Import / Context Reconciliation | | | |
19
19
  | 状态矩阵 | | | |
20
20
  | OpenAPI / 无 API 影响记录 | | | |