@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,91 +1,91 @@
1
1
  ---
2
2
  name: fec-react-project-standard
3
- description: Use when designing or reviewing React + TypeScript project structure, feature/module boundaries, component architecture, hooks organization, routing composition, state/API/error/styling defaults, or repository-wide React conventions. Prefer narrower skills for forms, data fetching, tests, accessibility, virtualization, animation, or security deep dives; Chinese triggers include React 项目规范, React 组件架构.
3
+ description: Use when designing or reviewing React + TypeScript project structure, feature/module boundaries, component architecture, hooks organization, routing composition, state/API/error/styling defaults, or repository-wide React conventions. Prefer narrower skills for forms, data fetching, tests, accessibility, virtualization, animation, or security deep dives; Chinese triggers include React project specification, React component architecture.
4
4
  ---
5
5
 
6
- # React 项目规范
6
+ # React project specifications
7
7
 
8
- 适用于 React + TypeScript 仓库中的中大型模块建设、页面重构和工程结构设计。
8
+ Suitable for medium and large module construction, page reconstruction and engineering structure design in React + TypeScript warehouse.
9
9
 
10
10
  ## Purpose
11
11
 
12
- 为 React + TypeScript 项目提供工程结构、模块边界和默认实现约定,确保架构清晰、代码可维护。
12
+ Provide engineering structure, module boundaries and default implementation conventions for React + TypeScript projects to ensure clear architecture and maintainable code.
13
13
 
14
14
  ## Procedure
15
15
 
16
- 本 skill 主要解决 React 工程任务“如何设计和落地”的问题,不重复声明基础编码底线。处理 React 工程化任务时,按以下顺序执行:
17
-
18
- 1. 识别仓库已有约定
19
- - 目录组织方式
20
- - 样式体系
21
- - 状态管理方案
22
- - 请求封装方式
23
- - 测试框架
24
- - UI 组件库 / 设计系统
25
-
26
- 2. 判断目标属于哪一层
27
- - 路由页面
28
- - 页面私有组件
29
- - feature 业务模块
30
- - 全局通用组件
16
+ This skill mainly solves the problem of "how to design and implement" React engineering tasks, without repeating the basic coding bottom line. When handling React engineering tasks, perform them in the following order:
17
+
18
+ 1. Identify the warehouse and have an agreement
19
+ - Directory organization
20
+ - Style system
21
+ - Status management solution
22
+ - Request packaging method
23
+ - Testing framework
24
+ - UI component library/design system
25
+
26
+ 2. Determine which layer the target belongs to
27
+ - Routing page
28
+ -Page private components
29
+ - feature business module
30
+ - Global common components
31
31
  - hooks / services / stores / utils
32
32
 
33
- 3. 设计边界后再落代码
34
- - 哪些逻辑属于页面编排
35
- - 哪些逻辑属于 feature
36
- - 哪些逻辑应下沉为通用能力
37
- - 哪些状态应本地管理,哪些应交给 store / query / URL
38
- - 状态归属复杂时使用状态管理流程先做状态清单
39
- - DTO、公共 props、泛型组件或 `tsconfig` 边界复杂时,先使用 TypeScript 项目规范流程收敛跨框架类型契约
40
-
41
- 4. 输出时补齐关键质量项
42
- - loading / error / empty / data 状态
43
- - 错误处理与重试
44
- - 类型约束
45
- - 关键测试入口
46
- - 必要的专项 skill 分流
47
- - 依赖是否已存在于 `package.json`,缺失时先给安装命令再使用
48
- - 重型 UI 能力(动效、图表、3D、编辑器、地图)是否隔离为 leaf component 并按需加载
49
- - 图片、视频、字体等资源是否本地化、可缓存,并避免占位 URL 进入交付
50
- - 页面级 Error Boundary、模块级 fallback、API 错误映射和用户可恢复动作是否一致
51
- - Tailwind token/variant 或响应式布局需求是否应分流到对应专项 skill
52
- - 对明显架构性能风险做轻量筛查,如重型依赖边界、过宽 Context、高频派生值和懒加载 fallback;需要指标证据时进入性能优化 workflow
53
-
54
- ## 详细参考
55
-
56
- 按需要加载更细的参考文件:
57
-
58
- - 项目目录、组件分层、组件边界和组件目录建议:加载 [references/react-project-structure.md](references/react-project-structure.md)。
59
- - 组件模式、Hooks、路由、状态归属、API 层、错误处理和 Suspense/懒加载:加载 [references/react-runtime-patterns.md](references/react-runtime-patterns.md)。
60
- - 样式、注释、TypeScript、测试、反模式和输出检查清单:加载 [references/react-quality-patterns.md](references/react-quality-patterns.md)。
61
- - React 项目规范层面的轻量性能约定:加载 [references/react-performance-patterns.md](references/react-performance-patterns.md)。
33
+ 3. Design the boundaries before writing the code
34
+ - What logic belongs to page layout
35
+ - Which logic belongs to feature
36
+ - Which logic should be transferred to general capabilities?
37
+ - Which state should be managed locally and which should be handed over to store/query/URL
38
+ - When the status ownership is complex, use the status management process to make a status list first
39
+ - When the boundaries of DTO, public props, generic components or `tsconfig` are complex, first use the TypeScript project specification process to converge cross-framework type contracts
40
+
41
+ 4. Complete key quality items when outputting
42
+ - loading / error / empty / data status
43
+ - Error handling and retrying
44
+ - Type constraints
45
+ - Key test entrance
46
+ - Diversion of necessary special skills
47
+ - Check whether the dependency already exists in `package.json`. If it is missing, give the installation command first and then use it.
48
+ - Whether heavy UI capabilities (animation, charts, 3D, editors, maps) are isolated as leaf components and loaded on demand
49
+ - Whether images, videos, fonts and other resources are localized and cacheable, and avoid placeholder URLs from entering delivery
50
+ - Whether page-level Error Boundary, module-level fallback, API error mapping and user-recoverable actions are consistent
51
+ - Whether Tailwind token/variant or responsive layout requirements should be diverted to the corresponding special skill
52
+ - Perform lightweight screening for obvious architectural performance risks, such as heavy dependency boundaries, too wide Context, high-frequency derived values and lazy loading fallback; enter the performance optimization workflow when indicator evidence is needed
53
+
54
+ ## Detailed reference
55
+
56
+ Load more detailed reference files as needed:
57
+
58
+ - Project Directory, Component Hierarchy, Component Boundary and Component Directory Recommendations: Load [references/react-project-structure.md](references/react-project-structure.md).
59
+ - Component pattern, Hooks, routing, state ownership, API layer, error handling and Suspense/lazy loading: Load [references/react-runtime-patterns.md](references/react-runtime-patterns.md).
60
+ - Style, annotations, TypeScript, tests, anti-patterns and output checklist: Loading [references/react-quality-patterns.md](references/react-quality-patterns.md).
61
+ - Lightweight performance conventions at the React project specification level: Load [references/react-performance-patterns.md](references/react-performance-patterns.md).
62
62
 
63
63
  ## Constraints
64
64
 
65
- - 默认遵守仓库现有全局规则和 React rule
66
- - 若仓库已有明确目录结构、样式体系、状态管理或请求封装,优先沿用仓库约定
67
- - 组件文件规模宜约 **300 行**内;逾 **500 行**或复杂度过高须拆分子组件、Hooks、utils、类型
68
- - 禁止新增类组件(Error Boundary 用 `react-error-boundary` 等库)
69
- - 禁止绕过模块出口,从 feature 深层路径导入
70
- - 不要用 `useEffect + setState` 模拟本可直接计算的派生值
71
- - 避免 prop drilling 过深却不考虑组合或局部封装
72
- - 不在通用页面组件里同步引入 GSAP、Three.js、Lottie、富文本编辑器或地图 SDK;需要时用动态导入、路由级分包或叶子组件隔离。
73
- - 不在 React 组件中散落裸 `fetch`、API URL、token refresh 或上传流程;跨边界请求应收敛到 API 集成层。
74
- - 不用 Error Boundary 处理普通 API 失败;请求错误应优先落到 loading/error/empty/data 状态和可恢复操作。
75
- - 不把 React 性能建议写成无证据的全局 memo 化;先定位请求瀑布、bundle 边界、重复渲染或 effect 误用。
65
+ - Comply with the existing global rules and React rules of the warehouse by default
66
+ - If the warehouse already has a clear directory structure, style system, status management or request encapsulation, the warehouse convention will be used first.
67
+ - The size of the component file should be approximately **300 lines**; if it exceeds **500 lines** or is too complex, it must be split into sub-components, Hooks, utils, and types.
68
+ - It is forbidden to add new class components (Error Boundary uses libraries such as `react-error-boundary`)
69
+ - Disable bypassing module exports and importing from feature deep paths
70
+ - Do not use `useEffect + setState` to simulate derived values that can be calculated directly
71
+ - Avoid prop drilling too deep without considering composition or partial encapsulation
72
+ - Do not synchronously introduce GSAP, Three.js, Lottie, rich text editor or map SDK into common page components; use dynamic import, route-level subcontracting or leaf component isolation when necessary.
73
+ - No bare `fetch`, API URL, token refresh or upload processes scattered around React components; cross-border requests should be converged to the API integration layer.
74
+ - Do not use Error Boundary to handle normal API failures; request errors should first fall into the loading/error/empty/data state and recoverable operations.
75
+ - Do not write React performance recommendations as global memo without evidence; first locate request waterfall, bundle boundaries, repeated rendering or effect misuse.
76
76
 
77
77
  ## Expected Output
78
78
 
79
- - 组件边界清晰,pages/features/components 分层明确
80
- - Props 类型完整且明确;复杂公共类型或外部数据收窄已分流到 TypeScript 项目规范流程
81
- - 可复用逻辑已提取为 hooks,loading/error/empty/data 状态齐全
82
- - API 层具备类型约束和统一错误处理,状态管理符合就近原则
83
- - URL 状态、服务端状态、表单状态和全局客户端状态边界明确
84
- - 关键行为有测试覆盖,关键模块已用 `react-error-boundary` 包裹
85
- - 超长列表已评估虚拟化,弹窗/复合组件具备键盘与焦点支持
86
- - 先尊重仓库现状,再给推荐结构
87
- - 给出必要的文件划分建议
88
- - 必要时说明为什么这样分层
89
- - 对新增模块,优先输出最小可落地结构,而不是一次性过度设计
90
- - 对重构任务,优先保证可迁移性和风险可控
91
- - 对性能相关 React 变更,说明触发的风险类别、证据来源和验证命令
79
+ - Component boundaries are clear, pages/features/components are clearly layered
80
+ - The Props type is complete and clear; the narrowing of complex public types or external data has been diverted to the TypeScript project specification process
81
+ - Reusable logic has been extracted into hooks, and the loading/error/empty/data status is complete
82
+ - The API layer has type constraints and unified error handling, and status management conforms to the proximity principle
83
+ - URL status, server status, form status and global client status have clear boundaries
84
+ - Key behaviors are covered by tests, and key modules have been wrapped with `react-error-boundary`
85
+ - The long list has been evaluated for virtualization, and pop-up/composite components have keyboard and focus support
86
+ - Respect the current situation of the warehouse first, and then recommend the structure
87
+ - Give necessary suggestions for file division
88
+ - Explain why this is layered if necessary
89
+ - For new modules, give priority to outputting the smallest floor-mountable structure rather than over-designing it all at once
90
+ - For reconstruction tasks, give priority to ensuring portability and risk controllability
91
+ - For performance-related React changes, describe the triggered risk categories, evidence sources, and verification commands
@@ -2,34 +2,34 @@
2
2
 
3
3
  This file keeps lightweight React project-standard performance guidance. Use the frontend performance workflow when the task needs metrics, traces, profiles, bundle analysis, network evidence, or a formal performance report.
4
4
 
5
- ### 性能(与「性能优化」一节配合)
6
-
7
- - **useMemo**:昂贵派生、大列表排序/过滤;注意不可变数据,例如 `useMemo(() => [...list].sort(...), [list])`,避免直接 `sort` 可变原数组。
8
- - **useCallback**:传给 **`React.memo`** 子组件或作为其他 Hook 依赖的回调,在确有稳定引用需求时使用。
9
- - **React.memo**:纯展示、props 浅比较可接受的组件;不要全局套 memo。
10
- - **虚拟列表**:超长列表用 **TanStack Virtual**、**react-window** 等,只渲染视区内节点(路由级与组件级懒加载仍见「Suspense 与懒加载」)。
11
-
12
- ## 性能优化
13
-
14
- 在以下场景考虑性能优化:
15
-
16
- - 大列表 / 大表格
17
- - 高频重渲染组件
18
- - 大量 props 传递的复杂树
19
- - 重型第三方组件
20
- - 高频变化 context
21
-
22
- ### 推荐手段
23
-
24
- - 合理使用 `React.memo`
25
- - 只在必要时使用 `useMemo` / `useCallback`
26
- - 列表使用稳定 `key`
27
- - 大列表使用虚拟滚动
28
- - 路由级做 code splitting
29
- - 避免将高频变化值放进顶层 context
30
- - 避免在 render 中无意义创建大量新对象 / 新函数 / 新数组
31
- - 重型图表、编辑器、地图、3D 和媒体处理能力放到叶子组件或路由级懒加载边界
32
- - 懒加载组件必须配套 loading、error、empty 或降级 UI,避免只优化包体却破坏用户状态
5
+ ### Performance (in conjunction with the "Performance Optimization" section)
6
+
7
+ - **useMemo**: Expensive derivation, large list sorting/filtering; pay attention to immutable data, such as `useMemo(() => [...list].sort(...), [list])`, and avoid directly `sort` the mutable original array.
8
+ - **useCallback**: passed to **`React.memo`** sub-component or used as a callback for other Hook dependencies, used when there is a stable reference requirement.
9
+ - **React.memo**: An acceptable component with pure display and shallow props; do not apply memo globally.
10
+ - **Virtual List**: For very long lists, use **TanStack Virtual**, **react-window**, etc., and only render nodes in the viewport (see "Suspense and Lazy Loading" for routing-level and component-level lazy loading).
11
+
12
+ ## Performance optimization
13
+
14
+ Consider performance optimization in the following scenarios:
15
+
16
+ - Large list/large table
17
+ - High frequency re-rendering components
18
+ - Complex trees passed with a large number of props
19
+ - Heavy-duty third-party components
20
+ - High frequency changing context
21
+
22
+ ### Recommended means
23
+
24
+ - Use `React.memo` appropriately
25
+ - Use `useMemo` / `useCallback` only when necessary
26
+ - List uses stable `key`
27
+ - Use virtual scrolling for large lists
28
+ - Code splitting at routing level
29
+ - Avoid putting high-frequency changing values into the top-level context
30
+ - Avoid meaninglessly creating a large number of new objects/new functions/new arrays in render
31
+ - Heavy charting, editor, map, 3D and media processing capabilities into leaf components or route-level lazy loading boundaries
32
+ - Lazy loading components must be equipped with loading, error, empty or downgraded UI to avoid only optimizing the package body but destroying the user state
33
33
 
34
34
  ---
35
35
 
@@ -1,177 +1,177 @@
1
1
  # React project structure and component boundaries
2
2
 
3
- ## 项目结构(推荐参考)
3
+ ## Project structure (recommended reference)
4
4
 
5
- 以下为中大型 React 项目的业界最佳实践结构,按项目实际情况裁剪:
5
+ The following is the industry's best practice structure for medium and large React projects, tailored according to the actual situation of the project:
6
6
 
7
7
  ```text
8
8
  src/
9
- ├── app/ # 应用入口与全局配置
10
- │ ├── App.tsx # 根组件(Provider 组合)
11
- │ ├── routes.tsx # 路由配置
12
- │ └── providers.tsx # 全局 Provider 组装
9
+ ├── app/ # Application entry and global configuration
10
+ │ ├── App.tsx # Root component (Provider combination)
11
+ │ ├── routes.tsx # Routing configuration
12
+ │ └── providers.tsx # Global Provider assembly
13
13
  │
14
- ├── pages/ # 页面组件(与路由一一对应)
14
+ ├── pages/ # Page components (one-to-one correspondence with routing)
15
15
  │ ├── Dashboard/
16
16
  │ │ ├── DashboardPage.tsx
17
- │ │ ├── components/ # 页面私有组件
18
- │ │ └── hooks/ # 页面私有 hooks
17
+ │ │ ├── components/ # Page private components
18
+ │ │ └── hooks/ # Page private hooks
19
19
  │ ├── UserList/
20
20
  │ └── Settings/
21
21
  │
22
- ├── layouts/ # 布局组件
23
- │ ├── MainLayout.tsx # 主布局(侧边栏 + 顶栏 + 内容区)
24
- │ ├── AuthLayout.tsx # 登录/注册页布局
25
- │ └── BlankLayout.tsx # 空白布局(错误页等)
22
+ ├── layouts/ # Layout component
23
+ │ ├── MainLayout.tsx # Main layout (sidebar + top bar + content area)
24
+ │ ├── AuthLayout.tsx # Login/registration page layout
25
+ │ └── BlankLayout.tsx # Blank layout (error page, etc.)
26
26
  │
27
- ├── features/ # 功能模块(按业务领域划分)
27
+ ├── features/ # Function modules (divided by business areas)
28
28
  │ ├── auth/
29
- │ │ ├── components/ # 模块组件
30
- │ │ ├── hooks/ # 模块 hooks
31
- │ │ ├── api.ts # 模块 API 调用
32
- │ │ ├── types.ts # 模块类型定义
33
- │ │ ├── constants.ts # 模块常量
34
- │ │ └── index.ts # 模块公开导出
29
+ │ │ ├── components/ # Module components
30
+ │ │ ├── hooks/ # module hooks
31
+ │ │ ├── api.ts # Module API call
32
+ │ │ ├── types.ts # Module type definition
33
+ │ │ ├── constants.ts # Module constants
34
+ │ │ └── index.ts # Module publicly exported
35
35
  │ └── order/
36
36
  │
37
- ├── components/ # 全局共享 UI 组件
37
+ ├── components/ # Globally shared UI components
38
38
  │ ├── Button/
39
39
  │ │ ├── Button.tsx
40
40
  │ │ ├── Button.styles.css
41
41
  │ │ └── __tests__/
42
42
  │ ├── Modal/
43
43
  │ ├── Form/
44
- │ └── ErrorBoundary/ # 对 react-error-boundary 等的薄封装(函数组件)
44
+ │ └── ErrorBoundary/ # Thin wrapper (function component) for react-error-boundary etc.
45
45
  │
46
- ├── hooks/ # 全局共享 hooks
46
+ ├── hooks/ # Global shared hooks
47
47
  │ ├── useAuth.ts
48
48
  │ ├── useDebounce.ts
49
49
  │ └── useMediaQuery.ts
50
50
  │
51
- ├── services/ # API 基础层
52
- │ ├── request.ts # Axios/fetch 实例与拦截器
53
- │ └── endpoints/ # API 端点定义(如按领域拆分)
51
+ ├── services/ # API base layer
52
+ │ ├── request.ts # Axios/fetch instance and interceptor
53
+ │ └── endpoints/ # API endpoint definition (such as split by field)
54
54
  │
55
- ├── stores/ # 全局状态管理
55
+ ├── stores/ # Global status management
56
56
  │ ├── authStore.ts
57
57
  │ └── uiStore.ts
58
58
  │
59
- ├── locales/ # 国际化语言包
60
- │ ├── zh-CN.json # 中文
61
- │ ├── en-US.json # 英文
62
- │ └── index.ts # i18n 实例初始化(i18next / react-intl)
59
+ ├── locales/ # International language pack
60
+ │ ├── zh-CN.json # Simplified Chinese
61
+ │ ├── en-US.json # English
62
+ │ └── index.ts # i18n instance initialization (i18next / react-intl)
63
63
  │
64
- ├── assets/ # 静态资源
65
- │ ├── images/ # 图片(PNG、JPG、WebP)
66
- │ ├── icons/ # SVG 图标
67
- │ └── fonts/ # 自定义字体
64
+ ├── assets/ # Static resources
65
+ │ ├── images/ # Pictures (PNG, JPG, WebP)
66
+ │ ├── icons/ # SVG icon
67
+ │ └── fonts/ # Custom fonts
68
68
  │
69
- ├── config/ # 应用配置
70
- │ ├── env.ts # 环境变量类型化封装
71
- │ └── features.ts # Feature Flags 管理
69
+ ├── config/ # Application configuration
70
+ │ ├── env.ts # Typed encapsulation of environment variables
71
+ │ └── features.ts # Feature Flags Management
72
72
  │
73
- ├── types/ # 全局共享类型
74
- │ ├── api.ts # API 响应/请求通用类型
75
- │ ├── models.ts # 业务实体类型
76
- │ └── global.d.ts # 全局类型扩展(图片模块声明等)
73
+ ├── types/ # Global shared types
74
+ │ ├── api.ts # API response/request common type
75
+ │ ├── models.ts #Business entity type
76
+ │ └── global.d.ts # Global type extension (picture module declaration, etc.)
77
77
  │
78
- ├── utils/ # 纯工具函数
79
- │ ├── format.ts # 日期、数字、货币格式化
80
- │ ├── validators.ts # 表单校验规则
81
- │ └── storage.ts # LocalStorage / SessionStorage 封装
78
+ ├── utils/ # Pure utility function
79
+ │ ├── format.ts # Date, number, currency formatting
80
+ │ ├── validators.ts # Form validation rules
81
+ │ └── storage.ts # LocalStorage / SessionStorage package
82
82
  │
83
- ├── styles/ # 全局样式与主题
84
- │ ├── global.css # 全局基础样式(reset / normalize)
85
- │ ├── variables.css # CSS 变量(颜色、间距、字号)
86
- │ ├── breakpoints.ts # 响应式断点常量
87
- │ └── themes/ # 主题定义
88
- │ ├── light.css # 亮色主题变量
89
- │ ├── dark.css # 暗色主题变量
90
- │ └── index.ts # 主题切换逻辑
83
+ ├── styles/ # Global styles and themes
84
+ │ ├── global.css # Global basic style (reset/normalize)
85
+ │ ├── variables.css # CSS variables (color, spacing, font size)
86
+ │ ├── breakpoints.ts # Responsive breakpoint constants
87
+ │ └── themes/ # theme definition
88
+ │ ├── light.css # Light theme variable
89
+ │ ├── dark.css # Dark theme variable
90
+ │ └── index.ts # theme switching logic
91
91
  │
92
- └── constants/ # 全局常量
93
- ├── routes.ts # 路由路径常量
94
- └── config.ts # 业务常量(分页大小、超时时间等)
92
+ └── constants/ # Global constants
93
+ ├── routes.ts #Routing path constants
94
+ └── config.ts #Business constants (paging size, timeout, etc.)
95
95
  ```
96
96
 
97
- ### 关键原则
97
+ ### Key Principles
98
98
 
99
- - `pages/` 做路由映射和页面编排,不承载大块可复用业务逻辑
100
- - `layouts/` 负责页面骨架和布局容器,由路由配置引用
101
- - `features/` 按业务领域划分,模块内尽量自包含
102
- - `components/` 仅放跨页面、跨模块复用的通用组件
103
- - `hooks/` 仅放全局通用 hooks;业务 hooks 优先放回对应 feature 或 page
104
- - `locales/` 存放语言包 JSON 文件,组件中使用 `t('key')` 而非硬编码文案
105
- - `assets/` 存放静态资源,图标优先使用 SVG,图片优先使用 WebP/AVIF
106
- - `services/` 负责请求基础设施,不堆叠业务细节
107
- - `config/` 统一封装环境变量和特性开关,禁止组件中直接读取 `import.meta.env`
108
- - `styles/` 和主题变量统一管理,避免颜色和尺寸散落在业务代码中
109
- - 每个模块通过 `index.ts` 管控对外公开 API,避免深层路径导入
99
+ - `pages/` does route mapping and page arrangement, and does not carry large pieces of reusable business logic.
100
+ - `layouts/` is responsible for the page skeleton and layout container, referenced by the routing configuration
101
+ - `features/` is divided according to business areas, and the module should be as self-contained as possible
102
+ - `components/` only contains common components that are reused across pages and modules
103
+ - `hooks/` only puts global general hooks; business hooks are put back to the corresponding feature or page first
104
+ - `locales/` stores language pack JSON files, use `t('key')` in the component instead of hard-coded copy
105
+ - `assets/` stores static resources, SVG is preferred for icons, and WebP/AVIF is preferred for images.
106
+ - `services/` is responsible for requesting infrastructure and does not stack business details
107
+ - `config/` uniformly encapsulates environment variables and feature switches, prohibiting direct reading of `import.meta.env` in components
108
+ - `styles/` and theme variables are managed uniformly to avoid colors and sizes being scattered in business code
109
+ - Each module controls the public API through `index.ts` to avoid deep path imports
110
110
 
111
111
  ---
112
112
 
113
- ## 组件与模块分层
113
+ ## Component and module layering
114
114
 
115
- 推荐分层:
115
+ Recommended layering:
116
116
 
117
117
  ```text
118
- 页面组件 (Pages) → 路由映射、布局组合、页面编排
119
- └── 容器/编排层 → 数据获取、状态组织、事件编排
120
- └── 业务组件 → 领域逻辑展示
121
- └── 通用组件 → 无业务耦合、可跨模块复用
118
+ Page components (Pages) → route mapping, layout combination, page arrangement
119
+ └── Container/orchestration layer → data acquisition, status organization, event orchestration
120
+ └── Business components → Domain logic display
121
+ └── Common components → No business coupling, reusable across modules
122
122
  ```
123
123
 
124
- ### 什么时候放到 `pages/`
124
+ ### When to put it in `pages/`
125
125
 
126
- 适合放:
126
+ Suitable for:
127
127
 
128
- - 路由入口组件
129
- - 页面级布局组合
130
- - 页面私有的轻量编排逻辑
128
+ - Routing entry component
129
+ - Page level layout combination
130
+ - Page private lightweight orchestration logic
131
131
 
132
- 不适合放:
132
+ Not suitable for:
133
133
 
134
- - 大量领域逻辑
135
- - 可复用于多个页面的复杂业务块
136
- - 与某个业务域强绑定的 API / hooks / types
134
+ - A lot of domain logic
135
+ - Complex business blocks that can be reused on multiple pages
136
+ - API/hooks/types that are strongly bound to a certain business domain
137
137
 
138
- ### 什么时候放到 `features/`
138
+ ### When to put it in `features/`
139
139
 
140
- 适合放:
140
+ Suitable for:
141
141
 
142
- - 某个业务域的组件、hooks、api、types
143
- - 可被多个页面共享但带业务语义的逻辑
144
- - 一个完整业务单元的自包含实现
142
+ - Components, hooks, apis, and types of a certain business domain
143
+ - Logic that can be shared by multiple pages but has business semantics
144
+ - Self-contained implementation of a complete business unit
145
145
 
146
- ### 什么时候放到 `components/`
146
+ ### When to put it in `components/`
147
147
 
148
- 适合放:
148
+ Suitable for:
149
149
 
150
- - 按钮、弹窗、表单项、表格壳子、空态、错误态等通用 UI
151
- - 与具体业务无关、可跨模块复用的组件
150
+ - Common UI such as buttons, pop-up windows, form items, table shells, empty states, error states, etc.
151
+ - Components that have nothing to do with specific business and can be reused across modules
152
152
 
153
153
  ---
154
154
 
155
- ## 组件设计规范
155
+ ## Component design specifications
156
156
 
157
- - 使用**函数组件**、Hooks 与 TypeScript;**不要**新增类组件(Error Boundary 用 `react-error-boundary` 等库,见下文)
158
- - **单文件规模**与拆分原则见 `templates/shared/rules/fec-react.md`「**组件文件规模**」(约 300 行内为佳,逾 500 行或复杂度过高拆子组件、Hooks、utils、类型)
159
- - 保持组件职责单一、可组合
160
- - 将可复用逻辑提取到 hooks
161
- - 在合适场景优先使用受控组件 API
162
- - props 定义清晰且类型明确
163
- - 优先复用现有设计系统组件
164
- - 保持可访问性与键盘交互
165
- - 避免过深的 JSX 嵌套和重复分支
166
- - 对可推导的值不要额外存 state
157
+ - Use **Functional Components**, Hooks and TypeScript; **Do not** add new class components (Error Boundary uses libraries such as `react-error-boundary`, see below)
158
+ - **Single file size** and splitting principles can be found in `templates/shared/rules/fec-react.md` "**Component file size**" (approximately 300 lines is preferred, if it exceeds 500 lines or is too complex, sub-components, Hooks, utils, and types will be split)
159
+ - Keep components with single responsibilities and composable
160
+ - Extract reusable logic into hooks
161
+ - Prioritize the use of controlled component APIs in appropriate scenarios
162
+ - props are clearly defined and typed
163
+ - Prioritize reuse of existing design system components
164
+ - Maintain accessibility with keyboard interaction
165
+ - Avoid deep JSX nesting and duplicate branches
166
+ - Do not store additional state for deducible values
167
167
 
168
168
  ---
169
169
 
170
170
 
171
- ## 组件目录建议
171
+ ## Component directory suggestions
172
172
 
173
- 当组件复杂度较低时,可只保留一个文件。
174
- 当组件包含样式、子组件、hooks、测试时,推荐使用如下结构:
173
+ When the component complexity is low, only one file can be kept.
174
+ When a component contains styles, subcomponents, hooks, and tests, it is recommended to use the following structure:
175
175
 
176
176
  ```text
177
177
  ComponentName/
@@ -186,12 +186,12 @@ ComponentName/
186
186
  └── ComponentName.spec.tsx
187
187
  ```
188
188
 
189
- 说明:
189
+ Description:
190
190
 
191
- - 类型复杂时再拆 `ComponentName.types.ts`
192
- - 存在局部逻辑复用时再拆 `hooks/`
193
- - 子组件仅在当前组件内部使用时,放到当前目录 `components/`
194
- - 测试是否就近放置,应遵循仓库现有约定
191
+ - Split `ComponentName.types.ts` when the type is complex
192
+ - Split `hooks/` when there is local logic reuse
193
+ - When the subcomponent is only used inside the current component, it is placed in the current directory `components/`
194
+ - Whether the test should be placed nearby should follow the existing protocols of the warehouse
195
195
 
196
196
  ---
197
197