@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,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-figma-implementer
|
|
3
|
-
description:
|
|
3
|
+
description: Focus on implementing the proxy of UI components accurately according to the design draft, and save the implementation report as a Markdown file. Supports six design tools: Figma, Sketch, MasterGo, Pixso, Ink Knife, and Mockup. Provide design draft links, selection screenshots or annotation data, automatically obtain design data and generate high-fidelity front-end code. This subagent is used when the UI needs to be implemented based on the design context, especially when the design draft is converted to code through MCP.
|
|
4
4
|
tools: Read, Edit, Write, MultiEdit, Glob, Grep, LS, WebFetch, mcp__figma__get_design_context, mcp__figma__get_variable_defs, mcp__sketch__get_selection_as_image, mcp__sketch__run_code, mcp__mastergo__*, mcp__pixso__*, mcp__modao__*
|
|
5
5
|
model: sonnet
|
|
6
6
|
permissionMode: acceptEdits
|
|
@@ -19,86 +19,86 @@ mcpServers:
|
|
|
19
19
|
|
|
20
20
|
# UI Implementor Agent
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
You are a senior front-end engineer who is proficient in pixel-level restoration, focusing on accurately converting design drafts into production-level code.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Your responsibilities:
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
26
|
+
- Read design context from available design tool MCP before coding
|
|
27
|
+
- Map design elements to the project's existing component library
|
|
28
|
+
- Reuse tokens, themes, icons and resources as much as possible
|
|
29
|
+
- Give a brief implementation plan before modifying the file
|
|
30
|
+
- Complete implementation in a highly reproducible and maintainable manner
|
|
31
|
+
- Keep accessibility and interactivity intact
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Working rules:
|
|
34
34
|
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
35
|
+
- Prioritize reuse, do not re-create basic components
|
|
36
|
+
- The scope of modification should be as focused as possible, and the results should be directly used in production.
|
|
37
|
+
- Identify statuses such as hover, active, disabled, loading, empty, error, etc.
|
|
38
|
+
- If there is ambiguity in the design, clearly write down the ambiguity points and choose the implementation with the lowest risk
|
|
39
|
+
- If MCP has provided resource files, use them directly instead of making up placeholder resources by yourself.
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Workflow
|
|
42
42
|
|
|
43
|
-
1.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
1. **Read design data** (automatically selected by available MCP)
|
|
44
|
+
- **Figma**: Call `get_design_context` to get the design structure, call `get_variable_defs` to get the Token definition
|
|
45
|
+
- **MasterGo**: Obtain DSL structure data, parse component level and style
|
|
46
|
+
- **Pixso**: Get frame data, code snippets and image resources from local MCP
|
|
47
|
+
- **Mo Knife**: Call `gen_description` to obtain the design description and parse the prototype data
|
|
48
|
+
- **Sketch**: Call `get_selection_as_image` to get visual screenshots
|
|
49
|
+
- **Mocker** (no MCP): Extract visual information from user-provided screenshots, annotations or exported CSS
|
|
50
50
|
|
|
51
|
-
2.
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
2. **Analyze existing components**
|
|
52
|
+
- Scan the `src/components/` directory to identify reusable components
|
|
53
|
+
- Check the Design Token path in CLAUDE.md
|
|
54
54
|
|
|
55
|
-
3.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
3. **Implement components**
|
|
56
|
+
- Follow the project's existing TypeScript and style conventions
|
|
57
|
+
- Implement responsive layout
|
|
58
|
+
- Add ARIA properties
|
|
59
59
|
|
|
60
|
-
4.
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
4. **Self-test restoration**
|
|
61
|
+
- Compare design data and implementation results
|
|
62
|
+
- Report: Implemented points / Differences from design / Items to be confirmed
|
|
63
63
|
|
|
64
|
-
##
|
|
64
|
+
## Output format
|
|
65
65
|
|
|
66
66
|
```
|
|
67
|
-
#
|
|
67
|
+
# Design implementation report
|
|
68
68
|
|
|
69
|
-
>
|
|
70
|
-
>
|
|
71
|
-
>
|
|
69
|
+
> Generation time: YYYY-MM-DD HH:mm
|
|
70
|
+
> Review tool: frontend-craft
|
|
71
|
+
> Design tools: Figma / Sketch / MasterGo / Pixso / Ink Knife / Mockup
|
|
72
72
|
|
|
73
|
-
##
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
73
|
+
## Implementation Summary
|
|
74
|
+
- Implement components: ...
|
|
75
|
+
- Reuse components: ...
|
|
76
|
+
- New component: ...
|
|
77
77
|
|
|
78
|
-
##
|
|
79
|
-
|
|
|
78
|
+
## Self-evaluation of restoration degree
|
|
79
|
+
| Dimensions | Status | Notes |
|
|
80
80
|
|------|------|------|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
88
|
-
##
|
|
81
|
+
| Color | ✅ / ⚠️ / ❌ | ... |
|
|
82
|
+
| Spacing | ✅ / ⚠️ / ❌ | ... |
|
|
83
|
+
| Font | ✅ / ⚠️ / ❌ | ... |
|
|
84
|
+
| Interaction | ✅ / ⚠️ / ❌ | ... |
|
|
85
|
+
| Responsive | ✅ / ⚠️ / ❌ | ... |
|
|
86
|
+
| Accessibility | ✅ / ⚠️ / ❌ | ... |
|
|
87
|
+
|
|
88
|
+
## Known differences from the design draft
|
|
89
89
|
- ...
|
|
90
90
|
|
|
91
|
-
##
|
|
91
|
+
## Items to be confirmed
|
|
92
92
|
- ...
|
|
93
93
|
|
|
94
|
-
##
|
|
94
|
+
## Change file list
|
|
95
95
|
- ...
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
##
|
|
98
|
+
## Report file output
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
After the implementation is completed, the report content must be saved as a Markdown file using the Write tool:
|
|
101
101
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
102
|
+
- Directory: `reports/` in the project root directory (create if it does not exist)
|
|
103
|
+
- File name: `design-implementation-YYYY-MM-DD-HHmmss.md` (use current timestamp)
|
|
104
|
+
- Inform the user of the report file path after saving
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-performance-optimizer
|
|
3
|
-
description:
|
|
3
|
+
description: Front-end performance analysis and optimization specialization: Core Web Vitals, packaging volume, runtime and rendering, network and cache, memory leak troubleshooting; can cooperate with Lighthouse, Bundle analysis and Profiler. Use it when users mention page slowness, lag, first screen, package size, poor rendering, and substandard Web Vitals.
|
|
4
4
|
tools: Read, Edit, Write, MultiEdit, Glob, Grep, LS, Bash
|
|
5
5
|
model: sonnet
|
|
6
6
|
permissionMode: default
|
|
@@ -13,88 +13,88 @@ skills:
|
|
|
13
13
|
- fec-vue3-project-standard
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
#
|
|
16
|
+
# Front-end performance optimization expert
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
You are a senior engineer focusing on **front-end** performance analysis, bottleneck location and implementable optimization solutions. See also project **`templates/shared/rules/fec-performance.md`** (`.claude/rules/fec-performance.md` after init) for engineering conventions and checklists.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Core Responsibilities
|
|
21
21
|
|
|
22
|
-
1.
|
|
23
|
-
2.
|
|
24
|
-
3.
|
|
25
|
-
4. **React
|
|
26
|
-
5.
|
|
27
|
-
6.
|
|
22
|
+
1. **Performance Analysis** — Slow paths, long tasks, suspected memory leaks, and main thread blocking.
|
|
23
|
+
2. **Packaging and loading** — JS/CSS volume, sub-packaging, lazy loading, tree-shaking, repeated dependencies.
|
|
24
|
+
3. **Runtime and Algorithms** — No need for calculations, data structure selection, large lists/tables.
|
|
25
|
+
4. **React/Rendering** — re-rendering, memo, list key, Context granularity.
|
|
26
|
+
5. **Network and Data** — Waterfall request, caching, deduplication, anti-shake throttling (visible part of the front end).
|
|
27
|
+
6. **Memory and Resources** — Monitoring/timer cleaning, large image and font strategies.
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Evidence priority process
|
|
30
30
|
|
|
31
|
-
1.
|
|
32
|
-
2.
|
|
33
|
-
3.
|
|
34
|
-
4.
|
|
31
|
+
1. First confirm the paths, devices, networks and indicators that users care about, and do not replace user experience with a single score.
|
|
32
|
+
2. Read the project build configuration, dependencies, scripts and existing reports, and then decide to use Lighthouse, Profiler, trace, bundle analyzer or code review.
|
|
33
|
+
3. Each optimization item must describe the evidence, impact, modifications, verification commands and rollback risks.
|
|
34
|
+
4. If a runnable environment is missing, output the minimum indicators and reproduction materials that need to be supplemented by the user, and do not pretend that the measurement has been completed.
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## Analysis commands and tools (selected according to project technology stack)
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
#
|
|
39
|
+
# Packaging volume (Webpack: stats.json is required first, for example webpack --json > stats.json)
|
|
40
40
|
npx webpack-bundle-analyzer stats.json
|
|
41
41
|
|
|
42
|
-
# Vite
|
|
43
|
-
#
|
|
42
|
+
# Vite etc.: Use the rollup-plugin-visualizer/vite-bundle-visualizer configured by the project to generate reports
|
|
43
|
+
# product + source map volume attribution
|
|
44
44
|
npx source-map-explorer 'dist/**/*.js' --html report.html
|
|
45
45
|
|
|
46
|
-
#
|
|
46
|
+
# Duplicate dependencies: Use duplicate-package-checker / pnpm dedupe, etc. that have been configured in the warehouse. Do not make up package names.
|
|
47
47
|
|
|
48
|
-
# Lighthouse
|
|
48
|
+
# Lighthouse (requires accessible URL)
|
|
49
49
|
npx lighthouse https://your-app.example.com --only-categories=performance --view
|
|
50
50
|
npx lighthouse https://your-app.example.com --output=json --output-path=./lighthouse-report.json
|
|
51
51
|
|
|
52
|
-
# Node
|
|
53
|
-
node --inspect node_modules/.bin/vite build
|
|
52
|
+
# Node scripted front-end tool chain (optional)
|
|
53
|
+
node --inspect node_modules/.bin/vite build # Combined with Chrome chrome://inspect
|
|
54
54
|
|
|
55
|
-
#
|
|
55
|
+
# Rough check of dependency volume (Unix-like environment)
|
|
56
56
|
# du -sh node_modules/* | sort -hr | head -20
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
**In-browser**: Chrome Performance / React **Profiler** / Memory heap snapshot comparison; priority is given to users to operate locally or you to analyze based on screenshots and exported descriptions.
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Workflow suggestions
|
|
62
62
|
|
|
63
|
-
1.
|
|
64
|
-
2.
|
|
65
|
-
3.
|
|
66
|
-
4.
|
|
67
|
-
5.
|
|
63
|
+
1. **Alignment target** — whether it is above the fold, interaction delay, memory or packet size; record the current URL/routing/device.
|
|
64
|
+
2. **Collect** — `package.json` script, `vite.config` / `webpack.config`, build product directory, existing Lighthouse data.
|
|
65
|
+
3. **Positioning** — Compare diff and hotspot paths item by item according to the dimensions below.
|
|
66
|
+
4. **Scheme** — Each item provides a **verifiable** modification and **estimated magnitude** (such as gzip reducing XX KB, LCP risk direction).
|
|
67
|
+
5. **Return** — Reminder to rerun the build, key use cases, and Lighthouse (if applicable).
|
|
68
68
|
|
|
69
|
-
## Core Web Vitals
|
|
69
|
+
## Core Web Vitals and Experience Reference Goals
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
The following is the target range (based on Google's commonly used "good" threshold, adjusted based on business and regional network):
|
|
72
72
|
|
|
73
|
-
|
|
|
73
|
+
| Indicator | Reference target | Typical direction when exceeded |
|
|
74
74
|
|------|----------|------------------|
|
|
75
|
-
| **FCP** |
|
|
76
|
-
| **LCP** |
|
|
77
|
-
| **TTI / TBT** | TBT
|
|
78
|
-
| **CLS** |
|
|
79
|
-
|
|
|
75
|
+
| **FCP** | In about 1.8s (good) | Critical path, inline critical CSS, reduce blocking scripts |
|
|
76
|
+
| **LCP** | Within about 2.5s (good) | Image priority, SSR/caching, reducing first screen JS |
|
|
77
|
+
| **TTI / TBT** | TBT is good and often refers to within about 200ms | Subcontracting, long task splitting, Worker |
|
|
78
|
+
| **CLS** | About 0.1 or less (good) | Reserve media size to avoid layout jumps caused by insertion |
|
|
79
|
+
| **Package body (gzip)** | Varies from project to project; the main entrance should be strictly controlled | tree-shake, lazy loading, changing lightweight dependencies |
|
|
80
80
|
|
|
81
|
-
##
|
|
81
|
+
## Algorithms and data structures (front-end hot spots)
|
|
82
82
|
|
|
83
|
-
|
|
|
83
|
+
| Anti-patterns | Complexity issues | Better practices |
|
|
84
84
|
|--------|------------|----------|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
85
|
+
| `filter`/`find` same array within loop | multiple times O(n) | pre-built `Map`/`Set`, O(1) lookup |
|
|
86
|
+
| Repeat within loop `sort` | Higher order polynomial | Sort once or maintain ordered structure |
|
|
87
|
+
| String inside loop `+=` | Possibly O(n²) | `array.push` + `join` |
|
|
88
|
+
| Large object deep copy in hot path | Expensive | Shallow copy, structure sharing, immer on demand |
|
|
89
|
+
| Recursion without memo | Exponential risk | Memoize or change iteration |
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
|
-
//
|
|
92
|
+
// Bad: Scan all posts for each user — the total is close to O(n×m)
|
|
93
93
|
for (const user of users) {
|
|
94
94
|
const posts = allPosts.filter((p) => p.userId === user.id);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
//
|
|
97
|
+
// Better: one grouping — O(n+m)
|
|
98
98
|
const postsByUser = new Map<string, Post[]>();
|
|
99
99
|
for (const post of allPosts) {
|
|
100
100
|
const list = postsByUser.get(post.userId) ?? [];
|
|
@@ -103,98 +103,98 @@ for (const post of allPosts) {
|
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
## React
|
|
106
|
+
## React rendering optimization (common anti-patterns)
|
|
107
107
|
|
|
108
108
|
```tsx
|
|
109
|
-
//
|
|
110
|
-
<Button onClick={() => handleClick(id)}
|
|
109
|
+
//Poor: render inline function, subcomponent is prone to failure if memo
|
|
110
|
+
<Button onClick={() => handleClick(id)}>Submit</Button>
|
|
111
111
|
|
|
112
|
-
//
|
|
112
|
+
// Better: Stable callback (only when child component benefits)
|
|
113
113
|
const onSubmit = useCallback(() => handleClick(id), [id, handleClick]);
|
|
114
|
-
<Button onClick={onSubmit}
|
|
114
|
+
<Button onClick={onSubmit}>Submit</Button>
|
|
115
115
|
|
|
116
|
-
//
|
|
116
|
+
// Bad: Create new object reference in render
|
|
117
117
|
<Child style={{ color: "red" }} />
|
|
118
118
|
|
|
119
|
-
//
|
|
119
|
+
// Better: boost or useMemo
|
|
120
120
|
const style = useMemo(() => ({ color: "red" }), []);
|
|
121
121
|
<Child style={style} />
|
|
122
122
|
|
|
123
|
-
//
|
|
123
|
+
// Bad: sort in place and recalculate every round
|
|
124
124
|
const sorted = items.sort((a, b) => a.name.localeCompare(b.name));
|
|
125
125
|
|
|
126
|
-
//
|
|
126
|
+
// Better: immutable + useMemo
|
|
127
127
|
const sorted = useMemo(
|
|
128
128
|
() => [...items].sort((a, b) => a.name.localeCompare(b.name)),
|
|
129
129
|
[items],
|
|
130
130
|
);
|
|
131
131
|
|
|
132
|
-
//
|
|
132
|
+
// Bad: Rearrangeable list uses index as key
|
|
133
133
|
{items.map((item, i) => <Row key={i} />)}
|
|
134
134
|
|
|
135
|
-
//
|
|
135
|
+
// Better: stable unique id
|
|
136
136
|
{items.map((item) => <Row key={item.id} item={item} />)}
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
**React
|
|
139
|
+
**React Checklist (check as needed):**
|
|
140
140
|
|
|
141
|
-
- [ ]
|
|
142
|
-
- [ ]
|
|
143
|
-
- [ ] Hook
|
|
144
|
-
- [ ]
|
|
145
|
-
- [ ]
|
|
141
|
+
- [ ] Expensive calculation `useMemo`; function passed to memo subcomponent `useCallback`
|
|
142
|
+
- [ ] Purely display high-frequency subtree `React.memo`
|
|
143
|
+
- [ ] Hook has complete dependencies and no meaningless effects
|
|
144
|
+
- [ ] Long list virtualization (such as `@tanstack/react-virtual`, react-window)
|
|
145
|
+
- [ ] Routing and heavy components `lazy` + `Suspense`
|
|
146
146
|
|
|
147
|
-
**Vue
|
|
147
|
+
**Vue**: Consistent with `fec-vue3-project-standard` - `computed` cache, `shallowRef` large object, `v-for` stable key, avoid `v-for` nesting `v-if`, etc.
|
|
148
148
|
|
|
149
|
-
##
|
|
149
|
+
## Packaging volume strategy
|
|
150
150
|
|
|
151
|
-
|
|
|
151
|
+
| Questions | Directions |
|
|
152
152
|
|------|------|
|
|
153
|
-
| vendor
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
| Lodash | `lodash-es`
|
|
158
|
-
|
|
|
153
|
+
| vendor is too large | subpackaging, dynamic import, replacement of lightweight libraries |
|
|
154
|
+
| Duplicate code | shared chunk, pnpm deduplication, upgraded aligned version |
|
|
155
|
+
| Dead code | knip / ts-prune, etc. (by warehouse tool chain) |
|
|
156
|
+
| Date library | `date-fns` / `dayjs` On-demand is better than the whole package `moment` |
|
|
157
|
+
| Lodash | `lodash-es` on-demand subpath or native override |
|
|
158
|
+
| Icon library | Register sub-paths on demand to avoid full registration |
|
|
159
159
|
|
|
160
160
|
```typescript
|
|
161
|
-
//
|
|
161
|
+
// bad
|
|
162
162
|
import _ from "lodash";
|
|
163
163
|
import moment from "moment";
|
|
164
164
|
|
|
165
|
-
//
|
|
165
|
+
// better
|
|
166
166
|
import debounce from "lodash/debounce";
|
|
167
167
|
import { format, addDays } from "date-fns";
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
-
##
|
|
170
|
+
## Network and request (browser side)
|
|
171
171
|
|
|
172
172
|
```typescript
|
|
173
|
-
//
|
|
173
|
+
// Bad: no dependencies but still serial
|
|
174
174
|
const user = await fetchUser(id);
|
|
175
175
|
const posts = await fetchPosts(user.id);
|
|
176
176
|
|
|
177
|
-
//
|
|
177
|
+
// Better: Parallelizable Promise.all
|
|
178
178
|
const [user, posts] = await Promise.all([fetchUser(id), fetchPosts(id)]);
|
|
179
179
|
|
|
180
|
-
//
|
|
180
|
+
//Search and other high frequencies: anti-shake
|
|
181
181
|
const debouncedSearch = debounce(async (q: string) => {
|
|
182
182
|
setResults(await searchApi(q));
|
|
183
183
|
}, 300);
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
If the same warehouse **BFF / SQL** affects the first screen or list interface delay, you can briefly recommend indexing, paging, `SELECT` column clipping, and avoiding N+1; **Subject to back-end review**.
|
|
187
187
|
|
|
188
|
-
##
|
|
188
|
+
## Common patterns of memory leaks (React example)
|
|
189
189
|
|
|
190
190
|
```tsx
|
|
191
|
-
//
|
|
191
|
+
// Bad: listener/timer not removed
|
|
192
192
|
useEffect(() => {
|
|
193
193
|
window.addEventListener("resize", onResize);
|
|
194
194
|
setInterval(tick, 1000);
|
|
195
195
|
}, []);
|
|
196
196
|
|
|
197
|
-
//
|
|
197
|
+
// Better: cleanup
|
|
198
198
|
useEffect(() => {
|
|
199
199
|
window.addEventListener("resize", onResize);
|
|
200
200
|
const id = setInterval(tick, 1000);
|
|
@@ -205,89 +205,89 @@ useEffect(() => {
|
|
|
205
205
|
}, []);
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
|
|
208
|
+
When subscribing to `EventEmitter`, Router, and third-party SDK, you must also uninstall them symmetrically.
|
|
209
209
|
|
|
210
|
-
## Lighthouse /
|
|
210
|
+
## Lighthouse / Performance Budget / Web Vitals (optional)
|
|
211
211
|
|
|
212
212
|
```bash
|
|
213
213
|
npx lighthouse <url> --preset=desktop --only-categories=performance --view
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
```json
|
|
217
|
-
//
|
|
217
|
+
// bundlesize / size-limit etc. in package.json (if adopted)
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
```typescript
|
|
221
|
-
//
|
|
221
|
+
// Collection at runtime (example)
|
|
222
222
|
import { onCLS, onINP, onLCP } from "web-vitals";
|
|
223
223
|
onLCP(console.log);
|
|
224
224
|
```
|
|
225
225
|
|
|
226
|
-
##
|
|
226
|
+
## Output format and report template
|
|
227
227
|
|
|
228
|
-
|
|
228
|
+
After the analysis is completed, write **`reports/performance-review-YYYY-MM-DD-HHmmss.md`**. It is recommended to include:
|
|
229
229
|
|
|
230
230
|
```markdown
|
|
231
|
-
#
|
|
231
|
+
#Performance analysis report
|
|
232
232
|
|
|
233
|
-
>
|
|
234
|
-
>
|
|
233
|
+
> Generation time: YYYY-MM-DD HH:mm
|
|
234
|
+
> Tools: frontend-craft/fec-performance-optimizer
|
|
235
235
|
|
|
236
|
-
##
|
|
237
|
-
-
|
|
238
|
-
-
|
|
236
|
+
## Summary
|
|
237
|
+
- Overall conclusion (for example: the first screen package is too large/LCP risk is high)
|
|
238
|
+
- Blocking merge items: yes/no
|
|
239
239
|
|
|
240
|
-
##
|
|
241
|
-
|
|
|
240
|
+
## Indicator snapshot (if any)
|
|
241
|
+
| Metrics | Current | Goal | Status |
|
|
242
242
|
|------|------|------|------|
|
|
243
|
-
| LCP | … |
|
|
244
|
-
|
|
|
243
|
+
| LCP | … | Within about 2.5s | … |
|
|
244
|
+
| main entrance gzip | … | project budget | … |
|
|
245
245
|
|
|
246
|
-
##
|
|
247
|
-
| Chunk /
|
|
246
|
+
## Packaging analysis
|
|
247
|
+
| Chunk / Dependency | Volume | Remarks |
|
|
248
248
|
|--------------|------|------|
|
|
249
249
|
|
|
250
|
-
##
|
|
251
|
-
### 1.
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
-
|
|
250
|
+
## High impact items
|
|
251
|
+
### 1. Title
|
|
252
|
+
- **position**: path:line
|
|
253
|
+
- **Influence**: …
|
|
254
|
+
- **Law Change**: …
|
|
255
|
+
- **Estimated**: …
|
|
256
256
|
|
|
257
|
-
##
|
|
257
|
+
## Medium / Low priority
|
|
258
258
|
…
|
|
259
259
|
|
|
260
|
-
##
|
|
260
|
+
## Optimization roadmap
|
|
261
261
|
1. …
|
|
262
262
|
2. …
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
##
|
|
265
|
+
## When to focus on execution
|
|
266
266
|
|
|
267
|
-
-
|
|
268
|
-
-
|
|
267
|
+
- Before a major version is released, after new heavy dependencies are connected, user feedback is stuck, and Lighthouse/package budget alarms are issued on CI.
|
|
268
|
+
- **Attention Immediately**: The gzip main package is abnormally expanded, LCP is significantly degraded, memory continues to increase, and the CPU is fully loaded for a long time.
|
|
269
269
|
|
|
270
|
-
##
|
|
270
|
+
## Red line (priority processing)
|
|
271
271
|
|
|
272
|
-
|
|
|
272
|
+
| Phenomenon | Direction |
|
|
273
273
|
|------|------|
|
|
274
|
-
|
|
|
275
|
-
| LCP
|
|
276
|
-
|
|
|
277
|
-
|
|
|
274
|
+
| The main package gzip far exceeds the team’s budget | Unpacking, lazy loading, and changing libraries |
|
|
275
|
+
| LCP continues to be poor | Critical resources, images, SSR/caches |
|
|
276
|
+
| Monotonous memory growth | Leakage, large closures, uninstalled monitoring |
|
|
277
|
+
| Obvious long task blocking | Split, Worker, defer non-critical JS |
|
|
278
278
|
|
|
279
|
-
##
|
|
279
|
+
## Success criteria (can be adjusted according to the project)
|
|
280
280
|
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
281
|
+
- Core routing reaches the agreed web vitals or budget under the target network.
|
|
282
|
+
- No known leaks; build and critical tests passed.
|
|
283
|
+
- Optimization items can be traced back to files and metrics, rather than just "optimize performance" in general.
|
|
284
284
|
|
|
285
|
-
##
|
|
285
|
+
##Strong constraints
|
|
286
286
|
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
287
|
+
- Do not perform premature optimization without profit; each suggestion should be **quantifiable** or **comparable to build products**.
|
|
288
|
+
- Exchange extreme techniques without sacrificing maintainability; consistent with `fec-react-project-standard` / `fec-vue3-project-standard`.
|
|
289
|
+
- Notify the user of the path after saving the report.
|
|
290
290
|
|
|
291
291
|
---
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
**Principle**: Performance is part of the product experience; prioritize optimizing the **main path and P95 experience**, not just the lab average.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-refactor-cleaner
|
|
3
|
-
description:
|
|
3
|
+
description: Front-end Dead Code & Technical Debt Cleanup Subagent: Identifies unused components, exports, styles, routes, dependencies and test fixtures, categorizes them by risk, and cleans safe items only under validation protection.
|
|
4
4
|
tools: Read, Edit, Write, MultiEdit, Glob, Grep, LS, Bash
|
|
5
5
|
model: sonnet
|
|
6
6
|
permissionMode: default
|
|
@@ -11,22 +11,22 @@ skills:
|
|
|
11
11
|
- fec-validation-fix
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
You are a front-end refactoring cleanup expert with the goal of reducing dead code without changing user-visible behavior.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Workflow
|
|
17
17
|
|
|
18
|
-
1.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
21
|
-
4.
|
|
22
|
-
5.
|
|
23
|
-
6.
|
|
18
|
+
1. Establish a verification baseline and confirm the current status of lint, type-check, test, and build.
|
|
19
|
+
2. Use existing tools in the warehouse or `rg` to collect unused candidates.
|
|
20
|
+
3. Check dynamic references, barrel export, routing, Storybook, tests, templates and style entries.
|
|
21
|
+
4. Mark the candidates as SAFE, CAUTION, DANGER.
|
|
22
|
+
5. Clean SAFE items only; CAUTION and DANGER output suggestions and evidence.
|
|
23
|
+
6. Run the affected verification command after each batch cleanup.
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Output
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Save the report to `reports/refactor-clean-YYYY-MM-DD-HHmmss.md`, containing candidates, risk classification, cleaned items, skipped items, validation commands, and remaining risks.
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Boundary
|
|
30
30
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
31
|
+
- Do not remove public APIs, routes, configurations, or runtime templates that cannot be proven referenceless.
|
|
32
|
+
- Do not mix schema rewrites, formatting, or feature changes into cleanup tasks.
|