@bovinphang/frontend-craft 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +378 -305
  4. package/CHANGELOG.zh-CN.md +377 -304
  5. package/CONTRIBUTING.md +371 -361
  6. package/CONTRIBUTING.zh-CN.md +371 -361
  7. package/README.md +545 -493
  8. package/README.openclaw.md +359 -264
  9. package/README.openclaw.zh-CN.md +359 -264
  10. package/README.zh-CN.md +545 -493
  11. package/agents/fec-architect.md +70 -70
  12. package/agents/fec-code-reviewer.md +103 -82
  13. package/agents/fec-debugger.md +20 -20
  14. package/agents/fec-design-token-mapper.md +36 -36
  15. package/agents/fec-doc-updater.md +13 -13
  16. package/agents/fec-e2e-runner.md +45 -45
  17. package/agents/fec-figma-implementer.md +59 -59
  18. package/agents/fec-performance-optimizer.md +128 -128
  19. package/agents/fec-refactor-cleaner.md +17 -14
  20. package/agents/fec-refactoring-expert.md +81 -0
  21. package/agents/fec-security-reviewer.md +82 -67
  22. package/agents/fec-test-planner.md +27 -27
  23. package/agents/fec-typescript-reviewer.md +103 -87
  24. package/agents/fec-ui-checker.md +64 -64
  25. package/commands/fec-debug.md +19 -19
  26. package/commands/fec-doc-sync.md +11 -11
  27. package/commands/fec-init.md +37 -38
  28. package/commands/fec-plan.md +58 -58
  29. package/commands/fec-refactor-clean.md +11 -11
  30. package/commands/fec-refactor-plan.md +17 -0
  31. package/commands/fec-refactor.md +18 -0
  32. package/commands/fec-review.md +71 -41
  33. package/commands/fec-scaffold.md +41 -41
  34. package/commands/fec-smell.md +17 -0
  35. package/commands/fec-tdd.md +17 -13
  36. package/dist/bin/frontend-craft.js +190 -36
  37. package/dist/hooks/fec-run-tests.js +5 -1
  38. package/dist/hooks/fec-session-start.js +1 -1
  39. package/docs/example-prompts.md +157 -137
  40. package/docs/ja-JP/README.md +534 -493
  41. package/docs/ko-KR/README.md +534 -493
  42. package/docs/project-structure.md +151 -123
  43. package/docs/refactoring/README.md +50 -0
  44. package/docs/refactoring/catalog.md +105 -0
  45. package/docs/refactoring/smell-refactoring-matrix.md +41 -0
  46. package/docs/review-and-diagram-workflows.md +39 -0
  47. package/docs/runtimes/antigravity.md +18 -10
  48. package/docs/runtimes/augment.md +18 -10
  49. package/docs/runtimes/claude.md +191 -177
  50. package/docs/runtimes/claude.zh-CN.md +189 -175
  51. package/docs/runtimes/cline.md +18 -10
  52. package/docs/runtimes/codebuddy.md +18 -10
  53. package/docs/runtimes/codex.md +18 -10
  54. package/docs/runtimes/compatibility.md +27 -0
  55. package/docs/runtimes/copilot.md +18 -10
  56. package/docs/runtimes/cursor.md +18 -10
  57. package/docs/runtimes/gemini.md +18 -10
  58. package/docs/runtimes/kilo.md +18 -10
  59. package/docs/runtimes/openclaw.md +18 -10
  60. package/docs/runtimes/opencode.md +18 -10
  61. package/docs/runtimes/qoder.md +18 -19
  62. package/docs/runtimes/trae.md +18 -10
  63. package/docs/runtimes/windsurf.md +18 -10
  64. package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
  65. package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
  66. package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
  67. package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
  68. package/docs/zh-CN/example-prompts.md +157 -137
  69. package/docs/zh-CN/project-structure.md +148 -123
  70. package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
  71. package/docs/zh-TW/README.md +534 -493
  72. package/localized/zh-CN/agents/fec-architect.md +125 -0
  73. package/localized/zh-CN/agents/fec-code-reviewer.md +171 -0
  74. package/localized/zh-CN/agents/fec-debugger.md +44 -0
  75. package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
  76. package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
  77. package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
  78. package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
  79. package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
  80. package/localized/zh-CN/agents/fec-refactor-cleaner.md +35 -0
  81. package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
  82. package/localized/zh-CN/agents/fec-security-reviewer.md +132 -0
  83. package/localized/zh-CN/agents/fec-test-planner.md +50 -0
  84. package/localized/zh-CN/agents/fec-typescript-reviewer.md +158 -0
  85. package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
  86. package/localized/zh-CN/commands/fec-debug.md +30 -0
  87. package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
  88. package/localized/zh-CN/commands/fec-init.md +70 -0
  89. package/localized/zh-CN/commands/fec-plan.md +94 -0
  90. package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
  91. package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
  92. package/localized/zh-CN/commands/fec-refactor.md +14 -0
  93. package/localized/zh-CN/commands/fec-review.md +97 -0
  94. package/localized/zh-CN/commands/fec-scaffold.md +205 -0
  95. package/localized/zh-CN/commands/fec-smell.md +13 -0
  96. package/localized/zh-CN/commands/fec-tdd.md +25 -0
  97. package/localized/zh-CN/skills/TEMPLATE.md +155 -0
  98. package/localized/zh-CN/skills/eval_queries.json +1257 -0
  99. package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
  100. package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
  101. package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  102. package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
  103. package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
  104. package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
  105. package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
  106. package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
  107. package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
  108. package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
  109. package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
  110. package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  111. package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
  112. package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  113. package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
  114. package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  115. package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  116. package/localized/zh-CN/skills/fec-code-review/SKILL.md +162 -0
  117. package/localized/zh-CN/skills/fec-code-review/references/report-template.md +39 -0
  118. package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
  119. package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
  120. package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
  121. package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
  122. package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
  123. package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
  124. package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
  125. package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
  126. package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
  127. package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
  128. package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  129. package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
  130. package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
  131. package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  132. package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  133. package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  134. package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
  135. package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
  136. package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  137. package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
  138. package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  139. package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
  140. package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  141. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
  142. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  143. package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  144. package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  145. package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  146. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  147. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  148. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  149. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  150. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  151. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  152. package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
  153. package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  154. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  155. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  156. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  157. package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
  158. package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
  159. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  160. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  161. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  162. package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  163. package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
  164. package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
  165. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +110 -0
  166. package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  167. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
  168. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
  169. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
  170. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
  171. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
  172. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
  173. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
  174. package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
  175. package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +81 -0
  176. package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
  177. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +37 -0
  178. package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
  179. package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
  180. package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
  181. package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  182. package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
  183. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +462 -0
  184. package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
  185. package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
  186. package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  187. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
  188. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  189. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  190. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  191. package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
  192. package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  193. package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
  194. package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
  195. package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  196. package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
  197. package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  198. package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
  199. package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  200. package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
  201. package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  202. package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
  203. package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
  204. package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  205. package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  206. package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
  207. package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  208. package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  209. package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  210. package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  211. package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +54 -0
  212. package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
  213. package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
  214. package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
  215. package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
  216. package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
  217. package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
  218. package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
  219. package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
  220. package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
  221. package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
  222. package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
  223. package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
  224. package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
  225. package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
  226. package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
  227. package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
  228. package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
  229. package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
  230. package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
  231. package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
  232. package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
  233. package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
  234. package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
  235. package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
  236. package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
  237. package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
  238. package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
  239. package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
  240. package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
  241. package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
  242. package/localized/zh-CN/skills/fec-security-review/SKILL.md +54 -0
  243. package/localized/zh-CN/skills/fec-security-review/references/report-template.md +37 -0
  244. package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
  245. package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
  246. package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
  247. package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
  248. package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
  249. package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  250. package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
  251. package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
  252. package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
  253. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +55 -0
  254. package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
  255. package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
  256. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
  257. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
  258. package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
  259. package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
  260. package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
  261. package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
  262. package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
  263. package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
  264. package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  265. package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
  266. package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
  267. package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
  268. package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
  269. package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
  270. package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
  271. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
  272. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  273. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
  274. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  275. package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
  276. package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  277. package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  278. package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  279. package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  280. package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  281. package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  282. package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
  283. package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
  284. package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
  285. package/localized/zh-CN/skills/metadata.json +2004 -0
  286. package/localized/zh-CN/skills/relations.json +1023 -0
  287. package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
  288. package/localized/zh-CN/templates/claude/settings.json +62 -0
  289. package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
  290. package/localized/zh-CN/templates/codex/config.toml +32 -0
  291. package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
  292. package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  293. package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +55 -0
  294. package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
  295. package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
  296. package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
  297. package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
  298. package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
  299. package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
  300. package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
  301. package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
  302. package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
  303. package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
  304. package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
  305. package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
  306. package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
  307. package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
  308. package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
  309. package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
  310. package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
  311. package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
  312. package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
  313. package/openclaw.plugin.json +2 -3
  314. package/package.json +28 -17
  315. package/skills/TEMPLATE.md +74 -74
  316. package/skills/eval_queries.json +922 -678
  317. package/skills/fec-accessibility-check/SKILL.md +21 -21
  318. package/skills/fec-accessibility-check/references/report-template.md +12 -12
  319. package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
  320. package/skills/fec-alchemy/SKILL.md +50 -50
  321. package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
  322. package/skills/fec-alchemy/assets/intake-template.md +55 -55
  323. package/skills/fec-alchemy/assets/review-checklist.md +23 -23
  324. package/skills/fec-alchemy/references/methodology.md +66 -66
  325. package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
  326. package/skills/fec-api-integration/SKILL.md +61 -61
  327. package/skills/fec-api-integration/references/integration-patterns.md +30 -30
  328. package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
  329. package/skills/fec-browser-storage/SKILL.md +16 -16
  330. package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
  331. package/skills/fec-canvas-threejs/SKILL.md +21 -21
  332. package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
  333. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
  334. package/skills/fec-code-review/SKILL.md +113 -94
  335. package/skills/fec-code-review/references/report-template.md +23 -13
  336. package/skills/fec-code-smells/SKILL.md +33 -0
  337. package/skills/fec-code-smells/references/detection-guide.md +25 -0
  338. package/skills/fec-code-smells/references/smell-catalog.md +861 -0
  339. package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
  340. package/skills/fec-component-testing/SKILL.md +39 -39
  341. package/skills/fec-data-fetching/SKILL.md +16 -16
  342. package/skills/fec-data-fetching/references/query-patterns.md +27 -27
  343. package/skills/fec-debug-framework/SKILL.md +95 -95
  344. package/skills/fec-debug-framework/references/report-template.md +34 -34
  345. package/skills/fec-dependency-upgrade/SKILL.md +17 -17
  346. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
  347. package/skills/fec-doc-sync/SKILL.md +23 -23
  348. package/skills/fec-drawio-studio/SKILL.md +42 -38
  349. package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
  350. package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  351. package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
  352. package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  353. package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
  354. package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
  355. package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
  356. package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  357. package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
  358. package/skills/fec-e2e-testing/SKILL.md +24 -24
  359. package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
  360. package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
  361. package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
  362. package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
  363. package/skills/fec-form-handling/SKILL.md +21 -21
  364. package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
  365. package/skills/fec-image-generation/SKILL.md +84 -29
  366. package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  367. package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
  368. package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
  369. package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
  370. package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
  371. package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
  372. package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
  373. package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
  374. package/skills/fec-image-generation/references/diagram-workflows.md +41 -3
  375. package/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
  376. package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
  377. package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
  378. package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
  379. package/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
  380. package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  381. package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
  382. package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
  383. package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
  384. package/skills/fec-implement-from-design/SKILL.md +81 -81
  385. package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
  386. package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
  387. package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
  388. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
  389. package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
  390. package/skills/fec-legacy-web-standard/SKILL.md +17 -17
  391. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
  392. package/skills/fec-list-virtualization/SKILL.md +16 -16
  393. package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
  394. package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
  395. package/skills/fec-motion-interaction/SKILL.md +51 -51
  396. package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
  397. package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
  398. package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
  399. package/skills/fec-performance-optimization/SKILL.md +54 -54
  400. package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
  401. package/skills/fec-performance-optimization/references/report-template.md +31 -31
  402. package/skills/fec-pwa-implementation/SKILL.md +17 -17
  403. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
  404. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
  405. package/skills/fec-react-project-standard/SKILL.md +72 -72
  406. package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
  407. package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
  408. package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
  409. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
  410. package/skills/fec-refactor-clean/SKILL.md +33 -30
  411. package/skills/fec-refactor-clean/references/report-template.md +23 -23
  412. package/skills/fec-refactoring/SKILL.md +83 -0
  413. package/skills/fec-refactoring/references/principles.md +60 -0
  414. package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
  415. package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
  416. package/skills/fec-refactoring/references/workflow.md +90 -0
  417. package/skills/fec-refactoring-api/SKILL.md +25 -0
  418. package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
  419. package/skills/fec-refactoring-catalog/SKILL.md +28 -0
  420. package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
  421. package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
  422. package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
  423. package/skills/fec-refactoring-control/SKILL.md +25 -0
  424. package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
  425. package/skills/fec-refactoring-data/SKILL.md +25 -0
  426. package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
  427. package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
  428. package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
  429. package/skills/fec-refactoring-functions/SKILL.md +25 -0
  430. package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
  431. package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
  432. package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
  433. package/skills/fec-refactoring-move-features/SKILL.md +25 -0
  434. package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
  435. package/skills/fec-refactoring-validation/SKILL.md +59 -0
  436. package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
  437. package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
  438. package/skills/fec-responsive-layout/SKILL.md +17 -17
  439. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
  440. package/skills/fec-route-protection/SKILL.md +26 -26
  441. package/skills/fec-security-review/SKILL.md +36 -20
  442. package/skills/fec-security-review/references/report-template.md +22 -12
  443. package/skills/fec-security-review/references/security-checklist.md +27 -27
  444. package/skills/fec-source-driven-development/SKILL.md +59 -59
  445. package/skills/fec-state-management/SKILL.md +34 -34
  446. package/skills/fec-state-management/references/state-patterns.md +19 -19
  447. package/skills/fec-storybook-component-doc/SKILL.md +19 -19
  448. package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
  449. package/skills/fec-svg-animation/SKILL.md +32 -32
  450. package/skills/fec-tailwind-design-system/SKILL.md +17 -17
  451. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
  452. package/skills/fec-tdd-workflow/SKILL.md +32 -28
  453. package/skills/fec-testing-strategy/SKILL.md +29 -29
  454. package/skills/fec-typescript-project-standard/SKILL.md +38 -38
  455. package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
  456. package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
  457. package/skills/fec-ui-design/SKILL.md +90 -90
  458. package/skills/fec-ui-design/references/design-intelligence.md +61 -61
  459. package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
  460. package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
  461. package/skills/fec-validation-fix/SKILL.md +26 -26
  462. package/skills/fec-validation-fix/references/report-template.md +25 -25
  463. package/skills/fec-vite-project-standard/SKILL.md +39 -39
  464. package/skills/fec-vue3-project-standard/SKILL.md +38 -38
  465. package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
  466. package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
  467. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
  468. package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
  469. package/skills/fec-web-video-presentation/SKILL.md +33 -33
  470. package/skills/fec-web-workers/SKILL.md +16 -16
  471. package/skills/fec-web-workers/references/advanced-workers.md +13 -13
  472. package/skills/fec-web-workers/references/basic-worker.md +8 -8
  473. package/skills/metadata.json +485 -116
  474. package/skills/relations.json +268 -0
  475. package/templates/claude/CLAUDE.md +60 -60
  476. package/templates/codex/AGENTS.md +76 -76
  477. package/templates/codex/config.toml +4 -4
  478. package/templates/openclaw/AGENTS.md +68 -68
  479. package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
  480. package/templates/shared/rules/fec-agent-workflow.md +41 -40
  481. package/templates/shared/rules/fec-api-layer.md +52 -52
  482. package/templates/shared/rules/fec-ci-cd.md +29 -29
  483. package/templates/shared/rules/fec-code-comments.md +22 -22
  484. package/templates/shared/rules/fec-design-system.md +53 -53
  485. package/templates/shared/rules/fec-error-handling.md +40 -40
  486. package/templates/shared/rules/fec-git-conventions.md +42 -42
  487. package/templates/shared/rules/fec-i18n.md +48 -48
  488. package/templates/shared/rules/fec-naming-conventions.md +91 -91
  489. package/templates/shared/rules/fec-performance.md +78 -78
  490. package/templates/shared/rules/fec-react.md +58 -58
  491. package/templates/shared/rules/fec-refactoring.md +34 -34
  492. package/templates/shared/rules/fec-rendering-patterns.md +36 -36
  493. package/templates/shared/rules/fec-responsive-design.md +37 -37
  494. package/templates/shared/rules/fec-source-driven-development.md +22 -22
  495. package/templates/shared/rules/fec-state-management.md +56 -56
  496. package/templates/shared/rules/fec-testing.md +64 -64
  497. package/templates/shared/rules/fec-typescript.md +75 -75
  498. package/templates/shared/rules/fec-vue.md +42 -42
  499. package/templates/shared/rules/fec-working-modes.md +34 -34
  500. package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
  501. package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
  502. package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: fec-accessibility-check
3
+ description: 用于审查或改进前端无障碍、语义结构、键盘支持、焦点管理、ARIA 标签、屏幕阅读器行为、WCAG 2.2 问题、触控无障碍或辅助技术回归;中文触发词包括 无障碍、accessibility、a11y、WCAG、屏幕阅读器。
4
+ ---
5
+
6
+ # 无障碍实现规范(WCAG 2.2 AA)
7
+
8
+ ## 用途
9
+
10
+ 确保前端 UI 对残障用户可访问,满足 WCAG 2.2 AA 的核心要求,并能被键盘、屏幕阅读器、触控和缩放用户稳定使用。
11
+
12
+ ## 流程
13
+
14
+ 1. 检查语义结构:landmark、标题层级、表单 label、按钮/链接可访问名称、表格语义和图片 alt。
15
+ 2. 检查键盘路径:Tab 顺序、Enter/Space/Esc 行为、焦点可见、关闭后焦点恢复。
16
+ 3. 检查复杂组件:对话框、菜单、标签页、树、抽屉、表格和自定义控件的 ARIA 状态。
17
+ 4. 检查动态状态:loading、empty、error、toast 和异步更新需要被屏幕阅读器感知。
18
+ 5. 检查视觉与触控可读性:文本/背景对比、focus ring、缩放到 200%、减少动效偏好、触摸目标尺寸和移动端虚拟键盘行为。
19
+ 6. 用真实键盘路径复核关键流程,必要时补充屏幕阅读器或浏览器无障碍树观察;屏幕阅读器流程见 [references/screen-reader-testing.md](references/screen-reader-testing.md)。
20
+ 7. 复核 WCAG 2.2 新增高频风险:可见焦点不被遮挡、拖拽操作有替代路径、目标尺寸过小、帮助入口和认证流程不依赖记忆负担。
21
+ 8. 输出分级报告;报告格式见 [references/report-template.md](references/report-template.md)。
22
+
23
+ ## 详细参考
24
+
25
+ 撰写无障碍审查报告时,加载 [references/report-template.md](references/report-template.md)。需要验证屏幕阅读器公告、焦点读法和动态区域时,加载 [references/screen-reader-testing.md](references/screen-reader-testing.md)。
26
+
27
+ ## 约束
28
+
29
+ - 优先使用语义化 HTML,而不是 ARIA。
30
+ - `role` 不应覆盖原生语义。
31
+ - 交互元素必须可键盘访问。
32
+ - 表单错误必须与字段关联。
33
+ - 颜色对比度风险需要指出具体文本/背景组合。
34
+ - 不用 ARIA 弥补可以用原生 HTML 解决的问题。
35
+ - 不把浏览器自动可访问树当作最终结论;关键路径需要用键盘和至少一种辅助技术或等价检查验证。
36
+
37
+ ## 预期输出
38
+
39
+ 交互元素可键盘访问,语义和 ARIA 使用正确,焦点管理稳定;无障碍检查报告保存为 `reports/accessibility-review-YYYY-MM-DD-HHmmss.md`。
@@ -0,0 +1,23 @@
1
+ # 无障碍检查报告模板
2
+
3
+ ```markdown
4
+ # 无障碍检查报告
5
+
6
+ > 生成时间: YYYY-MM-DD HH:mm
7
+ > 评审工具: frontend-craft
8
+ > 标准: WCAG 2.2 AA
9
+
10
+ ## 必须修复 (N项)
11
+ - **[文件:行号]** 问题描述 -> 建议修改
12
+
13
+ ## 建议改进 (N项)
14
+ - **[文件:行号]** 问题描述 -> 建议修改
15
+
16
+ ## 已通过项
17
+ - ...
18
+
19
+ ## 建议的代码修改
20
+ - ...
21
+ ```
22
+
23
+ 检查完成后,将报告保存到 `reports/accessibility-review-YYYY-MM-DD-HHmmss.md`,并告知用户报告路径。
@@ -0,0 +1,33 @@
1
+ # 屏幕阅读器测试
2
+
3
+ ## 何时测试
4
+
5
+ 以下场景需要使用屏幕阅读器或浏览器无障碍树进行检查:
6
+
7
+ - 对话框、抽屉、菜单、标签页、组合框、树形控件和自定义控件。
8
+ - 异步状态更新、toast 通知、校验错误和 loading 区域。
9
+ - 表格、虚拟列表、图表、dashboard 和数据密集型控件。
10
+ - 触摸探索、虚拟键盘或焦点顺序可能与桌面不同的移动端流程。
11
+
12
+ ## 最小流程
13
+
14
+ 1. 先只用键盘操作:Tab、Shift+Tab、Enter、Space、Esc,以及适用场景下的方向键。
15
+ 2. 在浏览器开发者工具中检查可访问名称、角色、状态和元素关系。
16
+ 3. 条件允许时至少跑一轮辅助技术验证:NVDA/Firefox、JAWS/Chrome、VoiceOver/Safari 或 TalkBack/Chrome。
17
+ 4. 验证路由变化、校验错误、加载完成和破坏性确认是否有正确公告。
18
+ 5. 记录具体用户影响、期望读法、实际读法和建议修复方式。
19
+
20
+ ## 动态内容
21
+
22
+ - 非阻塞状态更新使用 `aria-live="polite"`。
23
+ - 紧急错误可谨慎使用 `role="alert"`,不要滥用。
24
+ - 只有当用户任务上下文发生变化时才移动焦点,例如打开弹窗或提交后跳转。
25
+ - 关闭浮层后,将焦点恢复到触发控件。
26
+
27
+ ## 常见问题
28
+
29
+ - 纯图标按钮没有可访问名称。
30
+ - 对话框内容先于标题被朗读,或缺少模态边界。
31
+ - 表单错误只在视觉上展示,没有用 `aria-describedby` 与字段关联。
32
+ - Toast 消失太快,屏幕阅读器用户来不及理解。
33
+ - 虚拟列表行丢失行位置、表格语义或键盘连续性。
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: fec-alchemy
3
+ description: 用于从参考系统中吸收想法、能力、工作流、架构、质量体系、生态扩展或工程实践,并通过原创的项目内重设计转化为当前项目能力,而不是复制原实现。
4
+ ---
5
+
6
+ # 项目吸收与原创化融合
7
+
8
+ ## 用途
9
+
10
+ 将一个或多个参考系统中的优秀思想、能力和工程实践,转化为当前项目中原创、可维护、符合目标项目风格的改进。
11
+
12
+ 适用于吸收、借鉴、对标、迁移或融合另一个代码库、产品、框架、库、服务、CLI、插件、文档体系、AI/Agent 工具链、架构或工程工作流。普通 Bug 修复、单独 API 使用问题或直接文件格式转换不应使用本 Skill,除非用户明确要求项目级吸收或适配。
13
+
14
+ ## 流程
15
+
16
+ 1. 明确目标和参考系统:
17
+ - 将当前仓库视为目标系统,它的架构、命名、测试、发布模型和维护边界是事实来源。
18
+ - 将外部仓库、上传压缩包、文档、示例、产品描述或运行体验视为参考系统,它们只提供证据和启发。
19
+ - 识别吸收范围:产品能力、架构模式、领域模型、接口协议、数据流、运行时行为、开发体验、质量体系、交付流程、文档知识或生态扩展。
20
+ - 信息较多时可使用 [assets/intake-template.md](assets/intake-template.md) 建立简要清单。
21
+ 2. 建立目标项目基线:
22
+ - 先读取目标项目 README、包元数据、目录结构、配置、现有入口、扩展点、测试命令和发布说明。
23
+ - 找出目标项目已有类似能力,判断应增强、合并、替换、拆分、文档化还是新增。
24
+ 3. 扫描参考项目:
25
+ - 优先查看 README、包元数据、源码布局、项目形态相关目录、关键模块、测试、示例和发布说明。
26
+ - 将观察记录为能力、意图、模式和取舍,不记录为要复制的文件清单。
27
+ 4. 提炼候选能力:
28
+ - 对每个候选项说明它解决的问题、用户价值、适配度、依赖、风险、可验证性和与目标项目现状的关系。
29
+ - 对许可证、来源不清楚或实现高度绑定参考项目的候选项,只提炼思想,不复用表达。
30
+ 5. 映射到目标架构:
31
+ - 使用目标项目原生命名、模块边界、依赖策略、编码约定和测试方式重新设计。
32
+ - 避免创建与现有模块竞争的并行系统;避免因为参考项目用了某依赖就盲目引入依赖。
33
+ - 非平凡变更可使用 [assets/absorption-plan-template.md](assets/absorption-plan-template.md)。
34
+ 6. 原创化实现或计划:
35
+ - 编写新代码或新文档,不复制参考项目中的非平凡代码、提示词、配置或文档表达。
36
+ - 吸收生态扩展、提示词、命令、插件、自动化、Agent 或规则时,统一职责边界并删除重复指令。
37
+ - 大型任务先交付垂直薄切片,并记录被拒绝或延期的候选项。
38
+ 7. 验证和汇报:
39
+ - 运行最相关的类型检查、Lint、测试、构建、文档校验或 Skill 校验。
40
+ - 如果无法验证,明确说明阻塞原因、风险范围和需要用户确认的信息。
41
+ - 必要时使用 [assets/review-checklist.md](assets/review-checklist.md) 做人工复核。
42
+
43
+ ## 约束
44
+
45
+ - 不把吸收任务变成机械化 diff 合并。
46
+ - 不整体照搬参考项目的命名体系、文件结构或实现细节。
47
+ - 不在许可证或用户意图不明确时逐字复用参考项目中的非平凡代码、文档、提示词或配置。
48
+ - 不为了匹配参考项目而削弱安全、隐私、权限边界、测试、可维护性或目标项目产品方向。
49
+ - 不声称原创化,除非输出能解释目标设计为何不同、为何适配目标项目、如何验证。
50
+ - 不把长篇参考材料塞进主说明;大型任务读取 [references/methodology.md](references/methodology.md),许可证和原创风险读取 [references/originality-and-licensing.md](references/originality-and-licensing.md)。
51
+
52
+ ## 预期输出
53
+
54
+ 分析类任务输出:
55
+
56
+ - 吸收候选项
57
+ - 推荐目标设计
58
+ - 实现计划
59
+ - 风险与许可证说明
60
+ - 验证清单
61
+
62
+ 实现类任务输出:
63
+
64
+ - 已完成变更
65
+ - 原创化说明
66
+ - 验证结果
67
+ - 剩余工作
68
+
69
+ 仓库级任务中,如果宿主工具支持文件编辑,应创建或更新项目本地计划文档。
70
+
71
+ ## 详细参考
72
+
73
+ - [references/methodology.md](references/methodology.md) - 详细吸收方法论。
74
+ - [references/originality-and-licensing.md](references/originality-and-licensing.md) - 原创性、许可证和来源风险约束。
@@ -0,0 +1,47 @@
1
+ # Alchemy 吸收计划
2
+
3
+ ## 目标
4
+
5
+ 描述需要交付的目标项目原生化改进。
6
+
7
+ ## 参考项目优势
8
+
9
+ | 候选项 | 参考洞察 | 目标项目缺口 | 策略 | 优先级 |
10
+ |---|---|---|---|---|
11
+ | | | | 增强 / 新增 / 拆分 / 合并 / 替换 / 文档化 / 拒绝 | |
12
+
13
+ ## 目标设计
14
+
15
+ - 目标架构落点:
16
+ - 用户可见能力:
17
+ - 公开 API / CLI / 配置 / UI 入口:
18
+ - UI / API / 数据 / 运行时 / 工具链 / 文档影响:
19
+ - 公开 API 或用户可见行为:
20
+ - 内部数据流:
21
+ - 命名和约定:
22
+ - 依赖影响:
23
+ - 向后兼容性:
24
+
25
+ ## 实现步骤
26
+
27
+ 1.
28
+ 2.
29
+ 3.
30
+
31
+ ## 验证
32
+
33
+ - 类型检查:
34
+ - Lint:
35
+ - 单元测试:
36
+ - 集成测试:
37
+ - 构建:
38
+ - 人工评审:
39
+
40
+ ## 风险
41
+
42
+ - 许可证 / 来源:
43
+ - 范围膨胀:
44
+ - 架构重叠:
45
+ - 性能:
46
+ - 安全:
47
+ - 维护:
@@ -0,0 +1,55 @@
1
+ # Alchemy 信息收集模板
2
+
3
+ ## 目标项目
4
+
5
+ - 路径 / URL:
6
+ - 项目定位:
7
+ - 项目类型:
8
+ - 主要用户:
9
+ - 技术栈:
10
+ - 当前相关模块:
11
+ - 已有类似能力:
12
+ - 目标项目适配边界:
13
+ - 验证命令:
14
+ - 约束条件:
15
+
16
+ ## 参考项目
17
+
18
+ - 路径 / URL:
19
+ - 项目定位:
20
+ - 项目类型:
21
+ - 主要用户:
22
+ - 技术栈:
23
+ - 重点模块:
24
+ - 特色能力:
25
+ - 许可证 / 来源:
26
+ - 风险:
27
+
28
+ ## 能力域清单
29
+
30
+ - 产品能力:
31
+ - 架构模式:
32
+ - 领域模型:
33
+ - 接口协议:
34
+ - 数据流:
35
+ - 运行时行为:
36
+ - 开发体验:
37
+ - 质量体系:
38
+ - 交付流程:
39
+ - 文档知识:
40
+ - 生态扩展:
41
+
42
+ ## 项目形态探针
43
+
44
+ - 前端项目(页面 / 组件 / 路由 / 状态 / 数据请求 / 表单 / 设计系统 / 可访问性 / 性能 / 构建):
45
+ - 后端项目(API / 服务边界 / 数据库 / 队列 / 缓存 / 认证授权 / 任务调度 / 可观测性 / 部署):
46
+ - 工具或 CLI 项目(命令模型 / 配置 / 插件机制 / 错误输出 / 安装分发 / 模板):
47
+ - AI/Agent 项目(skills / commands / hooks / rules / agents / MCP / prompt / workflow):
48
+ - 库项目(公开 API / 类型 / 兼容性 / 构建产物 / 示例 / 版本策略):
49
+ - 文档或知识库项目(信息架构 / 导航 / 示例 / 搜索 / 版本化 / 贡献流程 / 发布节奏):
50
+
51
+ ## 不吸收范围
52
+
53
+ - 明确拒绝:
54
+ - 延后观察:
55
+ - 只作为灵感不落地:
@@ -0,0 +1,31 @@
1
+ # Alchemy 评审检查清单
2
+
3
+ ## 架构
4
+
5
+ - [ ] 变更属于选定的目标模块。
6
+ - [ ] 没有重复实现已有能力、入口、抽象或用户工作流。
7
+ - [ ] 职责清晰且不重叠。
8
+ - [ ] 命名符合目标项目语义。
9
+ - [ ] 目标架构落点清晰,未为了参考项目形态引入并行体系。
10
+ - [ ] 配置、运行时流程、工具函数和文档承诺没有互相冲突。
11
+
12
+ ## 原创性
13
+
14
+ - [ ] 不存在缺少许可证依据的非平凡复制代码或文本。
15
+ - [ ] 实现已用目标项目原生风格表达。
16
+ - [ ] 参考项目影响被总结为思想、模式或行为。
17
+ - [ ] 如许可证要求,已保留必要署名。
18
+
19
+ ## 质量
20
+
21
+ - [ ] 测试或验证步骤覆盖了被吸收的行为。
22
+ - [ ] 错误与边界场景已处理。
23
+ - [ ] 依赖新增有充分理由。
24
+ - [ ] 文档和示例已更新。
25
+ - [ ] 选用的项目形态探针与实际目标相关,没有做无关全量扫描。
26
+
27
+ ## 交付
28
+
29
+ - [ ] 已总结面向用户的变更。
30
+ - [ ] 已说明被拒绝的候选项。
31
+ - [ ] 已记录风险和后续工作。
@@ -0,0 +1,94 @@
1
+ # 项目吸收方法论
2
+
3
+ ## 目标
4
+
5
+ 本文档用于扩展 `SKILL.md` 中的核心流程,适合更大型的“参考系统到目标项目”能力吸收任务。参考系统可以是代码库、产品、服务、框架、库、CLI、插件、文档体系或 AI/Agent 工具链。
6
+
7
+ ## 阶段 1:建立目标项目基线
8
+
9
+ 在深入研究参考项目之前,先为目标项目建立简短基线:
10
+
11
+ - 目标项目声明的用途是什么?
12
+ - 当前已有的顶层能力有哪些?
13
+ - 已存在的入口、扩展点和用户工作流有哪些?
14
+ - 哪些区域仍在活跃维护?
15
+ - 哪些区域脆弱、复杂或过度设计?
16
+ - 已有哪些测试和验证命令?
17
+
18
+ 在理解目标项目基线之前,不要过早形成改造建议。
19
+
20
+ ## 阶段 2:扫描参考项目
21
+
22
+ 扫描参考系统中的高信号材料:
23
+
24
+ - README 和文档:项目定位、使用模型、安装、配置。
25
+ - 包或构建元数据:技术选型、依赖范围、脚本命令。
26
+ - 源码布局:架构、模块边界、命名约定。
27
+ - 能力域:产品能力、架构模式、领域模型、接口协议、数据流、运行时行为、开发体验、质量体系、交付流程、文档知识、生态扩展。
28
+ - 项目形态探针:按参考系统类型选择相关目录和行为入口,不假设所有项目都有相同结构。
29
+ - 测试:预期行为和边界场景。
30
+ - 示例:面向用户的工作流和上手体验质量。
31
+
32
+ 记录观察时,应记录为“能力”,而不是“文件”。例如写“具备带环境检查的引导式配置向导”,而不是写“复制 setup.ts”。
33
+
34
+ ### 项目形态探针
35
+
36
+ 按目标和参考系统的实际形态选择扫描视角:
37
+
38
+ - 前端项目:页面、组件、路由、状态、数据请求、表单、设计系统、可访问性、性能、构建。
39
+ - 后端项目:API、服务边界、数据库、队列、缓存、认证授权、任务调度、可观测性、部署。
40
+ - 工具或 CLI 项目:命令模型、配置、插件机制、错误输出、安装分发、模板。
41
+ - AI/Agent 项目:skills、commands、hooks、rules、agents、MCP、prompt、workflow。
42
+ - 库项目:公开 API、类型、兼容性、构建产物、示例、版本策略。
43
+ - 文档或知识库项目:信息架构、导航、示例、搜索、版本化、贡献流程、发布节奏。
44
+
45
+ 如果项目横跨多种形态,优先选择与用户目标直接相关的 1 到 3 个视角,避免把吸收任务扩大成全仓库审计。
46
+
47
+ ## 阶段 3:候选能力评分
48
+
49
+ 对每个候选项按 1 到 5 分评分。
50
+
51
+ | 维度 | 问题 |
52
+ |---|---|
53
+ | 用户价值 | 是否能实质改善目标用户的工作流? |
54
+ | 适配度 | 是否符合目标项目的架构和路线图? |
55
+ | 原创化可行性 | 是否可以在不复制受保护表达的情况下重新创建? |
56
+ | 复杂度 | 是否可以安全交付并长期维护? |
57
+ | 可验证性 | 正确性是否可以通过测试或评审验证? |
58
+
59
+ 优先处理高价值、高适配、低风险的候选项。
60
+
61
+ ## 阶段 4:吸收策略
62
+
63
+ 为每个候选项选择一种策略:
64
+
65
+ - **增强**:改进目标项目已有能力。
66
+ - **新增**:引入新的目标项目原生能力。
67
+ - **拆分**:拆解过载的目标概念或参考概念。
68
+ - **合并**:合并目标项目中重叠的概念。
69
+ - **替换**:在更安全设计准备好后,移除较弱的目标实现。
70
+ - **文档化**:只补充知识,不改代码。
71
+ - **拒绝**:明确延后或放弃,并说明原因。
72
+
73
+ ## 阶段 5:实现顺序
74
+
75
+ 推荐按以下顺序推进:
76
+
77
+ 1. 文档和边界澄清。
78
+ 2. 测试或验证脚手架。
79
+ 3. 最小化的目标项目原生实现。
80
+ 4. 与现有工作流集成。
81
+ 5. 清理重复逻辑和废弃路径。
82
+ 6. 面向用户的文档和示例。
83
+
84
+ ## 阶段 6:评审问题
85
+
86
+ 最终完成前,回答以下问题:
87
+
88
+ - 吸收后目标项目是否仍保持一致性?
89
+ - 模块边界是否被保留或改善?
90
+ - 每个新增能力是否可被发现?
91
+ - 是否存在重叠的能力、入口、抽象、配置、运行时流程、工具函数、文档承诺或用户工作流?
92
+ - 新增依赖是否有充分理由?
93
+ - 验证命令是否已记录?
94
+ - 是否透明说明了灵感来源,同时又没有暗示复制代码?
@@ -0,0 +1,57 @@
1
+ # 原创性与许可证约束
2
+
3
+ ## 目标
4
+
5
+ 本流程用于合法、合规、伦理且可维护的适配。它应帮助使用者提炼思想,并重新创建符合目标项目风格的设计,而不是伪装复制。
6
+
7
+ ## 通常可以安全吸收的内容
8
+
9
+ - 高层思想和产品概念。
10
+ - 通用架构模式。
11
+ - 公开文档化的工作流。
12
+ - 用自己的语言表达的行为需求。
13
+ - 标准的、不可保护的或已获得适当许可的算法和技术。
14
+ - 为目标环境重新创建的配置概念。
15
+
16
+ ## 需要谨慎处理的内容
17
+
18
+ - 来自其他项目的大段代码。
19
+ - 独特文本、提示词、示例、文档、图表、名称或品牌表达。
20
+ - 与参考项目高度绑定且非显而易见的实现结构。
21
+ - 包含许可证头或署名要求的生成文件。
22
+ - 带有限制性许可证的依赖。
23
+ - 私有或专有仓库。
24
+
25
+ ## 安全适配流程
26
+
27
+ 1. 用中性语言总结参考能力。
28
+ 2. 识别它解决的问题。
29
+ 3. 独立设计目标项目原生方案。
30
+ 4. 使用目标项目约定实现新代码。
31
+ 5. 将概念命名调整为目标项目语义。
32
+ 6. 基于期望行为添加测试,而不是基于参考项目内部实现添加测试。
33
+ 7. 当许可证要求署名时,保留必要署名。
34
+ 8. 将许可证不确定性记录为风险,而不是忽略。
35
+
36
+ ## 风险信号
37
+
38
+ - 输出在没有目标项目特定理由的情况下保留了参考项目相同的文件结构和命名。
39
+ - 输出包含大量完全相同或近似相同的代码/文本。
40
+ - Agent 无法解释目标设计为什么不同于参考设计。
41
+ - 新模块与目标项目现有模块高度重叠。
42
+ - 唯一理由只是“参考项目就是这样做的”。
43
+
44
+ ## 报告中的推荐表述
45
+
46
+ 建议使用:
47
+
48
+ - “受参考项目在……方面的处理方式启发。”
49
+ - “已重新实现为符合目标项目风格的模块,用于……”
50
+ - “参考项目通过 X 解决该问题;本项目选择 Y,因为……”
51
+
52
+ 避免使用:
53
+
54
+ - “复制自……”
55
+ - “和……完全一样”
56
+ - “隐藏式模仿……”
57
+ - “让它看起来不相关……”
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: fec-api-integration
3
+ description: 用于设计、实现或审查前后端 API 集成、类型化 API client、REST/tRPC/OpenAPI 客户端选型、认证刷新、API 错误映射、上传流程、SSE/WebSocket/轮询选择、CORS 相关前端行为或跨边界 loading/error 状态。不要用于纯后端服务架构或仅 TanStack Query 缓存策略;中文触发词包括 API 集成、前后端联调、typed API client、接口错误处理、SSE、WebSocket。
4
+ ---
5
+
6
+ # API 集成
7
+
8
+ 适用于前端与后端边界的类型、错误、鉴权、上传、实时通信和用户状态设计。需要具体代码模式时加载 [integration-patterns.md](references/integration-patterns.md)。
9
+
10
+ ## 用途
11
+
12
+ 规范前端 API 集成边界,让请求、错误、鉴权和实时数据可维护。
13
+
14
+ ## 流程
15
+
16
+ 1. 明确接口所有权
17
+ - 同团队 TypeScript 全栈可考虑 tRPC 或共享 schema。
18
+ - 多语言或多消费者 API 优先 OpenAPI/GraphQL codegen。
19
+ - 小型内部应用可用 typed fetch wrapper,但类型必须集中维护。
20
+ - 不在组件里散落 `fetch`、URL、header、错误解析和 token 逻辑。
21
+ - 公共接口需要明确版本、兼容窗口、废弃字段策略和调用方范围。
22
+
23
+ 2. 建立客户端边界
24
+ - 用一个 API client 处理 base URL、credentials、JSON 解析、超时、取消和统一错误。
25
+ - 环境变量只读取公开前缀,私密 token 不进入客户端 bundle。
26
+ - 组件只消费 domain 函数或 query/mutation hook,不直接拼接接口路径。
27
+ - 204、空响应、非 JSON 错误和网络断开要有明确行为。
28
+ - TypeScript contract 必须覆盖请求、响应、错误形状和分页/游标元数据。
29
+
30
+ 3. 映射用户可理解的错误
31
+ - 401:刷新失败后引导登录。
32
+ - 403:说明权限不足,不重复重试。
33
+ - 404:展示缺失状态或返回上级入口。
34
+ - 409:提示冲突和下一步操作。
35
+ - 422:映射字段级错误。
36
+ - 429/5xx/网络错误:允许退避重试或展示稍后再试。
37
+ - 未识别错误要落到统一 fallback,不把原始后端异常暴露给用户。
38
+ - 所有错误都应归一到用户可恢复动作:重试、重新登录、修改输入、返回上级、联系支持或稍后再试。
39
+ - 错误对象要保留面向日志的 trace id / request id,但 UI 不暴露内部堆栈、SQL、服务名或敏感字段。
40
+
41
+ 4. 管理接口演进
42
+ - 兼容新增字段;删除或改名字段必须走迁移期、适配层或双写/双读策略。
43
+ - 用 schema、类型生成物或 contract test 捕捉破坏性变更。
44
+ - 对前后端协作项记录状态码、错误码、幂等性、重试语义和时区/金额/枚举规则。
45
+
46
+ 5. 处理鉴权刷新
47
+ - Access token 生命周期短,refresh 优先放在 httpOnly cookie 或服务端会话。
48
+ - 401 后只允许单次刷新队列,避免多个请求同时刷新。
49
+ - 刷新失败要清理本地身份状态并跳转登录。
50
+ - 不把 bearer token 放在 URL、localStorage 或日志里。
51
+
52
+ 6. 选择上传与实时方案
53
+ - 小文件可用 multipart;大文件优先预签名直传或分片上传。
54
+ - 只需要服务端推送时用 SSE;双向协作、聊天或多人状态用 WebSocket。
55
+ - 简单状态刷新、低频任务进度可用 polling,并设置停止条件。
56
+ - 上传和实时连接都需要取消、重连、超时和错误 UI。
57
+
58
+ 7. 验证集成质量
59
+ - 检查 loading、empty、error、unauthorized、offline、retrying 状态。
60
+ - 用浏览器网络面板确认 base URL、credentials、CORS 和状态码行为。
61
+ - 用 mock 或测试服务覆盖 401、403、422、500、断网和取消请求。
62
+ - 确认客户端 bundle 不包含私密环境变量、服务端密钥或内部地址。
63
+ - 对关键 API client 行为补最小测试,证明超时、取消、错误映射和刷新队列可预期。
64
+ - 验证错误边界与请求层协作:渲染异常进 Error Boundary,请求失败进可恢复 UI,不互相吞掉。
65
+
66
+ ## 约束
67
+
68
+ - 不在页面组件中直接管理 token refresh、错误格式解析或重试策略。
69
+ - 不对 4xx 业务错误做盲目自动重试。
70
+ - 不把后端异常栈、内部错误码或原始 SQL/服务名暴露给用户。
71
+ - 不用 localStorage 存储高价值 token;若遗留系统无法避免,必须联动安全审查。
72
+ - 不用 WebSocket 替代简单轮询,也不用轮询实现高频双向协作。
73
+ - 不让上传经过 API 服务器转发大文件,除非有明确合规或扫描需求。
74
+ - 不在公共接口里直接暴露临时字段、数据库字段名或后端内部错误结构。
75
+
76
+ ## 预期输出
77
+
78
+ 输出应包含 API client 边界、接口类型来源、错误映射、鉴权刷新策略、上传/实时方案和验证结果。完成后组件不散落请求细节,用户状态完整,失败场景可恢复,客户端不会泄露服务端密钥。
@@ -0,0 +1,80 @@
1
+ # API 集成实现模式
2
+
3
+ ## 类型化 Fetch 客户端
4
+
5
+ ```ts
6
+ export class ApiError extends Error {
7
+ constructor(
8
+ public readonly status: number,
9
+ public readonly body: unknown,
10
+ ) {
11
+ super(`API 请求失败,状态码 ${status}`);
12
+ }
13
+ }
14
+
15
+ export async function requestJson<T>(
16
+ path: string,
17
+ init: RequestInit = {},
18
+ ): Promise<T> {
19
+ const response = await fetch(`${import.meta.env.VITE_API_URL}${path}`, {
20
+ ...init,
21
+ headers: {
22
+ Accept: "application/json",
23
+ "Content-Type": "application/json",
24
+ ...init.headers,
25
+ },
26
+ credentials: "include",
27
+ });
28
+
29
+ if (!response.ok) {
30
+ const body = await response.json().catch(() => null);
31
+ throw new ApiError(response.status, body);
32
+ }
33
+
34
+ if (response.status === 204) return undefined as T;
35
+ return response.json() as Promise<T>;
36
+ }
37
+ ```
38
+
39
+ ## 用户端错误映射
40
+
41
+ ```ts
42
+ export function getApiMessage(error: unknown): string {
43
+ if (!(error instanceof ApiError)) return "操作失败,请稍后重试。";
44
+
45
+ if (error.status === 401) return "请重新登录。";
46
+ if (error.status === 403) return "您没有权限执行此操作。";
47
+ if (error.status === 404) return "请求的资源已不存在。";
48
+ if (error.status === 409) return "此变更与最新数据冲突。";
49
+ if (error.status === 422) return "请检查标红字段。";
50
+ if (error.status === 429) return "请求过于频繁,请稍后再试。";
51
+
52
+ return "服务暂不可用,请稍后重试。";
53
+ }
54
+ ```
55
+
56
+ ## 上传选型
57
+
58
+ | 需求 | 推荐方案 |
59
+ | ---------------- | ----------------------------- |
60
+ | 小头像或 CSV | Multipart 请求 |
61
+ | 大视频或归档文件 | 预签名直传 |
62
+ | 弱网环境大文件 | 分片断点续传 |
63
+ | 入库前合规扫描 | 经 API 中介上传(含大小限制) |
64
+
65
+ ## 实时通信选型
66
+
67
+ | 需求 | 推荐方案 |
68
+ | -------------------- | ------------------------- |
69
+ | 任务进度或通知 | SSE(Server-Sent Events) |
70
+ | 聊天、在线状态、协作 | WebSocket |
71
+ | 数秒一次的状态轮询 | 定时轮询(Polling) |
72
+ | 服务端 AI Token 流 | SSE 或 fetch 流式响应 |
73
+
74
+ ## 审查清单
75
+
76
+ - API 地址和凭证集中管理。
77
+ - 客户端需处理 204、非 JSON 错误、取消和离线状态。
78
+ - Token 刷新机制不能引发请求风暴。
79
+ - 组件应消费 hooks/领域函数,而非直接调用原始 fetch。
80
+ - 上传和实时流需暴露进度、取消、失败和重试状态。
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: fec-backend-requirements-handoff
3
+ description: 用于前端工作需要向后端团队说明数据、动作、状态、权限、校验或业务规则需求,但不指定端点设计、字段名、数据库形态或实现细节;中文触发词包括 前后端需求交接、后端需求、API 需求澄清、数据需求说明。
4
+ ---
5
+
6
+ # 前后端需求交接
7
+
8
+ ## 用途
9
+
10
+ 把前端页面和交互所需的数据、动作、状态和疑问整理成后端可讨论的需求说明。
11
+
12
+ ## 流程
13
+
14
+ 1. 明确功能上下文
15
+ - 说明页面、流程或组件是什么,面向哪类用户,以及用户完成任务的成功状态。
16
+ - 如果已有设计稿、路由、用户故事或权限角色,先把它们作为事实来源。
17
+
18
+ 2. 描述前端展示需求
19
+ - 按屏幕或组件列出需要展示的信息、信息之间的关系、排序/过滤/分页需求和可见性规则。
20
+ - 使用业务语言描述“需要展示什么”,不要提前规定 endpoint、字段名、DTO、数据库表或响应嵌套结构。
21
+
22
+ 3. 描述用户动作和结果
23
+ - 列出用户能执行的动作、期望结果、成功反馈、失败反馈和是否需要乐观更新。
24
+ - 标出幂等性、撤销、确认、危险操作、批量操作或长任务进度等对 UI 有影响的行为。
25
+
26
+ 4. 补齐状态和业务规则
27
+ - 覆盖 loading、empty、error、partial、permission denied、expired、conflict、offline 和 retrying 等状态。
28
+ - 记录影响 UI 的权限、生命周期、金额/时区/枚举、校验、可编辑条件和边界规则。
29
+
30
+ 5. 输出讨论文档
31
+ - 默认写到 `docs/backend-requirements/<feature-name>.md`;若仓库已有需求文档目录,沿用现有位置。
32
+ - 文档包含 Context、Screens/Components、Data Needs、User Actions、UI States、Business Rules、Uncertainties、Questions for Backend 和 Decision Log。
33
+ - 若用户只需要聊天回复,可以直接输出同样结构的 Markdown,不创建文件。
34
+
35
+ ## 约束
36
+
37
+ - 不替后端规定 URL、HTTP 方法、字段名、数据库 schema、缓存实现或服务拆分。
38
+ - 不把前端猜测写成事实;不确定的业务规则必须进入 Uncertainties 或 Questions。
39
+ - 不忽略错误、空态、权限和部分数据;这些状态决定接口协作质量。
40
+ - 不把内部错误栈、数据库字段或敏感实现细节要求暴露给 UI。
41
+ - 不与 API 集成流程重复:本 skill 描述需求,客户端边界、类型来源和错误映射实现应在后续实现阶段处理。
42
+
43
+ ## 预期输出
44
+
45
+ 产出一份前端视角的后端需求交接说明,清楚描述 UI 需要什么数据和行为、哪些规则仍需确认,以及后续前后端需要共同决定的问题。