create-yss-spec 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/src/cli.js +56 -8
  4. package/template/.agents/rules/yss-ai-skills.md +59 -0
  5. package/template/.agents/skills/.yss-skills-manifest.json +28 -0
  6. package/template/.agents/skills/component-selection-imports/SKILL.md +64 -0
  7. package/template/.agents/skills/file-export-download/SKILL.md +160 -0
  8. package/template/.agents/skills/file-export-download/agents/openai.yaml +4 -0
  9. package/template/.agents/skills/formily-foundation/SKILL.md +176 -0
  10. package/template/.agents/skills/formily-foundation/references/examples.md +486 -0
  11. package/template/.agents/skills/formily-linkage-effects/SKILL.md +167 -0
  12. package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +137 -0
  13. package/template/.agents/skills/formily-step-flow/SKILL.md +194 -0
  14. package/template/.agents/skills/frontend-commit/SKILL.md +118 -0
  15. package/template/.agents/skills/frontend-commit/agents/openai.yaml +7 -0
  16. package/template/.agents/skills/frontend-commit/references/scope-and-examples.md +111 -0
  17. package/template/.agents/skills/java-backend-commit/SKILL.md +121 -0
  18. package/template/.agents/skills/java-backend-commit/agents/openai.yaml +7 -0
  19. package/template/.agents/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  20. package/template/.agents/skills/page-form-module/SKILL.md +168 -0
  21. package/template/.agents/skills/page-list-module/SKILL.md +137 -0
  22. package/template/.agents/skills/page-skeleton/SKILL.md +76 -0
  23. package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  24. package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  25. package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  26. package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  27. package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  28. package/template/.agents/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  29. package/template/.agents/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  30. package/template/.agents/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  31. package/template/.agents/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  32. package/template/.agents/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  33. package/template/.agents/skills/prototype-page-acceptance/SKILL.md +62 -0
  34. package/template/.agents/skills/theme-token-usage/SKILL.md +123 -0
  35. package/template/.agents/skills/theme-token-usage/agents/openai.yaml +4 -0
  36. package/template/.agents/skills/vue3-best-practices/SKILL.md +68 -0
  37. package/template/.agents/skills/yedit-table-usage/SKILL.md +227 -0
  38. package/template/.agents/skills/yss-api-integration/SKILL.md +12 -2
  39. package/template/.agents/skills/yss-components/SKILL.md +1 -1
  40. package/template/.agents/skills/yss-design-system/SKILL.md +1 -1
  41. package/template/.agents/skills/yss-formily/SKILL.md +233 -265
  42. package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  43. package/template/.agents/skills/yss-hook/SKILL.md +1 -1
  44. package/template/.agents/skills/yss-openapi-governance/SKILL.md +2 -2
  45. package/template/.agents/skills/yss-page-module-development/SKILL.md +12 -2
  46. package/template/.agents/skills/yss-page-module-development/references/component-map.md +34 -0
  47. package/template/.agents/skills/yss-page-module-development/references/hooks-map.md +11 -0
  48. package/template/.agents/skills/yss-page-module-development/references/utils-map.md +14 -0
  49. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  50. package/template/.agents/skills/yss-router/references/boundaries.md +1 -1
  51. package/template/.agents/skills/yss-router/references/router-contract.yaml +6 -2
  52. package/template/.agents/skills/yss-ui/SKILL.md +1 -1
  53. package/template/.agents/skills/yss-use-table-height/SKILL.md +9 -0
  54. package/template/.agents/skills/yss-use-tree-height/SKILL.md +9 -0
  55. package/template/.agents/skills/ytable-usage/SKILL.md +251 -0
  56. package/template/.agents/skills/ytree-usage/SKILL.md +132 -0
  57. package/template/.claude/skills/.yss-skills-manifest.json +29 -0
  58. package/template/.claude/skills/component-selection-imports/SKILL.md +64 -0
  59. package/template/.claude/skills/file-export-download/SKILL.md +160 -0
  60. package/template/.claude/skills/file-export-download/agents/openai.yaml +4 -0
  61. package/template/.claude/skills/formily-foundation/SKILL.md +176 -0
  62. package/template/.claude/skills/formily-foundation/references/examples.md +486 -0
  63. package/template/.claude/skills/formily-linkage-effects/SKILL.md +167 -0
  64. package/template/.claude/skills/formily-mode-slot-detail/SKILL.md +137 -0
  65. package/template/.claude/skills/formily-step-flow/SKILL.md +194 -0
  66. package/template/.claude/skills/frontend-commit/SKILL.md +118 -0
  67. package/template/.claude/skills/frontend-commit/agents/openai.yaml +7 -0
  68. package/template/.claude/skills/frontend-commit/references/scope-and-examples.md +111 -0
  69. package/template/.claude/skills/java-backend-commit/SKILL.md +121 -0
  70. package/template/.claude/skills/java-backend-commit/agents/openai.yaml +7 -0
  71. package/template/.claude/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  72. package/template/.claude/skills/page-form-module/SKILL.md +168 -0
  73. package/template/.claude/skills/page-list-module/SKILL.md +137 -0
  74. package/template/.claude/skills/page-skeleton/SKILL.md +76 -0
  75. package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  76. package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  77. package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  78. package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  79. package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  80. package/template/.claude/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  81. package/template/.claude/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  82. package/template/.claude/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  83. package/template/.claude/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  84. package/template/.claude/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  85. package/template/.claude/skills/prototype-page-acceptance/SKILL.md +62 -0
  86. package/template/.claude/skills/theme-token-usage/SKILL.md +123 -0
  87. package/template/.claude/skills/theme-token-usage/agents/openai.yaml +4 -0
  88. package/template/.claude/skills/vue3-best-practices/SKILL.md +68 -0
  89. package/template/.claude/skills/yedit-table-usage/SKILL.md +227 -0
  90. package/template/.claude/skills/yss-api-integration/SKILL.md +12 -2
  91. package/template/.claude/skills/yss-components/SKILL.md +1 -1
  92. package/template/.claude/skills/yss-design-system/SKILL.md +1 -1
  93. package/template/.claude/skills/yss-formily/SKILL.md +233 -265
  94. package/template/.claude/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  95. package/template/.claude/skills/yss-hook/SKILL.md +1 -1
  96. package/template/.claude/skills/yss-openapi-governance/SKILL.md +2 -2
  97. package/template/.claude/skills/yss-page-module-development/SKILL.md +12 -2
  98. package/template/.claude/skills/yss-page-module-development/references/component-map.md +34 -0
  99. package/template/.claude/skills/yss-page-module-development/references/hooks-map.md +11 -0
  100. package/template/.claude/skills/yss-page-module-development/references/utils-map.md +14 -0
  101. package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  102. package/template/.claude/skills/yss-router/references/boundaries.md +1 -1
  103. package/template/.claude/skills/yss-router/references/router-contract.yaml +6 -2
  104. package/template/.claude/skills/yss-ui/SKILL.md +1 -1
  105. package/template/.claude/skills/yss-use-table-height/SKILL.md +9 -0
  106. package/template/.claude/skills/yss-use-tree-height/SKILL.md +9 -0
  107. package/template/.claude/skills/ytable-usage/SKILL.md +251 -0
  108. package/template/.claude/skills/ytree-usage/SKILL.md +132 -0
  109. package/template/.codex/skills/component-selection-imports/SKILL.md +64 -0
  110. package/template/.codex/skills/file-export-download/SKILL.md +160 -0
  111. package/template/.codex/skills/file-export-download/agents/openai.yaml +4 -0
  112. package/template/.codex/skills/formily-foundation/SKILL.md +176 -0
  113. package/template/.codex/skills/formily-foundation/references/examples.md +486 -0
  114. package/template/.codex/skills/formily-linkage-effects/SKILL.md +167 -0
  115. package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +137 -0
  116. package/template/.codex/skills/formily-step-flow/SKILL.md +194 -0
  117. package/template/.codex/skills/frontend-commit/SKILL.md +118 -0
  118. package/template/.codex/skills/frontend-commit/agents/openai.yaml +7 -0
  119. package/template/.codex/skills/frontend-commit/references/scope-and-examples.md +111 -0
  120. package/template/.codex/skills/java-backend-commit/SKILL.md +121 -0
  121. package/template/.codex/skills/java-backend-commit/agents/openai.yaml +7 -0
  122. package/template/.codex/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  123. package/template/.codex/skills/page-form-module/SKILL.md +168 -0
  124. package/template/.codex/skills/page-list-module/SKILL.md +137 -0
  125. package/template/.codex/skills/page-skeleton/SKILL.md +76 -0
  126. package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  127. package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  128. package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  129. package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  130. package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  131. package/template/.codex/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  132. package/template/.codex/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  133. package/template/.codex/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  134. package/template/.codex/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  135. package/template/.codex/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  136. package/template/.codex/skills/prototype-page-acceptance/SKILL.md +62 -0
  137. package/template/.codex/skills/theme-token-usage/SKILL.md +123 -0
  138. package/template/.codex/skills/theme-token-usage/agents/openai.yaml +4 -0
  139. package/template/.codex/skills/vue3-best-practices/SKILL.md +68 -0
  140. package/template/.codex/skills/yedit-table-usage/SKILL.md +227 -0
  141. package/template/.codex/skills/yss-api-integration/SKILL.md +12 -2
  142. package/template/.codex/skills/yss-components/SKILL.md +1 -1
  143. package/template/.codex/skills/yss-design-system/SKILL.md +1 -1
  144. package/template/.codex/skills/yss-formily/SKILL.md +233 -265
  145. package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  146. package/template/.codex/skills/yss-hook/SKILL.md +1 -1
  147. package/template/.codex/skills/yss-openapi-governance/SKILL.md +2 -2
  148. package/template/.codex/skills/yss-page-module-development/SKILL.md +12 -2
  149. package/template/.codex/skills/yss-page-module-development/references/component-map.md +34 -0
  150. package/template/.codex/skills/yss-page-module-development/references/hooks-map.md +11 -0
  151. package/template/.codex/skills/yss-page-module-development/references/utils-map.md +14 -0
  152. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  153. package/template/.codex/skills/yss-router/references/boundaries.md +1 -1
  154. package/template/.codex/skills/yss-router/references/router-contract.yaml +6 -2
  155. package/template/.codex/skills/yss-ui/SKILL.md +1 -1
  156. package/template/.codex/skills/yss-use-table-height/SKILL.md +9 -0
  157. package/template/.codex/skills/yss-use-tree-height/SKILL.md +9 -0
  158. package/template/.codex/skills/ytable-usage/SKILL.md +251 -0
  159. package/template/.codex/skills/ytree-usage/SKILL.md +132 -0
  160. package/template/.cursor/skills/.yss-skills-manifest.json +29 -0
  161. package/template/.cursor/skills/component-selection-imports/SKILL.md +64 -0
  162. package/template/.cursor/skills/file-export-download/SKILL.md +160 -0
  163. package/template/.cursor/skills/file-export-download/agents/openai.yaml +4 -0
  164. package/template/.cursor/skills/formily-foundation/SKILL.md +176 -0
  165. package/template/.cursor/skills/formily-foundation/references/examples.md +486 -0
  166. package/template/.cursor/skills/formily-linkage-effects/SKILL.md +167 -0
  167. package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +137 -0
  168. package/template/.cursor/skills/formily-step-flow/SKILL.md +194 -0
  169. package/template/.cursor/skills/frontend-commit/SKILL.md +118 -0
  170. package/template/.cursor/skills/frontend-commit/agents/openai.yaml +7 -0
  171. package/template/.cursor/skills/frontend-commit/references/scope-and-examples.md +111 -0
  172. package/template/.cursor/skills/java-backend-commit/SKILL.md +121 -0
  173. package/template/.cursor/skills/java-backend-commit/agents/openai.yaml +7 -0
  174. package/template/.cursor/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  175. package/template/.cursor/skills/page-form-module/SKILL.md +168 -0
  176. package/template/.cursor/skills/page-list-module/SKILL.md +137 -0
  177. package/template/.cursor/skills/page-skeleton/SKILL.md +76 -0
  178. package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  179. package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  180. package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  181. package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  182. package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  183. package/template/.cursor/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  184. package/template/.cursor/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  185. package/template/.cursor/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  186. package/template/.cursor/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  187. package/template/.cursor/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  188. package/template/.cursor/skills/prototype-page-acceptance/SKILL.md +62 -0
  189. package/template/.cursor/skills/theme-token-usage/SKILL.md +123 -0
  190. package/template/.cursor/skills/theme-token-usage/agents/openai.yaml +4 -0
  191. package/template/.cursor/skills/vue3-best-practices/SKILL.md +68 -0
  192. package/template/.cursor/skills/yedit-table-usage/SKILL.md +227 -0
  193. package/template/.cursor/skills/yss-api-integration/SKILL.md +12 -2
  194. package/template/.cursor/skills/yss-components/SKILL.md +1 -1
  195. package/template/.cursor/skills/yss-design-system/SKILL.md +1 -1
  196. package/template/.cursor/skills/yss-formily/SKILL.md +233 -265
  197. package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  198. package/template/.cursor/skills/yss-hook/SKILL.md +1 -1
  199. package/template/.cursor/skills/yss-openapi-governance/SKILL.md +2 -2
  200. package/template/.cursor/skills/yss-page-module-development/SKILL.md +12 -2
  201. package/template/.cursor/skills/yss-page-module-development/references/component-map.md +34 -0
  202. package/template/.cursor/skills/yss-page-module-development/references/hooks-map.md +11 -0
  203. package/template/.cursor/skills/yss-page-module-development/references/utils-map.md +14 -0
  204. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  205. package/template/.cursor/skills/yss-router/references/boundaries.md +1 -1
  206. package/template/.cursor/skills/yss-router/references/router-contract.yaml +6 -2
  207. package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
  208. package/template/.cursor/skills/yss-use-table-height/SKILL.md +9 -0
  209. package/template/.cursor/skills/yss-use-tree-height/SKILL.md +9 -0
  210. package/template/.cursor/skills/ytable-usage/SKILL.md +251 -0
  211. package/template/.cursor/skills/ytree-usage/SKILL.md +132 -0
  212. package/template/.cursorrules +32 -0
  213. package/template/.hermes/skills/component-selection-imports/SKILL.md +64 -0
  214. package/template/.hermes/skills/file-export-download/SKILL.md +160 -0
  215. package/template/.hermes/skills/file-export-download/agents/openai.yaml +4 -0
  216. package/template/.hermes/skills/formily-foundation/SKILL.md +176 -0
  217. package/template/.hermes/skills/formily-foundation/references/examples.md +486 -0
  218. package/template/.hermes/skills/formily-linkage-effects/SKILL.md +167 -0
  219. package/template/.hermes/skills/formily-mode-slot-detail/SKILL.md +137 -0
  220. package/template/.hermes/skills/formily-step-flow/SKILL.md +194 -0
  221. package/template/.hermes/skills/frontend-commit/SKILL.md +118 -0
  222. package/template/.hermes/skills/frontend-commit/agents/openai.yaml +7 -0
  223. package/template/.hermes/skills/frontend-commit/references/scope-and-examples.md +111 -0
  224. package/template/.hermes/skills/java-backend-commit/SKILL.md +121 -0
  225. package/template/.hermes/skills/java-backend-commit/agents/openai.yaml +7 -0
  226. package/template/.hermes/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  227. package/template/.hermes/skills/page-form-module/SKILL.md +168 -0
  228. package/template/.hermes/skills/page-list-module/SKILL.md +137 -0
  229. package/template/.hermes/skills/page-skeleton/SKILL.md +76 -0
  230. package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  231. package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  232. package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  233. package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  234. package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  235. package/template/.hermes/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  236. package/template/.hermes/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  237. package/template/.hermes/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  238. package/template/.hermes/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  239. package/template/.hermes/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  240. package/template/.hermes/skills/prototype-page-acceptance/SKILL.md +62 -0
  241. package/template/.hermes/skills/theme-token-usage/SKILL.md +123 -0
  242. package/template/.hermes/skills/theme-token-usage/agents/openai.yaml +4 -0
  243. package/template/.hermes/skills/vue3-best-practices/SKILL.md +68 -0
  244. package/template/.hermes/skills/yedit-table-usage/SKILL.md +227 -0
  245. package/template/.hermes/skills/yss-api-integration/SKILL.md +12 -2
  246. package/template/.hermes/skills/yss-components/SKILL.md +1 -1
  247. package/template/.hermes/skills/yss-design-system/SKILL.md +1 -1
  248. package/template/.hermes/skills/yss-formily/SKILL.md +233 -265
  249. package/template/.hermes/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  250. package/template/.hermes/skills/yss-hook/SKILL.md +1 -1
  251. package/template/.hermes/skills/yss-openapi-governance/SKILL.md +2 -2
  252. package/template/.hermes/skills/yss-page-module-development/SKILL.md +12 -2
  253. package/template/.hermes/skills/yss-page-module-development/references/component-map.md +34 -0
  254. package/template/.hermes/skills/yss-page-module-development/references/hooks-map.md +11 -0
  255. package/template/.hermes/skills/yss-page-module-development/references/utils-map.md +14 -0
  256. package/template/.hermes/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  257. package/template/.hermes/skills/yss-router/references/boundaries.md +1 -1
  258. package/template/.hermes/skills/yss-router/references/router-contract.yaml +6 -2
  259. package/template/.hermes/skills/yss-ui/SKILL.md +1 -1
  260. package/template/.hermes/skills/yss-use-table-height/SKILL.md +9 -0
  261. package/template/.hermes/skills/yss-use-tree-height/SKILL.md +9 -0
  262. package/template/.hermes/skills/ytable-usage/SKILL.md +251 -0
  263. package/template/.hermes/skills/ytree-usage/SKILL.md +132 -0
  264. package/template/.pi/skills/component-selection-imports/SKILL.md +64 -0
  265. package/template/.pi/skills/file-export-download/SKILL.md +160 -0
  266. package/template/.pi/skills/file-export-download/agents/openai.yaml +4 -0
  267. package/template/.pi/skills/formily-foundation/SKILL.md +176 -0
  268. package/template/.pi/skills/formily-foundation/references/examples.md +486 -0
  269. package/template/.pi/skills/formily-linkage-effects/SKILL.md +167 -0
  270. package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +137 -0
  271. package/template/.pi/skills/formily-step-flow/SKILL.md +194 -0
  272. package/template/.pi/skills/frontend-commit/SKILL.md +118 -0
  273. package/template/.pi/skills/frontend-commit/agents/openai.yaml +7 -0
  274. package/template/.pi/skills/frontend-commit/references/scope-and-examples.md +111 -0
  275. package/template/.pi/skills/java-backend-commit/SKILL.md +121 -0
  276. package/template/.pi/skills/java-backend-commit/agents/openai.yaml +7 -0
  277. package/template/.pi/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  278. package/template/.pi/skills/page-form-module/SKILL.md +168 -0
  279. package/template/.pi/skills/page-list-module/SKILL.md +137 -0
  280. package/template/.pi/skills/page-skeleton/SKILL.md +76 -0
  281. package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  282. package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  283. package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  284. package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  285. package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  286. package/template/.pi/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  287. package/template/.pi/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  288. package/template/.pi/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  289. package/template/.pi/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  290. package/template/.pi/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  291. package/template/.pi/skills/prototype-page-acceptance/SKILL.md +62 -0
  292. package/template/.pi/skills/theme-token-usage/SKILL.md +123 -0
  293. package/template/.pi/skills/theme-token-usage/agents/openai.yaml +4 -0
  294. package/template/.pi/skills/vue3-best-practices/SKILL.md +68 -0
  295. package/template/.pi/skills/yedit-table-usage/SKILL.md +227 -0
  296. package/template/.pi/skills/yss-api-integration/SKILL.md +12 -2
  297. package/template/.pi/skills/yss-components/SKILL.md +1 -1
  298. package/template/.pi/skills/yss-design-system/SKILL.md +1 -1
  299. package/template/.pi/skills/yss-formily/SKILL.md +233 -265
  300. package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  301. package/template/.pi/skills/yss-hook/SKILL.md +1 -1
  302. package/template/.pi/skills/yss-openapi-governance/SKILL.md +2 -2
  303. package/template/.pi/skills/yss-page-module-development/SKILL.md +12 -2
  304. package/template/.pi/skills/yss-page-module-development/references/component-map.md +34 -0
  305. package/template/.pi/skills/yss-page-module-development/references/hooks-map.md +11 -0
  306. package/template/.pi/skills/yss-page-module-development/references/utils-map.md +14 -0
  307. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  308. package/template/.pi/skills/yss-router/references/boundaries.md +1 -1
  309. package/template/.pi/skills/yss-router/references/router-contract.yaml +6 -2
  310. package/template/.pi/skills/yss-ui/SKILL.md +1 -1
  311. package/template/.pi/skills/yss-use-table-height/SKILL.md +9 -0
  312. package/template/.pi/skills/yss-use-tree-height/SKILL.md +9 -0
  313. package/template/.pi/skills/ytable-usage/SKILL.md +251 -0
  314. package/template/.pi/skills/ytree-usage/SKILL.md +132 -0
  315. package/template/.qoder/skills/component-selection-imports/SKILL.md +64 -0
  316. package/template/.qoder/skills/file-export-download/SKILL.md +160 -0
  317. package/template/.qoder/skills/file-export-download/agents/openai.yaml +4 -0
  318. package/template/.qoder/skills/formily-foundation/SKILL.md +176 -0
  319. package/template/.qoder/skills/formily-foundation/references/examples.md +486 -0
  320. package/template/.qoder/skills/formily-linkage-effects/SKILL.md +167 -0
  321. package/template/.qoder/skills/formily-mode-slot-detail/SKILL.md +137 -0
  322. package/template/.qoder/skills/formily-step-flow/SKILL.md +194 -0
  323. package/template/.qoder/skills/frontend-commit/SKILL.md +118 -0
  324. package/template/.qoder/skills/frontend-commit/agents/openai.yaml +7 -0
  325. package/template/.qoder/skills/frontend-commit/references/scope-and-examples.md +111 -0
  326. package/template/.qoder/skills/java-backend-commit/SKILL.md +121 -0
  327. package/template/.qoder/skills/java-backend-commit/agents/openai.yaml +7 -0
  328. package/template/.qoder/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  329. package/template/.qoder/skills/page-form-module/SKILL.md +168 -0
  330. package/template/.qoder/skills/page-list-module/SKILL.md +137 -0
  331. package/template/.qoder/skills/page-skeleton/SKILL.md +76 -0
  332. package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  333. package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  334. package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  335. package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  336. package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  337. package/template/.qoder/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  338. package/template/.qoder/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  339. package/template/.qoder/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  340. package/template/.qoder/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  341. package/template/.qoder/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  342. package/template/.qoder/skills/prototype-page-acceptance/SKILL.md +62 -0
  343. package/template/.qoder/skills/theme-token-usage/SKILL.md +123 -0
  344. package/template/.qoder/skills/theme-token-usage/agents/openai.yaml +4 -0
  345. package/template/.qoder/skills/vue3-best-practices/SKILL.md +68 -0
  346. package/template/.qoder/skills/yedit-table-usage/SKILL.md +227 -0
  347. package/template/.qoder/skills/yss-api-integration/SKILL.md +12 -2
  348. package/template/.qoder/skills/yss-components/SKILL.md +1 -1
  349. package/template/.qoder/skills/yss-design-system/SKILL.md +1 -1
  350. package/template/.qoder/skills/yss-formily/SKILL.md +233 -265
  351. package/template/.qoder/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  352. package/template/.qoder/skills/yss-hook/SKILL.md +1 -1
  353. package/template/.qoder/skills/yss-openapi-governance/SKILL.md +2 -2
  354. package/template/.qoder/skills/yss-page-module-development/SKILL.md +12 -2
  355. package/template/.qoder/skills/yss-page-module-development/references/component-map.md +34 -0
  356. package/template/.qoder/skills/yss-page-module-development/references/hooks-map.md +11 -0
  357. package/template/.qoder/skills/yss-page-module-development/references/utils-map.md +14 -0
  358. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  359. package/template/.qoder/skills/yss-router/references/boundaries.md +1 -1
  360. package/template/.qoder/skills/yss-router/references/router-contract.yaml +6 -2
  361. package/template/.qoder/skills/yss-ui/SKILL.md +1 -1
  362. package/template/.qoder/skills/yss-use-table-height/SKILL.md +9 -0
  363. package/template/.qoder/skills/yss-use-tree-height/SKILL.md +9 -0
  364. package/template/.qoder/skills/ytable-usage/SKILL.md +251 -0
  365. package/template/.qoder/skills/ytree-usage/SKILL.md +132 -0
  366. package/template/.trae/skills/.yss-skills-manifest.json +29 -0
  367. package/template/.trae/skills/component-selection-imports/SKILL.md +64 -0
  368. package/template/.trae/skills/file-export-download/SKILL.md +160 -0
  369. package/template/.trae/skills/file-export-download/agents/openai.yaml +4 -0
  370. package/template/.trae/skills/formily-foundation/SKILL.md +176 -0
  371. package/template/.trae/skills/formily-foundation/references/examples.md +486 -0
  372. package/template/.trae/skills/formily-linkage-effects/SKILL.md +167 -0
  373. package/template/.trae/skills/formily-mode-slot-detail/SKILL.md +137 -0
  374. package/template/.trae/skills/formily-step-flow/SKILL.md +194 -0
  375. package/template/.trae/skills/frontend-commit/SKILL.md +118 -0
  376. package/template/.trae/skills/frontend-commit/agents/openai.yaml +7 -0
  377. package/template/.trae/skills/frontend-commit/references/scope-and-examples.md +111 -0
  378. package/template/.trae/skills/java-backend-commit/SKILL.md +121 -0
  379. package/template/.trae/skills/java-backend-commit/agents/openai.yaml +7 -0
  380. package/template/.trae/skills/java-backend-commit/references/scope-and-examples.md +118 -0
  381. package/template/.trae/skills/page-form-module/SKILL.md +168 -0
  382. package/template/.trae/skills/page-list-module/SKILL.md +137 -0
  383. package/template/.trae/skills/page-skeleton/SKILL.md +76 -0
  384. package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
  385. package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
  386. package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
  387. package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
  388. package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
  389. package/template/.trae/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
  390. package/template/.trae/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
  391. package/template/.trae/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
  392. package/template/.trae/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
  393. package/template/.trae/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
  394. package/template/.trae/skills/prototype-page-acceptance/SKILL.md +62 -0
  395. package/template/.trae/skills/theme-token-usage/SKILL.md +123 -0
  396. package/template/.trae/skills/theme-token-usage/agents/openai.yaml +4 -0
  397. package/template/.trae/skills/vue3-best-practices/SKILL.md +68 -0
  398. package/template/.trae/skills/yedit-table-usage/SKILL.md +227 -0
  399. package/template/.trae/skills/yss-api-integration/SKILL.md +12 -2
  400. package/template/.trae/skills/yss-components/SKILL.md +1 -1
  401. package/template/.trae/skills/yss-design-system/SKILL.md +1 -1
  402. package/template/.trae/skills/yss-formily/SKILL.md +233 -265
  403. package/template/.trae/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
  404. package/template/.trae/skills/yss-hook/SKILL.md +1 -1
  405. package/template/.trae/skills/yss-openapi-governance/SKILL.md +2 -2
  406. package/template/.trae/skills/yss-page-module-development/SKILL.md +12 -2
  407. package/template/.trae/skills/yss-page-module-development/references/component-map.md +34 -0
  408. package/template/.trae/skills/yss-page-module-development/references/hooks-map.md +11 -0
  409. package/template/.trae/skills/yss-page-module-development/references/utils-map.md +14 -0
  410. package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
  411. package/template/.trae/skills/yss-router/references/boundaries.md +1 -1
  412. package/template/.trae/skills/yss-router/references/router-contract.yaml +6 -2
  413. package/template/.trae/skills/yss-ui/SKILL.md +1 -1
  414. package/template/.trae/skills/yss-use-table-height/SKILL.md +9 -0
  415. package/template/.trae/skills/yss-use-tree-height/SKILL.md +9 -0
  416. package/template/.trae/skills/ytable-usage/SKILL.md +251 -0
  417. package/template/.trae/skills/ytree-usage/SKILL.md +132 -0
  418. package/template/AGENTS.md +1 -13
  419. package/template/docs/adr/README.md +7 -0
  420. package/template/docs/agents/skill-migrations.md +16 -0
  421. package/template/docs/agents/skills-maintenance.md +2 -2
  422. package/template/docs/agents/yss-skill-registry.yaml +125 -25
  423. package/template/docs/process/implementation-repo-integration.md +1 -1
  424. package/template/docs/user-guide//344/272/247/345/223/201/347/240/224/345/217/221/345/205/250/347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +4 -4
  425. package/template/docs/user-guide//347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +1 -1
  426. package/template/scripts/lib/scenario-checks.mjs +21 -0
  427. package/template/scripts/lib/skill-governance.mjs +50 -0
  428. package/template/scripts/lib/skill-registry.mjs +82 -5
  429. package/template/scripts/lib/skill-supply-chain.mjs +5 -1
  430. package/template/scripts/verify-governance-release +7 -5
  431. package/template/scripts/verify-skill-governance +10 -0
  432. package/template/scripts/verify-template +3 -2
  433. package/template/skills-lock.json +285 -29
  434. package/template.manifest.json +30 -7
  435. package/template.snapshot.json +5 -4
  436. package/template/.agents/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  437. package/template/.agents/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  438. package/template/.agents/skills/yss-formily/agents/openai.yaml +0 -5
  439. package/template/.agents/skills/yss-formily/references/examples.md +0 -65
  440. package/template/.claude/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  441. package/template/.claude/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  442. package/template/.claude/skills/yss-formily/agents/openai.yaml +0 -5
  443. package/template/.claude/skills/yss-formily/references/examples.md +0 -65
  444. package/template/.codex/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  445. package/template/.codex/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  446. package/template/.codex/skills/yss-formily/agents/openai.yaml +0 -5
  447. package/template/.codex/skills/yss-formily/references/examples.md +0 -65
  448. package/template/.cursor/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  449. package/template/.cursor/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  450. package/template/.cursor/skills/yss-formily/agents/openai.yaml +0 -5
  451. package/template/.cursor/skills/yss-formily/references/examples.md +0 -65
  452. package/template/.hermes/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  453. package/template/.hermes/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  454. package/template/.hermes/skills/yss-formily/agents/openai.yaml +0 -5
  455. package/template/.hermes/skills/yss-formily/references/examples.md +0 -65
  456. package/template/.pi/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  457. package/template/.pi/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  458. package/template/.pi/skills/yss-formily/agents/openai.yaml +0 -5
  459. package/template/.pi/skills/yss-formily/references/examples.md +0 -65
  460. package/template/.qoder/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  461. package/template/.qoder/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  462. package/template/.qoder/skills/yss-formily/agents/openai.yaml +0 -5
  463. package/template/.qoder/skills/yss-formily/references/examples.md +0 -65
  464. package/template/.trae/skills/high-fidelity-html-prototype/SKILL.md +0 -89
  465. package/template/.trae/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
  466. package/template/.trae/skills/yss-formily/agents/openai.yaml +0 -5
  467. package/template/.trae/skills/yss-formily/references/examples.md +0 -65
  468. package/template/docs/adr/0001-product-design-prototype-entrypoint.md +0 -54
  469. package/template/docs/adr/0002-yss-project-repository-mode.md +0 -3
  470. package/template/docs/adr/0003-machine-readable-lifecycle-registry.md +0 -5
  471. package/template/docs/adr/0006-stable-lifecycle-ids-and-generated-structure.md +0 -5
  472. package/template/docs/adr/0007-lifecycle-native-work-units.md +0 -5
package/README.md CHANGED
@@ -47,7 +47,7 @@ npx create-yss-spec@latest --version
47
47
  - init / sync 不把模板源治理笔记、wiki、审查证据、源仓 CI / Cloud 环境和公开发布清单写入项目实例;attach 会带上 `yss-public-skills.json` 供 `verify-template` 使用
48
48
  - 空 gitlink / detached HEAD / git-submodule 挂载点 fail closed,`--force` 也不能覆盖
49
49
 
50
- 本次模板适配按 `2.2.0` 发布,绑定 `yss-spec-project-template@04a6151`。`templateCommit` 会写入实例 metadata;“最新模板”指用户执行的 `npx create-yss-spec@latest` 所携带的最新已发布快照,CLI 运行时不会拉取模板仓库。
50
+ 本次模板适配按 `2.2.2` 发布,绑定 `yss-spec-project-template@51189ca`。`templateCommit` 会写入实例 metadata;“最新模板”指用户执行的 `npx create-yss-spec@latest` 所携带的最新已发布快照,CLI 运行时不会拉取模板仓库。实例会带上 YSS 前端技能叠加层(如 `ytable-usage`、`formily-foundation`、`yss-page-module-development`)、`.cursorrules` 与 `.agents/rules/yss-ai-skills.md`;审查临时目录 `docs/.scratch/` 与已退役的 `high-fidelity-html-prototype` 等独立入口不进入快照。
51
51
 
52
52
  ## 接管已有项目
53
53
 
@@ -100,7 +100,7 @@ npx create-yss-spec@latest sync --dry-run
100
100
  - 对已知的 Spec / Ticket 旧路径执行一次性迁移
101
101
  - 迁移目标已存在且内容不一致时停止,不静默覆盖
102
102
  - `.gitmodules`、gitlink(mode `160000`)和 `apps/` 下已挂载实现仓是用户资产,不创建、不覆盖、不删除
103
- - init / sync 保持瘦实例:不复制 `scripts/`、`wiki/`、`.github/`、`.nvmrc`、`.gitignore`、`.template-source/`;attach 结束后会执行 `scripts/sync-skills --check`、`scripts/update-skill-lock --check` 和 `scripts/verify-template`,门禁失败会回滚文件和 metadata
103
+ - init / sync 保持实例边界:不复制 `wiki/`、`.github/`、`.template-source/`、源仓库 ADR、Cursor Cloud 环境配置、`docs/reviews/` 或根 `package.json`;共享 `scripts/`、`scripts/vendor/`、`.nvmrc` 和 `.gitignore` 属于实例门禁所需资产。attach 结束后会执行 `scripts/sync-skills --check`、`scripts/update-skill-lock --check` 和 `scripts/verify-template`,门禁失败会回滚文件和 metadata
104
104
 
105
105
  ```bash
106
106
  npx create-yss-spec@latest sync --target-dir . --dry-run
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-yss-spec",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Initialize a YSS spec project template repository",
5
5
  "repository": {
6
6
  "type": "git",
package/src/cli.js CHANGED
@@ -18,6 +18,7 @@ const TEMPLATE_MANIFEST = JSON.parse(TEMPLATE_MANIFEST_TEXT);
18
18
  const ROOT_EXCLUDED_ENTRIES = new Set(TEMPLATE_MANIFEST.excludeRootEntries);
19
19
  const ROOT_EXCLUDED_FILES = new Set(TEMPLATE_MANIFEST.excludeRootFiles);
20
20
  const EXCLUDED_RELATIVE_PATHS = new Set(TEMPLATE_MANIFEST.excludePaths);
21
+ const ALLOWED_RELATIVE_PATHS = new Set(TEMPLATE_MANIFEST.allowFiles || []);
21
22
  const INIT_EXCLUDED_ROOT_ENTRIES = new Set(
22
23
  TEMPLATE_MANIFEST.initExcludeRootEntries || [],
23
24
  );
@@ -47,6 +48,7 @@ const AGENT_SKILL_ROOTS = [
47
48
  ];
48
49
  const GITLINK_MODE = "160000";
49
50
  const UNMANAGED_USER_PATHS = new Set([".gitmodules"]);
51
+ const GITLINK_PATH_CACHE = new Map();
50
52
  const INSTANCE_FORBIDDEN_PATHS = [
51
53
  ".template-source",
52
54
  ".github",
@@ -96,6 +98,9 @@ function readTemplateSnapshot() {
96
98
  if (!/^[0-9a-f]{64}$/.test(snapshot.snapshotHash || "")) {
97
99
  throw new Error("模板快照必须包含 64 位 snapshotHash");
98
100
  }
101
+ if (snapshot.manifestHash !== TEMPLATE_MANIFEST_VERSION) {
102
+ throw new Error("模板快照与当前 template.manifest.json 不一致,请重新构建 CLI 包");
103
+ }
99
104
 
100
105
  if (
101
106
  snapshot.encodedPaths !== undefined &&
@@ -322,8 +327,20 @@ function collectGitRoots(start) {
322
327
  }
323
328
  let current = path.resolve(start);
324
329
  while (true) {
330
+ const gitPath = path.join(current, ".git");
331
+ let validGitEntry = false;
332
+ try {
333
+ const gitStat = fs.lstatSync(gitPath);
334
+ validGitEntry = gitStat.isDirectory()
335
+ ? fs.readdirSync(gitPath).length > 0
336
+ : gitStat.isFile();
337
+ } catch (error) {
338
+ if (error.code !== "ENOENT") {
339
+ throw error;
340
+ }
341
+ }
325
342
  if (
326
- fs.existsSync(path.join(current, ".git")) ||
343
+ validGitEntry ||
327
344
  fs.existsSync(path.join(current, ".gitmodules"))
328
345
  ) {
329
346
  roots.push(current);
@@ -378,7 +395,7 @@ function gitLsFilesStage(repoRoot, relativePath) {
378
395
  const result = spawnSync(
379
396
  "git",
380
397
  ["-C", repoRoot, "ls-files", "--stage", "--", relativePath],
381
- { encoding: "utf8" },
398
+ { encoding: "utf8", timeout: 5000 },
382
399
  );
383
400
  if (result.status !== 0) {
384
401
  return null;
@@ -394,11 +411,34 @@ function gitLsFilesStage(repoRoot, relativePath) {
394
411
  return { mode: match[1], sha: match[2], stage: match[3], path: match[4] };
395
412
  }
396
413
 
414
+ function gitlinkPaths(repoRoot) {
415
+ const resolvedRoot = path.resolve(repoRoot);
416
+ if (GITLINK_PATH_CACHE.has(resolvedRoot)) {
417
+ return GITLINK_PATH_CACHE.get(resolvedRoot);
418
+ }
419
+ const result = spawnSync(
420
+ "git",
421
+ ["-C", resolvedRoot, "ls-files", "--stage", "-z"],
422
+ { encoding: "utf8", timeout: 5000 },
423
+ );
424
+ const paths = new Set();
425
+ if (result.status === 0) {
426
+ for (const record of (result.stdout || "").split("\0")) {
427
+ const match = record.match(/^(160000)\s+[0-9a-f]+\s+\d+\s+(.+)$/i);
428
+ if (match) {
429
+ paths.add(match[2].replaceAll("\\", "/"));
430
+ }
431
+ }
432
+ }
433
+ GITLINK_PATH_CACHE.set(resolvedRoot, paths);
434
+ return paths;
435
+ }
436
+
397
437
  function gitShowSuperproject(cwd) {
398
438
  const result = spawnSync(
399
439
  "git",
400
440
  ["-C", cwd, "rev-parse", "--show-superproject-working-tree"],
401
- { encoding: "utf8" },
441
+ { encoding: "utf8", timeout: 5000 },
402
442
  );
403
443
  if (result.status !== 0) {
404
444
  return "";
@@ -410,7 +450,7 @@ function gitAbbrevRef(cwd) {
410
450
  const result = spawnSync(
411
451
  "git",
412
452
  ["-C", cwd, "rev-parse", "--abbrev-ref", "HEAD"],
413
- { encoding: "utf8" },
453
+ { encoding: "utf8", timeout: 5000 },
414
454
  );
415
455
  if (result.status !== 0) {
416
456
  return null;
@@ -432,21 +472,22 @@ function isEmptyDir(dir) {
432
472
 
433
473
  function isGitSubmoduleMount(repoRoot, targetPathValue) {
434
474
  const relative = posixRelative(repoRoot, path.resolve(targetPathValue));
435
- if (!relative || relative.startsWith("..") || path.isAbsolute(relative)) {
475
+ if (!relative || relative === "." || relative.startsWith("..") || path.isAbsolute(relative)) {
436
476
  return false;
437
477
  }
438
478
  if (readGitmodules(repoRoot).some((item) => item.path === relative)) {
439
479
  return true;
440
480
  }
441
- const staged = gitLsFilesStage(repoRoot, relative);
442
- return staged?.mode === GITLINK_MODE;
481
+ return gitlinkPaths(repoRoot).has(relative);
443
482
  }
444
483
 
445
484
  function inspectCheckoutState(repoRoot, targetPathValue) {
446
485
  const resolved = path.resolve(targetPathValue);
447
486
  const relative = posixRelative(path.resolve(repoRoot), resolved);
448
487
  const inRepo = Boolean(relative) && !relative.startsWith("..");
449
- const staged = inRepo ? gitLsFilesStage(repoRoot, relative) : null;
488
+ const staged = inRepo && gitlinkPaths(repoRoot).has(relative)
489
+ ? { mode: GITLINK_MODE }
490
+ : null;
450
491
  const listed = inRepo
451
492
  ? readGitmodules(repoRoot).some((item) => item.path === relative)
452
493
  : false;
@@ -577,6 +618,11 @@ function targetPath(targetDir, relativePath) {
577
618
 
578
619
  function shouldExcludeRelativePath(relativePath, mode = "managed") {
579
620
  const normalized = normalizeRelativePath(relativePath);
621
+ if ([...ALLOWED_RELATIVE_PATHS].some(
622
+ (allowedPath) => allowedPath === normalized || allowedPath.startsWith(`${normalized}/`),
623
+ )) {
624
+ return false;
625
+ }
580
626
  return EXCLUDED_RELATIVE_PATHS.has(normalized) ||
581
627
  (mode === "init" &&
582
628
  (INIT_EXCLUDED_RELATIVE_PATHS.has(normalized) ||
@@ -1505,6 +1551,7 @@ function gitDirtyWarning(targetDir) {
1505
1551
  const probe = spawnSync("git", ["rev-parse", "--is-inside-work-tree"], {
1506
1552
  cwd: targetDir,
1507
1553
  encoding: "utf8",
1554
+ timeout: 5000,
1508
1555
  });
1509
1556
  if (probe.status !== 0 || probe.stdout.trim() !== "true") {
1510
1557
  return null;
@@ -1512,6 +1559,7 @@ function gitDirtyWarning(targetDir) {
1512
1559
  const status = spawnSync("git", ["status", "--porcelain"], {
1513
1560
  cwd: targetDir,
1514
1561
  encoding: "utf8",
1562
+ timeout: 5000,
1515
1563
  });
1516
1564
  if (status.status === 0 && status.stdout.trim()) {
1517
1565
  return "警告:目标 Git worktree 存在未提交改动;CLI 不会自动 stash 或提交,请在结果后检查 git diff / git status";
@@ -0,0 +1,59 @@
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # YSS AI Skills Entry
6
+
7
+ 本项目使用 YSS UI 业务页面开发规范。处理 Vue3 业务页面、CRUD、列表、表单、抽屉、YTable、YEditTable、YFormily、YTree、API 对接任务时,必须先读取匹配的 SKILL.md,再写计划或代码。
8
+
9
+ ## Available Skills
10
+
11
+ - yss-page-module-development: .agents/skills/yss-page-module-development/SKILL.md
12
+ - theme-token-usage: .agents/skills/theme-token-usage/SKILL.md
13
+ - component-selection-imports: .agents/skills/component-selection-imports/SKILL.md
14
+ - page-skeleton: .agents/skills/page-skeleton/SKILL.md
15
+ - page-list-module: .agents/skills/page-list-module/SKILL.md
16
+ - page-form-module: .agents/skills/page-form-module/SKILL.md
17
+ - ytable-usage: .agents/skills/ytable-usage/SKILL.md
18
+ - yedit-table-usage: .agents/skills/yedit-table-usage/SKILL.md
19
+ - ytree-usage: .agents/skills/ytree-usage/SKILL.md
20
+ - prototype-page-acceptance: .agents/skills/prototype-page-acceptance/SKILL.md
21
+ - yss-api-integration: .agents/skills/yss-api-integration/SKILL.md
22
+ - file-export-download: .agents/skills/file-export-download/SKILL.md
23
+ - vue3-best-practices: .agents/skills/vue3-best-practices/SKILL.md
24
+ - frontend-commit: .agents/skills/frontend-commit/SKILL.md
25
+ - java-backend-commit: .agents/skills/java-backend-commit/SKILL.md
26
+ - yss-use-table-height: .agents/skills/yss-use-table-height/SKILL.md
27
+ - yss-use-tree-height: .agents/skills/yss-use-tree-height/SKILL.md
28
+ - yss-formily: .agents/skills/yss-formily/SKILL.md
29
+ - formily-foundation: .agents/skills/formily-foundation/SKILL.md
30
+ - formily-linkage-effects: .agents/skills/formily-linkage-effects/SKILL.md
31
+ - formily-mode-slot-detail: .agents/skills/formily-mode-slot-detail/SKILL.md
32
+ - formily-step-flow: .agents/skills/formily-step-flow/SKILL.md
33
+
34
+ ## Mandatory Workflow
35
+
36
+ 1. 页面/CRUD/列表/表单任务:先读 `.agents/skills/yss-page-module-development/SKILL.md`。
37
+ 2. 新增或修改页面、组件、Less、内联样式、TS 渲染配置、SVG 色值:必须读 `.agents/skills/theme-token-usage/SKILL.md`。
38
+ 3. 导出、报表、模板、附件、Excel、CSV、PDF、ZIP、Blob 下载任务:必须读 `.agents/skills/file-export-download/SKILL.md`。
39
+ 4. 列表或表格任务:同时读 `.agents/skills/page-list-module/SKILL.md`、`.agents/skills/ytable-usage/SKILL.md`、`.agents/skills/yss-use-table-height/SKILL.md`。
40
+ 5. 新增/编辑/查看/抽屉表单:同时读 `.agents/skills/yss-formily/SKILL.md`、`.agents/skills/page-form-module/SKILL.md`。
41
+ 6. 可编辑表格、扩展属性、添加行/删除行:必须读 `.agents/skills/yedit-table-usage/SKILL.md`。
42
+ 7. 用户给原型截图或旧项目路径:必须读 `.agents/skills/prototype-page-acceptance/SKILL.md`,先生成验收清单,再实现。
43
+
44
+ ## Hard Stops
45
+
46
+ - 禁止使用 YTable 不存在的 `request`、`search-params` Props 和 `actionConfig.actions`;实例 `refresh()` 只刷新当前表格数据,不得当作远程重新查询。
47
+ - 标准列表必须使用 `:data`、`:columns`、`:loading`、`pageable`、`v-model:pagination`、`@page-change`。
48
+ - 表格主操作必须放入 `#toolbar-right`;只有确实需要列设置时才使用 `:toolbar-config="{ custom: true }"`。
49
+ - 业务列表查询区默认将查询/重置按钮放在 YFormily 外部独占一行并右对齐;`AutoButtonGroup + Submit + Reset` 仅用于纯 Formily 提交表单。
50
+ - 所有 YFormily 横向业务表单必须使用 `FormLayout(labelWidth, labelAlign: 'right') -> FormGrid -> 字段`,不得省略固定 label 宽度和右对齐。
51
+ - FormGrid 必须保持响应式:默认 `minColumns: 1`,通过 `maxColumns`、`minWidth` 控制宽屏列数;禁止 `minColumns` 等于 `maxColumns` 固定列数,除非用户明确要求不响应式。
52
+ - 抽屉/弹窗编辑表单默认 `labelWidth: 140`、`FormGrid { maxColumns: 2, minColumns: 1, minWidth: 320~360 }`;备注/长文本字段必须用 `gridSpan` 占满整行。
53
+ - 可编辑表格必须优先使用 `YEditTable`,禁止用 `a-table` 手搓。
54
+ - 抽屉表单必须有响应式宽度,查看态不显示保存按钮。
55
+ - 页面和组件禁止硬编码品牌色及 hover/active/selected/focus 色阶;主色透明态必须从真实动态 Token 派生,不得依赖未同步变量的固定色 fallback。
56
+ - 导出下载必须优先调用 `handleBlobResponse(res.data, res.headers)`;生成方法缺少 Blob 配置时,第二参数必须传 `{ responseType: 'blob' }`,禁止手改 Orval 生成文件。
57
+ - Orval 请求失败由 `mutator.ts` 统一提示并 reject;业务 Hook 禁止 `if (res?.success)` 冗余判断,也禁止在 `else`/`catch` 重复 `message.error`,除非请求显式跳过了全局处理。
58
+ - 调用 Orval API 前必须检查当前生成文件;存在具名导出时直接导入,只有工厂导出时在模块顶层创建一次实例,禁止猜测 `getApi()` 名称。
59
+ - 有截图/旧项目参考时,交付前必须逐项对照查询区、表格工具栏、分页高度、抽屉、label、字段控件类型。
@@ -0,0 +1,28 @@
1
+ {
2
+ "source": "@yss/skills",
3
+ "mode": "copy",
4
+ "skills": [
5
+ "yss-page-module-development",
6
+ "theme-token-usage",
7
+ "component-selection-imports",
8
+ "page-skeleton",
9
+ "page-list-module",
10
+ "page-form-module",
11
+ "ytable-usage",
12
+ "yedit-table-usage",
13
+ "ytree-usage",
14
+ "prototype-page-acceptance",
15
+ "yss-api-integration",
16
+ "file-export-download",
17
+ "vue3-best-practices",
18
+ "frontend-commit",
19
+ "java-backend-commit",
20
+ "yss-use-table-height",
21
+ "yss-use-tree-height",
22
+ "yss-formily",
23
+ "formily-foundation",
24
+ "formily-linkage-effects",
25
+ "formily-mode-slot-detail",
26
+ "formily-step-flow"
27
+ ]
28
+ }
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: component-selection-imports
3
+ description: 指导 YSS UI 业务页面、CRUD、列表页、表单页和组件评审在编码前判定组件、Hook 与工具函数的真实导出来源;当需要在 @yss-ui/components、@yss-ui/hooks、@yss-ui/utils 与 ant-design-vue 之间选择,或需要排查虚构 Y 前缀组件、错误导入、Formily UI 边界时使用。
4
+ ---
5
+
6
+ # 组件选择与导入
7
+
8
+ ## 触发条件
9
+
10
+ - 生成 YSS UI 业务页面前需要判定组件、Hook 或工具函数来源。
11
+ - 出现错误 Y 前缀、导入冲突、Formily UI 跨层或者组件是否已封装不明确。
12
+
13
+ ## 不适用场景
14
+
15
+ - 只修改与 UI 导入无关的纯数据逻辑。
16
+ - 组件库内部组件开发;该场景应按组件开发规范处理内部依赖。
17
+
18
+ ## 判定流程
19
+
20
+ 1. 当前会话可用 yss-ui MCP 时,先用 `list_components` 确认组件、Hook 或 Utils 是否真实存在,再用 `get_component_docs` 确认名称、导出包、Props、Events 和 Slots,不只看 demo 标签名。
21
+ 2. `get_component_docs` 未命中时,先用 `search_docs` 和 `list_components` 校正别名与归属,不得立即判定为未封装。
22
+ 3. MCP 工具不可用、调用失败或校正后仍无结果时,读取当前上下文中的最新 `llms-full.txt`;上下文没有时读取 `http://192.168.164.27:3200/llms-full.txt`。
23
+ 4. 必要时读取 `../yss-page-module-development/references/component-map.md`、`hooks-map.md`、`utils-map.md` 快速缩小范围;文档与当前项目依赖版本不一致时,最终以当前源码和可编译导出为准。
24
+ 5. 已导出的 YSS 能力优先从 `@yss-ui/components`、`@yss-ui/hooks`、`@yss-ui/utils` 导入;确认未封装后才从 `ant-design-vue` 导入原组件。
25
+ 6. 若文档与导出源码不一致,记录差异并按当前仓库可编译的导出处理,不猜测 API。
26
+
27
+ ## 硬约束(禁止/必须)
28
+
29
+ - 业务层已封装组件必须从 `@yss-ui/components` 导入;可编辑表格必须优先使用 `YEditTable`,业务主表格必须优先使用 `YTable`。
30
+ - 当前公共导出包含 `YButton`、`YCard`、`YTable`、`YEditTable`、`YTree`、`YSplitPane`、`YFormily` 等;未导出 `YModal`、`YDrawer`、`YInput`、`YPopconfirm`,禁止臆造这些名称。
31
+ - 当前未封装的 `Modal`、`Drawer`、`Popconfirm`、`Input` 等从 `ant-design-vue` 导入。删除操作使用按钮附近的 `Popconfirm`,不默认使用居中 `Modal.confirm`。
32
+ - 业务层禁止导入 `@formily/antdv` 或 `@formily/antd*` UI 组件;使用 `YFormily` 提供的 Schema 与组件边界。
33
+ - 禁止因文档暂时不可达就把猜测的 `Y*` 组件改成 Ant Design Vue “先落地”。只能复用当前仓库已证明可用的导入,或明确报告待确认项。
34
+ - 接口错误提示由 `mutator.ts` 的响应拦截器统一处理。API Hook 不得在 `success === false` 分支或 `catch` 内重复调用 `message.error`;`message` 只用于非 API 错误的本地交互反馈或成功提示。
35
+
36
+ ## 标准代码骨架
37
+
38
+ ```typescript
39
+ import {
40
+ YButton,
41
+ YCard,
42
+ YEditTable,
43
+ YTable,
44
+ YTree,
45
+ YFormily,
46
+ type YEditTableColumn,
47
+ type YTableColumn,
48
+ } from '@yss-ui/components';
49
+ import { useLoading, useTableHeight, useTreeHeight } from '@yss-ui/hooks';
50
+ import { copyToClipboard, formatDate } from '@yss-ui/utils';
51
+ import { Drawer, Input, Modal, Popconfirm } from 'ant-design-vue';
52
+ ```
53
+
54
+ ## 交付检查清单
55
+
56
+ - [ ] 每个关键导入都能在最新文档或包的 `src/index.ts` 中追溯。
57
+ - [ ] 未导出的 Y 前缀组件没有出现在业务代码中。
58
+ - [ ] 删除、表格、编辑表格和 Formily 导入边界符合项目约束。
59
+ - [ ] API Hook 中没有重复 `message.error`,异常仍由 `Promise.reject` 中断后续流程。
60
+
61
+ ## 失败兜底策略
62
+
63
+ - MCP 与 `llms-full.txt` 都不可用时,用 CodeGraph/源码 `src/index.ts` 和当前项目已编译的相近页面交叉确认,不猜测导出。
64
+ - 文档与源码不一致时,优先保证当前仓库可编译,并在交付中明确标注文档差异。
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: file-export-download
3
+ description: 指导 Vue3 YSS UI 微应用实现文件导出、报表下载、模板下载和附件下载,覆盖 OpenAPI binary 响应、Orval 生成方法检查、responseType blob 兜底、Blob 响应类型、Content-Disposition 文件名、handleBlobResponse、loading 与错误处理;当需求出现导出、下载、Excel、CSV、PDF、ZIP、Blob 或文件流时使用。
4
+ ---
5
+
6
+ # YSS 文件导出下载 Skill
7
+
8
+ ## 触发条件
9
+
10
+ - 页面需要导出 Excel、CSV、PDF、ZIP、报表、密钥文件或其他二进制文件。
11
+ - 页面需要下载导入模板、附件或后端动态生成的文件。
12
+ - Orval 生成接口的返回值是 `Blob`,或业务调用需要配置 `responseType: 'blob'`。
13
+ - 代码正在手写 `URL.createObjectURL`、解析 `Content-Disposition`、拼接文件名或调用 `downloadFileStream`。
14
+
15
+ ## 不适用场景
16
+
17
+ - 仅上传文件,不包含模板下载或导出流程。
18
+ - 下载公开静态 URL 且无需鉴权、请求参数和响应头文件名时,使用 `downloadFileFromUrl(url, fileName?)`。
19
+ - 浏览器只需要预览远程 PDF/图片,不触发文件保存。
20
+
21
+ ## 必读依据
22
+
23
+ - 通用接口规则:`../yss-api-integration/SKILL.md`。
24
+ - 当前项目:`openapi/openapi.json`、Orval 配置、生成后的 API 方法和 `packages/src/api/mutator.ts`。
25
+ - YSS Utils 文件下载能力:按下方检索顺序核对 `handleBlobResponse` 和 `downloadBlob`。
26
+
27
+ ## 文档检索
28
+
29
+ 1. MCP 可用时,先用 `search_docs` 查询 `handleBlobResponse 文件下载 Content-Disposition`,并读取命中的 `downloadBlob(/utils/download)` 文档。该能力属于工具函数,不强制调用面向组件别名的 `get_component_docs`。
30
+ 2. 搜索无结果时,调整关键词再次调用 `search_docs`;仅在 MCP 不可用、调用失败或仍无结果时,回退读取最新 `llms-full.txt` 的文件下载章节。文档版本与当前依赖不一致时,再核对 `packages/utils` 源码、CodeGraph 和真实导出。
31
+
32
+ ## 决策流程
33
+
34
+ 1. 在 OpenAPI 中定位导出接口,优先把成功响应声明为二进制媒体类型和 `format: binary`。
35
+ 2. 重新生成 API 后检查生成方法,而不是凭接口名称判断:
36
+ - 已包含 `responseType: 'blob'`:业务调用不必重复传第二参数。
37
+ - 未包含 `responseType: 'blob'`:业务调用必须传第二参数 `{ responseType: 'blob' }`。
38
+ 3. 检查 mutator 和全局错误处理器:Blob 成功响应必须保留 `{ data, headers }`;HTTP 4xx/5xx 的 Blob JSON 错误应由全局错误处理器解析并 reject。
39
+ 4. 在业务 hook 中设置 loading、防重复点击,调用生成 API,再执行 `handleBlobResponse(res.data, res.headers)`。
40
+ 5. 验证文件名、文件内容、错误响应和连续点击,不只验证浏览器出现了下载任务。
41
+
42
+ > OpenAPI 标准通过响应 `content` 和 `format: binary` 表达二进制,不直接使用 Axios 的 `responseType` 字段。最终以 Orval 生成方法是否含 `responseType: 'blob'` 为判断依据。
43
+
44
+ ## 硬约束(禁止/必须)
45
+
46
+ - 必须优先导入 `import { handleBlobResponse } from '@yss-ui/utils';` 处理接口文件流。
47
+ - 必须调用 `handleBlobResponse(res.data, res.headers)`;它会自动兼容响应头大小写,并解析 RFC 5987 `filename*` 与普通 `filename`。
48
+ - 第三个 `hasUtf8Encoding` 参数已弃用,禁止继续传递。
49
+ - 生成方法缺少 Blob 配置时,必须在第二参数顶层传 `{ responseType: 'blob' }`;禁止放进 `headers`、请求 body 或查询参数。
50
+ - 生成方法已包含 Blob 配置时,禁止为“保险”重复传相同配置;先保持 OpenAPI 契约和生成产物正确。
51
+ - 禁止修改 Orval 生成文件补写 `responseType`,因为重新生成会覆盖;应修正 OpenAPI,或在业务调用第二参数临时兜底。
52
+ - 禁止依赖 URL 中包含 `download/export` 的请求拦截器猜测响应类型;接口可能不按该名称命名。
53
+ - 禁止在业务层重复实现 `getFileNameFromContentDisposition`、`downloadFileStream`、`URL.createObjectURL` 和 `<a download>` 流程。
54
+ - 必须保留响应头;只取 `res.data` 会丢失服务端文件名。
55
+ - Blob 接口失败时遵循全局 mutator 错误处理,禁止在 catch 中重复 `message.error`;成功下载后可提示 `message.success`。
56
+ - 当前模板 mutator 只能识别“已解析 JSON 对象”的 `success === false`,不会自动检测 HTTP 200 Blob 内的业务错误;发现该契约时必须先修正后端状态码或 mutator,禁止把解析逻辑复制到每个 Hook。
57
+ - 必须用独立 loading 状态防止重复导出,并在 `finally` 中恢复。
58
+ - 不得默认传 `skipBusinessError` 或 `skipErrorHandler`;只有明确需要业务自定义错误体验时才使用。
59
+
60
+ ## OpenAPI 标准代码骨架
61
+
62
+ ```json
63
+ {
64
+ "responses": {
65
+ "200": {
66
+ "description": "导出成功",
67
+ "headers": {
68
+ "Content-Disposition": {
69
+ "schema": { "type": "string" }
70
+ }
71
+ },
72
+ "content": {
73
+ "application/octet-stream": {
74
+ "schema": {
75
+ "type": "string",
76
+ "format": "binary"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ 根据文件类型可将媒体类型换成 `text/csv`、`application/pdf` 或 Excel 对应类型。跨域请求若读取不到文件名,后端还必须暴露 `Content-Disposition` 响应头。
86
+
87
+ ## 标准代码骨架
88
+
89
+ ### 生成方法已包含 responseType
90
+
91
+ ```typescript
92
+ import { ref } from 'vue';
93
+ import { handleBlobResponse } from '@yss-ui/utils';
94
+ import { downloadAccessSecret } from '@/api/generated/quality';
95
+
96
+ /** 微应用 mutator 返回的文件下载响应。 */
97
+ type BlobDownloadResponse = {
98
+ data: Blob;
99
+ headers: Record<string, string>;
100
+ };
101
+
102
+ /** 文件下载进行中状态。 */
103
+ const downloading = ref(false);
104
+
105
+ /** 下载密钥文件。 */
106
+ const downloadFile = async (key: string): Promise<void> => {
107
+ if (downloading.value) return;
108
+
109
+ downloading.value = true;
110
+ try {
111
+ const res = (await downloadAccessSecret(key)) as unknown as BlobDownloadResponse;
112
+ handleBlobResponse(res.data, res.headers);
113
+ } catch {
114
+ // mutator 已展示错误;此处只阻止 reject 继续向 UI 事件传播。
115
+ } finally {
116
+ downloading.value = false;
117
+ }
118
+ };
119
+ ```
120
+
121
+ ### 生成方法缺少 responseType
122
+
123
+ 只改调用行,其他流程保持一致:
124
+
125
+ ```typescript
126
+ const res = (await downloadAccessSecret(key, {
127
+ responseType: 'blob',
128
+ })) as unknown as BlobDownloadResponse;
129
+ ```
130
+
131
+ 若 mutator 与 Orval 返回类型已经准确声明为 `{ data: Blob; headers: ... }`,直接使用生成类型,删除不必要的类型断言。
132
+
133
+ ## 响应约定
134
+
135
+ - 后端成功响应应返回真实文件流,并设置 `Content-Disposition: attachment; filename*=UTF-8''...`。
136
+ - mutator 对 Blob 成功响应返回 `{ data, headers }`,以便 `handleBlobResponse` 获取文件名。
137
+ - HTTP 错误的 Blob JSON 由全局错误处理器解析并 reject,业务 Hook 不重复解析或提示。
138
+ - HTTP 200 且 body 是 Blob 包装的业务错误时,当前模板不会自动 reject;必须修复契约或统一拦截器后再交付。
139
+ - `handleBlobResponse` 找不到文件名时会使用 `download`;应优先补齐后端响应头,而不是在每个页面手写解析逻辑。
140
+
141
+ ## 交付检查清单
142
+
143
+ - [ ] 已检查 OpenAPI 二进制响应声明和 Orval 生成方法。
144
+ - [ ] 仅在生成方法缺少配置时,第二参数传入了 `{ responseType: 'blob' }`。
145
+ - [ ] 已从 `@yss-ui/utils` 导入并调用 `handleBlobResponse(res.data, res.headers)`。
146
+ - [ ] 未修改 Orval 生成文件,未重复实现文件名解析或浏览器下载逻辑。
147
+ - [ ] Blob 成功响应保留了 `data` 与 `headers`,类型断言只位于 API 边界。
148
+ - [ ] 已处理 loading、防重复点击和 `finally` 恢复。
149
+ - [ ] 未在 catch 中重复业务错误 Toast。
150
+ - [ ] 中文文件名、普通文件名和缺失文件名场景均已验证。
151
+ - [ ] HTTP 错误的 Blob JSON 会 reject;如存在 HTTP 200 Blob 业务错误契约,已修正后端状态码或 mutator。
152
+ - [ ] 下载文件可以正常打开,格式和内容与接口预期一致。
153
+
154
+ ## 失败兜底策略
155
+
156
+ - 生成方法不支持第二参数时,先确认 Orval `options: true`;修正配置并重新生成,禁止手改生成文件。
157
+ - `res.headers` 为空时,检查 mutator 是否错误地只返回 `data`,以及后端/CORS 是否暴露 `Content-Disposition`。
158
+ - 下载到 JSON 错误文件时,先确认 HTTP 状态码:非 2xx 检查全局错误处理器,HTTP 200 检查后端契约并在 mutator 统一补齐;禁止把解析逻辑复制到每个业务 Hook。
159
+ - 文件名始终为 `download` 时,优先修复后端 `Content-Disposition`;无法改后端时再评估统一扩展 YSS 下载工具。
160
+ - 超大文件导致内存压力时,改用后端临时 URL、分片或流式下载方案,不强行把全部内容载入 Blob。
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "YSS 文件导出下载"
3
+ short_description: "规范 Orval Blob 导出、responseType 配置与文件下载处理"
4
+ default_prompt: "使用 $file-export-download 实现类型安全的文件导出下载,并正确处理 Blob、响应头和文件名。"