create-yss-spec 3.1.3 → 3.3.0

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 (457) hide show
  1. package/README.md +5 -1
  2. package/package.json +1 -1
  3. package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
  4. package/template/.agents/skills/code-review/SKILL.md +4 -0
  5. package/template/.agents/skills/code-review/agents/openai.yaml +1 -1
  6. package/template/.agents/skills/code-review/references/yss-review-standards.md +9 -2
  7. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  8. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  9. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
  10. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  11. package/template/.agents/skills/yss-domain/SKILL.md +3 -3
  12. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  13. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  14. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
  15. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
  16. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
  17. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +3 -3
  18. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +9 -0
  19. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +35 -2
  20. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
  21. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  22. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  23. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  24. package/template/.agents/skills/yss-mvc-design/SKILL.md +16 -0
  25. package/template/.agents/skills/yss-mvc-design/agents/openai.yaml +4 -0
  26. package/template/.agents/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
  27. package/template/.agents/skills/yss-mybatis/SKILL.md +34 -58
  28. package/template/.agents/skills/yss-mybatis/agents/openai.yaml +2 -2
  29. package/template/.agents/skills/yss-mybatis/references/source-index.md +88 -68
  30. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +48 -43
  31. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  32. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +81 -19
  33. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +6 -2
  34. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +6 -3
  35. package/template/.agents/skills/yss-repository/SKILL.md +28 -70
  36. package/template/.agents/skills/yss-repository/agents/openai.yaml +2 -2
  37. package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  38. package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  39. package/template/.agents/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  40. package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  41. package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  42. package/template/.agents/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  43. package/template/.agents/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  44. package/template/.agents/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  45. package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
  46. package/template/.agents/skills/yss-tactical-design/references/output-template.md +2 -0
  47. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
  48. package/template/.agents/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
  49. package/template/.agents/skills/yss-technical-design/SKILL.md +31 -0
  50. package/template/.agents/skills/yss-technical-design/agents/openai.yaml +4 -0
  51. package/template/.agents/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
  52. package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +31 -0
  53. package/template/.agents/skills/yss-technical-design/references/technical-design.schema.json +759 -0
  54. package/template/.agents/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
  55. package/template/.agents/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
  56. package/template/.agents/skills/yss-technical-design/tests/fixtures.mjs +32 -0
  57. package/template/.agents/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
  58. package/template/.claude/skills/code-review/SKILL.md +4 -0
  59. package/template/.claude/skills/code-review/agents/openai.yaml +1 -1
  60. package/template/.claude/skills/code-review/references/yss-review-standards.md +9 -2
  61. package/template/.claude/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  62. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  63. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
  64. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  65. package/template/.claude/skills/yss-domain/SKILL.md +3 -3
  66. package/template/.claude/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  67. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  68. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
  69. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
  70. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
  71. package/template/.claude/skills/yss-implementation-contract-compiler/SKILL.md +3 -3
  72. package/template/.claude/skills/yss-implementation-contract-compiler/references/boundaries.md +9 -0
  73. package/template/.claude/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +35 -2
  74. package/template/.claude/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
  75. package/template/.claude/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  76. package/template/.claude/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  77. package/template/.claude/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  78. package/template/.claude/skills/yss-mvc-design/SKILL.md +16 -0
  79. package/template/.claude/skills/yss-mvc-design/agents/openai.yaml +4 -0
  80. package/template/.claude/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
  81. package/template/.claude/skills/yss-mybatis/SKILL.md +34 -58
  82. package/template/.claude/skills/yss-mybatis/agents/openai.yaml +2 -2
  83. package/template/.claude/skills/yss-mybatis/references/source-index.md +88 -68
  84. package/template/.claude/skills/yss-product-lifecycle/SKILL.md +48 -43
  85. package/template/.claude/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  86. package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +81 -19
  87. package/template/.claude/skills/yss-product-lifecycle/references/orchestration.md +6 -2
  88. package/template/.claude/skills/yss-product-lifecycle/references/state-model.md +6 -3
  89. package/template/.claude/skills/yss-repository/SKILL.md +28 -70
  90. package/template/.claude/skills/yss-repository/agents/openai.yaml +2 -2
  91. package/template/.claude/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  92. package/template/.claude/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  93. package/template/.claude/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  94. package/template/.claude/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  95. package/template/.claude/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  96. package/template/.claude/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  97. package/template/.claude/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  98. package/template/.claude/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  99. package/template/.claude/skills/yss-tactical-design/SKILL.md +2 -2
  100. package/template/.claude/skills/yss-tactical-design/references/output-template.md +2 -0
  101. package/template/.claude/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
  102. package/template/.claude/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
  103. package/template/.claude/skills/yss-technical-design/SKILL.md +31 -0
  104. package/template/.claude/skills/yss-technical-design/agents/openai.yaml +4 -0
  105. package/template/.claude/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
  106. package/template/.claude/skills/yss-technical-design/references/technical-design-contract.md +31 -0
  107. package/template/.claude/skills/yss-technical-design/references/technical-design.schema.json +759 -0
  108. package/template/.claude/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
  109. package/template/.claude/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
  110. package/template/.claude/skills/yss-technical-design/tests/fixtures.mjs +32 -0
  111. package/template/.claude/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
  112. package/template/.codex/skills/code-review/SKILL.md +4 -0
  113. package/template/.codex/skills/code-review/agents/openai.yaml +1 -1
  114. package/template/.codex/skills/code-review/references/yss-review-standards.md +9 -2
  115. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  116. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  117. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
  118. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  119. package/template/.codex/skills/yss-domain/SKILL.md +3 -3
  120. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  121. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  122. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
  123. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
  124. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
  125. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +3 -3
  126. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +9 -0
  127. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +35 -2
  128. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
  129. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  130. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  131. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  132. package/template/.codex/skills/yss-mvc-design/SKILL.md +16 -0
  133. package/template/.codex/skills/yss-mvc-design/agents/openai.yaml +4 -0
  134. package/template/.codex/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
  135. package/template/.codex/skills/yss-mybatis/SKILL.md +34 -58
  136. package/template/.codex/skills/yss-mybatis/agents/openai.yaml +2 -2
  137. package/template/.codex/skills/yss-mybatis/references/source-index.md +88 -68
  138. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +48 -43
  139. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  140. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +81 -19
  141. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +6 -2
  142. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +6 -3
  143. package/template/.codex/skills/yss-repository/SKILL.md +28 -70
  144. package/template/.codex/skills/yss-repository/agents/openai.yaml +2 -2
  145. package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  146. package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  147. package/template/.codex/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  148. package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  149. package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  150. package/template/.codex/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  151. package/template/.codex/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  152. package/template/.codex/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  153. package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
  154. package/template/.codex/skills/yss-tactical-design/references/output-template.md +2 -0
  155. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
  156. package/template/.codex/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
  157. package/template/.codex/skills/yss-technical-design/SKILL.md +31 -0
  158. package/template/.codex/skills/yss-technical-design/agents/openai.yaml +4 -0
  159. package/template/.codex/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
  160. package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +31 -0
  161. package/template/.codex/skills/yss-technical-design/references/technical-design.schema.json +759 -0
  162. package/template/.codex/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
  163. package/template/.codex/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
  164. package/template/.codex/skills/yss-technical-design/tests/fixtures.mjs +32 -0
  165. package/template/.codex/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
  166. package/template/.cursor/skills/code-review/SKILL.md +4 -0
  167. package/template/.cursor/skills/code-review/agents/openai.yaml +1 -1
  168. package/template/.cursor/skills/code-review/references/yss-review-standards.md +9 -2
  169. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  170. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  171. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
  172. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  173. package/template/.cursor/skills/yss-domain/SKILL.md +3 -3
  174. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  175. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  176. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
  177. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
  178. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
  179. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +3 -3
  180. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +9 -0
  181. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +35 -2
  182. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
  183. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  184. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  185. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  186. package/template/.cursor/skills/yss-mvc-design/SKILL.md +16 -0
  187. package/template/.cursor/skills/yss-mvc-design/agents/openai.yaml +4 -0
  188. package/template/.cursor/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
  189. package/template/.cursor/skills/yss-mybatis/SKILL.md +34 -58
  190. package/template/.cursor/skills/yss-mybatis/agents/openai.yaml +2 -2
  191. package/template/.cursor/skills/yss-mybatis/references/source-index.md +88 -68
  192. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +48 -43
  193. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  194. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +81 -19
  195. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +6 -2
  196. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +6 -3
  197. package/template/.cursor/skills/yss-repository/SKILL.md +28 -70
  198. package/template/.cursor/skills/yss-repository/agents/openai.yaml +2 -2
  199. package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  200. package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  201. package/template/.cursor/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  202. package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  203. package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  204. package/template/.cursor/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  205. package/template/.cursor/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  206. package/template/.cursor/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  207. package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
  208. package/template/.cursor/skills/yss-tactical-design/references/output-template.md +2 -0
  209. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
  210. package/template/.cursor/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
  211. package/template/.cursor/skills/yss-technical-design/SKILL.md +31 -0
  212. package/template/.cursor/skills/yss-technical-design/agents/openai.yaml +4 -0
  213. package/template/.cursor/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
  214. package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +31 -0
  215. package/template/.cursor/skills/yss-technical-design/references/technical-design.schema.json +759 -0
  216. package/template/.cursor/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
  217. package/template/.cursor/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
  218. package/template/.cursor/skills/yss-technical-design/tests/fixtures.mjs +32 -0
  219. package/template/.cursor/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
  220. package/template/.pi/skills/code-review/SKILL.md +4 -0
  221. package/template/.pi/skills/code-review/agents/openai.yaml +1 -1
  222. package/template/.pi/skills/code-review/references/yss-review-standards.md +9 -2
  223. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  224. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  225. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
  226. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  227. package/template/.pi/skills/yss-domain/SKILL.md +3 -3
  228. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  229. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  230. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
  231. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
  232. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
  233. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +3 -3
  234. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +9 -0
  235. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +35 -2
  236. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
  237. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  238. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  239. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  240. package/template/.pi/skills/yss-mvc-design/SKILL.md +16 -0
  241. package/template/.pi/skills/yss-mvc-design/agents/openai.yaml +4 -0
  242. package/template/.pi/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
  243. package/template/.pi/skills/yss-mybatis/SKILL.md +34 -58
  244. package/template/.pi/skills/yss-mybatis/agents/openai.yaml +2 -2
  245. package/template/.pi/skills/yss-mybatis/references/source-index.md +88 -68
  246. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +48 -43
  247. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  248. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +81 -19
  249. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +6 -2
  250. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +6 -3
  251. package/template/.pi/skills/yss-repository/SKILL.md +28 -70
  252. package/template/.pi/skills/yss-repository/agents/openai.yaml +2 -2
  253. package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  254. package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  255. package/template/.pi/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  256. package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  257. package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  258. package/template/.pi/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  259. package/template/.pi/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  260. package/template/.pi/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  261. package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
  262. package/template/.pi/skills/yss-tactical-design/references/output-template.md +2 -0
  263. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
  264. package/template/.pi/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
  265. package/template/.pi/skills/yss-technical-design/SKILL.md +31 -0
  266. package/template/.pi/skills/yss-technical-design/agents/openai.yaml +4 -0
  267. package/template/.pi/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
  268. package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +31 -0
  269. package/template/.pi/skills/yss-technical-design/references/technical-design.schema.json +759 -0
  270. package/template/.pi/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
  271. package/template/.pi/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
  272. package/template/.pi/skills/yss-technical-design/tests/fixtures.mjs +32 -0
  273. package/template/.pi/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
  274. package/template/.qoder/skills/code-review/SKILL.md +4 -0
  275. package/template/.qoder/skills/code-review/agents/openai.yaml +1 -1
  276. package/template/.qoder/skills/code-review/references/yss-review-standards.md +9 -2
  277. package/template/.qoder/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  278. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  279. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
  280. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  281. package/template/.qoder/skills/yss-domain/SKILL.md +3 -3
  282. package/template/.qoder/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  283. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  284. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
  285. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
  286. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
  287. package/template/.qoder/skills/yss-implementation-contract-compiler/SKILL.md +3 -3
  288. package/template/.qoder/skills/yss-implementation-contract-compiler/references/boundaries.md +9 -0
  289. package/template/.qoder/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +35 -2
  290. package/template/.qoder/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
  291. package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  292. package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  293. package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  294. package/template/.qoder/skills/yss-mvc-design/SKILL.md +16 -0
  295. package/template/.qoder/skills/yss-mvc-design/agents/openai.yaml +4 -0
  296. package/template/.qoder/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
  297. package/template/.qoder/skills/yss-mybatis/SKILL.md +34 -58
  298. package/template/.qoder/skills/yss-mybatis/agents/openai.yaml +2 -2
  299. package/template/.qoder/skills/yss-mybatis/references/source-index.md +88 -68
  300. package/template/.qoder/skills/yss-product-lifecycle/SKILL.md +48 -43
  301. package/template/.qoder/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  302. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +81 -19
  303. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration.md +6 -2
  304. package/template/.qoder/skills/yss-product-lifecycle/references/state-model.md +6 -3
  305. package/template/.qoder/skills/yss-repository/SKILL.md +28 -70
  306. package/template/.qoder/skills/yss-repository/agents/openai.yaml +2 -2
  307. package/template/.qoder/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  308. package/template/.qoder/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  309. package/template/.qoder/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  310. package/template/.qoder/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  311. package/template/.qoder/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  312. package/template/.qoder/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  313. package/template/.qoder/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  314. package/template/.qoder/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  315. package/template/.qoder/skills/yss-tactical-design/SKILL.md +2 -2
  316. package/template/.qoder/skills/yss-tactical-design/references/output-template.md +2 -0
  317. package/template/.qoder/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
  318. package/template/.qoder/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
  319. package/template/.qoder/skills/yss-technical-design/SKILL.md +31 -0
  320. package/template/.qoder/skills/yss-technical-design/agents/openai.yaml +4 -0
  321. package/template/.qoder/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
  322. package/template/.qoder/skills/yss-technical-design/references/technical-design-contract.md +31 -0
  323. package/template/.qoder/skills/yss-technical-design/references/technical-design.schema.json +759 -0
  324. package/template/.qoder/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
  325. package/template/.qoder/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
  326. package/template/.qoder/skills/yss-technical-design/tests/fixtures.mjs +32 -0
  327. package/template/.qoder/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
  328. package/template/.trae/skills/code-review/SKILL.md +4 -0
  329. package/template/.trae/skills/code-review/agents/openai.yaml +1 -1
  330. package/template/.trae/skills/code-review/references/yss-review-standards.md +9 -2
  331. package/template/.trae/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  332. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  333. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +1 -1
  334. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  335. package/template/.trae/skills/yss-domain/SKILL.md +3 -3
  336. package/template/.trae/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  337. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  338. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +107 -0
  339. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +41 -0
  340. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +37 -0
  341. package/template/.trae/skills/yss-implementation-contract-compiler/SKILL.md +3 -3
  342. package/template/.trae/skills/yss-implementation-contract-compiler/references/boundaries.md +9 -0
  343. package/template/.trae/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +35 -2
  344. package/template/.trae/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
  345. package/template/.trae/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  346. package/template/.trae/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  347. package/template/.trae/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  348. package/template/.trae/skills/yss-mvc-design/SKILL.md +16 -0
  349. package/template/.trae/skills/yss-mvc-design/agents/openai.yaml +4 -0
  350. package/template/.trae/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
  351. package/template/.trae/skills/yss-mybatis/SKILL.md +34 -58
  352. package/template/.trae/skills/yss-mybatis/agents/openai.yaml +2 -2
  353. package/template/.trae/skills/yss-mybatis/references/source-index.md +88 -68
  354. package/template/.trae/skills/yss-product-lifecycle/SKILL.md +48 -43
  355. package/template/.trae/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  356. package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +81 -19
  357. package/template/.trae/skills/yss-product-lifecycle/references/orchestration.md +6 -2
  358. package/template/.trae/skills/yss-product-lifecycle/references/state-model.md +6 -3
  359. package/template/.trae/skills/yss-repository/SKILL.md +28 -70
  360. package/template/.trae/skills/yss-repository/agents/openai.yaml +2 -2
  361. package/template/.trae/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  362. package/template/.trae/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  363. package/template/.trae/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  364. package/template/.trae/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  365. package/template/.trae/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  366. package/template/.trae/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  367. package/template/.trae/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  368. package/template/.trae/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  369. package/template/.trae/skills/yss-tactical-design/SKILL.md +2 -2
  370. package/template/.trae/skills/yss-tactical-design/references/output-template.md +2 -0
  371. package/template/.trae/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
  372. package/template/.trae/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
  373. package/template/.trae/skills/yss-technical-design/SKILL.md +31 -0
  374. package/template/.trae/skills/yss-technical-design/agents/openai.yaml +4 -0
  375. package/template/.trae/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
  376. package/template/.trae/skills/yss-technical-design/references/technical-design-contract.md +31 -0
  377. package/template/.trae/skills/yss-technical-design/references/technical-design.schema.json +759 -0
  378. package/template/.trae/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
  379. package/template/.trae/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
  380. package/template/.trae/skills/yss-technical-design/tests/fixtures.mjs +32 -0
  381. package/template/.trae/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
  382. package/template/CONTEXT.md +2 -1
  383. package/template/docs/agents/digital-human-roles.yaml +4 -2
  384. package/template/docs/agents/yss-skill-registry.yaml +25 -1
  385. package/template/docs/architecture/templates/architecture-review-checklist.md +1 -1
  386. package/template/docs/architecture/templates/system-overview-design-template.md +15 -4
  387. package/template/docs/process/lifecycle-artifact-map.md +6 -0
  388. package/template/docs/process/lifecycle-registry-baseline.json +8 -1
  389. package/template/docs/process/lifecycle-registry.yaml +32 -2
  390. package/template/docs/process/schemas/implementation-repository-preparation-result.schema.json +38 -0
  391. package/template/docs/process/schemas/project-scaffold-contract.schema.json +113 -0
  392. package/template/docs/process/schemas/strategic-design-handoff.schema.json +77 -4
  393. package/template/docs/process/strategic-handoff-package.md +4 -2
  394. package/template/docs/process/template-verification-profiles.yaml +37 -0
  395. package/template/docs/templates/implementation-repo-registry-template.md +8 -0
  396. package/template/docs/templates/review-report-template.md +7 -3
  397. package/template/docs/user-guide//346/210/230/346/234/257/350/256/276/350/256/241/345/255/220/351/241/271/347/233/256/347/224/250/346/210/267/346/211/213/345/206/214.md +7 -6
  398. package/template/scripts/fixtures/strategic-handoff/fixture.mjs +3 -2
  399. package/template/scripts/lib/implementation-contract-compiler.mjs +8 -1
  400. package/template/scripts/lib/lifecycle-context-query.mjs +137 -0
  401. package/template/scripts/lib/lifecycle-transition.mjs +109 -3
  402. package/template/scripts/lib/scenario-checks.mjs +29 -26
  403. package/template/scripts/lib/skill-registry.mjs +9 -0
  404. package/template/scripts/lib/strategic-handoff-consumption.mjs +4 -4
  405. package/template/scripts/lib/strategic-handoff-design-targets.mjs +15 -0
  406. package/template/scripts/lib/technical-design-boundary.mjs +23 -0
  407. package/template/scripts/query-lifecycle-context +25 -0
  408. package/template/scripts/sync-strategic-handoff-tools +3 -2
  409. package/template/scripts/verify-business-language-scenarios +0 -7
  410. package/template/scripts/verify-frontend-scaffold-generator-scenarios +2 -0
  411. package/template/scripts/verify-lifecycle-context-query-scenarios +68 -0
  412. package/template/scripts/verify-lifecycle-transition-scenarios +44 -4
  413. package/template/scripts/verify-strategic-handoff-package-scenarios +7 -1
  414. package/template/skills-lock.json +48 -18
  415. package/template.snapshot.json +4 -4
  416. package/template/.agents/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  417. package/template/.agents/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  418. package/template/.agents/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  419. package/template/.agents/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  420. package/template/.agents/skills/yss-mybatis/references/README.md +0 -57
  421. package/template/.agents/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  422. package/template/.claude/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  423. package/template/.claude/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  424. package/template/.claude/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  425. package/template/.claude/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  426. package/template/.claude/skills/yss-mybatis/references/README.md +0 -57
  427. package/template/.claude/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  428. package/template/.codex/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  429. package/template/.codex/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  430. package/template/.codex/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  431. package/template/.codex/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  432. package/template/.codex/skills/yss-mybatis/references/README.md +0 -57
  433. package/template/.codex/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  434. package/template/.cursor/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  435. package/template/.cursor/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  436. package/template/.cursor/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  437. package/template/.cursor/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  438. package/template/.cursor/skills/yss-mybatis/references/README.md +0 -57
  439. package/template/.cursor/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  440. package/template/.pi/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  441. package/template/.pi/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  442. package/template/.pi/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  443. package/template/.pi/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  444. package/template/.pi/skills/yss-mybatis/references/README.md +0 -57
  445. package/template/.pi/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  446. package/template/.qoder/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  447. package/template/.qoder/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  448. package/template/.qoder/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  449. package/template/.qoder/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  450. package/template/.qoder/skills/yss-mybatis/references/README.md +0 -57
  451. package/template/.qoder/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  452. package/template/.trae/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  453. package/template/.trae/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  454. package/template/.trae/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  455. package/template/.trae/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  456. package/template/.trae/skills/yss-mybatis/references/README.md +0 -57
  457. package/template/.trae/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
@@ -0,0 +1,137 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFileSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { parseDocument } from "../vendor/yaml.mjs";
5
+ import { ROOT, loadRegistry, semanticDigest, validateRegistry } from "./lifecycle-registry.mjs";
6
+ import { loadSkillRegistry } from "./skill-registry.mjs";
7
+
8
+ const LIFECYCLE_REGISTRY_REF = "docs/process/lifecycle-registry.yaml";
9
+ const ORCHESTRATION_CONTRACT_REF = ".agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml";
10
+ const SKILL_REGISTRY_REF = "docs/agents/yss-skill-registry.yaml";
11
+
12
+ function read(relativePath) {
13
+ return readFileSync(path.join(ROOT, relativePath), "utf8");
14
+ }
15
+
16
+ function sha256(source) {
17
+ return createHash("sha256").update(source).digest("hex");
18
+ }
19
+
20
+ function loadYaml(relativePath, label) {
21
+ const document = parseDocument(read(relativePath), { maxAliasCount: 0, uniqueKeys: true });
22
+ if (document.errors.length) throw new TypeError(`无法解析${label}: ${document.errors[0].message}`);
23
+ const value = document.toJS({ maxAliasCount: 0 });
24
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError(`${label}必须是对象`);
25
+ return value;
26
+ }
27
+
28
+ function canonicalize(value) {
29
+ if (Array.isArray(value)) return value.map(canonicalize);
30
+ if (value && typeof value === "object") {
31
+ return Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonicalize(value[key])]));
32
+ }
33
+ return value;
34
+ }
35
+
36
+ function selectById(records, id, label) {
37
+ if (!id) return null;
38
+ const selected = records.find((record) => record.id === id);
39
+ if (!selected) throw new TypeError(`未知${label}: ${id}`);
40
+ return selected;
41
+ }
42
+
43
+ function collectPathReferences(value, references = new Set()) {
44
+ if (Array.isArray(value)) {
45
+ for (const item of value) collectPathReferences(item, references);
46
+ } else if (value && typeof value === "object") {
47
+ for (const item of Object.values(value)) collectPathReferences(item, references);
48
+ } else if (typeof value === "string" && /(?:^|\/)[^\s]+\.(?:md|ya?ml|json|mjs)(?:#.*)?$/.test(value)) {
49
+ references.add(value);
50
+ }
51
+ return references;
52
+ }
53
+
54
+ function selectedSkills(route, skillRegistry) {
55
+ if (!route) return [];
56
+ const ids = new Set([
57
+ route.primary_skill,
58
+ route.native?.skill,
59
+ ...(route.supporting_skills ?? []),
60
+ ...(route.skills ?? []),
61
+ ].filter(Boolean));
62
+ return skillRegistry.skills.filter((skill) => ids.has(skill.id));
63
+ }
64
+
65
+ export function queryLifecycleContext({ mode, stageId, workUnitId, include = [] } = {}) {
66
+ if (!mode && !stageId && !workUnitId && include.length === 0) {
67
+ throw new TypeError("至少提供 --mode、--stage、--work-unit 或 --include 之一");
68
+ }
69
+
70
+ const lifecycle = validateRegistry(loadRegistry());
71
+ const orchestration = loadYaml(ORCHESTRATION_CONTRACT_REF, "生命周期编排合同");
72
+ const skillRegistry = loadSkillRegistry();
73
+ const stage = selectById(lifecycle.stages, stageId, "阶段");
74
+ const workUnit = selectById(lifecycle.work_units, workUnitId, "工作单元");
75
+
76
+ if (mode && !(mode in orchestration.modes)) throw new TypeError(`未知模式: ${mode}`);
77
+ const normalizedIncludes = [...new Set(include.flatMap((value) => value.split(",")).map((value) => value.trim()).filter(Boolean))].sort();
78
+ for (const key of normalizedIncludes) {
79
+ if (!(key in orchestration)) throw new TypeError(`未知编排合同子树: ${key}`);
80
+ }
81
+
82
+ const route = workUnitId ? orchestration.work_unit_routes?.[workUnitId] ?? null : null;
83
+ const gates = stageId ? lifecycle.gates.filter((gate) => gate.stage === stageId) : [];
84
+ const artifacts = stageId ? lifecycle.artifacts.filter((artifact) => artifact.stage === stageId) : [];
85
+ const evidenceIds = new Set(gates.flatMap((gate) => gate.evidence ?? []));
86
+ const selected = Object.fromEntries(normalizedIncludes.map((key) => [key, orchestration[key]]));
87
+ const transition = workUnitId ? {
88
+ next: orchestration.transition_graph?.routes?.[workUnitId] ?? [],
89
+ forbidden_shortcuts: (orchestration.transition_graph?.forbidden_shortcuts ?? [])
90
+ .filter((edge) => edge.from === workUnitId || edge.to === workUnitId),
91
+ } : null;
92
+
93
+ const result = {
94
+ schema_version: 1,
95
+ query: {
96
+ include: normalizedIncludes,
97
+ mode: mode ?? null,
98
+ stage: stageId ?? null,
99
+ work_unit: workUnitId ?? null,
100
+ },
101
+ sources: {
102
+ lifecycle_registry: {
103
+ ref: LIFECYCLE_REGISTRY_REF,
104
+ semantic_sha256: semanticDigest(lifecycle),
105
+ status: lifecycle.status,
106
+ },
107
+ orchestration_contract: {
108
+ ref: ORCHESTRATION_CONTRACT_REF,
109
+ sha256: sha256(read(ORCHESTRATION_CONTRACT_REF)),
110
+ },
111
+ skill_registry: {
112
+ ref: SKILL_REGISTRY_REF,
113
+ sha256: sha256(read(SKILL_REGISTRY_REF)),
114
+ status: skillRegistry.status,
115
+ },
116
+ },
117
+ lifecycle: {
118
+ artifacts,
119
+ evidence: lifecycle.evidence.filter((item) => evidenceIds.has(item.id)),
120
+ gates,
121
+ stage,
122
+ work_unit: workUnit,
123
+ },
124
+ execution: {
125
+ mode: mode ? orchestration.modes[mode] : null,
126
+ selected,
127
+ transition,
128
+ work_unit_route: route,
129
+ },
130
+ skills: selectedSkills(route, skillRegistry),
131
+ };
132
+ result.references = [...collectPathReferences(result), LIFECYCLE_REGISTRY_REF, ORCHESTRATION_CONTRACT_REF, SKILL_REGISTRY_REF]
133
+ .filter((value, index, all) => all.indexOf(value) === index)
134
+ .sort();
135
+ return canonicalize(result);
136
+ }
137
+
@@ -5,6 +5,7 @@ import { enforceFrontendDelivery } from "./frontend-delivery-boundary.mjs";
5
5
 
6
6
  const IMPLEMENTATION_WORK_UNIT = "work-unit.slice-implementation";
7
7
  const TICKET_DECOMPOSITION_WORK_UNIT = "work-unit.ticket-decomposition";
8
+ const REPOSITORY_PREPARATION_WORK_UNIT = "work-unit.implementation-repository-preparation";
8
9
 
9
10
  function deepFreeze(value) {
10
11
  if (!value || typeof value !== "object" || Object.isFrozen(value)) return value;
@@ -26,9 +27,10 @@ const NEXT_ROUTES = deepFreeze({
26
27
  "work-unit.discovery-requirements": ["work-unit.domain-strategy-design", "work-unit.stage-decision", "work-unit.spec-synthesis"],
27
28
  "work-unit.domain-strategy-design": ["work-unit.stage-decision", "work-unit.spec-synthesis"],
28
29
  "work-unit.stage-decision": ["work-unit.spec-synthesis"],
29
- "work-unit.spec-synthesis": ["work-unit.prototype-design", "work-unit.technical-analysis", TICKET_DECOMPOSITION_WORK_UNIT],
30
- "work-unit.prototype-design": ["work-unit.technical-analysis", TICKET_DECOMPOSITION_WORK_UNIT],
31
- "work-unit.technical-analysis": [TICKET_DECOMPOSITION_WORK_UNIT],
30
+ "work-unit.spec-synthesis": ["work-unit.prototype-design", "work-unit.technical-analysis", REPOSITORY_PREPARATION_WORK_UNIT],
31
+ "work-unit.prototype-design": ["work-unit.technical-analysis", REPOSITORY_PREPARATION_WORK_UNIT],
32
+ "work-unit.technical-analysis": [REPOSITORY_PREPARATION_WORK_UNIT],
33
+ [REPOSITORY_PREPARATION_WORK_UNIT]: [TICKET_DECOMPOSITION_WORK_UNIT],
32
34
  [TICKET_DECOMPOSITION_WORK_UNIT]: [IMPLEMENTATION_WORK_UNIT],
33
35
  [IMPLEMENTATION_WORK_UNIT]: ["work-unit.frontend-implementation-verification", "work-unit.code-review"],
34
36
  "work-unit.frontend-implementation-verification": ["work-unit.code-review"],
@@ -56,6 +58,15 @@ const BLOCKING_SIGNALS = Object.freeze({
56
58
  contractNotCurrent: "slice-contract-not-current",
57
59
  missingEvidence: "ticket-formalization-evidence-missing",
58
60
  stale: "ticket-formalization-stale",
61
+ repositoryDecisionRequired: "implementation-repository-decision-required",
62
+ repositoryLocationRequired: "implementation-repository-location-required",
63
+ repositoryOnboardingIncomplete: "implementation-repository-onboarding-incomplete",
64
+ scaffoldChoiceRequired: "scaffold-choice-required",
65
+ scaffoldContractUnapproved: "scaffold-contract-unapproved",
66
+ scaffoldGenerationIncomplete: "scaffold-generation-incomplete",
67
+ scaffoldVerificationFailed: "scaffold-verification-failed",
68
+ frontendTemplateUnavailable: "frontend-template-unavailable",
69
+ implementationRepositoriesStale: "implementation-repositories-stale",
59
70
  });
60
71
 
61
72
  const allowedResult = (evidenceRefs = []) => ({
@@ -130,9 +141,101 @@ export function validateNextRoute(currentWorkUnit, nextRoute, decisionState, opt
130
141
  }
131
142
  return blockedResult(signals, ["allowed_next_route"]);
132
143
  }
144
+ if (nextRoute === TICKET_DECOMPOSITION_WORK_UNIT) {
145
+ const readiness = validateImplementationRepositoriesReady(decisionState, options);
146
+ if (readiness.result === "blocked") return readiness;
147
+ }
133
148
  return decisionState ? validateDecisionBoundary(currentWorkUnit, decisionState, options) : allowedResult();
134
149
  }
135
150
 
151
+ /**
152
+ * Validate the aggregate stage-5 repository-preparation result. Every affected
153
+ * delivery role must resolve to an onboarded existing repository or a freshly
154
+ * generated and verified scaffold. Unaffected roles need an explicit reason.
155
+ */
156
+ export function validateImplementationRepositoriesReady(state, { exists = existsSync } = {}) {
157
+ const preparation = state?.implementation_repository_preparation;
158
+ const impacts = state?.delivery_impacts;
159
+ const signals = [];
160
+ const missing = [];
161
+ const evidenceRefs = Array.isArray(preparation?.evidence_refs) ? preparation.evidence_refs : [];
162
+
163
+ if (!preparation || preparation.result !== "completed" || !Array.isArray(preparation.projects)) {
164
+ return blockedResult([BLOCKING_SIGNALS.repositoryDecisionRequired], ["completed implementation_repository_preparation with projects"]);
165
+ }
166
+ if (preparation.current_version !== true || state?.implementation_repositories_stale === true) {
167
+ signals.push(BLOCKING_SIGNALS.implementationRepositoriesStale);
168
+ missing.push("implementation repository preparation is current");
169
+ }
170
+ if (evidenceRefs.length === 0 || evidenceRefs.some((ref) => !isReadable(ref, exists))) {
171
+ signals.push(BLOCKING_SIGNALS.repositoryOnboardingIncomplete);
172
+ missing.push("readable implementation_repository_preparation.evidence_refs");
173
+ }
174
+
175
+ for (const role of ["backend", "frontend"]) {
176
+ const affected = impacts?.[role] === true;
177
+ const projects = preparation.projects.filter((project) => project?.delivery_role === role);
178
+ if (affected && projects.length === 0) {
179
+ signals.push(BLOCKING_SIGNALS.repositoryDecisionRequired);
180
+ missing.push(`${role} repository decision`);
181
+ }
182
+ if (!affected && projects.length === 0) {
183
+ signals.push(BLOCKING_SIGNALS.repositoryDecisionRequired);
184
+ missing.push(`${role} not-applicable decision with reason`);
185
+ }
186
+ for (const project of projects) {
187
+ if (!hasText(project.project_id) || !hasText(project.status)) {
188
+ signals.push(BLOCKING_SIGNALS.repositoryDecisionRequired);
189
+ missing.push(`${role} project_id and status`);
190
+ continue;
191
+ }
192
+ if (project.status === "not-applicable") {
193
+ if (affected || !hasText(project.reason)) {
194
+ signals.push(BLOCKING_SIGNALS.repositoryDecisionRequired);
195
+ missing.push(`${project.project_id} not-applicable reason for an unaffected role`);
196
+ }
197
+ continue;
198
+ }
199
+ if (!hasText(project.repository_ref) || !hasText(project.project_root) || !hasText(project.repository_scope)) {
200
+ signals.push(BLOCKING_SIGNALS.repositoryLocationRequired);
201
+ missing.push(`${project.project_id} repository_ref, project_root and repository_scope`);
202
+ }
203
+ if (project.status === "existing-and-onboarded") {
204
+ if (project.onboarding_result?.status !== "completed" || !isReadable(project.onboarding_result?.ref, exists)) {
205
+ signals.push(BLOCKING_SIGNALS.repositoryOnboardingIncomplete);
206
+ missing.push(`${project.project_id} readable completed onboarding result`);
207
+ }
208
+ } else if (project.status === "initialized-and-verified") {
209
+ if (role === "backend" && !hasText(project.architecture_family)) {
210
+ signals.push(BLOCKING_SIGNALS.scaffoldChoiceRequired);
211
+ missing.push(`${project.project_id} confirmed backend architecture_family`);
212
+ }
213
+ const contract = project.scaffold_contract;
214
+ if (![3, 4].includes(contract?.schema_version) || contract?.status !== "approved" || contract?.persisted !== true || contract?.current_version !== true || (role === "frontend" && contract?.schema_version !== 4)) {
215
+ signals.push(BLOCKING_SIGNALS.scaffoldContractUnapproved);
216
+ missing.push(`${project.project_id} approved persisted current scaffold contract`);
217
+ }
218
+ if (!isReadable(project.scaffold_manifest_ref, exists)) {
219
+ signals.push(BLOCKING_SIGNALS.scaffoldGenerationIncomplete);
220
+ missing.push(`${project.project_id} readable scaffold manifest`);
221
+ }
222
+ if (project.scaffold_verification?.status !== "passed" || !isReadable(project.scaffold_verification?.ref, exists)) {
223
+ signals.push(BLOCKING_SIGNALS.scaffoldVerificationFailed);
224
+ missing.push(`${project.project_id} readable passed scaffold verification`);
225
+ }
226
+ if (role === "frontend" && project.template_available !== true) {
227
+ signals.push(BLOCKING_SIGNALS.frontendTemplateUnavailable);
228
+ missing.push(`${project.project_id} verified frontend template source`);
229
+ }
230
+ } else {
231
+ signals.push(BLOCKING_SIGNALS.repositoryDecisionRequired);
232
+ missing.push(`${project.project_id} supported repository preparation status`);
233
+ }
234
+ }
235
+ }
236
+ return signals.length === 0 ? allowedResult(evidenceRefs) : blockedResult(signals, missing, evidenceRefs);
237
+ }
238
+
136
239
  function validateDecisionBoundary(workUnit, state, options) {
137
240
  try { assertWorkUnitUserDecision(workUnit, state, options); return allowedResult(); }
138
241
  catch (error) { return blockedResult([error.code || "user-decision-invalid"], [error.message]); }
@@ -145,6 +248,8 @@ function validateDecisionBoundary(workUnit, state, options) {
145
248
  export function validateTicketFormalization(state, { exists = existsSync, read = (ref) => readFileSync(ref, "utf8"), ...decisionOptions } = {}) {
146
249
  try { enforceFrontendDelivery(state, { root: decisionOptions.root, phase: "implementation" }); }
147
250
  catch (error) { return blockedResult(["frontend-delivery-blocked"], [error.message]); }
251
+ const repositoryResult = validateImplementationRepositoriesReady(state, { exists });
252
+ if (repositoryResult.result === "blocked") return repositoryResult;
148
253
  const decomposition = state?.ticket_decomposition_result;
149
254
  const ticket = state?.vertical_slice_ticket;
150
255
  const contract = state?.slice_contract;
@@ -276,6 +381,7 @@ export function validateImplementationEntry(state, options = {}) {
276
381
  export const lifecycleTransitionContract = Object.freeze({
277
382
  implementation_work_unit: IMPLEMENTATION_WORK_UNIT,
278
383
  ticket_decomposition_work_unit: TICKET_DECOMPOSITION_WORK_UNIT,
384
+ repository_preparation_work_unit: REPOSITORY_PREPARATION_WORK_UNIT,
279
385
  next_routes: NEXT_ROUTES,
280
386
  blocking_signals: BLOCKING_SIGNALS,
281
387
  });
@@ -76,7 +76,9 @@ function validateInvocationBoundary(data) {
76
76
  ensure(routes?.["work-unit.frontend-implementation-verification"]?.skills?.includes("code-review") && routes?.["work-unit.frontend-implementation-verification"]?.applies_when === "ui_impact", "前端还原验证未绑定 UI fidelity 审查轴");
77
77
  const reviewRoute = routes?.["work-unit.code-review"];
78
78
  ensure(reviewRoute?.primary_skill === "code-review" && reviewRoute?.review_standards_route?.unique_default_skill === "code-review" && reviewRoute?.review_standards_route?.second_generic_review_skill === "forbidden", "code-review 不是唯一默认审查入口或允许第二套通用审查 skill");
79
- ensure(includesAll(reviewRoute?.supporting_skills, ["alibaba-java-code-style", "yss-ui", "yss-domain"]) && includesAll(reviewRoute?.skills, ["code-review", "alibaba-java-code-style", "yss-ui"]), "审查工作单元缺少 YSS / Alibaba 专项检查输入");
79
+ ensure(includesAll(reviewRoute?.supporting_skills, ["alibaba-java-code-style", "yss-ui", "yss-domain", "yss-repository", "yss-mybatis"]) && includesAll(reviewRoute?.skills, ["code-review", "alibaba-java-code-style", "yss-ui", "yss-repository", "yss-mybatis"]), "审查工作单元缺少 YSS / Alibaba / Repository / MyBatis 专项检查输入");
80
+ const reviewScope = reviewRoute?.review_standards_route?.project_scope;
81
+ ensure(includesAll(reviewScope?.sources, ["candidate-project-root", "implementation-repository-registry", "slice-project-roots", "allowed-write-paths"]) && includesAll(reviewScope?.include, ["project-itself", "registered-backend-development-projects"]) && includesAll(reviewScope?.exclude, ["frontend-projects", "unrelated-submodules", "vendor", "unregistered-directories"]) && reviewScope?.fixed_apps_backend_assumption === "forbidden", "后端审查范围未绑定本体项目与已登记后端研发项目,或仍固定为 apps/backend");
80
82
  const disposition = reviewRoute?.review_standards_route?.finding_disposition;
81
83
  ensure(includesAll(disposition?.same_loop_for, ["product-slice", "template-maintenance"]) && disposition?.reviewer_write_implementation === "forbidden", "审查 finding 闭环未同时覆盖产品切片与模板维护,或允许审查者写实现");
82
84
  ensure(includesAll(disposition?.repair_then_full_rereview?.kinds, ["violation", "machine_check_failure", "blank_applicable_row", "missing_evidence"]) && disposition?.repair_then_full_rereview?.actor === "implementer" && disposition?.repair_then_full_rereview?.then === "recapture_candidate_and_rerun_all_axes", "violation 类 finding 未要求实现者修复后全轴复审");
@@ -125,6 +127,8 @@ function validateWorkflowExecutionResult(payload, contract, workUnitRoutes) {
125
127
  const implementationState = {
126
128
  user_decisions: payload.user_decisions,
127
129
  slice_contract_ref: payload.slice_contract_ref,
130
+ delivery_impacts: payload.delivery_impacts,
131
+ implementation_repository_preparation: payload.implementation_repository_preparation,
128
132
  tracker_kind: payload.tracker_kind,
129
133
  predecessor_work_unit: payload.predecessor_work_unit,
130
134
  ready_for_agent: payload.ready_for_agent,
@@ -164,18 +168,15 @@ function validateInvocationMetadata(boundary, skillContents) {
164
168
  for (const skill of boundary.model_invoked_skills) ensure(!skillContents(skill).includes("disable-model-invocation: true"), `${skill} 不应出现在 model-invoked 白名单`);
165
169
  }
166
170
 
167
- function validateMattProse(skill, adapter) {
168
- ensure(skill.includes("不得写生命周期资产或改变门禁/Ticket 状态") && skill.includes("任何写入前回交本编排器"), "主技能缺少 direct Matt 只导航并回交的说明");
169
- ensure(adapter.includes("仅发现旧路径资产") && adapter.includes("不得调用 `setup-matt-pocock-skills`"), "适配器缺少 setup 旧资产迁移或显式用户入口条件");
170
- ensure(adapter.includes("frontier 为空") && adapter.includes("双方共同理解已确认"), "适配器缺少 grill_exit 的 frontier 或共同理解条件");
171
- ensure(skill.includes("自然语言意向不构成上述结构化 Git 授权") && adapter.includes("本身不是结构化授权"), "主技能或适配器缺少自然语言 Git 意向不是授权的说明");
172
- ensure(adapter.includes("禁止 detached HEAD 提交") && adapter.includes("先推子仓再更新父仓 gitlink"), "适配器缺少 git-submodule 嵌套 Git 授权说明");
173
- }
174
-
175
- function validateInvocationProse(skill, adapter, orchestration) {
176
- ensure(skill.includes("不得自动调用它们或代替其创建正式资产") && skill.includes("Workflow Execution Result"), "主技能未限制 user-invoked 调用或未采用新结果协议");
177
- ensure(adapter.includes("workflow reference 不表示调用") && adapter.includes("正式 Spec、Ticket 或实现资产仍只能由对应显式用户入口创建"), "适配器未限制 workflow reference 的正式资产所有权");
178
- ensure(orchestration.includes("只实际调用允许的 model-invoked skill") && orchestration.includes("用户显式启动"), "编排协议未区分 model-invoked 原语和显式用户入口");
171
+ function validateLifecycleEntrySkill(skill) {
172
+ ensure(/^---\nname: yss-product-lifecycle\n/m.test(skill), "生命周期入口缺少有效 frontmatter");
173
+ ensure(Buffer.byteLength(skill) <= 8192, "生命周期入口超过 8KB 上下文预算");
174
+ for (const reference of ["docs/process/lifecycle-registry.yaml", "references/orchestration-contract.yaml", "docs/agents/yss-skill-registry.yaml", "scripts/query-lifecycle-context"]) {
175
+ ensure(skill.includes(reference), `生命周期入口缺少权威引用: ${reference}`);
176
+ }
177
+ for (const heading of ["### 仓库身份", "### 流转与实现", "### 用户决定", "### 外部副作用与 Git"]) {
178
+ ensure(skill.includes(heading), `生命周期入口缺少边界分组: ${heading}`);
179
+ }
179
180
  }
180
181
 
181
182
  const profiles = {
@@ -192,7 +193,7 @@ const profiles = {
192
193
  prototype: {
193
194
  message: "原型到后端脚手架及后续 YSS 代码生成压力场景验证通过",
194
195
  files: [".agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs", ".agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml"],
195
- markers: [[".agents/skills/yss-product-lifecycle/SKILL.md", "controlled-generation"]]
196
+ markers: [[".agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml", "controlled-generation"]]
196
197
  },
197
198
  implementationContractCompiler: {
198
199
  message: "YSS implementation contract compiler stage 7 scenarios passed",
@@ -248,7 +249,10 @@ export function runScenario(name) {
248
249
  { from: "work-unit.spec-synthesis", to: "work-unit.slice-implementation" },
249
250
  { from: "work-unit.prototype-design", to: "work-unit.slice-implementation" },
250
251
  { from: "work-unit.technical-analysis", to: "work-unit.slice-implementation" },
251
- ]), "生命周期转换图缺少 Spec/原型/技术分析到实现的越级阻断");
252
+ { from: "work-unit.technical-analysis", to: "work-unit.ticket-decomposition" },
253
+ ]), "生命周期转换图缺少工程准备、Ticket 正式化与实现越级阻断");
254
+ ensure(contract.transition_graph?.routes?.["work-unit.implementation-repository-preparation"]?.includes("work-unit.ticket-decomposition"), "实现仓库准备未成为 Ticket 正式化前置");
255
+ ensure(contract.implementation_repository_preparation?.gate === "gate.implementation-repositories-ready", "实现仓库准备聚合门禁缺失");
252
256
  ensure(lifecycleTransitionContract.next_routes["work-unit.ticket-decomposition"]?.includes("work-unit.slice-implementation"), "转换校验器未允许 Ticket 正式化后进入实现");
253
257
  ensure(contract.release_readiness?.conditional?.ui_impact?.includes("gate.frontend-implementation-verified") && contract.frontend_implementation_plan?.acceptance?.includes("no_template_placeholders"), "发布公式或前端计划实质校验不完整");
254
258
  const templateRejected = spawnSync("scripts/verify-frontend-implementation-evidence", ["docs/process/templates/frontend-implementation-plan-template.yaml"], { cwd: root, encoding: "utf8" });
@@ -275,7 +279,7 @@ export function runScenario(name) {
275
279
  changed_artifacts: [],
276
280
  new_impacts: [],
277
281
  stale_candidates: [],
278
- next_route: "work-unit.ticket-decomposition",
282
+ next_route: "work-unit.implementation-repository-preparation",
279
283
  blocking_signals: []
280
284
  };
281
285
  validateWorkflowExecutionResult(validResult, data.workflow_execution_result, data.work_unit_routes);
@@ -304,6 +308,14 @@ export function runScenario(name) {
304
308
  slice_contract_status: "approved",
305
309
  slice_contract_persisted: true,
306
310
  slice_contract_current_version: true,
311
+ delivery_impacts: { backend: true, frontend: false },
312
+ implementation_repository_preparation: {
313
+ result: "completed", current_version: true, evidence_refs: ["docs/process/lifecycle-registry.yaml"],
314
+ projects: [
315
+ { project_id: "backend", delivery_role: "backend", status: "existing-and-onboarded", repository_ref: "git://backend", project_root: "/workspace/backend", repository_scope: "external-repository", onboarding_result: { status: "completed", ref: "docs/process/lifecycle-registry.yaml" } },
316
+ { project_id: "frontend-na", delivery_role: "frontend", status: "not-applicable", reason: "no frontend impact" },
317
+ ],
318
+ },
307
319
  };
308
320
  validateWorkflowExecutionResult(validImplementationResult, data.workflow_execution_result, data.work_unit_routes);
309
321
  for (const mutate of [
@@ -377,16 +389,7 @@ export function runScenario(name) {
377
389
  ensure(rejected, "Matt/YSS 契约变异未被 baseline oracle 拒绝");
378
390
  }
379
391
  const skill = read(".agents/skills/yss-product-lifecycle/SKILL.md");
380
- const adapter = read(".agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md");
381
- const orchestration = read(".agents/skills/yss-product-lifecycle/references/orchestration.md");
382
- validateMattProse(skill, adapter);
383
- validateInvocationProse(skill, adapter, orchestration);
384
- let proseRejected = false;
385
- try { validateMattProse(skill.replace("任何写入前回交本编排器", "允许直接写入"), adapter); } catch { proseRejected = true; }
386
- ensure(proseRejected, "Matt/YSS prose 变异未被 baseline oracle 拒绝");
387
- let invocationProseRejected = false;
388
- try { validateInvocationProse(skill.replace("不得自动调用它们或代替其创建正式资产", "可以自动调用并创建正式资产"), adapter, orchestration); } catch { invocationProseRejected = true; }
389
- ensure(invocationProseRejected, "调用边界 prose 变异未被 baseline oracle 拒绝");
392
+ validateLifecycleEntrySkill(skill);
390
393
  for (const relative of ["SKILL.md", "references/matt-yss-adapter.md", "references/orchestration-contract.yaml"]) {
391
394
  ensure(read(`.agents/skills/yss-product-lifecycle/${relative}`) === read(`.codex/skills/yss-product-lifecycle/${relative}`), `YSS 生命周期投影未同步: ${relative}`);
392
395
  }
@@ -166,6 +166,10 @@ function validateReviewInputFinding(reviewInput) {
166
166
  if (reviewInput.completed_requires_no_open_mandatory_violations !== true) fail("未关闭的 mandatory violation 不得 completed");
167
167
  if (reviewInput.completed_requires_no_blank_applicable_rows !== true) fail("适用报告行空白不得 completed");
168
168
  if (reviewInput.reviewer_write_implementation !== "forbidden") fail("review_input 禁止审查者写实现");
169
+ requireObject(reviewInput.scope_resolution, "review_input.scope_resolution");
170
+ requireStringSet(reviewInput.scope_resolution.sources, ["candidate-project-root", "implementation-repository-registry", "slice-project-roots", "allowed-write-paths"], "review_input.scope_resolution.sources");
171
+ requireStringSet(reviewInput.scope_resolution.backend_includes, ["project-itself", "registered-backend-development-projects"], "review_input.scope_resolution.backend_includes");
172
+ requireStringSet(reviewInput.scope_resolution.excludes, ["frontend-projects", "unrelated-submodules", "vendor", "unregistered-directories"], "review_input.scope_resolution.excludes");
169
173
  }
170
174
 
171
175
  function validateCodeReviewRoute(route, resolve) {
@@ -180,6 +184,11 @@ function validateCodeReviewRoute(route, resolve) {
180
184
  if (standards.contract_required_skills !== "required") fail("Standards 必须消费 Slice 合同 required_skills");
181
185
  requireString(standards.report_template, "review_standards_route.report_template");
182
186
  if (!existsSync(path.join(ROOT, standards.report_template))) fail(`审查报告模板不存在: ${standards.report_template}`);
187
+ requireObject(standards.project_scope, "review_standards_route.project_scope");
188
+ requireStringSet(standards.project_scope.sources, ["candidate-project-root", "implementation-repository-registry", "slice-project-roots", "allowed-write-paths"], "review_standards_route.project_scope.sources");
189
+ requireStringSet(standards.project_scope.include, ["project-itself", "registered-backend-development-projects"], "review_standards_route.project_scope.include");
190
+ requireStringSet(standards.project_scope.exclude, ["frontend-projects", "unrelated-submodules", "vendor", "unregistered-directories"], "review_standards_route.project_scope.exclude");
191
+ if (standards.project_scope.fixed_apps_backend_assumption !== "forbidden") fail("code-review 不得把后端审查范围固定为 apps/backend");
183
192
  const conditional = standards.conditional_skills;
184
193
  if (!conditional || typeof conditional !== "object" || Array.isArray(conditional)) {
185
194
  fail("review_standards_route.conditional_skills 必须是对象");
@@ -3,6 +3,7 @@ import path from 'node:path';
3
3
  import { spawnSync } from 'node:child_process';
4
4
  import { openBundle } from './strategic-handoff.mjs';
5
5
  import { read, safe, ensure, ROOT, digest, project } from './strategic-handoff-io.mjs';
6
+ import { designTargets } from './strategic-handoff-design-targets.mjs';
6
7
  import { parseContextContract } from './context-contract.mjs';
7
8
  const present=x=>typeof x==='string'&&x.trim();
8
9
  const list=x=>Array.isArray(x)&&x.length&&x.every(present);
@@ -14,6 +15,7 @@ const strategyBasis=value=>({
14
15
  export async function verifyConsumption(data,{root=process.cwd(),sliceRef,consumer='tactical'}={}) {
15
16
  project(root);
16
17
  ensure(['tactical','frontend'].includes(consumer),'未知战略消费者');
18
+ if (data.schema_version === 2 && consumer === 'tactical') ensure(['domain-driven','layered-mvc'].includes(data.architecture?.family), '未知技术设计架构');
17
19
  if (sliceRef) ensure(data.status === (consumer==='frontend'?'accepted':'approved'), consumer==='frontend'?'前端接收记录尚未 accepted':'切片只能消费 approved 战术合同');
18
20
  const binding=data.strategic_handoff;
19
21
  ensure(binding && present(binding.import_receipt_ref) && present(binding.context_reconciliation_ref),'缺少战略交接导入收据与目标对账引用');
@@ -42,9 +44,7 @@ export async function verifyConsumption(data,{root=process.cwd(),sliceRef,consum
42
44
  const rows=new Map();for(const row of binding.rows){ensure(!rows.has(row.source_id),`重复承接: ${row.source_id}`);rows.set(row.source_id,row);}
43
45
  const issues=[], blocked=new Set();let all=false;
44
46
  const mark=(id,reason,row)=>{issues.push({source_id:id,reason});if(row?.dependency_status!=='known'||!list(row.dependent_slice_refs))all=true;else row.dependent_slice_refs.forEach(x=>blocked.add(x));};
45
- const catalogs=['aggregate_catalog','entity_catalog','value_object_catalog','behavior_catalog','invariant_catalog','state_transition_catalog','domain_event_catalog','gateway_catalog'];
46
- const ids=new Set(catalogs.flatMap(k=>(data[k]||[]).flatMap(x=>Object.entries(x).filter(([k])=>k.endsWith('_id')).map(([,v])=>v))));
47
- const seams=new Map((data.test_seams||[]).map(x=>[x.seam_id,x]));
47
+ const { ids, seams } = designTargets(data);
48
48
  const cases=new Map((data.frontend_cases||[]).map(x=>[x.case_id,x]));
49
49
  for(const[id,source]of known){
50
50
  const row=rows.get(id);
@@ -77,7 +77,7 @@ export async function verifyConsumption(data,{root=process.cwd(),sliceRef,consum
77
77
  all=true;issues.push({source_id:'strategic-design-basis',reason:'upstream-design-stale'});
78
78
  }
79
79
  const blockedHere=all||(sliceRef?blocked.has(sliceRef):issues.length>0);
80
- return {result:blockedHere?'blocked':'verified',bundle_digest:current.manifest.bundle_digest,consumed_bundle_digest:receipt.bundle_digest,...(consumer==='frontend'?{frontend_acceptance_digest:digest(data)}:{tactical_digest:digest(data)}),scope:sliceRef||`whole-${consumer}-design`,coverage_complete:[...known.keys()].every(id=>rows.has(id)),block_all:all,blocked_slice_refs:[...blocked].sort(),issues};
80
+ return {result:blockedHere?'blocked':'verified',bundle_digest:current.manifest.bundle_digest,consumed_bundle_digest:receipt.bundle_digest,...(consumer==='frontend'?{frontend_acceptance_digest:digest(data)}:{tactical_digest:digest(data), ...(data.schema_version === 2 ? {technical_design_digest:digest(data)} : {})}),scope:sliceRef||`whole-${consumer}-design`,coverage_complete:[...known.keys()].every(id=>rows.has(id)),block_all:all,blocked_slice_refs:[...blocked].sort(),issues};
81
81
  });
82
82
  });
83
83
  }
@@ -0,0 +1,15 @@
1
+ import { ensure } from './strategic-handoff-io.mjs';
2
+
3
+ export function designTargets(data) {
4
+ const design = data.schema_version === 2 ? data.design : data;
5
+ const catalogs = data.schema_version === 2 && data.architecture?.family === 'layered-mvc'
6
+ ? ['module_catalog', 'use_case_catalog', 'rule_catalog', 'state_transition_catalog', 'persistence_mapping', 'integration_catalog']
7
+ : ['aggregate_catalog', 'entity_catalog', 'value_object_catalog', 'behavior_catalog', 'invariant_catalog', 'state_transition_catalog', 'domain_event_catalog', 'gateway_catalog'];
8
+ const primaryKeys = { module_catalog: 'module_id', use_case_catalog: 'use_case_id', rule_catalog: 'rule_id', state_transition_catalog: 'transition_id', persistence_mapping: 'mapping_id', integration_catalog: 'integration_id', aggregate_catalog: 'aggregate_id', entity_catalog: 'entity_id', value_object_catalog: 'value_object_id', behavior_catalog: 'behavior_id', invariant_catalog: 'invariant_id', domain_event_catalog: 'event_id', gateway_catalog: 'gateway_id' };
9
+ const ids = catalogs.flatMap(key => (design?.[key] || []).map(item => item[primaryKeys[key]]).filter(Boolean));
10
+ ensure(new Set(ids).size === ids.length, '设计对象 ID 重复');
11
+ const seams = design?.test_seams || [];
12
+ ensure(new Set(seams.map(item => item.seam_id)).size === seams.length, '测试 seam ID 重复');
13
+ return { ids: new Set(ids), seams: new Map(seams.map(item => [item.seam_id, item])) };
14
+ }
15
+
@@ -0,0 +1,23 @@
1
+ import path from 'node:path';
2
+ import { readFileSync } from 'node:fs';
3
+ import { spawnSync } from 'node:child_process';
4
+ import { ROOT, read, safe, ensure, hash } from './strategic-handoff-io.mjs';
5
+
6
+ // The compiler's synchronous boundary reruns the design verifier against current files.
7
+ export function enforceTechnicalDesign(state = {}, { root = ROOT } = {}) {
8
+ const binding = state.technical_design;
9
+ const affected = (state.conditions || []).some(value => ['backend-technical-design-impact','tactical-domain','tactical-domain-impact','aggregate-impact','state-machine-impact','invariant-impact','consistency-impact','domain-event-impact','gateway-boundary-impact','persistence-mapping-impact'].includes(value));
10
+ if (!binding && !affected) return;
11
+ ensure(binding?.ref && binding?.digest && binding?.version, '缺少已批准技术设计绑定');
12
+ ensure(state.slice_id, '技术设计消费必须绑定切片 ID');
13
+ const file = safe(root, binding.ref);
14
+ ensure(hash(readFileSync(file)) === binding.digest, '技术设计绑定摘要漂移');
15
+ const data = read(file);
16
+ ensure(data.status === 'approved' && data.version === binding.version, '技术设计必须为批准且绑定版本');
17
+ const family = data.schema_version === 1 && binding.legacy_ddd === true ? 'domain-driven' : data.architecture?.family;
18
+ ensure(family && family === state.architecture_identity?.architecture_family, '技术设计与实现架构不匹配');
19
+ const args = [path.join(ROOT, '.agents/skills/yss-technical-design/scripts/validate-technical-design.mjs'), file, '--root', root, '--slice', state.slice_id];
20
+ if (binding.legacy_ddd === true) args.push('--legacy-ddd');
21
+ const verified = spawnSync(process.execPath, args, { cwd: root, encoding: 'utf8', timeout: 60000, maxBuffer: 2 * 1024 * 1024 });
22
+ ensure(verified.status === 0, `技术设计不可消费: ${verified.error?.message || verified.stderr}`);
23
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from "node:util";
3
+ import { queryLifecycleContext } from "./lib/lifecycle-context-query.mjs";
4
+
5
+ try {
6
+ const { values } = parseArgs({
7
+ options: {
8
+ mode: { type: "string" },
9
+ stage: { type: "string" },
10
+ "work-unit": { type: "string" },
11
+ include: { type: "string", multiple: true },
12
+ },
13
+ strict: true,
14
+ });
15
+ const result = queryLifecycleContext({
16
+ mode: values.mode,
17
+ stageId: values.stage,
18
+ workUnitId: values["work-unit"],
19
+ include: values.include ?? [],
20
+ });
21
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
22
+ } catch (error) {
23
+ process.stderr.write(`${error.message}\n`);
24
+ process.exitCode = 1;
25
+ }
@@ -7,9 +7,10 @@ const root=path.resolve(import.meta.dirname,'..');
7
7
  const check=process.argv.includes('--check');
8
8
  const targets=['submodules/yss-harness-design-agent','submodules/yss-harness-dev-agent','submodules/yss-harness-backend-agent','submodules/yss-harness-frontend-agent'];
9
9
  const shared=['scripts/strategic-handoff','scripts/verify-strategic-handoff-consumption','scripts/verify-strategic-handoff-package-scenarios','scripts/verify-strategic-context-import','scripts/verify-strategic-context-import-scenarios','scripts/lib/context-contract.mjs','docs/process/strategic-handoff-package.md','docs/process/schemas/strategic-design-handoff.schema.json',...readdirSync(path.join(root,'scripts/lib')).filter(x=>x.startsWith('strategic-handoff-')||x==='strategic-handoff.mjs').map(x=>`scripts/lib/${x}`),...readdirSync(path.join(root,'docs/process/schemas')).filter(x=>x.startsWith('strategic-handoff-')).map(x=>`docs/process/schemas/${x}`),...readdirSync(path.join(root,'scripts/fixtures/strategic-handoff')).map(x=>`scripts/fixtures/strategic-handoff/${x}`)];
10
- shared.push('scripts/instantiate-harness','scripts/lib/harness-execution-scope.mjs','scripts/backend-delivery','scripts/verify-frontend-delivery','scripts/lib/backend-delivery.mjs','scripts/lib/frontend-delivery.mjs','scripts/lib/frontend-delivery-boundary.mjs','docs/process/frontend-backend-delivery.md','docs/process/schemas/backend-delivery.schema.json','docs/process/schemas/backend-delivery-verification.schema.json','docs/process/schemas/frontend-delivery-acceptance.schema.json');
10
+ shared.push('scripts/instantiate-harness','scripts/backend-delivery','scripts/verify-frontend-delivery','scripts/lib/backend-delivery.mjs','scripts/lib/frontend-delivery.mjs','scripts/lib/frontend-delivery-boundary.mjs','docs/process/frontend-backend-delivery.md','docs/process/schemas/backend-delivery.schema.json','docs/process/schemas/backend-delivery-verification.schema.json','docs/process/schemas/frontend-delivery-acceptance.schema.json');
11
11
  let differences=[];
12
- function sync(source,dest){const bytes=readFileSync(source);if(!existsSync(dest)||!bytes.equals(readFileSync(dest))){differences.push(path.relative(root,dest));if(!check){mkdirSync(path.dirname(dest),{recursive:true});writeFileSync(dest,bytes);}}if(!check&&path.basename(path.dirname(dest))==='scripts'&&!path.extname(dest))chmodSync(dest,0o755);}
12
+ // 专职执行范围由各模板持有;后端只消费 wire 校验器,不恢复原型构建技能。
13
+ function sync(source,dest){let bytes=readFileSync(source);if(dest.includes('/yss-harness-backend-agent/')){let content=bytes.toString();if(dest.endsWith('/scripts/lib/strategic-handoff.mjs'))content=content.replace('../../.agents/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs','./visual-baseline-contract.mjs');if(dest.endsWith('/scripts/fixtures/strategic-handoff/fixture.mjs'))content=content.replace('../../../.agents/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs','../../lib/visual-baseline-contract.mjs');bytes=Buffer.from(content);}if(!existsSync(dest)||!bytes.equals(readFileSync(dest))){differences.push(path.relative(root,dest));if(!check){mkdirSync(path.dirname(dest),{recursive:true});writeFileSync(dest,bytes);}}if(!check&&path.basename(path.dirname(dest))==='scripts'&&!path.extname(dest))chmodSync(dest,0o755);}
13
14
  for(const kind of ['domain-strategy','stage-decision-package'])sync(path.join(root,`.agents/skills/yss-stage-decision/references/${kind}.schema.json`),path.join(root,`docs/process/schemas/strategic-handoff-${kind}.schema.json`));
14
15
  for(const target of targets){
15
16
  if(!existsSync(path.join(root,target,'.git')))continue;
@@ -25,13 +25,6 @@ for (const relativePath of PUBLIC_FILES) {
25
25
  }
26
26
  }
27
27
 
28
- const lifecycle = read(".agents/skills/yss-product-lifecycle/SKILL.md");
29
- for (const phrase of [
30
- "机会与目标 → 业务故事 → 责任与交接 → 规则、例子与疑问 → 可验收需求 → 页面验证 → 业务任务 → 交接研发",
31
- "业务方案总览",
32
- "不成为新的事实源",
33
- ]) assert.match(lifecycle, new RegExp(phrase));
34
-
35
28
  const registry = read("docs/process/lifecycle-registry.yaml");
36
29
  for (const stableId of ["work-unit.domain-strategy-design", "artifact.domain-strategy", "gate.domain-strategy-approved"]) {
37
30
  assert.match(registry, new RegExp(`id: ${stableId.replaceAll(".", "\\.")}`));
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../.agents/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs";