create-yss-spec 3.5.5 → 3.5.8

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 (554) hide show
  1. package/README.md +2 -0
  2. package/bin/create-yss-spec.js +3 -1
  3. package/cli-core.lock.json +11 -7
  4. package/package.json +4 -1
  5. package/src/api/_sync-service.js +3 -1
  6. package/src/command-runner.mjs +44 -9
  7. package/src/content-identity.js +111 -0
  8. package/src/runtime-store.mjs +650 -0
  9. package/src/template/asset-runtime.js +7 -2
  10. package/src/template/instance-runtime.js +27 -9
  11. package/src/validation/metadata.js +8 -0
  12. package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
  13. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +30 -36
  14. package/template/.agents/skills/archify/SKILL.md +2 -2
  15. package/template/.agents/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  16. package/template/.agents/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  17. package/template/.agents/skills/code-review/SKILL.md +19 -11
  18. package/template/.agents/skills/code-review/references/candidate-capture.md +1 -1
  19. package/template/.agents/skills/code-review/references/legacy-convergence.md +3 -1
  20. package/template/.agents/skills/code-review/references/review-axis-checklists.md +2 -0
  21. package/template/.agents/skills/code-review/references/yss-review-standards.md +4 -2
  22. package/template/.agents/skills/competitive-intelligence/SKILL.md +32 -74
  23. package/template/.agents/skills/file-export-download/SKILL.md +4 -73
  24. package/template/.agents/skills/file-export-download/references/binary-contract-example.md +26 -0
  25. package/template/.agents/skills/file-export-download/references/download-call-example.md +45 -0
  26. package/template/.agents/skills/formily-foundation/SKILL.md +6 -105
  27. package/template/.agents/skills/formily-foundation/references/async-save-example.md +57 -0
  28. package/template/.agents/skills/formily-foundation/references/query-layout.md +50 -0
  29. package/template/.agents/skills/formily-linkage-effects/SKILL.md +3 -116
  30. package/template/.agents/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  31. package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +3 -81
  32. package/template/.agents/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  33. package/template/.agents/skills/formily-step-flow/SKILL.md +3 -143
  34. package/template/.agents/skills/formily-step-flow/references/step-flow-example.md +143 -0
  35. package/template/.agents/skills/handoff/SKILL.md +3 -1
  36. package/template/.agents/skills/i-have-adhd/SKILL.md +2 -2
  37. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  38. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  39. package/template/.agents/skills/implement/SKILL.md +2 -2
  40. package/template/.agents/skills/llm-wiki/references/transactions.md +2 -2
  41. package/template/.agents/skills/llm-wiki/scripts/core.mjs +40 -2
  42. package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +30 -27
  43. package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  44. package/template/.agents/skills/lombok/SKILL.md +2 -0
  45. package/template/.agents/skills/mapstruct/SKILL.md +2 -0
  46. package/template/.agents/skills/tdd/SKILL.md +2 -2
  47. package/template/.agents/skills/theme-token-usage/SKILL.md +6 -5
  48. package/template/.agents/skills/wayfinder/references/chart-map.md +2 -2
  49. package/template/.agents/skills/wayfinder/references/ticket-types.md +1 -1
  50. package/template/.agents/skills/yss-api-integration/SKILL.md +13 -50
  51. package/template/.agents/skills/yss-api-integration/references/orval-list-example.md +38 -0
  52. package/template/.agents/skills/yss-application/SKILL.md +11 -5
  53. package/template/.agents/skills/yss-audit-log/SKILL.md +8 -6
  54. package/template/.agents/skills/yss-audit-log/references/README.md +5 -5
  55. package/template/.agents/skills/yss-cache/SKILL.md +4 -4
  56. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  57. package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  58. package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  59. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  60. package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
  61. package/template/.agents/skills/yss-distributed-id/SKILL.md +4 -4
  62. package/template/.agents/skills/yss-dto/SKILL.md +9 -9
  63. package/template/.agents/skills/yss-dto/references/README.md +4 -4
  64. package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  65. package/template/.agents/skills/yss-excel-mvc/SKILL.md +4 -4
  66. package/template/.agents/skills/yss-exception/SKILL.md +42 -48
  67. package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +26 -170
  68. package/template/.agents/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  69. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  70. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  71. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  72. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  73. package/template/.agents/skills/yss-mybatis/SKILL.md +4 -4
  74. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +6 -4
  75. package/template/.agents/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  76. package/template/.agents/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  77. package/template/.agents/skills/yss-openapi-governance/SKILL.md +5 -7
  78. package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +2 -0
  79. package/template/.agents/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  80. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +23 -21
  81. package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  82. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  83. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  84. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  85. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -1
  86. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  87. package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
  88. package/template/.agents/skills/yss-repository/SKILL.md +2 -2
  89. package/template/.agents/skills/yss-research/SKILL.md +39 -48
  90. package/template/.agents/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  91. package/template/.agents/skills/yss-research/references/competitive-analysis.md +76 -0
  92. package/template/.agents/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  93. package/template/.agents/skills/yss-research/references/evidence-contract.md +8 -0
  94. package/template/.agents/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  95. package/template/.agents/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  96. package/template/.agents/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  97. package/template/.agents/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  98. package/template/.agents/skills/yss-resilience4j/SKILL.md +25 -31
  99. package/template/.agents/skills/yss-security-algorithm/SKILL.md +37 -43
  100. package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  101. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  102. package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -5
  103. package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -1
  104. package/template/.agents/skills/yss-tactical-design/references/output-template.md +3 -3
  105. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  106. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -5
  107. package/template/.agents/skills/yss-ui/SKILL.md +7 -1
  108. package/template/.agents/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  109. package/template/.agents/skills/yss-ui/references/checklist.md +38 -96
  110. package/template/.agents/skills/yss-ui/references/component-routing.md +3 -1
  111. package/template/.agents/skills/yss-ui/references/quick-recipes.md +17 -272
  112. package/template/.agents/skills/yss-ui/references/specialized-components.md +3 -3
  113. package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  114. package/template/.agents/skills/yss-up-springboot3/SKILL.md +19 -21
  115. package/template/.agents/skills/yss-userinfo/SKILL.md +27 -33
  116. package/template/.agents/skills/yss-validation/SKILL.md +26 -32
  117. package/template/.agents/skills/yss-web-controller/SKILL.md +11 -44
  118. package/template/.agents/skills/yss-web-controller/references/crud-generation.md +38 -0
  119. package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
  120. package/template/.agents/skills/ytree-usage/SKILL.md +2 -80
  121. package/template/.agents/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  122. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +30 -36
  123. package/template/.codex/skills/archify/SKILL.md +2 -2
  124. package/template/.codex/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  125. package/template/.codex/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  126. package/template/.codex/skills/code-review/SKILL.md +19 -11
  127. package/template/.codex/skills/code-review/references/candidate-capture.md +1 -1
  128. package/template/.codex/skills/code-review/references/legacy-convergence.md +3 -1
  129. package/template/.codex/skills/code-review/references/review-axis-checklists.md +2 -0
  130. package/template/.codex/skills/code-review/references/yss-review-standards.md +4 -2
  131. package/template/.codex/skills/competitive-intelligence/SKILL.md +32 -74
  132. package/template/.codex/skills/file-export-download/SKILL.md +4 -73
  133. package/template/.codex/skills/file-export-download/references/binary-contract-example.md +26 -0
  134. package/template/.codex/skills/file-export-download/references/download-call-example.md +45 -0
  135. package/template/.codex/skills/formily-foundation/SKILL.md +6 -105
  136. package/template/.codex/skills/formily-foundation/references/async-save-example.md +57 -0
  137. package/template/.codex/skills/formily-foundation/references/query-layout.md +50 -0
  138. package/template/.codex/skills/formily-linkage-effects/SKILL.md +3 -116
  139. package/template/.codex/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  140. package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +3 -81
  141. package/template/.codex/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  142. package/template/.codex/skills/formily-step-flow/SKILL.md +3 -143
  143. package/template/.codex/skills/formily-step-flow/references/step-flow-example.md +143 -0
  144. package/template/.codex/skills/handoff/SKILL.md +3 -1
  145. package/template/.codex/skills/i-have-adhd/SKILL.md +2 -2
  146. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  147. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  148. package/template/.codex/skills/implement/SKILL.md +2 -2
  149. package/template/.codex/skills/llm-wiki/references/transactions.md +2 -2
  150. package/template/.codex/skills/llm-wiki/scripts/core.mjs +40 -2
  151. package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +30 -27
  152. package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  153. package/template/.codex/skills/lombok/SKILL.md +2 -0
  154. package/template/.codex/skills/mapstruct/SKILL.md +2 -0
  155. package/template/.codex/skills/product-design/references/communication-protocol.md +3 -3
  156. package/template/.codex/skills/product-design/references/critical-overrides.md +4 -5
  157. package/template/.codex/skills/product-design/skills/audit/SKILL.md +2 -4
  158. package/template/.codex/skills/product-design/skills/get-context/SKILL.md +6 -8
  159. package/template/.codex/skills/product-design/skills/ideate/SKILL.md +3 -3
  160. package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +3 -5
  161. package/template/.codex/skills/product-design/skills/index/SKILL.md +1 -1
  162. package/template/.codex/skills/product-design/skills/prototype/SKILL.md +2 -4
  163. package/template/.codex/skills/product-design/skills/research/SKILL.md +4 -6
  164. package/template/.codex/skills/product-design/skills/research/assets/research-brief-template.md +3 -3
  165. package/template/.codex/skills/product-design/skills/share/SKILL.md +2 -4
  166. package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +2 -4
  167. package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
  168. package/template/.codex/skills/tdd/SKILL.md +2 -2
  169. package/template/.codex/skills/theme-token-usage/SKILL.md +6 -5
  170. package/template/.codex/skills/wayfinder/references/chart-map.md +2 -2
  171. package/template/.codex/skills/wayfinder/references/ticket-types.md +1 -1
  172. package/template/.codex/skills/yss-api-integration/SKILL.md +13 -50
  173. package/template/.codex/skills/yss-api-integration/references/orval-list-example.md +38 -0
  174. package/template/.codex/skills/yss-application/SKILL.md +11 -5
  175. package/template/.codex/skills/yss-audit-log/SKILL.md +8 -6
  176. package/template/.codex/skills/yss-audit-log/references/README.md +5 -5
  177. package/template/.codex/skills/yss-cache/SKILL.md +4 -4
  178. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  179. package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  180. package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  181. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  182. package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
  183. package/template/.codex/skills/yss-distributed-id/SKILL.md +4 -4
  184. package/template/.codex/skills/yss-dto/SKILL.md +9 -9
  185. package/template/.codex/skills/yss-dto/references/README.md +4 -4
  186. package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  187. package/template/.codex/skills/yss-excel-mvc/SKILL.md +4 -4
  188. package/template/.codex/skills/yss-exception/SKILL.md +42 -48
  189. package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +26 -170
  190. package/template/.codex/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  191. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  192. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  193. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  194. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  195. package/template/.codex/skills/yss-mybatis/SKILL.md +4 -4
  196. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +6 -4
  197. package/template/.codex/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  198. package/template/.codex/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  199. package/template/.codex/skills/yss-openapi-governance/SKILL.md +5 -7
  200. package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +2 -0
  201. package/template/.codex/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  202. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +23 -21
  203. package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  204. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  205. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  206. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  207. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -1
  208. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  209. package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
  210. package/template/.codex/skills/yss-repository/SKILL.md +2 -2
  211. package/template/.codex/skills/yss-research/SKILL.md +39 -48
  212. package/template/.codex/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  213. package/template/.codex/skills/yss-research/references/competitive-analysis.md +76 -0
  214. package/template/.codex/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  215. package/template/.codex/skills/yss-research/references/evidence-contract.md +8 -0
  216. package/template/.codex/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  217. package/template/.codex/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  218. package/template/.codex/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  219. package/template/.codex/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  220. package/template/.codex/skills/yss-resilience4j/SKILL.md +25 -31
  221. package/template/.codex/skills/yss-security-algorithm/SKILL.md +37 -43
  222. package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  223. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  224. package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -5
  225. package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -1
  226. package/template/.codex/skills/yss-tactical-design/references/output-template.md +3 -3
  227. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  228. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -5
  229. package/template/.codex/skills/yss-ui/SKILL.md +7 -1
  230. package/template/.codex/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  231. package/template/.codex/skills/yss-ui/references/checklist.md +38 -96
  232. package/template/.codex/skills/yss-ui/references/component-routing.md +3 -1
  233. package/template/.codex/skills/yss-ui/references/quick-recipes.md +17 -272
  234. package/template/.codex/skills/yss-ui/references/specialized-components.md +3 -3
  235. package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  236. package/template/.codex/skills/yss-up-springboot3/SKILL.md +19 -21
  237. package/template/.codex/skills/yss-userinfo/SKILL.md +27 -33
  238. package/template/.codex/skills/yss-validation/SKILL.md +26 -32
  239. package/template/.codex/skills/yss-web-controller/SKILL.md +11 -44
  240. package/template/.codex/skills/yss-web-controller/references/crud-generation.md +38 -0
  241. package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
  242. package/template/.codex/skills/ytree-usage/SKILL.md +2 -80
  243. package/template/.codex/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  244. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +30 -36
  245. package/template/.cursor/skills/archify/SKILL.md +2 -2
  246. package/template/.cursor/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  247. package/template/.cursor/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  248. package/template/.cursor/skills/code-review/SKILL.md +19 -11
  249. package/template/.cursor/skills/code-review/references/candidate-capture.md +1 -1
  250. package/template/.cursor/skills/code-review/references/legacy-convergence.md +3 -1
  251. package/template/.cursor/skills/code-review/references/review-axis-checklists.md +2 -0
  252. package/template/.cursor/skills/code-review/references/yss-review-standards.md +4 -2
  253. package/template/.cursor/skills/competitive-intelligence/SKILL.md +32 -74
  254. package/template/.cursor/skills/file-export-download/SKILL.md +4 -73
  255. package/template/.cursor/skills/file-export-download/references/binary-contract-example.md +26 -0
  256. package/template/.cursor/skills/file-export-download/references/download-call-example.md +45 -0
  257. package/template/.cursor/skills/formily-foundation/SKILL.md +6 -105
  258. package/template/.cursor/skills/formily-foundation/references/async-save-example.md +57 -0
  259. package/template/.cursor/skills/formily-foundation/references/query-layout.md +50 -0
  260. package/template/.cursor/skills/formily-linkage-effects/SKILL.md +3 -116
  261. package/template/.cursor/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  262. package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +3 -81
  263. package/template/.cursor/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  264. package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -143
  265. package/template/.cursor/skills/formily-step-flow/references/step-flow-example.md +143 -0
  266. package/template/.cursor/skills/handoff/SKILL.md +3 -1
  267. package/template/.cursor/skills/i-have-adhd/SKILL.md +2 -2
  268. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  269. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  270. package/template/.cursor/skills/implement/SKILL.md +2 -2
  271. package/template/.cursor/skills/llm-wiki/references/transactions.md +2 -2
  272. package/template/.cursor/skills/llm-wiki/scripts/core.mjs +40 -2
  273. package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +30 -27
  274. package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  275. package/template/.cursor/skills/lombok/SKILL.md +2 -0
  276. package/template/.cursor/skills/mapstruct/SKILL.md +2 -0
  277. package/template/.cursor/skills/tdd/SKILL.md +2 -2
  278. package/template/.cursor/skills/theme-token-usage/SKILL.md +6 -5
  279. package/template/.cursor/skills/wayfinder/references/chart-map.md +2 -2
  280. package/template/.cursor/skills/wayfinder/references/ticket-types.md +1 -1
  281. package/template/.cursor/skills/yss-api-integration/SKILL.md +13 -50
  282. package/template/.cursor/skills/yss-api-integration/references/orval-list-example.md +38 -0
  283. package/template/.cursor/skills/yss-application/SKILL.md +11 -5
  284. package/template/.cursor/skills/yss-audit-log/SKILL.md +8 -6
  285. package/template/.cursor/skills/yss-audit-log/references/README.md +5 -5
  286. package/template/.cursor/skills/yss-cache/SKILL.md +4 -4
  287. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  288. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  289. package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  290. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  291. package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
  292. package/template/.cursor/skills/yss-distributed-id/SKILL.md +4 -4
  293. package/template/.cursor/skills/yss-dto/SKILL.md +9 -9
  294. package/template/.cursor/skills/yss-dto/references/README.md +4 -4
  295. package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  296. package/template/.cursor/skills/yss-excel-mvc/SKILL.md +4 -4
  297. package/template/.cursor/skills/yss-exception/SKILL.md +42 -48
  298. package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +26 -170
  299. package/template/.cursor/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  300. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  301. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  302. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  303. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  304. package/template/.cursor/skills/yss-mybatis/SKILL.md +4 -4
  305. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +6 -4
  306. package/template/.cursor/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  307. package/template/.cursor/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  308. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +5 -7
  309. package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +2 -0
  310. package/template/.cursor/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  311. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +23 -21
  312. package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  313. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  314. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  315. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  316. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -1
  317. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  318. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
  319. package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
  320. package/template/.cursor/skills/yss-research/SKILL.md +39 -48
  321. package/template/.cursor/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  322. package/template/.cursor/skills/yss-research/references/competitive-analysis.md +76 -0
  323. package/template/.cursor/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  324. package/template/.cursor/skills/yss-research/references/evidence-contract.md +8 -0
  325. package/template/.cursor/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  326. package/template/.cursor/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  327. package/template/.cursor/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  328. package/template/.cursor/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  329. package/template/.cursor/skills/yss-resilience4j/SKILL.md +25 -31
  330. package/template/.cursor/skills/yss-security-algorithm/SKILL.md +37 -43
  331. package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  332. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  333. package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -5
  334. package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -1
  335. package/template/.cursor/skills/yss-tactical-design/references/output-template.md +3 -3
  336. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  337. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -5
  338. package/template/.cursor/skills/yss-ui/SKILL.md +7 -1
  339. package/template/.cursor/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  340. package/template/.cursor/skills/yss-ui/references/checklist.md +38 -96
  341. package/template/.cursor/skills/yss-ui/references/component-routing.md +3 -1
  342. package/template/.cursor/skills/yss-ui/references/quick-recipes.md +17 -272
  343. package/template/.cursor/skills/yss-ui/references/specialized-components.md +3 -3
  344. package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  345. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +19 -21
  346. package/template/.cursor/skills/yss-userinfo/SKILL.md +27 -33
  347. package/template/.cursor/skills/yss-validation/SKILL.md +26 -32
  348. package/template/.cursor/skills/yss-web-controller/SKILL.md +11 -44
  349. package/template/.cursor/skills/yss-web-controller/references/crud-generation.md +38 -0
  350. package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
  351. package/template/.cursor/skills/ytree-usage/SKILL.md +2 -80
  352. package/template/.cursor/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  353. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +30 -36
  354. package/template/.pi/skills/archify/SKILL.md +2 -2
  355. package/template/.pi/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
  356. package/template/.pi/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
  357. package/template/.pi/skills/code-review/SKILL.md +19 -11
  358. package/template/.pi/skills/code-review/references/candidate-capture.md +1 -1
  359. package/template/.pi/skills/code-review/references/legacy-convergence.md +3 -1
  360. package/template/.pi/skills/code-review/references/review-axis-checklists.md +2 -0
  361. package/template/.pi/skills/code-review/references/yss-review-standards.md +4 -2
  362. package/template/.pi/skills/competitive-intelligence/SKILL.md +32 -74
  363. package/template/.pi/skills/file-export-download/SKILL.md +4 -73
  364. package/template/.pi/skills/file-export-download/references/binary-contract-example.md +26 -0
  365. package/template/.pi/skills/file-export-download/references/download-call-example.md +45 -0
  366. package/template/.pi/skills/formily-foundation/SKILL.md +6 -105
  367. package/template/.pi/skills/formily-foundation/references/async-save-example.md +57 -0
  368. package/template/.pi/skills/formily-foundation/references/query-layout.md +50 -0
  369. package/template/.pi/skills/formily-linkage-effects/SKILL.md +3 -116
  370. package/template/.pi/skills/formily-linkage-effects/references/linkage-example.md +116 -0
  371. package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +3 -81
  372. package/template/.pi/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
  373. package/template/.pi/skills/formily-step-flow/SKILL.md +3 -143
  374. package/template/.pi/skills/formily-step-flow/references/step-flow-example.md +143 -0
  375. package/template/.pi/skills/handoff/SKILL.md +3 -1
  376. package/template/.pi/skills/i-have-adhd/SKILL.md +2 -2
  377. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +2 -2
  378. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
  379. package/template/.pi/skills/implement/SKILL.md +2 -2
  380. package/template/.pi/skills/llm-wiki/references/transactions.md +2 -2
  381. package/template/.pi/skills/llm-wiki/scripts/core.mjs +40 -2
  382. package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +30 -27
  383. package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +38 -2
  384. package/template/.pi/skills/lombok/SKILL.md +2 -0
  385. package/template/.pi/skills/mapstruct/SKILL.md +2 -0
  386. package/template/.pi/skills/tdd/SKILL.md +2 -2
  387. package/template/.pi/skills/theme-token-usage/SKILL.md +6 -5
  388. package/template/.pi/skills/wayfinder/references/chart-map.md +2 -2
  389. package/template/.pi/skills/wayfinder/references/ticket-types.md +1 -1
  390. package/template/.pi/skills/yss-api-integration/SKILL.md +13 -50
  391. package/template/.pi/skills/yss-api-integration/references/orval-list-example.md +38 -0
  392. package/template/.pi/skills/yss-application/SKILL.md +11 -5
  393. package/template/.pi/skills/yss-audit-log/SKILL.md +8 -6
  394. package/template/.pi/skills/yss-audit-log/references/README.md +5 -5
  395. package/template/.pi/skills/yss-cache/SKILL.md +4 -4
  396. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
  397. package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
  398. package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
  399. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
  400. package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
  401. package/template/.pi/skills/yss-distributed-id/SKILL.md +4 -4
  402. package/template/.pi/skills/yss-dto/SKILL.md +9 -9
  403. package/template/.pi/skills/yss-dto/references/README.md +4 -4
  404. package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +4 -4
  405. package/template/.pi/skills/yss-excel-mvc/SKILL.md +4 -4
  406. package/template/.pi/skills/yss-exception/SKILL.md +42 -48
  407. package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +26 -170
  408. package/template/.pi/skills/yss-formily-schema-generator/references/workflow.md +49 -193
  409. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
  410. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -6
  411. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
  412. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
  413. package/template/.pi/skills/yss-mybatis/SKILL.md +4 -4
  414. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +6 -4
  415. package/template/.pi/skills/yss-openapi-draft-review/references/review-output.md +2 -0
  416. package/template/.pi/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
  417. package/template/.pi/skills/yss-openapi-governance/SKILL.md +5 -7
  418. package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +2 -0
  419. package/template/.pi/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
  420. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +23 -21
  421. package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
  422. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +25 -5
  423. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +100 -4
  424. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +35 -12
  425. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -1
  426. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
  427. package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
  428. package/template/.pi/skills/yss-repository/SKILL.md +2 -2
  429. package/template/.pi/skills/yss-research/SKILL.md +39 -48
  430. package/template/.pi/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
  431. package/template/.pi/skills/yss-research/references/competitive-analysis.md +76 -0
  432. package/template/.pi/skills/yss-research/references/competitive-analysis.schema.json +324 -0
  433. package/template/.pi/skills/yss-research/references/evidence-contract.md +8 -0
  434. package/template/.pi/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
  435. package/template/.pi/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
  436. package/template/.pi/skills/yss-research/scripts/validate-research-package.mjs +6 -2
  437. package/template/.pi/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
  438. package/template/.pi/skills/yss-resilience4j/SKILL.md +25 -31
  439. package/template/.pi/skills/yss-security-algorithm/SKILL.md +37 -43
  440. package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
  441. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  442. package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -5
  443. package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -1
  444. package/template/.pi/skills/yss-tactical-design/references/output-template.md +3 -3
  445. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  446. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -5
  447. package/template/.pi/skills/yss-ui/SKILL.md +7 -1
  448. package/template/.pi/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
  449. package/template/.pi/skills/yss-ui/references/checklist.md +38 -96
  450. package/template/.pi/skills/yss-ui/references/component-routing.md +3 -1
  451. package/template/.pi/skills/yss-ui/references/quick-recipes.md +17 -272
  452. package/template/.pi/skills/yss-ui/references/specialized-components.md +3 -3
  453. package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +1 -1
  454. package/template/.pi/skills/yss-up-springboot3/SKILL.md +19 -21
  455. package/template/.pi/skills/yss-userinfo/SKILL.md +27 -33
  456. package/template/.pi/skills/yss-validation/SKILL.md +26 -32
  457. package/template/.pi/skills/yss-web-controller/SKILL.md +11 -44
  458. package/template/.pi/skills/yss-web-controller/references/crud-generation.md +38 -0
  459. package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
  460. package/template/.pi/skills/ytree-usage/SKILL.md +2 -80
  461. package/template/.pi/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
  462. package/template/.template-spec/agents/backend-architecture-profiles.md +1 -1
  463. package/template/.template-spec/agents/digital-human-roles.md +5 -1
  464. package/template/.template-spec/agents/digital-human-roles.yaml +49 -1
  465. package/template/.template-spec/engineering/backend-platforms.json +1 -1
  466. package/template/.template-spec/plan/templates/competitive-analysis-template.md +38 -36
  467. package/template/.template-spec/plan/templates/competitive-matrix-template.md +37 -17
  468. package/template/.template-spec/process/document-writing.md +22 -3
  469. package/template/.template-spec/process/harness-process-tailoring.md +5 -1
  470. package/template/.template-spec/process/implementation-repo-integration.md +26 -8
  471. package/template/.template-spec/process/research-completion.md +2 -0
  472. package/template/.template-spec/process/runtime-storage.md +78 -0
  473. package/template/.template-spec/process/schemas/approval-context.schema.json +67 -0
  474. package/template/.template-spec/process/schemas/approval-record.schema.json +179 -16
  475. package/template/.template-spec/process/schemas/backend-delivery.schema.json +16 -0
  476. package/template/.template-spec/process/schemas/delivery-preflight-input.schema.json +4 -0
  477. package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +236 -1
  478. package/template/.template-spec/process/schemas/implementation-repository-preparation-result.schema.json +335 -52
  479. package/template/.template-spec/process/schemas/lifecycle-checkpoint.schema.json +11 -0
  480. package/template/.template-spec/process/schemas/project-scaffold-contract.schema.json +3 -0
  481. package/template/.template-spec/process/schemas/review-bundle.schema.json +347 -35
  482. package/template/.template-spec/process/schemas/strategic-design-handoff-v3.schema.json +504 -0
  483. package/template/.template-spec/process/schemas/strategic-design-handoff-v4.schema.json +544 -8
  484. package/template/.template-spec/process/schemas/strategic-design-handoff-v5.schema.json +616 -0
  485. package/template/.template-spec/process/schemas/strategic-design-handoff.schema.json +616 -0
  486. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +712 -109
  487. package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json +595 -90
  488. package/template/.template-spec/process/schemas/strategic-handoff-export-v2.schema.json +448 -0
  489. package/template/.template-spec/process/schemas/strategic-handoff-export.schema.json +392 -0
  490. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +556 -83
  491. package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json +418 -57
  492. package/template/.template-spec/process/subagent-collaboration.md +7 -1
  493. package/template/.template-spec/templates/approval-record-template.json +7 -3
  494. package/template/.template-spec/templates/approval-record-template.yaml +8 -2
  495. package/template/.template-spec/templates/examples/lifecycle-writing-examples.md +92 -2
  496. package/template/.template-spec/templates/retro-report-template.md +10 -3
  497. package/template/.template-spec/templates/review-bundle-template.yaml +19 -10
  498. package/template/AGENTS.md +4 -3
  499. package/template/CONTEXT.md +2 -2
  500. package/template/README.md +2 -2
  501. package/template/scripts/advance-maintenance-iteration +51 -0
  502. package/template/scripts/lib/approval-checkpoint-discovery.mjs +26 -0
  503. package/template/scripts/lib/approval-consumption.mjs +35 -0
  504. package/template/scripts/lib/approval-current.mjs +111 -0
  505. package/template/scripts/lib/approval-record-io.mjs +56 -0
  506. package/template/scripts/lib/approval-record.mjs +79 -184
  507. package/template/scripts/lib/approved-execution-context.mjs +8 -6
  508. package/template/scripts/lib/asset-transactions.mjs +5 -1
  509. package/template/scripts/lib/backend-delivery.mjs +1 -1
  510. package/template/scripts/lib/backend-review.mjs +2 -1
  511. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +3 -2
  512. package/template/scripts/lib/business-ticket-lifecycle.mjs +2 -1
  513. package/template/scripts/lib/checkpoint-commit.mjs +50 -0
  514. package/template/scripts/lib/command-runner.mjs +44 -9
  515. package/template/scripts/lib/content-identity.mjs +273 -0
  516. package/template/scripts/lib/delivery-preflight.mjs +2 -1
  517. package/template/scripts/lib/digital-human-roles.mjs +12 -5
  518. package/template/scripts/lib/drift-report.mjs +110 -0
  519. package/template/scripts/lib/existing-backend-architecture.mjs +4 -1
  520. package/template/scripts/lib/lifecycle-context-query.mjs +172 -11
  521. package/template/scripts/lib/lifecycle-controls.mjs +9 -19
  522. package/template/scripts/lib/lifecycle-presentation.mjs +5 -0
  523. package/template/scripts/lib/lifecycle-status.mjs +63 -12
  524. package/template/scripts/lib/lifecycle-transition.mjs +2 -1
  525. package/template/scripts/lib/maintenance-candidate.mjs +24 -30
  526. package/template/scripts/lib/maintenance-research.mjs +52 -8
  527. package/template/scripts/lib/maintenance-storage.mjs +81 -0
  528. package/template/scripts/lib/plan-spec-entry.mjs +2 -1
  529. package/template/scripts/lib/project-governance.mjs +2 -1
  530. package/template/scripts/lib/read-only-intake.mjs +44 -9
  531. package/template/scripts/lib/review-capabilities.mjs +234 -0
  532. package/template/scripts/lib/review-package.mjs +100 -0
  533. package/template/scripts/lib/runtime-store.mjs +650 -0
  534. package/template/scripts/lib/skill-registry.mjs +4 -4
  535. package/template/scripts/lib/strategic-handoff.mjs +22 -9
  536. package/template/scripts/lib/task-package.mjs +47 -16
  537. package/template/scripts/lifecycle-status +26 -1
  538. package/template/scripts/maintenance-path +11 -0
  539. package/template/scripts/prepare-review-package +8 -0
  540. package/template/scripts/project-ci +13 -3
  541. package/template/scripts/query-lifecycle-context +8 -1
  542. package/template/scripts/run-read-only-intake +2 -2
  543. package/template/scripts/runtime-store +40 -0
  544. package/template/scripts/verify-approval-record +21 -13
  545. package/template/scripts/verify-lifecycle-checkpoint +7 -3
  546. package/template/scripts/verify-project-instance +21 -1
  547. package/template/skills-lock.json +62 -61
  548. package/template.snapshot.json +4 -4
  549. package/vendor/cli-core/cli.mjs +2 -0
  550. package/vendor/cli-core/command-runner.mjs +44 -9
  551. package/vendor/cli-core/package.json +1 -1
  552. package/vendor/cli-core/runtime-store.mjs +650 -0
  553. package/vendor/cli-core/scaffold.mjs +4 -2
  554. package/vendor/cli-core/tests/package-contract.mjs +14 -0
@@ -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 掩盖合同字段遗漏。
@@ -19,9 +19,9 @@ See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking g
19
19
 
20
20
  A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
21
21
 
22
- **Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything — agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
22
+ **Test only at pre-agreed seams.** Before writing tests, first read the current approved contract (the Slice Implementation Contract for YSS implementation), its public seam references and the applicable user-decision evidence. Reuse confirmed seams covered by the same valid contract/decision version, scope and basis without asking the user again; follow the existing user-decision protocol selected by root `AGENTS.md` and the lifecycle owner when checking approval continuation.
23
23
 
24
- Ask: "What's the public interface, and which seams should we test?"
24
+ If a seam is missing, newly introduced or materially changed, the contract is `stale`, or confirmation cannot be proved from readable evidence, stop tests and implementation that depend on that seam and return to the lifecycle owner to update the contract and obtain any required decision. Independent work may continue. Elapsed time and unrelated file changes do not expire seam confirmation; changed relevant inputs require freshness and scope checks under the same protocol. No test is written at an unconfirmed seam. Agreeing seams directs testing effort to critical paths and complex logic.
25
25
 
26
26
  When the shape of that interface is itself in question — how deep the module is, where the seam belongs, what the interface should expose — use the `/codebase-design` skill for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.
27
27
 
@@ -20,12 +20,12 @@ description: "实现或修复 Vue3 YSS UI 主题、交互状态色与动态换
20
20
 
21
21
  ## 开发前检查
22
22
 
23
- 1. 读取当前微应用的 `packages/src/styles/variables.less`、主题 store/config 和相近页面,确认真实 Token 名称与运行时同步逻辑。
23
+ 1. 从目标工程实际的主题入口、store/config 和相近页面定位 Token 声明与同步逻辑;`variables.less` 只作为存在时的路径线索。当前 bundled 骨架使用 `packages/src/config/theme.json`、`packages/src/store/theme.ts`、`packages/src/styles/index.less` 与 `ThemeScope.vue`。
24
24
  2. 确认主应用传入的 `colorPrimary` 最终是否同步到 Ant Design ConfigProvider、YSS CSS 变量和 VXE 变量。
25
25
  3. 搜索本次改动涉及的硬编码色值,覆盖 SFC style、`style.less`、内联 `style`、`:style`、TS 配置、SVG `fill/stroke`。
26
26
  4. 区分“主题消费代码”和“主题定义代码”;禁止机械替换主题源文件中的合法默认色板。
27
27
 
28
- > 变量在 `:root` 中声明,不代表它会随运行时主题更新。必须同时检查主题同步代码是否写入该变量。
28
+ > 变量在 `:root` 或应用容器中声明,不代表它会随运行时主题更新。必须同时检查主题同步代码是否写入该变量,以及消费节点是否处于相同作用域。
29
29
 
30
30
  ## Token 选择
31
31
 
@@ -65,8 +65,9 @@ box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #3371ff) 15%, tran
65
65
 
66
66
  ## 标准代码骨架
67
67
 
68
+ 下面只说明语义 Token 的消费方式;变量名称、fallback 与默认值须先核对目标工程。主题已由应用入口注入时,不另加不存在的 Less 导入。
69
+
68
70
  ```less
69
- @import url('@/styles/variables.less');
70
71
 
71
72
  .module-card {
72
73
  color: var(--text-color, rgba(0, 0, 0, 0.88));
@@ -94,7 +95,7 @@ box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #3371ff) 15%, tran
94
95
  }
95
96
  ```
96
97
 
97
- 仅在 JS、图表或 Canvas 必须读取计算后色值时,优先使用 Ant Design Vue `theme.useToken()`;若消费微应用 CSS 变量,则通过 `getComputedStyle(document.documentElement)` 读取,不复制默认色板到业务常量。
98
+ 仅在 JS、图表或 Canvas 必须读取计算后色值时,优先使用当前 ConfigProvider 内的 Ant Design Vue `theme.useToken()`。消费 CSS 变量时,对实际获得主题变量的应用容器或其消费节点调用 `getComputedStyle()`;当前 bundled 微应用只向自己的容器同步变量,不读取或写入宿主 `documentElement`。只有已核验主题同步到文档根节点的独立应用,才从该根节点读取。不复制默认色板到业务常量。
98
99
 
99
100
  ## 验证流程
100
101
 
@@ -117,7 +118,7 @@ box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #3371ff) 15%, tran
117
118
 
118
119
  ## 失败兜底策略
119
120
 
120
- - 找不到 Token 时,先查项目 `variables.less`、主题 store/config 和 `llms-full.txt`;禁止猜测变量名。
121
+ - 找不到 Token 时,先查项目实际主题入口、store/config 和匹配版本的文档;`variables.less` 存在时才读取,禁止猜测变量名或创建同名文件充当输入。
121
122
  - 只有颜色值但没有语义 Token 时,先在统一主题源补充语义变量和运行时同步,再在页面消费。
122
123
  - 第三方组件不跟随主题时,优先通过 ConfigProvider/component token 或其官方 CSS 变量桥接;最后才使用受控的深度样式覆盖。
123
124
  - 浏览器目标不支持 `color-mix()` 时,在主题层生成并同步明确的透明态变量;不要在各页面散落固定透明色。
@@ -7,8 +7,8 @@
7
7
  User invokes with a loose idea.
8
8
 
9
9
  1. **Name the destination.** Run a `/grilling` and `/domain-modeling` session to pin down what this map is finding its way to — the spec, decision, or change. The destination fixes the scope, so it's settled first.
10
- 2. **Map the frontier.** Grill again, **breadth-first** this time: fan out across the whole space rather than deep on any one thread, surfacing the open decisions and the first steps takeable now. **If this surfaces no fog** — the way to the destination is already clear, the whole journey small enough for one session — you don't need a map. Stop and ask the user how they'd like to proceed.
10
+ 2. **Map the frontier.** Grill again, **breadth-first** this time: fan out across the whole space rather than deep on any one thread, surfacing the open decisions and the first steps takeable now. If no open decision remains and the work fits one session, return the settled destination, scope and evidence to the active orchestrator. Continue within the existing authorization; ask only for a missing real decision or new authorization.
11
11
  3. **Create the map** (label `wayfinder:map`): Destination and Notes filled in, Decisions-so-far empty, the fog sketched into **Not yet specified**.
12
12
  4. **Create the tickets you can specify now** as child issues of the map — then wire blocking edges in a **second pass** (issues need ids before they can reference each other). Wiring sorts them into the frontier and the blocked; everything you can't yet specify stays in the fog — the **Not yet specified** section.
13
- 5. **Fire the research subagents.** For each `research` ticket you just created, spin up a `/yss-research` subagent to resolve it in parallel, capturing its findings on a throwaway `research/<name>` branch with a context pointer from the ticket. `/research` remains only as a deprecated compatibility alias.
13
+ 5. **Dispatch research.** Route independent research tickets to `yss-research` when the runtime supports delegation; otherwise research in the current session. Follow the registered task-package and evidence contracts, and link the resulting sources from the ticket. Read-only intake uses schema v2 with empty write scope; formal research requires a new owner-issued task package. Template maintenance evidence stays in the registered external maintenance directory. Research does not require creating a Git branch.
14
14
  6. Stop — charting is one session's work; it hand-resolves nothing.
@@ -6,7 +6,7 @@
6
6
 
7
7
  Every ticket is either **HITL** — human in the loop, worked _with_ a human who speaks for themselves — or **AFK**, driven by the agent alone. A HITL ticket only resolves through that live exchange; the agent never stands in for the human's side of it (a grilling agent that answers its own questions has broken this).
8
8
 
9
- - **Research** (AFK): Reading documentation, third-party APIs, or local resources like knowledge bases to surface a fact a decision waits on. Resolved by a `/yss-research` **subagent** (`/research` is a deprecated alias). Use when knowledge outside the current working directory is required.
9
+ - **Research** (AFK): Reading documentation, third-party APIs, or local resources to surface a fact a decision waits on. Route to `yss-research`, delegating independent reading when supported. Use when a decision needs evidence unavailable in the current inputs; local evidence and external sources follow the same source policy.
10
10
  - **Prototype** (HITL): Raise the fidelity of the discussion by making a cheap, rough, concrete artifact to react to — an outline, a rough take, a stub, or UI/logic code via the /prototype skill. Links the prototype as an asset. Use when "how should it look" or "how should it behave" is the key question.
11
11
  - **Grilling** (HITL): Conversation. The default case. Always invoke the /grilling and /domain-modeling skills.
12
12
  - **Task** (HITL or AFK): Manual work that must happen before a _decision_ can be made — nothing to decide, prototype, or research, but the discussion is blocked until it's done. Signing up for a service so its API can be judged, provisioning access, moving data so its shape can be seen. This is the one type that _does_ rather than decides — and it earns its place by unblocking a decision, not by delivering the destination. The agent drives it alone where it can (AFK); otherwise it hands the human a precise checklist (HITL). Resolved when the work is done; the answer records what was done and any resulting facts (credentials location, new URLs, row counts) later tickets depend on.
@@ -5,24 +5,22 @@ description: "在 Vue3 YSS UI 中对接 Orval API;核验生成方法、mutator
5
5
 
6
6
  # API 集成 Skill
7
7
 
8
- 本目录是 API 集成的 canonical 技能;历史名称 `api-integration` 仅通过注册表和 实现合同编译器 alias 解析,不再维护第二份内容。
8
+ 本技能的 canonical 名称为 `yss-api-integration`。历史名称 `api-integration` 只由注册表与实现合同编译器解析,不维护第二份内容。
9
9
 
10
- 目录、frontmatter、注册表 ID 和 实现合同编译器 canonical 闭包键均为 `yss-api-integration`;历史名称 `api-integration` 只在注册表和 实现合同编译器 alias 表中解析为本技能。
11
-
12
- ## 📋 目标
10
+ ## 目标
13
11
 
14
12
  帮助 AI 正确使用基于 **Orval** 生成的 API 客户端:
15
13
 
16
- - ✅ 正确导入 API 函数
17
- - ✅ 统一错误处理与 Toast 门禁
18
- - ✅ Loading 状态管理
19
- - ✅ 长整型 ID 精度保持
20
- - ✅ TypeScript 类型安全
14
+ - 正确导入 API 函数
15
+ - 统一错误处理与 Toast 门禁
16
+ - Loading 状态管理
17
+ - 长整型 ID 精度保持
18
+ - TypeScript 类型安全
21
19
 
22
- ## 🔍 前置条件
20
+ ## 前置条件
23
21
 
24
22
  1. **契约状态已明确**:
25
- - 已有生成客户端:可以直接集成。
23
+ - 已有生成客户端:先核验冻结契约、JSON 派生记录和真实导出,输入当前且一致时可以直接集成。
26
24
  - 新增或变更 API:必须先在 `docs/.scratch/<feature>/api/<feature>.yaml` 形成 OpenAPI Draft,经工程基线 / 架构 / Spec Delta 设计和设计审查后 Freeze。冻结的 OpenAPI YAML 是唯一权威,JSON 仅为它的受控派生物。
27
25
  - 如果接口尚未冻结、JSON 派生记录缺失或生成函数不存在,先回到 `yss-product-lifecycle` / `yss-openapi-governance`,不要手写临时路径、DTO 或响应结构。
28
26
  2. **API 已生成**:在目标前端实现仓库中,按其既有的手动代码生成命令(例如 `pnpm generate:api`)刷新 API;本 Harness 不配置、不执行该命令,也不把它加入 CI。
@@ -41,9 +39,9 @@ description: "在 Vue3 YSS UI 中对接 Orval API;核验生成方法、mutator
41
39
  ```
42
40
 
43
41
  1. 读取 `yss-openapi-governance` 产出的 OpenAPI Freeze 记录和 `docs/.scratch/<feature>/api/<feature>-json-export.md`;确认 YAML SHA-256、JSON SHA-256、Redocly CLI 版本、lockfile 引用和 JSON 校验均通过。治理 JSON 的唯一产物路径是 `docs/.scratch/<feature>/api/<feature>.json`。
44
- 2. JSON 导出由 `yss-openapi-governance` 负责。`api-integration` 只接受该 skill 留下的派生记录;记录中的锁定 `redocly bundle` 命令是治理导出证据,不是前端集成任意重跑的入口。
42
+ 2. JSON 导出由 `yss-openapi-governance` 负责。`yss-api-integration` 只接受该 skill 留下的派生记录;记录中的锁定 `redocly bundle` 命令是治理导出证据,不是前端集成任意重跑的入口。
45
43
  3. **受控交接**:若前端实现仓库需要本地输入,批准的 Cross-repo 子合同或项目脚本只能将上述治理 JSON 原样物化为 `<frontend>/openapi/openapi.json`;物化后的 SHA-256 必须与派生记录一致。禁止从 URL、Draft YAML、后端运行时或任意本地文件临时替换输入。
46
- 4. `api-integration` 只核对 JSON 派生记录、交接路径和 SHA-256,并把原始 JSON 交给既有前端代码生成流程;本 Harness 可只读核对目标前端的生成器配置与真实导出,但不修改该配置,不在此仓库执行生成,也不建立生成 CI 门禁。若 JSON SHA 与派生记录不一致,停止交接并回到治理流程。
44
+ 4. `yss-api-integration` 只核对 JSON 派生记录、交接路径和 SHA-256,并把原始 JSON 交给既有前端代码生成流程;本 Harness 可只读核对目标前端的生成器配置与真实导出,但不修改该配置,不在此仓库执行生成,也不建立生成 CI 门禁。若 JSON SHA 与派生记录不一致,停止交接并回到治理流程。
47
45
  5. 目标前端项目在需要时手动运行其既有生成命令、类型检查和受影响组件 / API 测试;将实际命令、结果、生成输入 SHA 和偏离写入 `YSS Skill Execution Result`。
48
46
 
49
47
  ## 真实 mutator 响应契约
@@ -81,44 +79,9 @@ pnpm generate:api
81
79
  - 不得根据文档示例假定工厂一定名为 `getApi()`;Orval `title` 配置会影响真实名称。
82
80
  - 请求/响应 DTO 必须从当前生成的 `schemas` 导入,禁止重复声明。
83
81
 
84
- ## 标准代码骨架
85
-
86
- 以微应用的真实 `getApiApi()` 产物为例:
87
-
88
- ```typescript
89
- import { reactive, ref } from 'vue';
90
- import { getApiApi } from '@/api/generated/quality';
91
- import type { QualityBusinessRuleVO, QualityRulePage } from '@/api/generated/quality/schemas';
92
-
93
- const { pageQualityRule } = getApiApi();
94
-
95
- /** 管理质量规则列表请求和分页状态。 */
96
- export const useQualityRuleList = () => {
97
- const loading = ref(false);
98
- const dataList = ref<QualityBusinessRuleVO[]>([]);
99
- const query = reactive<QualityRulePage>({ pageIndex: 1, pageSize: 20, ruleName: '' });
100
- const total = ref(0);
101
-
102
- /** 加载规则列表。 */
103
- const fetchData = async (): Promise<void> => {
104
- loading.value = true;
105
- try {
106
- const res = await pageQualityRule(query);
107
- dataList.value = res.data ?? [];
108
- total.value = res.totalCount ?? 0;
109
- } catch {
110
- dataList.value = [];
111
- total.value = 0;
112
- } finally {
113
- loading.value = false;
114
- }
115
- };
116
-
117
- return { loading, dataList, query, total, fetchData };
118
- };
119
- ```
82
+ ## 按需示例
120
83
 
121
- > 如果所在项目已生成 `pageQualityRule` 具名导出,直接导入该函数,删除上面的工厂实例行。
84
+ 首次组织列表请求或需比较具名导出与工厂导出时,读取 [Orval 列表示例](references/orval-list-example.md)。示例中的业务名称与响应字段仅作已核验版本的用法说明,目标工程仍消费自己的冻结 DTO 和真实导出。
122
85
 
123
86
  ## 长整型与数值类型
124
87
 
@@ -0,0 +1,38 @@
1
+ ## 标准代码骨架
2
+
3
+ 以微应用的真实 `getApiApi()` 产物为例:
4
+
5
+ ```typescript
6
+ import { reactive, ref } from 'vue';
7
+ import { getApiApi } from '@/api/generated/quality';
8
+ import type { QualityBusinessRuleVO, QualityRulePage } from '@/api/generated/quality/schemas';
9
+
10
+ const { pageQualityRule } = getApiApi();
11
+
12
+ /** 管理质量规则列表请求和分页状态。 */
13
+ export const useQualityRuleList = () => {
14
+ const loading = ref(false);
15
+ const dataList = ref<QualityBusinessRuleVO[]>([]);
16
+ const query = reactive<QualityRulePage>({ pageIndex: 1, pageSize: 20, ruleName: '' });
17
+ const total = ref(0);
18
+
19
+ /** 加载规则列表。 */
20
+ const fetchData = async (): Promise<void> => {
21
+ loading.value = true;
22
+ try {
23
+ const res = await pageQualityRule(query);
24
+ dataList.value = res.data ?? [];
25
+ total.value = res.totalCount ?? 0;
26
+ } catch {
27
+ dataList.value = [];
28
+ total.value = 0;
29
+ } finally {
30
+ loading.value = false;
31
+ }
32
+ };
33
+
34
+ return { loading, dataList, query, total, fetchData };
35
+ };
36
+ ```
37
+
38
+ > 如果所在项目已生成 `pageQualityRule` 具名导出,直接导入该函数,删除上面的工厂实例行。