@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
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: fec-monorepo-project-standard
3
+ description: 用于创建、审查或重构前端 monorepo,包括 pnpm workspace、Turborepo、Nx、多包依赖边界、任务编排、包命名或包发布;中文触发词包括 monorepo、workspace、多包。
4
+ ---
5
+
6
+ # Monorepo 项目规范
7
+
8
+ 适用于使用 pnpm workspace、Turborepo 或 Nx 的多包前端仓库。
9
+
10
+ ## 用途
11
+
12
+ 规范 Monorepo 项目的目录结构、依赖管理、任务编排和包发布流程,确保多包协作的构建效率和版本一致性。
13
+
14
+ ## 流程
15
+
16
+ 1. 先确认仓库是否已使用 pnpm workspace、Turborepo 或 Nx,并沿用现有包命名与任务约定。
17
+ 2. 将应用放在 `apps/`,共享库、配置和工具放在 `packages/` 或既有等价目录。
18
+ 3. 内部依赖使用 `workspace:*`,通过依赖图驱动构建顺序。
19
+ 4. 为 build、lint、test 配置可缓存、可并行、可增量的根任务,并明确输入、输出和环境变量。
20
+ 5. 在 Turborepo/Nx 中配置 affected/changed 范围命令,CI 优先跑受影响包,同时保留主干全量验证入口。
21
+ 6. 发布包前检查包边界、循环依赖、exports、peer dependencies 和版本策略。
22
+
23
+ ## 工具选择
24
+
25
+ | 工具 | 适用 | 特点 |
26
+ | ------------------ | ---- | -------------------------- |
27
+ | **pnpm workspace** | 基础 | 依赖提升、链接、脚本聚合 |
28
+ | **Turborepo** | 推荐 | 缓存、并行、依赖图 |
29
+ | **Nx** | 大型 | 增量构建、云缓存、插件生态 |
30
+
31
+ ## 目录结构
32
+
33
+ ### pnpm + Turborepo
34
+
35
+ ```
36
+ ├── package.json # 根 package,workspace 配置
37
+ ├── pnpm-workspace.yaml # workspace 包列表
38
+ ├── turbo.json # Turborepo 配置
39
+ │
40
+ ├── apps/
41
+ │ ├── web/ # 主应用
42
+ │ │ ├── package.json
43
+ │ │ └── ...
44
+ │ ├── admin/ # 管理后台
45
+ │ └── docs/ # 文档站
46
+ │
47
+ ├── packages/
48
+ │ ├── ui/ # 共享 UI 组件
49
+ │ │ ├── package.json
50
+ │ │ └── src/
51
+ │ ├── utils/ # 工具函数
52
+ │ ├── config-eslint/ # 共享 ESLint 配置
53
+ │ └── config-typescript/ # 共享 TS 配置
54
+ │
55
+ └── tooling/ # 构建/测试工具(可选)
56
+ └── scripts/
57
+ ```
58
+
59
+ ### pnpm-workspace.yaml
60
+
61
+ ```yaml
62
+ packages:
63
+ - "apps/*"
64
+ - "packages/*"
65
+ ```
66
+
67
+ ## 依赖管理
68
+
69
+ - 内部包使用 `workspace:*` 协议
70
+ - 根 `package.json` 统一部分依赖版本,子包可覆盖
71
+ - 禁止循环依赖,通过 `pnpm why` 检查
72
+
73
+ ```json
74
+ {
75
+ "dependencies": {
76
+ "@repo/ui": "workspace:*",
77
+ "@repo/utils": "workspace:*"
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Turborepo 任务编排
83
+
84
+ ```json
85
+ {
86
+ "$schema": "https://turbo.build/schema.json",
87
+ "tasks": {
88
+ "build": {
89
+ "dependsOn": ["^build"],
90
+ "outputs": ["dist/**", ".next/**"]
91
+ },
92
+ "lint": {
93
+ "dependsOn": ["^build"]
94
+ },
95
+ "test": {
96
+ "dependsOn": ["^build"]
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ - `^build` 表示先执行依赖包的 build
103
+ - `outputs` 用于缓存命中判断
104
+ - `inputs` 应包含源码、配置、锁文件和环境相关文件;不要把 `.env` secret 值写入缓存 key
105
+ - 远程缓存要区分可信 CI 与本地开发,避免把含敏感信息的产物上传
106
+
107
+ ## Nx 任务编排
108
+
109
+ ```json
110
+ {
111
+ "targetDefaults": {
112
+ "build": {
113
+ "dependsOn": ["^build"],
114
+ "outputs": ["{projectRoot}/dist"],
115
+ "cache": true
116
+ }
117
+ }
118
+ }
119
+ ```
120
+
121
+ ## 包命名
122
+
123
+ - 内部包:`@org/package-name` 或 `@repo/package-name`
124
+ - 发布到 npm:遵循 `@scope/name` 规范
125
+
126
+ ## 约束
127
+
128
+ - 子包之间通过 `workspace:*` 引用,不发布到 npm 再安装
129
+ - 共享配置(ESLint、TS)放在 `packages/config-*`,子包 extends
130
+ - 构建顺序由依赖图决定,不手动指定无关依赖
131
+ - 根目录执行 `pnpm -r build` 或 `turbo run build` 时,所有包按序构建
132
+ - 禁止循环依赖,新增包时通过 `pnpm why` 检查依赖链
133
+ - CI cache 只缓存依赖安装目录和任务产物,不缓存未验证的构建状态
134
+ - affected 构建不能替代发布前全量验证;主干或 release 分支仍需完整质量门禁
135
+
136
+ ## 预期输出
137
+
138
+ - Monorepo 目录结构清晰(`apps/` 应用、`packages/` 共享包、`tooling/` 工具)
139
+ - `pnpm-workspace.yaml` 和 `turbo.json` / `nx.json` 配置正确
140
+ - 内部包使用 `workspace:*` 协议,无循环依赖
141
+ - 构建、lint、test 任务可通过根命令一键执行,缓存命中率高
142
+ - CI 能区分 affected 快速反馈和 release 全量验证,缓存配置不会泄露密钥或隐藏依赖边界问题
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: fec-motion-interaction
3
+ description: 用于设计、实现或审查前端交互动效、页面转场、滚动动画、Framer Motion、GSAP、Lottie、CSS 动画、动效强度、动画性能、减少动效行为或兼具表现力与可访问性的 UI 动效。不要用于仅 SVG 路径绘制、Canvas/WebGL 渲染或普通 hover 状态;中文触发词包括 动效设计、交互动效、页面转场、滚动动画、Framer Motion、GSAP。
4
+ ---
5
+
6
+ # 交互动效
7
+
8
+ 适用于需要把页面转场、滚动叙事、组件入场、微交互和反馈节奏设计成可维护、可降级、可验证的前端动效任务。需要具体实现模式时加载 [motion-patterns.md](references/motion-patterns.md)。
9
+
10
+ ## 用途
11
+
12
+ 为前端界面选择合适动效工具、强度和质量门禁。
13
+
14
+ ## 流程
15
+
16
+ 1. 判断动效职责
17
+ - 先写清动效服务的用户意图:定位、反馈、层级变化、状态确认、叙事引导或品牌记忆。
18
+ - 工具型界面默认克制,优先保障扫描效率;营销页和作品页可增加节奏,但不能遮挡主要信息。
19
+ - 若动效只装饰而不改善理解、反馈或品牌识别,应删掉或改成静态视觉处理。
20
+ - loading、skeleton、toast、错误提示和成功反馈属于状态沟通;动效只能增强反馈节奏,不能替代文本、语义或可见状态。
21
+
22
+ 2. 选择技术路线
23
+ - CSS transition/keyframes:hover、focus、toast、简单入场和小型状态反馈。
24
+ - Framer Motion:React 状态驱动、布局过渡、列表编排和可中断的组件级动画。
25
+ - GSAP:时间轴、滚动触发、复杂序列和跨元素精确编排。
26
+ - Lottie:设计工具输出的图标或空状态动画,按需懒加载。
27
+ - CSS scroll-driven animation:可接受渐进增强且无需旧浏览器一致性时使用。
28
+
29
+ 3. 定义强度等级
30
+ - Level 1-2:只用 150-250ms opacity/transform,适合后台、表单和高频工具。
31
+ - Level 3-4:加入短 stagger、局部 spring 和轻量 reveal,适合仪表盘、设置页和管理台。
32
+ - Level 5-6:加入视差、布局 morph、指针响应,适合产品展示和交互式首页。
33
+ - Level 7+:使用滚动叙事、固定段落或 3D/WebGL 配合,必须单独做移动端和 reduced-motion 降级。
34
+ - 场景默认值:公共服务、医疗、金融和强可访问性产品从 Level 1-2 起步;SaaS 工具和数据后台从 Level 2-3 起步;营销页、品牌页和作品集可从 Level 4-6 起步;实验性活动页或沉浸式叙事才考虑 Level 7+。
35
+ - 如果 UI 设计流程已经设定了动效强度拨盘,沿用该拨盘;不要因为引入了某个动效库就自动提高强度。
36
+
37
+ 4. 建立性能边界
38
+ - 只高频动画 `transform`、`opacity`,谨慎使用 `filter` 和 `clip-path`。
39
+ - GSAP、Lottie、Three.js、重型动画组件必须动态导入或隔离在叶子组件。
40
+ - 持续动画需要暂停条件:不可见、标签页隐藏、用户关闭、低电量或 reduced motion。
41
+ - 不在滚动事件中同步读写布局;使用 IntersectionObserver、ScrollTimeline 或节流后的 rAF。
42
+ - 滚动叙事、stagger、spring、磁吸指针和视差效果必须各自有明确职责;同一屏不要同时堆叠多种高强度运动语言。
43
+ - 长页面中重复 reveal 动画要控制节奏,避免每个区块都以同一种延迟、方向和 easing 进入,造成模板感和滚动疲劳。
44
+
45
+ 5. 设计可访问降级
46
+ - 所有非必要动效读取 `prefers-reduced-motion`,降级为静态、淡入或即时状态。
47
+ - 自动播放或循环动效若超过 5 秒,应提供暂停方式或只在局部非关键区域运行。
48
+ - 不闪烁超过每秒 3 次;不要用动效作为唯一状态提示。
49
+ - focus ring、错误提示、成功反馈必须在无动效时同样清楚。
50
+ - 手势动画必须有点击、键盘或明确控件替代;拖拽、滑动和长按不能成为唯一操作路径。
51
+
52
+ 6. 验证交付
53
+ - 在 375px、768px、1440px 检查动效是否遮挡文案、按钮或表格内容。
54
+ - 检查首次加载 bundle 是否因动效库显著膨胀。
55
+ - 手动开启 reduced motion,确认动画被禁用或弱化。
56
+ - 用性能面板或实际设备确认滚动和关键交互没有明显掉帧。
57
+ - 检查动效强度是否匹配页面类型:工作台不应出现营销式滚动剧场,作品集也不应只有默认 hover 淡入。
58
+ - 对滚动触发序列确认用户可以快速到达内容,不因 pinned 区块、过长时间轴或不可中断过渡丢失上下文。
59
+
60
+ ## 约束
61
+
62
+ - 不在同一个组件内混用 Framer Motion 和 GSAP 控制同一元素。
63
+ - 不用动效掩盖 loading、empty、error、disabled 等状态缺失。
64
+ - 不为普通后台表格、配置页和高频工作台默认加入大幅视差或滚动劫持。
65
+ - 不让所有区块使用相同 reveal 模板;动效节奏应随信息层级和用户任务变化。
66
+ - 不动画 `width`、`height`、`top`、`left`、`margin`、`padding` 等会频繁触发布局的属性。
67
+ - 不把大型 Lottie JSON、GSAP 插件或 3D 场景放入首屏同步包。
68
+ - 不让动画改变阅读顺序、焦点顺序或键盘可达性。
69
+ - 不用 skeleton 长时间占位掩盖真实加载失败;超过预期时应转入可理解的 loading、retry 或 error 状态。
70
+
71
+ ## 预期输出
72
+
73
+ 输出应包含动效目的、技术选型、强度等级、降级策略、性能边界和验证结果。完成后交互动效应帮助用户理解状态和层级,在 reduced-motion 与低端设备上仍可用,并且不显著拖慢首屏或滚动体验。
@@ -0,0 +1,112 @@
1
+ # 交互动效实现模式
2
+
3
+ ## CSS 微交互
4
+
5
+ ```css
6
+ .action {
7
+ transition:
8
+ transform 180ms ease,
9
+ opacity 180ms ease,
10
+ background-color 180ms ease;
11
+ }
12
+
13
+ .action:hover {
14
+ transform: translateY(-1px);
15
+ }
16
+
17
+ .action:active {
18
+ transform: translateY(0) scale(0.98);
19
+ }
20
+
21
+ @media (prefers-reduced-motion: reduce) {
22
+ .action {
23
+ transition-duration: 1ms;
24
+ }
25
+
26
+ .action:hover,
27
+ .action:active {
28
+ transform: none;
29
+ }
30
+ }
31
+ ```
32
+
33
+ ## Framer Motion 组件入场
34
+
35
+ ```tsx
36
+ import { motion, useReducedMotion } from "framer-motion";
37
+
38
+ export function MotionPanel({ children }: { children: React.ReactNode }) {
39
+ const reduceMotion = useReducedMotion();
40
+
41
+ return (
42
+ <motion.section
43
+ initial={reduceMotion ? false : { opacity: 0, y: 12 }}
44
+ animate={{ opacity: 1, y: 0 }}
45
+ transition={{ duration: 0.24, ease: [0.16, 1, 0.3, 1] }}
46
+ >
47
+ {children}
48
+ </motion.section>
49
+ );
50
+ }
51
+ ```
52
+
53
+ ## GSAP 时间轴清理
54
+
55
+ ```tsx
56
+ import { useLayoutEffect, useRef } from "react";
57
+ import gsap from "gsap";
58
+
59
+ export function RevealTimeline() {
60
+ const rootRef = useRef<HTMLDivElement>(null);
61
+
62
+ useLayoutEffect(() => {
63
+ if (!rootRef.current) return;
64
+
65
+ const context = gsap.context(() => {
66
+ gsap
67
+ .timeline({ defaults: { ease: "power2.out" } })
68
+ .from("[data-title]", { opacity: 0, y: 16, duration: 0.28 })
69
+ .from(
70
+ "[data-item]",
71
+ { opacity: 0, y: 10, stagger: 0.04, duration: 0.2 },
72
+ "-=0.08",
73
+ );
74
+ }, rootRef);
75
+
76
+ return () => context.revert();
77
+ }, []);
78
+
79
+ return (
80
+ <div ref={rootRef}>
81
+ <h2 data-title>Release health</h2>
82
+ <div data-item>Build</div>
83
+ <div data-item>Tests</div>
84
+ <div data-item>Deploy</div>
85
+ </div>
86
+ );
87
+ }
88
+ ```
89
+
90
+ ## 重型动效懒加载
91
+
92
+ ```tsx
93
+ import { lazy, Suspense } from "react";
94
+
95
+ const InteractiveShowcase = lazy(() => import("./InteractiveShowcase"));
96
+
97
+ export function ShowcaseSlot() {
98
+ return (
99
+ <Suspense fallback={<div aria-busy="true" />}>
100
+ <InteractiveShowcase />
101
+ </Suspense>
102
+ );
103
+ }
104
+ ```
105
+
106
+ ## 审查清单
107
+
108
+ - 动画目标能用一句话说明,且服务信息层级或状态反馈。
109
+ - 高吞吐界面不使用滚动劫持或长时间入场遮挡。
110
+ - reduced-motion 下信息仍完整,焦点与阅读顺序不变化。
111
+ - 动画库按需加载,持续动画可暂停或卸载清理。
112
+ - 关键设备上检查掉帧、文字遮挡和首屏 bundle 变化。
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: fec-nextjs-project-standard
3
+ description: 用于创建或审查 Next.js 14+ App Router 项目、文件路由、layout、服务端/客户端组件边界、SSR/SSG/ISR、streaming、metadata、middleware、server actions 或 Next 特定数据获取。通用客户端 React 组件架构另按项目 React 约定处理;中文触发词包括 Next.js、App Router。
4
+ ---
5
+
6
+ # Next.js 项目规范
7
+
8
+ 适用于使用 Next.js 14+ 与 App Router 的仓库。
9
+
10
+ ## 用途
11
+
12
+ 规范 Next.js 14+ 项目中 App Router、SSR/SSG/ISR 渲染模式、数据获取、路由布局、中间件和 SEO 元数据的工程实践,确保服务端优先、性能优化和可维护性。
13
+
14
+ ## 流程
15
+
16
+ 1. 先识别目标属于 App Router、布局、服务端数据、middleware、metadata 还是客户端交互。
17
+ 2. 默认服务端组件优先;只有需要浏览器 API、交互状态或事件处理时才使用 `'use client'`。
18
+ 3. 明确 SSR / SSG / ISR / CSR 渲染模式和 Next fetch/cache 策略。
19
+ 4. 为路由补齐 `loading.tsx`、`error.tsx`、`not-found.tsx`、metadata 和敏感逻辑的服务端边界。
20
+ 5. 引入第三方库前检查是否支持 Server Component;浏览器专属、动效、图表、编辑器和 WebGL 库必须放进客户端叶子组件并按需加载。
21
+ 6. 对动态渲染、缓存失效、RSC 序列化、route handler、middleware 和首屏 bundle 做证据优先审查;不确定时先收集构建、trace、headers 或路由行为证据。
22
+ 7. 客户端组件架构问题分流到 React 项目 workflow。
23
+
24
+ ## 项目结构
25
+
26
+ ```
27
+ src/
28
+ ├── app/ # App Router
29
+ │ ├── layout.tsx # 根布局
30
+ │ ├── page.tsx # 首页
31
+ │ ├── loading.tsx # 全局 loading UI
32
+ │ ├── error.tsx # 全局错误边界
33
+ │ ├── not-found.tsx # 404
34
+ │ ├── globals.css
35
+ │ │
36
+ │ ├── (auth)/ # 路由组
37
+ │ │ ├── login/
38
+ │ │ │ └── page.tsx
39
+ │ │ └── register/
40
+ │ │ └── page.tsx
41
+ │ │
42
+ │ ├── (dashboard)/ # 仪表盘路由组
43
+ │ │ ├── layout.tsx # 共享布局
44
+ │ │ ├── dashboard/
45
+ │ │ │ └── page.tsx
46
+ │ │ └── users/
47
+ │ │ ├── page.tsx
48
+ │ │ └── [id]/
49
+ │ │ └── page.tsx
50
+ │ │
51
+ │ └── api/ # API Routes
52
+ │ └── users/
53
+ │ └── route.ts
54
+ │
55
+ ├── components/ # 共享组件
56
+ ├── lib/ # 工具、配置
57
+ ├── hooks/
58
+ ├── services/
59
+ └── types/
60
+ ```
61
+
62
+ ## 渲染模式
63
+
64
+ | 模式 | 使用场景 | 实现方式 |
65
+ | ------- | ---------------- | ----------------------------------------------- |
66
+ | **SSR** | 动态、需实时数据 | 默认,`fetch` 不缓存或 `cache: 'no-store'` |
67
+ | **SSG** | 静态内容 | `generateStaticParams` + 静态 `fetch` |
68
+ | **ISR** | 定期更新 | `revalidate` 或 `revalidatePath` |
69
+ | **CSR** | 客户端交互 | `'use client'` + `useEffect` 或 SWR/React Query |
70
+
71
+ ## 数据获取
72
+
73
+ - 服务端组件:直接 `async` 或 `fetch`,不暴露 `useEffect`
74
+ - 客户端组件:`useEffect` + `useState`,或 SWR / React Query
75
+ - 优先在服务端获取数据,减少客户端水合
76
+ - 使用 `loading.tsx` 和 Suspense 包裹异步区块,提供流式体验
77
+ - 缓存策略要写清 `force-cache`、`no-store`、`revalidate`、tag/path revalidation 或用户私有数据约束
78
+ - 任何会让路由从静态变动态的读取(cookies、headers、searchParams、未缓存 fetch)都要说明原因和验证方式
79
+
80
+ ## 路由与布局
81
+
82
+ - 路由组 `(auth)` 不改变 URL,只影响布局
83
+ - 动态路由 `[id]` 配合 `generateStaticParams` 做 SSG
84
+ - `layout.tsx` 包裹子路由,共享 UI 与布局
85
+ - `page.tsx` 为叶子路由,不可嵌套
86
+
87
+ ## 中间件
88
+
89
+ - 放在 `middleware.ts` 根目录
90
+ - 用于鉴权、重定向、rewrite、Header 修改
91
+ - 尽量短小,避免阻塞请求
92
+
93
+ ## 元数据与 SEO
94
+
95
+ - 使用 `metadata` 或 `generateMetadata` 导出
96
+ - 支持 `title`、`description`、`openGraph`、`twitter` 等
97
+ - 动态路由用 `generateMetadata(params)` 生成
98
+
99
+ ## 约束
100
+
101
+ - 服务端组件默认,仅在需要客户端交互时加 `'use client'`
102
+ - 不在服务端组件中直接使用 `useState`、`useEffect`、浏览器 API
103
+ - 敏感逻辑(如鉴权)放在服务端或 API Route,不暴露在客户端
104
+ - 图片使用 `next/image`,字体使用 `next/font`
105
+ - 不把密钥、内部 API 地址或服务端 token 放入 `NEXT_PUBLIC_` 环境变量。
106
+ - 不让大型动效库、3D 场景、富文本编辑器或地图 SDK 进入根布局同步 bundle。
107
+ - 首屏媒体必须有确定尺寸、真实资源和合理 priority;不要用远程占位图撑布局。
108
+ - 不在没有指标、响应头、构建输出或路由行为证据时断言某路由“已缓存”或“必须动态”。
109
+ - Middleware 只处理路由级轻量决策,不承载重型鉴权查询、日志批处理或可放到 route handler 的业务逻辑。
110
+
111
+ ## 与客户端 UI 模式的分工
112
+
113
+ - **服务端**:渲染模式、数据获取与缓存、`loading.tsx` / `error.tsx`、路由与布局等以本 skill 为准。
114
+ - **`'use client'` 组件**:组合与复合组件、表单、客户端状态、列表虚拟化、动效与键盘/焦点等,与纯 React 项目一致,遵循项目中的 React 规则(如 `.claude/rules/fec-react.md`)。
115
+ - **权限与客户端数据**:鉴权、RBAC、redirect、客户端 server state 和缓存失效应按对应专项 workflow 处理;Next 服务端 fetch/cache 仍以本 skill 为准。
116
+
117
+ ## 预期输出
118
+
119
+ - 页面组件按 App Router 约定组织(`app/` 目录、`page.tsx`、`layout.tsx`、`loading.tsx`、`error.tsx`)
120
+ - 渲染模式选择正确(SSR/SSG/ISR/CSR),数据获取路径清晰
121
+ - 元数据和 SEO 配置完整(title、description、openGraph)
122
+ - 敏感逻辑在服务端,客户端组件仅处理交互
123
+ - 缓存、动态渲染和首屏 bundle 决策有可复查证据,性能风险可分流到专项性能 workflow
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: fec-nuxt-project-standard
3
+ description: 用于创建或审查 Nuxt 3 项目、文件路由、pages、layouts、SSR/SSG/SPA 行为、Nuxt 数据获取、route middleware、plugins、modules、server routes 或 Nuxt 特定 Vue 3 约定。通用 Vue 组件架构另按项目 Vue 约定处理;中文触发词包括 Nuxt、Nuxt 3。
4
+ ---
5
+
6
+ # Nuxt 3 项目规范
7
+
8
+ 适用于使用 Nuxt 3 + Vue 3 + TypeScript 的仓库。
9
+
10
+ ## 用途
11
+
12
+ 规范 Nuxt 3 项目中 SSR/SSG 渲染模式、组合式 API、自动导入、数据获取、路由中间件和模块插件的工程实践,确保约定式开发和类型安全。
13
+
14
+ ## 流程
15
+
16
+ 1. 先识别目标属于 Nuxt pages/layouts、渲染模式、数据获取、route middleware、plugin/module 还是 server route。
17
+ 2. 明确 SSR / SSG / SPA 选择,避免服务端可执行代码依赖 `window` 或 `document`。
18
+ 3. 数据获取优先使用 Nuxt 的 `useFetch` / `useAsyncData`,并检查水合一致性。
19
+ 4. 路由鉴权、redirect 和权限问题与路由保护 workflow 对齐。
20
+ 5. 通用 Vue 组件架构问题分流到 Vue 项目 workflow。
21
+
22
+ ## 项目结构
23
+
24
+ ```
25
+ ├── app.vue # 根组件
26
+ ├── nuxt.config.ts # Nuxt 配置
27
+ │
28
+ ├── pages/ # 基于文件的路由
29
+ │ ├── index.vue # /
30
+ │ ├── login.vue # /login
31
+ │ ├── dashboard/
32
+ │ │ ├── index.vue # /dashboard
33
+ │ │ └── users/
34
+ │ │ ├── index.vue # /dashboard/users
35
+ │ │ └── [id].vue # /dashboard/users/:id
36
+ │ └── [...slug].vue # 捕获所有
37
+ │
38
+ ├── layouts/ # 布局
39
+ │ ├── default.vue
40
+ │ └── auth.vue
41
+ │
42
+ ├── components/ # 自动导入组件
43
+ │ ├── Button/
44
+ │ │ └── Button.vue
45
+ │ └── AppHeader.vue
46
+ │
47
+ ├── composables/ # 组合式函数(自动导入)
48
+ │ ├── useAuth.ts
49
+ │ └── useFetch.ts
50
+ │
51
+ ├── server/ # 服务端 API
52
+ │ ├── api/ # API 路由
53
+ │ │ └── users/
54
+ │ │ └── index.get.ts
55
+ │ ├── middleware/ # 服务端中间件
56
+ │ └── utils/ # 服务端工具
57
+ │
58
+ ├── plugins/ # 插件
59
+ │ └── i18n.client.ts
60
+ │
61
+ ├── middleware/ # 路由中间件
62
+ │ └── auth.ts
63
+ │
64
+ ├── public/ # 静态资源
65
+ ├── assets/ # 需构建的资源
66
+ └── types/ # 类型定义
67
+ ```
68
+
69
+ ## 渲染模式
70
+
71
+ | 模式 | 配置 | 说明 |
72
+ | ------- | --------------- | -------------- |
73
+ | **SSR** | 默认 | `ssr: true` |
74
+ | **SSG** | `nuxt generate` | 预渲染所有页面 |
75
+ | **SPA** | `ssr: false` | 纯客户端渲染 |
76
+
77
+ ```ts
78
+ // nuxt.config.ts
79
+ export default defineNuxtConfig({
80
+ ssr: true, // 或 false
81
+ });
82
+ ```
83
+
84
+ ## 数据获取
85
+
86
+ - `useFetch` / `useAsyncData`:服务端 + 客户端,自动去重
87
+ - `$fetch`:直接请求,适合服务端或一次性调用
88
+ - `useLazyAsyncData`:不阻塞导航,适合非首屏
89
+ - 避免在 `setup` 顶层混用同步/异步逻辑导致水合不匹配
90
+
91
+ ## 路由与布局
92
+
93
+ - `pages/` 下文件自动生成路由
94
+ - 动态路由:`[id].vue`、`[...slug].vue`
95
+ - 布局:`layout` 选项或 `layouts/default.vue` 默认
96
+ - 嵌套路由:`pages/parent/child.vue` 需配合 `NuxtPage`
97
+
98
+ ## 中间件
99
+
100
+ - `middleware/` 下文件自动注册
101
+ - 页面级:`definePageMeta({ middleware: ['auth'] })`
102
+ - 全局:`nuxt.config.ts` 的 `router.middleware`
103
+ - 服务端中间件:`server/middleware/`
104
+
105
+ ## 插件与模块
106
+
107
+ - 插件:`plugins/*.ts`,支持 `.client`、`.server` 后缀
108
+ - 模块:`modules/` 或 `node_modules`,在 `nuxt.config` 中 `modules: []`
109
+
110
+ ## 约束
111
+
112
+ - 服务端可访问的代码不要依赖 `window`、`document`
113
+ - 使用 `useState` 共享状态时注意 SSR 序列化
114
+ - 图片使用 `NuxtImg`,链接使用 `NuxtLink`
115
+ - 避免在 `setup` 顶层使用 `await` 导致阻塞,优先用 `useAsyncData` / `useFetch`
116
+
117
+ ## 预期输出
118
+
119
+ - 页面按 `pages/` 约定式路由组织,动态路由正确配置
120
+ - 渲染模式(SSR/SSG/SPA)选择正确,`nuxt.config.ts` 配置清晰
121
+ - 数据获取使用 `useFetch` / `useAsyncData`,自动去重和水合
122
+ - Composables 和组件自动导入正确,服务端/客户端边界清晰
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: fec-performance-optimization
3
+ description: 用于诊断或改进前端性能、Core Web Vitals、包体积、运行时渲染成本、网络瀑布、内存泄漏、长任务、Lighthouse 问题或性能预算;中文触发词包括 性能优化、页面卡顿、首屏慢、包体积、Web Vitals。
4
+ ---
5
+
6
+ # 前端性能优化
7
+
8
+ ## 用途
9
+
10
+ 用可度量的方式定位前端性能瓶颈,并把优化建议收敛到用户主路径、构建产物和运行时证据。
11
+
12
+ ## 流程
13
+
14
+ 1. 锁定体验目标
15
+ - 明确问题属于首屏加载、交互延迟、滚动卡顿、内存上涨、网络瀑布、包体积,还是视觉稳定性。
16
+ - 记录路由、设备、网络条件、浏览器、复现步骤和当前可用指标。
17
+ - 没有指标时先建立基线,不直接给出“优化一切”的泛化建议。
18
+
19
+ 2. 建立度量基线
20
+ - 读取项目脚本、构建配置、依赖和已有性能报告。
21
+ - 对页面体验优先使用 Lighthouse、Performance trace、React Profiler、Vue Devtools、Memory snapshot 或 RUM 数据。
22
+ - 对包体优先看构建产物、source map、依赖重复、首屏 chunk 和动态 import 边界。
23
+ - 对运行时卡顿优先看长任务、重复渲染、昂贵计算、同步循环、布局抖动和大列表。
24
+ - 如果已有线上监控、平台指标或 CI 产物,先用它们确认受影响路由、设备、时间窗和用户主路径,再决定读哪些源码。
25
+
26
+ 3. 分层定位
27
+ - 加载层:关键 CSS、字体、图片、脚本阻塞、预加载和缓存。
28
+ - 渲染层:不稳定 key、过宽 Context、无意义 effect、重复计算、组件树过大。
29
+ - 数据层:串行请求、重复请求、过大 payload、缺少分页或缓存策略。
30
+ - 主线程:JSON/CSV 解析、图片处理、复杂排序过滤、同步压缩和大对象深拷贝。
31
+ - 资源层:事件监听、定时器、订阅、WebGL/Canvas 资源和对象 URL 未释放。
32
+
33
+ 4. 形成优化方案
34
+ - 每个建议必须绑定位置、影响、改法和验证方式。
35
+ - 优先处理高频主路径和 P95 体验;低频后台任务不抢占首屏预算。
36
+ - 先做低风险高收益改动,如懒加载、去重、缓存、尺寸预留、虚拟列表、稳定引用和释放资源。
37
+ - 对会牺牲可维护性的技巧,必须说明收益证据和替代方案。
38
+ - 建议进入实现前先过候选门禁:是否有指标支撑、能否定位到路由/组件/chunk/请求、是否可由前端验证、是否存在更小改动。
39
+
40
+ 5. 验证回归
41
+ - 重新运行受影响构建、测试和性能采集命令。
42
+ - 对比优化前后指标或产物体积。
43
+ - 确认 loading、empty、error、offline、reduced-motion 和移动端状态未被优化破坏。
44
+
45
+ ## 预算
46
+
47
+ | 范围 | 默认目标 | 说明 |
48
+ | ---- | -------- | ---- |
49
+ | LCP | 约 2.5s 内 | 以核心页面、目标地区网络和真实设备为准 |
50
+ | CLS | 低于 0.1 | 媒体、广告、异步内容需要预留空间 |
51
+ | INP | 约 200ms 内 | 优先拆分长任务和降低交互路径重渲染 |
52
+ | 初始 JS | 遵循项目预算 | 没有预算时先报告当前 gzip / brotli 体积 |
53
+ | 主线程 | 避免连续长任务 | 大计算考虑分片、缓存或 Worker |
54
+
55
+ ## 检查项
56
+
57
+ - 首屏资源是否包含非首屏组件、图表、编辑器、地图或全量图标库。
58
+ - 图片是否有明确尺寸、合适格式、懒加载和首屏优先级。
59
+ - 列表、表格、时间线是否需要虚拟化或分页。
60
+ - 搜索、筛选、排序是否在热路径重复 O(n*m) 扫描。
61
+ - 请求是否可并行、可缓存、可取消、可复用。
62
+ - 监听、订阅、定时器、AbortController、Object URL、Canvas/WebGL 资源是否对称清理。
63
+
64
+ ## 约束
65
+
66
+ - 不做没有目标和证据的过早优化。
67
+ - 不靠关闭功能、删除状态反馈或降低可访问性来换性能分数。
68
+ - 不为一次 Lighthouse 分数牺牲真实用户主路径。
69
+ - 不引入大型新依赖解决小问题;先利用项目已有工具和浏览器能力。
70
+ - 不把后端、网络和浏览器侧问题混为一谈;前端能验证的部分要单独列证据。
71
+ - 不从 repo-wide grep 直接跳到优化结论;先用指标或复现路径收窄候选,再读相关源码。
72
+
73
+ ## 详细参考
74
+
75
+ 撰写性能分析报告时,加载 [references/report-template.md](references/report-template.md)。
76
+ 需要按 React、Vue、Next.js 或 Nuxt 分类定位框架专项性能风险时,加载 [references/framework-performance-patterns.md](references/framework-performance-patterns.md)。
77
+
78
+ ## 预期输出
79
+
80
+ 输出有证据链的性能分析报告,说明基线、候选门禁、瓶颈、优化建议、验证方式和剩余风险。报告保存为 `reports/performance-review-YYYY-MM-DD-HHmmss.md`。