@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,52 +1,56 @@
1
1
  ---
2
2
  name: fec-tdd-workflow
3
- description: Use when implementing new frontend behavior, fixing bugs, or refactoring logic where tests can describe the expected behavior first. Apply to components, hooks/composables, utilities, API clients, route guards, or user workflows; Chinese triggers include TDD, 测试驱动, 先写测试, 红绿重构, 回归测试.
3
+ description: Use when implementing new observable frontend behavior or fixing a behavior-changing bug where a failing test can describe the missing or incorrect behavior first. Apply to components, hooks/composables, utilities, API clients, route guards, or user workflows; pure behavior-preserving refactoring uses an already-green contract instead.
4
4
  ---
5
5
 
6
- # 前端 TDD 工作流
6
+ # Front-end TDD workflow
7
7
 
8
8
  ## Purpose
9
9
 
10
- 用“先写失败测试,再实现最小代码,再重构”的节奏交付前端功能,避免只在实现后补覆盖率。
10
+ Use the rhythm of "write failing tests first, then implement the minimum code, and then refactor" to deliver front-end functions to avoid supplementing coverage only after implementation.
11
11
 
12
12
  ## Procedure
13
13
 
14
- 1. 识别可观察行为:用户能看到的 UI、组件契约、hook/composable 返回值、路由守卫结果、API client 输出或错误状态。
15
- 2. 先写一个最小失败测试:
16
- - 纯逻辑优先单元测试。
17
- - 组件交互优先 Testing Library / Vue Test Utils。
18
- - 跨页关键流程优先 Playwright / Cypress。
19
- 3. 运行该测试并确认失败原因正确,失败应来自行为尚未实现,而不是语法、导入或测试环境错误。
20
- 4. 写刚好能通过测试的最小实现,不顺手扩大范围。
21
- 5. 重新运行测试,确认变绿。
22
- 6. 在测试保持通过的前提下重构命名、边界和重复逻辑。
23
- 7. 对 bug 修复,保留能复现问题的回归测试。
24
- 8. 每轮只扩大一个可观察行为;新需求、新边界和新异常路径各自进入下一轮。
14
+ 1. Identify observable behaviors: UI, component contracts, hook/composable return values, route guard results, API client output or error status that users can see.
15
+ 2. First write a minimum failure test:
16
+ - Pure logic first unit testing.
17
+ - Prioritize component interaction Testing Library / Vue Test Utils.
18
+ - Prioritize critical processes across pages Playwright/Cypress.
19
+ 3. Run the test and confirm that the failure reason is correct and should come from behavior that has not yet been implemented, rather than a syntax, import, or test environment error.
20
+ 4. Write the minimum implementation that can just pass the test, and do not expand the scope easily.
21
+ 5. Rerun the test and confirm it turns green.
22
+ 6. Refactor naming, boundaries and duplication logic while keeping tests passing.
23
+ 7. Fix bugs and retain regression tests that can reproduce the problem.
24
+ 8. Only one observable behavior is expanded in each round; new requirements, new boundaries and new abnormal paths enter the next round respectively.
25
+
26
+ ## Pure Refactoring Boundary
27
+
28
+ Pure behavior-preserving refactoring does not manufacture a failing test. If existing behavior is already correct and the goal is structural only, establish or add characterization coverage that passes for the current behavior, then keep it green through each refactoring step. Use RED → GREEN → REFACTOR for new behavior or a behavior-changing defect fix; use GREEN → REFACTOR → GREEN for pure refactoring.
25
29
 
26
30
  ## Prove-It Pattern
27
31
 
28
- 修复缺陷时先让测试失败,再让它通过。若无法先失败,说明测试没有覆盖原始问题,需要收窄输入、断言或测试层级。
32
+ When fixing a defect, make the test fail first, then make it pass. If it cannot fail first, it means that the test does not cover the original problem, and the input, assertion or test level needs to be narrowed.
29
33
 
30
34
  ## Frontend Test Selection
31
35
 
32
36
  | Risk | Preferred Test |
33
37
  | ---- | -------------- |
34
- | utils、schema、状态计算 | 单元测试 |
35
- | hooks / composables | 单元或轻量集成测试 |
36
- | 组件 props、emits、交互、状态 | 组件测试 |
37
- | Router、Provider、Store 协作 | 轻量集成测试 |
38
- | 登录、支付、权限、关键 CRUD | E2E 测试 |
38
+ | utils, schema, status calculation | unit testing |
39
+ | hooks / composables | unit or lightweight integration testing |
40
+ | Component props, emits, interactions, status | Component testing |
41
+ | Router, Provider, Store collaboration | Lightweight integration testing |
42
+ | Login, payment, permissions, key CRUD | E2E testing |
39
43
 
40
44
  ## Constraints
41
45
 
42
- - 不为了 TDD 引入项目没有使用且收益不清晰的新测试框架。
43
- - 不测试实现细节、私有状态或脆弱 DOM 结构。
44
- - 不把 E2E 当作所有风险的默认答案;优先选择离风险最近的测试层。
45
- - 如果现有仓库没有测试基础设施,先输出最小测试落地建议,再请求用户确认是否引入。
46
- - 不在红灯阶段同时重构;先证明问题,再最小修复,再整理结构。
46
+ - Do not introduce new testing frameworks for the sake of TDD that are not used by the project and whose benefits are not clear.
47
+ - Does not test implementation details, private state, or fragile DOM structures.
48
+ - Don’t treat E2E as the default answer for all risks; prioritize the test layer closest to the risk.
49
+ - If the existing warehouse does not have testing infrastructure, output the minimum test implementation suggestions first, and then ask the user to confirm whether to introduce it.
50
+ - Do not refactor at the same time during the red light stage; prove the problem first, then make minimal repairs, and then organize the structure.
47
51
 
48
52
  ## Expected Output
49
53
 
50
- - 至少一个先失败后通过的测试覆盖新增或修复行为。
51
- - 实现保持最小范围,重构只在测试通过后进行。
52
- - 总结运行过的测试命令、覆盖的行为和未覆盖风险。
54
+ - At least one fail-then-pass test covering the new or fixed behavior.
55
+ - Implementation is kept to a minimum scope and refactoring is done only after the tests pass.
56
+ - Summarize the test commands run, behaviors covered, and risks not covered.
@@ -1,45 +1,45 @@
1
1
  ---
2
2
  name: fec-testing-strategy
3
- description: Use when planning or reviewing a frontend testing strategy, selecting the right test layer by risk, mapping coverage across static checks, unit tests, component tests, integration tests, E2E, Storybook/visual regression, a11y, security, performance, or CI gates. Do not use to write individual component/E2E tests or merely run existing validation commands; Chinese triggers include 测试策略, 测试分层, 测试计划, 覆盖矩阵.
3
+ description: Use when planning or reviewing a frontend testing strategy, selecting the right test layer by risk, mapping coverage across static checks, unit tests, component tests, integration tests, E2E, Storybook/visual regression, a11y, security, performance, or CI gates. Do not use to write individual component/E2E tests or merely run existing validation commands; Chinese triggers include test strategy, test layering, test plan, coverage matrix.
4
4
  ---
5
5
 
6
- # 前端测试策略
6
+ # Front-end testing strategy
7
7
 
8
8
  ## Purpose
9
9
 
10
- 按“离代码多近 / 覆盖风险层级”选择测试方法,避免把所有风险都塞进组件测试或 E2E。
10
+ Choose your testing approach by “closeness to code/level of risk coverage” to avoid cramming all risks into component tests or E2E.
11
11
 
12
12
  ## Procedure
13
13
 
14
- 1. 识别改动类型:纯逻辑、UI 组件、跨模块流程、浏览器能力、视觉稳定性、专项质量风险或发布门禁。
15
- 2. 建立测试层级矩阵,至少区分:
16
- - 静态检查:TypeScript、ESLint、格式、依赖安全、构建。
17
- - 单元测试:utils、hooks/composables、状态逻辑、schema、纯函数。
18
- - 组件测试:props/emits、用户交互、loading/error/empty、mock 边界。
19
- - 轻量集成测试:表单 + API mock + 路由/Store/Provider 上下文。
20
- - E2E:真实浏览器、跨页面关键旅程、鉴权、支付、权限、CI artifacts。
21
- - 视觉/交互文档:Storybook interaction、Chromatic、视觉回归基线。
22
- - 专项质量:a11y、安全、性能、兼容性。
23
- 3. 按风险分配覆盖:高频核心路径优先 E2E,复杂组件状态优先组件测试,纯逻辑优先单元测试,跨 provider 协作用轻量集成测试。
24
- 4. 用测试金字塔控制维护成本:
25
- - 越靠近纯逻辑,测试越多、越快、越稳定。
26
- - E2E 只覆盖用户关键旅程和真实浏览器风险,不覆盖每个分支。
27
- - 视觉、a11y、安全和性能属于专项质量层,不塞进普通组件测试。
28
- 5. 检查是否已有命令、测试框架、目录约定和 CI 门禁;沿用项目现状,不为策略文档引入不必要工具。
29
- 6. 规划失败证据:每个高风险项要说明失败时如何定位,例如断言、截图、trace、coverage、日志或报告。
30
- 7. 设计测试数据与 mock 策略:共享 fixture 表达业务场景,测试数据 builder 只封装噪声字段,避免每个测试手写随机对象。
31
- 8. 管理 flaky 风险:把时间、网络、动画、随机数、并发和外部服务标为不稳定来源,并指定隔离、重试和证据产物。
32
- 9. 输出可执行的最小测试计划:每层覆盖什么、不覆盖什么、优先级、建议命令和责任 skill。
14
+ 1. Identify the type of change: pure logic, UI components, cross-module processes, browser capabilities, visual stability, dedicated quality risks, or release gates.
15
+ 2. Establish a test level matrix, at least distinguish:
16
+ - Static checking: TypeScript, ESLint, format, dependency security, build.
17
+ - Unit testing: utils, hooks/composables, state logic, schema, pure functions.
18
+ - Component testing: props/emits, user interaction, loading/error/empty, mock boundaries.
19
+ - Lightweight integration testing: form + API mock + routing/Store/Provider context.
20
+ - E2E: real browser, cross-page key journeys, authentication, payments, permissions, CI artifacts.
21
+ - Visual/interactive documentation: Storybook interaction, Chromatic, visual regression baseline.
22
+ - Special quality: a11y, security, performance, compatibility.
23
+ 3. Allocate coverage by risk: high-frequency core paths prioritize E2E, complex component status prioritizes component testing, pure logic prioritizes unit testing, and lightweight integration testing is used for cross-provider collaboration.
24
+ 4. Use the testing pyramid to control maintenance costs:
25
+ - The closer to pure logic, the more tests, the faster, and the more stable it is.
26
+ - E2E only covers key user journeys and real browser risks, not every branch.
27
+ - Vision, a11y, safety and performance belong to dedicated quality layers and are not included in ordinary component tests.
28
+ 5. Check whether commands, test frameworks, directory conventions, and CI gates already exist; use the current status of the project and do not introduce unnecessary tools to the policy document.
29
+ 6. Plan failure evidence: Each high-risk item should describe how to locate it when it fails, such as assertions, screenshots, traces, coverage, logs, or reports.
30
+ 7. Design test data and mock strategies: share fixtures to express business scenarios, and the test data builder only encapsulates noise fields to avoid handwriting random objects for each test.
31
+ 8. Manage flaky risks: Mark time, network, animation, nonce, concurrency, and external services as sources of instability, and specify isolation, retries, and evidence artifacts.
32
+ 9. Output the minimum executable test plan: what is covered by each layer, what is not covered, priority, recommended commands and responsibility skills.
33
33
 
34
34
  ## Constraints
35
35
 
36
- - 不把测试策略写成泛泛的“多写测试”;每个建议必须对应具体风险。
37
- - 不要求所有项目都补齐完整测试金字塔;按业务风险和团队维护能力裁剪。
38
- - 不把 E2E 当作单元/组件测试的替代品;不把组件测试当作真实浏览器兼容保证。
39
- - 不为小改动强制引入新框架;优先复用仓库已有工具和脚本。
40
- - 不追求没有风险说明的覆盖率数字;覆盖率只能辅助判断,不能替代场景覆盖。
41
- - 不把随机 fixture、共享全局状态或依赖执行顺序的测试纳入主干门禁。
36
+ - Don't write the test strategy as a general "write more tests"; each suggestion must correspond to a specific risk.
37
+ - All projects are not required to complete the complete testing pyramid; they are tailored according to business risks and team maintenance capabilities.
38
+ - Do not consider E2E as a replacement for unit/component testing; do not consider component testing as a guarantee of true browser compatibility.
39
+ - Do not force the introduction of new frameworks for small changes; give priority to reusing existing tools and scripts in the warehouse.
40
+ - Do not pursue coverage figures without risk explanation; coverage can only assist judgment and cannot replace scene coverage.
41
+ - Do not include random fixtures, shared global state, or tests that depend on execution order into trunk gates.
42
42
 
43
43
  ## Expected Output
44
44
 
45
- 输出测试分层建议、风险到测试层的映射、优先级、建议命令、需新增或调整的测试文件范围,以及明确分流到哪些专项 skill 或 agent。
45
+ Output test layering recommendations, mapping of risks to test layers, priorities, recommended commands, the scope of test files that need to be added or adjusted, and the specific skills or agents that need to be clearly diverted.
@@ -1,54 +1,54 @@
1
1
  ---
2
2
  name: fec-typescript-project-standard
3
- description: Use when creating, configuring, reviewing, or debugging TypeScript project standards across frontend apps, libraries, SDKs, CLIs, monorepo packages, tsconfig, strictness, module/moduleResolution, path aliases, project references, declaration files, package exports, public API types, DTOs, advanced generics, discriminated unions, type guards, type narrowing, or type-level regressions. Prefer framework project skills for React/Vue/Next/Nuxt component architecture; Chinese triggers include TypeScript 项目规范, TS 项目规范, TypeScript 类型安全, 类型建模, 泛型, 判别联合, 类型收窄, tsconfig, 声明文件.
3
+ description: Use when creating, configuring, reviewing, or debugging TypeScript project standards across frontend apps, libraries, SDKs, CLIs, monorepo packages, tsconfig, strictness, module/moduleResolution, path aliases, project references, declaration files, package exports, public API types, DTOs, advanced generics, discriminated unions, type guards, type narrowing, or type-level regressions. Prefer framework project skills for React/Vue/Next/Nuxt component architecture; Chinese triggers include TypeScript project specification, TS project specification, TypeScript type safety, type modeling, generics, discriminative unions, type narrowing, tsconfig, declaration files.
4
4
  ---
5
5
 
6
- # TypeScript 项目规范
6
+ # TypeScript project specifications
7
7
 
8
8
  ## Purpose
9
9
 
10
- 统一 TypeScript 层的工程配置、类型边界和发布产物规则。适用于前端应用、组件库、SDK、CLI、monorepo package 和纯 TypeScript 工具库,但不接管 React、Vue、Next.js、Nuxt 或 Vite 的框架架构职责。
10
+ Unify project configuration, type boundaries, and release product rules for the TypeScript layer. Works with front-end applications, component libraries, SDKs, CLIs, monorepo packages, and pure TypeScript tool libraries, but does not take over the framework architecture responsibilities of React, Vue, Next.js, Nuxt, or Vite.
11
11
 
12
12
  ## Procedure
13
13
 
14
- 1. 识别 TypeScript 上下文
15
- - 应用项目:优先检查 `tsconfig` 分层、strictness、路径别名、类型检查脚本和框架生成类型。
16
- - 组件库或 SDK:优先检查 public API、声明文件、package exports、peer dependencies 类型边界和发布前 pack 校验。
17
- - CLI 或 Node 工具:优先检查 Node 目标版本、ESM/CJS 策略、`moduleResolution`、shebang 产物和 `process.env` 类型边界。
18
- - Monorepo package:优先检查 project references、composite build、包间导入边界和 workspace 路径别名是否泄漏到发布产物。
19
- - React、Vue、Next.js、Nuxt 等框架的组件架构、路由组织和状态管理归对应框架 skill;本流程只处理跨框架 TypeScript 契约和工程边界。
20
-
21
- 2. 收敛 `tsconfig`
22
- - 默认开启 `strict`,不要为通过构建关闭 `noImplicitAny`、`strictNullChecks` 或 `exactOptionalPropertyTypes` 等关键约束。
23
- - 按运行环境选择 `target`、`lib`、`module` 和 `moduleResolution`;浏览器应用、Node 脚本、库包不要共用一份含混配置。
24
- - 将基础配置、应用配置、测试配置和构建声明配置拆开,避免测试全局类型污染生产代码。
25
- - 路径别名必须同时被 TypeScript、bundler、test runner 和发布产物理解;库包不得发布无法解析的源码别名。
26
-
27
- 3. 设计类型边界
28
- - 外部输入、DTO、领域模型、UI view model、组件 props 和工具函数 API 分层命名。
29
- - public API 的参数和返回值显式标注,内部局部变量优先依赖推断。
30
- - 外部数据先以 `unknown` 接收,再通过 schema 或 type guard 收窄。
31
- - 复杂泛型、判别联合、DTO 映射、类型守卫和类型测试加载 [类型安全参考](references/type-safety.md);需要高级模式时加载 [类型安全模式](references/type-safety-patterns.md)。
32
-
33
- 4. 固定发布与声明产物
34
- - 库包必须确认 `package.json` 的 `exports`、`types`、`files` 和实际构建产物一致。
35
- - 不默认双包发布;只有明确消费方需要时才同时产出 ESM/CJS,并验证类型入口不分叉。
36
- - 通过 `tsc --emitDeclarationOnly`、构建工具声明插件或 API extractor 产出 `.d.ts`,并在发布前检查声明文件可被消费方解析。
37
- - 不把测试、fixture、内部工具、未稳定类型或私有路径暴露到 package exports。
38
-
39
- 5. 验证 TypeScript 质量
40
- - 优先使用仓库已有脚本,如 `typecheck`、`build`、`test`、`lint` 和 package pack dry-run。
41
- - Vite、Next、Nuxt 等构建不等于完整类型检查;CI 必须有独立 typecheck 或等效验证。
42
- - 类型改动影响 public API 时补类型测试、编译期断言或消费方 fixture。
14
+ 1. Identify TypeScript context
15
+ - Application projects: Prioritize checking of `tsconfig` layering, strictness, path aliases, type checking scripts and framework generation types.
16
+ - Component library or SDK: Prioritize checking public API, declaration files, package exports, peer dependencies type boundaries and pre-release pack verification.
17
+ - CLI or Node tools: Prioritize checking Node target versions, ESM/CJS policies, `moduleResolution`, shebang artifacts, and `process.env` type boundaries.
18
+ - Monorepo package: Prioritize checking whether project references, composite builds, inter-package import boundaries, and workspace path aliases leak into release products.
19
+ - The component architecture, routing organization, and state management of frameworks such as React, Vue, Next.js, and Nuxt belong to the corresponding framework skills; this process only deals with cross-framework TypeScript contracts and project boundaries.
20
+
21
+ 2. Convergence `tsconfig`
22
+ - Turn on `strict` by default, do not turn off key constraints such as `noImplicitAny`, `strictNullChecks` or `exactOptionalPropertyTypes` for pass builds.
23
+ - Select `target`, `lib`, `module` and `moduleResolution` according to the running environment; browser applications, Node scripts, and library packages should not share an ambiguous configuration.
24
+ - Separate basic configuration, application configuration, test configuration and build declaration configuration to avoid testing global types from polluting production code.
25
+ - Path aliases must be understood by TypeScript, bundler, test runner, and published products at the same time; library packages must not publish source code aliases that cannot be resolved.
26
+
27
+ 3. Design type boundaries
28
+ - Hierarchical naming of external input, DTO, domain model, UI view model, component props and tool function API.
29
+ - The parameters and return values of the public API are explicitly marked, and internal local variables are inferred first.
30
+ - External data is received as `unknown` first, and then narrowed by schema or type guard.
31
+ - Complex generics, discriminative unions, DTO mappings, type guards and type tests are loaded [Type Safety Reference](references/type-safety.md); [Type Safety Patterns](references/type-safety-patterns.md) is loaded when advanced patterns are required.
32
+
33
+ 4. Fixed release and announcement of products
34
+ - The library package must confirm that the `exports`, `types`, and `files` of `package.json` are consistent with the actual build product.
35
+ - Do not default to dual-package publishing; only produce ESM/CJS at the same time when the consumer clearly needs it, and verify that the type entry does not fork.
36
+ - Produce `.d.ts` through `tsc --emitDeclarationOnly`, build tool declaration plug-in or API extractor, and check that the declaration file can be parsed by the consumer before publishing.
37
+ - Do not expose tests, fixtures, internal tools, unstable types, or private paths to package exports.
38
+
39
+ 5. Verify TypeScript quality
40
+ - Prioritize the use of existing scripts in the repository, such as `typecheck`, `build`, `test`, `lint` and package pack dry-run.
41
+ - Vite, Next, Nuxt, etc. builds do not equal full type checking; CI must have standalone typecheck or equivalent verification.
42
+ - Type changes affect public API time-filling type tests, compile-time assertions, or consumer fixtures.
43
43
 
44
44
  ## Constraints
45
45
 
46
- - 不用 `skipLibCheck`、`any`、无守卫非空断言或宽泛 `as` 掩盖真实边界问题。
47
- - 不在应用代码中依赖发布包私有深层路径。
48
- - 不把框架目录结构、组件分层、路由组织或状态管理决策放进本流程;这些交给对应框架或专项流程。
49
- - 不让生成类型、测试类型或 Node-only 类型污染浏览器运行代码。
50
- - 不发布只能在源码仓库内解析的路径别名、ambient 声明或隐式全局类型。
46
+ - Don't use `skipLibCheck`, `any`, unguarded non-null assertions or the wide `as` to mask real boundary issues.
47
+ - Do not rely on release package private deep paths in application code.
48
+ - Do not put framework directory structure, component layering, routing organization or state management decisions into this process; these are left to the corresponding framework or dedicated process.
49
+ - Don't pollute browser running code with generated, test, or Node-only types.
50
+ - Do not publish path aliases, ambient declarations, or implicit global types that can only be resolved within the source code repository.
51
51
 
52
52
  ## Expected Output
53
53
 
54
- 输出应包含 TypeScript 上下文判断、关键 `tsconfig`/package 类型入口建议、类型边界方案、声明文件或 public API 风险、验证命令。完成后项目应能独立 typecheck,公开类型可被消费方解析,类型安全问题有明确收窄或建模方案。
54
+ The output should include TypeScript context determinations, key `tsconfig`/package type entry suggestions, type boundary schemes, declaration file or public API risks, and verification commands. After completion, the project should be able to independently typecheck, public types can be parsed by consumers, and type safety issues should have clear narrowing or modeling solutions.
@@ -1,15 +1,15 @@
1
- # 类型安全模式
1
+ # Type safety mode
2
2
 
3
- ## 类型边界审查清单
3
+ ## Type Boundary Review Checklist
4
4
 
5
- - DTO 应与外部载荷对应,并在 API 边界处进行转换。
6
- - 领域模型或视图模型使用前端命名和稳定的联合类型。
7
- - 组件 props 需命名明确,仅在该文件外复用时才导出。
8
- - 公开函数必须有显式的参数和返回值类型。
9
- - 外部输入必须从 `unknown` 开始,通过 schema 校验或类型守卫逐步收窄。
10
- - 配置映射表优先使用 `as const` 和 `satisfies`,避免宽泛断言。
5
+ - DTOs should correspond to external loads and be converted at API boundaries.
6
+ - Domain model or view model uses front-end naming and stable union types.
7
+ - Component props need to be named clearly and exported only when reused outside this file.
8
+ - Public functions must have explicit parameter and return value types.
9
+ - External input must start from `unknown` and be gradually narrowed through schema verification or type guarding.
10
+ - Configure mapping tables using `as const` and `satisfies` first to avoid broad assertions.
11
11
 
12
- ## 使用 `satisfies` 的配置映射表
12
+ ## Use the configuration mapping table of `satisfies`
13
13
 
14
14
  ```ts
15
15
  type Tone = "neutral" | "success" | "warning" | "danger";
@@ -23,9 +23,9 @@ const STATUS_TONE = {
23
23
  type InvoiceStatus = keyof typeof STATUS_TONE;
24
24
  ```
25
25
 
26
- 这样既保留了字面量值,又验证了映射表符合预期的值域。
26
+ This not only preserves the literal value, but also verifies that the mapping table conforms to the expected value range.
27
27
 
28
- ## 映射类型用于表单错误
28
+ ## Mapping type used for form errors
29
29
 
30
30
  ```ts
31
31
  type FieldErrors<TValues extends Record<string, unknown>> = {
@@ -40,7 +40,7 @@ interface ProfileFormValues {
40
40
  type ProfileFormErrors = FieldErrors<ProfileFormValues>;
41
41
  ```
42
42
 
43
- ## 模板字面量类型用于事件命名
43
+ ## Template literal type is used for event naming
44
44
 
45
45
  ```ts
46
46
  interface AnalyticsPayloads {
@@ -52,9 +52,9 @@ type AnalyticsEventName = keyof AnalyticsPayloads;
52
52
  type AnalyticsHandlerName = `on${Capitalize<string & AnalyticsEventName>}`;
53
53
  ```
54
54
 
55
- 当项目中已有事件命名规范时使用此模式。不要为一次性字符串引入。
55
+ Use this pattern when there is already an event naming convention in the project. Don't introduce it for one-time strings.
56
56
 
57
- ## 更安全的泛型组件模式
57
+ ## Safer generic component pattern
58
58
 
59
59
  ```tsx
60
60
  interface Entity {
@@ -92,11 +92,11 @@ export function EntityPicker<TEntity extends Entity>({
92
92
  }
93
93
  ```
94
94
 
95
- ## 类型审查反馈
95
+ ## Type Review Feedback
96
96
 
97
- 报告类型安全问题时,需包含:
97
+ When reporting a type safety issue, include:
98
98
 
99
- - 过于宽泛、过于狭窄或不合理的类型边界。
100
- - 尽管通过 TypeScript 但可能在运行时失败的行为。
101
- - 最小替换类型或守卫方案。
102
- - 该变更是否需要测试或类型测试。
99
+ - Type boundaries that are too broad, too narrow, or unreasonable.
100
+ - Behavior that may fail at runtime despite passing TypeScript.
101
+ - Minimal replacement type or guard scheme.
102
+ - Whether the change requires testing or type testing.
@@ -1,14 +1,14 @@
1
- # TypeScript 类型安全
1
+ #TypeScript type safety
2
2
 
3
3
  ## Purpose
4
4
 
5
- 为前端和 TypeScript 工程建立可演进的类型契约,减少 `any`、断言和运行时形状漂移。
5
+ Establish evolvable type contracts for front-end and TypeScript projects, reducing `any`, assertions, and runtime shape drift.
6
6
 
7
7
  ## Procedure
8
8
 
9
- ### 1. 先确定类型边界
9
+ ### 1. First determine the type boundary
10
10
 
11
- 把类型分为外部输入、领域模型、UI view model、组件 props、工具函数 API。不要让后端 DTO、表单模型和 UI 展示模型互相冒充。
11
+ Divide types into external input, domain model, UI view model, component props, and tool function API. Don't let backend DTOs, form models, and UI presentation models pretend to be each other.
12
12
 
13
13
  ```ts
14
14
  interface UserDto {
@@ -32,9 +32,9 @@ export function mapUserDto(dto: UserDto): UserViewModel {
32
32
  }
33
33
  ```
34
34
 
35
- ### 2. 用 `unknown` 和收窄处理不可信数据
35
+ ### 2. Use `unknown` and narrowing to handle untrusted data
36
36
 
37
- 外部输入先校验再使用。不要用 `as` 让编译器闭嘴。
37
+ External input must be verified before use. Don't use `as` to shut up the compiler.
38
38
 
39
39
  ```ts
40
40
  interface ApiErrorBody {
@@ -55,9 +55,9 @@ export function getApiErrorMessage(value: unknown): string {
55
55
  }
56
56
  ```
57
57
 
58
- ### 3. 用判别联合表达状态机
58
+ ### 3. Express state machine using discriminant union
59
59
 
60
- 异步状态、权限分支、支付状态等有限状态,用判别字段让新增分支在编译期暴露。
60
+ Limited states such as asynchronous status, permission branches, payment status, etc. use discriminant fields to expose new branches during compilation.
61
61
 
62
62
  ```ts
63
63
  type Loadable<T> =
@@ -86,9 +86,9 @@ export function renderUserState(user: Loadable<{ name: string }>): string {
86
86
  }
87
87
  ```
88
88
 
89
- ### 4. 让泛型服务调用方,而不是炫技
89
+ ### 4. Let generics serve callers, not show off their skills
90
90
 
91
- 泛型应减少重复并保持调用方推断清晰。复杂类型超过阅读成本时,优先拆具名类型。
91
+ Generics should reduce duplication and keep caller inference clear. When the complex type exceeds the reading cost, the named type will be demolished first.
92
92
 
93
93
  ```ts
94
94
  interface SelectOption<TValue extends string | number> {
@@ -119,9 +119,9 @@ export function Select<TValue extends string | number>({
119
119
  }
120
120
  ```
121
121
 
122
- ### 5. 用类型测试保护公共类型
122
+ ### 5. Protect public types with type testing
123
123
 
124
- 公共工具类型、组件库类型和 SDK 类型,应有轻量类型测试或编译期断言。
124
+ Public tool types, component library types, and SDK types should have lightweight type tests or compile-time assertions.
125
125
 
126
126
  ```ts
127
127
  type Equal<TLeft, TRight> =
@@ -137,12 +137,12 @@ type _UserStatusTest = Expect<Equal<UserStatus, "active" | "disabled">>;
137
137
 
138
138
  ## Constraints
139
139
 
140
- - 避免 `any`、无守卫的非空断言和不相关类型之间的强制 `as`。
141
- - 不把大型匿名类型堆在函数参数或 JSX props 上;提取具名类型表达业务含义。
142
- - 不为简单业务过度设计递归条件类型;类型复杂度应服务可维护性。
143
- - 公共 API 的输入输出必须显式标注,局部变量可依赖推断。
144
- - 类型建模不能替代运行时校验;外部数据仍需 schema 或 type guard。
140
+ - Avoid `any`, unguarded non-null assertions and coercion `as` between unrelated types.
141
+ - Don’t pile large anonymous types on function parameters or JSX props; extract named types to express business meaning.
142
+ - Do not over-design recursive conditional types for simple business; type complexity should serve maintainability.
143
+ - The input and output of the public API must be explicitly annotated, and local variables can be relied upon for inference.
144
+ - Type modeling does not replace runtime validation; external data still requires schema or type guard.
145
145
 
146
146
  ## Expected Output
147
147
 
148
- 产出清晰的类型边界、可收窄的数据模型、必要的类型测试和验证命令。评审时应列出类型风险、运行时影响、推荐建模方式和是否需要专项修复。
148
+ Produce clear type boundaries, narrowable data models, and necessary type testing and verification commands. The review should list type risks, runtime impacts, recommended modeling methods, and whether special fixes are needed.