@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,56 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Error handling specifications
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document agrees on the resident boundaries of front-end error handling. React/Vue component boundary details are handed over to the corresponding framework skill, API error mapping and authentication refresh are handed over to `fec-api-integration`, and security-sensitive errors are handed over to `fec-security-review`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Error layering
|
|
6
6
|
|
|
7
|
-
|
|
|
7
|
+
| Hierarchy | Error type | Default handling |
|
|
8
8
|
| ---- | -------- | -------- |
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
9
|
+
| Global | Uncaught exceptions, Promise rejection | Capture, reporting, global downgrade UI |
|
|
10
|
+
| Routing / Page | Page-level rendering exception | Error Boundary / Frame error boundary + Page-level degradation |
|
|
11
|
+
| Module | Function module runtime exception | Module-level boundary + local degradation |
|
|
12
|
+
| Component/Request | Data request failure, operation failure | User-understandable prompts + recoverable actions |
|
|
13
|
+
| Form | Validation failure | Field-level error prompts and correction entry |
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Global and module boundaries
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
- React
|
|
19
|
-
- Vue
|
|
20
|
-
-
|
|
21
|
-
- Error Boundary
|
|
17
|
+
- Uncaught exception and Promise rejection monitoring should be registered at the application entrance and connected to the project error reporting platform.
|
|
18
|
+
- React uses the project's unified Error Boundary solution; business components remain functional and no new handwritten class component boundaries are added.
|
|
19
|
+
- Vue uses project-unified `app.config.errorHandler`, `onErrorCaptured` or framework-level error boundaries.
|
|
20
|
+
- Independent functional modules should have local downgrade capabilities, and module crashes should not cause the entire page to go blank.
|
|
21
|
+
- Error Boundary handles rendering exceptions; normal API failures should fall into the loading/error/empty/data state and recoverable operations.
|
|
22
22
|
|
|
23
|
-
## API
|
|
23
|
+
## API error handling
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- `401
|
|
28
|
-
- UI
|
|
25
|
+
- The request layer uniformly normalizes error shapes, and components do not directly parse backend exceptions, token refresh or retry strategies.
|
|
26
|
+
- Each type of error should have a clear next step: retry, log in again, modify input, return to the previous level, refresh conflicting data, contact support, or try again later.
|
|
27
|
+
- `401`, `403`, `404`, `409`, `422`, `429`, `5xx` and network errors should have distinguishable user prompts and log semantics.
|
|
28
|
+
- The UI can display request id / trace id to facilitate support troubleshooting, but must not expose internal stacks, SQL, service names, keys or sensitive fields.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## User experience
|
|
31
31
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
32
|
+
- Each data display area handles four states: Loading, Error, Empty, and Success.
|
|
33
|
+
- Global-level error pages provide paths to return to the home page, refresh or retry; module-level downgrades only affect this module; operation-level errors provide the next step.
|
|
34
|
+
- The retry strategy must be restrained: users’ manual retries are given priority, and automatic retries must have upper limits, backoff and stop conditions.
|
|
35
|
+
- Error prompts should retain what the user has entered to avoid losing the form or context due to failure.
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Error reporting
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
The reported content should include the error stack, page URL, browser/device information, user or session ID, operation context, request ID, and version information. Clean tokens, passwords, personal sensitive fields and large payloads before reporting.
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Anti-pattern
|
|
42
42
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
- Error Boundary
|
|
47
|
-
-
|
|
48
|
-
-
|
|
43
|
+
- Empty `catch` blocks swallow errors.
|
|
44
|
+
- All errors are reported with `alert()` or a vague toast.
|
|
45
|
+
- When the interface fails, there is no feedback from the UI, or the original exception from the backend is directly displayed to the user.
|
|
46
|
+
- Error Boundary has no retry or return path.
|
|
47
|
+
- Write repeated `try/catch` everywhere in the component instead of uniformly encapsulating request boundaries.
|
|
48
|
+
- Use Error Boundary to handle common API errors, making it impossible for users to understand or recover.
|
|
49
49
|
|
|
50
|
-
##
|
|
50
|
+
## Checklist
|
|
51
51
|
|
|
52
|
-
- [ ]
|
|
53
|
-
- [ ]
|
|
54
|
-
- [ ] API
|
|
55
|
-
- [ ]
|
|
56
|
-
- [ ]
|
|
52
|
+
- [ ] Global uncaught exceptions and Promise rejections are listened to.
|
|
53
|
+
- [ ] Critical pages or modules have frame error boundaries and partially degraded UI.
|
|
54
|
+
- [ ] API requests have unified error normalization, hierarchical processing and recoverable actions.
|
|
55
|
+
- [ ] Data area override Loading / Error / Empty / Success.
|
|
56
|
+
- [ ] Error reports contain sufficient location information and do not leak sensitive data.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Git
|
|
1
|
+
# Git commit specifications
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This file should be used whenever creating a commit, writing a commit message, or preparing to submit code.
|
|
4
4
|
|
|
5
|
-
## Conventional Commits
|
|
5
|
+
## Conventional Commits Format
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
<type>(<scope>): <subject>
|
|
@@ -12,62 +12,62 @@
|
|
|
12
12
|
[footer]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
### type
|
|
15
|
+
### type value
|
|
16
16
|
|
|
17
|
-
| type |
|
|
17
|
+
| type | purpose |
|
|
18
18
|
|------|------|
|
|
19
|
-
| `feat` |
|
|
20
|
-
| `fix` |
|
|
21
|
-
| `refactor` |
|
|
22
|
-
| `style` |
|
|
23
|
-
| `docs` |
|
|
24
|
-
| `test` |
|
|
25
|
-
| `chore` |
|
|
26
|
-
| `perf` |
|
|
27
|
-
| `ci` | CI/CD
|
|
19
|
+
| `feat` | New features |
|
|
20
|
+
| `fix` | Fix bug |
|
|
21
|
+
| `refactor` | Refactor (does not change behavior) |
|
|
22
|
+
| `style` | Code format adjustment (does not affect logic) |
|
|
23
|
+
| `docs` | Documentation changes |
|
|
24
|
+
| `test` | Test related |
|
|
25
|
+
| `chore` | Build, tools, dependencies and other miscellaneous items |
|
|
26
|
+
| `perf` | Performance optimization |
|
|
27
|
+
| `ci` | CI/CD configuration changes |
|
|
28
28
|
|
|
29
29
|
### scope
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Optional, indicate the scope of influence, such as module name, component name or functional domain:
|
|
32
32
|
|
|
33
|
-
- `feat(auth):
|
|
34
|
-
- `fix(table):
|
|
35
|
-
- `refactor(api):
|
|
33
|
+
- `feat(auth): add new mobile phone number to log in`
|
|
34
|
+
- `fix(table): Fix sorting column not highlighted`
|
|
35
|
+
- `refactor(api): unified request error handling`
|
|
36
36
|
|
|
37
|
-
### subject
|
|
37
|
+
### subject specification
|
|
38
38
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
39
|
+
- Use imperative sentences ("increased xxx" instead of "increased xxx")
|
|
40
|
+
- No more than 72 characters
|
|
41
|
+
- does not end with a period
|
|
42
|
+
- If the scope of impact is large, describe it in detail in the body
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Branch naming
|
|
45
45
|
|
|
46
|
-
- `feature/xxx` —
|
|
47
|
-
- `fix/xxx` —
|
|
48
|
-
- `refactor/xxx` —
|
|
49
|
-
- `hotfix/xxx` —
|
|
46
|
+
- `feature/xxx` — new features
|
|
47
|
+
- `fix/xxx` — fix
|
|
48
|
+
- `refactor/xxx` — Refactor
|
|
49
|
+
- `hotfix/xxx` — emergency fix
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## Check before submission
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Must pass before submission:
|
|
54
54
|
|
|
55
55
|
1. lint
|
|
56
56
|
2. type-check
|
|
57
|
-
3.
|
|
57
|
+
3. Testing related to changes
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Do not execute `git commit` directly without user confirmation.
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Submission granularity
|
|
62
62
|
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
63
|
+
- A commit only has one clear purpose: feature, fix, test, documentation or cleanup.
|
|
64
|
+
- Large programs should be broken into verifiable smaller batches, each with instructions and command results.
|
|
65
|
+
- Don't mix cleanup, formatting, and behavior changes in the same commit.
|
|
66
|
+
- Review the diff before pushing or sending a PR to make sure there are no local configurations, keys, temporary reports or debug output.
|
|
67
67
|
|
|
68
|
-
##
|
|
68
|
+
## Anti-pattern
|
|
69
69
|
|
|
70
|
-
-
|
|
71
|
-
- commit message
|
|
72
|
-
-
|
|
73
|
-
-
|
|
70
|
+
- A commit that mixes unrelated changes
|
|
71
|
+
- The commit message is too general (such as "update", "fix bug", "wip")
|
|
72
|
+
- Include debug code, console.log, or temporary hacks in commits
|
|
73
|
+
- Commit high-risk changes without specifying verification commands or knowing the remaining risk
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Internationalization (i18n) rules
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document applies whenever it involves user-visible copy, tooltips, form labels, error messages, or UI text. Please modify the locales path, library and key prefix according to the actual i18n solution of the project.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Scope of application
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- **Modern stack (React/Vue/Next/Nuxt, etc.)**: New or modified user-visible copy must follow the project i18n solution.
|
|
8
|
+
- **Legacy HTML/JS, progressive migration or coexistence of old and new**: The new code path must still meet the core principles; the legacy layer adheres to migration constraints to avoid expanding hard coding and confusing keys.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
`src/locales/` is used below to refer to the actual copywriting resource directory of the project. Please replace it according to the warehouse convention.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Core Principles
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
- i18n
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
14
|
+
- User-visible copy in new application code must use i18n, and hardcoding Chinese or English strings is prohibited.
|
|
15
|
+
- i18n keys are organized by modules and named with dots, such as `order.list.empty`.
|
|
16
|
+
- Copies with the same semantics reuse the same key to avoid repeated definitions.
|
|
17
|
+
- Variables, plurals, dates, numbers and currencies are formatted using i18n capabilities without string concatenation.
|
|
18
|
+
- Search existing resources before modifying the copy, and give priority to reusing accurate keys.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Copywriting and resource specifications
|
|
21
21
|
|
|
22
|
-
- `common.*`
|
|
23
|
-
- `module.component.*`
|
|
24
|
-
- `validation.*`
|
|
25
|
-
- `error.*`
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
22
|
+
- `common.*` is used for cross-module common copywriting, such as confirm, cancel, submit, and loading.
|
|
23
|
+
- `module.component.*` is used for module-level copy.
|
|
24
|
+
- `validation.*` is used for form validation prompts.
|
|
25
|
+
- `error.*` for error messages.
|
|
26
|
+
- Each natural language corresponds to an independent resource file, and multiple languages are prohibited from being mixed in the same file or the same top-level multi-language object.
|
|
27
|
+
- Copywriting files must be saved in UTF-8; when the team has an agreement, priority will be given to UTF-8 without BOM to avoid garbled non-ASCII copywriting in Chinese, Japanese and other languages.
|
|
28
|
+
- When adding a key, the main language files that should be covered by the current function are updated simultaneously; if a language is temporarily missing, the gap must be explicitly recorded.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Legacy code and migration scenarios
|
|
31
31
|
|
|
32
|
-
-
|
|
33
|
-
- React
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
32
|
+
- No new user-visible hardcoding is added in legacy HTML or JS, unless the segment is purely static and the repository does not yet have access to the i18n path.
|
|
33
|
+
- When new code paths such as React/Vue add prompts, errors, buttons, and form labels, i18n must be used.
|
|
34
|
+
- When adding new sub-applications or modules, they should be consistent with the existing language file structure, namespace and lazy loading strategy.
|
|
35
|
+
- Keys are organized by page, module and semantics to avoid continuing to use historical abbreviations or meaningless segments.
|
|
36
|
+
- If the old key is only "usable but inaccurate", priority will be given to renaming the key and rewriting the translation, and parallel compatibility will not be maintained for a long time.
|
|
37
|
+
- Only introduce mapping layer or alias transition when the old key has become an external contract (fixed reference in backend, buried points, external documents, third-party integration, etc.).
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Implement constraints
|
|
40
40
|
|
|
41
|
-
- Vue
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
41
|
+
- The specific calling methods of Vue, React, Next, and Nuxt are subject to the existing i18n library of the project, such as `vue-i18n`, `react-intl`, `react-i18next` or the framework's built-in solution.
|
|
42
|
+
- Do not directly write user-visible hard coding in components; tests can assert through key or final copywriting, but should avoid over-coupling with translation details.
|
|
43
|
+
- When lazily loading language packs, loading, fallback, and missing key behaviors must be predictable.
|
|
44
|
+
- Error, form, and empty state copy should express the user’s next step, not just translate technical errors.
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Checklist
|
|
47
47
|
|
|
48
|
-
- [ ]
|
|
49
|
-
- [ ]
|
|
50
|
-
- [ ]
|
|
51
|
-
- [ ] key
|
|
52
|
-
- [ ]
|
|
53
|
-
- [ ]
|
|
54
|
-
- [ ]
|
|
48
|
+
- [ ] All newly added user-visible copy uses i18n key.
|
|
49
|
+
- [ ] The new key has been added to all language files that should be covered, and each language is maintained in separate files.
|
|
50
|
+
- [ ] The language resource file is UTF-8, and there will be no garbled characters when opened.
|
|
51
|
+
- [ ] key naming conforms to module, component, and usage conventions, and reuses existing semantics.
|
|
52
|
+
- [ ] Interpolation, complex numbers, dates, numbers, currencies are formatted using i18n.
|
|
53
|
+
- [ ] User-visible hardcoding not expanded in migration or hybrid stacks.
|
|
54
|
+
- [ ] The new code does not break existing namespaces, loading methods, and sub-app boundaries.
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## Anti-pattern
|
|
57
57
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
58
|
+
- Write user-visible Chinese or English strings directly in templates or JSX.
|
|
59
|
+
- Use string concatenation instead of i18n interpolation.
|
|
60
|
+
- Hardcode toast, error or confirmation text in JS/TS logic.
|
|
61
|
+
- Different modules create different keys for the same meaning.
|
|
62
|
+
- Mixing multiple languages makes diffing, reviewing and on-demand loading difficult.
|
|
63
|
+
- Save copy files in non-UTF-8 or incorrect encoding.
|
|
64
|
+
- Long-term retention of multiple sets of parallel keys to accommodate historical abbreviations or poor naming.
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Naming convention
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## File and directory naming
|
|
4
4
|
|
|
5
|
-
|
|
|
5
|
+
| Type | Naming Style | Example |
|
|
6
6
|
|------|----------|------|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
| Hooks / Composables | camelCase + `use`
|
|
11
|
-
| Store
|
|
12
|
-
| API
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
21
|
-
##
|
|
7
|
+
| Page component | PascalCase + `Page` suffix | `UserDetailPage.tsx` / `UserDetailPage.vue` |
|
|
8
|
+
| Layout component | PascalCase + `Layout` suffix | `MainLayout.tsx` / `MainLayout.vue` |
|
|
9
|
+
| Common components | PascalCase | `DataTable.tsx` / `AppButton.vue` |
|
|
10
|
+
| Hooks / Composables | camelCase + `use` prefix | `useAuth.ts`, `useDebounce.ts` |
|
|
11
|
+
| Store file | camelCase + `Store` suffix | `authStore.ts`, `uiStore.ts` |
|
|
12
|
+
| API documentation | camelCase | `api.ts` or by domain `userApi.ts` |
|
|
13
|
+
| Utility functions | camelCase | `format.ts`, `validators.ts` |
|
|
14
|
+
| Type files | camelCase | `types.ts`, `models.ts` |
|
|
15
|
+
| Constant files | camelCase | `constants.ts`, `config.ts` |
|
|
16
|
+
| Test file | Same name as source file + `.spec` / `.test` | `Button.spec.tsx`, `useAuth.spec.ts` |
|
|
17
|
+
| Style file | Component name + `.styles` + extension | `Button.styles.css`, `DataTable.styles.scss`; `ComponentName.styles.ts` when using styled-components |
|
|
18
|
+
| Language pack | Language code (BCP 47) | `zh-CN.json`, `en-US.json` |
|
|
19
|
+
| Directory name | PascalCase (component/page) or kebab-case (function module) | `UserDetail/`, `auth/`, `order/` |
|
|
20
|
+
|
|
21
|
+
## Component naming
|
|
22
22
|
|
|
23
23
|
### React
|
|
24
24
|
|
|
25
25
|
```tsx
|
|
26
|
-
//
|
|
26
|
+
//The file name is consistent with the component name
|
|
27
27
|
// src/components/DataTable/DataTable.tsx
|
|
28
28
|
export function DataTable({ data, columns }: DataTableProps) { ... }
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
//Add Page suffix to page component
|
|
31
31
|
// src/pages/UserDetail/UserDetailPage.tsx
|
|
32
32
|
export default function UserDetailPage() { ... }
|
|
33
33
|
```
|
|
@@ -35,86 +35,86 @@ export default function UserDetailPage() { ... }
|
|
|
35
35
|
### Vue
|
|
36
36
|
|
|
37
37
|
```vue
|
|
38
|
-
<!--
|
|
38
|
+
<!-- The file name is consistent with the component name -->
|
|
39
39
|
<!-- src/components/AppButton/AppButton.vue -->
|
|
40
40
|
<script setup lang="ts">
|
|
41
|
-
//
|
|
41
|
+
// No need for defineOptions, the file name is the component name
|
|
42
42
|
</script>
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
-
|
|
46
|
-
- Vue
|
|
47
|
-
-
|
|
45
|
+
- Multi-word component names (to avoid conflicts with HTML native tags)
|
|
46
|
+
- Vue global components are recommended to use the `App` prefix (`AppButton`, `AppModal`)
|
|
47
|
+
- Use PascalCase reference in template: `<AppButton>` instead of `<app-button>`
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## Variable and function naming
|
|
50
50
|
|
|
51
|
-
|
|
|
51
|
+
| Type | Naming Style | Example |
|
|
52
52
|
|------|----------|------|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
| Map / Record | `xxxMap`
|
|
60
|
-
| Ref (Vue) |
|
|
61
|
-
|
|
|
62
|
-
| Props
|
|
63
|
-
| Emits
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
67
|
-
## CSS
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
- CSS
|
|
73
|
-
|
|
74
|
-
##
|
|
75
|
-
|
|
76
|
-
|
|
|
53
|
+
| Ordinary variables | camelCase | `userName`, `isLoading`, `pageSize` |
|
|
54
|
+
| Constants | UPPER_SNAKE_CASE | `MAX_RETRY_COUNT`, `DEFAULT_PAGE_SIZE` |
|
|
55
|
+
| Boolean value | `is` / `has` / `should` / `can` prefix | `isVisible`, `hasPermission`, `canEdit` |
|
|
56
|
+
| Event handling (inside component) | `handle` prefix | `handleClick`, `handleSubmit` |
|
|
57
|
+
| Callback Props | `on` prefix | `onClick`, `onSubmit`, `onChange` |
|
|
58
|
+
| Array | Plural noun | `users`, `orderItems`, `selectedIds` |
|
|
59
|
+
| Map / Record | `xxxMap` or `xxxByYyy` | `userMap`, `permissionsById` |
|
|
60
|
+
| Ref (Vue) | Without `Ref` suffix | `count` (without `countRef`) |
|
|
61
|
+
| Interface | PascalCase, without `I` prefix | `UserProfile` (without `IUserProfile`) |
|
|
62
|
+
| Props interface | component name + `Props` | `DataTableProps`, `UserFormProps` |
|
|
63
|
+
| Emits interface | component name + `Emits` | `UserFormEmits` |
|
|
64
|
+
| Enum | PascalCase, members use PascalCase | `OrderStatus.Pending` |
|
|
65
|
+
| Generic parameters | Single letter capitalization or semantic | `T`, `TData`, `TItem` |
|
|
66
|
+
|
|
67
|
+
## CSS class naming
|
|
68
|
+
|
|
69
|
+
- Aligned with project conventions (BEM/CSS Modules/Tailwind/Atomic CSS)
|
|
70
|
+
- If using CSS Modules, use camelCase for class names: `.headerTitle`, `.cardBody`
|
|
71
|
+
- If using BEM, follow the `block__element--modifier` format
|
|
72
|
+
- CSS variables use kebab-case: `--color-primary`, `--spacing-md`
|
|
73
|
+
|
|
74
|
+
## Route naming
|
|
75
|
+
|
|
76
|
+
| Type | Naming Style | Example |
|
|
77
77
|
|------|----------|------|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
78
|
+
| routing path | kebab-case | `/user-detail`, `/order-list` |
|
|
79
|
+
| Route name | PascalCase | `UserDetail`, `OrderList` |
|
|
80
|
+
| Routing parameters | camelCase | `:userId`, `:orderId` |
|
|
81
|
+
| Query parameters | camelCase | `?pageSize=10&sortBy=name` |
|
|
82
|
+
| Path constants | UPPER_SNAKE_CASE | `ROUTE_USER_DETAIL = '/user-detail'` |
|
|
83
83
|
|
|
84
|
-
## API
|
|
84
|
+
## API naming
|
|
85
85
|
|
|
86
|
-
|
|
|
86
|
+
| Type | Naming Style | Example |
|
|
87
87
|
|------|----------|------|
|
|
88
|
-
| GET
|
|
89
|
-
| GET
|
|
90
|
-
| POST
|
|
91
|
-
| PUT
|
|
92
|
-
| DELETE
|
|
93
|
-
| DTO
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
## i18n Key
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
|
|
102
|
-
##
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
- CSS
|
|
110
|
-
|
|
111
|
-
##
|
|
112
|
-
|
|
113
|
-
- [ ]
|
|
114
|
-
- [ ]
|
|
115
|
-
- [ ]
|
|
116
|
-
- [ ]
|
|
117
|
-
- [ ]
|
|
118
|
-
- [ ]
|
|
119
|
-
- [ ] API
|
|
120
|
-
- [ ] i18n key
|
|
88
|
+
| GET list | `getXxxList` | `getUserList(params)` |
|
|
89
|
+
| GET single item | `getXxxDetail` / `getXxxById` | `getUserDetail(id)` |
|
|
90
|
+
| POST Create | `createXxx` | `createOrder(data)` |
|
|
91
|
+
| PUT update | `updateXxx` | `updateUser(id, data)` |
|
|
92
|
+
| DELETE delete | `deleteXxx` | `deleteOrder(id)` |
|
|
93
|
+
| DTO type | Verb + Noun + `DTO` | `CreateOrderDTO`, `UpdateUserDTO` |
|
|
94
|
+
| Response type | Noun | `User`, `Order`, `PageResult<User>` |
|
|
95
|
+
|
|
96
|
+
## i18n Key naming
|
|
97
|
+
|
|
98
|
+
- Use dotted namespace: `module.section.label`
|
|
99
|
+
- Examples: `user.form.username`, `common.button.submit`, `error.network.timeout`
|
|
100
|
+
- Do not use Chinese/Pinyin as key
|
|
101
|
+
|
|
102
|
+
## Anti-pattern
|
|
103
|
+
|
|
104
|
+
- File name and component name are inconsistent (`user-table.tsx` exports `DataGrid`)
|
|
105
|
+
- Mixing multiple naming styles (some kebab-case, some PascalCase) in the same project
|
|
106
|
+
- Use abbreviated or ambiguous names (`btn`, `usr`, `tmp`, `handleA`)
|
|
107
|
+
- Boolean values have no semantic prefix (`visible` → should be `isVisible`)
|
|
108
|
+
- Constants do not need to be capitalized (`maxRetry` → should be `MAX_RETRY`)
|
|
109
|
+
- CSS variables are hardcoded in components instead of using uniform variables
|
|
110
|
+
|
|
111
|
+
## Checklist
|
|
112
|
+
|
|
113
|
+
- [ ] The file name is consistent with the exported component/function name
|
|
114
|
+
- [ ] Page components have the `Page` suffix, and layout components have the `Layout` suffix.
|
|
115
|
+
- [ ] Boolean variables use `is` / `has` / `can` / `should` prefixes
|
|
116
|
+
- [ ] Event handling is prefixed with `handle`, callback Props are prefixed with `on`
|
|
117
|
+
- [ ] constant using UPPER_SNAKE_CASE
|
|
118
|
+
- [ ] Use kebab-case for the routing path and PascalCase for the routing name.
|
|
119
|
+
- [ ] API function naming is consistent with HTTP method semantics
|
|
120
|
+
- [ ] i18n key uses dotted namespace, no hardcoded copy
|