@bovinphang/frontend-craft 2.6.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 +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +72 -1
- package/CHANGELOG.zh-CN.md +71 -1
- package/README.md +10 -6
- package/README.openclaw.md +100 -42
- package/README.openclaw.zh-CN.md +100 -42
- package/README.zh-CN.md +10 -6
- 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 +88 -88
- 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 +84 -69
- package/docs/ja-JP/README.md +56 -52
- package/docs/ko-KR/README.md +45 -41
- package/docs/project-structure.md +19 -7
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +491 -0
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +340 -0
- package/docs/zh-CN/example-prompts.md +84 -69
- package/docs/zh-CN/project-structure.md +14 -5
- package/docs/zh-TW/README.md +33 -29
- 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/{skills/fec-typescript-type-safety → localized/zh-CN/skills/fec-typescript-project-standard}/references/type-safety-patterns.md +1 -1
- package/{skills/fec-typescript-type-safety/SKILL.md → localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md} +5 -14
- 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 +4 -3
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +717 -619
- 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 +45 -0
- 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 +73 -0
- package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
- package/skills/fec-drawio-studio/data/brand-icons.json +878 -0
- package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/skills/fec-drawio-studio/references/data-residency.md +27 -0
- package/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
- package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
- package/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
- package/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
- package/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
- package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
- package/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
- package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
- package/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
- package/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
- package/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
- package/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
- package/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
- package/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
- package/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
- package/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
- package/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
- package/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
- package/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
- package/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
- package/skills/fec-drawio-studio/styles/schema.json +112 -0
- package/skills/fec-e2e-testing/SKILL.md +24 -22
- package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
- package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
- package/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
- 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 +81 -0
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/references/artifact-routing.md +80 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +74 -0
- package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
- package/skills/fec-image-generation/references/png-qa-autofix.md +30 -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/png-qa.mjs +431 -0
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
- package/skills/fec-implement-from-design/SKILL.md +81 -74
- package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
- package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -173
- package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
- 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 +48 -0
- 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 -44
- package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
- package/skills/fec-nextjs-project-standard/SKILL.md +64 -58
- package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
- package/skills/fec-performance-optimization/SKILL.md +54 -50
- package/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
- package/skills/fec-performance-optimization/references/report-template.md +34 -28
- 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 -64
- package/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
- package/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
- 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 +39 -28
- 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 +66 -40
- 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 -32
- 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 +54 -0
- package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
- package/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
- package/skills/fec-ui-design/SKILL.md +90 -72
- package/skills/fec-ui-design/data/style-archetypes.json +40 -0
- package/skills/fec-ui-design/data/ux-quality-rules.json +35 -0
- package/skills/fec-ui-design/references/design-intelligence.md +81 -21
- package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
- package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -32
- package/skills/fec-ui-design/scripts/design-system.mjs +119 -1
- 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 +39 -30
- package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +163 -0
- package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +177 -0
- package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
- package/skills/fec-web-video-presentation/SKILL.md +61 -0
- package/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
- package/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
- package/skills/fec-web-video-presentation/references/content-plan.md +38 -0
- package/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
- package/skills/fec-web-video-presentation/references/theme-system.md +36 -0
- package/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
- 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 +402 -220
- package/skills/relations.json +120 -25
- 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 -117
- package/templates/shared/rules/fec-code-comments.md +22 -22
- package/templates/shared/rules/fec-design-system.md +65 -241
- package/templates/shared/rules/fec-error-handling.md +41 -185
- package/templates/shared/rules/fec-git-conventions.md +42 -42
- package/templates/shared/rules/fec-i18n.md +48 -96
- 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 -30
- package/templates/shared/rules/fec-rendering-patterns.md +40 -183
- package/templates/shared/rules/fec-responsive-design.md +37 -214
- package/templates/shared/rules/fec-source-driven-development.md +22 -22
- package/templates/shared/rules/fec-state-management.md +45 -148
- package/templates/shared/rules/fec-testing.md +64 -64
- package/templates/shared/rules/fec-typescript.md +98 -341
- package/templates/shared/rules/fec-vue.md +42 -42
- package/templates/shared/rules/fec-working-modes.md +34 -34
- package/skills/fec-e2e-testing/references/e2e-advanced.md +0 -176
- package/skills/fec-react-project-standard/references/react-project-details.md +0 -642
- package/skills/fec-vue3-project-standard/references/vue3-project-details.md +0 -547
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Code comments
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this document when writing or reviewing front-end implementations.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Principles
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- Intention is expressed first through **naming, type and structure**; comments are used to explain **why**, **constraints and background**, rather than reiterating what the code is doing.
|
|
8
|
+
- Avoid "zero comments in the entire file": Use **short** comments in **non-obvious** places to reduce the cost of accidental modifications, which is not inconsistent with "no nonsense comments".
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Situations that should be commented
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
12
|
+
- **Business or product rules**: permissions, display conditions, and the basis behind the verification logic (when related to requirements or domain agreements).
|
|
13
|
+
- **Non-intuitive implementation or trade-offs**: Why choose the current writing method (performance, compatibility, agreement with backend/third party, etc.).
|
|
14
|
+
- **External Contract**: Field meanings and mapping relationships related to interfaces, design drafts, enumerations or units.
|
|
15
|
+
- **Interim Solutions and Technical Debt**: `TODO` / `FIXME` should indicate expected closure or associated work orders (if any).
|
|
16
|
+
- **Easy pitfalls**: Third-party library version differences, the calling sequence that must be met, and known limitations.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Situations to avoid
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
- Line-by-line translation of behavior that can be seen directly from the code.
|
|
21
|
+
- Annotations are chronically inconsistent with the implementation; misleading annotations are updated or deleted synchronously when the logic is modified.
|
|
22
|
+
- Use large comments to replace functions that should be extracted or types that should be completed.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Format Suggestions
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
26
|
+
- The language is consistent with the existing comments in the warehouse (Chinese or English).
|
|
27
|
+
- Complex modules or components can use **1~3 lines** at the top of the file to describe responsibilities and key constraints; cross-package or externally exported APIs should use **JSDoc** to describe parameters, return values and side effects.
|
|
28
|
+
- Complex conditional branches or `useEffect`: If the dependency or triggering condition is not intuitive, use one line to describe the **triggering condition** or **invariant**.
|
|
29
|
+
- Temporary circumvention, compatibility with old systems or performance trade-offs must state reasons and exit conditions.
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## Document synchronization
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
When modifying public commands, skills, agents, templates, report naming or installation paths, synchronize updates to README, runtime docs, project structure documents and multi-language instructions. Comments explain local code, and public documentation explains how the team uses capabilities. The two should not replace each other.
|
|
@@ -1,248 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Design system rules
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document should be used whenever the task involves UI implementation, design draft conversion to code, style, design token, or component reuse. This article only retains the project's resident design constraints; product design direction, design system generation, page-level override, and UI QA details are handed over to `fec-ui-design`; Tailwind token, variant, dark mode and class management are handed over to `fec-tailwind-design-system`; responsive layout is handed over to `fec-responsive-layout`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Core priority
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. Reuse existing components.
|
|
8
|
+
2. Expand on existing components.
|
|
9
|
+
3. Create a new leaf component.
|
|
10
|
+
4. Only create new shared base components if there is good reason, clear boundaries, and if they will be reused.
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
2. 在已有组件上扩展
|
|
11
|
-
3. 创建新的叶子组件
|
|
12
|
-
4. 只有在理由非常充分时,才创建新的共享基础组件
|
|
12
|
+
## Product design direction
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- Tool-type pages, SaaS backend, CRM, and operations desk: Prioritize quiet, dense, and scannable, and the core work area is directly displayed on the first screen.
|
|
15
|
+
- Brand page, portfolio, release page: It can be more expressive, but H1 should be the brand, product, object or category, and the description copy should be placed in the subtitle.
|
|
16
|
+
- Visualization, games, and creative tools: You can use stronger visual assets and animations, but you must keep the interaction controllable and the status clear.
|
|
17
|
+
- Every important interface should have a visual anchor that fits the business, such as real media, data form, industry material, font character, spatial organization or interaction rhythm.
|
|
18
|
+
- Bold design must serve the scene; high-frequency tools focus on efficiency and stability, and display-type pages focus on subject recognition and memory points.
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
Avoid:
|
|
17
21
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- focus 状态
|
|
70
|
-
- 在相关场景下的 selected 状态
|
|
71
|
-
- 响应式行为
|
|
72
|
-
|
|
73
|
-
## 设计 Token 规则
|
|
74
|
-
|
|
75
|
-
- 优先使用已有 design token、CSS 变量或主题变量
|
|
76
|
-
- 当已有 Token 可用时,不要硬编码颜色、圆角、间距、阴影和字体取值
|
|
77
|
-
- 如果缺少所需 Token,要明确指出,不要悄悄到处硬编码
|
|
78
|
-
- Token 使用方式要与周边模块保持一致
|
|
79
|
-
- Tailwind 项目中,token 应通过语义化 `theme.extend`、CSS 变量或组件 variant 承接;不要把 `blue-600`、`rounded-xl` 等具体值复制成事实标准
|
|
80
|
-
- 组件 variant 应区分语义 tone、尺寸 size、密度 density 和状态 state;不要让一个字符串参数承载多种业务含义
|
|
81
|
-
- 动态 Tailwind class 必须可被构建扫描识别;复杂映射使用显式对象、variant 工具或 safelist
|
|
82
|
-
|
|
83
|
-
## 样式规则
|
|
84
|
-
|
|
85
|
-
- 优先使用局部、受控的样式,而不是大范围全局覆盖
|
|
86
|
-
- 保持当前断点下的响应式行为
|
|
87
|
-
- 与项目现有样式体系保持一致
|
|
88
|
-
- 检查 hover、active、focus、disabled、selected 等状态
|
|
89
|
-
- 除非没有合适 Token 或刻度值,否则不要使用 magic number
|
|
90
|
-
|
|
91
|
-
### 界面质感基线
|
|
92
|
-
|
|
93
|
-
- 嵌套圆角保持光学关系:外层圆角约等于内层圆角 + 间距
|
|
94
|
-
- 图标按钮、箭头、播放三角等非对称图形按视觉中心微调
|
|
95
|
-
- 小控件命中区域至少 40x40px,空间允许时优先 44x44px
|
|
96
|
-
- 标题和短文本可用 `text-wrap: balance`,短中正文可用 `text-wrap: pretty`
|
|
97
|
-
- 计数器、价格、时间、表格数字使用 `font-variant-numeric: tabular-nums`
|
|
98
|
-
- 图片在浅/深色背景上边缘不清时,使用中性 alpha 内描边,不使用品牌色描边
|
|
99
|
-
- 动效只声明实际变化属性,禁止 `transition: all` 和 `will-change: all`
|
|
100
|
-
- 进入/退出动效要克制,并尊重 `prefers-reduced-motion`
|
|
101
|
-
|
|
102
|
-
## 暗色模式
|
|
103
|
-
|
|
104
|
-
提供与系统主题同步的手动切换能力,减少视觉疲劳并满足可访问性要求。
|
|
105
|
-
|
|
106
|
-
### CSS 变量方案
|
|
107
|
-
|
|
108
|
-
```css
|
|
109
|
-
:root {
|
|
110
|
-
--color-bg-primary: #ffffff;
|
|
111
|
-
--color-bg-secondary: #f5f5f5;
|
|
112
|
-
--color-text-primary: #1a1a1a;
|
|
113
|
-
--color-text-secondary: #666666;
|
|
114
|
-
--color-border: #e0e0e0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
[data-theme="dark"] {
|
|
118
|
-
--color-bg-primary: #1a1a1a;
|
|
119
|
-
--color-bg-secondary: #2a2a2a;
|
|
120
|
-
--color-text-primary: #f0f0f0;
|
|
121
|
-
--color-text-secondary: #a0a0a0;
|
|
122
|
-
--color-border: #404040;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
body {
|
|
126
|
-
background-color: var(--color-bg-primary);
|
|
127
|
-
color: var(--color-text-primary);
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Tailwind 方案
|
|
132
|
-
|
|
133
|
-
```js
|
|
134
|
-
// tailwind.config.js
|
|
135
|
-
module.exports = {
|
|
136
|
-
darkMode: "class", // 通过 .dark 类控制,而非 prefers-color-scheme
|
|
137
|
-
};
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```html
|
|
141
|
-
<div class="bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100">
|
|
142
|
-
<!-- 内容 -->
|
|
143
|
-
</div>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### 主题切换 Hook
|
|
147
|
-
|
|
148
|
-
```tsx
|
|
149
|
-
import { useState, useEffect } from "react";
|
|
150
|
-
|
|
151
|
-
function useTheme() {
|
|
152
|
-
const [theme, setTheme] = useState<"light" | "dark">("light");
|
|
153
|
-
|
|
154
|
-
useEffect(() => {
|
|
155
|
-
// 1. 优先读取用户保存的偏好
|
|
156
|
-
const saved = localStorage.getItem("theme") as "light" | "dark" | null;
|
|
157
|
-
if (saved) {
|
|
158
|
-
setTheme(saved);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
// 2. 回退到系统偏好
|
|
162
|
-
const prefersDark = window.matchMedia(
|
|
163
|
-
"(prefers-color-scheme: dark)",
|
|
164
|
-
).matches;
|
|
165
|
-
setTheme(prefersDark ? "dark" : "light");
|
|
166
|
-
}, []);
|
|
167
|
-
|
|
168
|
-
useEffect(() => {
|
|
169
|
-
const root = document.documentElement;
|
|
170
|
-
if (theme === "dark") {
|
|
171
|
-
root.classList.add("dark");
|
|
172
|
-
root.setAttribute("data-theme", "dark");
|
|
173
|
-
} else {
|
|
174
|
-
root.classList.remove("dark");
|
|
175
|
-
root.setAttribute("data-theme", "light");
|
|
176
|
-
}
|
|
177
|
-
localStorage.setItem("theme", theme);
|
|
178
|
-
}, [theme]);
|
|
179
|
-
|
|
180
|
-
const toggle = () => setTheme((t) => (t === "light" ? "dark" : "light"));
|
|
181
|
-
|
|
182
|
-
return { theme, toggle };
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### FOUC 防护(主题闪烁)
|
|
187
|
-
|
|
188
|
-
在 `<head>` 中同步执行主题初始化脚本(阻塞渲染),避免首次加载时出现错误的主题色:
|
|
189
|
-
|
|
190
|
-
```html
|
|
191
|
-
<head>
|
|
192
|
-
<script>
|
|
193
|
-
// 同步执行 — 在 body 渲染前确定主题
|
|
194
|
-
(function () {
|
|
195
|
-
const theme =
|
|
196
|
-
localStorage.getItem("theme") ||
|
|
197
|
-
(window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
198
|
-
? "dark"
|
|
199
|
-
: "light");
|
|
200
|
-
if (theme === "dark") {
|
|
201
|
-
document.documentElement.classList.add("dark");
|
|
202
|
-
document.documentElement.setAttribute("data-theme", "dark");
|
|
203
|
-
}
|
|
204
|
-
})();
|
|
205
|
-
</script>
|
|
206
|
-
</head>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### 暗色模式注意事项
|
|
210
|
-
|
|
211
|
-
- **图片**: 亮色图片在暗色模式下刺眼,使用 `filter: brightness(0.8)` 降低亮度
|
|
212
|
-
- **阴影**: 暗色模式下阴影不明显,改用 `box-shadow: 0 0 15px rgba(255,255,255,0.05)` 或边框替代
|
|
213
|
-
- **颜色对比度**: 确保暗色模式下文本与背景的对比度 ≥ 4.5:1(WCAG AA)
|
|
214
|
-
- **表单控件**: 输入框、下拉框、开关等原生控件在暗色模式下需要自定义样式
|
|
215
|
-
- **第三方组件**: 检查 UI 组件库是否支持暗色模式,必要时用 CSS 变量覆盖
|
|
216
|
-
- **Tailwind 组件**: 暗色模式下需复核 focus、disabled、selected、invalid、skeleton、chart 和阴影层级,不只补 `dark:` 背景色
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## 可访问性基线
|
|
221
|
-
|
|
222
|
-
优先使用语义化 HTML。
|
|
223
|
-
|
|
224
|
-
确保:
|
|
225
|
-
|
|
226
|
-
- 表单控件具备标签
|
|
227
|
-
- 纯图标按钮具有可访问名称
|
|
228
|
-
- 菜单、标签页、对话框和自定义控件支持键盘操作
|
|
229
|
-
- 焦点样式可见
|
|
230
|
-
- 编辑页面时标题层级正确
|
|
231
|
-
- 真实表格数据使用正确表格语义
|
|
232
|
-
|
|
233
|
-
## UI 任务的输出要求
|
|
234
|
-
|
|
235
|
-
对于较复杂的设计类任务,开始时先给出:
|
|
236
|
-
|
|
237
|
-
- 复用的组件
|
|
238
|
-
- 新建的组件
|
|
239
|
-
- 可能改动的文件
|
|
240
|
-
- 响应式策略
|
|
241
|
-
- Token 映射或样式策略
|
|
242
|
-
|
|
243
|
-
实现完成后,需要说明:
|
|
244
|
-
|
|
245
|
-
- 复用了什么
|
|
246
|
-
- 新建了什么
|
|
247
|
-
- 与设计稿有哪些偏差
|
|
248
|
-
- 缺少哪些 Token、资源或交互细节
|
|
22
|
+
- Turn daily high-frequency tools into marketing landing pages.
|
|
23
|
+
- Use purple gradient, decorative light spots, stacked cards, empty hero or non-contextual default font by default.
|
|
24
|
+
- Large areas of the page are card-based, especially card sets.
|
|
25
|
+
- Use visible explanatory text to explain the functions that common controls are supposed to express.
|
|
26
|
+
- Let the entire interface consist of only one shade of hue.
|
|
27
|
+
|
|
28
|
+
## Design draft conversion code rules
|
|
29
|
+
|
|
30
|
+
- When given design context, read the source of truth first through MCP or screenshots/annotations, and don’t rely on guesswork to determine layout, spacing, fonts, colors, or status.
|
|
31
|
+
- Colors, spacing, rounded corners, shadows, and fonts in the design should be mapped to existing tokens, CSS variables, theme variables, or component variants.
|
|
32
|
+
- Check existing component libraries and business components before creating new components and prioritize reuse.
|
|
33
|
+
- Default verification is mobile(375px), tablet(768px), desktop(1440px).
|
|
34
|
+
- Pixel restoration requirements are subject to the project agreement; if there is no agreement, the core structure, spacing, fonts, status and interaction will take precedence over mechanical pursuit of screenshot overlap.
|
|
35
|
+
- Before implementing complex design tasks, a brief implementation plan is given, describing reused components, new components, possible changed files, responsive strategies and token mapping.
|
|
36
|
+
|
|
37
|
+
## Design Token and style
|
|
38
|
+
|
|
39
|
+
- Prefer using existing design tokens, CSS variables, or theme variables; do not hard-code colors, rounded corners, spacing, shadows, and font values.
|
|
40
|
+
- When required tokens are missing, clearly point them out and centrally complete or record them, rather than scattering literals in multiple components.
|
|
41
|
+
- In the Tailwind project, tokens should be inherited through semantic `theme.extend`, CSS variables or component variants; do not copy specific values such as `blue-600` and `rounded-xl` into de facto standards.
|
|
42
|
+
- Component variants should distinguish semantic tone, size, density and state; do not let a string parameter carry multiple business meanings at the same time.
|
|
43
|
+
- Dynamic Tailwind classes must be recognized by build scans; use explicit objects, variant tools, or safelist for complex mappings.
|
|
44
|
+
- Prioritize the use of local, controlled styles instead of large-scale global coverage; be consistent with the project's existing CSS Modules, Tailwind, component libraries or style systems.
|
|
45
|
+
|
|
46
|
+
## Interface texture baseline
|
|
47
|
+
|
|
48
|
+
- Nested fillets maintain an optical relationship: the outer fillet is approximately equal to the inner fillet + spacing.
|
|
49
|
+
- Asymmetric graphics such as icon buttons, arrows, and playback triangles are fine-tuned according to the visual center.
|
|
50
|
+
- The hit area of the small control should be at least 40x40px, and 44x44px is preferred if space allows.
|
|
51
|
+
- `text-wrap: balance` can be used for titles and short texts, and `text-wrap: pretty` can be used for short and medium text.
|
|
52
|
+
- Use `font-variant-numeric: tabular-nums` for counters, prices, times, and tabular numbers.
|
|
53
|
+
- Animation only declares actual change attributes, prohibits `transition: all` and `will-change: all`, and respects `prefers-reduced-motion`.
|
|
54
|
+
|
|
55
|
+
## Dark mode
|
|
56
|
+
|
|
57
|
+
- Project-level dark mode only selects one main strategy: CSS variables, root node class, `data-theme` or component library theme.
|
|
58
|
+
- When supporting manual theme switching, user preferences must be initialized before the first screen is drawn to avoid theme flickering; the implementation details are left to Tailwind / design-system skill reference.
|
|
59
|
+
- Review disabled, focus, selected, invalid, skeleton, chart, form controls, third-party components and shadow levels for both light and dark colors.
|
|
60
|
+
- Don't just reduce the transparency to express disabled, don't just fill in the background color and ignore text, borders, charts and focus states.
|
|
61
|
+
|
|
62
|
+
## Accessibility Baseline
|
|
63
|
+
|
|
64
|
+
- Prefer semantic HTML.
|
|
65
|
+
- Form controls have labels and pure icon buttons have accessible names.
|
|
66
|
+
- Menus, tabs, dialog boxes and custom controls support keyboard operation.
|
|
67
|
+
- Focus styles are visible, title levels are correct, and real table data uses table semantics.
|
|
68
|
+
- Color contrast, touch targets, reduced-motion and error prompts cannot be destroyed by visual polish.
|
|
69
|
+
|
|
70
|
+
## UI task output
|
|
71
|
+
|
|
72
|
+
After the implementation is completed, explain what was reused, what was newly created, deviations from the design draft or project token, and what resources or interaction details are missing. Complex UIs should also account for state overrides, responsive validation, and remaining design risks.
|
|
@@ -1,200 +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
|
-
|
|
6
|
-
|------|----------|----------|
|
|
7
|
-
| 全局 | 未捕获异常、Promise rejection | 全局捕获 + 上报 + 降级 UI |
|
|
8
|
-
| 路由/页面 | 页面级组件渲染错误 | Error Boundary + 页面级降级 |
|
|
9
|
-
| 模块 | 功能模块内的运行时错误 | Error Boundary + 模块级降级 |
|
|
10
|
-
| 组件 | 数据请求失败、操作失败 | 用户提示 + 重试机制 |
|
|
11
|
-
| 表单 | 校验失败 | 字段级错误提示 |
|
|
5
|
+
## Error layering
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
| Hierarchy | Error type | Default handling |
|
|
8
|
+
| ---- | -------- | -------- |
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
24
|
-
import { ErrorBoundary } from "react-error-boundary";
|
|
23
|
+
## API error handling
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
error: Error;
|
|
31
|
-
resetErrorBoundary: () => void;
|
|
32
|
-
}) {
|
|
33
|
-
return (
|
|
34
|
-
<div role="alert">
|
|
35
|
-
<p>页面出现异常</p>
|
|
36
|
-
<button type="button" onClick={resetErrorBoundary}>
|
|
37
|
-
重试
|
|
38
|
-
</button>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
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.
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
root.render(
|
|
45
|
-
<ErrorBoundary
|
|
46
|
-
FallbackComponent={GlobalErrorFallback}
|
|
47
|
-
onError={(error, info) => {
|
|
48
|
-
reportError(error, { componentStack: info.componentStack });
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
<App />
|
|
52
|
-
</ErrorBoundary>,
|
|
53
|
-
);
|
|
54
|
-
```
|
|
30
|
+
## User experience
|
|
55
31
|
|
|
56
|
-
|
|
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.
|
|
57
36
|
|
|
58
|
-
|
|
59
|
-
// main.ts
|
|
60
|
-
app.config.errorHandler = (err, instance, info) => {
|
|
61
|
-
reportError(err, {
|
|
62
|
-
component: instance?.$options.name,
|
|
63
|
-
lifecycleHook: info,
|
|
64
|
-
});
|
|
65
|
-
};
|
|
37
|
+
## Error reporting
|
|
66
38
|
|
|
67
|
-
|
|
68
|
-
reportError(event.reason);
|
|
69
|
-
});
|
|
70
|
-
```
|
|
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.
|
|
71
40
|
|
|
72
|
-
##
|
|
41
|
+
## Anti-pattern
|
|
73
42
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
│ ├── Dashboard (ErrorBoundary)
|
|
81
|
-
│ └── UserList (ErrorBoundary)
|
|
82
|
-
└── Footer
|
|
83
|
-
```
|
|
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.
|
|
84
49
|
|
|
85
|
-
|
|
86
|
-
- 模块崩溃不应导致整个页面白屏
|
|
87
|
-
- 降级 UI 应提供"重试"操作
|
|
50
|
+
## Checklist
|
|
88
51
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
interface ApiError {
|
|
95
|
-
code: string;
|
|
96
|
-
message: string;
|
|
97
|
-
details?: Record<string, string[]>;
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### 错误分级处理
|
|
102
|
-
|
|
103
|
-
```typescript
|
|
104
|
-
function handleApiError(error: ApiError) {
|
|
105
|
-
switch (error.code) {
|
|
106
|
-
case 'UNAUTHORIZED':
|
|
107
|
-
redirectToLogin();
|
|
108
|
-
break;
|
|
109
|
-
case 'FORBIDDEN':
|
|
110
|
-
showToast('无权限执行此操作');
|
|
111
|
-
break;
|
|
112
|
-
case 'VALIDATION_ERROR':
|
|
113
|
-
return error.details; // 返回给表单显示字段级错误
|
|
114
|
-
case 'NETWORK_ERROR':
|
|
115
|
-
showToast('网络异常,请检查网络连接');
|
|
116
|
-
break;
|
|
117
|
-
default:
|
|
118
|
-
showToast(error.message || '操作失败,请稍后重试');
|
|
119
|
-
reportError(error);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 请求拦截器
|
|
125
|
-
|
|
126
|
-
在 axios / fetch 封装层统一处理:
|
|
127
|
-
|
|
128
|
-
- 401 → 跳转登录(或刷新 token)
|
|
129
|
-
- 403 → 权限不足提示
|
|
130
|
-
- 500 → 通用错误提示 + 上报
|
|
131
|
-
- 网络超时 → 超时提示 + 可选重试
|
|
132
|
-
|
|
133
|
-
### 用户可恢复动作
|
|
134
|
-
|
|
135
|
-
每类错误都应对应明确下一步:
|
|
136
|
-
|
|
137
|
-
- `401`:重新登录或静默刷新失败后跳转登录
|
|
138
|
-
- `403`:说明无权限并提供返回或申请权限路径
|
|
139
|
-
- `404`:返回列表、重新搜索或创建入口
|
|
140
|
-
- `409`:展示冲突对象和刷新/覆盖/取消选择
|
|
141
|
-
- `422`:字段级错误回填表单
|
|
142
|
-
- `429`:告知等待时间或稍后重试
|
|
143
|
-
- `5xx` / 网络错误:重试、离线提示或联系支持
|
|
144
|
-
|
|
145
|
-
UI 可显示 request id / trace id 方便支持排查,但不得暴露内部堆栈、SQL、服务名或敏感字段。
|
|
146
|
-
|
|
147
|
-
## 用户体验
|
|
148
|
-
|
|
149
|
-
### 错误状态 UI
|
|
150
|
-
|
|
151
|
-
每个数据展示区域应处理四种状态:
|
|
152
|
-
|
|
153
|
-
1. **Loading** — 骨架屏或 spinner
|
|
154
|
-
2. **Error** — 错误描述 + 重试按钮
|
|
155
|
-
3. **Empty** — 空状态引导
|
|
156
|
-
4. **Success** — 正常数据展示
|
|
157
|
-
|
|
158
|
-
### 降级 UI 设计
|
|
159
|
-
|
|
160
|
-
- 全局级:显示友好的错误页面,提供"返回首页"和"重试"
|
|
161
|
-
- 模块级:显示该模块的占位错误卡片,页面其他部分正常
|
|
162
|
-
- 操作级:Toast 提示 + 具体的下一步指引
|
|
163
|
-
|
|
164
|
-
### 重试策略
|
|
165
|
-
|
|
166
|
-
- 用户手动重试(按钮)
|
|
167
|
-
- 自动重试(指数退避,最多 3 次)
|
|
168
|
-
- 数据请求库的内置重试(React Query retries 等)
|
|
169
|
-
|
|
170
|
-
## 错误上报
|
|
171
|
-
|
|
172
|
-
<!-- 请根据项目实际的错误监控平台调整:Sentry / 自建 / 其他 -->
|
|
173
|
-
|
|
174
|
-
上报内容应包含:
|
|
175
|
-
|
|
176
|
-
- 错误堆栈
|
|
177
|
-
- 用户 ID / 会话 ID
|
|
178
|
-
- 当前页面 URL
|
|
179
|
-
- 浏览器/设备信息
|
|
180
|
-
- 复现上下文(操作步骤、请求参数)
|
|
181
|
-
|
|
182
|
-
## 反模式
|
|
183
|
-
|
|
184
|
-
- 空 catch 块吞掉错误
|
|
185
|
-
- 所有错误统一用 `alert()` 提示
|
|
186
|
-
- 接口失败时 UI 无任何反馈
|
|
187
|
-
- Error Boundary 没有重试机制,用户只能刷新页面
|
|
188
|
-
- 在组件中到处写重复的 try/catch 而不是统一封装
|
|
189
|
-
- 不上报错误,依赖用户反馈来发现问题
|
|
190
|
-
- 用 Error Boundary 承接普通 API 错误,导致用户无法理解或恢复
|
|
191
|
-
- 把后端原始异常、内部错误码或敏感字段直接展示给用户
|
|
192
|
-
|
|
193
|
-
## 检查清单
|
|
194
|
-
|
|
195
|
-
- [ ] 全局有未捕获异常和 Promise rejection 的监听
|
|
196
|
-
- [ ] 关键功能模块有 Error Boundary(React)或 onErrorCaptured(Vue)包裹
|
|
197
|
-
- [ ] API 请求有统一的错误拦截和分级处理
|
|
198
|
-
- [ ] 所有数据展示区域处理了 Loading / Error / Empty / Success 四种状态
|
|
199
|
-
- [ ] 降级 UI 提供了"重试"操作
|
|
200
|
-
- [ ] 错误信息上报到监控平台
|
|
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.
|