@bovinphang/frontend-craft 2.7.0 → 2.8.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 (380) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +34 -0
  4. package/CHANGELOG.zh-CN.md +34 -0
  5. package/README.md +1 -1
  6. package/README.openclaw.md +99 -43
  7. package/README.openclaw.zh-CN.md +99 -43
  8. package/README.zh-CN.md +1 -1
  9. package/agents/fec-architect.md +70 -70
  10. package/agents/fec-code-reviewer.md +82 -82
  11. package/agents/fec-debugger.md +20 -20
  12. package/agents/fec-design-token-mapper.md +36 -36
  13. package/agents/fec-doc-updater.md +13 -13
  14. package/agents/fec-e2e-runner.md +45 -45
  15. package/agents/fec-figma-implementer.md +59 -59
  16. package/agents/fec-performance-optimizer.md +128 -128
  17. package/agents/fec-refactor-cleaner.md +14 -14
  18. package/agents/fec-security-reviewer.md +66 -67
  19. package/agents/fec-test-planner.md +27 -27
  20. package/agents/fec-typescript-reviewer.md +87 -87
  21. package/agents/fec-ui-checker.md +74 -74
  22. package/commands/fec-debug.md +19 -19
  23. package/commands/fec-doc-sync.md +11 -11
  24. package/commands/fec-init.md +37 -38
  25. package/commands/fec-plan.md +58 -58
  26. package/commands/fec-refactor-clean.md +11 -11
  27. package/commands/fec-review.md +41 -41
  28. package/commands/fec-scaffold.md +41 -41
  29. package/commands/fec-tdd.md +13 -13
  30. package/dist/bin/frontend-craft.js +29 -27
  31. package/docs/example-prompts.md +3 -0
  32. package/docs/ja-JP/README.md +1 -1
  33. package/docs/ko-KR/README.md +1 -1
  34. package/docs/project-structure.md +13 -5
  35. package/docs/zh-CN/example-prompts.md +3 -0
  36. package/docs/zh-CN/project-structure.md +6 -1
  37. package/docs/zh-TW/README.md +1 -1
  38. package/localized/zh-CN/agents/fec-architect.md +125 -0
  39. package/localized/zh-CN/agents/fec-code-reviewer.md +152 -0
  40. package/localized/zh-CN/agents/fec-debugger.md +44 -0
  41. package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
  42. package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
  43. package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
  44. package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
  45. package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
  46. package/localized/zh-CN/agents/fec-refactor-cleaner.md +32 -0
  47. package/localized/zh-CN/agents/fec-security-reviewer.md +116 -0
  48. package/localized/zh-CN/agents/fec-test-planner.md +50 -0
  49. package/localized/zh-CN/agents/fec-typescript-reviewer.md +142 -0
  50. package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
  51. package/localized/zh-CN/commands/fec-debug.md +30 -0
  52. package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
  53. package/localized/zh-CN/commands/fec-init.md +70 -0
  54. package/localized/zh-CN/commands/fec-plan.md +94 -0
  55. package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
  56. package/localized/zh-CN/commands/fec-review.md +66 -0
  57. package/localized/zh-CN/commands/fec-scaffold.md +205 -0
  58. package/localized/zh-CN/commands/fec-tdd.md +21 -0
  59. package/localized/zh-CN/skills/TEMPLATE.md +155 -0
  60. package/localized/zh-CN/skills/eval_queries.json +1013 -0
  61. package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
  62. package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
  63. package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  64. package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
  65. package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
  66. package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
  67. package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
  68. package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
  69. package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
  70. package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
  71. package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
  72. package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  73. package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
  74. package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  75. package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
  76. package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  77. package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  78. package/localized/zh-CN/skills/fec-code-review/SKILL.md +143 -0
  79. package/localized/zh-CN/skills/fec-code-review/references/report-template.md +29 -0
  80. package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
  81. package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
  82. package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
  83. package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
  84. package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
  85. package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
  86. package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  87. package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
  88. package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
  89. package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  90. package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  91. package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  92. package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
  93. package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
  94. package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  95. package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
  96. package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  97. package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
  98. package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  99. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
  100. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  101. package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  102. package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  103. package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  104. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  105. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  106. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  107. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  108. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  109. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  110. package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
  111. package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  112. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  113. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  114. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  115. package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
  116. package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
  117. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  118. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  119. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  120. package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  121. package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
  122. package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
  123. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +80 -0
  124. package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  125. package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
  126. package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +74 -0
  127. package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  128. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
  129. package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  130. package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  131. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
  132. package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  133. package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
  134. package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  135. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
  136. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  137. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  138. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  139. package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
  140. package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  141. package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
  142. package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
  143. package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  144. package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
  145. package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  146. package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
  147. package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  148. package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
  149. package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  150. package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
  151. package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
  152. package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  153. package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  154. package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
  155. package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  156. package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  157. package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  158. package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  159. package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +51 -0
  160. package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
  161. package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
  162. package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
  163. package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
  164. package/localized/zh-CN/skills/fec-security-review/SKILL.md +38 -0
  165. package/localized/zh-CN/skills/fec-security-review/references/report-template.md +27 -0
  166. package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
  167. package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
  168. package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
  169. package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
  170. package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
  171. package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  172. package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
  173. package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
  174. package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
  175. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +52 -0
  176. package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
  177. package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
  178. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
  179. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
  180. package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
  181. package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
  182. package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
  183. package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
  184. package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
  185. package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
  186. package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  187. package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
  188. package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
  189. package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
  190. package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
  191. package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
  192. package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
  193. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
  194. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  195. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
  196. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  197. package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
  198. package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  199. package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  200. package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  201. package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  202. package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  203. package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  204. package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
  205. package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
  206. package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
  207. package/localized/zh-CN/skills/metadata.json +1646 -0
  208. package/localized/zh-CN/skills/relations.json +755 -0
  209. package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
  210. package/localized/zh-CN/templates/claude/settings.json +62 -0
  211. package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
  212. package/localized/zh-CN/templates/codex/config.toml +32 -0
  213. package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
  214. package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  215. package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +54 -0
  216. package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
  217. package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
  218. package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
  219. package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
  220. package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
  221. package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
  222. package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
  223. package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
  224. package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
  225. package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
  226. package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
  227. package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
  228. package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
  229. package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
  230. package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
  231. package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
  232. package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
  233. package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
  234. package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
  235. package/openclaw.plugin.json +1 -1
  236. package/package.json +3 -2
  237. package/skills/TEMPLATE.md +74 -74
  238. package/skills/eval_queries.json +678 -678
  239. package/skills/fec-accessibility-check/SKILL.md +21 -21
  240. package/skills/fec-accessibility-check/references/report-template.md +12 -12
  241. package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
  242. package/skills/fec-alchemy/SKILL.md +50 -50
  243. package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
  244. package/skills/fec-alchemy/assets/intake-template.md +55 -55
  245. package/skills/fec-alchemy/assets/review-checklist.md +23 -23
  246. package/skills/fec-alchemy/references/methodology.md +66 -66
  247. package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
  248. package/skills/fec-api-integration/SKILL.md +61 -61
  249. package/skills/fec-api-integration/references/integration-patterns.md +30 -30
  250. package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
  251. package/skills/fec-browser-storage/SKILL.md +16 -16
  252. package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
  253. package/skills/fec-canvas-threejs/SKILL.md +21 -21
  254. package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
  255. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
  256. package/skills/fec-code-review/SKILL.md +94 -94
  257. package/skills/fec-code-review/references/report-template.md +13 -13
  258. package/skills/fec-component-testing/SKILL.md +39 -39
  259. package/skills/fec-data-fetching/SKILL.md +16 -16
  260. package/skills/fec-data-fetching/references/query-patterns.md +27 -27
  261. package/skills/fec-debug-framework/SKILL.md +95 -95
  262. package/skills/fec-debug-framework/references/report-template.md +34 -34
  263. package/skills/fec-dependency-upgrade/SKILL.md +17 -17
  264. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
  265. package/skills/fec-doc-sync/SKILL.md +23 -23
  266. package/skills/fec-drawio-studio/SKILL.md +42 -38
  267. package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
  268. package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  269. package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
  270. package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  271. package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
  272. package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
  273. package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
  274. package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  275. package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
  276. package/skills/fec-e2e-testing/SKILL.md +24 -24
  277. package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
  278. package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
  279. package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
  280. package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
  281. package/skills/fec-form-handling/SKILL.md +21 -21
  282. package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
  283. package/skills/fec-image-generation/SKILL.md +54 -29
  284. package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  285. package/skills/fec-image-generation/references/diagram-workflows.md +33 -2
  286. package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  287. package/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  288. package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  289. package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  290. package/skills/fec-implement-from-design/SKILL.md +81 -81
  291. package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
  292. package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
  293. package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
  294. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
  295. package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
  296. package/skills/fec-legacy-web-standard/SKILL.md +17 -17
  297. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
  298. package/skills/fec-list-virtualization/SKILL.md +16 -16
  299. package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
  300. package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
  301. package/skills/fec-motion-interaction/SKILL.md +51 -51
  302. package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
  303. package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
  304. package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
  305. package/skills/fec-performance-optimization/SKILL.md +54 -54
  306. package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
  307. package/skills/fec-performance-optimization/references/report-template.md +31 -31
  308. package/skills/fec-pwa-implementation/SKILL.md +17 -17
  309. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
  310. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
  311. package/skills/fec-react-project-standard/SKILL.md +72 -72
  312. package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
  313. package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
  314. package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
  315. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
  316. package/skills/fec-refactor-clean/SKILL.md +30 -30
  317. package/skills/fec-refactor-clean/references/report-template.md +23 -23
  318. package/skills/fec-responsive-layout/SKILL.md +17 -17
  319. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
  320. package/skills/fec-route-protection/SKILL.md +26 -26
  321. package/skills/fec-security-review/SKILL.md +20 -20
  322. package/skills/fec-security-review/references/report-template.md +12 -12
  323. package/skills/fec-security-review/references/security-checklist.md +27 -27
  324. package/skills/fec-source-driven-development/SKILL.md +59 -59
  325. package/skills/fec-state-management/SKILL.md +34 -34
  326. package/skills/fec-state-management/references/state-patterns.md +19 -19
  327. package/skills/fec-storybook-component-doc/SKILL.md +19 -19
  328. package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
  329. package/skills/fec-svg-animation/SKILL.md +32 -32
  330. package/skills/fec-tailwind-design-system/SKILL.md +17 -17
  331. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
  332. package/skills/fec-tdd-workflow/SKILL.md +28 -28
  333. package/skills/fec-testing-strategy/SKILL.md +29 -29
  334. package/skills/fec-typescript-project-standard/SKILL.md +38 -38
  335. package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
  336. package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
  337. package/skills/fec-ui-design/SKILL.md +90 -90
  338. package/skills/fec-ui-design/references/design-intelligence.md +61 -61
  339. package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
  340. package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
  341. package/skills/fec-validation-fix/SKILL.md +26 -26
  342. package/skills/fec-validation-fix/references/report-template.md +25 -25
  343. package/skills/fec-vite-project-standard/SKILL.md +39 -39
  344. package/skills/fec-vue3-project-standard/SKILL.md +38 -38
  345. package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
  346. package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
  347. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
  348. package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
  349. package/skills/fec-web-video-presentation/SKILL.md +33 -33
  350. package/skills/fec-web-workers/SKILL.md +16 -16
  351. package/skills/fec-web-workers/references/advanced-workers.md +13 -13
  352. package/skills/fec-web-workers/references/basic-worker.md +8 -8
  353. package/skills/metadata.json +121 -115
  354. package/skills/relations.json +4 -0
  355. package/templates/claude/CLAUDE.md +60 -60
  356. package/templates/codex/AGENTS.md +76 -76
  357. package/templates/codex/config.toml +4 -4
  358. package/templates/openclaw/AGENTS.md +68 -68
  359. package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
  360. package/templates/shared/rules/fec-agent-workflow.md +40 -40
  361. package/templates/shared/rules/fec-api-layer.md +52 -52
  362. package/templates/shared/rules/fec-ci-cd.md +29 -29
  363. package/templates/shared/rules/fec-code-comments.md +22 -22
  364. package/templates/shared/rules/fec-design-system.md +53 -53
  365. package/templates/shared/rules/fec-error-handling.md +40 -40
  366. package/templates/shared/rules/fec-git-conventions.md +42 -42
  367. package/templates/shared/rules/fec-i18n.md +48 -48
  368. package/templates/shared/rules/fec-naming-conventions.md +91 -91
  369. package/templates/shared/rules/fec-performance.md +78 -78
  370. package/templates/shared/rules/fec-react.md +58 -58
  371. package/templates/shared/rules/fec-refactoring.md +34 -34
  372. package/templates/shared/rules/fec-rendering-patterns.md +36 -36
  373. package/templates/shared/rules/fec-responsive-design.md +37 -37
  374. package/templates/shared/rules/fec-source-driven-development.md +22 -22
  375. package/templates/shared/rules/fec-state-management.md +56 -56
  376. package/templates/shared/rules/fec-testing.md +64 -64
  377. package/templates/shared/rules/fec-typescript.md +75 -75
  378. package/templates/shared/rules/fec-vue.md +42 -42
  379. package/templates/shared/rules/fec-working-modes.md +34 -34
  380. package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
@@ -0,0 +1,118 @@
1
+ # Storybook 配置与示例
2
+
3
+ ## 初始化
4
+
5
+ ```bash
6
+ npx storybook@latest init
7
+ ```
8
+
9
+ ## main.ts
10
+
11
+ ```ts
12
+ import type { StorybookConfig } from "@storybook/react-vite";
13
+
14
+ const config: StorybookConfig = {
15
+ stories: ["../src/**/*.stories.@(ts|tsx)"],
16
+ addons: [
17
+ "@storybook/addon-links",
18
+ "@storybook/addon-essentials",
19
+ "@storybook/addon-interactions",
20
+ "@storybook/addon-a11y",
21
+ ],
22
+ framework: { name: "@storybook/react-vite", options: {} },
23
+ docs: { autodocs: "tag" },
24
+ };
25
+
26
+ export default config;
27
+ ```
28
+
29
+ ## Story 示例
30
+
31
+ ```tsx
32
+ import type { Meta, StoryObj } from "@storybook/react";
33
+ import { Button } from "./Button";
34
+
35
+ const meta: Meta<typeof Button> = {
36
+ title: "Components/Button",
37
+ component: Button,
38
+ tags: ["autodocs"],
39
+ argTypes: {
40
+ variant: { control: "select", options: ["primary", "secondary", "ghost"] },
41
+ onClick: { action: "clicked" },
42
+ },
43
+ };
44
+
45
+ export default meta;
46
+ type Story = StoryObj<typeof Button>;
47
+
48
+ export const Primary: Story = {
49
+ args: { variant: "primary", children: "Primary Button" },
50
+ };
51
+ ```
52
+
53
+ ## 装饰器
54
+
55
+ ```tsx
56
+ import type { Preview } from "@storybook/react";
57
+ import { MemoryRouter } from "react-router-dom";
58
+ import { ThemeProvider } from "../src/app/providers";
59
+
60
+ const preview: Preview = {
61
+ decorators: [
62
+ (Story) => <ThemeProvider>{Story()}</ThemeProvider>,
63
+ (Story) => <MemoryRouter initialEntries={["/"]}>{Story()}</MemoryRouter>,
64
+ ],
65
+ };
66
+
67
+ export default preview;
68
+ ```
69
+
70
+ ## MDX 文档
71
+
72
+ ```mdx
73
+ import { Meta, Canvas, Controls, Source } from "@storybook/blocks";
74
+ import * as InputStories from "./Input.stories";
75
+
76
+ <Meta of={InputStories} />
77
+
78
+ # Input 输入框
79
+
80
+ 用于用户文本输入,支持校验提示、前后缀图标、字数统计等。
81
+
82
+ ### 何时使用
83
+
84
+ - 单行文本输入
85
+ - 需要实时校验反馈的表单字段
86
+
87
+ <Canvas of={InputStories.Default} />
88
+
89
+ ### 属性
90
+
91
+ <Controls />
92
+
93
+ ### 源码
94
+
95
+ <Source of={InputStories.Default} />
96
+ ```
97
+
98
+ ## 交互测试
99
+
100
+ ```tsx
101
+ import { expect, userEvent, within } from "@storybook/test";
102
+
103
+ export const FormSubmission: Story = {
104
+ play: async ({ canvasElement }) => {
105
+ const canvas = within(canvasElement);
106
+ await userEvent.type(canvas.getByLabelText("用户名"), "admin");
107
+ await userEvent.click(canvas.getByRole("button", { name: /登录/ }));
108
+ await expect(canvas.findByText("登录成功")).resolves.toBeInTheDocument();
109
+ },
110
+ };
111
+ ```
112
+
113
+ ## 视觉回归
114
+
115
+ ```bash
116
+ npx chromatic --project-token=<token>
117
+ npx test-storybook
118
+ ```
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: fec-svg-animation
3
+ description: 用于实现或审查 SVG 动画、路径绘制、图标动效、Logo 动画、插画动效、微交互、CSS/SMIL/Framer Motion/GSAP 选型、动效无障碍或降级行为;中文触发词包括 SVG 动画、路径描边、动效。
4
+ ---
5
+
6
+ # SVG 动画实现
7
+
8
+ ## 用途
9
+
10
+ 为 SVG 图标、插画和数据可视化提供可维护、可访问、性能可控的动画方案。
11
+
12
+ ## 适用场景
13
+
14
+ - 需要实现 SVG 图标、Logo、插画或路径描边动画。
15
+ - 需要在 React/Vue 组件中接入 Framer Motion、GSAP 或 CSS 动画。
16
+ - 需要根据 `prefers-reduced-motion` 提供动效降级。
17
+ - 不用于复杂 3D/WebGL 场景;此类场景优先使用 Canvas / Three.js workflow。
18
+
19
+ ## 流程
20
+
21
+ ### 1. 选择动画方式
22
+
23
+ 按复杂度和运行时需求选型:
24
+
25
+ | 场景 | 推荐 |
26
+ | --- | --- |
27
+ | hover/focus、opacity、transform | CSS animation/transition |
28
+ | 路径描边、简单重复动效 | CSS + `stroke-dasharray` |
29
+ | React 组件状态驱动动画 | Framer Motion |
30
+ | 时间轴、复杂编排、滚动触发 | GSAP |
31
+ | 需要保持零依赖的静态 SVG | CSS 或 SMIL |
32
+
33
+ 如果动效跨越页面转场、滚动叙事或复杂组件编排,应先按交互动效 workflow 判断强度、懒加载和 reduced-motion 策略;本 skill 只负责 SVG 图形本身的路径、形变和图标 motion。
34
+
35
+ ### 2. 使用 CSS 实现路径描边
36
+
37
+ ```tsx
38
+ export function CheckmarkIcon() {
39
+ return (
40
+ <svg viewBox="0 0 24 24" className="checkmark" aria-hidden="true">
41
+ <path
42
+ className="checkmark-path"
43
+ d="M5 12.5l4.5 4.5L19 7"
44
+ fill="none"
45
+ stroke="currentColor"
46
+ strokeWidth="2.5"
47
+ strokeLinecap="round"
48
+ strokeLinejoin="round"
49
+ />
50
+ </svg>
51
+ );
52
+ }
53
+ ```
54
+
55
+ ```css
56
+ .checkmark-path {
57
+ stroke-dasharray: 24;
58
+ stroke-dashoffset: 24;
59
+ animation: draw-checkmark 420ms ease-out forwards;
60
+ }
61
+
62
+ @keyframes draw-checkmark {
63
+ to {
64
+ stroke-dashoffset: 0;
65
+ }
66
+ }
67
+
68
+ @media (prefers-reduced-motion: reduce) {
69
+ .checkmark-path {
70
+ animation: none;
71
+ stroke-dashoffset: 0;
72
+ }
73
+ }
74
+ ```
75
+
76
+ ### 3. 在 React 中使用 Framer Motion
77
+
78
+ ```tsx
79
+ import { motion, useReducedMotion } from "framer-motion";
80
+
81
+ export function AnimatedSparkline({ path }: { path: string }) {
82
+ const reduceMotion = useReducedMotion();
83
+
84
+ return (
85
+ <svg viewBox="0 0 120 40" role="img" aria-label="趋势图">
86
+ <motion.path
87
+ d={path}
88
+ fill="none"
89
+ stroke="currentColor"
90
+ strokeWidth="2"
91
+ initial={reduceMotion ? false : { pathLength: 0, opacity: 0 }}
92
+ animate={{ pathLength: 1, opacity: 1 }}
93
+ transition={{ duration: 0.7, ease: "easeOut" }}
94
+ />
95
+ </svg>
96
+ );
97
+ }
98
+ ```
99
+
100
+ ### 4. 使用 GSAP 编排复杂时间轴
101
+
102
+ ```tsx
103
+ import { useLayoutEffect, useRef } from "react";
104
+ import gsap from "gsap";
105
+
106
+ export function LogoReveal() {
107
+ const rootRef = useRef<SVGSVGElement>(null);
108
+
109
+ useLayoutEffect(() => {
110
+ if (!rootRef.current) return;
111
+ const ctx = gsap.context(() => {
112
+ gsap.timeline({ defaults: { ease: "power2.out" } })
113
+ .from(".logo-mark", { scale: 0.9, opacity: 0, duration: 0.25 })
114
+ .from(".logo-line", { strokeDashoffset: 80, duration: 0.55 }, "-=0.1");
115
+ }, rootRef);
116
+
117
+ return () => ctx.revert();
118
+ }, []);
119
+
120
+ return (
121
+ <svg ref={rootRef} viewBox="0 0 120 32" aria-hidden="true">
122
+ <circle className="logo-mark" cx="16" cy="16" r="10" />
123
+ <path className="logo-line" d="M36 16h68" stroke="currentColor" />
124
+ </svg>
125
+ );
126
+ }
127
+ ```
128
+
129
+ ### 5. 控制运行成本
130
+
131
+ - 大型 SVG 拆成静态底图和少量可动画节点,不要让每个 path 都参与时间轴。
132
+ - 图标库或 Lottie 替代方案必须按需加载,不进入所有页面的基础包。
133
+ - 循环动画只在可见区域运行,页面隐藏或组件卸载时停止。
134
+ - 移动端减少滤镜、mask、clipPath 和大量渐变叠加。
135
+
136
+ ## 约束
137
+
138
+ - 优先动画 `transform`、`opacity` 和 SVG 路径属性;避免高频修改 layout 相关属性。
139
+ - 交互控件必须保留可见 focus 状态,动画不能替代状态表达。
140
+ - 所有非装饰性 SVG 必须有可访问名称;装饰性 SVG 使用 `aria-hidden="true"`。
141
+ - 默认尊重 `prefers-reduced-motion`,复杂动效必须提供静态或弱动效降级。
142
+ - 不要把大型 SVG 内联到频繁重渲染的组件中;提取为 memoized 组件或外部资源。
143
+ - 不用动画改变可点击区域、阅读顺序或焦点位置。
144
+ - 不让 SVG 滤镜、模糊、mask 或 clipPath 成为移动端掉帧主因;复杂效果需要设备降级。
145
+
146
+ ## 预期输出
147
+
148
+ 产出一个可复用的 SVG 动画组件或样式方案,包含选型理由、动效降级和可访问性处理。验证时检查动画流畅、无布局抖动、键盘与 reduced-motion 场景可用。
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: fec-tailwind-design-system
3
+ description: 用于设计、实现或审查 Tailwind CSS 设计系统、Token 映射、主题扩展、工具类治理、组件变体、暗色模式、响应式工具、safelist 或可维护的 class 组合;中文触发词包括 Tailwind、设计 Token、组件变体、暗色模式、class 管理。
4
+ ---
5
+
6
+ # Tailwind 设计系统
7
+
8
+ 适用于用 Tailwind CSS 承载产品设计系统、组件变体和主题规则的前端任务。需要具体配置、variant、class 组织和迁移细节时加载 [references/tailwind-system-patterns.md](references/tailwind-system-patterns.md)。
9
+
10
+ ## 用途
11
+
12
+ 让 Tailwind 项目中的 token、主题、组件变体和响应式样式可维护,而不是把一次性 utility class 散落到业务代码里。
13
+
14
+ ## 流程
15
+
16
+ 1. 识别现状:确认 Tailwind 版本、配置位置、暗色模式策略、组件库、CSS 变量、设计 token 和 class 合并工具。
17
+ 2. 建立 token 边界:颜色、间距、圆角、阴影、字体、z-index 和断点优先从项目 token 或 `theme.extend` 派生。
18
+ 3. 设计组件变体:按钮、输入框、卡片、弹窗、表格等基础组件用集中 variant API 表达尺寸、语义、状态和密度。
19
+ 4. 控制 class 复杂度:重复组合沉淀为组件、slot、variant 或局部 helper;不要把长 class 字符串复制到多个页面。
20
+ 5. 处理主题和暗色模式:明确 `class`、`data-theme` 或 CSS 变量方案,避免首次渲染闪烁和对比度回归。
21
+ 6. 接入响应式:移动优先组织 utility;复杂布局交给响应式布局工作流,不要只靠堆叠断点前缀碰运气。
22
+ 7. 验证样式结果:检查 hover、active、focus-visible、disabled、loading、selected、invalid、dark 和不同断点。
23
+
24
+ ## 约束
25
+
26
+ - 不把 Tailwind class 当作设计系统本身;真正的系统是 token、组件 API、状态矩阵和使用约束。
27
+ - 不为单个页面随意扩展全局 token;新增 token 必须有语义名称和复用场景。
28
+ - 不使用拼接的动态 class 破坏构建扫描;必要时使用 safelist、映射表或 variant 工具。
29
+ - 不在组件外部覆盖基础组件内部结构来实现变体。
30
+ - 不让暗色模式只靠反色;状态色、边框、阴影、图表和图片都要重新检查。
31
+
32
+ ## 预期输出
33
+
34
+ 输出 Tailwind token 映射、主题配置边界、组件 variant 设计、class 复用策略、暗色模式和响应式验证结果。完成后样式应能被项目组件复用、可搜索、可测试,并与设计系统规则一致。
@@ -0,0 +1,59 @@
1
+ # Tailwind 系统模式
2
+
3
+ ## Token 映射
4
+
5
+ 优先使用语义化名称:
6
+
7
+ | 需求 | 推荐 | 避免 |
8
+ | ---- | ---- | ---- |
9
+ | 品牌色 | `brand.600`, `--color-brand-primary` | 到处复制 `blue-600` |
10
+ | 表面层级 | `surface.canvas`, `surface.panel` | 一次性灰色值 |
11
+ | 圆角 | `radius.control`, `radius.panel` | 随意重复的具体值 |
12
+ | 阴影 | `shadow.floating`, `shadow.focus` | 没有状态含义的装饰阴影 |
13
+
14
+ 如果项目已有 CSS 变量,把 Tailwind token 映射到这些变量,而不是重复维护字面量。
15
+
16
+ ## Variant 归属
17
+
18
+ 长 class 组合应收敛到以下位置之一:
19
+
20
+ - 带 `variant`、`size`、`tone`、`density`、`state` props 的共享组件。
21
+ - 复合组件的 slot 映射表。
22
+ - CVA、tailwind-variants 或本地 `classNames` 映射等类型化 helper。
23
+ - 只在一个模块内复用时,使用局部常量。
24
+
25
+ 不要根据不受控的用户输入拼接 class 名。使用显式映射:
26
+
27
+ ```ts
28
+ const toneClass = {
29
+ neutral: "bg-slate-100 text-slate-900",
30
+ danger: "bg-red-600 text-white",
31
+ success: "bg-emerald-600 text-white",
32
+ } as const;
33
+ ```
34
+
35
+ ## 暗色模式
36
+
37
+ - 优先选择单一的项目级策略:`class`、`data-theme` 或 CSS 变量。
38
+ - 如果应用支持手动切换主题,在 body 绘制前初始化已选主题,避免首屏先亮后暗或先暗后亮的主题闪烁。
39
+ - 在亮色和暗色主题下都测试 disabled、focus、selected、invalid、chart 和 skeleton 状态。
40
+ - 不要把降低透明度作为 disabled 的唯一提示;要保留对比度和可感知性。
41
+ - Tailwind 项目使用 `darkMode: "class"` 或等价配置时,主题切换逻辑应同时维护根节点 class / data attribute,并持久化用户偏好。
42
+ - CSS 变量方案中,Tailwind token 应引用语义变量;不要为亮色和暗色分别散落两套工具类字面量。
43
+ - 在 `<head>` 或框架等价入口中放置极小同步初始化脚本时,只读取本地主题偏好和系统偏好,不执行业务逻辑、不访问服务端数据。
44
+ - 暗色模式需复核图片亮度、阴影层级、表单控件、第三方组件、图表色板和 focus ring;不要只补背景色。
45
+
46
+ ## 响应式工具类
47
+
48
+ - 默认 class 列表从移动端布局开始。
49
+ - 只有信息架构变化时,才增加更大断点前缀。
50
+ - 重复出现的响应式区块应沉淀为布局组件或 CSS 容器查询,不要反复复制同一串断点。
51
+ - 控件、标签页、看板和数据单元格使用稳定尺寸,避免 hover 和 loading 状态造成布局跳动。
52
+
53
+ ## 评审清单
54
+
55
+ - Token 值有语义角色,并且没有分叉既有设计规则。
56
+ - 组件 variants 覆盖 loading、disabled、selected、invalid、focus-visible 和暗色模式。
57
+ - 动态 class 可被静态扫描识别,或已安全加入 safelist。
58
+ - Tailwind 工具类没有破坏可访问性、点击目标或 reduced-motion 要求。
59
+ - 最终 UI 已在移动端、平板和桌面宽度检查过。
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: fec-tdd-workflow
3
+ description: 用于实现新前端行为、修复 bug 或重构可先由测试描述预期行为的逻辑。适用于组件、hooks/composables、工具函数、API clients、路由守卫或用户工作流;中文触发词包括 TDD、测试驱动、先写测试、红绿重构、回归测试。
4
+ ---
5
+
6
+ # 前端 TDD 工作流
7
+
8
+ ## 用途
9
+
10
+ 用“先写失败测试,再实现最小代码,再重构”的节奏交付前端功能,避免只在实现后补覆盖率。
11
+
12
+ ## 流程
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. 每轮只扩大一个可观察行为;新需求、新边界和新异常路径各自进入下一轮。
25
+
26
+ ## 证明式测试模式
27
+
28
+ 修复缺陷时先让测试失败,再让它通过。若无法先失败,说明测试没有覆盖原始问题,需要收窄输入、断言或测试层级。
29
+
30
+ ## 前端测试选择
31
+
32
+ | Risk | Preferred Test |
33
+ | ---- | -------------- |
34
+ | utils、schema、状态计算 | 单元测试 |
35
+ | hooks / composables | 单元或轻量集成测试 |
36
+ | 组件 props、emits、交互、状态 | 组件测试 |
37
+ | Router、Provider、Store 协作 | 轻量集成测试 |
38
+ | 登录、支付、权限、关键 CRUD | E2E 测试 |
39
+
40
+ ## 约束
41
+
42
+ - 不为了 TDD 引入项目没有使用且收益不清晰的新测试框架。
43
+ - 不测试实现细节、私有状态或脆弱 DOM 结构。
44
+ - 不把 E2E 当作所有风险的默认答案;优先选择离风险最近的测试层。
45
+ - 如果现有仓库没有测试基础设施,先输出最小测试落地建议,再请求用户确认是否引入。
46
+ - 不在红灯阶段同时重构;先证明问题,再最小修复,再整理结构。
47
+
48
+ ## 预期输出
49
+
50
+ - 至少一个先失败后通过的测试覆盖新增或修复行为。
51
+ - 实现保持最小范围,重构只在测试通过后进行。
52
+ - 总结运行过的测试命令、覆盖的行为和未覆盖风险。
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: fec-testing-strategy
3
+ description: 用于规划或审查前端测试策略,按风险选择正确测试层级,将覆盖映射到静态检查、单元测试、组件测试、集成测试、E2E、Storybook/视觉回归、a11y、安全、性能或 CI gates。不要用于编写单个组件/E2E 测试或只是运行现有验证命令;中文触发词包括 测试策略、测试分层、测试计划、覆盖矩阵。
4
+ ---
5
+
6
+ # 前端测试策略
7
+
8
+ ## 用途
9
+
10
+ 按“离代码多近 / 覆盖风险层级”选择测试方法,避免把所有风险都塞进组件测试或 E2E。
11
+
12
+ ## 流程
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。
33
+
34
+ ## 约束
35
+
36
+ - 不把测试策略写成泛泛的“多写测试”;每个建议必须对应具体风险。
37
+ - 不要求所有项目都补齐完整测试金字塔;按业务风险和团队维护能力裁剪。
38
+ - 不把 E2E 当作单元/组件测试的替代品;不把组件测试当作真实浏览器兼容保证。
39
+ - 不为小改动强制引入新框架;优先复用仓库已有工具和脚本。
40
+ - 不追求没有风险说明的覆盖率数字;覆盖率只能辅助判断,不能替代场景覆盖。
41
+ - 不把随机 fixture、共享全局状态或依赖执行顺序的测试纳入主干门禁。
42
+
43
+ ## 预期输出
44
+
45
+ 输出测试分层建议、风险到测试层的映射、优先级、建议命令、需新增或调整的测试文件范围,以及明确分流到哪些专项 skill 或 agent。
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: fec-typescript-project-standard
3
+ description: 用于创建、配置、审查或调试前端应用、库、SDK、CLI、monorepo 包中的 TypeScript 项目规范,包括 tsconfig、strictness、module/moduleResolution、路径别名、project references、声明文件、package exports、公共 API 类型、DTO、高级泛型、判别联合、类型守卫、类型收窄或类型级回归。React/Vue/Next/Nuxt 组件架构优先使用框架项目 skill;中文触发词包括 TypeScript 项目规范、TS 项目规范、TypeScript 类型安全、类型建模、泛型、判别联合、类型收窄、tsconfig、声明文件。
4
+ ---
5
+
6
+ # TypeScript 项目规范
7
+
8
+ ## 用途
9
+
10
+ 统一 TypeScript 层的工程配置、类型边界和发布产物规则。适用于前端应用、组件库、SDK、CLI、monorepo package 和纯 TypeScript 工具库,但不接管 React、Vue、Next.js、Nuxt 或 Vite 的框架架构职责。
11
+
12
+ ## 流程
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。
43
+
44
+ ## 约束
45
+
46
+ - 不用 `skipLibCheck`、`any`、无守卫非空断言或宽泛 `as` 掩盖真实边界问题。
47
+ - 不在应用代码中依赖发布包私有深层路径。
48
+ - 不把框架目录结构、组件分层、路由组织或状态管理决策放进本流程;这些交给对应框架或专项流程。
49
+ - 不让生成类型、测试类型或 Node-only 类型污染浏览器运行代码。
50
+ - 不发布只能在源码仓库内解析的路径别名、ambient 声明或隐式全局类型。
51
+
52
+ ## 预期输出
53
+
54
+ 输出应包含 TypeScript 上下文判断、关键 `tsconfig`/package 类型入口建议、类型边界方案、声明文件或 public API 风险、验证命令。完成后项目应能独立 typecheck,公开类型可被消费方解析,类型安全问题有明确收窄或建模方案。
@@ -0,0 +1,102 @@
1
+ # 类型安全模式
2
+
3
+ ## 类型边界审查清单
4
+
5
+ - DTO 应与外部载荷对应,并在 API 边界处进行转换。
6
+ - 领域模型或视图模型使用前端命名和稳定的联合类型。
7
+ - 组件 props 需命名明确,仅在该文件外复用时才导出。
8
+ - 公开函数必须有显式的参数和返回值类型。
9
+ - 外部输入必须从 `unknown` 开始,通过 schema 校验或类型守卫逐步收窄。
10
+ - 配置映射表优先使用 `as const` 和 `satisfies`,避免宽泛断言。
11
+
12
+ ## 使用 `satisfies` 的配置映射表
13
+
14
+ ```ts
15
+ type Tone = "neutral" | "success" | "warning" | "danger";
16
+
17
+ const STATUS_TONE = {
18
+ draft: "neutral",
19
+ paid: "success",
20
+ overdue: "danger",
21
+ } as const satisfies Record<string, Tone>;
22
+
23
+ type InvoiceStatus = keyof typeof STATUS_TONE;
24
+ ```
25
+
26
+ 这样既保留了字面量值,又验证了映射表符合预期的值域。
27
+
28
+ ## 映射类型用于表单错误
29
+
30
+ ```ts
31
+ type FieldErrors<TValues extends Record<string, unknown>> = {
32
+ [Key in keyof TValues]?: string;
33
+ };
34
+
35
+ interface ProfileFormValues {
36
+ email: string;
37
+ displayName: string;
38
+ }
39
+
40
+ type ProfileFormErrors = FieldErrors<ProfileFormValues>;
41
+ ```
42
+
43
+ ## 模板字面量类型用于事件命名
44
+
45
+ ```ts
46
+ interface AnalyticsPayloads {
47
+ checkoutStarted: { cartId: string };
48
+ checkoutCompleted: { orderId: string };
49
+ }
50
+
51
+ type AnalyticsEventName = keyof AnalyticsPayloads;
52
+ type AnalyticsHandlerName = `on${Capitalize<string & AnalyticsEventName>}`;
53
+ ```
54
+
55
+ 当项目中已有事件命名规范时使用此模式。不要为一次性字符串引入。
56
+
57
+ ## 更安全的泛型组件模式
58
+
59
+ ```tsx
60
+ interface Entity {
61
+ id: string;
62
+ }
63
+
64
+ interface EntityPickerProps<TEntity extends Entity> {
65
+ items: TEntity[];
66
+ selectedId: string | null;
67
+ getLabel: (item: TEntity) => string;
68
+ onSelect: (item: TEntity) => void;
69
+ }
70
+
71
+ export function EntityPicker<TEntity extends Entity>({
72
+ items,
73
+ selectedId,
74
+ getLabel,
75
+ onSelect,
76
+ }: EntityPickerProps<TEntity>) {
77
+ return (
78
+ <ul>
79
+ {items.map((item) => (
80
+ <li key={item.id}>
81
+ <button
82
+ aria-pressed={item.id === selectedId}
83
+ type="button"
84
+ onClick={() => onSelect(item)}
85
+ >
86
+ {getLabel(item)}
87
+ </button>
88
+ </li>
89
+ ))}
90
+ </ul>
91
+ );
92
+ }
93
+ ```
94
+
95
+ ## 类型审查反馈
96
+
97
+ 报告类型安全问题时,需包含:
98
+
99
+ - 过于宽泛、过于狭窄或不合理的类型边界。
100
+ - 尽管通过 TypeScript 但可能在运行时失败的行为。
101
+ - 最小替换类型或守卫方案。
102
+ - 该变更是否需要测试或类型测试。