create-yss-spec 3.4.7 → 3.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/template/.agents/skills/.strategic-design-skills-manifest.json +5 -5
  4. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +2 -2
  5. package/template/.agents/skills/archify/SKILL.md +2 -19
  6. package/template/.agents/skills/archify/references/geometry-and-routing.md +20 -0
  7. package/template/.agents/skills/code-review/SKILL.md +3 -33
  8. package/template/.agents/skills/code-review/references/candidate-capture.md +33 -0
  9. package/template/.agents/skills/code-review/references/yss-review-standards.md +20 -0
  10. package/template/.agents/skills/codebase-design/SKILL.md +2 -2
  11. package/template/.agents/skills/competitive-intelligence/SKILL.md +1 -1
  12. package/template/.agents/skills/diagnosing-bugs/SKILL.md +6 -2
  13. package/template/.agents/skills/formily-foundation/SKILL.md +1 -1
  14. package/template/.agents/skills/formily-step-flow/SKILL.md +3 -2
  15. package/template/.agents/skills/frontend-commit/SKILL.md +6 -6
  16. package/template/.agents/skills/grilling/SKILL.md +2 -2
  17. package/template/.agents/skills/implement/SKILL.md +1 -1
  18. package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +3 -3
  19. package/template/.agents/skills/implementation-repo-onboarding/references/write-scope.md +5 -0
  20. package/template/.agents/skills/improve-codebase-architecture/SKILL.md +10 -6
  21. package/template/.agents/skills/java-backend-commit/SKILL.md +5 -5
  22. package/template/.agents/skills/llm-wiki/SKILL.md +1 -1
  23. package/template/.agents/skills/lombok/SKILL.md +1 -1
  24. package/template/.agents/skills/mapstruct/SKILL.md +3 -1
  25. package/template/.agents/skills/prototype/SKILL.md +1 -1
  26. package/template/.agents/skills/prototype-review/SKILL.md +1 -1
  27. package/template/.agents/skills/resolving-merge-conflicts/SKILL.md +2 -2
  28. package/template/.agents/skills/tdd/SKILL.md +1 -1
  29. package/template/.agents/skills/to-questionnaire/SKILL.md +4 -2
  30. package/template/.agents/skills/to-spec/SKILL.md +3 -3
  31. package/template/.agents/skills/to-tickets/SKILL.md +7 -7
  32. package/template/.agents/skills/using-git-worktrees/SKILL.md +13 -11
  33. package/template/.agents/skills/wait-what/SKILL.md +1 -1
  34. package/template/.agents/skills/wayfinder/SKILL.md +4 -2
  35. package/template/.agents/skills/writing-for-agents/SKILL.md +9 -73
  36. package/template/.agents/skills/writing-for-agents/references/writing-principles.md +76 -0
  37. package/template/.agents/skills/yss-api-integration/SKILL.md +2 -2
  38. package/template/.agents/skills/yss-application/SKILL.md +12 -0
  39. package/template/.agents/skills/yss-application/references/application-layer-guide.md +7 -0
  40. package/template/.agents/skills/yss-audit-log/SKILL.md +3 -1
  41. package/template/.agents/skills/yss-audit-log/assets/AuditLogAspect.java +1 -0
  42. package/template/.agents/skills/yss-audit-log/assets/YssAuditLogPrintSubscriberImpl.java +1 -0
  43. package/template/.agents/skills/yss-audit-log/assets/YssAuditLogSysManagerSubscriberImpl.java +1 -0
  44. package/template/.agents/skills/yss-audit-log/assets/YssAuditPublishService.java +1 -0
  45. package/template/.agents/skills/yss-backend-spec-review/SKILL.md +44 -0
  46. package/template/.agents/skills/yss-backend-spec-review/references/check-inputs.md +21 -0
  47. package/template/.agents/skills/yss-backend-spec-review/references/remediation-workflow.md +48 -0
  48. package/template/.agents/skills/yss-backend-spec-review/references/standards-coverage.md +39 -0
  49. package/template/.agents/skills/yss-backend-spec-review/tests/routing.test.mjs +19 -0
  50. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -34
  51. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +60 -23
  52. package/template/.agents/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +6 -0
  53. package/template/.agents/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +1 -1
  54. package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +4 -2
  55. package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +32 -0
  56. package/template/.agents/skills/yss-ddd-scaffold-generator/references/engineering-baseline.md +7 -1
  57. package/template/.agents/skills/yss-ddd-scaffold-generator/references/generator-maintenance.md +7 -0
  58. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +6 -10
  59. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/first-slice-verification.test.mjs +12 -16
  60. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/run_first_slice_verification.mjs +36 -87
  61. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +4 -3
  62. package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
  63. package/template/.agents/skills/yss-domain/SKILL.md +17 -5
  64. package/template/.agents/skills/yss-domain/references/domain-layer-guide.md +10 -3
  65. package/template/.agents/skills/yss-domain/references/existing-project.md +5 -0
  66. package/template/.agents/skills/yss-dto/SKILL.md +13 -10
  67. package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +14 -0
  68. package/template/.agents/skills/yss-exception/SKILL.md +2 -2
  69. package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +12 -12
  70. package/template/.agents/skills/yss-hook/SKILL.md +8 -44
  71. package/template/.agents/skills/yss-hook/references/use-request.md +42 -0
  72. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +1 -5
  73. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
  74. package/template/.agents/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +7 -0
  75. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +5 -1
  76. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  77. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/assets/templates/architecture-rules-test.java.template +66 -0
  78. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +4 -2
  79. package/template/.agents/skills/yss-mybatis/SKILL.md +14 -0
  80. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +1 -1
  81. package/template/.agents/skills/yss-openapi-governance/SKILL.md +1 -32
  82. package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +34 -0
  83. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +1 -1
  84. package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
  85. package/template/.agents/skills/yss-prototype-stage/references/existing-ui-entry.md +7 -0
  86. package/template/.agents/skills/yss-repository/SKILL.md +13 -1
  87. package/template/.agents/skills/yss-repository/references/profiles/existing-domain-driven-maven.md +7 -0
  88. package/template/.agents/skills/yss-repository/references/profiles/existing-layered-mvc-maven.md +7 -0
  89. package/template/.agents/skills/yss-repository/references/profiles/target-domain-model.md +10 -2
  90. package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +3 -1
  91. package/template/.agents/skills/yss-stage-decision/SKILL.md +1 -1
  92. package/template/.agents/skills/yss-stage-decision/references/strategic-handoff-routing.md +3 -0
  93. package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -3
  94. package/template/.agents/skills/yss-tactical-design/references/strategic-handoff-routing.md +5 -0
  95. package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +5 -3
  96. package/template/.agents/skills/yss-validation/SKILL.md +1 -1
  97. package/template/.agents/skills/yss-web-controller/SKILL.md +16 -7
  98. package/template/.agents/skills/yss-web-controller/references/web-adapter-layer-guide.md +8 -0
  99. package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
  100. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +2 -2
  101. package/template/.codex/skills/archify/SKILL.md +2 -19
  102. package/template/.codex/skills/archify/references/geometry-and-routing.md +20 -0
  103. package/template/.codex/skills/code-review/SKILL.md +3 -33
  104. package/template/.codex/skills/code-review/references/candidate-capture.md +33 -0
  105. package/template/.codex/skills/code-review/references/yss-review-standards.md +20 -0
  106. package/template/.codex/skills/codebase-design/SKILL.md +2 -2
  107. package/template/.codex/skills/competitive-intelligence/SKILL.md +1 -1
  108. package/template/.codex/skills/data-analytics/mcp/server.cjs +2 -1
  109. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/SKILL.md +9 -32
  110. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/references/quality-checks.md +29 -0
  111. package/template/.codex/skills/data-analytics/skills/build-dashboard/SKILL.md +1 -1
  112. package/template/.codex/skills/data-analytics/skills/build-report/SKILL.md +4 -4
  113. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/SKILL.md +12 -22
  114. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/cli.py +5 -10
  115. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/plan.py +47 -49
  116. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/tests/test_delivery_plan.py +45 -0
  117. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/SKILL.md +4 -5
  118. package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/SKILL.md +1 -1
  119. package/template/.codex/skills/data-analytics/skills/build-report/specifications/mcp-app-report.md +1 -1
  120. package/template/.codex/skills/data-analytics/skills/design-kpis/SKILL.md +1 -1
  121. package/template/.codex/skills/data-analytics/skills/gather-business-context/SKILL.md +1 -1
  122. package/template/.codex/skills/data-analytics/skills/index/SKILL.md +4 -4
  123. package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/SKILL.md +1 -1
  124. package/template/.codex/skills/data-analytics/skills/kpi-reporting/SKILL.md +2 -2
  125. package/template/.codex/skills/data-analytics/skills/market-sizing/SKILL.md +1 -1
  126. package/template/.codex/skills/data-analytics/skills/metric-diagnostics/SKILL.md +1 -1
  127. package/template/.codex/skills/data-analytics/skills/product-business-analysis/SKILL.md +1 -1
  128. package/template/.codex/skills/data-analytics/skills/spreadsheets/SKILL.md +4 -4
  129. package/template/.codex/skills/data-analytics/skills/user-context/SKILL.md +16 -14
  130. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/automation-config.md +1 -1
  131. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-examples.md +1 -1
  132. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding.md +7 -7
  133. package/template/.codex/skills/data-analytics/skills/user-context/references/source-category-runtime.md +7 -7
  134. package/template/.codex/skills/data-analytics/skills/user-context/scripts/data_analytics_preflight.py +4 -2
  135. package/template/.codex/skills/data-analytics/skills/user-context/scripts/validate_user_context_preflight.py +5 -5
  136. package/template/.codex/skills/data-analytics/skills/user-context/tests/test_state_helpers.py +3 -3
  137. package/template/.codex/skills/data-analytics/skills/validate-data/SKILL.md +7 -71
  138. package/template/.codex/skills/data-analytics/skills/validate-data/references/validation-methods.md +70 -0
  139. package/template/.codex/skills/data-analytics/skills/visualize-data/SKILL.md +4 -4
  140. package/template/.codex/skills/data-analytics/src/analytics-app/App.tsx +1 -1
  141. package/template/.codex/skills/data-analytics/src/analytics-app-core.md +1 -1
  142. package/template/.codex/skills/diagnosing-bugs/SKILL.md +6 -2
  143. package/template/.codex/skills/formily-foundation/SKILL.md +1 -1
  144. package/template/.codex/skills/formily-step-flow/SKILL.md +3 -2
  145. package/template/.codex/skills/frontend-commit/SKILL.md +6 -6
  146. package/template/.codex/skills/grilling/SKILL.md +2 -2
  147. package/template/.codex/skills/implement/SKILL.md +1 -1
  148. package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +3 -3
  149. package/template/.codex/skills/implementation-repo-onboarding/references/write-scope.md +5 -0
  150. package/template/.codex/skills/improve-codebase-architecture/SKILL.md +10 -6
  151. package/template/.codex/skills/java-backend-commit/SKILL.md +5 -5
  152. package/template/.codex/skills/llm-wiki/SKILL.md +1 -1
  153. package/template/.codex/skills/lombok/SKILL.md +1 -1
  154. package/template/.codex/skills/mapstruct/SKILL.md +3 -1
  155. package/template/.codex/skills/product-design/references/critical-overrides.md +3 -4
  156. package/template/.codex/skills/product-design/skills/audit/SKILL.md +1 -1
  157. package/template/.codex/skills/product-design/skills/design-qa/SKILL.md +1 -1
  158. package/template/.codex/skills/product-design/skills/get-context/SKILL.md +2 -1
  159. package/template/.codex/skills/product-design/skills/ideate/SKILL.md +2 -50
  160. package/template/.codex/skills/product-design/skills/ideate/references/image-prompt-patterns.md +51 -0
  161. package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +6 -6
  162. package/template/.codex/skills/product-design/skills/index/SKILL.md +2 -2
  163. package/template/.codex/skills/product-design/skills/prototype/SKILL.md +6 -6
  164. package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +1 -1
  165. package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
  166. package/template/.codex/skills/prototype/SKILL.md +1 -1
  167. package/template/.codex/skills/prototype-review/SKILL.md +1 -1
  168. package/template/.codex/skills/resolving-merge-conflicts/SKILL.md +2 -2
  169. package/template/.codex/skills/tdd/SKILL.md +1 -1
  170. package/template/.codex/skills/to-questionnaire/SKILL.md +4 -2
  171. package/template/.codex/skills/to-spec/SKILL.md +3 -3
  172. package/template/.codex/skills/to-tickets/SKILL.md +7 -7
  173. package/template/.codex/skills/using-git-worktrees/SKILL.md +13 -11
  174. package/template/.codex/skills/wait-what/SKILL.md +1 -1
  175. package/template/.codex/skills/wayfinder/SKILL.md +4 -2
  176. package/template/.codex/skills/writing-for-agents/SKILL.md +9 -73
  177. package/template/.codex/skills/writing-for-agents/references/writing-principles.md +76 -0
  178. package/template/.codex/skills/yss-api-integration/SKILL.md +2 -2
  179. package/template/.codex/skills/yss-application/SKILL.md +12 -0
  180. package/template/.codex/skills/yss-application/references/application-layer-guide.md +7 -0
  181. package/template/.codex/skills/yss-audit-log/SKILL.md +3 -1
  182. package/template/.codex/skills/yss-audit-log/assets/AuditLogAspect.java +1 -0
  183. package/template/.codex/skills/yss-audit-log/assets/YssAuditLogPrintSubscriberImpl.java +1 -0
  184. package/template/.codex/skills/yss-audit-log/assets/YssAuditLogSysManagerSubscriberImpl.java +1 -0
  185. package/template/.codex/skills/yss-audit-log/assets/YssAuditPublishService.java +1 -0
  186. package/template/.codex/skills/yss-backend-spec-review/SKILL.md +44 -0
  187. package/template/.codex/skills/yss-backend-spec-review/references/check-inputs.md +21 -0
  188. package/template/.codex/skills/yss-backend-spec-review/references/remediation-workflow.md +48 -0
  189. package/template/.codex/skills/yss-backend-spec-review/references/standards-coverage.md +39 -0
  190. package/template/.codex/skills/yss-backend-spec-review/tests/routing.test.mjs +19 -0
  191. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -34
  192. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +60 -23
  193. package/template/.codex/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +6 -0
  194. package/template/.codex/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +1 -1
  195. package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +4 -2
  196. package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +32 -0
  197. package/template/.codex/skills/yss-ddd-scaffold-generator/references/engineering-baseline.md +7 -1
  198. package/template/.codex/skills/yss-ddd-scaffold-generator/references/generator-maintenance.md +7 -0
  199. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +6 -10
  200. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/first-slice-verification.test.mjs +12 -16
  201. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/run_first_slice_verification.mjs +36 -87
  202. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +4 -3
  203. package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
  204. package/template/.codex/skills/yss-domain/SKILL.md +17 -5
  205. package/template/.codex/skills/yss-domain/references/domain-layer-guide.md +10 -3
  206. package/template/.codex/skills/yss-domain/references/existing-project.md +5 -0
  207. package/template/.codex/skills/yss-dto/SKILL.md +13 -10
  208. package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +14 -0
  209. package/template/.codex/skills/yss-exception/SKILL.md +2 -2
  210. package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +12 -12
  211. package/template/.codex/skills/yss-hook/SKILL.md +8 -44
  212. package/template/.codex/skills/yss-hook/references/use-request.md +42 -0
  213. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +1 -5
  214. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
  215. package/template/.codex/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +7 -0
  216. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +5 -1
  217. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  218. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/assets/templates/architecture-rules-test.java.template +66 -0
  219. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +4 -2
  220. package/template/.codex/skills/yss-mybatis/SKILL.md +14 -0
  221. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +1 -1
  222. package/template/.codex/skills/yss-openapi-governance/SKILL.md +1 -32
  223. package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +34 -0
  224. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +1 -1
  225. package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
  226. package/template/.codex/skills/yss-prototype-stage/references/existing-ui-entry.md +7 -0
  227. package/template/.codex/skills/yss-repository/SKILL.md +13 -1
  228. package/template/.codex/skills/yss-repository/references/profiles/existing-domain-driven-maven.md +7 -0
  229. package/template/.codex/skills/yss-repository/references/profiles/existing-layered-mvc-maven.md +7 -0
  230. package/template/.codex/skills/yss-repository/references/profiles/target-domain-model.md +10 -2
  231. package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +3 -1
  232. package/template/.codex/skills/yss-stage-decision/SKILL.md +1 -1
  233. package/template/.codex/skills/yss-stage-decision/references/strategic-handoff-routing.md +3 -0
  234. package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -3
  235. package/template/.codex/skills/yss-tactical-design/references/strategic-handoff-routing.md +5 -0
  236. package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +5 -3
  237. package/template/.codex/skills/yss-validation/SKILL.md +1 -1
  238. package/template/.codex/skills/yss-web-controller/SKILL.md +16 -7
  239. package/template/.codex/skills/yss-web-controller/references/web-adapter-layer-guide.md +8 -0
  240. package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
  241. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +2 -2
  242. package/template/.cursor/skills/archify/SKILL.md +2 -19
  243. package/template/.cursor/skills/archify/references/geometry-and-routing.md +20 -0
  244. package/template/.cursor/skills/code-review/SKILL.md +3 -33
  245. package/template/.cursor/skills/code-review/references/candidate-capture.md +33 -0
  246. package/template/.cursor/skills/code-review/references/yss-review-standards.md +20 -0
  247. package/template/.cursor/skills/codebase-design/SKILL.md +2 -2
  248. package/template/.cursor/skills/competitive-intelligence/SKILL.md +1 -1
  249. package/template/.cursor/skills/diagnosing-bugs/SKILL.md +6 -2
  250. package/template/.cursor/skills/formily-foundation/SKILL.md +1 -1
  251. package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -2
  252. package/template/.cursor/skills/frontend-commit/SKILL.md +6 -6
  253. package/template/.cursor/skills/grilling/SKILL.md +2 -2
  254. package/template/.cursor/skills/implement/SKILL.md +1 -1
  255. package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +3 -3
  256. package/template/.cursor/skills/implementation-repo-onboarding/references/write-scope.md +5 -0
  257. package/template/.cursor/skills/improve-codebase-architecture/SKILL.md +10 -6
  258. package/template/.cursor/skills/java-backend-commit/SKILL.md +5 -5
  259. package/template/.cursor/skills/llm-wiki/SKILL.md +1 -1
  260. package/template/.cursor/skills/lombok/SKILL.md +1 -1
  261. package/template/.cursor/skills/mapstruct/SKILL.md +3 -1
  262. package/template/.cursor/skills/prototype/SKILL.md +1 -1
  263. package/template/.cursor/skills/prototype-review/SKILL.md +1 -1
  264. package/template/.cursor/skills/resolving-merge-conflicts/SKILL.md +2 -2
  265. package/template/.cursor/skills/tdd/SKILL.md +1 -1
  266. package/template/.cursor/skills/to-questionnaire/SKILL.md +4 -2
  267. package/template/.cursor/skills/to-spec/SKILL.md +3 -3
  268. package/template/.cursor/skills/to-tickets/SKILL.md +7 -7
  269. package/template/.cursor/skills/using-git-worktrees/SKILL.md +13 -11
  270. package/template/.cursor/skills/wait-what/SKILL.md +1 -1
  271. package/template/.cursor/skills/wayfinder/SKILL.md +4 -2
  272. package/template/.cursor/skills/writing-for-agents/SKILL.md +9 -73
  273. package/template/.cursor/skills/writing-for-agents/references/writing-principles.md +76 -0
  274. package/template/.cursor/skills/yss-api-integration/SKILL.md +2 -2
  275. package/template/.cursor/skills/yss-application/SKILL.md +12 -0
  276. package/template/.cursor/skills/yss-application/references/application-layer-guide.md +7 -0
  277. package/template/.cursor/skills/yss-audit-log/SKILL.md +3 -1
  278. package/template/.cursor/skills/yss-audit-log/assets/AuditLogAspect.java +1 -0
  279. package/template/.cursor/skills/yss-audit-log/assets/YssAuditLogPrintSubscriberImpl.java +1 -0
  280. package/template/.cursor/skills/yss-audit-log/assets/YssAuditLogSysManagerSubscriberImpl.java +1 -0
  281. package/template/.cursor/skills/yss-audit-log/assets/YssAuditPublishService.java +1 -0
  282. package/template/.cursor/skills/yss-backend-spec-review/SKILL.md +44 -0
  283. package/template/.cursor/skills/yss-backend-spec-review/references/check-inputs.md +21 -0
  284. package/template/.cursor/skills/yss-backend-spec-review/references/remediation-workflow.md +48 -0
  285. package/template/.cursor/skills/yss-backend-spec-review/references/standards-coverage.md +39 -0
  286. package/template/.cursor/skills/yss-backend-spec-review/tests/routing.test.mjs +19 -0
  287. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -34
  288. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +60 -23
  289. package/template/.cursor/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +6 -0
  290. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +1 -1
  291. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +4 -2
  292. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +32 -0
  293. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/engineering-baseline.md +7 -1
  294. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/generator-maintenance.md +7 -0
  295. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +6 -10
  296. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/first-slice-verification.test.mjs +12 -16
  297. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/run_first_slice_verification.mjs +36 -87
  298. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +4 -3
  299. package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
  300. package/template/.cursor/skills/yss-domain/SKILL.md +17 -5
  301. package/template/.cursor/skills/yss-domain/references/domain-layer-guide.md +10 -3
  302. package/template/.cursor/skills/yss-domain/references/existing-project.md +5 -0
  303. package/template/.cursor/skills/yss-dto/SKILL.md +13 -10
  304. package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +14 -0
  305. package/template/.cursor/skills/yss-exception/SKILL.md +2 -2
  306. package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +12 -12
  307. package/template/.cursor/skills/yss-hook/SKILL.md +8 -44
  308. package/template/.cursor/skills/yss-hook/references/use-request.md +42 -0
  309. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +1 -5
  310. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
  311. package/template/.cursor/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +7 -0
  312. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +5 -1
  313. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  314. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/assets/templates/architecture-rules-test.java.template +66 -0
  315. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +4 -2
  316. package/template/.cursor/skills/yss-mybatis/SKILL.md +14 -0
  317. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +1 -1
  318. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +1 -32
  319. package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +34 -0
  320. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +1 -1
  321. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
  322. package/template/.cursor/skills/yss-prototype-stage/references/existing-ui-entry.md +7 -0
  323. package/template/.cursor/skills/yss-repository/SKILL.md +13 -1
  324. package/template/.cursor/skills/yss-repository/references/profiles/existing-domain-driven-maven.md +7 -0
  325. package/template/.cursor/skills/yss-repository/references/profiles/existing-layered-mvc-maven.md +7 -0
  326. package/template/.cursor/skills/yss-repository/references/profiles/target-domain-model.md +10 -2
  327. package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +3 -1
  328. package/template/.cursor/skills/yss-stage-decision/SKILL.md +1 -1
  329. package/template/.cursor/skills/yss-stage-decision/references/strategic-handoff-routing.md +3 -0
  330. package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -3
  331. package/template/.cursor/skills/yss-tactical-design/references/strategic-handoff-routing.md +5 -0
  332. package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +5 -3
  333. package/template/.cursor/skills/yss-validation/SKILL.md +1 -1
  334. package/template/.cursor/skills/yss-web-controller/SKILL.md +16 -7
  335. package/template/.cursor/skills/yss-web-controller/references/web-adapter-layer-guide.md +8 -0
  336. package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
  337. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +2 -2
  338. package/template/.pi/skills/archify/SKILL.md +2 -19
  339. package/template/.pi/skills/archify/references/geometry-and-routing.md +20 -0
  340. package/template/.pi/skills/code-review/SKILL.md +3 -33
  341. package/template/.pi/skills/code-review/references/candidate-capture.md +33 -0
  342. package/template/.pi/skills/code-review/references/yss-review-standards.md +20 -0
  343. package/template/.pi/skills/codebase-design/SKILL.md +2 -2
  344. package/template/.pi/skills/competitive-intelligence/SKILL.md +1 -1
  345. package/template/.pi/skills/diagnosing-bugs/SKILL.md +6 -2
  346. package/template/.pi/skills/formily-foundation/SKILL.md +1 -1
  347. package/template/.pi/skills/formily-step-flow/SKILL.md +3 -2
  348. package/template/.pi/skills/frontend-commit/SKILL.md +6 -6
  349. package/template/.pi/skills/grilling/SKILL.md +2 -2
  350. package/template/.pi/skills/implement/SKILL.md +1 -1
  351. package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +3 -3
  352. package/template/.pi/skills/implementation-repo-onboarding/references/write-scope.md +5 -0
  353. package/template/.pi/skills/improve-codebase-architecture/SKILL.md +10 -6
  354. package/template/.pi/skills/java-backend-commit/SKILL.md +5 -5
  355. package/template/.pi/skills/llm-wiki/SKILL.md +1 -1
  356. package/template/.pi/skills/lombok/SKILL.md +1 -1
  357. package/template/.pi/skills/mapstruct/SKILL.md +3 -1
  358. package/template/.pi/skills/prototype/SKILL.md +1 -1
  359. package/template/.pi/skills/prototype-review/SKILL.md +1 -1
  360. package/template/.pi/skills/resolving-merge-conflicts/SKILL.md +2 -2
  361. package/template/.pi/skills/tdd/SKILL.md +1 -1
  362. package/template/.pi/skills/to-questionnaire/SKILL.md +4 -2
  363. package/template/.pi/skills/to-spec/SKILL.md +3 -3
  364. package/template/.pi/skills/to-tickets/SKILL.md +7 -7
  365. package/template/.pi/skills/using-git-worktrees/SKILL.md +13 -11
  366. package/template/.pi/skills/wait-what/SKILL.md +1 -1
  367. package/template/.pi/skills/wayfinder/SKILL.md +4 -2
  368. package/template/.pi/skills/writing-for-agents/SKILL.md +9 -73
  369. package/template/.pi/skills/writing-for-agents/references/writing-principles.md +76 -0
  370. package/template/.pi/skills/yss-api-integration/SKILL.md +2 -2
  371. package/template/.pi/skills/yss-application/SKILL.md +12 -0
  372. package/template/.pi/skills/yss-application/references/application-layer-guide.md +7 -0
  373. package/template/.pi/skills/yss-audit-log/SKILL.md +3 -1
  374. package/template/.pi/skills/yss-audit-log/assets/AuditLogAspect.java +1 -0
  375. package/template/.pi/skills/yss-audit-log/assets/YssAuditLogPrintSubscriberImpl.java +1 -0
  376. package/template/.pi/skills/yss-audit-log/assets/YssAuditLogSysManagerSubscriberImpl.java +1 -0
  377. package/template/.pi/skills/yss-audit-log/assets/YssAuditPublishService.java +1 -0
  378. package/template/.pi/skills/yss-backend-spec-review/SKILL.md +44 -0
  379. package/template/.pi/skills/yss-backend-spec-review/references/check-inputs.md +21 -0
  380. package/template/.pi/skills/yss-backend-spec-review/references/remediation-workflow.md +48 -0
  381. package/template/.pi/skills/yss-backend-spec-review/references/standards-coverage.md +39 -0
  382. package/template/.pi/skills/yss-backend-spec-review/tests/routing.test.mjs +19 -0
  383. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -34
  384. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/java/architecture-rules-test.java.template +60 -23
  385. package/template/.pi/skills/yss-ddd-scaffold-generator/assets/templates/pom/bootstrap-pom.xml.template +6 -0
  386. package/template/.pi/skills/yss-ddd-scaffold-generator/references/ARCHITECTURE.md +1 -1
  387. package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +4 -2
  388. package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +32 -0
  389. package/template/.pi/skills/yss-ddd-scaffold-generator/references/engineering-baseline.md +7 -1
  390. package/template/.pi/skills/yss-ddd-scaffold-generator/references/generator-maintenance.md +7 -0
  391. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/first-slice-compatibility.test.mjs +6 -10
  392. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/first-slice-verification.test.mjs +12 -16
  393. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/run_first_slice_verification.mjs +36 -87
  394. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +4 -3
  395. package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
  396. package/template/.pi/skills/yss-domain/SKILL.md +17 -5
  397. package/template/.pi/skills/yss-domain/references/domain-layer-guide.md +10 -3
  398. package/template/.pi/skills/yss-domain/references/existing-project.md +5 -0
  399. package/template/.pi/skills/yss-dto/SKILL.md +13 -10
  400. package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +14 -0
  401. package/template/.pi/skills/yss-exception/SKILL.md +2 -2
  402. package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +12 -12
  403. package/template/.pi/skills/yss-hook/SKILL.md +8 -44
  404. package/template/.pi/skills/yss-hook/references/use-request.md +42 -0
  405. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +1 -5
  406. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
  407. package/template/.pi/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +7 -0
  408. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +5 -1
  409. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  410. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/assets/templates/architecture-rules-test.java.template +66 -0
  411. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +4 -2
  412. package/template/.pi/skills/yss-mybatis/SKILL.md +14 -0
  413. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +1 -1
  414. package/template/.pi/skills/yss-openapi-governance/SKILL.md +1 -32
  415. package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +34 -0
  416. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +1 -1
  417. package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
  418. package/template/.pi/skills/yss-prototype-stage/references/existing-ui-entry.md +7 -0
  419. package/template/.pi/skills/yss-repository/SKILL.md +13 -1
  420. package/template/.pi/skills/yss-repository/references/profiles/existing-domain-driven-maven.md +7 -0
  421. package/template/.pi/skills/yss-repository/references/profiles/existing-layered-mvc-maven.md +7 -0
  422. package/template/.pi/skills/yss-repository/references/profiles/target-domain-model.md +10 -2
  423. package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +3 -1
  424. package/template/.pi/skills/yss-stage-decision/SKILL.md +1 -1
  425. package/template/.pi/skills/yss-stage-decision/references/strategic-handoff-routing.md +3 -0
  426. package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -3
  427. package/template/.pi/skills/yss-tactical-design/references/strategic-handoff-routing.md +5 -0
  428. package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +5 -3
  429. package/template/.pi/skills/yss-validation/SKILL.md +1 -1
  430. package/template/.pi/skills/yss-web-controller/SKILL.md +16 -7
  431. package/template/.pi/skills/yss-web-controller/references/web-adapter-layer-guide.md +8 -0
  432. package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
  433. package/template/docs/agents/yss-skill-registry.yaml +13 -0
  434. package/template/docs/engineering/backend-platforms.md +14 -0
  435. package/template/docs/process/schemas/digital-human-task-package.schema.json +713 -100
  436. package/template/docs/process/schemas/slice-implementation-contract-v3.schema.json +41 -0
  437. package/template/scripts/backend-standards-coverage +26 -0
  438. package/template/scripts/lib/backend-platform-provenance.mjs +1 -1
  439. package/template/scripts/lib/backend-platform-verification.mjs +2 -2
  440. package/template/scripts/lib/backend-platform.mjs +62 -0
  441. package/template/scripts/lib/backend-review.mjs +140 -0
  442. package/template/scripts/lib/backend-standards-coverage.mjs +237 -0
  443. package/template/scripts/lib/first-slice-artifacts.mjs +47 -0
  444. package/template/scripts/lib/first-slice-tests.mjs +24 -0
  445. package/template/scripts/lib/lifecycle-transition.mjs +9 -0
  446. package/template/scripts/lib/maintenance-candidate.mjs +160 -0
  447. package/template/scripts/lib/profile-skill-sync.mjs +46 -5
  448. package/template/scripts/lib/slice-execution-preflight.mjs +43 -0
  449. package/template/scripts/slice-contract +7 -3
  450. package/template/scripts/verify-backend-platform-matrix +8 -2
  451. package/template/skills-lock.json +77 -63
  452. package/template/yss-public-skills.json +4 -2
  453. package/template.manifest.json +0 -1
  454. package/template.snapshot.json +5 -5
@@ -8,33 +8,15 @@ import { fileURLToPath } from "node:url";
8
8
 
9
9
  import { run as runScaffoldVerification } from "./run_scaffold_verification.mjs";
10
10
  import { assertArchitectureAgreement } from "../../../../scripts/lib/backend-architecture.mjs";
11
- import { mvcFirstSliceProfile } from "../../../../scripts/lib/first-slice-architecture.mjs";
11
+ import { inspectSliceContract } from "../../../../scripts/lib/slice-execution-preflight.mjs";
12
+ import { selectSliceWorkUnit } from "../../../../scripts/lib/slice-contract.mjs";
13
+ import { verifyFirstSliceTests } from "../../../../scripts/lib/first-slice-tests.mjs";
14
+ import { inspectFirstSliceArtifacts } from "../../../../scripts/lib/first-slice-artifacts.mjs";
12
15
 
13
16
  const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
14
17
  const REPOSITORY_ROOT = path.resolve(SCRIPT_DIR, "../../../..");
15
18
  const REQUIRED_SKILLS = ["yss-domain", "yss-application", "yss-repository", "yss-mybatis", "yss-web-controller", "yss-dto", "yss-exception", "yss-validation", "mapstruct", "lombok", "alibaba-java-code-style"];
16
19
  const REQUIRED_LAYERS = ["domain", "application", "infrastructure", "web"];
17
- const ARTIFACT_CHECKS = [
18
- ["domain-model", /-domain\/src\/main\/java\/.+\/domain\/.+\/model\/.+\.java$/],
19
- ["domain-gateway", /-domain\/src\/main\/java\/.+\/domain\/.+\/gateway\/.+Gateway\.java$/],
20
- ["domain-behavior-test", /-domain\/src\/test\/java\/.+(?:Test|Tests)\.java$/],
21
- ["application-command-or-query", /-application\/src\/main\/java\/.+\/application\/(?:command|query)\/.+\.java$/],
22
- ["application-result", /-application\/src\/main\/java\/.+\/application\/result\/.+Result\.java$/],
23
- ["application-service", /-application\/src\/main\/java\/.+\/application\/service\/.+Service\.java$/],
24
- ["application-service-implementation", /-application\/src\/main\/java\/.+\/application\/service\/impl\/.+ServiceImpl\.java$/],
25
- ["application-behavior-test", /-application\/src\/test\/java\/.+(?:Test|Tests)\.java$/],
26
- ["infrastructure-po", /-infrastructure\/src\/main\/java\/.+\/infrastructure\/persistence\/po\/.+PO\.java$/],
27
- ["infrastructure-repository", /-infrastructure\/src\/main\/java\/.+\/infrastructure\/persistence\/repository\/.+Repository\.java$/],
28
- ["infrastructure-convertor", /-infrastructure\/src\/main\/java\/.+\/infrastructure\/persistence\/convertor\/.+Convertor\.java$/],
29
- ["infrastructure-gateway-implementation", /-infrastructure\/src\/main\/java\/.+\/infrastructure\/persistence\/gateway\/.+GatewayImpl\.java$/],
30
- ["infrastructure-query-adapter", /-infrastructure\/src\/main\/java\/.+\/infrastructure\/query\/adapter\/.+QueryAdapter\.java$/],
31
- ["infrastructure-integration-test", /-infrastructure\/src\/test\/java\/.+(?:Test|Tests)\.java$/],
32
- ["web-controller", /-adapter\/.+-web\/src\/main\/java\/.+\/rest\/.+Controller\.java$/],
33
- ["web-convertor", /-adapter\/.+-web\/src\/main\/java\/.+\/rest\/convertor\/.+WebConvertor\.java$/],
34
- ["web-request", /-adapter\/.+-web\/src\/main\/java\/.+\/rest\/dto\/request\/.+Request\.java$/],
35
- ["web-response", /-adapter\/.+-web\/src\/main\/java\/.+\/rest\/dto\/response\/.+Response\.java$/],
36
- ["web-contract-test", /-adapter\/.+-web\/src\/test\/java\/.+(?:Test|Tests)\.java$/]
37
- ];
38
20
 
39
21
  const isoNow = () => new Date().toISOString();
40
22
  const sha256 = (content) => createHash("sha256").update(content).digest("hex");
@@ -62,59 +44,7 @@ async function writeJsonAtomic(target, value) {
62
44
  await writeFile(temporary, `${JSON.stringify(value, null, 2)}\n`, "utf8");
63
45
  await rename(temporary, target);
64
46
  }
65
- function invalidContractReasons(contract, requiredSkills = REQUIRED_SKILLS, requiredLayers = REQUIRED_LAYERS) {
66
- const reasons = [];
67
- if (contract.schema_version !== 2) reasons.push("slice-contract-schema");
68
- if (contract.status !== "approved") reasons.push("slice-contract-not-approved");
69
- for (const field of ["contract_id", "contract_version", "slice_id"]) if (contract[field] === undefined || contract[field] === null || contract[field] === "") reasons.push(`slice-contract-${field}-missing`);
70
- if (contract.readiness?.blockers?.length) reasons.push("slice-contract-has-blockers");
71
- if (contract.readiness?.stale_inputs?.length) reasons.push("slice-contract-has-stale-inputs");
72
- const actualSkills = new Set([...(contract.common?.required_skills ?? []), ...(contract.backend?.required_skills ?? [])]);
73
- for (const skill of requiredSkills) if (!actualSkills.has(skill)) reasons.push(`required-skill-missing:${skill}`);
74
- const actualLayers = new Set(contract.backend?.affected_layers ?? []);
75
- for (const layer of requiredLayers) if (!actualLayers.has(layer)) reasons.push(`required-layer-missing:${layer}`);
76
- if (!Array.isArray(contract.work_units) || !contract.work_units.length) reasons.push("slice-contract-work-units-missing");
77
- else for (const [index, unit] of contract.work_units.entries()) {
78
- const id = unit.id || `index-${index}`;
79
- if (unit.contract_id !== contract.contract_id) reasons.push(`work-unit-contract-id-mismatch:${id}`);
80
- if (unit.contract_version !== contract.contract_version) reasons.push(`work-unit-contract-version-mismatch:${id}`);
81
- if (!unit.work_unit?.primary_skill) reasons.push(`work-unit-primary-skill-missing:${id}`);
82
- }
83
- return reasons;
84
- }
85
- async function downstreamDrift(manifest, requiredSkills = REQUIRED_SKILLS) {
86
- const drift = [];
87
- const recordedSkills = manifest.readiness?.downstream_skills ?? {};
88
- for (const skill of requiredSkills) {
89
- const expected = recordedSkills[skill];
90
- if (typeof expected !== "string" || !/^[a-f0-9]{64}$/.test(expected)) {
91
- drift.push(`${skill}:digest-missing`);
92
- continue;
93
- }
94
- const root = path.join(REPOSITORY_ROOT, ".agents", "skills", skill);
95
- if (!await isFile(path.join(root, "SKILL.md"))) drift.push(`${skill}:unavailable`);
96
- else if (await treeDigest(root) !== expected) drift.push(`${skill}:digest-mismatch`);
97
- }
98
- const contracts = manifest.readiness?.contracts ?? {};
99
- const contractFiles = {
100
- compiler_contract: path.join(REPOSITORY_ROOT, ".agents", "skills", "yss-implementation-contract-compiler", "references", "compiler-contract.yaml")
101
- };
102
- if (manifest.architecture_family === "layered-mvc") {
103
- contractFiles.architecture_profiles = path.join(REPOSITORY_ROOT, "docs/agents/backend-architecture-profiles.md");
104
- } else contractFiles.engineering_baseline = path.join(REPOSITORY_ROOT, ".agents", "skills", "yss-ddd-scaffold-generator", "references", "engineering-baseline.md");
105
- for (const [name, target] of Object.entries(contractFiles)) {
106
- const expected = contracts[name];
107
- if (typeof expected !== "string" || !/^[a-f0-9]{64}$/.test(expected)) {
108
- drift.push(`${name}:digest-missing`);
109
- continue;
110
- }
111
- if (!await isFile(target)) drift.push(`${name}:unavailable`);
112
- else if (sha256(await readFile(target)) !== expected) drift.push(`${name}:digest-mismatch`);
113
- }
114
- return drift;
115
- }
116
-
117
- export async function runFirstSliceVerification(projectRoot, evidenceDir, sliceContractFile, environment = process.env) {
47
+ export async function runFirstSliceVerification(projectRoot, evidenceDir, sliceContractFile, environment = process.env, options = {}) {
118
48
  projectRoot = path.resolve(projectRoot);
119
49
  evidenceDir = path.resolve(evidenceDir);
120
50
  sliceContractFile = path.resolve(sliceContractFile);
@@ -123,20 +53,33 @@ export async function runFirstSliceVerification(projectRoot, evidenceDir, sliceC
123
53
  if (!await isFile(manifestPath)) throw new Error(`missing scaffold manifest: ${manifestPath}`);
124
54
  if (!await isFile(sliceContractFile)) throw new Error(`missing Slice Implementation Contract: ${sliceContractFile}`);
125
55
  const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
126
- const contract = JSON.parse(await readFile(sliceContractFile, "utf8"));
56
+ const contractRoot = path.resolve(options.contractRoot || projectRoot);
57
+ let contract, preflight;
58
+ try {
59
+ const loaded = inspectSliceContract(path.relative(contractRoot, sliceContractFile), {
60
+ root: contractRoot, approval_ref: options.approvalRef, work_unit_id: options.workUnit
61
+ });
62
+ preflight = loaded.report;
63
+ contract = selectSliceWorkUnit(loaded.contract, options.workUnit);
64
+ } catch (error) {
65
+ preflight = { execution_allowed: false, blockers: [error.message] };
66
+ contract = {};
67
+ }
127
68
  if (manifest.platform_verification === "candidate") throw new Error("backend-platform: candidate scaffold cannot become first-slice-verified");
128
- const adapter = manifest.architecture_family === "layered-mvc" ? mvcFirstSliceProfile(manifest.architecture_identity ?? {}) : { skills: REQUIRED_SKILLS, layers: REQUIRED_LAYERS, artifacts: ARTIFACT_CHECKS };
129
- const contractFailures = invalidContractReasons(contract, adapter.skills, adapter.layers);
69
+ const contractFailures = [...preflight.blockers];
70
+ if (!preflight.execution_allowed) contractFailures.push("slice-execution-not-authorized");
71
+ if (!(contract.common?.project_roots || []).some(ref => path.resolve(contractRoot, ref) === projectRoot)) contractFailures.push("slice-project-root-mismatch");
130
72
  try {
131
73
  const identity = contract.architecture_identity ?? contract.resolution?.architecture_identity;
132
- assertArchitectureAgreement(identity, { manifest });
74
+ if (identity?.source_kind !== "existing-registration") assertArchitectureAgreement(identity, { manifest });
133
75
  for (const unit of contract.work_units ?? []) assertArchitectureAgreement(identity, { work_unit: unit.architecture_identity });
134
76
  } catch (error) { contractFailures.push(`architecture-identity:${error.message}`); }
135
77
  if (![2, 3, 4].includes(manifest.schema_version) || manifest.completion_level !== "empty-scaffold-verified") contractFailures.push("scaffold-not-empty-scaffold-verified");
136
78
  if (manifest.schema_version === 3 && manifest.legacy_reconciliation?.status !== "approved") contractFailures.push("legacy-scaffold-reconciliation-required");
137
- const projectFiles = await files(projectRoot);
138
- const missingArtifacts = adapter.artifacts.filter(([, pattern]) => !projectFiles.some((file) => pattern.test(file))).map(([name]) => name);
139
- const skillDrift = await downstreamDrift(manifest, adapter.skills);
79
+ const artifacts = inspectFirstSliceArtifacts(contract, projectRoot);
80
+ const missingArtifacts = artifacts.failures;
81
+ // Generation-time Skill hashes are provenance. Current authority was checked by execution preflight.
82
+ const skillDrift = [];
140
83
  if (contractFailures.length || missingArtifacts.length || skillDrift.length) {
141
84
  const report = { verification_mode: "first-slice", project_root: projectRoot, slice_contract_ref: sliceContractFile, scaffold_manifest_ref: manifestPath, generated_at: isoNow(), status: "failed", completion_level: manifest.completion_level, contract_failures: contractFailures, missing_artifacts: missingArtifacts, downstream_skill_drift: skillDrift, commands: [] };
142
85
  await writeJsonAtomic(reportPath, report);
@@ -144,9 +87,15 @@ export async function runFirstSliceVerification(projectRoot, evidenceDir, sliceC
144
87
  }
145
88
 
146
89
  const mavenEvidence = path.join(evidenceDir, "maven");
147
- const wrapper = await runScaffoldVerification(projectRoot, mavenEvidence, environment, { firstSlice: true });
148
- const passed = wrapper.status === "passed";
149
- const report = { verification_mode: "first-slice", project_root: projectRoot, slice_contract_ref: sliceContractFile, scaffold_manifest_ref: manifestPath, generated_at: isoNow(), status: passed ? "passed" : "failed", failure_category: wrapper.failure_category, completion_level: passed ? "first-slice-verified" : manifest.completion_level, contract_failures: [], missing_artifacts: [], downstream_skill_drift: [], commands: wrapper.commands };
90
+ const startedAt = Date.now();
91
+ const wrapper = await runScaffoldVerification(projectRoot, mavenEvidence, environment, { firstSlice: true, systemProperties: artifacts.properties });
92
+ const mvc = manifest.architecture_family === "layered-mvc";
93
+ const tests = wrapper.status === "passed" ? verifyFirstSliceTests(contract, projectRoot, startedAt, {
94
+ module: `${manifest.project_name}-${mvc ? "server" : "bootstrap"}`,
95
+ type: `${manifest.base_package}.${mvc ? "architecture.LayeredMvcArchitectureTest" : "ArchitectureRulesTest"}`
96
+ }) : { status: "not-executed", failures: [], evidence: [] };
97
+ const passed = wrapper.status === "passed" && tests.status === "passed";
98
+ const report = { verification_mode: "first-slice", project_root: projectRoot, slice_contract_ref: sliceContractFile, scaffold_manifest_ref: manifestPath, generated_at: isoNow(), status: passed ? "passed" : "failed", test_execution: tests, failure_category: wrapper.failure_category || (tests.status === "failed" ? "first-slice-tests" : null), completion_level: passed ? "first-slice-verified" : manifest.completion_level, contract_failures: [], missing_artifacts: [], downstream_skill_drift: [], commands: wrapper.commands };
150
99
  await writeJsonAtomic(reportPath, report);
151
100
  if (passed) {
152
101
  manifest.completion_level = "first-slice-verified";
@@ -162,7 +111,7 @@ function parseArgs(argv) {
162
111
  const result = {};
163
112
  for (let index = 0; index < argv.length; index += 2) {
164
113
  const flag = argv[index], value = argv[index + 1];
165
- if (!["--project-root", "--evidence-dir", "--slice-contract-file"].includes(flag) || !value) throw new Error("usage: run_first_slice_verification.mjs --project-root DIR --evidence-dir DIR --slice-contract-file FILE");
114
+ if (!["--project-root", "--evidence-dir", "--slice-contract-file", "--contract-root", "--approval-ref", "--work-unit"].includes(flag) || !value) throw new Error("usage: run_first_slice_verification.mjs --project-root DIR --evidence-dir DIR --slice-contract-file FILE");
166
115
  result[flag.slice(2).replaceAll(/-([a-z])/g, (_, letter) => letter.toUpperCase())] = value;
167
116
  }
168
117
  if (!result.projectRoot || !result.evidenceDir || !result.sliceContractFile) throw new Error("project root, evidence dir, and slice contract file are required");
@@ -172,7 +121,7 @@ function parseArgs(argv) {
172
121
  async function main() {
173
122
  try {
174
123
  const args = parseArgs(process.argv.slice(2));
175
- const report = await runFirstSliceVerification(args.projectRoot, args.evidenceDir, args.sliceContractFile);
124
+ const report = await runFirstSliceVerification(args.projectRoot, args.evidenceDir, args.sliceContractFile, process.env, args);
176
125
  process.stdout.write(`${report.status}: ${path.join(path.resolve(args.evidenceDir), "first-slice-verification.json")}\n`);
177
126
  return report.status === "passed" ? 0 : 1;
178
127
  } catch (error) {
@@ -62,7 +62,7 @@ function validateManifest(manifest) {
62
62
  if (manifest.schema_version === 4 ? manifest.current_version !== true : manifest.current_version !== manifest.contract_version) throw new Error("脚手架生成元数据清单不是当前合同版本");
63
63
  if (JSON.stringify(manifest.verification_commands) !== JSON.stringify(COMMANDS)) throw new Error("脚手架生成元数据清单验证命令不符合固定合同");
64
64
  }
65
- export async function run(projectRoot, evidenceDir, environment = process.env, { timeoutMs = 0, signal, platformOptions = {}, firstSlice = false } = {}) {
65
+ export async function run(projectRoot, evidenceDir, environment = process.env, { timeoutMs = 0, signal, platformOptions = {}, firstSlice = false, systemProperties = {} } = {}) {
66
66
  const wrapper = path.join(projectRoot, "mvnw"), manifestPath = path.join(projectRoot, ".yss", "scaffold-generation.json");
67
67
  if (!await isFile(wrapper)) throw new Error(`项目根目录缺少 Maven wrapper: ${wrapper}`);
68
68
  if (!await isFile(manifestPath)) throw new Error(`项目根目录缺少脚手架生成元数据清单: ${manifestPath}`);
@@ -114,13 +114,14 @@ export async function run(projectRoot, evidenceDir, environment = process.env, {
114
114
  const stderrPath = path.join(evidenceDir, `mvnw-${phase}.stderr.log`);
115
115
  const startedAt = isoNow();
116
116
  const started = process.hrtime.bigint();
117
- const execution = await runCommand(wrapper, [phase], { cwd: projectRoot, env: environment, timeoutMs, signal, stdoutFile: stdoutPath, stderrFile: stderrPath, secrets: [environment.MAVEN_REPO_USERNAME, environment.MAVEN_REPO_PASSWORD], progress: true });
117
+ const args = [phase, ...Object.entries(systemProperties).map(([key, value]) => `-D${key}=${value}`)];
118
+ const execution = await runCommand(wrapper, args, { cwd: projectRoot, env: environment, timeoutMs, signal, stdoutFile: stdoutPath, stderrFile: stderrPath, secrets: [environment.MAVEN_REPO_USERNAME, environment.MAVEN_REPO_PASSWORD], progress: true });
118
119
  const outcome = { ...execution, exitCode: execution.status };
119
120
  const durationMs = Number(process.hrtime.bigint() - started) / 1e6;
120
121
  await writeText(stdoutPath, redactSecrets(outcome.stdout, environment));
121
122
  await writeText(stderrPath, redactSecrets(outcome.stderr, environment));
122
123
  commands.push({
123
- command: `./mvnw ${phase}`,
124
+ command: `./mvnw ${args.join(" ")}`,
124
125
  phase,
125
126
  exit_code: outcome.exitCode,
126
127
  failure_category: outcome.termination || classifyFailure(phase, outcome),
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: yss-design-system
3
- description: Use when YSS 产品设计系统与 Ant Design 企业级 UI 风格基线。涉及页面设计、原型评审、UI 实现、组件选型、主题 token、颜色排版间距、响应式验收、Ant Design/YSS UI 风格一致性、docs/design/design.md 更新或从外部设计系统引入规范时必须使用。
3
+ description: 建立或核验 YSS 设计系统、主题 Token 与页面视觉一致性;用于设计规范变更、原型评审及按当前设计基线验收。
4
4
  ---
5
5
 
6
6
  # YSS Design System
@@ -18,7 +18,7 @@ description: Use when YSS 产品设计系统与 Ant Design 企业级 UI 风格
18
18
  - Codex `$design-qa` 项目对照:`references/design-qa-theme.md`,不替代官方 `design-qa` 流程,也不改上游插件正文。
19
19
  - 原型阶段合同:`yss-prototype-stage`,用于统一 H1/H2 原型资产和浏览器验证证据。H1/H2 默认使用项目 Token 驱动的 HTML/CSS/JavaScript 离线原型。
20
20
 
21
- 如果只需要快速判断,先读本文件。若要写 UI 规范、实现页面、评审设计或调整 Token,必须按 `DESIGN.md` → `docs/design/design.md` → `docs/design/tokens/*` 顺序读取;若要执行评审或实现检查,再读 `references/design-system.md`。
21
+ 如果只需要快速判断,先读本文件。若要写 UI 规范、实现页面、评审设计或调整 Token,必须按 `DESIGN.md` → `docs/design/design.md` 顺序读取,再按当前主题、密度与输出表面选择对应 Token 文件,不全量预读所有主题;若要执行评审或实现检查,再读 `references/design-system.md`。
22
22
 
23
23
  ## 使用流程
24
24
 
@@ -1,19 +1,21 @@
1
1
  ---
2
2
  name: yss-domain
3
- description: 用于构建或重构 YSS 领域层代码。当用户要求设计聚合、Entity、Domain Gateway、领域规则、状态流转或先做领域建模再补持久层时调用。
3
+ description: 按已批准的 DDD 技术设计实现或重构领域行为、不变量、状态机与 Gateway;不负责起草领域设计。
4
4
  ---
5
5
 
6
6
  # yss-domain
7
7
 
8
8
  这是一个领域实现 skill。核心目标是消费已批准的战术模型,将领域行为落实为代码;`yss-technical-design` 组织 DDD 分支,由 `yss-tactical-design` 设计、`yss-product-lifecycle` 维护批准。
9
9
 
10
+ 既有工程先读取 `references/existing-project.md`,按登记的职责和批准边界审计或整改;只读审计不要求批准 Slice。
11
+
10
12
  本 skill 在新脚手架链路只支持 `domain-driven` / `target-domain-model`。`layered-mvc-service` 与 `mvc-data-analysis-v1` 是独立 MVC Profile,不是失败的 DDD 工程;它们不加载本 skill,也不生成 Domain Gateway。既有旧架构不在本链路内迁移。
11
13
 
12
14
  ## 何时使用
13
15
 
14
- - 用户要求先做 Domain、先抽象实体或聚合。
15
- - 用户要补 `Entity`、`Gateway`、领域规则或状态机。
16
- - 用户给出页面流程、业务规则、DDL,希望先沉淀领域模型。
16
+ - 当前已批准的 DDD Slice Contract 要求实现或修复领域行为、不变量或状态机。
17
+ - 在既有已确认领域边界内重构 Entity、Value Object、Domain Event 或 Gateway。
18
+ - 需要从需求、页面或 DDL 决定聚合及领域边界时,回交 `yss-technical-design` / `yss-tactical-design`,不先写领域代码。
17
19
 
18
20
  ## 不适用
19
21
 
@@ -36,17 +38,27 @@ description: 用于构建或重构 YSS 领域层代码。当用户要求设计
36
38
 
37
39
  ## 建模约束
38
40
 
41
+ <a id="domain.dependencies"></a>
42
+ <!-- yss-rule {"id":"domain.dependencies","when":"domain","level":"mandatory","evidence":"code-and-verification"} -->
39
43
  - Domain 层不依赖 Repository、Mapper、Controller。
44
+ <a id="domain.behavior"></a>
45
+ <!-- yss-rule {"id":"domain.behavior","when":"domain","level":"mandatory","evidence":"code-and-verification"} -->
40
46
  - 领域行为放在模型方法,不要放在 Web 层。
47
+ <a id="domain.gateway"></a>
48
+ <!-- yss-rule {"id":"domain.gateway","when":"domain","level":"mandatory","evidence":"code-and-verification"} -->
41
49
  - Gateway 只暴露领域能力,不暴露持久化细节。
42
50
  - 对关键状态流转给出明确方法,如 `publish()`、`cancel()`、`terminate()`。
51
+ <a id="domain.invariants"></a>
52
+ <!-- yss-rule {"id":"domain.invariants","when":"domain","level":"mandatory","evidence":"code-and-verification"} -->
43
53
  - 明确 Aggregate Root、Entity identity、Value Object、不变量、Domain Event 和一致性边界;没有业务行为时不要伪造富领域模型。
44
- - 发现旧架构时停止套用新脚手架合同并返回 `unsupported`;旧项目继续按原工程维护,现代化改造单独立项。
54
+ - `unsupported` 只阻断不支持的生成方式。既有 DDD 按登记边界整改;目录差异不是领域违规。架构身份转换或公开契约迁移单独立项,MVC 不套用 DDD 规则。
45
55
 
46
56
  ## 质量要求
47
57
 
48
58
  - 命名体现业务语义,不照抄表名缩写。
49
59
  - 生成代码应可编译,且没有跨层依赖泄漏。
60
+ <a id="domain.gateway-owner"></a>
61
+ <!-- yss-rule {"id":"domain.gateway-owner","when":"domain","level":"mandatory","evidence":"code-and-verification"} -->
50
62
  - Domain Gateway interface 由本 skill 唯一拥有;Infrastructure 只能实现,不得由 `yss-repository` 反向创建或改写其签名。
51
63
  - 对不确定规则返回 `new_impacts` / `drift` 并暂停;不要把未批准假设或 TODO 写进实现冒充已确认事实。
52
64
 
@@ -1,6 +1,6 @@
1
1
  # YSS Domain Target Profile 指南
2
2
 
3
- 本指南只定义新 DDD `target-domain-model`。历史 DTO/VO 型 Gateway、`core/client/repository` 和贫血对象均为 `unsupported`,不存在旧架构 Profile 或迁移分支。
3
+ 本指南的目录和生成布局只定义新 DDD `target-domain-model`。既有 DDD 通过 [既有工程边界](existing-project.md) 应用领域语义规则;历史目录或贫血对象不能单凭名称判违规。HTTP DTO/VO 穿入领域端口仍须按登记职责检查。架构迁移不属于生成器。
4
4
 
5
5
  ## 1. Domain 所有权
6
6
 
@@ -62,7 +62,7 @@ public interface QualityTemplateGateway {
62
62
  - `*VO`、`PageResult`、Repository PO。
63
63
  - MyBatis、Spring MVC、Jackson、Swagger 类型。
64
64
 
65
- 分页、列表和投影查询由 Application Query Port 定义,Infrastructure 实现。
65
+ 展示分页、列表和投影查询由 Application Query Port 定义,Infrastructure 实现。
66
66
 
67
67
  ## 5. Domain Error
68
68
 
@@ -98,4 +98,11 @@ Web Exception Translator 再将它映射为批准的状态码、错误码和消
98
98
  - 消费批准且当前的 Tactical Design 与 Slice Implementation Contract。
99
99
  - 返回 YSS Skill Execution Result,包含 Domain 文件、行为测试、ArchUnit 结果及实际 `./mvnw ...` 证据。
100
100
  - 新聚合、不变量、状态机或跨上下文影响进入 `new_impacts` 并暂停。
101
- - 检测到旧架构时返回 `unsupported`;如需现代化,退出 scaffold 工作流并单独立项评估。
101
+ - 旧布局不走 scaffold 生成分支;既有 DDD 按登记整改。需改变架构或公开契约时单独评估并批准。
102
+
103
+ ## 聚合创建与重建
104
+
105
+ - 创建入口执行当前创建规则;持久化重建入口恢复已批准状态并校验结构不变量,不重复发送创建事件、生成身份或执行外部调用。两者不得通过公开任意 setter 混为一体。
106
+ - 值对象按值相等;聚合按稳定身份相等。集合对外只读,修改经业务方法;Java 8 使用普通类与防御性复制,不从示例推导 record 等高版本语法。
107
+ - 领域错误携带稳定标识与参数;公开消息和 HTTP 状态由 Web 翻译。测试通过公开行为覆盖非法状态、重复动作和重建后语义一致性。
108
+ - 为业务决策加载一个或一组聚合仍可使用 Domain Gateway;展示列表、分页、排序、统计和投影走 Application Query Port。返回 List 本身不是违规,须按调用目的判定。
@@ -0,0 +1,5 @@
1
+ # 既有领域工程
2
+
3
+ 只对 `existing-domain-driven-maven` 或登记为 DDD 的只读盘点范围应用领域语义。读取实际 build unit、role_paths、source roots 与工程基线;不要求 target 模块名、Entity 后缀或生成 Manifest。创建/重建、不变量、端口所有权和技术依赖边界仍按 domain-layer-guide 检查。MVC 不创建聚合或 Gateway。
4
+
5
+ 只读审计允许缺设计资产,但记录 missing_evidence。修改消费当前批准 Slice 和已确认行为 seam;不得从历史代码伪造业务规则批准。新增聚合、改变一致性或架构身份回设计与合同编译器。
@@ -44,6 +44,8 @@ description: "实现或核验 YSS Result、PageResult、PageQuery、CommandDTO
44
44
 
45
45
  - 写操作参数优先继承 `CommandDTO`。
46
46
  - Application/Infrastructure 内部读参数可按项目 Profile 使用 `QueryDTO` 或 `PageQuery`。
47
+ <a id="dto.page-input"></a>
48
+ <!-- yss-rule {"id":"dto.page-input","when":"pagination","level":"mandatory","evidence":"code-and-verification"} -->
47
49
  - 公开 HTTP Page Request 默认不继承 `PageQuery`,只复制冻结 OpenAPI 允许的分页字段,再由 WebConvertor 转为 Application Query;避免继承的 `offset`、`needTotalCount`、`tempTotalCount` 进入绑定面。
48
50
  - Controller 返回优先使用项目既有的 `Result` 或派生结果对象。
49
51
  - 单对象返回优先 `SingleResult`,列表返回优先 `MultiResult`,分页返回优先 `PageResult`,前提是当前项目已采用这套体系。
@@ -54,27 +56,24 @@ description: "实现或核验 YSS Result、PageResult、PageQuery、CommandDTO
54
56
  - `PageResult` 当前稳定公共字段为 `totalCount/pageSize/pageIndex/data[]`;`totalPages` 是计算 getter,只有目标 HTTP mapper / contract fixture 证明后才能进入具体契约。
55
57
  - `PageQuery` 客户端输入只允许 `pageIndex/pageSize/orderBy/orderDirection/groupBy`(后四项按 profile 的 optional / whitelist 规则);`orderDirection` 只能是 `ASC|DESC`。`offset`、`needTotalCount`、`tempTotalCount` 是计算或内部协作字段,禁止成为客户端输入。
56
58
  - `buildSuccess(...)` 各重载设置 code 的行为并不一致;冻结契约必须测试 `success/code/message/tips/dataType`、nullability 和三种 data shape,不能只测试 data。
59
+ <a id="dto.wire-evidence"></a>
60
+ <!-- yss-rule {"id":"dto.wire-evidence","when":"wire","level":"mandatory","evidence":"code-and-verification"} -->
57
61
  - Java getter、Lombok、`@JsonIgnore` 或默认 Jackson 结果都不是目标 HTTP wire fact;冻结前必须记录 mapper identity、代表性序列化 fixture 和 contract-test / 等价 HTTP 证据。
62
+ <a id="dto.boundary"></a>
63
+ <!-- yss-rule {"id":"dto.boundary","when":"wire","level":"mandatory","evidence":"code-and-verification"} -->
58
64
  - DTO 只表达接口契约,不承载 Repository PO 或领域对象的持久化细节。
59
65
 
60
66
  ## 检查清单
61
67
 
62
- - 分页字段名是否和框架约定一致。
63
- - `orderBy` / `groupBy` 是否经过 Repository 白名单映射,禁止直接拼接 SQL。
64
- - Application Query Port / Infrastructure 是否收到批准的分页语义;Domain Gateway 不接收 `PageQuery`。
65
- - 新增 DTO 是否与现有序列化和校验方式兼容。
66
- - 返回结构是否和前端或上游调用方契约一致。
67
- - 是否通过 `scripts/verify-yss-dto-openapi-profile`,并引用 profile 版本。
68
- - wrapper extension、`YssResultMeta`、`allOf`、具体 data schema 和方向性是否逐 endpoint 对齐。
69
- - 是否有针对 `offset` / `needTotalCount` / `tempTotalCount` 的负向断言,以及对 `totalPages` 的目标 mapper 证据。
70
- - Controller、Application Service、Domain、Repository 之间是否存在 DTO/VO/DO/PO 混穿。
71
- - 前端 Orval 或调用方是否依赖当前返回包装结构。
68
+ 仅在 DTO/OpenAPI wire shape 受影响时读取 [wire 验收清单](references/wire-validation-checklist.md),按当前平台和请求/响应方向执行;权威字段形状继续由 `references/openapi-wire-profile.yaml` 持有。
72
69
 
73
70
  ## 修改约束
74
71
 
75
72
  - 不要在一个项目里混用多套返回包装类。
76
73
  - 不要新建与 `PageQuery` 含义重叠的分页基类。
77
74
  - 不要把 `com.yss.cloud.dto.response` 作为新 API 的 canonical 包,也不要从 Java getter 机械生成 wire schema。
75
+ <a id="dto.no-leak"></a>
76
+ <!-- yss-rule {"id":"dto.no-leak","when":"pagination","level":"mandatory","evidence":"code-and-verification"} -->
78
77
  - 不要把 `offset`、`needTotalCount`、`tempTotalCount` 作为客户端分页输入;不要无证据把 `totalPages` 写入所有分页响应。
79
78
  - 若项目已有 `SingleResult`、`PageResult`、`MultiResult` 体系,优先保持一致。
80
79
 
@@ -95,3 +94,7 @@ description: "实现或核验 YSS Result、PageResult、PageQuery、CommandDTO
95
94
  ## 平台与源码门禁
96
95
 
97
96
  接入、修改、代码生成或给出精确类名/配置前,读取 [后端组件平台与源码门禁](../yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md),从批准的 `platform_configuration.component_platform_line` 选择 `source-index.boot2-java8.md` 或 `source-index.boot3-java17.md`,并以 `--skill yss-dto --platform-line <line> --source-root <matching-root>` 运行统一 freshness 校验。平台线与源码根不匹配、组件 tree 不一致、组件子树 dirty、索引缺少平台信号,或 Manifest / 组件 GAV 缺少 verified 兼容证据时返回 `blocked`;不得回退另一代索引,也不在业务实现中升级、降级或替换 YSS 组件。既有工程只读分诊可继续,但不得据此宣称跨 Boot/JDK 兼容。
97
+
98
+ ## 既有契约与特殊协议
99
+
100
+ 只读审计先辨认已锁定的 wire 契约。下载、流式和第三方回调按批准协议检查媒体类型、状态、Header、错误与权限边界;不强套 Result,也不因声称“特殊接口”豁免契约证据。普通已采用 YSS wrapper 的接口继续按 wire profile 检查。旧包/旧协议差距单列迁移,不静默改锁或改公开响应。
@@ -0,0 +1,14 @@
1
+ ## 检查清单
2
+
3
+ - 分页字段名是否和框架约定一致。
4
+ <a id="dto.sort"></a>
5
+ <!-- yss-rule {"id":"dto.sort","when":"pagination","level":"mandatory","evidence":"code-and-verification"} -->
6
+ - `orderBy` / `groupBy` 是否经过 Repository 白名单映射,禁止直接拼接 SQL。
7
+ - Application Query Port / Infrastructure 是否收到批准的分页语义;Domain Gateway 不接收 `PageQuery`。
8
+ - 新增 DTO 是否与现有序列化和校验方式兼容。
9
+ - 返回结构是否和前端或上游调用方契约一致。
10
+ - 是否通过 `scripts/verify-yss-dto-openapi-profile`,并引用 profile 版本。
11
+ - wrapper extension、`YssResultMeta`、`allOf`、具体 data schema 和方向性是否逐 endpoint 对齐。
12
+ - 是否有针对 `offset` / `needTotalCount` / `tempTotalCount` 的负向断言,以及对 `totalPages` 的目标 mapper 证据。
13
+ - Controller、Application Service、Domain、Repository 之间是否存在 DTO/VO/DO/PO 混穿。
14
+ - 前端 Orval 或调用方是否依赖当前返回包装结构。
@@ -47,12 +47,12 @@ Read `references/source-index.md` as a path-hint index whenever the task depends
47
47
  - Required dependency or starter module is present.
48
48
  - Error code/message are meaningful to API consumers.
49
49
  - Response messages are sanitized and do not expose raw RuntimeException or localized exception details.
50
- - HTTP assertions cover business 4xx, unknown/runtime 5xx, upload 413, and `X-Trace-Id`.
50
+ - For affected boot3-java17 HTTP seams, assert the documented business 4xx, unknown/runtime 5xx and trace header behavior. Assert upload 413 only for upload-limit impact. Boot 2 assertions follow its own source and frozen contract; do not import Boot 3 behavior into it.
51
51
  - Business validation failures are not reported as unknown system errors.
52
52
  - Stack traces are preserved in structured logger output for unknown/system failures, never printed directly to stderr or serialized to clients.
53
53
  - Retry guidance matches exception type.
54
54
  - Known system failures use `ExceptionFactory.sysException(..., cause)`; Application code does not replace them with ad-hoc `RuntimeException`.
55
- - Endpoint contract tests cover business, known-system, unknown/runtime, and upload-limit failures; unknown public messages never expose `getLocalizedMessage()`.
55
+ - Endpoint tests cover the failure types actually affected by this change; upload-limit tests apply only to upload endpoints or changed upload handling. Public messages must follow the selected platform contract and never leak protected exception details.
56
56
 
57
57
  ## Do Not
58
58
 
@@ -3,9 +3,9 @@ name: yss-formily-schema-generator
3
3
  description: "从需求或设计图生成 YFormily JSON Schema 与表单代码;仅用于生产表单实现。"
4
4
  ---
5
5
 
6
- # YssFormily Schema Generator
6
+ # YFormily Schema Generator
7
7
 
8
- Use this skill to turn upstream input into downstream YssFormily form artifacts.
8
+ Use this skill to turn upstream input into downstream YFormily form artifacts.
9
9
 
10
10
  Supported input forms:
11
11
 
@@ -16,13 +16,13 @@ Supported input forms:
16
16
 
17
17
  Expected output forms:
18
18
 
19
- - a YssFormily JSON Schema or `ISchema`
19
+ - a YFormily JSON Schema or `ISchema`
20
20
  - a recommended `v-model` data shape
21
21
  - optional `scope`, `effects`, and slot plan
22
- - optional Vue render snippet showing how to mount `YssFormily`
22
+ - optional Vue render snippet showing how to mount `YFormily`
23
23
 
24
24
  This skill designs the schema.
25
- For implementation rules and exact YssFormily behavior, also read:
25
+ For implementation rules and exact YFormily behavior, also read:
26
26
 
27
27
  - [yss-formily](../yss-formily/SKILL.md)
28
28
 
@@ -35,10 +35,10 @@ For conversion workflow and field mapping, read:
35
35
  Use this skill when the request is any of the following:
36
36
 
37
37
  - “根据需求描述生成表单 schema”
38
- - “根据原型图生成 YssFormily”
38
+ - “根据原型图生成 YFormily”
39
39
  - “根据图片/截图还原表单”
40
40
  - “根据 Figma 生成表单 JSON Schema”
41
- - “把业务字段整理成 YssFormily schema”
41
+ - “把业务字段整理成 YFormily schema”
42
42
  - “输出 schema 和渲染代码”
43
43
 
44
44
  ## Core principle
@@ -50,7 +50,7 @@ Translate the input into a stable form model:
50
50
  2. field semantics
51
51
  3. validation and dependency rules
52
52
  4. layout grouping
53
- 5. YssFormily schema
53
+ 5. YFormily schema
54
54
 
55
55
  The schema must reflect business meaning, not just pixel arrangement.
56
56
 
@@ -88,7 +88,7 @@ If the image contains only visual cues and no validation semantics, generate a s
88
88
 
89
89
  ### Figma input
90
90
 
91
- When a Figma link or node is provided, use the Figma workflow to inspect the design first.
91
+ When a Figma link or node is provided, discover an available design-inspection capability first. If unavailable, use supplied design exports or screenshots; report the missing access when those cannot establish a required detail. Do not invent a tool name or claim inspection succeeded.
92
92
  Extract:
93
93
 
94
94
  - field labels
@@ -99,7 +99,7 @@ Extract:
99
99
  - readonly versus editable patterns
100
100
  - footer actions
101
101
 
102
- Then convert that structure to YssFormily, following local YSS conventions instead of raw design-tool naming.
102
+ Then convert that structure to YFormily, following local YSS conventions instead of raw design-tool naming.
103
103
 
104
104
  ## Required outputs
105
105
 
@@ -120,7 +120,7 @@ If the user asks for code generation, also produce:
120
120
 
121
121
  Always align with `yss-formily`:
122
122
 
123
- - wrapper component is `YssFormily` or `YFormily`
123
+ - wrapper component for new code is `YFormily`; the historical `YssFormily` alias is accepted only when an existing installed export is verified
124
124
  - schema is `FormLayout -> FormGrid -> fields`
125
125
  - use `FormItem` for ordinary fields
126
126
  - prefer one shared schema for create/edit/detail when feasible
@@ -151,7 +151,7 @@ Follow this sequence every time:
151
151
  4. Decide field types and components.
152
152
  5. Decide sections and layout spans.
153
153
  6. Identify validation, enum, and linkage requirements.
154
- 7. Produce YssFormily schema.
154
+ 7. Produce YFormily schema.
155
155
  8. Produce render snippet if requested.
156
156
  9. Call out assumptions and uncertain inferences.
157
157
 
@@ -43,7 +43,7 @@ description: Use when YSS Vue 页面涉及 vue-hooks-plus/useRequest、分页、
43
43
  ```ts
44
44
  export function useReportTable() {
45
45
  const tableData = ref<any[]>([]);
46
- const currentParams = ref({ page: 1, pageSize: 20 });
46
+ const currentParams = ref({ pageIndex: 1, pageSize: 20 });
47
47
  const pagination = reactive({
48
48
  current: 1, pageSize: 20, total: 0,
49
49
  showSizeChanger: true, showQuickJumper: true,
@@ -52,8 +52,8 @@ export function useReportTable() {
52
52
  const { loading, run: fetchList } = useRequest(apiFn, {
53
53
  manual: true,
54
54
  onSuccess: (res) => {
55
- tableData.value = res?.data?.list || [];
56
- pagination.total = res?.data?.total || 0;
55
+ tableData.value = res?.data || [];
56
+ pagination.total = res?.totalCount || 0;
57
57
  },
58
58
  onError: () => {
59
59
  tableData.value = [];
@@ -64,60 +64,24 @@ export function useReportTable() {
64
64
  currentParams.value = { ...currentParams.value, ...params };
65
65
  return fetchList(currentParams.value);
66
66
  };
67
- const handlePageChange = (current: number, pageSize: number) => {
67
+ // YTable emits one object; adapt it at this boundary.
68
+ const handlePageChange = ({ current, pageSize }: { current: number; pageSize: number }) => {
68
69
  pagination.current = current;
69
70
  pagination.pageSize = pageSize;
70
- return query({ page: current, pageSize });
71
+ return query({ pageIndex: current, pageSize });
71
72
  };
72
73
  return { loading, tableData, currentParams, pagination, query, handlePageChange };
73
74
  }
74
75
  ```
75
76
 
76
77
  - 仅当项目已批准的请求库支持时使用 `useRequest`;通常使用 `manual: true`,除非需求明确要求挂载即请求。
77
- - `currentParams` 是唯一参数源。筛选变化重置 `page: 1`;翻页只改 `page/pageSize`;刷新、导出和编辑后重载复用它。
78
+ - `currentParams` 是唯一参数源。筛选变化重置 `pageIndex: 1`;翻页只改 `pageIndex/pageSize`;刷新、导出和编辑后重载复用它。
78
79
  - 在 Hook 内处理成功、失败、空数据和响应映射;旧列表会误导时才在失败时清空。
79
80
  - 树数据同样由 Hook 暴露 `treeData`、`treeLoading`、`selectedKey`、`handleSelect`,并在其中处理会触发加载的选中副作用。
80
81
 
81
82
  ## 3. `vue-hooks-plus/useRequest`(项目已批准时)
82
83
 
83
- `useRequest` 接收返回 `Promise<TData>` 的 service,并以插件组合管理 `loading`、`data`、`error`、`params`。自动模式默认在组件初始化时执行;`manual: true` 时用 `run` 或 `runAsync` 发起请求。
84
-
85
- ```ts
86
- import { useRequest } from 'vue-hooks-plus';
87
-
88
- const { data, error, loading, params, run, runAsync, refresh, mutate, cancel } = useRequest(
89
- searchReports,
90
- {
91
- manual: true,
92
- debounceWait: 300,
93
- onSuccess: (result, requestParams) => {
94
- tableData.value = result.list;
95
- pagination.total = result.total;
96
- },
97
- onError: (cause) => { requestError.value = cause; },
98
- },
99
- );
100
- ```
101
-
102
- - `run` 会捕获异常并交给 `onError`;`runAsync` 返回 `Promise`,调用处必须自行 `catch`。`refresh` / `refreshAsync` 使用上一次 `params` 重发请求;不要在页面重拼参数。
103
- - `mutate(nextData | updater)` 用于乐观更新;启用 `rollbackOnError` 时,远端失败会恢复更新前数据。先保存局部错误 / 刷新策略,不能只依赖乐观 UI。
104
- - `cancel()` 会忽略当前 Promise 的结果和错误,并会取消仍在等待执行的防抖调用;它**不会**终止底层 Promise。若 transport 支持真正中止,service 才能额外使用其已验证的 `AbortSignal` 支持。
105
- - 搜索场景优先 `debounceWait`(毫秒),并按需要配置 `debounceLeading`、`debounceTrailing`、`debounceMaxWait`。组件卸载与后一次请求的竞态响应会被库忽略;需要提前停止时调用 `cancel()`。不要再叠加自定义 timer / 序号,除非已验证当前版本或 transport 存在库无法覆盖的缺口。
106
- - `useRequest` 的并发语义在文档版本间出现差异:页面说明从 v2.4.0 起手动调用可独立执行,而 Options 表仍列出 `concurrent`(默认 `false`)控制新旧请求关系。启用并发前,必须以项目锁定版本的类型、测试与行为为准;搜索和同一资源写入默认采用单一最新请求策略。
107
-
108
- ### 3.1 缓存、刷新与重试
109
-
110
- - `cacheKey` 成功后会全局共享 data 和 params:同 key 的并发实例共用 Promise、数据同步。因此 key 必须包含稳定的业务身份与影响结果的参数;不同租户、用户、筛选条件或权限视图不能共用 key。副作用、实时性强或权限敏感结果默认不启用共享缓存。
111
- - `staleTime` 内数据视为新鲜,不重新请求;`cacheTime` 到期清除缓存。没有 `staleTime` 时,重新挂载会先展示缓存、再后台请求(SWR)。编辑 / 提交成功后的显式 `refresh` 优先于等待 SWR。
112
- - `refreshOnWindowFocus: true` 在 `visibilitychange` / `focus` 后刷新,使用 `focusTimespan`(默认 5000ms)限频。只给允许后台重取的读模型开启;编辑中的表单、一次性动作和高成本查询默认关闭。
113
- - `retryCount` 控制失败后的重试次数,`-1` 为无限重试;未设 `retryInterval` 时按 2s、4s…且最高 30s 的指数退避。仅对暂时性网络 / 可恢复服务错误设置有限重试;认证授权、参数校验、业务拒绝、显式取消和非幂等写操作禁止自动重试。`cancel()` 可停止正在等待的重试。
114
- - `loadingDelay` 可延迟 loading 变为 `true`,避免短请求闪烁;它不延迟请求,也不能作为防抖替代。
115
-
116
- ### 3.2 请求轮询与依赖刷新
117
-
118
- - `pollingInterval > 0` 启用请求轮询;每次请求完成后等待间隔再发下一次。`manual: true` 时,先 `run/runAsync` 才启动。`pollingWhenHidden` 默认 `true`;仅在业务允许后台继续请求时保留,需暂停则显式设为 `false`。`pollingErrorRetryCount` 默认 `-1`,必须为生产读模型配置有限值或明确停止条件。
119
- - 同一数据源只能选择 `useRequest` 轮询或 YSS `usePollingTask` 之一,禁止嵌套或同时运行。手动刷新前 `cancel()` 当前请求 / 轮询,执行带 loading 的 `refresh`,再依据明确业务规则恢复轮询。
120
- - `refreshDeps` 仅在非 manual 自动模式生效;传入 `WatchSource[]` 精确声明依赖,或在理解捕获范围后用 `true` 自动收集。筛选列表通常使用显式 `query` 并在筛选变化时重置页码,不以 `refreshDeps` 隐式驱动复杂参数。
84
+ 仅项目已批准且当前任务使用该库时,读取 [useRequest 实现细则](references/use-request.md),覆盖返回值、错误处理、取消、缓存、刷新、重试和轮询。不得因技能示例引入未批准依赖;调用 `runAsync` 必须捕获拒绝,业务失败提示遵循 mutator 的唯一所有权。
121
85
 
122
86
  ## 4. 单一异步动作:`useLoading`
123
87