@bovinphang/frontend-craft 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +34 -0
- package/CHANGELOG.zh-CN.md +34 -0
- package/README.md +1 -1
- package/README.openclaw.md +99 -43
- package/README.openclaw.zh-CN.md +99 -43
- package/README.zh-CN.md +1 -1
- package/agents/fec-architect.md +70 -70
- package/agents/fec-code-reviewer.md +82 -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 +14 -14
- package/agents/fec-security-reviewer.md +66 -67
- package/agents/fec-test-planner.md +27 -27
- package/agents/fec-typescript-reviewer.md +87 -87
- package/agents/fec-ui-checker.md +74 -74
- 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-review.md +41 -41
- package/commands/fec-scaffold.md +41 -41
- package/commands/fec-tdd.md +13 -13
- package/dist/bin/frontend-craft.js +29 -27
- package/docs/example-prompts.md +3 -0
- package/docs/ja-JP/README.md +1 -1
- package/docs/ko-KR/README.md +1 -1
- package/docs/project-structure.md +13 -5
- package/docs/zh-CN/example-prompts.md +3 -0
- package/docs/zh-CN/project-structure.md +6 -1
- package/docs/zh-TW/README.md +1 -1
- package/localized/zh-CN/agents/fec-architect.md +125 -0
- package/localized/zh-CN/agents/fec-code-reviewer.md +152 -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 +32 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +116 -0
- package/localized/zh-CN/agents/fec-test-planner.md +50 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +142 -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-review.md +66 -0
- package/localized/zh-CN/commands/fec-scaffold.md +205 -0
- package/localized/zh-CN/commands/fec-tdd.md +21 -0
- package/localized/zh-CN/skills/TEMPLATE.md +155 -0
- package/localized/zh-CN/skills/eval_queries.json +1013 -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 +143 -0
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +29 -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 +80 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -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 +74 -0
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +364 -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/png-qa.mjs +431 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -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 +51 -0
- package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -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 +38 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +27 -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 +52 -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 +1646 -0
- package/localized/zh-CN/skills/relations.json +755 -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 +54 -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 +1 -1
- package/package.json +3 -2
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +678 -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 +94 -94
- package/skills/fec-code-review/references/report-template.md +13 -13
- 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 +54 -29
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +33 -2
- package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
- package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -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 +30 -30
- package/skills/fec-refactor-clean/references/report-template.md +23 -23
- 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 +20 -20
- package/skills/fec-security-review/references/report-template.md +12 -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 +28 -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 +121 -115
- package/skills/relations.json +4 -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 +40 -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/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-react-project-standard
|
|
3
|
-
description: Use when designing or reviewing React + TypeScript project structure, feature/module boundaries, component architecture, hooks organization, routing composition, state/API/error/styling defaults, or repository-wide React conventions. Prefer narrower skills for forms, data fetching, tests, accessibility, virtualization, animation, or security deep dives; Chinese triggers include React
|
|
3
|
+
description: Use when designing or reviewing React + TypeScript project structure, feature/module boundaries, component architecture, hooks organization, routing composition, state/API/error/styling defaults, or repository-wide React conventions. Prefer narrower skills for forms, data fetching, tests, accessibility, virtualization, animation, or security deep dives; Chinese triggers include React project specification, React component architecture.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# React
|
|
6
|
+
# React project specifications
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Suitable for medium and large module construction, page reconstruction and engineering structure design in React + TypeScript warehouse.
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Provide engineering structure, module boundaries and default implementation conventions for React + TypeScript projects to ensure clear architecture and maintainable code.
|
|
13
13
|
|
|
14
14
|
## Procedure
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
1.
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- UI
|
|
25
|
-
|
|
26
|
-
2.
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- feature
|
|
30
|
-
-
|
|
16
|
+
This skill mainly solves the problem of "how to design and implement" React engineering tasks, without repeating the basic coding bottom line. When handling React engineering tasks, perform them in the following order:
|
|
17
|
+
|
|
18
|
+
1. Identify the warehouse and have an agreement
|
|
19
|
+
- Directory organization
|
|
20
|
+
- Style system
|
|
21
|
+
- Status management solution
|
|
22
|
+
- Request packaging method
|
|
23
|
+
- Testing framework
|
|
24
|
+
- UI component library/design system
|
|
25
|
+
|
|
26
|
+
2. Determine which layer the target belongs to
|
|
27
|
+
- Routing page
|
|
28
|
+
-Page private components
|
|
29
|
+
- feature business module
|
|
30
|
+
- Global common components
|
|
31
31
|
- hooks / services / stores / utils
|
|
32
32
|
|
|
33
|
-
3.
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
- DTO
|
|
40
|
-
|
|
41
|
-
4.
|
|
42
|
-
- loading / error / empty / data
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- Tailwind token/variant
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
##
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- React
|
|
33
|
+
3. Design the boundaries before writing the code
|
|
34
|
+
- What logic belongs to page layout
|
|
35
|
+
- Which logic belongs to feature
|
|
36
|
+
- Which logic should be transferred to general capabilities?
|
|
37
|
+
- Which state should be managed locally and which should be handed over to store/query/URL
|
|
38
|
+
- When the status ownership is complex, use the status management process to make a status list first
|
|
39
|
+
- When the boundaries of DTO, public props, generic components or `tsconfig` are complex, first use the TypeScript project specification process to converge cross-framework type contracts
|
|
40
|
+
|
|
41
|
+
4. Complete key quality items when outputting
|
|
42
|
+
- loading / error / empty / data status
|
|
43
|
+
- Error handling and retrying
|
|
44
|
+
- Type constraints
|
|
45
|
+
- Key test entrance
|
|
46
|
+
- Diversion of necessary special skills
|
|
47
|
+
- Check whether the dependency already exists in `package.json`. If it is missing, give the installation command first and then use it.
|
|
48
|
+
- Whether heavy UI capabilities (animation, charts, 3D, editors, maps) are isolated as leaf components and loaded on demand
|
|
49
|
+
- Whether images, videos, fonts and other resources are localized and cacheable, and avoid placeholder URLs from entering delivery
|
|
50
|
+
- Whether page-level Error Boundary, module-level fallback, API error mapping and user-recoverable actions are consistent
|
|
51
|
+
- Whether Tailwind token/variant or responsive layout requirements should be diverted to the corresponding special skill
|
|
52
|
+
- Perform lightweight screening for obvious architectural performance risks, such as heavy dependency boundaries, too wide Context, high-frequency derived values and lazy loading fallback; enter the performance optimization workflow when indicator evidence is needed
|
|
53
|
+
|
|
54
|
+
## Detailed reference
|
|
55
|
+
|
|
56
|
+
Load more detailed reference files as needed:
|
|
57
|
+
|
|
58
|
+
- Project Directory, Component Hierarchy, Component Boundary and Component Directory Recommendations: Load [references/react-project-structure.md](references/react-project-structure.md).
|
|
59
|
+
- Component pattern, Hooks, routing, state ownership, API layer, error handling and Suspense/lazy loading: Load [references/react-runtime-patterns.md](references/react-runtime-patterns.md).
|
|
60
|
+
- Style, annotations, TypeScript, tests, anti-patterns and output checklist: Loading [references/react-quality-patterns.md](references/react-quality-patterns.md).
|
|
61
|
+
- Lightweight performance conventions at the React project specification level: Load [references/react-performance-patterns.md](references/react-performance-patterns.md).
|
|
62
62
|
|
|
63
63
|
## Constraints
|
|
64
64
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
65
|
+
- Comply with the existing global rules and React rules of the warehouse by default
|
|
66
|
+
- If the warehouse already has a clear directory structure, style system, status management or request encapsulation, the warehouse convention will be used first.
|
|
67
|
+
- The size of the component file should be approximately **300 lines**; if it exceeds **500 lines** or is too complex, it must be split into sub-components, Hooks, utils, and types.
|
|
68
|
+
- It is forbidden to add new class components (Error Boundary uses libraries such as `react-error-boundary`)
|
|
69
|
+
- Disable bypassing module exports and importing from feature deep paths
|
|
70
|
+
- Do not use `useEffect + setState` to simulate derived values that can be calculated directly
|
|
71
|
+
- Avoid prop drilling too deep without considering composition or partial encapsulation
|
|
72
|
+
- Do not synchronously introduce GSAP, Three.js, Lottie, rich text editor or map SDK into common page components; use dynamic import, route-level subcontracting or leaf component isolation when necessary.
|
|
73
|
+
- No bare `fetch`, API URL, token refresh or upload processes scattered around React components; cross-border requests should be converged to the API integration layer.
|
|
74
|
+
- Do not use Error Boundary to handle normal API failures; request errors should first fall into the loading/error/empty/data state and recoverable operations.
|
|
75
|
+
- Do not write React performance recommendations as global memo without evidence; first locate request waterfall, bundle boundaries, repeated rendering or effect misuse.
|
|
76
76
|
|
|
77
77
|
## Expected Output
|
|
78
78
|
|
|
79
|
-
-
|
|
80
|
-
- Props
|
|
81
|
-
-
|
|
82
|
-
- API
|
|
83
|
-
- URL
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
79
|
+
- Component boundaries are clear, pages/features/components are clearly layered
|
|
80
|
+
- The Props type is complete and clear; the narrowing of complex public types or external data has been diverted to the TypeScript project specification process
|
|
81
|
+
- Reusable logic has been extracted into hooks, and the loading/error/empty/data status is complete
|
|
82
|
+
- The API layer has type constraints and unified error handling, and status management conforms to the proximity principle
|
|
83
|
+
- URL status, server status, form status and global client status have clear boundaries
|
|
84
|
+
- Key behaviors are covered by tests, and key modules have been wrapped with `react-error-boundary`
|
|
85
|
+
- The long list has been evaluated for virtualization, and pop-up/composite components have keyboard and focus support
|
|
86
|
+
- Respect the current situation of the warehouse first, and then recommend the structure
|
|
87
|
+
- Give necessary suggestions for file division
|
|
88
|
+
- Explain why this is layered if necessary
|
|
89
|
+
- For new modules, give priority to outputting the smallest floor-mountable structure rather than over-designing it all at once
|
|
90
|
+
- For reconstruction tasks, give priority to ensuring portability and risk controllability
|
|
91
|
+
- For performance-related React changes, describe the triggered risk categories, evidence sources, and verification commands
|
|
@@ -2,34 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
This file keeps lightweight React project-standard performance guidance. Use the frontend performance workflow when the task needs metrics, traces, profiles, bundle analysis, network evidence, or a formal performance report.
|
|
4
4
|
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
- **useMemo
|
|
8
|
-
- **useCallback
|
|
9
|
-
- **React.memo
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
###
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
5
|
+
### Performance (in conjunction with the "Performance Optimization" section)
|
|
6
|
+
|
|
7
|
+
- **useMemo**: Expensive derivation, large list sorting/filtering; pay attention to immutable data, such as `useMemo(() => [...list].sort(...), [list])`, and avoid directly `sort` the mutable original array.
|
|
8
|
+
- **useCallback**: passed to **`React.memo`** sub-component or used as a callback for other Hook dependencies, used when there is a stable reference requirement.
|
|
9
|
+
- **React.memo**: An acceptable component with pure display and shallow props; do not apply memo globally.
|
|
10
|
+
- **Virtual List**: For very long lists, use **TanStack Virtual**, **react-window**, etc., and only render nodes in the viewport (see "Suspense and Lazy Loading" for routing-level and component-level lazy loading).
|
|
11
|
+
|
|
12
|
+
## Performance optimization
|
|
13
|
+
|
|
14
|
+
Consider performance optimization in the following scenarios:
|
|
15
|
+
|
|
16
|
+
- Large list/large table
|
|
17
|
+
- High frequency re-rendering components
|
|
18
|
+
- Complex trees passed with a large number of props
|
|
19
|
+
- Heavy-duty third-party components
|
|
20
|
+
- High frequency changing context
|
|
21
|
+
|
|
22
|
+
### Recommended means
|
|
23
|
+
|
|
24
|
+
- Use `React.memo` appropriately
|
|
25
|
+
- Use `useMemo` / `useCallback` only when necessary
|
|
26
|
+
- List uses stable `key`
|
|
27
|
+
- Use virtual scrolling for large lists
|
|
28
|
+
- Code splitting at routing level
|
|
29
|
+
- Avoid putting high-frequency changing values into the top-level context
|
|
30
|
+
- Avoid meaninglessly creating a large number of new objects/new functions/new arrays in render
|
|
31
|
+
- Heavy charting, editor, map, 3D and media processing capabilities into leaf components or route-level lazy loading boundaries
|
|
32
|
+
- Lazy loading components must be equipped with loading, error, empty or downgraded UI to avoid only optimizing the package body but destroying the user state
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -1,177 +1,177 @@
|
|
|
1
1
|
# React project structure and component boundaries
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Project structure (recommended reference)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The following is the industry's best practice structure for medium and large React projects, tailored according to the actual situation of the project:
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
8
|
src/
|
|
9
|
-
├── app/
|
|
10
|
-
│
|
|
11
|
-
│
|
|
12
|
-
│
|
|
9
|
+
├── app/ # Application entry and global configuration
|
|
10
|
+
│ ├── App.tsx # Root component (Provider combination)
|
|
11
|
+
│ ├── routes.tsx # Routing configuration
|
|
12
|
+
│ └── providers.tsx # Global Provider assembly
|
|
13
13
|
│
|
|
14
|
-
├── pages/
|
|
14
|
+
├── pages/ # Page components (one-to-one correspondence with routing)
|
|
15
15
|
│ ├── Dashboard/
|
|
16
16
|
│ │ ├── DashboardPage.tsx
|
|
17
|
-
│
|
|
18
|
-
│
|
|
17
|
+
│ │ ├── components/ # Page private components
|
|
18
|
+
│ │ └── hooks/ # Page private hooks
|
|
19
19
|
│ ├── UserList/
|
|
20
20
|
│ └── Settings/
|
|
21
21
|
│
|
|
22
|
-
├── layouts/
|
|
23
|
-
│
|
|
24
|
-
│
|
|
25
|
-
│
|
|
22
|
+
├── layouts/ # Layout component
|
|
23
|
+
│ ├── MainLayout.tsx # Main layout (sidebar + top bar + content area)
|
|
24
|
+
│ ├── AuthLayout.tsx # Login/registration page layout
|
|
25
|
+
│ └── BlankLayout.tsx # Blank layout (error page, etc.)
|
|
26
26
|
│
|
|
27
|
-
├── features/
|
|
27
|
+
├── features/ # Function modules (divided by business areas)
|
|
28
28
|
│ ├── auth/
|
|
29
|
-
│
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
│
|
|
33
|
-
│
|
|
34
|
-
│
|
|
29
|
+
│ │ ├── components/ # Module components
|
|
30
|
+
│ │ ├── hooks/ # module hooks
|
|
31
|
+
│ │ ├── api.ts # Module API call
|
|
32
|
+
│ │ ├── types.ts # Module type definition
|
|
33
|
+
│ │ ├── constants.ts # Module constants
|
|
34
|
+
│ │ └── index.ts # Module publicly exported
|
|
35
35
|
│ └── order/
|
|
36
36
|
│
|
|
37
|
-
├── components/
|
|
37
|
+
├── components/ # Globally shared UI components
|
|
38
38
|
│ ├── Button/
|
|
39
39
|
│ │ ├── Button.tsx
|
|
40
40
|
│ │ ├── Button.styles.css
|
|
41
41
|
│ │ └── __tests__/
|
|
42
42
|
│ ├── Modal/
|
|
43
43
|
│ ├── Form/
|
|
44
|
-
│
|
|
44
|
+
│ └── ErrorBoundary/ # Thin wrapper (function component) for react-error-boundary etc.
|
|
45
45
|
│
|
|
46
|
-
├── hooks/
|
|
46
|
+
├── hooks/ # Global shared hooks
|
|
47
47
|
│ ├── useAuth.ts
|
|
48
48
|
│ ├── useDebounce.ts
|
|
49
49
|
│ └── useMediaQuery.ts
|
|
50
50
|
│
|
|
51
|
-
├── services/
|
|
52
|
-
│
|
|
53
|
-
│
|
|
51
|
+
├── services/ # API base layer
|
|
52
|
+
│ ├── request.ts # Axios/fetch instance and interceptor
|
|
53
|
+
│ └── endpoints/ # API endpoint definition (such as split by field)
|
|
54
54
|
│
|
|
55
|
-
├── stores/
|
|
55
|
+
├── stores/ # Global status management
|
|
56
56
|
│ ├── authStore.ts
|
|
57
57
|
│ └── uiStore.ts
|
|
58
58
|
│
|
|
59
|
-
├── locales/
|
|
60
|
-
│
|
|
61
|
-
│
|
|
62
|
-
│
|
|
59
|
+
├── locales/ # International language pack
|
|
60
|
+
│ ├── zh-CN.json # Simplified Chinese
|
|
61
|
+
│ ├── en-US.json # English
|
|
62
|
+
│ └── index.ts # i18n instance initialization (i18next / react-intl)
|
|
63
63
|
│
|
|
64
|
-
├── assets/
|
|
65
|
-
│
|
|
66
|
-
│
|
|
67
|
-
│
|
|
64
|
+
├── assets/ # Static resources
|
|
65
|
+
│ ├── images/ # Pictures (PNG, JPG, WebP)
|
|
66
|
+
│ ├── icons/ # SVG icon
|
|
67
|
+
│ └── fonts/ # Custom fonts
|
|
68
68
|
│
|
|
69
|
-
├── config/
|
|
70
|
-
│
|
|
71
|
-
│
|
|
69
|
+
├── config/ # Application configuration
|
|
70
|
+
│ ├── env.ts # Typed encapsulation of environment variables
|
|
71
|
+
│ └── features.ts # Feature Flags Management
|
|
72
72
|
│
|
|
73
|
-
├── types/
|
|
74
|
-
│
|
|
75
|
-
│
|
|
76
|
-
│
|
|
73
|
+
├── types/ # Global shared types
|
|
74
|
+
│ ├── api.ts # API response/request common type
|
|
75
|
+
│ ├── models.ts #Business entity type
|
|
76
|
+
│ └── global.d.ts # Global type extension (picture module declaration, etc.)
|
|
77
77
|
│
|
|
78
|
-
├── utils/
|
|
79
|
-
│
|
|
80
|
-
│
|
|
81
|
-
│
|
|
78
|
+
├── utils/ # Pure utility function
|
|
79
|
+
│ ├── format.ts # Date, number, currency formatting
|
|
80
|
+
│ ├── validators.ts # Form validation rules
|
|
81
|
+
│ └── storage.ts # LocalStorage / SessionStorage package
|
|
82
82
|
│
|
|
83
|
-
├── styles/
|
|
84
|
-
│
|
|
85
|
-
│
|
|
86
|
-
│
|
|
87
|
-
│
|
|
88
|
-
│
|
|
89
|
-
│
|
|
90
|
-
│
|
|
83
|
+
├── styles/ # Global styles and themes
|
|
84
|
+
│ ├── global.css # Global basic style (reset/normalize)
|
|
85
|
+
│ ├── variables.css # CSS variables (color, spacing, font size)
|
|
86
|
+
│ ├── breakpoints.ts # Responsive breakpoint constants
|
|
87
|
+
│ └── themes/ # theme definition
|
|
88
|
+
│ ├── light.css # Light theme variable
|
|
89
|
+
│ ├── dark.css # Dark theme variable
|
|
90
|
+
│ └── index.ts # theme switching logic
|
|
91
91
|
│
|
|
92
|
-
└── constants/
|
|
93
|
-
├── routes.ts
|
|
94
|
-
└── config.ts
|
|
92
|
+
└── constants/ # Global constants
|
|
93
|
+
├── routes.ts #Routing path constants
|
|
94
|
+
└── config.ts #Business constants (paging size, timeout, etc.)
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
###
|
|
97
|
+
### Key Principles
|
|
98
98
|
|
|
99
|
-
- `pages/`
|
|
100
|
-
- `layouts/`
|
|
101
|
-
- `features/`
|
|
102
|
-
- `components/`
|
|
103
|
-
- `hooks/`
|
|
104
|
-
- `locales/`
|
|
105
|
-
- `assets/`
|
|
106
|
-
- `services/`
|
|
107
|
-
- `config/`
|
|
108
|
-
- `styles/`
|
|
109
|
-
-
|
|
99
|
+
- `pages/` does route mapping and page arrangement, and does not carry large pieces of reusable business logic.
|
|
100
|
+
- `layouts/` is responsible for the page skeleton and layout container, referenced by the routing configuration
|
|
101
|
+
- `features/` is divided according to business areas, and the module should be as self-contained as possible
|
|
102
|
+
- `components/` only contains common components that are reused across pages and modules
|
|
103
|
+
- `hooks/` only puts global general hooks; business hooks are put back to the corresponding feature or page first
|
|
104
|
+
- `locales/` stores language pack JSON files, use `t('key')` in the component instead of hard-coded copy
|
|
105
|
+
- `assets/` stores static resources, SVG is preferred for icons, and WebP/AVIF is preferred for images.
|
|
106
|
+
- `services/` is responsible for requesting infrastructure and does not stack business details
|
|
107
|
+
- `config/` uniformly encapsulates environment variables and feature switches, prohibiting direct reading of `import.meta.env` in components
|
|
108
|
+
- `styles/` and theme variables are managed uniformly to avoid colors and sizes being scattered in business code
|
|
109
|
+
- Each module controls the public API through `index.ts` to avoid deep path imports
|
|
110
110
|
|
|
111
111
|
---
|
|
112
112
|
|
|
113
|
-
##
|
|
113
|
+
## Component and module layering
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
Recommended layering:
|
|
116
116
|
|
|
117
117
|
```text
|
|
118
|
-
|
|
119
|
-
└──
|
|
120
|
-
└──
|
|
121
|
-
└──
|
|
118
|
+
Page components (Pages) → route mapping, layout combination, page arrangement
|
|
119
|
+
└── Container/orchestration layer → data acquisition, status organization, event orchestration
|
|
120
|
+
└── Business components → Domain logic display
|
|
121
|
+
└── Common components → No business coupling, reusable across modules
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
###
|
|
124
|
+
### When to put it in `pages/`
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
Suitable for:
|
|
127
127
|
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
128
|
+
- Routing entry component
|
|
129
|
+
- Page level layout combination
|
|
130
|
+
- Page private lightweight orchestration logic
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
Not suitable for:
|
|
133
133
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
134
|
+
- A lot of domain logic
|
|
135
|
+
- Complex business blocks that can be reused on multiple pages
|
|
136
|
+
- API/hooks/types that are strongly bound to a certain business domain
|
|
137
137
|
|
|
138
|
-
###
|
|
138
|
+
### When to put it in `features/`
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
Suitable for:
|
|
141
141
|
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
142
|
+
- Components, hooks, apis, and types of a certain business domain
|
|
143
|
+
- Logic that can be shared by multiple pages but has business semantics
|
|
144
|
+
- Self-contained implementation of a complete business unit
|
|
145
145
|
|
|
146
|
-
###
|
|
146
|
+
### When to put it in `components/`
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
Suitable for:
|
|
149
149
|
|
|
150
|
-
-
|
|
151
|
-
-
|
|
150
|
+
- Common UI such as buttons, pop-up windows, form items, table shells, empty states, error states, etc.
|
|
151
|
+
- Components that have nothing to do with specific business and can be reused across modules
|
|
152
152
|
|
|
153
153
|
---
|
|
154
154
|
|
|
155
|
-
##
|
|
155
|
+
## Component design specifications
|
|
156
156
|
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
- props
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
157
|
+
- Use **Functional Components**, Hooks and TypeScript; **Do not** add new class components (Error Boundary uses libraries such as `react-error-boundary`, see below)
|
|
158
|
+
- **Single file size** and splitting principles can be found in `templates/shared/rules/fec-react.md` "**Component file size**" (approximately 300 lines is preferred, if it exceeds 500 lines or is too complex, sub-components, Hooks, utils, and types will be split)
|
|
159
|
+
- Keep components with single responsibilities and composable
|
|
160
|
+
- Extract reusable logic into hooks
|
|
161
|
+
- Prioritize the use of controlled component APIs in appropriate scenarios
|
|
162
|
+
- props are clearly defined and typed
|
|
163
|
+
- Prioritize reuse of existing design system components
|
|
164
|
+
- Maintain accessibility with keyboard interaction
|
|
165
|
+
- Avoid deep JSX nesting and duplicate branches
|
|
166
|
+
- Do not store additional state for deducible values
|
|
167
167
|
|
|
168
168
|
---
|
|
169
169
|
|
|
170
170
|
|
|
171
|
-
##
|
|
171
|
+
## Component directory suggestions
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
When the component complexity is low, only one file can be kept.
|
|
174
|
+
When a component contains styles, subcomponents, hooks, and tests, it is recommended to use the following structure:
|
|
175
175
|
|
|
176
176
|
```text
|
|
177
177
|
ComponentName/
|
|
@@ -186,12 +186,12 @@ ComponentName/
|
|
|
186
186
|
└── ComponentName.spec.tsx
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
Description:
|
|
190
190
|
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
191
|
+
- Split `ComponentName.types.ts` when the type is complex
|
|
192
|
+
- Split `hooks/` when there is local logic reuse
|
|
193
|
+
- When the subcomponent is only used inside the current component, it is placed in the current directory `components/`
|
|
194
|
+
- Whether the test should be placed nearby should follow the existing protocols of the warehouse
|
|
195
195
|
|
|
196
196
|
---
|
|
197
197
|
|