@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
package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
# 搬移特性类重构
|
|
2
|
+
|
|
3
|
+
这些卡片以用户提供的标准重构目录为知识基线,转换为面向前端 Agent 的操作指南。保留标准 ID/中英文名称,框架适配和示例为项目原创内容。
|
|
4
|
+
|
|
5
|
+
## RF-MOVE-FUNCTION — 搬移函数(Move Function)
|
|
6
|
+
|
|
7
|
+
### 意图
|
|
8
|
+
把函数搬到拥有其主要数据或变化责任的模块。
|
|
9
|
+
|
|
10
|
+
### 典型信号
|
|
11
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
12
|
+
|
|
13
|
+
### 不适用条件
|
|
14
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
15
|
+
|
|
16
|
+
### 前置条件
|
|
17
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
18
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
19
|
+
|
|
20
|
+
### 操作步骤
|
|
21
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
22
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
23
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
24
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
25
|
+
|
|
26
|
+
### 行为保持检查点
|
|
27
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
28
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
29
|
+
|
|
30
|
+
### 相关坏味道
|
|
31
|
+
- `SMELL-DIVERGENT-CHANGE`
|
|
32
|
+
- `SMELL-SHOTGUN-SURGERY`
|
|
33
|
+
- `SMELL-FEATURE-ENVY`
|
|
34
|
+
- `SMELL-TEMPORARY-FIELD`
|
|
35
|
+
- `SMELL-MESSAGE-CHAINS`
|
|
36
|
+
- `SMELL-INSIDER-TRADING`
|
|
37
|
+
- `SMELL-ALTERNATIVE-CLASSES-DIFFERENT-INTERFACES`
|
|
38
|
+
- `SMELL-DATA-CLASS`
|
|
39
|
+
|
|
40
|
+
### 常见组合
|
|
41
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
42
|
+
|
|
43
|
+
### JavaScript 注意事项
|
|
44
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
45
|
+
|
|
46
|
+
### TypeScript 注意事项
|
|
47
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
48
|
+
|
|
49
|
+
### React 注意事项
|
|
50
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
51
|
+
|
|
52
|
+
### Vue 注意事项
|
|
53
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
54
|
+
|
|
55
|
+
### Frontend-Craft 前端适配
|
|
56
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
57
|
+
|
|
58
|
+
### 原创前端变换示例
|
|
59
|
+
- 把“Move Function”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
60
|
+
|
|
61
|
+
## RF-MOVE-FIELD — 搬移字段(Move Field)
|
|
62
|
+
|
|
63
|
+
### 意图
|
|
64
|
+
把数据搬到真正拥有该概念、并与其共同变化的对象或模块。
|
|
65
|
+
|
|
66
|
+
### 典型信号
|
|
67
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
68
|
+
|
|
69
|
+
### 不适用条件
|
|
70
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
71
|
+
|
|
72
|
+
### 前置条件
|
|
73
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
74
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
75
|
+
|
|
76
|
+
### 操作步骤
|
|
77
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
78
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
79
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
80
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
81
|
+
|
|
82
|
+
### 行为保持检查点
|
|
83
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
84
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
85
|
+
|
|
86
|
+
### 相关坏味道
|
|
87
|
+
- `SMELL-SHOTGUN-SURGERY`
|
|
88
|
+
- `SMELL-INSIDER-TRADING`
|
|
89
|
+
|
|
90
|
+
### 常见组合
|
|
91
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
92
|
+
|
|
93
|
+
### JavaScript 注意事项
|
|
94
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
95
|
+
|
|
96
|
+
### TypeScript 注意事项
|
|
97
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
98
|
+
|
|
99
|
+
### React 注意事项
|
|
100
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
101
|
+
|
|
102
|
+
### Vue 注意事项
|
|
103
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
104
|
+
|
|
105
|
+
### Frontend-Craft 前端适配
|
|
106
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
107
|
+
|
|
108
|
+
### 原创前端变换示例
|
|
109
|
+
- 把“Move Field”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
110
|
+
|
|
111
|
+
## RF-MOVE-STATEMENTS-INTO-FUNCTION — 搬移语句到函数(Move Statements into Function)
|
|
112
|
+
|
|
113
|
+
### 意图
|
|
114
|
+
把所有调用者都必须伴随执行的公共语句移入被调用函数,使公共操作完整。
|
|
115
|
+
|
|
116
|
+
### 典型信号
|
|
117
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
118
|
+
|
|
119
|
+
### 不适用条件
|
|
120
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
121
|
+
|
|
122
|
+
### 前置条件
|
|
123
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
124
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
125
|
+
|
|
126
|
+
### 操作步骤
|
|
127
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
128
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
129
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
130
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
131
|
+
|
|
132
|
+
### 行为保持检查点
|
|
133
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
134
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
135
|
+
|
|
136
|
+
### 相关坏味道
|
|
137
|
+
- 不要求先存在某一种固定坏味道;以具体结构证据为准。
|
|
138
|
+
|
|
139
|
+
### 常见组合
|
|
140
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
141
|
+
|
|
142
|
+
### JavaScript 注意事项
|
|
143
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
144
|
+
|
|
145
|
+
### TypeScript 注意事项
|
|
146
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
147
|
+
|
|
148
|
+
### React 注意事项
|
|
149
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
150
|
+
|
|
151
|
+
### Vue 注意事项
|
|
152
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
153
|
+
|
|
154
|
+
### Frontend-Craft 前端适配
|
|
155
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
156
|
+
|
|
157
|
+
### 原创前端变换示例
|
|
158
|
+
- 把“Move Statements into Function”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
159
|
+
|
|
160
|
+
## RF-MOVE-STATEMENTS-TO-CALLERS — 搬移语句到调用者(Move Statements to Callers)
|
|
161
|
+
|
|
162
|
+
### 意图
|
|
163
|
+
把只对部分调用者成立或因上下文而变化的语句移回调用端。
|
|
164
|
+
|
|
165
|
+
### 典型信号
|
|
166
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
167
|
+
|
|
168
|
+
### 不适用条件
|
|
169
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
170
|
+
|
|
171
|
+
### 前置条件
|
|
172
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
173
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
174
|
+
|
|
175
|
+
### 操作步骤
|
|
176
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
177
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
178
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
179
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
180
|
+
|
|
181
|
+
### 行为保持检查点
|
|
182
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
183
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
184
|
+
|
|
185
|
+
### 相关坏味道
|
|
186
|
+
- 不要求先存在某一种固定坏味道;以具体结构证据为准。
|
|
187
|
+
|
|
188
|
+
### 常见组合
|
|
189
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
190
|
+
|
|
191
|
+
### JavaScript 注意事项
|
|
192
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
193
|
+
|
|
194
|
+
### TypeScript 注意事项
|
|
195
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
196
|
+
|
|
197
|
+
### React 注意事项
|
|
198
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
199
|
+
|
|
200
|
+
### Vue 注意事项
|
|
201
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
202
|
+
|
|
203
|
+
### Frontend-Craft 前端适配
|
|
204
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
205
|
+
|
|
206
|
+
### 原创前端变换示例
|
|
207
|
+
- 把“Move Statements to Callers”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
208
|
+
|
|
209
|
+
## RF-REPLACE-INLINE-CODE-WITH-FUNCTION-CALL — 以函数调用取代内联代码(Replace Inline Code with Function Call)
|
|
210
|
+
|
|
211
|
+
### 意图
|
|
212
|
+
用已经存在且语义等价的函数调用替代重复的内联逻辑。
|
|
213
|
+
|
|
214
|
+
### 典型信号
|
|
215
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
216
|
+
|
|
217
|
+
### 不适用条件
|
|
218
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
219
|
+
|
|
220
|
+
### 前置条件
|
|
221
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
222
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
223
|
+
|
|
224
|
+
### 操作步骤
|
|
225
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
226
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
227
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
228
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
229
|
+
|
|
230
|
+
### 行为保持检查点
|
|
231
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
232
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
233
|
+
|
|
234
|
+
### 相关坏味道
|
|
235
|
+
- 不要求先存在某一种固定坏味道;以具体结构证据为准。
|
|
236
|
+
|
|
237
|
+
### 常见组合
|
|
238
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
239
|
+
|
|
240
|
+
### JavaScript 注意事项
|
|
241
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
242
|
+
|
|
243
|
+
### TypeScript 注意事项
|
|
244
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
245
|
+
|
|
246
|
+
### React 注意事项
|
|
247
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
248
|
+
|
|
249
|
+
### Vue 注意事项
|
|
250
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
251
|
+
|
|
252
|
+
### Frontend-Craft 前端适配
|
|
253
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
254
|
+
|
|
255
|
+
### 原创前端变换示例
|
|
256
|
+
- 把“Replace Inline Code with Function Call”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
257
|
+
|
|
258
|
+
## RF-SLIDE-STATEMENTS — 移动语句(Slide Statements)
|
|
259
|
+
|
|
260
|
+
### 意图
|
|
261
|
+
在不跨越可观察依赖的前提下移动语句,让相关代码相邻,为后续提炼或简化创造条件。
|
|
262
|
+
|
|
263
|
+
### 典型信号
|
|
264
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
265
|
+
|
|
266
|
+
### 不适用条件
|
|
267
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
268
|
+
|
|
269
|
+
### 前置条件
|
|
270
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
271
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
272
|
+
|
|
273
|
+
### 操作步骤
|
|
274
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
275
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
276
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
277
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
278
|
+
|
|
279
|
+
### 行为保持检查点
|
|
280
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
281
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
282
|
+
|
|
283
|
+
### 相关坏味道
|
|
284
|
+
- `SMELL-DUPLICATED-CODE`
|
|
285
|
+
- `SMELL-MUTABLE-DATA`
|
|
286
|
+
|
|
287
|
+
### 常见组合
|
|
288
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
289
|
+
|
|
290
|
+
### JavaScript 注意事项
|
|
291
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
292
|
+
|
|
293
|
+
### TypeScript 注意事项
|
|
294
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
295
|
+
|
|
296
|
+
### React 注意事项
|
|
297
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
298
|
+
|
|
299
|
+
### Vue 注意事项
|
|
300
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
301
|
+
|
|
302
|
+
### Frontend-Craft 前端适配
|
|
303
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
304
|
+
|
|
305
|
+
### 原创前端变换示例
|
|
306
|
+
- 把“Slide Statements”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
307
|
+
|
|
308
|
+
## RF-SPLIT-LOOP — 拆分循环(Split Loop)
|
|
309
|
+
|
|
310
|
+
### 意图
|
|
311
|
+
把同时承担多个独立任务的循环拆成多个聚焦循环。
|
|
312
|
+
|
|
313
|
+
### 典型信号
|
|
314
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
315
|
+
|
|
316
|
+
### 不适用条件
|
|
317
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
318
|
+
|
|
319
|
+
### 前置条件
|
|
320
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
321
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
322
|
+
|
|
323
|
+
### 操作步骤
|
|
324
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
325
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
326
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
327
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
328
|
+
|
|
329
|
+
### 行为保持检查点
|
|
330
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
331
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
332
|
+
|
|
333
|
+
### 相关坏味道
|
|
334
|
+
- `SMELL-LONG-FUNCTION`
|
|
335
|
+
|
|
336
|
+
### 常见组合
|
|
337
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
338
|
+
|
|
339
|
+
### JavaScript 注意事项
|
|
340
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
341
|
+
|
|
342
|
+
### TypeScript 注意事项
|
|
343
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
344
|
+
|
|
345
|
+
### React 注意事项
|
|
346
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
347
|
+
|
|
348
|
+
### Vue 注意事项
|
|
349
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
350
|
+
|
|
351
|
+
### Frontend-Craft 前端适配
|
|
352
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
353
|
+
|
|
354
|
+
### 原创前端变换示例
|
|
355
|
+
- 把“Split Loop”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
356
|
+
|
|
357
|
+
## RF-REPLACE-LOOP-WITH-PIPELINE — 以管道取代循环(Replace Loop with Pipeline)
|
|
358
|
+
|
|
359
|
+
### 意图
|
|
360
|
+
当循环本质是集合过滤、映射或聚合时,用意图更清晰的管道表达。
|
|
361
|
+
|
|
362
|
+
### 典型信号
|
|
363
|
+
- 当前结构出现与本手法目标一致的重复、耦合、命名、职责、数据所有权或控制流问题,并有具体代码证据。
|
|
364
|
+
|
|
365
|
+
### 不适用条件
|
|
366
|
+
- 当前结构已经清晰,或该变换会制造更强耦合、隐藏依赖、破坏公共契约且没有兼容方案时,不使用。
|
|
367
|
+
|
|
368
|
+
### 前置条件
|
|
369
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
370
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
371
|
+
|
|
372
|
+
### 操作步骤
|
|
373
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
374
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
375
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
376
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
377
|
+
|
|
378
|
+
### 行为保持检查点
|
|
379
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
380
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
381
|
+
|
|
382
|
+
### 相关坏味道
|
|
383
|
+
- `SMELL-LOOPS`
|
|
384
|
+
|
|
385
|
+
### 常见组合
|
|
386
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
387
|
+
|
|
388
|
+
### JavaScript 注意事项
|
|
389
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
390
|
+
|
|
391
|
+
### TypeScript 注意事项
|
|
392
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
393
|
+
|
|
394
|
+
### React 注意事项
|
|
395
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
396
|
+
|
|
397
|
+
### Vue 注意事项
|
|
398
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
399
|
+
|
|
400
|
+
### Frontend-Craft 前端适配
|
|
401
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
402
|
+
|
|
403
|
+
### 原创前端变换示例
|
|
404
|
+
- 把“Replace Loop with Pipeline”应用到一个局部组件/Hook/Composable/Service 范围内,先记录行为契约,只迁移一个职责片段,并立即验证输出、事件与状态变化保持不变。
|
|
405
|
+
|
|
406
|
+
## RF-REMOVE-DEAD-CODE — 移除死代码(Remove Dead Code)
|
|
407
|
+
|
|
408
|
+
### 意图
|
|
409
|
+
移除已经证明不存在运行时或受支持工具链用途的代码;实际发现和删除由现有 cleanup lane 执行。
|
|
410
|
+
|
|
411
|
+
### 典型信号
|
|
412
|
+
- 代码疑似无引用,但必须进一步检查 dynamic import、route、Storybook、i18n key、Tailwind 动态 class、runtime template 和外部消费者。
|
|
413
|
+
|
|
414
|
+
### 不适用条件
|
|
415
|
+
- 没有完成动态引用与外部消费者证明时,不执行删除。
|
|
416
|
+
|
|
417
|
+
### 前置条件
|
|
418
|
+
- 已明确当前可观察行为、受影响调用者和公共契约。
|
|
419
|
+
- 目标位于声明的差异预算内,并且这个单一主要变换完成后能够立即验证。
|
|
420
|
+
|
|
421
|
+
### 操作步骤
|
|
422
|
+
1. 确认当前行为、调用者和边界,并锁定本步骤只处理这一项主要结构意图。
|
|
423
|
+
2. 创建最小的新结构/位置/接口,让旧行为可以逐步迁移而不是一次性大改。
|
|
424
|
+
3. 一次迁移一个调用点或职责片段,并保持兼容边界。
|
|
425
|
+
4. 运行窄范围验证;若变红,先回滚本步骤,再缩小变换。
|
|
426
|
+
|
|
427
|
+
### 行为保持检查点
|
|
428
|
+
- 对比输入、输出、异常、副作用、执行顺序和公共契约。
|
|
429
|
+
- 前端还要核对 UI 状态、事件、焦点、网络请求、生命周期/状态迁移,以及相关对象身份语义。
|
|
430
|
+
|
|
431
|
+
### 相关坏味道
|
|
432
|
+
- `SMELL-SPECULATIVE-GENERALITY`
|
|
433
|
+
|
|
434
|
+
### 常见组合
|
|
435
|
+
- 不建立固定流水线;下一步必须重新依据证据选择。
|
|
436
|
+
|
|
437
|
+
### JavaScript 注意事项
|
|
438
|
+
- 模块初始化顺序、循环依赖、闭包和动态 import 会让“搬文件”变成行为变化。
|
|
439
|
+
|
|
440
|
+
### TypeScript 注意事项
|
|
441
|
+
- 保持导出类型、路径别名、包边界以及 type-only/runtime import 区别。
|
|
442
|
+
|
|
443
|
+
### React 注意事项
|
|
444
|
+
- 检查 Hook 规则、Server/Client 边界、lazy/Suspense、路由和事件顺序。
|
|
445
|
+
|
|
446
|
+
### Vue 注意事项
|
|
447
|
+
- 检查 composable 生命周期、Pinia 所有权、async setup、route guard 和 auto-import。
|
|
448
|
+
|
|
449
|
+
### Frontend-Craft 前端适配
|
|
450
|
+
- 行为应跟随数据所有权和变化责任;死代码实际删除必须经过专门 cleanup lane 的动态引用证明。
|
|
451
|
+
|
|
452
|
+
### 原创前端变换示例
|
|
453
|
+
- 某组件看似未使用时,先检查 lazy import、路由、Storybook、i18n、动态样式和 runtime template;实际删除交给 `fec-refactor-clean`。
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-refactoring-validation
|
|
3
|
+
description: 用于证明前端重构保持了既有行为、选择合适的安全网、逐步验证结构修改,或依据证据给出 PASS、PARTIAL、NOT PROVEN 的行为保持结论。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 技能:重构验证
|
|
7
|
+
|
|
8
|
+
## 用途
|
|
9
|
+
|
|
10
|
+
定义可观察行为契约,并为每个结构步骤选择足够且不过度的验证证据。
|
|
11
|
+
|
|
12
|
+
## 流程
|
|
13
|
+
|
|
14
|
+
1. 在重要编辑前记录相关行为契约。
|
|
15
|
+
2. 将安全网分为 A、B、C 三个等级。
|
|
16
|
+
3. 运行并记录修改前基线。
|
|
17
|
+
4. 根据当前步骤的风险和边界选择验证方式。
|
|
18
|
+
5. 每个结构步骤后立即运行最小有效检查。
|
|
19
|
+
6. 新增失败出现时先回滚当前步骤,再扩大排查。
|
|
20
|
+
7. 最后运行与影响面匹配的更广门禁。
|
|
21
|
+
8. 只按证据给出 PASS、PARTIAL 或 NOT PROVEN。
|
|
22
|
+
|
|
23
|
+
纯结构重构使用 **GREEN → REFACTOR → GREEN**。
|
|
24
|
+
|
|
25
|
+
## 安全网等级
|
|
26
|
+
|
|
27
|
+
| 等级 | 证据 | 执行建议 |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| A — 强 | 既有测试直接覆盖相关行为 | 直接作为主要安全网 |
|
|
30
|
+
| B — 部分 | 重要行为覆盖不完整 | 高风险步骤前补当前行为的特征测试 |
|
|
31
|
+
| C — 无 | 没有有效自动化覆盖 | 不自动安装框架;CAUTION/DANGER 默认只规划,除非已授权补最小安全网 |
|
|
32
|
+
|
|
33
|
+
## 前端行为契约清单
|
|
34
|
+
|
|
35
|
+
按实际范围检查:函数输入输出、异常和错误映射;DOM、可见状态、焦点、键盘和无障碍语义;props、emits、slots、Hook/Composable 返回值和事件顺序;请求、载荷、取消、重试、缓存键和加载/错误状态;store、持久化、对象身份、memoization、响应式和生命周期;路由、URL、guard、包导出、序列化字段和后端 DTO。
|
|
36
|
+
|
|
37
|
+
## 参考资料
|
|
38
|
+
|
|
39
|
+
- 构建行为契约和证明等级见 [behavior-preservation.md](references/behavior-preservation.md)。
|
|
40
|
+
- 按前端风险选择目标验证见 [refactoring-test-checklist.md](references/refactoring-test-checklist.md)。
|
|
41
|
+
|
|
42
|
+
## 约束
|
|
43
|
+
|
|
44
|
+
- 无关测试通过不能证明行为保持。
|
|
45
|
+
- 只在修改后新增并通过的测试,证据弱于可比较的修改前基线。
|
|
46
|
+
- 不因为重构改变了行为就改测试期望值。
|
|
47
|
+
- 证据不足时不能用 PASS 掩盖缺口。
|
|
48
|
+
- 未经明确授权不安装新的测试框架。
|
|
49
|
+
|
|
50
|
+
## 预期输出
|
|
51
|
+
|
|
52
|
+
输出行为契约、基线状态、安全网等级、逐步验证、最终门禁、覆盖缺口,以及 PASS、PARTIAL 或 NOT PROVEN 结论。
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 行为保持
|
|
2
|
+
|
|
3
|
+
## 构建行为契约
|
|
4
|
+
|
|
5
|
+
开始结构修改前,只记录受影响边界真正需要保持的观察结果:输入和归一化、返回值和顺序、异常/错误、副作用、UI 状态、焦点和事件、请求与状态迁移、持久化、React/Vue 身份语义、公开导出、路由和序列化字段。
|
|
6
|
+
|
|
7
|
+
## 特征测试
|
|
8
|
+
|
|
9
|
+
重要行为缺乏覆盖时,在风险较高的结构修改前补一个描述当前实际行为的窄范围测试。它首次运行可以直接通过,因为目标是锁定既有行为,不是增加新要求。
|
|
10
|
+
|
|
11
|
+
## 结论等级
|
|
12
|
+
|
|
13
|
+
- **PASS**:相关契约明确,修改前后基线可比较,要求的检查通过。
|
|
14
|
+
- **PARTIAL**:检查通过,但仍有重要路径缺乏足够自动化或可重复证据。
|
|
15
|
+
- **NOT PROVEN**:依赖无法安装、工具无法运行、基线不清或安全网不足,不能可信证明行为保持。
|
package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 重构验证检查表
|
|
2
|
+
|
|
3
|
+
## 局部函数/模块
|
|
4
|
+
|
|
5
|
+
检查目标单测、受影响模块类型、调用方契约以及公开导出是否保持。
|
|
6
|
+
|
|
7
|
+
## React
|
|
8
|
+
|
|
9
|
+
检查 Hook 顺序和依赖、闭包时效、受控/非受控状态所有权、memoization/引用相等、effect 清理和请求取消、事件顺序以及相关 Server/Client 与水合边界。
|
|
10
|
+
|
|
11
|
+
## Vue
|
|
12
|
+
|
|
13
|
+
检查 `ref`/`reactive` 身份和解包、computed 是否仍保持派生语义、watch source/flush/cleanup、props/emits/slots/expose 以及 Pinia 状态和持久化。
|
|
14
|
+
|
|
15
|
+
## API 与数据
|
|
16
|
+
|
|
17
|
+
检查请求形状、header、认证刷新、取消、重试和错误;字段改名是否越过 DTO/存储/URL/后端契约;排序和过滤是否保留顺序、重复项和边界值;值对象/引用对象转换是否保持必要身份。
|
|
18
|
+
|
|
19
|
+
## 路由与运行时注册
|
|
20
|
+
|
|
21
|
+
检查 route name/path/guard、dynamic import、lazy 注册、Storybook、i18n、CSS/Tailwind 动态 class、运行时模板和生成 metadata。
|
|
22
|
+
|
|
23
|
+
## 最终阶梯
|
|
24
|
+
|
|
25
|
+
按“目标测试 → 受影响集成 → lint/typecheck → 全量测试 → build → 实际受影响的 E2E/SSR/视觉/无障碍/性能门禁”逐步扩大验证。
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-responsive-layout
|
|
3
|
+
description: 用于设计、实现或审查响应式前端布局、移动优先断点、容器查询、流式网格、数据密集表格、触摸目标、安全区域、横竖屏变化、视口溢出或跨设备 UI 行为;中文触发词包括 响应式布局、移动端适配、断点、容器查询、横竖屏、触摸目标。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 响应式布局
|
|
7
|
+
|
|
8
|
+
适用于需要让页面、工具界面、表格、仪表盘或组件在多设备上稳定工作的前端任务。需要布局模式和检查清单时加载 [references/responsive-layout-patterns.md](references/responsive-layout-patterns.md)。
|
|
9
|
+
|
|
10
|
+
## 用途
|
|
11
|
+
|
|
12
|
+
用内容优先、移动优先和容器感知的方式设计响应式布局,避免只靠固定断点修补溢出。
|
|
13
|
+
|
|
14
|
+
## 流程
|
|
15
|
+
|
|
16
|
+
1. 明确信息优先级:小屏先保留核心任务、关键操作和反馈;次要信息折叠、延后或移入详情层。
|
|
17
|
+
2. 选择布局策略:简单页面用 mobile-first 断点;嵌套组件、卡片网格和侧栏优先考虑 container query。
|
|
18
|
+
3. 设计流式尺寸:用 `minmax()`、`clamp()`、`aspect-ratio`、`max-width`、`min-width: 0` 和稳定网格轨道控制伸缩。
|
|
19
|
+
4. 处理数据密集界面:表格、列表、看板和编辑器需要明确横向滚动、列优先级、冻结列或移动端摘要视图。
|
|
20
|
+
5. 保证触摸与键盘:触摸目标、焦点路径、hover 替代、虚拟键盘、安全区域和横竖屏切换都要复核。
|
|
21
|
+
6. 关联性能与资源:移动端减少首屏大图、重型图表、同步动画和不必要列渲染。
|
|
22
|
+
7. 验证断点之间:检查 375px、768px、1024px、1440px,以及断点中间值是否溢出、遮挡或跳变。
|
|
23
|
+
|
|
24
|
+
## 约束
|
|
25
|
+
|
|
26
|
+
- 不把桌面版缩小当作移动端设计。
|
|
27
|
+
- 不让关键功能只依赖 hover 或宽屏侧栏。
|
|
28
|
+
- 不用固定高度掩盖内容变化;需要固定格式时用稳定约束和可滚动区域。
|
|
29
|
+
- 不用 viewport 字体缩放替代真实排版层级。
|
|
30
|
+
- 不让移动端横向溢出成为默认解决方案;只有数据表、画布或编辑器等明确场景可以局部横滚。
|
|
31
|
+
|
|
32
|
+
## 预期输出
|
|
33
|
+
|
|
34
|
+
输出响应式信息优先级、断点或容器策略、关键组件布局模式、触摸/键盘要求、数据密集区域处理方案和验证结果。完成后页面在常见视口和输入方式下不溢出、不遮挡、可操作。
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# 响应式布局模式
|
|
2
|
+
|
|
3
|
+
## 策略选择
|
|
4
|
+
|
|
5
|
+
| 场景 | 策略 |
|
|
6
|
+
| ---- | ---- |
|
|
7
|
+
| 页面级结构 | 移动优先断点 |
|
|
8
|
+
| 会被放进未知父容器的复用组件 | 容器查询 |
|
|
9
|
+
| 卡片网格 | `repeat(auto-fit, minmax())`,并设置合理最小宽度 |
|
|
10
|
+
| 数据表格 | 列优先级、横向滚动或移动端摘要行 |
|
|
11
|
+
| 编辑器 / 画布 / dashboard | 稳定外壳 + 可滚动工作区 |
|
|
12
|
+
|
|
13
|
+
## CSS 模式
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
.card-grid {
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
|
|
19
|
+
gap: 1rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.panel {
|
|
23
|
+
min-width: 0;
|
|
24
|
+
container-type: inline-size;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@container (min-width: 42rem) {
|
|
28
|
+
.panel-body {
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: 16rem minmax(0, 1fr);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
当 grid/flex 子项包含长文本、表格、代码、图表或媒体时,给子项设置 `min-width: 0`。
|
|
36
|
+
|
|
37
|
+
## 数据密集型界面
|
|
38
|
+
|
|
39
|
+
- 编码前先确定移动端列优先级。
|
|
40
|
+
- 主标识、状态和主要操作保持可见。
|
|
41
|
+
- 低优先级元数据移入详情行、抽屉或可展开面板。
|
|
42
|
+
- 小屏仍要保留排序、筛选、分页和选择能力。
|
|
43
|
+
- 虚拟滚动只解决 DOM 数量问题,不能解决信息层级问题。
|
|
44
|
+
- 表格可以局部横向滚动,但页面整体不应出现无意水平溢出。
|
|
45
|
+
|
|
46
|
+
## 响应式媒体
|
|
47
|
+
|
|
48
|
+
- 图片和视频要有稳定尺寸、`aspect-ratio` 或容器约束,避免加载后推挤布局。
|
|
49
|
+
- 需要多尺寸资源时使用 `srcset`、`sizes` 或 `<picture>`,不要让移动端下载桌面大图。
|
|
50
|
+
- 非首屏图片默认懒加载;首屏主体图按框架能力设置明确优先级。
|
|
51
|
+
- 媒体裁切必须保留主体信息;不要为了填满卡片裁掉产品、人物、图表关键区域。
|
|
52
|
+
|
|
53
|
+
## 触控与视口检查
|
|
54
|
+
|
|
55
|
+
- 空间允许时,交互目标至少 44x44px。
|
|
56
|
+
- 移动端输入框字号避免低于 16px。
|
|
57
|
+
- 固定底部栏和操作条必须考虑 `env(safe-area-inset-bottom)`。
|
|
58
|
+
- 对话框和抽屉需要适配虚拟键盘导致的视口变化。
|
|
59
|
+
- 只在 hover 时出现的内容必须提供点击、焦点或常驻可见替代方案。
|
|
60
|
+
- iOS/Android 横竖屏切换后,主操作、焦点位置和滚动容器仍应可达。
|
|
61
|
+
- 需要局部滚动的区域应明确最大高度和滚动边界,避免页面和内部容器互相抢滚动。
|
|
62
|
+
|
|
63
|
+
## 验证清单
|
|
64
|
+
|
|
65
|
+
- 320-375px:页面级没有横向溢出。
|
|
66
|
+
- 768px:布局切换后阅读顺序仍然合理。
|
|
67
|
+
- 1024-1440px:内容宽度有约束,扫描路径清晰。
|
|
68
|
+
- 长标签、翻译文本、数字以及 empty/error/loading 状态不会撑坏固定格式控件。
|
|
69
|
+
- 横竖屏切换不会困住焦点或隐藏主操作。
|
|
70
|
+
- 虚拟键盘弹出时,输入框、提交按钮和错误提示不被遮挡。
|