@bovinphang/frontend-craft 2.6.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 (414) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +72 -1
  4. package/CHANGELOG.zh-CN.md +71 -1
  5. package/README.md +10 -6
  6. package/README.openclaw.md +100 -42
  7. package/README.openclaw.zh-CN.md +100 -42
  8. package/README.zh-CN.md +10 -6
  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 +88 -88
  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 +84 -69
  32. package/docs/ja-JP/README.md +56 -52
  33. package/docs/ko-KR/README.md +45 -41
  34. package/docs/project-structure.md +19 -7
  35. package/docs/superpowers/plans/2026-05-29-fec-debug.md +491 -0
  36. package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +340 -0
  37. package/docs/zh-CN/example-prompts.md +84 -69
  38. package/docs/zh-CN/project-structure.md +14 -5
  39. package/docs/zh-TW/README.md +33 -29
  40. package/localized/zh-CN/agents/fec-architect.md +125 -0
  41. package/localized/zh-CN/agents/fec-code-reviewer.md +152 -0
  42. package/localized/zh-CN/agents/fec-debugger.md +44 -0
  43. package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
  44. package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
  45. package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
  46. package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
  47. package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
  48. package/localized/zh-CN/agents/fec-refactor-cleaner.md +32 -0
  49. package/localized/zh-CN/agents/fec-security-reviewer.md +116 -0
  50. package/localized/zh-CN/agents/fec-test-planner.md +50 -0
  51. package/localized/zh-CN/agents/fec-typescript-reviewer.md +142 -0
  52. package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
  53. package/localized/zh-CN/commands/fec-debug.md +30 -0
  54. package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
  55. package/localized/zh-CN/commands/fec-init.md +70 -0
  56. package/localized/zh-CN/commands/fec-plan.md +94 -0
  57. package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
  58. package/localized/zh-CN/commands/fec-review.md +66 -0
  59. package/localized/zh-CN/commands/fec-scaffold.md +205 -0
  60. package/localized/zh-CN/commands/fec-tdd.md +21 -0
  61. package/localized/zh-CN/skills/TEMPLATE.md +155 -0
  62. package/localized/zh-CN/skills/eval_queries.json +1013 -0
  63. package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
  64. package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
  65. package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  66. package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
  67. package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
  68. package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
  69. package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
  70. package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
  71. package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
  72. package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
  73. package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
  74. package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  75. package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
  76. package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  77. package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
  78. package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  79. package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  80. package/localized/zh-CN/skills/fec-code-review/SKILL.md +143 -0
  81. package/localized/zh-CN/skills/fec-code-review/references/report-template.md +29 -0
  82. package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
  83. package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
  84. package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
  85. package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
  86. package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
  87. package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
  88. package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  89. package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
  90. package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
  91. package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  92. package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  93. package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  94. package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
  95. package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
  96. package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  97. package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
  98. package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  99. package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
  100. package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  101. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
  102. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  103. package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  104. package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  105. package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  106. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  107. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  108. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  109. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  110. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  111. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  112. package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
  113. package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  114. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  115. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  116. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  117. package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
  118. package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
  119. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  120. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  121. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  122. package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  123. package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
  124. package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
  125. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +80 -0
  126. package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  127. package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
  128. package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +74 -0
  129. package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  130. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
  131. package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  132. package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  133. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
  134. package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  135. package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
  136. package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  137. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
  138. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  139. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  140. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  141. package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
  142. package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  143. package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
  144. package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
  145. package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  146. package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
  147. package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  148. package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
  149. package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  150. package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
  151. package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  152. package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
  153. package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
  154. package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  155. package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  156. package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
  157. package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  158. package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  159. package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  160. package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  161. package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +51 -0
  162. package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
  163. package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
  164. package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
  165. package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
  166. package/localized/zh-CN/skills/fec-security-review/SKILL.md +38 -0
  167. package/localized/zh-CN/skills/fec-security-review/references/report-template.md +27 -0
  168. package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
  169. package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
  170. package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
  171. package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
  172. package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
  173. package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  174. package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
  175. package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
  176. package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
  177. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +52 -0
  178. package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
  179. package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
  180. package/{skills/fec-typescript-type-safety → localized/zh-CN/skills/fec-typescript-project-standard}/references/type-safety-patterns.md +1 -1
  181. package/{skills/fec-typescript-type-safety/SKILL.md → localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md} +5 -14
  182. package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
  183. package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
  184. package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
  185. package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
  186. package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
  187. package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
  188. package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  189. package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
  190. package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
  191. package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
  192. package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
  193. package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
  194. package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
  195. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
  196. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  197. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
  198. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  199. package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
  200. package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  201. package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  202. package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  203. package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  204. package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  205. package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  206. package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
  207. package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
  208. package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
  209. package/localized/zh-CN/skills/metadata.json +1646 -0
  210. package/localized/zh-CN/skills/relations.json +755 -0
  211. package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
  212. package/localized/zh-CN/templates/claude/settings.json +62 -0
  213. package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
  214. package/localized/zh-CN/templates/codex/config.toml +32 -0
  215. package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
  216. package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  217. package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +54 -0
  218. package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
  219. package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
  220. package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
  221. package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
  222. package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
  223. package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
  224. package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
  225. package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
  226. package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
  227. package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
  228. package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
  229. package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
  230. package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
  231. package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
  232. package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
  233. package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
  234. package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
  235. package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
  236. package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
  237. package/openclaw.plugin.json +1 -1
  238. package/package.json +4 -3
  239. package/skills/TEMPLATE.md +74 -74
  240. package/skills/eval_queries.json +717 -619
  241. package/skills/fec-accessibility-check/SKILL.md +21 -21
  242. package/skills/fec-accessibility-check/references/report-template.md +12 -12
  243. package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
  244. package/skills/fec-alchemy/SKILL.md +50 -50
  245. package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
  246. package/skills/fec-alchemy/assets/intake-template.md +55 -55
  247. package/skills/fec-alchemy/assets/review-checklist.md +23 -23
  248. package/skills/fec-alchemy/references/methodology.md +66 -66
  249. package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
  250. package/skills/fec-api-integration/SKILL.md +61 -61
  251. package/skills/fec-api-integration/references/integration-patterns.md +30 -30
  252. package/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  253. package/skills/fec-browser-storage/SKILL.md +16 -16
  254. package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
  255. package/skills/fec-canvas-threejs/SKILL.md +21 -21
  256. package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
  257. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
  258. package/skills/fec-code-review/SKILL.md +94 -94
  259. package/skills/fec-code-review/references/report-template.md +13 -13
  260. package/skills/fec-component-testing/SKILL.md +39 -39
  261. package/skills/fec-data-fetching/SKILL.md +16 -16
  262. package/skills/fec-data-fetching/references/query-patterns.md +27 -27
  263. package/skills/fec-debug-framework/SKILL.md +95 -95
  264. package/skills/fec-debug-framework/references/report-template.md +34 -34
  265. package/skills/fec-dependency-upgrade/SKILL.md +17 -17
  266. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
  267. package/skills/fec-doc-sync/SKILL.md +23 -23
  268. package/skills/fec-drawio-studio/SKILL.md +73 -0
  269. package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  270. package/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  271. package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  272. package/skills/fec-drawio-studio/references/data-residency.md +27 -0
  273. package/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
  274. package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  275. package/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
  276. package/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  277. package/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
  278. package/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  279. package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
  280. package/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  281. package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  282. package/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  283. package/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  284. package/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  285. package/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  286. package/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  287. package/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  288. package/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  289. package/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  290. package/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
  291. package/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  292. package/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  293. package/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  294. package/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  295. package/skills/fec-drawio-studio/styles/schema.json +112 -0
  296. package/skills/fec-e2e-testing/SKILL.md +24 -22
  297. package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  298. package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  299. package/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  300. package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
  301. package/skills/fec-form-handling/SKILL.md +21 -21
  302. package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
  303. package/skills/fec-image-generation/SKILL.md +81 -0
  304. package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  305. package/skills/fec-image-generation/references/artifact-routing.md +80 -0
  306. package/skills/fec-image-generation/references/diagram-workflows.md +74 -0
  307. package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  308. package/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
  309. package/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  310. package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  311. package/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
  312. package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  313. package/skills/fec-implement-from-design/SKILL.md +81 -74
  314. package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
  315. package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -173
  316. package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  317. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
  318. package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  319. package/skills/fec-legacy-web-standard/SKILL.md +17 -17
  320. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
  321. package/skills/fec-list-virtualization/SKILL.md +16 -16
  322. package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
  323. package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
  324. package/skills/fec-motion-interaction/SKILL.md +51 -44
  325. package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
  326. package/skills/fec-nextjs-project-standard/SKILL.md +64 -58
  327. package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
  328. package/skills/fec-performance-optimization/SKILL.md +54 -50
  329. package/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  330. package/skills/fec-performance-optimization/references/report-template.md +34 -28
  331. package/skills/fec-pwa-implementation/SKILL.md +17 -17
  332. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
  333. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
  334. package/skills/fec-react-project-standard/SKILL.md +72 -64
  335. package/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  336. package/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  337. package/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  338. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  339. package/skills/fec-refactor-clean/SKILL.md +30 -30
  340. package/skills/fec-refactor-clean/references/report-template.md +23 -23
  341. package/skills/fec-responsive-layout/SKILL.md +17 -17
  342. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +39 -28
  343. package/skills/fec-route-protection/SKILL.md +26 -26
  344. package/skills/fec-security-review/SKILL.md +20 -20
  345. package/skills/fec-security-review/references/report-template.md +12 -12
  346. package/skills/fec-security-review/references/security-checklist.md +27 -27
  347. package/skills/fec-source-driven-development/SKILL.md +66 -40
  348. package/skills/fec-state-management/SKILL.md +34 -34
  349. package/skills/fec-state-management/references/state-patterns.md +19 -19
  350. package/skills/fec-storybook-component-doc/SKILL.md +19 -19
  351. package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
  352. package/skills/fec-svg-animation/SKILL.md +32 -32
  353. package/skills/fec-tailwind-design-system/SKILL.md +17 -17
  354. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -32
  355. package/skills/fec-tdd-workflow/SKILL.md +28 -28
  356. package/skills/fec-testing-strategy/SKILL.md +29 -29
  357. package/skills/fec-typescript-project-standard/SKILL.md +54 -0
  358. package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
  359. package/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
  360. package/skills/fec-ui-design/SKILL.md +90 -72
  361. package/skills/fec-ui-design/data/style-archetypes.json +40 -0
  362. package/skills/fec-ui-design/data/ux-quality-rules.json +35 -0
  363. package/skills/fec-ui-design/references/design-intelligence.md +81 -21
  364. package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
  365. package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -32
  366. package/skills/fec-ui-design/scripts/design-system.mjs +119 -1
  367. package/skills/fec-validation-fix/SKILL.md +26 -26
  368. package/skills/fec-validation-fix/references/report-template.md +25 -25
  369. package/skills/fec-vite-project-standard/SKILL.md +39 -39
  370. package/skills/fec-vue3-project-standard/SKILL.md +39 -30
  371. package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +163 -0
  372. package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  373. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +177 -0
  374. package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  375. package/skills/fec-web-video-presentation/SKILL.md +61 -0
  376. package/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  377. package/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  378. package/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  379. package/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  380. package/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  381. package/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  382. package/skills/fec-web-workers/SKILL.md +16 -16
  383. package/skills/fec-web-workers/references/advanced-workers.md +13 -13
  384. package/skills/fec-web-workers/references/basic-worker.md +8 -8
  385. package/skills/metadata.json +402 -220
  386. package/skills/relations.json +120 -25
  387. package/templates/claude/CLAUDE.md +60 -60
  388. package/templates/codex/AGENTS.md +76 -76
  389. package/templates/codex/config.toml +4 -4
  390. package/templates/openclaw/AGENTS.md +68 -68
  391. package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
  392. package/templates/shared/rules/fec-agent-workflow.md +40 -40
  393. package/templates/shared/rules/fec-api-layer.md +52 -52
  394. package/templates/shared/rules/fec-ci-cd.md +29 -117
  395. package/templates/shared/rules/fec-code-comments.md +22 -22
  396. package/templates/shared/rules/fec-design-system.md +65 -241
  397. package/templates/shared/rules/fec-error-handling.md +41 -185
  398. package/templates/shared/rules/fec-git-conventions.md +42 -42
  399. package/templates/shared/rules/fec-i18n.md +48 -96
  400. package/templates/shared/rules/fec-naming-conventions.md +91 -91
  401. package/templates/shared/rules/fec-performance.md +78 -78
  402. package/templates/shared/rules/fec-react.md +58 -58
  403. package/templates/shared/rules/fec-refactoring.md +34 -30
  404. package/templates/shared/rules/fec-rendering-patterns.md +40 -183
  405. package/templates/shared/rules/fec-responsive-design.md +37 -214
  406. package/templates/shared/rules/fec-source-driven-development.md +22 -22
  407. package/templates/shared/rules/fec-state-management.md +45 -148
  408. package/templates/shared/rules/fec-testing.md +64 -64
  409. package/templates/shared/rules/fec-typescript.md +98 -341
  410. package/templates/shared/rules/fec-vue.md +42 -42
  411. package/templates/shared/rules/fec-working-modes.md +34 -34
  412. package/skills/fec-e2e-testing/references/e2e-advanced.md +0 -176
  413. package/skills/fec-react-project-standard/references/react-project-details.md +0 -642
  414. package/skills/fec-vue3-project-standard/references/vue3-project-details.md +0 -547
@@ -1,227 +1,50 @@
1
- # 响应式设计规则
1
+ # Responsive design rules
2
2
 
3
- 凡是任务涉及移动端适配、响应式布局、多端兼容时,都应用本文件。
3
+ This document should be used whenever the task involves mobile adaptation, responsive layout, multi-device compatibility, touch targets or viewport behavior. This article only retains project-resident constraints; layout mode, container query, responsive tables, media and validation details are left to `fec-responsive-layout`.
4
4
 
5
- ## 核心原则
5
+ ## Core Principles
6
6
 
7
- - **移动优先**: 从小屏幕开始设计,逐步增强到大屏幕
8
- - **内容优先**: 移动端优先展示核心内容,次要内容折叠或延后
9
- - **触摸友好**: 所有交互元素必须适配手指操作
10
- - **性能优先**: 移动端网络和设备性能较弱,需优化加载
11
- - **容器感知**: 可复用组件优先适配所在容器,而不是假设整页断点
12
- - **稳定尺寸**: 工具栏、表格列、棋盘、卡片网格和计数器需要稳定约束,避免状态变化导致布局跳动
7
+ - **Mobile First**: Start designing for small screens and work your way up to large screens.
8
+ - **Content Priority**: Small screens give priority to core tasks, key operations and feedback, and secondary content is folded, postponed or entered into the detail layer.
9
+ - **Touch Friendly**: All interactive elements must adapt to finger operations, and key functions cannot rely solely on hover.
10
+ - **Performance first**: The mobile network and device performance are weak, so first-screen resources, charts, animations, and large lists should be restrained.
11
+ - **Container Aware**: Reusable components will first adapt to the container in which they are located, instead of assuming full page breakpoints.
12
+ - **Stable size**: Toolbars, table columns, checkerboards, card grids and counters need stable constraints to avoid layout jumps caused by state changes.
13
13
 
14
- ## 断点策略
14
+ ## Breakpoints and container strategies
15
15
 
16
- | 断点 | 宽度 | 设备 | Tailwind | 说明 |
17
- | ----------- | ------ | --------------- | -------- | -------------------- |
18
- | **Mobile** | 375px | 手机竖屏 | (默认) | 基础样式,无媒体查询 |
19
- | **Tablet** | 768px | 平板 / 手机横屏 | `md:` | 两列布局起点 |
20
- | **Desktop** | 1024px | 笔记本 | `lg:` | 完整布局 |
21
- | **Large** | 1280px | 桌面显示器 | `xl:` | 宽屏优化 |
22
- | **XLarge** | 1536px | 超宽屏 | `2xl:` | 最大内容宽度 |
16
+ - Default validation for 375px, 768px, 1024px, 1440px, and breakpoint intermediate values.
17
+ - Use mobile-first `min-width` breakpoint; do not write the desktop style first and then use `max-width` to supplement the mobile version.
18
+ - Tailwind prefixes are used from smallest to largest: default → `sm:` → `md:` → `lg:` → `xl:` → `2xl:`.
19
+ - Page-level structures can use breakpoints; reusable components that will be placed into sidebars, pop-ups, cards, or main content areas preferentially use container queries.
20
+ - `min-width: 0`, `minmax()`, `aspect-ratio` and explicit overflow strategies must be taken into account when grid/flex children contain long text, charts, code, media or tables.
23
21
 
24
- ### 移动优先 CSS
22
+ ## Touch target to interact with mobile terminal
25
23
 
26
- ```css
27
- /* 基础样式 — 移动端 */
28
- .container {
29
- padding: 16px;
30
- display: flex;
31
- flex-direction: column;
32
- gap: 12px;
33
- }
24
+ - When space permits, interaction targets such as buttons, links, and close buttons must be at least 44x44px; compact tool interfaces must be at least operable.
25
+ - Avoid input box font size below 16px to prevent iOS Safari from automatically scaling.
26
+ - Fixed bottom bar, action bar, drawer and dialog box must consider safe area and virtual keyboard.
27
+ - Hover-only messages must have click, focus, or permanent visible alternatives.
28
+ - After switching between horizontal and vertical screens, the main operation, focus position, scroll container and error prompts should still be accessible.
34
29
 
35
- /* Tablet — 768px+ */
36
- @media (min-width: 768px) {
37
- .container {
38
- padding: 24px;
39
- flex-direction: row;
40
- gap: 24px;
41
- }
42
- }
30
+ ## Data intensive area
43
31
 
44
- /* Desktop — 1024px+ */
45
- @media (min-width: 1024px) {
46
- .container {
47
- max-width: 960px;
48
- margin: 0 auto;
49
- padding: 32px;
50
- }
51
- }
52
- ```
32
+ - Tables, lists, boards, editors and canvases can be partially scrolled horizontally, but the page as a whole should not have unintentional horizontal overflow.
33
+ - Data-intensive views on the mobile terminal need to define column priorities first: main identification, status and main operations are retained first; low-priority fields enter details, expand rows or drawers.
34
+ - Small screens must still retain the ability to sort, filter, paging, and select.
35
+ - Virtual scrolling only solves the problem of DOM quantity and cannot replace information hierarchy design.
53
36
 
54
- ### Tailwind 移动优先
37
+ ## Responsive media
55
38
 
56
- Tailwind 默认移动优先,无前缀类作用于所有屏幕,前缀仅覆盖更大断点:
39
+ - Images and videos must have stable size, `aspect-ratio` or container constraints to avoid pushing the layout after loading.
40
+ - Use `srcset`, `sizes`, `picture` or frame picture components when multi-size resources are needed to avoid downloading large desktop images on mobile devices.
41
+ - Media cropping must preserve the main information and do not crop out key areas of products, people, graphics or status to fill the card.
57
42
 
58
- ```html
59
- <!-- 移动端: 单列, 小间距 | Tablet: 双列 | Desktop: 三列 -->
60
- <div
61
- class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 lg:gap-8"
62
- >
63
- <!-- 卡片: 移动端小字, Desktop 大字 -->
64
- <div class="p-4 md:p-6 text-sm md:text-base">...</div>
65
- </div>
43
+ ## Checklist
66
44
 
67
- <!-- 导航: 移动端隐藏, Desktop 显示 -->
68
- <nav class="hidden md:flex">...</nav>
69
-
70
- <!-- 移动端汉堡菜单, Desktop 隐藏 -->
71
- <button class="md:hidden" aria-label="菜单">☰</button>
72
- ```
73
-
74
- **关键约定**:
75
-
76
- - 始终使用 `min-width` 媒体查询(mobile-first),不用 `max-width`
77
- - Tailwind 前缀从小到大:`sm:` → `md:` → `lg:` → `xl:`
78
- - 不要在桌面端写默认样式然后用 `max-width` 覆盖移动端
79
-
80
- ## 触摸目标
81
-
82
- | 元素 | 最小尺寸 | 说明 |
83
- | ----------- | --------- | --------------------------- |
84
- | 按钮 | 44×44px | WCAG 2.2 触摸目标要求 |
85
- | 链接 | 44×44px | 可通过 padding 扩大点击区域 |
86
- | 表单输入 | 44px 高度 | 避免 iOS 自动缩放 |
87
- | 复选框/单选 | 24×24px | 最小可见尺寸 |
88
- | 关闭按钮 | 44×44px | 模态框、Toast 的关闭按钮 |
89
-
90
- ```css
91
- /* 扩大点击区域(视觉尺寸不变) */
92
- .icon-button {
93
- width: 24px;
94
- height: 24px;
95
- padding: 10px; /* 实际点击区域 44×44 */
96
- }
97
-
98
- /* 表单输入 — 避免 iOS 缩放 */
99
- input,
100
- select,
101
- textarea {
102
- font-size: 16px; /* < 16px 时 iOS Safari 会自动缩放页面 */
103
- }
104
- ```
105
-
106
- ## 布局模式
107
-
108
- ### Container Query
109
-
110
- 当组件会出现在侧栏、弹窗、卡片和主内容区等不同容器时,优先使用容器查询:
111
-
112
- ```css
113
- .summary-panel {
114
- container-type: inline-size;
115
- }
116
-
117
- @container (min-width: 42rem) {
118
- .summary-panel__body {
119
- display: grid;
120
- grid-template-columns: 16rem minmax(0, 1fr);
121
- }
122
- }
123
- ```
124
-
125
- Flex/Grid 子项包含长文本、图表、代码或表格时,记得设置 `min-width: 0`。
126
-
127
- ### Stack → Row
128
-
129
- 移动端纵向堆叠,桌面端横向排列:
130
-
131
- ```html
132
- <div class="flex flex-col md:flex-row gap-4">
133
- <div class="flex-1">主内容</div>
134
- <div class="md:w-64 md:flex-shrink-0">侧边栏</div>
135
- </div>
136
- ```
137
-
138
- ### 响应式表格
139
-
140
- ```html
141
- <!-- 小屏横向滚动 -->
142
- <div class="overflow-x-auto">
143
- <table class="min-w-full">
144
- ...
145
- </table>
146
- </div>
147
-
148
- <!-- 或:移动端卡片式布局 -->
149
- <div class="hidden md:block">
150
- <table>
151
- ...
152
- </table>
153
- </div>
154
- <div class="md:hidden">
155
- <!-- 每行变为卡片 -->
156
- </div>
157
- ```
158
-
159
- 移动端数据密集视图需先定义列优先级:主标识、状态和主操作优先保留;低优先级字段进入详情、展开行或抽屉。
160
-
161
- ### 响应式图片
162
-
163
- ```html
164
- <!-- srcset 按设备像素比加载 -->
165
- <img
166
- src="/img/hero-800.jpg"
167
- srcset="
168
- /img/hero-400.jpg 400w,
169
- /img/hero-800.jpg 800w,
170
- /img/hero-1200.jpg 1200w
171
- "
172
- sizes="(max-width: 768px) 100vw, 800px"
173
- alt="描述"
174
- loading="lazy"
175
- />
176
-
177
- <!-- picture 元素按断点切换 -->
178
- <picture>
179
- <source
180
- media="(min-width: 1024px)"
181
- srcset="/img/hero-desktop.webp"
182
- type="image/webp"
183
- />
184
- <source
185
- media="(min-width: 768px)"
186
- srcset="/img/hero-tablet.webp"
187
- type="image/webp"
188
- />
189
- <img src="/img/hero-mobile.webp" alt="描述" loading="lazy" />
190
- </picture>
191
- ```
192
-
193
- ## 移动端交互注意
194
-
195
- - **悬停不可靠**: 移动端无 hover 状态,不要将关键功能隐藏在 hover 中(如 tooltip 改为点击触发)
196
- - **键盘弹出**: 移动端虚拟键盘会缩小可视区域,固定定位元素需注意位置调整
197
- - **滚动性能**: 使用 `-webkit-overflow-scrolling: touch`(iOS)或 `overscroll-behavior` 优化滚动体验
198
- - **安全区域**: 适配 iPhone 刘海/底部横条,使用 `env(safe-area-inset-*)`:
199
-
200
- ```css
201
- .app-content {
202
- padding-top: env(safe-area-inset-top);
203
- padding-bottom: env(safe-area-inset-bottom);
204
- padding-left: env(safe-area-inset-left);
205
- padding-right: env(safe-area-inset-right);
206
- }
207
- ```
208
-
209
- ## 测试策略
210
-
211
- - 使用 Chrome DevTools Device Mode 测试主流设备
212
- - 优先在真实设备上测试(iOS Safari / Android Chrome)
213
- - 测试方向切换(横屏 / 竖屏)
214
- - 测试不同网络条件(3G / 4G / 弱网)
215
- - 不要假设桌面端是"默认",移动端优先验证
216
-
217
- ## 检查清单
218
-
219
- - [ ] 375px 宽度下布局正常,无水平溢出
220
- - [ ] 所有交互元素 ≥ 44×44px(触摸目标)
221
- - [ ] 输入框 font-size ≥ 16px(避免 iOS 缩放)
222
- - [ ] 无 hover 依赖的关键功能
223
- - [ ] 图片使用 srcset / picture 按设备加载
224
- - [ ] iPhone 安全区域适配(safe-area-inset)
225
- - [ ] 内容在断点间平滑过渡,无突变
226
- - [ ] 断点中间值、横竖屏切换和虚拟键盘弹出不遮挡主操作
227
- - [ ] 数据密集区域有列优先级或局部滚动策略
45
+ - [ ] 320-375px No horizontal overflow at page level.
46
+ - [ ] The reading order is reasonable after breakpoint switching, and the main operation is not hidden.
47
+ - [ ] Touch target, input font size, safe area, virtual keyboard and horizontal and vertical screen behaviors have been verified.
48
+ - [ ] loading, empty, error, disabled, hover/focus, long translation text and large numbers will not break the fixed format control.
49
+ - [ ] Column priority, partial scrolling, or mobile summary strategies for data-intensive areas.
50
+ - [ ] The size of first-screen media is stable, and non-first-screen media will not slow down the main path of the mobile terminal.
@@ -1,31 +1,31 @@
1
- # 来源驱动开发规则
1
+ # Source-driven development rules
2
2
 
3
- 当实现依赖框架、库、浏览器、运行时、构建工具或平台行为时,先确认事实来源,再写代码或评审结论。
3
+ When an implementation relies on a framework, library, browser, runtime, build tool, or platform behavior, confirm the source of truth before writing code or reviewing conclusions.
4
4
 
5
- ## 事实来源优先级
5
+ ## Fact source priority
6
6
 
7
- 1. 项目内 README、配置、测试、模板和已有实现。
8
- 2. 官方文档、源码、类型定义、release notes、migration guide。
9
- 3. Web 标准、浏览器兼容数据和平台文档。
10
- 4. Issue、讨论、博客和第三方文章仅作为线索。
7
+ 1. README, configuration, testing, templates and existing implementations within the project.
8
+ 2. Official documents, source code, type definitions, release notes, migration guide.
9
+ 3. Web standards, browser compatibility data, and platform documentation.
10
+ 4. Issues, discussions, blogs and third-party articles are only used as clues.
11
11
 
12
- ## 使用场景
12
+ ## Usage scenarios
13
13
 
14
- - 框架新版本、路由、渲染模式、缓存、构建配置、浏览器 API。
15
- - 公共接口、组件 API、设计系统 token、CLI 命令和插件元数据。
16
- - 依赖升级、迁移、废弃 API 替换、跨运行时兼容。
17
- - 与安全、性能、可访问性相关的版本敏感判断。
14
+ - New versions of frameworks, routing, rendering modes, caching, build configurations, browser APIs.
15
+ - Public interfaces, component APIs, design system tokens, CLI commands, and plugin metadata.
16
+ - Dependency upgrade, migration, obsolete API replacement, cross-runtime compatibility.
17
+ - Version-sensitive judgments related to security, performance, and accessibility.
18
18
 
19
- ## 输出要求
19
+ ## Output requirements
20
20
 
21
- - 写清来源、版本或项目事实、决策结论、影响范围和验证方式。
22
- - 若项目现状与官方推荐冲突,说明冲突原因和渐进迁移策略。
23
- - 不复制长篇外部文档;只保留必要结论、链接或项目内文件路径。
24
- - 无法验证时标注不确定性和需要用户/团队确认的事项。
21
+ - Write down the source, version or project facts, decision conclusion, scope of influence and verification method.
22
+ - If the current status of the project conflicts with official recommendations, explain the cause of the conflict and the gradual migration strategy.
23
+ - Do not copy long external documents; only keep necessary conclusions, links or file paths within the project.
24
+ - Mark uncertainties and matters requiring confirmation from the user/team when they cannot be verified.
25
25
 
26
- ## 反模式
26
+ ## Anti-pattern
27
27
 
28
- - 凭记忆使用版本敏感 API。
29
- - 用过时教程替代官方文档。
30
- - 为追新推翻稳定项目约定。
31
- - 在组件里散落外部库行为假设,而不是集中到适配层。
28
+ - Use version-sensitive APIs from memory.
29
+ - Replace official documentation with outdated tutorials.
30
+ - Overturn the stable project agreement in order to pursue new projects.
31
+ - Scatter external library behavior assumptions throughout components instead of centralizing them in the adaptation layer.
@@ -1,163 +1,60 @@
1
- # 状态管理规范
1
+ # Status management specifications
2
2
 
3
- ## 状态分类
3
+ This document stipulates that the front-end status belongs to the bottom line. State manifests, Store shape examples, URL states, persistence adapters, and SSR isolation details are left to `fec-state-management`; request caching details are left to the data fetch workflow; and form fields and validation are left to the form workflow.
4
4
 
5
- | 类型 | 示例 | 存放位置 |
6
- | ------------ | -------------------------------- | ------------------- |
7
- | 组件 UI 状态 | modal 开关、tab 索引、hover 状态 | 组件内 state |
8
- | 表单状态 | 输入值、校验错误 | 表单库或组件 state |
9
- | 服务端数据 | 用户列表、订单详情 | 数据请求库缓存 |
10
- | 全局业务状态 | 当前用户、权限、主题 | 全局 Store |
11
- | URL 状态 | 当前页码、筛选条件、排序 | 路由参数 / 搜索参数 |
5
+ ## Status classification
12
6
 
13
- ## 核心原则
7
+ | Type | Example | Default Attribution |
8
+ | ---- | ---- | -------- |
9
+ | Local UI state | modal switch, tab, expand row, hover editing state | In-component state / ref |
10
+ | Form status | Input value, dirty field, validation error, submitting | Form library or form component |
11
+ | Server status | List, details, paging results, remote errors | Request cache library |
12
+ | URL status | Search terms, filter, sort, page number, selected tab | Routing parameters / search params |
13
+ | Global client status | Login users, topics, permission snapshots, shopping cart drafts | Global store |
14
+ | Browser persistent state | Preferences, non-sensitive drafts, offline queues | Storage layer + state adapter |
14
15
 
15
- - **就近管理**: 状态放在需要它的最近公共祖先
16
- - **单一数据源**: 同一份数据只在一个地方维护
17
- - **派生优于同步**: 可计算的值用 computed / useMemo,而不是手动同步多个 state
18
- - **最小状态**: 不存储可以从已有状态推导的值
16
+ ## Core Principles
19
17
 
20
- ## React 状态管理
18
+ - **Own first, choose library later**: Don’t choose Redux, Zustand, Pinia or Context first; determine the unique owner of each state first.
19
+ - **Nearest Management**: The state is placed in the nearest common ancestor that needs it.
20
+ - **Single Data Source**: The same data is maintained in only one place.
21
+ - **Derivation is better than synchronization**: Values that can be derived from props, server state, URL or existing state, do not save a new copy.
22
+ - **Minimum global state**: The global store only saves client state that is truly cross-page, cross-feature, or requires unified action.
21
23
 
22
- ### 本地状态
24
+ ## React state boundaries
23
25
 
24
- ```tsx
25
- // 简单值 - useState
26
- const [count, setCount] = useState(0);
26
+ - Use `useState` / `useReducer` for single components or small subtrees.
27
+ - Low-frequency global configuration, theme or dependency injection can use Context; large objects that change frequently should not be placed in Context.
28
+ - For moderately complex business states, Zustand, Jotai or existing warehouse solutions can be used; for large and strict action flows, Redux Toolkit can be used.
29
+ - Server-side data uses the request cache library and is not copied to the global store.
27
30
 
28
- // 复杂逻辑 - useReducer
29
- const [state, dispatch] = useReducer(formReducer, initialState);
30
- ```
31
+ ## Vue state boundary
31
32
 
32
- ### 全局状态(Zustand 示例)
33
+ - Use `ref` / `reactive` / `computed` for local state.
34
+ - Use `provide/inject` for local cross-level context.
35
+ - Global business status uses Pinia or the existing store of the project.
36
+ - Server-side data is first managed using the request library or composable and is not written to Pinia intact.
33
37
 
34
- <!-- 请根据项目实际选型调整:Redux Toolkit / Zustand / Jotai -->
38
+ ## URL and persistent state
35
39
 
36
- ```tsx
37
- const useAuthStore = create<AuthState>((set) => ({
38
- user: null,
39
- login: async (credentials) => {
40
- const user = await authApi.login(credentials);
41
- set({ user });
42
- },
43
- logout: () => set({ user: null }),
44
- }));
45
- ```
40
+ - When searching, filtering, sorting, paging, selecting tabs, etc., the view state that needs to be shared or refreshed should be given priority to the URL.
41
+ - Browser persistence only saves stable preferences or non-sensitive drafts, and clearly identifies field whitelists, version numbers, migration paths, expiration policies, and sensitive field exclusions.
42
+ - In SSR scenarios, do not create a single instance store with user data at the top level of the module; each request requires an independent instance.
46
43
 
47
- ### 服务端状态
44
+ ## Anti-pattern
48
45
 
49
- <!-- 请根据项目实际选型调整:React Query / SWR -->
46
+ - Put all state into global store.
47
+ - Store UI temporary state or each field of the form in the store.
48
+ - Manually synchronize multiple copies of the same data instead of deriving from source state.
49
+ - Store the server response intact in the global store without requesting the cache library.
50
+ - Use Context / provide to carry large objects that change frequently, resulting in large-scale re-rendering.
51
+ - Persistent tokens, permission details, personal sensitive data or unversioned large objects.
50
52
 
51
- ```tsx
52
- const { data, isLoading, error } = useQuery({
53
- queryKey: ["users", params],
54
- queryFn: () => fetchUsers(params),
55
- staleTime: 5 * 60 * 1000,
56
- });
57
- ```
53
+ ## Checklist
58
54
 
59
- ## Vue 状态管理
60
-
61
- ### 本地状态
62
-
63
- ```typescript
64
- const count = ref(0);
65
- const form = reactive({ name: "", email: "" });
66
- ```
67
-
68
- ### 全局状态(Pinia)
69
-
70
- ```typescript
71
- export const useAuthStore = defineStore("auth", () => {
72
- const user = ref<User | null>(null);
73
-
74
- async function login(credentials: LoginParams) {
75
- user.value = await authApi.login(credentials);
76
- }
77
-
78
- function logout() {
79
- user.value = null;
80
- }
81
-
82
- const isLoggedIn = computed(() => user.value !== null);
83
-
84
- return { user: readonly(user), isLoggedIn, login, logout };
85
- });
86
- ```
87
-
88
- ### 服务端状态
89
-
90
- <!-- 请根据项目实际选型调整:VueQuery / 自定义 composable -->
91
-
92
- ```typescript
93
- const { data, isLoading, error } = useQuery({
94
- queryKey: ["users", params],
95
- queryFn: () => fetchUsers(toValue(params)),
96
- });
97
- ```
98
-
99
- ## 选型决策矩阵
100
-
101
- ### React 全局状态管理选型
102
-
103
- | 维度 | Context API | Zustand | Redux Toolkit | Jotai |
104
- | -------------- | -------------------------------------- | -------------------------------------- | ------------------------------- | ------------------- |
105
- | **适用场景** | 全局常量(主题、语言、用户信息) | 复杂业务状态(购物车、Dashboard 筛选) | 大型应用,需要严格的状态流控制 | 细粒度原子状态 |
106
- | **重渲染性能** | ❌ 任何 value 变化导致所有消费者重渲染 | ✅ 通过 selector 精确订阅 | ✅ connect/useSelector 精确订阅 | ✅ 原子级订阅 |
107
- | **样板代码** | 少(Provider + createContext) | 极少(一个 create 调用) | 多(slice / action / selector) | 极少(atom) |
108
- | **DevTools** | ❌ 无 | ✅ Redux DevTools(中间件) | ✅ Redux DevTools | ✅ 专用 DevTools |
109
- | **TypeScript** | ⚠️ 需手动类型标注 | ✅ 自动推导 | ✅ 自动推导 | ✅ 自动推导 |
110
- | **中间件** | ❌ | ✅(persist / devtools / immer) | ✅(thunk / listener) | ✅ |
111
- | **Provider** | ✅ 必须包裹 | ❌ 不需要(外部 store) | ✅ Provider | ❌(可选 Provider) |
112
-
113
- **推荐决策流程**:
114
-
115
- ```
116
- 状态是否跨组件共享?
117
- ├── 否 → useState / useReducer(本地状态)
118
- └── 是
119
- ├── 值是否几乎不变?(主题、语言、配置)
120
- │ └── 是 → Context API
121
- │
122
- ├── 是否需要严格状态流 + 时间旅行调试?
123
- │ └── 是 → Redux Toolkit
124
- │
125
- ├── 状态是否高度关联、需要集中管理?
126
- │ └── 是 → Zustand
127
- │
128
- └── 状态是否独立、需要细粒度订阅?
129
- └── 是 → Jotai
130
- ```
131
-
132
- ### Vue 全局状态管理选型
133
-
134
- | 维度 | provide/inject | Pinia |
135
- | -------------- | ---------------------------------- | ---------------- |
136
- | **适用场景** | 局部跨层级传递(主题、表单上下文) | 全局业务状态 |
137
- | **响应式** | ✅(传入 reactive/ref) | ✅ |
138
- | **DevTools** | ❌ | ✅ Vue DevTools |
139
- | **TypeScript** | ⚠️ 需 InjectionKey | ✅ 自动推导 |
140
- | **SSR 安全** | ⚠️ 需注意作用域 | ✅ 内置 SSR 支持 |
141
-
142
- **Vue 选型结论**:Pinia 是 Vue 3 官方推荐,新项目直接使用。provide/inject 仅用于局部上下文传递。
143
-
144
- ---
145
-
146
- ## 反模式
147
-
148
- - 将所有状态都放进全局 store(应优先本地状态)
149
- - 在 store 中存放 UI 临时状态(modal 开关、表单输入等)
150
- - 手动同步多份相同数据而不是用计算属性
151
- - 在组件中直接修改 store 的内部数据(应通过 action / mutation)
152
- - 将服务端响应原封不动存入全局 store 而不用请求缓存库
153
- - 过度使用 Context / provide 替代 props 传递
154
- - 用 Context 管理频繁更新的状态(导致全量消费者重渲染,应改用 Zustand/Pinia)
155
-
156
- ## 检查清单
157
-
158
- - [ ] 每个状态都有明确的归属(本地 / 全局 / URL / 服务端缓存)
159
- - [ ] 可派生的值没有被存为独立 state
160
- - [ ] 全局 store 仅包含真正需要跨组件共享的数据
161
- - [ ] 服务端数据通过请求库管理,而非手动存入 store
162
- - [ ] URL 状态(搜索、分页、筛选)与路由参数同步
163
- - [ ] Context 仅用于低频变更的全局值(主题、语言、用户信息)
55
+ - [ ] Each state has a clear ownership: local / form / server cache / URL / global store / browser persistence.
56
+ - [ ] Derivable values are not stored as independent state.
57
+ - [ ] The global store only contains data that is truly shared across boundaries.
58
+ - [ ] Server-side data is managed through the request library, and refreshes, rollbacks, permission changes, and error states can still be recovered.
59
+ - [ ] URL state is synchronized with route parameters, and refresh and share behavior is as expected.
60
+ - [ ] Persistence status has whitelist, version, migration and sensitive field exclusions.