create-yss-spec 2.2.2 → 2.2.4

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 (356) hide show
  1. package/README.md +17 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +15 -1
  4. package/src/self-update.js +277 -0
  5. package/template/.agents/skills/yss-domain/SKILL.md +5 -4
  6. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +9 -9
  7. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  8. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  9. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  10. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  11. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +9 -4
  12. package/template/.agents/skills/yss-router/SKILL.md +5 -3
  13. package/template/.agents/skills/yss-router/references/router-contract.yaml +18 -3
  14. package/template/.agents/skills/yss-router/references/slice-implementation-contract.md +59 -1
  15. package/template/.agents/skills/yss-stage-decision/SKILL.md +50 -0
  16. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  17. package/template/.agents/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  18. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  19. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  20. package/template/.agents/skills/yss-stage-decision/references/validation-rules.md +18 -0
  21. package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  22. package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  23. package/template/.agents/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  24. package/template/.agents/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  25. package/template/.agents/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  26. package/template/.agents/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  27. package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  28. package/template/.agents/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  29. package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  30. package/template/.agents/skills/yss-tactical-design/SKILL.md +33 -0
  31. package/template/.agents/skills/yss-tactical-design/agents/openai.yaml +4 -0
  32. package/template/.agents/skills/yss-tactical-design/references/output-template.md +28 -0
  33. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  34. package/template/.agents/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  35. package/template/.agents/skills/yss-tactical-design/references/validation-rules.md +13 -0
  36. package/template/.agents/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  37. package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  38. package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  39. package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  40. package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  41. package/template/.agents/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  42. package/template/.agents/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  43. package/template/.agents/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  44. package/template/.claude/skills/yss-domain/SKILL.md +5 -4
  45. package/template/.claude/skills/yss-product-lifecycle/SKILL.md +9 -9
  46. package/template/.claude/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  47. package/template/.claude/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  48. package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  49. package/template/.claude/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  50. package/template/.claude/skills/yss-product-lifecycle/references/state-model.md +9 -4
  51. package/template/.claude/skills/yss-router/SKILL.md +5 -3
  52. package/template/.claude/skills/yss-router/references/router-contract.yaml +18 -3
  53. package/template/.claude/skills/yss-router/references/slice-implementation-contract.md +59 -1
  54. package/template/.claude/skills/yss-stage-decision/SKILL.md +50 -0
  55. package/template/.claude/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  56. package/template/.claude/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  57. package/template/.claude/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  58. package/template/.claude/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  59. package/template/.claude/skills/yss-stage-decision/references/validation-rules.md +18 -0
  60. package/template/.claude/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  61. package/template/.claude/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  62. package/template/.claude/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  63. package/template/.claude/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  64. package/template/.claude/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  65. package/template/.claude/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  66. package/template/.claude/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  67. package/template/.claude/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  68. package/template/.claude/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  69. package/template/.claude/skills/yss-tactical-design/SKILL.md +33 -0
  70. package/template/.claude/skills/yss-tactical-design/agents/openai.yaml +4 -0
  71. package/template/.claude/skills/yss-tactical-design/references/output-template.md +28 -0
  72. package/template/.claude/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  73. package/template/.claude/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  74. package/template/.claude/skills/yss-tactical-design/references/validation-rules.md +13 -0
  75. package/template/.claude/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  76. package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  77. package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  78. package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  79. package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  80. package/template/.claude/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  81. package/template/.claude/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  82. package/template/.claude/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  83. package/template/.codex/skills/yss-domain/SKILL.md +5 -4
  84. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +9 -9
  85. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  86. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  87. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  88. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  89. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +9 -4
  90. package/template/.codex/skills/yss-router/SKILL.md +5 -3
  91. package/template/.codex/skills/yss-router/references/router-contract.yaml +18 -3
  92. package/template/.codex/skills/yss-router/references/slice-implementation-contract.md +59 -1
  93. package/template/.codex/skills/yss-stage-decision/SKILL.md +50 -0
  94. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  95. package/template/.codex/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  96. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  97. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  98. package/template/.codex/skills/yss-stage-decision/references/validation-rules.md +18 -0
  99. package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  100. package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  101. package/template/.codex/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  102. package/template/.codex/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  103. package/template/.codex/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  104. package/template/.codex/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  105. package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  106. package/template/.codex/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  107. package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  108. package/template/.codex/skills/yss-tactical-design/SKILL.md +33 -0
  109. package/template/.codex/skills/yss-tactical-design/agents/openai.yaml +4 -0
  110. package/template/.codex/skills/yss-tactical-design/references/output-template.md +28 -0
  111. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  112. package/template/.codex/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  113. package/template/.codex/skills/yss-tactical-design/references/validation-rules.md +13 -0
  114. package/template/.codex/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  115. package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  116. package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  117. package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  118. package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  119. package/template/.codex/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  120. package/template/.codex/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  121. package/template/.codex/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  122. package/template/.cursor/skills/yss-domain/SKILL.md +5 -4
  123. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +9 -9
  124. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  125. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  126. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  127. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  128. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +9 -4
  129. package/template/.cursor/skills/yss-router/SKILL.md +5 -3
  130. package/template/.cursor/skills/yss-router/references/router-contract.yaml +18 -3
  131. package/template/.cursor/skills/yss-router/references/slice-implementation-contract.md +59 -1
  132. package/template/.cursor/skills/yss-stage-decision/SKILL.md +50 -0
  133. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  134. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  135. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  136. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  137. package/template/.cursor/skills/yss-stage-decision/references/validation-rules.md +18 -0
  138. package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  139. package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  140. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  141. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  142. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  143. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  144. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  145. package/template/.cursor/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  146. package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  147. package/template/.cursor/skills/yss-tactical-design/SKILL.md +33 -0
  148. package/template/.cursor/skills/yss-tactical-design/agents/openai.yaml +4 -0
  149. package/template/.cursor/skills/yss-tactical-design/references/output-template.md +28 -0
  150. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  151. package/template/.cursor/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  152. package/template/.cursor/skills/yss-tactical-design/references/validation-rules.md +13 -0
  153. package/template/.cursor/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  154. package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  155. package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  156. package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  157. package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  158. package/template/.cursor/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  159. package/template/.cursor/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  160. package/template/.cursor/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  161. package/template/.hermes/skills/yss-domain/SKILL.md +5 -4
  162. package/template/.hermes/skills/yss-product-lifecycle/SKILL.md +9 -9
  163. package/template/.hermes/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  164. package/template/.hermes/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  165. package/template/.hermes/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  166. package/template/.hermes/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  167. package/template/.hermes/skills/yss-product-lifecycle/references/state-model.md +9 -4
  168. package/template/.hermes/skills/yss-router/SKILL.md +5 -3
  169. package/template/.hermes/skills/yss-router/references/router-contract.yaml +18 -3
  170. package/template/.hermes/skills/yss-router/references/slice-implementation-contract.md +59 -1
  171. package/template/.hermes/skills/yss-stage-decision/SKILL.md +50 -0
  172. package/template/.hermes/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  173. package/template/.hermes/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  174. package/template/.hermes/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  175. package/template/.hermes/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  176. package/template/.hermes/skills/yss-stage-decision/references/validation-rules.md +18 -0
  177. package/template/.hermes/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  178. package/template/.hermes/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  179. package/template/.hermes/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  180. package/template/.hermes/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  181. package/template/.hermes/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  182. package/template/.hermes/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  183. package/template/.hermes/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  184. package/template/.hermes/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  185. package/template/.hermes/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  186. package/template/.hermes/skills/yss-tactical-design/SKILL.md +33 -0
  187. package/template/.hermes/skills/yss-tactical-design/agents/openai.yaml +4 -0
  188. package/template/.hermes/skills/yss-tactical-design/references/output-template.md +28 -0
  189. package/template/.hermes/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  190. package/template/.hermes/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  191. package/template/.hermes/skills/yss-tactical-design/references/validation-rules.md +13 -0
  192. package/template/.hermes/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  193. package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  194. package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  195. package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  196. package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  197. package/template/.hermes/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  198. package/template/.hermes/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  199. package/template/.hermes/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  200. package/template/.pi/skills/yss-domain/SKILL.md +5 -4
  201. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +9 -9
  202. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  203. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  204. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  205. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  206. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +9 -4
  207. package/template/.pi/skills/yss-router/SKILL.md +5 -3
  208. package/template/.pi/skills/yss-router/references/router-contract.yaml +18 -3
  209. package/template/.pi/skills/yss-router/references/slice-implementation-contract.md +59 -1
  210. package/template/.pi/skills/yss-stage-decision/SKILL.md +50 -0
  211. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  212. package/template/.pi/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  213. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  214. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  215. package/template/.pi/skills/yss-stage-decision/references/validation-rules.md +18 -0
  216. package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  217. package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  218. package/template/.pi/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  219. package/template/.pi/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  220. package/template/.pi/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  221. package/template/.pi/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  222. package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  223. package/template/.pi/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  224. package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  225. package/template/.pi/skills/yss-tactical-design/SKILL.md +33 -0
  226. package/template/.pi/skills/yss-tactical-design/agents/openai.yaml +4 -0
  227. package/template/.pi/skills/yss-tactical-design/references/output-template.md +28 -0
  228. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  229. package/template/.pi/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  230. package/template/.pi/skills/yss-tactical-design/references/validation-rules.md +13 -0
  231. package/template/.pi/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  232. package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  233. package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  234. package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  235. package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  236. package/template/.pi/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  237. package/template/.pi/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  238. package/template/.pi/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  239. package/template/.qoder/skills/yss-domain/SKILL.md +5 -4
  240. package/template/.qoder/skills/yss-product-lifecycle/SKILL.md +9 -9
  241. package/template/.qoder/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  242. package/template/.qoder/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  243. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  244. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  245. package/template/.qoder/skills/yss-product-lifecycle/references/state-model.md +9 -4
  246. package/template/.qoder/skills/yss-router/SKILL.md +5 -3
  247. package/template/.qoder/skills/yss-router/references/router-contract.yaml +18 -3
  248. package/template/.qoder/skills/yss-router/references/slice-implementation-contract.md +59 -1
  249. package/template/.qoder/skills/yss-stage-decision/SKILL.md +50 -0
  250. package/template/.qoder/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  251. package/template/.qoder/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  252. package/template/.qoder/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  253. package/template/.qoder/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  254. package/template/.qoder/skills/yss-stage-decision/references/validation-rules.md +18 -0
  255. package/template/.qoder/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  256. package/template/.qoder/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  257. package/template/.qoder/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  258. package/template/.qoder/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  259. package/template/.qoder/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  260. package/template/.qoder/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  261. package/template/.qoder/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  262. package/template/.qoder/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  263. package/template/.qoder/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  264. package/template/.qoder/skills/yss-tactical-design/SKILL.md +33 -0
  265. package/template/.qoder/skills/yss-tactical-design/agents/openai.yaml +4 -0
  266. package/template/.qoder/skills/yss-tactical-design/references/output-template.md +28 -0
  267. package/template/.qoder/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  268. package/template/.qoder/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  269. package/template/.qoder/skills/yss-tactical-design/references/validation-rules.md +13 -0
  270. package/template/.qoder/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  271. package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  272. package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  273. package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  274. package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  275. package/template/.qoder/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  276. package/template/.qoder/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  277. package/template/.qoder/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  278. package/template/.trae/skills/yss-domain/SKILL.md +5 -4
  279. package/template/.trae/skills/yss-product-lifecycle/SKILL.md +9 -9
  280. package/template/.trae/skills/yss-product-lifecycle/references/artifact-dependencies.md +4 -0
  281. package/template/.trae/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  282. package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +139 -4
  283. package/template/.trae/skills/yss-product-lifecycle/references/orchestration.md +8 -5
  284. package/template/.trae/skills/yss-product-lifecycle/references/state-model.md +9 -4
  285. package/template/.trae/skills/yss-router/SKILL.md +5 -3
  286. package/template/.trae/skills/yss-router/references/router-contract.yaml +18 -3
  287. package/template/.trae/skills/yss-router/references/slice-implementation-contract.md +59 -1
  288. package/template/.trae/skills/yss-stage-decision/SKILL.md +50 -0
  289. package/template/.trae/skills/yss-stage-decision/references/domain-strategy-contract.md +26 -0
  290. package/template/.trae/skills/yss-stage-decision/references/domain-strategy.schema.json +128 -0
  291. package/template/.trae/skills/yss-stage-decision/references/stage-decision-package-contract.md +19 -0
  292. package/template/.trae/skills/yss-stage-decision/references/stage-decision-package.schema.json +86 -0
  293. package/template/.trae/skills/yss-stage-decision/references/validation-rules.md +18 -0
  294. package/template/.trae/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +169 -0
  295. package/template/.trae/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +100 -0
  296. package/template/.trae/skills/yss-stage-decision/tests/fixtures/domain-strategy-approval.yaml +15 -0
  297. package/template/.trae/skills/yss-stage-decision/tests/fixtures/invalid-direction.yaml +58 -0
  298. package/template/.trae/skills/yss-stage-decision/tests/fixtures/invalid-stage-decision-blocker.yaml +44 -0
  299. package/template/.trae/skills/yss-stage-decision/tests/fixtures/stage-decision-approval.yaml +15 -0
  300. package/template/.trae/skills/yss-stage-decision/tests/fixtures/valid-stage-decision-package.yaml +49 -0
  301. package/template/.trae/skills/yss-stage-decision/tests/fixtures/valid-supplier-domain.yaml +108 -0
  302. package/template/.trae/skills/yss-stage-decision/tests/run-scenarios.mjs +68 -0
  303. package/template/.trae/skills/yss-tactical-design/SKILL.md +33 -0
  304. package/template/.trae/skills/yss-tactical-design/agents/openai.yaml +4 -0
  305. package/template/.trae/skills/yss-tactical-design/references/output-template.md +28 -0
  306. package/template/.trae/skills/yss-tactical-design/references/tactical-design-contract.md +41 -0
  307. package/template/.trae/skills/yss-tactical-design/references/tactical-design.schema.json +31 -0
  308. package/template/.trae/skills/yss-tactical-design/references/validation-rules.md +13 -0
  309. package/template/.trae/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +213 -0
  310. package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-api-leaks-aggregate.yaml +21 -0
  311. package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-missing-consistency-policy.yaml +21 -0
  312. package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-missing-invariant.yaml +21 -0
  313. package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-stale-upstream-ref.yaml +21 -0
  314. package/template/.trae/skills/yss-tactical-design/tests/fixtures/invalid-strategic-as-tactical.yaml +21 -0
  315. package/template/.trae/skills/yss-tactical-design/tests/fixtures/valid-tactical-design.yaml +80 -0
  316. package/template/.trae/skills/yss-tactical-design/tests/run-scenarios.mjs +47 -0
  317. package/template/AGENTS.md +8 -4
  318. package/template/CONTEXT.md +14 -2
  319. package/template/docs/agents/digital-human-roles.md +83 -0
  320. package/template/docs/agents/digital-human-roles.yaml +259 -0
  321. package/template/docs/agents/triage-labels.md +5 -5
  322. package/template/docs/agents/yss-skill-registry.yaml +12 -0
  323. package/template/docs/architecture/templates/system-overview-design-template.md +1 -0
  324. package/template/docs/process/lifecycle-artifact-map.md +8 -0
  325. package/template/docs/process/lifecycle-registry-baseline.json +11 -1
  326. package/template/docs/process/lifecycle-registry.yaml +46 -2
  327. package/template/docs/process/schemas/digital-human-task-package.schema.json +107 -0
  328. package/template/docs/process/schemas/lifecycle-checkpoint.schema.json +2 -1
  329. package/template/docs/process/schemas/subagent-task-package.schema.json +6 -0
  330. package/template/docs/process/subagent-collaboration.md +5 -3
  331. package/template/docs/process/templates/stage-checkpoint-template.md +3 -1
  332. package/template/docs/templates/approval-record-template.yaml +14 -0
  333. package/template/docs/templates/digital-human-runtime-profile-template.md +38 -0
  334. package/template/docs/templates/grok-bot-profile-template.md +24 -0
  335. package/template/docs/templates/implementation-routing-template.md +3 -3
  336. package/template/docs/templates/local-parent-ticket-template.md +8 -0
  337. package/template/docs/templates/subagent-task-package-template.md +43 -1
  338. package/template/docs/templates/vertical-slice-ticket-template.md +7 -0
  339. package/template/docs/user-guide//344/272/247/345/223/201/347/240/224/345/217/221/345/205/250/347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +2 -0
  340. package/template/scripts/lib/approval-record.mjs +123 -0
  341. package/template/scripts/lib/digital-human-roles.mjs +398 -0
  342. package/template/scripts/lib/lifecycle-transition.mjs +259 -0
  343. package/template/scripts/lib/scenario-checks.mjs +96 -2
  344. package/template/scripts/lib/task-package.mjs +214 -0
  345. package/template/scripts/verify-approval-record +13 -0
  346. package/template/scripts/verify-digital-human-roles +10 -0
  347. package/template/scripts/verify-digital-human-roles-scenarios +147 -0
  348. package/template/scripts/verify-digital-human-task-package +14 -0
  349. package/template/scripts/verify-digital-human-task-package-scenarios +8 -0
  350. package/template/scripts/verify-lifecycle-checkpoint +2 -0
  351. package/template/scripts/verify-lifecycle-transition-scenarios +105 -0
  352. package/template/scripts/verify-subagent-task-package +8 -0
  353. package/template/scripts/verify-subagent-task-package-scenarios +196 -0
  354. package/template/scripts/verify-template +16 -2
  355. package/template/skills-lock.json +35 -3
  356. package/template.snapshot.json +4 -4
@@ -100,6 +100,71 @@ workflow_execution_result:
100
100
  workflow_reference:
101
101
  required: [source, skill, invocation_mode]
102
102
  allowed_sources: [yss-product-lifecycle, mattpocock/skills]
103
+ next_route:
104
+ validator: scripts/lib/lifecycle-transition.mjs
105
+ function: validateNextRoute
106
+ implementation_predecessor: work-unit.ticket-decomposition
107
+ null_allowed_when: [blocked, needs-human, failed, terminal_completed]
108
+ work_unit_requirements:
109
+ work-unit.ticket-decomposition:
110
+ completed_requires: [vertical_slice_ticket_ref, ticket_decomposition_result_ref]
111
+ work-unit.slice-implementation:
112
+ required: [predecessor_work_unit, ticket_decomposition_result_ref, ticket_decomposition_result_status, vertical_slice_ticket_ref, vertical_slice_ticket_role, vertical_slice_ticket_kind, slice_contract_ticket_ref, slice_contract_status]
113
+ boolean_required: [ready_for_agent, slice_contract_persisted, slice_contract_current_version]
114
+ validator: scripts/lib/lifecycle-transition.mjs
115
+ function: validateImplementationEntry
116
+
117
+ task_package:
118
+ schema_version: 1
119
+ applies_to: all-formal-digital-human-dispatches
120
+ schema_ref: docs/process/schemas/digital-human-task-package.schema.json
121
+ compatibility_schema_ref: docs/process/schemas/subagent-task-package.schema.json
122
+ validator: scripts/verify-digital-human-task-package
123
+ compatibility_validator: scripts/verify-subagent-task-package
124
+ persistence_layout: docs/.scratch/<feature>/task-packages/<task-id>.yaml
125
+ required: [schema_version, task_id, work_unit_id, actor_id, role_id, runtime_id, execution_state, workflow_status, skill_source, contract, inputs, objective, allowed_write_paths, forbidden_actions, expected_outputs, expected_evidence_files, verification_commands, verification_results, downstream_consumers, convergence]
126
+ execution_states: [Explorer, Drafter, Worker, Reviewer, Verifier]
127
+ workflow_statuses: [not-started, active, paused, resolved, failed]
128
+ skill_source:
129
+ registry_ref: docs/agents/digital-human-roles.yaml
130
+ defaults: taskPackageDefaults(role_id)
131
+ copy_required: [core_skills, forbidden_skills]
132
+ contract:
133
+ kinds: [lifecycle-work-unit, slice-implementation, template-maintenance]
134
+ required: [kind, contract_id, contract_version, status, contract_ref]
135
+ status_at_dispatch: issued
136
+ status_after_change: [stale, blocked]
137
+ lifecycle-work-unit:
138
+ required: [lifecycle_ref]
139
+ forbidden: [slice_contract_ref, maintenance_ref]
140
+ template_source_work_unit: forbidden
141
+ slice-implementation:
142
+ required: [slice_contract_ref]
143
+ must_match_current_slice_contract: true
144
+ version_mismatch: blocked
145
+ stage: stage.vertical-slice-implementation
146
+ parent_work_unit: work-unit.slice-implementation
147
+ work_unit_must_be_declared_in_slice_contract: true
148
+ template-maintenance:
149
+ required: [maintenance_ref]
150
+ forbidden: [slice_contract_ref, lifecycle_ref]
151
+ dispatch:
152
+ owner: role.lifecycle-orchestrator
153
+ mode: orchestrator-one-to-one
154
+ per_feature_instances: forbidden
155
+ write_isolation:
156
+ policy: task-package-policy
157
+ changed_files_must_be_within_allowed_paths: true
158
+ shared_workspace_is_not_security_boundary: true
159
+ downstream:
160
+ formal_channel: [task_package_ref, contract_ref, evidence_refs, workflow_execution_result]
161
+ direct_chat_is_not_formal_evidence: true
162
+ stale:
163
+ owner: yss-product-lifecycle
164
+ on_contract_change: [mark_downstream_stale, remove_ready-for-agent, reroute]
165
+ compatibility:
166
+ legacy_results: read-only-normalize
167
+ schema_version: 1
103
168
 
104
169
  # Matt user-invoked skills remain explicit user entry points. Lifecycle work units
105
170
  # may prepare, validate and accept their results, but cannot invoke them or create
@@ -146,6 +211,22 @@ work_unit_routes:
146
211
  skills: [grilling, domain-modeling]
147
212
  applies_when: requirements_or_domain_boundary_unclear
148
213
  not_applicable_reason: requirements_already_confirmed
214
+ work-unit.domain-strategy-design:
215
+ native: {source: yss-product-lifecycle, skill: yss-stage-decision, invocation_mode: model-invoked}
216
+ primary_skill: yss-stage-decision
217
+ supporting_skills: [domain-modeling, research, grilling]
218
+ skills: [yss-stage-decision, domain-modeling, research, grilling]
219
+ human_gate: domain-strategy-approved
220
+ applies_when: domain_boundary_or_language_or_core_rule_impact
221
+ not_applicable_reason: no_domain_strategy_impact
222
+ work-unit.stage-decision:
223
+ native: {source: yss-product-lifecycle, skill: yss-stage-decision, invocation_mode: model-invoked}
224
+ primary_skill: yss-stage-decision
225
+ supporting_skills: [domain-modeling]
226
+ skills: [yss-stage-decision, domain-modeling]
227
+ human_gate: stage-decision-package-approved
228
+ applies_when: discovery_to_spec_requires_stable_decision_package
229
+ not_applicable_reason: existing_approved_stage_decision_current
149
230
  work-unit.spec-synthesis:
150
231
  native: {source: yss-product-lifecycle, skill: yss-product-lifecycle, invocation_mode: model-invoked}
151
232
  primary_skill: yss-product-lifecycle
@@ -166,8 +247,17 @@ work_unit_routes:
166
247
  work-unit.technical-analysis:
167
248
  native: {source: yss-product-lifecycle, skill: yss-product-lifecycle, invocation_mode: model-invoked}
168
249
  primary_skill: yss-router
169
- supporting_skills: [yss-openapi-governance, yss-openapi-draft-review, codebase-design, implementation-repo-onboarding]
170
- skills: [yss-openapi-governance, yss-openapi-draft-review, codebase-design, implementation-repo-onboarding, yss-router]
250
+ supporting_skills: [yss-openapi-governance, yss-openapi-draft-review, codebase-design, implementation-repo-onboarding, yss-tactical-design]
251
+ skills: [yss-openapi-governance, yss-openapi-draft-review, codebase-design, implementation-repo-onboarding, yss-tactical-design, yss-router]
252
+ tactical_ddd:
253
+ applies_when: [aggregate-impact, state-machine-impact, invariant-impact, consistency-impact, domain-event-impact, gateway-boundary-impact, persistence-mapping-impact]
254
+ not_applicable_reason: no_tactical_ddd_impact
255
+ default_artifact: system-overview-design.tactical-ddd-check
256
+ standalone_artifact: artifact.tactical-design
257
+ review_evidence: evidence.tactical-design-review
258
+ statuses: [draft, ready-for-human, approved, blocked, stale, drift, new_impacts, not-applicable]
259
+ approved_by: yss-product-lifecycle
260
+ forbidden: [self-approval, ready-for-agent, production-code-generation]
171
261
  human_gate: openapi-freeze_if_api_impact
172
262
  applies_when: technical_or_contract_impact
173
263
  not_applicable_reason: no_technical_or_contract_impact
@@ -179,6 +269,7 @@ work_unit_routes:
179
269
  skills: [yss-router]
180
270
  applies_when: frozen_scope_ready_for_slicing
181
271
  not_applicable_reason: contract_or_scope_not_frozen
272
+ must_complete_before: work-unit.slice-implementation
182
273
  work-unit.slice-implementation:
183
274
  native: {source: yss-product-lifecycle, skill: yss-product-lifecycle, invocation_mode: model-invoked}
184
275
  primary_skill: yss-router
@@ -206,6 +297,7 @@ work_unit_routes:
206
297
  theme_impact: no_theme_impact
207
298
  applies_when: ready_for_agent
208
299
  not_applicable_reason: slice_contract_not_approved
300
+ requires_completed_work_units: [work-unit.ticket-decomposition]
209
301
  work-unit.frontend-implementation-verification:
210
302
  native: {source: yss-product-lifecycle, skill: yss-product-lifecycle, invocation_mode: model-invoked}
211
303
  primary_skill: yss-ui
@@ -239,9 +331,49 @@ compatibility_flow_preconditions:
239
331
  output: vertical-slice-tickets
240
332
  output_role: ready-for-human
241
333
  implement:
242
- required: [ready_for_agent, slice_contract_approved, slice_contract_persisted, slice_contract_current_version, build_architecture_checklist, implementation_repo, implementation_branch, ci, verification_commands, rollback_point, backend_slice_contract_if_applicable, backend_scaffold_policy_satisfied, frontend_implementation_plan_if_ui_impact]
334
+ required: [ready_for_agent, predecessor_work_unit, ticket_decomposition_result_ref, ticket_decomposition_result_status, vertical_slice_ticket_ref, vertical_slice_ticket_role, vertical_slice_ticket_kind, slice_contract_approved, slice_contract_persisted, slice_contract_current_version, build_architecture_checklist, implementation_repo, implementation_branch, ci, verification_commands, rollback_point, backend_slice_contract_if_applicable, backend_scaffold_policy_satisfied, frontend_implementation_plan_if_ui_impact]
243
335
  applies_to_single_session: true
244
336
 
337
+ ticket_formalization:
338
+ implementation_predecessor: work-unit.ticket-decomposition
339
+ result_ref_required: true
340
+ result_must_be: completed
341
+ evidence_refs_required: true
342
+ vertical_slice_ticket:
343
+ kind: vertical-slice-ticket
344
+ role_before_promotion: ready-for-human
345
+ role_for_implementation: ready-for-agent
346
+ local_ref_pattern: '^docs/\\.scratch/[^/]+/issues/[^/]+\\.md$'
347
+ parent_ticket_ref_forbidden: true
348
+ slice_contract_binding:
349
+ ticket_ref_must_equal: vertical_slice_ticket_ref
350
+ status: approved
351
+ persisted: true
352
+ current_version: true
353
+ validator:
354
+ module: scripts/lib/lifecycle-transition.mjs
355
+ functions: [validateNextRoute, validateTicketFormalization, validateImplementationEntry]
356
+
357
+ transition_graph:
358
+ validator: scripts/lib/lifecycle-transition.mjs
359
+ implementation_requires_predecessor: work-unit.ticket-decomposition
360
+ routes:
361
+ work-unit.ssot-update: [work-unit.skill-projection-sync, work-unit.intensity-aware-verification]
362
+ work-unit.skill-projection-sync: [work-unit.template-snapshot-build, work-unit.intensity-aware-verification]
363
+ work-unit.template-snapshot-build: [work-unit.attach-sync-integration, work-unit.intensity-aware-verification]
364
+ work-unit.attach-sync-integration: [work-unit.intensity-aware-verification]
365
+ work-unit.intensity-aware-verification: [work-unit.intensity-aware-review]
366
+ work-unit.intensity-aware-review: [work-unit.release-and-rollback]
367
+ work-unit.release-and-rollback: []
368
+ work-unit.spec-synthesis: [work-unit.prototype-design, work-unit.technical-analysis, work-unit.ticket-decomposition]
369
+ work-unit.prototype-design: [work-unit.technical-analysis, work-unit.ticket-decomposition]
370
+ work-unit.technical-analysis: [work-unit.ticket-decomposition]
371
+ work-unit.ticket-decomposition: [work-unit.slice-implementation]
372
+ forbidden_shortcuts:
373
+ - {from: work-unit.spec-synthesis, to: work-unit.slice-implementation}
374
+ - {from: work-unit.prototype-design, to: work-unit.slice-implementation}
375
+ - {from: work-unit.technical-analysis, to: work-unit.slice-implementation}
376
+
245
377
  grill_exit:
246
378
  required: [frontier_empty, facts_resolved_or_routed, decisions_confirmed, shared_understanding_confirmed, no_unresolved_runnable_blocker]
247
379
  facts_resolved_or_routed:
@@ -467,7 +599,10 @@ wayfinder_completion:
467
599
  required: [no_open_children, no_open_blocked_or_claimed_children, no_fog, destination_clear]
468
600
 
469
601
  ready_for_agent:
470
- required: [gates_satisfied, no_stale_artifacts, blockers_closed, implementation_context_ready, implementation_repo, implementation_branch, ci, verification_commands, rollback_point, slice_contract_approved, slice_contract_persisted, slice_contract_current_version, build_architecture_checklist, backend_slice_contract_if_applicable, backend_scaffold_policy_satisfied, frontend_implementation_plan_if_ui_impact]
602
+ required: [gates_satisfied, no_stale_artifacts, blockers_closed, implementation_context_ready, implementation_repo, implementation_branch, ci, verification_commands, rollback_point, predecessor_work_unit, ticket_decomposition_result_ref, ticket_decomposition_result_status, vertical_slice_ticket_ref, vertical_slice_ticket_role, vertical_slice_ticket_kind, slice_contract_approved, slice_contract_persisted, slice_contract_current_version, build_architecture_checklist, backend_slice_contract_if_applicable, backend_scaffold_policy_satisfied, frontend_implementation_plan_if_ui_impact]
603
+ ticket_formalization_validator: scripts/lib/lifecycle-transition.mjs
604
+ requires_vertical_slice_ticket: true
605
+ parent_ticket_as_implementation_ref: forbidden
471
606
 
472
607
  frontend_implementation_plan:
473
608
  applies_when: [ui_impact]
@@ -5,8 +5,8 @@
5
5
  1. 识别模式、仓库身份、任务规模和影响面。
6
6
  2. `setup readiness`:每个任务只执行一次,核对 tracker、五态标签和领域文档布局,并在本轮缓存结果;仅在 tracker、主远端、真实标签或配置变化时重查。
7
7
  3. 加载父 Ticket/checkpoint 与真实资产,计算最近可信阶段。
8
- 4. 评估资产、门禁和 `stale`,选择第一个未阻塞工作单元。
9
- 5. 执行最小生命周期工作单元:只实际调用允许的 model-invoked skill;原生工作单元可直接持有正式资产,Matt 兼容 user-invoked skill 仅作为 workflow reference,仍由用户显式启动。将结果归一化为 `Workflow Execution Result`,验收输出并回写状态与证据。
8
+ 4. 评估资产、门禁和 `stale`,选择第一个未阻塞工作单元。进入 `work-unit.slice-implementation` 前,必须先通过 `scripts/lib/lifecycle-transition.mjs` 的 Ticket 正式化、垂直切片绑定和合法 `next_route` 校验;父 Ticket、缺少垂直切片或 `ready-for-human` 的切片一律 `blocked`。
9
+ 5. 执行最小生命周期工作单元:主控先按 `docs/process/schemas/digital-human-task-package.schema.json` 编译并校验任务包,再只实际调用允许的 model-invoked skill;原生工作单元可直接持有正式资产,Matt 兼容 user-invoked skill 仅作为 workflow reference,仍由用户显式启动。将结果归一化为 `Workflow Execution Result`,验收输出并回写状态与证据。任务包的 `contract.kind` 按工作单元选择;只有实现子任务使用 `slice-implementation` 并消费 Slice Implementation Contract,其他阶段不伪造该合同。
10
10
  6. 若仍在授权和自动推进边界内,回到第 3 步;否则暂停。
11
11
 
12
12
  不要仅输出下一个提示词后结束 `orchestrate`/`resume`。不要因进入业务代码阶段而退出主控;应把实现交给专项 skill,并在返回后继续核验。
@@ -51,9 +51,12 @@ tracker 选择和冲突按 `docs/agents/issue-tracker.md` 裁决:已持久化
51
51
 
52
52
  ## Matt flow 进入条件
53
53
 
54
+ - `work-unit.technical-analysis` 命中聚合、状态机、不变量、一致性、Domain Event、Gateway 或持久化映射影响时,先调度 `yss-tactical-design` 完成 Tactical DDD Check;默认嵌入系统概要设计 / 数据架构,复杂场景才生成 `artifact.tactical-design`。无领域影响记录 `not-applicable`。该 skill 只返回设计合同和验证结果,批准仍由生命周期编排器维护,发现 `stale`、`drift` 或 `new_impacts` 时不得继续 Ticket 正式化。
55
+
54
56
  - `work-unit.discovery-requirements` 实际调用 `grilling` 和 `domain-modeling`;`work-unit.discovery-opportunity` 按事实类型路由 `competitive-intelligence` 或 `research`。生命周期原生工作单元默认负责 Spec、Ticket 和实现资产;`to-spec`、`to-tickets`、`implement` 仅保留为显式兼容入口,结果必须回交生命周期验收。
55
- - 原生 `work-unit.ticket-decomposition` 只能在 OpenAPI Freeze 或无 API 影响记录后创建垂直切片,初始角色统一为 `ready-for-human`;生命周期复算完整公式后才能提升 `ready-for-agent`。
57
+ - 原生 `work-unit.ticket-decomposition` 只能在 OpenAPI Freeze 或无 API 影响记录后创建垂直切片,初始 Ticket 状态统一为 `ready-for-human`;生命周期复算完整公式后才能提升 `ready-for-agent`。该工作单元必须返回 `ticket_decomposition_result_ref` 和垂直切片引用,并作为实现的必经前置证据。
56
58
  - 原生 `work-unit.slice-implementation` 必须在生命周期批准并持久化 Slice Implementation Contract 和 Build Architecture Checklist 后执行;用户显式 `implement` 仍走兼容入口,不得绕过生命周期。
59
+ - `Workflow Execution Result.next_route` 必须通过生命周期转换校验;Spec、原型和技术分析不得直接跳转到 `work-unit.slice-implementation`,只能先进入 `work-unit.ticket-decomposition`。
57
60
  - `implement` 遇到 backend `scaffold_status=required` 时,还必须满足原型确认后的脚手架策略:脚手架 Execution Result、`yss-backend-scaffold-parent` 基线、Wrapper 验证和 Router 合同重编译均已回写;否则停在工程基线,不得写业务代码。
58
61
  - `Workflow Execution Result` 出现 `drift`、`new_impacts`、`stale_candidates`、`violation`、`missing_evidence`、空 `evidence_refs` 或缺少必需字段时暂停当前工作单元;旧结果只能先经只读兼容 adapter 归一化。
59
62
 
@@ -73,13 +76,13 @@ tracker 选择和冲突按 `docs/agents/issue-tracker.md` 裁决:已持久化
73
76
 
74
77
  ## 必须暂停
75
78
 
76
- - Spec baseline、需求冻结、原型确认、OpenAPI Freeze 或 Architecture Review 等普通门禁等待人工裁决。
79
+ - Spec baseline、需求冻结、原型确认、OpenAPI Freeze 或 Architecture Review 等普通门禁等待会签裁决(数字人或生物人,以 `docs/agents/digital-human-roles.yaml` 的 `gate_policy` 为准)。暂停输出必须包含:门禁 ID、指定 `role_id`、`runtime_id`、会签文件路径。恢复前执行 `scripts/verify-approval-record`;角色错误、起草者自签或生物人门禁被数字人关闭时返回 `blocked`,不得标 `approved`。
77
80
  - 需要目标仓库、外部凭据、发布窗口或其他新授权。
78
81
  - 状态与证据冲突且无法可靠重建。
79
82
  - 专项 skill 失败或返回不可验收结果。
80
83
  - 即将作出可合并、可发布或完成结论。
81
84
 
82
- 暂停输出:门禁、证据、责任人、推荐答案、一个问题、恢复动作。
85
+ 暂停输出:门禁、指定会签 `role_id`、`runtime_id`、会签文件路径、证据、推荐答案、一个问题、恢复动作。
83
86
 
84
87
  ## Wayfinder 完成判定
85
88
 
@@ -11,7 +11,7 @@
11
11
  | `tracker.kind` | `local-markdown`、`github`、`gitlab` |
12
12
  | `ticket.role` | `needs-triage`、`needs-info`、`ready-for-agent`、`ready-for-human`、`wontfix` |
13
13
 
14
- Matt 五态不得扩义。资产的 `ready-for-human` 与 Ticket label 必须带命名空间表达。
14
+ Matt 五态不得扩义。资产的 `ready-for-human` 与 Ticket label 必须带命名空间表达。`paused-human-gate` 表示等待 `docs/agents/digital-human-roles.yaml` 指定的会签人(数字人或生物人),不是「必须是生物人」。
15
15
 
16
16
  ## 上下文与外部输入证据
17
17
 
@@ -34,14 +34,19 @@ phase_boundary:
34
34
 
35
35
  ## `ready-for-agent` 公式
36
36
 
37
- 仅当以下全部为真,垂直切片 Ticket 才能获得该角色:
37
+ 仅当以下全部为真,垂直切片 Ticket 才能获得该 Ticket 状态:
38
38
 
39
39
  ```text
40
40
  required gates ∈ {approved, not-applicable}
41
- AND related artifacts 不含 stale
41
+ AND related artifacts 不含 stale(若命中领域影响,`artifact.tactical-design` 或嵌入式 Tactical DDD Check 引用必须为当前版本)
42
42
  AND blocking edges 全部关闭
43
43
  AND implementation repo/branch/CI/test/rollback 已明确
44
+ AND `work-unit.ticket-decomposition` 已返回 `completed`,且其 `ticket_decomposition_result_ref` 证据可读取
45
+ AND `vertical_slice_ticket_ref` 指向 `docs/.scratch/<feature>/issues/` 下的垂直切片 Ticket
46
+ AND `vertical_slice_ticket_kind=vertical-slice-ticket` 且 `vertical_slice_ticket_role=ready-for-agent`
47
+ AND `vertical_slice_ticket_ref` 不得指向 `parent-ticket.md`
44
48
  AND Slice Implementation Contract 已由生命周期编排器批准并持久化
49
+ AND Slice Implementation Contract 的 `ticket_ref` 与 `vertical_slice_ticket_ref` 完全一致
45
50
  AND 当前工作单元消费的 contract_id/version 与最新批准版本一致
46
51
  AND Backend Slice Implementation Contract(后端适用)和 Build Architecture Checklist 已完成
47
52
  AND backend 影响且 scaffold_status=required 时,原型确认后的脚手架策略、`yss-backend-scaffold-parent` 基线、Wrapper 验证和 Router 重编译均已完成
@@ -53,7 +58,7 @@ AND UI 影响切片的前端实现还原计划已通过 schema 校验、`templat
53
58
 
54
59
  发布前还必须满足所有已触发门禁均为 `approved` 或 `not-applicable`;UI 影响切片必须额外通过 `gate.frontend-implementation-verified`,不能只凭 fresh verification 和回滚点放行。
55
60
 
56
- 用户显式运行 `to-tickets` 后,垂直切片初始角色固定为 `ready-for-human`。只有 `yss-product-lifecycle` 复算上述公式全部为真后,才能把它提升为 `ready-for-agent`;生命周期不会自动调用 `to-tickets`,其默认标签也不参与该裁决。
61
+ 用户显式运行 `to-tickets` 后,垂直切片初始 Ticket 状态固定为 `ready-for-human`。原生路径执行 `work-unit.ticket-decomposition` 时同样必须产生等价的垂直切片和 `Workflow Execution Result` 证据。只有 `yss-product-lifecycle` 复算上述公式全部为真后,才能把它提升为 `ready-for-agent`;生命周期不会自动调用 `to-tickets`,但不得跳过 Ticket 正式化工作单元。其默认标签也不参与该裁决。
57
62
 
58
63
  ## Review 与 Git 授权状态
59
64
 
@@ -13,20 +13,21 @@ description: Use when a YSS vertical slice is entering implementation, spans mul
13
13
 
14
14
  ## 编译循环
15
15
 
16
- 1. 判断 frontend/backend/API/data/cross-repo 影响,并逐项填写 backend `component_impacts`。
16
+ 1. 判断 frontend/backend/API/data/domain/cross-repo 影响,并逐项填写 backend `component_impacts`;命中聚合、状态机、不变量、一致性、Domain Event、Gateway 或持久化映射时加入 `yss-tactical-design`。
17
17
  2. 检查工程存在性和核心/长尾 skill 可用性。
18
18
  3. 选择主 skill,并按 [router-contract.yaml](references/router-contract.yaml) 计算强制依赖闭包。
19
19
  4. 为切片生成基线合同;为当前行为生成工作单元增量路由。
20
20
  5. 选择 `behavior-tdd` 或 `controlled-generation`。
21
21
  6. 输出 `draft`、`blocked` 或 `ready-for-lifecycle-review`,交生命周期编排器核验和持久化。
22
22
 
23
- 合同结构见 [slice-implementation-contract.md](references/slice-implementation-contract.md),专项返回协议见 [yss-skill-execution-result.md](references/yss-skill-execution-result.md)。
23
+ 合同结构见 [slice-implementation-contract.md](references/slice-implementation-contract.md),专项返回协议见 [yss-skill-execution-result.md](references/yss-skill-execution-result.md)。前端、后端和测试子任务必须由生命周期主控从批准的 Slice Contract 编译任务包;任务包 schema 为 `docs/process/schemas/subagent-task-package.schema.json`,技能列表必须来自 `taskPackageDefaults`,不能由 Router 或执行 Agent 另行手写。
24
24
 
25
25
  ## 硬规则
26
26
 
27
27
  - Router 不得输出 `approved`、`ready-for-agent` 或 `completed`。
28
28
  - UI 影响缺少正式原型确认时,不得路由页面实现。
29
29
  - Repository/数据模型影响缺少数据架构时,不得路由持久化实现。
30
+ - 领域影响缺少批准且版本当前的 tactical-design contract 时,不得路由 Domain 实现;无领域影响必须记录 `not-applicable`。
30
31
  - API 变化必须回到生命周期 Draft/Review/Freeze;半成品 backend 不得冒充稳定 source of truth。
31
32
  - 后端端到端切片必须包含 Application;对象/POJO 影响按契约自动补 `mapstruct`、`lombok`、`alibaba-java-code-style`。
32
33
  - Harness 内实现路径必须落在 `apps/backend/<project>/` 或 `apps/frontend/<project>/` 的具体项目目录;`apps/backend/`、`apps/frontend/` 只能作为容器,`app/backend/`、`app/frontend/` 及其子路径一律阻断。外部实现仓库使用其登记的真实项目根路径。`git-submodule` 使用 `implementation_path_policy: git-submodule-harness-apps`,空 gitlink、detached HEAD 或 `--force` 覆盖挂载点不得脚手架;`inspectWorkingTreeScope.writable` 必须为显式布尔值。
@@ -36,6 +37,7 @@ description: Use when a YSS vertical slice is entering implementation, spans mul
36
37
  - 脚手架合同在 Router 阶段只能是 `draft` / `ready-for-lifecycle-review` / `blocked`;只有生命周期编排器可以把已持久化脚手架合同标记为 `approved`。脚手架合同只覆盖业务代码前的工程骨架工作单元;生成、基线校验和 Router 重编译完成后,它不能替代脚手架后的 Slice Implementation Contract。
37
38
  - 脚手架输出消费批准的脚手架合同;脚手架后的所有生成后端代码都必须绑定当前批准且版本当前的 Slice Implementation Contract、主 YSS skill、依赖闭包、允许写路径、预期证据和 YSS Skill Execution Result。打印命令、`./mvnw validate` 单项通过或脚手架成功不能替代合同批准;生成范围从机械内容变成业务行为时触发完整重路由。
38
39
  - 专项结果中的越界路径、缺失证据、`drift`、`violation` 或 `new_impacts` 必须阻断或重路由。
40
+ - 前后端子任务必须使用同一 `contract_id/contract_version`,并在任务包中记录 `role_id`、`runtime_id`、`execution_state`、`allowed_write_paths`、`downstream_consumers` 和 `convergence_ref`;版本不一致或汇合引用缺失时输出 `blocked`。
39
41
  - 长尾 skill 不可用时显式 `blocked`,不得用通用知识假装已应用 YSS 规范。
40
42
 
41
43
  ## 三级路由
@@ -46,4 +48,4 @@ description: Use when a YSS vertical slice is entering implementation, spans mul
46
48
 
47
49
  ## 输出
48
50
 
49
- 输出合同草案、技能依赖闭包、不适用理由、阻塞项、TDD 模式、工作单元、预期证据、验证命令、人工审查点和完整重路由触发器。自然语言说明不能替代结构化合同字段。
51
+ 输出合同草案、技能依赖闭包、不适用理由、阻塞项、TDD 模式、工作单元、预期证据、验证命令、人工审查点、完整重路由触发器,以及建议的 `suggested_owner_role_id`(UI 影响 → `role.frontend-engineer`,后端影响 → `role.backend-engineer`,测试/审查 → `role.test-engineer`)。自然语言说明不能替代结构化合同字段。Router 不得自行批准合同、设置 `ready-for-agent` 或关闭会签门禁;owner 建议只供主控派活。
@@ -66,11 +66,11 @@ exclusive_flags:
66
66
 
67
67
  slice_contract_required:
68
68
  root: [schema_version, contract_id, contract_version, slice_id, status, lifecycle_refs, readiness, common, frontend, backend, contract, cross_repo, work_units]
69
- lifecycle_refs: [spec, ticket, requirement_freeze, low_fidelity_review, prototype_review, high_fidelity_html, prototype_verification, antd_cli_evidence, browser_verification_evidence, prototype_confirmation, openapi_freeze_or_no_impact, architecture_review, data_architecture, engineering_baseline, build_architecture_checklist, implementation_repository, frontend_repository, backend_repository, maven_wrapper]
69
+ lifecycle_refs: [spec, ticket, requirement_freeze, low_fidelity_review, prototype_review, high_fidelity_html, prototype_verification, antd_cli_evidence, browser_verification_evidence, prototype_confirmation, openapi_freeze_or_no_impact, architecture_review, data_architecture, tactical_design, engineering_baseline, build_architecture_checklist, implementation_repository, frontend_repository, backend_repository, maven_wrapper]
70
70
  readiness: [blockers, stale_inputs, not_applicable]
71
71
  common: [impacted_areas, implementation_path_policy, project_roots, required_skills, optional_skills, unavailable_skills, allowed_write_paths, forbidden_patterns, expected_evidence_files, verification_commands, human_review_points, full_reroute_triggers]
72
72
  frontend: [status, required_skills, approved_prototype_ref, state_matrix_ref, allowed_write_paths, component_test_seams, e2e_paths]
73
- backend: [status, affected_layers, component_impacts, required_skills, application_boundary, transaction_boundary, persistence_strategy, allowed_write_paths, forbidden_patterns, expected_evidence_files, seam_deferred, verification_commands]
73
+ backend: [status, affected_layers, component_impacts, required_skills, application_boundary, transaction_boundary, persistence_strategy, allowed_write_paths, forbidden_patterns, expected_evidence_files, seam_deferred, verification_commands, tactical_ddd]
74
74
  contract: [api_impact, freeze_ref, no_api_impact_ref, generated_clients, contract_tests, regeneration_commands]
75
75
  cross_repo: [repositories, delivery_order, integration_verification, rollback_order]
76
76
 
@@ -91,6 +91,7 @@ lifecycle_ref_by_readiness:
91
91
  openapi_freeze: openapi_freeze_or_no_impact
92
92
  no_api_impact_record: openapi_freeze_or_no_impact
93
93
  data_architecture: data_architecture
94
+ tactical_design: tactical_design
94
95
  engineering_baseline: engineering_baseline
95
96
  backend_repository: backend_repository
96
97
  maven_wrapper: maven_wrapper
@@ -135,6 +136,10 @@ applicable_subcontract_nonempty:
135
136
  backend:
136
137
  scalar: [application_boundary, transaction_boundary, persistence_strategy]
137
138
  array: [affected_layers, required_skills, allowed_write_paths, forbidden_patterns, expected_evidence_files, verification_commands]
139
+ conditional_tactical_ddd:
140
+ when: [aggregate-impact, state-machine-impact, invariant-impact, consistency-impact, domain-event-impact, gateway-boundary-impact, persistence-mapping-impact]
141
+ scalar: [tactical_design_ref, tactical_design_version, gateway_boundary_ref]
142
+ array: [aggregate_refs, invariant_refs, state_behavior_refs, domain_test_seams, application_test_seams]
138
143
  contract_api:
139
144
  scalar: [freeze_ref]
140
145
  array: [contract_tests]
@@ -148,8 +153,12 @@ dependency_closure:
148
153
  always: [yss-backend-scaffold-parent, alibaba-java-code-style]
149
154
  yss-domain:
150
155
  always: [alibaba-java-code-style]
151
- when_modeling: [domain-modeling]
156
+ when_modeling: [domain-modeling, yss-tactical-design]
152
157
  when_pojo: [lombok]
158
+ yss-tactical-design:
159
+ always: [domain-modeling]
160
+ when_api_impact: [yss-openapi-draft-review]
161
+ when_data_impact: [yss-repository]
153
162
  yss-application:
154
163
  always: [alibaba-java-code-style]
155
164
  when_conversion: [mapstruct, lombok]
@@ -218,6 +227,12 @@ full_reroute_triggers:
218
227
  - data-model-impact
219
228
  - new-write-path
220
229
  - new-repository
230
+ - aggregate-impact
231
+ - invariant-impact
232
+ - consistency-impact
233
+ - domain-event-impact
234
+ - gateway-boundary-impact
235
+ - persistence-mapping-impact
221
236
  - new-required-skill
222
237
  - not-applicable-invalidated
223
238
  - architecture-drift
@@ -9,6 +9,7 @@ slice_contract:
9
9
  contract_version: 1
10
10
  slice_id:
11
11
  status: draft
12
+ suggested_owner_role_id: # role.frontend-engineer | role.backend-engineer | role.test-engineer;Router 只建议,编排器派活并批准
12
13
  lifecycle_refs:
13
14
  spec:
14
15
  ticket:
@@ -24,6 +25,7 @@ slice_contract:
24
25
  architecture_review:
25
26
  data_architecture:
26
27
  engineering_baseline:
28
+ tactical_design:
27
29
  build_architecture_checklist:
28
30
  implementation_repository:
29
31
  frontend_repository:
@@ -69,6 +71,24 @@ slice_contract:
69
71
  application_boundary:
70
72
  transaction_boundary:
71
73
  persistence_strategy:
74
+ tactical_design_ref:
75
+ tactical_design_version:
76
+ aggregate_refs: []
77
+ invariant_refs: []
78
+ state_behavior_refs: []
79
+ gateway_boundary_ref:
80
+ domain_test_seams: []
81
+ application_test_seams: []
82
+ tactical_ddd:
83
+ status: not-applicable
84
+ tactical_design_ref:
85
+ tactical_design_version:
86
+ aggregate_refs: []
87
+ invariant_refs: []
88
+ state_behavior_refs: []
89
+ gateway_boundary_ref:
90
+ domain_test_seams: []
91
+ application_test_seams: []
72
92
  allowed_write_paths: []
73
93
  forbidden_patterns: []
74
94
  expected_evidence_files: []
@@ -86,7 +106,43 @@ slice_contract:
86
106
  delivery_order: []
87
107
  integration_verification: []
88
108
  rollback_order: []
89
- work_units: []
109
+ work_units:
110
+ - id: slice-frontend
111
+ role_id: role.frontend-engineer
112
+ runtime_id: runtime.skill-projection
113
+ execution_state: Worker
114
+ workflow_status: not-started
115
+ task_package_ref:
116
+ contract_id: # must equal slice_contract.contract_id
117
+ contract_version: # must equal slice_contract.contract_version
118
+ downstream_consumers: []
119
+ convergence_ref:
120
+ work_unit:
121
+ behavior:
122
+ primary_skill:
123
+ supporting_skills: []
124
+ tdd_mode: behavior-tdd
125
+ allowed_write_paths: []
126
+ expected_evidence: []
127
+ verification_commands: []
128
+ - id: slice-backend
129
+ role_id: role.backend-engineer
130
+ runtime_id: runtime.skill-projection
131
+ execution_state: Worker
132
+ workflow_status: not-started
133
+ task_package_ref:
134
+ contract_id:
135
+ contract_version:
136
+ downstream_consumers: []
137
+ convergence_ref:
138
+ work_unit:
139
+ behavior:
140
+ primary_skill:
141
+ supporting_skills: []
142
+ tdd_mode: behavior-tdd
143
+ allowed_write_paths: []
144
+ expected_evidence: []
145
+ verification_commands: []
90
146
  ```
91
147
 
92
148
  工作单元:
@@ -111,3 +167,5 @@ work_unit:
111
167
  ```
112
168
 
113
169
  `controlled_generation` 仅在 `tdd_mode: controlled-generation` 时必填;其他模式标记 `not-applicable`。明确写入需求的权限业务行为仍使用 `behavior-tdd`;API schema 与 database schema 分别触发契约或数据架构回退,不得用一个含糊的 schema 类型决定路线。
170
+
171
+ `work_units` 中的前端、后端和测试任务是切片级子任务,不是新的生命周期阶段。每个子任务必须引用独立任务包;任务包只能消费同一份已批准且版本当前的 Slice Contract。`workflow_status` 追踪执行过程,不能替代生命周期状态;`contract_id` 或 `contract_version` 不一致时必须阻断并回到 Router。
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: yss-stage-decision
3
+ description: 编排 Discovery 到 Spec 入口的阶段决策与 DDD 战略设计;当需求、领域边界、统一语言或下游影响尚未稳定时使用。
4
+ ---
5
+
6
+ # YSS Stage Decision
7
+
8
+ `yss-stage-decision` 是由 `yss-product-lifecycle` 调度的上游决策技能空间,负责把需求、产品、商务输入和 DDD 战略设计结果整理成可审查、可版本化、可被下游消费的阶段决策包。它不替代生命周期主控,也不生成产品代码、原型、OpenAPI 或垂直切片 Ticket。
9
+
10
+ ## 适用边界
11
+
12
+ - 适用于 `project-instance` 的 Discovery → Spec 入口。
13
+ - `template-source` 只维护本技能、Schema、验证器和合成 Fixture,不生成具体产品领域资产。
14
+ - DDD 工作单元只做子域、限界上下文、Context Map、统一语言、关键场景、事件、核心领域概念候选和业务不变量。
15
+ - Entity、Aggregate、Repository、Java 类、数据库表和 OpenAPI Freeze 留给下游工作单元。
16
+
17
+ ## 执行顺序
18
+
19
+ 1. 读取 `yss-project.yaml`、`CONTEXT.md`、既有 Discovery/Spec、ADR 和父 Ticket/checkpoint。
20
+ 2. 分离事实、决策、假设、约束和未决项;技术事实走 `research`,市场/竞品事实走 `competitive-intelligence`。
21
+ 3. 从业务场景、事件、规则、责任人和失败路径识别子域及限界上下文,不从数据库表或调用链直接反推边界。
22
+ 4. 为每个上下文建立本地统一语言;为跨上下文关系记录语义上游/下游、业务决策权、技术传输方向和翻译责任。
23
+ 5. 记录核心领域概念候选,不提前锁定 Entity 或 Aggregate。
24
+ 6. 生成 `domain_strategy` 和 `stage_decision_package`,绑定版本、digest、证据和下游影响映射。
25
+ 7. 运行 Schema、引用、语义一致性和传播验证;发现关键冲突时返回 `blocked`,不得生成 `approved` 包。
26
+
27
+ ## 语义方向规则
28
+
29
+ `semantic_upstream` 是拥有业务规则、决策语义或权威模型的一方;`semantic_downstream` 是消费、适配或依赖该语义的一方。二者不等于 HTTP、事件或数据库的技术方向。每条 Context Map 关系必须独立记录 `transport_direction` 和 `translation_responsibility`;同一对上下文可以存在多条相反方向的语义边。
30
+
31
+ ## 产物与批准
32
+
33
+ - DDD 资产是事实源,阶段决策包只通过 `domain_strategy_ref` 引用它们。
34
+ - `stage_decision_package` 必须经过 `draft → ready-for-human → approved`;起草者不得自签。
35
+ - 建议门禁为 `gate.domain-strategy-approved` 和 `gate.stage-decision-package-approved`,实际状态由 `yss-product-lifecycle` 维护;阶段包批准引用必须通过 `scripts/verify-approval-record`,不得用不可读路径或聊天确认替代。
36
+ - 下游只能消费批准且版本当前的包;发现语义冲突返回 `drift` / `new_impacts`,不得静默修改上游。
37
+
38
+ ## 结果合同
39
+
40
+ 返回标准 `Workflow Execution Result`,至少包含 `work_unit`、`workflow_reference`、`result`、`evidence_refs`、`changed_artifacts`、`new_impacts`、`stale_candidates`、`next_route` 和 `blocking_signals`。`blocked` 必须包含冲突、责任人、恢复条件和下一工作单元。
41
+
42
+ ## 禁止事项
43
+
44
+ - 不把阶段包当作第二套领域事实源。
45
+ - 不按数据库、微服务、菜单或 HTTP 调用方向自动划分上下文。
46
+ - 不把同名术语强行合并为全局概念。
47
+ - 不在战略设计阶段生成 Entity、Aggregate、Repository、生产代码或 API 契约。
48
+ - 不把模板 Fixture 当作具体项目的业务事实。
49
+
50
+ 详细合同、字段和验证规则见 `references/domain-strategy-contract.md`、`references/stage-decision-package-contract.md` 与 `references/validation-rules.md`。机器可读合同分别为 `references/domain-strategy.schema.json` 和 `references/stage-decision-package.schema.json`;对应验证器为 `scripts/validate-domain-strategy.mjs` 与 `scripts/validate-stage-decision-package.mjs`。
@@ -0,0 +1,26 @@
1
+ # DDD 战略设计合同
2
+
3
+ ## 顶层结构
4
+
5
+ 机器可读合同使用 `references/domain-strategy.schema.json`。顶层必须包含:
6
+
7
+ - `schema_version`、`domain_strategy_id`、`domain_version`、`status`;
8
+ - `contexts`、`subdomains`、`relationships`、`scenarios`;
9
+ - `concept_candidates`、`invariants`、`terminology_refs`;
10
+ - `downstream_mapping`、`evidence_refs`、`approval`。
11
+
12
+ ## 上下文
13
+
14
+ 每个上下文声明 `context_id`、职责边界、非职责、子域分类、模型所有者、关键场景和本地词汇引用。`context_id` 是稳定身份,不得使用代码模块、数据库 schema 或菜单路径替代。
15
+
16
+ ## 关系
17
+
18
+ 关系必须声明 `relationship_pattern`、`semantic_upstream`、`semantic_downstream`、`business_authority`、`model_change_impact`、`transport_direction` 和 `translation_responsibility`。语义方向与技术方向可以不同;关系模式只能使用合同中列出的 DDD 模式。
19
+
20
+ ## 核心概念
21
+
22
+ 使用 `domain_concept_candidate` 表达战略阶段的核心概念候选,记录身份特征、生命周期、不变量引用、可能的战术角色和置信度。不得在该合同中把概念直接批准为 Entity 或 Aggregate Root。
23
+
24
+ ## 阶段决策包
25
+
26
+ 阶段包应通过 `domain_strategy_ref` 引用 DDD 合同的当前版本和 digest,并使用 `domain_to_downstream_mapping` 描述领域变化对 Spec、设计、API、数据、Ticket 和测试 seam 的传播。