@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,47 +1,47 @@
1
- # 重构项目规则
1
+ # Refactor project rules
2
2
 
3
- 当任务涉及从现有项目重构、迁移或重写前端代码时,应用本文件。
3
+ This document applies when the task involves refactoring, migrating, or rewriting front-end code from an existing project.
4
4
 
5
- ## 目标
5
+ ## Target
6
6
 
7
- - **视觉和交互**:与原项目一致,用户无感知差异
8
- - **代码质量**:更简洁、易维护,符合目标框架规范
9
- - **业务功能**:与原项目保持一致,**不得缺失功能**;重构前后行为等价
7
+ - **Visual and interactive**: consistent with the original project, no perceived difference by users
8
+ - **Code Quality**: more concise, easier to maintain, and in line with the target framework specifications
9
+ - **Business functions**: consistent with the original project, **no missing functions**; behaviors before and after reconstruction are equivalent
10
10
 
11
- ## 图片与图标
11
+ ## Pictures and Icons
12
12
 
13
- - 直接使用原项目的图片资源路径,不重新托管或替换
14
- - 可使用 SVG 图片(`<img src="*.svg" />` 或 CSS `background-image`),**禁止使用内联 SVG**(`<svg>...</svg>` 直接写在组件中)
15
- - **若原项目使用了 iconfont 或 IcoMoon 图标,重构时继续使用**,保持图标体系一致;不替换为其他图标方案
16
- - 图标优先使用原项目已有的图标文件(iconfont / IcoMoon / 已有 SVG),必要时可引入 SVG 文件作为独立资源
13
+ - Directly use the image resource path of the original project without rehosting or replacing it.
14
+ - SVG images (`<img src="*.svg" />` or CSS `background-image`) can be used, **inline SVG is prohibited** (`<svg>...</svg>` written directly in the component)
15
+ - **If the original project uses iconfont or IcoMoon icons, continue to use them** during reconstruction to keep the icon system consistent; do not replace it with other icon schemes
16
+ - For icons, priority is given to using existing icon files in the original project (iconfont / IcoMoon / existing SVG). If necessary, SVG files can be introduced as independent resources
17
17
 
18
- ## 样式
18
+ ## Style
19
19
 
20
- - 布局样式对齐原项目视觉效果,但**只参考原项目效果,不照搬其 CSS**
21
- - 优先使用 **flex 弹性布局**,避免 `float`、复杂 `position`、冗余嵌套
22
- - 避免不合理写法:`!important` 滥用、过深选择器、重复定义
23
- - **组件中禁止使用内联样式**(`style={{ ... }}` / `style="..."`),样式统一放在 CSS Modules、Tailwind 类或样式文件中,便于维护
20
+ - The layout style aligns with the visual effects of the original project, but **only refers to the original project effects and does not copy its CSS**
21
+ - Prioritize the use of **flex elastic layout** to avoid `float`, complex `position`, and redundant nesting
22
+ - Avoid unreasonable writing methods: `!important` abuse, excessively deep selectors, and repeated definitions
23
+ - **Inline styles are prohibited in components** (`style={{ ... }}` / `style="..."`). Styles are unified in CSS Modules, Tailwind classes or style files for easy maintenance.
24
24
 
25
- ## 强约束
25
+ ##Strong constraints
26
26
 
27
- - 业务功能与原项目完整等价,不得缺失
28
- - 图片使用原项目资源,无内联 SVG;若原项目用 iconfont/IcoMoon 则继续使用
29
- - 样式参考原项目效果但不照搬 CSS,优先 flex 布局,无内联样式
30
- - 对公共 API、路由、事件、埋点、权限、缓存和错误状态建立行为清单,重构前后逐项核对
31
- - 涉及页面、组件、路由、表单、弹窗、导航或关键用户流程的迁移,必须使用 Playwright 或同等真实浏览器验证方式对关键路径做对比验证
32
- - 对视觉敏感页面,应补充截图对比或人工截图验收;动态内容、动画、字体和环境差异需明确屏蔽、稳定化或说明
33
- - 对纯逻辑、类型、构建或无 UI 的迁移,不强制 Playwright,应选择更贴近风险的验证层:type-check、unit test、component test、build 或 lint
34
- - 验证目标不是像素级完全一致,而是确认业务功能无缺失、关键交互等价、主要视觉布局无非预期偏差,并且代码比旧实现更清晰、可维护
27
+ - The business functions are completely equivalent to the original project and must not be missing.
28
+ - Images use original project resources, no inline SVG; if the original project uses iconfont/IcoMoon, continue to use it
29
+ - The style refers to the original project effect but does not copy CSS, giving priority to flex layout, no inline style
30
+ - Establish a behavior list for public APIs, routing, events, hidden points, permissions, caches and error status, and check them one by one before and after reconstruction
31
+ - For migrations involving pages, components, routes, forms, pop-ups, navigation or key user processes, Playwright or equivalent real browser verification methods must be used to compare and verify the critical paths.
32
+ - For visually sensitive pages, screenshot comparison or manual screenshot acceptance should be supplemented; dynamic content, animation, fonts and environmental differences need to be clearly blocked, stabilized or explained
33
+ - For pure logic, type, build or no UI migrations, Playwright is not mandatory and a validation layer closer to the risk should be chosen: type-check, unit test, component test, build or lint
34
+ - The verification goal is not to be completely consistent at the pixel level, but to confirm that there are no missing business functions, key interactions are equivalent, there are no unexpected deviations in the main visual layout, and the code is clearer and maintainable than the old implementation.
35
35
 
36
- ## 死代码清理
36
+ ## Dead code cleanup
37
37
 
38
- 清理未使用代码、导出、样式或依赖时:
38
+ When cleaning unused code, exports, styles or dependencies:
39
39
 
40
- - 先建立验证基线,再做清理。
41
- - 使用工具或搜索证据证明候选项无引用。
42
- - 将候选项分为 SAFE、CAUTION、DANGER。
43
- - 仅自动清理 SAFE 项;路由、配置、运行时模板、动态 import 和公开 API 默认视为高风险。
44
- - 每批清理后运行受影响验证命令。
45
- - 若验证失败,先回到最近一批候选项定位,不继续扩大清理范围。
40
+ - Establish a verification baseline first, then clean it up.
41
+ - Use tools or search for evidence that candidates have no citations.
42
+ - Classify candidates into SAFE, CAUTION, and DANGER.
43
+ - Only SAFE items are automatically sanitized; routing, configuration, runtime templates, dynamic imports, and public APIs are considered high risk by default.
44
+ - Run affected verification command after each batch cleanup.
45
+ - If the verification fails, return to the most recent batch of candidates and do not continue to expand the scope of cleaning.
46
46
 
47
- 不要把死代码清理与功能重写、视觉调整或依赖升级混在同一个改动里。
47
+ Don’t mix dead code cleanup with feature rewrites, visual tweaks, or dependency upgrades in the same change.
@@ -1,40 +1,40 @@
1
- # 渲染模式选型
1
+ #Rendering mode selection
2
2
 
3
- 当项目需要选择或评估 CSR / SSR / SSG / ISR / RSC 时,参考本文件。本文只保留跨框架决策约束;Next.js App Router 细节交给 `fec-nextjs-project-standard`,Nuxt 细节交给 `fec-nuxt-project-standard`,性能证据交给 `fec-performance-optimization`。
3
+ Reference this document when a project needs to select or evaluate CSR/SSR/SSG/ISR/RSC. This article only retains cross-framework decision constraints; Next.js App Router details are left to `fec-nextjs-project-standard`, Nuxt details are left to `fec-nuxt-project-standard`, and performance evidence is left to `fec-performance-optimization`.
4
4
 
5
- ## 渲染模式概览
5
+ ## Rendering mode overview
6
6
 
7
- | 模式 | 生成时机 | 典型适用 |
7
+ | Mode | Generation timing | Typical application |
8
8
  | ---- | -------- | -------- |
9
- | CSR | 浏览器运行时 | 登录后后台、内部工具、高交互 SPA |
10
- | SSR | 请求时服务端 | SEO 关键且内容实时的公开页 |
11
- | SSG | 构建时 | 文档、博客、营销页、变化慢的公开内容 |
12
- | ISR | 构建时 + 按需再生成 | 页面数量多、内容更新频繁但允许延迟 |
13
- | RSC | 服务端组件渲染 | Next.js App Router 中需要减少客户端 JS 的场景 |
14
-
15
- ## 选型原则
16
-
17
- - SEO 必须且内容实时:优先 SSR,并明确缓存、超时和错误降级。
18
- - SEO 必须且内容稳定:优先 SSG;页面数量巨大或更新频繁时考虑 ISR。
19
- - 登录后后台、强交互工作区、内部工具:优先 CSR,公开登录/注册页可单独 SSG/SSR。
20
- - 混合产品:公开页与私有页可以采用不同模式,不为统一架构牺牲体验或成本。
21
- - 页面数量、更新频率、服务器成本、部署平台、缓存策略和团队运维能力必须一起评估。
22
- - RSC 只在支持的框架和路由体系中使用;客户端交互、浏览器 API 和高频状态仍放在客户端叶子组件。
23
-
24
- ## 实施约束
25
-
26
- - SSR / RSC 路径不得直接依赖 `window`、`document`、localStorage 或浏览器专属库。
27
- - Hydration 前后的 HTML、时间、随机数、用户偏好和媒体查询结果要保持一致,避免水合不匹配。
28
- - 服务端数据获取必须有超时、错误降级和缓存策略。
29
- - SSG / ISR 需要明确未预渲染路径、revalidate / 失效策略和回滚方式。
30
- - 客户端大型动效库、图表、编辑器、地图、WebGL/Canvas 等应按需加载,不进入根布局同步 bundle。
31
- - 不在没有响应头、构建输出、trace、路由行为或线上指标证据时断言某路由“已缓存”或“必须动态”。
32
-
33
- ## 检查清单
34
-
35
- - [ ] 明确公开页与私有页、SEO 需求和实时性需求。
36
- - [ ] 明确每类页面使用 CSR / SSR / SSG / ISR / RSC 的理由。
37
- - [ ] 评估页面数量、构建时间、服务器成本和缓存失效策略。
38
- - [ ] 检查 SSR/RSC 代码没有浏览器 API 依赖和不可序列化 props。
39
- - [ ] 确认 loading、error、not-found、离线和权限状态不会因渲染模式丢失。
40
- - [ ] 用构建输出、响应头、trace 或路由行为验证最终模式。
9
+ | CSR | Browser runtime | Post-login backend, internal tools, high-interaction SPA |
10
+ | SSR | Server-side on request | SEO-critical and real-time content public page |
11
+ | SSG | Build-time | Documentation, blogs, marketing pages, slow-changing public content |
12
+ | ISR | Build time + regenerate on demand | Large number of pages, frequent content updates but allow for delays |
13
+ | RSC | Server-side component rendering | Scenarios where client-side JS needs to be reduced in Next.js App Router |
14
+
15
+ ## Selection principles
16
+
17
+ - SEO is a must and content is live: Prioritize SSR and be clear about caching, timeouts and error degradation.
18
+ - SEO is required and the content is stable: Prioritize SSG; consider ISR when the number of pages is huge or updates are frequent.
19
+ - Backend after login, strong interaction workspace, internal tools: priority CSR, public login/registration page can be separate SSG/SSR.
20
+ - Hybrid product: Public pages and private pages can adopt different models without sacrificing experience or cost for a unified architecture.
21
+ - Number of pages, update frequency, server cost, deployment platform, caching strategy and team operation and maintenance capabilities must be evaluated together.
22
+ - RSC is only used in supported frameworks and routing architectures; client interactions, browser APIs, and high-frequency states are still placed in client leaf components.
23
+
24
+ ## Implement constraints
25
+
26
+ - SSR/RSC paths must not directly depend on `window`, `document`, localStorage or browser-specific libraries.
27
+ - HTML, time, random numbers, user preferences and media query results before and after hydration should be consistent to avoid hydration mismatch.
28
+ - Server-side data retrieval must have timeout, error degradation and caching strategies.
29
+ - SSG/ISR needs to clarify the non-prerendered path, revalidate/invalidation strategy and rollback method.
30
+ - Client-side large animation libraries, charts, editors, maps, WebGL/Canvas, etc. should be loaded on demand without entering the root layout synchronization bundle.
31
+ - No longer assert that a route is "cached" or "must be dynamic" without evidence of response headers, build output, traces, route behavior, or online metrics.
32
+
33
+ ## Checklist
34
+
35
+ - [ ] Clarify public pages and private pages, SEO requirements and real-time requirements.
36
+ - [ ] Clarify the reasons for using CSR / SSR / SSG / ISR / RSC for each type of page.
37
+ - [ ] Evaluate page count, build times, server costs, and cache invalidation strategies.
38
+ - [ ] Check that SSR/RSC code has no browser API dependencies and non-serializable props.
39
+ - [ ] Confirm that loading, error, not-found, offline and permission states are not lost across render modes.
40
+ - [ ] Verify the final schema with build output, response headers, traces, or routing behavior.
@@ -1,50 +1,50 @@
1
- # 响应式设计规则
1
+ # Responsive design rules
2
2
 
3
- 凡是任务涉及移动端适配、响应式布局、多端兼容、触摸目标或视口行为时,都应用本文件。本文只保留项目常驻约束;布局模式、container query、响应式表格、媒体和验证细节交给 `fec-responsive-layout`。
3
+ This document should be used whenever the task involves mobile adaptation, responsive layout, multi-device compatibility, touch targets or viewport behavior. This article only retains project-resident constraints; layout mode, container query, responsive tables, media and validation details are left to `fec-responsive-layout`.
4
4
 
5
- ## 核心原则
5
+ ## Core Principles
6
6
 
7
- - **移动优先**:从小屏幕开始设计,逐步增强到大屏幕。
8
- - **内容优先**:小屏优先展示核心任务、关键操作和反馈,次要内容折叠、延后或进入详情层。
9
- - **触摸友好**:所有交互元素必须适配手指操作,关键功能不能只依赖 hover。
10
- - **性能优先**:移动端网络和设备性能较弱,首屏资源、图表、动效和大列表要克制。
11
- - **容器感知**:可复用组件优先适配所在容器,而不是假设整页断点。
12
- - **稳定尺寸**:工具栏、表格列、棋盘、卡片网格和计数器需要稳定约束,避免状态变化导致布局跳动。
7
+ - **Mobile First**: Start designing for small screens and work your way up to large screens.
8
+ - **Content Priority**: Small screens give priority to core tasks, key operations and feedback, and secondary content is folded, postponed or entered into the detail layer.
9
+ - **Touch Friendly**: All interactive elements must adapt to finger operations, and key functions cannot rely solely on hover.
10
+ - **Performance first**: The mobile network and device performance are weak, so first-screen resources, charts, animations, and large lists should be restrained.
11
+ - **Container Aware**: Reusable components will first adapt to the container in which they are located, instead of assuming full page breakpoints.
12
+ - **Stable size**: Toolbars, table columns, checkerboards, card grids and counters need stable constraints to avoid layout jumps caused by state changes.
13
13
 
14
- ## 断点与容器策略
14
+ ## Breakpoints and container strategies
15
15
 
16
- - 默认验证 375px、768px、1024px、1440px,以及断点中间值。
17
- - 使用 mobile-first `min-width` 断点;不要先写桌面样式再用 `max-width` 补移动端。
18
- - Tailwind 前缀从小到大使用:默认 → `sm:` → `md:` → `lg:` → `xl:` → `2xl:`。
19
- - 页面级结构可以使用断点;会被放进侧栏、弹窗、卡片或主内容区的复用组件优先使用 container query。
20
- - grid/flex 子项包含长文本、图表、代码、媒体或表格时,必须考虑 `min-width: 0`、`minmax()`、`aspect-ratio` 和明确溢出策略。
16
+ - Default validation for 375px, 768px, 1024px, 1440px, and breakpoint intermediate values.
17
+ - Use mobile-first `min-width` breakpoint; do not write the desktop style first and then use `max-width` to supplement the mobile version.
18
+ - Tailwind prefixes are used from smallest to largest: default → `sm:` → `md:` → `lg:` → `xl:` → `2xl:`.
19
+ - Page-level structures can use breakpoints; reusable components that will be placed into sidebars, pop-ups, cards, or main content areas preferentially use container queries.
20
+ - `min-width: 0`, `minmax()`, `aspect-ratio` and explicit overflow strategies must be taken into account when grid/flex children contain long text, charts, code, media or tables.
21
21
 
22
- ## 触摸目标与移动端交互
22
+ ## Touch target to interact with mobile terminal
23
23
 
24
- - 空间允许时,按钮、链接、关闭按钮等交互目标至少 44x44px;紧凑工具界面最低也要保证可操作。
25
- - 输入框字号避免低于 16px,防止 iOS Safari 自动缩放。
26
- - 固定底部栏、操作条、抽屉和对话框必须考虑 safe area 与虚拟键盘。
27
- - hover-only 信息必须有点击、焦点或常驻可见替代方案。
28
- - 横竖屏切换后,主操作、焦点位置、滚动容器和错误提示仍应可达。
24
+ - When space permits, interaction targets such as buttons, links, and close buttons must be at least 44x44px; compact tool interfaces must be at least operable.
25
+ - Avoid input box font size below 16px to prevent iOS Safari from automatically scaling.
26
+ - Fixed bottom bar, action bar, drawer and dialog box must consider safe area and virtual keyboard.
27
+ - Hover-only messages must have click, focus, or permanent visible alternatives.
28
+ - After switching between horizontal and vertical screens, the main operation, focus position, scroll container and error prompts should still be accessible.
29
29
 
30
- ## 数据密集区域
30
+ ## Data intensive area
31
31
 
32
- - 表格、列表、看板、编辑器和画布可以局部横向滚动,但页面整体不应出现无意水平溢出。
33
- - 移动端数据密集视图需先定义列优先级:主标识、状态和主操作优先保留;低优先级字段进入详情、展开行或抽屉。
34
- - 小屏仍要保留排序、筛选、分页和选择能力。
35
- - 虚拟滚动只解决 DOM 数量问题,不能替代信息层级设计。
32
+ - Tables, lists, boards, editors and canvases can be partially scrolled horizontally, but the page as a whole should not have unintentional horizontal overflow.
33
+ - Data-intensive views on the mobile terminal need to define column priorities first: main identification, status and main operations are retained first; low-priority fields enter details, expand rows or drawers.
34
+ - Small screens must still retain the ability to sort, filter, paging, and select.
35
+ - Virtual scrolling only solves the problem of DOM quantity and cannot replace information hierarchy design.
36
36
 
37
- ## 响应式媒体
37
+ ## Responsive media
38
38
 
39
- - 图片和视频要有稳定尺寸、`aspect-ratio` 或容器约束,避免加载后推挤布局。
40
- - 需要多尺寸资源时使用 `srcset`、`sizes`、`picture` 或框架图片组件,避免移动端下载桌面大图。
41
- - 媒体裁切必须保留主体信息,不为填满卡片裁掉产品、人物、图表或状态关键区域。
39
+ - Images and videos must have stable size, `aspect-ratio` or container constraints to avoid pushing the layout after loading.
40
+ - Use `srcset`, `sizes`, `picture` or frame picture components when multi-size resources are needed to avoid downloading large desktop images on mobile devices.
41
+ - Media cropping must preserve the main information and do not crop out key areas of products, people, graphics or status to fill the card.
42
42
 
43
- ## 检查清单
43
+ ## Checklist
44
44
 
45
- - [ ] 320-375px 页面级无水平溢出。
46
- - [ ] 断点切换后阅读顺序合理,主操作不被隐藏。
47
- - [ ] 触摸目标、输入字号、safe area、虚拟键盘和横竖屏行为已验证。
48
- - [ ] loading、empty、error、disabled、hover/focus、长翻译文本和大数字不会撑坏固定格式控件。
49
- - [ ] 数据密集区域有列优先级、局部滚动或移动端摘要策略。
50
- - [ ] 首屏媒体尺寸稳定,非首屏媒体不会拖慢移动端主路径。
45
+ - [ ] 320-375px No horizontal overflow at page level.
46
+ - [ ] The reading order is reasonable after breakpoint switching, and the main operation is not hidden.
47
+ - [ ] Touch target, input font size, safe area, virtual keyboard and horizontal and vertical screen behaviors have been verified.
48
+ - [ ] loading, empty, error, disabled, hover/focus, long translation text and large numbers will not break the fixed format control.
49
+ - [ ] Column priority, partial scrolling, or mobile summary strategies for data-intensive areas.
50
+ - [ ] The size of first-screen media is stable, and non-first-screen media will not slow down the main path of the mobile terminal.
@@ -1,31 +1,31 @@
1
- # 来源驱动开发规则
1
+ # Source-driven development rules
2
2
 
3
- 当实现依赖框架、库、浏览器、运行时、构建工具或平台行为时,先确认事实来源,再写代码或评审结论。
3
+ When an implementation relies on a framework, library, browser, runtime, build tool, or platform behavior, confirm the source of truth before writing code or reviewing conclusions.
4
4
 
5
- ## 事实来源优先级
5
+ ## Fact source priority
6
6
 
7
- 1. 项目内 README、配置、测试、模板和已有实现。
8
- 2. 官方文档、源码、类型定义、release notes、migration guide。
9
- 3. Web 标准、浏览器兼容数据和平台文档。
10
- 4. Issue、讨论、博客和第三方文章仅作为线索。
7
+ 1. README, configuration, testing, templates and existing implementations within the project.
8
+ 2. Official documents, source code, type definitions, release notes, migration guide.
9
+ 3. Web standards, browser compatibility data, and platform documentation.
10
+ 4. Issues, discussions, blogs and third-party articles are only used as clues.
11
11
 
12
- ## 使用场景
12
+ ## Usage scenarios
13
13
 
14
- - 框架新版本、路由、渲染模式、缓存、构建配置、浏览器 API。
15
- - 公共接口、组件 API、设计系统 token、CLI 命令和插件元数据。
16
- - 依赖升级、迁移、废弃 API 替换、跨运行时兼容。
17
- - 与安全、性能、可访问性相关的版本敏感判断。
14
+ - New versions of frameworks, routing, rendering modes, caching, build configurations, browser APIs.
15
+ - Public interfaces, component APIs, design system tokens, CLI commands, and plugin metadata.
16
+ - Dependency upgrade, migration, obsolete API replacement, cross-runtime compatibility.
17
+ - Version-sensitive judgments related to security, performance, and accessibility.
18
18
 
19
- ## 输出要求
19
+ ## Output requirements
20
20
 
21
- - 写清来源、版本或项目事实、决策结论、影响范围和验证方式。
22
- - 若项目现状与官方推荐冲突,说明冲突原因和渐进迁移策略。
23
- - 不复制长篇外部文档;只保留必要结论、链接或项目内文件路径。
24
- - 无法验证时标注不确定性和需要用户/团队确认的事项。
21
+ - Write down the source, version or project facts, decision conclusion, scope of influence and verification method.
22
+ - If the current status of the project conflicts with official recommendations, explain the cause of the conflict and the gradual migration strategy.
23
+ - Do not copy long external documents; only keep necessary conclusions, links or file paths within the project.
24
+ - Mark uncertainties and matters requiring confirmation from the user/team when they cannot be verified.
25
25
 
26
- ## 反模式
26
+ ## Anti-pattern
27
27
 
28
- - 凭记忆使用版本敏感 API。
29
- - 用过时教程替代官方文档。
30
- - 为追新推翻稳定项目约定。
31
- - 在组件里散落外部库行为假设,而不是集中到适配层。
28
+ - Use version-sensitive APIs from memory.
29
+ - Replace official documentation with outdated tutorials.
30
+ - Overturn the stable project agreement in order to pursue new projects.
31
+ - Scatter external library behavior assumptions throughout components instead of centralizing them in the adaptation layer.
@@ -1,60 +1,60 @@
1
- # 状态管理规范
1
+ # Status management specifications
2
2
 
3
- 本文件约定前端状态归属底线。状态清单、Store 形状示例、URL 状态、持久化适配器和 SSR 隔离细节交给 `fec-state-management`;请求缓存细节交给数据获取 workflow;表单字段和校验交给表单 workflow。
3
+ This document stipulates that the front-end status belongs to the bottom line. State manifests, Store shape examples, URL states, persistence adapters, and SSR isolation details are left to `fec-state-management`; request caching details are left to the data fetch workflow; and form fields and validation are left to the form workflow.
4
4
 
5
- ## 状态分类
5
+ ## Status classification
6
6
 
7
- | 类型 | 示例 | 默认归属 |
7
+ | Type | Example | Default Attribution |
8
8
  | ---- | ---- | -------- |
9
- | 本地 UI 状态 | modal 开关、tab、展开行、hover 编辑态 | 组件内 state / ref |
10
- | 表单状态 | 输入值、脏字段、校验错误、提交中 | 表单库或表单组件 |
11
- | 服务端状态 | 列表、详情、分页结果、远程错误 | 请求缓存库 |
12
- | URL 状态 | 搜索词、筛选、排序、页码、选中 tab | 路由参数 / search params |
13
- | 全局客户端状态 | 登录用户、主题、权限快照、购物车草稿 | 全局 store |
14
- | 浏览器持久化状态 | 偏好、非敏感草稿、离线队列 | 存储层 + 状态适配器 |
15
-
16
- ## 核心原则
17
-
18
- - **先归属,后选库**:不要先选 Redux、Zustand、Pinia 或 Context;先确定每个状态的唯一 owner。
19
- - **就近管理**:状态放在需要它的最近公共祖先。
20
- - **单一数据源**:同一份数据只在一个地方维护。
21
- - **派生优于同步**:可从 props、server state、URL 或已有 state 推导的值,不另存一份。
22
- - **最小全局状态**:全局 store 只保存真正跨页面、跨 feature 或需要统一动作的客户端状态。
23
-
24
- ## React 状态边界
25
-
26
- - 单组件或小子树使用 `useState` / `useReducer`。
27
- - 低频全局配置、主题或依赖注入可用 Context;高频变化的大对象不要放 Context。
28
- - 中等复杂业务状态可用 Zustand、Jotai 或仓库既有方案;大型严格动作流可用 Redux Toolkit。
29
- - 服务端数据使用请求缓存库,不复制到全局 store。
30
-
31
- ## Vue 状态边界
32
-
33
- - 局部状态使用 `ref` / `reactive` / `computed`。
34
- - 局部跨层级上下文使用 `provide/inject`。
35
- - 全局业务状态使用 Pinia 或项目既有 store。
36
- - 服务端数据优先使用请求库或 composable 管理,不原封不动写入 Pinia。
37
-
38
- ## URL 与持久化状态
39
-
40
- - 搜索、筛选、排序、分页、选中 tab 等需要分享或刷新保留的视图状态优先放 URL。
41
- - 浏览器持久化只保存稳定偏好或非敏感草稿,并明确字段白名单、版本号、迁移路径、过期策略和敏感字段排除。
42
- - SSR 场景不要在模块顶层创建带用户数据的单例 store;每次请求需要独立实例。
43
-
44
- ## 反模式
45
-
46
- - 将所有状态都放进全局 store。
47
- - 在 store 中存放 UI 临时状态或表单每个字段。
48
- - 手动同步多份相同数据,而不是从源状态派生。
49
- - 将服务端响应原封不动存入全局 store,而不用请求缓存库。
50
- - 用 Context / provide 承载高频变化大对象,导致大范围重渲染。
51
- - 持久化 token、权限细节、个人敏感数据或未版本化的大对象。
52
-
53
- ## 检查清单
54
-
55
- - [ ] 每个状态都有明确归属:本地 / 表单 / 服务端缓存 / URL / 全局 store / 浏览器持久化。
56
- - [ ] 可派生的值没有被存为独立 state。
57
- - [ ] 全局 store 只包含真正跨边界共享的数据。
58
- - [ ] 服务端数据通过请求库管理,刷新、回退、权限变化和错误状态仍可恢复。
59
- - [ ] URL 状态与路由参数同步,刷新和分享行为符合预期。
60
- - [ ] 持久化状态有白名单、版本、迁移和敏感字段排除。
9
+ | Local UI state | modal switch, tab, expand row, hover editing state | In-component state / ref |
10
+ | Form status | Input value, dirty field, validation error, submitting | Form library or form component |
11
+ | Server status | List, details, paging results, remote errors | Request cache library |
12
+ | URL status | Search terms, filter, sort, page number, selected tab | Routing parameters / search params |
13
+ | Global client status | Login users, topics, permission snapshots, shopping cart drafts | Global store |
14
+ | Browser persistent state | Preferences, non-sensitive drafts, offline queues | Storage layer + state adapter |
15
+
16
+ ## Core Principles
17
+
18
+ - **Own first, choose library later**: Don’t choose Redux, Zustand, Pinia or Context first; determine the unique owner of each state first.
19
+ - **Nearest Management**: The state is placed in the nearest common ancestor that needs it.
20
+ - **Single Data Source**: The same data is maintained in only one place.
21
+ - **Derivation is better than synchronization**: Values that can be derived from props, server state, URL or existing state, do not save a new copy.
22
+ - **Minimum global state**: The global store only saves client state that is truly cross-page, cross-feature, or requires unified action.
23
+
24
+ ## React state boundaries
25
+
26
+ - Use `useState` / `useReducer` for single components or small subtrees.
27
+ - Low-frequency global configuration, theme or dependency injection can use Context; large objects that change frequently should not be placed in Context.
28
+ - For moderately complex business states, Zustand, Jotai or existing warehouse solutions can be used; for large and strict action flows, Redux Toolkit can be used.
29
+ - Server-side data uses the request cache library and is not copied to the global store.
30
+
31
+ ## Vue state boundary
32
+
33
+ - Use `ref` / `reactive` / `computed` for local state.
34
+ - Use `provide/inject` for local cross-level context.
35
+ - Global business status uses Pinia or the existing store of the project.
36
+ - Server-side data is first managed using the request library or composable and is not written to Pinia intact.
37
+
38
+ ## URL and persistent state
39
+
40
+ - When searching, filtering, sorting, paging, selecting tabs, etc., the view state that needs to be shared or refreshed should be given priority to the URL.
41
+ - Browser persistence only saves stable preferences or non-sensitive drafts, and clearly identifies field whitelists, version numbers, migration paths, expiration policies, and sensitive field exclusions.
42
+ - In SSR scenarios, do not create a single instance store with user data at the top level of the module; each request requires an independent instance.
43
+
44
+ ## Anti-pattern
45
+
46
+ - Put all state into global store.
47
+ - Store UI temporary state or each field of the form in the store.
48
+ - Manually synchronize multiple copies of the same data instead of deriving from source state.
49
+ - Store the server response intact in the global store without requesting the cache library.
50
+ - Use Context / provide to carry large objects that change frequently, resulting in large-scale re-rendering.
51
+ - Persistent tokens, permission details, personal sensitive data or unversioned large objects.
52
+
53
+ ## Checklist
54
+
55
+ - [ ] Each state has a clear ownership: local / form / server cache / URL / global store / browser persistence.
56
+ - [ ] Derivable values are not stored as independent state.
57
+ - [ ] The global store only contains data that is truly shared across boundaries.
58
+ - [ ] Server-side data is managed through the request library, and refreshes, rollbacks, permission changes, and error states can still be recovered.
59
+ - [ ] URL state is synchronized with route parameters, and refresh and share behavior is as expected.
60
+ - [ ] Persistence status has whitelist, version, migration and sensitive field exclusions.
@@ -1,98 +1,98 @@
1
- # 测试与校验规则
1
+ # Testing and verification rules
2
2
 
3
- 凡是新增、修改、重构或评审代码时,都应用本文件。
3
+ This document should be used whenever code is added, modified, refactored, or reviewed.
4
4
 
5
- ## 校验顺序
5
+ ## Verification sequence
6
6
 
7
- 优先按以下顺序执行:
7
+ Prioritize execution in the following order:
8
8
 
9
9
  1. lint
10
10
  2. type check
11
11
  3. unit test
12
12
  4. build
13
13
 
14
- 优先使用仓库已有脚本。
15
- 如果命令不确定,先检查 `package.json`。
14
+ Priority is given to using existing scripts in the warehouse.
15
+ If the command is uncertain, check `package.json` first.
16
16
 
17
- ## 改动校验原则
17
+ ## Change the verification principle
18
18
 
19
- - 先修复范围最小且正确的问题
20
- - 每次关键修复后重新执行受影响的命令
21
- - 不要盲目压掉报错或关闭规则
22
- - 不要为了通过检查而降低类型安全
23
- - 不要因为一个局部测试失败就重写无关模块
19
+ - Fix the smallest and correct issues first
20
+ - Re-execute affected commands after each critical fix
21
+ - Don’t blindly suppress error reporting or closing rules
22
+ - Don't compromise type safety to pass checks
23
+ - Don't rewrite unrelated modules just because a local test fails
24
24
 
25
- ## 测试要求
25
+ ## Testing requirements
26
26
 
27
- 新增或修改行为时,考虑是否需要覆盖以下内容:
27
+ When adding or modifying behaviors, consider whether you need to override the following:
28
28
 
29
- - 组件渲染
30
- - 交互行为
31
- - 状态切换
32
- - 边界场景
33
- - loading / empty / error 状态
34
- - 与可访问性相关的关键交互
29
+ - Component rendering
30
+ - interactive behavior
31
+ - Status switching
32
+ - Border scenes
33
+ - loading / empty / error status
34
+ - Key interactions related to accessibility
35
35
 
36
- 如果没有补测试,需要说明原因。
36
+ If there is no supplementary test, the reason needs to be explained.
37
37
 
38
- ## Fixture 与 Mock
38
+ ## Fixture and Mock
39
39
 
40
- - Fixture 表达业务场景,不使用随机、无语义或只对测试作者有意义的数据
41
- - 复杂对象使用 builder 填充默认值,每个测试只覆盖当前场景相关字段
42
- - 测试间不共享可变全局状态、fake timer、store 或 mock server handler
43
- - 网络 mock 应模拟公开契约和用户可见错误,不复制后端内部实现
40
+ - Fixture expresses business scenarios without using random, meaningless or data that is meaningful only to the test author
41
+ - Complex objects use builder to fill in default values, and each test only covers fields related to the current scenario.
42
+ - No mutable global state, fake timers, stores or mock server handlers are shared between tests
43
+ - Network mocks should simulate public contracts and user-visible errors and not replicate backend internal implementations
44
44
 
45
- ## TDD 与回归测试
45
+ ## TDD and regression testing
46
46
 
47
- 新增行为、修复 Bug 或重构关键逻辑时,优先采用 TDD:
47
+ When adding new behaviors, fixing bugs, or refactoring key logic, TDD is preferred:
48
48
 
49
- 1. 先写能描述期望行为的失败测试。
50
- 2. 运行测试并确认失败原因正确。
51
- 3. 写最小实现让测试通过。
52
- 4. 测试保持通过后再重构。
49
+ 1. Start by writing failing tests that describe the desired behavior.
50
+ 2. Run the test and confirm that the failure reason is correct.
51
+ 3. Write the minimum implementation to make the test pass.
52
+ 4. Refactor after the test remains passed.
53
53
 
54
- Bug 修复应优先保留能复现问题的回归测试。若现有项目缺少测试基础设施,不要盲目引入新框架;先给出最小测试落地建议并说明维护成本。
54
+ Bug fixes should prioritize keeping regression tests that reproduce the problem. If the existing project lacks testing infrastructure, do not blindly introduce a new framework; first provide minimum test implementation suggestions and explain maintenance costs.
55
55
 
56
- ## 代码评审输出风格
56
+ ## Code review output style
57
57
 
58
- 评审代码时,返回:
58
+ When reviewing code, return:
59
59
 
60
- - 总体评估
61
- - 必修问题
62
- - 建议优化
63
- - 可选优化项
64
- - 风险等级
60
+ - Overall assessment
61
+ - Required questions
62
+ - Suggestions for optimization
63
+ - Optional optimization items
64
+ - Risk level
65
65
 
66
- 结论要具体且可执行。
66
+ Conclusions should be specific and actionable.
67
67
 
68
- ## E2E 测试规则
68
+ ## E2E test rules
69
69
 
70
- 使用 Playwright 或 Cypress 时:
70
+ When using Playwright or Cypress:
71
71
 
72
- - 遵循 **Page Object**,spec 内不写裸选择器;优先 **`data-testid`**,其次 **`role` / `label`**
73
- - 用 **`test.describe` + `beforeEach`** 组织场景,单用例可独立运行、不依赖执行顺序
74
- - 禁止用固定 **`sleep`** 当主要同步手段;用 **Locator 自动等待**、`expect`、`waitForResponse` 等
75
- - Playwright:**`playwright.config.ts`** 中配置 `baseURL`、CI 下 `retries`/`workers`、`trace`/`screenshot`/`video`、**`webServer`** 与多 **`projects`(含移动端)**
76
- - 关键流程至少覆盖桌面、平板、移动端视口(或等价 device 项目)
77
- - **不稳定用例**:`test.fixme` / `test.skip` 需写原因与 issue;用 `--repeat-each` 辅助定位 flaky
78
- - 失败时保留 **截图、Trace、视频**,CI 用 **artifact** 上传 HTML 报告与产物
79
- - 高风险/资金类流程:**勿在生产跑真实 E2E**;staging 或 mock,必要时 `test.skip`
80
- - 测试数据可重复:优先 seed、测试账号或 mock 服务;随机值必须带唯一前缀并在 teardown 清理
72
+ - Follow **Page Object**, do not write naked selectors in spec; give priority to **`data-testid`**, followed by **`role` / `label`**
73
+ - Use **`test.describe` + `beforeEach`** to organize scenarios. A single use case can run independently and does not depend on the execution sequence.
74
+ - It is forbidden to use fixed **`sleep`** as the main synchronization method; use **Locator to automatically wait**, `expect`, `waitForResponse`, etc.
75
+ - Playwright: Configure `baseURL` in **`playwright.config.ts`**, `retries`/`workers`, `trace`/`screenshot`/`video`, **`webServer`** and many **`projects` (including mobile)** under CI
76
+ - Key processes cover at least desktop, tablet, and mobile viewports (or equivalent device projects)
77
+ - **Unstable use case**: `test.fixme` / `test.skip` needs to write the reason and issue; use `--repeat-each` to assist in locating flaky
78
+ - Keep **Screenshots, Traces, Videos** in case of failure, CI uses **artifact** to upload HTML reports and products
79
+ - High-risk/funding processes: **Do not run real E2E in production**; staging or mock, if necessary `test.skip`
80
+ - Test data is repeatable: priority is seed, test account or mock service; random values must be uniquely prefixed and cleaned in teardown
81
81
 
82
- 详细模式与示例见插件 **`fec-e2e-testing`** skill。
82
+ For detailed modes and examples, see the plug-in **`fec-e2e-testing`** skill.
83
83
 
84
- ## 重构规则
84
+ ## Refactoring rules
85
85
 
86
- 进行重构时:
86
+ When refactoring:
87
87
 
88
- - 除非任务明确要求改行为,否则保持行为一致
89
- - 说明可能的迁移风险
90
- - 优先做渐进式修改,而不是大范围重写
91
- - 总结改动文件、执行过的命令和剩余风险
88
+ - Maintain consistent behavior unless the task specifically requires a change in behavior
89
+ - Describe possible migration risks
90
+ - Prioritize incremental changes over extensive rewrites
91
+ - Summarize changed files, executed commands and remaining risks
92
92
 
93
- ## 验证失败处理
93
+ ## Verification failure handling
94
94
 
95
- - 按文件和根因分组错误,一次修复一类问题。
96
- - 每次修复后重新运行最近的失败命令。
97
- - 不删除失败测试、不关闭规则、不降低类型安全来换取通过。
98
- - 同一错误多次修复仍失败时,停止扩大改动并报告阻塞。
95
+ - Group errors by file and root cause to fix one type of problems at a time.
96
+ - Rerun the most recent failed command after each fix.
97
+ - Don't remove failing tests, don't close rules, don't reduce type safety in exchange for passing.
98
+ - When the same error is repaired multiple times and still fails, the expansion of changes will be stopped and a blockage will be reported.