create-yss-spec 2.2.9 → 2.2.10

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 (580) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/template/.agents/mcp_config.json +8 -0
  4. package/template/.agents/rules/yss-ai-skills.md +3 -1
  5. package/template/.agents/skills/.yss-skills-manifest.json +51 -25
  6. package/template/.agents/skills/code-review/references/yss-review-standards.md +3 -3
  7. package/template/.agents/skills/component-selection-imports/SKILL.md +2 -2
  8. package/template/.agents/skills/frontend-commit/SKILL.md +1 -1
  9. package/template/.agents/skills/yss-api-integration/SKILL.md +85 -339
  10. package/template/.agents/skills/yss-application/SKILL.md +7 -5
  11. package/template/.agents/skills/yss-application/references/application-layer-guide.md +60 -105
  12. package/template/.agents/skills/yss-components/SKILL.md +1 -1
  13. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  14. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  15. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  16. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  17. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  18. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  19. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  20. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  21. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  22. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  23. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  24. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  25. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  26. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  27. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  28. package/template/.agents/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  29. package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  30. package/template/.agents/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  31. package/template/.agents/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  32. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  33. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  34. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  35. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  36. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  37. package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
  38. package/template/.agents/skills/yss-design-system/references/design-system.md +2 -2
  39. package/template/.agents/skills/yss-domain/SKILL.md +3 -3
  40. package/template/.agents/skills/yss-domain/references/domain-layer-guide.md +61 -236
  41. package/template/.agents/skills/yss-dto/SKILL.md +5 -5
  42. package/template/.agents/skills/yss-dto/references/README.md +2 -2
  43. package/template/.agents/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  44. package/template/.agents/skills/yss-exception/SKILL.md +2 -0
  45. package/template/.agents/skills/yss-formily/SKILL.md +1 -1
  46. package/template/.agents/skills/yss-mybatis/SKILL.md +2 -2
  47. package/template/.agents/skills/yss-page-module-development/SKILL.md +2 -0
  48. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  49. package/template/.agents/skills/yss-repository/SKILL.md +7 -5
  50. package/template/.agents/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  51. package/template/.agents/skills/yss-router/references/router-contract.yaml +41 -7
  52. package/template/.agents/skills/yss-ui/SKILL.md +6 -5
  53. package/template/.agents/skills/yss-ui/references/component-routing.md +1 -1
  54. package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  55. package/template/.agents/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  56. package/template/.agents/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  57. package/template/.agents/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  58. package/template/.agents/skills/yss-use-table-height/SKILL.md +78 -297
  59. package/template/.agents/skills/yss-use-tree-height/SKILL.md +51 -393
  60. package/template/.agents/skills/yss-web-controller/SKILL.md +12 -11
  61. package/template/.agents/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  62. package/template/.agents/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  63. package/template/{.claude/skills/yss-web-controller/assets/templates/domain/dto/cmd/AddCmd.java.template → .agents/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template} +7 -11
  64. package/template/.agents/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  65. package/template/.agents/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  66. package/template/.agents/skills/yss-web-controller/assets/templates/{domain/dto/cmd/AddCmd.java.template → web/dto/UpdateRequest.java.template} +7 -11
  67. package/template/.agents/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  68. package/template/.agents/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  69. package/template/.agents/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  70. package/template/.claude/skills/code-review/references/yss-review-standards.md +3 -3
  71. package/template/.claude/skills/component-selection-imports/SKILL.md +2 -2
  72. package/template/.claude/skills/frontend-commit/SKILL.md +1 -1
  73. package/template/.claude/skills/yss-api-integration/SKILL.md +85 -339
  74. package/template/.claude/skills/yss-application/SKILL.md +7 -5
  75. package/template/.claude/skills/yss-application/references/application-layer-guide.md +60 -105
  76. package/template/.claude/skills/yss-components/SKILL.md +1 -1
  77. package/template/.claude/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  78. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  79. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  80. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  81. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  82. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  83. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  84. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  85. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  86. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  87. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  88. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  89. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  90. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  91. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  92. package/template/.claude/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  93. package/template/.claude/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  94. package/template/.claude/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  95. package/template/.claude/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  96. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  97. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  98. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  99. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  100. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  101. package/template/.claude/skills/yss-design-system/SKILL.md +2 -2
  102. package/template/.claude/skills/yss-design-system/references/design-system.md +2 -2
  103. package/template/.claude/skills/yss-domain/SKILL.md +3 -3
  104. package/template/.claude/skills/yss-domain/references/domain-layer-guide.md +61 -236
  105. package/template/.claude/skills/yss-dto/SKILL.md +5 -5
  106. package/template/.claude/skills/yss-dto/references/README.md +2 -2
  107. package/template/.claude/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  108. package/template/.claude/skills/yss-exception/SKILL.md +2 -0
  109. package/template/.claude/skills/yss-formily/SKILL.md +1 -1
  110. package/template/.claude/skills/yss-mybatis/SKILL.md +2 -2
  111. package/template/.claude/skills/yss-page-module-development/SKILL.md +2 -0
  112. package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  113. package/template/.claude/skills/yss-repository/SKILL.md +7 -5
  114. package/template/.claude/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  115. package/template/.claude/skills/yss-router/references/router-contract.yaml +41 -7
  116. package/template/.claude/skills/yss-ui/SKILL.md +6 -5
  117. package/template/.claude/skills/yss-ui/references/component-routing.md +1 -1
  118. package/template/.claude/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  119. package/template/.claude/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  120. package/template/.claude/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  121. package/template/.claude/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  122. package/template/.claude/skills/yss-use-table-height/SKILL.md +78 -297
  123. package/template/.claude/skills/yss-use-tree-height/SKILL.md +51 -393
  124. package/template/.claude/skills/yss-web-controller/SKILL.md +12 -11
  125. package/template/.claude/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  126. package/template/.claude/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  127. package/template/{.codex/skills/yss-web-controller/assets/templates/domain/dto/cmd/AddCmd.java.template → .claude/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template} +7 -11
  128. package/template/.claude/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  129. package/template/.claude/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  130. package/template/{.cursor/skills/yss-web-controller/assets/templates/domain/dto/cmd/AddCmd.java.template → .claude/skills/yss-web-controller/assets/templates/web/dto/UpdateRequest.java.template} +7 -11
  131. package/template/.claude/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  132. package/template/.claude/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  133. package/template/.claude/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  134. package/template/.codex/skills/code-review/references/yss-review-standards.md +3 -3
  135. package/template/.codex/skills/component-selection-imports/SKILL.md +2 -2
  136. package/template/.codex/skills/frontend-commit/SKILL.md +1 -1
  137. package/template/.codex/skills/yss-api-integration/SKILL.md +85 -339
  138. package/template/.codex/skills/yss-application/SKILL.md +7 -5
  139. package/template/.codex/skills/yss-application/references/application-layer-guide.md +60 -105
  140. package/template/.codex/skills/yss-components/SKILL.md +1 -1
  141. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  142. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  143. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  144. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  145. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  146. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  147. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  148. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  149. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  150. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  151. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  152. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  153. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  154. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  155. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  156. package/template/.codex/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  157. package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  158. package/template/.codex/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  159. package/template/.codex/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  160. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  161. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  162. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  163. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  164. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  165. package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
  166. package/template/.codex/skills/yss-design-system/references/design-system.md +2 -2
  167. package/template/.codex/skills/yss-domain/SKILL.md +3 -3
  168. package/template/.codex/skills/yss-domain/references/domain-layer-guide.md +61 -236
  169. package/template/.codex/skills/yss-dto/SKILL.md +5 -5
  170. package/template/.codex/skills/yss-dto/references/README.md +2 -2
  171. package/template/.codex/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  172. package/template/.codex/skills/yss-exception/SKILL.md +2 -0
  173. package/template/.codex/skills/yss-formily/SKILL.md +1 -1
  174. package/template/.codex/skills/yss-mybatis/SKILL.md +2 -2
  175. package/template/.codex/skills/yss-page-module-development/SKILL.md +2 -0
  176. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  177. package/template/.codex/skills/yss-repository/SKILL.md +7 -5
  178. package/template/.codex/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  179. package/template/.codex/skills/yss-router/references/router-contract.yaml +41 -7
  180. package/template/.codex/skills/yss-ui/SKILL.md +6 -5
  181. package/template/.codex/skills/yss-ui/references/component-routing.md +1 -1
  182. package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  183. package/template/.codex/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  184. package/template/.codex/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  185. package/template/.codex/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  186. package/template/.codex/skills/yss-use-table-height/SKILL.md +78 -297
  187. package/template/.codex/skills/yss-use-tree-height/SKILL.md +51 -393
  188. package/template/.codex/skills/yss-web-controller/SKILL.md +12 -11
  189. package/template/.codex/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  190. package/template/.codex/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  191. package/template/.codex/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template +19 -0
  192. package/template/.codex/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  193. package/template/.codex/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  194. package/template/.codex/skills/yss-web-controller/assets/templates/web/dto/UpdateRequest.java.template +19 -0
  195. package/template/.codex/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  196. package/template/.codex/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  197. package/template/.codex/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  198. package/template/.cursor/mcp.json +8 -0
  199. package/template/.cursor/skills/code-review/references/yss-review-standards.md +3 -3
  200. package/template/.cursor/skills/component-selection-imports/SKILL.md +2 -2
  201. package/template/.cursor/skills/frontend-commit/SKILL.md +1 -1
  202. package/template/.cursor/skills/yss-api-integration/SKILL.md +85 -339
  203. package/template/.cursor/skills/yss-application/SKILL.md +7 -5
  204. package/template/.cursor/skills/yss-application/references/application-layer-guide.md +60 -105
  205. package/template/.cursor/skills/yss-components/SKILL.md +1 -1
  206. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  207. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  208. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  209. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  210. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  211. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  212. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  213. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  214. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  215. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  216. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  217. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  218. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  219. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  220. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  221. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  222. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  223. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  224. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  225. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  226. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  227. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  228. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  229. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  230. package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
  231. package/template/.cursor/skills/yss-design-system/references/design-system.md +2 -2
  232. package/template/.cursor/skills/yss-domain/SKILL.md +3 -3
  233. package/template/.cursor/skills/yss-domain/references/domain-layer-guide.md +61 -236
  234. package/template/.cursor/skills/yss-dto/SKILL.md +5 -5
  235. package/template/.cursor/skills/yss-dto/references/README.md +2 -2
  236. package/template/.cursor/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  237. package/template/.cursor/skills/yss-exception/SKILL.md +2 -0
  238. package/template/.cursor/skills/yss-formily/SKILL.md +1 -1
  239. package/template/.cursor/skills/yss-mybatis/SKILL.md +2 -2
  240. package/template/.cursor/skills/yss-page-module-development/SKILL.md +2 -0
  241. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  242. package/template/.cursor/skills/yss-repository/SKILL.md +7 -5
  243. package/template/.cursor/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  244. package/template/.cursor/skills/yss-router/references/router-contract.yaml +41 -7
  245. package/template/.cursor/skills/yss-ui/SKILL.md +6 -5
  246. package/template/.cursor/skills/yss-ui/references/component-routing.md +1 -1
  247. package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  248. package/template/.cursor/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  249. package/template/.cursor/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  250. package/template/.cursor/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  251. package/template/.cursor/skills/yss-use-table-height/SKILL.md +78 -297
  252. package/template/.cursor/skills/yss-use-tree-height/SKILL.md +51 -393
  253. package/template/.cursor/skills/yss-web-controller/SKILL.md +12 -11
  254. package/template/.cursor/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  255. package/template/.cursor/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  256. package/template/.cursor/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template +19 -0
  257. package/template/.cursor/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  258. package/template/.cursor/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  259. package/template/.cursor/skills/yss-web-controller/assets/templates/web/dto/UpdateRequest.java.template +19 -0
  260. package/template/.cursor/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  261. package/template/.cursor/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  262. package/template/.cursor/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  263. package/template/.cursorrules +9 -5
  264. package/template/.gemini/settings.json +8 -0
  265. package/template/.hermes/skills/code-review/references/yss-review-standards.md +3 -3
  266. package/template/.hermes/skills/component-selection-imports/SKILL.md +2 -2
  267. package/template/.hermes/skills/frontend-commit/SKILL.md +1 -1
  268. package/template/.hermes/skills/yss-api-integration/SKILL.md +85 -339
  269. package/template/.hermes/skills/yss-application/SKILL.md +7 -5
  270. package/template/.hermes/skills/yss-application/references/application-layer-guide.md +60 -105
  271. package/template/.hermes/skills/yss-components/SKILL.md +1 -1
  272. package/template/.hermes/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  273. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  274. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  275. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  276. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  277. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  278. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  279. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  280. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  281. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  282. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  283. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  284. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  285. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  286. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  287. package/template/.hermes/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  288. package/template/.hermes/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  289. package/template/.hermes/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  290. package/template/.hermes/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  291. package/template/.hermes/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  292. package/template/.hermes/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  293. package/template/.hermes/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  294. package/template/.hermes/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  295. package/template/.hermes/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  296. package/template/.hermes/skills/yss-design-system/SKILL.md +2 -2
  297. package/template/.hermes/skills/yss-design-system/references/design-system.md +2 -2
  298. package/template/.hermes/skills/yss-domain/SKILL.md +3 -3
  299. package/template/.hermes/skills/yss-domain/references/domain-layer-guide.md +61 -236
  300. package/template/.hermes/skills/yss-dto/SKILL.md +5 -5
  301. package/template/.hermes/skills/yss-dto/references/README.md +2 -2
  302. package/template/.hermes/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  303. package/template/.hermes/skills/yss-exception/SKILL.md +2 -0
  304. package/template/.hermes/skills/yss-formily/SKILL.md +1 -1
  305. package/template/.hermes/skills/yss-mybatis/SKILL.md +2 -2
  306. package/template/.hermes/skills/yss-page-module-development/SKILL.md +2 -0
  307. package/template/.hermes/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  308. package/template/.hermes/skills/yss-repository/SKILL.md +7 -5
  309. package/template/.hermes/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  310. package/template/.hermes/skills/yss-router/references/router-contract.yaml +41 -7
  311. package/template/.hermes/skills/yss-ui/SKILL.md +6 -5
  312. package/template/.hermes/skills/yss-ui/references/component-routing.md +1 -1
  313. package/template/.hermes/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  314. package/template/.hermes/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  315. package/template/.hermes/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  316. package/template/.hermes/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  317. package/template/.hermes/skills/yss-use-table-height/SKILL.md +78 -297
  318. package/template/.hermes/skills/yss-use-tree-height/SKILL.md +51 -393
  319. package/template/.hermes/skills/yss-web-controller/SKILL.md +12 -11
  320. package/template/.hermes/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  321. package/template/.hermes/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  322. package/template/.hermes/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template +19 -0
  323. package/template/.hermes/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  324. package/template/.hermes/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  325. package/template/.hermes/skills/yss-web-controller/assets/templates/web/dto/UpdateRequest.java.template +19 -0
  326. package/template/.hermes/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  327. package/template/.hermes/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  328. package/template/.hermes/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  329. package/template/.kiro/settings/mcp.json +8 -0
  330. package/template/.mcp.json +8 -0
  331. package/template/.pi/skills/code-review/references/yss-review-standards.md +3 -3
  332. package/template/.pi/skills/component-selection-imports/SKILL.md +2 -2
  333. package/template/.pi/skills/frontend-commit/SKILL.md +1 -1
  334. package/template/.pi/skills/yss-api-integration/SKILL.md +85 -339
  335. package/template/.pi/skills/yss-application/SKILL.md +7 -5
  336. package/template/.pi/skills/yss-application/references/application-layer-guide.md +60 -105
  337. package/template/.pi/skills/yss-components/SKILL.md +1 -1
  338. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  339. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  340. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  341. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  342. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  343. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  344. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  345. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  346. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  347. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  348. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  349. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  350. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  351. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  352. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  353. package/template/.pi/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  354. package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  355. package/template/.pi/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  356. package/template/.pi/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  357. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  358. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  359. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  360. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  361. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  362. package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
  363. package/template/.pi/skills/yss-design-system/references/design-system.md +2 -2
  364. package/template/.pi/skills/yss-domain/SKILL.md +3 -3
  365. package/template/.pi/skills/yss-domain/references/domain-layer-guide.md +61 -236
  366. package/template/.pi/skills/yss-dto/SKILL.md +5 -5
  367. package/template/.pi/skills/yss-dto/references/README.md +2 -2
  368. package/template/.pi/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  369. package/template/.pi/skills/yss-exception/SKILL.md +2 -0
  370. package/template/.pi/skills/yss-formily/SKILL.md +1 -1
  371. package/template/.pi/skills/yss-mybatis/SKILL.md +2 -2
  372. package/template/.pi/skills/yss-page-module-development/SKILL.md +2 -0
  373. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  374. package/template/.pi/skills/yss-repository/SKILL.md +7 -5
  375. package/template/.pi/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  376. package/template/.pi/skills/yss-router/references/router-contract.yaml +41 -7
  377. package/template/.pi/skills/yss-ui/SKILL.md +6 -5
  378. package/template/.pi/skills/yss-ui/references/component-routing.md +1 -1
  379. package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  380. package/template/.pi/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  381. package/template/.pi/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  382. package/template/.pi/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  383. package/template/.pi/skills/yss-use-table-height/SKILL.md +78 -297
  384. package/template/.pi/skills/yss-use-tree-height/SKILL.md +51 -393
  385. package/template/.pi/skills/yss-web-controller/SKILL.md +12 -11
  386. package/template/.pi/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  387. package/template/.pi/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  388. package/template/.pi/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template +19 -0
  389. package/template/.pi/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  390. package/template/.pi/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  391. package/template/.pi/skills/yss-web-controller/assets/templates/web/dto/UpdateRequest.java.template +19 -0
  392. package/template/.pi/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  393. package/template/.pi/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  394. package/template/.pi/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  395. package/template/.qoder/skills/code-review/references/yss-review-standards.md +3 -3
  396. package/template/.qoder/skills/component-selection-imports/SKILL.md +2 -2
  397. package/template/.qoder/skills/frontend-commit/SKILL.md +1 -1
  398. package/template/.qoder/skills/yss-api-integration/SKILL.md +85 -339
  399. package/template/.qoder/skills/yss-application/SKILL.md +7 -5
  400. package/template/.qoder/skills/yss-application/references/application-layer-guide.md +60 -105
  401. package/template/.qoder/skills/yss-components/SKILL.md +1 -1
  402. package/template/.qoder/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  403. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  404. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  405. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  406. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  407. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  408. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  409. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  410. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  411. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  412. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  413. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  414. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  415. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  416. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  417. package/template/.qoder/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  418. package/template/.qoder/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  419. package/template/.qoder/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  420. package/template/.qoder/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  421. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  422. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  423. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  424. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  425. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  426. package/template/.qoder/skills/yss-design-system/SKILL.md +2 -2
  427. package/template/.qoder/skills/yss-design-system/references/design-system.md +2 -2
  428. package/template/.qoder/skills/yss-domain/SKILL.md +3 -3
  429. package/template/.qoder/skills/yss-domain/references/domain-layer-guide.md +61 -236
  430. package/template/.qoder/skills/yss-dto/SKILL.md +5 -5
  431. package/template/.qoder/skills/yss-dto/references/README.md +2 -2
  432. package/template/.qoder/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  433. package/template/.qoder/skills/yss-exception/SKILL.md +2 -0
  434. package/template/.qoder/skills/yss-formily/SKILL.md +1 -1
  435. package/template/.qoder/skills/yss-mybatis/SKILL.md +2 -2
  436. package/template/.qoder/skills/yss-page-module-development/SKILL.md +2 -0
  437. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  438. package/template/.qoder/skills/yss-repository/SKILL.md +7 -5
  439. package/template/.qoder/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  440. package/template/.qoder/skills/yss-router/references/router-contract.yaml +41 -7
  441. package/template/.qoder/skills/yss-ui/SKILL.md +6 -5
  442. package/template/.qoder/skills/yss-ui/references/component-routing.md +1 -1
  443. package/template/.qoder/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  444. package/template/.qoder/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  445. package/template/.qoder/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  446. package/template/.qoder/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  447. package/template/.qoder/skills/yss-use-table-height/SKILL.md +78 -297
  448. package/template/.qoder/skills/yss-use-tree-height/SKILL.md +51 -393
  449. package/template/.qoder/skills/yss-web-controller/SKILL.md +12 -11
  450. package/template/.qoder/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  451. package/template/.qoder/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  452. package/template/.qoder/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template +19 -0
  453. package/template/.qoder/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  454. package/template/.qoder/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  455. package/template/.qoder/skills/yss-web-controller/assets/templates/web/dto/UpdateRequest.java.template +19 -0
  456. package/template/.qoder/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  457. package/template/.qoder/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  458. package/template/.qoder/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  459. package/template/.trae/skills/code-review/references/yss-review-standards.md +3 -3
  460. package/template/.trae/skills/component-selection-imports/SKILL.md +2 -2
  461. package/template/.trae/skills/frontend-commit/SKILL.md +1 -1
  462. package/template/.trae/skills/yss-api-integration/SKILL.md +85 -339
  463. package/template/.trae/skills/yss-application/SKILL.md +7 -5
  464. package/template/.trae/skills/yss-application/references/application-layer-guide.md +60 -105
  465. package/template/.trae/skills/yss-components/SKILL.md +1 -1
  466. package/template/.trae/skills/yss-ddd-scaffold-generator/SKILL.md +27 -13
  467. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/config/application-local.yml.template +8 -0
  468. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/config/application.yml.template +2 -3
  469. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +36 -0
  470. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/java/bootstrap-application.java.template +15 -0
  471. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/pom/adapter-pom.xml.template +3 -3
  472. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/pom/application-pom.xml.template +13 -4
  473. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +24 -4
  474. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/pom/domain-pom.xml.template +6 -20
  475. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/pom/infrastructure-pom.xml.template +26 -6
  476. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/pom/parent-pom.xml.template +70 -10
  477. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/pom/web-pom.xml.template +24 -10
  478. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/maven.config +2 -3
  479. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/settings.xml +18 -105
  480. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/wrapper/.mvn/wrapper/maven-wrapper.properties +4 -2
  481. package/template/.trae/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +78 -156
  482. package/template/.trae/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +83 -389
  483. package/template/.trae/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-adapter/SKILL.md +20 -188
  484. package/template/.trae/skills/yss-ddd-scaffold-generator/references/yss-backend-scaffold-parent/SKILL.md +41 -122
  485. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +191 -0
  486. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +126 -0
  487. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +139 -42
  488. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +87 -7
  489. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +322 -12
  490. package/template/.trae/skills/yss-design-system/SKILL.md +2 -2
  491. package/template/.trae/skills/yss-design-system/references/design-system.md +2 -2
  492. package/template/.trae/skills/yss-domain/SKILL.md +3 -3
  493. package/template/.trae/skills/yss-domain/references/domain-layer-guide.md +61 -236
  494. package/template/.trae/skills/yss-dto/SKILL.md +5 -5
  495. package/template/.trae/skills/yss-dto/references/README.md +2 -2
  496. package/template/.trae/skills/yss-dto/references/openapi-wire-profile.yaml +3 -3
  497. package/template/.trae/skills/yss-exception/SKILL.md +2 -0
  498. package/template/.trae/skills/yss-formily/SKILL.md +1 -1
  499. package/template/.trae/skills/yss-mybatis/SKILL.md +2 -2
  500. package/template/.trae/skills/yss-page-module-development/SKILL.md +2 -0
  501. package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +42 -11
  502. package/template/.trae/skills/yss-repository/SKILL.md +7 -5
  503. package/template/.trae/skills/yss-repository/references/infrastructure-layer-guide.md +70 -155
  504. package/template/.trae/skills/yss-router/references/router-contract.yaml +41 -7
  505. package/template/.trae/skills/yss-ui/SKILL.md +6 -5
  506. package/template/.trae/skills/yss-ui/references/component-routing.md +1 -1
  507. package/template/.trae/skills/yss-ui-business-page-generation/SKILL.md +159 -0
  508. package/template/.trae/skills/yss-ui-business-page-generation/references/component-map.md +39 -0
  509. package/template/.trae/skills/yss-ui-business-page-generation/references/hooks-map.md +70 -0
  510. package/template/.trae/skills/yss-ui-business-page-generation/references/utils-map.md +51 -0
  511. package/template/.trae/skills/yss-use-table-height/SKILL.md +78 -297
  512. package/template/.trae/skills/yss-use-tree-height/SKILL.md +51 -393
  513. package/template/.trae/skills/yss-web-controller/SKILL.md +12 -11
  514. package/template/.trae/skills/yss-web-controller/assets/templates/Controller.java.template +15 -16
  515. package/template/.trae/skills/yss-web-controller/assets/templates/WebConvertor.java.template +21 -11
  516. package/template/.trae/skills/yss-web-controller/assets/templates/web/dto/CreateRequest.java.template +19 -0
  517. package/template/.trae/skills/yss-web-controller/assets/templates/web/dto/PageRequest.java.template +24 -0
  518. package/template/.trae/skills/yss-web-controller/assets/templates/web/dto/Response.java.template +18 -0
  519. package/template/.trae/skills/yss-web-controller/assets/templates/web/dto/UpdateRequest.java.template +19 -0
  520. package/template/.trae/skills/yss-web-controller/references/web-adapter-layer-guide.md +61 -145
  521. package/template/.trae/skills/yss-web-controller/scripts/generate_controller.mjs +45 -17
  522. package/template/.trae/skills/yss-web-controller/scripts/generate_controller.test.mjs +44 -3
  523. package/template/.vscode/mcp.json +8 -0
  524. package/template/README.md +3 -0
  525. package/template/docs/agents/digital-human-roles.yaml +1 -1
  526. package/template/docs/agents/skills-maintenance.md +7 -4
  527. package/template/docs/agents/yss-skill-registry.yaml +7 -1
  528. package/template/docs/agents/yss-ui-skills-integration.md +24 -0
  529. package/template/docs/process/template-verification-profiles.yaml +11 -0
  530. package/template/docs/templates/implementation-routing-template.md +5 -3
  531. package/template/docs/templates/review-report-template.md +2 -2
  532. package/template/docs/user-guide/yss-ui-mcp.md +43 -0
  533. package/template/scripts/lib/scenario-checks.mjs +3 -3
  534. package/template/scripts/lib/skill-governance.mjs +36 -2
  535. package/template/scripts/lib/skill-registry.mjs +2 -1
  536. package/template/scripts/lib/skill-supply-chain.mjs +72 -1
  537. package/template/scripts/verify-scaffold-generator-scenarios +150 -44
  538. package/template/scripts/verify-skill-governance +1 -1
  539. package/template/scripts/verify-upstream-skill-source +38 -3
  540. package/template/scripts/verify-yss-dto-openapi-profile +4 -2
  541. package/template/skills-lock.json +159 -84
  542. package/template/yss-public-skills.json +2 -0
  543. package/template.manifest.json +4 -0
  544. package/template.snapshot.json +5 -5
  545. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  546. package/template/.agents/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  547. package/template/.agents/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  548. package/template/.agents/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
  549. package/template/.claude/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  550. package/template/.claude/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  551. package/template/.claude/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  552. package/template/.claude/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
  553. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  554. package/template/.codex/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  555. package/template/.codex/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  556. package/template/.codex/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
  557. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  558. package/template/.cursor/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  559. package/template/.cursor/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  560. package/template/.cursor/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
  561. package/template/.hermes/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  562. package/template/.hermes/skills/yss-web-controller/assets/templates/domain/dto/cmd/AddCmd.java.template +0 -23
  563. package/template/.hermes/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  564. package/template/.hermes/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  565. package/template/.hermes/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
  566. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  567. package/template/.pi/skills/yss-web-controller/assets/templates/domain/dto/cmd/AddCmd.java.template +0 -23
  568. package/template/.pi/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  569. package/template/.pi/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  570. package/template/.pi/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
  571. package/template/.qoder/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  572. package/template/.qoder/skills/yss-web-controller/assets/templates/domain/dto/cmd/AddCmd.java.template +0 -23
  573. package/template/.qoder/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  574. package/template/.qoder/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  575. package/template/.qoder/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
  576. package/template/.trae/skills/yss-ddd-scaffold-generator/assets/templates/config/parent-pom.xml.template +0 -84
  577. package/template/.trae/skills/yss-web-controller/assets/templates/domain/dto/cmd/AddCmd.java.template +0 -23
  578. package/template/.trae/skills/yss-web-controller/assets/templates/domain/dto/cmd/UpdateCmd.java.template +0 -23
  579. package/template/.trae/skills/yss-web-controller/assets/templates/domain/dto/query/PageQuery.java.template +0 -21
  580. package/template/.trae/skills/yss-web-controller/assets/templates/domain/vo/VO.java.template +0 -20
@@ -0,0 +1,126 @@
1
+ #!/usr/bin/env node
2
+ /** 在同一个受控工作流中生成脚手架并执行真实 Maven Wrapper 验证。 */
3
+ import { execFile } from "node:child_process";
4
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
5
+ import path from "node:path";
6
+ import process from "node:process";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ import { run } from "./run_scaffold_verification.mjs";
10
+
11
+ const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
12
+ const GENERATOR = path.join(SCRIPT_DIR, "generate_scaffold.mjs");
13
+ const isoNow = () => new Date().toISOString();
14
+
15
+ function parseArgs(argv) {
16
+ const generatorArgs = [];
17
+ let evidenceDir;
18
+ let projectName;
19
+ let outputDir;
20
+ for (let index = 0; index < argv.length; index += 1) {
21
+ const original = argv[index];
22
+ const [flag, inlineValue] = original.split(/=(.*)/s, 2);
23
+ let value = inlineValue;
24
+ if (["--evidence-dir", "--project-name", "--output-dir"].includes(flag) && value === undefined) value = argv[index + 1];
25
+ if (flag === "--evidence-dir") {
26
+ if (!value || value.startsWith("--")) throw new Error("参数 --evidence-dir 缺少值");
27
+ evidenceDir = path.resolve(value);
28
+ if (inlineValue === undefined) index += 1;
29
+ continue;
30
+ }
31
+ generatorArgs.push(original);
32
+ if (["--project-name", "--output-dir"].includes(flag) && inlineValue === undefined) {
33
+ if (!value || value.startsWith("--")) throw new Error(`参数 ${flag} 缺少值`);
34
+ generatorArgs.push(value);
35
+ index += 1;
36
+ }
37
+ if (flag === "--project-name") projectName = value;
38
+ if (flag === "--output-dir") outputDir = value;
39
+ }
40
+ if (!evidenceDir) throw new Error("必须提供 --evidence-dir");
41
+ if (!projectName || !outputDir) throw new Error("必须提供 --project-name 和 --output-dir");
42
+ return { evidenceDir, generatorArgs, projectRoot: path.join(path.resolve(outputDir), projectName) };
43
+ }
44
+
45
+ function executeGenerator(args) {
46
+ return new Promise((resolve) => {
47
+ execFile(process.execPath, [GENERATOR, ...args], { encoding: "utf8" }, (error, stdout, stderr) => {
48
+ resolve({ exitCode: error?.code ?? 0, stdout, stderr });
49
+ });
50
+ });
51
+ }
52
+
53
+ async function writeJson(target, value) {
54
+ await mkdir(path.dirname(target), { recursive: true });
55
+ await writeFile(target, `${JSON.stringify(value, null, 2)}\n`, "utf8");
56
+ }
57
+
58
+ async function main() {
59
+ let args;
60
+ try {
61
+ args = parseArgs(process.argv.slice(2));
62
+ } catch (error) {
63
+ process.stderr.write(`❌ 脚手架工作流无法执行: ${error.message}\n`);
64
+ return 1;
65
+ }
66
+ await mkdir(args.evidenceDir, { recursive: true });
67
+ const workflowPath = path.join(args.evidenceDir, "scaffold-workflow.json");
68
+ const verificationPath = path.join(args.evidenceDir, "scaffold-verification.json");
69
+ const generation = await executeGenerator(args.generatorArgs);
70
+ await writeFile(path.join(args.evidenceDir, "scaffold-generation.stdout.log"), generation.stdout, "utf8");
71
+ await writeFile(path.join(args.evidenceDir, "scaffold-generation.stderr.log"), generation.stderr, "utf8");
72
+ process.stdout.write(generation.stdout);
73
+ process.stderr.write(generation.stderr);
74
+ if (generation.exitCode !== 0) {
75
+ await writeJson(workflowPath, {
76
+ workflow_mode: "controlled-generation",
77
+ generated_at: isoNow(),
78
+ project_root: args.projectRoot,
79
+ status: "blocked",
80
+ failure_category: "generation",
81
+ generation_exit_code: generation.exitCode,
82
+ verification_ref: null
83
+ });
84
+ return 1;
85
+ }
86
+ try {
87
+ const verification = await run(args.projectRoot, args.evidenceDir);
88
+ await writeJson(verificationPath, verification);
89
+ const passed = verification.status === "passed";
90
+ if (passed) {
91
+ const manifestPath = path.join(args.projectRoot, ".yss", "scaffold-generation.json");
92
+ const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
93
+ manifest.completion_level = "empty-scaffold-verified";
94
+ manifest.empty_scaffold_verification_ref = verificationPath;
95
+ manifest.empty_scaffold_verified_at = isoNow();
96
+ await writeJson(manifestPath, manifest);
97
+ }
98
+ await writeJson(workflowPath, {
99
+ workflow_mode: "controlled-generation",
100
+ generated_at: isoNow(),
101
+ project_root: args.projectRoot,
102
+ status: passed ? "completed" : "blocked",
103
+ failure_category: verification.failure_category,
104
+ generation_exit_code: generation.exitCode,
105
+ verification_ref: verificationPath
106
+ });
107
+ if (passed) process.stdout.write(`✅ 脚手架生成与验证完成: ${args.projectRoot}\n`);
108
+ else process.stderr.write(`❌ 脚手架验证失败,已阻断: ${verification.failure_category}\n`);
109
+ return passed ? 0 : 1;
110
+ } catch (error) {
111
+ await writeJson(workflowPath, {
112
+ workflow_mode: "controlled-generation",
113
+ generated_at: isoNow(),
114
+ project_root: args.projectRoot,
115
+ status: "blocked",
116
+ failure_category: "verification-preflight",
117
+ generation_exit_code: generation.exitCode,
118
+ verification_ref: verificationPath,
119
+ error: error.message
120
+ });
121
+ process.stderr.write(`❌ 脚手架验证无法执行,已阻断: ${error.message}\n`);
122
+ return 1;
123
+ }
124
+ }
125
+
126
+ process.exitCode = await main();
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /** YSS DDD 后端纯工程骨架生成器;只生成工程结构,不生成任何业务行为。 */
3
+ import { createHash } from "node:crypto";
3
4
  import { chmod, cp, lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, stat, writeFile, copyFile } from "node:fs/promises";
4
5
  import path from "node:path";
5
6
  import process from "node:process";
@@ -15,17 +16,29 @@ const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
15
16
  const SKILL_ROOT = path.resolve(SCRIPT_DIR, "..");
16
17
  const REPOSITORY_ROOT = path.resolve(SCRIPT_DIR, "../../../..");
17
18
  const COMMANDS = ["./mvnw validate", "./mvnw test", "./mvnw package"];
18
-
19
+ const SUPPORTED_PROFILES = Object.freeze({
20
+ architecture: "target-domain-model",
21
+ persistence: "mybatis-plus",
22
+ database: "mysql",
23
+ platform: "spring-boot-2.7-jdk8",
24
+ validation_namespace: "javax",
25
+ dto_placement: "web",
26
+ repository: "yss-internal"
27
+ });
28
+ const DOWNSTREAM_SKILLS = ["yss-domain", "yss-application", "yss-repository", "yss-mybatis", "yss-dto", "yss-exception", "yss-web-controller"];
19
29
  function fail(message) { throw new Error(message); }
20
30
  function isoNow() { return new Date().toISOString(); }
21
31
  function localDate() { return new Date().toISOString().slice(0, 10); }
22
- function backupStamp() { return new Date().toISOString().replace(/[-:TZ.]/g, ""); }
32
+ function toUpperCamel(value) { return value.split("-").map((part) => `${part[0].toUpperCase()}${part.slice(1)}`).join(""); }
33
+ function sha256(content) { return createHash("sha256").update(content).digest("hex"); }
23
34
  function usage(error) {
24
35
  const text = `YSS DDD 脚手架生成器\n\n` +
25
36
  `用法: node scripts/generate_scaffold.mjs --project-name <kebab-case> --base-package <package> --output-dir <dir> --contract-file <json> [选项]\n\n` +
26
37
  `必填合同元数据: --contract-id --contract-version --approval-ref --router-draft-ref --persisted-ref\n` +
27
- `选项: --database mysql, --force, --overwrite-scope <scope>, --rollback-ref <ref>\n` +
28
- `--with-example 已禁用;--without-example 是兼容的无操作参数。`;
38
+ `Maven 坐标: --group-id --project-version --parent-group-id --parent-artifact-id --parent-version --yss-components-version\n` +
39
+ `固定 Profile: target-domain-model / mybatis-plus / spring-boot-2.7-jdk8 / javax / web / yss-internal\n` +
40
+ `本生成器严格 initialize-only;--force 和任何已有项目目标均为 unsupported。\n` +
41
+ `--with-example 已禁用;--without-example 仅保留为无操作参数。`;
29
42
  if (error) process.stderr.write(`错误: ${error}\n\n`);
30
43
  process.stdout.write(`${text}\n`);
31
44
  }
@@ -36,7 +49,10 @@ function parseArgs(argv) {
36
49
  ["--project-name", "projectName"], ["--base-package", "basePackage"], ["--output-dir", "outputDir"],
37
50
  ["--database", "database"], ["--contract-id", "contractId"], ["--contract-version", "contractVersion"],
38
51
  ["--approval-ref", "approvalRef"], ["--router-draft-ref", "routerDraftRef"], ["--persisted-ref", "persistedRef"],
39
- ["--contract-file", "contractFile"], ["--overwrite-scope", "overwriteScope"], ["--rollback-ref", "rollbackRef"],
52
+ ["--contract-file", "contractFile"],
53
+ ["--group-id", "groupId"], ["--project-version", "projectVersion"], ["--parent-group-id", "parentGroupId"],
54
+ ["--parent-artifact-id", "parentArtifactId"], ["--parent-version", "parentVersion"],
55
+ ["--yss-components-version", "yssComponentsVersion"],
40
56
  ]);
41
57
  for (let index = 0; index < argv.length; index += 1) {
42
58
  let token = argv[index];
@@ -54,7 +70,7 @@ function parseArgs(argv) {
54
70
  }
55
71
  if (options.help) return options;
56
72
  for (const [flag, key] of mapping) {
57
- if (["database", "overwriteScope", "rollbackRef", "contractId", "contractVersion", "approvalRef", "routerDraftRef", "persistedRef"].includes(key)) continue;
73
+ if (["database", "overwriteScope", "rollbackRef", "contractId", "contractVersion", "approvalRef", "routerDraftRef", "persistedRef", "groupId", "projectVersion", "parentGroupId", "parentArtifactId", "parentVersion", "yssComponentsVersion"].includes(key)) continue;
58
74
  if (!options[key]) fail(`缺少必填参数: ${flag}`);
59
75
  }
60
76
  if (options.database !== "mysql") fail("参数 --database 只支持 mysql");
@@ -63,15 +79,37 @@ function parseArgs(argv) {
63
79
  if (options.contractVersion !== undefined && (!/^\d+$/.test(options.contractVersion) || Number(options.contractVersion) < 1)) fail("--contract-version(必须为正整数)");
64
80
  if (options.contractVersion !== undefined) options.contractVersion = Number(options.contractVersion);
65
81
  if (options.withExample) fail("--with-example 已禁用;业务代码必须由批准的 YSS Slice skill 逐切片生成");
82
+ if (options.force) fail("unsupported: initialize-only 脚手架禁止 --force,也不承担旧项目迁移或模板升级");
66
83
  return options;
67
84
  }
68
85
 
69
86
  async function exists(target) { try { await lstat(target); return true; } catch (error) { if (error.code === "ENOENT") return false; throw error; } }
70
87
  async function isFile(target) { try { return (await stat(target)).isFile(); } catch (error) { if (error.code === "ENOENT") return false; throw error; } }
71
- async function nonEmpty(target) { const info = await lstat(target); return !info.isDirectory() || (await readdir(target)).length > 0; }
72
88
  async function readJson(target, message) { try { return JSON.parse(await readFile(target, "utf8")); } catch (error) { fail(`${message}: ${target}`); } }
73
89
  async function writeText(target, content) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, content, "utf8"); }
74
90
  function isPresent(value) { return value !== undefined && value !== null && value !== "" && (!Array.isArray(value) || value.length > 0); }
91
+ function isWithin(parent, target) { const relative = path.relative(parent, target); return relative === "" || (!relative.startsWith("..") && !path.isAbsolute(relative)); }
92
+ async function fileEntries(root, { exclude = new Set() } = {}) {
93
+ const output = [];
94
+ const visit = async (directory) => {
95
+ for (const entry of (await readdir(directory, { withFileTypes: true })).sort((left, right) => left.name.localeCompare(right.name))) {
96
+ const absolute = path.join(directory, entry.name);
97
+ const relative = path.relative(root, absolute).split(path.sep).join("/");
98
+ if (exclude.has(relative)) continue;
99
+ if (entry.isDirectory()) await visit(absolute);
100
+ else if (entry.isFile()) output.push({ absolute, relative });
101
+ }
102
+ };
103
+ await visit(root);
104
+ return output;
105
+ }
106
+ async function treeDigest(root) {
107
+ const hash = createHash("sha256");
108
+ for (const entry of await fileEntries(root)) {
109
+ hash.update(entry.relative).update("\0").update(await readFile(entry.absolute)).update("\0");
110
+ }
111
+ return hash.digest("hex");
112
+ }
75
113
 
76
114
  class ScaffoldGenerator {
77
115
  constructor(options) {
@@ -84,13 +122,19 @@ class ScaffoldGenerator {
84
122
  this.projectRoot = this.finalProjectRoot;
85
123
  this.templateRoot = path.join(SKILL_ROOT, "assets", "templates");
86
124
  this.configTemplateDir = path.join(this.templateRoot, "config");
125
+ this.javaTemplateDir = path.join(this.templateRoot, "java");
87
126
  this.pomTemplateDir = path.join(this.templateRoot, "pom");
88
127
  this.packagePath = this.basePackage.replaceAll(".", path.sep);
89
128
  this.author = process.env.USER || "yss-team";
90
129
  this.date = localDate();
91
- this.groupId = this.basePackage.split(".").slice(0, 2).join(".");
92
130
  this.dbName = this.projectName.replaceAll("-", "_");
131
+ this.applicationClassName = `${toUpperCamel(this.projectName)}Application`;
132
+ this.bootstrapMainSource = `${this.projectName}-bootstrap/src/main/java/${this.basePackage.replaceAll(".", "/")}/${this.applicationClassName}.java`;
93
133
  this.scaffoldContract = undefined;
134
+ this.mavenCoordinates = undefined;
135
+ this.mavenCoordinatesSource = "approved-contract";
136
+ this.contractDigest = undefined;
137
+ this.profiles = structuredClone(SUPPORTED_PROFILES);
94
138
  }
95
139
 
96
140
  gitRootForOutput() {
@@ -108,30 +152,22 @@ class ScaffoldGenerator {
108
152
  const gitlinkViolation = gitSubmoduleScaffoldViolation(gitRoot, this.outputDir, this.projectName, { force: this.options.force });
109
153
  if (gitlinkViolation) fail(gitlinkViolation);
110
154
  this.refuseGitlinkAsRegularDirectory(gitRoot, this.finalProjectRoot);
155
+ await this.validateContractMetadata();
111
156
  const targetExists = await exists(this.finalProjectRoot);
112
157
  if (targetExists) {
113
158
  this.refuseGitlinkAsRegularDirectory(gitRoot, this.finalProjectRoot);
114
- if (!this.options.force) fail(`输出目录已存在: ${this.finalProjectRoot};如确认覆盖,请显式传入 --force`);
159
+ fail(`unsupported: initialize-only 脚手架只创建全新项目,拒绝已存在目标: ${this.finalProjectRoot}`);
115
160
  }
116
- await this.validateContractMetadata();
117
- if (targetExists && await nonEmpty(this.finalProjectRoot) && this.options.force) this.validateForceMetadata();
118
161
  await mkdir(this.outputDir, { recursive: true });
119
162
  const stagingRoot = await mkdtemp(path.join(this.outputDir, `.${this.projectName}.staging-`));
120
163
  this.projectRoot = path.join(stagingRoot, this.projectName);
121
164
  try {
122
165
  console.log(`🚀 开始生成项目: ${this.projectName}\n📦 基础包名: ${this.basePackage}\n📁 输出目录: ${this.outputDir}\n`);
123
- await this.createProjectStructure(); await this.generatePomFiles(); await this.generateConfigFiles();
124
- this.generateDatabaseScripts(); await this.generateDocumentation(); await this.writeGenerationManifest();
125
- await this.copyWrapperFiles(); await this.validateGeneratedArtifacts();
126
- let backupPath;
127
- if (await exists(this.finalProjectRoot)) {
128
- this.refuseGitlinkAsRegularDirectory(gitRoot, this.finalProjectRoot);
129
- backupPath = path.join(this.outputDir, `.${this.projectName}.backup-${backupStamp()}`);
130
- await rename(this.finalProjectRoot, backupPath);
131
- }
166
+ await this.createProjectStructure(); await this.generatePomFiles(); await this.generateBootstrapSource(); await this.generateArchitectureRules(); await this.generateConfigFiles();
167
+ this.generateDatabaseScripts(); await this.generateDocumentation(); await this.copyWrapperFiles();
168
+ await this.writeGenerationManifest(); await this.validateGeneratedArtifacts();
132
169
  await rename(this.projectRoot, this.finalProjectRoot); this.projectRoot = this.finalProjectRoot;
133
- console.log(`\n✅ 项目生成完成!\n📂 项目位置: ${this.projectRoot}`);
134
- if (backupPath) console.log(`♻️ 原项目备份: ${backupPath}`);
170
+ console.log(`\n✅ 工程文件生成完成,等待受控 Maven 验证\n📂 项目位置: ${this.projectRoot}`);
135
171
  console.log(`\n🎯 下一步:\n cd ${this.projectRoot}\n ./mvnw validate\n ./mvnw test\n ./mvnw package\n ./mvnw spring-boot:run -pl ${this.projectName}-bootstrap`);
136
172
  } catch (error) { await rm(stagingRoot, { recursive: true, force: true }); throw error; }
137
173
  }
@@ -148,15 +184,17 @@ class ScaffoldGenerator {
148
184
 
149
185
  async validateContractMetadata() {
150
186
  if (!await isFile(this.contractFile)) fail("必须提供已持久化的结构化脚手架合同 JSON 文件: --contract-file");
151
- const contract = await readJson(this.contractFile, "脚手架合同文件无法读取或不是合法 JSON");
187
+ const contractText = await readFile(this.contractFile, "utf8");
188
+ let contract; try { contract = JSON.parse(contractText); } catch { fail(`脚手架合同文件无法读取或不是合法 JSON: ${this.contractFile}`); }
152
189
  if (!contract || Array.isArray(contract) || typeof contract !== "object") fail("脚手架合同必须是 JSON 对象");
190
+ if (contract.schema_version !== 2) fail(`unsupported: scaffold contract schema_version=${contract.schema_version};只接受 Target Profile schema v2,不提供自动升级`);
153
191
  const requiredMetadata = [["--contract-id", this.options.contractId], ["--contract-version", this.options.contractVersion], ["--approval-ref", this.options.approvalRef], ["--router-draft-ref", this.options.routerDraftRef], ["--persisted-ref", this.options.persistedRef]];
154
192
  const missing = requiredMetadata.filter(([, value]) => !isPresent(value)).map(([flag]) => flag);
155
193
  if (missing.length) fail(`生成项目必须提供当前已批准脚手架合同的完整元数据: ${missing.join(", ")}`);
156
- const required = ["schema_version", "contract_id", "contract_version", "slice_id", "status", "router_draft_ref", "lifecycle_approval_ref", "persisted_ref", "current_version", "implementation_repository", "backend_repository", "scaffold_status", "target_git_url_or_output_dir", "allowed_write_paths", "expected_evidence_files", "verification_commands", "approval", "work_unit", "overwrite_policy"];
194
+ const required = ["schema_version", "contract_id", "contract_version", "scaffold_request_id", "status", "router_draft_ref", "lifecycle_approval_ref", "persisted_ref", "current_version", "implementation_repository", "backend_repository", "scaffold_status", "project_name", "target_output_dir", "base_package", "maven_coordinates", "profiles", "allowed_write_paths", "expected_evidence_files", "verification_commands", "approval", "work_unit", "generation_policy"];
157
195
  const missingFields = required.filter((field) => !isPresent(contract[field]));
158
196
  if (missingFields.length) fail(`脚手架合同缺少结构化字段: ${missingFields.join(", ")}`);
159
- if (contract.schema_version !== 1 || contract.status !== "approved") fail("脚手架合同必须是 schema_version=1 且已由生命周期批准");
197
+ if (contract.status !== "approved") fail("脚手架合同必须已由生命周期批准");
160
198
  if (contract.contract_id !== this.options.contractId) fail("--contract-id 与脚手架合同不一致");
161
199
  if (contract.contract_version !== this.options.contractVersion) fail("--contract-version 与脚手架合同不一致");
162
200
  if (contract.current_version !== contract.contract_version) fail("脚手架合同版本不是当前版本");
@@ -164,10 +202,13 @@ class ScaffoldGenerator {
164
202
  if (contract.persisted_ref !== this.options.persistedRef) fail("--persisted-ref 与脚手架合同不一致");
165
203
  if (contract.lifecycle_approval_ref !== this.options.approvalRef) fail("--approval-ref 与脚手架合同不一致");
166
204
  if (contract.scaffold_status !== "required") fail("脚手架生成器只接受 scaffold_status=required");
205
+ if (contract.project_name !== this.projectName) fail("--project-name 与脚手架合同不一致");
206
+ if (contract.base_package !== this.basePackage) fail("--base-package 与脚手架合同不一致");
167
207
  if (!["allowed_write_paths", "expected_evidence_files", "verification_commands"].every((field) => Array.isArray(contract[field]) && contract[field].length)) fail("脚手架合同的 allowed_write_paths、expected_evidence_files、verification_commands 必须非空");
168
208
  if (!contract.expected_evidence_files.map(String).join(" ").includes(".yss/scaffold-generation.json")) fail("脚手架合同 expected_evidence_files 必须包含 .yss/scaffold-generation.json");
169
- const targetRef = String(contract.target_git_url_or_output_dir);
170
- if (!targetRef.includes("://") && !targetRef.startsWith("git@") && path.resolve(targetRef) !== this.outputDir) fail("脚手架合同目标目录与 --output-dir 不一致");
209
+ if (path.resolve(String(contract.target_output_dir)) !== this.outputDir) fail("脚手架合同 target_output_dir 与 --output-dir 不一致");
210
+ const allowedRoots = contract.allowed_write_paths.map((item) => path.resolve(this.outputDir, String(item)));
211
+ if (!allowedRoots.some((root) => isWithin(root, this.finalProjectRoot))) fail("实际项目根不在脚手架合同 allowed_write_paths 内");
171
212
  if (JSON.stringify(contract.verification_commands) !== JSON.stringify(COMMANDS)) fail("脚手架合同验证命令必须固定为三条项目根目录 ./mvnw 命令");
172
213
  const approval = contract.approval;
173
214
  if (!approval || typeof approval !== "object" || ["approval_ref", "approver", "persisted_ref", "current_version"].some((field) => !isPresent(approval[field]))) fail("脚手架合同 approval 记录不完整");
@@ -178,23 +219,57 @@ class ScaffoldGenerator {
178
219
  if (!workUnit || typeof workUnit !== "object" || workFields.some((field) => !isPresent(workUnit[field]))) fail("脚手架合同 work_unit 结构不完整");
179
220
  if (workUnit.primary_skill !== "yss-ddd-scaffold-generator" || workUnit.tdd_mode !== "controlled-generation" || workUnit.controlled_generation !== true) fail("脚手架合同 work_unit 必须绑定本 skill 和 controlled-generation");
180
221
  if (JSON.stringify(workUnit.verification_commands) !== JSON.stringify(contract.verification_commands) || JSON.stringify(workUnit.allowed_write_paths) !== JSON.stringify(contract.allowed_write_paths)) fail("脚手架合同 work_unit 与根级验证/写路径约束不一致");
181
- const overwrite = contract.overwrite_policy;
182
- if (!overwrite || typeof overwrite !== "object" || ["force_allowed", "overwrite_scope", "rollback_ref"].some((field) => !(field in overwrite))) fail("脚手架合同 overwrite_policy 结构不完整");
222
+ this.validateMavenCoordinates(contract);
223
+ this.validateProfiles(contract.profiles);
224
+ const generationPolicy = contract.generation_policy;
225
+ if (!generationPolicy || generationPolicy.mode !== "initialize-only" || generationPolicy.existing_target !== "unsupported" || generationPolicy.old_project_migration !== "unsupported" || generationPolicy.template_upgrade !== "unsupported") fail("脚手架合同 generation_policy 必须声明 initialize-only,且 existing_target、old_project_migration、template_upgrade 均为 unsupported");
226
+ this.contractDigest = sha256(contractText);
183
227
  this.scaffoldContract = contract;
184
228
  }
185
229
 
186
- validateForceMetadata() {
187
- if (!isPresent(this.options.overwriteScope) || !isPresent(this.options.rollbackRef)) fail("覆盖非空目录必须提供当前批准合同的覆盖范围和回滚引用: --overwrite-scope, --rollback-ref");
188
- const policy = this.scaffoldContract.overwrite_policy;
189
- if (policy.force_allowed !== true) fail("脚手架合同未批准非空目录覆盖");
190
- if (policy.overwrite_scope !== this.options.overwriteScope) fail("--overwrite-scope 与脚手架合同不一致");
191
- if (policy.rollback_ref !== this.options.rollbackRef) fail("--rollback-ref 与脚手架合同不一致");
230
+ validateProfiles(profiles) {
231
+ if (!profiles || typeof profiles !== "object") fail("脚手架合同 profiles 结构不完整");
232
+ for (const [name, expected] of Object.entries(SUPPORTED_PROFILES)) {
233
+ if (!isPresent(profiles[name])) fail(`脚手架合同 profiles 缺少 ${name}`);
234
+ if (profiles[name] !== expected) {
235
+ if (name === "persistence") fail(`unsupported persistence profile: ${profiles[name]};只支持 ${expected}`);
236
+ fail(`unsupported ${name} profile: ${profiles[name]};只支持 ${expected}`);
237
+ }
238
+ }
239
+ this.profiles = structuredClone(profiles);
240
+ if (this.options.database !== profiles.database) fail("--database 与脚手架合同 profiles.database 不一致");
241
+ }
242
+
243
+ validateMavenCoordinates(contract) {
244
+ const optionValues = [
245
+ this.options.groupId,
246
+ this.options.projectVersion,
247
+ this.options.parentGroupId,
248
+ this.options.parentArtifactId,
249
+ this.options.parentVersion,
250
+ this.options.yssComponentsVersion
251
+ ];
252
+ const providedCount = optionValues.filter(isPresent).length;
253
+ if (providedCount !== 0 && providedCount !== optionValues.length) {
254
+ fail("显式 Maven 坐标必须完整提供 groupId、项目版本、父 POM 坐标和 YSS Components 版本");
255
+ }
256
+ const coordinates = contract.maven_coordinates;
257
+ const parent = coordinates.parent;
258
+ const values = [coordinates.group_id, coordinates.project_version, parent?.group_id, parent?.artifact_id, parent?.version, coordinates.yss_components_version];
259
+ if (values.some((value) => !isPresent(value))) fail("脚手架合同 maven_coordinates 必须包含项目 groupId/version、父 POM GAV 和 YSS Components 版本");
260
+ if (providedCount !== optionValues.length) fail("合同包含 maven_coordinates 时必须传入完整 Maven 坐标参数");
261
+ if (JSON.stringify(values) !== JSON.stringify(optionValues)) fail("命令行 Maven 坐标与已批准脚手架合同不一致");
262
+ const coordinatePattern = /^[A-Za-z0-9_.-]+$/;
263
+ if (values.some((value) => !coordinatePattern.test(String(value)))) fail("Maven 坐标只能包含字母、数字、点、下划线和连字符");
264
+ this.mavenCoordinates = structuredClone(coordinates);
265
+ this.mavenCoordinatesSource = "approved-contract";
192
266
  }
193
267
 
194
268
  templateVars() {
195
269
  const database = this.options.database;
196
270
  const dependency = database === "mysql" ? `<dependency>\n <groupId>com.mysql</groupId>\n <artifactId>mysql-connector-j</artifactId>\n <version>8.4.0</version>\n <scope>compile</scope>\n</dependency>` : "";
197
- return { project_name: this.projectName, base_package: this.basePackage, group_id: this.groupId, project_description: `${this.projectName} service`, author: this.author, date: this.date, database, driver_class: "com.mysql.cj.jdbc.Driver", db_name: this.dbName, jdbc_url: `jdbc:mysql://localhost:3306/${this.dbName}?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai`, db_dependency: dependency };
271
+ const coordinates = this.mavenCoordinates;
272
+ return { project_name: this.projectName, application_class_name: this.applicationClassName, base_package: this.basePackage, group_id: coordinates.group_id, project_version: coordinates.project_version, parent_group_id: coordinates.parent.group_id, parent_artifact_id: coordinates.parent.artifact_id, parent_version: coordinates.parent.version, yss_components_version: coordinates.yss_components_version, project_description: `${this.projectName} service`, author: this.author, date: this.date, database, driver_class: "com.mysql.cj.jdbc.Driver", db_name: this.dbName, jdbc_url: `jdbc:mysql://localhost:3306/${this.dbName}?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai`, db_dependency: dependency };
198
273
  }
199
274
  render(text) { let output = text; for (const [key, value] of Object.entries(this.templateVars())) output = output.replaceAll(`{{${key}}}`, String(value)); return output; }
200
275
  async renderTemplate(template, output) { if (!await isFile(template)) fail(`模板文件不存在: ${template}`); await writeText(output, this.render(await readFile(template, "utf8"))); }
@@ -217,10 +292,22 @@ class ScaffoldGenerator {
217
292
  await Promise.all([[pom("parent-pom.xml.template"), path.join(this.projectRoot, "pom.xml")], [pom("domain-pom.xml.template"), target(`${this.projectName}-domain`)], [pom("application-pom.xml.template"), target(`${this.projectName}-application`)], [pom("infrastructure-pom.xml.template"), target(`${this.projectName}-infrastructure`)], [pom("adapter-pom.xml.template"), target(`${this.projectName}-adapter`)], [pom("web-pom.xml.template"), target(path.join(`${this.projectName}-adapter`, `${this.projectName}-web`))], [pom("bootstrap-pom.xml.template"), target(`${this.projectName}-bootstrap`)]].map(([from, to]) => this.renderTemplate(from, to)));
218
293
  console.log(" ✓ 父级 pom.xml\n ✓ domain pom.xml\n ✓ application pom.xml\n ✓ infrastructure pom.xml\n ✓ adapter pom.xml\n ✓ web pom.xml\n ✓ bootstrap pom.xml");
219
294
  }
295
+ async generateBootstrapSource() {
296
+ const source = path.join(this.javaTemplateDir, "bootstrap-application.java.template");
297
+ const target = path.join(this.projectRoot, this.bootstrapMainSource);
298
+ await this.renderTemplate(source, target);
299
+ console.log(`\n☕ 生成机械启动入口...\n ✓ ${this.applicationClassName}.java`);
300
+ }
301
+ async generateArchitectureRules() {
302
+ const source = path.join(this.javaTemplateDir, "architecture-rules-test.java.template");
303
+ const target = path.join(this.projectRoot, `${this.projectName}-bootstrap`, "src", "test", "java", this.packagePath, "ArchitectureRulesTest.java");
304
+ await this.renderTemplate(source, target);
305
+ console.log(" ✓ ArchitectureRulesTest.java");
306
+ }
220
307
  async generateConfigFiles() {
221
308
  console.log("\n⚙️ 生成配置文件..."); const base = path.join(this.projectRoot, `${this.projectName}-bootstrap`, "src/main/resources");
222
- await Promise.all([["application.yml.template", "application.yml"], ["logback-spring.xml.template", "logback-spring.xml"]].map(([from, to]) => this.renderTemplate(path.join(this.configTemplateDir, from), path.join(base, to))));
223
- console.log(" ✓ application.yml\n ✓ logback-spring.xml");
309
+ await Promise.all([["application.yml.template", "application.yml"], ["application-local.yml.template", "application-local.yml"], ["logback-spring.xml.template", "logback-spring.xml"]].map(([from, to]) => this.renderTemplate(path.join(this.configTemplateDir, from), path.join(base, to))));
310
+ console.log(" ✓ application.yml\n ✓ application-local.yml\n ✓ logback-spring.xml");
224
311
  }
225
312
  generateDatabaseScripts() { console.log("\n🗃️ 保留数据库目录布局...\n ✓ db/(业务 schema 和初始化数据由批准切片合同生成)"); }
226
313
  async generateDocumentation() {
@@ -230,7 +317,17 @@ class ScaffoldGenerator {
230
317
  }
231
318
  async writeGenerationManifest() {
232
319
  const contract = this.scaffoldContract;
233
- const manifest = { schema_version: 1, contract_id: this.options.contractId, contract_version: this.options.contractVersion, approval_ref: this.options.approvalRef, router_draft_ref: this.options.routerDraftRef, persisted_ref: this.options.persistedRef, contract_file_ref: this.contractFile, slice_id: contract.slice_id, lifecycle_approval_ref: contract.lifecycle_approval_ref, current_version: contract.current_version, approver: contract.approval.approver, allowed_write_paths: contract.allowed_write_paths, expected_evidence_files: contract.expected_evidence_files, project_name: this.projectName, base_package: this.basePackage, database: this.options.database, generation_mode: "controlled-generation", force: this.options.force, overwrite_scope: this.options.overwriteScope, rollback_ref: this.options.rollbackRef, verification_commands: COMMANDS, generated_at: isoNow() };
320
+ const manifestRelative = ".yss/scaffold-generation.json";
321
+ const generatedFiles = [];
322
+ for (const entry of await fileEntries(this.projectRoot, { exclude: new Set([manifestRelative]) })) {
323
+ generatedFiles.push({ path: entry.relative, owner: "generator", sha256: sha256(await readFile(entry.absolute)) });
324
+ }
325
+ const downstream = {};
326
+ for (const skill of DOWNSTREAM_SKILLS) {
327
+ const skillFile = path.join(REPOSITORY_ROOT, ".agents", "skills", skill, "SKILL.md");
328
+ downstream[skill] = await isFile(skillFile) ? sha256(await readFile(skillFile)) : "unavailable";
329
+ }
330
+ const manifest = { schema_version: 2, contract_id: this.options.contractId, contract_version: this.options.contractVersion, scaffold_request_id: contract.scaffold_request_id, approval_ref: this.options.approvalRef, router_draft_ref: this.options.routerDraftRef, persisted_ref: this.options.persistedRef, contract_file_ref: this.contractFile, contract_digest: this.contractDigest, lifecycle_approval_ref: contract.lifecycle_approval_ref, current_version: contract.current_version, approver: contract.approval.approver, allowed_write_paths: contract.allowed_write_paths, expected_evidence_files: contract.expected_evidence_files, project_name: this.projectName, base_package: this.basePackage, bootstrap_main_class: `${this.basePackage}.${this.applicationClassName}`, bootstrap_main_source: this.bootstrapMainSource, maven_coordinates: this.mavenCoordinates, maven_coordinates_source: this.mavenCoordinatesSource, profiles: this.profiles, database: this.options.database, generation_mode: "controlled-generation", completion_level: "generated", generator: { id: "yss-ddd-scaffold-generator", template_digest: await treeDigest(path.join(SKILL_ROOT, "assets")) }, ownership: { generated_files: generatedFiles, user_owned_globs: ["**/src/main/java/**", "**/src/test/java/**", "db/**"] }, readiness: { downstream_skills: downstream, architecture_ruleset: sha256(await readFile(path.join(this.javaTemplateDir, "architecture-rules-test.java.template"))) }, generation_policy: { mode: "initialize-only", existing_target: "unsupported", old_project_migration: "unsupported", template_upgrade: "unsupported" }, verification_commands: COMMANDS, generated_at: isoNow() };
234
331
  await writeText(path.join(this.projectRoot, ".yss", "scaffold-generation.json"), `${JSON.stringify(manifest, null, 2)}\n`); console.log(" ✓ .yss/scaffold-generation.json");
235
332
  }
236
333
  async copyWrapperFiles() {
@@ -239,10 +336,10 @@ class ScaffoldGenerator {
239
336
  if (await exists(path.join(wrapper, ".mvn"))) await cp(path.join(wrapper, ".mvn"), path.join(this.projectRoot, ".mvn"), { recursive: true, force: true });
240
337
  }
241
338
  async validateGeneratedArtifacts() {
242
- const required = [path.join(this.projectRoot, "pom.xml"), path.join(this.projectRoot, `${this.projectName}-bootstrap`, "pom.xml"), path.join(this.projectRoot, "mvnw"), path.join(this.projectRoot, ".yss", "scaffold-generation.json")];
339
+ const required = [path.join(this.projectRoot, "pom.xml"), path.join(this.projectRoot, `${this.projectName}-bootstrap`, "pom.xml"), path.join(this.projectRoot, this.bootstrapMainSource), path.join(this.projectRoot, "mvnw"), path.join(this.projectRoot, ".yss", "scaffold-generation.json")];
243
340
  const missing = []; for (const target of required) if (!await isFile(target)) missing.push(target); if (missing.length) fail(`生成产物缺失: ${missing.join(", ")}`);
244
- const manifest = await readJson(required[3], "脚手架生成元数据清单无法读取");
245
- if (manifest.contract_id !== this.options.contractId || manifest.contract_version !== this.options.contractVersion || manifest.current_version !== this.options.contractVersion || manifest.generation_mode !== "controlled-generation" || JSON.stringify(manifest.verification_commands) !== JSON.stringify(COMMANDS)) fail("脚手架生成元数据清单与当前批准合同或固定验证命令不一致");
341
+ const manifest = await readJson(required[4], "脚手架生成元数据清单无法读取");
342
+ if (manifest.schema_version !== 2 || manifest.contract_id !== this.options.contractId || manifest.contract_version !== this.options.contractVersion || manifest.current_version !== this.options.contractVersion || manifest.generation_mode !== "controlled-generation" || manifest.bootstrap_main_class !== `${this.basePackage}.${this.applicationClassName}` || manifest.bootstrap_main_source !== this.bootstrapMainSource || manifest.profiles.architecture !== SUPPORTED_PROFILES.architecture || manifest.generation_policy.mode !== "initialize-only" || manifest.generation_policy.existing_target !== "unsupported" || JSON.stringify(manifest.verification_commands) !== JSON.stringify(COMMANDS)) fail("脚手架生成元数据清单与当前批准合同、Target Profile、initialize-only 边界、机械启动入口或固定验证命令不一致");
246
343
  const stack = [this.projectRoot], binary = new Set([".class", ".db", ".jar", ".png", ".jpg", ".jpeg", ".gif"]);
247
344
  while (stack.length) { const dir = stack.pop(); for (const entry of await readdir(dir, { withFileTypes: true })) { const target = path.join(dir, entry.name); if (entry.isDirectory()) { stack.push(target); continue; } if (!entry.isFile() || binary.has(path.extname(entry.name))) continue; const content = await readFile(target, "utf8"); if (content.includes("{{") || content.includes("root/root")) fail(`生成文件包含未替换占位符或明文凭据: ${target}`); } }
248
345
  }
@@ -10,23 +10,103 @@ const COMMANDS = PHASES.map((phase) => `./mvnw ${phase}`);
10
10
  const isoNow = () => new Date().toISOString();
11
11
  async function isFile(target) { try { return (await stat(target)).isFile(); } catch (error) { if (error.code === "ENOENT") return false; throw error; } }
12
12
  async function writeText(target, content) { await mkdir(path.dirname(target), { recursive: true }); await writeFile(target, content, "utf8"); }
13
+ async function isExecutable(target) {
14
+ try { const info = await stat(target); return info.isFile() && Boolean(info.mode & 0o111); }
15
+ catch (error) { if (error.code === "ENOENT") return false; throw error; }
16
+ }
17
+ async function readTextIfPresent(target) { try { return await readFile(target, "utf8"); } catch (error) { if (error.code === "ENOENT") return ""; throw error; } }
18
+ function configured(value) { return typeof value === "string" && value.trim().length > 0; }
19
+ function redactSecrets(text, environment = process.env) {
20
+ let output = text;
21
+ for (const name of ["MAVEN_REPO_USERNAME", "MAVEN_REPO_PASSWORD"]) {
22
+ const value = environment[name];
23
+ if (configured(value)) output = output.replaceAll(value, `[REDACTED:${name}]`);
24
+ }
25
+ return output;
26
+ }
27
+ function classifyFailure(phase, outcome) {
28
+ if (outcome.exitCode === 0) return null;
29
+ const output = `${outcome.stdout}\n${outcome.stderr}`.replaceAll(/\u001B\[[0-9;]*m/g, "");
30
+ if (/Non-resolvable parent POM|Could not transfer artifact|Could not resolve (?:dependencies|artifact)|status code: 401|\bUnauthorized\b|PKIX path building failed|Name or service not known|Unknown host/i.test(output)) return "repository-access";
31
+ if (/Unable to find main class|mainClass.*(?:not found|missing)/i.test(output)) return "bootstrap-entrypoint";
32
+ if (/COMPILATION ERROR|Compilation failure|maven-compiler-plugin/i.test(output)) return "compilation";
33
+ if (phase === "validate") return "project-model";
34
+ if (phase === "test") return "test-failure";
35
+ if (phase === "package") return "packaging";
36
+ return "maven-execution";
37
+ }
13
38
  function parseArgs(argv) { const result = {}; for (let index = 0; index < argv.length; index += 1) { let token = argv[index]; if (token === "--help" || token === "-h") { result.help = true; continue; } const equals = token.indexOf("="); let value; if (equals !== -1) { value = token.slice(equals + 1); token = token.slice(0, equals); } if (!["--project-root", "--evidence-dir"].includes(token)) throw new Error(`不支持的参数: ${token}`); if (value === undefined) value = argv[++index]; if (!value || value.startsWith("--")) throw new Error(`参数 ${token} 缺少值`); result[token === "--project-root" ? "projectRoot" : "evidenceDir"] = path.resolve(value); } if (result.help) return result; if (!result.projectRoot || !result.evidenceDir) throw new Error("必须提供 --project-root 和 --evidence-dir"); return result; }
14
39
  function validateManifest(manifest) {
15
- const required = ["schema_version", "contract_id", "contract_version", "slice_id", "approval_ref", "approver", "lifecycle_approval_ref", "router_draft_ref", "persisted_ref", "contract_file_ref", "current_version", "allowed_write_paths", "expected_evidence_files", "verification_commands", "generation_mode"];
40
+ if (manifest.schema_version !== 2) throw new Error(`unsupported: scaffold Manifest schema_version=${manifest.schema_version};只验证 Target Profile v2`);
41
+ const required = ["schema_version", "contract_id", "contract_version", "scaffold_request_id", "contract_digest", "profiles", "ownership", "readiness", "generation_policy", "completion_level", "approval_ref", "approver", "lifecycle_approval_ref", "router_draft_ref", "persisted_ref", "contract_file_ref", "current_version", "allowed_write_paths", "expected_evidence_files", "verification_commands", "generation_mode"];
16
42
  const missing = required.filter((field) => manifest[field] === undefined || manifest[field] === null || manifest[field] === "");
17
43
  if (manifest.generation_mode !== "controlled-generation" || missing.length) throw new Error(`脚手架生成元数据清单不完整或不是 controlled-generation: ${missing.join(", ")}`);
44
+ if (manifest.profiles.architecture !== "target-domain-model" || manifest.generation_policy.mode !== "initialize-only" || manifest.generation_policy.existing_target !== "unsupported" || manifest.generation_policy.old_project_migration !== "unsupported" || manifest.generation_policy.template_upgrade !== "unsupported") throw new Error("Manifest v2 必须声明 Target Profile 与严格 initialize-only;已有目标、旧项目迁移和模板升级均须为 unsupported");
18
45
  if (manifest.current_version !== manifest.contract_version) throw new Error("脚手架生成元数据清单不是当前合同版本");
19
46
  if (JSON.stringify(manifest.verification_commands) !== JSON.stringify(COMMANDS)) throw new Error("脚手架生成元数据清单验证命令不符合固定合同");
20
47
  }
21
- function execute(wrapper, phase, cwd) { return new Promise((resolve) => { const child = spawn(wrapper, [phase], { cwd, stdio: ["ignore", "pipe", "pipe"] }); let stdout = "", stderr = ""; child.stdout.on("data", (chunk) => { stdout += chunk; }); child.stderr.on("data", (chunk) => { stderr += chunk; }); child.on("error", (error) => resolve({ exitCode: 127, stdout: "", stderr: String(error) })); child.on("close", (code) => resolve({ exitCode: code ?? 1, stdout, stderr })); }); }
22
- export async function run(projectRoot, evidenceDir) {
48
+ function execute(wrapper, phase, cwd, environment) { return new Promise((resolve) => { const child = spawn(wrapper, [phase], { cwd, env: environment, stdio: ["ignore", "pipe", "pipe"] }); let stdout = "", stderr = ""; child.stdout.on("data", (chunk) => { stdout += chunk; }); child.stderr.on("data", (chunk) => { stderr += chunk; }); child.on("error", (error) => resolve({ exitCode: 127, stdout: "", stderr: String(error) })); child.on("close", (code) => resolve({ exitCode: code ?? 1, stdout, stderr })); }); }
49
+ export async function run(projectRoot, evidenceDir, environment = process.env) {
23
50
  const wrapper = path.join(projectRoot, "mvnw"), manifestPath = path.join(projectRoot, ".yss", "scaffold-generation.json");
24
51
  if (!await isFile(wrapper)) throw new Error(`项目根目录缺少 Maven wrapper: ${wrapper}`);
25
52
  if (!await isFile(manifestPath)) throw new Error(`项目根目录缺少脚手架生成元数据清单: ${manifestPath}`);
26
53
  let manifest; try { manifest = JSON.parse(await readFile(manifestPath, "utf8")); } catch { throw new Error(`脚手架生成元数据清单无法读取或不是合法 JSON: ${manifestPath}`); }
27
- validateManifest(manifest); await mkdir(evidenceDir, { recursive: true }); const commands = [];
28
- for (const phase of PHASES) { const stdoutPath = path.join(evidenceDir, `mvnw-${phase}.stdout.log`), stderrPath = path.join(evidenceDir, `mvnw-${phase}.stderr.log`), startedAt = isoNow(), started = process.hrtime.bigint(); const outcome = await execute(wrapper, phase, projectRoot); const durationMs = Number(process.hrtime.bigint() - started) / 1e6; await writeText(stdoutPath, outcome.stdout); await writeText(stderrPath, outcome.stderr); commands.push({ command: `./mvnw ${phase}`, phase, exit_code: outcome.exitCode, duration_ms: Number(durationMs.toFixed(3)), started_at: startedAt, executed_at: isoNow(), stdout_ref: stdoutPath, stderr_ref: stderrPath }); }
29
- return { verification_mode: "controlled-generation", project_root: projectRoot, scaffold_manifest_ref: manifestPath, generated_at: isoNow(), status: commands.every((item) => item.exit_code === 0) ? "passed" : "failed", commands };
54
+ validateManifest(manifest);
55
+ await mkdir(evidenceDir, { recursive: true });
56
+ const mavenConfig = await readTextIfPresent(path.join(projectRoot, ".mvn", "maven.config"));
57
+ const preflight = {
58
+ wrapper_exists: true,
59
+ wrapper_executable: await isExecutable(wrapper),
60
+ java_home_configured: configured(environment.JAVA_HOME),
61
+ maven_repository_credentials_configured: configured(environment.MAVEN_REPO_USERNAME) && configured(environment.MAVEN_REPO_PASSWORD),
62
+ maven_repository_url_configured: configured(environment.YSS_MAVEN_REPOSITORY_URL),
63
+ project_settings_present: await isFile(path.join(projectRoot, ".mvn", "settings.xml")),
64
+ project_maven_config_present: await isFile(path.join(projectRoot, ".mvn", "maven.config")),
65
+ project_settings_wired: /(?:^|\s)-(?:s|-settings)\s+\.mvn\/settings\.xml(?:\s|$)/m.test(mavenConfig),
66
+ repository_profile: manifest.profiles.repository,
67
+ repository_profile_wired: /(?:^|\s)-(?:P|-activate-profiles)\s+yss-internal(?:\s|$)/m.test(mavenConfig),
68
+ maven_coordinates_source: manifest.maven_coordinates_source
69
+ };
70
+ const failed = [];
71
+ if (!preflight.wrapper_executable) failed.push("wrapper-not-executable");
72
+ if (!preflight.project_settings_present || !preflight.project_maven_config_present || !preflight.project_settings_wired || !preflight.repository_profile_wired) failed.push("repository-profile-not-wired");
73
+ if (!preflight.maven_repository_url_configured) failed.push("repository-url-not-configured");
74
+ if (!preflight.maven_repository_credentials_configured) failed.push("repository-credentials-not-configured");
75
+ if (failed.length) return { verification_mode: "controlled-generation", project_root: projectRoot, scaffold_manifest_ref: manifestPath, generated_at: isoNow(), status: "failed", failure_category: "verification-preflight", completion_level: "generated", preflight: { ...preflight, failures: failed }, commands: [] };
76
+ const commands = [];
77
+ for (const phase of PHASES) {
78
+ const stdoutPath = path.join(evidenceDir, `mvnw-${phase}.stdout.log`);
79
+ const stderrPath = path.join(evidenceDir, `mvnw-${phase}.stderr.log`);
80
+ const startedAt = isoNow();
81
+ const started = process.hrtime.bigint();
82
+ const outcome = await execute(wrapper, phase, projectRoot, environment);
83
+ const durationMs = Number(process.hrtime.bigint() - started) / 1e6;
84
+ await writeText(stdoutPath, redactSecrets(outcome.stdout, environment));
85
+ await writeText(stderrPath, redactSecrets(outcome.stderr, environment));
86
+ commands.push({
87
+ command: `./mvnw ${phase}`,
88
+ phase,
89
+ exit_code: outcome.exitCode,
90
+ failure_category: classifyFailure(phase, outcome),
91
+ duration_ms: Number(durationMs.toFixed(3)),
92
+ started_at: startedAt,
93
+ executed_at: isoNow(),
94
+ stdout_ref: stdoutPath,
95
+ stderr_ref: stderrPath
96
+ });
97
+ }
98
+ const failureCategory = commands.find((item) => item.failure_category)?.failure_category ?? null;
99
+ return {
100
+ verification_mode: "controlled-generation",
101
+ project_root: projectRoot,
102
+ scaffold_manifest_ref: manifestPath,
103
+ generated_at: isoNow(),
104
+ status: failureCategory === null ? "passed" : "failed",
105
+ failure_category: failureCategory,
106
+ completion_level: failureCategory === null ? "empty-scaffold-verified" : "generated",
107
+ preflight,
108
+ commands
109
+ };
30
110
  }
31
- async function main() { let args; try { args = parseArgs(process.argv.slice(2)); if (args.help) { console.log("运行 YSS 脚手架真实验证命令\n用法: node scripts/run_scaffold_verification.mjs --project-root <dir> --evidence-dir <dir>"); return 0; } const reportPath = path.join(args.evidenceDir, "scaffold-verification.json"); try { const report = await run(args.projectRoot, args.evidenceDir); await writeText(reportPath, `${JSON.stringify(report, null, 2)}\n`); console.log(`${report.status}: ${reportPath}`); return report.status === "passed" ? 0 : 1; } catch (error) { const report = { verification_mode: "controlled-generation", project_root: args.projectRoot, generated_at: isoNow(), status: "failed", error: error.message, commands: [] }; await writeText(reportPath, `${JSON.stringify(report, null, 2)}\n`); process.stderr.write(`❌ 脚手架验证无法执行: ${error.message}\n`); return 1; } } catch (error) { process.stderr.write(`❌ 脚手架验证无法执行: ${error.message}\n`); return 1; } }
111
+ async function main() { let args; try { args = parseArgs(process.argv.slice(2)); if (args.help) { console.log("运行 YSS 脚手架真实验证命令\n用法: node scripts/run_scaffold_verification.mjs --project-root <dir> --evidence-dir <dir>"); return 0; } const reportPath = path.join(args.evidenceDir, "scaffold-verification.json"); try { const report = await run(args.projectRoot, args.evidenceDir); await writeText(reportPath, `${JSON.stringify(report, null, 2)}\n`); console.log(`${report.status}: ${reportPath}`); return report.status === "passed" ? 0 : 1; } catch (error) { const report = { verification_mode: "controlled-generation", project_root: args.projectRoot, generated_at: isoNow(), status: "failed", failure_category: "verification-preflight", error: error.message, commands: [] }; await writeText(reportPath, `${JSON.stringify(report, null, 2)}\n`); process.stderr.write(`❌ 脚手架验证无法执行: ${error.message}\n`); return 1; } } catch (error) { process.stderr.write(`❌ 脚手架验证无法执行: ${error.message}\n`); return 1; } }
32
112
  if (process.argv[1] && import.meta.url === new URL(`file://${process.argv[1]}`).href) process.exitCode = await main();