@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,27 +1,27 @@
1
1
  ---
2
2
  name: fec-component-testing
3
- description: Use when authoring or reviewing frontend unit, component, or light integration tests close to UI code, including React Testing Library, Vue Test Utils, hooks/composables, props/emits, callbacks, accessible queries, user-event interactions, mocks, loading/error/empty states, and regression coverage. For layer planning, real-browser journeys, or existing validation failures, choose the matching testing or validation workflow first; Chinese triggers include 组件测试, 组件单测, 单元测试, 轻量集成测试.
3
+ description: Use when authoring or reviewing frontend unit, component, or light integration tests close to UI code, including React Testing Library, Vue Test Utils, hooks/composables, props/emits, callbacks, accessible queries, user-event interactions, mocks, loading/error/empty states, and regression coverage. For layer planning, real-browser journeys, or existing validation failures, choose the matching testing or validation workflow first; Chinese triggers include component testing, Component unit testing, unit testing, lightweight integration testing.
4
4
  ---
5
5
 
6
- # 组件测试
6
+ #Component testing
7
7
 
8
8
  ## Purpose
9
9
 
10
- 用贴近代码和用户行为的测试验证纯逻辑、组件契约与轻量模块协作,减少重构和 UI 交互回归。
10
+ Use tests close to the code and user behavior to verify pure logic, component contracts, and lightweight module collaboration to reduce refactoring and UI interaction regression.
11
11
 
12
12
  ## Procedure
13
13
 
14
- ### 1. 先确定测试层级
14
+ ### 1. First determine the test level
15
15
 
16
- - 单元测试:纯函数、hooks/composables、utils、状态逻辑、schema。
17
- - 组件测试:props/emits、回调、用户交互、loading/error/empty、mock 边界。
18
- - 轻量集成测试:表单 + API mock + Router/Store/Provider 上下文。
16
+ - Unit testing: pure functions, hooks/composables, utils, state logic, schema.
17
+ - Component testing: props/emis, callbacks, user interaction, loading/error/empty, mock boundaries.
18
+ - Lightweight integration testing: form + API mock + Router/Store/Provider context.
19
19
 
20
- 跨页面真实浏览器流程分流到 E2E workflow;测试层选择不清楚时先做测试分层规划。
20
+ The cross-page real browser process is offloaded to the E2E workflow; if the test layer selection is unclear, do the test layering planning first.
21
21
 
22
- ### 2. 优先按用户可感知行为测试
22
+ ### 2. Prioritize testing based on user-perceivable behavior
23
23
 
24
- 每个测试保持 Arrange / Act / Assert 清晰分段:准备数据和渲染、执行用户动作、断言用户可见结果或公开契约。
24
+ Each test keeps Arrange / Act / Assert clearly segmented: preparing data and rendering, performing user actions, asserting user-visible results or exposing contracts.
25
25
 
26
26
  ```tsx
27
27
  import { render, screen } from "@testing-library/react";
@@ -41,7 +41,7 @@ test("submits the entered keyword", async () => {
41
41
  });
42
42
  ```
43
43
 
44
- ### 3. Vue 组件使用可访问查询或明确文本断言
44
+ ### 3. Vue components use accessible queries or explicit text assertions
45
45
 
46
46
  ```ts
47
47
  import { mount } from "@vue/test-utils";
@@ -58,9 +58,9 @@ test("emits logout when the logout item is clicked", async () => {
58
58
  });
59
59
  ```
60
60
 
61
- 优先使用角色、标签和可见文本;仅在没有稳定语义时使用 `data-testid`。
61
+ Prefer roles, labels, and visible text; only use `data-testid` when there is no stable semantics.
62
62
 
63
- ### 4. 控制 mock 边界
63
+ ### 4. Control mock boundaries
64
64
 
65
65
  ```ts
66
66
  vi.mock("../api/users", () => ({
@@ -68,24 +68,24 @@ vi.mock("../api/users", () => ({
68
68
  }));
69
69
  ```
70
70
 
71
- - mock 网络、时间、路由和浏览器 API。
72
- - 不 mock 被测组件的内部函数。
73
- - 对设计系统基础组件只做轻量 mock,保留可访问行为。
74
- - mock 数据应表达业务场景,不使用只有测试作者能理解的随意字符串。
75
- - 共享 fixture 应保持可读,复杂对象用 builder 补默认值;每个测试只覆盖与场景相关的字段。
76
- - mock 网络时优先模拟用户可见结果和错误形状,不复制后端实现细节。
71
+ - Mock network, time, routing and browser APIs.
72
+ - Do not mock the internal functions of the component under test.
73
+ - Only make light mocks of the basic components of the design system to retain accessible behaviors.
74
+ - Mock data should express the business scenario and not use arbitrary strings that only the test author can understand.
75
+ - Shared fixtures should remain readable, and complex objects should use builders to fill in default values; each test only covers the fields relevant to the scenario.
76
+ - When mocking the network, give priority to simulating user-visible results and error shapes, and do not copy back-end implementation details.
77
77
 
78
- ### 5. 覆盖关键状态
78
+ ### 5. Override key status
79
79
 
80
- 每个复杂组件至少覆盖:
80
+ Each complex component covers at least:
81
81
 
82
- - 默认渲染。
83
- - 用户交互和回调。
82
+ - Default rendering.
83
+ - User interaction and callbacks.
84
84
  - loading / empty / error。
85
- - 权限或禁用态。
86
- - 键盘交互和焦点行为(适用时)。
85
+ - Permission or disabled status.
86
+ - Keyboard interaction and focus behavior (when applicable).
87
87
 
88
- ### 6. 保持测试可维护
88
+ ### 6. Keep tests maintainable
89
89
 
90
90
  ```ts
91
91
  function setup() {
@@ -96,24 +96,24 @@ function setup() {
96
96
  }
97
97
  ```
98
98
 
99
- 将重复渲染逻辑放入 `setup`,但不要隐藏测试的核心操作和断言。
99
+ Put the repetitive rendering logic into `setup`, but don't hide the core actions and assertions of the test.
100
100
 
101
- ### 7. 回归测试先证明问题
101
+ ### 7. Regression testing proves the problem first
102
102
 
103
- - Bug 修复先写能复现失败的最小测试。
104
- - 失败原因应指向用户行为或公开契约,而不是导入错误、测试环境或等待方式。
105
- - 修复后保留回归测试,避免把验证只留在手工步骤里。
103
+ - Bug fixes should be written first to create the smallest test that can reproduce the failure.
104
+ - Reasons for failure should point to user behavior or public contracts, not import errors, test environments, or wait methods.
105
+ - Keep regression testing after fixing to avoid leaving verification only in manual steps.
106
106
 
107
107
  ## Constraints
108
108
 
109
- - 避免测试实现细节,例如内部 state 名称、私有函数调用、DOM 层级快照。
110
- - 不把 snapshot 作为交互组件的主要断言;它只能辅助检查稳定静态输出。
111
- - 异步断言使用 `findBy*` 或 `waitFor`,不要用固定延迟。
112
- - 测试名称应描述用户场景,而不是函数名。
113
- - 组件测试不能替代 E2E;路由、真实浏览器兼容和跨页流程仍需 E2E。
114
- - 不在测试里复制组件实现逻辑;否则测试会和错误实现一起通过。
115
- - 不在测试间共享可变 fixture、全局 store 或 fake timer 状态;每个用例独立 setup 和 cleanup。
109
+ - Avoid testing implementation details such as internal state names, private function calls, DOM hierarchy snapshots.
110
+ - Do not use snapshot as the main assertion for interactive components; it can only assist in checking stable static output.
111
+ - Use `findBy*` or `waitFor` for asynchronous assertions, do not use fixed delays.
112
+ - Test names should describe user scenarios, not function names.
113
+ - Component testing is not a replacement for E2E; routing, real-browser compatibility, and cross-page flows still require E2E.
114
+ - Do not copy component implementation logic in tests; otherwise the test will pass with the wrong implementation.
115
+ - No mutable fixtures, global store or fake timer state shared between tests; each use case has independent setup and cleanup.
116
116
 
117
117
  ## Expected Output
118
118
 
119
- 产出与组件同目录或项目约定目录下的测试文件,覆盖核心交互、状态和回归场景。验证时运行项目现有 test 命令,确认失败信息能定位到用户行为或组件契约。
119
+ Produce test files in the same directory as the component or in the directory agreed upon by the project, covering core interactions, status and regression scenarios. During verification, run the existing test command of the project to confirm that the failure information can be located to user behavior or component contract.
@@ -1,21 +1,21 @@
1
1
  ---
2
2
  name: fec-data-fetching
3
- description: Use when implementing or reviewing frontend server-state flows: typed queries, request caching, invalidation, mutations, optimistic updates, infinite queries, prefetch, SSR hydration, or API-layer integration. Do not use for local UI state or Service Worker caching; Chinese triggers include 数据获取, 缓存, 乐观更新.
3
+ description: Use when implementing or reviewing frontend server-state flows: typed queries, request caching, invalidation, mutations, optimistic updates, infinite queries, prefetch, SSR hydration, or API-layer integration. Do not use for local UI state or Service Worker caching; Chinese triggers include data fetch, cache, optimistic updates.
4
4
  ---
5
5
 
6
- # Server State 数据获取
6
+ # Server State data acquisition
7
7
 
8
8
  ## Purpose
9
9
 
10
- 为前端 server state 建立清晰的数据获取、缓存、失效和提交边界,避免请求状态散落在页面组件中。
10
+ Establish clear data acquisition, caching, invalidation and submission boundaries for front-end server state to avoid request state being scattered among page components.
11
11
 
12
12
  ## Procedure
13
13
 
14
- 1. 判断状态来源:来自服务端且需要缓存、去重、刷新、分页或 mutation 时使用请求缓存方案;纯本地 UI 状态用组件 state 或 store。
15
- 2. 先沿用项目已有数据获取库;新增依赖时 React/Vue/Solid/Svelte 可考虑 TanStack Query,也可沿用 SWR、Nuxt/Nitro 数据获取或项目封装。
16
- 3. 设计稳定 cache key/query key:结构包含实体、动作和所有影响结果的参数。
17
- 4. API 函数保持纯请求函数,数据 hook/composable 负责缓存、select、loading/error/empty 状态。
18
- 5. mutation 成功后 invalidation;需要即时反馈时使用 optimistic update 并在失败时回滚。
14
+ 1. Determine the source of the state: use the request caching scheme when it comes from the server and needs caching, deduplication, refreshing, paging or mutation; use component state or store for purely local UI state.
15
+ 2. First use the existing data acquisition library of the project; when adding dependencies, you can consider TanStack Query for React/Vue/Solid/Svelte, or you can also use SWR, Nuxt/Nitro data acquisition or project encapsulation.
16
+ 3. Stable design cache key/query key: The structure contains entities, actions and all parameters that affect the results.
17
+ 4. The API function remains a pure request function, and the data hook/composable is responsible for cache, select, loading/error/empty status.
18
+ 5. Invalidation after mutation succeeds; use optimistic update when immediate feedback is needed and rollback when failure occurs.
19
19
 
20
20
  ## React Quick Start
21
21
 
@@ -45,18 +45,18 @@ export function useCreateUser() {
45
45
  }
46
46
  ```
47
47
 
48
- ## 详细参考
48
+ ## Detailed reference
49
49
 
50
- 涉及是否需要查询库、QueryClient 默认配置、Vue adapter、乐观更新、无限滚动查询、预取、SSR 水合和 API 层整合时,加载 [references/query-patterns.md](references/query-patterns.md)。
50
+ Load [references/query-patterns.md](references/query-patterns.md) when it comes to whether you need a query library, QueryClient default configuration, Vue adapter, optimistic updates, infinite scroll queries, prefetching, SSR hydration, and API layer integration.
51
51
 
52
52
  ## Constraints
53
53
 
54
- - 相同数据必须复用相同 cache key/query key;参数缺失会造成缓存串读。
55
- - `staleTime` 过长会显示旧数据,过短会造成频繁请求。
56
- - 请求缓存库不管理本地 UI 状态;不要把 modal、输入框值放进 query cache。
57
- - 乐观更新必须保存快照并在失败时回滚。
58
- - SSR/SSG 场景必须使用框架支持的预取、水合或服务端数据边界。
54
+ - The same data must reuse the same cache key/query key; missing parameters will cause cache string reading.
55
+ - If `staleTime` is too long, old data will be displayed, and if it is too short, it will cause frequent requests.
56
+ - The request cache library does not manage local UI state; do not put modal and input box values into the query cache.
57
+ - Optimistic updates must save snapshots and rollback on failure.
58
+ - SSR/SSG scenarios must use framework-supported prefetching, hydration, or server-side data boundaries.
59
59
 
60
60
  ## Expected Output
61
61
 
62
- 数据获取层具备 loading/error/empty/data 状态,重复请求自动去重,mutation 后缓存正确失效或回滚,API 层与 UI 层边界清晰。
62
+ The data acquisition layer has loading/error/empty/data status, repeated requests are automatically deduplicated, the cache is correctly invalidated or rolled back after mutation, and the boundary between the API layer and the UI layer is clear.
@@ -1,32 +1,32 @@
1
- # Server State 数据获取模式
1
+ # Server State data acquisition mode
2
2
 
3
- ## 先判断是否需要查询库
3
+ ## First determine whether a query library is needed
4
4
 
5
- - 简单静态请求、一次性提交或已有框架 loader 足够表达的页面,不必默认引入查询库。
6
- - 需要跨组件缓存、去重、后台刷新、分页、乐观更新、预取或 SSR hydration 时,再使用 TanStack Query、SWR、Nuxt 数据获取或项目既有请求缓存方案。
7
- - 查询库只管理 server state,不替代本地 UI 状态、表单状态、权限判断或 Service Worker 缓存。
5
+ - Simple static requests, one-time submissions, or pages with sufficient expression in the existing framework loader do not need to introduce the query library by default.
6
+ - When cross-component caching, deduplication, background refresh, paging, optimistic updates, prefetching or SSR hydration are required, use TanStack Query, SWR, Nuxt data acquisition or the project's existing request caching solution.
7
+ - The query library only manages server state and does not replace local UI state, form state, permission judgment or Service Worker cache.
8
8
 
9
- ## 选型参考
9
+ ## Selection reference
10
10
 
11
- 先沿用仓库已有请求层和缓存方案;新增依赖时再按框架与复杂度选择。
11
+ First, use the existing request layer and caching solution in the warehouse; when adding new dependencies, choose based on the framework and complexity.
12
12
 
13
- | 场景 | 候选方案 | 注意点 |
13
+ | Scenarios | Alternative solutions | Notes |
14
14
  | --- | --- | --- |
15
- | React server state | TanStack Query / SWR / 项目既有封装 | TanStack Query 适合 mutation、invalidation 和无限查询;SWR 适合轻量读取缓存。 |
16
- | Vue server state | TanStack Query Vue adapter / VueUse / Nuxt `useFetch` / 项目既有封装 | 不要让 Vue 项目照搬 React-only hook 示例。 |
17
- | Solid / Svelte / 跨框架 | TanStack Query 对应 adapter 或项目既有资源层 | cache key、staleTime、mutation 回滚原则保持一致。 |
18
- | 简单页面请求 | 框架 loader、组件内轻量请求或 API composable | 仍要处理 loading/error/empty 和取消或过期响应。 |
19
- | SSR / SSG | 框架预取、水合或服务端数据边界 | 确保服务端 key 与客户端 key 一致,避免重复请求和水合错配。 |
15
+ | React server state | TanStack Query / SWR / Project existing package | TanStack Query is suitable for mutation, invalidation and infinite queries; SWR is suitable for lightweight read caching. |
16
+ | Vue server state | TanStack Query Vue adapter / VueUse / Nuxt `useFetch` / Project existing package | Don’t let Vue projects copy React-only hook examples. |
17
+ | Solid / Svelte / Cross-framework | TanStack Query corresponds to the existing resource layer of the adapter or project | The cache key, staleTime, and mutation rollback principles are consistent. |
18
+ | Simple page requests | Framework loaders, lightweight requests within components, or API composable | Still have to handle loading/error/empty and cancellation or expiration responses. |
19
+ | SSR / SSG | Framework prefetching, hydration or server-side data boundaries | Ensure that the server key is consistent with the client key to avoid repeated requests and hydration mismatches. |
20
20
 
21
- ## 通用边界
21
+ ## Universal Boundary
22
22
 
23
- - API 函数只负责请求、解析和错误归一化,不包含 UI toast、loading 或缓存逻辑。
24
- - cache key/query key 必须包含所有影响响应的参数。
25
- - mutation 成功后按实体或列表失效;乐观更新必须先保存快照,失败时回滚。
26
- - 无限查询只处理数据分页;DOM 虚拟化由列表虚拟化流程处理。
27
- - 预取要有明确用户路径或首屏收益,不为所有可能数据提前请求。
23
+ - API functions are only responsible for requesting, parsing and error normalization, and do not include UI toast, loading or caching logic.
24
+ - The cache key/query key must contain all parameters that affect the response.
25
+ - Mutation fails by entity or list after success; optimistic update must save the snapshot first and roll back when it fails.
26
+ - Infinite queries only handle data paging; DOM virtualization is handled by the list virtualization process.
27
+ - Prefetching must have a clear user path or above-the-fold revenue, and do not request all possible data in advance.
28
28
 
29
- ## QueryClient 默认配置
29
+ ## QueryClient default configuration
30
30
 
31
31
  ```tsx
32
32
  const queryClient = new QueryClient({
@@ -43,11 +43,11 @@ const queryClient = new QueryClient({
43
43
 
44
44
  ## Query Key
45
45
 
46
- - 推荐:`["users", "list", { page, status }]`
47
- - 详情:`["users", "detail", userId]`
48
- - 所有影响请求结果的参数都必须进入 key。
46
+ - Recommended: `["users", "list", { page, status }]`
47
+ - Details: `["users", "detail", userId]`
48
+ - All parameters that affect the request result must enter key.
49
49
 
50
- ## 乐观更新
50
+ ## Optimistic update
51
51
 
52
52
  ```tsx
53
53
  const mutation = useMutation({
@@ -82,9 +82,9 @@ const feed = useInfiniteQuery({
82
82
  });
83
83
  ```
84
84
 
85
- 虚拟列表场景将数据分页与 DOM 虚拟化分开设计。
85
+ The virtual list scenario is designed to separate data paging and DOM virtualization.
86
86
 
87
- ## API 层整合
87
+ ## API layer integration
88
88
 
89
89
  ```ts
90
90
  export async function getUserList(params: GetUserListParams): Promise<GetUserListResponse> {
@@ -100,4 +100,4 @@ export function useUsers(params: GetUserListParams) {
100
100
  }
101
101
  ```
102
102
 
103
- API 函数不包含 UI toast、loading 或缓存逻辑。
103
+ API functions do not contain UI toast, loading or caching logic.
@@ -1,157 +1,157 @@
1
1
  ---
2
2
  name: fec-debug-framework
3
- description: Use when diagnosing frontend build failures, runtime errors, UI anomalies, API/data problems, white screens, request failures, or unexplained production exceptions; Chinese triggers include 调试, debug, 排查, 定位, 报错, 异常, 白屏, 请求失败.
3
+ description: Use when diagnosing frontend build failures, runtime errors, UI anomalies, API/data problems, white screens, request failures, or unexplained production exceptions; Chinese triggers include debugging, debug, troubleshooting, positioning, error reporting, exceptions, white screens, request failures.
4
4
  ---
5
5
 
6
- # 前端诊断框架
6
+ # Front-end diagnostic framework
7
7
 
8
8
  ## Purpose
9
9
 
10
- 用证据驱动的分类、收集、假设、验证和修复流程定位前端故障,避免凭直觉扩大改动范围。
10
+ Use an evidence-driven triage, collection, hypothesis, verification, and remediation process to locate front-end faults and avoid relying on intuition to expand the scope of changes.
11
11
 
12
12
  ## Procedure
13
13
 
14
- 所有前端问题诊断遵循统一流程:
14
+ All front-end problem diagnosis follows a unified process:
15
15
 
16
- ### Step 1: 分类(Classify)
16
+ ### Step 1: Classify
17
17
 
18
- 识别问题类型和影响范围:
18
+ Identify problem type and scope of impact:
19
19
 
20
- | 类型 | 判断依据 | 诊断入口 |
20
+ | Type | Judgment basis | Diagnosis entrance |
21
21
  | ------- | ---------------------------- | -------------- |
22
- | build | 命令退出非零、stderr 有错误 | → Build 模块 |
23
- | runtime | 控制台异常、白屏、功能不可用 | → Runtime 模块 |
24
- | ui | 视觉偏差、交互不符预期 | → UI 模块 |
25
- | api | 请求状态码异常、数据不一致 | → API 模块 |
22
+ | build | Command exit is non-zero, stderr has error | → Build module |
23
+ | runtime | Console exception, white screen, function unavailable | → Runtime module |
24
+ | ui | Visual deviation, interaction not as expected | → UI module |
25
+ | api | Request status code exception, data inconsistency | → API module |
26
26
 
27
- 跨类型问题(如 API 失败导致 UI 异常)从最表层症状入手,逐层深入。
27
+ Cross-type problems (such as API failure leading to UI exceptions) start with the most superficial symptoms and drill down layer by layer.
28
28
 
29
- ### Step 2: 收集(Collect)
29
+ ### Step 2: Collect
30
30
 
31
- 按类型收集证据(各模块有具体策略,见下方)。
31
+ Collect evidence by type (specific strategies for each module, see below).
32
32
 
33
- ### Step 3: 假设(Hypothesize)
33
+ ### Step 3: Hypothesize
34
34
 
35
- 基于证据提出可能根因,按可能性排序:
35
+ Propose possible root causes based on evidence, ranked by likelihood:
36
36
 
37
- - 每个假设必须可测试(有明确的验证方法)
38
- - 最多保留 3 个假设,避免发散
39
- - 格式:「因为 X,导致 Y,可通过 Z 验证」
37
+ - Every hypothesis must be testable (have clear verification methods)
38
+ - Keep at most 3 hypotheses to avoid divergence
39
+ - Format: "Because X leads to Y, which can be verified by Z"
40
40
 
41
- ### Step 4: 验证(Verify)
41
+ ### Step 4: Verify
42
42
 
43
- 逐一测试假设:
43
+ Test the hypotheses one by one:
44
44
 
45
- - 从最可能的假设开始
46
- - 每次只改一个变量
47
- - 验证结果记录:证实 / 证伪 / 待定
48
- - 假设全部证伪时回到 Step 2 重新收集
45
+ - Start with the most likely hypothesis
46
+ - Only change one variable at a time
47
+ - Verification result record: confirmed / falsified / pending
48
+ - If all assumptions are falsified, return to Step 2 and collect again.
49
49
 
50
- ### Step 5: 修复与确认(Fix & Validate)
50
+ ### Step 5: Fix & Validate
51
51
 
52
- - 应用最小修复
53
- - 运行受影响验证命令
54
- - 确认无回归
55
- - 输出修复报告
52
+ - Apply minimal fixes
53
+ - Run affected verification commands
54
+ - Confirmed no regression
55
+ - Output repair report
56
56
 
57
57
  ---
58
58
 
59
- ## 诊断模块
59
+ ## Diagnostic module
60
60
 
61
- ### Build 模块
61
+ ### Build module
62
62
 
63
- **收集**:运行最小失败命令,捕获完整 stderr/stdout
64
- **假设**:按错误类型分组(类型错误、导入失败、配置解析、依赖缺失),匹配已知模式
65
- **验证**:修一类根因 → 重跑命令 → 确认错误减少
66
- **特殊处理**:
63
+ **Collect**: Run minimal failing commands, capture full stderr/stdout
64
+ **Assumptions**: Grouped by error type (type error, import failure, configuration resolution, missing dependency), match known patterns
65
+ **Verification**: Fix a type of root cause → rerun the command → confirm that errors are reduced
66
+ **Special handling**:
67
67
 
68
- - 依赖版本、peer dependency、ESM/CJS、lockfile 相关失败先作为 build 兼容性问题收集证据
69
- - 记录 package manager、Node 版本、lockfile diff、相关包版本和完整错误日志
70
- - 不在缺少证据时升级依赖、手工编辑 lockfile,或把依赖迁移与普通调试修复混在同一批改动
71
- - 若任务目标本身是版本升级、CVE 修复或 lockfile 风险评审,应转入依赖升级工作流
72
- - CI 专属失败检查 Node 版本、包管理器、环境变量差异
68
+ - Collect evidence for dependency version, peer dependency, ESM/CJS, and lockfile related failures first as build compatibility issues
69
+ - Log package manager, Node version, lockfile diff, related package version and full error log
70
+ - No longer upgrade dependencies, manually edit lockfiles when evidence is lacking, or mix dependency migrations with normal debug fixes in the same batch of changes
71
+ - If the task goal itself is version upgrade, CVE repair or lockfile risk review, it should be transferred to the dependency upgrade workflow
72
+ - CI exclusive failure check Node version, package manager, environment variable differences
73
73
 
74
- ### Runtime 模块
74
+ ### Runtime module
75
75
 
76
- **收集**:
76
+ **Collect**:
77
77
 
78
- - 复现路径(用户操作序列)
79
- - 控制台错误和堆栈
80
- - 组件渲染树状态(检查关键组件是否正确挂载)
81
- - 相关 store/state 快照
78
+ - Recurrence path (sequence of user operations)
79
+ - Console errors and stack
80
+ - Component rendering tree status (check whether key components are mounted correctly)
81
+ - Relevant store/state snapshot
82
82
 
83
- **假设**:
83
+ **Assumptions**:
84
84
 
85
- - 堆栈反向追踪:从异常位置回溯到触发源
86
- - 状态流分析:检查 state 变化是否符合预期
87
- - 生命周期分析:是否在错误的时机访问了未初始化的数据
85
+ - Stack reverse tracing: trace back from the exception location to the trigger source
86
+ - State flow analysis: Check whether state changes are as expected
87
+ - Life cycle analysis: whether uninitialized data is accessed at the wrong time
88
88
 
89
- **验证**:
89
+ **Verification**:
90
90
 
91
- - 添加临时日志确认状态值
92
- - 在可疑路径添加断言
93
- - 复现路径验证修复
91
+ - Add temporary log confirmation status value
92
+ - Add assertions on suspicious paths
93
+ - Recurrence path verification fix
94
94
 
95
- ### UI 模块
95
+ ### UI module
96
96
 
97
- **收集**:
97
+ **Collect**:
98
98
 
99
- - 当前截图 vs 期望效果
100
- - DOM 结构检查(元素是否存在、层级是否正确)
101
- - 计算样式检查(实际应用的 CSS 值)
102
- - 响应式断点测试
99
+ - Current screenshot vs desired effect
100
+ - DOM structure check (whether the element exists and whether the level is correct)
101
+ - Computed style checks (actual applied CSS values)
102
+ - Responsive breakpoint testing
103
103
 
104
- **假设**:
104
+ **Assumptions**:
105
105
 
106
- - CSS 特异性冲突(选择器权重不够被覆盖)
107
- - 组件状态不匹配(props/state 未正确传递)
108
- - 布局模型问题(flex/grid 配置错误)
109
- - 响应式断点遗漏
106
+ - CSS specificity conflict (selector weight is not enough to be overridden)
107
+ - Component state mismatch (props/state not passed correctly)
108
+ - Layout model problem (flex/grid configuration error)
109
+ - Missing responsive breakpoints
110
110
 
111
- **验证**:
111
+ **Verification**:
112
112
 
113
- - 浏览器 DevTools 实时调整验证
114
- - 隔离组件测试(排除外部样式干扰)
115
- - 多断点逐一验证
113
+ - Browser DevTools real-time adjustment verification
114
+ - Isolated component testing (excluding external style interference)
115
+ - Multiple breakpoints to verify one by one
116
116
 
117
- ### API 模块
117
+ ### API module
118
118
 
119
- **收集**:
119
+ **Collect**:
120
120
 
121
- - 请求 URL、method、headers、body
122
- - 响应 status、headers、body
123
- - 网络瀑布时序
124
- - 相关 store/state 中的缓存数据
121
+ - Request URL, method, headers, body
122
+ - Respond to status, headers, body
123
+ - Network waterfall timing
124
+ - Cache data in related store/state
125
125
 
126
- **假设**:
126
+ **Assumptions**:
127
127
 
128
- - 请求链路逐跳检查(URL → 中间件 → 拦截器 → 服务端)
129
- - 数据转换检查(响应解析、类型映射)
130
- - 缓存策略检查(过期、失效、竞态)
131
- - 并发请求竞态(race condition)
128
+ - Request link hop-by-hop inspection (URL → Middleware → Interceptor → Server)
129
+ - Data conversion checks (response parsing, type mapping)
130
+ - Cache policy check (expiration, invalidation, race condition)
131
+ - Concurrent request race condition (race condition)
132
132
 
133
- **验证**:
133
+ **Verification**:
134
134
 
135
- - curl 独立复现(排除前端干扰)
136
- - 逐层 mock 定位问题层级
137
- - 端到端请求验证修复
135
+ - curl independent reproduction (excluding front-end interference)
136
+ - Mock layer by layer to locate the problem level
137
+ - End-to-end request validation fixes
138
138
 
139
139
  ---
140
140
 
141
- ## 详细参考
141
+ ## Detailed reference
142
142
 
143
- 撰写诊断报告时,加载 [references/report-template.md](references/report-template.md)。
143
+ When writing a diagnostic report, load [references/report-template.md](references/report-template.md).
144
144
 
145
145
  ## Constraints
146
146
 
147
- - 不在缺少证据时猜测根因
148
- - 不通过关闭规则、删除测试或降低类型安全来「修复」
149
- - 每次只改一个变量来验证假设
150
- - 不在验证前扩大改动范围
151
- - 同一假设连续 3 次验证失败,停止并报告阻塞
147
+ - Don't guess at root cause when evidence is lacking
148
+ - Not "fixed" by turning off rules, removing tests, or reducing type safety
149
+ - Change only one variable at a time to test your hypothesis
150
+ - Do not expand the scope of changes before verification
151
+ - The same hypothesis fails verification 3 times in a row, stops and reports blocking
152
152
 
153
153
  ## Expected Output
154
154
 
155
- - 诊断报告保存为 `reports/debug-YYYY-MM-DD-HHmmss.md`
156
- - 报告包含问题类型、关键证据、假设验证记录、根因、修复内容、验证结果和剩余风险
157
- - build/runtime/ui/api 问题均能说明复现路径、验证命令或下一步阻塞点
155
+ - The diagnostic report is saved as `reports/debug-YYYY-MM-DD-HHmmss.md`
156
+ - The report includes issue type, key evidence, hypothesis verification records, root cause, fix content, verification results and remaining risk
157
+ - Build/runtime/ui/api problems can explain the reproduction path, verification command or next blocking point
@@ -1,58 +1,58 @@
1
- # 诊断报告模板
1
+ # Diagnostic report template
2
2
 
3
3
  ```markdown
4
- # 前端诊断报告
4
+ # Front-end diagnostic report
5
5
 
6
- > 生成时间: YYYY-MM-DD HH:mm
7
- > 问题类型: build / runtime / ui / api
8
- > 影响范围: 页面、功能、用户群或环境
6
+ > Generation time: YYYY-MM-DD HH:mm
7
+ > Question type: build/runtime/ui/api
8
+ > Scope of influence: page, feature, user group or environment
9
9
 
10
- ## 问题描述
10
+ ## Problem description
11
11
 
12
- - 用户报告或观察到的现象
13
- - 首次出现时间、环境、分支或版本
12
+ - Phenomenon reported or observed by users
13
+ - First appearance time, environment, branch or version
14
14
 
15
- ## 复现路径
15
+ ## Reproduction path
16
16
 
17
- 1. 操作步骤或触发命令
18
- 2. 期望结果
19
- 3. 实际结果
17
+ 1. Operation steps or trigger commands
18
+ 2. Desired results
19
+ 3. Actual results
20
20
 
21
- ## 收集的证据
21
+ ## Evidence collected
22
22
 
23
- - 日志 / stderr / console stack
24
- - 截图、DOM、样式、网络请求或 trace
25
- - 相关配置、依赖版本、环境变量或状态快照
23
+ - log/stderr/console stack
24
+ - Screenshot, DOM, style, network request or trace
25
+ - Related configurations, dependency versions, environment variables or status snapshots
26
26
 
27
- ## 假设与验证
27
+ ## Hypothesis and Verification
28
28
 
29
- | 假设 | 验证方法 | 结果 |
29
+ | Hypothesis | Verification Method | Results |
30
30
  | --- | --- | --- |
31
- | 因为 X,导致 Y | 通过 Z 验证 | 证实 / 证伪 / 待定 |
31
+ | Because X, causes Y | Verified by Z | Confirmed / Falsified / Pending |
32
32
 
33
- ## 根因
33
+ ## Root cause
34
34
 
35
- - 最终确认的根本原因
36
- - 为什么已有证据能支持该结论
35
+ - Final confirmed root cause
36
+ - Why the existing evidence supports this conclusion
37
37
 
38
- ## 修复内容
38
+ ## Fix content
39
39
 
40
- - 修改的文件和行为
41
- - 为什么这是最小有效修复
40
+ - Modified files and behavior
41
+ - Why this is a minimal effective fix
42
42
 
43
- ## 验证结果
43
+ ## Verification results
44
44
 
45
- - 执行的命令、手工路径或浏览器验证
46
- - 修复后观察到的结果
45
+ - Executed command, manual path or browser verification
46
+ - Observed results after fix
47
47
 
48
- ## 剩余风险
48
+ ## Residual risk
49
49
 
50
- - 未覆盖的边界
51
- - 可能回归的区域
50
+ - Uncovered borders
51
+ - Areas of possible return
52
52
 
53
- ## 下一步
53
+ ## Next step
54
54
 
55
- - 需要用户决策、后续任务或监控项
55
+ - Requires user decisions, follow-up tasks or monitoring items
56
56
  ```
57
57
 
58
- 诊断完成后,将报告保存到 `reports/debug-YYYY-MM-DD-HHmmss.md`,并告知用户报告路径。
58
+ After the diagnosis is completed, save the report to `reports/debug-YYYY-MM-DD-HHmmss.md` and inform the user of the report path.