create-yss-spec 3.5.6 → 3.5.9

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 (578) hide show
  1. package/bin/create-yss-spec.js +3 -1
  2. package/cli-core.lock.json +10 -6
  3. package/package.json +4 -1
  4. package/src/api/_sync-service.js +3 -1
  5. package/src/command-runner.mjs +44 -9
  6. package/src/commands/doctor.js +40 -0
  7. package/src/commands/skills.js +7 -2
  8. package/src/content-identity.js +111 -0
  9. package/src/runtime-store.mjs +650 -0
  10. package/src/template/asset-runtime.js +124 -22
  11. package/src/template/instance-runtime.js +23 -7
  12. package/src/validation/metadata.js +8 -0
  13. package/template/.agents/skills/.strategic-design-skills-manifest.json +3 -3
  14. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +30 -36
  15. package/template/.agents/skills/archify/SKILL.md +2 -2
  16. package/template/.agents/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  17. package/template/.agents/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  18. package/template/.agents/skills/code-review/SKILL.md +19 -11
  19. package/template/.agents/skills/code-review/references/candidate-capture.md +1 -1
  20. package/template/.agents/skills/code-review/references/legacy-convergence.md +3 -1
  21. package/template/.agents/skills/code-review/references/review-axis-checklists.md +2 -0
  22. package/template/.agents/skills/code-review/references/yss-review-standards.md +4 -2
  23. package/template/.agents/skills/competitive-intelligence/SKILL.md +32 -74
  24. package/template/.agents/skills/file-export-download/SKILL.md +4 -73
  25. package/template/.agents/skills/file-export-download/references/binary-contract-example.md +26 -0
  26. package/template/.agents/skills/file-export-download/references/download-call-example.md +45 -0
  27. package/template/.agents/skills/formily-foundation/SKILL.md +6 -105
  28. package/template/.agents/skills/formily-foundation/references/async-save-example.md +57 -0
  29. package/template/.agents/skills/formily-foundation/references/query-layout.md +50 -0
  30. package/template/.agents/skills/formily-linkage-effects/SKILL.md +3 -116
  31. package/template/.agents/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  32. package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +3 -81
  33. package/template/.agents/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  34. package/template/.agents/skills/formily-step-flow/SKILL.md +3 -143
  35. package/template/.agents/skills/formily-step-flow/references/step-flow-example.md +143 -0
  36. package/template/.agents/skills/handoff/SKILL.md +3 -1
  37. package/template/.agents/skills/i-have-adhd/SKILL.md +2 -2
  38. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  39. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  40. package/template/.agents/skills/implement/SKILL.md +2 -2
  41. package/template/.agents/skills/llm-wiki/references/transactions.md +2 -2
  42. package/template/.agents/skills/llm-wiki/scripts/core.mjs +40 -2
  43. package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +30 -27
  44. package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  45. package/template/.agents/skills/lombok/SKILL.md +2 -0
  46. package/template/.agents/skills/mapstruct/SKILL.md +2 -0
  47. package/template/.agents/skills/tdd/SKILL.md +2 -2
  48. package/template/.agents/skills/theme-token-usage/SKILL.md +6 -5
  49. package/template/.agents/skills/wayfinder/references/chart-map.md +2 -2
  50. package/template/.agents/skills/wayfinder/references/ticket-types.md +1 -1
  51. package/template/.agents/skills/yss-api-integration/SKILL.md +13 -50
  52. package/template/.agents/skills/yss-api-integration/references/orval-list-example.md +38 -0
  53. package/template/.agents/skills/yss-application/SKILL.md +11 -5
  54. package/template/.agents/skills/yss-audit-log/SKILL.md +8 -6
  55. package/template/.agents/skills/yss-audit-log/references/README.md +5 -5
  56. package/template/.agents/skills/yss-cache/SKILL.md +4 -4
  57. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  58. package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  59. package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  60. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  61. package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
  62. package/template/.agents/skills/yss-distributed-id/SKILL.md +4 -4
  63. package/template/.agents/skills/yss-dto/SKILL.md +9 -9
  64. package/template/.agents/skills/yss-dto/references/README.md +4 -4
  65. package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  66. package/template/.agents/skills/yss-excel-mvc/SKILL.md +4 -4
  67. package/template/.agents/skills/yss-exception/SKILL.md +42 -48
  68. package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +26 -170
  69. package/template/.agents/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  70. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  71. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  72. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  73. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  74. package/template/.agents/skills/yss-mybatis/SKILL.md +4 -4
  75. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +6 -4
  76. package/template/.agents/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  77. package/template/.agents/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  78. package/template/.agents/skills/yss-openapi-governance/SKILL.md +5 -7
  79. package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +2 -0
  80. package/template/.agents/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  81. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +32 -26
  82. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  83. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  84. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  85. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  86. package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  87. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -1
  88. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  89. package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
  90. package/template/.agents/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  91. package/template/.agents/skills/yss-repository/SKILL.md +2 -2
  92. package/template/.agents/skills/yss-research/SKILL.md +39 -48
  93. package/template/.agents/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  94. package/template/.agents/skills/yss-research/references/competitive-analysis.md +76 -0
  95. package/template/.agents/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  96. package/template/.agents/skills/yss-research/references/evidence-contract.md +8 -0
  97. package/template/.agents/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  98. package/template/.agents/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  99. package/template/.agents/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  100. package/template/.agents/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  101. package/template/.agents/skills/yss-resilience4j/SKILL.md +25 -31
  102. package/template/.agents/skills/yss-security-algorithm/SKILL.md +37 -43
  103. package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  104. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  105. package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -5
  106. package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  107. package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  108. package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  109. package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -1
  110. package/template/.agents/skills/yss-tactical-design/references/output-template.md +3 -3
  111. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  112. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -5
  113. package/template/.agents/skills/yss-ui/SKILL.md +7 -1
  114. package/template/.agents/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  115. package/template/.agents/skills/yss-ui/references/checklist.md +38 -96
  116. package/template/.agents/skills/yss-ui/references/component-routing.md +3 -1
  117. package/template/.agents/skills/yss-ui/references/quick-recipes.md +17 -272
  118. package/template/.agents/skills/yss-ui/references/specialized-components.md +3 -3
  119. package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  120. package/template/.agents/skills/yss-up-springboot3/SKILL.md +19 -21
  121. package/template/.agents/skills/yss-userinfo/SKILL.md +27 -33
  122. package/template/.agents/skills/yss-validation/SKILL.md +26 -32
  123. package/template/.agents/skills/yss-web-controller/SKILL.md +11 -44
  124. package/template/.agents/skills/yss-web-controller/references/crud-generation.md +38 -0
  125. package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
  126. package/template/.agents/skills/ytree-usage/SKILL.md +2 -80
  127. package/template/.agents/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  128. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +30 -36
  129. package/template/.codex/skills/archify/SKILL.md +2 -2
  130. package/template/.codex/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  131. package/template/.codex/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  132. package/template/.codex/skills/code-review/SKILL.md +19 -11
  133. package/template/.codex/skills/code-review/references/candidate-capture.md +1 -1
  134. package/template/.codex/skills/code-review/references/legacy-convergence.md +3 -1
  135. package/template/.codex/skills/code-review/references/review-axis-checklists.md +2 -0
  136. package/template/.codex/skills/code-review/references/yss-review-standards.md +4 -2
  137. package/template/.codex/skills/competitive-intelligence/SKILL.md +32 -74
  138. package/template/.codex/skills/file-export-download/SKILL.md +4 -73
  139. package/template/.codex/skills/file-export-download/references/binary-contract-example.md +26 -0
  140. package/template/.codex/skills/file-export-download/references/download-call-example.md +45 -0
  141. package/template/.codex/skills/formily-foundation/SKILL.md +6 -105
  142. package/template/.codex/skills/formily-foundation/references/async-save-example.md +57 -0
  143. package/template/.codex/skills/formily-foundation/references/query-layout.md +50 -0
  144. package/template/.codex/skills/formily-linkage-effects/SKILL.md +3 -116
  145. package/template/.codex/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  146. package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +3 -81
  147. package/template/.codex/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  148. package/template/.codex/skills/formily-step-flow/SKILL.md +3 -143
  149. package/template/.codex/skills/formily-step-flow/references/step-flow-example.md +143 -0
  150. package/template/.codex/skills/handoff/SKILL.md +3 -1
  151. package/template/.codex/skills/i-have-adhd/SKILL.md +2 -2
  152. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  153. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  154. package/template/.codex/skills/implement/SKILL.md +2 -2
  155. package/template/.codex/skills/llm-wiki/references/transactions.md +2 -2
  156. package/template/.codex/skills/llm-wiki/scripts/core.mjs +40 -2
  157. package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +30 -27
  158. package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  159. package/template/.codex/skills/lombok/SKILL.md +2 -0
  160. package/template/.codex/skills/mapstruct/SKILL.md +2 -0
  161. package/template/.codex/skills/product-design/references/communication-protocol.md +3 -3
  162. package/template/.codex/skills/product-design/references/critical-overrides.md +4 -5
  163. package/template/.codex/skills/product-design/skills/audit/SKILL.md +2 -4
  164. package/template/.codex/skills/product-design/skills/get-context/SKILL.md +6 -8
  165. package/template/.codex/skills/product-design/skills/ideate/SKILL.md +3 -3
  166. package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +3 -5
  167. package/template/.codex/skills/product-design/skills/index/SKILL.md +1 -1
  168. package/template/.codex/skills/product-design/skills/prototype/SKILL.md +2 -4
  169. package/template/.codex/skills/product-design/skills/research/SKILL.md +4 -6
  170. package/template/.codex/skills/product-design/skills/research/assets/research-brief-template.md +3 -3
  171. package/template/.codex/skills/product-design/skills/share/SKILL.md +2 -4
  172. package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +2 -4
  173. package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
  174. package/template/.codex/skills/tdd/SKILL.md +2 -2
  175. package/template/.codex/skills/theme-token-usage/SKILL.md +6 -5
  176. package/template/.codex/skills/wayfinder/references/chart-map.md +2 -2
  177. package/template/.codex/skills/wayfinder/references/ticket-types.md +1 -1
  178. package/template/.codex/skills/yss-api-integration/SKILL.md +13 -50
  179. package/template/.codex/skills/yss-api-integration/references/orval-list-example.md +38 -0
  180. package/template/.codex/skills/yss-application/SKILL.md +11 -5
  181. package/template/.codex/skills/yss-audit-log/SKILL.md +8 -6
  182. package/template/.codex/skills/yss-audit-log/references/README.md +5 -5
  183. package/template/.codex/skills/yss-cache/SKILL.md +4 -4
  184. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  185. package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  186. package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  187. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  188. package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
  189. package/template/.codex/skills/yss-distributed-id/SKILL.md +4 -4
  190. package/template/.codex/skills/yss-dto/SKILL.md +9 -9
  191. package/template/.codex/skills/yss-dto/references/README.md +4 -4
  192. package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  193. package/template/.codex/skills/yss-excel-mvc/SKILL.md +4 -4
  194. package/template/.codex/skills/yss-exception/SKILL.md +42 -48
  195. package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +26 -170
  196. package/template/.codex/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  197. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  198. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  199. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  200. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  201. package/template/.codex/skills/yss-mybatis/SKILL.md +4 -4
  202. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +6 -4
  203. package/template/.codex/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  204. package/template/.codex/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  205. package/template/.codex/skills/yss-openapi-governance/SKILL.md +5 -7
  206. package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +2 -0
  207. package/template/.codex/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  208. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +32 -26
  209. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  210. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  211. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  212. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  213. package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  214. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -1
  215. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  216. package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
  217. package/template/.codex/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  218. package/template/.codex/skills/yss-repository/SKILL.md +2 -2
  219. package/template/.codex/skills/yss-research/SKILL.md +39 -48
  220. package/template/.codex/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  221. package/template/.codex/skills/yss-research/references/competitive-analysis.md +76 -0
  222. package/template/.codex/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  223. package/template/.codex/skills/yss-research/references/evidence-contract.md +8 -0
  224. package/template/.codex/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  225. package/template/.codex/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  226. package/template/.codex/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  227. package/template/.codex/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  228. package/template/.codex/skills/yss-resilience4j/SKILL.md +25 -31
  229. package/template/.codex/skills/yss-security-algorithm/SKILL.md +37 -43
  230. package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  231. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  232. package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -5
  233. package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  234. package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  235. package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  236. package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -1
  237. package/template/.codex/skills/yss-tactical-design/references/output-template.md +3 -3
  238. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  239. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -5
  240. package/template/.codex/skills/yss-ui/SKILL.md +7 -1
  241. package/template/.codex/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  242. package/template/.codex/skills/yss-ui/references/checklist.md +38 -96
  243. package/template/.codex/skills/yss-ui/references/component-routing.md +3 -1
  244. package/template/.codex/skills/yss-ui/references/quick-recipes.md +17 -272
  245. package/template/.codex/skills/yss-ui/references/specialized-components.md +3 -3
  246. package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  247. package/template/.codex/skills/yss-up-springboot3/SKILL.md +19 -21
  248. package/template/.codex/skills/yss-userinfo/SKILL.md +27 -33
  249. package/template/.codex/skills/yss-validation/SKILL.md +26 -32
  250. package/template/.codex/skills/yss-web-controller/SKILL.md +11 -44
  251. package/template/.codex/skills/yss-web-controller/references/crud-generation.md +38 -0
  252. package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
  253. package/template/.codex/skills/ytree-usage/SKILL.md +2 -80
  254. package/template/.codex/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  255. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +30 -36
  256. package/template/.cursor/skills/archify/SKILL.md +2 -2
  257. package/template/.cursor/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  258. package/template/.cursor/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  259. package/template/.cursor/skills/code-review/SKILL.md +19 -11
  260. package/template/.cursor/skills/code-review/references/candidate-capture.md +1 -1
  261. package/template/.cursor/skills/code-review/references/legacy-convergence.md +3 -1
  262. package/template/.cursor/skills/code-review/references/review-axis-checklists.md +2 -0
  263. package/template/.cursor/skills/code-review/references/yss-review-standards.md +4 -2
  264. package/template/.cursor/skills/competitive-intelligence/SKILL.md +32 -74
  265. package/template/.cursor/skills/file-export-download/SKILL.md +4 -73
  266. package/template/.cursor/skills/file-export-download/references/binary-contract-example.md +26 -0
  267. package/template/.cursor/skills/file-export-download/references/download-call-example.md +45 -0
  268. package/template/.cursor/skills/formily-foundation/SKILL.md +6 -105
  269. package/template/.cursor/skills/formily-foundation/references/async-save-example.md +57 -0
  270. package/template/.cursor/skills/formily-foundation/references/query-layout.md +50 -0
  271. package/template/.cursor/skills/formily-linkage-effects/SKILL.md +3 -116
  272. package/template/.cursor/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  273. package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +3 -81
  274. package/template/.cursor/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  275. package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -143
  276. package/template/.cursor/skills/formily-step-flow/references/step-flow-example.md +143 -0
  277. package/template/.cursor/skills/handoff/SKILL.md +3 -1
  278. package/template/.cursor/skills/i-have-adhd/SKILL.md +2 -2
  279. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  280. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  281. package/template/.cursor/skills/implement/SKILL.md +2 -2
  282. package/template/.cursor/skills/llm-wiki/references/transactions.md +2 -2
  283. package/template/.cursor/skills/llm-wiki/scripts/core.mjs +40 -2
  284. package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +30 -27
  285. package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  286. package/template/.cursor/skills/lombok/SKILL.md +2 -0
  287. package/template/.cursor/skills/mapstruct/SKILL.md +2 -0
  288. package/template/.cursor/skills/tdd/SKILL.md +2 -2
  289. package/template/.cursor/skills/theme-token-usage/SKILL.md +6 -5
  290. package/template/.cursor/skills/wayfinder/references/chart-map.md +2 -2
  291. package/template/.cursor/skills/wayfinder/references/ticket-types.md +1 -1
  292. package/template/.cursor/skills/yss-api-integration/SKILL.md +13 -50
  293. package/template/.cursor/skills/yss-api-integration/references/orval-list-example.md +38 -0
  294. package/template/.cursor/skills/yss-application/SKILL.md +11 -5
  295. package/template/.cursor/skills/yss-audit-log/SKILL.md +8 -6
  296. package/template/.cursor/skills/yss-audit-log/references/README.md +5 -5
  297. package/template/.cursor/skills/yss-cache/SKILL.md +4 -4
  298. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  299. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  300. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  301. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  302. package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
  303. package/template/.cursor/skills/yss-distributed-id/SKILL.md +4 -4
  304. package/template/.cursor/skills/yss-dto/SKILL.md +9 -9
  305. package/template/.cursor/skills/yss-dto/references/README.md +4 -4
  306. package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  307. package/template/.cursor/skills/yss-excel-mvc/SKILL.md +4 -4
  308. package/template/.cursor/skills/yss-exception/SKILL.md +42 -48
  309. package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +26 -170
  310. package/template/.cursor/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  311. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  312. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  313. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  314. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  315. package/template/.cursor/skills/yss-mybatis/SKILL.md +4 -4
  316. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +6 -4
  317. package/template/.cursor/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  318. package/template/.cursor/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  319. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +5 -7
  320. package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +2 -0
  321. package/template/.cursor/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  322. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +32 -26
  323. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  324. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  325. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  326. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  327. package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  328. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -1
  329. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  330. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
  331. package/template/.cursor/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  332. package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
  333. package/template/.cursor/skills/yss-research/SKILL.md +39 -48
  334. package/template/.cursor/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  335. package/template/.cursor/skills/yss-research/references/competitive-analysis.md +76 -0
  336. package/template/.cursor/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  337. package/template/.cursor/skills/yss-research/references/evidence-contract.md +8 -0
  338. package/template/.cursor/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  339. package/template/.cursor/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  340. package/template/.cursor/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  341. package/template/.cursor/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  342. package/template/.cursor/skills/yss-resilience4j/SKILL.md +25 -31
  343. package/template/.cursor/skills/yss-security-algorithm/SKILL.md +37 -43
  344. package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  345. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  346. package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -5
  347. package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  348. package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  349. package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  350. package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -1
  351. package/template/.cursor/skills/yss-tactical-design/references/output-template.md +3 -3
  352. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  353. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -5
  354. package/template/.cursor/skills/yss-ui/SKILL.md +7 -1
  355. package/template/.cursor/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  356. package/template/.cursor/skills/yss-ui/references/checklist.md +38 -96
  357. package/template/.cursor/skills/yss-ui/references/component-routing.md +3 -1
  358. package/template/.cursor/skills/yss-ui/references/quick-recipes.md +17 -272
  359. package/template/.cursor/skills/yss-ui/references/specialized-components.md +3 -3
  360. package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  361. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +19 -21
  362. package/template/.cursor/skills/yss-userinfo/SKILL.md +27 -33
  363. package/template/.cursor/skills/yss-validation/SKILL.md +26 -32
  364. package/template/.cursor/skills/yss-web-controller/SKILL.md +11 -44
  365. package/template/.cursor/skills/yss-web-controller/references/crud-generation.md +38 -0
  366. package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
  367. package/template/.cursor/skills/ytree-usage/SKILL.md +2 -80
  368. package/template/.cursor/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  369. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +30 -36
  370. package/template/.pi/skills/archify/SKILL.md +2 -2
  371. package/template/.pi/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  372. package/template/.pi/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  373. package/template/.pi/skills/code-review/SKILL.md +19 -11
  374. package/template/.pi/skills/code-review/references/candidate-capture.md +1 -1
  375. package/template/.pi/skills/code-review/references/legacy-convergence.md +3 -1
  376. package/template/.pi/skills/code-review/references/review-axis-checklists.md +2 -0
  377. package/template/.pi/skills/code-review/references/yss-review-standards.md +4 -2
  378. package/template/.pi/skills/competitive-intelligence/SKILL.md +32 -74
  379. package/template/.pi/skills/file-export-download/SKILL.md +4 -73
  380. package/template/.pi/skills/file-export-download/references/binary-contract-example.md +26 -0
  381. package/template/.pi/skills/file-export-download/references/download-call-example.md +45 -0
  382. package/template/.pi/skills/formily-foundation/SKILL.md +6 -105
  383. package/template/.pi/skills/formily-foundation/references/async-save-example.md +57 -0
  384. package/template/.pi/skills/formily-foundation/references/query-layout.md +50 -0
  385. package/template/.pi/skills/formily-linkage-effects/SKILL.md +3 -116
  386. package/template/.pi/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  387. package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +3 -81
  388. package/template/.pi/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  389. package/template/.pi/skills/formily-step-flow/SKILL.md +3 -143
  390. package/template/.pi/skills/formily-step-flow/references/step-flow-example.md +143 -0
  391. package/template/.pi/skills/handoff/SKILL.md +3 -1
  392. package/template/.pi/skills/i-have-adhd/SKILL.md +2 -2
  393. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  394. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  395. package/template/.pi/skills/implement/SKILL.md +2 -2
  396. package/template/.pi/skills/llm-wiki/references/transactions.md +2 -2
  397. package/template/.pi/skills/llm-wiki/scripts/core.mjs +40 -2
  398. package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +30 -27
  399. package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  400. package/template/.pi/skills/lombok/SKILL.md +2 -0
  401. package/template/.pi/skills/mapstruct/SKILL.md +2 -0
  402. package/template/.pi/skills/tdd/SKILL.md +2 -2
  403. package/template/.pi/skills/theme-token-usage/SKILL.md +6 -5
  404. package/template/.pi/skills/wayfinder/references/chart-map.md +2 -2
  405. package/template/.pi/skills/wayfinder/references/ticket-types.md +1 -1
  406. package/template/.pi/skills/yss-api-integration/SKILL.md +13 -50
  407. package/template/.pi/skills/yss-api-integration/references/orval-list-example.md +38 -0
  408. package/template/.pi/skills/yss-application/SKILL.md +11 -5
  409. package/template/.pi/skills/yss-audit-log/SKILL.md +8 -6
  410. package/template/.pi/skills/yss-audit-log/references/README.md +5 -5
  411. package/template/.pi/skills/yss-cache/SKILL.md +4 -4
  412. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  413. package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  414. package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  415. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  416. package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
  417. package/template/.pi/skills/yss-distributed-id/SKILL.md +4 -4
  418. package/template/.pi/skills/yss-dto/SKILL.md +9 -9
  419. package/template/.pi/skills/yss-dto/references/README.md +4 -4
  420. package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  421. package/template/.pi/skills/yss-excel-mvc/SKILL.md +4 -4
  422. package/template/.pi/skills/yss-exception/SKILL.md +42 -48
  423. package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +26 -170
  424. package/template/.pi/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  425. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  426. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
  427. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  428. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  429. package/template/.pi/skills/yss-mybatis/SKILL.md +4 -4
  430. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +6 -4
  431. package/template/.pi/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  432. package/template/.pi/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  433. package/template/.pi/skills/yss-openapi-governance/SKILL.md +5 -7
  434. package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +2 -0
  435. package/template/.pi/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  436. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +32 -26
  437. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  438. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
  439. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
  440. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +38 -13
  441. package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
  442. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -1
  443. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  444. package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
  445. package/template/.pi/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
  446. package/template/.pi/skills/yss-repository/SKILL.md +2 -2
  447. package/template/.pi/skills/yss-research/SKILL.md +39 -48
  448. package/template/.pi/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  449. package/template/.pi/skills/yss-research/references/competitive-analysis.md +76 -0
  450. package/template/.pi/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  451. package/template/.pi/skills/yss-research/references/evidence-contract.md +8 -0
  452. package/template/.pi/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  453. package/template/.pi/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  454. package/template/.pi/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  455. package/template/.pi/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  456. package/template/.pi/skills/yss-resilience4j/SKILL.md +25 -31
  457. package/template/.pi/skills/yss-security-algorithm/SKILL.md +37 -43
  458. package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  459. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  460. package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -5
  461. package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
  462. package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
  463. package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
  464. package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -1
  465. package/template/.pi/skills/yss-tactical-design/references/output-template.md +3 -3
  466. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  467. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -5
  468. package/template/.pi/skills/yss-ui/SKILL.md +7 -1
  469. package/template/.pi/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  470. package/template/.pi/skills/yss-ui/references/checklist.md +38 -96
  471. package/template/.pi/skills/yss-ui/references/component-routing.md +3 -1
  472. package/template/.pi/skills/yss-ui/references/quick-recipes.md +17 -272
  473. package/template/.pi/skills/yss-ui/references/specialized-components.md +3 -3
  474. package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  475. package/template/.pi/skills/yss-up-springboot3/SKILL.md +19 -21
  476. package/template/.pi/skills/yss-userinfo/SKILL.md +27 -33
  477. package/template/.pi/skills/yss-validation/SKILL.md +26 -32
  478. package/template/.pi/skills/yss-web-controller/SKILL.md +11 -44
  479. package/template/.pi/skills/yss-web-controller/references/crud-generation.md +38 -0
  480. package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
  481. package/template/.pi/skills/ytree-usage/SKILL.md +2 -80
  482. package/template/.pi/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  483. package/template/.template-spec/agents/backend-architecture-profiles.md +1 -1
  484. package/template/.template-spec/agents/digital-human-roles.md +5 -1
  485. package/template/.template-spec/agents/digital-human-roles.yaml +49 -1
  486. package/template/.template-spec/engineering/backend-platforms.json +1 -1
  487. package/template/.template-spec/plan/entry-review.md +2 -1
  488. package/template/.template-spec/plan/templates/competitive-analysis-template.md +38 -36
  489. package/template/.template-spec/plan/templates/competitive-matrix-template.md +37 -17
  490. package/template/.template-spec/plan/templates/plan-template.md +11 -5
  491. package/template/.template-spec/process/document-writing.md +22 -3
  492. package/template/.template-spec/process/harness-process-tailoring.md +5 -1
  493. package/template/.template-spec/process/implementation-repo-integration.md +26 -8
  494. package/template/.template-spec/process/research-completion.md +2 -0
  495. package/template/.template-spec/process/runtime-storage.md +78 -0
  496. package/template/.template-spec/process/schemas/approval-context.schema.json +67 -0
  497. package/template/.template-spec/process/schemas/approval-record.schema.json +179 -16
  498. package/template/.template-spec/process/schemas/backend-delivery.schema.json +16 -0
  499. package/template/.template-spec/process/schemas/delivery-preflight-input.schema.json +4 -0
  500. package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +236 -1
  501. package/template/.template-spec/process/schemas/implementation-repository-preparation-result.schema.json +335 -52
  502. package/template/.template-spec/process/schemas/lifecycle-checkpoint.schema.json +11 -0
  503. package/template/.template-spec/process/schemas/project-scaffold-contract.schema.json +3 -0
  504. package/template/.template-spec/process/schemas/review-bundle.schema.json +347 -35
  505. package/template/.template-spec/process/schemas/strategic-design-handoff-v3.schema.json +504 -0
  506. package/template/.template-spec/process/schemas/strategic-design-handoff-v4.schema.json +544 -8
  507. package/template/.template-spec/process/schemas/strategic-design-handoff-v5.schema.json +616 -0
  508. package/template/.template-spec/process/schemas/strategic-design-handoff.schema.json +616 -0
  509. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +712 -109
  510. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json +595 -90
  511. package/template/.template-spec/process/schemas/strategic-handoff-export-v2.schema.json +448 -0
  512. package/template/.template-spec/process/schemas/strategic-handoff-export.schema.json +392 -0
  513. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +556 -83
  514. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json +418 -57
  515. package/template/.template-spec/process/script-execution.md +37 -0
  516. package/template/.template-spec/process/subagent-collaboration.md +7 -1
  517. package/template/.template-spec/templates/approval-record-template.json +7 -3
  518. package/template/.template-spec/templates/approval-record-template.yaml +8 -2
  519. package/template/.template-spec/templates/examples/lifecycle-writing-examples.md +92 -2
  520. package/template/.template-spec/templates/retro-report-template.md +10 -3
  521. package/template/.template-spec/templates/review-bundle-template.yaml +19 -10
  522. package/template/.template-spec/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +2 -0
  523. package/template/AGENTS.md +4 -3
  524. package/template/CONTEXT.md +2 -2
  525. package/template/README.md +2 -2
  526. package/template/scripts/advance-maintenance-iteration +51 -0
  527. package/template/scripts/lib/approval-checkpoint-discovery.mjs +26 -0
  528. package/template/scripts/lib/approval-consumption.mjs +35 -0
  529. package/template/scripts/lib/approval-current.mjs +111 -0
  530. package/template/scripts/lib/approval-record-io.mjs +56 -0
  531. package/template/scripts/lib/approval-record.mjs +79 -184
  532. package/template/scripts/lib/approved-execution-context.mjs +8 -6
  533. package/template/scripts/lib/asset-transactions.mjs +5 -1
  534. package/template/scripts/lib/backend-delivery.mjs +1 -1
  535. package/template/scripts/lib/backend-review.mjs +2 -1
  536. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +3 -2
  537. package/template/scripts/lib/business-ticket-lifecycle.mjs +2 -1
  538. package/template/scripts/lib/checkpoint-commit.mjs +50 -0
  539. package/template/scripts/lib/command-runner.mjs +44 -9
  540. package/template/scripts/lib/content-identity.mjs +273 -0
  541. package/template/scripts/lib/delivery-preflight.mjs +2 -1
  542. package/template/scripts/lib/digital-human-roles.mjs +12 -5
  543. package/template/scripts/lib/drift-report.mjs +110 -0
  544. package/template/scripts/lib/existing-backend-architecture.mjs +4 -1
  545. package/template/scripts/lib/lifecycle-context-query.mjs +172 -11
  546. package/template/scripts/lib/lifecycle-controls.mjs +9 -19
  547. package/template/scripts/lib/lifecycle-presentation.mjs +5 -0
  548. package/template/scripts/lib/lifecycle-status.mjs +63 -12
  549. package/template/scripts/lib/lifecycle-transition.mjs +2 -1
  550. package/template/scripts/lib/maintenance-candidate.mjs +24 -30
  551. package/template/scripts/lib/maintenance-research.mjs +52 -8
  552. package/template/scripts/lib/maintenance-storage.mjs +81 -0
  553. package/template/scripts/lib/plan-spec-entry.mjs +2 -1
  554. package/template/scripts/lib/project-governance.mjs +2 -1
  555. package/template/scripts/lib/read-only-intake.mjs +44 -9
  556. package/template/scripts/lib/review-capabilities.mjs +234 -0
  557. package/template/scripts/lib/review-package.mjs +100 -0
  558. package/template/scripts/lib/runtime-store.mjs +650 -0
  559. package/template/scripts/lib/skill-registry.mjs +4 -4
  560. package/template/scripts/lib/strategic-handoff.mjs +22 -9
  561. package/template/scripts/lib/task-package.mjs +47 -16
  562. package/template/scripts/lifecycle-status +26 -1
  563. package/template/scripts/maintenance-path +11 -0
  564. package/template/scripts/prepare-review-package +8 -0
  565. package/template/scripts/project-ci +13 -3
  566. package/template/scripts/query-lifecycle-context +8 -1
  567. package/template/scripts/run-read-only-intake +2 -2
  568. package/template/scripts/runtime-store +40 -0
  569. package/template/scripts/verify-approval-record +21 -13
  570. package/template/scripts/verify-lifecycle-checkpoint +7 -3
  571. package/template/scripts/verify-project-instance +21 -1
  572. package/template/skills-lock.json +64 -63
  573. package/template.snapshot.json +4 -4
  574. package/vendor/cli-core/cli.mjs +2 -0
  575. package/vendor/cli-core/command-runner.mjs +44 -9
  576. package/vendor/cli-core/package.json +1 -1
  577. package/vendor/cli-core/runtime-store.mjs +650 -0
  578. package/vendor/cli-core/scaffold.mjs +4 -2
@@ -0,0 +1,143 @@
1
+ ## 标准代码骨架
2
+
3
+ ```vue
4
+ <script setup lang="ts">
5
+ import { YButton, YFormily, type ISchema } from '@yss-ui/components';
6
+ import { Steps as ASteps } from 'ant-design-vue';
7
+ import { computed, reactive, ref } from 'vue';
8
+
9
+ /** YFormily 对外提交能力。 */
10
+ interface YssFormilyExpose {
11
+ submit: () => Promise<Record<string, any>>;
12
+ }
13
+
14
+ /** 分步表单数据。 */
15
+ interface StepFormData {
16
+ step1: { name: string };
17
+ step2: { level: string };
18
+ }
19
+
20
+ /** 分步表单提交回调 Props。 */
21
+ interface StepFlowProps {
22
+ onSubmit: (values: StepFormData) => Promise<void>;
23
+ }
24
+
25
+ /** 分步表单提交回调。 */
26
+ const props = defineProps<StepFlowProps>();
27
+ /** 当前步骤,从 0 开始。 */
28
+ const currentStep = ref(0);
29
+ /** 最终提交状态。 */
30
+ const submitting = ref(false);
31
+ /** 第一步表单实例。 */
32
+ const step1Ref = ref<YssFormilyExpose>();
33
+ /** 第二步表单实例。 */
34
+ const step2Ref = ref<YssFormilyExpose>();
35
+ /** 步骤导航配置。 */
36
+ const stepItems = [{ title: '基础信息' }, { title: '策略配置' }, { title: '确认提交' }];
37
+ /** 跨步唯一数据源。 */
38
+ const formData = reactive<StepFormData>({
39
+ step1: { name: '' },
40
+ step2: { level: 'normal' },
41
+ });
42
+
43
+ /** 创建符合业务三层布局约定的步骤 Schema。 */
44
+ const createStepSchema = (properties: Record<string, ISchema>): ISchema => ({
45
+ type: 'object',
46
+ properties: {
47
+ layout: {
48
+ type: 'void',
49
+ 'x-component': 'FormLayout',
50
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
51
+ properties: {
52
+ grid: {
53
+ type: 'void',
54
+ 'x-component': 'FormGrid',
55
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
56
+ properties,
57
+ },
58
+ },
59
+ },
60
+ },
61
+ });
62
+
63
+ /** 第一步 Schema。 */
64
+ const step1Schema = createStepSchema({
65
+ name: {
66
+ type: 'string',
67
+ title: '任务名称',
68
+ required: true,
69
+ 'x-validator': [{ required: true, whitespace: true, message: '请输入任务名称' }],
70
+ 'x-decorator': 'FormItem',
71
+ 'x-component': 'Input',
72
+ },
73
+ });
74
+ /** 第二步 Schema。 */
75
+ const step2Schema = createStepSchema({
76
+ level: {
77
+ type: 'string',
78
+ title: '策略等级',
79
+ required: true,
80
+ enum: [
81
+ { label: '普通', value: 'normal' },
82
+ { label: '严格', value: 'strict' },
83
+ ],
84
+ 'x-decorator': 'FormItem',
85
+ 'x-component': 'Select',
86
+ },
87
+ });
88
+ /** 确认步骤 Schema。 */
89
+ const confirmSchema = createStepSchema({
90
+ name: { type: 'string', title: '任务名称', 'x-decorator': 'FormItem', 'x-component': 'Input' },
91
+ level: { type: 'string', title: '策略等级', 'x-decorator': 'FormItem', 'x-component': 'Input' },
92
+ });
93
+ /** 确认步骤展示数据。 */
94
+ const confirmValues = computed(() => ({ name: formData.step1.name, level: formData.step2.level }));
95
+
96
+ /** 校验当前步骤,成功后前进。 */
97
+ const next = async () => {
98
+ const currentRef = currentStep.value === 0 ? step1Ref.value : step2Ref.value;
99
+ if (!currentRef) return;
100
+ try {
101
+ await currentRef.submit();
102
+ currentStep.value += 1;
103
+ } catch {
104
+ return;
105
+ }
106
+ };
107
+
108
+ /** 返回上一步。 */
109
+ const back = () => {
110
+ currentStep.value = Math.max(0, currentStep.value - 1);
111
+ };
112
+
113
+ /** 提交全部步骤数据。 */
114
+ const submitAll = async () => {
115
+ submitting.value = true;
116
+ try {
117
+ await props.onSubmit({ step1: { ...formData.step1 }, step2: { ...formData.step2 } });
118
+ } finally {
119
+ submitting.value = false;
120
+ }
121
+ };
122
+ </script>
123
+
124
+ <template>
125
+ <ASteps :current="currentStep" :items="stepItems" />
126
+
127
+ <YFormily v-if="currentStep === 0" ref="step1Ref" v-model="formData.step1" :schema="step1Schema" />
128
+ <YFormily v-else-if="currentStep === 1" ref="step2Ref" v-model="formData.step2" :schema="step2Schema" />
129
+ <YFormily
130
+ v-else
131
+ :schema="confirmSchema"
132
+ :initial-values="confirmValues"
133
+ :mode="2"
134
+ :detail-options="{ bordered: true, maxColumns: 2, minColumns: 1, minWidth: 320 }"
135
+ />
136
+
137
+ <YButton :disabled="currentStep === 0" @click="back">上一步</YButton>
138
+ <YButton v-if="currentStep < 2" type="primary" @click="next">下一步</YButton>
139
+ <YButton v-else type="primary" :loading="submitting" @click="submitAll">提交</YButton>
140
+ </template>
141
+ ```
142
+
143
+ 当 schema、步骤状态和页面编排难以独立理解或验证时,分别拆到 `constant.ts`、`hooks/useStepFlow.ts`;以职责清晰和状态可测试为准,不按固定行数拆分。
@@ -5,7 +5,9 @@ argument-hint: "What will the next session be used for?"
5
5
  disable-model-invocation: true
6
6
  ---
7
7
 
8
- Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save to the temporary directory of the user's OS - not the current workspace.
8
+ Write a handoff document so a fresh agent can continue the current objective. Save to the temporary directory of the user's OS, then return its actual absolute path.
9
+
10
+ Record the current objective, completed work, remaining work and blockers, existing authorization scope, and the next executable action. Distinguish verified results from planned or unexecuted checks. Preserve the references and versions needed to resume; a handoff does not grant approval, implementation, commit, push or release authority.
9
11
 
10
12
  Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
11
13
 
@@ -10,13 +10,13 @@ license: MIT
10
10
 
11
11
  ## 触发与作用域
12
12
 
13
- 调用者在当前工作包含研究结论、Plan、Spec、设计说明、契约解释正文、Ticket、审查、交接、发布或复盘时,设置条件 `lifecycle-document-output` 并加载本技能。进度与会签表达也属于文档输出;纯代码修改、命令执行和后续无关会话不激活此条件。
13
+ 调用者在当前工作包含研究结论、Plan、Spec、设计说明、契约解释正文、Ticket、审查、PR / MR 描述、交接、发布或复盘时,设置条件 `lifecycle-document-output` 并加载本技能。进度与会签表达也属于文档输出;纯代码修改、命令执行和后续无关会话不激活此条件。
14
14
 
15
15
  每次调用只覆盖输入指定的文档或报告。工作结束即结束本次作用域;用户后续要求正常表达或不使用本技能时遵从当前要求,不继承先前启用状态。不假设读者具有任何诊断。
16
16
 
17
17
  ## 执行
18
18
 
19
- 1. 接收产物类型、读者、允许改动范围和可读权威输入;先读共用规范,再读取对应阶段指引。字段、版本或规则来源不明确时保留缺口并回交原所有者,不补造业务决定。
19
+ 1. 接收产物类型、读者、允许改动范围和可读权威输入;先读共用规范,再读取对应阶段或 PR / MR 描述指引。字段、版本或规则来源不明确时保留缺口并回交原所有者,不补造业务决定。
20
20
  2. 先写当前问题、结论或交付行为,再提供依据和必要细节;按顺序动作、规则比较和因果说明选择编号、表格或段落。删除无信息的修饰和重复,不设置字数或规则数量上限。
21
21
  3. 对照输入核查主体、条件、例外、量词、范围、数值、证据、未决项、责任、时点和依赖。保持原 API 标识、schema、冻结行为、状态及批准证据;发现冲突时交回所有者,不以润色名义修复事实。
22
22
  4. 返回调整后的正文及必要的缺口说明,由原工作单元执行现有验证。明确区分已验证结果、估算和未知原因;未执行测试不写通过,多项实质阻塞全部保留。已授权工作由原执行者继续,不把可完成的操作转交用户。
@@ -1,8 +1,8 @@
1
1
  # i-have-adhd 的 YSS 适配
2
2
 
3
- 上游:`ayghri/i-have-adhd`;固定 revision:`7b9069b39972e269e61bd95c2f66ebb90cac6a02`;许可证见技能目录 `LICENSE`。
3
+ 上游:`ayghri/i-have-adhd`;固定 revision:`839872f9d1cd634fed642b4589ce7226199cc15f`;许可证见技能目录 `LICENSE`。
4
4
 
5
- 原始文件来自 [固定版本目录](https://github.com/ayghri/i-have-adhd/tree/7b9069b39972e269e61bd95c2f66ebb90cac6a02/skills/i-have-adhd)。未经改写的来源基线保存在模板维护证据中;`upstream-files.json` 记录逐文件 SHA-256,`skills-lock.json` 记录上游目录哈希和当前技能目录哈希。基线不进入实例默认加载面。
5
+ 原始文件来自 [固定版本目录](https://github.com/ayghri/i-have-adhd/tree/839872f9d1cd634fed642b4589ce7226199cc15f/skills/i-have-adhd)。2026-10-03 核验该提交与先前 `7b9069b39972e269e61bd95c2f66ebb90cac6a02` 的技能目录树和三个文件原字节一致;本轮更新来源记录并修复 YSS 消费指引。未经改写的来源基线保存在模板维护证据中;`upstream-files.json` 记录逐文件 SHA-256,`skills-lock.json` 记录上游目录哈希和当前技能目录哈希。基线不进入实例默认加载面。
6
6
 
7
7
  | 上游行为 | YSS 适配 |
8
8
  |---|---|
@@ -15,11 +15,13 @@ assert.ok(registry.invocation_contract.overrides['i-have-adhd'].exclusion_condit
15
15
  assert.ok(registry.invocation_contract.overrides['i-have-adhd'].exclusion_conditions.includes('user-disabled'));
16
16
  const entry=read('.agents/skills/i-have-adhd/SKILL.md');
17
17
  assert.ok(!entry.includes('disable-model-invocation: true'));
18
+ assert.ok(entry.includes('PR / MR 描述'),'PR / MR description remains current document work');
18
19
  assert.equal(parse(read('.agents/skills/i-have-adhd/agents/openai.yaml')).policy.allow_implicit_invocation,true);
19
20
  const lock=JSON.parse(read('skills-lock.json'));
20
21
  const locked=lock.skills.shared['i-have-adhd'];
21
22
  assert.equal(locked.source,'ayghri/i-have-adhd');
22
- assert.equal(locked.sourceRevision,'7b9069b39972e269e61bd95c2f66ebb90cac6a02');
23
+ assert.equal(locked.sourceRevision,'839872f9d1cd634fed642b4589ce7226199cc15f');
24
+ assert.ok(read('.agents/skills/i-have-adhd/references/yss-adaptation.md').includes(locked.sourceRevision),'adaptation provenance follows the locked source revision');
23
25
  assert.notEqual(locked.upstreamHash,locked.effectiveHash);
24
26
  const {treeHash}=await import(pathToFileURL(path.join(root,'scripts/lib/skill-supply-chain.mjs')));
25
27
  assert.equal(treeHash(path.join(root,'.agents/skills/i-have-adhd')),locked.effectiveHash);
@@ -58,6 +60,9 @@ if(fs.existsSync(compiler)) {
58
60
  assert.ok(on.required_skills.includes('i-have-adhd'));
59
61
  assert.ok(!next.required_skills.includes('i-have-adhd'));
60
62
  assert.equal(on.status,'draft');
61
- console.log('PASS: actual resolver excludes code-only, includes document output, does not persist condition or approve the contract.');
63
+ // PR / MR drafting uses the same caller-provided document condition exercised by on/next.
64
+ assert.deepEqual(next.required_skills,off.required_skills);
65
+ assert.equal(next.status,'draft');
66
+ console.log('PASS: actual resolver excludes code-only, includes the caller-provided document condition also used for PR / MR drafts, does not persist that condition or approve the contract. Model classification of PR / MR work is not measured.');
62
67
  } else console.log('N/A: this strategic-only template has no implementation compiler; conditional route verified in registry and orchestration contract.');
63
68
  console.log(`PASS: source, license metadata, ${locked.targets.length} projections, ${callers.length} callers, scope and readable writing inputs. Model output quality not measured.`);
@@ -10,6 +10,6 @@ Use /tdd where possible, at pre-agreed seams.
10
10
 
11
11
  Run typechecking regularly, single test files regularly, and the full test suite once at the end.
12
12
 
13
- Once done, use /code-review to review the work.
13
+ Once implementation and applicable verification are ready, return the candidate and evidence to the lifecycle owner, who dispatches an independent reviewer using /code-review. The implementer fixes reported findings and supplies fresh evidence for the affected conclusions; it does not review its own work or declare acceptance.
14
14
 
15
- Do not commit or push. Implementation authorization does not include git commit/push. Natural language such as "do it and commit" is not structured Git authorization. Stop after review unless a structured Git authorization is already present.
15
+ Git commit and push require separate explicit authorization under the existing user-decision protocol selected by root `AGENTS.md` and the lifecycle owner. The Agent may normalize a real, readable user reply that identifies the Git action and repository/change scope into the required authorization, scope and source-reference fields; do not ask the user to fill internal fields again. Implementation authorization or a generic request to continue does not authorize Git actions, and commit authorization does not authorize push. If the source is unreadable, authorization was revoked or the action exceeds its scope, do not execute that Git action; return the checkpoint judgment for the lifecycle owner.
@@ -30,7 +30,7 @@ node <skill-root>/scripts/transaction.mjs apply --wiki <root> --repo <repo> --pl
30
30
 
31
31
  plan 不写 wiki;返回 sources/articles/protected/conflicts、完整 writes `{path,before,after,content,original}`、inputs 摘要和计划 digest。检查准确范围后应用。source 删除只留 tombstone 与快照,不能删 source 或 article 记录。未被编译的文章保持旧 watermark;更新 raw 不会清除它们的 stale。human-owned 自动正文修改拒绝;已显式授权链接修复时传 `linkRepairs: [articleId]`,脚本严格比较 wikilink 外所有字节,不能夹带正文变更。
32
32
 
33
- apply 先核验全部输入摘要,变化即 PLAN_STALE,必须重新计划。只写计划内文件;内部 `.wiki-staging/<id>/` 保存候选与完成收据,`.wiki-transaction.json` 是恢复记录,`.wiki-lock` 是事务锁,`.wiki-runner-lock` 防止并发恢复。内部文件位于同一 wiki-root,纳入写操作授权;不分发或公开其中的来源原文/备份。共享 index/log/manifest 由主控生成。manifest、日志最后发布;未完成期间查询拒绝读取混合版本。
33
+ apply 先核验全部输入摘要,变化即 PLAN_STALE,必须重新计划。只写计划内文件;内部 `.wiki-staging/<id>/` 保存候选与完成收据,`.wiki-transaction.json` 是恢复记录,`.wiki-lock` 是事务锁,`.wiki-runner-lock` 防止并发恢复。`template-source` 的 journal、staging、锁和备份由项目 `scripts/lib/maintenance-storage.mjs` 解析到仓外 `maintenance:wiki/<wiki-id>/`;其它 wiki 沿用同一 wiki-root。这些内部文件纳入写操作授权;不分发或公开其中的来源原文/备份。共享 index/log/manifest 由主控生成。manifest、日志最后发布;未完成期间查询拒绝读取混合版本。
34
34
 
35
35
  ## 恢复和取消
36
36
 
@@ -41,7 +41,7 @@ node <skill-root>/scripts/transaction.mjs abort --wiki <root> --repo <repo>
41
41
 
42
42
  resume 只补未完成步骤、验证 staging、检查来源是否仍为原计划版本。abort 先检查全部目标,再仅恢复该事务改动;目标被人工修改时停止,绝不覆盖。真实进程崩溃若留下 runner lock,禁止自动抢占:先核实原进程已停止,展示锁和 journal,由用户明确选择清除该残留执行锁后再 resume/abort。事务锁本身由恢复流程管理,不手删以绕过冲突。
43
43
 
44
- 相同计划重放复用完成收据,不重复追加日志。aborted 计划是终态,重新执行用新计划 ID。保留内部 journal/staging/收据用于追溯;本轮不自动清理。最终做结构 lint + status + advise,明确剩余 freshness,结构维护完成不等于所有知识 current。
44
+ 相同计划重放复用完成收据,不重复追加日志。aborted 计划是终态,重新执行用新计划 ID。保留内部 journal/staging/收据用于追溯。模板源仓内 `log.md` 只保存最新运行入口,不追加历史;详细计划、旧日志与原字节保存在仓外事务包中。最终做结构 lint + status + advise,明确剩余 freshness,结构维护完成不等于所有知识 current。
45
45
 
46
46
  ## 人工反馈
47
47
 
@@ -1,6 +1,7 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import { readFile, writeFile, rename, lstat, realpath, mkdir, access } from "node:fs/promises";
3
3
  import path from "node:path";
4
+ import { pathToFileURL } from 'node:url';
4
5
  const STATES = ["current", "stale", "missing", "unverified", "archived"];
5
6
  const INFRA = /* @__PURE__ */ new Set(["index.md", "log.md", "claude.md", "agents.md", "soul.md", "concept-table.md"]);
6
7
  const sha256 = (value) => createHash("sha256").update(value).digest("hex");
@@ -69,6 +70,41 @@ async function safePath(root, ref, { write = false } = {}) {
69
70
  }
70
71
  return target;
71
72
  }
73
+ async function wikiHistoryRoot(wikiRoot) {
74
+ let cursor = path.resolve(wikiRoot);
75
+ while (true) {
76
+ const identity = path.join(cursor, 'yss-project.yaml');
77
+ if (await exists(identity)) {
78
+ const source = await readFile(identity, 'utf8');
79
+ if (!/^repository_mode:\s*template-source\s*$/m.test(source)) return null;
80
+ const helper = path.join(cursor, 'scripts/lib/maintenance-storage.mjs');
81
+ if (!await exists(helper)) fail('MAINTENANCE_STORAGE_MISSING', 'template-source requires its registered maintenance storage helper');
82
+ const { resolveMaintenanceOutput } = await import(pathToFileURL(helper).href);
83
+ return resolveMaintenanceOutput(`maintenance:wiki/${sha256(path.resolve(wikiRoot))}`, { root: cursor });
84
+ }
85
+ const parent = path.dirname(cursor);
86
+ if (parent === cursor) return null;
87
+ cursor = parent;
88
+ }
89
+ }
90
+ async function wikiInternalPath(wikiRoot, ref, options = {}) {
91
+ if (typeof ref === 'string' && /^\.wiki-(?:staging\/|backups\/|transaction\.json$|lock$|runner-lock$)/.test(ref)) {
92
+ // Validate the same relative path contract before resolving an external file.
93
+ if (ref.includes('\\') || ref.split('/').some(part => ['..', '.', ''].includes(part))) fail('PATH_INVALID', ref);
94
+ const historyRoot = await wikiHistoryRoot(wikiRoot);
95
+ if (historyRoot) {
96
+ const target = path.join(historyRoot, ref);
97
+ let cursor = target;
98
+ while (inside(historyRoot, cursor)) {
99
+ if (await exists(cursor) && (await lstat(cursor)).isSymbolicLink()) fail('SYMLINK_WRITE', ref);
100
+ if (cursor === historyRoot) break;
101
+ cursor = path.dirname(cursor);
102
+ }
103
+ return target;
104
+ }
105
+ }
106
+ return safePath(wikiRoot, ref, options);
107
+ }
72
108
  async function atomicWrite(file, content) {
73
109
  await mkdir(path.dirname(file), { recursive: true });
74
110
  const temp = `${file}.${randomUUID()}.tmp`;
@@ -204,8 +240,8 @@ async function loadManifest(wikiRoot, { repoRoot = process.cwd(), validate = tru
204
240
  async function transactionState(wikiRoot, { reader } = {}) {
205
241
  // A writer claims the lock before replacing an earlier finalized journal.
206
242
  // That interval must also block readers.
207
- if (await exists(await safePath(wikiRoot, ".wiki-lock"))) return { state: "locked", incomplete: true };
208
- const file = await safePath(wikiRoot, ".wiki-transaction.json");
243
+ if (await exists(await wikiInternalPath(wikiRoot, ".wiki-lock"))) return { state: "locked", incomplete: true };
244
+ const file = await wikiInternalPath(wikiRoot, ".wiki-transaction.json");
209
245
  if (!await exists(file)) return { state: "none" };
210
246
  const j = JSON.parse(reader ? (await reader(file)).toString() : await readFile(file, "utf8"));
211
247
  return { id: j.id, state: j.phase, incomplete: !["finalized", "aborted"].includes(j.phase) };
@@ -252,6 +288,8 @@ export {
252
288
  frontmatter,
253
289
  json,
254
290
  loadManifest,
291
+ wikiHistoryRoot,
292
+ wikiInternalPath,
255
293
  ownership,
256
294
  safePath,
257
295
  sha256,
@@ -2,7 +2,7 @@
2
2
  import { readFile, writeFile, mkdir, rm, readdir, lstat } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { sha256, json, safePath, atomicWrite, digestFile, exists, loadManifest, validateManifest, checkPaths, ownership, sourceClosure, sourceSection, frontmatter, fail, args, cliError } from "./core.mjs";
5
+ import { sha256, json, wikiInternalPath, wikiHistoryRoot, atomicWrite, digestFile, exists, loadManifest, validateManifest, checkPaths, ownership, sourceClosure, sourceSection, frontmatter, fail, args, cliError } from "./core.mjs";
6
6
  import { observeSource, sameVersion } from "./sources.mjs";
7
7
  import { extractLinks } from "./lint-wikilinks.mjs";
8
8
  const MANIFEST = ".wiki-manifest.json", JOURNAL = ".wiki-transaction.json", LOCK = ".wiki-lock";
@@ -16,7 +16,7 @@ function stripLinks(text) {
16
16
  return text.replace(/\[\[[^\]\n]+\]\]/g, "[[LINK]]");
17
17
  }
18
18
  async function getText(root, ref) {
19
- const file = await safePath(root, ref);
19
+ const file = await wikiInternalPath(root, ref);
20
20
  try {
21
21
  return await readFile(file, "utf8");
22
22
  } catch (e) {
@@ -50,7 +50,7 @@ async function createPlan({ wikiRoot, repoRoot = process.cwd(), request }) {
50
50
  if (proposed.size !== (request.writes || []).length) fail("PLAN_INVALID", "duplicate writes");
51
51
  const inputs = {}, writes = [];
52
52
  const bind = async (kind, root, ref) => {
53
- const p = await safePath(root, ref);
53
+ const p = await wikiInternalPath(root, ref);
54
54
  const digest = await digestFile(p);
55
55
  inputs[`${kind}:${ref}`] = digest;
56
56
  return p;
@@ -82,7 +82,7 @@ async function createPlan({ wikiRoot, repoRoot = process.cwd(), request }) {
82
82
  }
83
83
  for (const s of prior?.sources || []) if (!manifest.sources.some((x) => x.id === s.id)) fail("SOURCE_REMOVAL_FORBIDDEN", `retain tombstone and snapshot: ${s.id}`);
84
84
  for (const [ref, content] of proposed) {
85
- await safePath(wikiRoot, ref, { write: true });
85
+ await wikiInternalPath(wikiRoot, ref, { write: true });
86
86
  if ([MANIFEST, "wiki/log.md", LOCK, JOURNAL].includes(ref) || ref.startsWith(".wiki-staging/")) fail("PLAN_INVALID", `reserved ${ref}`);
87
87
  if (typeof content !== "string") fail("PLAN_INVALID", "deletion or non-text content");
88
88
  const isKnown = manifest.articles.some((a) => a.file === ref) || manifest.sources.some((s) => s.rawPath === ref) || ["wiki/index.md", "wiki/CLAUDE.md", "wiki/AGENTS.md", "wiki/concept-table.md"].includes(ref) || operation === "migrate" && ref.startsWith(".wiki-backups/");
@@ -165,8 +165,8 @@ async function createPlan({ wikiRoot, repoRoot = process.cwd(), request }) {
165
165
  for (const id2 of extractLinks(content).ids) if (!manifest.articles.some((x) => x.id === id2)) fail("WIKILINK_MISSING", id2);
166
166
  if (extractLinks(content).invalid.length) fail("WIKILINK_INVALID", a.id);
167
167
  }
168
- if (await exists(await safePath(wikiRoot, "wiki"))) {
169
- for (const file of await readdir(await safePath(wikiRoot, "wiki"))) if (file.endsWith(".md") && !["index.md", "log.md", "claude.md", "agents.md", "soul.md", "concept-table.md"].includes(file.toLowerCase()) && !manifest.articles.some((a) => a.file === `wiki/${file}`)) fail("UNLISTED_ARTICLE", file);
168
+ if (await exists(await wikiInternalPath(wikiRoot, "wiki"))) {
169
+ for (const file of await readdir(await wikiInternalPath(wikiRoot, "wiki"))) if (file.endsWith(".md") && !["index.md", "log.md", "claude.md", "agents.md", "soul.md", "concept-table.md"].includes(file.toLowerCase()) && !manifest.articles.some((a) => a.file === `wiki/${file}`)) fail("UNLISTED_ARTICLE", file);
170
170
  }
171
171
  const index = proposed.get("wiki/index.md") ?? await getText(wikiRoot, "wiki/index.md");
172
172
  if (index === null) fail("INDEX_MISSING", "wiki/index.md");
@@ -177,14 +177,15 @@ async function createPlan({ wikiRoot, repoRoot = process.cwd(), request }) {
177
177
  proposed.set(MANIFEST, json(manifest));
178
178
  const id = request.id || sha256(JSON.stringify({ operation, inputs, proposed: [...proposed] })).slice(0, 24);
179
179
  if (!/^[a-zA-Z0-9_-]+$/.test(id)) fail("PLAN_INVALID", "id");
180
- const priorLog = await getText(wikiRoot, "wiki/log.md") || "# log\n";
180
+ const historyRoot = await wikiHistoryRoot(wikiRoot);
181
+ const priorLog = historyRoot ? "# Wiki 当前运行\n" : await getText(wikiRoot, "wiki/log.md") || "# log\n";
181
182
  proposed.set("wiki/log.md", `${priorLog.trimEnd()}
182
183
 
183
184
  ## [${(request.at || (/* @__PURE__ */ new Date()).toISOString()).slice(0, 10)}] ${operation.toUpperCase()} | ${id}
184
185
 
185
186
  - Changed articles: ${[...compiled].join(", ") || "none"}
186
187
  - Remaining freshness must be read from status.
187
- `);
188
+ ${historyRoot ? `- 运行材料:maintenance:wiki/${sha256(path.resolve(wikiRoot))}/.wiki-staging/${id}/completed.json\n` : ""}`);
188
189
  for (const [ref, content] of proposed) {
189
190
  const old = await getText(wikiRoot, ref);
190
191
  if (old === content) continue;
@@ -204,28 +205,30 @@ async function verifyInputs(plan, options, { during = false } = {}) {
204
205
  for (const [key, expected] of Object.entries(plan.inputs)) {
205
206
  const colon = key.indexOf(":"), kind = key.slice(0, colon), ref = key.slice(colon + 1);
206
207
  if (!["repo", "wiki"].includes(kind)) fail("PLAN_INVALID", key);
207
- const p = await safePath(kind === "wiki" ? options.wikiRoot : options.repoRoot, ref, { write: kind === "wiki" }), actual = await digestFile(p);
208
+ const p = await wikiInternalPath(kind === "wiki" ? options.wikiRoot : options.repoRoot, ref, { write: kind === "wiki" }), actual = await digestFile(p);
208
209
  const w = kind === "wiki" ? plan.writes.find((w2) => w2.path === ref) : null;
209
210
  if (actual !== expected && !(during && w && actual === w.after)) fail("PLAN_STALE", key);
210
211
  }
211
212
  }
212
213
  async function loadJournal(wikiRoot) {
213
- const j = JSON.parse(await readFile(await safePath(wikiRoot, JOURNAL), "utf8"));
214
+ const j = JSON.parse(await readFile(await wikiInternalPath(wikiRoot, JOURNAL), "utf8"));
214
215
  if (j.schemaVersion !== 1 || !phases.includes(j.phase) || j.id !== j.plan?.id || !Array.isArray(j.applied)) fail("JOURNAL_INVALID", "invalid journal");
215
216
  validatePlan(j.plan);
216
217
  return j;
217
218
  }
218
219
  async function saveJournal(wikiRoot, j) {
219
- await atomicWrite(await safePath(wikiRoot, JOURNAL, { write: true }), json(j));
220
+ await atomicWrite(await wikiInternalPath(wikiRoot, JOURNAL, { write: true }), json(j));
220
221
  }
221
222
  async function assertLock(wikiRoot, id) {
222
- const lock = JSON.parse(await readFile(await safePath(wikiRoot, LOCK), "utf8"));
223
+ const lock = JSON.parse(await readFile(await wikiInternalPath(wikiRoot, LOCK), "utf8"));
223
224
  if (lock.id !== id) fail("LOCK_CONFLICT", "another writer owns the lock");
224
225
  }
225
226
  async function acquire(wikiRoot, id) {
226
227
  await mkdir(wikiRoot, { recursive: true });
227
228
  try {
228
- await writeFile(await safePath(wikiRoot, LOCK, { write: true }), json({ id }), { flag: "wx" });
229
+ const file = await wikiInternalPath(wikiRoot, LOCK, { write: true });
230
+ await mkdir(path.dirname(file), { recursive: true });
231
+ await writeFile(file, json({ id }), { flag: "wx" });
229
232
  } catch (e) {
230
233
  if (e.code === "EEXIST") fail("LOCKED", "explicit resume/abort; never steal a lock");
231
234
  throw e;
@@ -233,15 +236,15 @@ async function acquire(wikiRoot, id) {
233
236
  }
234
237
  async function stage(wikiRoot, plan) {
235
238
  for (const [i, w] of plan.writes.entries()) {
236
- await atomicWrite(await safePath(wikiRoot, `.wiki-staging/${plan.id}/${i}.txt`, { write: true }), w.content);
239
+ await atomicWrite(await wikiInternalPath(wikiRoot, `.wiki-staging/${plan.id}/${i}.txt`, { write: true }), w.content);
237
240
  }
238
241
  }
239
242
  async function install(options, j, w, index) {
240
- const target = await safePath(options.wikiRoot, w.path, { write: true });
243
+ const target = await wikiInternalPath(options.wikiRoot, w.path, { write: true });
241
244
  const actual = await digestFile(target);
242
245
  if (actual !== w.before && actual !== w.after) fail("MANUAL_MODIFICATION", w.path);
243
246
  if (actual !== w.after) {
244
- const content = await readFile(await safePath(options.wikiRoot, `.wiki-staging/${j.id}/${index}.txt`));
247
+ const content = await readFile(await wikiInternalPath(options.wikiRoot, `.wiki-staging/${j.id}/${index}.txt`));
245
248
  if (sha256(content) !== w.after) fail("STAGING_CHANGED", w.path);
246
249
  await atomicWrite(target, content);
247
250
  }
@@ -262,7 +265,7 @@ async function applyPlan({ wikiRoot, repoRoot = process.cwd(), plan, stopAfter }
262
265
  const j2 = await loadJournal(wikiRoot);
263
266
  if (j2.id === plan.id && j2.plan.digest === plan.digest) {
264
267
  if (j2.phase === "finalized") {
265
- for (const w of j2.plan.writes) if (await digestFile(await safePath(wikiRoot, w.path)) !== w.after) fail("MANUAL_MODIFICATION", w.path);
268
+ for (const w of j2.plan.writes) if (await digestFile(await wikiInternalPath(wikiRoot, w.path)) !== w.after) fail("MANUAL_MODIFICATION", w.path);
266
269
  return { id: j2.id, phase: "finalized", replayed: true };
267
270
  }
268
271
  fail("TRANSACTION_INCOMPLETE", "use explicit resume");
@@ -281,16 +284,16 @@ async function resumeInternal({ wikiRoot, repoRoot = process.cwd(), stopAfter })
281
284
  const j = await loadJournal(wikiRoot);
282
285
  const options = { wikiRoot, repoRoot };
283
286
  if (["finalized", "aborted"].includes(j.phase)) {
284
- if (await exists(await safePath(wikiRoot, LOCK))) {
287
+ if (await exists(await wikiInternalPath(wikiRoot, LOCK))) {
285
288
  await assertLock(wikiRoot, j.id);
286
- await rm(await safePath(wikiRoot, LOCK, { write: true }));
289
+ await rm(await wikiInternalPath(wikiRoot, LOCK, { write: true }));
287
290
  }
288
291
  return { id: j.id, phase: j.phase, replayed: true };
289
292
  }
290
293
  await assertLock(wikiRoot, j.id);
291
294
  await verifyInputs(j.plan, options, { during: true });
292
295
  for (const [i, w] of j.plan.writes.entries()) {
293
- const p = await safePath(wikiRoot, `.wiki-staging/${j.id}/${i}.txt`, { write: true });
296
+ const p = await wikiInternalPath(wikiRoot, `.wiki-staging/${j.id}/${i}.txt`, { write: true });
294
297
  if (!await exists(p)) await atomicWrite(p, w.content);
295
298
  }
296
299
  if (j.phase === "prepared") {
@@ -300,7 +303,7 @@ async function resumeInternal({ wikiRoot, repoRoot = process.cwd(), stopAfter })
300
303
  if (stopAfter === "applied") return { id: j.id, phase: j.phase };
301
304
  }
302
305
  if (j.phase === "applied") {
303
- for (const w of j.plan.writes.filter((w2) => ![MANIFEST, "wiki/log.md"].includes(w2.path))) if (await digestFile(await safePath(wikiRoot, w.path)) !== w.after) fail("VERIFY_FAILED", w.path);
306
+ for (const w of j.plan.writes.filter((w2) => ![MANIFEST, "wiki/log.md"].includes(w2.path))) if (await digestFile(await wikiInternalPath(wikiRoot, w.path)) !== w.after) fail("VERIFY_FAILED", w.path);
304
307
  const candidate = j.plan.writes.find((w) => w.path === MANIFEST);
305
308
  if (candidate) {
306
309
  const errors = validateManifest(JSON.parse(candidate.content));
@@ -315,10 +318,10 @@ async function resumeInternal({ wikiRoot, repoRoot = process.cwd(), stopAfter })
315
318
  await install(options, j, w, i);
316
319
  if (stopAfter === w.path) return { id: j.id, phase: j.phase };
317
320
  }
318
- await atomicWrite(await safePath(wikiRoot, `.wiki-staging/${j.id}/completed.json`, { write: true }), json({ id: j.id, digest: j.plan.digest, phase: "finalized", writes: j.plan.writes.map(({ path: path2, before, after }) => ({ path: path2, before, after })) }));
321
+ await atomicWrite(await wikiInternalPath(wikiRoot, `.wiki-staging/${j.id}/completed.json`, { write: true }), json({ id: j.id, digest: j.plan.digest, phase: "finalized", writes: j.plan.writes.map(({ path: path2, before, after }) => ({ path: path2, before, after })) }));
319
322
  j.phase = "finalized";
320
323
  await saveJournal(wikiRoot, j);
321
- await rm(await safePath(wikiRoot, LOCK, { write: true }));
324
+ await rm(await wikiInternalPath(wikiRoot, LOCK, { write: true }));
322
325
  return { id: j.id, phase: j.phase };
323
326
  }
324
327
  async function abortInternal({ wikiRoot }) {
@@ -327,12 +330,12 @@ async function abortInternal({ wikiRoot }) {
327
330
  if (j.phase === "finalized") fail("TRANSACTION_FINALIZED", "cannot abort published transaction");
328
331
  await assertLock(wikiRoot, j.id);
329
332
  for (const w of j.plan.writes) {
330
- const digest = await digestFile(await safePath(wikiRoot, w.path, { write: true }));
333
+ const digest = await digestFile(await wikiInternalPath(wikiRoot, w.path, { write: true }));
331
334
  if (digest !== w.before && digest !== w.after) fail("MANUAL_MODIFICATION", w.path);
332
335
  if (w.before !== null && (typeof w.original !== "string" || sha256(w.original) !== w.before)) fail("BACKUP_INVALID", w.path);
333
336
  }
334
337
  for (const w of [...j.plan.writes].reverse()) {
335
- const p = await safePath(wikiRoot, w.path, { write: true });
338
+ const p = await wikiInternalPath(wikiRoot, w.path, { write: true });
336
339
  if (await digestFile(p) === w.after) {
337
340
  if (w.before === null) await rm(p);
338
341
  else await atomicWrite(p, w.original);
@@ -340,11 +343,11 @@ async function abortInternal({ wikiRoot }) {
340
343
  }
341
344
  j.phase = "aborted";
342
345
  await saveJournal(wikiRoot, j);
343
- await rm(await safePath(wikiRoot, LOCK, { write: true }));
346
+ await rm(await wikiInternalPath(wikiRoot, LOCK, { write: true }));
344
347
  return { id: j.id, phase: j.phase };
345
348
  }
346
349
  async function exclusive(options, run) {
347
- const file = await safePath(options.wikiRoot, ".wiki-runner-lock", { write: true });
350
+ const file = await wikiInternalPath(options.wikiRoot, ".wiki-runner-lock", { write: true });
348
351
  try {
349
352
  await writeFile(file, json({ pid: process.pid }), { flag: "wx" });
350
353
  } catch (e) {
@@ -1,9 +1,9 @@
1
1
  import test from "node:test";
2
2
  import assert from "node:assert/strict";
3
- import { mkdtemp, mkdir, readFile, writeFile, rm, readdir, symlink } from "node:fs/promises";
3
+ import { mkdtemp, mkdir, readFile, writeFile, rm, readdir, symlink, cp, realpath } from "node:fs/promises";
4
4
  import { tmpdir } from "node:os";
5
5
  import path from "node:path";
6
- import { sha256, json, loadManifest, sourceClosure, validateManifest, safePath } from "./core.mjs";
6
+ import { sha256, json, loadManifest, sourceClosure, validateManifest, safePath, wikiInternalPath, wikiHistoryRoot } from "./core.mjs";
7
7
  import { createPlan, applyPlan, resumeTransaction, abortTransaction, planDigest } from "./transaction.mjs";
8
8
  import { drift, hashSources } from "./inventory.mjs";
9
9
  import { migrate } from "./migrate.mjs";
@@ -352,3 +352,39 @@ test("query: publication changes during reads cannot produce a mixed answer",asy
352
352
  });
353
353
  test('ownership: renewing proof for unchanged human content does not rewrite it',async t=>{const f=await fixture(t);const m=await loadManifest(f.wikiRoot,f);m.articles[0].humanOwned=true;await writeFile(path.join(f.wikiRoot,'.wiki-manifest.json'),json(m));const p=await createPlan({...f,request:{operation:'refresh',compilations:[proof()],authorization}});assert.equal(p.writes.some(w=>w.path==='wiki/Alpha.md'),false);await applyPlan({...f,plan:p});assert.equal((await drift(f)).articleStates[0].state,'current');});
354
354
  test('schema: malformed references and evidence are validation errors',async t=>{const f=await fixture(t);const m=await loadManifest(f.wikiRoot,f);m.articles[0].sourceIds={};m.articles[0].verification.evidence={};assert.ok(validateManifest(m).some(e=>e.includes('SOURCE_REFS_INVALID')));assert.ok(validateManifest(m).some(e=>e.includes('EVIDENCE_INVALID')));});
355
+
356
+ test('template-source transactions and migration keep history outside; current log has one run', async t => {
357
+ const f = await fixture(t, {init:false});
358
+ const home = await realpath(await mkdtemp(path.join(tmpdir(), 'wiki-external-history-')));
359
+ const previousHome = process.env.YSS_RUNTIME_HOME;
360
+ process.env.YSS_RUNTIME_HOME = home;
361
+ t.after(async () => { if (previousHome === undefined) delete process.env.YSS_RUNTIME_HOME; else process.env.YSS_RUNTIME_HOME = previousHome; await rm(home,{recursive:true,force:true}); });
362
+ await writeFile(path.join(f.repoRoot,'yss-project.yaml'),'schema_version: 1\nrepository_mode: template-source\n');
363
+ const sourceRoot = path.resolve(import.meta.dirname,'../../../..');
364
+ await mkdir(path.join(f.repoRoot,'scripts/lib'),{recursive:true});
365
+ await mkdir(path.join(f.repoRoot,'scripts/vendor'),{recursive:true});
366
+ for (const name of ['maintenance-storage.mjs','runtime-store.mjs','repository-mode.mjs']) await cp(path.join(sourceRoot,'scripts/lib',name),path.join(f.repoRoot,'scripts/lib',name));
367
+ await cp(path.join(sourceRoot,'scripts/vendor/yaml.mjs'),path.join(f.repoRoot,'scripts/vendor/yaml.mjs'));
368
+ const initial = await createPlan({...f,request:f.request});
369
+ await applyPlan({...f,plan:initial,stopAfter:'prepared'});
370
+ const history = await wikiHistoryRoot(f.wikiRoot);
371
+ assert.ok(history.startsWith(home+path.sep));
372
+ const journal = JSON.parse(await readFile(await wikiInternalPath(f.wikiRoot,'.wiki-transaction.json'),'utf8'));
373
+ assert.equal(journal.phase,'prepared');
374
+ assert.equal((await readdir(f.wikiRoot)).some(name=>name.startsWith('.wiki-')),false);
375
+ await resumeTransaction(f);
376
+ const next = await refresh(f);
377
+ await applyPlan({...f,plan:next});
378
+ const log = await readFile(path.join(f.wikiRoot,'wiki/log.md'),'utf8');
379
+ assert.equal((log.match(/^## /gm)||[]).length,1);
380
+ assert.ok(log.includes(next.id)); assert.ok(!log.includes(initial.id));
381
+ assert.ok(log.includes('maintenance:wiki/'));
382
+ assert.equal((await drift(f)).articleStates[0].state,'current');
383
+ const prior = {schemaVersion:1,profile:'documents',sources:[{id:'guide',kind:'document',livePath:'docs.md',rawPath:'raw/guide.md',sha256:sha256(await readFile(path.join(f.repoRoot,'docs.md')))}],articles:[{id:'Alpha',file:'wiki/Alpha.md',sourceIds:['guide'],humanOwned:false}]};
384
+ const bytes=json(prior); await writeFile(path.join(f.wikiRoot,'.wiki-manifest.json'),bytes);
385
+ const migration = await migrate({...f,apply:true});
386
+ assert.equal(await readFile(await wikiInternalPath(f.wikiRoot,migration.backup),'utf8'),bytes);
387
+ assert.equal((await readdir(f.wikiRoot)).includes('.wiki-backups'),false);
388
+ assert.equal((await loadManifest(f.wikiRoot,f)).schemaVersion,2);
389
+ assert.equal((await drift(f)).articleStates[0].state,'unverified');
390
+ });
@@ -4,6 +4,8 @@ description: "配置或排查 Lombok 注解、构造器、Builder 和注解处
4
4
  ---
5
5
  # Project Lombok
6
6
 
7
+ 只读排障先核验实际对象、工程基线和处理器配置,缺批准 Slice 时记录缺口;写入仍消费批准且当前的工作单元与允许路径。
8
+
7
9
  ## YSS 阶段 7 执行结果
8
10
 
9
11
  - 消费工程 Java 与处理器基线;Java 语法、API、处理器与测试工具消费批准的精确平台配置。MapStruct binding 进入 annotationProcessorPaths,不作为业务依赖单独引入;示例不授权升级依赖。MVC PO 的身份/敏感字段风险与 DDD 相同,不能默认全量 @Data。
@@ -4,6 +4,8 @@ description: "实现或排查 MapStruct DTO、PO、Domain 映射及 Lombok 集
4
4
  ---
5
5
  # MapStruct Object Mapping
6
6
 
7
+ 只读排障先核验实际对象、工程基线和处理器配置,缺批准 Slice 时记录缺口;写入仍消费批准且当前的工作单元与允许路径。
8
+
7
9
  ## YSS 阶段 7 执行结果
8
10
 
9
11
  - Java、依赖与处理器版本来自工程基线,不从下面通用示例推断。Java 语法、API、处理器与测试工具均消费批准的精确平台配置;MVC 的 wire/internal 转换在 server,core/service 不依赖 client,Repository 不依赖上层 DTO。采用 Spring Bean 和构造器注入,显式映射或忽略字段;禁止通过全局 IGNORE 掩盖合同字段遗漏。
@@ -11,7 +11,7 @@ Default response shape:
11
11
  - Explain what changed in plain product or design language.
12
12
  - Give the clickable preview URL when there is one.
13
13
  - Name trade-offs or misses plainly.
14
- - End with one concise suggested next step for the user's current task or goal.
14
+ - State the next actions needed for the user's current goal, keeping all material blockers and required decisions visible.
15
15
  - Avoid walls of bullets and overwhelming the user.
16
16
  - Prioritize pithy, explicit prose that is helpful and minimizes jargon.
17
17
 
@@ -32,9 +32,9 @@ Use technical detail only when:
32
32
 
33
33
  Final response continuation:
34
34
 
35
- - Every final response should end with exactly one useful next action, phrased as a natural sentence or question in the ordinary prose of the response.
35
+ - When concrete work remains, end with the useful next actions or required decisions, phrased naturally in the ordinary prose of the response. Do not invent a follow-up after the requested work is complete.
36
36
  - Make the next step specific to the active Product Design goal, such as reviewing a preview, choosing a direction, approving an implementation pass, tightening one screen, or sharing a target route or reference.
37
- - If the response is blocked on missing input, make the unresolved question the final next step.
37
+ - If the response is blocked on missing input, explain each material gap and the decision or source needed to resolve it; do not hide independent questions to fit a fixed count.
38
38
  - Do not end with only a bare confirmation, file path, preview link, or "done" message while a concrete Product Design next step remains.
39
39
  - Skip the next step only when the user explicitly asks for no follow-up, clearly closes the task, or another active workflow already owns the final next action.
40
40