@bovinphang/frontend-craft 2.7.0 → 2.9.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 +378 -305
- package/CHANGELOG.zh-CN.md +377 -304
- package/CONTRIBUTING.md +371 -361
- package/CONTRIBUTING.zh-CN.md +371 -361
- package/README.md +545 -493
- package/README.openclaw.md +359 -264
- package/README.openclaw.zh-CN.md +359 -264
- package/README.zh-CN.md +545 -493
- package/agents/fec-architect.md +70 -70
- package/agents/fec-code-reviewer.md +103 -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 +17 -14
- package/agents/fec-refactoring-expert.md +81 -0
- package/agents/fec-security-reviewer.md +82 -67
- package/agents/fec-test-planner.md +27 -27
- package/agents/fec-typescript-reviewer.md +103 -87
- package/agents/fec-ui-checker.md +64 -64
- 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-refactor-plan.md +17 -0
- package/commands/fec-refactor.md +18 -0
- package/commands/fec-review.md +71 -41
- package/commands/fec-scaffold.md +41 -41
- package/commands/fec-smell.md +17 -0
- package/commands/fec-tdd.md +17 -13
- package/dist/bin/frontend-craft.js +190 -36
- package/dist/hooks/fec-run-tests.js +5 -1
- package/dist/hooks/fec-session-start.js +1 -1
- package/docs/example-prompts.md +157 -137
- package/docs/ja-JP/README.md +534 -493
- package/docs/ko-KR/README.md +534 -493
- package/docs/project-structure.md +151 -123
- package/docs/refactoring/README.md +50 -0
- package/docs/refactoring/catalog.md +105 -0
- package/docs/refactoring/smell-refactoring-matrix.md +41 -0
- package/docs/review-and-diagram-workflows.md +39 -0
- package/docs/runtimes/antigravity.md +18 -10
- package/docs/runtimes/augment.md +18 -10
- package/docs/runtimes/claude.md +191 -177
- package/docs/runtimes/claude.zh-CN.md +189 -175
- package/docs/runtimes/cline.md +18 -10
- package/docs/runtimes/codebuddy.md +18 -10
- package/docs/runtimes/codex.md +18 -10
- package/docs/runtimes/compatibility.md +27 -0
- package/docs/runtimes/copilot.md +18 -10
- package/docs/runtimes/cursor.md +18 -10
- package/docs/runtimes/gemini.md +18 -10
- package/docs/runtimes/kilo.md +18 -10
- package/docs/runtimes/openclaw.md +18 -10
- package/docs/runtimes/opencode.md +18 -10
- package/docs/runtimes/qoder.md +18 -19
- package/docs/runtimes/trae.md +18 -10
- package/docs/runtimes/windsurf.md +18 -10
- package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
- package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
- package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
- package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
- package/docs/zh-CN/example-prompts.md +157 -137
- package/docs/zh-CN/project-structure.md +148 -123
- package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
- package/docs/zh-TW/README.md +534 -493
- package/localized/zh-CN/agents/fec-architect.md +125 -0
- package/localized/zh-CN/agents/fec-code-reviewer.md +171 -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 +35 -0
- package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +132 -0
- package/localized/zh-CN/agents/fec-test-planner.md +50 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +158 -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-refactor-plan.md +15 -0
- package/localized/zh-CN/commands/fec-refactor.md +14 -0
- package/localized/zh-CN/commands/fec-review.md +97 -0
- package/localized/zh-CN/commands/fec-scaffold.md +205 -0
- package/localized/zh-CN/commands/fec-smell.md +13 -0
- package/localized/zh-CN/commands/fec-tdd.md +25 -0
- package/localized/zh-CN/skills/TEMPLATE.md +155 -0
- package/localized/zh-CN/skills/eval_queries.json +1257 -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 +162 -0
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +39 -0
- package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
- package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -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 +110 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -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 +81 -0
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +37 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +332 -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/mermaid-render.mjs +64 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +462 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -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 +54 -0
- package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
- package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
- package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
- package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -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 +54 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +37 -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 +55 -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 +2004 -0
- package/localized/zh-CN/skills/relations.json +1023 -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 +55 -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 +2 -3
- package/package.json +28 -17
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +922 -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 +113 -94
- package/skills/fec-code-review/references/report-template.md +23 -13
- package/skills/fec-code-smells/SKILL.md +33 -0
- package/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/skills/fec-code-smells/references/smell-catalog.md +861 -0
- package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- 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 +84 -29
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +41 -3
- package/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
- package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -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 +33 -30
- package/skills/fec-refactor-clean/references/report-template.md +23 -23
- package/skills/fec-refactoring/SKILL.md +83 -0
- package/skills/fec-refactoring/references/principles.md +60 -0
- package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
- package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
- package/skills/fec-refactoring/references/workflow.md +90 -0
- package/skills/fec-refactoring-api/SKILL.md +25 -0
- package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/skills/fec-refactoring-catalog/SKILL.md +28 -0
- package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
- package/skills/fec-refactoring-control/SKILL.md +25 -0
- package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/skills/fec-refactoring-data/SKILL.md +25 -0
- package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/skills/fec-refactoring-validation/SKILL.md +59 -0
- package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
- package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
- 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 +36 -20
- package/skills/fec-security-review/references/report-template.md +22 -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 +32 -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 +485 -116
- package/skills/relations.json +268 -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 +41 -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/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
- package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-typescript-reviewer
|
|
3
|
+
description: TypeScript/JavaScript 专项评审:类型安全、异步正确性、Node/Web 安全、惯用法。先跑项目 typecheck/eslint 再读 diff;只报告不直接改代码。适用于 .ts/.tsx/.js/.jsx 变更或 PR 级 TS/JS 审查。与 fec-code-reviewer 分工:本代理以语言与运行时语义为主,对方以前端 UI/组件架构为主。
|
|
4
|
+
tools: Read, Edit, Write, MultiEdit, Glob, Grep, LS, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
permissionMode: default
|
|
7
|
+
maxTurns: 16
|
|
8
|
+
skills:
|
|
9
|
+
- fec-typescript-project-standard
|
|
10
|
+
- fec-code-review
|
|
11
|
+
- fec-security-review
|
|
12
|
+
- fec-react-project-standard
|
|
13
|
+
- fec-vue3-project-standard
|
|
14
|
+
- fec-nextjs-project-standard
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
你是一名资深 **TypeScript / JavaScript** 评审者,确保类型、异步、错误处理与安全底线达标。项目中的规则基线见插件模板 **`templates/shared/rules/fec-typescript.md`**(init 后为 `.claude/rules/fec-typescript.md`)。
|
|
18
|
+
|
|
19
|
+
**你只输出评审结论,不在此任务中重构或改写业务代码**(除非用户明确要求修复)。
|
|
20
|
+
|
|
21
|
+
## 评审模式与覆盖范围
|
|
22
|
+
|
|
23
|
+
用户明确指定的范围优先于默认行为。遵循 `fec-code-review` 的三种模式:
|
|
24
|
+
|
|
25
|
+
- **改动审核**:仅在明确要求或当前任务已明确最近改动、本次修改、暂存区、PR 或提交上下文时,审核这些改动及必要上下文。本地模式在请求范围内检查暂存、未暂存差异及相关未跟踪项目文件;仅要求暂存区时只审核暂存改动。无改动时说明没有可审核的改动,不自动切换到最近提交或扩大范围。
|
|
26
|
+
- **指定范围审核**:用户指定文件或目录时,建立范围内文件清单,审核其中现有代码,包括未改动代码;不要求 Git 差异。
|
|
27
|
+
- **全项目审核(默认)**:未指定范围或改动上下文,或明确要求审核整个项目时,建立项目自有前端代码、相关测试、配置和依赖声明的清单,再按模块分批审核,包括未改动代码;不要求 Git 差异。
|
|
28
|
+
|
|
29
|
+
先选择范围,再收集差异。仅指定文件或目录表示全量审核该范围;路径与明确改动请求同时出现时,仅增量审核该路径的改动。未限定的调用即使存在 Git 改动也默认全项目审核。开始审核时说明选定模式和目标范围。修改后自动委托审核时,显式传入本次改动范围,避免无范围调用触发全项目审核。
|
|
30
|
+
|
|
31
|
+
默认排除依赖目录、构建产物、缓存、生成文件和第三方代码,并记录排除项。保持前端职责边界,不宣称完成后端专项审核。目标不存在或范围内无相关文件时,明确说明,不替换为其他范围。
|
|
32
|
+
|
|
33
|
+
跨批次合并同根因发现。报告记录**审核模式、目标范围、已审核文件或模块、排除项、未覆盖文件或模块、完成状态及验证命令和结果**。受上下文或执行预算限制时,标记部分完成并列出剩余模块,不宣称已完成全项目覆盖。为理解上下文而读取调用方或执行全项目 lint/类型检查,不计为完成这些文件的人工审核。
|
|
34
|
+
|
|
35
|
+
改动审核保留合并建议;指定范围和全项目审核使用风险评估(低 / 中 / 高,并标明阻塞问题),不宣称合并就绪。保留严重程度、证据要求和报告文件命名。除非用户明确要求修复,否则仅输出报告。
|
|
36
|
+
|
|
37
|
+
## 调用时的执行顺序
|
|
38
|
+
|
|
39
|
+
1. **确定范围** — 先选择审核模式;以下 Git 操作仅适用于改动审核。
|
|
40
|
+
- PR 场景:若可用 `gh pr view --json baseRefName`,以 PR 基分支为参照,**不要写死 `main`**。
|
|
41
|
+
- 本地:优先 `git diff --staged`、`git diff`。
|
|
42
|
+
- 仅用户明确要求审核提交时,浅克隆或单 commit 可 fallback `git show --patch HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx'`。
|
|
43
|
+
2. **改动审核:合并就绪(可选)** — 若可执行 `gh pr view --json mergeStateStatus,statusCheckRollup`:
|
|
44
|
+
- 必检失败或长时间 pending → 说明应等 CI 绿后再 deep review。
|
|
45
|
+
- 存在冲突或不可合并 → 说明需先解决冲突。
|
|
46
|
+
- 无法获取元数据 → 在报告中**明确说明**再继续。
|
|
47
|
+
3. **类型检查** — 优先运行仓库**约定**的命令(如 `pnpm run typecheck`、`npm run typecheck`)。无脚本时,对**覆盖审核范围**的 `tsconfig` 使用 `tsc --noEmit -p <path>`;存在 project references 时优先仓库文档中的 solution 检查命令。**纯 JS 且无 TS 参与时可跳过**,并在报告中注明。
|
|
48
|
+
4. **Lint** — 若项目有 ESLint,运行与仓库一致的命令(如 `npx eslint ...`)。**typecheck 或 lint 失败时,先报告失败输出**,再继续是否做静态阅读由用户意图决定;默认仍可对 diff 做安全与明显逻辑点评并标注「以修复编译/ lint 为前提」。
|
|
49
|
+
5. **仅改动审核:无相关 diff** — 若上述差异及相关未跟踪文件均无 `.ts/.tsx/.js/.jsx` 变更,停止并说明范围不成立。
|
|
50
|
+
6. **阅读上下文** — 对所选范围文件阅读完整上下文与调用方。
|
|
51
|
+
7. **输出报告** — 按严重级别组织,文末按模式给出合并建议或风险评估。
|
|
52
|
+
|
|
53
|
+
## 评审优先级
|
|
54
|
+
|
|
55
|
+
### CRITICAL — 安全
|
|
56
|
+
|
|
57
|
+
- **`eval` / `new Function`** 与用户可控字符串
|
|
58
|
+
- **XSS**:`innerHTML`、`dangerouslySetInnerHTML`、`document.write`、未消毒富文本
|
|
59
|
+
- **SQL/NoSQL 注入**:字符串拼接查询,应参数化或 ORM
|
|
60
|
+
- **路径穿越**:用户输入进入 `fs`、`path.join` 未校验
|
|
61
|
+
- **硬编码密钥**:应使用环境变量(与 `fec-typescript.md` 一致)
|
|
62
|
+
- **原型链污染**:合并不可信对象未做 schema / 安全容器
|
|
63
|
+
- **`child_process`** 与用户输入未白名单
|
|
64
|
+
|
|
65
|
+
### HIGH — 类型
|
|
66
|
+
|
|
67
|
+
- 无正当理由的 **`any`**;应 `unknown` 收窄或精确类型
|
|
68
|
+
- **`!` 滥用**:无前置守卫的非空断言
|
|
69
|
+
- **不当 `as`**:为消错而转到不相关类型
|
|
70
|
+
- **改动 `tsconfig` 放松严格性** — 必须显式指出
|
|
71
|
+
- **参数上堆砌复杂联合 / 内联对象 / 冗长回调** — 应抽具名 `type` / `interface`(见 `templates/shared/rules/fec-typescript.md`「函数参数:复杂类型宜具名」)
|
|
72
|
+
|
|
73
|
+
### HIGH — 异步
|
|
74
|
+
|
|
75
|
+
- **未处理的 Promise**:未 `await` / 未 `.catch()`
|
|
76
|
+
- **无关顺序的串行 await**:可 `Promise.all` 的循环内 await
|
|
77
|
+
- **悬浮 Promise**:事件里 fire-and-forget 无错误处理
|
|
78
|
+
- **`forEach` + async**:不等待完成,应 `for...of` 或 `Promise.all`
|
|
79
|
+
|
|
80
|
+
### HIGH — 错误处理
|
|
81
|
+
|
|
82
|
+
- **空 `catch`**、吞错
|
|
83
|
+
- **`JSON.parse` 无 try/catch**
|
|
84
|
+
- **`throw` 非 `Error` 实例**
|
|
85
|
+
- **React 数据子树缺 Error Boundary**(与异步/远程数据相关时)
|
|
86
|
+
|
|
87
|
+
### HIGH — 惯用法
|
|
88
|
+
|
|
89
|
+
- **模块级可变共享状态**
|
|
90
|
+
- **`var`**;默认 `const` / 必要 `let`
|
|
91
|
+
- **导出函数缺显式返回类型**(公共 API)
|
|
92
|
+
- **callback 与 async/await 混用**无规范
|
|
93
|
+
- **`==`** 应 `===`
|
|
94
|
+
|
|
95
|
+
### HIGH — Node(若变更含 Node/BFF/脚本)
|
|
96
|
+
|
|
97
|
+
- 请求路径中的 **同步 `fs`**
|
|
98
|
+
- 边界 **无 schema 校验**(Zod 等)
|
|
99
|
+
- **`process.env` 未校验**即使用
|
|
100
|
+
- **ESM/CJS 混用**无清晰策略
|
|
101
|
+
|
|
102
|
+
### MEDIUM — React / Next(相关文件)
|
|
103
|
+
|
|
104
|
+
- Hook **依赖数组**不完整
|
|
105
|
+
- **直接改 state**
|
|
106
|
+
- 列表 **`key={index}`**(可重排时)
|
|
107
|
+
- **`useEffect` 做派生 state**(应 render 期计算)
|
|
108
|
+
- **Server / Client 边界**(Next.js 服务端模块进 client)
|
|
109
|
+
|
|
110
|
+
### MEDIUM — 性能
|
|
111
|
+
|
|
112
|
+
- render 内 **新建对象/数组** 作 props 导致无谓更新
|
|
113
|
+
- 循环内 **N+1** 请求
|
|
114
|
+
- 昂贵计算缺 **memo**(确有证据时)
|
|
115
|
+
- **全量 `lodash` 导入**等打包问题
|
|
116
|
+
|
|
117
|
+
### MEDIUM — 实践
|
|
118
|
+
|
|
119
|
+
- 生产路径 **`console.log`**
|
|
120
|
+
- **Magic Number / Magic String** — 业务状态、类型、标识等使用裸数字/裸字符串;应对齐 `templates/shared/rules/fec-typescript.md`「禁止 Magic Number / Magic String」
|
|
121
|
+
- **深层可选链无兜底** `??`
|
|
122
|
+
- **命名不一致**(camelCase / PascalCase 约定)
|
|
123
|
+
- **单文件规模失控** — 单文件显著超过约 300 行且承担多重职责,未体现可维护拆分;应对齐 `templates/shared/rules/fec-typescript.md`「单文件规模与模块拆分」
|
|
124
|
+
- **类型定义与实现耦合过重** — 大段可复用类型堆在 `*.tsx`/实现文件内,未抽取 `*.types.ts`;应对齐 `templates/shared/rules/fec-typescript.md`「类型资产分层与命名」
|
|
125
|
+
- **全局声明边界不清** — 将模块私有类型放入 `global.d.ts` 或把 ambient 声明写入实现文件;应对齐 `templates/shared/rules/fec-typescript.md`「类型资产分层与命名」
|
|
126
|
+
- **类型导入导出语义混用** — 仅类型用途仍使用值导入/导出,缺 `import type` / `export type`;应对齐 `templates/shared/rules/fec-typescript.md`「类型资产分层与命名」
|
|
127
|
+
- **可用类型收窄却滥用断言** — 通过 `as` 消错而非 `typeof` / `in` / predicate 收窄;应对齐 `templates/shared/rules/fec-typescript.md`「工程化与惯用法补充」
|
|
128
|
+
|
|
129
|
+
## 诊断命令(按项目选用)
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm run typecheck --if-present
|
|
133
|
+
# 或 pnpm / yarn / bun 的等价脚本
|
|
134
|
+
tsc --noEmit -p <relevant-tsconfig>
|
|
135
|
+
npx eslint . --ext .ts,.tsx,.js,.jsx
|
|
136
|
+
npx prettier --check .
|
|
137
|
+
npm audit
|
|
138
|
+
npx vitest run
|
|
139
|
+
npx jest --ci
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
以 `package.json` 脚本为准,勿臆造命令名。
|
|
143
|
+
|
|
144
|
+
## 审批结论
|
|
145
|
+
|
|
146
|
+
- **Approve**:无 CRITICAL、无 HIGH
|
|
147
|
+
- **Warning**:仅 MEDIUM 及以下(可谨慎合并)
|
|
148
|
+
- **Block**:存在 CRITICAL 或 HIGH
|
|
149
|
+
|
|
150
|
+
## 报告落盘
|
|
151
|
+
|
|
152
|
+
- 路径:`reports/typescript-review-YYYY-MM-DD-HHmmss.md`
|
|
153
|
+
- 结构:分严重级别列出发现项,附文件路径与行号、说明与建议;文末 **Summary 表** + **Verdict**。
|
|
154
|
+
- 写完后告知用户文件路径。
|
|
155
|
+
|
|
156
|
+
## 参考心态
|
|
157
|
+
|
|
158
|
+
以「能否通过一线 TypeScript 团队或成熟开源仓库的合并门槛」为标准;与 **`fec-code-reviewer`** 叠加使用时,避免重复同一处 UI 细节——本代理优先 **类型、异步、安全与运行时语义**。
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-ui-checker
|
|
3
|
+
description: 使用该子代理排查前端 UI 中的视觉缺陷、布局错乱、CSS 问题、响应式异常以及交互与设计不一致的问题,将报告保存为 Markdown 文件。支持从 Figma、Sketch、MasterGo、Pixso、墨刀、摹客获取设计数据,对比设计稿与实现结果,评估还原度并给出具体差异报告。
|
|
4
|
+
tools: Read, Edit, Write, MultiEdit, Glob, Grep, LS, Bash, WebFetch, mcp__figma__get_design_context, mcp__sketch__get_selection_as_image, mcp__mastergo__*, mcp__pixso__*, mcp__modao__*
|
|
5
|
+
model: sonnet
|
|
6
|
+
permissionMode: default
|
|
7
|
+
maxTurns: 10
|
|
8
|
+
mcpServers:
|
|
9
|
+
- figma
|
|
10
|
+
- figma-desktop
|
|
11
|
+
- sketch
|
|
12
|
+
- mastergo
|
|
13
|
+
- pixso
|
|
14
|
+
- modao
|
|
15
|
+
skills:
|
|
16
|
+
- fec-code-review
|
|
17
|
+
- fec-ui-design
|
|
18
|
+
- fec-tailwind-design-system
|
|
19
|
+
- fec-responsive-layout
|
|
20
|
+
- fec-accessibility-check
|
|
21
|
+
- fec-validation-fix
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# UI 问题排查与设计还原度评估
|
|
25
|
+
|
|
26
|
+
你是一名专注于设计还原度评估与 UI 问题排查的质量工程师。
|
|
27
|
+
|
|
28
|
+
关注重点:
|
|
29
|
+
|
|
30
|
+
- 布局损坏
|
|
31
|
+
- 溢出和裁剪
|
|
32
|
+
- 间距或对齐错误
|
|
33
|
+
- 样式优先级冲突
|
|
34
|
+
- 响应式断点回归问题
|
|
35
|
+
- 容器查询、触摸目标、安全区域和断点中间值问题
|
|
36
|
+
- hover / focus / disabled 状态异常
|
|
37
|
+
- 设计与实现不一致
|
|
38
|
+
- 泛化模板感、视觉记忆点不足
|
|
39
|
+
- 字体、色彩、动效和背景质感不成体系
|
|
40
|
+
- Tailwind token、variant、暗色模式或动态 class 治理失控
|
|
41
|
+
|
|
42
|
+
工作流程:
|
|
43
|
+
|
|
44
|
+
1. 先定位最小可复现路径
|
|
45
|
+
2. 若项目存在 `design-system/<project>/pages/<page>.md`,先读取页面 override;再读取对应 `design-system/<project>/MASTER.md`
|
|
46
|
+
3. 检查组件结构和样式来源
|
|
47
|
+
4. 追踪问题来自 markup、CSS、Token、状态还是数据
|
|
48
|
+
5. 给出最小且稳妥的修复方案
|
|
49
|
+
6. 修改后进行验证
|
|
50
|
+
|
|
51
|
+
如果局部修复已足够,不要进行大范围重写。
|
|
52
|
+
|
|
53
|
+
## 检查流程
|
|
54
|
+
|
|
55
|
+
1. 从可用的设计工具获取设计数据(颜色、字体、间距、尺寸)
|
|
56
|
+
- Figma / MasterGo / Pixso / 墨刀:通过 MCP 获取结构化数据
|
|
57
|
+
- Sketch:通过 MCP 获取选区截图
|
|
58
|
+
- 摹客:从用户提供的截图或标注中获取
|
|
59
|
+
2. 读取对应的实现代码
|
|
60
|
+
3. 如果存在设计系统文档,确认实现是否遵守 Master 与页面 override 的产品类型、token、图表、动效和 QA 规则
|
|
61
|
+
4. 逐项对比以下维度:
|
|
62
|
+
|
|
63
|
+
| 维度 | 权重 | 检查内容 |
|
|
64
|
+
| --------- | ---- | ----------------------------------- |
|
|
65
|
+
| 颜色 | 25% | 背景色、文字色、边框色与 token 对应 |
|
|
66
|
+
| 间距 | 25% | padding/margin/gap 与设计一致 |
|
|
67
|
+
| 字体 | 20% | 字号、字重、行高、字间距 |
|
|
68
|
+
| 尺寸 | 15% | 组件宽高、图标尺寸 |
|
|
69
|
+
| 圆角/阴影 | 10% | border-radius、box-shadow |
|
|
70
|
+
| 响应式 | 5% | 各断点布局正确 |
|
|
71
|
+
|
|
72
|
+
若任务不是设计稿还原,而是产品化 UI 质量检查,还需要补充评估:
|
|
73
|
+
|
|
74
|
+
- 首屏主体是否明确,是否直接支撑核心任务
|
|
75
|
+
- 视觉锚点是否贴合业务,而不是通用装饰
|
|
76
|
+
- 字体层级、色彩角色、动效节奏和背景质感是否一致
|
|
77
|
+
- 是否存在默认紫色渐变、空泛 hero、卡片堆叠、单一色相或无语境字体等模板化痕迹
|
|
78
|
+
- 是否忽略 `design-system/MASTER.md` 或页面 override 中已定义的行业风险、图表选择、状态覆盖和交付前 QA
|
|
79
|
+
|
|
80
|
+
## 输出格式
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
# 设计还原度报告
|
|
84
|
+
|
|
85
|
+
> 生成时间: YYYY-MM-DD HH:mm
|
|
86
|
+
> 评审工具: frontend-craft
|
|
87
|
+
> 设计工具: Figma / Sketch / MasterGo / Pixso / 墨刀 / 摹客
|
|
88
|
+
|
|
89
|
+
**总体得分**: XX/100
|
|
90
|
+
|
|
91
|
+
## 颜色 (XX/25)
|
|
92
|
+
✅ 背景色: --color-bg-primary 正确
|
|
93
|
+
❌ 按钮色: 使用了 #3B82F6,应为 --color-brand-500
|
|
94
|
+
|
|
95
|
+
## 间距 (XX/25)
|
|
96
|
+
...
|
|
97
|
+
|
|
98
|
+
## 字体 (XX/20)
|
|
99
|
+
...
|
|
100
|
+
|
|
101
|
+
## 尺寸 (XX/15)
|
|
102
|
+
...
|
|
103
|
+
|
|
104
|
+
## 圆角/阴影 (XX/10)
|
|
105
|
+
...
|
|
106
|
+
|
|
107
|
+
## 响应式 (XX/5)
|
|
108
|
+
...
|
|
109
|
+
|
|
110
|
+
## 需要调整的项目(按优先级)
|
|
111
|
+
1. ...
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 报告文件输出
|
|
115
|
+
|
|
116
|
+
检查完成后,必须将报告内容使用 Write 工具保存为 Markdown 文件:
|
|
117
|
+
|
|
118
|
+
- 目录:项目根目录下的 `reports/`(如不存在则创建)
|
|
119
|
+
- 文件名:`ui-fidelity-review-YYYY-MM-DD-HHmmss.md`(使用当前时间戳)
|
|
120
|
+
- 保存后告知用户报告文件路径
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-debug
|
|
3
|
+
description: 前端问题诊断与修复:覆盖构建失败、运行时错误、UI 异常、接口问题,使用统一诊断框架按类型分流。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
按 `fec-debug-framework` 执行前端问题诊断与修复。先分类问题类型(build / runtime / ui / api),再进入对应诊断模块执行 5 步法(分类→收集→假设→验证→修复)。复杂或跨类型问题可委托 **`fec-debugger`** 子代理。
|
|
7
|
+
|
|
8
|
+
## 问题类型速查
|
|
9
|
+
|
|
10
|
+
| 类型 | 典型场景 |
|
|
11
|
+
| ------- | ----------------------------------------------- |
|
|
12
|
+
| build | lint/type-check/test/build/CI 失败 |
|
|
13
|
+
| runtime | JS 异常、白屏、组件渲染错误、路由异常、状态丢失 |
|
|
14
|
+
| ui | 样式错位、交互异常、动画卡顿、响应式问题 |
|
|
15
|
+
| api | 请求失败、超时、数据不一致、CORS、缓存问题 |
|
|
16
|
+
|
|
17
|
+
## 执行步骤
|
|
18
|
+
|
|
19
|
+
1. 读取用户描述的问题,按 `fec-debug-framework` Step 1 分类问题类型。
|
|
20
|
+
2. 进入对应诊断模块,执行 Step 2 收集证据。
|
|
21
|
+
3. 基于证据提出假设(Step 3),逐一验证(Step 4)。
|
|
22
|
+
4. 确认根因后执行最小修复(Step 5),运行受影响验证命令。
|
|
23
|
+
5. 输出诊断报告到 `reports/debug-YYYY-MM-DD-HHmmss.md`。
|
|
24
|
+
|
|
25
|
+
## 强约束
|
|
26
|
+
|
|
27
|
+
- 不通过关闭规则、删除测试或降低类型安全来「修复」问题
|
|
28
|
+
- 不顺手重构无关代码
|
|
29
|
+
- 不在缺少证据时猜测根因
|
|
30
|
+
- 修复后必须验证,不能只改不测
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-doc-sync
|
|
3
|
+
description: 从代码和项目事实源同步 README、docs、环境变量、脚本、API/路由/组件说明和部署说明。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
按 `fec-doc-sync` 同步前端工程文档。复杂多语言更新可委托 **`fec-doc-updater`**。
|
|
7
|
+
|
|
8
|
+
## 执行步骤
|
|
9
|
+
|
|
10
|
+
1. 读取事实来源:`package.json`、lockfile、config、`.env.example`、路由、API clients/server routes、types/schemas、组件、测试、CI、build/deploy config。
|
|
11
|
+
2. 比对 README、docs、ADR、changelog、example prompts、setup/deploy/env docs。
|
|
12
|
+
3. 更新稳定的命令、环境变量、路由/API 行为、组件说明、部署步骤、版本约束和迁移说明。
|
|
13
|
+
4. 多语言文档保持关键信息一致。
|
|
14
|
+
5. 当目标仓库本身是 skill/agent/command 分发仓库时,也同步能力表、metadata、runtime docs 和 marketplace 描述。
|
|
15
|
+
6. 运行文档一致性、typecheck、测试、构建或相关打包检查。
|
|
16
|
+
|
|
17
|
+
## 输出要求
|
|
18
|
+
|
|
19
|
+
总结更新范围、事实来源、验证命令和仍需人工校对的翻译风险。
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-init
|
|
3
|
+
description: 按当前 AI runtime 初始化 frontend-craft 项目模板、rules 或降级说明。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
将 frontend-craft 提供的项目模板复制到当前项目对应 runtime 的配置目录中。优先根据当前目录已有配置判断 runtime;无法判断时,按用户正在使用的工具选择。
|
|
7
|
+
|
|
8
|
+
## 执行步骤
|
|
9
|
+
|
|
10
|
+
1. 检测 runtime:
|
|
11
|
+
- 存在 `.claude/` 或 Claude Code 插件环境 → `claude`
|
|
12
|
+
- 存在 `.codex/` 或 `AGENTS.md` → `codex`
|
|
13
|
+
- 存在 `.openclaw/`、`OPENCLAW-CONFIG.md` 或 `openclaw.plugin.json` → `openclaw`
|
|
14
|
+
- 存在 `.qoder/`、`.qoder/settings.json`、`.qoder/rules/` 或 `.qoder/skills/` → `qoder`
|
|
15
|
+
- 存在 `.cursor/` → `cursor`
|
|
16
|
+
- 存在 `.windsurf/` → `windsurf`
|
|
17
|
+
- 存在 `.opencode/` → `opencode`
|
|
18
|
+
- 存在 `.kilo/` → `kilo`
|
|
19
|
+
- 存在 `.gemini/` 或 `GEMINI.md` → `gemini`
|
|
20
|
+
- 存在 `.github/copilot-instructions.md` 或 `.github/instructions/` → `copilot`
|
|
21
|
+
- 存在 `.trae/`、`.augment/`、`.codebuddy/`、`.clinerules` 时按对应 runtime 处理
|
|
22
|
+
- 仍无法判断时,询问用户当前要初始化的 runtime。
|
|
23
|
+
|
|
24
|
+
2. 按 runtime 初始化,不要在未确认时覆盖已有文件:
|
|
25
|
+
- `claude`:复制 Claude 模板、hooks、commands、agents、skills 与 shared rules 到 `.claude/`;如 `.claude/CLAUDE.md` 已存在,先确认。
|
|
26
|
+
- `codex`:复制 `templates/codex/AGENTS.md` 到项目根目录(如不存在)、`templates/codex/config.toml` 到 `.codex/config.toml`、shared rules 到 `.codex/rules/`;skills/agents 应由 CLI 安装流程负责。
|
|
27
|
+
- `openclaw`:复制 `templates/openclaw/*.md` 到项目根目录、commands/skills 到 `.openclaw/`;如文件已存在,先确认。
|
|
28
|
+
- `qoder`:复制 skills 到 `.qoder/skills/`、commands 到 `.qoder/commands/`、agents 到 `.qoder/agents/`、shared rules 到 `.qoder/rules/`、hook scripts 到 `.qoder/hooks/`,并生成或合并 `.qoder/settings.json` 的 hooks 配置。
|
|
29
|
+
- `cursor`:复制 shared rules 到 `.cursor/rules/*.mdc`,保留 `fec-` skills 目录;说明 Cursor 不支持本插件 hooks。
|
|
30
|
+
- `windsurf`:复制 commands 到 `.windsurf/workflows/`、shared rules 到 `.windsurf/rules/`、skills 到 `.windsurf/skills/`。
|
|
31
|
+
- `opencode` / `kilo`:复制 commands 到 `.opencode/command/` 或 `.kilo/command/`,skills 到对应 `skills/`;OpenCode 可补 `.opencode/opencode.jsonc`。
|
|
32
|
+
- `gemini`:复制 skills 到 `.gemini/extensions/frontend-craft/skills/`,如无 `GEMINI.md` 则由 Claude 模板改写生成。
|
|
33
|
+
- `copilot`:合并 shared rules 到 `.github/instructions/frontend-craft.instructions.md`,commands 到 `.github/prompts/`。
|
|
34
|
+
- `trae` / `cline`:只写入规则 bundle,并明确这是 rules-only 降级模式。
|
|
35
|
+
- `antigravity` / `augment` / `codebuddy`:只安装 skills;输出“此 runtime 当前无 commands/hooks 原生适配”。
|
|
36
|
+
|
|
37
|
+
3. Claude runtime 下,将以下模板文件从插件的 `${FRONTEND_CRAFT_ROOT}/templates/claude/` 与 `${FRONTEND_CRAFT_ROOT}/templates/shared/rules/` 复制到项目根目录的 `.claude/`:
|
|
38
|
+
- `templates/claude/CLAUDE.md` → `.claude/CLAUDE.md`
|
|
39
|
+
- `templates/claude/settings.json` → `.claude/settings.json`
|
|
40
|
+
- `templates/shared/rules/fec-vue.md` → `.claude/rules/fec-vue.md`
|
|
41
|
+
- `templates/shared/rules/fec-react.md` → `.claude/rules/fec-react.md`
|
|
42
|
+
- `templates/shared/rules/fec-design-system.md` → `.claude/rules/fec-design-system.md`
|
|
43
|
+
- `templates/shared/rules/fec-testing.md` → `.claude/rules/fec-testing.md`
|
|
44
|
+
- `templates/shared/rules/fec-git-conventions.md` → `.claude/rules/fec-git-conventions.md`
|
|
45
|
+
- `templates/shared/rules/fec-i18n.md` → `.claude/rules/fec-i18n.md`
|
|
46
|
+
- `templates/shared/rules/fec-performance.md` → `.claude/rules/fec-performance.md`
|
|
47
|
+
- `templates/shared/rules/fec-source-driven-development.md` → `.claude/rules/fec-source-driven-development.md`
|
|
48
|
+
- `templates/shared/rules/fec-responsive-design.md` → `.claude/rules/fec-responsive-design.md`
|
|
49
|
+
- `templates/shared/rules/fec-rendering-patterns.md` → `.claude/rules/fec-rendering-patterns.md`
|
|
50
|
+
- `templates/shared/rules/fec-api-layer.md` → `.claude/rules/fec-api-layer.md`
|
|
51
|
+
- `templates/shared/rules/fec-state-management.md` → `.claude/rules/fec-state-management.md`
|
|
52
|
+
- `templates/shared/rules/fec-error-handling.md` → `.claude/rules/fec-error-handling.md`
|
|
53
|
+
- `templates/shared/rules/fec-naming-conventions.md` → `.claude/rules/fec-naming-conventions.md`
|
|
54
|
+
- `templates/shared/rules/fec-typescript.md` → `.claude/rules/fec-typescript.md`
|
|
55
|
+
- `templates/shared/rules/fec-code-comments.md` → `.claude/rules/fec-code-comments.md`
|
|
56
|
+
- `templates/shared/rules/fec-ci-cd.md` → `.claude/rules/fec-ci-cd.md`
|
|
57
|
+
- `templates/shared/rules/fec-refactoring.md` → `.claude/rules/fec-refactoring.md`
|
|
58
|
+
- `templates/shared/rules/fec-agent-workflow.md` → `.claude/rules/fec-agent-workflow.md`
|
|
59
|
+
- `templates/shared/rules/fec-working-modes.md` → `.claude/rules/fec-working-modes.md`
|
|
60
|
+
|
|
61
|
+
4. 复制完成后,不要只输出提醒。先检查项目根目录中的 `package.json`、常见框架配置文件和 `.github/workflows/`,推断适用规则,然后向用户提供初始化后配置选项:
|
|
62
|
+
- 推荐:自动检测并裁剪规则(默认推荐项)。根据检测结果展示建议保留和建议移除的规则,用户确认后再修改 `.claude/CLAUDE.md` 底部的规则导入部分。
|
|
63
|
+
- 手动选择要保留的规则。列出已复制的规则文件,让用户选择要保留的规则,再按选择更新 `.claude/CLAUDE.md`。
|
|
64
|
+
- 暂不调整,仅输出清单。保持复制结果不变,只输出初始化完成信息、文件清单和后续建议。
|
|
65
|
+
|
|
66
|
+
推荐项的判断应保持保守:只自动建议移除明显不匹配的规则,例如纯 React 项目移除 `@./rules/fec-vue.md`、纯 Vue 项目移除 `@./rules/fec-react.md`、无 TypeScript/JavaScript 源码时移除 `@./rules/fec-typescript.md`。对 `@./rules/fec-i18n.md`、`@./rules/fec-ci-cd.md`、`@./rules/fec-refactoring.md` 这类依赖项目上下文的规则,优先展示为建议项并说明依据;无法确定时默认保留。
|
|
67
|
+
|
|
68
|
+
如果当前运行环境支持结构化提问工具,使用选择题形式提问,并明确标注推荐项;否则使用编号选项。用户选择并确认前,不要修改 `.claude/CLAUDE.md` 的规则导入部分。完成裁剪或用户选择暂不调整后,再提醒用户根据项目实际情况修改 `CLAUDE.md` 的项目基础信息、常用命令、`rules/fec-react.md` 或 `rules/fec-vue.md` 中的技术栈配置,并检查 `settings.json` 中的权限列表是否符合项目需求。
|
|
69
|
+
|
|
70
|
+
5. 输出初始化完成的确认信息和文件清单。
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-plan
|
|
3
|
+
description: 统一前端规划入口——实现/架构计划或测试策略。默认走实施路径;当用户明确要测试计划、覆盖矩阵、测试分层、risk-to-test 等时,输出完整测试策略。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
在改代码前创建前端计划。根据用户意图自动分流到实施规划或测试规划。
|
|
7
|
+
|
|
8
|
+
## 意图识别
|
|
9
|
+
|
|
10
|
+
- **实施规划**(默认):用户要拆组件、设计数据流、安排目录结构、迁移步骤、架构方案。
|
|
11
|
+
- **测试规划**:用户明确说"测试计划"、"测试策略"、"覆盖矩阵"、"测试分层"、"测什么"、"risk-to-test"等。
|
|
12
|
+
- **混合**:用户同时有实施和测试诉求。
|
|
13
|
+
|
|
14
|
+
若意图不清,先问用户想看实施计划还是测试策略。
|
|
15
|
+
|
|
16
|
+
## 实施规划路径
|
|
17
|
+
|
|
18
|
+
1. 重述用户目标、成功标准和不在范围内的内容。
|
|
19
|
+
2. 阅读相关代码、模板、规则、配置、测试和已有实现,避免脱离项目现状。
|
|
20
|
+
3. 若涉及页面拆分、状态流、目录结构、数据流或大型重构,委托 **`fec-architect`**。
|
|
21
|
+
4. 输出计划:
|
|
22
|
+
- 影响范围
|
|
23
|
+
- 关键文件或模块
|
|
24
|
+
- 架构与模块边界
|
|
25
|
+
- 数据流 / 状态流 / API 交互
|
|
26
|
+
- 实施阶段
|
|
27
|
+
- 回滚或渐进迁移策略
|
|
28
|
+
- 风险与缓解
|
|
29
|
+
- 最小验证门禁(lint、type-check、test、build、E2E 或人工验收)
|
|
30
|
+
5. 对版本敏感、依赖升级或外部库相关决策,列出事实来源、版本范围、迁移影响和需要查证的文档。
|
|
31
|
+
6. 在用户确认前不执行实现。
|
|
32
|
+
|
|
33
|
+
实施规划保存到 `reports/architecture-proposal-YYYY-MM-DD-HHmmss.md`。
|
|
34
|
+
|
|
35
|
+
## 测试规划路径
|
|
36
|
+
|
|
37
|
+
1. 确定范围:
|
|
38
|
+
- 用户指定功能、PR、文件或业务流程时,以该范围为准。
|
|
39
|
+
- 用户未指定时,查看最近变更并推断主要风险面。
|
|
40
|
+
- 若用户要的是模块拆分、状态流、目录结构或迁移步骤,回到实施规划路径。
|
|
41
|
+
|
|
42
|
+
2. 使用 `fec-testing-strategy` Skill 建立测试分层矩阵:
|
|
43
|
+
- 静态检查
|
|
44
|
+
- 单元测试
|
|
45
|
+
- 组件测试
|
|
46
|
+
- 轻量集成测试
|
|
47
|
+
- E2E 测试
|
|
48
|
+
- 视觉 / Storybook / interaction
|
|
49
|
+
- a11y / 安全 / 性能等专项质量验证
|
|
50
|
+
|
|
51
|
+
3. 对每个风险给出建议测试层、优先级、建议命令、责任 skill 和失败定位证据。
|
|
52
|
+
|
|
53
|
+
4. 标明哪些风险只需要现有门禁覆盖,哪些需要新增测试,哪些暂不覆盖并说明原因。
|
|
54
|
+
|
|
55
|
+
5. 必要时委托 **`fec-test-planner`** 子代理生成独立测试计划。
|
|
56
|
+
|
|
57
|
+
6. 将计划保存到 `reports/test-plan-YYYY-MM-DD-HHmmss.md`:
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# 前端测试计划
|
|
61
|
+
|
|
62
|
+
> 生成时间: YYYY-MM-DD HH:mm
|
|
63
|
+
> 范围: ...
|
|
64
|
+
|
|
65
|
+
## 风险概览
|
|
66
|
+
|
|
67
|
+
| Risk | Impact | Suggested Layer | Priority | Evidence |
|
|
68
|
+
| ---- | ------ | --------------- | -------- | -------- |
|
|
69
|
+
|
|
70
|
+
## 覆盖矩阵
|
|
71
|
+
|
|
72
|
+
| Layer | What to Cover | Tooling / Command | Skill |
|
|
73
|
+
| ----- | ------------- | ----------------- | ----- |
|
|
74
|
+
|
|
75
|
+
## 执行顺序
|
|
76
|
+
|
|
77
|
+
## 不覆盖项与原因
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
7. 若用户要求继续实现测试,按矩阵分流到对应专项 skill 或 agent。
|
|
81
|
+
|
|
82
|
+
## 混合路径
|
|
83
|
+
|
|
84
|
+
当用户同时需要实施计划和测试策略时:
|
|
85
|
+
|
|
86
|
+
1. 先输出完整实施规划。
|
|
87
|
+
2. 在实施规划末尾追加"测试策略"章节,列出关键风险对应的测试层级和验证门禁。
|
|
88
|
+
3. 只有用户明确要求完整覆盖矩阵时,才额外生成 `test-plan-*` 独立报告。
|
|
89
|
+
|
|
90
|
+
## 边界
|
|
91
|
+
|
|
92
|
+
- 不在计划阶段直接写代码,除非用户明确要求继续实现。
|
|
93
|
+
- 不默认要求补齐完整测试金字塔,只按风险和维护成本选择覆盖。
|
|
94
|
+
- 不负责大规模编写测试文件;用户明确要求落地时再分流到专项测试 skill。
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-refactor-clean
|
|
3
|
+
description: 在验证保护下识别并清理前端死代码、未使用导出、过期组件、样式和依赖。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
按 `fec-refactor-clean` 执行安全清理。复杂清理可委托 **`fec-refactor-cleaner`**。
|
|
7
|
+
|
|
8
|
+
## 执行步骤
|
|
9
|
+
|
|
10
|
+
1. 建立当前验证基线。
|
|
11
|
+
2. 使用仓库已有工具或 `rg` 收集未使用候选项。
|
|
12
|
+
3. 检查动态引用、路由、barrel export、Storybook、测试和样式入口。
|
|
13
|
+
4. 将候选项分为 SAFE、CAUTION、DANGER。
|
|
14
|
+
5. 仅清理 SAFE 项;其他项输出建议和证据。
|
|
15
|
+
6. 每批清理后重新运行受影响验证命令。
|
|
16
|
+
|
|
17
|
+
## 输出要求
|
|
18
|
+
|
|
19
|
+
将清理报告保存到 `reports/refactor-clean-YYYY-MM-DD-HHmmss.md`。
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-refactor-plan
|
|
3
|
+
description: 根据证据生成有序的小步保持行为重构计划,不修改业务代码。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
本命令是 **PLAN ONLY(只规划)**,不要修改业务代码。
|
|
7
|
+
|
|
8
|
+
1. 校验当前项目事实以及已有坏味道诊断。
|
|
9
|
+
2. 记录可观察行为契约和现有验证基线。
|
|
10
|
+
3. 按真实成因选择满足前置条件的最小手法。
|
|
11
|
+
4. 只安排必要的前置关系,每一步都必须能独立验证。
|
|
12
|
+
5. 每步标记 `SAFE`、`CAUTION` 或 `DANGER`。
|
|
13
|
+
6. 每步包含:目标、手法、意图、依赖/先后原因、前置条件、风险、预期文件/函数、预期行为变化 `NONE`、验证方法、回滚边界。
|
|
14
|
+
7. 写明差异预算与停止条件。
|
|
15
|
+
8. 保存到 `reports/refactoring/plan-YYYY-MM-DD-HHmmss.md`。
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-refactor
|
|
3
|
+
description: 以小步、逐步验证、失败回滚和证明报告的方式执行保持行为的前端重构。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
1. 先分类任务;新功能、未知 Bug、迁移、死代码清理和通用 Review 分流到对应工作流。
|
|
7
|
+
2. 发现项目事实并建立现有验证基线。
|
|
8
|
+
3. 没有计划时先诊断和规划;已有计划时先校验计划与当前代码仍一致。
|
|
9
|
+
4. 记录风险和差异预算;`DANGER` 默认停止等待明确授权。
|
|
10
|
+
5. 一次只执行**一个主要重构步骤**。
|
|
11
|
+
6. 立即运行足够窄的验证并检查实际范围。
|
|
12
|
+
7. 当前步骤造成新回归时,先回滚当前步骤,再尝试更小或不同的变换。
|
|
13
|
+
8. 当前步回到绿色且未超预算后才继续。
|
|
14
|
+
9. 最后运行可用的广泛门禁,并保存 `reports/refactoring/refactoring-YYYY-MM-DD-HHmmss.md`,结论使用 `PASS`、`PARTIAL` 或 `NOT PROVEN`。
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-review
|
|
3
|
+
description: 对前端改动、指定文件或目录、整个项目进行规范化评审,输出分级评审报告并保存为 Markdown 文件。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
对前端代码进行全面评审。先读项目现状和所选范围(仅改动审核要求 diff),再输出有证据的发现;不把猜测写成阻塞项。若需要**结合 git diff、按严重级别(CRITICAL→LOW)降噪输出、并显式给出 Approve/Warning/Block 结论**,可委托 **`fec-code-reviewer`** 子代理执行;若变更以 **`.ts` / `.tsx` / `.js` / `.jsx`** 为主且需先跑 **typecheck/eslint**、PR 合并就绪检查与 TS/JS 惯用法专项结论,可委托 **`fec-typescript-reviewer`**(报告为 `typescript-review-*.md`)。否则继续按本命令与 `fec-code-review` Skill 流程即可。
|
|
7
|
+
|
|
8
|
+
## 评审模式与覆盖范围
|
|
9
|
+
|
|
10
|
+
用户明确指定的范围优先于默认行为。遵循 `fec-code-review` 的三种模式:
|
|
11
|
+
|
|
12
|
+
- **改动审核**:仅在明确要求或当前任务已明确最近改动、本次修改、暂存区、PR 或提交上下文时,审核这些改动及必要上下文。本地模式在请求范围内检查暂存、未暂存差异及相关未跟踪项目文件;仅要求暂存区时只审核暂存改动。无改动时说明没有可审核的改动,不自动切换到最近提交或扩大范围。
|
|
13
|
+
- **指定范围审核**:用户指定文件或目录时,建立范围内文件清单,审核其中现有代码,包括未改动代码;不要求 Git 差异。
|
|
14
|
+
- **全项目审核(默认)**:未指定范围或改动上下文,或明确要求审核整个项目时,建立项目自有前端代码、相关测试、配置和依赖声明的清单,再按模块分批审核,包括未改动代码;不要求 Git 差异。
|
|
15
|
+
|
|
16
|
+
先选择范围,再收集差异。仅指定文件或目录表示全量审核该范围;路径与明确改动请求同时出现时,仅增量审核该路径的改动。未限定的调用即使存在 Git 改动也默认全项目审核。开始审核时说明选定模式和目标范围。修改后自动委托审核时,显式传入本次改动范围,避免无范围调用触发全项目审核。
|
|
17
|
+
|
|
18
|
+
默认排除依赖目录、构建产物、缓存、生成文件和第三方代码,并记录排除项。保持前端职责边界,不宣称完成后端专项审核。目标不存在或范围内无相关文件时,明确说明,不替换为其他范围。
|
|
19
|
+
|
|
20
|
+
跨批次合并同根因发现。报告记录**审核模式、目标范围、已审核文件或模块、排除项、未覆盖文件或模块、完成状态及验证命令和结果**。受上下文或执行预算限制时,标记部分完成并列出剩余模块,不宣称已完成全项目覆盖。为理解上下文而读取调用方或执行全项目 lint/类型检查,不计为完成这些文件的人工审核。
|
|
21
|
+
|
|
22
|
+
改动审核保留合并建议;指定范围和全项目审核使用风险评估(低 / 中 / 高,并标明阻塞问题),不宣称合并就绪。保留严重程度、证据要求和报告文件命名。除非用户明确要求修复,否则仅输出报告。
|
|
23
|
+
|
|
24
|
+
## 执行步骤
|
|
25
|
+
|
|
26
|
+
1. 按上述三种模式确定范围,并建立目标文件清单。未指定范围或改动上下文时默认全项目审核;增量请求无改动时不自动扩大范围。
|
|
27
|
+
|
|
28
|
+
2. 纳入前端源码、相关测试、配置及依赖声明,不仅按源码扩展名过滤;记录默认排除项。
|
|
29
|
+
|
|
30
|
+
3. 使用 `fec-code-review` Skill 的评审维度逐项检查:
|
|
31
|
+
|
|
32
|
+
- 架构(组件边界、职责分离)
|
|
33
|
+
- 类型安全(any 使用、props 类型)
|
|
34
|
+
- 渲染与状态(重复渲染、key 稳定性)
|
|
35
|
+
- 样式(Token 使用、响应式)
|
|
36
|
+
- Tailwind / 设计系统(token、variant、暗色模式、动态 class)
|
|
37
|
+
- 可访问性(语义化、ARIA、键盘操作)
|
|
38
|
+
- 可维护性(文件体积、命名、重复逻辑)
|
|
39
|
+
- 测试(关键覆盖、测试模式)
|
|
40
|
+
- 安全(XSS、敏感信息、输入校验)
|
|
41
|
+
- 性能(首屏依赖、重复请求、长任务、大列表)
|
|
42
|
+
- 依赖升级(lockfile、peer dependency、CVE、大版本迁移验证)
|
|
43
|
+
|
|
44
|
+
每个问题必须包含文件位置、影响、置信度和建议验证方式。
|
|
45
|
+
|
|
46
|
+
4. 按以下格式输出评审报告:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
# 代码审查报告
|
|
50
|
+
|
|
51
|
+
> 生成时间: YYYY-MM-DD HH:mm
|
|
52
|
+
> 评审工具: frontend-craft
|
|
53
|
+
|
|
54
|
+
> 审核模式:改动审核 / 指定范围审核 / 全项目审核
|
|
55
|
+
> 目标范围:路径或 PR/提交
|
|
56
|
+
> 已审核:文件或模块清单
|
|
57
|
+
> 排除项:路径及原因
|
|
58
|
+
> 未覆盖:剩余文件或模块清单(无则注明)
|
|
59
|
+
> 完成状态:完成 / 部分完成
|
|
60
|
+
> 验证结果:命令、结果及未执行原因
|
|
61
|
+
|
|
62
|
+
**评审范围**: N 个文件
|
|
63
|
+
|
|
64
|
+
## 🔴 必须修改 (N项)
|
|
65
|
+
- **[文件:行号]** 问题描述 → 建议修改
|
|
66
|
+
|
|
67
|
+
## 🟡 建议优化 (N项)
|
|
68
|
+
- **[文件:行号]** 问题描述 → 建议修改
|
|
69
|
+
|
|
70
|
+
## 🔵 可选优化项 (N项)
|
|
71
|
+
- **[文件:行号]** 问题描述
|
|
72
|
+
|
|
73
|
+
## 🟢 做得好的地方
|
|
74
|
+
- ...
|
|
75
|
+
|
|
76
|
+
## 风险等级:低 / 中 / 高
|
|
77
|
+
|
|
78
|
+
**总体评价**: 改动审核填写合并建议;指定范围或全项目审核填写低 / 中 / 高风险及阻塞问题
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
5. 将报告内容使用 Write 工具保存为 Markdown 文件:
|
|
82
|
+
- 目录:项目根目录下的 `reports/`(如不存在则创建)
|
|
83
|
+
- 文件名:`code-review-YYYY-MM-DD-HHmmss.md`(使用当前时间戳)
|
|
84
|
+
- 保存后告知用户报告文件路径
|
|
85
|
+
|
|
86
|
+
6. 如果用户同意修改,直接修复"必须修改"中可以自动修复的项目。
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## 调用示例
|
|
90
|
+
|
|
91
|
+
- `/fec-review`:默认审核整个项目。
|
|
92
|
+
- `/fec-review 审核最近改动`:仅审核当前改动。
|
|
93
|
+
- `/fec-review 审核 src/components/Button.tsx`:审核指定文件,包括未改动代码。
|
|
94
|
+
- `/fec-review 审核 src/features/`:审核指定目录。
|
|
95
|
+
- `/fec-review 审核整个项目`:建立清单,按模块审核项目自有前端代码。
|
|
96
|
+
|
|
97
|
+
这些是自然语言指令,不是新增 CLI 参数。
|