create-yss-spec 3.5.0 → 3.5.3

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 (882) hide show
  1. package/README.md +6 -2
  2. package/package.json +1 -1
  3. package/src/api/_sync-service.js +31 -6
  4. package/src/cli/args.js +2 -0
  5. package/src/cli/help.js +4 -1
  6. package/src/commands/attach.js +9 -3
  7. package/src/commands/diff.js +1 -0
  8. package/src/commands/doctor.js +1 -0
  9. package/src/commands/init.js +2 -1
  10. package/src/commands/sync.js +1 -0
  11. package/src/family-identity.js +1 -1
  12. package/src/template/asset-runtime.js +59 -49
  13. package/src/template/attach-planner.js +1 -1
  14. package/src/template/distribution-runtime.js +9 -9
  15. package/src/template/instance-runtime.js +9 -9
  16. package/src/template/layout-migration.js +160 -0
  17. package/src/template/migration-runtime.js +2 -2
  18. package/src/template/sync-planner.js +1 -1
  19. package/template/.agents/rules/yss-ai-skills.md +1 -1
  20. package/template/.agents/skills/.strategic-design-skills-manifest.json +7 -8
  21. package/template/.agents/skills/.yss-skills-manifest.json +2 -2
  22. package/template/.agents/skills/alibaba-java-code-style/SKILL.md +1 -1
  23. package/template/.agents/skills/code-review/SKILL.md +6 -6
  24. package/template/.agents/skills/code-review/references/yss-review-standards.md +1 -1
  25. package/template/.agents/skills/codebase-design/SKILL.md +4 -0
  26. package/template/{.codex/skills/improve-codebase-architecture/SKILL.md → .agents/skills/codebase-design/references/architecture-audit.md} +3 -9
  27. package/template/.agents/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  28. package/template/.agents/skills/frontend-commit/SKILL.md +4 -93
  29. package/template/.agents/skills/git-commit-core/SKILL.md +18 -0
  30. package/template/.agents/skills/i-have-adhd/SKILL.md +1 -1
  31. package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  32. package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  33. package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
  34. package/template/.agents/skills/java-backend-commit/SKILL.md +4 -96
  35. package/template/.agents/skills/llm-wiki/SKILL.md +12 -13
  36. package/template/.agents/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  37. package/template/.agents/skills/llm-wiki/references/compile.md +21 -114
  38. package/template/.agents/skills/llm-wiki/references/discover.md +3 -3
  39. package/template/.agents/skills/llm-wiki/references/ingest.md +8 -33
  40. package/template/.agents/skills/llm-wiki/references/lint.md +9 -46
  41. package/template/.agents/skills/llm-wiki/references/query.md +9 -18
  42. package/template/.agents/skills/llm-wiki/references/schema.md +56 -29
  43. package/template/.agents/skills/llm-wiki/references/transactions.md +48 -0
  44. package/template/.agents/skills/llm-wiki/references/writing.md +4 -4
  45. package/template/.agents/skills/llm-wiki/scripts/advise.mjs +46 -58
  46. package/template/.agents/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  47. package/template/.agents/skills/llm-wiki/scripts/core.mjs +262 -0
  48. package/template/.agents/skills/llm-wiki/scripts/extract.mjs +35 -18
  49. package/template/.agents/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  50. package/template/.agents/skills/llm-wiki/scripts/feedback.mjs +51 -0
  51. package/template/.agents/skills/llm-wiki/scripts/inventory.mjs +43 -171
  52. package/template/.agents/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  53. package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  54. package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  55. package/template/.agents/skills/llm-wiki/scripts/migrate.mjs +51 -0
  56. package/template/.agents/skills/llm-wiki/scripts/query.mjs +149 -0
  57. package/template/.agents/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  58. package/template/.agents/skills/llm-wiki/scripts/sources.mjs +166 -0
  59. package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +384 -0
  60. package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  61. package/template/.agents/skills/prototype/LOGIC.md +1 -1
  62. package/template/.agents/skills/prototype/SKILL.md +5 -19
  63. package/template/.agents/skills/prototype-review/SKILL.md +4 -4
  64. package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +11 -11
  65. package/template/.agents/skills/triage/SKILL.md +1 -1
  66. package/template/.agents/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  67. package/template/.agents/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  68. package/template/.agents/skills/yss-backend-spec-review/SKILL.md +1 -1
  69. package/template/.agents/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  70. package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  71. package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  72. package/template/.agents/skills/yss-design-system/SKILL.md +10 -10
  73. package/template/.agents/skills/yss-design-system/references/design-qa-theme.md +3 -3
  74. package/template/.agents/skills/yss-design-system/references/design-system.md +3 -3
  75. package/template/.agents/skills/yss-exception/SKILL.md +1 -1
  76. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  77. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  78. package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  79. package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +11 -9
  80. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
  81. package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  82. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  83. package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  84. package/template/.agents/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  85. package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  86. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  87. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  88. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  89. package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  90. package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -2
  91. package/template/.agents/skills/yss-openapi-governance/SKILL.md +7 -7
  92. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +17 -17
  93. package/template/.agents/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  94. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
  95. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
  96. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +24 -16
  97. package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  98. package/template/.agents/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  99. package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +4 -4
  100. package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  101. package/template/.agents/skills/yss-prototype-stage/SKILL.md +7 -7
  102. package/template/.agents/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  103. package/template/.agents/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  104. package/template/.agents/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  105. package/template/.agents/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  106. package/template/.agents/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  107. package/template/.agents/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  108. package/template/.agents/skills/yss-repository/SKILL.md +2 -2
  109. package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  110. package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  111. package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  112. package/template/.agents/skills/yss-research/SKILL.md +6 -2
  113. package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  114. package/template/.agents/skills/yss-stage-decision/SKILL.md +5 -5
  115. package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  116. package/template/.agents/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  117. package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
  118. package/template/.agents/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  119. package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  120. package/template/.agents/skills/yss-technical-design/SKILL.md +6 -6
  121. package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  122. package/template/.agents/skills/yss-ui/SKILL.md +1 -1
  123. package/template/.agents/skills/yss-up-springboot3/SKILL.md +1 -1
  124. package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
  125. package/template/.agents/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  126. package/template/.codex/skills/alibaba-java-code-style/SKILL.md +1 -1
  127. package/template/.codex/skills/code-review/SKILL.md +6 -6
  128. package/template/.codex/skills/code-review/references/yss-review-standards.md +1 -1
  129. package/template/.codex/skills/codebase-design/SKILL.md +4 -0
  130. package/template/{.pi/skills/improve-codebase-architecture/SKILL.md → .codex/skills/codebase-design/references/architecture-audit.md} +3 -9
  131. package/template/.codex/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  132. package/template/.codex/skills/frontend-commit/SKILL.md +4 -93
  133. package/template/.codex/skills/git-commit-core/SKILL.md +18 -0
  134. package/template/.codex/skills/i-have-adhd/SKILL.md +1 -1
  135. package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  136. package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  137. package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
  138. package/template/.codex/skills/java-backend-commit/SKILL.md +4 -96
  139. package/template/.codex/skills/llm-wiki/SKILL.md +12 -13
  140. package/template/.codex/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  141. package/template/.codex/skills/llm-wiki/references/compile.md +21 -114
  142. package/template/.codex/skills/llm-wiki/references/discover.md +3 -3
  143. package/template/.codex/skills/llm-wiki/references/ingest.md +8 -33
  144. package/template/.codex/skills/llm-wiki/references/lint.md +9 -46
  145. package/template/.codex/skills/llm-wiki/references/query.md +9 -18
  146. package/template/.codex/skills/llm-wiki/references/schema.md +56 -29
  147. package/template/.codex/skills/llm-wiki/references/transactions.md +48 -0
  148. package/template/.codex/skills/llm-wiki/references/writing.md +4 -4
  149. package/template/.codex/skills/llm-wiki/scripts/advise.mjs +46 -58
  150. package/template/.codex/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  151. package/template/.codex/skills/llm-wiki/scripts/core.mjs +262 -0
  152. package/template/.codex/skills/llm-wiki/scripts/extract.mjs +35 -18
  153. package/template/.codex/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  154. package/template/.codex/skills/llm-wiki/scripts/feedback.mjs +51 -0
  155. package/template/.codex/skills/llm-wiki/scripts/inventory.mjs +43 -171
  156. package/template/.codex/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  157. package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  158. package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  159. package/template/.codex/skills/llm-wiki/scripts/migrate.mjs +51 -0
  160. package/template/.codex/skills/llm-wiki/scripts/query.mjs +149 -0
  161. package/template/.codex/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  162. package/template/.codex/skills/llm-wiki/scripts/sources.mjs +166 -0
  163. package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +384 -0
  164. package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  165. package/template/.codex/skills/prototype/LOGIC.md +1 -1
  166. package/template/.codex/skills/prototype/SKILL.md +5 -19
  167. package/template/.codex/skills/prototype-review/SKILL.md +4 -4
  168. package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +11 -11
  169. package/template/.codex/skills/triage/SKILL.md +1 -1
  170. package/template/.codex/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  171. package/template/.codex/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  172. package/template/.codex/skills/yss-backend-spec-review/SKILL.md +1 -1
  173. package/template/.codex/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  174. package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  175. package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  176. package/template/.codex/skills/yss-design-system/SKILL.md +10 -10
  177. package/template/.codex/skills/yss-design-system/references/design-qa-theme.md +3 -3
  178. package/template/.codex/skills/yss-design-system/references/design-system.md +3 -3
  179. package/template/.codex/skills/yss-exception/SKILL.md +1 -1
  180. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  181. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  182. package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  183. package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +11 -9
  184. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
  185. package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  186. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  187. package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  188. package/template/.codex/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  189. package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  190. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  191. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  192. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  193. package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  194. package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -2
  195. package/template/.codex/skills/yss-openapi-governance/SKILL.md +7 -7
  196. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +17 -17
  197. package/template/.codex/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  198. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
  199. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
  200. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +24 -16
  201. package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  202. package/template/.codex/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  203. package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +4 -4
  204. package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  205. package/template/.codex/skills/yss-prototype-stage/SKILL.md +7 -7
  206. package/template/.codex/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  207. package/template/.codex/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  208. package/template/.codex/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  209. package/template/.codex/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  210. package/template/.codex/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  211. package/template/.codex/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  212. package/template/.codex/skills/yss-repository/SKILL.md +2 -2
  213. package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  214. package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  215. package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  216. package/template/.codex/skills/yss-research/SKILL.md +6 -2
  217. package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  218. package/template/.codex/skills/yss-stage-decision/SKILL.md +5 -5
  219. package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  220. package/template/.codex/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  221. package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
  222. package/template/.codex/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  223. package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  224. package/template/.codex/skills/yss-technical-design/SKILL.md +6 -6
  225. package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  226. package/template/.codex/skills/yss-ui/SKILL.md +1 -1
  227. package/template/.codex/skills/yss-up-springboot3/SKILL.md +1 -1
  228. package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
  229. package/template/.codex/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  230. package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +1 -1
  231. package/template/.cursor/skills/code-review/SKILL.md +6 -6
  232. package/template/.cursor/skills/code-review/references/yss-review-standards.md +1 -1
  233. package/template/.cursor/skills/codebase-design/SKILL.md +4 -0
  234. package/template/.cursor/skills/{improve-codebase-architecture/SKILL.md → codebase-design/references/architecture-audit.md} +3 -9
  235. package/template/.cursor/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  236. package/template/.cursor/skills/frontend-commit/SKILL.md +4 -93
  237. package/template/.cursor/skills/git-commit-core/SKILL.md +18 -0
  238. package/template/.cursor/skills/i-have-adhd/SKILL.md +1 -1
  239. package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  240. package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  241. package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
  242. package/template/.cursor/skills/java-backend-commit/SKILL.md +4 -96
  243. package/template/.cursor/skills/llm-wiki/SKILL.md +12 -13
  244. package/template/.cursor/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  245. package/template/.cursor/skills/llm-wiki/references/compile.md +21 -114
  246. package/template/.cursor/skills/llm-wiki/references/discover.md +3 -3
  247. package/template/.cursor/skills/llm-wiki/references/ingest.md +8 -33
  248. package/template/.cursor/skills/llm-wiki/references/lint.md +9 -46
  249. package/template/.cursor/skills/llm-wiki/references/query.md +9 -18
  250. package/template/.cursor/skills/llm-wiki/references/schema.md +56 -29
  251. package/template/.cursor/skills/llm-wiki/references/transactions.md +48 -0
  252. package/template/.cursor/skills/llm-wiki/references/writing.md +4 -4
  253. package/template/.cursor/skills/llm-wiki/scripts/advise.mjs +46 -58
  254. package/template/.cursor/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  255. package/template/.cursor/skills/llm-wiki/scripts/core.mjs +262 -0
  256. package/template/.cursor/skills/llm-wiki/scripts/extract.mjs +35 -18
  257. package/template/.cursor/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  258. package/template/.cursor/skills/llm-wiki/scripts/feedback.mjs +51 -0
  259. package/template/.cursor/skills/llm-wiki/scripts/inventory.mjs +43 -171
  260. package/template/.cursor/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  261. package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  262. package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  263. package/template/.cursor/skills/llm-wiki/scripts/migrate.mjs +51 -0
  264. package/template/.cursor/skills/llm-wiki/scripts/query.mjs +149 -0
  265. package/template/.cursor/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  266. package/template/.cursor/skills/llm-wiki/scripts/sources.mjs +166 -0
  267. package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +384 -0
  268. package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  269. package/template/.cursor/skills/prototype/LOGIC.md +1 -1
  270. package/template/.cursor/skills/prototype/SKILL.md +5 -19
  271. package/template/.cursor/skills/prototype-review/SKILL.md +4 -4
  272. package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +11 -11
  273. package/template/.cursor/skills/triage/SKILL.md +1 -1
  274. package/template/.cursor/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  275. package/template/.cursor/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  276. package/template/.cursor/skills/yss-backend-spec-review/SKILL.md +1 -1
  277. package/template/.cursor/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  278. package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  279. package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  280. package/template/.cursor/skills/yss-design-system/SKILL.md +10 -10
  281. package/template/.cursor/skills/yss-design-system/references/design-qa-theme.md +3 -3
  282. package/template/.cursor/skills/yss-design-system/references/design-system.md +3 -3
  283. package/template/.cursor/skills/yss-exception/SKILL.md +1 -1
  284. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  285. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  286. package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  287. package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +11 -9
  288. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
  289. package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  290. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  291. package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  292. package/template/.cursor/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  293. package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  294. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  295. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  296. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  297. package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  298. package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -2
  299. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +7 -7
  300. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +17 -17
  301. package/template/.cursor/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  302. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
  303. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
  304. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +24 -16
  305. package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  306. package/template/.cursor/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  307. package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +4 -4
  308. package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  309. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +7 -7
  310. package/template/.cursor/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  311. package/template/.cursor/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  312. package/template/.cursor/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  313. package/template/.cursor/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  314. package/template/.cursor/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  315. package/template/.cursor/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  316. package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
  317. package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  318. package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  319. package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  320. package/template/.cursor/skills/yss-research/SKILL.md +6 -2
  321. package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  322. package/template/.cursor/skills/yss-stage-decision/SKILL.md +5 -5
  323. package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  324. package/template/.cursor/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  325. package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
  326. package/template/.cursor/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  327. package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  328. package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -6
  329. package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  330. package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
  331. package/template/.cursor/skills/yss-up-springboot3/SKILL.md +1 -1
  332. package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
  333. package/template/.cursor/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  334. package/template/.cursorrules +1 -1
  335. package/template/.pi/skills/alibaba-java-code-style/SKILL.md +1 -1
  336. package/template/.pi/skills/code-review/SKILL.md +6 -6
  337. package/template/.pi/skills/code-review/references/yss-review-standards.md +1 -1
  338. package/template/.pi/skills/codebase-design/SKILL.md +4 -0
  339. package/template/{.agents/skills/improve-codebase-architecture/SKILL.md → .pi/skills/codebase-design/references/architecture-audit.md} +3 -9
  340. package/template/.pi/skills/cross-repo-implementation-routing/SKILL.md +2 -2
  341. package/template/.pi/skills/frontend-commit/SKILL.md +4 -93
  342. package/template/.pi/skills/git-commit-core/SKILL.md +18 -0
  343. package/template/.pi/skills/i-have-adhd/SKILL.md +1 -1
  344. package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +1 -1
  345. package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
  346. package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
  347. package/template/.pi/skills/java-backend-commit/SKILL.md +4 -96
  348. package/template/.pi/skills/llm-wiki/SKILL.md +12 -13
  349. package/template/.pi/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
  350. package/template/.pi/skills/llm-wiki/references/compile.md +21 -114
  351. package/template/.pi/skills/llm-wiki/references/discover.md +3 -3
  352. package/template/.pi/skills/llm-wiki/references/ingest.md +8 -33
  353. package/template/.pi/skills/llm-wiki/references/lint.md +9 -46
  354. package/template/.pi/skills/llm-wiki/references/query.md +9 -18
  355. package/template/.pi/skills/llm-wiki/references/schema.md +56 -29
  356. package/template/.pi/skills/llm-wiki/references/transactions.md +48 -0
  357. package/template/.pi/skills/llm-wiki/references/writing.md +4 -4
  358. package/template/.pi/skills/llm-wiki/scripts/advise.mjs +46 -58
  359. package/template/.pi/skills/llm-wiki/scripts/advise.test.mjs +11 -16
  360. package/template/.pi/skills/llm-wiki/scripts/core.mjs +262 -0
  361. package/template/.pi/skills/llm-wiki/scripts/extract.mjs +35 -18
  362. package/template/.pi/skills/llm-wiki/scripts/extract.test.mjs +5 -8
  363. package/template/.pi/skills/llm-wiki/scripts/feedback.mjs +51 -0
  364. package/template/.pi/skills/llm-wiki/scripts/inventory.mjs +43 -171
  365. package/template/.pi/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
  366. package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
  367. package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
  368. package/template/.pi/skills/llm-wiki/scripts/migrate.mjs +51 -0
  369. package/template/.pi/skills/llm-wiki/scripts/query.mjs +149 -0
  370. package/template/.pi/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
  371. package/template/.pi/skills/llm-wiki/scripts/sources.mjs +166 -0
  372. package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +384 -0
  373. package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +354 -0
  374. package/template/.pi/skills/prototype/LOGIC.md +1 -1
  375. package/template/.pi/skills/prototype/SKILL.md +5 -19
  376. package/template/.pi/skills/prototype-review/SKILL.md +4 -4
  377. package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +11 -11
  378. package/template/.pi/skills/triage/SKILL.md +1 -1
  379. package/template/.pi/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
  380. package/template/.pi/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
  381. package/template/.pi/skills/yss-backend-spec-review/SKILL.md +1 -1
  382. package/template/.pi/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
  383. package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
  384. package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  385. package/template/.pi/skills/yss-design-system/SKILL.md +10 -10
  386. package/template/.pi/skills/yss-design-system/references/design-qa-theme.md +3 -3
  387. package/template/.pi/skills/yss-design-system/references/design-system.md +3 -3
  388. package/template/.pi/skills/yss-exception/SKILL.md +1 -1
  389. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
  390. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
  391. package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
  392. package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +11 -9
  393. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
  394. package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
  395. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
  396. package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
  397. package/template/.pi/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
  398. package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
  399. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
  400. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
  401. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
  402. package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
  403. package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -2
  404. package/template/.pi/skills/yss-openapi-governance/SKILL.md +7 -7
  405. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +17 -17
  406. package/template/.pi/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
  407. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
  408. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
  409. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +24 -16
  410. package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
  411. package/template/.pi/skills/yss-product-lifecycle/references/request-triage.md +2 -0
  412. package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +4 -4
  413. package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
  414. package/template/.pi/skills/yss-prototype-stage/SKILL.md +7 -7
  415. package/template/.pi/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
  416. package/template/.pi/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
  417. package/template/.pi/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
  418. package/template/.pi/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
  419. package/template/.pi/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
  420. package/template/.pi/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
  421. package/template/.pi/skills/yss-repository/SKILL.md +2 -2
  422. package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
  423. package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
  424. package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
  425. package/template/.pi/skills/yss-research/SKILL.md +6 -2
  426. package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
  427. package/template/.pi/skills/yss-stage-decision/SKILL.md +5 -5
  428. package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
  429. package/template/.pi/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
  430. package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
  431. package/template/.pi/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
  432. package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
  433. package/template/.pi/skills/yss-technical-design/SKILL.md +6 -6
  434. package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +1 -1
  435. package/template/.pi/skills/yss-ui/SKILL.md +1 -1
  436. package/template/.pi/skills/yss-up-springboot3/SKILL.md +1 -1
  437. package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
  438. package/template/.pi/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
  439. package/template/{docs → .template-spec}/adr/README.md +1 -1
  440. package/template/{docs → .template-spec}/agents/README.md +2 -2
  441. package/template/{docs → .template-spec}/agents/backend-architecture-profiles.md +2 -2
  442. package/template/{docs → .template-spec}/agents/digital-human-roles.md +6 -6
  443. package/template/{docs → .template-spec}/agents/digital-human-roles.yaml +6 -6
  444. package/template/{docs → .template-spec}/agents/gitlab-workflow-skills.md +2 -2
  445. package/template/{docs → .template-spec}/agents/issue-tracker.md +1 -1
  446. package/template/{docs → .template-spec}/agents/skill-migrations.md +17 -2
  447. package/template/{docs → .template-spec}/agents/triage-labels.md +1 -1
  448. package/template/{docs → .template-spec}/agents/yss-skill-registry.yaml +12 -31
  449. package/template/{docs → .template-spec}/architecture/README.md +5 -36
  450. package/template/{docs → .template-spec}/architecture/templates/tech-design-template.md +3 -1
  451. package/template/{docs → .template-spec}/design/README.md +12 -11
  452. package/template/{docs → .template-spec}/design/design.md +19 -19
  453. package/template/{docs/design/templates/interaction-spec-template.md → .template-spec/design/templates/examples/model-publishing-interaction.example.md} +5 -3
  454. package/template/{docs/design/templates/state-matrix-template.md → .template-spec/design/templates/examples/model-publishing-state-matrix.example.md} +3 -1
  455. package/template/.template-spec/design/templates/interaction-spec-template.md +61 -0
  456. package/template/{docs → .template-spec}/design/templates/product-overview-design-template.md +11 -11
  457. package/template/{docs → .template-spec}/design/templates/prototype-evidence-template.yaml +4 -4
  458. package/template/{docs → .template-spec}/design/templates/prototype-review-checklist.md +1 -1
  459. package/template/.template-spec/design/templates/state-matrix-template.md +29 -0
  460. package/template/.template-spec/design/tokens/.design-md-projection.json +13 -0
  461. package/template/{docs → .template-spec}/engineering/backend-platforms.md +1 -1
  462. package/template/{docs → .template-spec}/plan/entry-review.md +8 -4
  463. package/template/{docs → .template-spec}/plan/templates/competitive-analysis-template.md +2 -2
  464. package/template/{docs → .template-spec}/plan/templates/plan-template.md +1 -1
  465. package/template/{docs → .template-spec}/process/contract-reading.md +25 -1
  466. package/template/{docs → .template-spec}/process/lifecycle-artifact-map.md +5 -5
  467. package/template/.template-spec/process/lifecycle-registry-baseline.json +255 -0
  468. package/template/{docs → .template-spec}/process/lifecycle-registry.yaml +25 -12
  469. package/template/{docs → .template-spec}/process/plan-migration.md +1 -1
  470. package/template/.template-spec/process/research-completion.md +23 -0
  471. package/template/{docs → .template-spec}/process/schemas/digital-human-task-package.schema.json +209 -6
  472. package/template/{docs → .template-spec}/process/schemas/frontend-implementation-evidence.schema.json +7 -15
  473. package/template/{docs → .template-spec}/process/schemas/lifecycle-checkpoint.schema.json +15 -0
  474. package/template/{docs → .template-spec}/process/schemas/lifecycle-registry.schema.json +1 -1
  475. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v3.schema.json +1 -1
  476. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v4.schema.json +1 -1
  477. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v5.schema.json +1 -1
  478. package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff.schema.json +1 -1
  479. package/template/{docs → .template-spec}/process/stage-tracking.md +1 -1
  480. package/template/.template-spec/process/subagent-collaboration.md +21 -0
  481. package/template/{docs → .template-spec}/process/templates/frontend-implementation-verification-template.yaml +15 -1
  482. package/template/{docs → .template-spec}/templates/build-architecture-checklist-template.md +2 -2
  483. package/template/{docs → .template-spec}/templates/digital-human-runtime-profile-template.md +2 -2
  484. package/template/{docs → .template-spec}/templates/grok-bot-profile-template.md +1 -1
  485. package/template/{docs → .template-spec}/templates/local-parent-ticket-template.md +1 -1
  486. package/template/.template-spec/templates/release-note-template.md +29 -0
  487. package/template/.template-spec/templates/retro-report-template.md +24 -0
  488. package/template/{docs → .template-spec}/templates/subagent-task-package-template.md +3 -3
  489. package/template/.template-spec/templates/verification-record-template.md +64 -0
  490. package/template/{docs → .template-spec}/templates/vertical-slice-ticket-template.md +5 -10
  491. package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
  492. package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +4 -4
  493. package/template/AGENTS.md +13 -13
  494. package/template/CONTEXT.md +8 -4
  495. package/template/README.md +33 -45
  496. package/template/scripts/backend-delivery +1 -1
  497. package/template/scripts/contract +5 -5
  498. package/template/scripts/lib/api-contract-decision.mjs +1 -1
  499. package/template/scripts/lib/approved-execution-context.mjs +5 -5
  500. package/template/scripts/lib/backend-delivery.mjs +4 -4
  501. package/template/scripts/lib/backend-platform.mjs +1 -1
  502. package/template/scripts/lib/backend-review.mjs +1 -1
  503. package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
  504. package/template/scripts/lib/backend-standards-coverage.mjs +2 -2
  505. package/template/scripts/lib/context-reconciliation.mjs +1 -1
  506. package/template/scripts/lib/contract-views.mjs +66 -11
  507. package/template/scripts/lib/delivery-preflight.mjs +6 -6
  508. package/template/scripts/lib/design-md.mjs +2 -2
  509. package/template/scripts/lib/digital-human-roles.mjs +2 -2
  510. package/template/scripts/lib/execution-evidence.mjs +51 -0
  511. package/template/scripts/lib/existing-backend-architecture.mjs +1 -1
  512. package/template/scripts/lib/existing-ui-baseline.mjs +1 -1
  513. package/template/scripts/lib/frontend-delivery.mjs +2 -2
  514. package/template/scripts/lib/governance-layout.mjs +74 -0
  515. package/template/scripts/lib/harness-execution-scope.mjs +3 -3
  516. package/template/scripts/lib/implementation-contract-compiler.mjs +2 -0
  517. package/template/scripts/lib/lifecycle-context-query.mjs +26 -6
  518. package/template/scripts/lib/lifecycle-registry.mjs +46 -7
  519. package/template/scripts/lib/lifecycle-status.mjs +137 -0
  520. package/template/scripts/lib/lifecycle-transition.mjs +90 -11
  521. package/template/scripts/lib/maintenance-research.mjs +63 -0
  522. package/template/scripts/lib/openapi-draft-validation.mjs +1 -1
  523. package/template/scripts/lib/plan-spec-entry-view.mjs +48 -0
  524. package/template/scripts/lib/plan-spec-entry.mjs +3 -3
  525. package/template/scripts/lib/read-only-intake.mjs +132 -0
  526. package/template/scripts/lib/skill-registry.mjs +10 -9
  527. package/template/scripts/lib/skill-supply-chain.mjs +5 -1
  528. package/template/scripts/lib/slice-contract-preparation.mjs +3 -3
  529. package/template/scripts/lib/slice-contract.mjs +1 -1
  530. package/template/scripts/lib/slice-repositories.mjs +1 -1
  531. package/template/scripts/lib/slice-task-package.mjs +4 -4
  532. package/template/scripts/lib/stage-tracking-migration.mjs +2 -2
  533. package/template/scripts/lib/stage-tracking.mjs +5 -5
  534. package/template/scripts/lib/strategic-feedback.mjs +2 -2
  535. package/template/scripts/lib/strategic-handoff-routing.mjs +2 -2
  536. package/template/scripts/lib/strategic-handoff.mjs +15 -15
  537. package/template/scripts/lib/task-package-schema.mjs +2 -2
  538. package/template/scripts/lib/task-package.mjs +10 -3
  539. package/template/scripts/lib/technical-design-boundary.mjs +1 -1
  540. package/template/scripts/lib/user-decision.mjs +2 -1
  541. package/template/scripts/lifecycle-status +14 -0
  542. package/template/scripts/plan-spec-entry +21 -0
  543. package/template/scripts/prepare-read-only-intake +16 -0
  544. package/template/scripts/run-read-only-intake +14 -0
  545. package/template/scripts/strategic-consumer-entry +1 -1
  546. package/template/scripts/strategic-handoff +1 -1
  547. package/template/scripts/verify-digital-human-task-package +2 -2
  548. package/template/scripts/verify-frontend-implementation-evidence +25 -2
  549. package/template/scripts/verify-governance-layout +15 -0
  550. package/template/scripts/verify-lifecycle-checkpoint +1 -1
  551. package/template/scripts/verify-maintenance-research +13 -0
  552. package/template/scripts/verify-project-instance +2 -0
  553. package/template/scripts/verify-scaffold-architecture-decisions +1 -1
  554. package/template/scripts/verify-strategic-context-import +3 -3
  555. package/template/skills-lock.json +82 -139
  556. package/template.manifest.json +135 -46
  557. package/template.snapshot.json +5 -6
  558. package/template/.agents/skills/grill-with-docs/SKILL.md +0 -20
  559. package/template/.agents/skills/grill-with-docs/agents/openai.yaml +0 -5
  560. package/template/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  561. package/template/.agents/skills/prototype/UI.md +0 -112
  562. package/template/.agents/skills/setup-matt-pocock-skills/domain.md +0 -37
  563. package/template/.agents/skills/to-questionnaire/SKILL.md +0 -55
  564. package/template/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
  565. package/template/.agents/skills/wait-what/SKILL.md +0 -7
  566. package/template/.agents/skills/wait-what/agents/openai.yaml +0 -5
  567. package/template/.codex/skills/data-analytics/.app.json +0 -84
  568. package/template/.codex/skills/data-analytics/.codex-plugin/plugin.json +0 -66
  569. package/template/.codex/skills/data-analytics/.mcp.json +0 -30
  570. package/template/.codex/skills/data-analytics/AGENTS.md +0 -20
  571. package/template/.codex/skills/data-analytics/DEPENDENCIES.MD +0 -27
  572. package/template/.codex/skills/data-analytics/README.md +0 -60
  573. package/template/.codex/skills/data-analytics/__yss_dotfile__.gitignore +0 -2
  574. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html +0 -16
  575. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part001 +0 -1
  576. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part002 +0 -1
  577. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part003 +0 -1
  578. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part004 +0 -1
  579. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part005 +0 -1
  580. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part006 +0 -1
  581. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html +0 -16
  582. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part001 +0 -1
  583. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part002 +0 -1
  584. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part003 +0 -1
  585. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part004 +0 -1
  586. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part005 +0 -1
  587. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part006 +0 -1
  588. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part007 +0 -1
  589. package/template/.codex/skills/data-analytics/assets/datascience-small.svg +0 -5
  590. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html +0 -16
  591. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part001 +0 -1
  592. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part002 +0 -1
  593. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part003 +0 -1
  594. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part004 +0 -1
  595. package/template/.codex/skills/data-analytics/assets/datascience.png +0 -0
  596. package/template/.codex/skills/data-analytics/assets/datascience.svg +0 -10
  597. package/template/.codex/skills/data-analytics/mcp/server.cjs +0 -2964
  598. package/template/.codex/skills/data-analytics/package-lock.json +0 -3048
  599. package/template/.codex/skills/data-analytics/package.json +0 -43
  600. package/template/.codex/skills/data-analytics/scripts/normalize-widget-assets.mjs +0 -75
  601. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/SKILL.md +0 -137
  602. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/agents/openai.yaml +0 -6
  603. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/references/quality-checks.md +0 -29
  604. package/template/.codex/skills/data-analytics/skills/build-dashboard/SKILL.md +0 -148
  605. package/template/.codex/skills/data-analytics/skills/build-dashboard/agents/openai.yaml +0 -6
  606. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/bi-platform-dashboard.md +0 -18
  607. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/html-dashboard.md +0 -24
  608. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/mcp-artifact-dashboard.md +0 -71
  609. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/streamlit-dashboard.md +0 -85
  610. package/template/.codex/skills/data-analytics/skills/build-report/SKILL.md +0 -207
  611. package/template/.codex/skills/data-analytics/skills/build-report/agents/openai.yaml +0 -6
  612. package/template/.codex/skills/data-analytics/skills/build-report/assets/executive-report-shell.html +0 -70
  613. package/template/.codex/skills/data-analytics/skills/build-report/assets/technical-report-shell.html +0 -66
  614. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/SKILL.md +0 -108
  615. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/agents/openai.yaml +0 -6
  616. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/__init__.py +0 -1
  617. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/cli.py +0 -52
  618. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/constants.py +0 -61
  619. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/docx_writer.py +0 -362
  620. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/html_parser.py +0 -829
  621. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/model.py +0 -30
  622. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/plan.py +0 -127
  623. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/quality.py +0 -374
  624. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/rendering.py +0 -613
  625. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/table_utils.py +0 -54
  626. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/utils.py +0 -16
  627. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc_plan.py +0 -9
  628. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/tests/test_delivery_plan.py +0 -45
  629. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/SKILL.md +0 -77
  630. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/agents/openai.yaml +0 -6
  631. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/scripts/report_to_google_slides.py +0 -2379
  632. package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/SKILL.md +0 -88
  633. package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/agents/openai.yaml +0 -6
  634. package/template/.codex/skills/data-analytics/skills/build-report/specifications/executive-report.md +0 -97
  635. package/template/.codex/skills/data-analytics/skills/build-report/specifications/mcp-app-report.md +0 -59
  636. package/template/.codex/skills/data-analytics/skills/build-report/specifications/technical-report.md +0 -75
  637. package/template/.codex/skills/data-analytics/skills/design-kpis/SKILL.md +0 -103
  638. package/template/.codex/skills/data-analytics/skills/design-kpis/agents/openai.yaml +0 -6
  639. package/template/.codex/skills/data-analytics/skills/gather-business-context/SKILL.md +0 -68
  640. package/template/.codex/skills/data-analytics/skills/gather-business-context/agents/openai.yaml +0 -6
  641. package/template/.codex/skills/data-analytics/skills/index/SKILL.md +0 -251
  642. package/template/.codex/skills/data-analytics/skills/index/agents/openai.yaml +0 -6
  643. package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/SKILL.md +0 -131
  644. package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/agents/openai.yaml +0 -6
  645. package/template/.codex/skills/data-analytics/skills/kpi-reporting/SKILL.md +0 -141
  646. package/template/.codex/skills/data-analytics/skills/kpi-reporting/agents/openai.yaml +0 -6
  647. package/template/.codex/skills/data-analytics/skills/kpi-reporting/references/report-templates.md +0 -32
  648. package/template/.codex/skills/data-analytics/skills/market-sizing/SKILL.md +0 -106
  649. package/template/.codex/skills/data-analytics/skills/market-sizing/agents/openai.yaml +0 -6
  650. package/template/.codex/skills/data-analytics/skills/metric-diagnostics/SKILL.md +0 -130
  651. package/template/.codex/skills/data-analytics/skills/metric-diagnostics/agents/openai.yaml +0 -6
  652. package/template/.codex/skills/data-analytics/skills/product-business-analysis/SKILL.md +0 -141
  653. package/template/.codex/skills/data-analytics/skills/product-business-analysis/agents/openai.yaml +0 -6
  654. package/template/.codex/skills/data-analytics/skills/spreadsheets/SKILL.md +0 -178
  655. package/template/.codex/skills/data-analytics/skills/spreadsheets/agents/openai.yaml +0 -9
  656. package/template/.codex/skills/data-analytics/skills/spreadsheets/assets/file-spreadsheet.png +0 -0
  657. package/template/.codex/skills/data-analytics/skills/spreadsheets/charts.md +0 -31
  658. package/template/.codex/skills/data-analytics/skills/spreadsheets/references/artifact_tool_api.md +0 -466
  659. package/template/.codex/skills/data-analytics/skills/spreadsheets/style_guidelines.md +0 -99
  660. package/template/.codex/skills/data-analytics/skills/user-context/SKILL.md +0 -197
  661. package/template/.codex/skills/data-analytics/skills/user-context/agents/openai.yaml +0 -6
  662. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/automation-config.md +0 -26
  663. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/source-category-config.json +0 -51
  664. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/user-context-config.md +0 -66
  665. package/template/.codex/skills/data-analytics/skills/user-context/references/automation.md +0 -69
  666. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-examples.md +0 -204
  667. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-state-template.json +0 -87
  668. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding.md +0 -497
  669. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/connector-playbook.md +0 -74
  670. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/setup.md +0 -65
  671. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/skill-template.md +0 -160
  672. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/source-intake.md +0 -75
  673. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/weekly-polling-automation.md +0 -96
  674. package/template/.codex/skills/data-analytics/skills/user-context/references/source-category-runtime.md +0 -263
  675. package/template/.codex/skills/data-analytics/skills/user-context/scripts/data_analytics_preflight.py +0 -1462
  676. package/template/.codex/skills/data-analytics/skills/user-context/scripts/init_user_context_state.py +0 -128
  677. package/template/.codex/skills/data-analytics/skills/user-context/scripts/reset_user_context_state.py +0 -101
  678. package/template/.codex/skills/data-analytics/skills/user-context/scripts/validate_user_context_preflight.py +0 -499
  679. package/template/.codex/skills/data-analytics/skills/user-context/tests/test_state_helpers.py +0 -978
  680. package/template/.codex/skills/data-analytics/skills/validate-data/SKILL.md +0 -126
  681. package/template/.codex/skills/data-analytics/skills/validate-data/agents/openai.yaml +0 -6
  682. package/template/.codex/skills/data-analytics/skills/validate-data/references/validation-methods.md +0 -70
  683. package/template/.codex/skills/data-analytics/skills/visualize-data/SKILL.md +0 -157
  684. package/template/.codex/skills/data-analytics/skills/visualize-data/agents/openai.yaml +0 -6
  685. package/template/.codex/skills/data-analytics/skills/visualize-data/references/seaborn-templates.md +0 -774
  686. package/template/.codex/skills/data-analytics/src/DESIGN.md +0 -222
  687. package/template/.codex/skills/data-analytics/src/analytics-app/App.tsx +0 -3666
  688. package/template/.codex/skills/data-analytics/src/analytics-app/analytics-layout.test.mjs +0 -136
  689. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartFrame.tsx +0 -54
  690. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartLegend.tsx +0 -96
  691. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartRenderer.tsx +0 -1647
  692. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartTooltip.tsx +0 -245
  693. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-app-helpers.tsx +0 -462
  694. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-capabilities.ts +0 -107
  695. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-compatibility.ts +0 -164
  696. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-contract.ts +0 -192
  697. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-theme.ts +0 -203
  698. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-tokens.css +0 -619
  699. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-transforms.ts +0 -402
  700. package/template/.codex/skills/data-analytics/src/analytics-app/fonts/SystemSansVariableVF.woff2 +0 -0
  701. package/template/.codex/skills/data-analytics/src/analytics-app/imageExport.ts +0 -370
  702. package/template/.codex/skills/data-analytics/src/analytics-app/layout/AnalyticsLayoutCanvas.tsx +0 -536
  703. package/template/.codex/skills/data-analytics/src/analytics-app/layout/RichMarkdown.tsx +0 -681
  704. package/template/.codex/skills/data-analytics/src/analytics-app/layout/analyticsLayoutCore.ts +0 -164
  705. package/template/.codex/skills/data-analytics/src/analytics-app/main.tsx +0 -21
  706. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/chart_contract.py +0 -472
  707. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/check_analytics_app_runtime_links.py +0 -75
  708. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/design_contract.py +0 -142
  709. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/package_utils.py +0 -142
  710. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/tests/test_package_utils.py +0 -377
  711. package/template/.codex/skills/data-analytics/src/analytics-app/styles.css +0 -3468
  712. package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.d.ts +0 -44
  713. package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.jsx +0 -639
  714. package/template/.codex/skills/data-analytics/src/analytics-app/tables/data-table.css +0 -327
  715. package/template/.codex/skills/data-analytics/src/analytics-app/tokens.css +0 -225
  716. package/template/.codex/skills/data-analytics/src/analytics-app/types.ts +0 -204
  717. package/template/.codex/skills/data-analytics/src/analytics-app-core.md +0 -85
  718. package/template/.codex/skills/data-analytics/src/codex-style-contract.md +0 -30
  719. package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.html +0 -12
  720. package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.jsx +0 -1008
  721. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.css +0 -2117
  722. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.html +0 -122
  723. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.js +0 -3588
  724. package/template/.codex/skills/data-analytics/src/datascience-table-widget.css +0 -483
  725. package/template/.codex/skills/data-analytics/src/datascience-table-widget.html +0 -32
  726. package/template/.codex/skills/data-analytics/src/datascience-table-widget.js +0 -333
  727. package/template/.codex/skills/data-analytics/src/mcp-host.js +0 -153
  728. package/template/.codex/skills/data-analytics/src/recharts-config.js +0 -315
  729. package/template/.codex/skills/data-analytics/src/recharts-renderer.jsx +0 -294
  730. package/template/.codex/skills/data-analytics/src/sql-source-view.css +0 -33
  731. package/template/.codex/skills/data-analytics/src/sql-source-view.js +0 -157
  732. package/template/.codex/skills/data-analytics/src/styles/codex-theme.css +0 -121
  733. package/template/.codex/skills/data-analytics/src/table-renderer.jsx +0 -28
  734. package/template/.codex/skills/data-analytics/tests/chart-transforms.test.mjs +0 -87
  735. package/template/.codex/skills/data-analytics/tests/funnel-smoke.html +0 -105
  736. package/template/.codex/skills/data-analytics/tests/inline-widget-compare.html +0 -233
  737. package/template/.codex/skills/data-analytics/tests/mcp-server.test.mjs +0 -1500
  738. package/template/.codex/skills/data-analytics/tests/native-style-contract.test.mjs +0 -219
  739. package/template/.codex/skills/data-analytics/tests/recharts-config.test.mjs +0 -144
  740. package/template/.codex/skills/data-analytics/tests/recharts-renderer.test.mjs +0 -11
  741. package/template/.codex/skills/data-analytics/tests/rich-markdown.test.mjs +0 -54
  742. package/template/.codex/skills/data-analytics/tests/widget-render-harness.html +0 -321
  743. package/template/.codex/skills/data-analytics/tsconfig.json +0 -19
  744. package/template/.codex/skills/data-analytics/vite.config.ts +0 -46
  745. package/template/.codex/skills/grill-with-docs/SKILL.md +0 -20
  746. package/template/.codex/skills/grill-with-docs/agents/openai.yaml +0 -5
  747. package/template/.codex/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  748. package/template/.codex/skills/prototype/UI.md +0 -112
  749. package/template/.codex/skills/setup-matt-pocock-skills/domain.md +0 -37
  750. package/template/.codex/skills/to-questionnaire/SKILL.md +0 -55
  751. package/template/.codex/skills/to-questionnaire/agents/openai.yaml +0 -5
  752. package/template/.codex/skills/wait-what/SKILL.md +0 -7
  753. package/template/.codex/skills/wait-what/agents/openai.yaml +0 -5
  754. package/template/.cursor/skills/grill-with-docs/SKILL.md +0 -20
  755. package/template/.cursor/skills/grill-with-docs/agents/openai.yaml +0 -5
  756. package/template/.cursor/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  757. package/template/.cursor/skills/prototype/UI.md +0 -112
  758. package/template/.cursor/skills/setup-matt-pocock-skills/domain.md +0 -37
  759. package/template/.cursor/skills/to-questionnaire/SKILL.md +0 -55
  760. package/template/.cursor/skills/to-questionnaire/agents/openai.yaml +0 -5
  761. package/template/.cursor/skills/wait-what/SKILL.md +0 -7
  762. package/template/.cursor/skills/wait-what/agents/openai.yaml +0 -5
  763. package/template/.pi/skills/grill-with-docs/SKILL.md +0 -20
  764. package/template/.pi/skills/grill-with-docs/agents/openai.yaml +0 -5
  765. package/template/.pi/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  766. package/template/.pi/skills/prototype/UI.md +0 -112
  767. package/template/.pi/skills/setup-matt-pocock-skills/domain.md +0 -37
  768. package/template/.pi/skills/to-questionnaire/SKILL.md +0 -55
  769. package/template/.pi/skills/to-questionnaire/agents/openai.yaml +0 -5
  770. package/template/.pi/skills/wait-what/SKILL.md +0 -7
  771. package/template/.pi/skills/wait-what/agents/openai.yaml +0 -5
  772. package/template/docs/agents/archify-integration.md +0 -19
  773. package/template/docs/agents/domain.md +0 -31
  774. package/template/docs/design/design-system-sync.yaml +0 -13
  775. package/template/docs/design/preview-dark.html +0 -178
  776. package/template/docs/design/preview.css +0 -730
  777. package/template/docs/design/preview.html +0 -178
  778. package/template/docs/design/preview.js +0 -71
  779. package/template/docs/design/tokens/.design-md-projection.json +0 -13
  780. package/template/docs/engineering/evidence/aliyun-artifact-resolution.json +0 -446
  781. package/template/docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md +0 -13
  782. package/template/docs/process/github-workflows.md +0 -52
  783. package/template/docs/process/subagent-collaboration.md +0 -13
  784. package/template/docs/templates/release-note-template.md +0 -14
  785. package/template/docs/templates/retro-report-template.md +0 -16
  786. package/template/docs/templates/verification-record-template.md +0 -53
  787. /package/template/.agents/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
  788. /package/template/.codex/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
  789. /package/template/.cursor/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
  790. /package/template/.pi/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
  791. /package/template/{docs → .template-spec}/api/templates/openapi-draft-review-checklist.md +0 -0
  792. /package/template/{docs → .template-spec}/api/templates/openapi-draft-validation-record-template.yaml +0 -0
  793. /package/template/{docs → .template-spec}/api/templates/openapi-freeze-record-template.md +0 -0
  794. /package/template/{docs → .template-spec}/api/templates/openapi-json-export-record-template.md +0 -0
  795. /package/template/{docs → .template-spec}/architecture/templates/architecture-deepening-template.md +0 -0
  796. /package/template/{docs → .template-spec}/architecture/templates/architecture-review-checklist.md +0 -0
  797. /package/template/{docs → .template-spec}/architecture/templates/business-architecture-template.md +0 -0
  798. /package/template/{docs → .template-spec}/architecture/templates/data-architecture-template.md +0 -0
  799. /package/template/{docs → .template-spec}/architecture/templates/engineering-baseline-review-template.md +0 -0
  800. /package/template/{docs → .template-spec}/architecture/templates/functional-architecture-template.md +0 -0
  801. /package/template/{docs → .template-spec}/architecture/templates/system-overview-design-template.md +0 -0
  802. /package/template/{docs → .template-spec}/design/diagrams/README.md +0 -0
  803. /package/template/{docs → .template-spec}/design/schemas/visual-baseline.schema.json +0 -0
  804. /package/template/{docs → .template-spec}/design/templates/prototype-confirmation-template.md +0 -0
  805. /package/template/{docs → .template-spec}/design/templates/visual-baseline-template.yaml +0 -0
  806. /package/template/{docs → .template-spec}/design/tokens/theme.json +0 -0
  807. /package/template/{docs → .template-spec}/design/tokens/tokens.compact.json +0 -0
  808. /package/template/{docs → .template-spec}/design/tokens/tokens.dark.json +0 -0
  809. /package/template/{docs → .template-spec}/design/tokens/tokens.default.json +0 -0
  810. /package/template/{docs → .template-spec}/design/tokens/variables.css +0 -0
  811. /package/template/{docs → .template-spec}/design/tokens/variables.dark.css +0 -0
  812. /package/template/{docs → .template-spec}/engineering/backend-platforms.json +0 -0
  813. /package/template/{docs → .template-spec}/plan/README.md +0 -0
  814. /package/template/{docs → .template-spec}/plan/templates/competitive-matrix-template.md +0 -0
  815. /package/template/{docs → .template-spec}/plan/templates/market-analysis-template.md +0 -0
  816. /package/template/{docs → .template-spec}/plan/templates/user-pain-points-template.md +0 -0
  817. /package/template/{docs → .template-spec}/process/delivery-preflight.md +0 -0
  818. /package/template/{docs → .template-spec}/process/document-writing.md +0 -0
  819. /package/template/{docs → .template-spec}/process/existing-backend-architecture.md +0 -0
  820. /package/template/{docs → .template-spec}/process/existing-ui-baseline.md +0 -0
  821. /package/template/{docs → .template-spec}/process/frontend-backend-delivery.md +0 -0
  822. /package/template/{docs → .template-spec}/process/harness-process-tailoring.md +0 -0
  823. /package/template/{docs → .template-spec}/process/implementation-repo-integration.md +0 -0
  824. /package/template/{docs/process/lifecycle-registry-baseline.json → .template-spec/process/lifecycle-registry-baseline-v1.json} +0 -0
  825. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision-v2.schema.json +0 -0
  826. /package/template/{docs → .template-spec}/process/schemas/api-contract-decision.schema.json +0 -0
  827. /package/template/{docs → .template-spec}/process/schemas/backend-architecture-identity.schema.json +0 -0
  828. /package/template/{docs → .template-spec}/process/schemas/backend-delivery-verification.schema.json +0 -0
  829. /package/template/{docs → .template-spec}/process/schemas/backend-delivery.schema.json +0 -0
  830. /package/template/{docs → .template-spec}/process/schemas/context-reconciliation.schema.json +0 -0
  831. /package/template/{docs → .template-spec}/process/schemas/data-architecture-decision.schema.json +0 -0
  832. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-input.schema.json +0 -0
  833. /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-result.schema.json +0 -0
  834. /package/template/{docs → .template-spec}/process/schemas/existing-ui-baseline.schema.json +0 -0
  835. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v1.schema.json +0 -0
  836. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v3.schema.json +0 -0
  837. /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance.schema.json +0 -0
  838. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight-v2.schema.json +0 -0
  839. /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight.schema.json +0 -0
  840. /package/template/{docs → .template-spec}/process/schemas/implementation-repository-preparation-result.schema.json +0 -0
  841. /package/template/{docs → .template-spec}/process/schemas/openapi-draft-validation-record.schema.json +0 -0
  842. /package/template/{docs → .template-spec}/process/schemas/project-scaffold-contract.schema.json +0 -0
  843. /package/template/{docs → .template-spec}/process/schemas/review-bundle.schema.json +0 -0
  844. /package/template/{docs → .template-spec}/process/schemas/scaffold-architecture-decisions.schema.json +0 -0
  845. /package/template/{docs → .template-spec}/process/schemas/slice-implementation-contract-v3.schema.json +0 -0
  846. /package/template/{docs → .template-spec}/process/schemas/stage-tracking.schema.json +0 -0
  847. /package/template/{docs → .template-spec}/process/schemas/strategic-consumer-feedback.schema.json +0 -0
  848. /package/template/{docs → .template-spec}/process/schemas/strategic-feedback-adjudication.schema.json +0 -0
  849. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery-verification.schema.json +0 -0
  850. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery.schema.json +0 -0
  851. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +0 -0
  852. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy.schema.json +0 -0
  853. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export-v2.schema.json +0 -0
  854. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export.schema.json +0 -0
  855. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt-v3.schema.json +0 -0
  856. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt.schema.json +0 -0
  857. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-package.schema.json +0 -0
  858. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +0 -0
  859. /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package.schema.json +0 -0
  860. /package/template/{docs → .template-spec}/process/schemas/subagent-task-package.schema.json +0 -0
  861. /package/template/{docs → .template-spec}/process/schemas/user-decision.schema.json +0 -0
  862. /package/template/{docs → .template-spec}/process/strategic-handoff-package.md +0 -0
  863. /package/template/{docs → .template-spec}/process/templates/context-reconciliation-template.yaml +0 -0
  864. /package/template/{docs → .template-spec}/process/templates/frontend-implementation-plan-template.yaml +0 -0
  865. /package/template/{docs → .template-spec}/process/templates/lifecycle-checkpoint-template.yaml +0 -0
  866. /package/template/{docs → .template-spec}/process/templates/scaffold-architecture-decisions-template.yaml +0 -0
  867. /package/template/{docs → .template-spec}/process/templates/stage-checkpoint-template.md +0 -0
  868. /package/template/{docs → .template-spec}/process/templates/user-decision-template.yaml +0 -0
  869. /package/template/{docs → .template-spec}/templates/adr-template.md +0 -0
  870. /package/template/{docs → .template-spec}/templates/approval-record-template.yaml +0 -0
  871. /package/template/{docs → .template-spec}/templates/cross-repo-slice-template.md +0 -0
  872. /package/template/{docs → .template-spec}/templates/examples/lifecycle-writing-examples.md +0 -0
  873. /package/template/{docs → .template-spec}/templates/implementation-repo-registry-template.md +0 -0
  874. /package/template/{docs → .template-spec}/templates/openapi-spec-template.yaml +0 -0
  875. /package/template/{docs → .template-spec}/templates/review-bundle-template.yaml +0 -0
  876. /package/template/{docs → .template-spec}/templates/review-report-template.md +0 -0
  877. /package/template/{docs → .template-spec}/templates/spec-delta-template.md +0 -0
  878. /package/template/{docs → .template-spec}/templates/spec-template.md +0 -0
  879. /package/template/{docs → .template-spec}/user-guide/yss-ui-mcp.md +0 -0
  880. /package/template/{docs → .template-spec}/user-guide//346/212/200/346/234/257/350/256/276/350/256/241/347/224/250/346/210/267/346/214/207/345/215/227.md" +0 -0
  881. /package/template/{docs → .template-spec}/user-guide//350/256/276/345/244/207/345/200/237/347/224/250/350/264/257/347/251/277/346/241/210/344/276/213.md" +0 -0
  882. /package/template/{docs → .template-spec}/user-guide//351/230/266/346/256/265/346/216/245/345/205/245/344/270/216/344/272/247/347/211/251/345/244/215/347/224/250/344/275/277/347/224/250/346/211/213/345/206/214.md" +0 -0
@@ -2,9 +2,8 @@
2
2
  import { readFile, readdir } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { exists } from "./inventory.mjs";
5
+ import { exists, safePath, loadManifest, frontmatter, assertReadable, cliError } from "./core.mjs";
6
6
  import { articlesDir, extractLinks, INFRA } from "./lint-wikilinks.mjs";
7
-
8
7
  const SOURCE_HEADING_RE = /^##\s+来源\s*$/m;
9
8
  const H1_RE = /^#\s+(.+?)\s*$/m;
10
9
  const NUMBER_RE = /\b\d+(?:\.\d+)?[A-Za-z%]+\b/g;
@@ -13,68 +12,62 @@ const LONG_QUOTE_RE = /[“"]([^”"]{12,})[”"]/g;
13
12
  const BACKTICK_RE = /`([^`\n]{2,64})`/g;
14
13
  const BOLD_RE = /\*\*([^*]{2,32})\*\*/g;
15
14
  const HEADING_RE = /^#{2,6}\s+(.+)$/gm;
16
-
17
- export function sourceSection(text) {
15
+ function sourceSection(text) {
18
16
  const match = text.match(SOURCE_HEADING_RE);
19
17
  if (!match) return "";
20
18
  return text.slice(match.index + match[0].length);
21
19
  }
22
-
23
- export function firstParagraph(text) {
20
+ function firstParagraph(text) {
24
21
  const afterH1 = text.replace(/^---[\s\S]*?---\s*/, "").replace(H1_RE, "").trimStart();
25
22
  const block = afterH1.split(/\n\s*\n/)[0] || "";
26
23
  return block.trim();
27
24
  }
28
-
29
- export function articleBody(text) {
25
+ function articleBody(text) {
30
26
  const source = text.search(SOURCE_HEADING_RE);
31
27
  const head = source === -1 ? text : text.slice(0, source);
32
28
  return head.replace(/^---[\s\S]*?---\s*/, "");
33
29
  }
34
-
35
- export function highSignalLiterals(text) {
36
- const found = new Set();
30
+ function highSignalLiterals(text) {
31
+ const found = /* @__PURE__ */ new Set();
37
32
  for (const match of text.matchAll(NUMBER_RE)) found.add(match[0]);
38
33
  for (const match of text.matchAll(ISO_DATE_RE)) found.add(match[0]);
39
34
  for (const match of text.matchAll(LONG_QUOTE_RE)) found.add(match[1]);
40
35
  return [...found];
41
36
  }
42
-
43
37
  function addTerm(counter, term) {
44
38
  const value = term.trim();
45
39
  if (!value) return;
46
40
  counter.set(value, (counter.get(value) || 0) + 1);
47
41
  }
48
-
49
- export function collectTerms(text) {
42
+ function collectTerms(text) {
50
43
  const body = articleBody(text);
51
- const counter = new Map();
44
+ const counter = /* @__PURE__ */ new Map();
52
45
  for (const match of body.matchAll(BACKTICK_RE)) addTerm(counter, match[1]);
53
46
  for (const match of body.matchAll(BOLD_RE)) addTerm(counter, match[1]);
54
47
  for (const match of body.matchAll(HEADING_RE)) addTerm(counter, match[1]);
55
48
  return counter;
56
49
  }
57
-
58
- export async function loadArticles(wikiRoot) {
59
- const dir = articlesDir(wikiRoot);
50
+ async function loadArticles(wikiRoot) {
51
+ await assertReadable(wikiRoot);
52
+ const dir = await safePath(wikiRoot, "wiki");
60
53
  const names = (await readdir(dir)).filter((name) => name.endsWith(".md"));
61
54
  const files = names.filter((name) => !INFRA.has(name.toLowerCase()));
62
55
  const articles = [];
63
56
  for (const file of files) {
64
- const text = await readFile(path.join(dir, file), "utf8");
57
+ const text = await readFile(await safePath(wikiRoot, `wiki/${file}`), "utf8");
58
+ frontmatter(text);
65
59
  articles.push({
66
60
  id: file.slice(0, -3),
67
61
  file,
68
62
  text,
69
- links: extractLinks(text).ids,
63
+ links: extractLinks(text).ids
70
64
  });
71
65
  }
72
66
  return articles;
73
67
  }
74
-
75
- export function oneWayLinks(articles) {
76
- const inbound = new Map();
77
- for (const article of articles) inbound.set(article.id, new Set());
68
+ function oneWayLinks(articles) {
69
+ const inbound = /* @__PURE__ */ new Map();
70
+ for (const article of articles) inbound.set(article.id, /* @__PURE__ */ new Set());
78
71
  for (const article of articles) {
79
72
  for (const target of article.links) {
80
73
  if (!inbound.has(target)) continue;
@@ -92,10 +85,9 @@ export function oneWayLinks(articles) {
92
85
  }
93
86
  return findings;
94
87
  }
95
-
96
- export function missingTermPages(articles) {
88
+ function missingTermPages(articles) {
97
89
  const ids = new Set(articles.map((article) => article.id));
98
- const counts = new Map();
90
+ const counts = /* @__PURE__ */ new Map();
99
91
  for (const article of articles) {
100
92
  const local = collectTerms(article.text);
101
93
  for (const [term, count] of local) {
@@ -103,13 +95,9 @@ export function missingTermPages(articles) {
103
95
  counts.set(term, (counts.get(term) || 0) + count);
104
96
  }
105
97
  }
106
- return [...counts.entries()]
107
- .filter(([, count]) => count >= 2)
108
- .map(([term, count]) => ({ term, count }))
109
- .sort((a, b) => b.count - a.count || a.term.localeCompare(b.term));
98
+ return [...counts.entries()].filter(([, count]) => count >= 2).map(([term, count]) => ({ term, count })).sort((a, b) => b.count - a.count || a.term.localeCompare(b.term));
110
99
  }
111
-
112
- export function unreferencedRaws(manifest, articles) {
100
+ function unreferencedRaws(manifest, articles) {
113
101
  const cited = articles.map((article) => sourceSection(article.text)).join("\n");
114
102
  const findings = [];
115
103
  for (const source of manifest.sources || []) {
@@ -119,29 +107,24 @@ export function unreferencedRaws(manifest, articles) {
119
107
  }
120
108
  return findings;
121
109
  }
122
-
123
110
  async function citedCorpus({ wikiRoot, repoRoot, article, manifest }) {
124
111
  const cited = sourceSection(article.text);
125
112
  const chunks = [cited];
126
113
  for (const source of manifest.sources || []) {
127
- const mentioned =
128
- (source.rawPath && cited.includes(source.rawPath)) ||
129
- (source.id && cited.includes(source.id)) ||
130
- (source.livePath && cited.includes(source.livePath));
114
+ const mentioned = source.rawPath && cited.includes(source.rawPath) || source.id && cited.includes(source.id) || source.livePath && cited.includes(source.livePath);
131
115
  if (!mentioned) continue;
132
116
  if (source.rawPath) {
133
- const raw = path.resolve(wikiRoot, source.rawPath);
117
+ const raw = await safePath(wikiRoot, source.rawPath);
134
118
  if (await exists(raw)) chunks.push(await readFile(raw, "utf8"));
135
119
  }
136
120
  if (source.livePath) {
137
- const live = path.resolve(repoRoot, source.livePath);
121
+ const live = await safePath(repoRoot, source.livePath);
138
122
  if (await exists(live)) chunks.push(await readFile(live, "utf8"));
139
123
  }
140
124
  }
141
125
  return chunks.join("\n");
142
126
  }
143
-
144
- export async function evidenceSuspects({ wikiRoot, repoRoot, articles, manifest }) {
127
+ async function evidenceSuspects({ wikiRoot, repoRoot, articles, manifest }) {
145
128
  const findings = [];
146
129
  for (const article of articles) {
147
130
  const literals = highSignalLiterals(articleBody(article.text));
@@ -155,21 +138,17 @@ export async function evidenceSuspects({ wikiRoot, repoRoot, articles, manifest
155
138
  }
156
139
  return findings;
157
140
  }
158
-
159
- export async function adviseWiki(wikiRoot, { repoRoot = process.cwd() } = {}) {
141
+ async function adviseWiki(wikiRoot, { repoRoot = process.cwd() } = {}) {
160
142
  const articles = await loadArticles(wikiRoot);
161
- const manifestFile = path.join(wikiRoot, ".wiki-manifest.json");
162
- const manifest = (await exists(manifestFile))
163
- ? JSON.parse(await readFile(manifestFile, "utf8"))
164
- : { sources: [] };
143
+ const manifestFile = await safePath(wikiRoot, ".wiki-manifest.json");
144
+ const manifest = await exists(manifestFile) ? await loadManifest(wikiRoot, { repoRoot }) : { sources: [] };
165
145
  return {
166
146
  oneWayLinks: oneWayLinks(articles),
167
147
  missingTermPages: missingTermPages(articles),
168
148
  unreferencedRaws: unreferencedRaws(manifest, articles),
169
- suspects: await evidenceSuspects({ wikiRoot, repoRoot, articles, manifest }),
149
+ suspects: await evidenceSuspects({ wikiRoot, repoRoot, articles, manifest })
170
150
  };
171
151
  }
172
-
173
152
  function parseArgs(argv) {
174
153
  const args = { wiki: null, repo: process.cwd() };
175
154
  for (let i = 0; i < argv.length; i += 1) {
@@ -179,18 +158,27 @@ function parseArgs(argv) {
179
158
  }
180
159
  return args;
181
160
  }
182
-
183
161
  async function main(argv = process.argv.slice(2)) {
184
162
  const args = parseArgs(argv);
185
163
  if (!args.wiki) throw new Error("usage: advise.mjs <wiki-root> [--repo <repo-root>]");
186
164
  const wikiRoot = path.resolve(args.repo, args.wiki);
187
165
  const report = await adviseWiki(wikiRoot, { repoRoot: path.resolve(args.repo) });
188
- process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
166
+ process.stdout.write(`${JSON.stringify(report, null, 2)}
167
+ `);
189
168
  }
190
-
191
169
  if (process.argv[1] === fileURLToPath(import.meta.url)) {
192
- main().catch((error) => {
193
- process.stderr.write(`${error.message}\n`);
194
- process.exitCode = 2;
195
- });
196
- }
170
+ main().catch(cliError);
171
+ }
172
+ export {
173
+ adviseWiki,
174
+ articleBody,
175
+ collectTerms,
176
+ evidenceSuspects,
177
+ firstParagraph,
178
+ highSignalLiterals,
179
+ loadArticles,
180
+ missingTermPages,
181
+ oneWayLinks,
182
+ sourceSection,
183
+ unreferencedRaws
184
+ };
@@ -8,9 +8,7 @@ import { fileURLToPath } from "node:url";
8
8
  import { sha256 } from "./inventory.mjs";
9
9
  import { adviseWiki } from "./advise.mjs";
10
10
  import { lintWiki } from "./lint-wikilinks.mjs";
11
-
12
11
  const adviseCli = fileURLToPath(new URL("./advise.mjs", import.meta.url));
13
-
14
12
  async function seedAdvise() {
15
13
  const repo = await mkdtemp(path.join(tmpdir(), "llm-wiki-advise-"));
16
14
  const wikiRoot = path.join(repo, "wiki-root");
@@ -25,12 +23,12 @@ async function seedAdvise() {
25
23
  await writeFile(
26
24
  path.join(wiki, "Alpha.md"),
27
25
  "# Alpha\n\nSee [[Beta]] and **孤立术语**. The figure is 42K.\n\n## 来源\n\n- raw/api.md\n",
28
- "utf8",
26
+ "utf8"
29
27
  );
30
28
  await writeFile(
31
29
  path.join(wiki, "Beta.md"),
32
30
  "# Beta\n\nMentions **孤立术语** again.\n\n## 来源\n\n- raw/api.md\n",
33
- "utf8",
31
+ "utf8"
34
32
  );
35
33
  await writeFile(path.join(wiki, "concept-table.md"), "# concepts\n", "utf8");
36
34
  await writeFile(
@@ -44,37 +42,35 @@ async function seedAdvise() {
44
42
  kind: "document",
45
43
  livePath: "docs/api.md",
46
44
  rawPath: "raw/api.md",
47
- sha256: sha256(Buffer.from("version one\n")),
45
+ sha256: sha256(Buffer.from("version one\n"))
48
46
  },
49
47
  {
50
48
  id: "orphan-raw.md",
51
49
  kind: "document",
52
50
  livePath: "docs/api.md",
53
51
  rawPath: "raw/orphan-raw.md",
54
- sha256: sha256(Buffer.from("version one\n")),
55
- },
52
+ sha256: sha256(Buffer.from("version one\n"))
53
+ }
56
54
  ],
57
55
  articles: [
58
56
  { id: "Alpha", file: "wiki/Alpha.md", sourceIds: ["api.md"] },
59
- { id: "Beta", file: "wiki/Beta.md", sourceIds: ["api.md"] },
60
- ],
57
+ { id: "Beta", file: "wiki/Beta.md", sourceIds: ["api.md"] }
58
+ ]
61
59
  }),
62
- "utf8",
60
+ "utf8"
63
61
  );
64
62
  return { repo, wikiRoot };
65
63
  }
66
-
67
64
  test("advise reports one-way links, missing terms, unreferenced raw, and suspects without failing lint", async () => {
68
65
  const { repo, wikiRoot } = await seedAdvise();
69
- const lint = await lintWiki(wikiRoot, { repoRoot: repo });
66
+ const lint = await lintWiki(wikiRoot, { repoRoot: repo, structureOnly: true });
70
67
  assert.equal(lint.ok, true, lint.errors.join("\n"));
71
- const report = await adviseWiki(wikiRoot, { repoRoot: repo });
68
+ const report = await adviseWiki(wikiRoot, { repoRoot: repo, structureOnly: true });
72
69
  assert.ok(report.oneWayLinks.some((item) => item.from === "Alpha" && item.to === "Beta"));
73
70
  assert.ok(report.missingTermPages.some((item) => item.term === "孤立术语" && item.count >= 2));
74
71
  assert.ok(report.unreferencedRaws.some((item) => item.rawPath === "raw/orphan-raw.md"));
75
72
  assert.ok(report.suspects.some((item) => item.article === "Alpha" && item.value === "42K"));
76
73
  });
77
-
78
74
  test("advise CLI exits 0 and prints JSON", async () => {
79
75
  const { repo, wikiRoot } = await seedAdvise();
80
76
  const ran = spawnSync(process.execPath, [adviseCli, wikiRoot, "--repo", repo], { encoding: "utf8" });
@@ -82,10 +78,9 @@ test("advise CLI exits 0 and prints JSON", async () => {
82
78
  const report = JSON.parse(ran.stdout);
83
79
  assert.ok(Array.isArray(report.suspects));
84
80
  });
85
-
86
81
  test("concept-table.md is infrastructure and does not fail lint as an orphan", async () => {
87
82
  const { repo, wikiRoot } = await seedAdvise();
88
- const lint = await lintWiki(wikiRoot, { repoRoot: repo });
83
+ const lint = await lintWiki(wikiRoot, { repoRoot: repo, structureOnly: true });
89
84
  assert.equal(lint.ok, true, lint.errors.join("\n"));
90
85
  assert.equal(lint.counts.articles, 2);
91
86
  });
@@ -0,0 +1,262 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { readFile, writeFile, rename, lstat, realpath, mkdir, access } from "node:fs/promises";
3
+ import path from "node:path";
4
+ const STATES = ["current", "stale", "missing", "unverified", "archived"];
5
+ const INFRA = /* @__PURE__ */ new Set(["index.md", "log.md", "claude.md", "agents.md", "soul.md", "concept-table.md"]);
6
+ const sha256 = (value) => createHash("sha256").update(value).digest("hex");
7
+ const json = (value) => `${JSON.stringify(value, null, 2)}
8
+ `;
9
+ class WikiError extends Error {
10
+ constructor(code, message) {
11
+ super(`${code}: ${message}`);
12
+ this.code = code;
13
+ }
14
+ }
15
+ function fail(code, message) {
16
+ throw new WikiError(code, message);
17
+ }
18
+ async function exists(file) {
19
+ try {
20
+ await access(file);
21
+ return true;
22
+ } catch (e) {
23
+ if (e.code === "ENOENT") return false;
24
+ throw e;
25
+ }
26
+ }
27
+ async function digestFile(file) {
28
+ try {
29
+ return sha256(await readFile(file));
30
+ } catch (e) {
31
+ if (e.code === "ENOENT") return null;
32
+ throw e;
33
+ }
34
+ }
35
+ function inside(root, target) {
36
+ const r = path.relative(root, target);
37
+ return r === "" || !r.startsWith(`..${path.sep}`) && r !== ".." && !path.isAbsolute(r);
38
+ }
39
+ async function safePath(root, ref, { write = false } = {}) {
40
+ if (typeof ref !== "string" || !ref || ref.includes("\\") || ref.includes("\0") || path.isAbsolute(ref) || ref.split("/").some((x) => ["..", ".", ""].includes(x))) fail("PATH_INVALID", String(ref));
41
+ const base = path.resolve(root), target = path.resolve(base, ref);
42
+ if (!inside(base, target) || target === base) fail("PATH_ESCAPE", ref);
43
+ let baseReal;
44
+ try {
45
+ baseReal = await realpath(base);
46
+ } catch (e) {
47
+ if (e.code !== "ENOENT") throw e;
48
+ const parent = path.dirname(base);
49
+ baseReal = path.join(await realpath(parent), path.basename(base));
50
+ }
51
+ let current = base;
52
+ for (const part of ref.split("/")) {
53
+ current = path.join(current, part);
54
+ let st;
55
+ try {
56
+ st = await lstat(current);
57
+ } catch (e) {
58
+ if (e.code === "ENOENT") continue;
59
+ throw e;
60
+ }
61
+ if (st.isSymbolicLink() && write) fail("SYMLINK_WRITE", ref);
62
+ let resolved;
63
+ try {
64
+ resolved = await realpath(current);
65
+ } catch {
66
+ fail("PATH_ESCAPE", `unresolved symlink ${ref}`);
67
+ }
68
+ if (!inside(baseReal, resolved)) fail("PATH_ESCAPE", ref);
69
+ }
70
+ return target;
71
+ }
72
+ async function atomicWrite(file, content) {
73
+ await mkdir(path.dirname(file), { recursive: true });
74
+ const temp = `${file}.${randomUUID()}.tmp`;
75
+ await writeFile(temp, content, { flag: "wx" });
76
+ await rename(temp, file);
77
+ }
78
+ function frontmatter(text) {
79
+ if (!text.startsWith("---\n") && !text.startsWith("---\r\n")) return { humanOwned: false, body: text, fields: {} };
80
+ const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
81
+ if (!m) fail("FRONTMATTER_INVALID", "unterminated header");
82
+ const fields = {};
83
+ for (const line of m[1].split(/\r?\n/)) {
84
+ if (!line.trim() || line.trim().startsWith("#")) continue;
85
+ const pair = line.match(/^([\w-]+):\s*(.*?)\s*$/);
86
+ if (!pair) fail("FRONTMATTER_INVALID", "use flat scalar fields");
87
+ if (Object.hasOwn(fields, pair[1])) fail("FRONTMATTER_INVALID", `duplicate ${pair[1]}`);
88
+ fields[pair[1]] = pair[2];
89
+ }
90
+ if (fields["human-owned"] !== void 0 && !["true", "false"].includes(fields["human-owned"])) fail("FRONTMATTER_INVALID", "human-owned must be a boolean");
91
+ return { humanOwned: fields["human-owned"] === "true", fields, body: text.slice(m[0].length) };
92
+ }
93
+ function sourceSection(text) {
94
+ return text.match(/^##\s+来源\s*\r?\n([\s\S]*)/m)?.[1]?.trim() || "";
95
+ }
96
+ function ownership(article, text) {
97
+ const fm = frontmatter(text);
98
+ return { protected: article.humanOwned === true || fm.humanOwned, conflict: article.humanOwned !== void 0 && fm.fields["human-owned"] !== void 0 && article.humanOwned !== fm.humanOwned };
99
+ }
100
+ const array = (v) => Array.isArray(v);
101
+ const unique = (v) => new Set(v).size === v.length;
102
+ const digest = (v) => v === null || /^[a-f0-9]{64}$/.test(v);
103
+ function validateManifest(m) {
104
+ const errors = [];
105
+ const check = (ok, code, detail) => {
106
+ if (!ok) errors.push(`${code}: ${detail}`);
107
+ };
108
+ if (!m || typeof m !== "object" || array(m)) return ["MANIFEST_INVALID: expected object"];
109
+ check([1, 2].includes(m.schemaVersion), "SCHEMA_UNSUPPORTED", m.schemaVersion);
110
+ check(m.profile === void 0 && m.schemaVersion === 1 || ["mixed", "documents", "code"].includes(m.profile), "PROFILE_INVALID", m.profile);
111
+ if (!array(m.sources) || !array(m.articles)) return [...errors, "MANIFEST_INVALID: sources and articles must be arrays"];
112
+ for (const [group, rows] of [["source", m.sources], ["article", m.articles]]) {
113
+ check(rows.every((x) => x && typeof x.id === "string" && x.id.trim() && (group === "source" || !/[\[\]#|/\\]/.test(x.id))), "ID_INVALID", group);
114
+ check(unique(rows.map((x) => x?.id)), "DUPLICATE_ID", group);
115
+ }
116
+ const sources = new Set(m.sources.map((x) => x?.id)), articles = new Set(m.articles.map((x) => x?.id));
117
+ check(unique(m.articles.map((x) => x?.file)), "DUPLICATE_FILE", "articles");
118
+ for (const s of m.sources) {
119
+ if (!s || typeof s !== "object") continue;
120
+ check(["document", "derived", "code-surface"].includes(s.kind), "SOURCE_KIND", s.id);
121
+ if (s.kind === "code-surface") check(typeof s.livePath === "string" && s.livePath.length > 0, "LIVE_PATH_REQUIRED", s.id);
122
+ check(!(m.profile === "documents" && s.kind === "code-surface"), "PROFILE KIND", s.id + " code-surface");
123
+ check(s.kind === "code-surface" ? s.rawPath == null : typeof s.rawPath === "string" && s.rawPath.length > 0, s.kind === "code-surface" ? "RAW PATH FORBIDDEN" : "RAW PATH REQUIRED", s.id);
124
+ if (s.kind === "derived") {
125
+ if (m.schemaVersion === 2 && s.extract?.kind === "prose-note") check(typeof s.extract.rules === "string" && s.extract.rules.length > 0 && s.extract.inputDigests && typeof s.extract.inputDigests === "object", "EXTRACT_RULES", s.id);
126
+ check(!!s.extract?.kind, "EXTRACT REQUIRED", s.id);
127
+ if (s.extract?.kind) check(["skill-names", "heading-list", "prose-note"].includes(s.extract.kind), "EXTRACT KIND", `${s.id} ${s.extract.kind}`);
128
+ if (m.schemaVersion === 2) {
129
+ check(typeof s.extract?.version === "string" && !!s.extract.version, "EXTRACT_VERSION", s.id);
130
+ check(array(s.extract?.inputs) && s.extract.inputs.length > 0 && unique(s.extract.inputs), "EXTRACT_INPUTS", s.id);
131
+ }
132
+ }
133
+ if (s.status !== void 0) check(STATES.includes(s.status), "STATUS_INVALID", s.id);
134
+ if (m.schemaVersion === 2) {
135
+ for (const k of ["originalDigest", "effectiveDigest", "rawDigest"]) check(Object.hasOwn(s, k) && digest(s[k]), "DIGEST_INVALID", `${s.id}.${k}`);
136
+ check(typeof s.location === "string" && s.location.length > 0, "LOCATION_REQUIRED", s.id);
137
+ }
138
+ }
139
+ for (const a of m.articles) {
140
+ if (!a || typeof a !== "object") continue;
141
+ check(a.file === `wiki/${a.id}.md` && !INFRA.has(`${a.id}.md`.toLowerCase()), "MANIFEST ID MISMATCH", a.id);
142
+ check(array(a.sourceIds) && unique(a.sourceIds), "SOURCE_REFS_INVALID", a.id);
143
+ check(array(a.sourceIds) && (a.sourceIds.length > 0 || array(a.dependsOnArticles) && a.dependsOnArticles.length > 0), "EMPTY_SOURCE_REFS", a.id);
144
+ for (const id of array(a.sourceIds) ? a.sourceIds : []) check(sources.has(id), "UNKNOWN SOURCE ID", `${a.id} -> ${id}`);
145
+ if (a.dependsOnArticles !== void 0) check(array(a.dependsOnArticles) && unique(a.dependsOnArticles), "DEPENDENCIES_INVALID", a.id);
146
+ for (const id of array(a.dependsOnArticles) ? a.dependsOnArticles : []) check(articles.has(id), "UNKNOWN_ARTICLE_ID", `${a.id} -> ${id}`);
147
+ if (a.aliases !== void 0) check(array(a.aliases) && a.aliases.every((x) => typeof x === "string" && x.trim()), "ALIASES_INVALID", a.id);
148
+ if (a.humanOwned !== void 0) check(typeof a.humanOwned === "boolean", "OWNERSHIP_INVALID", a.id);
149
+ if (a.verification !== void 0 && a.verification !== null) check(a.verification && typeof a.verification === "object" && array(a.verification.evidence) && a.verification.evidence.every((e) => e && typeof e === "object" && sources.has(e.sourceId) && ["general", "critical"].includes(e.risk) && typeof e.claim === "string" && e.claim.length > 0 && digest(e.excerptDigest) && e.excerptDigest !== null && typeof e.inputPath === "string" && Number.isInteger(e.startLine) && e.startLine > 0 && Number.isInteger(e.endLine) && e.endLine >= e.startLine) && digest(a.verification.articleDigest) && a.verification.articleDigest !== null, "EVIDENCE_INVALID", a.id);
150
+ if (a.status !== void 0) check(STATES.includes(a.status), "STATUS_INVALID", a.id);
151
+ if (m.schemaVersion === 2) {
152
+ check(digest(a.articleDigest) && Object.hasOwn(a, "articleDigest"), "DIGEST_INVALID", a.id);
153
+ check(a.compiledFrom && typeof a.compiledFrom === "object" && !array(a.compiledFrom), "COMPILED_FROM_INVALID", a.id);
154
+ for (const [id, binding] of Object.entries(a.compiledFrom || {})) {
155
+ check(sources.has(id) && binding && digest(binding.effectiveDigest) && binding.effectiveDigest !== null, "COMPILED_FROM_INVALID", `${a.id}:${id}`);
156
+ }
157
+ }
158
+ }
159
+ if (errors.length === 0) {
160
+ try {
161
+ for (const a of m.articles) sourceClosure(m, a.id);
162
+ } catch (e) {
163
+ errors.push(e.message);
164
+ }
165
+ }
166
+ if (m.feedback !== void 0) {
167
+ check(array(m.feedback), "FEEDBACK_INVALID", "expected array");
168
+ if (array(m.feedback)) {
169
+ check(unique(m.feedback.map((f) => f?.id)), "DUPLICATE_ID", "feedback");
170
+ for (const f of m.feedback) {
171
+ if (!f || typeof f !== "object") {
172
+ errors.push("FEEDBACK_INVALID: expected object");
173
+ continue;
174
+ }
175
+ check(typeof f.id === "string" && f.id.length > 0 && articles.has(f.articleId) && digest(f.targetDigest) && f.targetDigest !== null && typeof f.issue === "string" && f.issue.trim() && f.locator && typeof f.locator.quote === "string" && f.locator.quote.length > 0, "FEEDBACK_INVALID", f.id);
176
+ check(["open", "accepted", "partial", "rejected", "deferred"].includes(f.status), "FEEDBACK_STATUS", f.id);
177
+ }
178
+ }
179
+ }
180
+ return errors;
181
+ }
182
+ function sourceClosure(m, id, trail = []) {
183
+ if (trail.includes(id)) fail("DEPENDENCY_CYCLE", [...trail, id].join(" -> "));
184
+ const a = m.articles.find((x) => x.id === id);
185
+ if (!a) fail("UNKNOWN_ARTICLE_ID", id);
186
+ return [.../* @__PURE__ */ new Set([...a.sourceIds || [], ...(a.dependsOnArticles || []).flatMap((dep) => sourceClosure(m, dep, [...trail, id]))])].sort();
187
+ }
188
+ async function checkPaths(m, { wikiRoot, repoRoot }) {
189
+ for (const s of m.sources) {
190
+ for (const ref of [s.livePath, ...s.extract?.inputs || []].filter(Boolean)) await safePath(repoRoot, ref);
191
+ if (s.rawPath) await safePath(wikiRoot, s.rawPath);
192
+ }
193
+ for (const a of m.articles) await safePath(wikiRoot, a.file);
194
+ }
195
+ async function loadManifest(wikiRoot, { repoRoot = process.cwd(), validate = true } = {}) {
196
+ const m = JSON.parse(await readFile(await safePath(wikiRoot, ".wiki-manifest.json"), "utf8"));
197
+ if (validate) {
198
+ const errors = validateManifest(m);
199
+ if (errors.length) fail("MANIFEST_INVALID", errors.join("\n"));
200
+ await checkPaths(m, { wikiRoot, repoRoot });
201
+ }
202
+ return m;
203
+ }
204
+ async function transactionState(wikiRoot, { reader } = {}) {
205
+ // A writer claims the lock before replacing an earlier finalized journal.
206
+ // 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");
209
+ if (!await exists(file)) return { state: "none" };
210
+ const j = JSON.parse(reader ? (await reader(file)).toString() : await readFile(file, "utf8"));
211
+ return { id: j.id, state: j.phase, incomplete: !["finalized", "aborted"].includes(j.phase) };
212
+ }
213
+ async function assertReadable(wikiRoot, reader) {
214
+ const tx = await transactionState(wikiRoot, { reader });
215
+ if (tx.incomplete || tx.state === "locked") fail("TRANSACTION_INCOMPLETE", "explicit resume or abort required; query never recovers");
216
+ return tx;
217
+ }
218
+ function cliError(e) {
219
+ process.stderr.write(`${JSON.stringify({ ok: false, code: e.code || "EXECUTION_ERROR", message: e.message })}
220
+ `);
221
+ process.exitCode = 2;
222
+ }
223
+ function args(argv, commands = []) {
224
+ const result = { command: commands.length ? argv.shift() : void 0, repo: process.cwd() };
225
+ if (commands.length && !commands.includes(result.command)) fail("USAGE", commands.join("|"));
226
+ while (argv.length) {
227
+ const a = argv.shift();
228
+ if (a === "--apply" || a === "--structure-only") {
229
+ result[a.slice(2)] = true;
230
+ } else if (a.startsWith("--")) {
231
+ if (!argv.length || argv[0].startsWith("--")) fail("USAGE", `value required ${a}`);
232
+ const key = a.slice(2);
233
+ if (key === "candidate") (result.candidates ??= []).push(argv.shift());
234
+ else result[key] = argv.shift();
235
+ } else if (!result.wiki) result.wiki = a;
236
+ else fail("USAGE", a);
237
+ }
238
+ return result;
239
+ }
240
+ export {
241
+ INFRA,
242
+ STATES,
243
+ WikiError,
244
+ args,
245
+ assertReadable,
246
+ atomicWrite,
247
+ checkPaths,
248
+ cliError,
249
+ digestFile,
250
+ exists,
251
+ fail,
252
+ frontmatter,
253
+ json,
254
+ loadManifest,
255
+ ownership,
256
+ safePath,
257
+ sha256,
258
+ sourceClosure,
259
+ sourceSection,
260
+ transactionState,
261
+ validateManifest
262
+ };
@@ -2,15 +2,27 @@
2
2
  import { readFile, writeFile, mkdir } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
-
6
- export const EXTRACT_KINDS = Object.freeze(["skill-names", "heading-list", "prose-note"]);
7
-
5
+ import { safePath, cliError } from "./core.mjs";
6
+ const EXTRACT_KINDS = Object.freeze(["skill-names", "heading-list", "prose-note"]);
7
+ function extractHeadings(text, input = "") {
8
+ const lines = [`# heading-list${input ? `: ${input}` : ""}`, ""];
9
+ let fence = null;
10
+ for (const [index, line] of text.split(/\r?\n/).entries()) {
11
+ const marker = line.match(/^\s*(`{3,}|~{3,})/);
12
+ if (marker) {
13
+ if (!fence) fence = marker[1][0];
14
+ else if (fence === marker[1][0]) fence = null;
15
+ continue;
16
+ }
17
+ if (!fence && /^#{1,6}\s+\S/.test(line)) lines.push(`- L${index + 1}: ${line.trim()}`);
18
+ }
19
+ return lines.join("\n") + "\n";
20
+ }
8
21
  function namesOf(value) {
9
22
  if (!value || typeof value !== "object" || Array.isArray(value)) return [];
10
23
  return Object.keys(value).sort((a, b) => a.localeCompare(b));
11
24
  }
12
-
13
- export function extractSkillNames(lock) {
25
+ function extractSkillNames(lock) {
14
26
  if (!lock || typeof lock !== "object" || Array.isArray(lock)) {
15
27
  throw new TypeError("skill-names input must be a lock object");
16
28
  }
@@ -27,9 +39,9 @@ export function extractSkillNames(lock) {
27
39
  lines.push("");
28
40
  }
29
41
  }
30
- return `${lines.join("\n").replace(/\n+$/, "")}\n`;
42
+ return `${lines.join("\n").replace(/\n+$/, "")}
43
+ `;
31
44
  }
32
-
33
45
  async function main(argv = process.argv.slice(2)) {
34
46
  const kind = argv[0];
35
47
  let input;
@@ -38,18 +50,23 @@ async function main(argv = process.argv.slice(2)) {
38
50
  if (argv[i] === "--in") input = argv[++i];
39
51
  else if (argv[i] === "--out") output = argv[++i];
40
52
  }
41
- if (kind !== "skill-names" || !input || !output) {
42
- throw new Error("usage: extract.mjs skill-names --in <lock.json> --out <raw.md>");
53
+ if (!["skill-names", "heading-list"].includes(kind) || !input || !output) {
54
+ throw new Error("usage: extract.mjs skill-names|heading-list --in <lock.json> --out <raw.md>");
43
55
  }
44
- const text = extractSkillNames(JSON.parse(await readFile(input, "utf8")));
45
- await mkdir(path.dirname(output), { recursive: true });
46
- await writeFile(output, text, "utf8");
47
- process.stdout.write(`${output}\n`);
56
+ const inputFile = await safePath(process.cwd(), input);
57
+ const outputFile = await safePath(process.cwd(), output, { write: true });
58
+ const content = await readFile(inputFile, "utf8");
59
+ const text = kind === "skill-names" ? extractSkillNames(JSON.parse(content)) : extractHeadings(content, input);
60
+ await mkdir(path.dirname(outputFile), { recursive: true });
61
+ await writeFile(outputFile, text, "utf8");
62
+ process.stdout.write(`${output}
63
+ `);
48
64
  }
49
-
50
65
  if (process.argv[1] === fileURLToPath(import.meta.url)) {
51
- main().catch((error) => {
52
- process.stderr.write(`${error.message}\n`);
53
- process.exitCode = 2;
54
- });
66
+ main().catch(cliError);
55
67
  }
68
+ export {
69
+ EXTRACT_KINDS,
70
+ extractHeadings,
71
+ extractSkillNames
72
+ };