@bovinphang/frontend-craft 2.7.0 → 2.9.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 (502) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +378 -305
  4. package/CHANGELOG.zh-CN.md +377 -304
  5. package/CONTRIBUTING.md +371 -361
  6. package/CONTRIBUTING.zh-CN.md +371 -361
  7. package/README.md +545 -493
  8. package/README.openclaw.md +359 -264
  9. package/README.openclaw.zh-CN.md +359 -264
  10. package/README.zh-CN.md +545 -493
  11. package/agents/fec-architect.md +70 -70
  12. package/agents/fec-code-reviewer.md +103 -82
  13. package/agents/fec-debugger.md +20 -20
  14. package/agents/fec-design-token-mapper.md +36 -36
  15. package/agents/fec-doc-updater.md +13 -13
  16. package/agents/fec-e2e-runner.md +45 -45
  17. package/agents/fec-figma-implementer.md +59 -59
  18. package/agents/fec-performance-optimizer.md +128 -128
  19. package/agents/fec-refactor-cleaner.md +17 -14
  20. package/agents/fec-refactoring-expert.md +81 -0
  21. package/agents/fec-security-reviewer.md +82 -67
  22. package/agents/fec-test-planner.md +27 -27
  23. package/agents/fec-typescript-reviewer.md +103 -87
  24. package/agents/fec-ui-checker.md +64 -64
  25. package/commands/fec-debug.md +19 -19
  26. package/commands/fec-doc-sync.md +11 -11
  27. package/commands/fec-init.md +37 -38
  28. package/commands/fec-plan.md +58 -58
  29. package/commands/fec-refactor-clean.md +11 -11
  30. package/commands/fec-refactor-plan.md +17 -0
  31. package/commands/fec-refactor.md +18 -0
  32. package/commands/fec-review.md +71 -41
  33. package/commands/fec-scaffold.md +41 -41
  34. package/commands/fec-smell.md +17 -0
  35. package/commands/fec-tdd.md +17 -13
  36. package/dist/bin/frontend-craft.js +190 -36
  37. package/dist/hooks/fec-run-tests.js +5 -1
  38. package/dist/hooks/fec-session-start.js +1 -1
  39. package/docs/example-prompts.md +157 -137
  40. package/docs/ja-JP/README.md +534 -493
  41. package/docs/ko-KR/README.md +534 -493
  42. package/docs/project-structure.md +151 -123
  43. package/docs/refactoring/README.md +50 -0
  44. package/docs/refactoring/catalog.md +105 -0
  45. package/docs/refactoring/smell-refactoring-matrix.md +41 -0
  46. package/docs/review-and-diagram-workflows.md +39 -0
  47. package/docs/runtimes/antigravity.md +18 -10
  48. package/docs/runtimes/augment.md +18 -10
  49. package/docs/runtimes/claude.md +191 -177
  50. package/docs/runtimes/claude.zh-CN.md +189 -175
  51. package/docs/runtimes/cline.md +18 -10
  52. package/docs/runtimes/codebuddy.md +18 -10
  53. package/docs/runtimes/codex.md +18 -10
  54. package/docs/runtimes/compatibility.md +27 -0
  55. package/docs/runtimes/copilot.md +18 -10
  56. package/docs/runtimes/cursor.md +18 -10
  57. package/docs/runtimes/gemini.md +18 -10
  58. package/docs/runtimes/kilo.md +18 -10
  59. package/docs/runtimes/openclaw.md +18 -10
  60. package/docs/runtimes/opencode.md +18 -10
  61. package/docs/runtimes/qoder.md +18 -19
  62. package/docs/runtimes/trae.md +18 -10
  63. package/docs/runtimes/windsurf.md +18 -10
  64. package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
  65. package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
  66. package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
  67. package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
  68. package/docs/zh-CN/example-prompts.md +157 -137
  69. package/docs/zh-CN/project-structure.md +148 -123
  70. package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
  71. package/docs/zh-TW/README.md +534 -493
  72. package/localized/zh-CN/agents/fec-architect.md +125 -0
  73. package/localized/zh-CN/agents/fec-code-reviewer.md +171 -0
  74. package/localized/zh-CN/agents/fec-debugger.md +44 -0
  75. package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
  76. package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
  77. package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
  78. package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
  79. package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
  80. package/localized/zh-CN/agents/fec-refactor-cleaner.md +35 -0
  81. package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
  82. package/localized/zh-CN/agents/fec-security-reviewer.md +132 -0
  83. package/localized/zh-CN/agents/fec-test-planner.md +50 -0
  84. package/localized/zh-CN/agents/fec-typescript-reviewer.md +158 -0
  85. package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
  86. package/localized/zh-CN/commands/fec-debug.md +30 -0
  87. package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
  88. package/localized/zh-CN/commands/fec-init.md +70 -0
  89. package/localized/zh-CN/commands/fec-plan.md +94 -0
  90. package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
  91. package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
  92. package/localized/zh-CN/commands/fec-refactor.md +14 -0
  93. package/localized/zh-CN/commands/fec-review.md +97 -0
  94. package/localized/zh-CN/commands/fec-scaffold.md +205 -0
  95. package/localized/zh-CN/commands/fec-smell.md +13 -0
  96. package/localized/zh-CN/commands/fec-tdd.md +25 -0
  97. package/localized/zh-CN/skills/TEMPLATE.md +155 -0
  98. package/localized/zh-CN/skills/eval_queries.json +1257 -0
  99. package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
  100. package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
  101. package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  102. package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
  103. package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
  104. package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
  105. package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
  106. package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
  107. package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
  108. package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
  109. package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
  110. package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  111. package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
  112. package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  113. package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
  114. package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  115. package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  116. package/localized/zh-CN/skills/fec-code-review/SKILL.md +162 -0
  117. package/localized/zh-CN/skills/fec-code-review/references/report-template.md +39 -0
  118. package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
  119. package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
  120. package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
  121. package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
  122. package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
  123. package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
  124. package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
  125. package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
  126. package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
  127. package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
  128. package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  129. package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
  130. package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
  131. package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  132. package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  133. package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  134. package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
  135. package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
  136. package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  137. package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
  138. package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  139. package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
  140. package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  141. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
  142. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  143. package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  144. package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  145. package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  146. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  147. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  148. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  149. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  150. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  151. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  152. package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
  153. package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  154. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  155. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  156. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  157. package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
  158. package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
  159. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  160. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  161. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  162. package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  163. package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
  164. package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
  165. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +110 -0
  166. package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  167. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
  168. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
  169. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
  170. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
  171. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
  172. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
  173. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
  174. package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
  175. package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +81 -0
  176. package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
  177. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +37 -0
  178. package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
  179. package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
  180. package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
  181. package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  182. package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
  183. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +462 -0
  184. package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
  185. package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
  186. package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  187. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
  188. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  189. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  190. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  191. package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
  192. package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  193. package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
  194. package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
  195. package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  196. package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
  197. package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  198. package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
  199. package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  200. package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
  201. package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  202. package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
  203. package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
  204. package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  205. package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  206. package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
  207. package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  208. package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  209. package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  210. package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  211. package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +54 -0
  212. package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
  213. package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
  214. package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
  215. package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
  216. package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
  217. package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
  218. package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
  219. package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
  220. package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
  221. package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
  222. package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
  223. package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
  224. package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
  225. package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
  226. package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
  227. package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
  228. package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
  229. package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
  230. package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
  231. package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
  232. package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
  233. package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
  234. package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
  235. package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
  236. package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
  237. package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
  238. package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
  239. package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
  240. package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
  241. package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
  242. package/localized/zh-CN/skills/fec-security-review/SKILL.md +54 -0
  243. package/localized/zh-CN/skills/fec-security-review/references/report-template.md +37 -0
  244. package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
  245. package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
  246. package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
  247. package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
  248. package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
  249. package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  250. package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
  251. package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
  252. package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
  253. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +55 -0
  254. package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
  255. package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
  256. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
  257. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
  258. package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
  259. package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
  260. package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
  261. package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
  262. package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
  263. package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
  264. package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  265. package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
  266. package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
  267. package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
  268. package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
  269. package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
  270. package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
  271. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
  272. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  273. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
  274. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  275. package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
  276. package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  277. package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  278. package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  279. package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  280. package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  281. package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  282. package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
  283. package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
  284. package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
  285. package/localized/zh-CN/skills/metadata.json +2004 -0
  286. package/localized/zh-CN/skills/relations.json +1023 -0
  287. package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
  288. package/localized/zh-CN/templates/claude/settings.json +62 -0
  289. package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
  290. package/localized/zh-CN/templates/codex/config.toml +32 -0
  291. package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
  292. package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  293. package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +55 -0
  294. package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
  295. package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
  296. package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
  297. package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
  298. package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
  299. package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
  300. package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
  301. package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
  302. package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
  303. package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
  304. package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
  305. package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
  306. package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
  307. package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
  308. package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
  309. package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
  310. package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
  311. package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
  312. package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
  313. package/openclaw.plugin.json +2 -3
  314. package/package.json +28 -17
  315. package/skills/TEMPLATE.md +74 -74
  316. package/skills/eval_queries.json +922 -678
  317. package/skills/fec-accessibility-check/SKILL.md +21 -21
  318. package/skills/fec-accessibility-check/references/report-template.md +12 -12
  319. package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
  320. package/skills/fec-alchemy/SKILL.md +50 -50
  321. package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
  322. package/skills/fec-alchemy/assets/intake-template.md +55 -55
  323. package/skills/fec-alchemy/assets/review-checklist.md +23 -23
  324. package/skills/fec-alchemy/references/methodology.md +66 -66
  325. package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
  326. package/skills/fec-api-integration/SKILL.md +61 -61
  327. package/skills/fec-api-integration/references/integration-patterns.md +30 -30
  328. package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
  329. package/skills/fec-browser-storage/SKILL.md +16 -16
  330. package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
  331. package/skills/fec-canvas-threejs/SKILL.md +21 -21
  332. package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
  333. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
  334. package/skills/fec-code-review/SKILL.md +113 -94
  335. package/skills/fec-code-review/references/report-template.md +23 -13
  336. package/skills/fec-code-smells/SKILL.md +33 -0
  337. package/skills/fec-code-smells/references/detection-guide.md +25 -0
  338. package/skills/fec-code-smells/references/smell-catalog.md +861 -0
  339. package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
  340. package/skills/fec-component-testing/SKILL.md +39 -39
  341. package/skills/fec-data-fetching/SKILL.md +16 -16
  342. package/skills/fec-data-fetching/references/query-patterns.md +27 -27
  343. package/skills/fec-debug-framework/SKILL.md +95 -95
  344. package/skills/fec-debug-framework/references/report-template.md +34 -34
  345. package/skills/fec-dependency-upgrade/SKILL.md +17 -17
  346. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
  347. package/skills/fec-doc-sync/SKILL.md +23 -23
  348. package/skills/fec-drawio-studio/SKILL.md +42 -38
  349. package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
  350. package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  351. package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
  352. package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  353. package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
  354. package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
  355. package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
  356. package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  357. package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
  358. package/skills/fec-e2e-testing/SKILL.md +24 -24
  359. package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
  360. package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
  361. package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
  362. package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
  363. package/skills/fec-form-handling/SKILL.md +21 -21
  364. package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
  365. package/skills/fec-image-generation/SKILL.md +84 -29
  366. package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  367. package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
  368. package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
  369. package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
  370. package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
  371. package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
  372. package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
  373. package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
  374. package/skills/fec-image-generation/references/diagram-workflows.md +41 -3
  375. package/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
  376. package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
  377. package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
  378. package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
  379. package/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
  380. package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  381. package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
  382. package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
  383. package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
  384. package/skills/fec-implement-from-design/SKILL.md +81 -81
  385. package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
  386. package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
  387. package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
  388. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
  389. package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
  390. package/skills/fec-legacy-web-standard/SKILL.md +17 -17
  391. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
  392. package/skills/fec-list-virtualization/SKILL.md +16 -16
  393. package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
  394. package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
  395. package/skills/fec-motion-interaction/SKILL.md +51 -51
  396. package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
  397. package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
  398. package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
  399. package/skills/fec-performance-optimization/SKILL.md +54 -54
  400. package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
  401. package/skills/fec-performance-optimization/references/report-template.md +31 -31
  402. package/skills/fec-pwa-implementation/SKILL.md +17 -17
  403. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
  404. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
  405. package/skills/fec-react-project-standard/SKILL.md +72 -72
  406. package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
  407. package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
  408. package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
  409. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
  410. package/skills/fec-refactor-clean/SKILL.md +33 -30
  411. package/skills/fec-refactor-clean/references/report-template.md +23 -23
  412. package/skills/fec-refactoring/SKILL.md +83 -0
  413. package/skills/fec-refactoring/references/principles.md +60 -0
  414. package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
  415. package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
  416. package/skills/fec-refactoring/references/workflow.md +90 -0
  417. package/skills/fec-refactoring-api/SKILL.md +25 -0
  418. package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
  419. package/skills/fec-refactoring-catalog/SKILL.md +28 -0
  420. package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
  421. package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
  422. package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
  423. package/skills/fec-refactoring-control/SKILL.md +25 -0
  424. package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
  425. package/skills/fec-refactoring-data/SKILL.md +25 -0
  426. package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
  427. package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
  428. package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
  429. package/skills/fec-refactoring-functions/SKILL.md +25 -0
  430. package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
  431. package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
  432. package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
  433. package/skills/fec-refactoring-move-features/SKILL.md +25 -0
  434. package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
  435. package/skills/fec-refactoring-validation/SKILL.md +59 -0
  436. package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
  437. package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
  438. package/skills/fec-responsive-layout/SKILL.md +17 -17
  439. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
  440. package/skills/fec-route-protection/SKILL.md +26 -26
  441. package/skills/fec-security-review/SKILL.md +36 -20
  442. package/skills/fec-security-review/references/report-template.md +22 -12
  443. package/skills/fec-security-review/references/security-checklist.md +27 -27
  444. package/skills/fec-source-driven-development/SKILL.md +59 -59
  445. package/skills/fec-state-management/SKILL.md +34 -34
  446. package/skills/fec-state-management/references/state-patterns.md +19 -19
  447. package/skills/fec-storybook-component-doc/SKILL.md +19 -19
  448. package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
  449. package/skills/fec-svg-animation/SKILL.md +32 -32
  450. package/skills/fec-tailwind-design-system/SKILL.md +17 -17
  451. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
  452. package/skills/fec-tdd-workflow/SKILL.md +32 -28
  453. package/skills/fec-testing-strategy/SKILL.md +29 -29
  454. package/skills/fec-typescript-project-standard/SKILL.md +38 -38
  455. package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
  456. package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
  457. package/skills/fec-ui-design/SKILL.md +90 -90
  458. package/skills/fec-ui-design/references/design-intelligence.md +61 -61
  459. package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
  460. package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
  461. package/skills/fec-validation-fix/SKILL.md +26 -26
  462. package/skills/fec-validation-fix/references/report-template.md +25 -25
  463. package/skills/fec-vite-project-standard/SKILL.md +39 -39
  464. package/skills/fec-vue3-project-standard/SKILL.md +38 -38
  465. package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
  466. package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
  467. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
  468. package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
  469. package/skills/fec-web-video-presentation/SKILL.md +33 -33
  470. package/skills/fec-web-workers/SKILL.md +16 -16
  471. package/skills/fec-web-workers/references/advanced-workers.md +13 -13
  472. package/skills/fec-web-workers/references/basic-worker.md +8 -8
  473. package/skills/metadata.json +485 -116
  474. package/skills/relations.json +268 -0
  475. package/templates/claude/CLAUDE.md +60 -60
  476. package/templates/codex/AGENTS.md +76 -76
  477. package/templates/codex/config.toml +4 -4
  478. package/templates/openclaw/AGENTS.md +68 -68
  479. package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
  480. package/templates/shared/rules/fec-agent-workflow.md +41 -40
  481. package/templates/shared/rules/fec-api-layer.md +52 -52
  482. package/templates/shared/rules/fec-ci-cd.md +29 -29
  483. package/templates/shared/rules/fec-code-comments.md +22 -22
  484. package/templates/shared/rules/fec-design-system.md +53 -53
  485. package/templates/shared/rules/fec-error-handling.md +40 -40
  486. package/templates/shared/rules/fec-git-conventions.md +42 -42
  487. package/templates/shared/rules/fec-i18n.md +48 -48
  488. package/templates/shared/rules/fec-naming-conventions.md +91 -91
  489. package/templates/shared/rules/fec-performance.md +78 -78
  490. package/templates/shared/rules/fec-react.md +58 -58
  491. package/templates/shared/rules/fec-refactoring.md +34 -34
  492. package/templates/shared/rules/fec-rendering-patterns.md +36 -36
  493. package/templates/shared/rules/fec-responsive-design.md +37 -37
  494. package/templates/shared/rules/fec-source-driven-development.md +22 -22
  495. package/templates/shared/rules/fec-state-management.md +56 -56
  496. package/templates/shared/rules/fec-testing.md +64 -64
  497. package/templates/shared/rules/fec-typescript.md +75 -75
  498. package/templates/shared/rules/fec-vue.md +42 -42
  499. package/templates/shared/rules/fec-working-modes.md +34 -34
  500. package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
  501. package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
  502. package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
@@ -1,28 +1,28 @@
1
1
  ---
2
2
  name: fec-state-management
3
- description: Use when choosing, implementing, reviewing, or refactoring frontend state ownership across React, Vue, Next.js, Nuxt, URL state, server state, form state, browser persistence, or global stores. Prefer narrower skills for TanStack Query cache details, browser storage persistence, or form validation internals; Chinese triggers include 状态管理, 状态归属, store 选型.
3
+ description: Use when choosing, implementing, reviewing, or refactoring frontend state ownership across React, Vue, Next.js, Nuxt, URL state, server state, form state, browser persistence, or global stores. Prefer narrower skills for TanStack Query cache details, browser storage persistence, or form validation internals; Chinese triggers include state management, state ownership, store selection.
4
4
  ---
5
5
 
6
- # 前端状态管理
6
+ # Front-end status management
7
7
 
8
8
  ## Purpose
9
9
 
10
- 为前端状态确定清晰归属,避免全局 store 膨胀、重复缓存和派生状态同步错误。
10
+ Determine clear ownership of front-end state to avoid global store bloat, duplicate caching, and derived state synchronization errors.
11
11
 
12
12
  ## Procedure
13
13
 
14
- ### 1. 先分类状态来源
14
+ ### 1. Classify status sources first
15
15
 
16
- 不要先选 Redux、Zustand、Pinia 或 Context。先把每个状态标到唯一归属,再决定工具。
16
+ Don't choose Redux, Zustand, Pinia or Context first. First mark each state to its unique owner, and then decide on the tool.
17
17
 
18
- | 状态类型 | 典型例子 | 默认归属 |
18
+ | Status Type | Typical Example | Default Attribution |
19
19
  | ---------------- | ------------------------------------ | ------------------------ |
20
- | 本地 UI 状态 | 弹窗开关、tab、展开行、hover 编辑态 | 组件内 state / ref |
21
- | 表单状态 | 输入值、脏字段、校验错误、提交中 | 表单库或表单组件 |
22
- | 服务端状态 | 列表、详情、分页结果、远程错误 | 请求缓存库 |
23
- | URL 状态 | 搜索词、筛选、排序、页码、选中 tab | 路由参数 / search params |
24
- | 全局客户端状态 | 登录用户、主题、权限快照、购物车草稿 | 全局 store |
25
- | 浏览器持久化状态 | 跨刷新保留的草稿、偏好、离线队列 | 存储层 + 状态适配器 |
20
+ | Local UI state | Pop-up window switch, tab, expand row, hover editing state | In-component state / ref |
21
+ | Form status | Input value, dirty field, validation error, submitting | Form library or form component |
22
+ | Server status | List, details, paging results, remote errors | Request cache library |
23
+ | URL status | Search terms, filter, sort, page number, selected tab | Routing parameters / search params |
24
+ | Global client status | Login users, topics, permission snapshots, shopping cart drafts | Global store |
25
+ | Browser persistent state | Drafts, preferences, offline queues retained across refreshes | Storage layer + state adapter |
26
26
 
27
27
  ```tsx
28
28
  type ReportsStateMap = {
@@ -34,9 +34,9 @@ type ReportsStateMap = {
34
34
  };
35
35
  ```
36
36
 
37
- ### 2. 保持最小状态
37
+ ### 2. Keep it minimal
38
38
 
39
- 可从 props、server state、URL 或已有 state 推导出来的值,不要另存一份。
39
+ Do not save a new copy of a value that can be inferred from props, server state, URL, or existing state.
40
40
 
41
41
  ```tsx
42
42
  interface Invoice {
@@ -51,9 +51,9 @@ function InvoiceList({ invoices }: { invoices: Invoice[] }) {
51
51
  }
52
52
  ```
53
53
 
54
- ### 3. 选择 React 全局状态方案
54
+ ### 3. Select the React global state solution
55
55
 
56
- React 中优先本地化和组合;只有跨页面、跨 feature 或需要统一动作时才引入全局 store。
56
+ Priority is given to localization and combination in React; the global store is only introduced when cross-page, cross-feature or unified actions are required.
57
57
 
58
58
  ```tsx
59
59
  import { create } from "zustand";
@@ -69,17 +69,17 @@ export const useWorkspaceStore = create<WorkspaceState>((set) => ({
69
69
  }));
70
70
  ```
71
71
 
72
- 决策顺序:
72
+ Decision order:
73
73
 
74
- 1. 只在一个组件或一个小子树使用:`useState` / `useReducer`。
75
- 2. 低频全局配置或依赖注入:Context。
76
- 3. 中等复杂业务状态:Zustand 或 Jotai,按仓库现有选型优先。
77
- 4. 大型应用、严格动作流、审计或时间旅行调试:Redux Toolkit。
78
- 5. 远程数据:使用数据获取 skill 管理 query key、缓存和失效策略。
74
+ 1. Use only in one component or a small subtree: `useState` / `useReducer`.
75
+ 2. Low-frequency global configuration or dependency injection: Context.
76
+ 3. Moderately complex business status: Zustand or Jotai, priority will be given based on the existing selection of the warehouse.
77
+ 4. Large applications, strict action flow, auditing or time travel debugging: Redux Toolkit.
78
+ 5. Remote data: Use the data acquisition skill to manage query keys, cache and invalidation policies.
79
79
 
80
- ### 4. 选择 Vue 全局状态方案
80
+ ### 4. Select Vue global state solution
81
81
 
82
- Vue 3 中,局部跨层级传递使用 `provide/inject`;全局业务状态使用 Pinia 或项目既有 store。
82
+ In Vue 3, use `provide/inject` for local cross-level transfer; use Pinia or the existing store of the project for global business status.
83
83
 
84
84
  ```ts
85
85
  import { computed, readonly, ref } from "vue";
@@ -101,9 +101,9 @@ export const useSessionStore = defineStore("session", () => {
101
101
  });
102
102
  ```
103
103
 
104
- ### 5. 明确状态边界和迁移步骤
104
+ ### 5. Clarify status boundaries and migration steps
105
105
 
106
- 重构状态时先做状态清单,再逐步移动读写入口。每一步都应保持行为可验证。
106
+ When reconstructing the state, first make a state list, and then gradually move the read and write entries. Each step should keep the behavior verifiable.
107
107
 
108
108
  ```ts
109
109
  interface StateMigrationItem {
@@ -123,18 +123,18 @@ const migrationPlan: StateMigrationItem[] = [
123
123
  ];
124
124
  ```
125
125
 
126
- ## 详细参考
126
+ ## Detailed reference
127
127
 
128
- 需要 Store 形状示例、选择器模式、URL 状态同步、持久化适配器、SSR 边界或审查清单时,加载 [references/state-patterns.md](references/state-patterns.md)。
128
+ Load [references/state-patterns.md](references/state-patterns.md) when you need Store shape examples, selector patterns, URL state synchronization, persistence adapters, SSR boundaries, or review checklists.
129
129
 
130
130
  ## Constraints
131
131
 
132
- - 不把服务端响应复制到全局 store;缓存、失效和重试归数据获取层。
133
- - 不把表单每个字段提升到全局 store;跨步骤共享也优先由表单上下文或提交草稿适配器处理。
134
- - 不用 Context 承载高频变化的大对象;会扩大重渲染范围。
135
- - 持久化状态必须明确字段白名单、版本号、过期策略和敏感数据排除。
136
- - SSR 场景不要在模块顶层创建带用户数据的单例 store。
132
+ - Do not copy the server response to the global store; caching, invalidation and retries belong to the data acquisition layer.
133
+ - Do not promote each field of the form to the global store; cross-step sharing is also handled first by the form context or submit draft adapter.
134
+ - No need to use Context to carry large objects that change frequently; it will expand the re-rendering range.
135
+ - Persistence state must specify field whitelist, version number, expiration policy and sensitive data exclusion.
136
+ - In SSR scenarios, do not create a singleton store with user data at the top level of the module.
137
137
 
138
138
  ## Expected Output
139
139
 
140
- 产出状态归属清单、选型理由、store/API 边界和验证步骤。实现时应保留 loading/error/empty、刷新、回退、跨路由和权限变化等关键行为。
140
+ Output status attribution list, selection reasons, store/API boundaries and verification steps. Key behaviors such as loading/error/empty, refresh, rollback, cross-routing, and permission changes should be retained during implementation.
@@ -1,15 +1,15 @@
1
- # 状态管理模式
1
+ #State management mode
2
2
 
3
- ## 所有权审查清单
3
+ ## Ownership Review Checklist
4
4
 
5
- - 每个状态字段有唯一归属:本地状态、表单状态、服务端缓存、URL 状态、全局 Store 或浏览器持久化。
6
- - 派生值由源状态计算得出,而不是通过 effect 或 watcher 手动同步。
7
- - URL 状态用于可分享、刷新后需保留的视图状态,如筛选、搜索、排序和分页。
8
- - 服务端数据保留在请求缓存中;全局 Store 仅存放选中的 ID、本地偏好或乐观更新提示。
9
- - 持久化的客户端状态需有白名单、schema 版本号、迁移路径和敏感字段排除规则。
10
- - Store 的 action 以领域事件命名,而非组件处理器命名。
5
+ - Each status field has a unique ownership: local status, form status, server-side cache, URL status, global Store or browser persistence.
6
+ - Derived values are calculated from the source state rather than manually synchronized via effects or watchers.
7
+ - URL state is used for view states that are shareable and need to be retained after refresh, such as filtering, searching, sorting, and paging.
8
+ - Server-side data is kept in the request cache; the global Store only stores selected IDs, local preferences, or optimistic update prompts.
9
+ - Persistent client state requires a whitelist, schema version number, migration path and sensitive field exclusion rules.
10
+ - Store actions are named after domain events, not component processors.
11
11
 
12
- ## React Store 形状示例
12
+ ## React Store shape example
13
13
 
14
14
  ```tsx
15
15
  import { create } from "zustand";
@@ -41,7 +41,7 @@ export const useCartStore = create<CartState>()(
41
41
  );
42
42
  ```
43
43
 
44
- 选择器应尽可能返回稳定的原始值或经过 memo 的切片:
44
+ Selectors should return stable raw values or memo-encoded slices whenever possible:
45
45
 
46
46
  ```tsx
47
47
  const itemCount = useCartStore((state) =>
@@ -49,9 +49,9 @@ const itemCount = useCartStore((state) =>
49
49
  );
50
50
  ```
51
51
 
52
- ## URL 状态边界
52
+ ## URL status boundaries
53
53
 
54
- 当另一个用户应能打开相同视图,或刷新后需要保留视图时,使用 URL 状态。
54
+ Use URL state when another user should be able to open the same view, or when the view needs to be preserved after a refresh.
55
55
 
56
56
  ```tsx
57
57
  import { useSearchParams } from "react-router-dom";
@@ -72,9 +72,9 @@ export function useReportFilters() {
72
72
  }
73
73
  ```
74
74
 
75
- ## 持久化适配器边界
75
+ ## Persistence adapter boundary
76
76
 
77
- 仅持久化稳定的客户端偏好设置或非敏感草稿。序列化逻辑放在组件外部。
77
+ Only persist stable client preferences or non-sensitive drafts. Serialization logic is placed outside the component.
78
78
 
79
79
  ```ts
80
80
  interface PersistedGridState {
@@ -101,9 +101,9 @@ export function writeGridState(state: PersistedGridState): void {
101
101
  }
102
102
  ```
103
103
 
104
- ## SSR 与请求隔离
104
+ ## SSR is isolated from requests
105
105
 
106
- - 当状态可能包含用户数据时,每次请求需创建独立的 Store。
107
- - 服务端渲染期间不要读取 `window`、`localStorage` 或 `document`。
108
- - 水合后再加载持久化偏好,并在水合前提供确定性默认值。
109
- - 服务端缓存脱水与纯客户端全局 Store 分开处理。
106
+ - When the state may contain user data, a separate Store needs to be created for each request.
107
+ - Do not read `window`, `localStorage` or `document` during server rendering.
108
+ - Reload persistence preferences after hydration and provide deterministic defaults before hydration.
109
+ - Server-side cache dehydration is handled separately from pure client-side global Store.
@@ -1,37 +1,37 @@
1
1
  ---
2
2
  name: fec-storybook-component-doc
3
- description: Use when setting up or reviewing Storybook component documentation, design-system presentation, isolated component state previews, stories, addons, decorators, MDX docs, component-state interaction checks, visual baselines, or Chromatic. For real-browser cross-page journeys or broader coverage planning, choose the matching testing workflow first; Chinese triggers include Storybook, 组件文档, Design System, 视觉回归.
3
+ description: Use when setting up or reviewing Storybook component documentation, design-system presentation, isolated component state previews, stories, addons, decorators, MDX docs, component-state interaction checks, visual baselines, or Chromatic. For real-browser cross-page journeys or broader coverage planning, choose the matching testing workflow first; Chinese triggers include Storybook, component documentation, Design System, visual regression.
4
4
  ---
5
5
 
6
- # Storybook 组件文档化
6
+ # Storybook component documentation
7
7
 
8
8
  ## Purpose
9
9
 
10
- 为 UI 组件建立文档化、设计系统展示和隔离状态预览环境;交互与视觉测试只覆盖 Storybook 场景内的组件状态。
10
+ Establish documentation, design system display and isolated state preview environment for UI components; interaction and visual testing only cover component states within the Storybook scene.
11
11
 
12
12
  ## Procedure
13
13
 
14
- 1. 初始化或识别现有 Storybook 配置,沿用项目框架适配器、stories glob、主题和构建命令。
15
- 2. 每个组件的 Story 覆盖默认态、主要变体、尺寸、语义 tone、disabled、loading、error、empty、selected、invalid 和关键边缘状态。
16
- 3. 依赖 Router、Store、i18n、ThemeProvider 的组件用 decorators 包裹,不在 Story 中复制应用入口。
17
- 4. 复杂组件用 MDX 补充使用说明、Props、slots/children、variant 矩阵、状态示例、可访问性要求和源码展示。
18
- 5. 需要自动化时接入 interaction tests、addon-a11y、Chromatic 或 Storybook Test Runner;这些能力服务于组件文档和设计系统展示,不承接跨页业务旅程。
19
- 6. 设计系统组件应记录 token 来源、Tailwind/class 变体、暗色模式、响应式尺寸和不支持的组合,避免消费者靠猜测拼装。
14
+ 1. Initialize or identify an existing Storybook configuration, inheriting the project framework adapter, stories globs, themes, and build commands.
15
+ 2. Each component's Story covers default state, main variant, size, semantic tone, disabled, loading, error, empty, selected, invalid and key edge states.
16
+ 3. Components that rely on Router, Store, i18n, and ThemeProvider are wrapped with decorators and do not copy the application entry in Story.
17
+ 4. Use MDX to supplement complex components with usage instructions, Props, slots/children, variant matrices, status examples, accessibility requirements and source code display.
18
+ 5. When automation is required, connect interaction tests, addon-a11y, Chromatic or Storybook Test Runner; these capabilities serve component documentation and design system display and do not undertake cross-page business journeys.
19
+ 6. Design system components should record token sources, Tailwind/class variants, dark modes, responsive sizes, and unsupported combinations to avoid consumers guessing at assembly.
20
20
 
21
- ## 详细参考
21
+ ## Detailed reference
22
22
 
23
- - 需要 `main.ts`、`preview.ts`、stories、decorators、MDX、交互测试和视觉回归示例时,加载 [references/story-patterns.md](references/story-patterns.md)。
23
+ - Load [references/story-patterns.md](references/story-patterns.md) when you need `main.ts`, `preview.ts`, stories, decorators, MDX, interaction tests and visual regression examples.
24
24
 
25
25
  ## Constraints
26
26
 
27
- - Story 需随组件 prop 变更同步更新。
28
- - Provider 依赖必须通过 decorator 补齐。
29
- - Storybook 构建产物 `storybook-static/` 不应提交到 Git。
30
- - Storybook 用于开发和组件文档,不替代生产页面 SEO。
31
- - Storybook 视觉基线用于组件状态;跨页面截图和真实路由流程分流到 E2E workflow。
32
- - 大型组件库需控制 stories glob 和 addon 开销。
33
- - 不用 Storybook 隐藏组件 API 问题;若变体组合爆炸,应先收敛组件职责或拆分组件。
27
+ - Story needs to be updated synchronously with component prop changes.
28
+ - Provider dependencies must be completed through decorators.
29
+ - Storybook build product `storybook-static/` should not be committed to Git.
30
+ - Storybook is used for development and component documentation and is not a replacement for production page SEO.
31
+ - Storybook visual baseline for component state; cross-page screenshots and real routing processes are offloaded to E2E workflow.
32
+ - Large component libraries need to control stories glob and addon overhead.
33
+ - Don’t use Storybook to hide component API issues; if variant combinations explode, you should first converge component responsibilities or split components.
34
34
 
35
35
  ## Expected Output
36
36
 
37
- 可交互的组件文档和设计系统展示站点,每个组件状态都有隔离预览,Props 表格可生成,关键 Storybook 场景有可选 play 测试或视觉回归基线。
37
+ Interactive component documentation and design system showcase site with isolated previews of each component state, Props tables to generate, and key Storybook scenes with optional play testing or visual regression baselines.
@@ -1,6 +1,6 @@
1
- # Storybook 配置与示例
1
+ # Storybook configuration and examples
2
2
 
3
- ## 初始化
3
+ ## Initialization
4
4
 
5
5
  ```bash
6
6
  npx storybook@latest init
@@ -75,22 +75,22 @@ import * as InputStories from "./Input.stories";
75
75
 
76
76
  <Meta of={InputStories} />
77
77
 
78
- # Input 输入框
78
+ #Input input box
79
79
 
80
- 用于用户文本输入,支持校验提示、前后缀图标、字数统计等。
80
+ Used for user text input, supporting verification prompts, suffix and suffix icons, word count, etc.
81
81
 
82
- ### 何时使用
82
+ ### When to use
83
83
 
84
- - 单行文本输入
85
- - 需要实时校验反馈的表单字段
84
+ - Single line text input
85
+ - Form fields that require real-time verification feedback
86
86
 
87
87
  <Canvas of={InputStories.Default} />
88
88
 
89
- ### 属性
89
+ ### Properties
90
90
 
91
91
  <Controls />
92
92
 
93
- ### 源码
93
+ ### Source code
94
94
 
95
95
  <Source of={InputStories.Default} />
96
96
  ```
@@ -103,9 +103,9 @@ import { expect, userEvent, within } from "@storybook/test";
103
103
  export const FormSubmission: Story = {
104
104
  play: async ({ canvasElement }) => {
105
105
  const canvas = within(canvasElement);
106
- await userEvent.type(canvas.getByLabelText("用户名"), "admin");
107
- await userEvent.click(canvas.getByRole("button", { name: /登录/ }));
108
- await expect(canvas.findByText("登录成功")).resolves.toBeInTheDocument();
106
+ await userEvent.type(canvas.getByLabelText("username"), "admin");
107
+ await userEvent.click(canvas.getByRole("button", { name: /login/ }));
108
+ await expect(canvas.findByText("Login successful")).resolves.toBeInTheDocument();
109
109
  },
110
110
  };
111
111
  ```
@@ -1,38 +1,38 @@
1
1
  ---
2
2
  name: fec-svg-animation
3
- description: Use when implementing or reviewing SVG animation, path drawing, icon motion, logo animation, illustration motion, micro-interactions, CSS/SMIL/Framer Motion/GSAP choices, motion accessibility, or fallback behavior; Chinese triggers include SVG 动画, 路径描边, 动效.
3
+ description: Use when implementing or reviewing SVG animation, path drawing, icon motion, logo animation, illustration motion, micro-interactions, CSS/SMIL/Framer Motion/GSAP choices, motion accessibility, or fallback behavior; Chinese triggers include SVG animation, path stroke, animation.
4
4
  ---
5
5
 
6
- # SVG 动画实现
6
+ # SVG animation implementation
7
7
 
8
8
  ## Purpose
9
9
 
10
- 为 SVG 图标、插画和数据可视化提供可维护、可访问、性能可控的动画方案。
10
+ Provide maintainable, accessible, and performance-controllable animation solutions for SVG icons, illustrations, and data visualizations.
11
11
 
12
12
  ## When to Use
13
13
 
14
- - 需要实现 SVG 图标、Logo、插画或路径描边动画。
15
- - 需要在 React/Vue 组件中接入 Framer Motion、GSAP 或 CSS 动画。
16
- - 需要根据 `prefers-reduced-motion` 提供动效降级。
17
- - 不用于复杂 3D/WebGL 场景;此类场景优先使用 Canvas / Three.js workflow。
14
+ - SVG icon, logo, illustration or path stroke animation needs to be implemented.
15
+ - Framer Motion, GSAP or CSS animation needs to be connected to React/Vue components.
16
+ - Need to provide motion reduction according to `prefers-reduced-motion`.
17
+ - Not used for complex 3D/WebGL scenes; for such scenes, Canvas / Three.js workflow is preferred.
18
18
 
19
19
  ## Procedure
20
20
 
21
- ### 1. 选择动画方式
21
+ ### 1. Select animation mode
22
22
 
23
- 按复杂度和运行时需求选型:
23
+ Choose based on complexity and runtime requirements:
24
24
 
25
- | 场景 | 推荐 |
25
+ | Scenario | Recommendation |
26
26
  | --- | --- |
27
27
  | hover/focus、opacity、transform | CSS animation/transition |
28
- | 路径描边、简单重复动效 | CSS + `stroke-dasharray` |
29
- | React 组件状态驱动动画 | Framer Motion |
30
- | 时间轴、复杂编排、滚动触发 | GSAP |
31
- | 需要保持零依赖的静态 SVG | CSS 或 SMIL |
28
+ | Path stroke, simple repeating animation | CSS + `stroke-dasharray` |
29
+ | React component state-driven animation | Framer Motion |
30
+ | Timeline, complex arrangement, scrolling trigger | GSAP |
31
+ | Need to keep static SVG with zero dependencies | CSS or SMIL |
32
32
 
33
- 如果动效跨越页面转场、滚动叙事或复杂组件编排,应先按交互动效 workflow 判断强度、懒加载和 reduced-motion 策略;本 skill 只负责 SVG 图形本身的路径、形变和图标 motion。
33
+ If the animation spans page transitions, scrolling narratives, or complex component arrangements, you should first judge the intensity, lazy loading, and reduced-motion strategies according to the interactive effects workflow; this skill is only responsible for the path, deformation, and icon motion of the SVG graphics themselves.
34
34
 
35
- ### 2. 使用 CSS 实现路径描边
35
+ ### 2. Use CSS to implement path strokes
36
36
 
37
37
  ```tsx
38
38
  export function CheckmarkIcon() {
@@ -73,7 +73,7 @@ export function CheckmarkIcon() {
73
73
  }
74
74
  ```
75
75
 
76
- ### 3. 在 React 中使用 Framer Motion
76
+ ### 3. Using Framer Motion in React
77
77
 
78
78
  ```tsx
79
79
  import { motion, useReducedMotion } from "framer-motion";
@@ -82,7 +82,7 @@ export function AnimatedSparkline({ path }: { path: string }) {
82
82
  const reduceMotion = useReducedMotion();
83
83
 
84
84
  return (
85
- <svg viewBox="0 0 120 40" role="img" aria-label="趋势图">
85
+ <svg viewBox="0 0 120 40" role="img" aria-label="Trend Chart">
86
86
  <motion.path
87
87
  d={path}
88
88
  fill="none"
@@ -97,7 +97,7 @@ export function AnimatedSparkline({ path }: { path: string }) {
97
97
  }
98
98
  ```
99
99
 
100
- ### 4. 使用 GSAP 编排复杂时间轴
100
+ ### 4. Use GSAP to orchestrate complex timelines
101
101
 
102
102
  ```tsx
103
103
  import { useLayoutEffect, useRef } from "react";
@@ -126,23 +126,23 @@ export function LogoReveal() {
126
126
  }
127
127
  ```
128
128
 
129
- ### 5. 控制运行成本
129
+ ### 5. Control operating costs
130
130
 
131
- - 大型 SVG 拆成静态底图和少量可动画节点,不要让每个 path 都参与时间轴。
132
- - 图标库或 Lottie 替代方案必须按需加载,不进入所有页面的基础包。
133
- - 循环动画只在可见区域运行,页面隐藏或组件卸载时停止。
134
- - 移动端减少滤镜、mask、clipPath 和大量渐变叠加。
131
+ - Split large SVG into static basemaps and a small number of animatable nodes. Do not let each path participate in the timeline.
132
+ - Icon libraries or Lottie alternatives must be loaded on demand, without going into the base package for all pages.
133
+ - The loop animation only runs in the visible area and stops when the page is hidden or the component is unloaded.
134
+ - The mobile version reduces filters, masks, clipPaths and a large number of gradient overlays.
135
135
 
136
136
  ## Constraints
137
137
 
138
- - 优先动画 `transform`、`opacity` 和 SVG 路径属性;避免高频修改 layout 相关属性。
139
- - 交互控件必须保留可见 focus 状态,动画不能替代状态表达。
140
- - 所有非装饰性 SVG 必须有可访问名称;装饰性 SVG 使用 `aria-hidden="true"`。
141
- - 默认尊重 `prefers-reduced-motion`,复杂动效必须提供静态或弱动效降级。
142
- - 不要把大型 SVG 内联到频繁重渲染的组件中;提取为 memoized 组件或外部资源。
143
- - 不用动画改变可点击区域、阅读顺序或焦点位置。
144
- - 不让 SVG 滤镜、模糊、mask 或 clipPath 成为移动端掉帧主因;复杂效果需要设备降级。
138
+ - Prioritize animation `transform`, `opacity` and SVG path attributes; avoid frequent modification of layout-related attributes.
139
+ - Interactive controls must retain the visible focus state, and animation cannot replace state expression.
140
+ - All non-decorative SVGs must have accessible names; decorative SVGs use `aria-hidden="true"`.
141
+ - Default respects `prefers-reduced-motion`, complex animations must provide static or weak motion degradation.
142
+ - Don't inline large SVGs into frequently re-rendered components; extract as memoized components or external resources.
143
+ - Change clickable area, reading order or focus position without animation.
144
+ - Don't let SVG filters, blur, mask or clipPath become the main cause of frame drops on mobile devices; complex effects require device downgrading.
145
145
 
146
146
  ## Expected Output
147
147
 
148
- 产出一个可复用的 SVG 动画组件或样式方案,包含选型理由、动效降级和可访问性处理。验证时检查动画流畅、无布局抖动、键盘与 reduced-motion 场景可用。
148
+ Produce a reusable SVG animation component or style solution, including selection reasons, animation degradation and accessibility processing. During verification, check that the animation is smooth, there is no layout jitter, and keyboard and reduced-motion scenes are available.
@@ -1,34 +1,34 @@
1
1
  ---
2
2
  name: fec-tailwind-design-system
3
- description: Use when designing, implementing, or reviewing Tailwind CSS design systems, token mapping, theme extension, utility class governance, component variants, dark mode, responsive utilities, safelists, or maintainable class composition; Chinese triggers include Tailwind, 设计 Token, 组件变体, 暗色模式, class 管理.
3
+ description: Use when designing, implementing, or reviewing Tailwind CSS design systems, token mapping, theme extension, utility class governance, component variants, dark mode, responsive utilities, safelists, or maintainable class composition; Chinese triggers include Tailwind, design Token, component variants, dark mode, class management.
4
4
  ---
5
5
 
6
- # Tailwind 设计系统
6
+ #Tailwind Design System
7
7
 
8
- 适用于用 Tailwind CSS 承载产品设计系统、组件变体和主题规则的前端任务。需要具体配置、variant、class 组织和迁移细节时加载 [references/tailwind-system-patterns.md](references/tailwind-system-patterns.md)。
8
+ Suitable for front-end tasks hosting product design systems, component variations, and theme rules with Tailwind CSS. Load [references/tailwind-system-patterns.md](references/tailwind-system-patterns.md) when specific configuration, variant, class organization and migration details are needed.
9
9
 
10
10
  ## Purpose
11
11
 
12
- 让 Tailwind 项目中的 token、主题、组件变体和响应式样式可维护,而不是把一次性 utility class 散落到业务代码里。
12
+ Make the tokens, themes, component variations, and responsive styles in the Tailwind project maintainable instead of scattering one-off utility classes into business code.
13
13
 
14
14
  ## Procedure
15
15
 
16
- 1. 识别现状:确认 Tailwind 版本、配置位置、暗色模式策略、组件库、CSS 变量、设计 token 和 class 合并工具。
17
- 2. 建立 token 边界:颜色、间距、圆角、阴影、字体、z-index 和断点优先从项目 token 或 `theme.extend` 派生。
18
- 3. 设计组件变体:按钮、输入框、卡片、弹窗、表格等基础组件用集中 variant API 表达尺寸、语义、状态和密度。
19
- 4. 控制 class 复杂度:重复组合沉淀为组件、slot、variant 或局部 helper;不要把长 class 字符串复制到多个页面。
20
- 5. 处理主题和暗色模式:明确 `class`、`data-theme` 或 CSS 变量方案,避免首次渲染闪烁和对比度回归。
21
- 6. 接入响应式:移动优先组织 utility;复杂布局交给响应式布局工作流,不要只靠堆叠断点前缀碰运气。
22
- 7. 验证样式结果:检查 hover、active、focus-visible、disabled、loading、selected、invalid、dark 和不同断点。
16
+ 1. Identify the current situation: Confirm Tailwind version, configuration location, dark mode strategy, component library, CSS variables, design token and class merging tool.
17
+ 2. Establish token boundaries: color, spacing, rounded corners, shadow, font, z-index and breakpoints are first derived from the project token or `theme.extend`.
18
+ 3. Design component variants: Basic components such as buttons, input boxes, cards, pop-up windows, and tables use centralized variant APIs to express size, semantics, status, and density.
19
+ 4. Control class complexity: Repeated combinations are precipitated into components, slots, variants or local helpers; do not copy long class strings to multiple pages.
20
+ 5. Handle themes and dark modes: Explicit `class`, `data-theme` or CSS variable schemes to avoid first render flickering and contrast regression.
21
+ 6. Access responsiveness: mobile-first organization utility; leave complex layouts to responsive layout workflow, don’t just rely on stacked breakpoint prefixes to try your luck.
22
+ 7. Verify style results: check hover, active, focus-visible, disabled, loading, selected, invalid, dark and different breakpoints.
23
23
 
24
24
  ## Constraints
25
25
 
26
- - 不把 Tailwind class 当作设计系统本身;真正的系统是 token、组件 API、状态矩阵和使用约束。
27
- - 不为单个页面随意扩展全局 token;新增 token 必须有语义名称和复用场景。
28
- - 不使用拼接的动态 class 破坏构建扫描;必要时使用 safelist、映射表或 variant 工具。
29
- - 不在组件外部覆盖基础组件内部结构来实现变体。
30
- - 不让暗色模式只靠反色;状态色、边框、阴影、图表和图片都要重新检查。
26
+ - Don't think of the Tailwind class as the design system itself; the real system is the token, component API, state matrix, and usage constraints.
27
+ - Do not expand global tokens arbitrarily for a single page; new tokens must have semantic names and reuse scenarios.
28
+ - Do not use spliced dynamic classes to break build scans; use safelist, mapping table or variant tools when necessary.
29
+ - Do not override base component internals outside the component to implement variations.
30
+ - Don't let dark mode rely solely on inverse colors; status colors, borders, shadows, charts, and images are all re-examined.
31
31
 
32
32
  ## Expected Output
33
33
 
34
- 输出 Tailwind token 映射、主题配置边界、组件 variant 设计、class 复用策略、暗色模式和响应式验证结果。完成后样式应能被项目组件复用、可搜索、可测试,并与设计系统规则一致。
34
+ Output Tailwind token mapping, theme configuration boundaries, component variant design, class reuse strategy, dark mode and responsive validation results. After completion, the style should be reusable by project components, searchable, testable, and consistent with the design system rules.
@@ -1,28 +1,28 @@
1
- # Tailwind 系统模式
1
+ # Tailwind system mode
2
2
 
3
- ## Token 映射
3
+ ## Token mapping
4
4
 
5
- 优先使用语义化名称:
5
+ Prefer using semantic names:
6
6
 
7
- | 需求 | 推荐 | 避免 |
7
+ | Need | Recommend | Avoid |
8
8
  | ---- | ---- | ---- |
9
- | 品牌色 | `brand.600`, `--color-brand-primary` | 到处复制 `blue-600` |
10
- | 表面层级 | `surface.canvas`, `surface.panel` | 一次性灰色值 |
11
- | 圆角 | `radius.control`, `radius.panel` | 随意重复的具体值 |
12
- | 阴影 | `shadow.floating`, `shadow.focus` | 没有状态含义的装饰阴影 |
9
+ | Brand color | `brand.600`, `--color-brand-primary` | Copy everywhere `blue-600` |
10
+ | Surface level | `surface.canvas`, `surface.panel` | One-time gray value |
11
+ | rounded corners | `radius.control`, `radius.panel` | optionally repeated specific values |
12
+ | Shadow | `shadow.floating`, `shadow.focus` | Decorative shadow with no state meaning |
13
13
 
14
- 如果项目已有 CSS 变量,把 Tailwind token 映射到这些变量,而不是重复维护字面量。
14
+ If the project already has CSS variables, map Tailwind tokens to these variables instead of repeatedly maintaining literals.
15
15
 
16
- ## Variant 归属
16
+ ## Variant Attribution
17
17
 
18
- 长 class 组合应收敛到以下位置之一:
18
+ Long class combinations should converge to one of the following locations:
19
19
 
20
- - 带 `variant`、`size`、`tone`、`density`、`state` props 的共享组件。
21
- - 复合组件的 slot 映射表。
22
- - CVA、tailwind-variants 或本地 `classNames` 映射等类型化 helper。
23
- - 只在一个模块内复用时,使用局部常量。
20
+ - Shared components with `variant`, `size`, `tone`, `density`, `state` props.
21
+ - Slot mapping table of composite components.
22
+ - Typed helpers such as CVA, tailwind-variants or local `classNames` mappings.
23
+ - Use local constants when reusing them within only one module.
24
24
 
25
- 不要根据不受控的用户输入拼接 class 名。使用显式映射:
25
+ Don't splice class names based on uncontrolled user input. Use explicit mapping:
26
26
 
27
27
  ```ts
28
28
  const toneClass = {
@@ -32,28 +32,28 @@ const toneClass = {
32
32
  } as const;
33
33
  ```
34
34
 
35
- ## 暗色模式
35
+ ## Dark mode
36
36
 
37
- - 优先选择单一的项目级策略:`class`、`data-theme` 或 CSS 变量。
38
- - 如果应用支持手动切换主题,在 body 绘制前初始化已选主题,避免首屏先亮后暗或先暗后亮的主题闪烁。
39
- - 在亮色和暗色主题下都测试 disabled、focus、selected、invalid、chart 和 skeleton 状态。
40
- - 不要把降低透明度作为 disabled 的唯一提示;要保留对比度和可感知性。
41
- - Tailwind 项目使用 `darkMode: "class"` 或等价配置时,主题切换逻辑应同时维护根节点 class / data attribute,并持久化用户偏好。
42
- - CSS 变量方案中,Tailwind token 应引用语义变量;不要为亮色和暗色分别散落两套工具类字面量。
43
- - 在 `<head>` 或框架等价入口中放置极小同步初始化脚本时,只读取本地主题偏好和系统偏好,不执行业务逻辑、不访问服务端数据。
44
- - 暗色模式需复核图片亮度、阴影层级、表单控件、第三方组件、图表色板和 focus ring;不要只补背景色。
37
+ - Prefer a single project-level strategy: `class`, `data-theme` or CSS variables.
38
+ - If the application supports manual theme switching, initialize the selected theme before the body is drawn to avoid flickering of the first screen that first lights up and then darkens or first darkens and then lights up.
39
+ - Test disabled, focus, selected, invalid, chart and skeleton states in both light and dark themes.
40
+ - Don't use lowering transparency as the only hint of disabled; preserve contrast and perceptibility.
41
+ - When the Tailwind project uses `darkMode: "class"` or equivalent configuration, the theme switching logic should maintain the root node class / data attribute and persist user preferences.
42
+ - In the CSS variable scheme, Tailwind token should refer to semantic variables; do not scatter two sets of utility literals for light and dark colors.
43
+ - When placing a minimal synchronization initialization script in `<head>` or a framework equivalent entry, only local theme preferences and system preferences are read, no business logic is executed, and no server-side data is accessed.
44
+ - In dark mode, you need to review the image brightness, shadow level, form controls, third-party components, chart color palette and focus ring; don't just add the background color.
45
45
 
46
- ## 响应式工具类
46
+ ## Responsive tool class
47
47
 
48
- - 默认 class 列表从移动端布局开始。
49
- - 只有信息架构变化时,才增加更大断点前缀。
50
- - 重复出现的响应式区块应沉淀为布局组件或 CSS 容器查询,不要反复复制同一串断点。
51
- - 控件、标签页、看板和数据单元格使用稳定尺寸,避免 hover 和 loading 状态造成布局跳动。
48
+ - The default class list starts with mobile layout.
49
+ - Only add larger breakpoint prefixes when the information architecture changes.
50
+ - Recurring responsive blocks should be precipitated into layout components or CSS container queries, and do not duplicate the same string of breakpoints repeatedly.
51
+ - Controls, tabs, dashboards and data cells use stable sizes to avoid layout jumps caused by hover and loading states.
52
52
 
53
- ## 评审清单
53
+ ## Review Checklist
54
54
 
55
- - Token 值有语义角色,并且没有分叉既有设计规则。
56
- - 组件 variants 覆盖 loading、disabled、selected、invalid、focus-visible 和暗色模式。
57
- - 动态 class 可被静态扫描识别,或已安全加入 safelist。
58
- - Tailwind 工具类没有破坏可访问性、点击目标或 reduced-motion 要求。
59
- - 最终 UI 已在移动端、平板和桌面宽度检查过。
55
+ - Token values have semantic roles and do not fork existing design rules.
56
+ - Component variants cover loading, disabled, selected, invalid, focus-visible and dark mode.
57
+ - Dynamic classes can be recognized by static scans, or have been safely added to the safelist.
58
+ - Tailwind utility classes have no accessibility-breaking, click-targeting, or reduced-motion requirements.
59
+ - Final UI checked in mobile, tablet and desktop widths.