create-yss-spec 2.2.3 → 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 (339) 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 +5 -5
  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 +2 -2
  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 +6 -3
  11. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +7 -2
  12. package/template/.agents/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +5 -5
  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 +2 -2
  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 +6 -3
  50. package/template/.claude/skills/yss-product-lifecycle/references/state-model.md +7 -2
  51. package/template/.claude/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +5 -5
  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 +2 -2
  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 +6 -3
  89. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +7 -2
  90. package/template/.codex/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +5 -5
  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 +2 -2
  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 +6 -3
  128. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +7 -2
  129. package/template/.cursor/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +5 -5
  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 +2 -2
  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 +6 -3
  167. package/template/.hermes/skills/yss-product-lifecycle/references/state-model.md +7 -2
  168. package/template/.hermes/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +5 -5
  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 +2 -2
  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 +6 -3
  206. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +7 -2
  207. package/template/.pi/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +5 -5
  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 +2 -2
  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 +6 -3
  245. package/template/.qoder/skills/yss-product-lifecycle/references/state-model.md +7 -2
  246. package/template/.qoder/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +5 -5
  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 +2 -2
  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 +6 -3
  284. package/template/.trae/skills/yss-product-lifecycle/references/state-model.md +7 -2
  285. package/template/.trae/skills/yss-router/SKILL.md +4 -2
  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 +58 -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 +2 -1
  318. package/template/docs/agents/digital-human-roles.md +2 -2
  319. package/template/docs/agents/digital-human-roles.yaml +7 -1
  320. package/template/docs/agents/yss-skill-registry.yaml +12 -0
  321. package/template/docs/architecture/templates/system-overview-design-template.md +1 -0
  322. package/template/docs/process/lifecycle-artifact-map.md +8 -0
  323. package/template/docs/process/lifecycle-registry-baseline.json +11 -1
  324. package/template/docs/process/lifecycle-registry.yaml +46 -2
  325. package/template/docs/process/schemas/digital-human-task-package.schema.json +107 -0
  326. package/template/docs/process/schemas/subagent-task-package.schema.json +6 -0
  327. package/template/docs/process/subagent-collaboration.md +2 -2
  328. package/template/docs/templates/subagent-task-package-template.md +39 -1
  329. package/template/scripts/lib/lifecycle-transition.mjs +259 -0
  330. package/template/scripts/lib/scenario-checks.mjs +96 -2
  331. package/template/scripts/lib/task-package.mjs +214 -0
  332. package/template/scripts/verify-digital-human-task-package +14 -0
  333. package/template/scripts/verify-digital-human-task-package-scenarios +8 -0
  334. package/template/scripts/verify-lifecycle-transition-scenarios +105 -0
  335. package/template/scripts/verify-subagent-task-package +8 -0
  336. package/template/scripts/verify-subagent-task-package-scenarios +196 -0
  337. package/template/scripts/verify-template +13 -2
  338. package/template/skills-lock.json +35 -3
  339. package/template.snapshot.json +4 -4
package/README.md CHANGED
@@ -38,6 +38,7 @@ npx create-yss-spec@latest --version
38
38
  - `--no-example-docs`
39
39
  - `attach` 子命令:在已有项目中补齐研发管理资产
40
40
  - `sync` 子命令
41
+ - `update` / `upgrade` 子命令:检查 npm 最新版本,如有更新则安装 CLI 自身
41
42
  - 基于 `.yss-template.json` 的模板版本基线和 managed baseline
42
43
  - 只使用当前 CLI 包内置、绑定不可变 commit 的模板快照
43
44
  - 初始化时将 `yss-project.yaml` 从 `template-source` 改写为 `project-instance`
@@ -47,7 +48,7 @@ npx create-yss-spec@latest --version
47
48
  - init / sync 不把模板源治理笔记、wiki、审查证据、源仓 CI / Cloud 环境和公开发布清单写入项目实例;attach 会带上 `yss-public-skills.json` 供 `verify-template` 使用
48
49
  - 空 gitlink / detached HEAD / git-submodule 挂载点 fail closed,`--force` 也不能覆盖
49
50
 
50
- 本次模板适配按 `2.2.3` 发布,绑定 `yss-spec-project-template@030d806`。`templateCommit` 会写入实例 metadata;“最新模板”指用户执行的 `npx create-yss-spec@latest` 所携带的最新已发布快照,CLI 运行时不会拉取模板仓库。实例会带上数字人角色叠加(`docs/agents/digital-human-roles.yaml`)、YSS 前端技能叠加层(如 `ytable-usage`、`formily-foundation`、`yss-page-module-development`)、`.cursorrules` 与 `.agents/rules/yss-ai-skills.md`;审查临时目录 `docs/.scratch/` 与已退役的 `high-fidelity-html-prototype` 等独立入口不进入快照。
51
+ 本次模板适配按 `2.2.4` 发布,绑定 `yss-spec-project-template@37251d0`。`templateCommit` 会写入实例 metadata;“最新模板”指用户执行的 `npx create-yss-spec@latest` 所携带的最新已发布快照,CLI 运行时不会拉取模板仓库。实例会带上数字人角色叠加(`docs/agents/digital-human-roles.yaml`)、YSS 前端技能叠加层(如 `ytable-usage`、`formily-foundation`、`yss-page-module-development`)、DDD Tactical Design 与生命周期转换校验资产、`.cursorrules` 与 `.agents/rules/yss-ai-skills.md`;审查临时目录 `docs/.scratch/` 与已退役的 `high-fidelity-html-prototype` 等独立入口不进入快照。
51
52
 
52
53
  ## 接管已有项目
53
54
 
@@ -107,6 +108,21 @@ npx create-yss-spec@latest sync --target-dir . --dry-run
107
108
  npx create-yss-spec@latest sync --target-dir . [--force]
108
109
  ```
109
110
 
111
+ ## 升级 CLI 自身
112
+
113
+ `update`(别名 `upgrade`)检查 npm registry 上的最新 `create-yss-spec` 版本,如有更新则按当前安装方式自动安装。它升级的是 CLI 包本身,不会同步项目里的模板资产;模板同步仍使用 `sync`。
114
+
115
+ ```bash
116
+ npx create-yss-spec update
117
+ npx create-yss-spec update --dry-run
118
+ npx create-yss-spec upgrade
119
+ ```
120
+
121
+ - 全局安装会执行 `npm install -g create-yss-spec@latest`
122
+ - 项目本地依赖会在对应项目根执行 `npm install create-yss-spec@latest`
123
+ - 通过 npx 运行或在源码目录中运行时只报告版本并给出安装建议,不覆盖当前文件
124
+ - `--dry-run` 只查询和预览,不安装;`--force` 在已是最新时仍重新安装(npx / 源码目录除外)
125
+
110
126
  ## 开发验证
111
127
 
112
128
  CLI 源码和研发记录由本仓库独立维护。首次测试会从
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-yss-spec",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "Initialize a YSS spec project template repository",
5
5
  "repository": {
6
6
  "type": "git",
package/src/cli.js CHANGED
@@ -5,6 +5,7 @@ const path = require("node:path");
5
5
  const readline = require("node:readline/promises");
6
6
  const { spawnSync } = require("node:child_process");
7
7
  const { treeHash } = require("./template-hash");
8
+ const { UPDATE_COMMANDS, runUpdate } = require("./self-update");
8
9
 
9
10
  const PACKAGE_ROOT = path.resolve(__dirname, "..");
10
11
  const PACKAGE_MANIFEST = JSON.parse(
@@ -2125,6 +2126,8 @@ COMMANDS
2125
2126
  (default) 初始化新的模板实例仓库
2126
2127
  attach 向已有项目补齐受管研发管理资产
2127
2128
  sync 同步已有模板实例的受管资产
2129
+ update 检查 npm 最新版本,如有更新则安装
2130
+ upgrade update 的别名
2128
2131
 
2129
2132
  OPTIONS
2130
2133
  --project-name <name> 项目名称;init 不传则进入交互输入
@@ -2132,10 +2135,11 @@ OPTIONS
2132
2135
  --team-size <size> 团队规模;init 不传则可留空,默认「待补充」
2133
2136
  --target-dir <dir> 目标目录;init 不传则进入交互输入,sync 默认为当前目录
2134
2137
  --issue-tracker github|gitlab 默认 issue tracker 偏好(默认 github)
2135
- --dry-run 只预览计划,不写入文件
2138
+ --dry-run 只预览计划,不写入文件;update 只查询不安装
2136
2139
  --apply attach 确认执行写入;不能与 --dry-run 同时使用
2137
2140
  --force init:允许清空非空目录后重新生成
2138
2141
  attach / sync:覆盖受管冲突文件;unsafe 路径始终阻断
2142
+ update:即使已是最新也重新安装;npx / 源码目录仍不覆盖
2139
2143
  --git-init 初始化完成后执行 git init
2140
2144
  --include-example-docs 显式保留示例文档(默认开启)
2141
2145
  --no-example-docs 不生成示例文档
@@ -2171,6 +2175,9 @@ EXAMPLES
2171
2175
  $ npx create-yss-spec@latest sync
2172
2176
  $ npx create-yss-spec@latest sync --dry-run
2173
2177
  $ npx create-yss-spec@latest sync --target-dir . --force
2178
+ $ npx create-yss-spec update
2179
+ $ npx create-yss-spec update --dry-run
2180
+ $ npx create-yss-spec upgrade
2174
2181
 
2175
2182
  LEARN MORE
2176
2183
  仓库 README:https://github.com/iloveZzz/create-yss-spec#readme
@@ -2196,6 +2203,13 @@ async function runCli(argv = []) {
2196
2203
  runAttach(argv.slice(1));
2197
2204
  return;
2198
2205
  }
2206
+ if (UPDATE_COMMANDS.has(argv[0])) {
2207
+ runUpdate(argv.slice(1), {
2208
+ packageRoot: PACKAGE_ROOT,
2209
+ currentVersion: PACKAGE_MANIFEST.version,
2210
+ });
2211
+ return;
2212
+ }
2199
2213
  await runInit(argv);
2200
2214
  }
2201
2215
 
@@ -0,0 +1,277 @@
1
+ const fs = require("node:fs");
2
+ const path = require("node:path");
3
+ const { spawnSync } = require("node:child_process");
4
+
5
+ const PACKAGE_NAME = "create-yss-spec";
6
+ const UPDATE_COMMANDS = new Set(["update", "upgrade"]);
7
+
8
+ function parseUpdateArgs(argv = []) {
9
+ const options = { dryRun: false, force: false };
10
+
11
+ for (const current of argv) {
12
+ if (current === "--dry-run") {
13
+ options.dryRun = true;
14
+ } else if (current === "--force") {
15
+ options.force = true;
16
+ } else {
17
+ throw new Error(`不支持的参数:${current}`);
18
+ }
19
+ }
20
+
21
+ return options;
22
+ }
23
+
24
+ function parseSemver(version) {
25
+ const match = String(version)
26
+ .trim()
27
+ .match(/^v?(\d+)\.(\d+)\.(\d+)/);
28
+ if (!match) {
29
+ throw new Error(`无法解析版本号:${version}`);
30
+ }
31
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
32
+ }
33
+
34
+ function compareSemver(left, right) {
35
+ const leftParts = parseSemver(left);
36
+ const rightParts = parseSemver(right);
37
+ for (let index = 0; index < 3; index += 1) {
38
+ if (leftParts[index] > rightParts[index]) {
39
+ return 1;
40
+ }
41
+ if (leftParts[index] < rightParts[index]) {
42
+ return -1;
43
+ }
44
+ }
45
+ return 0;
46
+ }
47
+
48
+ function defaultSpawn(command, args, options = {}) {
49
+ return spawnSync(command, args, {
50
+ encoding: "utf8",
51
+ timeout: 120000,
52
+ ...options,
53
+ });
54
+ }
55
+
56
+ function spawnFailed(result) {
57
+ return Boolean(result.error) || result.status !== 0;
58
+ }
59
+
60
+ function spawnErrorDetail(result) {
61
+ return (result.stderr || result.error?.message || result.stdout || "").trim();
62
+ }
63
+
64
+ function npmViewLatest(packageName, spawn) {
65
+ const result = spawn("npm", ["view", packageName, "version"], {
66
+ encoding: "utf8",
67
+ timeout: 30000,
68
+ });
69
+ if (spawnFailed(result)) {
70
+ const detail = spawnErrorDetail(result);
71
+ throw new Error(`无法查询最新版本${detail ? `:${detail}` : ""}`);
72
+ }
73
+
74
+ const lines = (result.stdout || "")
75
+ .trim()
76
+ .split(/\r?\n/)
77
+ .map((line) => line.trim().replace(/^['"]|['"]$/g, ""))
78
+ .filter(Boolean);
79
+ const version = lines[lines.length - 1];
80
+ if (!version) {
81
+ throw new Error("无法查询最新版本:npm view 未返回版本号");
82
+ }
83
+ parseSemver(version);
84
+ return version;
85
+ }
86
+
87
+ function npmGlobalPrefix(spawn) {
88
+ const result = spawn("npm", ["prefix", "-g"], {
89
+ encoding: "utf8",
90
+ timeout: 15000,
91
+ });
92
+ if (spawnFailed(result)) {
93
+ return "";
94
+ }
95
+ return (result.stdout || "").trim();
96
+ }
97
+
98
+ function hasPathSegment(target, segment) {
99
+ return path.resolve(target).split(path.sep).includes(segment);
100
+ }
101
+
102
+ function sameResolvedPath(left, right) {
103
+ try {
104
+ return fs.realpathSync(left) === fs.realpathSync(right);
105
+ } catch {
106
+ return path.resolve(left) === path.resolve(right);
107
+ }
108
+ }
109
+
110
+ function findLocalProjectRoot(packageRoot, packageName) {
111
+ const resolved = path.resolve(packageRoot);
112
+ const marker = `${path.sep}node_modules${path.sep}${packageName}`;
113
+ const index = resolved.lastIndexOf(marker);
114
+ if (index === -1) {
115
+ return null;
116
+ }
117
+ const after = resolved.slice(index + marker.length);
118
+ if (after !== "") {
119
+ return null;
120
+ }
121
+ return resolved.slice(0, index) || path.parse(resolved).root;
122
+ }
123
+
124
+ function detectInstallKind(packageRoot, spawn, packageName = PACKAGE_NAME) {
125
+ const resolvedRoot = path.resolve(packageRoot);
126
+
127
+ if (hasPathSegment(resolvedRoot, "_npx")) {
128
+ return { kind: "npx" };
129
+ }
130
+
131
+ if (fs.existsSync(path.join(resolvedRoot, ".git"))) {
132
+ return { kind: "source" };
133
+ }
134
+
135
+ const prefix = npmGlobalPrefix(spawn);
136
+ if (prefix) {
137
+ const globalRoots = [
138
+ path.join(prefix, "lib", "node_modules", packageName),
139
+ path.join(prefix, "node_modules", packageName),
140
+ ];
141
+ if (globalRoots.some((candidate) => sameResolvedPath(candidate, resolvedRoot))) {
142
+ return { kind: "global" };
143
+ }
144
+ }
145
+
146
+ const projectRoot = findLocalProjectRoot(resolvedRoot, packageName);
147
+ if (projectRoot) {
148
+ return { kind: "local", cwd: projectRoot };
149
+ }
150
+
151
+ return { kind: "unknown" };
152
+ }
153
+
154
+ function buildInstallPlan(install, packageName) {
155
+ if (install.kind === "global") {
156
+ return {
157
+ command: "npm",
158
+ args: ["install", "-g", `${packageName}@latest`],
159
+ cwd: undefined,
160
+ };
161
+ }
162
+ if (install.kind === "local") {
163
+ return {
164
+ command: "npm",
165
+ args: ["install", `${packageName}@latest`],
166
+ cwd: install.cwd,
167
+ };
168
+ }
169
+ return null;
170
+ }
171
+
172
+ function formatInstallCommand(plan) {
173
+ const rendered = `npm ${plan.args.join(" ")}`;
174
+ if (!plan.cwd) {
175
+ return rendered;
176
+ }
177
+ return `npm ${plan.args.join(" ")}(目录:${plan.cwd})`;
178
+ }
179
+
180
+ function writeln(stdout, line) {
181
+ stdout.write(line.endsWith("\n") ? line : `${line}\n`);
182
+ }
183
+
184
+ function printInstallAdvice(stdout, install) {
185
+ writeln(stdout, "当前安装方式不会自动覆盖本地文件");
186
+ if (install.kind === "source") {
187
+ writeln(
188
+ stdout,
189
+ "检测到源码目录;请通过发布流程或 npm install -g create-yss-spec@latest 升级",
190
+ );
191
+ } else if (install.kind === "npx") {
192
+ writeln(
193
+ stdout,
194
+ "当前通过 npx 运行;下次使用 npx create-yss-spec@latest 即可拿到最新版",
195
+ );
196
+ } else {
197
+ writeln(stdout, "未能判断安装位置");
198
+ }
199
+ writeln(stdout, "建议:");
200
+ writeln(stdout, " npm install -g create-yss-spec@latest");
201
+ writeln(stdout, " npx create-yss-spec@latest");
202
+ }
203
+
204
+ function runUpdate(argv = [], deps = {}) {
205
+ const spawn = deps.spawn || defaultSpawn;
206
+ const packageRoot = deps.packageRoot;
207
+ const currentVersion = deps.currentVersion;
208
+ const packageName = deps.packageName || PACKAGE_NAME;
209
+ const stdout = deps.stdout || process.stdout;
210
+ const options = parseUpdateArgs(argv);
211
+
212
+ if (!packageRoot) {
213
+ throw new Error("update 缺少 packageRoot");
214
+ }
215
+ if (!currentVersion) {
216
+ throw new Error("update 缺少 currentVersion");
217
+ }
218
+
219
+ const latestVersion = npmViewLatest(packageName, spawn);
220
+ const comparison = compareSemver(currentVersion, latestVersion);
221
+
222
+ writeln(stdout, `当前版本:${currentVersion}`);
223
+ writeln(stdout, `最新版本:${latestVersion}`);
224
+
225
+ if (comparison > 0) {
226
+ writeln(stdout, "当前版本新于 npm latest,未降级");
227
+ return { status: "newer-than-latest", latestVersion };
228
+ }
229
+
230
+ if (comparison === 0 && !options.force) {
231
+ writeln(stdout, "已是最新版本");
232
+ return { status: "up-to-date", latestVersion };
233
+ }
234
+
235
+ const install = detectInstallKind(packageRoot, spawn, packageName);
236
+ const plan = buildInstallPlan(install, packageName);
237
+
238
+ if (!plan) {
239
+ printInstallAdvice(stdout, install);
240
+ return { status: "advice", kind: install.kind, latestVersion };
241
+ }
242
+
243
+ const commandText = formatInstallCommand(plan);
244
+ if (options.dryRun) {
245
+ writeln(stdout, "dry-run 预览");
246
+ writeln(stdout, `将执行:${commandText}`);
247
+ return { status: "dry-run", kind: install.kind, latestVersion, commandText };
248
+ }
249
+
250
+ writeln(stdout, `正在安装:${commandText}`);
251
+ const result = spawn(plan.command, plan.args, {
252
+ encoding: "utf8",
253
+ timeout: 120000,
254
+ cwd: plan.cwd,
255
+ });
256
+ if (result.stdout) {
257
+ writeln(stdout, result.stdout);
258
+ }
259
+ if (spawnFailed(result)) {
260
+ const detail = spawnErrorDetail(result);
261
+ throw new Error(`升级失败${detail ? `:${detail}` : ""}`);
262
+ }
263
+ if (result.stderr && result.stderr.trim()) {
264
+ writeln(stdout, result.stderr);
265
+ }
266
+ writeln(stdout, `升级完成:${currentVersion} -> ${latestVersion}`);
267
+ return { status: "updated", kind: install.kind, latestVersion };
268
+ }
269
+
270
+ module.exports = {
271
+ PACKAGE_NAME,
272
+ UPDATE_COMMANDS,
273
+ parseUpdateArgs,
274
+ compareSemver,
275
+ detectInstallKind,
276
+ runUpdate,
277
+ };
@@ -5,7 +5,7 @@ description: 用于构建或重构 YSS 领域层代码。当用户要求设计
5
5
 
6
6
  # yss-domain
7
7
 
8
- 这是一个建模型 skill。核心目标是先把领域语义和边界建立清楚,再落代码。
8
+ 这是一个领域实现 skill。核心目标是消费已批准的战术模型,将领域行为落实为代码;战术模型的设计与批准由 `yss-tactical-design` 和 `yss-product-lifecycle` 负责。
9
9
 
10
10
  默认输出是新 DDD target profile;现有 YSS 组件仓库常见 `core/client/repository`、贫血对象和 VO 型 Gateway 只是 legacy profile,不得静默复制成新模块架构。
11
11
 
@@ -23,10 +23,10 @@ description: 用于构建或重构 YSS 领域层代码。当用户要求设计
23
23
 
24
24
  ## 工作方式
25
25
 
26
- 1. 先抽业务术语、聚合边界和状态变化。
26
+ 1. 先读取批准且版本当前的 tactical-design contract 和 Slice Implementation Contract。
27
27
  2. 数据库字段只做补充,不直接决定领域对象结构。
28
- 3. 先定义领域行为,再决定 Gateway 边界。
29
- 4. 规则不清晰时,保留显式假设,不要静默猜测。
28
+ 3. 按合同实现领域行为、状态机、不变量和 Gateway 边界。
29
+ 4. 规则不清晰或模型需要扩展时,返回 `new_impacts` / `drift` 并停止,不要静默猜测。
30
30
 
31
31
  ## 产物范围
32
32
 
@@ -63,6 +63,7 @@ description: 用于构建或重构 YSS 领域层代码。当用户要求设计
63
63
  ## 阶段 7 合同
64
64
 
65
65
  - 只消费生命周期已批准的 `Slice Implementation Contract` 和当前 `work_unit`;不得扩大 `allowed_write_paths`。
66
+ - `Slice Implementation Contract` 必须引用批准且版本当前的 `tactical_design_ref`;不得在实现阶段重新批准或替换聚合、不变量和一致性策略。
66
67
  - 领域规则、状态机和不变量必须使用 `behavior-tdd`,先形成失败测试,再实现最小行为。
67
68
  - 完成后按 `yss-router/references/yss-skill-execution-result.md` 返回统一 `YSS Skill Execution Result`:changed files、领域/测试证据、实际验证结果、偏离和新增影响。
68
69
  - 发现新 API、权限、状态机、数据模型或架构影响时填入 `new_impacts` 并暂停,不得静默扩张切片。
@@ -27,12 +27,12 @@ Matt 的 `grill-with-docs`、`to-spec`、`to-tickets`、`implement` 等保留为
27
27
  | 阶段 | 必需产物/门禁 | 工作单元与技能 | 通过条件 |
28
28
  |---|---|---|---|
29
29
  | 入口分诊 | 身份、影响面、最近可信阶段 | `yss-product-lifecycle` | `yss-project.yaml` 合法且影响面可解释 |
30
- | 机会调研/需求分析 | Discovery、用户/MVP/非目标/成功标准、测试 seam | `work-unit.discovery-opportunity` + `work-unit.discovery-requirements`;市场/竞品事实用 `competitive-intelligence`,技术/标准事实用 `research`;`grill-with-docs` 为兼容入口 | 未决事实已 research 或 handoff,用户确认,无 runnable blocker |
30
+ | 机会调研/需求分析 | Discovery、用户/MVP/非目标/成功标准、测试 seam;命中 DDD 影响时补充领域战略设计与阶段决策包 | `work-unit.discovery-opportunity` + `work-unit.discovery-requirements` + `work-unit.domain-strategy-design` + `work-unit.stage-decision`;市场/竞品事实用 `competitive-intelligence`,技术/标准事实用 `research`;领域建模用 `domain-modeling`;`grill-with-docs` 为兼容入口 | 未决事实已 research 或 handoff,领域边界和统一语言可审查,阶段决策包完成必要批准 |
31
31
  | Spec/功能架构 | Spec、产品总体设计、功能架构;必要时 Spec Delta | 原生 `work-unit.spec-synthesis`;`to-spec` 为兼容入口 | 初稿先为 `ready-for-human`;只有 Spec baseline 会签批准后资产才为 `approved` 并进入下游 |
32
32
  | 原型设计 | 交互说明、低保真、状态矩阵、高保真 HTML、评审记录 | `yss-design-system` → `yss-prototype-stage` → `yss-antd-design`(仅原型事实)→ Codex `product-design:index`(非 Codex 交付等价合同)。前端落地改用 `yss-ui` | `gate.prototype-reviewed`、`gate.prototype-verified`、`gate.user-confirmation` 均有证据 |
33
- | 技术分析 | OpenAPI Draft/Freeze、数据架构、工程基线、架构审查 | `yss-openapi-governance` / `yss-openapi-draft-review`、`codebase-design`、`implementation-repo-onboarding`、`yss-router` | API/架构契约冻结;无 API 影响有明确记录;脚手架策略满足 |
33
+ | 技术分析 | OpenAPI Draft/Freeze、数据架构、工程基线、架构审查;按领域影响执行 Tactical DDD Check | `yss-openapi-governance` / `yss-openapi-draft-review`、`codebase-design`、`implementation-repo-onboarding`、`yss-tactical-design`、`yss-router` | API/架构契约冻结;无 API 影响有明确记录;战术模型无未解释冲突;脚手架策略满足 |
34
34
  | Ticket 正式化 | 功能父 Ticket、垂直切片、Slice Implementation Contract | 原生 `work-unit.ticket-decomposition`;`to-tickets` 为兼容入口;生命周期复算 | 依赖、验收、测试 seam 可执行;合同已批准、持久化且为当前版本 |
35
- | 技术实现 | 前端/后端代码、TDD 证据、YSS Skill Execution Result | 原生 `work-unit.slice-implementation`;`implement` 为兼容入口;前端按 `yss-ui` + `yss-page-module-development`,后端按 `yss-router` 最小闭包,业务行为统一 `tdd` | 只写允许路径;业务行为用 `behavior-tdd`;UI 影响必须有还原计划 |
35
+ | 技术实现 | 前端/后端代码、TDD 证据、YSS Skill Execution Result | 原生 `work-unit.slice-implementation`;`implement` 为兼容入口;前端按 `yss-ui` + `yss-page-module-development`,后端按 `yss-router` 最小闭包,业务行为统一 `tdd` | 仅接收已完成 Ticket 正式化、已绑定垂直切片且 `ready-for-agent` 公式通过的输入;只写允许路径;业务行为用 `behavior-tdd`;UI 影响必须有还原计划 |
36
36
  | Review/验证 | 不可变候选快照、review 结论、fresh verification | `code-review`(独立于实现者);UI 影响追加 `yss-ui` + `yss-design-system` 的 UI fidelity 轴 | findings 已处理;同一候选快照通过全部审查轴与验证 |
37
37
  | 发布/复盘 | 发布/回滚证据、复盘记录 | 生命周期自有工作单元 | fresh verification、独立审查和发布裁决齐全;`gate.release-ready` 仍须生物人 |
38
38
 
@@ -42,8 +42,8 @@ Matt 的 `grill-with-docs`、`to-spec`、`to-tickets`、`implement` 等保留为
42
42
 
43
43
  ## 结果与暂停
44
44
 
45
- 每个工作单元必须返回 `Workflow Execution Result`(workflow reference、skill、changed files、evidence refs、actual verification、deferred seams、drift/new impacts)。缺少可读证据、`stale`、`violation`、`drift`、`new_impacts` 或阻塞信号时不得标记 completed。实现授权不包含 Git commit/push 授权;“做完提交”等自然语言意向不构成上述结构化 Git 授权。
45
+ 凡主控向数字人角色或独立运行时正式派发生命周期工作单元,都必须通过结构化任务包派发,并返回 `Workflow Execution Result`(workflow reference、skill、changed files、evidence refs、actual verification、deferred seams、drift/new impacts)。任务包使用 `docs/process/schemas/digital-human-task-package.schema.json`,由 `scripts/verify-digital-human-task-package` 校验;其中 `role_id`、`runtime_id`、`execution_state`、`contract.kind/id/version`、允许写路径、预期证据和汇合引用必须完整。`slice-implementation` 任务包额外绑定批准且当前版本的 Slice Implementation Contract;Discovery、Spec、原型、技术分析、Ticket、Review、发布和模板维护分别绑定各自的生命周期资产或维护 checkpoint,不得伪造 Slice Contract。缺少可读证据、`stale`、`violation`、`drift`、`new_impacts` 或阻塞信号时不得标记 completed。实现授权不包含 Git commit/push 授权;“做完提交”等自然语言意向不构成上述结构化 Git 授权。
46
46
 
47
- 输出固定包含:模式、当前阶段、影响面、资产/门禁状态、证据、阻塞项、本轮动作、下一工作单元、暂停/继续理由、Ticket 同步和 Git checkpoint 判断。暂停会签时必须输出门禁 ID、指定 `role_id`、`runtime_id` 和会签文件路径(`docs/.scratch/<feature>/gates/<gate-id>-approval.yaml`)。恢复前运行 `scripts/verify-approval-record`;错误会签记为 `blocked`,不得把该门禁标为 `approved`。任务包的 `core_skills` / `forbidden_skills` 必须从 `docs/agents/digital-human-roles.yaml` 复制(`taskPackageDefaults`),禁止手写第二套。
47
+ 输出固定包含:模式、当前阶段、影响面、资产/门禁状态、证据、Ticket 正式化状态、垂直切片引用、`ready-for-agent` 计算结果、阻塞项、本轮动作、下一工作单元、暂停/继续理由、Ticket 同步和 Git checkpoint 判断。原生路径未出现 `to-tickets` / `implement` 名称本身不构成异常;但没有完成 `work-unit.ticket-decomposition`、垂直切片仍为 `ready-for-human`、引用父 Ticket 或 `next_route` 越过 Ticket 正式化时必须返回 `blocked`。暂停会签时必须输出门禁 ID、指定 `role_id`、`runtime_id` 和会签文件路径(`docs/.scratch/<feature>/gates/<gate-id>-approval.yaml`)。恢复前运行 `scripts/verify-approval-record`;错误会签记为 `blocked`,不得把该门禁标为 `approved`。任务包的 `core_skills` / `forbidden_skills` 必须从 `docs/agents/digital-human-roles.yaml` 复制(`taskPackageDefaults`),禁止手写第二套。
48
48
 
49
49
  详细执行循环、readiness、脚手架(包括 `controlled-generation`)、审查快照、状态传播和 Matt 边界见 [orchestration.md](references/orchestration.md)、[orchestration-contract.yaml](references/orchestration-contract.yaml)、[artifact-dependencies.md](references/artifact-dependencies.md) 和 [state-model.md](references/state-model.md)。
@@ -7,6 +7,8 @@ Discovery → Spec → Product Overview / Functional Architecture
7
7
  Spec + Product Overview → Product Design / Requirement Freeze
8
8
  Spec + Product Overview → API Impact / OpenAPI Draft
9
9
  Spec + Product Overview → System / Data Architecture
10
+ System / Data Architecture + domain impact → Tactical DDD Check / tactical-design contract
11
+ Tactical DDD contract → Architecture Review / Engineering Baseline / Slice Implementation Contract
10
12
  API impact = yes: Requirement Freeze + Design Review + Draft Review → OpenAPI Freeze
11
13
  API impact = no: API Impact Assessment approved → No-API-Impact record;Draft/Freeze gates = not-applicable
12
14
  Frozen Contract → Vertical Slice Tickets
@@ -30,3 +32,5 @@ Implementation → Independent Review → Fresh Verification → Release
30
32
  明确写入需求的认证、授权、租户隔离、敏感数据或合规行为变化不使用独立影响类型;按它实际改变的 UI 状态、API schema、状态机、数据模型或服务边界传播。普通 action 注册、SQL / DDL / 迁移和上传 / 下载只使用既有技术影响类型,不增加安全 / 权限传播。
31
33
 
32
34
  OpenAPI Freeze 后发生上游变化时,不得仅因父 Ticket 仍写阶段 6 就继续实现。先做影响分析,再精准更新相关资产和门禁。
35
+
36
+ 战术设计合同上游引用发生版本变化时,先将 tactical-design 标记为 `stale`,再传播到 Slice Contract;发现新的聚合、状态、不变量、一致性或 Gateway 影响时标记 `drift` / `new_impacts` 并重新路由。
@@ -69,8 +69,8 @@ Router 状态映射为:`draft → completed`、`blocked → blocked`、`ready-
69
69
  | Matt flow | 进入条件 | 生命周期结果 |
70
70
  |---|---|---|
71
71
  | `to-spec`(用户显式) | Discovery work unit 或 `grill-with-docs` 已满足退出条件,且不存在未回流 runnable blocker;用户问题、MVP/非目标、成功标准、测试 seam 和术语审查均有证据 | 生命周期只准备/验收;Spec 初稿为 `ready-for-human`,不等于批准 |
72
- | `to-tickets`(用户显式) | OpenAPI Freeze 或 `no-api-impact` 记录、必要门禁、垂直切片范围和阻塞边均已明确 | 生命周期只准备/验收;只能生成垂直切片 Ticket,初始统一为 `ready-for-human` |
73
- | `implement`(用户显式) | `ready-for-agent` 公式、Contract 已批准/持久化/版本一致、Build Architecture Checklist、实现仓库/分支/CI/验证命令/回滚点,以及后端 Contract(适用时)均满足 | 生命周期只准备/验收;单会话实现同样适用,不得绕过门禁 |
72
+ | `to-tickets`(用户显式) | OpenAPI Freeze 或 `no-api-impact` 记录、必要门禁、垂直切片范围和阻塞边均已明确 | 生命周期只准备/验收;只能生成垂直切片 Ticket,初始统一为 `ready-for-human`;必须留下 `ticket_decomposition_result_ref` 和 `vertical_slice_ticket_ref` |
73
+ | `implement`(用户显式) | `ready-for-agent` 公式、Ticket 正式化结果、垂直切片引用/类型/状态、Contract 已批准/持久化/版本一致、Build Architecture Checklist、实现仓库/分支/CI/验证命令/回滚点,以及后端 Contract(适用时)均满足 | 生命周期只准备/验收;单会话实现同样适用,不得绕过门禁;父 Ticket、`ready-for-human` 切片或跳过 Ticket 正式化的 `next_route` 必须 `blocked` |
74
74
 
75
75
  `grill_exit` 不是“已经聊过”的自然语言声明。它必须同时证明 frontier 为空、事实已解决或分别路由到 `research` / prototype / external input、用户决策已确认、双方共同理解已确认,并且没有未回流的 runnable blocker。
76
76