create-yss-spec 3.4.10 → 3.5.2

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 (642) hide show
  1. package/README.md +8 -4
  2. package/package.json +1 -1
  3. package/src/api/_sync-service.js +141 -23
  4. package/src/cli/args.js +3 -0
  5. package/src/cli/help.js +14 -2
  6. package/src/cli/index.js +3 -0
  7. package/src/cli/prompts.js +5 -1
  8. package/src/cli/router.js +2 -0
  9. package/src/commands/attach.js +21 -5
  10. package/src/commands/diff.js +1 -0
  11. package/src/commands/doctor.js +1 -0
  12. package/src/commands/init.js +4 -1
  13. package/src/commands/skills.js +253 -0
  14. package/src/commands/sync.js +4 -0
  15. package/src/family-identity.js +2 -2
  16. package/src/template/asset-runtime.js +228 -0
  17. package/src/template/attach-planner.js +1 -1
  18. package/src/template/distribution-runtime.js +165 -0
  19. package/src/template/instance-runtime.js +76 -29
  20. package/src/template/layout-migration.js +160 -0
  21. package/src/template/migration-runtime.js +2 -2
  22. package/src/template/ownership-policy.js +17 -1
  23. package/src/template/prune-planner.js +6 -1
  24. package/src/template/sync-planner.js +4 -1
  25. package/src/template/verification-runtime.js +56 -1
  26. package/src/validation/metadata.js +24 -1
  27. package/template/.agents/rules/yss-ai-skills.md +1 -1
  28. package/template/.agents/skills/.strategic-design-skills-manifest.json +7 -8
  29. package/template/.agents/skills/.yss-skills-manifest.json +2 -2
  30. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +1 -1
  31. package/template/.agents/skills/code-review/SKILL.md +6 -6
  32. package/template/.agents/skills/code-review/references/yss-review-standards.md +1 -1
  33. package/template/.agents/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  34. package/template/.agents/skills/i-have-adhd/SKILL.md +1 -1
  35. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  36. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  37. package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
  38. package/template/.agents/skills/llm-wiki/references/discover.md +3 -3
  39. package/template/.agents/skills/prototype-review/SKILL.md +4 -4
  40. package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  41. package/template/.agents/skills/triage/SKILL.md +1 -1
  42. package/template/.agents/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  43. package/template/.agents/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  44. package/template/.agents/skills/yss-backend-spec-review/SKILL.md +1 -1
  45. package/template/.agents/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  46. package/template/.agents/skills/yss-cache/SKILL.md +6 -5
  47. package/template/.agents/skills/yss-cache/references/annotations.md +3 -1
  48. package/template/.agents/skills/yss-cache/references/architecture.md +4 -2
  49. package/template/.agents/skills/yss-cache/references/configuration.md +6 -3
  50. package/template/.agents/skills/yss-cache/references/jetcache.md +21 -0
  51. package/template/.agents/skills/yss-cache/references/redis-fallback.md +5 -3
  52. package/template/.agents/skills/yss-cache/references/verification.md +10 -4
  53. package/template/.agents/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  54. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  55. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  56. package/template/.agents/skills/yss-design-system/SKILL.md +10 -10
  57. package/template/.agents/skills/yss-design-system/references/design-qa-theme.md +3 -3
  58. package/template/.agents/skills/yss-design-system/references/design-system.md +3 -3
  59. package/template/.agents/skills/yss-distributed-id/SKILL.md +14 -58
  60. package/template/.agents/skills/yss-distributed-id/agents/openai.yaml +2 -2
  61. package/template/.agents/skills/yss-distributed-id/references/README.md +11 -47
  62. package/template/.agents/skills/yss-exception/SKILL.md +1 -1
  63. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  64. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  65. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  66. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  67. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  68. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  69. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  70. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  71. package/template/.agents/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  72. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  73. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  74. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  75. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  76. package/template/.agents/skills/yss-mybatis/SKILL.md +14 -2
  77. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -2
  78. package/template/.agents/skills/yss-openapi-governance/SKILL.md +7 -7
  79. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +11 -11
  80. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  81. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  82. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  83. package/template/.agents/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  84. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +11 -11
  85. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  86. package/template/.agents/skills/yss-prototype-stage/SKILL.md +9 -9
  87. package/template/.agents/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  88. package/template/.agents/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  89. package/template/.agents/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  90. package/template/.agents/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  91. package/template/.agents/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  92. package/template/.agents/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  93. package/template/.agents/skills/yss-repository/SKILL.md +3 -2
  94. package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  95. package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  96. package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  97. package/template/.agents/skills/yss-research/SKILL.md +2 -2
  98. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  99. package/template/.agents/skills/yss-stage-decision/SKILL.md +5 -5
  100. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  101. package/template/.agents/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  102. package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
  103. package/template/.agents/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  104. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  105. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -6
  106. package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  107. package/template/.agents/skills/yss-ui/SKILL.md +1 -1
  108. package/template/.agents/skills/yss-up-springboot3/SKILL.md +1 -1
  109. package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
  110. package/template/.agents/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  111. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +1 -1
  112. package/template/.codex/skills/code-review/SKILL.md +6 -6
  113. package/template/.codex/skills/code-review/references/yss-review-standards.md +1 -1
  114. package/template/.codex/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  115. package/template/.codex/skills/i-have-adhd/SKILL.md +1 -1
  116. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  117. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  118. package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
  119. package/template/.codex/skills/llm-wiki/references/discover.md +3 -3
  120. package/template/.codex/skills/prototype-review/SKILL.md +4 -4
  121. package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  122. package/template/.codex/skills/triage/SKILL.md +1 -1
  123. package/template/.codex/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  124. package/template/.codex/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  125. package/template/.codex/skills/yss-backend-spec-review/SKILL.md +1 -1
  126. package/template/.codex/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  127. package/template/.codex/skills/yss-cache/SKILL.md +6 -5
  128. package/template/.codex/skills/yss-cache/references/annotations.md +3 -1
  129. package/template/.codex/skills/yss-cache/references/architecture.md +4 -2
  130. package/template/.codex/skills/yss-cache/references/configuration.md +6 -3
  131. package/template/.codex/skills/yss-cache/references/jetcache.md +21 -0
  132. package/template/.codex/skills/yss-cache/references/redis-fallback.md +5 -3
  133. package/template/.codex/skills/yss-cache/references/verification.md +10 -4
  134. package/template/.codex/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  135. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  136. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  137. package/template/.codex/skills/yss-design-system/SKILL.md +10 -10
  138. package/template/.codex/skills/yss-design-system/references/design-qa-theme.md +3 -3
  139. package/template/.codex/skills/yss-design-system/references/design-system.md +3 -3
  140. package/template/.codex/skills/yss-distributed-id/SKILL.md +14 -58
  141. package/template/.codex/skills/yss-distributed-id/agents/openai.yaml +2 -2
  142. package/template/.codex/skills/yss-distributed-id/references/README.md +11 -47
  143. package/template/.codex/skills/yss-exception/SKILL.md +1 -1
  144. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  145. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  146. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  147. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  148. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  149. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  150. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  151. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  152. package/template/.codex/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  153. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  154. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  155. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  156. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  157. package/template/.codex/skills/yss-mybatis/SKILL.md +14 -2
  158. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -2
  159. package/template/.codex/skills/yss-openapi-governance/SKILL.md +7 -7
  160. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +11 -11
  161. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  162. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  163. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  164. package/template/.codex/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  165. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +11 -11
  166. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  167. package/template/.codex/skills/yss-prototype-stage/SKILL.md +9 -9
  168. package/template/.codex/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  169. package/template/.codex/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  170. package/template/.codex/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  171. package/template/.codex/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  172. package/template/.codex/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  173. package/template/.codex/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  174. package/template/.codex/skills/yss-repository/SKILL.md +3 -2
  175. package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  176. package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  177. package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  178. package/template/.codex/skills/yss-research/SKILL.md +2 -2
  179. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  180. package/template/.codex/skills/yss-stage-decision/SKILL.md +5 -5
  181. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  182. package/template/.codex/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  183. package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
  184. package/template/.codex/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  185. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  186. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -6
  187. package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  188. package/template/.codex/skills/yss-ui/SKILL.md +1 -1
  189. package/template/.codex/skills/yss-up-springboot3/SKILL.md +1 -1
  190. package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
  191. package/template/.codex/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  192. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +1 -1
  193. package/template/.cursor/skills/code-review/SKILL.md +6 -6
  194. package/template/.cursor/skills/code-review/references/yss-review-standards.md +1 -1
  195. package/template/.cursor/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  196. package/template/.cursor/skills/i-have-adhd/SKILL.md +1 -1
  197. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  198. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  199. package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
  200. package/template/.cursor/skills/llm-wiki/references/discover.md +3 -3
  201. package/template/.cursor/skills/prototype-review/SKILL.md +4 -4
  202. package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  203. package/template/.cursor/skills/triage/SKILL.md +1 -1
  204. package/template/.cursor/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  205. package/template/.cursor/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  206. package/template/.cursor/skills/yss-backend-spec-review/SKILL.md +1 -1
  207. package/template/.cursor/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  208. package/template/.cursor/skills/yss-cache/SKILL.md +6 -5
  209. package/template/.cursor/skills/yss-cache/references/annotations.md +3 -1
  210. package/template/.cursor/skills/yss-cache/references/architecture.md +4 -2
  211. package/template/.cursor/skills/yss-cache/references/configuration.md +6 -3
  212. package/template/.cursor/skills/yss-cache/references/jetcache.md +21 -0
  213. package/template/.cursor/skills/yss-cache/references/redis-fallback.md +5 -3
  214. package/template/.cursor/skills/yss-cache/references/verification.md +10 -4
  215. package/template/.cursor/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  216. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  217. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  218. package/template/.cursor/skills/yss-design-system/SKILL.md +10 -10
  219. package/template/.cursor/skills/yss-design-system/references/design-qa-theme.md +3 -3
  220. package/template/.cursor/skills/yss-design-system/references/design-system.md +3 -3
  221. package/template/.cursor/skills/yss-distributed-id/SKILL.md +14 -58
  222. package/template/.cursor/skills/yss-distributed-id/agents/openai.yaml +2 -2
  223. package/template/.cursor/skills/yss-distributed-id/references/README.md +11 -47
  224. package/template/.cursor/skills/yss-exception/SKILL.md +1 -1
  225. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  226. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  227. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  228. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  229. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  230. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  231. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  232. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  233. package/template/.cursor/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  234. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  235. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  236. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  237. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  238. package/template/.cursor/skills/yss-mybatis/SKILL.md +14 -2
  239. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -2
  240. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +7 -7
  241. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +11 -11
  242. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  243. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  244. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  245. package/template/.cursor/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  246. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +11 -11
  247. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  248. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +9 -9
  249. package/template/.cursor/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  250. package/template/.cursor/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  251. package/template/.cursor/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  252. package/template/.cursor/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  253. package/template/.cursor/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  254. package/template/.cursor/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  255. package/template/.cursor/skills/yss-repository/SKILL.md +3 -2
  256. package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  257. package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  258. package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  259. package/template/.cursor/skills/yss-research/SKILL.md +2 -2
  260. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  261. package/template/.cursor/skills/yss-stage-decision/SKILL.md +5 -5
  262. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  263. package/template/.cursor/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  264. package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
  265. package/template/.cursor/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  266. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  267. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -6
  268. package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  269. package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
  270. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +1 -1
  271. package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
  272. package/template/.cursor/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  273. package/template/.cursorrules +1 -1
  274. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +1 -1
  275. package/template/.pi/skills/code-review/SKILL.md +6 -6
  276. package/template/.pi/skills/code-review/references/yss-review-standards.md +1 -1
  277. package/template/.pi/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  278. package/template/.pi/skills/i-have-adhd/SKILL.md +1 -1
  279. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  280. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  281. package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
  282. package/template/.pi/skills/llm-wiki/references/discover.md +3 -3
  283. package/template/.pi/skills/prototype-review/SKILL.md +4 -4
  284. package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +10 -10
  285. package/template/.pi/skills/triage/SKILL.md +1 -1
  286. package/template/.pi/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  287. package/template/.pi/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  288. package/template/.pi/skills/yss-backend-spec-review/SKILL.md +1 -1
  289. package/template/.pi/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  290. package/template/.pi/skills/yss-cache/SKILL.md +6 -5
  291. package/template/.pi/skills/yss-cache/references/annotations.md +3 -1
  292. package/template/.pi/skills/yss-cache/references/architecture.md +4 -2
  293. package/template/.pi/skills/yss-cache/references/configuration.md +6 -3
  294. package/template/.pi/skills/yss-cache/references/jetcache.md +21 -0
  295. package/template/.pi/skills/yss-cache/references/redis-fallback.md +5 -3
  296. package/template/.pi/skills/yss-cache/references/verification.md +10 -4
  297. package/template/.pi/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
  298. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  299. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  300. package/template/.pi/skills/yss-design-system/SKILL.md +10 -10
  301. package/template/.pi/skills/yss-design-system/references/design-qa-theme.md +3 -3
  302. package/template/.pi/skills/yss-design-system/references/design-system.md +3 -3
  303. package/template/.pi/skills/yss-distributed-id/SKILL.md +14 -58
  304. package/template/.pi/skills/yss-distributed-id/agents/openai.yaml +2 -2
  305. package/template/.pi/skills/yss-distributed-id/references/README.md +11 -47
  306. package/template/.pi/skills/yss-exception/SKILL.md +1 -1
  307. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  308. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  309. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  310. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
  311. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
  312. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  313. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  314. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  315. package/template/.pi/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  316. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  317. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  318. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  319. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  320. package/template/.pi/skills/yss-mybatis/SKILL.md +14 -2
  321. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -2
  322. package/template/.pi/skills/yss-openapi-governance/SKILL.md +7 -7
  323. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +11 -11
  324. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
  325. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
  326. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +22 -14
  327. package/template/.pi/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  328. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +11 -11
  329. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  330. package/template/.pi/skills/yss-prototype-stage/SKILL.md +9 -9
  331. package/template/.pi/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  332. package/template/.pi/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  333. package/template/.pi/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  334. package/template/.pi/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  335. package/template/.pi/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  336. package/template/.pi/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  337. package/template/.pi/skills/yss-repository/SKILL.md +3 -2
  338. package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  339. package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  340. package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  341. package/template/.pi/skills/yss-research/SKILL.md +2 -2
  342. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  343. package/template/.pi/skills/yss-stage-decision/SKILL.md +5 -5
  344. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  345. package/template/.pi/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  346. package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
  347. package/template/.pi/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  348. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  349. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -6
  350. package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  351. package/template/.pi/skills/yss-ui/SKILL.md +1 -1
  352. package/template/.pi/skills/yss-up-springboot3/SKILL.md +1 -1
  353. package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
  354. package/template/.pi/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  355. package/template/{docs → .template-spec}/adr/README.md +1 -1
  356. package/template/{docs → .template-spec}/agents/README.md +1 -1
  357. package/template/{docs → .template-spec}/agents/backend-architecture-profiles.md +2 -2
  358. package/template/{docs → .template-spec}/agents/digital-human-roles.md +6 -6
  359. package/template/{docs → .template-spec}/agents/digital-human-roles.yaml +5 -5
  360. package/template/{docs → .template-spec}/agents/gitlab-workflow-skills.md +2 -2
  361. package/template/{docs → .template-spec}/agents/issue-tracker.md +1 -1
  362. package/template/{docs → .template-spec}/agents/skill-migrations.md +6 -2
  363. package/template/{docs → .template-spec}/agents/triage-labels.md +1 -1
  364. package/template/{docs → .template-spec}/agents/yss-skill-registry.yaml +9 -8
  365. package/template/{docs → .template-spec}/architecture/README.md +3 -3
  366. package/template/{docs → .template-spec}/architecture/templates/tech-design-template.md +3 -1
  367. package/template/{docs → .template-spec}/design/README.md +12 -12
  368. package/template/{docs → .template-spec}/design/design.md +20 -20
  369. package/template/{docs/design/templates/interaction-spec-template.md → .template-spec/design/templates/examples/model-publishing-interaction.example.md} +6 -4
  370. package/template/{docs/design/templates/state-matrix-template.md → .template-spec/design/templates/examples/model-publishing-state-matrix.example.md} +3 -1
  371. package/template/.template-spec/design/templates/interaction-spec-template.md +61 -0
  372. package/template/{docs → .template-spec}/design/templates/product-overview-design-template.md +11 -11
  373. package/template/{docs → .template-spec}/design/templates/prototype-evidence-template.yaml +4 -4
  374. package/template/{docs → .template-spec}/design/templates/prototype-review-checklist.md +1 -1
  375. package/template/.template-spec/design/templates/state-matrix-template.md +29 -0
  376. package/template/.template-spec/design/tokens/.design-md-projection.json +13 -0
  377. package/template/{docs → .template-spec}/engineering/backend-platforms.md +1 -1
  378. package/template/{docs → .template-spec}/plan/entry-review.md +8 -4
  379. package/template/{docs → .template-spec}/plan/templates/plan-template.md +1 -1
  380. package/template/{docs → .template-spec}/process/contract-reading.md +1 -1
  381. package/template/{docs → .template-spec}/process/lifecycle-artifact-map.md +5 -5
  382. package/template/.template-spec/process/lifecycle-registry-baseline.json +253 -0
  383. package/template/{docs → .template-spec}/process/lifecycle-registry.yaml +19 -12
  384. package/template/{docs → .template-spec}/process/plan-migration.md +1 -1
  385. package/template/{docs → .template-spec}/process/schemas/digital-human-task-package.schema.json +14 -1
  386. package/template/{docs → .template-spec}/process/schemas/lifecycle-checkpoint.schema.json +15 -0
  387. package/template/{docs → .template-spec}/process/schemas/lifecycle-registry.schema.json +1 -1
  388. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v3.schema.json +1 -1
  389. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v4.schema.json +1 -1
  390. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v5.schema.json +1 -1
  391. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff.schema.json +1 -1
  392. package/template/{docs → .template-spec}/process/stage-tracking.md +1 -1
  393. package/template/{docs → .template-spec}/process/subagent-collaboration.md +2 -2
  394. package/template/{docs → .template-spec}/templates/build-architecture-checklist-template.md +2 -2
  395. package/template/{docs → .template-spec}/templates/digital-human-runtime-profile-template.md +2 -2
  396. package/template/{docs → .template-spec}/templates/grok-bot-profile-template.md +1 -1
  397. package/template/{docs → .template-spec}/templates/local-parent-ticket-template.md +1 -1
  398. package/template/.template-spec/templates/release-note-template.md +29 -0
  399. package/template/.template-spec/templates/retro-report-template.md +24 -0
  400. package/template/{docs → .template-spec}/templates/subagent-task-package-template.md +3 -3
  401. package/template/.template-spec/templates/verification-record-template.md +64 -0
  402. package/template/{docs → .template-spec}/templates/vertical-slice-ticket-template.md +5 -10
  403. package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
  404. package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +4 -4
  405. package/template/AGENTS.md +12 -12
  406. package/template/CONTEXT.md +3 -3
  407. package/template/README.md +22 -25
  408. package/template/scripts/backend-delivery +1 -1
  409. package/template/scripts/design-md +2 -0
  410. package/template/scripts/lib/api-contract-decision.mjs +1 -1
  411. package/template/scripts/lib/approved-execution-context.mjs +5 -5
  412. package/template/scripts/lib/backend-delivery.mjs +4 -4
  413. package/template/scripts/lib/backend-platform.mjs +1 -1
  414. package/template/scripts/lib/backend-review.mjs +1 -1
  415. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
  416. package/template/scripts/lib/backend-standards-coverage.mjs +2 -2
  417. package/template/scripts/lib/context-reconciliation.mjs +1 -1
  418. package/template/scripts/lib/contract-views.mjs +9 -9
  419. package/template/scripts/lib/delivery-preflight.mjs +6 -6
  420. package/template/scripts/lib/design-md.mjs +230 -0
  421. package/template/scripts/lib/digital-human-roles.mjs +2 -2
  422. package/template/scripts/lib/existing-backend-architecture.mjs +1 -1
  423. package/template/scripts/lib/existing-ui-baseline.mjs +1 -1
  424. package/template/scripts/lib/frontend-delivery.mjs +2 -2
  425. package/template/scripts/lib/governance-layout.mjs +74 -0
  426. package/template/scripts/lib/harness-execution-scope.mjs +2 -2
  427. package/template/scripts/lib/lifecycle-context-query.mjs +11 -3
  428. package/template/scripts/lib/lifecycle-registry.mjs +46 -7
  429. package/template/scripts/lib/lifecycle-status.mjs +111 -0
  430. package/template/scripts/lib/lifecycle-transition.mjs +71 -10
  431. package/template/scripts/lib/openapi-draft-validation.mjs +1 -1
  432. package/template/scripts/lib/plan-spec-entry-view.mjs +48 -0
  433. package/template/scripts/lib/plan-spec-entry.mjs +3 -3
  434. package/template/scripts/lib/skill-registry.mjs +16 -9
  435. package/template/scripts/lib/skill-supply-chain.mjs +34 -15
  436. package/template/scripts/lib/slice-contract-preparation.mjs +3 -3
  437. package/template/scripts/lib/slice-contract.mjs +1 -1
  438. package/template/scripts/lib/slice-repositories.mjs +1 -1
  439. package/template/scripts/lib/slice-task-package.mjs +3 -3
  440. package/template/scripts/lib/stage-tracking-migration.mjs +2 -2
  441. package/template/scripts/lib/stage-tracking.mjs +5 -5
  442. package/template/scripts/lib/strategic-feedback.mjs +2 -2
  443. package/template/scripts/lib/strategic-handoff-routing.mjs +2 -2
  444. package/template/scripts/lib/strategic-handoff.mjs +15 -15
  445. package/template/scripts/lib/task-package-schema.mjs +2 -2
  446. package/template/scripts/lib/task-package.mjs +1 -1
  447. package/template/scripts/lib/technical-design-boundary.mjs +1 -1
  448. package/template/scripts/lib/user-decision.mjs +2 -1
  449. package/template/scripts/lifecycle-status +14 -0
  450. package/template/scripts/plan-spec-entry +21 -0
  451. package/template/scripts/strategic-consumer-entry +1 -1
  452. package/template/scripts/strategic-handoff +1 -1
  453. package/template/scripts/verify-frontend-implementation-evidence +1 -1
  454. package/template/scripts/verify-governance-layout +15 -0
  455. package/template/scripts/verify-lifecycle-checkpoint +1 -1
  456. package/template/scripts/verify-project-instance +13 -10
  457. package/template/scripts/verify-scaffold-architecture-decisions +1 -1
  458. package/template/scripts/verify-strategic-context-import +3 -3
  459. package/template/skills-lock.json +80 -95
  460. package/template.manifest.json +30 -15
  461. package/template.snapshot.json +5 -5
  462. package/template/.agents/skills/grill-me/SKILL.md +0 -7
  463. package/template/.agents/skills/grill-me/agents/openai.yaml +0 -5
  464. package/template/.agents/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  465. package/template/.agents/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  466. package/template/.agents/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  467. package/template/.codex/skills/grill-me/SKILL.md +0 -7
  468. package/template/.codex/skills/grill-me/agents/openai.yaml +0 -5
  469. package/template/.codex/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  470. package/template/.codex/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  471. package/template/.codex/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  472. package/template/.cursor/skills/grill-me/SKILL.md +0 -7
  473. package/template/.cursor/skills/grill-me/agents/openai.yaml +0 -5
  474. package/template/.cursor/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  475. package/template/.cursor/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  476. package/template/.cursor/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  477. package/template/.pi/skills/grill-me/SKILL.md +0 -7
  478. package/template/.pi/skills/grill-me/agents/openai.yaml +0 -5
  479. package/template/.pi/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
  480. package/template/.pi/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
  481. package/template/.pi/skills/yss-distributed-id/assets/LeafConf.java +0 -36
  482. package/template/docs/agents/archify-integration.md +0 -19
  483. package/template/docs/agents/yss-plugin-dependency-contract.md +0 -45
  484. package/template/docs/api/.gitkeep +0 -0
  485. package/template/docs/api/specs/.gitkeep +0 -0
  486. package/template/docs/architecture/.gitkeep +0 -0
  487. package/template/docs/design/design-system-sync.yaml +0 -13
  488. package/template/docs/design/facts/antdv-next/1.5.2/cli-help.txt +0 -38
  489. package/template/docs/design/facts/antdv-next/1.5.2/component-list.json +0 -434
  490. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/demo-basic.json +0 -7
  491. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/info.json +0 -246
  492. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/semantic.json +0 -40
  493. package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/token.json +0 -32
  494. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/demo-basic.json +0 -7
  495. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/info.json +0 -190
  496. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/semantic.json +0 -20
  497. package/template/docs/design/facts/antdv-next/1.5.2/components/Button/token.json +0 -256
  498. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/demo-basic.json +0 -7
  499. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/info.json +0 -460
  500. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/semantic.json +0 -70
  501. package/template/docs/design/facts/antdv-next/1.5.2/components/Input/token.json +0 -123
  502. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/demo-basic.json +0 -7
  503. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/info.json +0 -646
  504. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/semantic.json +0 -50
  505. package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/token.json +0 -130
  506. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/demo-basic.json +0 -7
  507. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/info.json +0 -640
  508. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/semantic.json +0 -70
  509. package/template/docs/design/facts/antdv-next/1.5.2/components/Select/token.json +0 -172
  510. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/demo-basic.json +0 -7
  511. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/info.json +0 -1010
  512. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/semantic.json +0 -70
  513. package/template/docs/design/facts/antdv-next/1.5.2/components/Table/token.json +0 -263
  514. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/demo-basic.json +0 -7
  515. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/info.json +0 -321
  516. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/semantic.json +0 -25
  517. package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/token.json +0 -25
  518. package/template/docs/design/facts/antdv-next/1.5.2/design-md.json +0 -3
  519. package/template/docs/design/facts/antdv-next/1.5.2/manifest.json +0 -215
  520. package/template/docs/design/facts/antdv-next/1.5.2/resolution-probe.json +0 -5
  521. package/template/docs/design/preview-dark.html +0 -178
  522. package/template/docs/design/preview.css +0 -730
  523. package/template/docs/design/preview.html +0 -178
  524. package/template/docs/design/preview.js +0 -71
  525. package/template/docs/design/prototypes/.gitkeep +0 -1
  526. package/template/docs/design/tokens/.design-md-projection.json +0 -13
  527. package/template/docs/implementation/.gitkeep +0 -1
  528. package/template/docs/plan/IDEATION.md +0 -96
  529. package/template/docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md +0 -13
  530. package/template/docs/process/PDCA-SCRUM.md +0 -10
  531. package/template/docs/process/github-workflows.md +0 -52
  532. package/template/docs/process/harness-executive-blueprint.md +0 -10
  533. package/template/docs/releases/.gitkeep +0 -1
  534. package/template/docs/requirements/README.md +0 -85
  535. package/template/docs/requirements/tickets/.gitkeep +0 -1
  536. package/template/docs/templates/agent-brief-template.md +0 -46
  537. package/template/docs/templates/architecture-proposal-template.md +0 -18
  538. package/template/docs/templates/implementation-plan-template.md +0 -16
  539. package/template/docs/templates/implementation-routing-template.md +0 -350
  540. package/template/docs/templates/release-note-template.md +0 -14
  541. package/template/docs/templates/requirement-freeze-template.md +0 -63
  542. package/template/docs/templates/retro-report-template.md +0 -16
  543. package/template/docs/templates/risk-register-template.md +0 -11
  544. package/template/docs/templates/user-story-template.md +0 -20
  545. package/template/docs/templates/verification-record-template.md +0 -53
  546. package/template/docs/testing/README.md +0 -110
  547. /package/template/{docs → .template-spec}/agents/domain.md +0 -0
  548. /package/template/{docs → .template-spec}/api/templates/openapi-draft-review-checklist.md +0 -0
  549. /package/template/{docs → .template-spec}/api/templates/openapi-draft-validation-record-template.yaml +0 -0
  550. /package/template/{docs → .template-spec}/api/templates/openapi-freeze-record-template.md +0 -0
  551. /package/template/{docs → .template-spec}/api/templates/openapi-json-export-record-template.md +0 -0
  552. /package/template/{docs → .template-spec}/architecture/templates/architecture-deepening-template.md +0 -0
  553. /package/template/{docs → .template-spec}/architecture/templates/architecture-review-checklist.md +0 -0
  554. /package/template/{docs → .template-spec}/architecture/templates/business-architecture-template.md +0 -0
  555. /package/template/{docs → .template-spec}/architecture/templates/data-architecture-template.md +0 -0
  556. /package/template/{docs → .template-spec}/architecture/templates/engineering-baseline-review-template.md +0 -0
  557. /package/template/{docs → .template-spec}/architecture/templates/functional-architecture-template.md +0 -0
  558. /package/template/{docs → .template-spec}/architecture/templates/system-overview-design-template.md +0 -0
  559. /package/template/{docs → .template-spec}/design/diagrams/README.md +0 -0
  560. /package/template/{docs → .template-spec}/design/schemas/visual-baseline.schema.json +0 -0
  561. /package/template/{docs → .template-spec}/design/templates/prototype-confirmation-template.md +0 -0
  562. /package/template/{docs → .template-spec}/design/templates/visual-baseline-template.yaml +0 -0
  563. /package/template/{docs → .template-spec}/design/tokens/theme.json +0 -0
  564. /package/template/{docs → .template-spec}/design/tokens/tokens.compact.json +0 -0
  565. /package/template/{docs → .template-spec}/design/tokens/tokens.dark.json +0 -0
  566. /package/template/{docs → .template-spec}/design/tokens/tokens.default.json +0 -0
  567. /package/template/{docs → .template-spec}/design/tokens/variables.css +0 -0
  568. /package/template/{docs → .template-spec}/design/tokens/variables.dark.css +0 -0
  569. /package/template/{docs → .template-spec}/engineering/backend-platforms.json +0 -0
  570. /package/template/{docs → .template-spec}/plan/README.md +0 -0
  571. /package/template/{docs → .template-spec}/plan/templates/competitive-analysis-template.md +0 -0
  572. /package/template/{docs → .template-spec}/plan/templates/competitive-matrix-template.md +0 -0
  573. /package/template/{docs → .template-spec}/plan/templates/market-analysis-template.md +0 -0
  574. /package/template/{docs → .template-spec}/plan/templates/user-pain-points-template.md +0 -0
  575. /package/template/{docs → .template-spec}/process/delivery-preflight.md +0 -0
  576. /package/template/{docs → .template-spec}/process/document-writing.md +0 -0
  577. /package/template/{docs → .template-spec}/process/existing-backend-architecture.md +0 -0
  578. /package/template/{docs → .template-spec}/process/existing-ui-baseline.md +0 -0
  579. /package/template/{docs → .template-spec}/process/frontend-backend-delivery.md +0 -0
  580. /package/template/{docs → .template-spec}/process/harness-process-tailoring.md +0 -0
  581. /package/template/{docs → .template-spec}/process/implementation-repo-integration.md +0 -0
  582. /package/template/{docs/process/lifecycle-registry-baseline.json → .template-spec/process/lifecycle-registry-baseline-v1.json} +0 -0
  583. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision-v2.schema.json +0 -0
  584. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision.schema.json +0 -0
  585. /package/template/{docs → .template-spec}/process/schemas/backend-architecture-identity.schema.json +0 -0
  586. /package/template/{docs → .template-spec}/process/schemas/backend-delivery-verification.schema.json +0 -0
  587. /package/template/{docs → .template-spec}/process/schemas/backend-delivery.schema.json +0 -0
  588. /package/template/{docs → .template-spec}/process/schemas/context-reconciliation.schema.json +0 -0
  589. /package/template/{docs → .template-spec}/process/schemas/data-architecture-decision.schema.json +0 -0
  590. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-input.schema.json +0 -0
  591. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-result.schema.json +0 -0
  592. /package/template/{docs → .template-spec}/process/schemas/existing-ui-baseline.schema.json +0 -0
  593. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v1.schema.json +0 -0
  594. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v3.schema.json +0 -0
  595. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance.schema.json +0 -0
  596. /package/template/{docs → .template-spec}/process/schemas/frontend-implementation-evidence.schema.json +0 -0
  597. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight-v2.schema.json +0 -0
  598. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight.schema.json +0 -0
  599. /package/template/{docs → .template-spec}/process/schemas/implementation-repository-preparation-result.schema.json +0 -0
  600. /package/template/{docs → .template-spec}/process/schemas/openapi-draft-validation-record.schema.json +0 -0
  601. /package/template/{docs → .template-spec}/process/schemas/project-scaffold-contract.schema.json +0 -0
  602. /package/template/{docs → .template-spec}/process/schemas/review-bundle.schema.json +0 -0
  603. /package/template/{docs → .template-spec}/process/schemas/scaffold-architecture-decisions.schema.json +0 -0
  604. /package/template/{docs → .template-spec}/process/schemas/slice-implementation-contract-v3.schema.json +0 -0
  605. /package/template/{docs → .template-spec}/process/schemas/stage-tracking.schema.json +0 -0
  606. /package/template/{docs → .template-spec}/process/schemas/strategic-consumer-feedback.schema.json +0 -0
  607. /package/template/{docs → .template-spec}/process/schemas/strategic-feedback-adjudication.schema.json +0 -0
  608. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery-verification.schema.json +0 -0
  609. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery.schema.json +0 -0
  610. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +0 -0
  611. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy.schema.json +0 -0
  612. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export-v2.schema.json +0 -0
  613. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export.schema.json +0 -0
  614. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt-v3.schema.json +0 -0
  615. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt.schema.json +0 -0
  616. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-package.schema.json +0 -0
  617. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +0 -0
  618. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package.schema.json +0 -0
  619. /package/template/{docs → .template-spec}/process/schemas/subagent-task-package.schema.json +0 -0
  620. /package/template/{docs → .template-spec}/process/schemas/user-decision.schema.json +0 -0
  621. /package/template/{docs → .template-spec}/process/strategic-handoff-package.md +0 -0
  622. /package/template/{docs → .template-spec}/process/templates/context-reconciliation-template.yaml +0 -0
  623. /package/template/{docs → .template-spec}/process/templates/frontend-implementation-plan-template.yaml +0 -0
  624. /package/template/{docs → .template-spec}/process/templates/frontend-implementation-verification-template.yaml +0 -0
  625. /package/template/{docs → .template-spec}/process/templates/lifecycle-checkpoint-template.yaml +0 -0
  626. /package/template/{docs → .template-spec}/process/templates/scaffold-architecture-decisions-template.yaml +0 -0
  627. /package/template/{docs → .template-spec}/process/templates/stage-checkpoint-template.md +0 -0
  628. /package/template/{docs → .template-spec}/process/templates/user-decision-template.yaml +0 -0
  629. /package/template/{docs → .template-spec}/templates/adr-template.md +0 -0
  630. /package/template/{docs → .template-spec}/templates/approval-record-template.yaml +0 -0
  631. /package/template/{docs → .template-spec}/templates/cross-repo-slice-template.md +0 -0
  632. /package/template/{docs → .template-spec}/templates/examples/lifecycle-writing-examples.md +0 -0
  633. /package/template/{docs → .template-spec}/templates/implementation-repo-registry-template.md +0 -0
  634. /package/template/{docs → .template-spec}/templates/openapi-spec-template.yaml +0 -0
  635. /package/template/{docs → .template-spec}/templates/review-bundle-template.yaml +0 -0
  636. /package/template/{docs → .template-spec}/templates/review-report-template.md +0 -0
  637. /package/template/{docs → .template-spec}/templates/spec-delta-template.md +0 -0
  638. /package/template/{docs → .template-spec}/templates/spec-template.md +0 -0
  639. /package/template/{docs → .template-spec}/user-guide/yss-ui-mcp.md +0 -0
  640. /package/template/{docs → .template-spec}/user-guide//346/212/200/346/234/257/350/256/276/350/256/241/347/224/250/346/210/267/346/214/207/345/215/227.md" +0 -0
  641. /package/template/{docs → .template-spec}/user-guide//350/256/276/345/244/207/345/200/237/347/224/250/350/264/257/347/251/277/346/241/210/344/276/213.md" +0 -0
  642. /package/template/{docs → .template-spec}/user-guide//351/230/266/346/256/265/346/216/245/345/205/245/344/270/216/344/272/247/347/211/251/345/244/215/347/224/250/344/275/277/347/224/250/346/211/213/345/206/214.md" +0 -0
@@ -0,0 +1,253 @@
1
+ "use strict";
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+ const { runInTransaction } = require("../filesystem/transaction-runner");
6
+ const { applyManagedOperation } = require("../filesystem/apply-plan");
7
+ const { pathKind, targetPath } = require("../filesystem/path-utils");
8
+ const { assertTargetFamily } = require("../family-runtime");
9
+ const { assertTargetWorkingTreeWritable } = require("../validation/security");
10
+ const { readTemplateSnapshot, loadTemplateMetadata, writeTemplateMetadata, buildDesiredManagedOperations, BUNDLED_TEMPLATE_ROOT, fileHash } = require("../template/instance-runtime");
11
+ const { RUNTIMES, assertRuntime, readDistributionRegistry, requiredSkills, renderInstanceDesignSkillFile } = require("../template/distribution-runtime");
12
+ const { ASSET_PROFILE, STAGES } = require("../template/asset-runtime");
13
+ const { refreshGeneratedProjectInstance, verifyGeneratedProjectInstance } = require("../template/verification-runtime");
14
+
15
+ function parseSkillArgs(argv) {
16
+ const options = { names: [], triggers: [], targetDir: "." };
17
+ for (let index = 0; index < argv.length; index++) {
18
+ const arg = argv[index];
19
+ if (arg === "--plan") options.plan = true;
20
+ else if (arg === "--apply") options.apply = true;
21
+ else if (arg === "--target-dir" || arg === "--when") {
22
+ const value = argv[++index];
23
+ if (!value || value.startsWith("--")) throw new Error(`${arg} 需要一个值`);
24
+ if (arg === "--target-dir") options.targetDir = value;
25
+ else options.triggers.push(value);
26
+ } else if (arg.startsWith("--")) throw new Error(`不支持的参数:${arg}`);
27
+ else options.names.push(arg);
28
+ }
29
+ if (options.plan && options.apply) throw new Error("--plan 与 --apply 互斥");
30
+ if (!options.plan && !options.apply) throw new Error("skills 命令必须显式选择 --plan 或 --apply");
31
+ return options;
32
+ }
33
+
34
+ function listFiles(directory, prefix = "") {
35
+ const files = [];
36
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
37
+ const relative = prefix ? `${prefix}/${entry.name}` : entry.name;
38
+ if (entry.isDirectory()) files.push(...listFiles(path.join(directory, entry.name), relative));
39
+ else if (entry.isFile()) files.push(relative);
40
+ }
41
+ return files;
42
+ }
43
+
44
+ function addManagedTree(metadata, targetDir, relativeDir) {
45
+ for (const file of listFiles(targetPath(targetDir, relativeDir))) {
46
+ const relative = `${relativeDir}/${file}`;
47
+ metadata.managedFiles[relative] = { type: "copy", contentHash: fileHash(targetPath(targetDir, relative)) };
48
+ }
49
+ }
50
+
51
+ function context(targetDir) {
52
+ assertTargetFamily(targetDir);
53
+ const { metadata } = loadTemplateMetadata(targetDir);
54
+ if (metadata.metadataSchemaVersion !== 3 || metadata.distribution?.mode !== "selected") {
55
+ throw new Error("按需 Skill 命令仅适用于 v3 精简实例;v2 实例继续 legacy-all 分发");
56
+ }
57
+ const snapshot = readTemplateSnapshot();
58
+ if (metadata.templateCommit !== snapshot.templateCommit || metadata.snapshotHash !== snapshot.snapshotHash) {
59
+ throw new Error("CLI 快照与实例模板提交不一致,请先运行 create-yss-spec sync");
60
+ }
61
+ const lockPath = targetPath(targetDir, "skills-lock.json");
62
+ const lock = JSON.parse(fs.readFileSync(lockPath, "utf8"));
63
+ if (JSON.stringify(lock.projectionRoots) !== JSON.stringify(metadata.distribution.runtimes.map((name) => RUNTIMES[name]))) {
64
+ throw new Error("实例 Skill 锁与元数据的平台选择不一致");
65
+ }
66
+ return { metadata, lock, lockPath };
67
+ }
68
+
69
+ function runAssetSelection({ targetDir, requestedSkills = [], triggers = [], stage = null, plan = false }) {
70
+ const { metadata, lock, lockPath } = context(targetDir);
71
+ const distribution = metadata.distribution;
72
+ if (distribution.assetProfile !== ASSET_PROFILE) {
73
+ throw new Error("阶段资产命令仅适用于新建的按阶段分发实例;旧实例保持原分发范围");
74
+ }
75
+ if (stage && !Object.hasOwn(STAGES, stage)) throw new Error(`未知生命周期阶段:${stage}`);
76
+ const stageSkills = stage ? STAGES[stage].skills : [];
77
+ const registry = readDistributionRegistry(BUNDLED_TEMPLATE_ROOT);
78
+ const requested = [...new Set([...requestedSkills, ...stageSkills])];
79
+ const addStage = stage && !distribution.installedStages.includes(stage) ? stage : null;
80
+ const variables = { ...metadata.variables };
81
+ const before = buildDesiredManagedOperations(targetDir, { ...variables, distribution }, "init");
82
+ for (const operation of before) {
83
+ if (metadata.managedFiles[operation.relativePath] && pathKind(operation.targetPath) === "missing") {
84
+ throw new Error(`实例受管资产缺失,请先运行 create-yss-spec sync:${operation.relativePath}`);
85
+ }
86
+ }
87
+ let names, missingSkills, nextDistribution, after;
88
+ for (let attempt = 0; attempt <= 50; attempt++) {
89
+ names = requiredSkills(registry.text, requested, triggers, BUNDLED_TEMPLATE_ROOT);
90
+ missingSkills = names.filter((name) => !distribution.installedSkills.includes(name));
91
+ nextDistribution = {
92
+ ...distribution,
93
+ installedSkills: [...distribution.installedSkills, ...missingSkills].sort(),
94
+ installedStages: addStage ? [...distribution.installedStages, addStage] : [...distribution.installedStages],
95
+ resourceSkills: [...new Set([...distribution.resourceSkills, ...missingSkills])].sort(),
96
+ };
97
+ try {
98
+ after = buildDesiredManagedOperations(targetDir, { ...variables, distribution: nextDistribution }, "init");
99
+ break;
100
+ } catch (error) {
101
+ if (!error.requiredSkill || requested.includes(error.requiredSkill) || attempt === 50) throw error;
102
+ requested.push(error.requiredSkill);
103
+ }
104
+ }
105
+ const beforePaths = new Set(before.map((operation) => operation.relativePath));
106
+ const newOperations = after.filter((operation) => !beforePaths.has(operation.relativePath) && operation.relativePath !== "skills-lock.json");
107
+ const paths = newOperations.map((operation) => operation.relativePath);
108
+ for (const relative of paths) {
109
+ if (pathKind(targetPath(targetDir, relative)) !== "missing") throw new Error(`目标阶段资产路径已存在,拒绝覆盖:${relative}`);
110
+ }
111
+ if (plan) {
112
+ console.log(JSON.stringify({ operation: stage ? "assets ensure" : "skills ensure", targetDir, requested: stage || requestedSkills,
113
+ dependencies: names, addSkills: missingSkills, addStage, paths }, null, 2));
114
+ return;
115
+ }
116
+ if (!addStage && !missingSkills.length && !paths.length) {
117
+ verifyGeneratedProjectInstance(targetDir);
118
+ console.log("阶段资产已满足,无需写入");
119
+ return;
120
+ }
121
+ assertTargetWorkingTreeWritable(targetDir, { packageRoot: path.resolve(__dirname, "../..") });
122
+ const sourceLock = JSON.parse(fs.readFileSync(path.join(BUNDLED_TEMPLATE_ROOT, "skills-lock.json"), "utf8"));
123
+ runInTransaction({
124
+ targetDir, operation: stage ? "assets" : "skills", affectedPaths: [...paths, "skills-lock.json", ".yss-template.json"],
125
+ execute(transaction) {
126
+ const nextMetadata = structuredClone(metadata);
127
+ const nextLock = structuredClone(lock);
128
+ for (const operation of newOperations) {
129
+ applyManagedOperation(operation, transaction);
130
+ nextMetadata.managedFiles[operation.relativePath] = { type: operation.type, contentHash: fileHash(operation.targetPath) };
131
+ }
132
+ for (const name of missingSkills) {
133
+ if (!sourceLock.skills.shared[name]) throw new Error(`CLI 快照缺少 Skill 锁记录:${name}`);
134
+ nextLock.skills.shared[name] = { ...sourceLock.skills.shared[name], targets: [".agents/skills", ...nextLock.projectionRoots] };
135
+ }
136
+ nextMetadata.distribution = nextDistribution;
137
+ transaction.writeFile(lockPath, `${JSON.stringify(nextLock, null, 2)}\n`);
138
+ refreshGeneratedProjectInstance(targetDir);
139
+ nextMetadata.managedFiles["skills-lock.json"] = { type: "render", contentHash: fileHash(lockPath) };
140
+ verifyGeneratedProjectInstance(targetDir);
141
+ writeTemplateMetadata(targetDir, nextMetadata, transaction);
142
+ },
143
+ });
144
+ console.log(stage ? `已安装阶段资产 ${stage}` : `已补装 ${missingSkills.join(", ")}`);
145
+ }
146
+
147
+ function runAssets(argv = []) {
148
+ const [command, stage, ...rest] = argv;
149
+ if (command !== "ensure" || !stage || stage.startsWith("--")) throw new Error("用法:assets ensure <stage-id> --plan|--apply");
150
+ const options = parseSkillArgs(rest);
151
+ if (options.names.length || options.triggers.length) throw new Error("assets ensure 只接受一个阶段 ID");
152
+ runAssetSelection({ targetDir: path.resolve(options.targetDir), stage, plan: Boolean(options.plan) });
153
+ }
154
+
155
+ function runSkills(argv = []) {
156
+ const [command, maybeAction, ...rest] = argv;
157
+ const runtimeAdd = command === "runtime" && maybeAction === "add";
158
+ if (command !== "ensure" && !runtimeAdd) throw new Error("用法:skills ensure <skill-id...> --plan|--apply,或 skills runtime add <runtime> --plan|--apply");
159
+ const options = parseSkillArgs(runtimeAdd ? rest : [maybeAction, ...rest].filter((value) => value !== undefined));
160
+ if (!options.names.length) throw new Error(runtimeAdd ? "runtime add 需要平台名" : "ensure 需要至少一个 Skill ID");
161
+ if (runtimeAdd && options.names.length !== 1) throw new Error("runtime add 一次只接受一个平台");
162
+ const targetDir = path.resolve(options.targetDir);
163
+ const { metadata, lock, lockPath } = context(targetDir);
164
+ const distribution = metadata.distribution;
165
+ if (!runtimeAdd && distribution.assetProfile === ASSET_PROFILE) {
166
+ runAssetSelection({ targetDir, requestedSkills: options.names, triggers: options.triggers, plan: Boolean(options.plan) });
167
+ return;
168
+ }
169
+ const registry = readDistributionRegistry(BUNDLED_TEMPLATE_ROOT);
170
+ const names = runtimeAdd ? [] : requiredSkills(registry.text, options.names, options.triggers, BUNDLED_TEMPLATE_ROOT);
171
+ const runtime = runtimeAdd ? assertRuntime(options.names[0]) : null;
172
+ const missing = names.filter((name) => !distribution.installedSkills.includes(name));
173
+ const addedRuntime = runtime && !distribution.runtimes.includes(runtime) ? runtime : null;
174
+ const roots = distribution.runtimes.map((name) => RUNTIMES[name]);
175
+ const runtimeFiles = addedRuntime ? buildDesiredManagedOperations(targetDir, {
176
+ ...metadata.variables,
177
+ distribution: { mode: "selected", runtimes: [...distribution.runtimes, addedRuntime], installedSkills: distribution.installedSkills },
178
+ }, "init").filter((operation) => {
179
+ const runtimeRoot = RUNTIMES[addedRuntime].split("/")[0];
180
+ return (operation.relativePath.startsWith(`${runtimeRoot}/`) || (addedRuntime === "cursor" && operation.relativePath === ".cursorrules")) &&
181
+ !distribution.installedSkills.some((name) => operation.relativePath.startsWith(`${RUNTIMES[addedRuntime]}/${name}/`));
182
+ }) : [];
183
+ const paths = ["skills-lock.json", ".yss-template.json"];
184
+ for (const name of missing) {
185
+ paths.push(`.agents/skills/${name}`, ...roots.map((root) => `${root}/${name}`));
186
+ }
187
+ if (addedRuntime) paths.push(...Object.keys(lock.skills.shared).map((name) => `${RUNTIMES[addedRuntime]}/${name}`), ...runtimeFiles.map((operation) => operation.relativePath));
188
+ for (const relative of paths.slice(2)) {
189
+ if (pathKind(targetPath(targetDir, relative)) !== "missing") throw new Error(`目标 Skill 路径已存在,拒绝覆盖:${relative}`);
190
+ }
191
+ if (options.plan) {
192
+ console.log(JSON.stringify({ operation: runtimeAdd ? "runtime add" : "ensure", targetDir, requested: options.names, dependencies: names, addSkills: missing, addRuntime: addedRuntime, paths }, null, 2));
193
+ return;
194
+ }
195
+ if (!missing.length && !addedRuntime) {
196
+ verifyGeneratedProjectInstance(targetDir);
197
+ console.log("Skill 分发已满足,无需写入");
198
+ return;
199
+ }
200
+ assertTargetWorkingTreeWritable(targetDir, { packageRoot: path.resolve(__dirname, "../..") });
201
+ const sourceLock = JSON.parse(fs.readFileSync(path.join(BUNDLED_TEMPLATE_ROOT, "skills-lock.json"), "utf8"));
202
+ runInTransaction({
203
+ targetDir, operation: "skills", affectedPaths: paths,
204
+ execute(transaction) {
205
+ const nextMetadata = structuredClone(metadata);
206
+ const nextLock = structuredClone(lock);
207
+ if (addedRuntime) {
208
+ nextMetadata.distribution.runtimes.push(addedRuntime);
209
+ nextLock.projectionRoots.push(RUNTIMES[addedRuntime]);
210
+ }
211
+ for (const name of missing) {
212
+ const source = path.join(BUNDLED_TEMPLATE_ROOT, ".agents/skills", name);
213
+ if (pathKind(source) !== "directory" || !sourceLock.skills.shared[name]) throw new Error(`CLI 快照缺少 Skill:${name}`);
214
+ transaction.copyFile(source, targetPath(targetDir, `.agents/skills/${name}`));
215
+ for (const root of roots) transaction.copyFile(source, targetPath(targetDir, `${root}/${name}`));
216
+ if (name === "yss-design-system") {
217
+ for (const root of [".agents/skills", ...roots]) {
218
+ for (const file of ["SKILL.md", "references/data-quality-theme.md"]) {
219
+ const target = targetPath(targetDir, `${root}/${name}/${file}`);
220
+ transaction.writeFile(target, renderInstanceDesignSkillFile(fs.readFileSync(target, "utf8")));
221
+ }
222
+ }
223
+ }
224
+ nextMetadata.distribution.installedSkills.push(name);
225
+ nextLock.skills.shared[name] = { ...sourceLock.skills.shared[name], targets: [".agents/skills", ...nextLock.projectionRoots] };
226
+ addManagedTree(nextMetadata, targetDir, `.agents/skills/${name}`);
227
+ for (const root of roots) addManagedTree(nextMetadata, targetDir, `${root}/${name}`);
228
+ }
229
+ if (addedRuntime) {
230
+ const root = RUNTIMES[addedRuntime];
231
+ for (const name of Object.keys(nextLock.skills.shared)) {
232
+ const source = targetPath(targetDir, `.agents/skills/${name}`);
233
+ transaction.copyFile(source, targetPath(targetDir, `${root}/${name}`));
234
+ if (nextMetadata.distribution.installedSkills.includes(name)) addManagedTree(nextMetadata, targetDir, `${root}/${name}`);
235
+ }
236
+ for (const operation of runtimeFiles) {
237
+ transaction.copyFile(operation.sourcePath, operation.targetPath);
238
+ nextMetadata.managedFiles[operation.relativePath] = { type: operation.type, contentHash: fileHash(operation.targetPath) };
239
+ }
240
+ }
241
+ for (const record of Object.values(nextLock.skills.shared)) record.targets = [".agents/skills", ...nextLock.projectionRoots];
242
+ nextMetadata.distribution.installedSkills.sort();
243
+ transaction.writeFile(lockPath, `${JSON.stringify(nextLock, null, 2)}\n`);
244
+ refreshGeneratedProjectInstance(targetDir);
245
+ nextMetadata.managedFiles["skills-lock.json"] = { type: "render", contentHash: fileHash(lockPath) };
246
+ verifyGeneratedProjectInstance(targetDir);
247
+ writeTemplateMetadata(targetDir, nextMetadata, transaction);
248
+ },
249
+ });
250
+ console.log(runtimeAdd ? `已增加平台 ${runtime}` : `已补装 ${missing.join(", ")}`);
251
+ }
252
+
253
+ module.exports = { runSkills, runAssets };
@@ -56,6 +56,9 @@ function printSyncDryRun(context) {
56
56
  syncPlan.updated,
57
57
  (operation) => `update: ${operation.relativePath}`,
58
58
  );
59
+ if ([...syncPlan.updated, ...syncPlan.added].some((operation) => operation.relativePath === "skills-lock.json")) {
60
+ console.log("提示:skills-lock.json 为生成文件;最终校验后内容一致时不会重新写入。");
61
+ }
59
62
  printLimitedOperations(
60
63
  syncPlan.added,
61
64
  (operation) => `add: ${operation.relativePath}`,
@@ -85,6 +88,7 @@ function runSync(argv = []) {
85
88
  const context = buildSyncContext({
86
89
  targetDir: options.targetDir || ".",
87
90
  force: Boolean(options.force),
91
+ migrateLayout: Boolean(options.migrateLayout),
88
92
  });
89
93
 
90
94
  if (options.json) {
@@ -36,7 +36,7 @@ const FAMILIES = [
36
36
  },
37
37
  ];
38
38
 
39
- const PROFILE_PATH = "docs/process/harness-profile.yaml";
39
+ const PROFILE_PATH = ".template-spec/process/harness-profile.yaml";
40
40
 
41
41
  function statOrMissing(file) {
42
42
  try {
@@ -283,7 +283,7 @@ function createFamilyGuard(_packageRoot, expectedName) {
283
283
  Object.hasOwn(value, "metadataSchemaVersion") &&
284
284
  (!Number.isInteger(value.metadataSchemaVersion) ||
285
285
  value.metadataSchemaVersion < 1 ||
286
- value.metadataSchemaVersion > (expectedName === "create-yss-spec" ? 2 : 1))
286
+ value.metadataSchemaVersion > (expectedName === "create-yss-spec" ? 3 : 1))
287
287
  ) {
288
288
  throw new Error("身份 metadata schema 版本非法或不支持");
289
289
  }
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+
6
+ const ASSET_PROFILE = "stage-selective";
7
+ const INITIAL_STAGES = ["stage.entry-triage", "stage.plan"];
8
+ const TEMPLATE_ONLY_IMPORTS = new Set(["scripts/lib/maintenance-intensity.mjs"]);
9
+ const RENDERED_SKILL_SCRIPTS = Object.freeze({ "yss-design-system": ["scripts/design-md"] });
10
+ const SKILL_ASSET_PREFIXES = Object.freeze({ "yss-design-system": [".template-spec/design/tokens/"] });
11
+
12
+ // Paths here are the entry points for each stage. Relative JavaScript imports
13
+ // are included by moduleClosure; files named by an explicitly installed Skill
14
+ // are included by skillReferences. The CLI snapshot retains every source file.
15
+ const COMMON = {
16
+ files: [
17
+ ".template-spec/agents/yss-skill-registry.yaml",
18
+ ".template-spec/agents/digital-human-roles.yaml",
19
+ ".template-spec/agents/digital-human-roles.md",
20
+ ".template-spec/agents/issue-tracker.md",
21
+ ".template-spec/agents/triage-labels.md",
22
+ ".template-spec/agents/domain.md",
23
+ ".template-spec/process/lifecycle-registry.yaml",
24
+ ".template-spec/process/lifecycle-registry-baseline.json",
25
+ ".template-spec/process/lifecycle-registry-baseline-v1.json",
26
+ ".template-spec/process/lifecycle-artifact-map.md",
27
+ ".template-spec/process/harness-process-tailoring.md",
28
+ ".template-spec/process/document-writing.md",
29
+ ".template-spec/process/contract-reading.md",
30
+ ".template-spec/process/stage-tracking.md",
31
+ ".template-spec/process/schemas/context-reconciliation.schema.json",
32
+ ".template-spec/process/schemas/digital-human-task-package.schema.json",
33
+ ".template-spec/process/schemas/lifecycle-checkpoint.schema.json",
34
+ ".template-spec/process/schemas/stage-tracking.schema.json",
35
+ ".template-spec/process/schemas/user-decision.schema.json",
36
+ ".template-spec/process/templates/context-reconciliation-template.yaml",
37
+ ".template-spec/process/templates/lifecycle-checkpoint-template.yaml",
38
+ ".template-spec/process/templates/stage-checkpoint-template.md",
39
+ ".template-spec/process/templates/user-decision-template.yaml",
40
+ ".template-spec/templates/local-parent-ticket-template.md",
41
+ ".template-spec/templates/approval-record-template.yaml",
42
+ ".template-spec/templates/review-report-template.md",
43
+ ".template-spec/user-guide/用户手册.md",
44
+ ],
45
+ scripts: [
46
+ "scripts/verify-project-instance",
47
+ "scripts/sync-skills",
48
+ "scripts/update-skill-lock",
49
+ "scripts/verify-context-contract",
50
+ "scripts/verify-context-reconciliation",
51
+ "scripts/verify-digital-human-roles",
52
+ "scripts/verify-digital-human-task-package",
53
+ "scripts/verify-lifecycle-checkpoint",
54
+ "scripts/verify-user-decision",
55
+ "scripts/verify-approval-record",
56
+ "scripts/query-lifecycle-context",
57
+ "scripts/contract",
58
+ "scripts/stage-tracking",
59
+ "scripts/gitworks",
60
+ ],
61
+ };
62
+
63
+ const STAGES = Object.freeze({
64
+ "stage.entry-triage": { files: [], scripts: [], skills: [] },
65
+ "stage.plan": {
66
+ prefixes: [".template-spec/plan/"],
67
+ files: [".template-spec/process/plan-migration.md"],
68
+ scripts: ["scripts/verify-plan-spec-entry"],
69
+ skills: [],
70
+ },
71
+ "stage.spec-architecture": {
72
+ files: [
73
+ ".template-spec/templates/spec-template.md",
74
+ ".template-spec/templates/spec-delta-template.md",
75
+ ".template-spec/architecture/templates/business-architecture-template.md",
76
+ ".template-spec/architecture/templates/functional-architecture-template.md",
77
+ ],
78
+ scripts: [],
79
+ skills: [],
80
+ },
81
+ "stage.product-design": {
82
+ prefixes: [".template-spec/design/"],
83
+ files: [],
84
+ scripts: ["scripts/design-md"],
85
+ skills: ["yss-prototype-stage"],
86
+ },
87
+ "stage.system-data-engineering": {
88
+ prefixes: [".template-spec/engineering/"],
89
+ files: [
90
+ ".template-spec/process/implementation-repo-integration.md",
91
+ ".template-spec/process/existing-backend-architecture.md",
92
+ ".template-spec/process/existing-ui-baseline.md",
93
+ ".template-spec/process/frontend-backend-delivery.md",
94
+ ".template-spec/templates/implementation-repo-registry-template.md",
95
+ ],
96
+ scripts: [
97
+ "scripts/backend-platforms",
98
+ "scripts/backend-delivery",
99
+ "scripts/repository-scope-policy",
100
+ "scripts/verify-scaffold-architecture-decisions",
101
+ ],
102
+ skills: ["yss-implementation-contract-compiler"],
103
+ },
104
+ "stage.ticket-formalization": {
105
+ files: [".template-spec/templates/vertical-slice-ticket-template.md", ".template-spec/templates/cross-repo-slice-template.md"],
106
+ scripts: ["scripts/dispatch-slice-task", "scripts/slice-contract"],
107
+ skills: [],
108
+ },
109
+ "stage.vertical-slice-implementation": {
110
+ files: [".template-spec/templates/verification-record-template.md"],
111
+ scripts: ["scripts/implementation-path-policy", "scripts/complete-backend-delivery"],
112
+ skills: [],
113
+ },
114
+ "stage.verification-release-retrospective": {
115
+ files: [
116
+ ".template-spec/process/delivery-preflight.md",
117
+ ".template-spec/templates/release-note-template.md",
118
+ ".template-spec/templates/retro-report-template.md",
119
+ ".template-spec/templates/review-bundle-template.yaml",
120
+ ],
121
+ scripts: ["scripts/preflight-delivery"],
122
+ skills: [],
123
+ },
124
+ });
125
+
126
+ function sourceFile(root, ref) {
127
+ const file = path.join(root, ref);
128
+ if (!fs.existsSync(file) || !fs.statSync(file).isFile()) throw new Error(`CLI 快照缺少阶段资产:${ref}`);
129
+ return file;
130
+ }
131
+
132
+ function addFile(root, result, ref) {
133
+ sourceFile(root, ref);
134
+ result.add(ref);
135
+ }
136
+
137
+ function addPrefix(root, result, prefix) {
138
+ const directory = path.join(root, prefix);
139
+ if (!fs.existsSync(directory) || !fs.statSync(directory).isDirectory()) throw new Error(`CLI 快照缺少阶段目录:${prefix}`);
140
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
141
+ const ref = `${prefix}${entry.name}`;
142
+ if (entry.isDirectory()) addPrefix(root, result, `${ref}/`);
143
+ else if (entry.isFile()) result.add(ref);
144
+ }
145
+ }
146
+
147
+ function moduleClosure(root, result, ref, selectedSkills) {
148
+ if (result.has(ref)) return;
149
+ const source = fs.readFileSync(sourceFile(root, ref), "utf8");
150
+ result.add(ref);
151
+ const expressions = [
152
+ /\b(?:import|export)\s+(?:[^'"\n]*?\s+from\s*)?['"]([^'"]+)['"]/g,
153
+ /\b(?:require|import)\s*\(\s*['"]([^'"]+)['"]\s*\)/g,
154
+ ];
155
+ for (const expression of expressions) {
156
+ for (const match of source.matchAll(expression)) {
157
+ if (!match[1].startsWith(".")) continue;
158
+ const resolved = path.posix.normalize(path.posix.join(path.posix.dirname(ref), match[1]));
159
+ const candidate = [resolved, `${resolved}.mjs`, `${resolved}.js`].find((name) => fs.existsSync(path.join(root, name)));
160
+ if (!candidate && TEMPLATE_ONLY_IMPORTS.has(resolved)) continue;
161
+ if (candidate?.startsWith(".agents/skills/")) {
162
+ const skill = candidate.split("/")[2];
163
+ if (!selectedSkills.has(skill)) {
164
+ const error = new Error(`阶段脚本依赖未安装 Skill:${ref} -> ${skill}`);
165
+ error.requiredSkill = skill;
166
+ throw error;
167
+ }
168
+ continue;
169
+ }
170
+ if (!candidate || !candidate.startsWith("scripts/")) throw new Error(`阶段脚本依赖未分发:${ref} -> ${match[1]}`);
171
+ moduleClosure(root, result, candidate, selectedSkills);
172
+ }
173
+ }
174
+ }
175
+
176
+ function skillReferences(root, result, skillId, selectedSkills) {
177
+ const skillRoot = path.join(root, ".agents/skills", skillId);
178
+ if (!fs.existsSync(skillRoot)) throw new Error(`CLI 快照缺少 Skill:${skillId}`);
179
+ function visit(directory) {
180
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
181
+ const file = path.join(directory, entry.name);
182
+ if (entry.isDirectory()) visit(file);
183
+ else if (entry.isFile() && /\.(?:md|yaml|json)$/.test(entry.name)) {
184
+ const source = fs.readFileSync(file, "utf8");
185
+ for (const match of source.matchAll(/(?:\.template-spec|scripts)\/[\p{L}\p{N}_.\/-]+/gu)) {
186
+ const ref = match[0].replace(/[.,;]+$/, "");
187
+ if (!fs.existsSync(path.join(root, ref)) || !fs.statSync(path.join(root, ref)).isFile()) continue;
188
+ if (ref.startsWith("scripts/")) moduleClosure(root, result, ref, selectedSkills);
189
+ else addFile(root, result, ref);
190
+ }
191
+ }
192
+ }
193
+ }
194
+ visit(skillRoot);
195
+ for (const prefix of SKILL_ASSET_PREFIXES[skillId] || []) addPrefix(root, result, prefix);
196
+ for (const ref of RENDERED_SKILL_SCRIPTS[skillId] || []) moduleClosure(root, result, ref, selectedSkills);
197
+ }
198
+
199
+ function assetPaths(root, distribution) {
200
+ if (distribution.mode !== "selected" || distribution.assetProfile !== ASSET_PROFILE) return null;
201
+ const lifecycle = fs.readFileSync(sourceFile(root, ".template-spec/process/lifecycle-registry.yaml"), "utf8");
202
+ const stageIds = [...lifecycle.matchAll(/^ - id: (stage\.[a-z0-9-]+)\s*$/gm)].map((match) => match[1]).sort();
203
+ if (JSON.stringify(stageIds) !== JSON.stringify(Object.keys(STAGES).sort())) {
204
+ throw new Error("CLI 阶段资产映射与生命周期注册表阶段 ID 不一致");
205
+ }
206
+ const result = new Set();
207
+ const selectedSkills = new Set(distribution.installedSkills);
208
+ for (const ref of COMMON.files) {
209
+ if (ref === ".template-spec/process/lifecycle-registry-baseline-v1.json" &&
210
+ !fs.existsSync(path.join(root, ref))) {
211
+ const baseline = JSON.parse(fs.readFileSync(sourceFile(root, ".template-spec/process/lifecycle-registry-baseline.json"), "utf8"));
212
+ if (baseline.schema_version === 1) continue;
213
+ }
214
+ addFile(root, result, ref);
215
+ }
216
+ for (const ref of COMMON.scripts) moduleClosure(root, result, ref, selectedSkills);
217
+ for (const stage of distribution.installedStages) {
218
+ const bundle = STAGES[stage];
219
+ if (!bundle) throw new Error(`未知生命周期阶段:${stage}`);
220
+ for (const prefix of bundle.prefixes || []) addPrefix(root, result, prefix);
221
+ for (const ref of bundle.files || []) addFile(root, result, ref);
222
+ for (const ref of bundle.scripts || []) moduleClosure(root, result, ref, selectedSkills);
223
+ }
224
+ for (const skill of distribution.resourceSkills || []) skillReferences(root, result, skill, selectedSkills);
225
+ return result;
226
+ }
227
+
228
+ module.exports = { ASSET_PROFILE, INITIAL_STAGES, STAGES, assetPaths };
@@ -41,7 +41,7 @@ function classifyAttachOperations({
41
41
  continue;
42
42
  }
43
43
 
44
- if (operation.relativePath === "docs/agents/issue-tracker.md") {
44
+ if (operation.relativePath === ".template-spec/agents/issue-tracker.md") {
45
45
  matched.push({ ...operation, reason: "project-owned-tracker-configuration" });
46
46
  continue;
47
47
  }