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
@@ -0,0 +1,486 @@
1
+ # YFormily 代码示例库
2
+
3
+ 本参考只保留可直接复用且已与当前源码核对的模式。基础 Props、实例方法与详情配置以最新 `llms-full.txt` 和 `packages/components/src/formily` 为准;不要从旧 demo 推断未公开 API。
4
+
5
+ ## 目录
6
+
7
+ 1. [基础表单与提交](#1-基础表单与提交)
8
+ 2. [表达式显隐与禁用](#2-表达式显隐与禁用)
9
+ 3. [x-reactions 级联选项](#3-x-reactions-级联选项)
10
+ 4. [新增编辑查看与双通道插槽](#4-新增编辑查看与双通道插槽)
11
+ 5. [Schema Slot 自定义字段](#5-schema-slot-自定义字段)
12
+ 6. [分步表单路由](#6-分步表单路由)
13
+ 7. [动态 Schema 与动态插槽](#7-动态-schema-与动态插槽)
14
+ 8. [Orval 提交与错误处理](#8-orval-提交与错误处理)
15
+
16
+ ## 1. 基础表单与提交
17
+
18
+ `Submit` 必须通过表达式拿到 `onSubmit`。业务列表查询区不使用 schema 内按钮组,查询/重置按钮应放到外部操作区。
19
+
20
+ ```vue
21
+ <script setup lang="ts">
22
+ import { YFormily, type ISchema } from '@yss-ui/components';
23
+
24
+ /** 表单提交事件。 */
25
+ const emit = defineEmits<{ submit: [values: Record<string, any>] }>();
26
+
27
+ /** 校验通过后向上层提交。 */
28
+ const onSubmit = (values: Record<string, any>) => {
29
+ emit('submit', values);
30
+ };
31
+
32
+ /** 纯 Formily 表单 Schema。 */
33
+ const schema: ISchema = {
34
+ type: 'object',
35
+ properties: {
36
+ layout: {
37
+ type: 'void',
38
+ 'x-component': 'FormLayout',
39
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
40
+ properties: {
41
+ grid: {
42
+ type: 'void',
43
+ 'x-component': 'FormGrid',
44
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
45
+ properties: {
46
+ name: {
47
+ type: 'string',
48
+ title: '姓名',
49
+ required: true,
50
+ 'x-decorator': 'FormItem',
51
+ 'x-component': 'Input',
52
+ 'x-component-props': { placeholder: '请输入姓名', allowClear: true },
53
+ 'x-validator': [
54
+ { required: true, whitespace: true, message: '请输入姓名' },
55
+ {
56
+ validator: (value: string) => {
57
+ const str = (value || '').trim();
58
+ if (!str) return true;
59
+ if (str.length < 2 || str.length > 50) return '姓名长度需在2到50之间';
60
+ return true;
61
+ },
62
+ },
63
+ ],
64
+ },
65
+ gender: {
66
+ type: 'string',
67
+ title: '性别',
68
+ enum: [
69
+ { label: '男', value: 'male' },
70
+ { label: '女', value: 'female' },
71
+ ],
72
+ 'x-decorator': 'FormItem',
73
+ 'x-component': 'Select',
74
+ },
75
+ actions: {
76
+ type: 'void',
77
+ 'x-decorator': 'FormItem',
78
+ 'x-decorator-props': { gridSpan: 2, colon: false },
79
+ 'x-component': 'AutoButtonGroup',
80
+ properties: {
81
+ reset: { type: 'void', 'x-component': 'Reset', 'x-content': '重置' },
82
+ submit: {
83
+ type: 'void',
84
+ 'x-component': 'Submit',
85
+ 'x-content': '提交',
86
+ 'x-component-props': { onSubmit: '{{ onSubmit }}' },
87
+ },
88
+ },
89
+ },
90
+ },
91
+ },
92
+ },
93
+ },
94
+ },
95
+ };
96
+ </script>
97
+
98
+ <template>
99
+ <YFormily :schema="schema" :scope="{ onSubmit }" :initial-values="{ gender: 'male' }" />
100
+ </template>
101
+ ```
102
+
103
+ ## 2. 表达式显隐与禁用
104
+
105
+ 只依赖 `$values` 的显隐和禁用直接写表达式,初始化和后续变更都会生效,不要为此创建 `effects`。
106
+
107
+ ```vue
108
+ <script setup lang="ts">
109
+ import { YFormily, type ISchema } from '@yss-ui/components';
110
+
111
+ /** 简单表达式联动 Schema。 */
112
+ const schema: ISchema = {
113
+ type: 'object',
114
+ properties: {
115
+ layout: {
116
+ type: 'void',
117
+ 'x-component': 'FormLayout',
118
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
119
+ properties: {
120
+ grid: {
121
+ type: 'void',
122
+ 'x-component': 'FormGrid',
123
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
124
+ properties: {
125
+ needCompany: {
126
+ type: 'boolean',
127
+ title: '是否任职',
128
+ 'x-decorator': 'FormItem',
129
+ 'x-component': 'Switch',
130
+ },
131
+ companyName: {
132
+ type: 'string',
133
+ title: '公司名称',
134
+ required: true,
135
+ 'x-decorator': 'FormItem',
136
+ 'x-component': 'Input',
137
+ 'x-visible': '{{ $values.needCompany === true }}',
138
+ },
139
+ systemCode: {
140
+ type: 'string',
141
+ title: '系统编码',
142
+ 'x-decorator': 'FormItem',
143
+ 'x-component': 'Input',
144
+ 'x-disabled': '{{ $values.needCompany === false }}',
145
+ },
146
+ },
147
+ },
148
+ },
149
+ },
150
+ },
151
+ };
152
+ </script>
153
+
154
+ <template>
155
+ <YFormily :schema="schema" :initial-values="{ needCompany: false }" />
156
+ </template>
157
+ ```
158
+
159
+ ## 3. x-reactions 级联选项
160
+
161
+ 级联项更新时,仅当旧值不在新选项中才清空。无条件 `field.value = undefined` 会破坏合法回填值。
162
+
163
+ ```vue
164
+ <script setup lang="ts">
165
+ import { YFormily, type Field, type ISchema } from '@yss-ui/components';
166
+
167
+ /** 城市选项。 */
168
+ interface CityOption {
169
+ label: string;
170
+ value: string;
171
+ }
172
+
173
+ /** 省份到城市的静态映射。 */
174
+ const cityMap: Record<string, CityOption[]> = {
175
+ zhejiang: [{ label: '杭州', value: 'hangzhou' }],
176
+ jiangsu: [{ label: '南京', value: 'nanjing' }],
177
+ };
178
+
179
+ /** 基于省份同步当前城市字段。 */
180
+ const syncCityReaction = (field: Field) => {
181
+ const province = field.query('province').get('value') as string | undefined;
182
+ const options = province ? cityMap[province] ?? [] : [];
183
+ field.dataSource = options;
184
+ if (!options.some(item => item.value === field.value)) field.value = undefined;
185
+ };
186
+
187
+ /** 级联选择 Schema。 */
188
+ const schema: ISchema = {
189
+ type: 'object',
190
+ properties: {
191
+ layout: {
192
+ type: 'void',
193
+ 'x-component': 'FormLayout',
194
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
195
+ properties: {
196
+ grid: {
197
+ type: 'void',
198
+ 'x-component': 'FormGrid',
199
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
200
+ properties: {
201
+ province: {
202
+ type: 'string',
203
+ title: '省份',
204
+ enum: [
205
+ { label: '浙江', value: 'zhejiang' },
206
+ { label: '江苏', value: 'jiangsu' },
207
+ ],
208
+ 'x-decorator': 'FormItem',
209
+ 'x-component': 'Select',
210
+ },
211
+ city: {
212
+ type: 'string',
213
+ title: '城市',
214
+ 'x-decorator': 'FormItem',
215
+ 'x-component': 'Select',
216
+ 'x-reactions': syncCityReaction,
217
+ },
218
+ },
219
+ },
220
+ },
221
+ },
222
+ },
223
+ };
224
+ </script>
225
+
226
+ <template>
227
+ <YFormily :schema="schema" :initial-values="{ province: 'zhejiang', city: 'hangzhou' }" />
228
+ </template>
229
+ ```
230
+
231
+ 需要首屏与变更都执行的表单级副作用时,读取 `../../formily-linkage-effects/SKILL.md`,成对使用 `onFieldInit` 与 `onFieldValueChange`。
232
+
233
+ ## 4. 新增编辑查看与双通道插槽
234
+
235
+ `mode=2` 直接进入 Descriptions;不存在 `detail-as` 开关。默认响应式详情用 `maxColumns/minColumns/minWidth`,`columns` 只在 `responsive: false` 时生效。
236
+
237
+ ```vue
238
+ <script setup lang="ts">
239
+ import { YMonaco, YFormily, type ISchema } from '@yss-ui/components';
240
+ import { ref } from 'vue';
241
+
242
+ /** 表单模式。 */
243
+ type FormMode = 0 | 1 | 2;
244
+
245
+ /** 当前模式。 */
246
+ const mode = ref<FormMode>(1);
247
+ /** 编辑与查看回填值。 */
248
+ const initialValues = { user: { email: 'user@example.com' }, sql: 'select 1' };
249
+ /** 三态共用 Schema。 */
250
+ const schema: ISchema = {
251
+ type: 'object',
252
+ properties: {
253
+ layout: {
254
+ type: 'void',
255
+ 'x-component': 'FormLayout',
256
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
257
+ properties: {
258
+ grid: {
259
+ type: 'void',
260
+ 'x-component': 'FormGrid',
261
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
262
+ properties: {
263
+ user: {
264
+ type: 'object',
265
+ properties: {
266
+ email: {
267
+ type: 'string',
268
+ title: '邮箱',
269
+ 'x-decorator': 'FormItem',
270
+ 'x-component': 'Input',
271
+ },
272
+ },
273
+ },
274
+ sql: {
275
+ type: 'string',
276
+ title: 'SQL',
277
+ 'x-decorator': 'FormItem',
278
+ 'x-decorator-props': { gridSpan: 2 },
279
+ 'x-component': 'Slot',
280
+ 'x-component-props': { name: 'sql' },
281
+ },
282
+ },
283
+ },
284
+ },
285
+ },
286
+ },
287
+ };
288
+ </script>
289
+
290
+ <template>
291
+ <YFormily
292
+ :key="mode"
293
+ :schema="schema"
294
+ :initial-values="initialValues"
295
+ :mode="mode"
296
+ :detail-options="{ bordered: true, maxColumns: 2, minColumns: 1, minWidth: 320 }"
297
+ >
298
+ <template #sql="{ value, onChange }">
299
+ <YMonaco :model-value="value" language="sql" @change="onChange" />
300
+ </template>
301
+ <template #detail-user-email="{ value }">
302
+ <a :href="`mailto:${value}`">{{ value }}</a>
303
+ </template>
304
+ <template #detail-sql="{ value }">
305
+ <YMonaco :model-value="value" language="sql" readonly />
306
+ </template>
307
+ </YFormily>
308
+ </template>
309
+ ```
310
+
311
+ ## 5. Schema Slot 自定义字段
312
+
313
+ `value/onChange` 默认注入;只有确实需要 `field` 或全表值时才配置 `params: ['field', '$values']`。
314
+
315
+ ```vue
316
+ <script setup lang="ts">
317
+ import { YButton, YFormily, type ISchema } from '@yss-ui/components';
318
+ import { Input as AInput } from 'ant-design-vue';
319
+
320
+ /** 模拟选人并把主键写回字段。 */
321
+ const selectUser = (onChange: (value?: string) => void) => {
322
+ onChange('user-001');
323
+ };
324
+
325
+ /** 自定义选人字段 Schema。 */
326
+ const schema: ISchema = {
327
+ type: 'object',
328
+ properties: {
329
+ layout: {
330
+ type: 'void',
331
+ 'x-component': 'FormLayout',
332
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
333
+ properties: {
334
+ grid: {
335
+ type: 'void',
336
+ 'x-component': 'FormGrid',
337
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
338
+ properties: {
339
+ category: {
340
+ type: 'string',
341
+ title: '分类',
342
+ 'x-decorator': 'FormItem',
343
+ 'x-component': 'Input',
344
+ },
345
+ userId: {
346
+ type: 'string',
347
+ title: '关联用户',
348
+ 'x-decorator': 'FormItem',
349
+ 'x-component': 'Slot',
350
+ 'x-component-props': { name: 'userSelector', params: ['$values'] },
351
+ },
352
+ },
353
+ },
354
+ },
355
+ },
356
+ },
357
+ };
358
+ </script>
359
+
360
+ <template>
361
+ <YFormily :schema="schema">
362
+ <template #userSelector="{ value, onChange, values }">
363
+ <AInput :value="value" readonly />
364
+ <YButton @click="selectUser(onChange)">选择用户</YButton>
365
+ <YButton v-if="value" @click="onChange(undefined)">清除</YButton>
366
+ <span>当前分类:{{ values.category ?? '无' }}</span>
367
+ </template>
368
+ </YFormily>
369
+ </template>
370
+ ```
371
+
372
+ ## 6. 分步表单路由
373
+
374
+ 完整实现读取 `../../formily-step-flow/SKILL.md`,必须遵循以下边界:
375
+
376
+ - 从 `ant-design-vue` 导入 `Steps as ASteps`;组件库没有 `YSteps`。
377
+ - 每步使用独立 YFormily ref 与 `v-model`,统一收敛到一个 `reactive` 数据源。
378
+ - `await formRef.submit()` 成功后前进,校验失败会 reject;不要写 `ok !== false`。
379
+ - 确认步骤读取前序数据的 `computed` 聚合,不要绑定空的 `step3`。
380
+ - 最终提交只聚合真实业务步骤;API 错误交给 `mutator.ts` 提示。
381
+
382
+ ## 7. 动态 Schema 与动态插槽
383
+
384
+ 动态 schema 优先由 `computed` 派生,避免在 `onMounted` 中清空后原地修改深层 `properties`。
385
+
386
+ ```vue
387
+ <script setup lang="ts">
388
+ import { YMonaco, YFormily, type ISchema } from '@yss-ui/components';
389
+ import { computed, ref } from 'vue';
390
+
391
+ /** 后端动态字段描述。 */
392
+ interface PluginParam {
393
+ field: string;
394
+ name: string;
395
+ type: 'string' | 'boolean' | 'input-code';
396
+ required?: boolean;
397
+ }
398
+
399
+ /** 动态字段配置。 */
400
+ const pluginParams = ref<PluginParam[]>([
401
+ { field: 'tableName', name: '表名', type: 'string', required: true },
402
+ { field: 'enabled', name: '是否启用', type: 'boolean' },
403
+ { field: 'customSql', name: '自定义 SQL', type: 'input-code', required: true },
404
+ ]);
405
+ /** 动态表单值。 */
406
+ const formValues = ref<Record<string, any>>({});
407
+
408
+ /** 将动态字段描述转换为 Formily 字段节点。 */
409
+ const createFieldSchema = (param: PluginParam): ISchema => ({
410
+ type: param.type === 'boolean' ? 'boolean' : 'string',
411
+ title: param.name,
412
+ required: param.required ?? false,
413
+ 'x-decorator': 'FormItem',
414
+ 'x-component': param.type === 'boolean' ? 'Switch' : param.type === 'input-code' ? 'Slot' : 'Input',
415
+ 'x-component-props': param.type === 'input-code' ? { name: `${param.field}Slot` } : { placeholder: `请输入${param.name}` },
416
+ });
417
+
418
+ /** 动态字段名到 Schema 的映射。 */
419
+ const dynamicProperties = computed<Record<string, ISchema>>(() =>
420
+ Object.fromEntries(pluginParams.value.map(param => [param.field, createFieldSchema(param)]))
421
+ );
422
+ /** 完整动态表单 Schema。 */
423
+ const schema = computed<ISchema>(() => ({
424
+ type: 'object',
425
+ properties: {
426
+ layout: {
427
+ type: 'void',
428
+ 'x-component': 'FormLayout',
429
+ 'x-component-props': { layout: 'vertical' },
430
+ properties: {
431
+ grid: {
432
+ type: 'void',
433
+ 'x-component': 'FormGrid',
434
+ 'x-component-props': { maxColumns: 1, minColumns: 1, minWidth: 260 },
435
+ properties: dynamicProperties.value,
436
+ },
437
+ },
438
+ },
439
+ },
440
+ }));
441
+ /** 需要代码编辑器插槽的字段名。 */
442
+ const codeEditorFields = computed(() =>
443
+ pluginParams.value.filter(param => param.type === 'input-code').map(param => param.field)
444
+ );
445
+ </script>
446
+
447
+ <template>
448
+ <YFormily v-model="formValues" :schema="schema">
449
+ <template v-for="fieldKey in codeEditorFields" :key="fieldKey" #[`${fieldKey}Slot`]="{ value, onChange }">
450
+ <YMonaco :model-value="value" language="sql" :height="160" @change="onChange" />
451
+ </template>
452
+ </YFormily>
453
+ </template>
454
+ ```
455
+
456
+ ## 8. Orval 提交与错误处理
457
+
458
+ 底层 `mutator.ts` 已对网络错误和 `success === false` 统一执行 `message.error` 并 reject。业务提交只处理成功动作与 loading,不写重复失败提示。若需要统一提示 Formily 客户端校验失败,使用 `onFormSubmitValidateFailed`;不要在会同时接收 API reject 的 `onFormSubmitFailed` 或 `Submit.onSubmitFailed` 中调用 `message.error`。
459
+
460
+ ```typescript
461
+ import { message } from 'ant-design-vue';
462
+ import { ref } from 'vue';
463
+
464
+ /** 保存状态。 */
465
+ const saving = ref(false);
466
+
467
+ /** 提交表单;saveRecord 代表项目中实际生成的 Orval 方法。 */
468
+ const handleSubmit = async (values: Record<string, any>) => {
469
+ saving.value = true;
470
+ try {
471
+ await saveRecord(values);
472
+ message.success('保存成功');
473
+ emit('success');
474
+ } finally {
475
+ saving.value = false;
476
+ }
477
+ };
478
+ ```
479
+
480
+ 禁止以下模式:
481
+
482
+ - `if (res.success) { ... } else { message.error(...) }`
483
+ - `catch (error) { message.error(...) }`
484
+ - API reject 后仍继续关闭弹窗、切换步骤或刷新成功态
485
+
486
+ 如果必须做回滚,可以在 `catch` 中回滚后继续 `throw error`,但仍不重复提示。
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: formily-linkage-effects
3
+ description: 指导 YFormily 字段联动与表单级副作用;当实现动态显隐、禁用、级联选项、scope 事件、x-reactions、effects、异步联动或客户端校验失败兜底时使用。
4
+ ---
5
+
6
+ # Formily Linkage Effects Skill
7
+
8
+ ## 触发条件
9
+
10
+ - 需要字段联动(A 影响 B)、动态显隐/禁用、级联下拉。
11
+ - 需要 `scope`、`x-reactions` 或 `createForm + effects`。
12
+ - 需要处理异步选项竞态、旧值清理或 Formily 校验失败反馈。
13
+
14
+ ## 不适用场景
15
+
16
+ - 纯基础字段与提交:使用 `../formily-foundation/SKILL.md`。
17
+ - 详情态渲染和 mode 切换:使用 `../formily-mode-slot-detail/SKILL.md`。
18
+ - 分步流程:使用 `../formily-step-flow/SKILL.md`。
19
+
20
+ ## 文档检索
21
+
22
+ 1. 当前会话可用 yss-ui MCP 时,先用 `get_component_docs` 查询 `YFormily` 的 `scope`/Schema/表单实例边界;实现字段联动、多字段反应或 effects 时,再用 `get_demo` 获取 `formily/linkage`、`formily/linkage-multi`、`formily/effects` 等官方 Demo。
23
+ 2. MCP 查询未命中时先用 `search_docs/list_components` 校正名称;MCP 不可用、调用失败或校正后仍无结果时,才读取最新 `llms-full.txt`。若文档与当前项目依赖版本不一致,用当前源码和导出核验。
24
+
25
+ ## 硬约束(禁止/必须)
26
+
27
+ - 按复杂度选择机制:表达式 < `x-reactions` < `scope` < `effects`,避免同一联动在多处重复实现。
28
+ - 仅显隐/禁用优先使用 `$values` 表达式;当前字段依赖其他字段时优先 `x-reactions`;跨字段事件用 `scope`;表单级监听才用 `effects`。
29
+ - `effects` 需要首屏即生效时,同时注册 `onFieldInit` 和 `onFieldValueChange`,禁止只监听变化导致初始状态错误。
30
+ - 修改其他字段状态时使用 `form.setFieldState`;级联选项变化后,只有旧值不在新选项中时才清空,避免初始化误删合法回填值。
31
+ - 异步联动必须处理空依赖、loading、请求竞态与卸载;旧请求不得覆盖新选择。
32
+ - 客户端校验提示使用 `onFormSubmitValidateFailed`。禁止在 `onFormSubmitFailed` 或 `Submit.onSubmitFailed` 中调用 `message.error`:Formily 会把 `onSubmit` 中的 API reject 也交给这些通用失败回调,导致与 `mutator.ts` 重复提示。
33
+ - Orval API 的网络/业务错误已由 `mutator.ts` 提示并 reject,业务 `else`/`catch` 禁止重复 `message.error`。
34
+ - 分步需求默认走 `formily-step-flow`,不在此 skill 中给 `FormStep` 默认方案。
35
+
36
+ ## 标准代码骨架
37
+
38
+ ```vue
39
+ <script setup lang="ts">
40
+ import type { DataField, Form, IFieldState } from '@formily/core';
41
+ import { createForm, onFieldInit, onFieldValueChange, onFormSubmitValidateFailed } from '@formily/core';
42
+ import { YFormily, type ISchema } from '@yss-ui/components';
43
+ import { message } from 'ant-design-vue';
44
+
45
+ /** 下拉选项。 */
46
+ interface OptionItem {
47
+ label: string;
48
+ value: string;
49
+ }
50
+
51
+ /** 根据省份返回城市选项。 */
52
+ const getCityOptions = (province?: string): OptionItem[] =>
53
+ province === 'zhejiang'
54
+ ? [{ label: '杭州', value: 'hangzhou' }]
55
+ : province === 'jiangsu'
56
+ ? [{ label: '南京', value: 'nanjing' }]
57
+ : [];
58
+
59
+ /** 同步城市选项并清理已经失效的旧值。 */
60
+ const syncCity = (field: DataField) => {
61
+ const options = getCityOptions(field.value as string | undefined);
62
+ field.form.setFieldState('city', (state: IFieldState) => {
63
+ state.dataSource = options;
64
+ if (!options.some(item => item.value === state.value)) state.value = undefined;
65
+ });
66
+ };
67
+
68
+ /** 外部 Form 实例,用于承载表单级 effects。 */
69
+ const form: Form = createForm({
70
+ values: { province: 'zhejiang', city: 'hangzhou' },
71
+ effects() {
72
+ onFieldInit('province', field => syncCity(field as DataField));
73
+ onFieldValueChange('province', field => syncCity(field as DataField));
74
+ onFormSubmitValidateFailed(() => {
75
+ const feedbacks = form.queryFeedbacks({ type: 'error' });
76
+ message.error(feedbacks[0]?.messages?.[0] ?? '请检查表单');
77
+ });
78
+ },
79
+ });
80
+
81
+ /** 表单保存回调 Props。 */
82
+ interface SaveFormProps {
83
+ onSave: (values: Record<string, any>) => Promise<void>;
84
+ }
85
+
86
+ /** 表单保存回调。 */
87
+ const props = defineProps<SaveFormProps>();
88
+
89
+ /** 校验通过后提交;API 错误由 mutator 统一提示。 */
90
+ const onSubmit = (values: Record<string, any>) => {
91
+ return props.onSave(values);
92
+ };
93
+
94
+ /** 级联表单 Schema。 */
95
+ const schema: ISchema = {
96
+ type: 'object',
97
+ properties: {
98
+ layout: {
99
+ type: 'void',
100
+ 'x-component': 'FormLayout',
101
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
102
+ properties: {
103
+ grid: {
104
+ type: 'void',
105
+ 'x-component': 'FormGrid',
106
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
107
+ properties: {
108
+ province: {
109
+ type: 'string',
110
+ title: '省份',
111
+ required: true,
112
+ enum: [
113
+ { label: '浙江', value: 'zhejiang' },
114
+ { label: '江苏', value: 'jiangsu' },
115
+ ],
116
+ 'x-decorator': 'FormItem',
117
+ 'x-component': 'Select',
118
+ },
119
+ city: {
120
+ type: 'string',
121
+ title: '城市',
122
+ required: true,
123
+ 'x-decorator': 'FormItem',
124
+ 'x-component': 'Select',
125
+ },
126
+ actions: {
127
+ type: 'void',
128
+ 'x-decorator': 'FormItem',
129
+ 'x-decorator-props': { gridSpan: 2, colon: false },
130
+ 'x-component': 'AutoButtonGroup',
131
+ properties: {
132
+ submit: {
133
+ type: 'void',
134
+ 'x-component': 'Submit',
135
+ 'x-content': '提交',
136
+ 'x-component-props': { onSubmit: '{{ onSubmit }}' },
137
+ },
138
+ },
139
+ },
140
+ },
141
+ },
142
+ },
143
+ },
144
+ },
145
+ };
146
+ </script>
147
+
148
+ <template>
149
+ <YFormily :schema="schema" :form="form" :scope="{ onSubmit }" />
150
+ </template>
151
+ ```
152
+
153
+ ## 交付检查清单
154
+
155
+ - [ ] 已说明为何选择表达式、`x-reactions`、`scope` 或 `effects`。
156
+ - [ ] 首屏需要联动时同时覆盖初始化与变更事件。
157
+ - [ ] 字段切换后旧值、选项和 loading 状态正确,异步请求有竞态保护。
158
+ - [ ] Formily 客户端校验提示集中在 `onFormSubmitValidateFailed`,未用通用 `onFormSubmitFailed`/`Submit.onSubmitFailed` 处理 API reject。
159
+ - [ ] API 错误只由 `mutator.ts` 提示,业务 `else`/`catch` 未重复 `message.error`。
160
+ - [ ] 无 DOM hack、无无意义 `setTimeout`,未把分步逻辑塞入本 skill。
161
+
162
+ ## 失败兜底策略
163
+
164
+ - `x-reactions` 失效时先校验字段路径和实际 schema 层级,再决定是否升级为 `setFieldState`。
165
+ - 首屏状态错误时检查是否遗漏 `onFieldInit`;回填值丢失时检查是否无条件清空了级联字段。
166
+ - 异步结果乱序时使用请求序号或 `AbortController`,只接受最后一次请求结果。
167
+ - API 调用 reject 时只恢复 loading 或回滚局部状态,不重复弹出错误提示。