create-yss-spec 3.5.6 → 3.5.9

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 (578) hide show
  1. package/bin/create-yss-spec.js +3 -1
  2. package/cli-core.lock.json +10 -6
  3. package/package.json +4 -1
  4. package/src/api/_sync-service.js +3 -1
  5. package/src/command-runner.mjs +44 -9
  6. package/src/commands/doctor.js +40 -0
  7. package/src/commands/skills.js +7 -2
  8. package/src/content-identity.js +111 -0
  9. package/src/runtime-store.mjs +650 -0
  10. package/src/template/asset-runtime.js +124 -22
  11. package/src/template/instance-runtime.js +23 -7
  12. package/src/validation/metadata.js +8 -0
  13. package/template/.agents/skills/.strategic-design-skills-manifest.json +3 -3
  14. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +30 -36
  15. package/template/.agents/skills/archify/SKILL.md +2 -2
  16. package/template/.agents/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  17. package/template/.agents/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  18. package/template/.agents/skills/code-review/SKILL.md +19 -11
  19. package/template/.agents/skills/code-review/references/candidate-capture.md +1 -1
  20. package/template/.agents/skills/code-review/references/legacy-convergence.md +3 -1
  21. package/template/.agents/skills/code-review/references/review-axis-checklists.md +2 -0
  22. package/template/.agents/skills/code-review/references/yss-review-standards.md +4 -2
  23. package/template/.agents/skills/competitive-intelligence/SKILL.md +32 -74
  24. package/template/.agents/skills/file-export-download/SKILL.md +4 -73
  25. package/template/.agents/skills/file-export-download/references/binary-contract-example.md +26 -0
  26. package/template/.agents/skills/file-export-download/references/download-call-example.md +45 -0
  27. package/template/.agents/skills/formily-foundation/SKILL.md +6 -105
  28. package/template/.agents/skills/formily-foundation/references/async-save-example.md +57 -0
  29. package/template/.agents/skills/formily-foundation/references/query-layout.md +50 -0
  30. package/template/.agents/skills/formily-linkage-effects/SKILL.md +3 -116
  31. package/template/.agents/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  32. package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +3 -81
  33. package/template/.agents/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  34. package/template/.agents/skills/formily-step-flow/SKILL.md +3 -143
  35. package/template/.agents/skills/formily-step-flow/references/step-flow-example.md +143 -0
  36. package/template/.agents/skills/handoff/SKILL.md +3 -1
  37. package/template/.agents/skills/i-have-adhd/SKILL.md +2 -2
  38. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  39. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  40. package/template/.agents/skills/implement/SKILL.md +2 -2
  41. package/template/.agents/skills/llm-wiki/references/transactions.md +2 -2
  42. package/template/.agents/skills/llm-wiki/scripts/core.mjs +40 -2
  43. package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +30 -27
  44. package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  45. package/template/.agents/skills/lombok/SKILL.md +2 -0
  46. package/template/.agents/skills/mapstruct/SKILL.md +2 -0
  47. package/template/.agents/skills/tdd/SKILL.md +2 -2
  48. package/template/.agents/skills/theme-token-usage/SKILL.md +6 -5
  49. package/template/.agents/skills/wayfinder/references/chart-map.md +2 -2
  50. package/template/.agents/skills/wayfinder/references/ticket-types.md +1 -1
  51. package/template/.agents/skills/yss-api-integration/SKILL.md +13 -50
  52. package/template/.agents/skills/yss-api-integration/references/orval-list-example.md +38 -0
  53. package/template/.agents/skills/yss-application/SKILL.md +11 -5
  54. package/template/.agents/skills/yss-audit-log/SKILL.md +8 -6
  55. package/template/.agents/skills/yss-audit-log/references/README.md +5 -5
  56. package/template/.agents/skills/yss-cache/SKILL.md +4 -4
  57. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  58. package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  59. package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  60. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  61. package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
  62. package/template/.agents/skills/yss-distributed-id/SKILL.md +4 -4
  63. package/template/.agents/skills/yss-dto/SKILL.md +9 -9
  64. package/template/.agents/skills/yss-dto/references/README.md +4 -4
  65. package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  66. package/template/.agents/skills/yss-excel-mvc/SKILL.md +4 -4
  67. package/template/.agents/skills/yss-exception/SKILL.md +42 -48
  68. package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +26 -170
  69. package/template/.agents/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  70. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  71. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  72. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  73. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  74. package/template/.agents/skills/yss-mybatis/SKILL.md +4 -4
  75. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +6 -4
  76. package/template/.agents/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  77. package/template/.agents/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  78. package/template/.agents/skills/yss-openapi-governance/SKILL.md +5 -7
  79. package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +2 -0
  80. package/template/.agents/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  81. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +32 -26
  82. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  83. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  84. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  85. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  86. package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  87. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -1
  88. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  89. package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
  90. package/template/.agents/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  91. package/template/.agents/skills/yss-repository/SKILL.md +2 -2
  92. package/template/.agents/skills/yss-research/SKILL.md +39 -48
  93. package/template/.agents/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  94. package/template/.agents/skills/yss-research/references/competitive-analysis.md +76 -0
  95. package/template/.agents/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  96. package/template/.agents/skills/yss-research/references/evidence-contract.md +8 -0
  97. package/template/.agents/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  98. package/template/.agents/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  99. package/template/.agents/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  100. package/template/.agents/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  101. package/template/.agents/skills/yss-resilience4j/SKILL.md +25 -31
  102. package/template/.agents/skills/yss-security-algorithm/SKILL.md +37 -43
  103. package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  104. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  105. package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -5
  106. package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  107. package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  108. package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  109. package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -1
  110. package/template/.agents/skills/yss-tactical-design/references/output-template.md +3 -3
  111. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  112. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -5
  113. package/template/.agents/skills/yss-ui/SKILL.md +7 -1
  114. package/template/.agents/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  115. package/template/.agents/skills/yss-ui/references/checklist.md +38 -96
  116. package/template/.agents/skills/yss-ui/references/component-routing.md +3 -1
  117. package/template/.agents/skills/yss-ui/references/quick-recipes.md +17 -272
  118. package/template/.agents/skills/yss-ui/references/specialized-components.md +3 -3
  119. package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  120. package/template/.agents/skills/yss-up-springboot3/SKILL.md +19 -21
  121. package/template/.agents/skills/yss-userinfo/SKILL.md +27 -33
  122. package/template/.agents/skills/yss-validation/SKILL.md +26 -32
  123. package/template/.agents/skills/yss-web-controller/SKILL.md +11 -44
  124. package/template/.agents/skills/yss-web-controller/references/crud-generation.md +38 -0
  125. package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
  126. package/template/.agents/skills/ytree-usage/SKILL.md +2 -80
  127. package/template/.agents/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  128. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +30 -36
  129. package/template/.codex/skills/archify/SKILL.md +2 -2
  130. package/template/.codex/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  131. package/template/.codex/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  132. package/template/.codex/skills/code-review/SKILL.md +19 -11
  133. package/template/.codex/skills/code-review/references/candidate-capture.md +1 -1
  134. package/template/.codex/skills/code-review/references/legacy-convergence.md +3 -1
  135. package/template/.codex/skills/code-review/references/review-axis-checklists.md +2 -0
  136. package/template/.codex/skills/code-review/references/yss-review-standards.md +4 -2
  137. package/template/.codex/skills/competitive-intelligence/SKILL.md +32 -74
  138. package/template/.codex/skills/file-export-download/SKILL.md +4 -73
  139. package/template/.codex/skills/file-export-download/references/binary-contract-example.md +26 -0
  140. package/template/.codex/skills/file-export-download/references/download-call-example.md +45 -0
  141. package/template/.codex/skills/formily-foundation/SKILL.md +6 -105
  142. package/template/.codex/skills/formily-foundation/references/async-save-example.md +57 -0
  143. package/template/.codex/skills/formily-foundation/references/query-layout.md +50 -0
  144. package/template/.codex/skills/formily-linkage-effects/SKILL.md +3 -116
  145. package/template/.codex/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  146. package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +3 -81
  147. package/template/.codex/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  148. package/template/.codex/skills/formily-step-flow/SKILL.md +3 -143
  149. package/template/.codex/skills/formily-step-flow/references/step-flow-example.md +143 -0
  150. package/template/.codex/skills/handoff/SKILL.md +3 -1
  151. package/template/.codex/skills/i-have-adhd/SKILL.md +2 -2
  152. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  153. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  154. package/template/.codex/skills/implement/SKILL.md +2 -2
  155. package/template/.codex/skills/llm-wiki/references/transactions.md +2 -2
  156. package/template/.codex/skills/llm-wiki/scripts/core.mjs +40 -2
  157. package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +30 -27
  158. package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  159. package/template/.codex/skills/lombok/SKILL.md +2 -0
  160. package/template/.codex/skills/mapstruct/SKILL.md +2 -0
  161. package/template/.codex/skills/product-design/references/communication-protocol.md +3 -3
  162. package/template/.codex/skills/product-design/references/critical-overrides.md +4 -5
  163. package/template/.codex/skills/product-design/skills/audit/SKILL.md +2 -4
  164. package/template/.codex/skills/product-design/skills/get-context/SKILL.md +6 -8
  165. package/template/.codex/skills/product-design/skills/ideate/SKILL.md +3 -3
  166. package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +3 -5
  167. package/template/.codex/skills/product-design/skills/index/SKILL.md +1 -1
  168. package/template/.codex/skills/product-design/skills/prototype/SKILL.md +2 -4
  169. package/template/.codex/skills/product-design/skills/research/SKILL.md +4 -6
  170. package/template/.codex/skills/product-design/skills/research/assets/research-brief-template.md +3 -3
  171. package/template/.codex/skills/product-design/skills/share/SKILL.md +2 -4
  172. package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +2 -4
  173. package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
  174. package/template/.codex/skills/tdd/SKILL.md +2 -2
  175. package/template/.codex/skills/theme-token-usage/SKILL.md +6 -5
  176. package/template/.codex/skills/wayfinder/references/chart-map.md +2 -2
  177. package/template/.codex/skills/wayfinder/references/ticket-types.md +1 -1
  178. package/template/.codex/skills/yss-api-integration/SKILL.md +13 -50
  179. package/template/.codex/skills/yss-api-integration/references/orval-list-example.md +38 -0
  180. package/template/.codex/skills/yss-application/SKILL.md +11 -5
  181. package/template/.codex/skills/yss-audit-log/SKILL.md +8 -6
  182. package/template/.codex/skills/yss-audit-log/references/README.md +5 -5
  183. package/template/.codex/skills/yss-cache/SKILL.md +4 -4
  184. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  185. package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  186. package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  187. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  188. package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
  189. package/template/.codex/skills/yss-distributed-id/SKILL.md +4 -4
  190. package/template/.codex/skills/yss-dto/SKILL.md +9 -9
  191. package/template/.codex/skills/yss-dto/references/README.md +4 -4
  192. package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  193. package/template/.codex/skills/yss-excel-mvc/SKILL.md +4 -4
  194. package/template/.codex/skills/yss-exception/SKILL.md +42 -48
  195. package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +26 -170
  196. package/template/.codex/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  197. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  198. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  199. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  200. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  201. package/template/.codex/skills/yss-mybatis/SKILL.md +4 -4
  202. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +6 -4
  203. package/template/.codex/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  204. package/template/.codex/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  205. package/template/.codex/skills/yss-openapi-governance/SKILL.md +5 -7
  206. package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +2 -0
  207. package/template/.codex/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  208. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +32 -26
  209. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  210. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  211. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  212. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  213. package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  214. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -1
  215. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  216. package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
  217. package/template/.codex/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  218. package/template/.codex/skills/yss-repository/SKILL.md +2 -2
  219. package/template/.codex/skills/yss-research/SKILL.md +39 -48
  220. package/template/.codex/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  221. package/template/.codex/skills/yss-research/references/competitive-analysis.md +76 -0
  222. package/template/.codex/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  223. package/template/.codex/skills/yss-research/references/evidence-contract.md +8 -0
  224. package/template/.codex/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  225. package/template/.codex/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  226. package/template/.codex/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  227. package/template/.codex/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  228. package/template/.codex/skills/yss-resilience4j/SKILL.md +25 -31
  229. package/template/.codex/skills/yss-security-algorithm/SKILL.md +37 -43
  230. package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  231. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  232. package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -5
  233. package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  234. package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  235. package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  236. package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -1
  237. package/template/.codex/skills/yss-tactical-design/references/output-template.md +3 -3
  238. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  239. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -5
  240. package/template/.codex/skills/yss-ui/SKILL.md +7 -1
  241. package/template/.codex/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  242. package/template/.codex/skills/yss-ui/references/checklist.md +38 -96
  243. package/template/.codex/skills/yss-ui/references/component-routing.md +3 -1
  244. package/template/.codex/skills/yss-ui/references/quick-recipes.md +17 -272
  245. package/template/.codex/skills/yss-ui/references/specialized-components.md +3 -3
  246. package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  247. package/template/.codex/skills/yss-up-springboot3/SKILL.md +19 -21
  248. package/template/.codex/skills/yss-userinfo/SKILL.md +27 -33
  249. package/template/.codex/skills/yss-validation/SKILL.md +26 -32
  250. package/template/.codex/skills/yss-web-controller/SKILL.md +11 -44
  251. package/template/.codex/skills/yss-web-controller/references/crud-generation.md +38 -0
  252. package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
  253. package/template/.codex/skills/ytree-usage/SKILL.md +2 -80
  254. package/template/.codex/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  255. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +30 -36
  256. package/template/.cursor/skills/archify/SKILL.md +2 -2
  257. package/template/.cursor/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  258. package/template/.cursor/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  259. package/template/.cursor/skills/code-review/SKILL.md +19 -11
  260. package/template/.cursor/skills/code-review/references/candidate-capture.md +1 -1
  261. package/template/.cursor/skills/code-review/references/legacy-convergence.md +3 -1
  262. package/template/.cursor/skills/code-review/references/review-axis-checklists.md +2 -0
  263. package/template/.cursor/skills/code-review/references/yss-review-standards.md +4 -2
  264. package/template/.cursor/skills/competitive-intelligence/SKILL.md +32 -74
  265. package/template/.cursor/skills/file-export-download/SKILL.md +4 -73
  266. package/template/.cursor/skills/file-export-download/references/binary-contract-example.md +26 -0
  267. package/template/.cursor/skills/file-export-download/references/download-call-example.md +45 -0
  268. package/template/.cursor/skills/formily-foundation/SKILL.md +6 -105
  269. package/template/.cursor/skills/formily-foundation/references/async-save-example.md +57 -0
  270. package/template/.cursor/skills/formily-foundation/references/query-layout.md +50 -0
  271. package/template/.cursor/skills/formily-linkage-effects/SKILL.md +3 -116
  272. package/template/.cursor/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  273. package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +3 -81
  274. package/template/.cursor/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  275. package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -143
  276. package/template/.cursor/skills/formily-step-flow/references/step-flow-example.md +143 -0
  277. package/template/.cursor/skills/handoff/SKILL.md +3 -1
  278. package/template/.cursor/skills/i-have-adhd/SKILL.md +2 -2
  279. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  280. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  281. package/template/.cursor/skills/implement/SKILL.md +2 -2
  282. package/template/.cursor/skills/llm-wiki/references/transactions.md +2 -2
  283. package/template/.cursor/skills/llm-wiki/scripts/core.mjs +40 -2
  284. package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +30 -27
  285. package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  286. package/template/.cursor/skills/lombok/SKILL.md +2 -0
  287. package/template/.cursor/skills/mapstruct/SKILL.md +2 -0
  288. package/template/.cursor/skills/tdd/SKILL.md +2 -2
  289. package/template/.cursor/skills/theme-token-usage/SKILL.md +6 -5
  290. package/template/.cursor/skills/wayfinder/references/chart-map.md +2 -2
  291. package/template/.cursor/skills/wayfinder/references/ticket-types.md +1 -1
  292. package/template/.cursor/skills/yss-api-integration/SKILL.md +13 -50
  293. package/template/.cursor/skills/yss-api-integration/references/orval-list-example.md +38 -0
  294. package/template/.cursor/skills/yss-application/SKILL.md +11 -5
  295. package/template/.cursor/skills/yss-audit-log/SKILL.md +8 -6
  296. package/template/.cursor/skills/yss-audit-log/references/README.md +5 -5
  297. package/template/.cursor/skills/yss-cache/SKILL.md +4 -4
  298. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  299. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  300. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  301. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  302. package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
  303. package/template/.cursor/skills/yss-distributed-id/SKILL.md +4 -4
  304. package/template/.cursor/skills/yss-dto/SKILL.md +9 -9
  305. package/template/.cursor/skills/yss-dto/references/README.md +4 -4
  306. package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  307. package/template/.cursor/skills/yss-excel-mvc/SKILL.md +4 -4
  308. package/template/.cursor/skills/yss-exception/SKILL.md +42 -48
  309. package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +26 -170
  310. package/template/.cursor/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  311. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  312. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  313. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  314. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  315. package/template/.cursor/skills/yss-mybatis/SKILL.md +4 -4
  316. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +6 -4
  317. package/template/.cursor/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  318. package/template/.cursor/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  319. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +5 -7
  320. package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +2 -0
  321. package/template/.cursor/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  322. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +32 -26
  323. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  324. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  325. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  326. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  327. package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  328. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -1
  329. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  330. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
  331. package/template/.cursor/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  332. package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
  333. package/template/.cursor/skills/yss-research/SKILL.md +39 -48
  334. package/template/.cursor/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  335. package/template/.cursor/skills/yss-research/references/competitive-analysis.md +76 -0
  336. package/template/.cursor/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  337. package/template/.cursor/skills/yss-research/references/evidence-contract.md +8 -0
  338. package/template/.cursor/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  339. package/template/.cursor/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  340. package/template/.cursor/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  341. package/template/.cursor/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  342. package/template/.cursor/skills/yss-resilience4j/SKILL.md +25 -31
  343. package/template/.cursor/skills/yss-security-algorithm/SKILL.md +37 -43
  344. package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  345. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  346. package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -5
  347. package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  348. package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  349. package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  350. package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -1
  351. package/template/.cursor/skills/yss-tactical-design/references/output-template.md +3 -3
  352. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  353. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -5
  354. package/template/.cursor/skills/yss-ui/SKILL.md +7 -1
  355. package/template/.cursor/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  356. package/template/.cursor/skills/yss-ui/references/checklist.md +38 -96
  357. package/template/.cursor/skills/yss-ui/references/component-routing.md +3 -1
  358. package/template/.cursor/skills/yss-ui/references/quick-recipes.md +17 -272
  359. package/template/.cursor/skills/yss-ui/references/specialized-components.md +3 -3
  360. package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  361. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +19 -21
  362. package/template/.cursor/skills/yss-userinfo/SKILL.md +27 -33
  363. package/template/.cursor/skills/yss-validation/SKILL.md +26 -32
  364. package/template/.cursor/skills/yss-web-controller/SKILL.md +11 -44
  365. package/template/.cursor/skills/yss-web-controller/references/crud-generation.md +38 -0
  366. package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
  367. package/template/.cursor/skills/ytree-usage/SKILL.md +2 -80
  368. package/template/.cursor/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  369. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +30 -36
  370. package/template/.pi/skills/archify/SKILL.md +2 -2
  371. package/template/.pi/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  372. package/template/.pi/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  373. package/template/.pi/skills/code-review/SKILL.md +19 -11
  374. package/template/.pi/skills/code-review/references/candidate-capture.md +1 -1
  375. package/template/.pi/skills/code-review/references/legacy-convergence.md +3 -1
  376. package/template/.pi/skills/code-review/references/review-axis-checklists.md +2 -0
  377. package/template/.pi/skills/code-review/references/yss-review-standards.md +4 -2
  378. package/template/.pi/skills/competitive-intelligence/SKILL.md +32 -74
  379. package/template/.pi/skills/file-export-download/SKILL.md +4 -73
  380. package/template/.pi/skills/file-export-download/references/binary-contract-example.md +26 -0
  381. package/template/.pi/skills/file-export-download/references/download-call-example.md +45 -0
  382. package/template/.pi/skills/formily-foundation/SKILL.md +6 -105
  383. package/template/.pi/skills/formily-foundation/references/async-save-example.md +57 -0
  384. package/template/.pi/skills/formily-foundation/references/query-layout.md +50 -0
  385. package/template/.pi/skills/formily-linkage-effects/SKILL.md +3 -116
  386. package/template/.pi/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  387. package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +3 -81
  388. package/template/.pi/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  389. package/template/.pi/skills/formily-step-flow/SKILL.md +3 -143
  390. package/template/.pi/skills/formily-step-flow/references/step-flow-example.md +143 -0
  391. package/template/.pi/skills/handoff/SKILL.md +3 -1
  392. package/template/.pi/skills/i-have-adhd/SKILL.md +2 -2
  393. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  394. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  395. package/template/.pi/skills/implement/SKILL.md +2 -2
  396. package/template/.pi/skills/llm-wiki/references/transactions.md +2 -2
  397. package/template/.pi/skills/llm-wiki/scripts/core.mjs +40 -2
  398. package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +30 -27
  399. package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  400. package/template/.pi/skills/lombok/SKILL.md +2 -0
  401. package/template/.pi/skills/mapstruct/SKILL.md +2 -0
  402. package/template/.pi/skills/tdd/SKILL.md +2 -2
  403. package/template/.pi/skills/theme-token-usage/SKILL.md +6 -5
  404. package/template/.pi/skills/wayfinder/references/chart-map.md +2 -2
  405. package/template/.pi/skills/wayfinder/references/ticket-types.md +1 -1
  406. package/template/.pi/skills/yss-api-integration/SKILL.md +13 -50
  407. package/template/.pi/skills/yss-api-integration/references/orval-list-example.md +38 -0
  408. package/template/.pi/skills/yss-application/SKILL.md +11 -5
  409. package/template/.pi/skills/yss-audit-log/SKILL.md +8 -6
  410. package/template/.pi/skills/yss-audit-log/references/README.md +5 -5
  411. package/template/.pi/skills/yss-cache/SKILL.md +4 -4
  412. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  413. package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  414. package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  415. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  416. package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
  417. package/template/.pi/skills/yss-distributed-id/SKILL.md +4 -4
  418. package/template/.pi/skills/yss-dto/SKILL.md +9 -9
  419. package/template/.pi/skills/yss-dto/references/README.md +4 -4
  420. package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  421. package/template/.pi/skills/yss-excel-mvc/SKILL.md +4 -4
  422. package/template/.pi/skills/yss-exception/SKILL.md +42 -48
  423. package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +26 -170
  424. package/template/.pi/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  425. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  426. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  427. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  428. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  429. package/template/.pi/skills/yss-mybatis/SKILL.md +4 -4
  430. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +6 -4
  431. package/template/.pi/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  432. package/template/.pi/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  433. package/template/.pi/skills/yss-openapi-governance/SKILL.md +5 -7
  434. package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +2 -0
  435. package/template/.pi/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  436. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +32 -26
  437. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  438. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  439. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  440. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  441. package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  442. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -1
  443. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  444. package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
  445. package/template/.pi/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  446. package/template/.pi/skills/yss-repository/SKILL.md +2 -2
  447. package/template/.pi/skills/yss-research/SKILL.md +39 -48
  448. package/template/.pi/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  449. package/template/.pi/skills/yss-research/references/competitive-analysis.md +76 -0
  450. package/template/.pi/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  451. package/template/.pi/skills/yss-research/references/evidence-contract.md +8 -0
  452. package/template/.pi/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  453. package/template/.pi/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  454. package/template/.pi/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  455. package/template/.pi/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  456. package/template/.pi/skills/yss-resilience4j/SKILL.md +25 -31
  457. package/template/.pi/skills/yss-security-algorithm/SKILL.md +37 -43
  458. package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  459. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  460. package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -5
  461. package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  462. package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  463. package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  464. package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -1
  465. package/template/.pi/skills/yss-tactical-design/references/output-template.md +3 -3
  466. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  467. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -5
  468. package/template/.pi/skills/yss-ui/SKILL.md +7 -1
  469. package/template/.pi/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  470. package/template/.pi/skills/yss-ui/references/checklist.md +38 -96
  471. package/template/.pi/skills/yss-ui/references/component-routing.md +3 -1
  472. package/template/.pi/skills/yss-ui/references/quick-recipes.md +17 -272
  473. package/template/.pi/skills/yss-ui/references/specialized-components.md +3 -3
  474. package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  475. package/template/.pi/skills/yss-up-springboot3/SKILL.md +19 -21
  476. package/template/.pi/skills/yss-userinfo/SKILL.md +27 -33
  477. package/template/.pi/skills/yss-validation/SKILL.md +26 -32
  478. package/template/.pi/skills/yss-web-controller/SKILL.md +11 -44
  479. package/template/.pi/skills/yss-web-controller/references/crud-generation.md +38 -0
  480. package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
  481. package/template/.pi/skills/ytree-usage/SKILL.md +2 -80
  482. package/template/.pi/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  483. package/template/.template-spec/agents/backend-architecture-profiles.md +1 -1
  484. package/template/.template-spec/agents/digital-human-roles.md +5 -1
  485. package/template/.template-spec/agents/digital-human-roles.yaml +49 -1
  486. package/template/.template-spec/engineering/backend-platforms.json +1 -1
  487. package/template/.template-spec/plan/entry-review.md +2 -1
  488. package/template/.template-spec/plan/templates/competitive-analysis-template.md +38 -36
  489. package/template/.template-spec/plan/templates/competitive-matrix-template.md +37 -17
  490. package/template/.template-spec/plan/templates/plan-template.md +11 -5
  491. package/template/.template-spec/process/document-writing.md +22 -3
  492. package/template/.template-spec/process/harness-process-tailoring.md +5 -1
  493. package/template/.template-spec/process/implementation-repo-integration.md +26 -8
  494. package/template/.template-spec/process/research-completion.md +2 -0
  495. package/template/.template-spec/process/runtime-storage.md +78 -0
  496. package/template/.template-spec/process/schemas/approval-context.schema.json +67 -0
  497. package/template/.template-spec/process/schemas/approval-record.schema.json +179 -16
  498. package/template/.template-spec/process/schemas/backend-delivery.schema.json +16 -0
  499. package/template/.template-spec/process/schemas/delivery-preflight-input.schema.json +4 -0
  500. package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +236 -1
  501. package/template/.template-spec/process/schemas/implementation-repository-preparation-result.schema.json +335 -52
  502. package/template/.template-spec/process/schemas/lifecycle-checkpoint.schema.json +11 -0
  503. package/template/.template-spec/process/schemas/project-scaffold-contract.schema.json +3 -0
  504. package/template/.template-spec/process/schemas/review-bundle.schema.json +347 -35
  505. package/template/.template-spec/process/schemas/strategic-design-handoff-v3.schema.json +504 -0
  506. package/template/.template-spec/process/schemas/strategic-design-handoff-v4.schema.json +544 -8
  507. package/template/.template-spec/process/schemas/strategic-design-handoff-v5.schema.json +616 -0
  508. package/template/.template-spec/process/schemas/strategic-design-handoff.schema.json +616 -0
  509. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +712 -109
  510. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json +595 -90
  511. package/template/.template-spec/process/schemas/strategic-handoff-export-v2.schema.json +448 -0
  512. package/template/.template-spec/process/schemas/strategic-handoff-export.schema.json +392 -0
  513. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +556 -83
  514. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json +418 -57
  515. package/template/.template-spec/process/script-execution.md +37 -0
  516. package/template/.template-spec/process/subagent-collaboration.md +7 -1
  517. package/template/.template-spec/templates/approval-record-template.json +7 -3
  518. package/template/.template-spec/templates/approval-record-template.yaml +8 -2
  519. package/template/.template-spec/templates/examples/lifecycle-writing-examples.md +92 -2
  520. package/template/.template-spec/templates/retro-report-template.md +10 -3
  521. package/template/.template-spec/templates/review-bundle-template.yaml +19 -10
  522. package/template/.template-spec/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +2 -0
  523. package/template/AGENTS.md +4 -3
  524. package/template/CONTEXT.md +2 -2
  525. package/template/README.md +2 -2
  526. package/template/scripts/advance-maintenance-iteration +51 -0
  527. package/template/scripts/lib/approval-checkpoint-discovery.mjs +26 -0
  528. package/template/scripts/lib/approval-consumption.mjs +35 -0
  529. package/template/scripts/lib/approval-current.mjs +111 -0
  530. package/template/scripts/lib/approval-record-io.mjs +56 -0
  531. package/template/scripts/lib/approval-record.mjs +79 -184
  532. package/template/scripts/lib/approved-execution-context.mjs +8 -6
  533. package/template/scripts/lib/asset-transactions.mjs +5 -1
  534. package/template/scripts/lib/backend-delivery.mjs +1 -1
  535. package/template/scripts/lib/backend-review.mjs +2 -1
  536. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +3 -2
  537. package/template/scripts/lib/business-ticket-lifecycle.mjs +2 -1
  538. package/template/scripts/lib/checkpoint-commit.mjs +50 -0
  539. package/template/scripts/lib/command-runner.mjs +44 -9
  540. package/template/scripts/lib/content-identity.mjs +273 -0
  541. package/template/scripts/lib/delivery-preflight.mjs +2 -1
  542. package/template/scripts/lib/digital-human-roles.mjs +12 -5
  543. package/template/scripts/lib/drift-report.mjs +110 -0
  544. package/template/scripts/lib/existing-backend-architecture.mjs +4 -1
  545. package/template/scripts/lib/lifecycle-context-query.mjs +172 -11
  546. package/template/scripts/lib/lifecycle-controls.mjs +9 -19
  547. package/template/scripts/lib/lifecycle-presentation.mjs +5 -0
  548. package/template/scripts/lib/lifecycle-status.mjs +63 -12
  549. package/template/scripts/lib/lifecycle-transition.mjs +2 -1
  550. package/template/scripts/lib/maintenance-candidate.mjs +24 -30
  551. package/template/scripts/lib/maintenance-research.mjs +52 -8
  552. package/template/scripts/lib/maintenance-storage.mjs +81 -0
  553. package/template/scripts/lib/plan-spec-entry.mjs +2 -1
  554. package/template/scripts/lib/project-governance.mjs +2 -1
  555. package/template/scripts/lib/read-only-intake.mjs +44 -9
  556. package/template/scripts/lib/review-capabilities.mjs +234 -0
  557. package/template/scripts/lib/review-package.mjs +100 -0
  558. package/template/scripts/lib/runtime-store.mjs +650 -0
  559. package/template/scripts/lib/skill-registry.mjs +4 -4
  560. package/template/scripts/lib/strategic-handoff.mjs +22 -9
  561. package/template/scripts/lib/task-package.mjs +47 -16
  562. package/template/scripts/lifecycle-status +26 -1
  563. package/template/scripts/maintenance-path +11 -0
  564. package/template/scripts/prepare-review-package +8 -0
  565. package/template/scripts/project-ci +13 -3
  566. package/template/scripts/query-lifecycle-context +8 -1
  567. package/template/scripts/run-read-only-intake +2 -2
  568. package/template/scripts/runtime-store +40 -0
  569. package/template/scripts/verify-approval-record +21 -13
  570. package/template/scripts/verify-lifecycle-checkpoint +7 -3
  571. package/template/scripts/verify-project-instance +21 -1
  572. package/template/skills-lock.json +64 -63
  573. package/template.snapshot.json +4 -4
  574. package/vendor/cli-core/cli.mjs +2 -0
  575. package/vendor/cli-core/command-runner.mjs +44 -9
  576. package/vendor/cli-core/package.json +1 -1
  577. package/vendor/cli-core/runtime-store.mjs +650 -0
  578. package/vendor/cli-core/scaffold.mjs +4 -2
@@ -2,6 +2,7 @@
2
2
 
3
3
  const fs = require("node:fs");
4
4
  const path = require("node:path");
5
+ const { pathToFileURL } = require("node:url");
5
6
 
6
7
  const ASSET_PROFILE = "stage-selective";
7
8
  const INITIAL_STAGES = ["stage.entry-triage", "stage.plan"];
@@ -24,9 +25,11 @@ const COMMON = {
24
25
  ".template-spec/process/lifecycle-registry-baseline-v1.json",
25
26
  ".template-spec/process/lifecycle-artifact-map.md",
26
27
  ".template-spec/process/harness-process-tailoring.md",
28
+ ".template-spec/process/script-execution.md",
27
29
  ".template-spec/process/document-writing.md",
28
30
  ".template-spec/process/contract-reading.md",
29
31
  ".template-spec/process/structured-assets.md",
32
+ ".template-spec/process/runtime-storage.md",
30
33
  ".template-spec/process/schemas/approval-record.schema.json",
31
34
  ".template-spec/process/schemas/review-bundle.schema.json",
32
35
  ".template-spec/process/templates/lifecycle-checkpoint-template.json",
@@ -53,6 +56,7 @@ const COMMON = {
53
56
  ".template-spec/process/templates/user-decision-template.yaml",
54
57
  ".template-spec/templates/local-parent-ticket-template.md",
55
58
  ".template-spec/templates/approval-record-template.yaml",
59
+ ".template-spec/templates/review-bundle-template.yaml",
56
60
  ".template-spec/templates/review-report-template.md",
57
61
  ".template-spec/user-guide/用户手册.md",
58
62
  ],
@@ -69,7 +73,9 @@ const COMMON = {
69
73
  "scripts/verify-approval-record",
70
74
  "scripts/query-lifecycle-context",
71
75
  "scripts/prepare-read-only-intake",
76
+ "scripts/prepare-review-package",
72
77
  "scripts/run-read-only-intake",
78
+ "scripts/runtime-store",
73
79
  "scripts/contract",
74
80
  "scripts/check-plan-stage-coverage",
75
81
  "scripts/stage-tracking",
@@ -139,38 +145,100 @@ const STAGES = Object.freeze({
139
145
  ".template-spec/process/delivery-preflight.md",
140
146
  ".template-spec/templates/release-note-template.md",
141
147
  ".template-spec/templates/retro-report-template.md",
142
- ".template-spec/templates/review-bundle-template.yaml",
143
148
  ],
144
149
  scripts: ["scripts/preflight-delivery"],
145
150
  skills: [],
146
151
  },
147
152
  });
148
153
 
154
+ function assertContained(root, ref) {
155
+ if (path.posix.isAbsolute(ref) || ref.includes("\\") || ref.split("/").includes("..")) throw new Error(`阶段资产路径越界:${ref}`);
156
+ const file = path.join(root, ref);
157
+ const relative = path.relative(fs.realpathSync(root), fs.realpathSync(file));
158
+ if (relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error(`阶段资产路径越界:${ref}`);
159
+ return file;
160
+ }
161
+
149
162
  function sourceFile(root, ref) {
150
163
  const file = path.join(root, ref);
151
164
  if (!fs.existsSync(file) || !fs.statSync(file).isFile()) throw new Error(`CLI 快照缺少阶段资产:${ref}`);
152
- return file;
165
+ return assertContained(root, ref);
153
166
  }
154
167
 
155
- function addFile(root, result, ref) {
156
- sourceFile(root, ref);
157
- result.add(ref);
168
+ function recordReason(result, ref, reason) {
169
+ const reasons = result.inclusionReasons.get(ref) || [];
170
+ if (!reasons.some(item => JSON.stringify(item) === JSON.stringify(reason))) reasons.push(reason);
171
+ result.inclusionReasons.set(ref, reasons);
158
172
  }
159
173
 
160
- function addPrefix(root, result, prefix) {
174
+ function addFile(root, result, ref, reason, uri) {
175
+ recordReason(result, ref, reason);
176
+ if (!result.has(ref)) {
177
+ sourceFile(root, ref);
178
+ result.add(ref);
179
+ } else if (!ref.endsWith(".schema.json")) return;
180
+ if (ref.endsWith(".schema.json")) {
181
+ const visited = result.schemaFiles.has(ref);
182
+ const text = result.schemaFiles.get(ref) || fs.readFileSync(path.join(root, ref), "utf8"), schema = JSON.parse(text);
183
+ const fileURI = pathToFileURL(path.join(root, ref)).href;
184
+ for (const id of [uri, fileURI, schema.$id].filter(Boolean)) {
185
+ if (result.schemaResources.has(id) && result.schemaResources.get(id) !== text) throw new Error(`阶段 Schema ID 冲突:${id}`);
186
+ result.schemaResources.set(id, text);
187
+ }
188
+ if (visited) return;
189
+ result.schemaFiles.set(ref, text);
190
+ const base = schema.$id || uri || fileURI;
191
+ function visit(value) {
192
+ if (!value || typeof value !== "object") return;
193
+ for (const [key, dependency] of Object.entries(value)) {
194
+ if (["$ref", "$dynamicRef"].includes(key) && typeof dependency === "string" && !dependency.startsWith("#")) {
195
+ const file = dependency.split("#")[0];
196
+ const resolvedURI = new URL(file, base).href;
197
+ if (result.schemaResources.has(resolvedURI)) continue;
198
+ if (/^[a-z][a-z0-9+.-]*:/i.test(file) || path.posix.isAbsolute(file) || file.includes("\\")) throw new Error(`阶段 Schema 依赖必须为本地相对路径:${ref} -> ${dependency}`);
199
+ const resolved = path.posix.normalize(path.posix.join(path.posix.dirname(ref), file));
200
+ if (!resolved.startsWith(".template-spec/") && !resolved.startsWith("scripts/")) throw new Error(`阶段 Schema 依赖路径越界:${ref} -> ${dependency}`);
201
+ addFile(root, result, resolved, { kind: "schema-ref", from: ref, reference: dependency }, resolvedURI);
202
+ } else visit(dependency);
203
+ }
204
+ }
205
+ visit(schema);
206
+ }
207
+ }
208
+
209
+ function addPrefix(root, result, prefix, reason, ancestors = []) {
161
210
  const directory = path.join(root, prefix);
162
211
  if (!fs.existsSync(directory) || !fs.statSync(directory).isDirectory()) throw new Error(`CLI 快照缺少阶段目录:${prefix}`);
212
+ assertContained(root, prefix);
213
+ const physical = fs.realpathSync(directory);
214
+ if (ancestors.includes(physical)) throw new Error(`阶段资产目录链接循环:${prefix}`);
215
+ const nextAncestors = [...ancestors, physical];
163
216
  for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
164
217
  const ref = `${prefix}${entry.name}`;
165
- if (entry.isDirectory()) addPrefix(root, result, `${ref}/`);
166
- else if (entry.isFile()) result.add(ref);
218
+ const stat = entry.isSymbolicLink() ? fs.statSync(path.join(root, ref)) : entry;
219
+ if (stat.isDirectory()) addPrefix(root, result, `${ref}/`, reason, nextAncestors);
220
+ else if (stat.isFile()) addFile(root, result, ref, reason);
167
221
  }
168
222
  }
169
223
 
170
- function moduleClosure(root, result, ref, selectedSkills) {
171
- if (result.has(ref)) return;
224
+ function moduleClosure(root, result, ref, selectedSkills, reason) {
225
+ addFile(root, result, ref, reason);
226
+ if (result.modules.has(ref)) return;
227
+ result.modules.add(ref);
172
228
  const source = fs.readFileSync(sourceFile(root, ref), "utf8");
173
- result.add(ref);
229
+ for (const match of source.matchAll(/\b(?:spawnSync|spawn|execFileSync|execFile)\(\s*['"](python3|node)['"]\s*,/g)) {
230
+ const dependency = result.runtimeDependencies.get(match[1]) || { executable: match[1], requiredBy: new Set(), packages: new Set() };
231
+ dependency.requiredBy.add(ref);
232
+ if (match[1] === "python3") {
233
+ for (const pkg of ["jsonschema", "referencing"]) if (new RegExp(`^from ${pkg}(?:\\.|\\s)`, "m").test(source)) dependency.packages.add(pkg);
234
+ }
235
+ result.runtimeDependencies.set(match[1], dependency);
236
+ }
237
+ if (/\b(?:spawnSync|spawn|execFileSync|execFile)\(\s*process\.execPath\s*,/.test(source)) {
238
+ const dependency = result.runtimeDependencies.get("node") || { executable: "node", requiredBy: new Set(), packages: new Set() };
239
+ dependency.requiredBy.add(ref);
240
+ result.runtimeDependencies.set("node", dependency);
241
+ }
174
242
  const expressions = [
175
243
  /\b(?:import|export)\s+(?:[^'"\n]*?\s+from\s*)?['"]([^'"]+)['"]/g,
176
244
  /\b(?:require|import)\s*\(\s*['"]([^'"]+)['"]\s*\)/g,
@@ -191,9 +259,27 @@ function moduleClosure(root, result, ref, selectedSkills) {
191
259
  continue;
192
260
  }
193
261
  if (!candidate || !candidate.startsWith("scripts/")) throw new Error(`阶段脚本依赖未分发:${ref} -> ${match[1]}`);
194
- moduleClosure(root, result, candidate, selectedSkills);
262
+ moduleClosure(root, result, candidate, selectedSkills, { kind: "module-import", from: ref, reference: match[1] });
195
263
  }
196
264
  }
265
+ // File names passed to a subprocess or Schema loader are runtime resources,
266
+ // not JavaScript imports. Include only complete, fixed local file references.
267
+ for (const match of source.matchAll(/['"]((?:scripts\/[\p{L}\p{N}_.\/-]+\.py|\.template-spec\/[\p{L}\p{N}_.\/-]+\.(?:json|yaml)))['"]/gu)) {
268
+ if (!fs.existsSync(path.join(root, match[1])) && !/\.(?:py|schema\.json)$/.test(match[1])) continue;
269
+ addFile(root, result, match[1], { kind: "runtime-resource", from: ref });
270
+ }
271
+ for (const match of source.matchAll(/\bnew\s+URL\(\s*['"](\.[^'"]+\.(?:json|yaml|py))['"]\s*,\s*import\.meta\.url\s*\)/g)) {
272
+ const resolved = path.posix.normalize(path.posix.join(path.posix.dirname(ref), match[1]));
273
+ if (!resolved.startsWith("scripts/") && !resolved.startsWith(".template-spec/")) throw new Error(`阶段资源依赖路径越界:${ref} -> ${match[1]}`);
274
+ addFile(root, result, resolved, { kind: "runtime-resource", from: ref, reference: match[1] });
275
+ }
276
+ // Caller-supplied roots can address another registered project. Only the
277
+ // module's fixed template root proves a dependency in this distribution.
278
+ for (const match of source.matchAll(/\b(?:spawnSync|spawn|execFileSync|execFile)\(\s*(?:(?:process\.execPath|['"](?:node|python3)['"])\s*,\s*\[\s*)?(?:path\.)?(?:join|resolve)\(\s*(?:ROOT|TEMPLATE_ROOT)\s*,\s*['"](scripts\/[\p{L}\p{N}_.\/-]+)['"]\s*\)/gu)) {
279
+ const reason = { kind: "subprocess-entry", from: ref };
280
+ if (/\.(?:py|json|yaml)$/.test(match[1])) addFile(root, result, match[1], reason);
281
+ else moduleClosure(root, result, match[1], selectedSkills, reason);
282
+ }
197
283
  }
198
284
 
199
285
  function skillReferences(root, result, skillId, selectedSkills) {
@@ -208,15 +294,16 @@ function skillReferences(root, result, skillId, selectedSkills) {
208
294
  for (const match of source.matchAll(/(?:\.template-spec|scripts)\/[\p{L}\p{N}_.\/-]+/gu)) {
209
295
  const ref = match[0].replace(/[.,;]+$/, "");
210
296
  if (!fs.existsSync(path.join(root, ref)) || !fs.statSync(path.join(root, ref)).isFile()) continue;
211
- if (ref.startsWith("scripts/")) moduleClosure(root, result, ref, selectedSkills);
212
- else addFile(root, result, ref);
297
+ const reason = { kind: "skill-reference", skill: skillId, from: path.relative(root, file).split(path.sep).join("/") };
298
+ if (ref.startsWith("scripts/")) moduleClosure(root, result, ref, selectedSkills, reason);
299
+ else addFile(root, result, ref, reason);
213
300
  }
214
301
  }
215
302
  }
216
303
  }
217
304
  visit(skillRoot);
218
- for (const prefix of SKILL_ASSET_PREFIXES[skillId] || []) addPrefix(root, result, prefix);
219
- for (const ref of RENDERED_SKILL_SCRIPTS[skillId] || []) moduleClosure(root, result, ref, selectedSkills);
305
+ for (const prefix of SKILL_ASSET_PREFIXES[skillId] || []) addPrefix(root, result, prefix, { kind: "skill-resource", skill: skillId, prefix });
306
+ for (const ref of RENDERED_SKILL_SCRIPTS[skillId] || []) moduleClosure(root, result, ref, selectedSkills, { kind: "skill-resource", skill: skillId });
220
307
  }
221
308
 
222
309
  function assetPaths(root, distribution) {
@@ -227,6 +314,11 @@ function assetPaths(root, distribution) {
227
314
  throw new Error("CLI 阶段资产映射与生命周期注册表阶段 ID 不一致");
228
315
  }
229
316
  const result = new Set();
317
+ result.inclusionReasons = new Map();
318
+ result.runtimeDependencies = new Map();
319
+ result.modules = new Set();
320
+ result.schemaFiles = new Map();
321
+ result.schemaResources = new Map();
230
322
  const selectedSkills = new Set(distribution.installedSkills);
231
323
  for (const ref of COMMON.files) {
232
324
  if (ref === ".template-spec/process/lifecycle-registry-baseline-v1.json" &&
@@ -234,15 +326,15 @@ function assetPaths(root, distribution) {
234
326
  const baseline = JSON.parse(fs.readFileSync(sourceFile(root, ".template-spec/process/lifecycle-registry-baseline.json"), "utf8"));
235
327
  if (baseline.schema_version === 1) continue;
236
328
  }
237
- addFile(root, result, ref);
329
+ addFile(root, result, ref, { kind: "common-asset" });
238
330
  }
239
- for (const ref of COMMON.scripts) moduleClosure(root, result, ref, selectedSkills);
331
+ for (const ref of COMMON.scripts) moduleClosure(root, result, ref, selectedSkills, { kind: "common-entry" });
240
332
  for (const stage of distribution.installedStages) {
241
333
  const bundle = STAGES[stage];
242
334
  if (!bundle) throw new Error(`未知生命周期阶段:${stage}`);
243
- for (const prefix of bundle.prefixes || []) addPrefix(root, result, prefix);
244
- for (const ref of bundle.files || []) addFile(root, result, ref);
245
- for (const ref of bundle.scripts || []) moduleClosure(root, result, ref, selectedSkills);
335
+ for (const prefix of bundle.prefixes || []) addPrefix(root, result, prefix, { kind: "stage-asset", stage, prefix });
336
+ for (const ref of bundle.files || []) addFile(root, result, ref, { kind: "stage-asset", stage });
337
+ for (const ref of bundle.scripts || []) moduleClosure(root, result, ref, selectedSkills, { kind: "stage-entry", stage });
246
338
  }
247
339
  const resourceSkills = new Set(distribution.resourceSkills || []);
248
340
  if (selectedSkills.has("yss-harness-upgrade")) resourceSkills.add("yss-harness-upgrade");
@@ -250,4 +342,14 @@ function assetPaths(root, distribution) {
250
342
  return result;
251
343
  }
252
344
 
253
- module.exports = { ASSET_PROFILE, INITIAL_STAGES, STAGES, assetPaths };
345
+ function assetRequirements(root, distribution) {
346
+ const files = assetPaths(root, distribution);
347
+ if (!files) return { selective: false, inclusionReasons: {}, runtimeDependencies: [] };
348
+ return {
349
+ selective: true,
350
+ inclusionReasons: Object.fromEntries([...files.inclusionReasons].sort(([a], [b]) => a.localeCompare(b)).map(([ref, reasons]) => [ref, reasons.sort((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b)))])),
351
+ runtimeDependencies: [...files.runtimeDependencies.values()].sort((a, b) => a.executable.localeCompare(b.executable)).map(item => ({ executable: item.executable, requiredBy: [...item.requiredBy].sort(), packages: [...item.packages].sort() })),
352
+ };
353
+ }
354
+
355
+ module.exports = { ASSET_PROFILE, INITIAL_STAGES, STAGES, assetPaths, assetRequirements };
@@ -8,6 +8,7 @@ const { treeHash } = require("../template-hash");
8
8
  const { targetPath, pathKind, normalizeRelativePath } = require("../filesystem/path-utils");
9
9
  const { validateTemplateSnapshot } = require("../validation/snapshot");
10
10
  const { validateTemplateMetadata } = require("../validation/metadata");
11
+ const { identityForPaths } = require("../content-identity");
11
12
  const { distributionForVariables, isIncludedInstancePath, selectedSkillLock, renderInstanceSkillSupplyChain, renderInstanceDesignSkillFile } = require("./distribution-runtime");
12
13
  const { ASSET_PROFILE, assetPaths } = require("./asset-runtime");
13
14
  const {
@@ -143,6 +144,7 @@ function readTargetIdentity(targetDir) {
143
144
  }
144
145
 
145
146
  function renderTemplateFile(relativePath, content, variables) {
147
+ const skillPreflight = "\n\n专项技能调用前,运行 `scripts/query-lifecycle-context --work-unit <当前工作单元> --check-skills`;多运行时用 `--agent-runtime`,已确认条件用 `--when`。未安装技能先核对结果中的补装计划,在既有任务授权内应用后重验;漂移、冲突和版本不匹配暂停当前调用,不自动覆盖或迁移。\n";
146
148
  const distribution = variables.distribution || distributionForVariables(variables, BUNDLED_TEMPLATE_ROOT);
147
149
  if (relativePath === "skills-lock.json") return selectedSkillLock(content, distribution);
148
150
  if (relativePath === "scripts/lib/skill-supply-chain.mjs" && distribution.mode === "selected") return renderInstanceSkillSupplyChain(content);
@@ -155,9 +157,9 @@ function renderTemplateFile(relativePath, content, variables) {
155
157
  }
156
158
  if (relativePath === ".template-spec/user-guide/用户手册.md" && distribution.mode === "selected") {
157
159
  if (distribution.assetProfile !== ASSET_PROFILE) {
158
- return `# ${variables.projectName} 用户手册\n\n本仓是 \`project-instance\`,用于 ${variables.businessDomain} 的研发资产。先阅读根 [AGENTS.md](../../AGENTS.md)、[CONTEXT.md](../../CONTEXT.md) 与 [生命周期资产索引](../process/lifecycle-artifact-map.md)。\n\n阶段派发前,由 Agent 运行 \`create-yss-spec skills ensure <skill-id...> --plan\` 核对依赖,再运行 \`--apply\` 安装。旧实例继续沿用既有文件分发范围;增加平台使用 \`create-yss-spec skills runtime add <codex|cursor|pi> --plan/--apply\`。CLI 快照必须与实例记录的模板提交一致;升级 CLI 后先运行 \`create-yss-spec sync\`。\n\n项目校验运行 \`scripts/verify-project-instance\`。\n`;
160
+ return `# ${variables.projectName} 用户手册\n\n本仓是 \`project-instance\`,用于 ${variables.businessDomain} 的研发资产。先阅读根 [AGENTS.md](../../AGENTS.md)、[CONTEXT.md](../../CONTEXT.md) 与 [生命周期资产索引](../process/lifecycle-artifact-map.md)。\n\n阶段派发前,由 Agent 运行 \`create-yss-spec skills ensure <skill-id...> --plan\` 核对依赖,再运行 \`--apply\` 安装。旧实例继续沿用既有文件分发范围;增加平台使用 \`create-yss-spec skills runtime add <codex|cursor|pi> --plan/--apply\`。CLI 快照必须与实例记录的模板提交一致;版本不匹配时先核对匹配的 CLI 或 \`create-yss-spec sync --plan\`,不自动扩展同步范围。\n\n项目校验运行 \`scripts/verify-project-instance\`。\n` + skillPreflight;
159
161
  }
160
- return `# ${variables.projectName} 用户手册\n\n本仓是 \`project-instance\`,用于 ${variables.businessDomain} 的研发资产。先阅读根 [AGENTS.md](../../AGENTS.md)、[CONTEXT.md](../../CONTEXT.md) 与 [生命周期资产索引](../process/lifecycle-artifact-map.md)。\n\n初始化安装分诊与 Plan 入口资产、三项入口 Skill 与所选 Agent 平台。进入后续阶段前,运行 \`create-yss-spec assets ensure <stage-id> --plan\` 核对文件,再运行 \`--apply\` 原子安装;专项 Skill 使用 \`create-yss-spec skills ensure <skill-id...> --plan/--apply\`,会补齐该 Skill 引用的实例文件。增加平台使用 \`create-yss-spec skills runtime add <codex|cursor|pi> --plan/--apply\`。CLI 快照必须与实例记录的模板提交一致;升级 CLI 后先运行 \`create-yss-spec sync\`。\n\n项目校验运行 \`scripts/verify-project-instance\`;实例 CI 应执行该命令和项目实际的构建、测试。\n`;
162
+ return `# ${variables.projectName} 用户手册\n\n本仓是 \`project-instance\`,用于 ${variables.businessDomain} 的研发资产。先阅读根 [AGENTS.md](../../AGENTS.md)、[CONTEXT.md](../../CONTEXT.md) 与 [生命周期资产索引](../process/lifecycle-artifact-map.md)。\n\n初始化安装分诊与 Plan 入口资产、入口 Skill 与所选 Agent 平台。进入后续阶段前,运行 \`create-yss-spec assets ensure <stage-id> --plan\` 核对文件,再运行 \`--apply\` 原子安装;专项 Skill 使用 \`create-yss-spec skills ensure <skill-id...> --plan/--apply\`,会补齐该 Skill 引用的实例文件。增加平台使用 \`create-yss-spec skills runtime add <codex|cursor|pi> --plan/--apply\`。CLI 快照必须与实例记录的模板提交一致;版本不匹配时先核对匹配的 CLI 或 \`create-yss-spec sync --plan\`,不自动扩展同步范围。\n\n项目校验运行 \`scripts/verify-project-instance\`;实例 CI 应执行该命令和项目实际的构建、测试。\n` + skillPreflight;
161
163
  }
162
164
  if (distribution.mode === "selected" && relativePath === ".template-spec/design/README.md") {
163
165
  return content.replace(/^.*design-system-sync\.yaml.*\n/m, "");
@@ -188,9 +190,9 @@ function renderTemplateFile(relativePath, content, variables) {
188
190
  const base = rendered.replace(/## 4\. \`template-source\` 模板维护路由[\s\S]*?(?=## 5\.)/, "")
189
191
  .replace(/\| 影响面、\`not-applicable\`、模板维护强度 \|[^\n]*\n/, "| 影响面与 `not-applicable` | `.template-spec/process/harness-process-tailoring.md` |\n");
190
192
  const guidance = distribution.assetProfile === ASSET_PROFILE
191
- ? "## 按需阶段资产与 Skill\n\n进入后续生命周期阶段前,运行 `create-yss-spec assets ensure <stage-id> --plan` 查看完整依赖,核对后运行 `--apply`。专项任务根据 .template-spec/agents/yss-skill-registry.yaml 选定 Skill,运行 `create-yss-spec skills ensure <skill-id...> --plan`,核对后运行 `--apply`。缺少阶段资产时先补装,不以缺文件推定门禁不适用。若 CLI 快照与实例模板提交不一致,先运行 `create-yss-spec sync`。\n"
192
- : "## 按需 Skill\n\n此实例继续沿用原文件分发范围。阶段派发或专项任务开始前,根据 .template-spec/agents/yss-skill-registry.yaml 选定 Skill,运行 `create-yss-spec skills ensure <skill-id...> --plan`,核对后运行 `--apply`。若 CLI 快照与实例模板提交不一致,先运行 `create-yss-spec sync`。\n";
193
- return `${base}\n${guidance}`;
193
+ ? "## 按需阶段资产与 Skill\n\n进入后续生命周期阶段前,运行 `create-yss-spec assets ensure <stage-id> --plan` 查看完整依赖,核对后运行 `--apply`。专项任务根据 .template-spec/agents/yss-skill-registry.yaml 选定 Skill,运行 `create-yss-spec skills ensure <skill-id...> --plan`,核对后运行 `--apply`。缺少阶段资产时先补装,不以缺文件推定门禁不适用。若 CLI 快照与实例模板提交不一致,先核对匹配的 CLI 或 `create-yss-spec sync --plan`;不自动扩展同步范围。\n"
194
+ : "## 按需 Skill\n\n此实例继续沿用原文件分发范围。阶段派发或专项任务开始前,根据 .template-spec/agents/yss-skill-registry.yaml 选定 Skill,运行 `create-yss-spec skills ensure <skill-id...> --plan`,核对后运行 `--apply`。若 CLI 快照与实例模板提交不一致,先核对匹配的 CLI 或 `create-yss-spec sync --plan`;不自动扩展同步范围。\n";
195
+ return `${base}\n${guidance}${skillPreflight}`;
194
196
  }
195
197
 
196
198
  if (relativePath === "README.md") {
@@ -428,11 +430,16 @@ function loadTemplateMetadata(targetDir) {
428
430
 
429
431
  function collectManagedFiles(desiredOperations) {
430
432
  const managedFiles = {};
431
- for (const operation of desiredOperations) {
432
- if (operation.relativePath === "README.md" || pathKind(operation.targetPath) !== "file") continue;
433
+ const files = desiredOperations.filter((operation) => operation.relativePath !== "README.md" && pathKind(operation.targetPath) === "file");
434
+ // One batched Git identity per repository, recorded alongside the legacy
435
+ // sha256 contentHash so older CLIs keep reading the same metadata.
436
+ const identities = identityForPaths(files.map((operation) => operation.targetPath));
437
+ for (const operation of files) {
438
+ const identity = identities.get(operation.targetPath);
433
439
  managedFiles[operation.relativePath] = {
434
440
  type: operation.type,
435
441
  contentHash: fileHash(operation.targetPath),
442
+ ...(identity ? { identity } : {}),
436
443
  };
437
444
  }
438
445
  return managedFiles;
@@ -483,13 +490,22 @@ function buildNextSyncMetadata(metadata, syncPlan, {
483
490
  delete nextManagedFiles["README.md"];
484
491
  for (const relativePath of syncPlan.alreadyMissing || []) delete nextManagedFiles[relativePath];
485
492
  for (const relativePath of syncPlan.pruned || []) delete nextManagedFiles[relativePath];
493
+ const desiredFiles = syncPlan.desiredOperations.filter((operation) => pathKind(operation.targetPath) === "file");
494
+ const identities = identityForPaths(desiredFiles.map((operation) => operation.targetPath));
486
495
  for (const operation of syncPlan.desiredOperations) {
487
496
  if (pathKind(operation.targetPath) !== "file") continue;
488
497
  const currentHash = currentHashes?.[operation.relativePath] ?? fileHash(operation.targetPath);
489
498
  if (currentHash === operation.desiredHash || operation.relativePath === "skills-lock.json") {
499
+ // Keep the recorded identity while the content hash is unchanged so a sync
500
+ // with nothing to do stays byte-identical (no churn, no needless backup).
501
+ const previousRecord = metadata.managedFiles?.[operation.relativePath];
502
+ const identity = previousRecord?.contentHash === currentHash && previousRecord.identity
503
+ ? previousRecord.identity
504
+ : identities.get(operation.targetPath);
490
505
  nextManagedFiles[operation.relativePath] = {
491
506
  type: operation.type,
492
507
  contentHash: currentHash,
508
+ ...(identity ? { identity } : {}),
493
509
  };
494
510
  }
495
511
  }
@@ -100,6 +100,14 @@ function validateTemplateMetadata(metadata, {
100
100
  `模板元数据 managedFiles.${relativePath}.generatorVersion 必须是正整数`,
101
101
  );
102
102
  }
103
+ if (
104
+ record.identity !== undefined &&
105
+ !/^(git-sha1:[0-9a-f]{40}|git-sha256:[0-9a-f]{64}|sha256:[0-9a-f]{64})$/.test(record.identity)
106
+ ) {
107
+ throw new Error(
108
+ `模板元数据 managedFiles.${relativePath}.identity 非法`,
109
+ );
110
+ }
103
111
  }
104
112
 
105
113
  if (metadata.metadataSchemaVersion === currentSchemaVersion) {
@@ -3,7 +3,7 @@
3
3
  "source": "iloveZzz/yss-harness-design-agent",
4
4
  "source_type": "git-submodule",
5
5
  "source_root": ".agents/skills",
6
- "source_revision": "fbe4084276a8fe9a8f59e58481f2913133346eaf",
6
+ "source_revision": "8948ada59432ce2c4e1ef34999eaed45939bdf5e",
7
7
  "adaptation_ref": ".template-source/agents/strategic-design-skills-integration.md",
8
8
  "skills": [
9
9
  {
@@ -14,7 +14,7 @@
14
14
  {
15
15
  "upstream": "yss-prototype-stage",
16
16
  "canonical": "yss-prototype-stage",
17
- "upstream_hash": "0e82e8c0f6b5446dbe48aec8df092574ab895be303efe33d8fc8457bce98d02e"
17
+ "upstream_hash": "9d1177a3f7f4737e08f084049ca3c0a6e8da0c5327da8370a87262a1b5db3b8e"
18
18
  },
19
19
  {
20
20
  "upstream": "yss-design-system",
@@ -24,7 +24,7 @@
24
24
  {
25
25
  "upstream": "yss-stage-decision",
26
26
  "canonical": "yss-stage-decision",
27
- "upstream_hash": "77fa3075f90966821881998ff5fa9d674672bd2568e70b8d877402efeb360453"
27
+ "upstream_hash": "5a55a18e996920c5e5ec683b6dfa89d714bb0a3299632ecc75e0d4865b71d108"
28
28
  }
29
29
  ],
30
30
  "source_state": "committed"
@@ -3,50 +3,44 @@ name: alibaba-java-code-style
3
3
  description: 应用阿里巴巴 Java 手册审查或实现 Java 代码;按当前项目框架与数据库基线选择适用规范。
4
4
  ---
5
5
 
6
- # Alibaba Java Code Style
6
+ # 阿里巴巴 Java 规范
7
7
 
8
- This skill distills the provided `阿里巴巴 Java 开发手册` 1.4.0 PDF into execution rules for Codex. Treat rules marked mandatory as review blockers unless the repository's own `AGENTS.md`, security constraints, or existing framework conventions explicitly require a different pattern.
8
+ 本 Skill 从用户提供的《阿里巴巴 Java 开发手册》1.4.0 提炼适用规范。`mandatory` 违规阻断审查,除非仓库 `AGENTS.md`、安全约束或现有框架约定明确要求不同模式;例外须有依据。`recommended` / `reference` 保留建议等级,不因进入下文检查提要变为强制规则。
9
9
 
10
- ## Workflow
10
+ ## 工作流
11
11
 
12
- 1. Identify the touched surface:
13
- - Java source, naming, constants, OOP, collections, concurrency, control flow, comments: read `references/java-programming.md`.
14
- - Exceptions, logging, unit tests, or security: read `references/reliability-test-security.md`.
15
- - MySQL, ORM/MyBatis, Maven dependencies, layering, server/JVM settings, or design artifacts: read `references/database-engineering-design.md`.
16
- 2. Apply mandatory rules first, then use recommended rules to improve maintainability, performance, and readability.
17
- 3. When reviewing, report mandatory violations as findings. Mention recommended violations when they create real risk or are already in the changed area.
18
- 4. When implementing, prefer the repository's existing framework helpers and code generation skills over inventing new local infrastructure.
19
- 5. For auth, payment, encryption, SQL, migrations or public-library changes, check the current contract and actual authorization. Continue an already authorized repair with its required verification; produce a draft or `TODO-HUMAN-REVIEW` only for a real missing decision or approval, and identify that gap.
12
+ 1. 按影响面读取对应规范:Java 命名、常量、OOP、集合、并发、控制流和注释读 [Java 编程](references/java-programming.md);异常、日志、测试或安全读 [可靠性与安全](references/reliability-test-security.md);MySQL、ORM/MyBatis、Maven、分层、服务器/JVM 或设计资产读 [工程与数据库](references/database-engineering-design.md)。
13
+ 2. 先执行适用 mandatory,再按实际风险采用 recommended;审查报告保留规则等级。建议仅在产生真实风险或处于本次范围时报告。
14
+ 3. 实现优先复用工程框架与已有生成能力,不新增重复基础设施。
15
+ 4. 认证、付款、加密、SQL、迁移或公共库变更先核验当前合同及实际授权。已授权修复继续完成适用验证;仅真实缺决定或批准时形成草案 / `TODO-HUMAN-REVIEW`,并说明缺口。
20
16
 
21
- ## Core Priorities
17
+ ## 适用原则
22
18
 
23
19
  - 先消费 architecture_identity 与工程 Java/数据库基线。MVC 分层按 `.template-spec/agents/backend-architecture-profiles.md`;MySQL 专属方言规则仅对批准的 MySQL 存储生效,不能要求 H2 骨架引入 MySQL 驱动。YSS 包装、命名及处理器差异逐项记录基线例外,安全、权限、敏感信息与 SQL 参数绑定不得豁免。
24
- - Keep names readable, English, and consistent with Java layer conventions.
25
- - Avoid null, equality, wrapper comparison, collection, and concurrency traps that compile cleanly but fail at runtime.
26
- - Make logs useful without wasting CPU, disk, or alert budget.
27
- - Keep unit tests automatic, independent, repeatable, and close to public behavior.
28
- - Bind SQL parameters, define explicit ORM mappings, and never rely on string-concatenated SQL.
29
- - Preserve layering: web/controller code validates and adapts; service/manager code owns business orchestration; DAO/repository code owns persistence.
30
-
31
- ## Review Checklist
32
-
33
- - Naming and formatting are consistent: camel case, constants, package names, braces, spacing, line length, UTF-8/Unix line endings.
34
- - POJO, DTO, DO, VO, Query, enum, interface, implementation, and test names follow the expected suffixes and boolean naming rules.
35
- - `equals`, `hashCode`, wrapper comparisons, `toString`, `serialVersionUID`, constructors, access modifiers, and getters/setters avoid known pitfalls.
36
- - Collection code avoids unsafe `subList`, `Arrays.asList`, raw `toArray`, foreach removal, null-unsafe maps, and invalid comparators.
37
- - Thread code uses named thread pools, avoids `Executors` factories in production code, and handles locking order, date formatting, and scheduled tasks safely.
38
- - Exceptions are handled at the right layer, logged once with context and stack, and never swallowed or used for normal control flow.
39
- - Tests use assertions, avoid external dependence, live under `src/test/java`, and cover boundaries, correct cases, design cases, and error cases.
40
- - Security-sensitive inputs are validated, authorized, escaped, CSRF-protected, rate-limited, and never concatenated into SQL.
41
- - MySQL DDL/SQL/ORM code uses explicit fields, mappings, indexes, timestamps, `#{}`
42
- parameter binding, and avoids dangerous cascades, stored procedures, `select *`, and uncontrolled pagination.
43
-
44
- ## Source
45
-
46
- Based on the user-provided PDF: `阿里巴巴 Java 开发手册` version 1.4.0, Alibaba Group technical team, update date 2018-05-20.
20
+ - 名称使用清晰英文标识并遵循当前 Java 分层约定。
21
+ - 核验 null、相等、包装类型比较、集合和并发的运行时边界,不能以编译通过代替行为正确。
22
+ - 日志有诊断用途,并控制 CPU、磁盘和告警成本。
23
+ - 单元测试自动、独立、可重复,围绕公开行为验证。
24
+ - SQL 使用参数绑定与显式 ORM 映射,不依赖字符串拼接。
25
+ - 按已登记架构保持职责:Web/controller 校验和适配,service/manager 编排业务,DAO/repository 持有持久化。
26
+
27
+ ## 检查提要
28
+
29
+ - 命名与格式:camel case、常量、包名、括号、间距、行长、UTF-8/Unix 换行;类型后缀和 boolean 命名符合适用规范。
30
+ - 对象语义:`equals/hashCode`、包装类型比较、`toString`、`serialVersionUID`、构造器、可见性和访问器。
31
+ - 集合:`subList`、`Arrays.asList`、`toArray`、foreach 删除、null map 和 comparator 的边界。
32
+ - 并发:命名线程池、生产 `Executors` 工厂限制、锁顺序、日期格式和定时任务。
33
+ - 异常:正确分层、上下文与堆栈、避免重复日志、不吞异常、不用于普通控制流。
34
+ - 测试:断言、外部依赖隔离、`src/test/java` 与边界/正确/设计/错误场景。
35
+ - 安全:按真实输入与认证方式核验校验、授权、转义、CSRF、限流和 SQL 参数绑定,不能泛用某项检查豁免其他风险。
36
+ - MySQL:仅适用存储核验显式字段、映射、索引、时间戳与 `#{}` 绑定,以及危险级联、存储过程、`select *` 和分页边界。
37
+
38
+ ## 来源
39
+
40
+ 用户提供的《阿里巴巴 Java 开发手册》1.4.0,阿里巴巴集团技术团队,更新于 2018-05-20;具体条款等级保留在对应 references 中。
47
41
 
48
42
  ## 阶段 7 执行结果
49
43
 
50
44
  - 消费当前合同版本、changed files 和 verification results,只审查合同允许范围。
51
- - 必须把 mandatory violation 返回为 `violation`,并提供文件/位置/规则证据;高风险项保留 `TODO-HUMAN-REVIEW`。
45
+ - 适用 mandatory violation 返回 `violation`,附文件/位置/规则证据;高风险项仅在当前合同确有未满足人工决定或批准要求时保留 `TODO-HUMAN-REVIEW`。
52
46
  - 按统一 `YSS Skill Execution Result` 返回审查证据、偏离和新增安全/SQL/公共 API 影响,不得仅输出“符合规范”。
@@ -25,10 +25,10 @@ When the current repository contains `yss-project.yaml`, these rules override th
25
25
  node .agents/skills/archify/scripts/yss-safe-deliver.mjs <type> docs/architecture/diagrams/<diagram-id>/<diagram-id>.archify.json docs/architecture/diagrams/<diagram-id>/<diagram-id>.html --quality showcase
26
26
 
27
27
  # template-source
28
- node .agents/skills/archify/scripts/yss-safe-deliver.mjs <type> .template-source/evidence/maintenance/diagrams/<diagram-id>/<diagram-id>.archify.json .template-source/evidence/maintenance/diagrams/<diagram-id>/<diagram-id>.html --quality showcase
28
+ node .agents/skills/archify/scripts/yss-safe-deliver.mjs <type> "$(scripts/maintenance-path diagrams/<diagram-id>/<diagram-id>.archify.json)" "$(scripts/maintenance-path diagrams/<diagram-id>/<diagram-id>.html)" --quality showcase
29
29
  ```
30
30
 
31
- - For a `project-instance`, stable source and output must be the matching pair `docs/architecture/diagrams/<diagram-id>/<diagram-id>.archify.json` and `<diagram-id>.html`. For a `template-source`, use `.template-source/evidence/maintenance/diagrams/<diagram-id>/`. The wrapper writes `<diagram-id>.receipt.json` only after successful delivery. Temporary exploration may target the operating-system temporary directory.
31
+ - For a `project-instance`, stable source and output must be the matching pair `docs/architecture/diagrams/<diagram-id>/<diagram-id>.archify.json` and `<diagram-id>.html`. For a `template-source`, use the current workspace's external `maintenance:diagrams/<diagram-id>/` (resolve with `scripts/maintenance-path`). The wrapper writes `<diagram-id>.receipt.json` only after successful delivery. Temporary exploration may target the operating-system temporary directory.
32
32
  - The safe wrapper rejects `--open`, non-HTML targets, symlink escapes, unrelated existing files, and stable source/output pairs outside those roots. Do not bypass it with the raw `deliver` or `preview` commands in a YSS repository.
33
33
 
34
34
  ## Fast authoring path
@@ -4,7 +4,7 @@ import { spawnSync } from 'node:child_process';
4
4
  import fs from 'node:fs';
5
5
  import os from 'node:os';
6
6
  import path from 'node:path';
7
- import { fileURLToPath } from 'node:url';
7
+ import { fileURLToPath, pathToFileURL } from 'node:url';
8
8
 
9
9
  const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
10
10
  const skillRoot = path.resolve(scriptDirectory, '..');
@@ -93,11 +93,12 @@ function assertReplaceableReceipt(receipt) {
93
93
  if (parsed?.yssArchifyReceipt !== true) fail(`拒绝覆盖非 YSS Archify receipt: ${receipt}`);
94
94
  }
95
95
 
96
- function stableContract(projectRoot, mode, input, output) {
96
+ async function stableContract(projectRoot, mode, input, output) {
97
97
  const relativeBase = mode === 'project-instance'
98
98
  ? 'docs/architecture/diagrams'
99
- : '.template-source/evidence/maintenance/diagrams';
100
- const base = path.join(projectRoot, relativeBase);
99
+ : 'maintenance:diagrams';
100
+ const base = mode === 'project-instance' ? path.join(projectRoot, relativeBase)
101
+ : (await import(pathToFileURL(path.join(projectRoot, 'scripts/lib/maintenance-storage.mjs')).href)).resolveMaintenanceOutput(relativeBase, { root: projectRoot });
101
102
  const relativeOutput = path.relative(base, output);
102
103
  const segments = relativeOutput.split(path.sep);
103
104
  if (segments.length !== 2 || !diagramIdPattern.test(segments[0])) {
@@ -139,7 +140,10 @@ const temporaryBase = fs.realpathSync(os.tmpdir());
139
140
  // parent symlink resolves into the OS temporary directory. Otherwise the
140
141
  // temporary-delivery exception could be used to escape the stable output root.
141
142
  const requestedWithinProject = requestedProjectRoot !== null;
142
- const isTemporary = !requestedWithinProject && isWithin(temporaryBase, output);
143
+ const projectMode = projectRoot ? repositoryMode(projectRoot) : null;
144
+ const templateDiagramBase = projectMode === 'template-source'
145
+ ? (await import(pathToFileURL(path.join(projectRoot, 'scripts/lib/maintenance-storage.mjs')).href)).resolveMaintenanceOutput('maintenance:diagrams', { root: projectRoot }) : null;
146
+ const isTemporary = !requestedWithinProject && isWithin(temporaryBase, output) && !(templateDiagramBase && isWithin(templateDiagramBase, output));
143
147
  let mode = null;
144
148
  let receipt;
145
149
  let allowedBase;
@@ -150,7 +154,7 @@ if (isTemporary) {
150
154
  } else {
151
155
  if (!projectRoot) fail('稳定交付必须从包含 yss-project.yaml 的仓库内运行');
152
156
  mode = repositoryMode(projectRoot);
153
- const contract = stableContract(projectRoot, mode, input, output);
157
+ const contract = await stableContract(projectRoot, mode, input, output);
154
158
  allowedBase = contract.base;
155
159
  receipt = contract.receipt;
156
160
  }
@@ -4,6 +4,7 @@ import fs from 'node:fs';
4
4
  import os from 'node:os';
5
5
  import path from 'node:path';
6
6
  import test from 'node:test';
7
+ import { resolveMaintenanceOutput } from '../../../../scripts/lib/maintenance-storage.mjs';
7
8
  import { fileURLToPath } from 'node:url';
8
9
 
9
10
  const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
@@ -12,6 +13,12 @@ const example = path.join(skillRoot, 'examples', 'web-app.architecture.json');
12
13
 
13
14
  function repository(mode = 'project-instance') {
14
15
  const root = fs.mkdtempSync(path.join(os.tmpdir(), 'yss-archify-safe-'));
16
+ if (mode === 'template-source') {
17
+ fs.mkdirSync(path.join(root, 'scripts/lib'), { recursive: true });
18
+ for (const name of ['maintenance-storage.mjs', 'runtime-store.mjs', 'repository-mode.mjs']) fs.copyFileSync(path.resolve(skillRoot, '../../../scripts/lib', name), path.join(root, 'scripts/lib', name));
19
+ fs.mkdirSync(path.join(root, 'scripts/vendor'), { recursive: true });
20
+ fs.copyFileSync(path.resolve(skillRoot, '../../../scripts/vendor/yaml.mjs'), path.join(root, 'scripts/vendor/yaml.mjs'));
21
+ }
15
22
  fs.writeFileSync(path.join(root, 'yss-project.yaml'), `schema_version: 1\nrepository_mode: ${mode}\n`);
16
23
  return root;
17
24
  }
@@ -104,9 +111,9 @@ test('delivers a paired project artifact and an auditable receipt', () => {
104
111
  assert.equal(receipt.archify.validation.warnings, 0);
105
112
  });
106
113
 
107
- test('uses the template-source evidence root for stable maintenance diagrams', () => {
114
+ test('uses the external workspace maintenance root for stable diagrams', () => {
108
115
  const root = repository('template-source');
109
- const directory = path.join(root, '.template-source', 'evidence', 'maintenance', 'diagrams', 'workflow-map');
116
+ const directory = resolveMaintenanceOutput('maintenance:diagrams/workflow-map', { root });
110
117
  fs.mkdirSync(directory, { recursive: true });
111
118
  const input = path.join(directory, 'workflow-map.archify.json');
112
119
  const output = path.join(directory, 'workflow-map.html');