@bovinphang/frontend-craft 2.7.0 → 2.8.0

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 (380) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +34 -0
  4. package/CHANGELOG.zh-CN.md +34 -0
  5. package/README.md +1 -1
  6. package/README.openclaw.md +99 -43
  7. package/README.openclaw.zh-CN.md +99 -43
  8. package/README.zh-CN.md +1 -1
  9. package/agents/fec-architect.md +70 -70
  10. package/agents/fec-code-reviewer.md +82 -82
  11. package/agents/fec-debugger.md +20 -20
  12. package/agents/fec-design-token-mapper.md +36 -36
  13. package/agents/fec-doc-updater.md +13 -13
  14. package/agents/fec-e2e-runner.md +45 -45
  15. package/agents/fec-figma-implementer.md +59 -59
  16. package/agents/fec-performance-optimizer.md +128 -128
  17. package/agents/fec-refactor-cleaner.md +14 -14
  18. package/agents/fec-security-reviewer.md +66 -67
  19. package/agents/fec-test-planner.md +27 -27
  20. package/agents/fec-typescript-reviewer.md +87 -87
  21. package/agents/fec-ui-checker.md +74 -74
  22. package/commands/fec-debug.md +19 -19
  23. package/commands/fec-doc-sync.md +11 -11
  24. package/commands/fec-init.md +37 -38
  25. package/commands/fec-plan.md +58 -58
  26. package/commands/fec-refactor-clean.md +11 -11
  27. package/commands/fec-review.md +41 -41
  28. package/commands/fec-scaffold.md +41 -41
  29. package/commands/fec-tdd.md +13 -13
  30. package/dist/bin/frontend-craft.js +29 -27
  31. package/docs/example-prompts.md +3 -0
  32. package/docs/ja-JP/README.md +1 -1
  33. package/docs/ko-KR/README.md +1 -1
  34. package/docs/project-structure.md +13 -5
  35. package/docs/zh-CN/example-prompts.md +3 -0
  36. package/docs/zh-CN/project-structure.md +6 -1
  37. package/docs/zh-TW/README.md +1 -1
  38. package/localized/zh-CN/agents/fec-architect.md +125 -0
  39. package/localized/zh-CN/agents/fec-code-reviewer.md +152 -0
  40. package/localized/zh-CN/agents/fec-debugger.md +44 -0
  41. package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
  42. package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
  43. package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
  44. package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
  45. package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
  46. package/localized/zh-CN/agents/fec-refactor-cleaner.md +32 -0
  47. package/localized/zh-CN/agents/fec-security-reviewer.md +116 -0
  48. package/localized/zh-CN/agents/fec-test-planner.md +50 -0
  49. package/localized/zh-CN/agents/fec-typescript-reviewer.md +142 -0
  50. package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
  51. package/localized/zh-CN/commands/fec-debug.md +30 -0
  52. package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
  53. package/localized/zh-CN/commands/fec-init.md +70 -0
  54. package/localized/zh-CN/commands/fec-plan.md +94 -0
  55. package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
  56. package/localized/zh-CN/commands/fec-review.md +66 -0
  57. package/localized/zh-CN/commands/fec-scaffold.md +205 -0
  58. package/localized/zh-CN/commands/fec-tdd.md +21 -0
  59. package/localized/zh-CN/skills/TEMPLATE.md +155 -0
  60. package/localized/zh-CN/skills/eval_queries.json +1013 -0
  61. package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
  62. package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
  63. package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  64. package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
  65. package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
  66. package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
  67. package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
  68. package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
  69. package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
  70. package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
  71. package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
  72. package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  73. package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
  74. package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  75. package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
  76. package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  77. package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  78. package/localized/zh-CN/skills/fec-code-review/SKILL.md +143 -0
  79. package/localized/zh-CN/skills/fec-code-review/references/report-template.md +29 -0
  80. package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
  81. package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
  82. package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
  83. package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
  84. package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
  85. package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
  86. package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  87. package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
  88. package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
  89. package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  90. package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  91. package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  92. package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
  93. package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
  94. package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  95. package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
  96. package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  97. package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
  98. package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  99. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
  100. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  101. package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  102. package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  103. package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  104. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  105. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  106. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  107. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  108. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  109. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  110. package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
  111. package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  112. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  113. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  114. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  115. package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
  116. package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
  117. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  118. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  119. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  120. package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  121. package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
  122. package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
  123. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +80 -0
  124. package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  125. package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
  126. package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +74 -0
  127. package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  128. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
  129. package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  130. package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  131. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
  132. package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  133. package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
  134. package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  135. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
  136. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  137. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  138. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  139. package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
  140. package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  141. package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
  142. package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
  143. package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  144. package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
  145. package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  146. package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
  147. package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  148. package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
  149. package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  150. package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
  151. package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
  152. package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  153. package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  154. package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
  155. package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  156. package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  157. package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  158. package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  159. package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +51 -0
  160. package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
  161. package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
  162. package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
  163. package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
  164. package/localized/zh-CN/skills/fec-security-review/SKILL.md +38 -0
  165. package/localized/zh-CN/skills/fec-security-review/references/report-template.md +27 -0
  166. package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
  167. package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
  168. package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
  169. package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
  170. package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
  171. package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  172. package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
  173. package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
  174. package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
  175. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +52 -0
  176. package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
  177. package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
  178. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
  179. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
  180. package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
  181. package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
  182. package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
  183. package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
  184. package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
  185. package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
  186. package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  187. package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
  188. package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
  189. package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
  190. package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
  191. package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
  192. package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
  193. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
  194. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  195. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
  196. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  197. package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
  198. package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  199. package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  200. package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  201. package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  202. package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  203. package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  204. package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
  205. package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
  206. package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
  207. package/localized/zh-CN/skills/metadata.json +1646 -0
  208. package/localized/zh-CN/skills/relations.json +755 -0
  209. package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
  210. package/localized/zh-CN/templates/claude/settings.json +62 -0
  211. package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
  212. package/localized/zh-CN/templates/codex/config.toml +32 -0
  213. package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
  214. package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  215. package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +54 -0
  216. package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
  217. package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
  218. package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
  219. package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
  220. package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
  221. package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
  222. package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
  223. package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
  224. package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
  225. package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
  226. package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
  227. package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
  228. package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
  229. package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
  230. package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
  231. package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
  232. package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
  233. package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
  234. package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
  235. package/openclaw.plugin.json +1 -1
  236. package/package.json +3 -2
  237. package/skills/TEMPLATE.md +74 -74
  238. package/skills/eval_queries.json +678 -678
  239. package/skills/fec-accessibility-check/SKILL.md +21 -21
  240. package/skills/fec-accessibility-check/references/report-template.md +12 -12
  241. package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
  242. package/skills/fec-alchemy/SKILL.md +50 -50
  243. package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
  244. package/skills/fec-alchemy/assets/intake-template.md +55 -55
  245. package/skills/fec-alchemy/assets/review-checklist.md +23 -23
  246. package/skills/fec-alchemy/references/methodology.md +66 -66
  247. package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
  248. package/skills/fec-api-integration/SKILL.md +61 -61
  249. package/skills/fec-api-integration/references/integration-patterns.md +30 -30
  250. package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
  251. package/skills/fec-browser-storage/SKILL.md +16 -16
  252. package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
  253. package/skills/fec-canvas-threejs/SKILL.md +21 -21
  254. package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
  255. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
  256. package/skills/fec-code-review/SKILL.md +94 -94
  257. package/skills/fec-code-review/references/report-template.md +13 -13
  258. package/skills/fec-component-testing/SKILL.md +39 -39
  259. package/skills/fec-data-fetching/SKILL.md +16 -16
  260. package/skills/fec-data-fetching/references/query-patterns.md +27 -27
  261. package/skills/fec-debug-framework/SKILL.md +95 -95
  262. package/skills/fec-debug-framework/references/report-template.md +34 -34
  263. package/skills/fec-dependency-upgrade/SKILL.md +17 -17
  264. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
  265. package/skills/fec-doc-sync/SKILL.md +23 -23
  266. package/skills/fec-drawio-studio/SKILL.md +42 -38
  267. package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
  268. package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  269. package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
  270. package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  271. package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
  272. package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
  273. package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
  274. package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  275. package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
  276. package/skills/fec-e2e-testing/SKILL.md +24 -24
  277. package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
  278. package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
  279. package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
  280. package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
  281. package/skills/fec-form-handling/SKILL.md +21 -21
  282. package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
  283. package/skills/fec-image-generation/SKILL.md +54 -29
  284. package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  285. package/skills/fec-image-generation/references/diagram-workflows.md +33 -2
  286. package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  287. package/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  288. package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  289. package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  290. package/skills/fec-implement-from-design/SKILL.md +81 -81
  291. package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
  292. package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
  293. package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
  294. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
  295. package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
  296. package/skills/fec-legacy-web-standard/SKILL.md +17 -17
  297. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
  298. package/skills/fec-list-virtualization/SKILL.md +16 -16
  299. package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
  300. package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
  301. package/skills/fec-motion-interaction/SKILL.md +51 -51
  302. package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
  303. package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
  304. package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
  305. package/skills/fec-performance-optimization/SKILL.md +54 -54
  306. package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
  307. package/skills/fec-performance-optimization/references/report-template.md +31 -31
  308. package/skills/fec-pwa-implementation/SKILL.md +17 -17
  309. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
  310. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
  311. package/skills/fec-react-project-standard/SKILL.md +72 -72
  312. package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
  313. package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
  314. package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
  315. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
  316. package/skills/fec-refactor-clean/SKILL.md +30 -30
  317. package/skills/fec-refactor-clean/references/report-template.md +23 -23
  318. package/skills/fec-responsive-layout/SKILL.md +17 -17
  319. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
  320. package/skills/fec-route-protection/SKILL.md +26 -26
  321. package/skills/fec-security-review/SKILL.md +20 -20
  322. package/skills/fec-security-review/references/report-template.md +12 -12
  323. package/skills/fec-security-review/references/security-checklist.md +27 -27
  324. package/skills/fec-source-driven-development/SKILL.md +59 -59
  325. package/skills/fec-state-management/SKILL.md +34 -34
  326. package/skills/fec-state-management/references/state-patterns.md +19 -19
  327. package/skills/fec-storybook-component-doc/SKILL.md +19 -19
  328. package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
  329. package/skills/fec-svg-animation/SKILL.md +32 -32
  330. package/skills/fec-tailwind-design-system/SKILL.md +17 -17
  331. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
  332. package/skills/fec-tdd-workflow/SKILL.md +28 -28
  333. package/skills/fec-testing-strategy/SKILL.md +29 -29
  334. package/skills/fec-typescript-project-standard/SKILL.md +38 -38
  335. package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
  336. package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
  337. package/skills/fec-ui-design/SKILL.md +90 -90
  338. package/skills/fec-ui-design/references/design-intelligence.md +61 -61
  339. package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
  340. package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
  341. package/skills/fec-validation-fix/SKILL.md +26 -26
  342. package/skills/fec-validation-fix/references/report-template.md +25 -25
  343. package/skills/fec-vite-project-standard/SKILL.md +39 -39
  344. package/skills/fec-vue3-project-standard/SKILL.md +38 -38
  345. package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
  346. package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
  347. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
  348. package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
  349. package/skills/fec-web-video-presentation/SKILL.md +33 -33
  350. package/skills/fec-web-workers/SKILL.md +16 -16
  351. package/skills/fec-web-workers/references/advanced-workers.md +13 -13
  352. package/skills/fec-web-workers/references/basic-worker.md +8 -8
  353. package/skills/metadata.json +121 -115
  354. package/skills/relations.json +4 -0
  355. package/templates/claude/CLAUDE.md +60 -60
  356. package/templates/codex/AGENTS.md +76 -76
  357. package/templates/codex/config.toml +4 -4
  358. package/templates/openclaw/AGENTS.md +68 -68
  359. package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
  360. package/templates/shared/rules/fec-agent-workflow.md +40 -40
  361. package/templates/shared/rules/fec-api-layer.md +52 -52
  362. package/templates/shared/rules/fec-ci-cd.md +29 -29
  363. package/templates/shared/rules/fec-code-comments.md +22 -22
  364. package/templates/shared/rules/fec-design-system.md +53 -53
  365. package/templates/shared/rules/fec-error-handling.md +40 -40
  366. package/templates/shared/rules/fec-git-conventions.md +42 -42
  367. package/templates/shared/rules/fec-i18n.md +48 -48
  368. package/templates/shared/rules/fec-naming-conventions.md +91 -91
  369. package/templates/shared/rules/fec-performance.md +78 -78
  370. package/templates/shared/rules/fec-react.md +58 -58
  371. package/templates/shared/rules/fec-refactoring.md +34 -34
  372. package/templates/shared/rules/fec-rendering-patterns.md +36 -36
  373. package/templates/shared/rules/fec-responsive-design.md +37 -37
  374. package/templates/shared/rules/fec-source-driven-development.md +22 -22
  375. package/templates/shared/rules/fec-state-management.md +56 -56
  376. package/templates/shared/rules/fec-testing.md +64 -64
  377. package/templates/shared/rules/fec-typescript.md +75 -75
  378. package/templates/shared/rules/fec-vue.md +42 -42
  379. package/templates/shared/rules/fec-working-modes.md +34 -34
  380. package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
@@ -1,43 +1,43 @@
1
- # 验证修复报告模板
1
+ # Verify repair report template
2
2
 
3
3
  ```markdown
4
- # 验证修复报告
4
+ # Verify repair report
5
5
 
6
- > 生成时间: YYYY-MM-DD HH:mm
7
- > 验证范围: lint / type-check / test / build / CI
6
+ > Generation time: YYYY-MM-DD HH:mm
7
+ > Verification scope: lint/type-check/test/build/CI
8
8
 
9
- ## 命令状态表
9
+ ## Command status table
10
10
 
11
- | 命令 | 初始状态 | 修复后状态 | 备注 |
11
+ | Command | Initial state | Repaired state | Remarks |
12
12
  | --- | --- | --- | --- |
13
- | `npm run type-check` | 失败 / 通过 / 未运行 | 失败 / 通过 / 未运行 | ... |
13
+ | `npm run type-check` | failed/passed/didn’t run | failed/passed/didn’t run | ... |
14
14
 
15
- ## 失败摘要
15
+ ## Failure summary
16
16
 
17
- - 最早出现且会级联的错误
18
- - 受影响文件、错误类型和关键日志
19
- - 是否属于 CI 专属、测试环境、依赖版本或 flaky 问题
17
+ - Errors that occur earliest and cascade
18
+ - Affected files, error types and critical logs
19
+ - Whether it is CI exclusive, test environment, dependent version or flaky issue
20
20
 
21
- ## 根因
21
+ ## Root cause
22
22
 
23
- - 确认的根本原因
24
- - 支持该结论的输出、日志或复现证据
23
+ - Confirmed root cause
24
+ - Output, logs, or reproduction evidence to support the conclusion
25
25
 
26
- ## 修复内容
26
+ ## Fix content
27
27
 
28
- - 修改的文件和行为
29
- - 为什么没有通过关闭规则、删除断言或降低类型安全来规避失败
28
+ - Modified files and behavior
29
+ - Why the failure was not circumvented by turning off rules, removing assertions, or reducing type safety
30
30
 
31
- ## 验证结果
31
+ ## Verification results
32
32
 
33
- - 重新执行的命令
34
- - 命令输出摘要
35
- - 是否仍有失败项
33
+ - Command to re-execute
34
+ - Summary of command output
35
+ - Are there still failed items?
36
36
 
37
- ## 剩余风险
37
+ ## Residual risk
38
38
 
39
- - 未覆盖的验证命令
40
- - 仍需用户决策或外部环境确认的问题
39
+ - Uncovered verification commands
40
+ - Issues that still require user decision-making or external environment confirmation
41
41
  ```
42
42
 
43
- 验证修复完成后,将报告保存到 `reports/validation-fix-YYYY-MM-DD-HHmmss.md`,并告知用户报告路径。
43
+ After the verification fix is completed, save the report to `reports/validation-fix-YYYY-MM-DD-HHmmss.md` and inform the user of the report path.
@@ -1,44 +1,44 @@
1
1
  ---
2
2
  name: fec-vite-project-standard
3
- description: Use when creating, configuring, reviewing, or debugging Vite-based frontend projects, vite.config.ts, env variables, dev server proxy, HMR, plugin ordering, library mode, dependency pre-bundling, bundle splitting, or Vite build performance. Use framework-specific skills for React/Vue component architecture; Chinese triggers include Vite 配置, vite.config, Vite 构建, Vite 性能.
3
+ description: Use when creating, configuring, reviewing, or debugging Vite-based frontend projects, vite.config.ts, env variables, dev server proxy, HMR, plugin ordering, library mode, dependency pre-bundling, bundle splitting, or Vite build performance. Use framework-specific skills for React/Vue component architecture; Chinese triggers include Vite configuration, vite.config, Vite build, Vite performance.
4
4
  ---
5
5
 
6
- # Vite 项目规范
6
+ # Vite Project Specifications
7
7
 
8
- 适用于 Vite 应用、组件库、开发服务器和构建配置的设计与审查。
8
+ Design and review of Vite applications, component libraries, development servers, and build configurations.
9
9
 
10
10
  ## Purpose
11
11
 
12
- 规范 Vite 配置、安全边界和构建性能,避免开发环境与生产构建的常见陷阱。
12
+ Standardize Vite configurations, security boundaries, and build performance to avoid common pitfalls of development environments and production builds.
13
13
 
14
14
  ## Procedure
15
15
 
16
- 1. 识别项目类型
17
- - 应用项目优先检查 `root`、`base`、`server.proxy`、`envPrefix`、`build` 和框架插件。
18
- - 组件库项目优先检查 `build.lib`、类型产物、peer dependencies external 和导出入口。
19
- - Monorepo 额外检查 `server.fs.allow`、路径别名和包依赖边界。
20
-
21
- 2. 选择插件
22
- - React 默认优先 `@vitejs/plugin-react-swc`;需要 Babel 插件时才用 `@vitejs/plugin-react`。
23
- - Vue 项目使用 `@vitejs/plugin-vue`,路径别名优先交给 `vite-tsconfig-paths`。
24
- - TypeScript 项目必须通过 `tsc --noEmit`、CI 或 `vite-plugin-checker` 补齐类型检查。
25
-
26
- 3. 管理环境变量
27
- - 客户端只读取明确公开的前缀,如 `VITE_`。
28
- - `loadEnv` 第三个参数使用显式前缀数组,不使用空字符串加载全部变量。
29
- - 密钥、数据库地址、私有 token 必须留在服务端或构建系统,不进入客户端 bundle。
30
-
31
- 4. 优化开发体验
32
- - 慢启动先用 `vite --profile` 定位插件、解析或预构建瓶颈。
33
- - 对 CJS/UMD 依赖用 `optimizeDeps.include` 处理互操作问题。
34
- - 大项目可用 `server.warmup.clientFiles` 预热核心入口。
35
-
36
- 5. 优化生产构建
37
- - 发布前运行 `vite build`,并用 `vite preview` 做本地构建烟测。
38
- - 手动分包使用稳定的对象形式优先,避免把每个依赖拆成独立小 chunk。
39
- - 生产 sourcemap 默认关闭;若上传错误追踪平台,上传后不随站点公开。
40
- - 动效、3D、图表、编辑器、地图和音视频处理库优先通过动态导入或路由级拆包隔离。
41
- - 检查静态资源是否进入正确目录、是否被 hash/cache、是否存在占位 URL 或过大的未压缩媒体。
16
+ 1. Identify the project type
17
+ - Application projects check `root`, `base`, `server.proxy`, `envPrefix`, `build` and framework plugins first.
18
+ - Component library projects check `build.lib`, type products, peer dependencies external and export entries first.
19
+ - Monorepo additional checks for `server.fs.allow`, path aliases and package dependency boundaries.
20
+
21
+ 2. Select plugin
22
+ - React gives priority to `@vitejs/plugin-react-swc` by default; use `@vitejs/plugin-react` only when the Babel plug-in is required.
23
+ - The Vue project uses `@vitejs/plugin-vue`, and path aliases are given priority to `vite-tsconfig-paths`.
24
+ - TypeScript projects must complete type checking via `tsc --noEmit`, CI or `vite-plugin-checker`.
25
+
26
+ 3. Manage environment variables
27
+ - Clients only read explicitly exposed prefixes, such as `VITE_`.
28
+ - The third parameter of `loadEnv` uses an explicit prefix array and does not use an empty string to load all variables.
29
+ - Keys, database addresses, and private tokens must stay on the server or build system and not enter the client bundle.
30
+
31
+ 4. Optimize development experience
32
+ - Use `vite --profile` to locate plug-in, parsing or pre-built bottlenecks before slow start.
33
+ - Use `optimizeDeps.include` for CJS/UMD dependencies to handle interop issues.
34
+ - Large projects can use `server.warmup.clientFiles` to warm up the core entrance.
35
+
36
+ 5. Optimize production builds
37
+ - Run `vite build` before release and use `vite preview` to do local build smoke testing.
38
+ - Prioritize manual subcontracting by using stable object forms to avoid splitting each dependency into independent small chunks.
39
+ - The production sourcemap is turned off by default; if uploaded to the error tracking platform, it will not be published with the site after uploading.
40
+ - Motion effects, 3D, charts, editors, maps, and audio and video processing libraries are prioritized for isolation through dynamic import or route-level unpacking.
41
+ - Check whether static resources go into the correct directory, have been hashed/cache, have placeholder URLs, or are too large uncompressed media.
42
42
 
43
43
  ## Minimal Config
44
44
 
@@ -69,15 +69,15 @@ export default defineConfig(({ mode }) => {
69
69
 
70
70
  ## Constraints
71
71
 
72
- - `vite build` 只转译和打包,不等于类型检查;CI 必须另跑 typecheck。
73
- - `VITE_` 不是安全边界;任何 `VITE_` 变量都会进入客户端包。
74
- - 不设置 `envPrefix: ""`,不使用 `loadEnv(mode, root, "")` 后再随意 `define`。
75
- - 不默认引入 legacy 插件;只有真实用户数据需要时再启用。
76
- - 不用 `vite preview` 作为生产服务器。
77
- - 组件库必须 externalize peer dependencies,并单独产出 `.d.ts`。
78
- - 不把服务端密钥通过 `define`、`import.meta.env` 或空前缀 `loadEnv` 注入客户端。
79
- - 不把 GSAP、Three.js、Lottie、Monaco、地图 SDK 等重型库放进所有页面共享入口;先评估 async chunk 和首屏影响。
72
+ - `vite build` only translates and packages, not type checking; CI must run typecheck separately.
73
+ - `VITE_` is not a security boundary; any `VITE_` variable goes into the client package.
74
+ - Do not set `envPrefix: ""`, do not use `loadEnv(mode, root, "")` and then `define` at will.
75
+ - Legacy plugins are not introduced by default; only enable them when needed for real user data.
76
+ - Don't use `vite preview` as a production server.
77
+ - Component libraries must externalize peer dependencies and produce `.d.ts` separately.
78
+ - Do not inject server keys into clients via `define`, `import.meta.env` or empty prefix `loadEnv`.
79
+ - Do not put heavy libraries such as GSAP, Three.js, Lottie, Monaco, and Map SDK into all page sharing entries; first evaluate the impact of async chunk and first screen.
80
80
 
81
81
  ## Expected Output
82
82
 
83
- 输出应包含项目类型判断、关键配置变更、环境变量安全说明、构建/开发性能验证方式。完成后 Vite 配置应可类型检查、可构建、密钥不泄露,并能解释 dev 与 build 的差异。
83
+ The output should include project type judgment, key configuration changes, environment variable security instructions, and build/development performance verification methods. When completed, the Vite configuration should be type-checked, buildable, secret-secure, and explain the differences between dev and build.
@@ -1,58 +1,58 @@
1
1
  ---
2
2
  name: fec-vue3-project-standard
3
- description: Use when designing or reviewing Vue 3 + TypeScript project structure, SFC/component boundaries, composables organization, route composition, Pinia ownership, API/error/styling defaults, directives, or repository-wide Vue conventions. Prefer narrower skills for forms, data fetching, tests, accessibility, virtualization, animation, or security deep dives; Chinese triggers include Vue 3 项目规范, Vue 组件架构.
3
+ description: Use when designing or reviewing Vue 3 + TypeScript project structure, SFC/component boundaries, composables organization, route composition, Pinia ownership, API/error/styling defaults, directives, or repository-wide Vue conventions. Prefer narrower skills for forms, data fetching, tests, accessibility, virtualization, animation, or security deep dives; Chinese triggers include Vue 3 project specification, Vue component architecture.
4
4
  ---
5
5
 
6
- # Vue 3 项目规范
6
+ # Vue 3 project specifications
7
7
 
8
- 适用于使用 Vue 3 + TypeScript 的仓库。
8
+ For repositories using Vue 3 + TypeScript.
9
9
 
10
10
  ## Purpose
11
11
 
12
- 为 Vue 3 + TypeScript 项目提供工程结构、组件边界、Composables 和默认实现约定,确保约定式开发和类型安全。
12
+ Provides project structure, component boundaries, Composables, and default implementation conventions for Vue 3 + TypeScript projects to ensure conventional development and type safety.
13
13
 
14
14
  ## Procedure
15
15
 
16
- 1. 识别仓库已有 Vue 约定:目录、路由、Pinia、请求层、样式体系、组件库和测试框架。
17
- 2. 划分页面、业务组件、通用组件、composables、stores、services 和 utils 的边界。
18
- 3. 优先沿用 `<script setup lang="ts">`、组合式 API 和仓库现有自动导入/模块出口约定。
19
- 4. 输出时补齐状态归属、API 层、错误处理、样式隔离和专项 skill 分流。
20
- 5. 页面和模块要有可恢复错误 UI;全局 `errorHandler`、`onErrorCaptured`、请求错误映射和路由错误页分工明确。
21
- 6. Tailwind token/variant 或响应式布局需求应分流到对应专项 skill,避免把样式系统规则塞进 Vue 组件规范。
22
- 7. 状态归属复杂时先做状态清单;DTO、公共 props、泛型 composable 或 `tsconfig` 边界复杂时,先使用 TypeScript 项目规范流程收敛跨框架类型契约。
23
- 8. 设计可复用 composable 时明确输入是否支持 plain value、ref、computed 或 getter;测试 Vue 组件时覆盖 Pinia、Router、Teleport、Suspense 和 async setup 的常见边界。
16
+ 1. Identify the existing Vue conventions in the warehouse: directory, routing, Pinia, request layer, style system, component library and test framework.
17
+ 2. Demarcate the boundaries between pages, business components, common components, composables, stores, services and utils.
18
+ 3. Prioritize the existing automatic import/module export conventions of `<script setup lang="ts">`, composite API and warehouse.
19
+ 4. Complete state ownership, API layer, error handling, style isolation and special skill offloading when outputting.
20
+ 5. Pages and modules must have recoverable error UI; global `errorHandler`, `onErrorCaptured`, request error mapping and routing error page have clear division of labor.
21
+ 6. Tailwind token/variant or responsive layout requirements should be diverted to corresponding special skills to avoid stuffing style system rules into Vue component specifications.
22
+ 7. When the state ownership is complex, first make a state list; when the boundaries of DTO, public props, generic composable or `tsconfig` are complex, first use the TypeScript project specification process to converge cross-framework type contracts.
23
+ 8. When designing reusable composables, clarify whether the input supports plain value, ref, computed or getter; when testing Vue components, cover the common boundaries of Pinia, Router, Teleport, Suspense and async setup.
24
24
 
25
- ## 详细参考
25
+ ## Detailed reference
26
26
 
27
- 按需要加载更细的参考文件:
27
+ Load more detailed reference files as needed:
28
28
 
29
- - 项目目录、组件分层、组件规范、注释和 TypeScript:加载 [references/vue3-project-structure.md](references/vue3-project-structure.md)。
30
- - Composables、slots、Provide/Inject 和路由组织:加载 [references/vue3-composables-routing.md](references/vue3-composables-routing.md)。
31
- - Pinia、API 层、错误处理、指令、样式、测试、反模式和输出检查清单:加载 [references/vue3-state-api-quality.md](references/vue3-state-api-quality.md)。
32
- - Vue 项目规范层面的轻量性能约定:加载 [references/vue3-performance-patterns.md](references/vue3-performance-patterns.md)。
29
+ - Project directory, component layering, component specifications, annotations, and TypeScript: Load [references/vue3-project-structure.md](references/vue3-project-structure.md).
30
+ - Composables, slots, Provide/Inject and routing organizations: Load [references/vue3-composables-routing.md](references/vue3-composables-routing.md).
31
+ - Pinia, API layer, error handling, directives, styles, tests, anti-patterns and output checklist: Loading [references/vue3-state-api-quality.md](references/vue3-state-api-quality.md).
32
+ - Lightweight performance conventions at the Vue project specification level: Load [references/vue3-performance-patterns.md](references/vue3-performance-patterns.md).
33
33
 
34
34
  ## Constraints
35
35
 
36
- - 使用 `<script setup lang="ts">`,禁止使用 Options API 新增组件
37
- - 组件文件规模宜约 **300 行**内;逾 **500 行**或复杂度过高须拆子组件与 Composables
38
- - Props / Emits 必须使用 TypeScript interface 定义,禁止使用 `any`
39
- - Composable 返回 `readonly` 引用,防止外部意外修改
40
- - 不要在 store 中存放 UI 临时状态(modal 开关、表单输入等)
41
- - 服务端数据优先用请求库管理,而非手动存入 Pinia
42
- - 避免在 `v-for` 中使用 `v-if`(提取为 computed 过滤)
43
- - 禁止直接从 feature 内部深层路径导入,绕过 `index.ts`
44
- - 不用全局错误处理吞掉组件内可恢复的 API、表单或权限错误。
45
- - 不把函数型参数误当 getter 自动调用;composable 参数若可能是回调,应避免使用 getter 型输入约定。
46
- - 不依赖快照作为 Vue 组件唯一断言;异步组件、Teleport 和 Pinia 场景要有用户可见行为断言。
36
+ - Use `<script setup lang="ts">` to disable using Options API to add new components
37
+ - The size of the component file should be approximately **300 lines**; if it exceeds **500 lines** or is too complex, sub-components and Composables must be separated
38
+ - Props / Emits must be defined using the TypeScript interface, and `any` is prohibited
39
+ - Composable returns a `readonly` reference to prevent accidental external modifications
40
+ - Do not store UI temporary states (modal switches, form inputs, etc.) in the store
41
+ - Server-side data is first managed by the request library rather than manually stored in Pinia
42
+ - Avoid using `v-if` in `v-for` (extract to computed filtering)
43
+ - It is forbidden to import directly from the deep path inside the feature, bypassing `index.ts`
44
+ - No need for global error handling to swallow recoverable API, form or permission errors within components.
45
+ - Do not mistake function parameters for getter automatic calls; if composable parameters may be callbacks, avoid using getter input conventions.
46
+ - Do not rely on snapshots as the only assertions for Vue components; asynchronous components, Teleport and Pinia scenes must have user-visible behavior assertions.
47
47
 
48
48
  ## Expected Output
49
49
 
50
- - 组件使用 `<script setup lang="ts">`,Props / Emits 类型完整
51
- - 可复用逻辑已提取到 composable,返回 `readonly` 引用
52
- - Loading / Error / Empty / Data 状态均已处理
53
- - 路由组件使用动态 import 加载,状态管理符合就近原则
54
- - URL 状态、服务端状态、表单状态和 Pinia 全局状态边界明确
55
- - API 调用有类型约束和统一错误处理
56
- - 样式使用 scoped 隔离,关键行为有测试覆盖
57
- - 文件结构与项目约定一致(pages / features / components 分离)
58
- - 可复用 composable 的输入响应性、Pinia/Router 边界和异步组件测试策略已说明
50
+ - The component uses `<script setup lang="ts">`, and the Props/Emits type is complete
51
+ - Reusable logic has been extracted to composable, returning `readonly` reference
52
+ - Loading / Error / Empty / Data status have been processed
53
+ - Routing components are loaded using dynamic import, and state management conforms to the proximity principle
54
+ - URL status, server status, form status and Pinia global status have clear boundaries
55
+ - API calls have type constraints and unified error handling
56
+ - Styles are isolated using scoped, and key behaviors are covered by tests
57
+ - The file structure is consistent with the project convention (pages/features/components are separated)
58
+ - Input responsiveness, Pinia/Router boundaries and asynchronous component testing strategies for reusable composables explained
@@ -1,14 +1,14 @@
1
1
  # Vue 3 composables and routing patterns
2
2
 
3
- ## Composables 规范
3
+ ## Composables specification
4
4
 
5
- ### 设计原则
5
+ ### Design principles
6
6
 
7
- - 以 `use` 前缀命名
8
- - 返回值使用对象,明确标注类型
9
- - 内部处理 loading / error / data 三态
10
- - 支持参数响应式(接受 `Ref` 或 getter)
11
- - 库级 composable 要明确参数是否支持普通值、`Ref`、`computed` 或 getter,并在副作用内部解析最新值
7
+ - Named with `use` prefix
8
+ - Use objects as return values and clearly mark the type
9
+ - Internal processing loading / error / data tri-state
10
+ -Support parameter responsiveness (accepts `Ref` or getter)
11
+ - Library level composable to clarify whether the parameter supports normal values, `Ref`, `computed` or getter, and parse the latest value inside the side effect
12
12
 
13
13
  ```typescript
14
14
  export function useUserList(params: MaybeRef<QueryParams>) {
@@ -42,31 +42,31 @@ export function useUserList(params: MaybeRef<QueryParams>) {
42
42
  }
43
43
  ```
44
44
 
45
- ### Composable 使用原则
45
+ ### Composable usage principles
46
46
 
47
- - 返回 `readonly` 引用防止外部意外修改
48
- - 数据请求场景优先使用 VueQuery / VueUse 等库(如项目已引入)
49
- - `onUnmounted` 中清理定时器、事件监听等副作用
50
- - 避免在 composable 中直接操作 DOM
51
- - 只读输入可接受普通值、ref、computed 或 getter;需要双向写入的输入只接受可写 ref 或明确的 setter。
52
- - 如果参数本身是回调、比较器或 predicate,不要把它设计成 getter 型输入,否则解析时可能误调用业务函数。
47
+ - Return a `readonly` reference to prevent accidental modification by outsiders
48
+ - In data request scenarios, libraries such as VueQuery / VueUse are preferred (if the project has been introduced)
49
+ - Clean up timers, event listeners and other side effects in `onUnmounted`
50
+ - Avoid directly manipulating DOM in composable
51
+ - Read-only inputs accept normal values, refs, computed or getters; inputs that require bidirectional writing only accept writable refs or explicit setters.
52
+ - If the parameter itself is a callback, comparator or predicate, do not design it as a getter type input, otherwise the business function may be mistakenly called during parsing.
53
53
 
54
- ### Vue Router / Pinia / 测试常见边界
54
+ ### Vue Router / Pinia / Test common boundaries
55
55
 
56
- - 路由参数变化不会重新创建同一个路由组件;依赖 `route.params` 的数据要 watch 明确字段,并处理取消和竞态。
57
- - 导航守卫中避免旧式 `next()` 多分支重复调用;优先返回 `false`、重定向对象或抛出可处理错误。
58
- - Pinia store 解构会丢失响应性时使用 `storeToRefs`;setup store 必须返回需要被外部追踪的 state、getter 和 action。
59
- - UI 临时状态、表单输入、弹窗开关不进入全局 store;URL 查询、服务端缓存和本地组件状态先各归其位。
60
- - Vue Test Utils 测试优先断言用户可见行为,不把快照作为唯一证明;异步更新使用 `await`、`flushPromises` 或框架推荐的等待方式。
61
- - 测试使用 Pinia、Router、Teleport、Suspense、async setup 或 `defineAsyncComponent` 时,在测试夹具中显式安装插件、挂载目标容器并等待异步稳定。
56
+ - Changes in routing parameters will not recreate the same routing component; data that relies on `route.params` must watch clear fields and handle cancellation and race conditions.
57
+ - Avoid old-style `next()` multi-branch repeated calls in navigation guards; give priority to returning `false`, redirecting objects or throwing handleable errors.
58
+ - Use `storeToRefs` when destructuring the Pinia store will lose responsiveness; the setup store must return state, getters and actions that need to be tracked externally.
59
+ - UI temporary status, form input, and pop-up window switches do not enter the global store; URL query, server-side cache, and local component status are returned to their respective places first.
60
+ - Vue Test Utils tests prioritize user-visible behavior and do not use snapshots as the only proof; asynchronous updates use `await`, `flushPromises` or the waiting method recommended by the framework.
61
+ - When testing using Pinia, Router, Teleport, Suspense, async setup or `defineAsyncComponent`, explicitly install the plugin in the test fixture, mount the target container and wait for async to stabilize.
62
62
 
63
- ## Slots 与 Provide/Inject
63
+ ## Slots and Provide/Inject
64
64
 
65
65
  ### Slots
66
66
 
67
- - 用 `<slot>` 实现组件组合,而非过多 props
68
- - 具名 slot 用于明确的布局区域
69
- - 作用域 slot 传递数据给父组件自定义渲染
67
+ - Use `<slot>` to achieve component composition instead of too many props
68
+ - Named slots are used for explicit layout areas
69
+ - Scope slot passes data to parent component for custom rendering
70
70
 
71
71
  ```vue
72
72
  <template>
@@ -83,9 +83,9 @@ export function useUserList(params: MaybeRef<QueryParams>) {
83
83
 
84
84
  ### Provide/Inject
85
85
 
86
- - 用于跨多层级的上下文共享(主题、配置、权限)
87
- - 提供 InjectionKey 保证类型安全
88
- - 不要用 provide/inject 替代 props 传递直接父子数据
86
+ - For context sharing across multiple levels (topics, configurations, permissions)
87
+ - Provide InjectionKey to ensure type safety
88
+ - Do not use provide/inject instead of props to pass direct parent-child data
89
89
 
90
90
  ```typescript
91
91
  // keys.ts
@@ -98,9 +98,9 @@ provide(ThemeKey, theme);
98
98
  const theme = inject(ThemeKey);
99
99
  ```
100
100
 
101
- ## 路由规范
101
+ ## Routing specifications
102
102
 
103
- ### 路由组织
103
+ ### Routing organization
104
104
 
105
105
  ```typescript
106
106
  // app/router.ts
@@ -144,15 +144,15 @@ const routes: RouteRecordRaw[] = [
144
144
  ];
145
145
  ```
146
146
 
147
- ### 路由原则
147
+ ### Routing principles
148
148
 
149
- - 路由配置集中管理,每个路由必须有 `name`
150
- - 页面组件使用动态 `import()` 按需加载
151
- - 权限控制使用路由守卫(`beforeEach`),而非在每个页面内判断
152
- - URL 参数(分页、筛选、排序)与路由状态同步
149
+ - Centralized management of routing configuration, each route must have a `name`
150
+ - Page components are loaded on demand using dynamic `import()`
151
+ - Permission control uses route guard (`beforeEach`) instead of judging within each page
152
+ - URL parameters (pagination, filtering, sorting) and routing status are synchronized
153
153
 
154
154
  ```typescript
155
- // 导航守卫
155
+ // Navigation guard
156
156
  router.beforeEach((to) => {
157
157
  const authStore = useAuthStore();
158
158
  if (to.meta.requiresAuth && !authStore.isLoggedIn) {
@@ -2,12 +2,12 @@
2
2
 
3
3
  This file keeps lightweight Vue project-standard performance guidance. Use the frontend performance workflow when the task needs metrics, traces, profiles, bundle analysis, network evidence, or a formal performance report.
4
4
 
5
- ## 性能
6
-
7
- - 使用 `shallowRef` / `shallowReactive` 优化大型对象
8
- - 大列表使用虚拟滚动
9
- - 避免在 `v-for` 中使用 `v-if`(提取为 computed 过滤)
10
- - 使用 `defineAsyncComponent` 懒加载重型组件
11
- - `v-for` 必须有稳定的 `:key`
12
- - 路由组件使用动态 `import()` 按需加载
5
+ ## Performance
6
+
7
+ - Use `shallowRef` / `shallowReactive` to optimize large objects
8
+ - Use virtual scrolling for large lists
9
+ - Avoid using `v-if` in `v-for` (extract to computed filtering)
10
+ - Use `defineAsyncComponent` to lazily load heavy components
11
+ - `v-for` must have a stable `:key`
12
+ - Routing components are loaded on demand using dynamic `import()`
13
13