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,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 或回滚局部状态,不重复弹出错误提示。
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: formily-mode-slot-detail
3
+ description: 指导 YFormily 新增、编辑、查看三态与插槽渲染;当配置 mode 0/1/2、查看态只读、详情页 Descriptions 展示、detail-options、Schema Slot 或详情字段插槽时使用。
4
+ ---
5
+
6
+ # Formily Mode Slot Detail Skill
7
+
8
+ ## 触发条件
9
+
10
+ - 需要 `mode: 0/1/2` 的新增、编辑、查看三态切换。
11
+ - 查看态需要 Descriptions 响应式渲染或 `detail-*` 字段插槽。
12
+ - 同一字段在编辑态使用 Schema Slot、查看态使用 detail slot。
13
+
14
+ ## 不适用场景
15
+
16
+ - 基础表单骨架:使用 `../formily-foundation/SKILL.md`。
17
+ - 复杂联动与副作用:使用 `../formily-linkage-effects/SKILL.md`。
18
+ - 分步流程:使用 `../formily-step-flow/SKILL.md`。
19
+
20
+ ## 文档检索
21
+
22
+ 1. 当前会话可用 yss-ui MCP 时,先用 `get_component_docs` 查询 `YFormily` 的 `mode`、`detail-options`、Slots 和 Methods;实现三态、详情插槽或 Schema Slot 时,再用 `get_demo` 获取 `formily/modes`、`formily/group`、`formily/slot` 等官方 Demo。
23
+ 2. MCP 查询未命中时先用 `search_docs/list_components` 校正名称;MCP 不可用、调用失败或校正后仍无结果时,才读取最新 `llms-full.txt`。若文档与当前项目依赖版本不一致,用当前源码和导出核验。
24
+
25
+ ## 硬约束(禁止/必须)
26
+
27
+ - mode 语义固定:`0=新增`、`1=编辑`、`2=查看`;默认值为 `0`。
28
+ - `mode=2` 直接进入 Descriptions 查看态并强制 readPretty;源码没有 `detail-as` 等额外详情开关,禁止生成旧式 prop。
29
+ - 描述列表配置使用 `:detail-options`。默认 `responsive=true`,此时 `columns` 被忽略;响应式列数使用 `maxColumns`、`minColumns`、`minWidth`,固定列数才组合 `responsive: false` 与 `columns`。
30
+ - 查看态插槽命名固定为 `#detail-<path>`,字段路径中的 `.` 替换为 `-`;作用域为 `{ value, item, values }`。
31
+ - 编辑态插槽使用 `x-component: 'Slot'` 与 `x-component-props.name`;`value/onChange` 默认提供,仅在需要 `field` 或整表数据时配置 `params`。
32
+ - 运行时切换 mode 时加 `:key="mode"`,确保当前实现重新创建 form/schema 上下文并避免状态残留。
33
+ - 查看态不会发送 `update:modelValue`;回填优先在渲染前准备好 `v-model`/`initial-values`,或通过已公开的 `setValues` 更新。
34
+ - 只使用公开实例方法:`getValues`、`setValues`、`submit`、`setFieldState`、`toggle/expand/collapse`;禁止编造 `validate/reset/clearValidate`。
35
+ - 加载详情的 Orval API 错误已由 `mutator.ts` 统一 `message.error` 并 reject,业务 `else`/`catch` 禁止重复提示。
36
+ - 分步需求默认走 `formily-step-flow`,不在本 skill 中给 `FormStep` 默认方案。
37
+
38
+ ## 标准代码骨架
39
+
40
+ ```vue
41
+ <script setup lang="ts">
42
+ import { YMonaco, YFormily, type ISchema } from '@yss-ui/components';
43
+ import { ref } from 'vue';
44
+
45
+ /** YFormily 业务模式。 */
46
+ type FormMode = 0 | 1 | 2;
47
+
48
+ /** 当前表单模式。 */
49
+ const mode = ref<FormMode>(0);
50
+
51
+ /** 编辑和查看回填值。 */
52
+ const initialValues = {
53
+ user: { email: 'user@example.com' },
54
+ sql: 'select * from users',
55
+ };
56
+
57
+ /** 编辑与详情共用的 Schema。 */
58
+ const schema: ISchema = {
59
+ type: 'object',
60
+ properties: {
61
+ layout: {
62
+ type: 'void',
63
+ 'x-component': 'FormLayout',
64
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
65
+ properties: {
66
+ grid: {
67
+ type: 'void',
68
+ 'x-component': 'FormGrid',
69
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
70
+ properties: {
71
+ user: {
72
+ type: 'object',
73
+ properties: {
74
+ email: {
75
+ type: 'string',
76
+ title: '邮箱',
77
+ 'x-decorator': 'FormItem',
78
+ 'x-component': 'Input',
79
+ },
80
+ },
81
+ },
82
+ sql: {
83
+ type: 'string',
84
+ title: 'SQL',
85
+ 'x-decorator': 'FormItem',
86
+ 'x-decorator-props': { gridSpan: 2 },
87
+ 'x-component': 'Slot',
88
+ 'x-component-props': { name: 'sql' },
89
+ },
90
+ },
91
+ },
92
+ },
93
+ },
94
+ },
95
+ };
96
+ </script>
97
+
98
+ <template>
99
+ <YFormily
100
+ :key="mode"
101
+ :schema="schema"
102
+ :initial-values="initialValues"
103
+ :mode="mode"
104
+ :detail-options="{ bordered: true, maxColumns: 3, minColumns: 1, minWidth: 260 }"
105
+ >
106
+ <template #sql="{ value, onChange }">
107
+ <YMonaco :model-value="value" language="sql" @change="onChange" />
108
+ </template>
109
+
110
+ <template #detail-user-email="{ value }">
111
+ <a :href="`mailto:${value}`">{{ value }}</a>
112
+ </template>
113
+
114
+ <template #detail-sql="{ value }">
115
+ <YMonaco :model-value="value" language="sql" readonly />
116
+ </template>
117
+ </YFormily>
118
+ </template>
119
+ ```
120
+
121
+ ## 交付检查清单
122
+
123
+ - [ ] mode 语义和默认值正确,运行时切换配置了 `:key="mode"`。
124
+ - [ ] 未生成 `detail-as`、旧式详情开关或虚构实例方法。
125
+ - [ ] `detail-options` 已区分响应式 `maxColumns` 与固定列 `columns`。
126
+ - [ ] 查看态插槽路径映射正确,作用域只使用 `{ value, item, values }`。
127
+ - [ ] 编辑 Slot 名称与模板插槽一致,只在需要时声明 `params`。
128
+ - [ ] 查看回填在进入 `mode=2` 前准备完毕,未依赖查看态 v-model 回写。
129
+ - [ ] API 失败只由 `mutator.ts` 统一提示,业务 `else`/`catch` 未重复 `message.error`。
130
+ - [ ] 无分步 `FormStep` 默认实现。
131
+
132
+ ## 失败兜底策略
133
+
134
+ - 查看态插槽不生效时,先按详情收集后的数据路径核对 `detail-<path>`,不要把 `FormLayout/FormGrid` 容器名拼入路径。
135
+ - 编辑态插槽不生效时,核对 `x-component-props.name` 与模板名;需要整表值时再加入 `params: ['$values']`。
136
+ - 模式切换错乱时先确认 `:key="mode"`,再检查回填数据是否在新实例挂载前准备好。
137
+ - API 调用 reject 时只恢复 loading 或保留原数据,不重复弹出错误提示。
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: formily-step-flow
3
+ description: 指导 YSS UI 分步表单与流程录入;当需要 Ant Design Vue Steps、多 YFormily 独立校验、跨步数据保留、确认预览或最终聚合提交时使用。
4
+ ---
5
+
6
+ # Formily Step Flow Skill
7
+
8
+ ## 触发条件
9
+
10
+ - 需求是分步表单(Step Form)或流程化录入。
11
+ - 每一步需要独立校验与前进/后退控制。
12
+ - 需要跨步数据聚合、确认预览和最终提交编排。
13
+
14
+ ## 不适用场景
15
+
16
+ - 普通单页表单:使用 `../formily-foundation/SKILL.md`。
17
+ - 仅字段联动:使用 `../formily-linkage-effects/SKILL.md`。
18
+ - 仅查看态插槽:使用 `../formily-mode-slot-detail/SKILL.md`。
19
+
20
+ ## 文档检索
21
+
22
+ 1. 当前会话可用 yss-ui MCP 时,先用 `get_component_docs` 查询 `YFormily` 的 `submit()`、`mode`、`v-model` 和回填边界,再用 `get_demo` 获取 `formily/steps` 官方 Demo;`Steps` 的属性以当前 `ant-design-vue` 依赖和类型为准。
23
+ 2. MCP 查询未命中时先用 `search_docs/list_components` 校正名称;MCP 不可用、调用失败或校正后仍无结果时,才读取最新 `llms-full.txt`。若文档与当前项目依赖版本不一致,用当前源码和导出核验。
24
+
25
+ ## 硬约束(禁止/必须)
26
+
27
+ - 默认方案使用 `ant-design-vue` 的 `Steps` + 多 schema / 多 `YFormily`;组件库没有 `YSteps`,禁止编造。
28
+ - 业务层禁止把 `@formily/antdv FormStep` 作为默认方案;只有维护旧代码或用户明确指定时才可使用。
29
+ - 每次前进前对当前 YFormily 实例执行 `submit()`;该方法校验成功后 resolve,失败时 reject,不返回布尔值,禁止写 `ok !== false`。
30
+ - 每步使用独立 `v-model` 数据,并以单一 `reactive` 对象聚合;`v-if` 卸载实例后仍由该数据源保留回填值。
31
+ - 确认步骤用前面步骤的聚合数据作为 `initial-values`/`v-model`,禁止绑定一个空的第三步对象导致详情无数据。
32
+ - 最终 API 提交只聚合业务步骤,禁止把纯确认步骤当作新数据源。
33
+ - Orval API 的网络错误及 `success === false` 业务错误已由 `mutator.ts` 统一 `message.error` 并 reject;最终提交的 `else`/`catch` 禁止重复提示,loading 放在 `finally` 恢复。
34
+
35
+ ## 标准代码骨架
36
+
37
+ ```vue
38
+ <script setup lang="ts">
39
+ import { YButton, YFormily, type ISchema } from '@yss-ui/components';
40
+ import { Steps as ASteps } from 'ant-design-vue';
41
+ import { computed, reactive, ref } from 'vue';
42
+
43
+ /** YFormily 对外提交能力。 */
44
+ interface YssFormilyExpose {
45
+ submit: () => Promise<Record<string, any>>;
46
+ }
47
+
48
+ /** 分步表单数据。 */
49
+ interface StepFormData {
50
+ step1: { name: string };
51
+ step2: { level: string };
52
+ }
53
+
54
+ /** 分步表单提交回调 Props。 */
55
+ interface StepFlowProps {
56
+ onSubmit: (values: StepFormData) => Promise<void>;
57
+ }
58
+
59
+ /** 分步表单提交回调。 */
60
+ const props = defineProps<StepFlowProps>();
61
+ /** 当前步骤,从 0 开始。 */
62
+ const currentStep = ref(0);
63
+ /** 最终提交状态。 */
64
+ const submitting = ref(false);
65
+ /** 第一步表单实例。 */
66
+ const step1Ref = ref<YssFormilyExpose>();
67
+ /** 第二步表单实例。 */
68
+ const step2Ref = ref<YssFormilyExpose>();
69
+ /** 步骤导航配置。 */
70
+ const stepItems = [{ title: '基础信息' }, { title: '策略配置' }, { title: '确认提交' }];
71
+ /** 跨步唯一数据源。 */
72
+ const formData = reactive<StepFormData>({
73
+ step1: { name: '' },
74
+ step2: { level: 'normal' },
75
+ });
76
+
77
+ /** 创建符合业务三层布局约定的步骤 Schema。 */
78
+ const createStepSchema = (properties: Record<string, ISchema>): ISchema => ({
79
+ type: 'object',
80
+ properties: {
81
+ layout: {
82
+ type: 'void',
83
+ 'x-component': 'FormLayout',
84
+ 'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
85
+ properties: {
86
+ grid: {
87
+ type: 'void',
88
+ 'x-component': 'FormGrid',
89
+ 'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 320 },
90
+ properties,
91
+ },
92
+ },
93
+ },
94
+ },
95
+ });
96
+
97
+ /** 第一步 Schema。 */
98
+ const step1Schema = createStepSchema({
99
+ name: {
100
+ type: 'string',
101
+ title: '任务名称',
102
+ required: true,
103
+ 'x-decorator': 'FormItem',
104
+ 'x-component': 'Input',
105
+ },
106
+ });
107
+ /** 第二步 Schema。 */
108
+ const step2Schema = createStepSchema({
109
+ level: {
110
+ type: 'string',
111
+ title: '策略等级',
112
+ required: true,
113
+ enum: [
114
+ { label: '普通', value: 'normal' },
115
+ { label: '严格', value: 'strict' },
116
+ ],
117
+ 'x-decorator': 'FormItem',
118
+ 'x-component': 'Select',
119
+ },
120
+ });
121
+ /** 确认步骤 Schema。 */
122
+ const confirmSchema = createStepSchema({
123
+ name: { type: 'string', title: '任务名称', 'x-decorator': 'FormItem', 'x-component': 'Input' },
124
+ level: { type: 'string', title: '策略等级', 'x-decorator': 'FormItem', 'x-component': 'Input' },
125
+ });
126
+ /** 确认步骤展示数据。 */
127
+ const confirmValues = computed(() => ({ name: formData.step1.name, level: formData.step2.level }));
128
+
129
+ /** 校验当前步骤,成功后前进。 */
130
+ const next = async () => {
131
+ const currentRef = currentStep.value === 0 ? step1Ref.value : step2Ref.value;
132
+ if (!currentRef) return;
133
+ try {
134
+ await currentRef.submit();
135
+ currentStep.value += 1;
136
+ } catch {
137
+ return;
138
+ }
139
+ };
140
+
141
+ /** 返回上一步。 */
142
+ const back = () => {
143
+ currentStep.value = Math.max(0, currentStep.value - 1);
144
+ };
145
+
146
+ /** 提交全部步骤数据。 */
147
+ const submitAll = async () => {
148
+ submitting.value = true;
149
+ try {
150
+ await props.onSubmit({ step1: { ...formData.step1 }, step2: { ...formData.step2 } });
151
+ } finally {
152
+ submitting.value = false;
153
+ }
154
+ };
155
+ </script>
156
+
157
+ <template>
158
+ <ASteps :current="currentStep" :items="stepItems" />
159
+
160
+ <YFormily v-if="currentStep === 0" ref="step1Ref" v-model="formData.step1" :schema="step1Schema" />
161
+ <YFormily v-else-if="currentStep === 1" ref="step2Ref" v-model="formData.step2" :schema="step2Schema" />
162
+ <YFormily
163
+ v-else
164
+ :schema="confirmSchema"
165
+ :initial-values="confirmValues"
166
+ :mode="2"
167
+ :detail-options="{ bordered: true, maxColumns: 2, minColumns: 1, minWidth: 320 }"
168
+ />
169
+
170
+ <YButton :disabled="currentStep === 0" @click="back">上一步</YButton>
171
+ <YButton v-if="currentStep < 2" type="primary" @click="next">下一步</YButton>
172
+ <YButton v-else type="primary" :loading="submitting" @click="submitAll">提交</YButton>
173
+ </template>
174
+ ```
175
+
176
+ 复杂页面把 schema、类型与步骤 hook 分别拆到 `constant.ts`、`hooks/useStepFlow.ts`,保持 `index.vue` 在 150 行以内。
177
+
178
+ ## 交付检查清单
179
+
180
+ - [ ] 使用 `ASteps + 多 YFormily`,组件来源明确且未编造 `YSteps`。
181
+ - [ ] 每步前进前 await 当前实例 `submit()`,校验 reject 时不会前进。
182
+ - [ ] 未使用 `ok !== false` 判断 `submit()` 结果。
183
+ - [ ] 步骤切换后数据可保留和回显,确认页直接读取前序聚合数据。
184
+ - [ ] 最终提交只聚合真实业务步骤,未把确认页空对象混入 payload。
185
+ - [ ] API 失败只由 `mutator.ts` 统一提示,业务 `else`/`catch` 未重复 `message.error`。
186
+ - [ ] 业务层未使用 `@formily/antdv FormStep` 作为默认实现。
187
+
188
+ ## 失败兜底策略
189
+
190
+ - 下一步无校验时确认 ref 指向当前已挂载实例,并直接观察 `submit()` 是否 reject。
191
+ - 状态串联错误时先收敛为单一 `reactive` 数据源,再检查每步 `v-model` 路径。
192
+ - 确认页为空时检查是否错误绑定了独立 `step3`,应改为前序数据的 `computed` 聚合。
193
+ - API 调用 reject 时只在 `finally` 恢复 loading,不重复弹出错误提示。
194
+ - 步骤过多或主组件超过 150 行时,按阶段拆子组件和 `useStepXxx` hook。
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: frontend-commit
3
+ description: 分析并提交 Vue、React、TypeScript、JavaScript、Vite、微前端和前端 monorepo 项目的 Git 改动;当用户要求生成 commit message、检查提交规范、拆分原子提交、暂存并执行 git commit,或修复 commitlint 与 commit-msg hook 拒绝时使用。读取仓库实际规则和 diff,选择业务 scope,生成英文 type/scope 与中文标题和正文,并安全验证提交。
4
+ ---
5
+
6
+ # 前端规范提交
7
+
8
+ ## 触发条件
9
+
10
+ - 用户要求为前端项目生成 commit message、检查提交规范或执行 `git commit`。
11
+ - 需要将混合改动拆分为原子提交,或评估当前暂存区是否可以安全提交。
12
+ - commitlint、`commit-msg` 或 `pre-commit` hook 拒绝提交,需要按规则修复。
13
+ - 适用于 Vue、React、TypeScript、JavaScript、Vite、微前端和前端 monorepo 仓库。
14
+
15
+ ## 不适用场景
16
+
17
+ - yss-ui 组件库仓库自身的提交与发版:使用 `../commit-linting/SKILL.md`。
18
+ - Java、Spring Boot、Maven、Gradle 后端仓库:使用 `../java-backend-commit/SKILL.md`。
19
+ - 仅请求代码实现,不涉及提交信息或 `git commit` 操作。
20
+ - 无代码改动,或改动内容与提交请求不匹配。
21
+ - 合并提交、发布提交和自动依赖机器人提交:遵循仓库专用流程,不套用本技能的常规消息模板。
22
+
23
+ ## 硬约束(禁止/必须)
24
+
25
+ - 必须把仓库规则视为最高优先级:依次遵循 `AGENTS.md`、`CONTRIBUTING.md`、Git hooks、解析后的 commitlint 配置、本地配置和近期历史;通用规则只作回退。
26
+ - 只在用户明确要求提交时执行暂存和 `git commit`;若仅要求提交信息或审查,只输出候选消息与依据。
27
+ - 必须保留用户和他人的既有改动。禁止默认使用 `git add -A`、`git add .`、`git commit -a`、`--no-verify`,也不要自动 amend、rebase、push 或改写已发布历史。
28
+ - 提交必须是单一逻辑变更。不要用提交信息掩盖混杂的功能、修复、格式化或临时文件。
29
+ - 遇到密钥、令牌、私钥、证书、`.env` 实值、账号数据或意外大文件时停止提交并报告具体路径,不要在输出中泄露内容。
30
+ - 已有暂存内容视为用户选择,除非用户授权,不要擅自取消暂存或混入其他文件。
31
+ - `fixup!` 只用于用户明确要求的评审或 autosquash 工作流,不能作为最终历史的默认提交。
32
+ - revert 优先使用 Git 生成的回滚信息并保留被回滚 SHA,再根据仓库规范校验;不要把普通反向修改伪装成 revert。
33
+
34
+ ## 工作流
35
+
36
+ ### 1. 建立仓库契约
37
+
38
+ 1. 确认仓库根目录、当前分支和工作树状态。
39
+ 2. 搜索并读取仓库级说明、贡献指南、提交模板、commitlint 配置和 `commit-msg`、`pre-commit` hooks。
40
+ 3. 检测 `package.json`、lockfile、workspace 配置和前端应用或包边界。
41
+ 4. 如果仓库使用 commitlint,优先使用本地依赖按包管理器读取解析后的配置,例如 `pnpm exec commitlint --print-config json`;不要为了校验联网安装依赖。
42
+ 5. 查看相关路径近期的非 merge 提交,了解仓库已经形成的 scope 和语言习惯,但不要复制历史中的明显错误。
43
+
44
+ ### 2. 审查真实改动
45
+
46
+ 至少检查:
47
+
48
+ ```bash
49
+ git status --short --branch
50
+ git diff --cached --name-status
51
+ git diff --cached
52
+ git diff --name-status
53
+ git diff
54
+ git ls-files --others --exclude-standard
55
+ ```
56
+
57
+ - 同时理解暂存区、未暂存区和未跟踪文件;不要只依据文件名生成消息。
58
+ - 将改动按用户可理解的行为和因果关系分组。功能实现、配套测试和为该功能必需的最小配置可以属于同一原子提交。
59
+ - lockfile 必须与对应 manifest 一起提交。只提交项目本来就跟踪且由本次意图产生的生成代码;排除构建产物、缓存和临时文件。
60
+ - 若无改动、改动与请求不符、多个逻辑变更无法安全拆分,先说明并停止。需要逐行拆分同一文件时,不要靠猜测改写暂存区。
61
+
62
+ ### 3. 选择 type、scope 与正文
63
+
64
+ 先读取 `./references/scope-and-examples.md`,再按「标准代码骨架」的格式生成。
65
+
66
+ - type 默认从 `feat/fix/docs/style/refactor/perf/test/chore/revert/build/ci` 中选择,但仓库枚举优先。
67
+ - scope 优先级为:仓库枚举 → monorepo 包或应用 → 业务模块 → 共享能力。使用小写 kebab-case;不要机械地以 `views`、`hooks` 或文件名作为 scope。
68
+ - 标题使用英文 type/scope、ASCII `:` 和中文摘要;描述行为或价值,不写“修改文件”“更新代码”或单个文件名。
69
+ - 默认将完整 header 控制在 72 个字符内;仓库存在更严格限制时服从仓库。标题末尾不加句号,不用 emoji 或全角冒号。
70
+ - 简单单文件变更可以没有 body;多文件、非显然修复、重要功能或行为变化使用 body 解释做了什么、为什么以及如何验证。
71
+ - 仅对真实不兼容变更使用 `!` 和 `BREAKING CHANGE:`;仅在已知编号或仓库要求时加入工单、DCO、`Signed-off-by` 等 footer,禁止编造。
72
+
73
+ ### 4. 验证并提交
74
+
75
+ 1. 根据变更范围运行仓库已有的最小充分检查,例如相关单元测试、类型检查、lint 和构建检查;优先使用仓库脚本与当前包管理器。
76
+ 2. 通过 stdin 校验完整候选消息,而不只校验 header。使用仓库本地 commitlint 命令;退出码为 0 才继续。
77
+ 3. 仅暂存属于当前原子提交的明确路径或安全 hunks,再重新检查 `git diff --cached --check`、`--name-status` 和完整 staged diff。
78
+ 4. 执行正常 `git commit`,允许 hooks 运行。
79
+ 5. hook 若格式化或修改文件,重新检查 staged 与 working tree,确认实际提交内容没有漂移。
80
+ 6. 提交成功后检查 `git show --stat --oneline --decorate HEAD` 和 `git status --short`,向用户报告 commit hash、消息、已运行检查以及剩余未提交改动。
81
+
82
+ ## 标准代码骨架
83
+
84
+ ```text
85
+ type(scope)!: 中文行为摘要
86
+
87
+ - 说明关键行为或原因
88
+ - 说明兼容性、测试或必要约束
89
+
90
+ BREAKING CHANGE: 说明不兼容影响和迁移方式
91
+ Refs: 已知工单号
92
+ ```
93
+
94
+ 示例:
95
+
96
+ ```text
97
+ feat(data-push): 优化推送任务数据源与调度规则展示
98
+
99
+ - 将英文星期转换为中文调度描述
100
+ - 按数据源目录映射业务名称并补充单元测试
101
+ ```
102
+
103
+ ## 交付检查清单
104
+
105
+ - [ ] type 与 scope 通过仓库 resolved commitlint 校验,完整消息经 stdin 校验退出码为 0。
106
+ - [ ] scope 来自仓库枚举、包名或业务模块,未使用 `views`、`hooks`、`utils` 或文件名兜底。
107
+ - [ ] 标题为英文 type/scope + ASCII 冒号 + 中文摘要,完整 header 不超过 72 字符。
108
+ - [ ] 暂存区只包含当前原子提交的文件;lockfile 与对应 manifest 同提交。
109
+ - [ ] 已运行与变更范围匹配的最小充分检查(相关测试、类型检查、lint)。
110
+ - [ ] 提交后已核对 `git show --stat` 与 `git status --short`,并向用户报告 hash 与剩余改动。
111
+
112
+ ## 失败兜底策略
113
+
114
+ - 无法区分 `feat`、`fix`、`refactor` 时继续检查需求和行为;仍有高影响歧义则询问用户,不自动降级为 `chore`。
115
+ - hook 拒绝时按输出中的规则修正并重新校验,绝不使用 `--no-verify`。
116
+ - 仓库 parser 或 hook 不支持标准破坏性标记时,不要绕过校验或静默删掉标记;报告规则冲突,并采用仓库明确批准的兼容方案。
117
+ - 多个逻辑变更无法安全拆分时,先给出拆分方案并停止,不强行生成“大杂烩”提交。
118
+ - 发现密钥或意外大文件时停止提交,报告具体路径并等待用户处理。
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "前端规范提交"
3
+ short_description: "分析真实改动并生成、校验前端项目的规范化 Git 提交"
4
+ default_prompt: "使用 $frontend-commit 检查当前前端改动并创建一条规范、原子的 Git 提交。"
5
+
6
+ policy:
7
+ allow_implicit_invocation: true