@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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 响应式设计规则
|
|
2
|
+
|
|
3
|
+
凡是任务涉及移动端适配、响应式布局、多端兼容、触摸目标或视口行为时,都应用本文件。本文只保留项目常驻约束;布局模式、container query、响应式表格、媒体和验证细节交给 `fec-responsive-layout`。
|
|
4
|
+
|
|
5
|
+
## 核心原则
|
|
6
|
+
|
|
7
|
+
- **移动优先**:从小屏幕开始设计,逐步增强到大屏幕。
|
|
8
|
+
- **内容优先**:小屏优先展示核心任务、关键操作和反馈,次要内容折叠、延后或进入详情层。
|
|
9
|
+
- **触摸友好**:所有交互元素必须适配手指操作,关键功能不能只依赖 hover。
|
|
10
|
+
- **性能优先**:移动端网络和设备性能较弱,首屏资源、图表、动效和大列表要克制。
|
|
11
|
+
- **容器感知**:可复用组件优先适配所在容器,而不是假设整页断点。
|
|
12
|
+
- **稳定尺寸**:工具栏、表格列、棋盘、卡片网格和计数器需要稳定约束,避免状态变化导致布局跳动。
|
|
13
|
+
|
|
14
|
+
## 断点与容器策略
|
|
15
|
+
|
|
16
|
+
- 默认验证 375px、768px、1024px、1440px,以及断点中间值。
|
|
17
|
+
- 使用 mobile-first `min-width` 断点;不要先写桌面样式再用 `max-width` 补移动端。
|
|
18
|
+
- Tailwind 前缀从小到大使用:默认 → `sm:` → `md:` → `lg:` → `xl:` → `2xl:`。
|
|
19
|
+
- 页面级结构可以使用断点;会被放进侧栏、弹窗、卡片或主内容区的复用组件优先使用 container query。
|
|
20
|
+
- grid/flex 子项包含长文本、图表、代码、媒体或表格时,必须考虑 `min-width: 0`、`minmax()`、`aspect-ratio` 和明确溢出策略。
|
|
21
|
+
|
|
22
|
+
## 触摸目标与移动端交互
|
|
23
|
+
|
|
24
|
+
- 空间允许时,按钮、链接、关闭按钮等交互目标至少 44x44px;紧凑工具界面最低也要保证可操作。
|
|
25
|
+
- 输入框字号避免低于 16px,防止 iOS Safari 自动缩放。
|
|
26
|
+
- 固定底部栏、操作条、抽屉和对话框必须考虑 safe area 与虚拟键盘。
|
|
27
|
+
- hover-only 信息必须有点击、焦点或常驻可见替代方案。
|
|
28
|
+
- 横竖屏切换后,主操作、焦点位置、滚动容器和错误提示仍应可达。
|
|
29
|
+
|
|
30
|
+
## 数据密集区域
|
|
31
|
+
|
|
32
|
+
- 表格、列表、看板、编辑器和画布可以局部横向滚动,但页面整体不应出现无意水平溢出。
|
|
33
|
+
- 移动端数据密集视图需先定义列优先级:主标识、状态和主操作优先保留;低优先级字段进入详情、展开行或抽屉。
|
|
34
|
+
- 小屏仍要保留排序、筛选、分页和选择能力。
|
|
35
|
+
- 虚拟滚动只解决 DOM 数量问题,不能替代信息层级设计。
|
|
36
|
+
|
|
37
|
+
## 响应式媒体
|
|
38
|
+
|
|
39
|
+
- 图片和视频要有稳定尺寸、`aspect-ratio` 或容器约束,避免加载后推挤布局。
|
|
40
|
+
- 需要多尺寸资源时使用 `srcset`、`sizes`、`picture` 或框架图片组件,避免移动端下载桌面大图。
|
|
41
|
+
- 媒体裁切必须保留主体信息,不为填满卡片裁掉产品、人物、图表或状态关键区域。
|
|
42
|
+
|
|
43
|
+
## 检查清单
|
|
44
|
+
|
|
45
|
+
- [ ] 320-375px 页面级无水平溢出。
|
|
46
|
+
- [ ] 断点切换后阅读顺序合理,主操作不被隐藏。
|
|
47
|
+
- [ ] 触摸目标、输入字号、safe area、虚拟键盘和横竖屏行为已验证。
|
|
48
|
+
- [ ] loading、empty、error、disabled、hover/focus、长翻译文本和大数字不会撑坏固定格式控件。
|
|
49
|
+
- [ ] 数据密集区域有列优先级、局部滚动或移动端摘要策略。
|
|
50
|
+
- [ ] 首屏媒体尺寸稳定,非首屏媒体不会拖慢移动端主路径。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 来源驱动开发规则
|
|
2
|
+
|
|
3
|
+
当实现依赖框架、库、浏览器、运行时、构建工具或平台行为时,先确认事实来源,再写代码或评审结论。
|
|
4
|
+
|
|
5
|
+
## 事实来源优先级
|
|
6
|
+
|
|
7
|
+
1. 项目内 README、配置、测试、模板和已有实现。
|
|
8
|
+
2. 官方文档、源码、类型定义、release notes、migration guide。
|
|
9
|
+
3. Web 标准、浏览器兼容数据和平台文档。
|
|
10
|
+
4. Issue、讨论、博客和第三方文章仅作为线索。
|
|
11
|
+
|
|
12
|
+
## 使用场景
|
|
13
|
+
|
|
14
|
+
- 框架新版本、路由、渲染模式、缓存、构建配置、浏览器 API。
|
|
15
|
+
- 公共接口、组件 API、设计系统 token、CLI 命令和插件元数据。
|
|
16
|
+
- 依赖升级、迁移、废弃 API 替换、跨运行时兼容。
|
|
17
|
+
- 与安全、性能、可访问性相关的版本敏感判断。
|
|
18
|
+
|
|
19
|
+
## 输出要求
|
|
20
|
+
|
|
21
|
+
- 写清来源、版本或项目事实、决策结论、影响范围和验证方式。
|
|
22
|
+
- 若项目现状与官方推荐冲突,说明冲突原因和渐进迁移策略。
|
|
23
|
+
- 不复制长篇外部文档;只保留必要结论、链接或项目内文件路径。
|
|
24
|
+
- 无法验证时标注不确定性和需要用户/团队确认的事项。
|
|
25
|
+
|
|
26
|
+
## 反模式
|
|
27
|
+
|
|
28
|
+
- 凭记忆使用版本敏感 API。
|
|
29
|
+
- 用过时教程替代官方文档。
|
|
30
|
+
- 为追新推翻稳定项目约定。
|
|
31
|
+
- 在组件里散落外部库行为假设,而不是集中到适配层。
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# 状态管理规范
|
|
2
|
+
|
|
3
|
+
本文件约定前端状态归属底线。状态清单、Store 形状示例、URL 状态、持久化适配器和 SSR 隔离细节交给 `fec-state-management`;请求缓存细节交给数据获取 workflow;表单字段和校验交给表单 workflow。
|
|
4
|
+
|
|
5
|
+
## 状态分类
|
|
6
|
+
|
|
7
|
+
| 类型 | 示例 | 默认归属 |
|
|
8
|
+
| ---- | ---- | -------- |
|
|
9
|
+
| 本地 UI 状态 | modal 开关、tab、展开行、hover 编辑态 | 组件内 state / ref |
|
|
10
|
+
| 表单状态 | 输入值、脏字段、校验错误、提交中 | 表单库或表单组件 |
|
|
11
|
+
| 服务端状态 | 列表、详情、分页结果、远程错误 | 请求缓存库 |
|
|
12
|
+
| URL 状态 | 搜索词、筛选、排序、页码、选中 tab | 路由参数 / search params |
|
|
13
|
+
| 全局客户端状态 | 登录用户、主题、权限快照、购物车草稿 | 全局 store |
|
|
14
|
+
| 浏览器持久化状态 | 偏好、非敏感草稿、离线队列 | 存储层 + 状态适配器 |
|
|
15
|
+
|
|
16
|
+
## 核心原则
|
|
17
|
+
|
|
18
|
+
- **先归属,后选库**:不要先选 Redux、Zustand、Pinia 或 Context;先确定每个状态的唯一 owner。
|
|
19
|
+
- **就近管理**:状态放在需要它的最近公共祖先。
|
|
20
|
+
- **单一数据源**:同一份数据只在一个地方维护。
|
|
21
|
+
- **派生优于同步**:可从 props、server state、URL 或已有 state 推导的值,不另存一份。
|
|
22
|
+
- **最小全局状态**:全局 store 只保存真正跨页面、跨 feature 或需要统一动作的客户端状态。
|
|
23
|
+
|
|
24
|
+
## React 状态边界
|
|
25
|
+
|
|
26
|
+
- 单组件或小子树使用 `useState` / `useReducer`。
|
|
27
|
+
- 低频全局配置、主题或依赖注入可用 Context;高频变化的大对象不要放 Context。
|
|
28
|
+
- 中等复杂业务状态可用 Zustand、Jotai 或仓库既有方案;大型严格动作流可用 Redux Toolkit。
|
|
29
|
+
- 服务端数据使用请求缓存库,不复制到全局 store。
|
|
30
|
+
|
|
31
|
+
## Vue 状态边界
|
|
32
|
+
|
|
33
|
+
- 局部状态使用 `ref` / `reactive` / `computed`。
|
|
34
|
+
- 局部跨层级上下文使用 `provide/inject`。
|
|
35
|
+
- 全局业务状态使用 Pinia 或项目既有 store。
|
|
36
|
+
- 服务端数据优先使用请求库或 composable 管理,不原封不动写入 Pinia。
|
|
37
|
+
|
|
38
|
+
## URL 与持久化状态
|
|
39
|
+
|
|
40
|
+
- 搜索、筛选、排序、分页、选中 tab 等需要分享或刷新保留的视图状态优先放 URL。
|
|
41
|
+
- 浏览器持久化只保存稳定偏好或非敏感草稿,并明确字段白名单、版本号、迁移路径、过期策略和敏感字段排除。
|
|
42
|
+
- SSR 场景不要在模块顶层创建带用户数据的单例 store;每次请求需要独立实例。
|
|
43
|
+
|
|
44
|
+
## 反模式
|
|
45
|
+
|
|
46
|
+
- 将所有状态都放进全局 store。
|
|
47
|
+
- 在 store 中存放 UI 临时状态或表单每个字段。
|
|
48
|
+
- 手动同步多份相同数据,而不是从源状态派生。
|
|
49
|
+
- 将服务端响应原封不动存入全局 store,而不用请求缓存库。
|
|
50
|
+
- 用 Context / provide 承载高频变化大对象,导致大范围重渲染。
|
|
51
|
+
- 持久化 token、权限细节、个人敏感数据或未版本化的大对象。
|
|
52
|
+
|
|
53
|
+
## 检查清单
|
|
54
|
+
|
|
55
|
+
- [ ] 每个状态都有明确归属:本地 / 表单 / 服务端缓存 / URL / 全局 store / 浏览器持久化。
|
|
56
|
+
- [ ] 可派生的值没有被存为独立 state。
|
|
57
|
+
- [ ] 全局 store 只包含真正跨边界共享的数据。
|
|
58
|
+
- [ ] 服务端数据通过请求库管理,刷新、回退、权限变化和错误状态仍可恢复。
|
|
59
|
+
- [ ] URL 状态与路由参数同步,刷新和分享行为符合预期。
|
|
60
|
+
- [ ] 持久化状态有白名单、版本、迁移和敏感字段排除。
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# 测试与校验规则
|
|
2
|
+
|
|
3
|
+
凡是新增、修改、重构或评审代码时,都应用本文件。
|
|
4
|
+
|
|
5
|
+
## 校验顺序
|
|
6
|
+
|
|
7
|
+
优先按以下顺序执行:
|
|
8
|
+
|
|
9
|
+
1. lint
|
|
10
|
+
2. type check
|
|
11
|
+
3. unit test
|
|
12
|
+
4. build
|
|
13
|
+
|
|
14
|
+
优先使用仓库已有脚本。
|
|
15
|
+
如果命令不确定,先检查 `package.json`。
|
|
16
|
+
|
|
17
|
+
## 改动校验原则
|
|
18
|
+
|
|
19
|
+
- 先修复范围最小且正确的问题
|
|
20
|
+
- 每次关键修复后重新执行受影响的命令
|
|
21
|
+
- 不要盲目压掉报错或关闭规则
|
|
22
|
+
- 不要为了通过检查而降低类型安全
|
|
23
|
+
- 不要因为一个局部测试失败就重写无关模块
|
|
24
|
+
|
|
25
|
+
## 测试要求
|
|
26
|
+
|
|
27
|
+
新增或修改行为时,考虑是否需要覆盖以下内容:
|
|
28
|
+
|
|
29
|
+
- 组件渲染
|
|
30
|
+
- 交互行为
|
|
31
|
+
- 状态切换
|
|
32
|
+
- 边界场景
|
|
33
|
+
- loading / empty / error 状态
|
|
34
|
+
- 与可访问性相关的关键交互
|
|
35
|
+
|
|
36
|
+
如果没有补测试,需要说明原因。
|
|
37
|
+
|
|
38
|
+
## Fixture 与 Mock
|
|
39
|
+
|
|
40
|
+
- Fixture 表达业务场景,不使用随机、无语义或只对测试作者有意义的数据
|
|
41
|
+
- 复杂对象使用 builder 填充默认值,每个测试只覆盖当前场景相关字段
|
|
42
|
+
- 测试间不共享可变全局状态、fake timer、store 或 mock server handler
|
|
43
|
+
- 网络 mock 应模拟公开契约和用户可见错误,不复制后端内部实现
|
|
44
|
+
|
|
45
|
+
## TDD 与回归测试
|
|
46
|
+
|
|
47
|
+
新增行为、修复 Bug 或重构关键逻辑时,优先采用 TDD:
|
|
48
|
+
|
|
49
|
+
1. 先写能描述期望行为的失败测试。
|
|
50
|
+
2. 运行测试并确认失败原因正确。
|
|
51
|
+
3. 写最小实现让测试通过。
|
|
52
|
+
4. 测试保持通过后再重构。
|
|
53
|
+
|
|
54
|
+
Bug 修复应优先保留能复现问题的回归测试。若现有项目缺少测试基础设施,不要盲目引入新框架;先给出最小测试落地建议并说明维护成本。
|
|
55
|
+
|
|
56
|
+
## 代码评审输出风格
|
|
57
|
+
|
|
58
|
+
评审代码时,返回:
|
|
59
|
+
|
|
60
|
+
- 总体评估
|
|
61
|
+
- 必修问题
|
|
62
|
+
- 建议优化
|
|
63
|
+
- 可选优化项
|
|
64
|
+
- 风险等级
|
|
65
|
+
|
|
66
|
+
结论要具体且可执行。
|
|
67
|
+
|
|
68
|
+
## E2E 测试规则
|
|
69
|
+
|
|
70
|
+
使用 Playwright 或 Cypress 时:
|
|
71
|
+
|
|
72
|
+
- 遵循 **Page Object**,spec 内不写裸选择器;优先 **`data-testid`**,其次 **`role` / `label`**
|
|
73
|
+
- 用 **`test.describe` + `beforeEach`** 组织场景,单用例可独立运行、不依赖执行顺序
|
|
74
|
+
- 禁止用固定 **`sleep`** 当主要同步手段;用 **Locator 自动等待**、`expect`、`waitForResponse` 等
|
|
75
|
+
- Playwright:**`playwright.config.ts`** 中配置 `baseURL`、CI 下 `retries`/`workers`、`trace`/`screenshot`/`video`、**`webServer`** 与多 **`projects`(含移动端)**
|
|
76
|
+
- 关键流程至少覆盖桌面、平板、移动端视口(或等价 device 项目)
|
|
77
|
+
- **不稳定用例**:`test.fixme` / `test.skip` 需写原因与 issue;用 `--repeat-each` 辅助定位 flaky
|
|
78
|
+
- 失败时保留 **截图、Trace、视频**,CI 用 **artifact** 上传 HTML 报告与产物
|
|
79
|
+
- 高风险/资金类流程:**勿在生产跑真实 E2E**;staging 或 mock,必要时 `test.skip`
|
|
80
|
+
- 测试数据可重复:优先 seed、测试账号或 mock 服务;随机值必须带唯一前缀并在 teardown 清理
|
|
81
|
+
|
|
82
|
+
详细模式与示例见插件 **`fec-e2e-testing`** skill。
|
|
83
|
+
|
|
84
|
+
## 重构规则
|
|
85
|
+
|
|
86
|
+
进行重构时:
|
|
87
|
+
|
|
88
|
+
- 除非任务明确要求改行为,否则保持行为一致
|
|
89
|
+
- 说明可能的迁移风险
|
|
90
|
+
- 优先做渐进式修改,而不是大范围重写
|
|
91
|
+
- 总结改动文件、执行过的命令和剩余风险
|
|
92
|
+
|
|
93
|
+
## 验证失败处理
|
|
94
|
+
|
|
95
|
+
- 按文件和根因分组错误,一次修复一类问题。
|
|
96
|
+
- 每次修复后重新运行最近的失败命令。
|
|
97
|
+
- 不删除失败测试、不关闭规则、不降低类型安全来换取通过。
|
|
98
|
+
- 同一错误多次修复仍失败时,停止扩大改动并报告阻塞。
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# TypeScript / JavaScript 规则
|
|
2
|
+
|
|
3
|
+
编写、修改或评审 `.ts`、`.tsx`、`.js`、`.jsx` 时应用本文件。本文只保留项目常驻硬约束;复杂类型建模、`tsconfig` 分层、声明产物、DTO / view model 边界、类型测试与发布入口设计,交给 `fec-typescript-project-standard` skill 或专项评审处理。注释风格另见 `fec-code-comments.md`;E2E 与校验流程另见 `fec-testing.md`。
|
|
4
|
+
|
|
5
|
+
## 类型与接口
|
|
6
|
+
|
|
7
|
+
用类型让对外 API、共享模型与组件 props 显式、可读、可复用。
|
|
8
|
+
|
|
9
|
+
### 对外导出的 API
|
|
10
|
+
|
|
11
|
+
- 对**导出**的函数、共享工具函数、公开类方法,写明参数与返回值类型。
|
|
12
|
+
- **局部**变量在类型显而易见时交给 TypeScript 推断,不为显而易见的中间变量重复标注。
|
|
13
|
+
- 重复出现的内联对象形状抽成具名 `interface` 或 `type`,避免同一契约散落在多个签名中。
|
|
14
|
+
- 外部数据、API DTO、路由参数、表单值与组件 props 的边界要显式命名;复杂建模分流到 `fec-typescript-project-standard`。
|
|
15
|
+
|
|
16
|
+
### `interface` 与 `type`
|
|
17
|
+
|
|
18
|
+
- 可能被扩展或 `implements` 的**对象形状**优先用 `interface`。
|
|
19
|
+
- **联合、交叉、元组、映射类型、工具类型组合**用 `type`。
|
|
20
|
+
- 状态、类型、角色等有限业务取值优先用字符串字面量联合;仅在互操作或团队统一要求时使用 `enum`。
|
|
21
|
+
|
|
22
|
+
### 函数参数:复杂类型宜具名
|
|
23
|
+
|
|
24
|
+
- 参数上的**复杂联合**、**内联对象类型**、**较复杂的回调签名**等,应优先提取为具名 `type` / `interface`,再在函数签名中引用。
|
|
25
|
+
- 仅当类型简单、短小、一眼可读,且明显无复用价值时,允许在参数位置内联。
|
|
26
|
+
- 回调参数与返回值必须表达清楚;不要用 `Function`、宽泛对象或隐式 `any` 承接业务契约。
|
|
27
|
+
|
|
28
|
+
### 避免 `any`
|
|
29
|
+
|
|
30
|
+
- 业务代码中避免 `any`;已有遗留 `any` 不随手扩散。
|
|
31
|
+
- 外部或不可信数据用 `unknown`,通过 `typeof`、`in`、`instanceof`、schema parse 或自定义 predicate 安全收窄。
|
|
32
|
+
- 类型随调用方变化时用泛型,但不要为简单场景引入难以理解的泛型层。
|
|
33
|
+
- `as` 类型断言只用于明确的边界互操作或已验证收窄后的补充表达,不用于压制类型错误。
|
|
34
|
+
|
|
35
|
+
### React 组件 Props
|
|
36
|
+
|
|
37
|
+
- 用具名 `interface` 或 `type` 定义 props,复杂公共 props 分流到类型模块。
|
|
38
|
+
- 回调 props 写清参数与返回值;事件 payload 不用裸对象长期内联。
|
|
39
|
+
- 无特殊理由不使用 `React.FC`,避免隐式 `children` 等差异。
|
|
40
|
+
- TSX 泛型、复杂组件 props 或外部 DTO 映射问题,交给 React 规则与 `fec-typescript-project-standard` 共同收敛。
|
|
41
|
+
|
|
42
|
+
## 单文件规模与模块拆分
|
|
43
|
+
|
|
44
|
+
- `.ts` / `.tsx` / `.js` / `.jsx` 单文件建议控制在**约 300 行以内**。该阈值是可维护性与评审效率的经验上限,不是机械硬限制。
|
|
45
|
+
- 当文件明显超过该规模且承担多重职责时,应优先按职责拆分:数据访问、业务规则、视图渲染、适配层、常量与映射、类型定义。
|
|
46
|
+
- 超阈值优先提取纯函数、子组件、自定义 Hook、`*.types.ts` 类型模块、常量表;不要仅为压行数做无意义切分。
|
|
47
|
+
- 可接受例外:生成代码、极薄的 re-export 聚合文件、经团队评审确认的高内聚模块;例外建议在文件头简短注明原因。
|
|
48
|
+
|
|
49
|
+
### 仍为 JavaScript 的文件
|
|
50
|
+
|
|
51
|
+
- 在 `.js` / `.jsx` 中,若短期无法迁 TS,可用 JSDoc 补类型,并与运行时行为一致。
|
|
52
|
+
- 不为迁移方便引入新的隐式全局、宽松对象或未验证外部输入。
|
|
53
|
+
|
|
54
|
+
## 禁止 Magic Number / Magic String
|
|
55
|
+
|
|
56
|
+
- **业务代码中禁止**使用**无语义**的硬编码数字或字符串直接表示状态、类型、标识或业务含义,包括 `if` / `switch` / 赋值 / API 字段映射。
|
|
57
|
+
- 固定且有限的取值范围须在单一真源处定义,并在全仓引用名称,避免裸值散落。
|
|
58
|
+
- 前端主路径优先使用 `as const` 常量对象配合字面量联合;与后端协议或团队约定强绑定时可使用 `enum`。
|
|
59
|
+
- 不属本条的典型例外仍应保持可读:纯算法下标、明显的 `0` / `1` 长度判断、与业务无关的 UI 刻度;视觉值若已有设计 Token,应改走 `fec-design-system.md`。
|
|
60
|
+
|
|
61
|
+
## 不可变更新
|
|
62
|
+
|
|
63
|
+
- 优先返回新对象或新数组,避免直接改写入参、props、store 快照或缓存对象。
|
|
64
|
+
- 对不应被修改的数据优先建模为 `readonly` / `Readonly<T>`。
|
|
65
|
+
- 大型嵌套更新应使用项目既有状态方案或清晰的 reducer / helper,不在组件中堆叠临时可变逻辑。
|
|
66
|
+
|
|
67
|
+
## 异步与错误处理
|
|
68
|
+
|
|
69
|
+
- 使用 `async` / `await` 与明确的错误边界;不要吞掉 promise rejection。
|
|
70
|
+
- `catch` 中将错误视为 `unknown` 再收窄,统一映射为用户可见错误、日志错误或调用方可处理的领域错误。
|
|
71
|
+
- API、认证、上传、支付等跨边界错误遵循 `fec-api-layer.md`、`fec-error-handling.md` 和安全规则,不在业务组件中散落裸处理。
|
|
72
|
+
|
|
73
|
+
## 输入校验
|
|
74
|
+
|
|
75
|
+
- 外部输入(表单、API、URL 参数、localStorage、postMessage、第三方 SDK 回调等)必须在边界处校验或收窄。
|
|
76
|
+
- 可使用 Zod、Valibot、Yup 或项目选用的同类 schema 工具;不要把具体库作为无条件新依赖引入。
|
|
77
|
+
- schema 推导类型可作为输入类型单一真源;复杂 DTO、领域模型与 UI view model 的分层交给 `fec-typescript-project-standard`。
|
|
78
|
+
|
|
79
|
+
## 类型资产分层与命名
|
|
80
|
+
|
|
81
|
+
- 模块或特性专属类型使用 `*.types.ts`,并与实现文件同目录或同 feature 目录放置。
|
|
82
|
+
- 全局与环境相关声明放在 `global.d.ts`、`env.d.ts` 或 `types/*.d.ts`,仅用于真全局或 ambient 声明,不将可模块化类型放入全局。
|
|
83
|
+
- 仅用于类型的导入导出优先使用 `import type` 与 `export type`,减少值空间歧义并提升编译语义清晰度。
|
|
84
|
+
- 与 API DTO 同源的类型,放在对应 feature 或 API 子目录,避免在页面或组件实现内散落大型匿名类型。
|
|
85
|
+
- `index.ts` 聚合导出应保持浅层且按 feature 边界组织,避免深层 barrel 引发循环依赖与不必要耦合。
|
|
86
|
+
|
|
87
|
+
## 工程化与惯用法补充
|
|
88
|
+
|
|
89
|
+
- 需要同时满足字面量保留与结构校验时优先使用 `satisfies`,再考虑类型断言。
|
|
90
|
+
- 使用判别式联合表达清晰状态;关键分支需要穷尽性时用 `never` 检查。
|
|
91
|
+
- 新业务代码默认采用 ES Module;`namespace` 与三斜线指令仅用于声明合并或遗留互操作场景。
|
|
92
|
+
- 扩展第三方类型时使用独立声明文件并通过局部 `declare module` 扩展,避免污染全局实现文件。
|
|
93
|
+
- `tsconfig`、package exports、声明文件、路径别名和 public API 类型属于 TypeScript 项目规范深水区,不在本规则内展开。
|
|
94
|
+
|
|
95
|
+
## 日志与 `console.log`
|
|
96
|
+
|
|
97
|
+
- 生产路径避免遗留 `console.log`;使用项目统一的日志方案。
|
|
98
|
+
- 调试日志提交前应删除,或按团队工具链通过 lint / hook / CI 提示。
|
|
99
|
+
|
|
100
|
+
## 密钥与敏感配置
|
|
101
|
+
|
|
102
|
+
- **禁止**在源码中硬编码密钥、Token、私钥或真实凭证示例。
|
|
103
|
+
- 必须通过环境变量或构建期注入读取配置,并在缺失时显式失败或提供清晰降级策略。
|
|
104
|
+
- 涉及认证、支付、上传、第三方脚本或敏感数据处理时,结合项目安全规范做专项评审。
|
|
105
|
+
|
|
106
|
+
## 与测试规则的关系
|
|
107
|
+
|
|
108
|
+
类型改动影响 public API、DTO、外部输入收窄或关键业务分支时,应补充 typecheck、类型测试、组件测试或消费方 fixture。关键用户路径的端到端覆盖方式(Playwright、Cypress、Page Object 等)以 `fec-testing.md` 为准;本文件不重复展开 E2E 细则。
|
|
109
|
+
|
|
110
|
+
## 与 `typescript-reviewer` 子代理
|
|
111
|
+
|
|
112
|
+
对 **`.ts` / `.tsx` / `.js` / `.jsx`** 进行专项评审(先跑 typecheck / eslint、PR 合并就绪检查、分级结论)时,可委托插件内置的 **`typescript-reviewer`** 子代理;其报告默认写入 `reports/typescript-review-YYYY-MM-DD-HHmmss.md`,规则底线仍以本文件与项目 `CLAUDE.md` 为准。
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Vue 规则
|
|
2
|
+
|
|
3
|
+
当仓库或目标模块使用 Vue 时,应用本文件。
|
|
4
|
+
|
|
5
|
+
## 技术栈
|
|
6
|
+
|
|
7
|
+
<!-- 请根据项目实际情况修改 -->
|
|
8
|
+
|
|
9
|
+
- 框架: Vue 3 + TypeScript
|
|
10
|
+
- 状态管理: Pinia
|
|
11
|
+
- UI 组件库: 按项目实际选择(如 Element Plus、Naive UI、Vant 或内部 Design System)
|
|
12
|
+
- 版本与依赖:新建模块、补充 `package.json` 或更新本节前,优先采用彼此兼容的主流稳定版本(对齐官方文档、脚手架默认值或包管理器推荐),避免混用已停止维护或与仓库主线 major 不匹配的依赖。
|
|
13
|
+
|
|
14
|
+
## Vue 组件规范
|
|
15
|
+
|
|
16
|
+
- 使用 `<script setup lang="ts">`
|
|
17
|
+
- 明确使用 `defineProps` 和 `defineEmits`
|
|
18
|
+
- 保持模板逻辑简单、可读
|
|
19
|
+
- 将可复用逻辑提取到 composables
|
|
20
|
+
- 优先使用 computed,而不是大范围 watcher
|
|
21
|
+
- 保持组件职责聚焦,避免上帝组件
|
|
22
|
+
- props、emits、refs 和 expose 方法尽量使用强类型
|
|
23
|
+
|
|
24
|
+
## Vue 实现指导
|
|
25
|
+
|
|
26
|
+
创建新组件前:
|
|
27
|
+
|
|
28
|
+
1. 先搜索项目中是否已有可复用组件
|
|
29
|
+
2. 判断逻辑是否适合提取到 composable
|
|
30
|
+
3. 检查样式是否应沿用周边现有模式
|
|
31
|
+
|
|
32
|
+
编辑 Vue 组件时:
|
|
33
|
+
|
|
34
|
+
- 在可能的情况下,不要把 API 调用直接放进纯展示组件
|
|
35
|
+
- 不要在组件文件中内联大段业务逻辑
|
|
36
|
+
- 不要重复维护可从 props 或 store 推导出的状态
|
|
37
|
+
- 事件 payload 要明确且有类型约束
|
|
38
|
+
|
|
39
|
+
## Vue 文件组织
|
|
40
|
+
|
|
41
|
+
优先遵循项目已有约定。
|
|
42
|
+
常见输出可能包括:
|
|
43
|
+
|
|
44
|
+
- `ComponentName.vue`
|
|
45
|
+
- `types.ts`
|
|
46
|
+
- `useXxx.ts`
|
|
47
|
+
- 只有在符合仓库模式时才新增本地样式文件
|
|
48
|
+
|
|
49
|
+
## 组件文件规模
|
|
50
|
+
|
|
51
|
+
- 单个 `.vue` 文件或同一组件模块保持**职责单一**、语义清晰、易于维护。
|
|
52
|
+
- **行数参考**:优先控制在约 **300 行**以内;超过 **500 行**应视为**强烈拆分信号**。
|
|
53
|
+
- **未到 500 行也应拆分**的情形:同时存在**复杂响应式状态**、**过多副作用 / watch**、**模板嵌套过深**、**`<script setup>` 内逻辑过长**、密集条件分支等,应拆为**子组件**、**Composables**、**工具模块**、**常量**与**类型定义**等(与上文「Vue 组件规范」「Vue 文件组织」一致)。
|
|
54
|
+
|
|
55
|
+
## Vue 反模式
|
|
56
|
+
|
|
57
|
+
避免:
|
|
58
|
+
|
|
59
|
+
- 本该使用 computed 却使用大范围 watcher
|
|
60
|
+
- 对 props、emits 或 refs 无理由使用 `any`
|
|
61
|
+
- 模板分支层级过深却不提取
|
|
62
|
+
- 在一个组件中混入无关职责
|
|
63
|
+
- 单 `.vue` **逾 500 行或复杂度已高**仍拒不拆分(参见上文「组件文件规模」)
|
|
64
|
+
- 用大范围全局样式覆盖去解决局部 UI 问题
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 工作模式规则
|
|
2
|
+
|
|
3
|
+
根据任务阶段选择合适的工作模式,避免一边探索一边大改代码。
|
|
4
|
+
|
|
5
|
+
## 调研模式
|
|
6
|
+
|
|
7
|
+
适用于需求不清、现状复杂、需要比较方案或定位风险时。
|
|
8
|
+
|
|
9
|
+
- 先阅读 README、项目规则、相关源码和最近变更。
|
|
10
|
+
- 用 `rg` 查找已有模式、组件、工具函数和测试。
|
|
11
|
+
- 先列发现,再给建议。
|
|
12
|
+
- 在证据不足时不要下确定结论。
|
|
13
|
+
- 涉及版本敏感框架、库或平台行为时,先查项目内事实和官方来源。
|
|
14
|
+
|
|
15
|
+
## 计划模式
|
|
16
|
+
|
|
17
|
+
适用于复杂功能、架构调整、跨文件重构和高风险修复。
|
|
18
|
+
|
|
19
|
+
- 重述目标、成功标准和不做什么。
|
|
20
|
+
- 标出影响范围、文件边界、依赖关系、风险和验证方式。
|
|
21
|
+
- 计划应能分批执行,每批都有可验证结果。
|
|
22
|
+
- 用户未确认前,不执行大范围实现。
|
|
23
|
+
|
|
24
|
+
## 开发模式
|
|
25
|
+
|
|
26
|
+
适用于目标明确且已有计划或范围很小的实现。
|
|
27
|
+
|
|
28
|
+
- 优先复用现有模式。
|
|
29
|
+
- 行为变更优先使用 TDD:先失败测试,再最小实现,再重构。
|
|
30
|
+
- 每次关键修改后运行最近的验证命令。
|
|
31
|
+
- 完成时总结改动、命令和剩余风险。
|
|
32
|
+
- 行为、接口或性能假设必须能被类型、测试、构建、浏览器观察或文档来源支撑。
|
|
33
|
+
|
|
34
|
+
## 评审模式
|
|
35
|
+
|
|
36
|
+
适用于 PR、最近变更、合并前检查和专项审查。
|
|
37
|
+
|
|
38
|
+
- 先通读上下文,再按严重程度列问题。
|
|
39
|
+
- 优先报告会导致 bug、安全风险、回归或维护成本明显上升的问题。
|
|
40
|
+
- 每个问题给出文件位置、影响、建议修复方式和置信度。
|
|
41
|
+
- 无问题时明确说明剩余测试缺口。
|
|
42
|
+
|
|
43
|
+
## 收尾模式
|
|
44
|
+
|
|
45
|
+
适用于提交前或交付前。
|
|
46
|
+
|
|
47
|
+
- 运行 lint、type-check、test、build 中与改动相关的命令。
|
|
48
|
+
- 检查是否有调试代码、临时文件、未同步文档或未说明的风险。
|
|
49
|
+
- 不在未经确认时提交或推送。
|
|
50
|
+
- 不用“应该可以”作为交付依据;交付前报告实际运行过的命令和结果。
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "frontend-craft",
|
|
3
3
|
"name": "Frontend Craft",
|
|
4
4
|
"description": "Frontend team skills, OpenClaw workspace templates, optional init tool, exec safety hooks, and design MCP reference.",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.8.0",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills",
|
|
8
8
|
"commands"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bovinphang/frontend-craft",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Universal frontend plugin for Claude Code, Codex, Cursor, OpenCode, Gemini CLI, Qoder, Windsurf, Copilot, OpenClaw, and more — skills, agents, commands, hooks, and MCP templates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"agents",
|
|
33
33
|
"skills",
|
|
34
34
|
"commands",
|
|
35
|
+
"localized",
|
|
35
36
|
"hooks",
|
|
36
37
|
"templates",
|
|
37
38
|
".mcp.json",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"clean": "node scripts/clean-dist.mjs",
|
|
55
56
|
"typecheck": "npm run typecheck:ts && npm run typecheck:skill-scripts",
|
|
56
57
|
"typecheck:ts": "tsc --noEmit -p tsconfig.json",
|
|
57
|
-
"typecheck:skill-scripts": "tsc --allowJs --checkJs --noEmit --strict --module NodeNext --moduleResolution NodeNext --target ES2022 skills/fec-ui-design/scripts/design-system.mjs skills/fec-image-generation/scripts/png-qa.mjs",
|
|
58
|
+
"typecheck:skill-scripts": "tsc --allowJs --checkJs --noEmit --strict --module NodeNext --moduleResolution NodeNext --target ES2022 skills/fec-ui-design/scripts/design-system.mjs skills/fec-image-generation/scripts/png-qa.mjs skills/fec-image-generation/scripts/tech-diagram-render.mjs skills/fec-image-generation/scripts/interactive-diagram-server.mjs skills/fec-image-generation/scripts/export-diagram.mjs",
|
|
58
59
|
"build": "npm run clean && npm run typecheck && tsx scripts/build-dist.ts",
|
|
59
60
|
"test:only": "node --import tsx --test --test-concurrency=1 tests/converters/codex-agents.test.ts tests/install/cli.test.ts tests/install/end-to-end.test.ts tests/install/update.test.ts tests/install/all-runtimes-dry.test.ts tests/install/metadata-consistency.test.ts tests/install/npm-pack.test.ts tests/install/skill-package.test.ts tests/install/ui-design-intelligence.test.ts tests/install/image-generation-skill.test.ts tests/install/drawio-studio-skill.test.ts tests/install/sync-version.test.ts tests/install/claude-cache.test.ts",
|
|
60
61
|
"test": "npm run build && npm run test:only",
|