@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.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +378 -305
- package/CHANGELOG.zh-CN.md +377 -304
- package/CONTRIBUTING.md +371 -361
- package/CONTRIBUTING.zh-CN.md +371 -361
- package/README.md +545 -493
- package/README.openclaw.md +359 -264
- package/README.openclaw.zh-CN.md +359 -264
- package/README.zh-CN.md +545 -493
- package/agents/fec-architect.md +70 -70
- package/agents/fec-code-reviewer.md +103 -82
- package/agents/fec-debugger.md +20 -20
- package/agents/fec-design-token-mapper.md +36 -36
- package/agents/fec-doc-updater.md +13 -13
- package/agents/fec-e2e-runner.md +45 -45
- package/agents/fec-figma-implementer.md +59 -59
- package/agents/fec-performance-optimizer.md +128 -128
- package/agents/fec-refactor-cleaner.md +17 -14
- package/agents/fec-refactoring-expert.md +81 -0
- package/agents/fec-security-reviewer.md +82 -67
- package/agents/fec-test-planner.md +27 -27
- package/agents/fec-typescript-reviewer.md +103 -87
- package/agents/fec-ui-checker.md +64 -64
- package/commands/fec-debug.md +19 -19
- package/commands/fec-doc-sync.md +11 -11
- package/commands/fec-init.md +37 -38
- package/commands/fec-plan.md +58 -58
- package/commands/fec-refactor-clean.md +11 -11
- package/commands/fec-refactor-plan.md +17 -0
- package/commands/fec-refactor.md +18 -0
- package/commands/fec-review.md +71 -41
- package/commands/fec-scaffold.md +41 -41
- package/commands/fec-smell.md +17 -0
- package/commands/fec-tdd.md +17 -13
- package/dist/bin/frontend-craft.js +190 -36
- package/dist/hooks/fec-run-tests.js +5 -1
- package/dist/hooks/fec-session-start.js +1 -1
- package/docs/example-prompts.md +157 -137
- package/docs/ja-JP/README.md +534 -493
- package/docs/ko-KR/README.md +534 -493
- package/docs/project-structure.md +151 -123
- package/docs/refactoring/README.md +50 -0
- package/docs/refactoring/catalog.md +105 -0
- package/docs/refactoring/smell-refactoring-matrix.md +41 -0
- package/docs/review-and-diagram-workflows.md +39 -0
- package/docs/runtimes/antigravity.md +18 -10
- package/docs/runtimes/augment.md +18 -10
- package/docs/runtimes/claude.md +191 -177
- package/docs/runtimes/claude.zh-CN.md +189 -175
- package/docs/runtimes/cline.md +18 -10
- package/docs/runtimes/codebuddy.md +18 -10
- package/docs/runtimes/codex.md +18 -10
- package/docs/runtimes/compatibility.md +27 -0
- package/docs/runtimes/copilot.md +18 -10
- package/docs/runtimes/cursor.md +18 -10
- package/docs/runtimes/gemini.md +18 -10
- package/docs/runtimes/kilo.md +18 -10
- package/docs/runtimes/openclaw.md +18 -10
- package/docs/runtimes/opencode.md +18 -10
- package/docs/runtimes/qoder.md +18 -19
- package/docs/runtimes/trae.md +18 -10
- package/docs/runtimes/windsurf.md +18 -10
- package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
- package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
- package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
- package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
- package/docs/zh-CN/example-prompts.md +157 -137
- package/docs/zh-CN/project-structure.md +148 -123
- package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
- package/docs/zh-TW/README.md +534 -493
- package/localized/zh-CN/agents/fec-architect.md +125 -0
- package/localized/zh-CN/agents/fec-code-reviewer.md +171 -0
- package/localized/zh-CN/agents/fec-debugger.md +44 -0
- package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
- package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
- package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
- package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
- package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +35 -0
- package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +132 -0
- package/localized/zh-CN/agents/fec-test-planner.md +50 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +158 -0
- package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
- package/localized/zh-CN/commands/fec-debug.md +30 -0
- package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
- package/localized/zh-CN/commands/fec-init.md +70 -0
- package/localized/zh-CN/commands/fec-plan.md +94 -0
- package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
- package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
- package/localized/zh-CN/commands/fec-refactor.md +14 -0
- package/localized/zh-CN/commands/fec-review.md +97 -0
- package/localized/zh-CN/commands/fec-scaffold.md +205 -0
- package/localized/zh-CN/commands/fec-smell.md +13 -0
- package/localized/zh-CN/commands/fec-tdd.md +25 -0
- package/localized/zh-CN/skills/TEMPLATE.md +155 -0
- package/localized/zh-CN/skills/eval_queries.json +1257 -0
- package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
- package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
- package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
- package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
- package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
- package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +162 -0
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +39 -0
- package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
- package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
- package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
- package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
- package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
- package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
- package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
- package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
- package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +110 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +81 -0
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +37 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +462 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
- package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
- package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
- package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
- package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
- package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
- package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
- package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
- package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
- package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
- package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
- package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
- package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
- package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +37 -0
- package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
- package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
- package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
- package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
- package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +55 -0
- package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
- package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
- package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
- package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
- package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
- package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
- package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
- package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
- package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
- package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
- package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
- package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
- package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
- package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
- package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
- package/localized/zh-CN/skills/metadata.json +2004 -0
- package/localized/zh-CN/skills/relations.json +1023 -0
- package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
- package/localized/zh-CN/templates/claude/settings.json +62 -0
- package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
- package/localized/zh-CN/templates/codex/config.toml +32 -0
- package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
- package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +55 -0
- package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
- package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
- package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
- package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
- package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
- package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
- package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
- package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
- package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
- package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
- package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
- package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
- package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
- package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
- package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
- package/openclaw.plugin.json +2 -3
- package/package.json +28 -17
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +922 -678
- package/skills/fec-accessibility-check/SKILL.md +21 -21
- package/skills/fec-accessibility-check/references/report-template.md +12 -12
- package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
- package/skills/fec-alchemy/SKILL.md +50 -50
- package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
- package/skills/fec-alchemy/assets/intake-template.md +55 -55
- package/skills/fec-alchemy/assets/review-checklist.md +23 -23
- package/skills/fec-alchemy/references/methodology.md +66 -66
- package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
- package/skills/fec-api-integration/SKILL.md +61 -61
- package/skills/fec-api-integration/references/integration-patterns.md +30 -30
- package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
- package/skills/fec-browser-storage/SKILL.md +16 -16
- package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
- package/skills/fec-canvas-threejs/SKILL.md +21 -21
- package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
- package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
- package/skills/fec-code-review/SKILL.md +113 -94
- package/skills/fec-code-review/references/report-template.md +23 -13
- package/skills/fec-code-smells/SKILL.md +33 -0
- package/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/skills/fec-code-smells/references/smell-catalog.md +861 -0
- package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/skills/fec-component-testing/SKILL.md +39 -39
- package/skills/fec-data-fetching/SKILL.md +16 -16
- package/skills/fec-data-fetching/references/query-patterns.md +27 -27
- package/skills/fec-debug-framework/SKILL.md +95 -95
- package/skills/fec-debug-framework/references/report-template.md +34 -34
- package/skills/fec-dependency-upgrade/SKILL.md +17 -17
- package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
- package/skills/fec-doc-sync/SKILL.md +23 -23
- package/skills/fec-drawio-studio/SKILL.md +42 -38
- package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
- package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
- package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
- package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
- package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
- package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
- package/skills/fec-e2e-testing/SKILL.md +24 -24
- package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
- package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
- package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
- package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
- package/skills/fec-form-handling/SKILL.md +21 -21
- package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
- package/skills/fec-image-generation/SKILL.md +84 -29
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +41 -3
- package/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
- package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
- package/skills/fec-implement-from-design/SKILL.md +81 -81
- package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
- package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
- package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
- package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
- package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
- package/skills/fec-legacy-web-standard/SKILL.md +17 -17
- package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
- package/skills/fec-list-virtualization/SKILL.md +16 -16
- package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
- package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
- package/skills/fec-motion-interaction/SKILL.md +51 -51
- package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
- package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
- package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
- package/skills/fec-performance-optimization/SKILL.md +54 -54
- package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
- package/skills/fec-performance-optimization/references/report-template.md +31 -31
- package/skills/fec-pwa-implementation/SKILL.md +17 -17
- package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
- package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
- package/skills/fec-react-project-standard/SKILL.md +72 -72
- package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
- package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
- package/skills/fec-refactor-clean/SKILL.md +33 -30
- package/skills/fec-refactor-clean/references/report-template.md +23 -23
- package/skills/fec-refactoring/SKILL.md +83 -0
- package/skills/fec-refactoring/references/principles.md +60 -0
- package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
- package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
- package/skills/fec-refactoring/references/workflow.md +90 -0
- package/skills/fec-refactoring-api/SKILL.md +25 -0
- package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/skills/fec-refactoring-catalog/SKILL.md +28 -0
- package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
- package/skills/fec-refactoring-control/SKILL.md +25 -0
- package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/skills/fec-refactoring-data/SKILL.md +25 -0
- package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/skills/fec-refactoring-validation/SKILL.md +59 -0
- package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
- package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
- package/skills/fec-responsive-layout/SKILL.md +17 -17
- package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
- package/skills/fec-route-protection/SKILL.md +26 -26
- package/skills/fec-security-review/SKILL.md +36 -20
- package/skills/fec-security-review/references/report-template.md +22 -12
- package/skills/fec-security-review/references/security-checklist.md +27 -27
- package/skills/fec-source-driven-development/SKILL.md +59 -59
- package/skills/fec-state-management/SKILL.md +34 -34
- package/skills/fec-state-management/references/state-patterns.md +19 -19
- package/skills/fec-storybook-component-doc/SKILL.md +19 -19
- package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
- package/skills/fec-svg-animation/SKILL.md +32 -32
- package/skills/fec-tailwind-design-system/SKILL.md +17 -17
- package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
- package/skills/fec-tdd-workflow/SKILL.md +32 -28
- package/skills/fec-testing-strategy/SKILL.md +29 -29
- package/skills/fec-typescript-project-standard/SKILL.md +38 -38
- package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
- package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
- package/skills/fec-ui-design/SKILL.md +90 -90
- package/skills/fec-ui-design/references/design-intelligence.md +61 -61
- package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
- package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
- package/skills/fec-validation-fix/SKILL.md +26 -26
- package/skills/fec-validation-fix/references/report-template.md +25 -25
- package/skills/fec-vite-project-standard/SKILL.md +39 -39
- package/skills/fec-vue3-project-standard/SKILL.md +38 -38
- package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
- package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
- package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
- package/skills/fec-web-video-presentation/SKILL.md +33 -33
- package/skills/fec-web-workers/SKILL.md +16 -16
- package/skills/fec-web-workers/references/advanced-workers.md +13 -13
- package/skills/fec-web-workers/references/basic-worker.md +8 -8
- package/skills/metadata.json +485 -116
- package/skills/relations.json +268 -0
- package/templates/claude/CLAUDE.md +60 -60
- package/templates/codex/AGENTS.md +76 -76
- package/templates/codex/config.toml +4 -4
- package/templates/openclaw/AGENTS.md +68 -68
- package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
- package/templates/shared/rules/fec-agent-workflow.md +41 -40
- package/templates/shared/rules/fec-api-layer.md +52 -52
- package/templates/shared/rules/fec-ci-cd.md +29 -29
- package/templates/shared/rules/fec-code-comments.md +22 -22
- package/templates/shared/rules/fec-design-system.md +53 -53
- package/templates/shared/rules/fec-error-handling.md +40 -40
- package/templates/shared/rules/fec-git-conventions.md +42 -42
- package/templates/shared/rules/fec-i18n.md +48 -48
- package/templates/shared/rules/fec-naming-conventions.md +91 -91
- package/templates/shared/rules/fec-performance.md +78 -78
- package/templates/shared/rules/fec-react.md +58 -58
- package/templates/shared/rules/fec-refactoring.md +34 -34
- package/templates/shared/rules/fec-rendering-patterns.md +36 -36
- package/templates/shared/rules/fec-responsive-design.md +37 -37
- package/templates/shared/rules/fec-source-driven-development.md +22 -22
- package/templates/shared/rules/fec-state-management.md +56 -56
- package/templates/shared/rules/fec-testing.md +64 -64
- package/templates/shared/rules/fec-typescript.md +75 -75
- package/templates/shared/rules/fec-vue.md +42 -42
- package/templates/shared/rules/fec-working-modes.md +34 -34
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
- package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-state-management
|
|
3
|
-
description: Use when choosing, implementing, reviewing, or refactoring frontend state ownership across React, Vue, Next.js, Nuxt, URL state, server state, form state, browser persistence, or global stores. Prefer narrower skills for TanStack Query cache details, browser storage persistence, or form validation internals; Chinese triggers include
|
|
3
|
+
description: Use when choosing, implementing, reviewing, or refactoring frontend state ownership across React, Vue, Next.js, Nuxt, URL state, server state, form state, browser persistence, or global stores. Prefer narrower skills for TanStack Query cache details, browser storage persistence, or form validation internals; Chinese triggers include state management, state ownership, store selection.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Front-end status management
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Determine clear ownership of front-end state to avoid global store bloat, duplicate caching, and derived state synchronization errors.
|
|
11
11
|
|
|
12
12
|
## Procedure
|
|
13
13
|
|
|
14
|
-
### 1.
|
|
14
|
+
### 1. Classify status sources first
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Don't choose Redux, Zustand, Pinia or Context first. First mark each state to its unique owner, and then decide on the tool.
|
|
17
17
|
|
|
18
|
-
|
|
|
18
|
+
| Status Type | Typical Example | Default Attribution |
|
|
19
19
|
| ---------------- | ------------------------------------ | ------------------------ |
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| URL
|
|
24
|
-
|
|
|
25
|
-
|
|
|
20
|
+
| Local UI state | Pop-up window switch, tab, expand row, hover editing state | In-component state / ref |
|
|
21
|
+
| Form status | Input value, dirty field, validation error, submitting | Form library or form component |
|
|
22
|
+
| Server status | List, details, paging results, remote errors | Request cache library |
|
|
23
|
+
| URL status | Search terms, filter, sort, page number, selected tab | Routing parameters / search params |
|
|
24
|
+
| Global client status | Login users, topics, permission snapshots, shopping cart drafts | Global store |
|
|
25
|
+
| Browser persistent state | Drafts, preferences, offline queues retained across refreshes | Storage layer + state adapter |
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
28
|
type ReportsStateMap = {
|
|
@@ -34,9 +34,9 @@ type ReportsStateMap = {
|
|
|
34
34
|
};
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
### 2.
|
|
37
|
+
### 2. Keep it minimal
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Do not save a new copy of a value that can be inferred from props, server state, URL, or existing state.
|
|
40
40
|
|
|
41
41
|
```tsx
|
|
42
42
|
interface Invoice {
|
|
@@ -51,9 +51,9 @@ function InvoiceList({ invoices }: { invoices: Invoice[] }) {
|
|
|
51
51
|
}
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
### 3.
|
|
54
|
+
### 3. Select the React global state solution
|
|
55
55
|
|
|
56
|
-
React
|
|
56
|
+
Priority is given to localization and combination in React; the global store is only introduced when cross-page, cross-feature or unified actions are required.
|
|
57
57
|
|
|
58
58
|
```tsx
|
|
59
59
|
import { create } from "zustand";
|
|
@@ -69,17 +69,17 @@ export const useWorkspaceStore = create<WorkspaceState>((set) => ({
|
|
|
69
69
|
}));
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Decision order:
|
|
73
73
|
|
|
74
|
-
1.
|
|
75
|
-
2.
|
|
76
|
-
3.
|
|
77
|
-
4.
|
|
78
|
-
5.
|
|
74
|
+
1. Use only in one component or a small subtree: `useState` / `useReducer`.
|
|
75
|
+
2. Low-frequency global configuration or dependency injection: Context.
|
|
76
|
+
3. Moderately complex business status: Zustand or Jotai, priority will be given based on the existing selection of the warehouse.
|
|
77
|
+
4. Large applications, strict action flow, auditing or time travel debugging: Redux Toolkit.
|
|
78
|
+
5. Remote data: Use the data acquisition skill to manage query keys, cache and invalidation policies.
|
|
79
79
|
|
|
80
|
-
### 4.
|
|
80
|
+
### 4. Select Vue global state solution
|
|
81
81
|
|
|
82
|
-
Vue 3
|
|
82
|
+
In Vue 3, use `provide/inject` for local cross-level transfer; use Pinia or the existing store of the project for global business status.
|
|
83
83
|
|
|
84
84
|
```ts
|
|
85
85
|
import { computed, readonly, ref } from "vue";
|
|
@@ -101,9 +101,9 @@ export const useSessionStore = defineStore("session", () => {
|
|
|
101
101
|
});
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
### 5.
|
|
104
|
+
### 5. Clarify status boundaries and migration steps
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
When reconstructing the state, first make a state list, and then gradually move the read and write entries. Each step should keep the behavior verifiable.
|
|
107
107
|
|
|
108
108
|
```ts
|
|
109
109
|
interface StateMigrationItem {
|
|
@@ -123,18 +123,18 @@ const migrationPlan: StateMigrationItem[] = [
|
|
|
123
123
|
];
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
##
|
|
126
|
+
## Detailed reference
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
Load [references/state-patterns.md](references/state-patterns.md) when you need Store shape examples, selector patterns, URL state synchronization, persistence adapters, SSR boundaries, or review checklists.
|
|
129
129
|
|
|
130
130
|
## Constraints
|
|
131
131
|
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
- SSR
|
|
132
|
+
- Do not copy the server response to the global store; caching, invalidation and retries belong to the data acquisition layer.
|
|
133
|
+
- Do not promote each field of the form to the global store; cross-step sharing is also handled first by the form context or submit draft adapter.
|
|
134
|
+
- No need to use Context to carry large objects that change frequently; it will expand the re-rendering range.
|
|
135
|
+
- Persistence state must specify field whitelist, version number, expiration policy and sensitive data exclusion.
|
|
136
|
+
- In SSR scenarios, do not create a singleton store with user data at the top level of the module.
|
|
137
137
|
|
|
138
138
|
## Expected Output
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
Output status attribution list, selection reasons, store/API boundaries and verification steps. Key behaviors such as loading/error/empty, refresh, rollback, cross-routing, and permission changes should be retained during implementation.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
#State management mode
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Ownership Review Checklist
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
- URL
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- Store
|
|
5
|
+
- Each status field has a unique ownership: local status, form status, server-side cache, URL status, global Store or browser persistence.
|
|
6
|
+
- Derived values are calculated from the source state rather than manually synchronized via effects or watchers.
|
|
7
|
+
- URL state is used for view states that are shareable and need to be retained after refresh, such as filtering, searching, sorting, and paging.
|
|
8
|
+
- Server-side data is kept in the request cache; the global Store only stores selected IDs, local preferences, or optimistic update prompts.
|
|
9
|
+
- Persistent client state requires a whitelist, schema version number, migration path and sensitive field exclusion rules.
|
|
10
|
+
- Store actions are named after domain events, not component processors.
|
|
11
11
|
|
|
12
|
-
## React Store
|
|
12
|
+
## React Store shape example
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
15
|
import { create } from "zustand";
|
|
@@ -41,7 +41,7 @@ export const useCartStore = create<CartState>()(
|
|
|
41
41
|
);
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Selectors should return stable raw values or memo-encoded slices whenever possible:
|
|
45
45
|
|
|
46
46
|
```tsx
|
|
47
47
|
const itemCount = useCartStore((state) =>
|
|
@@ -49,9 +49,9 @@ const itemCount = useCartStore((state) =>
|
|
|
49
49
|
);
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
## URL
|
|
52
|
+
## URL status boundaries
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Use URL state when another user should be able to open the same view, or when the view needs to be preserved after a refresh.
|
|
55
55
|
|
|
56
56
|
```tsx
|
|
57
57
|
import { useSearchParams } from "react-router-dom";
|
|
@@ -72,9 +72,9 @@ export function useReportFilters() {
|
|
|
72
72
|
}
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
##
|
|
75
|
+
## Persistence adapter boundary
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Only persist stable client preferences or non-sensitive drafts. Serialization logic is placed outside the component.
|
|
78
78
|
|
|
79
79
|
```ts
|
|
80
80
|
interface PersistedGridState {
|
|
@@ -101,9 +101,9 @@ export function writeGridState(state: PersistedGridState): void {
|
|
|
101
101
|
}
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
## SSR
|
|
104
|
+
## SSR is isolated from requests
|
|
105
105
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
106
|
+
- When the state may contain user data, a separate Store needs to be created for each request.
|
|
107
|
+
- Do not read `window`, `localStorage` or `document` during server rendering.
|
|
108
|
+
- Reload persistence preferences after hydration and provide deterministic defaults before hydration.
|
|
109
|
+
- Server-side cache dehydration is handled separately from pure client-side global Store.
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-storybook-component-doc
|
|
3
|
-
description: Use when setting up or reviewing Storybook component documentation, design-system presentation, isolated component state previews, stories, addons, decorators, MDX docs, component-state interaction checks, visual baselines, or Chromatic. For real-browser cross-page journeys or broader coverage planning, choose the matching testing workflow first; Chinese triggers include Storybook,
|
|
3
|
+
description: Use when setting up or reviewing Storybook component documentation, design-system presentation, isolated component state previews, stories, addons, decorators, MDX docs, component-state interaction checks, visual baselines, or Chromatic. For real-browser cross-page journeys or broader coverage planning, choose the matching testing workflow first; Chinese triggers include Storybook, component documentation, Design System, visual regression.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Storybook
|
|
6
|
+
# Storybook component documentation
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Establish documentation, design system display and isolated state preview environment for UI components; interaction and visual testing only cover component states within the Storybook scene.
|
|
11
11
|
|
|
12
12
|
## Procedure
|
|
13
13
|
|
|
14
|
-
1.
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
18
|
-
5.
|
|
19
|
-
6.
|
|
14
|
+
1. Initialize or identify an existing Storybook configuration, inheriting the project framework adapter, stories globs, themes, and build commands.
|
|
15
|
+
2. Each component's Story covers default state, main variant, size, semantic tone, disabled, loading, error, empty, selected, invalid and key edge states.
|
|
16
|
+
3. Components that rely on Router, Store, i18n, and ThemeProvider are wrapped with decorators and do not copy the application entry in Story.
|
|
17
|
+
4. Use MDX to supplement complex components with usage instructions, Props, slots/children, variant matrices, status examples, accessibility requirements and source code display.
|
|
18
|
+
5. When automation is required, connect interaction tests, addon-a11y, Chromatic or Storybook Test Runner; these capabilities serve component documentation and design system display and do not undertake cross-page business journeys.
|
|
19
|
+
6. Design system components should record token sources, Tailwind/class variants, dark modes, responsive sizes, and unsupported combinations to avoid consumers guessing at assembly.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Detailed reference
|
|
22
22
|
|
|
23
|
-
-
|
|
23
|
+
- Load [references/story-patterns.md](references/story-patterns.md) when you need `main.ts`, `preview.ts`, stories, decorators, MDX, interaction tests and visual regression examples.
|
|
24
24
|
|
|
25
25
|
## Constraints
|
|
26
26
|
|
|
27
|
-
- Story
|
|
28
|
-
- Provider
|
|
29
|
-
- Storybook
|
|
30
|
-
- Storybook
|
|
31
|
-
- Storybook
|
|
32
|
-
-
|
|
33
|
-
-
|
|
27
|
+
- Story needs to be updated synchronously with component prop changes.
|
|
28
|
+
- Provider dependencies must be completed through decorators.
|
|
29
|
+
- Storybook build product `storybook-static/` should not be committed to Git.
|
|
30
|
+
- Storybook is used for development and component documentation and is not a replacement for production page SEO.
|
|
31
|
+
- Storybook visual baseline for component state; cross-page screenshots and real routing processes are offloaded to E2E workflow.
|
|
32
|
+
- Large component libraries need to control stories glob and addon overhead.
|
|
33
|
+
- Don’t use Storybook to hide component API issues; if variant combinations explode, you should first converge component responsibilities or split components.
|
|
34
34
|
|
|
35
35
|
## Expected Output
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Interactive component documentation and design system showcase site with isolated previews of each component state, Props tables to generate, and key Storybook scenes with optional play testing or visual regression baselines.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Storybook
|
|
1
|
+
# Storybook configuration and examples
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Initialization
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx storybook@latest init
|
|
@@ -75,22 +75,22 @@ import * as InputStories from "./Input.stories";
|
|
|
75
75
|
|
|
76
76
|
<Meta of={InputStories} />
|
|
77
77
|
|
|
78
|
-
#
|
|
78
|
+
#Input input box
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
Used for user text input, supporting verification prompts, suffix and suffix icons, word count, etc.
|
|
81
81
|
|
|
82
|
-
###
|
|
82
|
+
### When to use
|
|
83
83
|
|
|
84
|
-
-
|
|
85
|
-
-
|
|
84
|
+
- Single line text input
|
|
85
|
+
- Form fields that require real-time verification feedback
|
|
86
86
|
|
|
87
87
|
<Canvas of={InputStories.Default} />
|
|
88
88
|
|
|
89
|
-
###
|
|
89
|
+
### Properties
|
|
90
90
|
|
|
91
91
|
<Controls />
|
|
92
92
|
|
|
93
|
-
###
|
|
93
|
+
### Source code
|
|
94
94
|
|
|
95
95
|
<Source of={InputStories.Default} />
|
|
96
96
|
```
|
|
@@ -103,9 +103,9 @@ import { expect, userEvent, within } from "@storybook/test";
|
|
|
103
103
|
export const FormSubmission: Story = {
|
|
104
104
|
play: async ({ canvasElement }) => {
|
|
105
105
|
const canvas = within(canvasElement);
|
|
106
|
-
|
|
107
|
-
await userEvent.click(canvas.getByRole("button", { name:
|
|
108
|
-
await expect(canvas.findByText("
|
|
106
|
+
await userEvent.type(canvas.getByLabelText("username"), "admin");
|
|
107
|
+
await userEvent.click(canvas.getByRole("button", { name: /login/ }));
|
|
108
|
+
await expect(canvas.findByText("Login successful")).resolves.toBeInTheDocument();
|
|
109
109
|
},
|
|
110
110
|
};
|
|
111
111
|
```
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-svg-animation
|
|
3
|
-
description: Use when implementing or reviewing SVG animation, path drawing, icon motion, logo animation, illustration motion, micro-interactions, CSS/SMIL/Framer Motion/GSAP choices, motion accessibility, or fallback behavior; Chinese triggers include SVG
|
|
3
|
+
description: Use when implementing or reviewing SVG animation, path drawing, icon motion, logo animation, illustration motion, micro-interactions, CSS/SMIL/Framer Motion/GSAP choices, motion accessibility, or fallback behavior; Chinese triggers include SVG animation, path stroke, animation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# SVG
|
|
6
|
+
# SVG animation implementation
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Provide maintainable, accessible, and performance-controllable animation solutions for SVG icons, illustrations, and data visualizations.
|
|
11
11
|
|
|
12
12
|
## When to Use
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
14
|
+
- SVG icon, logo, illustration or path stroke animation needs to be implemented.
|
|
15
|
+
- Framer Motion, GSAP or CSS animation needs to be connected to React/Vue components.
|
|
16
|
+
- Need to provide motion reduction according to `prefers-reduced-motion`.
|
|
17
|
+
- Not used for complex 3D/WebGL scenes; for such scenes, Canvas / Three.js workflow is preferred.
|
|
18
18
|
|
|
19
19
|
## Procedure
|
|
20
20
|
|
|
21
|
-
### 1.
|
|
21
|
+
### 1. Select animation mode
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Choose based on complexity and runtime requirements:
|
|
24
24
|
|
|
25
|
-
|
|
|
25
|
+
| Scenario | Recommendation |
|
|
26
26
|
| --- | --- |
|
|
27
27
|
| hover/focus、opacity、transform | CSS animation/transition |
|
|
28
|
-
|
|
|
29
|
-
| React
|
|
30
|
-
|
|
|
31
|
-
|
|
|
28
|
+
| Path stroke, simple repeating animation | CSS + `stroke-dasharray` |
|
|
29
|
+
| React component state-driven animation | Framer Motion |
|
|
30
|
+
| Timeline, complex arrangement, scrolling trigger | GSAP |
|
|
31
|
+
| Need to keep static SVG with zero dependencies | CSS or SMIL |
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
If the animation spans page transitions, scrolling narratives, or complex component arrangements, you should first judge the intensity, lazy loading, and reduced-motion strategies according to the interactive effects workflow; this skill is only responsible for the path, deformation, and icon motion of the SVG graphics themselves.
|
|
34
34
|
|
|
35
|
-
### 2.
|
|
35
|
+
### 2. Use CSS to implement path strokes
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
38
|
export function CheckmarkIcon() {
|
|
@@ -73,7 +73,7 @@ export function CheckmarkIcon() {
|
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
### 3.
|
|
76
|
+
### 3. Using Framer Motion in React
|
|
77
77
|
|
|
78
78
|
```tsx
|
|
79
79
|
import { motion, useReducedMotion } from "framer-motion";
|
|
@@ -82,7 +82,7 @@ export function AnimatedSparkline({ path }: { path: string }) {
|
|
|
82
82
|
const reduceMotion = useReducedMotion();
|
|
83
83
|
|
|
84
84
|
return (
|
|
85
|
-
<svg viewBox="0 0 120 40" role="img" aria-label="
|
|
85
|
+
<svg viewBox="0 0 120 40" role="img" aria-label="Trend Chart">
|
|
86
86
|
<motion.path
|
|
87
87
|
d={path}
|
|
88
88
|
fill="none"
|
|
@@ -97,7 +97,7 @@ export function AnimatedSparkline({ path }: { path: string }) {
|
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
### 4.
|
|
100
|
+
### 4. Use GSAP to orchestrate complex timelines
|
|
101
101
|
|
|
102
102
|
```tsx
|
|
103
103
|
import { useLayoutEffect, useRef } from "react";
|
|
@@ -126,23 +126,23 @@ export function LogoReveal() {
|
|
|
126
126
|
}
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
### 5.
|
|
129
|
+
### 5. Control operating costs
|
|
130
130
|
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
131
|
+
- Split large SVG into static basemaps and a small number of animatable nodes. Do not let each path participate in the timeline.
|
|
132
|
+
- Icon libraries or Lottie alternatives must be loaded on demand, without going into the base package for all pages.
|
|
133
|
+
- The loop animation only runs in the visible area and stops when the page is hidden or the component is unloaded.
|
|
134
|
+
- The mobile version reduces filters, masks, clipPaths and a large number of gradient overlays.
|
|
135
135
|
|
|
136
136
|
## Constraints
|
|
137
137
|
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
138
|
+
- Prioritize animation `transform`, `opacity` and SVG path attributes; avoid frequent modification of layout-related attributes.
|
|
139
|
+
- Interactive controls must retain the visible focus state, and animation cannot replace state expression.
|
|
140
|
+
- All non-decorative SVGs must have accessible names; decorative SVGs use `aria-hidden="true"`.
|
|
141
|
+
- Default respects `prefers-reduced-motion`, complex animations must provide static or weak motion degradation.
|
|
142
|
+
- Don't inline large SVGs into frequently re-rendered components; extract as memoized components or external resources.
|
|
143
|
+
- Change clickable area, reading order or focus position without animation.
|
|
144
|
+
- Don't let SVG filters, blur, mask or clipPath become the main cause of frame drops on mobile devices; complex effects require device downgrading.
|
|
145
145
|
|
|
146
146
|
## Expected Output
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
Produce a reusable SVG animation component or style solution, including selection reasons, animation degradation and accessibility processing. During verification, check that the animation is smooth, there is no layout jitter, and keyboard and reduced-motion scenes are available.
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-tailwind-design-system
|
|
3
|
-
description: Use when designing, implementing, or reviewing Tailwind CSS design systems, token mapping, theme extension, utility class governance, component variants, dark mode, responsive utilities, safelists, or maintainable class composition; Chinese triggers include Tailwind,
|
|
3
|
+
description: Use when designing, implementing, or reviewing Tailwind CSS design systems, token mapping, theme extension, utility class governance, component variants, dark mode, responsive utilities, safelists, or maintainable class composition; Chinese triggers include Tailwind, design Token, component variants, dark mode, class management.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
#Tailwind Design System
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Suitable for front-end tasks hosting product design systems, component variations, and theme rules with Tailwind CSS. Load [references/tailwind-system-patterns.md](references/tailwind-system-patterns.md) when specific configuration, variant, class organization and migration details are needed.
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Make the tokens, themes, component variations, and responsive styles in the Tailwind project maintainable instead of scattering one-off utility classes into business code.
|
|
13
13
|
|
|
14
14
|
## Procedure
|
|
15
15
|
|
|
16
|
-
1.
|
|
17
|
-
2.
|
|
18
|
-
3.
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
21
|
-
6.
|
|
22
|
-
7.
|
|
16
|
+
1. Identify the current situation: Confirm Tailwind version, configuration location, dark mode strategy, component library, CSS variables, design token and class merging tool.
|
|
17
|
+
2. Establish token boundaries: color, spacing, rounded corners, shadow, font, z-index and breakpoints are first derived from the project token or `theme.extend`.
|
|
18
|
+
3. Design component variants: Basic components such as buttons, input boxes, cards, pop-up windows, and tables use centralized variant APIs to express size, semantics, status, and density.
|
|
19
|
+
4. Control class complexity: Repeated combinations are precipitated into components, slots, variants or local helpers; do not copy long class strings to multiple pages.
|
|
20
|
+
5. Handle themes and dark modes: Explicit `class`, `data-theme` or CSS variable schemes to avoid first render flickering and contrast regression.
|
|
21
|
+
6. Access responsiveness: mobile-first organization utility; leave complex layouts to responsive layout workflow, don’t just rely on stacked breakpoint prefixes to try your luck.
|
|
22
|
+
7. Verify style results: check hover, active, focus-visible, disabled, loading, selected, invalid, dark and different breakpoints.
|
|
23
23
|
|
|
24
24
|
## Constraints
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
26
|
+
- Don't think of the Tailwind class as the design system itself; the real system is the token, component API, state matrix, and usage constraints.
|
|
27
|
+
- Do not expand global tokens arbitrarily for a single page; new tokens must have semantic names and reuse scenarios.
|
|
28
|
+
- Do not use spliced dynamic classes to break build scans; use safelist, mapping table or variant tools when necessary.
|
|
29
|
+
- Do not override base component internals outside the component to implement variations.
|
|
30
|
+
- Don't let dark mode rely solely on inverse colors; status colors, borders, shadows, charts, and images are all re-examined.
|
|
31
31
|
|
|
32
32
|
## Expected Output
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Output Tailwind token mapping, theme configuration boundaries, component variant design, class reuse strategy, dark mode and responsive validation results. After completion, the style should be reusable by project components, searchable, testable, and consistent with the design system rules.
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
# Tailwind
|
|
1
|
+
# Tailwind system mode
|
|
2
2
|
|
|
3
|
-
## Token
|
|
3
|
+
## Token mapping
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Prefer using semantic names:
|
|
6
6
|
|
|
7
|
-
|
|
|
7
|
+
| Need | Recommend | Avoid |
|
|
8
8
|
| ---- | ---- | ---- |
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
9
|
+
| Brand color | `brand.600`, `--color-brand-primary` | Copy everywhere `blue-600` |
|
|
10
|
+
| Surface level | `surface.canvas`, `surface.panel` | One-time gray value |
|
|
11
|
+
| rounded corners | `radius.control`, `radius.panel` | optionally repeated specific values |
|
|
12
|
+
| Shadow | `shadow.floating`, `shadow.focus` | Decorative shadow with no state meaning |
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
If the project already has CSS variables, map Tailwind tokens to these variables instead of repeatedly maintaining literals.
|
|
15
15
|
|
|
16
|
-
## Variant
|
|
16
|
+
## Variant Attribution
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Long class combinations should converge to one of the following locations:
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- CVA
|
|
23
|
-
-
|
|
20
|
+
- Shared components with `variant`, `size`, `tone`, `density`, `state` props.
|
|
21
|
+
- Slot mapping table of composite components.
|
|
22
|
+
- Typed helpers such as CVA, tailwind-variants or local `classNames` mappings.
|
|
23
|
+
- Use local constants when reusing them within only one module.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Don't splice class names based on uncontrolled user input. Use explicit mapping:
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
28
|
const toneClass = {
|
|
@@ -32,28 +32,28 @@ const toneClass = {
|
|
|
32
32
|
} as const;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Dark mode
|
|
36
36
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- Tailwind
|
|
42
|
-
- CSS
|
|
43
|
-
-
|
|
44
|
-
-
|
|
37
|
+
- Prefer a single project-level strategy: `class`, `data-theme` or CSS variables.
|
|
38
|
+
- If the application supports manual theme switching, initialize the selected theme before the body is drawn to avoid flickering of the first screen that first lights up and then darkens or first darkens and then lights up.
|
|
39
|
+
- Test disabled, focus, selected, invalid, chart and skeleton states in both light and dark themes.
|
|
40
|
+
- Don't use lowering transparency as the only hint of disabled; preserve contrast and perceptibility.
|
|
41
|
+
- When the Tailwind project uses `darkMode: "class"` or equivalent configuration, the theme switching logic should maintain the root node class / data attribute and persist user preferences.
|
|
42
|
+
- In the CSS variable scheme, Tailwind token should refer to semantic variables; do not scatter two sets of utility literals for light and dark colors.
|
|
43
|
+
- When placing a minimal synchronization initialization script in `<head>` or a framework equivalent entry, only local theme preferences and system preferences are read, no business logic is executed, and no server-side data is accessed.
|
|
44
|
+
- In dark mode, you need to review the image brightness, shadow level, form controls, third-party components, chart color palette and focus ring; don't just add the background color.
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Responsive tool class
|
|
47
47
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
48
|
+
- The default class list starts with mobile layout.
|
|
49
|
+
- Only add larger breakpoint prefixes when the information architecture changes.
|
|
50
|
+
- Recurring responsive blocks should be precipitated into layout components or CSS container queries, and do not duplicate the same string of breakpoints repeatedly.
|
|
51
|
+
- Controls, tabs, dashboards and data cells use stable sizes to avoid layout jumps caused by hover and loading states.
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## Review Checklist
|
|
54
54
|
|
|
55
|
-
- Token
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
- Tailwind
|
|
59
|
-
-
|
|
55
|
+
- Token values have semantic roles and do not fork existing design rules.
|
|
56
|
+
- Component variants cover loading, disabled, selected, invalid, focus-visible and dark mode.
|
|
57
|
+
- Dynamic classes can be recognized by static scans, or have been safely added to the safelist.
|
|
58
|
+
- Tailwind utility classes have no accessibility-breaking, click-targeting, or reduced-motion requirements.
|
|
59
|
+
- Final UI checked in mobile, tablet and desktop widths.
|