create-yss-spec 3.2.0 → 3.3.1

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 (439) hide show
  1. package/README.md +2 -2
  2. package/package.json +3 -2
  3. package/src/command-runner.mjs +107 -0
  4. package/src/self-update.js +7 -4
  5. package/src/template/instance-runtime.js +1 -1
  6. package/template/.agents/skills/.strategic-design-skills-manifest.json +2 -2
  7. package/template/.agents/skills/code-review/SKILL.md +4 -0
  8. package/template/.agents/skills/code-review/agents/openai.yaml +1 -1
  9. package/template/.agents/skills/code-review/references/yss-review-standards.md +9 -2
  10. package/template/.agents/skills/competitive-intelligence/SKILL.md +4 -4
  11. package/template/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +1 -1
  12. package/template/.agents/skills/grill-with-docs/SKILL.md +1 -1
  13. package/template/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +1 -1
  14. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  15. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  16. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +8 -8
  17. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  18. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  19. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  20. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +121 -0
  21. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +40 -0
  22. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +55 -0
  23. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
  24. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
  25. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
  26. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  27. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  28. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  29. package/template/.agents/skills/yss-mybatis/SKILL.md +34 -58
  30. package/template/.agents/skills/yss-mybatis/agents/openai.yaml +2 -2
  31. package/template/.agents/skills/yss-mybatis/references/source-index.md +88 -68
  32. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +50 -42
  33. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  34. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  35. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +124 -16
  36. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +16 -2
  37. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +5 -2
  38. package/template/.agents/skills/yss-repository/SKILL.md +28 -70
  39. package/template/.agents/skills/yss-repository/agents/openai.yaml +2 -2
  40. package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  41. package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  42. package/template/.agents/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  43. package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  44. package/template/.agents/skills/yss-research/SKILL.md +1 -1
  45. package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  46. package/template/.agents/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  47. package/template/.agents/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  48. package/template/.agents/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  49. package/template/.agents/skills/yss-stage-decision/SKILL.md +5 -3
  50. package/template/.agents/skills/yss-stage-decision/references/stage-decision-package-contract.md +1 -1
  51. package/template/.claude/skills/code-review/SKILL.md +4 -0
  52. package/template/.claude/skills/code-review/agents/openai.yaml +1 -1
  53. package/template/.claude/skills/code-review/references/yss-review-standards.md +9 -2
  54. package/template/.claude/skills/competitive-intelligence/SKILL.md +4 -4
  55. package/template/.claude/skills/domain-modeling/CONTEXT-FORMAT.md +1 -1
  56. package/template/.claude/skills/grill-with-docs/SKILL.md +1 -1
  57. package/template/.claude/skills/setup-matt-pocock-skills/issue-tracker-local.md +1 -1
  58. package/template/.claude/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  59. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  60. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +8 -8
  61. package/template/.claude/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  62. package/template/.claude/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  63. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  64. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +121 -0
  65. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +40 -0
  66. package/template/.claude/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +55 -0
  67. package/template/.claude/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
  68. package/template/.claude/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
  69. package/template/.claude/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
  70. package/template/.claude/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  71. package/template/.claude/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  72. package/template/.claude/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  73. package/template/.claude/skills/yss-mybatis/SKILL.md +34 -58
  74. package/template/.claude/skills/yss-mybatis/agents/openai.yaml +2 -2
  75. package/template/.claude/skills/yss-mybatis/references/source-index.md +88 -68
  76. package/template/.claude/skills/yss-product-lifecycle/SKILL.md +50 -42
  77. package/template/.claude/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  78. package/template/.claude/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  79. package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +124 -16
  80. package/template/.claude/skills/yss-product-lifecycle/references/orchestration.md +16 -2
  81. package/template/.claude/skills/yss-product-lifecycle/references/state-model.md +5 -2
  82. package/template/.claude/skills/yss-repository/SKILL.md +28 -70
  83. package/template/.claude/skills/yss-repository/agents/openai.yaml +2 -2
  84. package/template/.claude/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  85. package/template/.claude/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  86. package/template/.claude/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  87. package/template/.claude/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  88. package/template/.claude/skills/yss-research/SKILL.md +1 -1
  89. package/template/.claude/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  90. package/template/.claude/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  91. package/template/.claude/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  92. package/template/.claude/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  93. package/template/.claude/skills/yss-stage-decision/SKILL.md +5 -3
  94. package/template/.claude/skills/yss-stage-decision/references/stage-decision-package-contract.md +1 -1
  95. package/template/.codex/skills/code-review/SKILL.md +4 -0
  96. package/template/.codex/skills/code-review/agents/openai.yaml +1 -1
  97. package/template/.codex/skills/code-review/references/yss-review-standards.md +9 -2
  98. package/template/.codex/skills/competitive-intelligence/SKILL.md +4 -4
  99. package/template/.codex/skills/domain-modeling/CONTEXT-FORMAT.md +1 -1
  100. package/template/.codex/skills/grill-with-docs/SKILL.md +1 -1
  101. package/template/.codex/skills/setup-matt-pocock-skills/issue-tracker-local.md +1 -1
  102. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  103. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  104. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +8 -8
  105. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  106. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  107. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  108. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +121 -0
  109. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +40 -0
  110. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +55 -0
  111. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
  112. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
  113. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
  114. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  115. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  116. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  117. package/template/.codex/skills/yss-mybatis/SKILL.md +34 -58
  118. package/template/.codex/skills/yss-mybatis/agents/openai.yaml +2 -2
  119. package/template/.codex/skills/yss-mybatis/references/source-index.md +88 -68
  120. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +50 -42
  121. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  122. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  123. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +124 -16
  124. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +16 -2
  125. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +5 -2
  126. package/template/.codex/skills/yss-repository/SKILL.md +28 -70
  127. package/template/.codex/skills/yss-repository/agents/openai.yaml +2 -2
  128. package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  129. package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  130. package/template/.codex/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  131. package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  132. package/template/.codex/skills/yss-research/SKILL.md +1 -1
  133. package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  134. package/template/.codex/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  135. package/template/.codex/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  136. package/template/.codex/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  137. package/template/.codex/skills/yss-stage-decision/SKILL.md +5 -3
  138. package/template/.codex/skills/yss-stage-decision/references/stage-decision-package-contract.md +1 -1
  139. package/template/.cursor/skills/code-review/SKILL.md +4 -0
  140. package/template/.cursor/skills/code-review/agents/openai.yaml +1 -1
  141. package/template/.cursor/skills/code-review/references/yss-review-standards.md +9 -2
  142. package/template/.cursor/skills/competitive-intelligence/SKILL.md +4 -4
  143. package/template/.cursor/skills/domain-modeling/CONTEXT-FORMAT.md +1 -1
  144. package/template/.cursor/skills/grill-with-docs/SKILL.md +1 -1
  145. package/template/.cursor/skills/setup-matt-pocock-skills/issue-tracker-local.md +1 -1
  146. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  147. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  148. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +8 -8
  149. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  150. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  151. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  152. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +121 -0
  153. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +40 -0
  154. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +55 -0
  155. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
  156. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
  157. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
  158. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  159. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  160. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  161. package/template/.cursor/skills/yss-mybatis/SKILL.md +34 -58
  162. package/template/.cursor/skills/yss-mybatis/agents/openai.yaml +2 -2
  163. package/template/.cursor/skills/yss-mybatis/references/source-index.md +88 -68
  164. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +50 -42
  165. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  166. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  167. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +124 -16
  168. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +16 -2
  169. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +5 -2
  170. package/template/.cursor/skills/yss-repository/SKILL.md +28 -70
  171. package/template/.cursor/skills/yss-repository/agents/openai.yaml +2 -2
  172. package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  173. package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  174. package/template/.cursor/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  175. package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  176. package/template/.cursor/skills/yss-research/SKILL.md +1 -1
  177. package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  178. package/template/.cursor/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  179. package/template/.cursor/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  180. package/template/.cursor/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  181. package/template/.cursor/skills/yss-stage-decision/SKILL.md +5 -3
  182. package/template/.cursor/skills/yss-stage-decision/references/stage-decision-package-contract.md +1 -1
  183. package/template/.pi/skills/code-review/SKILL.md +4 -0
  184. package/template/.pi/skills/code-review/agents/openai.yaml +1 -1
  185. package/template/.pi/skills/code-review/references/yss-review-standards.md +9 -2
  186. package/template/.pi/skills/competitive-intelligence/SKILL.md +4 -4
  187. package/template/.pi/skills/domain-modeling/CONTEXT-FORMAT.md +1 -1
  188. package/template/.pi/skills/grill-with-docs/SKILL.md +1 -1
  189. package/template/.pi/skills/setup-matt-pocock-skills/issue-tracker-local.md +1 -1
  190. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  191. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  192. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +8 -8
  193. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  194. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  195. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  196. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +121 -0
  197. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +40 -0
  198. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +55 -0
  199. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
  200. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
  201. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
  202. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  203. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  204. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  205. package/template/.pi/skills/yss-mybatis/SKILL.md +34 -58
  206. package/template/.pi/skills/yss-mybatis/agents/openai.yaml +2 -2
  207. package/template/.pi/skills/yss-mybatis/references/source-index.md +88 -68
  208. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +50 -42
  209. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  210. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  211. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +124 -16
  212. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +16 -2
  213. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +5 -2
  214. package/template/.pi/skills/yss-repository/SKILL.md +28 -70
  215. package/template/.pi/skills/yss-repository/agents/openai.yaml +2 -2
  216. package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  217. package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  218. package/template/.pi/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  219. package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  220. package/template/.pi/skills/yss-research/SKILL.md +1 -1
  221. package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  222. package/template/.pi/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  223. package/template/.pi/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  224. package/template/.pi/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  225. package/template/.pi/skills/yss-stage-decision/SKILL.md +5 -3
  226. package/template/.pi/skills/yss-stage-decision/references/stage-decision-package-contract.md +1 -1
  227. package/template/.qoder/skills/code-review/SKILL.md +4 -0
  228. package/template/.qoder/skills/code-review/agents/openai.yaml +1 -1
  229. package/template/.qoder/skills/code-review/references/yss-review-standards.md +9 -2
  230. package/template/.qoder/skills/competitive-intelligence/SKILL.md +4 -4
  231. package/template/.qoder/skills/domain-modeling/CONTEXT-FORMAT.md +1 -1
  232. package/template/.qoder/skills/grill-with-docs/SKILL.md +1 -1
  233. package/template/.qoder/skills/setup-matt-pocock-skills/issue-tracker-local.md +1 -1
  234. package/template/.qoder/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  235. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  236. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +8 -8
  237. package/template/.qoder/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  238. package/template/.qoder/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  239. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  240. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +121 -0
  241. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +40 -0
  242. package/template/.qoder/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +55 -0
  243. package/template/.qoder/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
  244. package/template/.qoder/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
  245. package/template/.qoder/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
  246. package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  247. package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  248. package/template/.qoder/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  249. package/template/.qoder/skills/yss-mybatis/SKILL.md +34 -58
  250. package/template/.qoder/skills/yss-mybatis/agents/openai.yaml +2 -2
  251. package/template/.qoder/skills/yss-mybatis/references/source-index.md +88 -68
  252. package/template/.qoder/skills/yss-product-lifecycle/SKILL.md +50 -42
  253. package/template/.qoder/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  254. package/template/.qoder/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  255. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +124 -16
  256. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration.md +16 -2
  257. package/template/.qoder/skills/yss-product-lifecycle/references/state-model.md +5 -2
  258. package/template/.qoder/skills/yss-repository/SKILL.md +28 -70
  259. package/template/.qoder/skills/yss-repository/agents/openai.yaml +2 -2
  260. package/template/.qoder/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  261. package/template/.qoder/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  262. package/template/.qoder/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  263. package/template/.qoder/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  264. package/template/.qoder/skills/yss-research/SKILL.md +1 -1
  265. package/template/.qoder/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  266. package/template/.qoder/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  267. package/template/.qoder/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  268. package/template/.qoder/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  269. package/template/.qoder/skills/yss-stage-decision/SKILL.md +5 -3
  270. package/template/.qoder/skills/yss-stage-decision/references/stage-decision-package-contract.md +1 -1
  271. package/template/.trae/skills/code-review/SKILL.md +4 -0
  272. package/template/.trae/skills/code-review/agents/openai.yaml +1 -1
  273. package/template/.trae/skills/code-review/references/yss-review-standards.md +9 -2
  274. package/template/.trae/skills/competitive-intelligence/SKILL.md +4 -4
  275. package/template/.trae/skills/domain-modeling/CONTEXT-FORMAT.md +1 -1
  276. package/template/.trae/skills/grill-with-docs/SKILL.md +1 -1
  277. package/template/.trae/skills/setup-matt-pocock-skills/issue-tracker-local.md +1 -1
  278. package/template/.trae/skills/yss-ddd-scaffold-generator/SKILL.md +1 -1
  279. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +7 -3
  280. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/run_scaffold_verification.mjs +8 -8
  281. package/template/.trae/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +9 -0
  282. package/template/.trae/skills/yss-frontend-scaffold-generator/SKILL.md +10 -7
  283. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/generate_and_verify_scaffold.mjs +10 -0
  284. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +121 -0
  285. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/run_scaffold_verification.mjs +40 -0
  286. package/template/.trae/skills/yss-frontend-scaffold-generator/scripts/scaffold-generator.test.mjs +55 -0
  287. package/template/.trae/skills/yss-implementation-contract-compiler/SKILL.md +1 -1
  288. package/template/.trae/skills/yss-implementation-contract-compiler/references/boundaries.md +4 -0
  289. package/template/.trae/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +25 -0
  290. package/template/.trae/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  291. package/template/.trae/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +8 -5
  292. package/template/.trae/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +17 -2
  293. package/template/.trae/skills/yss-mybatis/SKILL.md +34 -58
  294. package/template/.trae/skills/yss-mybatis/agents/openai.yaml +2 -2
  295. package/template/.trae/skills/yss-mybatis/references/source-index.md +88 -68
  296. package/template/.trae/skills/yss-product-lifecycle/SKILL.md +50 -42
  297. package/template/.trae/skills/yss-product-lifecycle/references/artifact-dependencies.md +5 -3
  298. package/template/.trae/skills/yss-product-lifecycle/references/matt-yss-adapter.md +3 -3
  299. package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +124 -16
  300. package/template/.trae/skills/yss-product-lifecycle/references/orchestration.md +16 -2
  301. package/template/.trae/skills/yss-product-lifecycle/references/state-model.md +5 -2
  302. package/template/.trae/skills/yss-repository/SKILL.md +28 -70
  303. package/template/.trae/skills/yss-repository/agents/openai.yaml +2 -2
  304. package/template/.trae/skills/yss-repository/references/profiles/layered-mvc-service.md +19 -1
  305. package/template/.trae/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +19 -1
  306. package/template/.trae/skills/yss-repository/references/profiles/target-domain-model.md +21 -1
  307. package/template/.trae/skills/yss-repository/tests/profile-routing.test.mjs +59 -0
  308. package/template/.trae/skills/yss-research/SKILL.md +1 -1
  309. package/template/.trae/skills/yss-skill-source-index-refresh/SKILL.md +8 -5
  310. package/template/.trae/skills/yss-skill-source-index-refresh/references/source-location.md +2 -1
  311. package/template/.trae/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs +388 -18
  312. package/template/.trae/skills/yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.test.mjs +79 -1
  313. package/template/.trae/skills/yss-stage-decision/SKILL.md +5 -3
  314. package/template/.trae/skills/yss-stage-decision/references/stage-decision-package-contract.md +1 -1
  315. package/template/AGENTS.md +2 -2
  316. package/template/CONTEXT.md +3 -2
  317. package/template/README.md +3 -3
  318. package/template/docs/agents/digital-human-roles.md +1 -1
  319. package/template/docs/agents/digital-human-roles.yaml +13 -11
  320. package/template/docs/agents/issue-tracker.md +1 -1
  321. package/template/docs/agents/strategic-design-skills-integration.md +2 -0
  322. package/template/docs/agents/yss-skill-registry.yaml +5 -0
  323. package/template/docs/architecture/README.md +1 -1
  324. package/template/docs/architecture/templates/business-architecture-template.md +1 -1
  325. package/template/docs/architecture/templates/functional-architecture-template.md +1 -1
  326. package/template/docs/design/README.md +1 -1
  327. package/template/docs/design/templates/interaction-spec-template.md +1 -1
  328. package/template/docs/design/templates/product-overview-design-template.md +1 -1
  329. package/template/docs/{discovery → plan}/IDEATION.md +5 -5
  330. package/template/docs/plan/README.md +9 -0
  331. package/template/docs/plan/entry-review.md +23 -0
  332. package/template/docs/plan/templates/plan-template.md +58 -0
  333. package/template/docs/process/harness-process-tailoring.md +1 -1
  334. package/template/docs/process/lifecycle-artifact-map.md +10 -6
  335. package/template/docs/process/lifecycle-registry-baseline.json +10 -1
  336. package/template/docs/process/lifecycle-registry.yaml +48 -20
  337. package/template/docs/process/plan-migration.md +13 -0
  338. package/template/docs/process/schemas/digital-human-task-package.schema.json +2 -0
  339. package/template/docs/process/schemas/implementation-repository-preparation-result.schema.json +38 -0
  340. package/template/docs/process/schemas/lifecycle-checkpoint.schema.json +3 -0
  341. package/template/docs/process/schemas/lifecycle-registry.schema.json +1 -1
  342. package/template/docs/process/schemas/project-scaffold-contract.schema.json +113 -0
  343. package/template/docs/process/template-engineering-overview.md +2 -2
  344. package/template/docs/process/template-verification-profiles.yaml +25 -0
  345. package/template/docs/process/templates/context-reconciliation-template.yaml +2 -2
  346. package/template/docs/process/templates/lifecycle-checkpoint-template.yaml +1 -1
  347. package/template/docs/requirements/README.md +2 -2
  348. package/template/docs/templates/implementation-repo-registry-template.md +8 -0
  349. package/template/docs/templates/local-parent-ticket-template.md +1 -1
  350. package/template/docs/templates/review-report-template.md +7 -3
  351. package/template/docs/templates/subagent-task-package-template.md +1 -1
  352. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
  353. package/template/scripts/cache-template-commit +2 -2
  354. package/template/scripts/fixtures/strategic-handoff/source-roles.json +7 -7
  355. package/template/scripts/fixtures/user-decision/plan-fixture.mjs +30 -0
  356. package/template/scripts/lib/backend-delivery.mjs +5 -2
  357. package/template/scripts/lib/command-runner.mjs +107 -0
  358. package/template/scripts/lib/context-reconciliation.mjs +34 -0
  359. package/template/scripts/lib/json-schema.mjs +42 -13
  360. package/template/scripts/lib/lifecycle-context-query.mjs +141 -0
  361. package/template/scripts/lib/lifecycle-transition.mjs +118 -6
  362. package/template/scripts/lib/plan-spec-entry.mjs +87 -0
  363. package/template/scripts/lib/scenario-checks.mjs +44 -38
  364. package/template/scripts/lib/skill-registry.mjs +9 -0
  365. package/template/scripts/lib/skill-supply-chain.mjs +18 -2
  366. package/template/scripts/lib/strategic-handoff-io.mjs +5 -4
  367. package/template/scripts/lib/strategic-handoff.mjs +10 -9
  368. package/template/scripts/lib/task-package.mjs +2 -0
  369. package/template/scripts/lib/template-commit-cache.mjs +7 -5
  370. package/template/scripts/query-lifecycle-context +25 -0
  371. package/template/scripts/run-template-verification +9 -3
  372. package/template/scripts/sync-strategic-handoff-tools +9 -0
  373. package/template/scripts/verify-business-language-scenarios +0 -7
  374. package/template/scripts/verify-context-reconciliation +2 -48
  375. package/template/scripts/verify-context-reconciliation-scenarios +1 -1
  376. package/template/scripts/verify-frontend-scaffold-generator-scenarios +2 -0
  377. package/template/scripts/verify-lifecycle-checkpoint +2 -0
  378. package/template/scripts/verify-lifecycle-context-query-scenarios +88 -0
  379. package/template/scripts/verify-lifecycle-transition-scenarios +44 -4
  380. package/template/scripts/verify-plan-spec-entry +11 -0
  381. package/template/scripts/verify-plan-spec-entry-scenarios +79 -0
  382. package/template/scripts/verify-script-performance-scenarios +56 -0
  383. package/template/scripts/verify-subagent-task-package-scenarios +9 -8
  384. package/template/scripts/verify-template-cache-scenarios +11 -1
  385. package/template/scripts/verify-user-decision-scenarios +4 -4
  386. package/template/skills-lock.json +23 -23
  387. package/template.manifest.json +2 -1
  388. package/template.snapshot.json +5 -5
  389. package/template/.agents/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  390. package/template/.agents/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  391. package/template/.agents/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  392. package/template/.agents/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  393. package/template/.agents/skills/yss-mybatis/references/README.md +0 -57
  394. package/template/.agents/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  395. package/template/.claude/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  396. package/template/.claude/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  397. package/template/.claude/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  398. package/template/.claude/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  399. package/template/.claude/skills/yss-mybatis/references/README.md +0 -57
  400. package/template/.claude/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  401. package/template/.codex/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  402. package/template/.codex/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  403. package/template/.codex/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  404. package/template/.codex/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  405. package/template/.codex/skills/yss-mybatis/references/README.md +0 -57
  406. package/template/.codex/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  407. package/template/.cursor/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  408. package/template/.cursor/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  409. package/template/.cursor/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  410. package/template/.cursor/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  411. package/template/.cursor/skills/yss-mybatis/references/README.md +0 -57
  412. package/template/.cursor/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  413. package/template/.pi/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  414. package/template/.pi/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  415. package/template/.pi/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  416. package/template/.pi/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  417. package/template/.pi/skills/yss-mybatis/references/README.md +0 -57
  418. package/template/.pi/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  419. package/template/.qoder/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  420. package/template/.qoder/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  421. package/template/.qoder/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  422. package/template/.qoder/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  423. package/template/.qoder/skills/yss-mybatis/references/README.md +0 -57
  424. package/template/.qoder/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  425. package/template/.trae/skills/yss-mybatis/assets/BaseRepository.java +0 -112
  426. package/template/.trae/skills/yss-mybatis/assets/EntityQueryAspect.java +0 -37
  427. package/template/.trae/skills/yss-mybatis/assets/MybatisBaseConfiguration.java +0 -18
  428. package/template/.trae/skills/yss-mybatis/assets/PageQueryEntityConfigration.java +0 -18
  429. package/template/.trae/skills/yss-mybatis/references/README.md +0 -57
  430. package/template/.trae/skills/yss-repository/references/infrastructure-layer-guide.md +0 -107
  431. package/template/docs/discovery/README.md +0 -87
  432. package/template/docs/discovery/reports/.gitkeep +0 -0
  433. package/template/docs/discovery/reports/agent-governance-options.md +0 -71
  434. package/template/docs/discovery/reports/competitor-deep-dive/.gitkeep +0 -0
  435. package/template/docs/discovery/templates/discovery-template.md +0 -94
  436. /package/template/docs/{discovery → plan}/templates/competitive-analysis-template.md +0 -0
  437. /package/template/docs/{discovery → plan}/templates/competitive-matrix-template.md +0 -0
  438. /package/template/docs/{discovery → plan}/templates/market-analysis-template.md +0 -0
  439. /package/template/docs/{discovery → plan}/templates/user-pain-points-template.md +0 -0
@@ -1,24 +1,394 @@
1
1
  #!/usr/bin/env node
2
+ import { createHash } from "node:crypto";
2
3
  import { execFileSync } from "node:child_process";
3
- import { access, mkdir, readdir, writeFile } from "node:fs/promises";
4
+ import { access, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
4
5
  import os from "node:os";
5
6
  import path from "node:path";
6
7
  import { fileURLToPath } from "node:url";
7
8
 
8
- const BACKEND = {"yss-cache":["yss-microservice-components/yss-component-cache-parent"],"yss-mybatis":["yss-microservice-components/yss-component-persistence"],"yss-dto":["yss-microservice-components/yss-component-dto"],"yss-audit-log":["yss-microservice-components/yss-component-audit-log"],"yss-excel-mvc":["yss-microservice-components/yss-component-excel-mvc","yss-microservice-components/yss-component-excel-starter"],"yss-distributed-id":["yss-microservice-components/yss-component-distributed-id","yss-microservice-components/yss-component-leaf"],"yss-resilience4j":["yss-microservice-components/yss-component-resilience4j-starter"],"yss-validation":["yss-microservice-components/yss-component-validation-engine-parent","yss-microservice-components/yss-component-validation-jsr303"],"yss-security-algorithm":["yss-microservice-components/yss-component-security-algorithm"],"yss-userinfo":["yss-microservice-components/yss-component-userinfo-starter"],"yss-exception":["yss-microservice-components/yss-component-exception"]};
9
- const FRONTEND={"yss-ui":["components","hooks","skills"],"yss-components":["components"],"yss-hook":["hooks"],"yss-ui-business-page-generation":["components","hooks","skills"],"yss-use-table-height":["hooks"],"yss-use-tree-height":["hooks"]};
10
- const URLS={components:"http://192.168.164.27:3200/components",hooks:"http://192.168.164.27:3200/hooks",skills:"http://192.168.164.27:3200/skills"};
11
- const KEYS=["Audit","Cache","Clear","Command","Configuration","Controller","DTO","Data","Enable","Excel","Handler","Interceptor","Jdbc","Mapper","Mybatis","Page","Properties","Query","Repository","Request","Response","Result","Update","Aspect","Leaf","Id","Dir","Dic","Dictionary","File","Upload","Log","Message","Mail","Liquibase","Circuit","Breaker","Sql","Tpl","Tag","Task","Flow","Report","Validation","Validator","Security","Crypto","User","Variable","Quality","Search","Similarity","Scheduler","Runner","Duck","Dynamic","Factory","Client","Feign","Gateway","Convertor","Adapter","Advice","Bridge","Route","Uploader","Sftp","Minio","Parser","Express","Rule","Template","Generator","Importer","Engine","Event","Submitter","Executor","Context","Status","Type","State"];
12
- const DOCS=new Set(["README.md","readme.md","HELP.md","TECHNICAL_DESIGN.md"]);
13
- const exists=async p=>{try{await access(p);return true}catch{return false}};
14
- async function walk(root){if(!await exists(root))return[];const out=[];for(const item of await readdir(root,{withFileTypes:true})){const p=path.join(root,item.name);if(item.isDirectory())out.push(...await walk(p));else if(item.isFile())out.push(p)}return out}
15
- const relative=(root,p)=>{const value=path.relative(root,p);return value&&!value.startsWith("..")?value:p};
16
- function state(root){try{const run=args=>execFileSync("git",["-C",root,...args],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return[run(["rev-parse","HEAD"]),run(["status","--porcelain"])?"dirty":"clean"]}catch{return["unavailable","unknown"]}}
17
- async function sourceRoot(){if(process.env.YSS_SOURCE_ROOT){const root=path.resolve(process.env.YSS_SOURCE_ROOT);if(await exists(path.join(root,"yss-microservice-components")))return root;throw new Error(`YSS_SOURCE_ROOT must point to the repository root containing \`yss-microservice-components\`: ${root}`)}const home=os.homedir(),candidates=[process.cwd(),...ancestors(process.cwd()),path.join(home,"Documents/yss-project/yss-cloud-microservice"),path.join(home,"Documents/yss-project"),path.join(home,"Projects/yss-cloud-microservice"),path.join(home,"Projects")];for(const base of [path.join(home,"Projects"),path.join(home,"Documents"),path.join(home,"Documents/yss-project")])if(await exists(base))for(const entry of await readdir(base,{withFileTypes:true}))if(entry.isDirectory())candidates.push(path.join(base,entry.name));for(const root of candidates)if(await exists(path.join(root,"yss-microservice-components")))return path.resolve(root);throw new Error("Could not find a YSS source repository containing `yss-microservice-components`. Export YSS_SOURCE_ROOT=/absolute/path/to/yss-cloud-microservice and rerun.")}
18
- function ancestors(start){const out=[];let current=path.resolve(start);while(path.dirname(current)!==current){current=path.dirname(current);out.push(current)}return out}
19
- async function files(bases){const out={docs:[],poms:[],java:[]};for(const base of bases)for(const p of await walk(base)){if(DOCS.has(path.basename(p)))out.docs.push(p);else if(path.basename(p)==="pom.xml")out.poms.push(p);else if(p.endsWith(".java")&&p.includes(`${path.sep}src${path.sep}main${path.sep}java${path.sep}`))out.java.push(p)}for(const a of Object.values(out))a.sort();return out}
20
- export async function refresh({skillsRoot,source,now=new Date().toISOString(),frontend=true}){const [commit,worktree]=state(source);for(const [skill,parts]of Object.entries(BACKEND)){const bases=parts.map(item=>path.join(source,item));const found=await files(bases);const java=found.java.filter(p=>KEYS.some(key=>path.basename(p,".java").includes(key))).slice(0,120);const list=(items,map,empty)=>items.length?items.map(map):[empty];const baseHints=await Promise.all(bases.map(async p=>`- \`${relative(source,p)}\` (${await exists(p)?"existed":"missing"} when indexed)`));const lines=[`# ${skill} Source Index`,``,`Generated: ${now}`,`Source commit: \`${commit}\``,`Source worktree: \`${worktree}\``,`Indexed source root: resolved at refresh time; set \`YSS_SOURCE_ROOT\` to reproduce or refresh.`,``,`This file is generated by \`yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs\`. Do not hand-edit generated sections.`,``,`Paths below are source path hints captured at refresh time. If they do not exist in the current workspace, locate sources using \`YSS_SOURCE_ROOT\`, CodeGraph, package/class names, Maven artifact names, or repository search before assuming the source is unavailable.`,``,`## Component Path Hints`,``,...baseHints,``,`## Documentation Files`,``,...list(found.docs,p=>`- \`${relative(source,p)}\``,"- No component documentation files found."),``,`## Maven Modules`,``,...list(found.poms,p=>`- \`${relative(source,path.dirname(p))}\``,"- No Maven modules found."),``,`## Key Java Entry Points`,``,...list(java,p=>`- \`${relative(source,p)}\``,"- No key Java entry points matched the configured name patterns."),``,`## Recommended Next Reads`,``,`- Start with the documentation files above when learning component usage.`,`- Search the key Java entry points for annotations, auto configuration, properties, aspects, interceptors, handlers, and result objects before changing application code.`,`- Prefer existing component extension points over rewriting framework logic in business modules.`,``];const target=path.join(skillsRoot,skill,"references","source-index.md");await mkdir(path.dirname(target),{recursive:true});await writeFile(target,lines.join("\n"),"utf8")}
21
- if(frontend)for(const[skill,keys]of Object.entries(FRONTEND)){if(!await exists(path.join(skillsRoot,skill)))continue;const target=path.join(skillsRoot,skill,"references","frontend-docs.md");await mkdir(path.dirname(target),{recursive:true});await writeFile(target,[`# ${skill} Frontend Documentation`,``,`Generated: ${now}`,``,`Use these YSS UI documentation entry points as authoritative references when local repo examples are insufficient.`,``,...keys.map(key=>`- ${key}: ${URLS[key]}`),``,`When documentation and local code differ, inspect the current project code before editing and prefer established local usage.`,``].join("\n"),"utf8")}
22
- return{backend:Object.keys(BACKEND).length,frontend:frontend?Object.keys(FRONTEND).length:0}}
23
- async function main(){try{const script=path.dirname(fileURLToPath(import.meta.url));const result=await refresh({skillsRoot:path.resolve(process.env.YSS_SKILLS_ROOT||path.join(script,"../..")),source:await sourceRoot(),frontend:!["0","false","no"].includes((process.env.YSS_REFRESH_FRONTEND||"true").toLowerCase())});console.log(`Updated ${result.backend} backend indexes and ${result.frontend} frontend doc references.`)}catch(error){console.error(error.message);process.exitCode=1}}
24
- if(process.argv[1]===fileURLToPath(import.meta.url))await main();
9
+ const BACKEND = {
10
+ "yss-cache": ["yss-microservice-components/yss-component-cache-parent"],
11
+ "yss-mybatis": ["yss-microservice-components/yss-component-persistence"],
12
+ "yss-dto": ["yss-microservice-components/yss-component-dto"],
13
+ "yss-audit-log": ["yss-microservice-components/yss-component-audit-log"],
14
+ "yss-excel-mvc": [
15
+ "yss-microservice-components/yss-component-excel-mvc",
16
+ "yss-microservice-components/yss-component-excel-starter",
17
+ ],
18
+ "yss-distributed-id": [
19
+ "yss-microservice-components/yss-component-distributed-id",
20
+ "yss-microservice-components/yss-component-leaf",
21
+ ],
22
+ "yss-resilience4j": ["yss-microservice-components/yss-component-resilience4j-starter"],
23
+ "yss-validation": [
24
+ "yss-microservice-components/yss-component-validation-engine-parent",
25
+ "yss-microservice-components/yss-component-validation-jsr303",
26
+ ],
27
+ "yss-security-algorithm": ["yss-microservice-components/yss-component-security-algorithm"],
28
+ "yss-userinfo": ["yss-microservice-components/yss-component-userinfo-starter"],
29
+ "yss-exception": ["yss-microservice-components/yss-component-exception"],
30
+ };
31
+
32
+ const FRONTEND = {
33
+ "yss-ui": ["components", "hooks", "skills"],
34
+ "yss-components": ["components"],
35
+ "yss-hook": ["hooks"],
36
+ "yss-ui-business-page-generation": ["components", "hooks", "skills"],
37
+ "yss-use-table-height": ["hooks"],
38
+ "yss-use-tree-height": ["hooks"],
39
+ };
40
+
41
+ const URLS = {
42
+ components: "http://192.168.164.27:3200/components",
43
+ hooks: "http://192.168.164.27:3200/hooks",
44
+ skills: "http://192.168.164.27:3200/skills",
45
+ };
46
+
47
+ const KEYS = [
48
+ "Audit", "Cache", "Clear", "Command", "Configuration", "Controller", "DTO", "Data", "Enable", "Excel",
49
+ "Handler", "Interceptor", "Jdbc", "Mapper", "Mybatis", "Page", "Properties", "Query", "Repository", "Request",
50
+ "Response", "Result", "Update", "Aspect", "Leaf", "Id", "Dir", "Dic", "Dictionary", "File", "Upload", "Log",
51
+ "Message", "Mail", "Liquibase", "Circuit", "Breaker", "Sql", "Tpl", "Tag", "Task", "Flow", "Report",
52
+ "Validation", "Validator", "Security", "Crypto", "User", "Variable", "Quality", "Search", "Similarity",
53
+ "Scheduler", "Runner", "Duck", "Dynamic", "Factory", "Client", "Feign", "Gateway", "Convertor", "Adapter",
54
+ "Advice", "Bridge", "Route", "Uploader", "Sftp", "Minio", "Parser", "Express", "Rule", "Template", "Generator",
55
+ "Importer", "Engine", "Event", "Submitter", "Executor", "Context", "Status", "Type", "State",
56
+ ];
57
+
58
+ const DOCS = new Set(["README.md", "readme.md", "HELP.md", "TECHNICAL_DESIGN.md"]);
59
+ const SKIPPED_DIRECTORIES = new Set([".git", "node_modules", "target", "build", "out", "${project.build.directory}"]);
60
+
61
+ const MYBATIS_CAPABILITIES = [
62
+ {
63
+ title: "Repository abstractions",
64
+ sources: [
65
+ {
66
+ suffix: "/support/BaseRepository.java",
67
+ patterns: [/public interface BaseRepository/, /int (insert|insertSelective|insertList|updateList|updateListSelective)\(/],
68
+ },
69
+ {
70
+ suffix: "/support/BasePlusRepository.java",
71
+ patterns: [/public interface BasePlusRepository/, /insertBatchSomeColumn/],
72
+ },
73
+ ],
74
+ },
75
+ {
76
+ title: "Pagination and activation",
77
+ sources: [
78
+ { suffix: "/aop/EntityQueryAspect.java", patterns: [/@Around\(/, /PageHelper\.offsetPage/] },
79
+ { suffix: "/config/PageQueryEntityConfigration.java", patterns: [/@ConditionalOnProperty/] },
80
+ {
81
+ suffix: "/YssMybatisMapperProperties.java",
82
+ patterns: [
83
+ /@ConfigurationProperties/,
84
+ /private (String mapperLocation|String mapperScan|Integer batchSize|String dbType|PageHelper pageHelper|MybatisPlusPagination mybatisPlusPagination)/,
85
+ /public static class (PageHelper|MybatisPlusPagination)/,
86
+ /private Boolean enabled/,
87
+ ],
88
+ },
89
+ {
90
+ suffix: "/config/MapperConfiguration.java",
91
+ patterns: [/new PageInterceptor\(/, /new PaginationInnerInterceptor\(/, /setBatchSize\(/, /setDbType\(/],
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ title: "SQL-level batch insertion",
97
+ sources: [
98
+ { suffix: "/config/BatchInsertSettings.java", patterns: [/DEFAULT_BATCH_SIZE/, /configuredBatchSize/] },
99
+ { suffix: "/config/BatchSqlInjector.java", patterns: [/public class BatchSqlInjector/, /insertBatchSomeColumnInternal/, /FieldFill\.UPDATE/] },
100
+ { suffix: "/config/DialectInsertBatchSomeColumn.java", patterns: [/public class DialectInsertBatchSomeColumn/, /DbType\.(ORACLE|ORACLE_12C|DM)/] },
101
+ ],
102
+ },
103
+ {
104
+ title: "Multi-data-source capability boundary",
105
+ sources: [
106
+ {
107
+ suffix: "/MultiDataSourceHolder.java",
108
+ patterns: [/public class MultiDataSourceHolder/, /Map<String, DataSource>/, /getMultiDataSource\(/],
109
+ },
110
+ ],
111
+ },
112
+ ];
113
+
114
+ const exists = async (target) => {
115
+ try {
116
+ await access(target);
117
+ return true;
118
+ } catch {
119
+ return false;
120
+ }
121
+ };
122
+
123
+ async function walk(root) {
124
+ if (!await exists(root)) return [];
125
+ const output = [];
126
+ for (const item of await readdir(root, { withFileTypes: true })) {
127
+ const target = path.join(root, item.name);
128
+ if (item.isDirectory() && !SKIPPED_DIRECTORIES.has(item.name)) output.push(...await walk(target));
129
+ else if (item.isFile()) output.push(target);
130
+ }
131
+ return output;
132
+ }
133
+
134
+ function relative(root, target) {
135
+ const value = path.relative(root, target).replaceAll(path.sep, "/");
136
+ return value && !value.startsWith("..") ? value : target;
137
+ }
138
+
139
+ function runGit(root, args) {
140
+ return execFileSync("git", ["-C", root, ...args], {
141
+ encoding: "utf8",
142
+ stdio: ["ignore", "pipe", "ignore"],
143
+ }).trim();
144
+ }
145
+
146
+ export function sourceState(root, componentPaths) {
147
+ try {
148
+ const commit = runGit(root, ["rev-parse", "HEAD"]);
149
+ const componentWorktree = runGit(root, ["status", "--porcelain", "--", ...componentPaths]) ? "dirty" : "clean";
150
+ const componentTrees = componentPaths.map((componentPath) => {
151
+ let tree = "missing";
152
+ try {
153
+ tree = runGit(root, ["rev-parse", `HEAD:${componentPath}`]);
154
+ } catch {
155
+ // The path can be newly added or absent in the indexed commit.
156
+ }
157
+ return { path: componentPath, tree };
158
+ });
159
+ return { commit, componentWorktree, componentTrees };
160
+ } catch {
161
+ return {
162
+ commit: "unavailable",
163
+ componentWorktree: "unknown",
164
+ componentTrees: componentPaths.map((componentPath) => ({ path: componentPath, tree: "unavailable" })),
165
+ };
166
+ }
167
+ }
168
+
169
+ async function sourceRoot() {
170
+ if (process.env.YSS_SOURCE_ROOT) {
171
+ const root = path.resolve(process.env.YSS_SOURCE_ROOT);
172
+ if (await exists(path.join(root, "yss-microservice-components"))) return root;
173
+ throw new Error(`YSS_SOURCE_ROOT must point to the repository root containing \`yss-microservice-components\`: ${root}`);
174
+ }
175
+
176
+ const home = os.homedir();
177
+ const candidates = [
178
+ process.cwd(),
179
+ ...ancestors(process.cwd()),
180
+ path.join(home, "Documents/yss-project/yss-cloud-microservice"),
181
+ path.join(home, "Documents/yss-project"),
182
+ path.join(home, "Projects/yss-cloud-microservice"),
183
+ path.join(home, "Projects"),
184
+ ];
185
+ for (const base of [path.join(home, "Projects"), path.join(home, "Documents"), path.join(home, "Documents/yss-project")]) {
186
+ if (!await exists(base)) continue;
187
+ for (const entry of await readdir(base, { withFileTypes: true })) {
188
+ if (entry.isDirectory()) candidates.push(path.join(base, entry.name));
189
+ }
190
+ }
191
+ for (const root of candidates) {
192
+ if (await exists(path.join(root, "yss-microservice-components"))) return path.resolve(root);
193
+ }
194
+ throw new Error("Could not find a YSS source repository containing `yss-microservice-components`. Export YSS_SOURCE_ROOT=/absolute/path/to/yss-cloud-microservice and rerun.");
195
+ }
196
+
197
+ function ancestors(start) {
198
+ const output = [];
199
+ let current = path.resolve(start);
200
+ while (path.dirname(current) !== current) {
201
+ current = path.dirname(current);
202
+ output.push(current);
203
+ }
204
+ return output;
205
+ }
206
+
207
+ async function files(bases) {
208
+ const output = { docs: [], poms: [], java: [], metadata: [] };
209
+ for (const base of bases) {
210
+ for (const target of await walk(base)) {
211
+ if (DOCS.has(path.basename(target))) output.docs.push(target);
212
+ else if (path.basename(target) === "pom.xml") output.poms.push(target);
213
+ else if (target.endsWith(".java") && target.includes(`${path.sep}src${path.sep}main${path.sep}java${path.sep}`)) output.java.push(target);
214
+ else if (path.basename(target) === "spring.factories") output.metadata.push(target);
215
+ }
216
+ }
217
+ for (const items of Object.values(output)) items.sort();
218
+ return output;
219
+ }
220
+
221
+ async function sha256(target) {
222
+ return createHash("sha256").update(await readFile(target)).digest("hex");
223
+ }
224
+
225
+ function list(items, render, empty) {
226
+ return items.length ? items.map(render) : [empty];
227
+ }
228
+
229
+ async function genericJavaEntries(source, javaFiles) {
230
+ const selected = javaFiles
231
+ .filter((target) => KEYS.some((key) => path.basename(target, ".java").includes(key)))
232
+ .slice(0, 120);
233
+ const output = [];
234
+ for (const target of selected) {
235
+ output.push(`- \`${relative(source, target)}\` — \`sha256:${await sha256(target)}\``);
236
+ }
237
+ return output.length ? output : ["- No key Java entry points matched the configured name patterns."];
238
+ }
239
+
240
+ function matchingLines(contents, patterns) {
241
+ return contents
242
+ .split(/\r?\n/)
243
+ .map((line, index) => ({ line: index + 1, text: line.trim().replace(/\s+/g, " ") }))
244
+ .filter(({ text }) => text && patterns.some((pattern) => pattern.test(text)))
245
+ .slice(0, 14);
246
+ }
247
+
248
+ async function mybatisCapabilityMatrix(source, javaFiles, metadataFiles) {
249
+ const output = ["## Capability Matrix", ""];
250
+ for (const capability of MYBATIS_CAPABILITIES) {
251
+ output.push(`### ${capability.title}`, "");
252
+ for (const expected of capability.sources) {
253
+ const target = javaFiles.find((candidate) => relative(source, candidate).endsWith(expected.suffix));
254
+ if (!target) {
255
+ output.push(`- \`${path.basename(expected.suffix)}\` — source not found.`);
256
+ continue;
257
+ }
258
+ const sourcePath = relative(source, target);
259
+ output.push(`- \`${sourcePath}\` — \`sha256:${await sha256(target)}\``);
260
+ const lines = matchingLines(await readFile(target, "utf8"), expected.patterns);
261
+ if (!lines.length) output.push(" - No configured public fact matched; refresh rules may need maintenance.");
262
+ else for (const fact of lines) output.push(` - \`${sourcePath}:${fact.line}\` — \`${fact.text.replaceAll("`", "'")}\``);
263
+ }
264
+ output.push("");
265
+ }
266
+
267
+ output.push("### Auto-configuration registration", "");
268
+ for (const target of metadataFiles) {
269
+ const sourcePath = relative(source, target);
270
+ output.push(`- \`${sourcePath}\` — \`sha256:${await sha256(target)}\``);
271
+ const registrations = (await readFile(target, "utf8"))
272
+ .split(/\r?\n/)
273
+ .map((line) => line.trim())
274
+ .filter((line) => line && !line.startsWith("#"));
275
+ for (const registration of registrations.slice(0, 12)) output.push(` - \`${registration.replaceAll("`", "'")}\``);
276
+ }
277
+ if (!metadataFiles.length) output.push("- No `spring.factories` registration found.");
278
+ output.push("");
279
+ return output;
280
+ }
281
+
282
+ async function backendIndex({ skill, parts, source, found, now, stateResolver }) {
283
+ const currentState = stateResolver(source, parts);
284
+ const bases = parts.map((item) => path.join(source, item));
285
+ const baseHints = await Promise.all(bases.map(async (target) =>
286
+ `- \`${relative(source, target)}\` (${await exists(target) ? "existed" : "missing"} when indexed)`,
287
+ ));
288
+ const treeLines = currentState.componentTrees.map(({ path: componentPath, tree }) =>
289
+ `Component tree \`${componentPath}\`: \`${tree}\``,
290
+ );
291
+ const lines = [
292
+ `# ${skill} Source Index`,
293
+ "",
294
+ `Generated: ${now}`,
295
+ `Source commit: \`${currentState.commit}\``,
296
+ `Component worktree: \`${currentState.componentWorktree}\``,
297
+ ...treeLines,
298
+ "Indexed source root: resolved at refresh time; set `YSS_SOURCE_ROOT` to reproduce or refresh.",
299
+ "",
300
+ "This file is generated by `yss-skill-source-index-refresh/scripts/refresh-yss-skill-index.mjs`. Do not hand-edit generated sections.",
301
+ "",
302
+ "Paths are relocatable source hints. Exact guidance requires a matching component tree and a clean indexed component subtree; the repository commit is trace metadata and may differ when unrelated components change.",
303
+ "",
304
+ "## Component Path Hints",
305
+ "",
306
+ ...baseHints,
307
+ "",
308
+ "## Documentation Files",
309
+ "",
310
+ ...list(found.docs, (target) => `- \`${relative(source, target)}\``, "- No component documentation files found."),
311
+ "",
312
+ "Component documentation is a discovery aid. For API signatures, conditions and defaults, prefer the indexed source facts below when documentation differs.",
313
+ "",
314
+ "## Maven Modules",
315
+ "",
316
+ ...list(found.poms, (target) => `- \`${relative(source, path.dirname(target))}\``, "- No Maven modules found."),
317
+ "",
318
+ ];
319
+
320
+ if (skill === "yss-mybatis") lines.push(...await mybatisCapabilityMatrix(source, found.java, found.metadata));
321
+ else lines.push("## Key Java Entry Points", "", ...await genericJavaEntries(source, found.java), "");
322
+
323
+ lines.push(
324
+ "## Freshness and Use",
325
+ "",
326
+ "- Locate the current source root using `YSS_SOURCE_ROOT`, CodeGraph, Maven artifact names or repository search.",
327
+ "- Compare each indexed `Component tree` with `git rev-parse HEAD:<component-path>` and require the current component subtree to be clean before exact guidance.",
328
+ "- A repository commit difference alone is not stale when the component tree is unchanged; a component tree mismatch or component-local dirty state is stale.",
329
+ "- Read only the source entries needed for the current decision or troubleshooting path.",
330
+ "",
331
+ );
332
+ return lines.join("\n");
333
+ }
334
+
335
+ export async function refresh({
336
+ skillsRoot,
337
+ source,
338
+ now = new Date().toISOString(),
339
+ frontend = true,
340
+ backendSkills = Object.keys(BACKEND),
341
+ stateResolver = sourceState,
342
+ }) {
343
+ const unknownSkills = backendSkills.filter((skill) => !(skill in BACKEND));
344
+ if (unknownSkills.length) throw new Error(`Unknown backend source-index skill: ${unknownSkills.join(", ")}`);
345
+ for (const skill of backendSkills) {
346
+ const parts = BACKEND[skill];
347
+ const bases = parts.map((item) => path.join(source, item));
348
+ const found = await files(bases);
349
+ const target = path.join(skillsRoot, skill, "references", "source-index.md");
350
+ await mkdir(path.dirname(target), { recursive: true });
351
+ await writeFile(target, await backendIndex({ skill, parts, source, found, now, stateResolver }), "utf8");
352
+ }
353
+
354
+ if (frontend) {
355
+ for (const [skill, keys] of Object.entries(FRONTEND)) {
356
+ if (!await exists(path.join(skillsRoot, skill))) continue;
357
+ const target = path.join(skillsRoot, skill, "references", "frontend-docs.md");
358
+ await mkdir(path.dirname(target), { recursive: true });
359
+ await writeFile(target, [
360
+ `# ${skill} Frontend Documentation`,
361
+ "",
362
+ `Generated: ${now}`,
363
+ "",
364
+ "Use these YSS UI documentation entry points as authoritative references when local repo examples are insufficient.",
365
+ "",
366
+ ...keys.map((key) => `- ${key}: ${URLS[key]}`),
367
+ "",
368
+ "When documentation and local code differ, inspect the current project code before editing and prefer established local usage.",
369
+ "",
370
+ ].join("\n"), "utf8");
371
+ }
372
+ }
373
+ return { backend: backendSkills.length, frontend: frontend ? Object.keys(FRONTEND).length : 0 };
374
+ }
375
+
376
+ async function main() {
377
+ try {
378
+ const script = path.dirname(fileURLToPath(import.meta.url));
379
+ const result = await refresh({
380
+ skillsRoot: path.resolve(process.env.YSS_SKILLS_ROOT || path.join(script, "../..")),
381
+ source: await sourceRoot(),
382
+ frontend: !["0", "false", "no"].includes((process.env.YSS_REFRESH_FRONTEND || "true").toLowerCase()),
383
+ backendSkills: process.env.YSS_REFRESH_BACKEND_SKILLS
384
+ ? process.env.YSS_REFRESH_BACKEND_SKILLS.split(",").map((skill) => skill.trim()).filter(Boolean)
385
+ : Object.keys(BACKEND),
386
+ });
387
+ console.log(`Updated ${result.backend} backend indexes and ${result.frontend} frontend doc references.`);
388
+ } catch (error) {
389
+ console.error(error.message);
390
+ process.exitCode = 1;
391
+ }
392
+ }
393
+
394
+ if (process.argv[1] === fileURLToPath(import.meta.url)) await main();
@@ -1,9 +1,10 @@
1
1
  import assert from "node:assert/strict";
2
+ import { execFileSync } from "node:child_process";
2
3
  import { mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
3
4
  import { tmpdir } from "node:os";
4
5
  import path from "node:path";
5
6
  import test from "node:test";
6
- import { refresh } from "./refresh-yss-skill-index.mjs";
7
+ import { refresh, sourceState } from "./refresh-yss-skill-index.mjs";
7
8
 
8
9
  test("writes Node-labelled generated indexes", async () => {
9
10
  const root=await mkdtemp(path.join(tmpdir(),"yss-index-")); const source=path.join(root,"source"); const skills=path.join(root,"skills");
@@ -13,3 +14,80 @@ test("writes Node-labelled generated indexes", async () => {
13
14
  assert.match(await readFile(path.join(skills,"yss-cache/references/source-index.md"),"utf8"),/refresh-yss-skill-index\.mjs/);
14
15
  assert.match(await readFile(path.join(skills,"yss-ui/references/frontend-docs.md"),"utf8"),/components/);
15
16
  });
17
+
18
+ test("writes a source-backed MyBatis capability matrix without absolute paths", async () => {
19
+ const root = await mkdtemp(path.join(tmpdir(), "yss-mybatis-index-"));
20
+ const source = path.join(root, "source");
21
+ const skills = path.join(root, "skills");
22
+ const component = "yss-microservice-components/yss-component-persistence";
23
+ const plusJava = path.join(source, component, "yss-component-mybatis-plus-starter/src/main/java/com/yss/cloud/mybatis");
24
+ const baseJava = path.join(source, component, "yss-component-mybatis-starter/src/main/java/com/yss/cloud/mybatis");
25
+ const commonJava = path.join(source, component, "yss-component-persistence-common/src/main/java/com/yss/cloud/mybatis");
26
+
27
+ await mkdir(path.join(plusJava, "support"), { recursive: true });
28
+ await mkdir(path.join(baseJava, "config"), { recursive: true });
29
+ await mkdir(commonJava, { recursive: true });
30
+ await mkdir(path.join(skills, "yss-mybatis"), { recursive: true });
31
+ await writeFile(path.join(source, component, "pom.xml"), "<project/>");
32
+ await writeFile(path.join(plusJava, "support/BasePlusRepository.java"), [
33
+ "public interface BasePlusRepository<T> extends BaseMapper<T> {",
34
+ " default Integer insertBatchSomeColumn(List<T> entities) { return 0; }",
35
+ " Integer insertBatchSomeColumnInternal(List<T> entities);",
36
+ "}",
37
+ ].join("\n"));
38
+ await writeFile(path.join(baseJava, "config/PageQueryEntityConfigration.java"), [
39
+ "public class PageQueryEntityConfigration {",
40
+ " @ConditionalOnProperty(name = \"yss.mybatis.page-helper.enabled\", havingValue = \"true\", matchIfMissing = true)",
41
+ "}",
42
+ ].join("\n"));
43
+ await writeFile(path.join(commonJava, "MultiDataSourceHolder.java"), [
44
+ "public class MultiDataSourceHolder {",
45
+ " private Map<String, DataSource> multiDataSource;",
46
+ "}",
47
+ ].join("\n"));
48
+
49
+ await refresh({
50
+ skillsRoot: skills,
51
+ source,
52
+ now: "2026-01-01T00:00:00Z",
53
+ frontend: false,
54
+ backendSkills: ["yss-mybatis"],
55
+ stateResolver: () => ({
56
+ commit: "a".repeat(40),
57
+ componentWorktree: "clean",
58
+ componentTrees: [{ path: component, tree: "b".repeat(40) }],
59
+ }),
60
+ });
61
+
62
+ const index = await readFile(path.join(skills, "yss-mybatis/references/source-index.md"), "utf8");
63
+ assert.match(index, /## Capability Matrix/);
64
+ assert.match(index, /BasePlusRepository<T>/);
65
+ assert.match(index, /yss\.mybatis\.page-helper\.enabled/);
66
+ assert.match(index, /Map<String, DataSource>/);
67
+ assert.match(index, /Component worktree: `clean`/);
68
+ assert.match(index, /Component tree.*b{40}/);
69
+ assert.doesNotMatch(index, new RegExp(root.replaceAll("/", "\\/")));
70
+ assert.doesNotMatch(index, /## Key Java Entry Points/);
71
+ });
72
+
73
+ test("source freshness is scoped to the indexed component subtree", async () => {
74
+ const root = await mkdtemp(path.join(tmpdir(), "yss-component-state-"));
75
+ const component = "yss-microservice-components/yss-component-persistence";
76
+ const componentFile = path.join(root, component, "pom.xml");
77
+ const unrelatedFile = path.join(root, "yss-microservice-components/other/README.md");
78
+ await mkdir(path.dirname(componentFile), { recursive: true });
79
+ await mkdir(path.dirname(unrelatedFile), { recursive: true });
80
+ await writeFile(componentFile, "<project/>\n");
81
+ await writeFile(unrelatedFile, "clean\n");
82
+ execFileSync("git", ["init", "-q"], { cwd: root });
83
+ execFileSync("git", ["config", "user.email", "test@example.com"], { cwd: root });
84
+ execFileSync("git", ["config", "user.name", "Test"], { cwd: root });
85
+ execFileSync("git", ["add", "."], { cwd: root });
86
+ execFileSync("git", ["commit", "-qm", "fixture"], { cwd: root });
87
+
88
+ await writeFile(unrelatedFile, "dirty elsewhere\n");
89
+ assert.equal(sourceState(root, [component]).componentWorktree, "clean");
90
+
91
+ await writeFile(componentFile, "<project><dirty/></project>\n");
92
+ assert.equal(sourceState(root, [component]).componentWorktree, "dirty");
93
+ });
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: yss-stage-decision
3
- description: 编排 Discovery 到 Spec 入口的方案决策与业务边界、协作和规则设计;当需求、业务责任区、统一业务词汇或下游影响尚未稳定时使用。
3
+ description: 编排 Plan 到 Spec 入口的方案决策与业务边界、协作和规则设计;当需求、业务责任区、统一业务词汇或下游影响尚未稳定时使用。
4
4
  ---
5
5
 
6
6
  # YSS Stage Decision
@@ -9,14 +9,16 @@ description: 编排 Discovery 到 Spec 入口的方案决策与业务边界、
9
9
 
10
10
  ## 适用边界
11
11
 
12
- - 适用于 `project-instance` 的 Discovery → Spec 入口。
12
+ - 适用于 `project-instance` 的 Plan → Spec 入口。
13
13
  - `template-source` 只维护本技能、Schema、验证器和合成 Fixture,不生成具体产品领域资产。
14
14
  - 业务边界与协作工作单元只回答:有哪些业务板块、每个业务责任区负责什么、不同责任区如何交接、使用哪些统一业务词汇、发生哪些业务事实、有哪些待确认的关键业务对象和不可违反的业务规则。
15
15
  - Entity、Aggregate、Repository、Java 类、数据库表和 OpenAPI Freeze 留给下游工作单元。
16
16
 
17
17
  ## 执行顺序
18
18
 
19
- 1. 读取 `yss-project.yaml`、`CONTEXT.md`、既有 Discovery/Spec、ADR 和父 Ticket/checkpoint。
19
+ Plan 的目标与退出条件由 `docs/process/lifecycle-registry.yaml` 持有;从 `docs/plan/templates/plan-template.md` 汇总输入。旧资产按 `docs/process/plan-migration.md` 重新整理并核查,关键未决项不得延期到 Spec,非关键项记录责任人、解决时点与接收方。
20
+
21
+ 1. 读取 `yss-project.yaml`、`CONTEXT.md`、既有 Plan/Spec、ADR 和父 Ticket/checkpoint。
20
22
  2. 分离事实、决策、假设、约束和未决项;技术事实走 `yss-research` 的 `technical-evidence`,领域边界、业务规则、MVP、非目标、成功标准或阶段推进依据等决策证据走 `strategy-evidence`,市场/竞品事实走 `competitive-intelligence`。
21
23
  3. 从业务故事、已发生的事实、规则、责任人和失败路径识别业务板块与业务责任区,不从数据库表或调用链直接反推边界。
22
24
  4. 为每个业务责任区建立统一业务词汇;对跨责任区协作记录规则提供方、规则使用方、业务决策权、信息传递方向和口径转换负责人。
@@ -1,6 +1,6 @@
1
1
  # 方案决策包合同
2
2
 
3
- 内部对象 `stage_decision_package` 是 Discovery、需求/产品/商务决策与业务边界和规则设计之间的冻结入口。它记录“做什么、为什么做、范围是什么、哪些仍未决”,不复制业务边界与规则事实。
3
+ 内部对象 `stage_decision_package` 是 Plan、需求/产品/商务决策与业务边界和规则设计之间的冻结入口。它记录“做什么、为什么做、范围是什么、哪些仍未决”,不复制业务边界与规则事实。
4
4
 
5
5
  ## 必须包含
6
6
 
@@ -38,11 +38,11 @@
38
38
 
39
39
  ## 5. `project-instance` 产品研发路由
40
40
 
41
- 主流程:分诊 → Discovery → Spec / 功能架构 → 产品设计 → 工程契约 → Ticket → 切片 → 验证 / 发布 / 复盘。
41
+ 主流程:分诊 → Plan → Spec / 功能架构 → 产品设计 → 工程契约 → Ticket → 切片 → 验证 / 发布 / 复盘。
42
42
 
43
43
  - 先按 `docs/process/harness-process-tailoring.md` 判定影响面和最近可信阶段,再由 `yss-product-lifecycle` 执行 `docs/process/lifecycle-registry.yaml`;阅读导航见 `docs/process/lifecycle-artifact-map.md`。
44
44
  - 命中门禁必须完成;仅未命中时记录带原因的 `not-applicable`,不得生成空文档或混淆门禁、产物、工作单元、证据。安全 / 权限写入普通 Spec、契约、架构、验收和 seam,按实际影响触发门禁。
45
- - 新功能和较大变更先进入 Discovery;`grill-with-docs`、`to-spec`、`to-tickets`、`implement` 仅为用户显式兼容入口。API 变更先形成 OpenAPI 3.1 Draft,审查后 Freeze,再实现。
45
+ - 新功能和较大变更先进入 Plan;`grill-with-docs`、`to-spec`、`to-tickets`、`implement` 仅为用户显式兼容入口。API 变更先形成 OpenAPI 3.1 Draft,审查后 Freeze,再实现。
46
46
  - Spec Delta 只记冻结基线的高风险行为差异。OpenAPI Freeze 或无 API 影响记录后拆窄垂直切片,禁止仅按技术层横拆。
47
47
  - `seam-deferred` 必须记录风险、责任人、后续 Ticket、验证计划和目标版本或发布日期。
48
48
 
@@ -15,6 +15,7 @@ context_schema_version: 1
15
15
 
16
16
  | 术语 | 含义 | 英文标识 | 避免 / 备注 |
17
17
  |---|---|---|---|
18
+ | Plan(战略规划) | 确认目标、业务边界、关键规则、MVP / 非目标、优先级和交接责任,为 Spec 提供已确认的战略输入。 | — | 问题探索是其中按需开展的活动;不等同于 AI-DLC 官方阶段名、交付排期或实现合同的 Context Plan。旧阶段 ID 已弃用,不提供兼容解析。 |
18
19
  | Agent | 执行特定工作流步骤的 AI 协作者。 | — | 不要与生物人审查者、数字人角色或 Ticket 状态混用。运行时实例(Cursor Agent、Claude Code、Grok Bot 等)是 Agent 的承载,不是角色本身。 |
19
20
  | 运行时绑定 | 把数字人角色落到某个 Agent 平台的适配声明,权威清单在数字人角色注册表的 `runtimes`。 | — | 不要为每个平台复制一套职称职责。 |
20
21
  | Grok Bot | Grok 平台上的持久数字队友实例;对应 `runtime.grok`。 | — | 不是数字人角色、技能或门禁。 |
@@ -26,9 +27,9 @@ context_schema_version: 1
26
27
  | 运行时副作用审批 | 对发消息、改生产、付款、删数据等工具动作的账号级确认。 | — | 点 Allow 不等于门禁已批准或可发布。避免只称「Grok 平台审批」。 |
27
28
  | Ticket 状态 | Tracker 五态:`needs-triage`、`needs-info`、`ready-for-agent`、`ready-for-human`、`wontfix`。 | — | 不要称为数字人角色或「标准角色」。 |
28
29
  | 阶段协作组 | 某阶段需要共同可见会签的逻辑成员集合。 | — | 不是某个产品的群聊;平台人数上限只写在对应 `runtimes`。 |
29
- | 需求经理 | 主责 Discovery 语言、用户/MVP/非目标、Spec 正文与测试 seam 的数字人角色。 | — | 不拥有原型视觉定稿,不 Freeze API,不写实现。 |
30
+ | 需求经理 | 主责 Plan 语言、用户/MVP/非目标、Spec 正文与测试 seam 的数字人角色。 | — | 不拥有原型视觉定稿,不 Freeze API,不写实现。 |
30
31
  | 产品经理 | 主责优先级、产品设计影响、原型确认建议、范围裁剪以及商业约束、交付承诺、发布窗口和商业非目标的数字人角色。 | — | 不写生产代码,不单独 Freeze API;对外商务合同和正式承诺须由生物人批准。 |
31
- | 商业约束 | Discovery 与发布阶段需要确认的商业边界、交付承诺、发布窗口和商业非目标。 | — | 由产品经理负责数字人侧的整理与协调;不等同于独立的“商务”数字人角色。 |
32
+ | 商业约束 | Plan 与发布阶段需要确认的商业边界、交付承诺、发布窗口和商业非目标。 | — | 由产品经理负责数字人侧的整理与协调;不等同于独立的“商务”数字人角色。 |
32
33
  | Agent 入口规则 | Agent 启动任务时必须先遵守的全局路由、硬门禁和禁止事项。 | — | 不作为 YSS 后端、前端或其他专项编码规范的完整手册。 |
33
34
  | 标准文档语言 | 面向业务、产品、架构、实施、审查、发布和复盘的持久化文档所使用的默认语言。 | — | 统一使用简体中文;英文专有名词、代码标识、API 路径、schema、文件名和协议 metadata 保持原样。 |
34
35
  | Matt Engineering Skills | 来自 `mattpocock/skills` 的轻量工程流程技能集合。 | — | 用于澄清、Spec、Ticket、实现、TDD、诊断、审查和架构治理,不替代 YSS 专项规范。 |
@@ -23,7 +23,7 @@
23
23
  │ ├── api/ ← OpenAPI 3.1 契约
24
24
  │ ├── adr/ ← 架构决策记录
25
25
  │ ├── requirements/ ← Spec / 用户故事 / 需求草案 / 垂直切片
26
- │ ├── discovery/ ← 机会探索、市场、竞品和用户材料
26
+ │ ├── plan/ ← 战略规划与 Spec 上游输入
27
27
  │ ├── design/ ← 产品设计、原型、交互说明和状态矩阵
28
28
  │ ├── architecture/ ← 架构设计与审查模板
29
29
  │ ├── releases/ ← 发布说明
@@ -42,7 +42,7 @@
42
42
  1. 先读取 `yss-project.yaml`,按 `repository_mode` 选择模板维护或产品研发生命周期。
43
43
  2. 必读入口为 `AGENTS.md` 与 `CONTEXT.md`;流程事实分别以生命周期映射和裁剪指南为准。
44
44
  3. `template-source` 修改后先按 `maintenance-intensity.yaml` 判定 L1 / L2 / L3,默认用 `scripts/verify-template-fast` 达到 `implementation-ready`;L3 日常采用维护者自检,正式发布前执行完整门禁;只有共享 skill 变更才运行 `scripts/sync-skills` 和 `scripts/update-skill-lock`。
45
- 4. `project-instance` 默认从 `yss-product-lifecycle` 的 `route` 模式开始,再由原生 `work-unit.*` 推进 Discovery、Spec、产品设计、工程契约和 Ticket 正式化;`grill-with-docs`、`to-spec`、`to-tickets`、`implement` 仅作为用户显式调用的兼容入口。
45
+ 4. `project-instance` 默认从 `yss-product-lifecycle` 的 `route` 模式开始,再由原生 `work-unit.*` 推进 Plan、Spec、产品设计、工程契约和 Ticket 正式化;`grill-with-docs`、`to-spec`、`to-tickets`、`implement` 仅作为用户显式调用的兼容入口。
46
46
  5. 实现仓库接入、YSS 路由、独立审查、fresh verification 和 Git checkpoint 以 `AGENTS.md` 的硬门禁为准。
47
47
 
48
48
  YSS skills 的公开发布投影维护在 [iloveZzz/yss-spec-dev-skills](https://github.com/iloveZzz/yss-spec-dev-skills),发布清单和导出命令见 [skills 维护说明](./docs/agents/skills-maintenance.md)。
@@ -115,7 +115,7 @@ scripts/verify-template-fast
115
115
  | [docs/agents/README.md](./docs/agents/README.md) | Agent 协作文档目录说明 |
116
116
  | [docs/agents/skills-maintenance.md](./docs/agents/skills-maintenance.md) | Agent skills 安装与维护 |
117
117
  | [docs/user-guide/yss-ui-mcp.md](./docs/user-guide/yss-ui-mcp.md) | YSS UI MCP 项目配置、全局安装边界与自检 |
118
- | [docs/discovery/IDEATION.md](./docs/discovery/IDEATION.md) | 机会构想方法 |
118
+ | [docs/plan/IDEATION.md](./docs/plan/IDEATION.md) | 机会构想方法 |
119
119
  | [docs/architecture/README.md](./docs/architecture/README.md) | 架构设计 + 审查清单 |
120
120
  | [docs/testing/README.md](./docs/testing/README.md) | 测试策略 |
121
121
 
@@ -12,7 +12,7 @@
12
12
  |---|---|---|
13
13
  | 数字人角色 | 职称配置(需求经理、产品经理、前端工程师…) | Ticket 五态、某个平台的 Bot |
14
14
  | 主控数字人 | 生命周期编排器的运行时实例 | 第八个业务职称 |
15
- | 职能工作单元 | Discovery / Spec / Code / Review | 职称 |
15
+ | 职能工作单元 | Plan / Spec / Code / Review | 职称 |
16
16
  | 执行态 | Explorer / Drafter / Worker / Reviewer / Verifier | 数字人角色 |
17
17
  | 运行时绑定 | 如何在 Cursor / Claude / Grok 等落地 | 角色职责本身 |
18
18