@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-web-video-presentation/scripts/create-video-presentation.mjs
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const skillDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const themesPath = path.join(skillDir, "data", "starter-themes.json");
|
|
8
|
+
const themes = JSON.parse(fs.readFileSync(themesPath, "utf8"));
|
|
9
|
+
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
const options = parseArgs(args);
|
|
12
|
+
|
|
13
|
+
if (options.help) {
|
|
14
|
+
printHelp();
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (options.listThemes) {
|
|
19
|
+
for (const theme of themes) {
|
|
20
|
+
console.log(`${theme.id}\t${theme.name}\t${theme.bestFor}`);
|
|
21
|
+
}
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const target = path.resolve(process.cwd(), options.target ?? "presentation");
|
|
26
|
+
const theme = themes.find((candidate) => candidate.id === options.theme);
|
|
27
|
+
|
|
28
|
+
if (!theme) {
|
|
29
|
+
fail(`Unknown theme "${options.theme}". Run with --list-themes to see available themes.`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const files = buildFiles(theme);
|
|
33
|
+
|
|
34
|
+
if (options.dryRun) {
|
|
35
|
+
console.log(`Would create ${files.length} files in ${target}`);
|
|
36
|
+
console.log(`Theme: ${theme.id} (${theme.name})`);
|
|
37
|
+
for (const file of files) console.log(`- ${file.name}`);
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (fs.existsSync(target) && fs.readdirSync(target).length > 0) {
|
|
42
|
+
fail(`Target directory is not empty: ${target}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (const file of files) {
|
|
46
|
+
const fullPath = path.join(target, file.name);
|
|
47
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
48
|
+
fs.writeFileSync(fullPath, file.body, "utf8");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(`Created web video presentation at ${target}`);
|
|
52
|
+
console.log(`Theme: ${theme.id} (${theme.name})`);
|
|
53
|
+
console.log("Next:");
|
|
54
|
+
console.log(" cd " + path.relative(process.cwd(), target));
|
|
55
|
+
console.log(" npm install");
|
|
56
|
+
console.log(" npm run dev");
|
|
57
|
+
|
|
58
|
+
function parseArgs(values) {
|
|
59
|
+
const out = {
|
|
60
|
+
dryRun: false,
|
|
61
|
+
help: false,
|
|
62
|
+
listThemes: false,
|
|
63
|
+
target: undefined,
|
|
64
|
+
theme: themes[0]?.id ?? "editorial-slate",
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
68
|
+
const value = values[index];
|
|
69
|
+
if (value === "--help" || value === "-h") out.help = true;
|
|
70
|
+
else if (value === "--dry-run") out.dryRun = true;
|
|
71
|
+
else if (value === "--list-themes") out.listThemes = true;
|
|
72
|
+
else if (value.startsWith("--theme=")) out.theme = value.slice("--theme=".length);
|
|
73
|
+
else if (value === "--theme") {
|
|
74
|
+
const next = values[index + 1];
|
|
75
|
+
if (!next || next.startsWith("--")) fail("Missing value for --theme.");
|
|
76
|
+
out.theme = next;
|
|
77
|
+
index += 1;
|
|
78
|
+
}
|
|
79
|
+
else if (value.startsWith("--")) fail(`Unknown option: ${value}`);
|
|
80
|
+
else if (!out.target) out.target = value;
|
|
81
|
+
else fail(`Unexpected argument: ${value}`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function buildFiles(theme) {
|
|
88
|
+
const tokenCss = renderTokens(theme.tokens);
|
|
89
|
+
return [
|
|
90
|
+
{
|
|
91
|
+
name: "package.json",
|
|
92
|
+
body: JSON.stringify(
|
|
93
|
+
{
|
|
94
|
+
scripts: {
|
|
95
|
+
dev: "vite",
|
|
96
|
+
build: "tsc --noEmit && vite build",
|
|
97
|
+
preview: "vite preview",
|
|
98
|
+
},
|
|
99
|
+
dependencies: {
|
|
100
|
+
react: "latest",
|
|
101
|
+
"react-dom": "latest",
|
|
102
|
+
},
|
|
103
|
+
devDependencies: {
|
|
104
|
+
"@types/react": "latest",
|
|
105
|
+
"@types/react-dom": "latest",
|
|
106
|
+
"@vitejs/plugin-react": "latest",
|
|
107
|
+
typescript: "latest",
|
|
108
|
+
vite: "latest",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
null,
|
|
112
|
+
2,
|
|
113
|
+
) + "\n",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "index.html",
|
|
117
|
+
body: `<!doctype html>
|
|
118
|
+
<html lang="en">
|
|
119
|
+
<head>
|
|
120
|
+
<meta charset="UTF-8" />
|
|
121
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
122
|
+
<title>Web Video Presentation</title>
|
|
123
|
+
</head>
|
|
124
|
+
<body>
|
|
125
|
+
<div id="root"></div>
|
|
126
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
127
|
+
</body>
|
|
128
|
+
</html>
|
|
129
|
+
`,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "tsconfig.json",
|
|
133
|
+
body: JSON.stringify(
|
|
134
|
+
{
|
|
135
|
+
compilerOptions: {
|
|
136
|
+
target: "ES2022",
|
|
137
|
+
useDefineForClassFields: true,
|
|
138
|
+
lib: ["DOM", "DOM.Iterable", "ES2022"],
|
|
139
|
+
allowJs: false,
|
|
140
|
+
skipLibCheck: true,
|
|
141
|
+
esModuleInterop: true,
|
|
142
|
+
allowSyntheticDefaultImports: true,
|
|
143
|
+
strict: true,
|
|
144
|
+
forceConsistentCasingInFileNames: true,
|
|
145
|
+
module: "ESNext",
|
|
146
|
+
moduleResolution: "Node",
|
|
147
|
+
resolveJsonModule: true,
|
|
148
|
+
isolatedModules: true,
|
|
149
|
+
noEmit: true,
|
|
150
|
+
jsx: "react-jsx",
|
|
151
|
+
},
|
|
152
|
+
include: ["src"],
|
|
153
|
+
},
|
|
154
|
+
null,
|
|
155
|
+
2,
|
|
156
|
+
) + "\n",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "vite.config.ts",
|
|
160
|
+
body: `import { defineConfig } from 'vite';
|
|
161
|
+
import react from '@vitejs/plugin-react';
|
|
162
|
+
|
|
163
|
+
export default defineConfig({
|
|
164
|
+
plugins: [react()],
|
|
165
|
+
});
|
|
166
|
+
`,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "src/main.tsx",
|
|
170
|
+
body: `import React, { useEffect, useMemo, useState } from 'react';
|
|
171
|
+
import { createRoot } from 'react-dom/client';
|
|
172
|
+
import './styles.css';
|
|
173
|
+
|
|
174
|
+
type Scene = {
|
|
175
|
+
eyebrow: string;
|
|
176
|
+
title: string;
|
|
177
|
+
body: string;
|
|
178
|
+
detail: string;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const scenes: Scene[] = [
|
|
182
|
+
{
|
|
183
|
+
eyebrow: '01 / Hook',
|
|
184
|
+
title: 'Replace this with the first spoken beat',
|
|
185
|
+
body: 'One step equals one idea. Keep it readable in a 1080p recording.',
|
|
186
|
+
detail: 'Use source facts, product states, diagrams, or real assets to make the screen specific.',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
eyebrow: '02 / Proof',
|
|
190
|
+
title: 'Show the evidence, not a generic slide',
|
|
191
|
+
body: 'Turn a claim into a visual: timeline, interface state, metric, map, comparison, or system diagram.',
|
|
192
|
+
detail: 'Advance with Space, ArrowRight, PageDown, or click. Go back with ArrowLeft or PageUp.',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
eyebrow: '03 / Close',
|
|
196
|
+
title: 'End on the idea the viewer should remember',
|
|
197
|
+
body: 'Swap this starter content for your script and outline.',
|
|
198
|
+
detail: 'Controls stay quiet so the stage is clean for recording.',
|
|
199
|
+
},
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
const storageKey = 'fec-web-video-presentation-step-v1';
|
|
203
|
+
|
|
204
|
+
function App() {
|
|
205
|
+
const [step, setStep] = useState(() => Number(localStorage.getItem(storageKey) ?? 0));
|
|
206
|
+
const current = scenes[Math.min(Math.max(step, 0), scenes.length - 1)];
|
|
207
|
+
const progress = useMemo(() => ((step + 1) / scenes.length) * 100, [step]);
|
|
208
|
+
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
localStorage.setItem(storageKey, String(step));
|
|
211
|
+
}, [step]);
|
|
212
|
+
|
|
213
|
+
useEffect(() => {
|
|
214
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
215
|
+
if (event.key === 'ArrowRight' || event.key === 'PageDown' || event.key === ' ') {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
setStep((value) => Math.min(value + 1, scenes.length - 1));
|
|
218
|
+
}
|
|
219
|
+
if (event.key === 'ArrowLeft' || event.key === 'PageUp') {
|
|
220
|
+
event.preventDefault();
|
|
221
|
+
setStep((value) => Math.max(value - 1, 0));
|
|
222
|
+
}
|
|
223
|
+
if (event.key.toLowerCase() === 'r') {
|
|
224
|
+
setStep(0);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
window.addEventListener('keydown', onKeyDown);
|
|
228
|
+
return () => window.removeEventListener('keydown', onKeyDown);
|
|
229
|
+
}, []);
|
|
230
|
+
|
|
231
|
+
return (
|
|
232
|
+
<main className="viewport" onClick={() => setStep((value) => Math.min(value + 1, scenes.length - 1))}>
|
|
233
|
+
<section className="stage" aria-live="polite">
|
|
234
|
+
<div className="scene-grid">
|
|
235
|
+
<div className="copy">
|
|
236
|
+
<p className="eyebrow">{current.eyebrow}</p>
|
|
237
|
+
<h1>{current.title}</h1>
|
|
238
|
+
<p className="body">{current.body}</p>
|
|
239
|
+
</div>
|
|
240
|
+
<div className="visual" aria-label="Visual evidence placeholder">
|
|
241
|
+
<span>{String(step + 1).padStart(2, '0')}</span>
|
|
242
|
+
<p>{current.detail}</p>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
<div className="progress" aria-hidden="true">
|
|
246
|
+
<span style={{ width: \`\${progress}%\` }} />
|
|
247
|
+
</div>
|
|
248
|
+
</section>
|
|
249
|
+
</main>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
createRoot(document.getElementById('root')!).render(<App />);
|
|
254
|
+
`,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "src/styles.css",
|
|
258
|
+
body: `${tokenCss}
|
|
259
|
+
|
|
260
|
+
* {
|
|
261
|
+
box-sizing: border-box;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
html,
|
|
265
|
+
body,
|
|
266
|
+
#root {
|
|
267
|
+
margin: 0;
|
|
268
|
+
min-height: 100%;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
body {
|
|
272
|
+
background: #111;
|
|
273
|
+
color: var(--stage-fg);
|
|
274
|
+
font-family: var(--font-body);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.viewport {
|
|
278
|
+
min-height: 100vh;
|
|
279
|
+
display: grid;
|
|
280
|
+
place-items: center;
|
|
281
|
+
padding: 24px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.stage {
|
|
285
|
+
width: min(100vw - 48px, calc((100vh - 48px) * 16 / 9));
|
|
286
|
+
aspect-ratio: 16 / 9;
|
|
287
|
+
position: relative;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
background: var(--stage-bg);
|
|
290
|
+
color: var(--stage-fg);
|
|
291
|
+
box-shadow: var(--shadow);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.scene-grid {
|
|
295
|
+
height: 100%;
|
|
296
|
+
display: grid;
|
|
297
|
+
grid-template-columns: 1.12fr 0.88fr;
|
|
298
|
+
gap: 72px;
|
|
299
|
+
align-items: center;
|
|
300
|
+
padding: 96px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.eyebrow {
|
|
304
|
+
color: var(--accent);
|
|
305
|
+
font-size: 24px;
|
|
306
|
+
font-weight: 700;
|
|
307
|
+
margin: 0 0 26px;
|
|
308
|
+
text-transform: uppercase;
|
|
309
|
+
letter-spacing: 0.08em;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
h1 {
|
|
313
|
+
font-family: var(--font-display);
|
|
314
|
+
font-size: clamp(48px, 6vw, 104px);
|
|
315
|
+
line-height: 0.96;
|
|
316
|
+
letter-spacing: 0;
|
|
317
|
+
margin: 0;
|
|
318
|
+
text-wrap: balance;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.body {
|
|
322
|
+
color: var(--muted-fg);
|
|
323
|
+
font-size: 32px;
|
|
324
|
+
line-height: 1.35;
|
|
325
|
+
margin: 36px 0 0;
|
|
326
|
+
max-width: 820px;
|
|
327
|
+
text-wrap: pretty;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.visual {
|
|
331
|
+
min-height: 560px;
|
|
332
|
+
border: 1px solid var(--line);
|
|
333
|
+
border-radius: var(--radius);
|
|
334
|
+
background: var(--panel);
|
|
335
|
+
display: grid;
|
|
336
|
+
align-content: space-between;
|
|
337
|
+
padding: 42px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.visual span {
|
|
341
|
+
color: var(--accent-2);
|
|
342
|
+
font-family: var(--font-display);
|
|
343
|
+
font-size: 132px;
|
|
344
|
+
line-height: 1;
|
|
345
|
+
font-variant-numeric: tabular-nums;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.visual p {
|
|
349
|
+
margin: 0;
|
|
350
|
+
color: var(--muted-fg);
|
|
351
|
+
font-size: 26px;
|
|
352
|
+
line-height: 1.4;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.progress {
|
|
356
|
+
position: absolute;
|
|
357
|
+
left: 32px;
|
|
358
|
+
right: 32px;
|
|
359
|
+
bottom: 28px;
|
|
360
|
+
height: 3px;
|
|
361
|
+
background: color-mix(in srgb, var(--line) 70%, transparent);
|
|
362
|
+
opacity: 0;
|
|
363
|
+
transition: opacity 160ms ease;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.stage:hover .progress,
|
|
367
|
+
.stage:focus-within .progress {
|
|
368
|
+
opacity: 1;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.progress span {
|
|
372
|
+
display: block;
|
|
373
|
+
height: 100%;
|
|
374
|
+
background: var(--accent);
|
|
375
|
+
transition: width var(--step-duration) ease;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
@media (prefers-reduced-motion: reduce) {
|
|
379
|
+
.progress,
|
|
380
|
+
.progress span {
|
|
381
|
+
transition: none;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
`,
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
name: "README.md",
|
|
388
|
+
body: `# Web Video Presentation
|
|
389
|
+
|
|
390
|
+
Generated with Frontend Craft.
|
|
391
|
+
|
|
392
|
+
- 16:9 browser recording stage
|
|
393
|
+
- Step-driven scenes
|
|
394
|
+
- Keyboard and click navigation
|
|
395
|
+
- Theme tokens in \`src/styles.css\`
|
|
396
|
+
|
|
397
|
+
Replace the starter scenes in \`src/main.tsx\` with your script and outline.
|
|
398
|
+
`,
|
|
399
|
+
},
|
|
400
|
+
];
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function renderTokens(tokens) {
|
|
404
|
+
return `:root {
|
|
405
|
+
--stage-bg: ${tokens.stageBg};
|
|
406
|
+
--stage-fg: ${tokens.stageFg};
|
|
407
|
+
--muted-fg: ${tokens.mutedFg};
|
|
408
|
+
--accent: ${tokens.accent};
|
|
409
|
+
--accent-2: ${tokens.accent2};
|
|
410
|
+
--panel: ${tokens.panel};
|
|
411
|
+
--line: ${tokens.line};
|
|
412
|
+
--shadow: ${tokens.shadow};
|
|
413
|
+
--font-display: ${tokens.fontDisplay};
|
|
414
|
+
--font-body: ${tokens.fontBody};
|
|
415
|
+
--radius: ${tokens.radius};
|
|
416
|
+
--step-duration: ${tokens.stepDuration};
|
|
417
|
+
}`;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function printHelp() {
|
|
421
|
+
console.log(`Usage:
|
|
422
|
+
node skills/fec-web-video-presentation/scripts/create-video-presentation.mjs [target] [--theme=<id>] [--dry-run]
|
|
423
|
+
node skills/fec-web-video-presentation/scripts/create-video-presentation.mjs --list-themes
|
|
424
|
+
`);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function fail(message) {
|
|
428
|
+
console.error(`[create-video-presentation] ${message}`);
|
|
429
|
+
process.exit(1);
|
|
430
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-web-workers
|
|
3
|
+
description: 用于将昂贵的浏览器工作移出主线程,涉及 Web Workers、SharedWorker、worker 池、Comlink、transferable objects、Vite/Webpack worker 集成或 UI 响应性修复。不要用于轻量同步工作或 DOM 操作;中文触发词包括 Web Worker、后台线程、主线程阻塞。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web Workers
|
|
7
|
+
|
|
8
|
+
## 用途
|
|
9
|
+
|
|
10
|
+
把昂贵计算移出主线程,保持输入、滚动和动画响应。
|
|
11
|
+
|
|
12
|
+
## 流程
|
|
13
|
+
|
|
14
|
+
1. 先确认瓶颈:任务超过约 10ms、用户输入延迟明显、FPS 下滑或大文件解析/图像处理/加密计算才考虑 Worker。
|
|
15
|
+
2. 选择通信模型:简单任务用 `postMessage`,函数式 RPC 用 Comlink,大量并行小任务用 Worker pool,跨 Tab 同步用 SharedWorker。
|
|
16
|
+
3. 设计消息协议:请求/响应类型、错误类型、取消或超时策略都要明确。
|
|
17
|
+
4. 传大对象时优先 Transferable Objects;不要让结构化克隆吞掉 Worker 带来的收益。
|
|
18
|
+
5. 在组件或页面卸载时 `terminate()`,并通过 Profiler、Performance 面板或 FPS 指标验证主线程改善。
|
|
19
|
+
|
|
20
|
+
## 详细参考
|
|
21
|
+
|
|
22
|
+
- 需要原生 Worker 文件、构建工具导入、React 生命周期封装和清理示例时,加载 [references/basic-worker.md](references/basic-worker.md)。
|
|
23
|
+
- 需要 Transferable Objects、Comlink、Worker pool、SharedWorker、CSP 和 SharedArrayBuffer 注意事项时,加载 [references/advanced-workers.md](references/advanced-workers.md)。
|
|
24
|
+
|
|
25
|
+
## 约束
|
|
26
|
+
|
|
27
|
+
- Worker 内不能访问 DOM、`window`、`document`、`alert()` 或同步 `localStorage`。
|
|
28
|
+
- 高频通信可能比主线程计算更慢;先测量再拆分。
|
|
29
|
+
- Worker 文件必须同源加载,并受 `worker-src` CSP 限制。
|
|
30
|
+
- 大型二进制数据优先 transfer,transfer 后原引用会失效。
|
|
31
|
+
- 每个 Worker 有独立 JS 堆,必须主动管理生命周期和内存。
|
|
32
|
+
|
|
33
|
+
## 预期输出
|
|
34
|
+
|
|
35
|
+
计算密集型操作在后台线程执行,主线程输入和滚动恢复流畅,错误与取消路径明确,Worker 在卸载时被终止且无内存泄漏。
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 高级 Worker 模式
|
|
2
|
+
|
|
3
|
+
## 可转移对象
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const buffer = new ArrayBuffer(10 * 1024 * 1024);
|
|
7
|
+
worker.postMessage(buffer, [buffer]);
|
|
8
|
+
// transfer 后主线程中的 buffer.byteLength 变为 0。
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
适用于图片像素、音频采样、大型二进制文件。不要在 transfer 后继续读取原引用。
|
|
12
|
+
|
|
13
|
+
## Comlink
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// math.worker.ts
|
|
17
|
+
import { expose } from "comlink";
|
|
18
|
+
|
|
19
|
+
const mathApi = {
|
|
20
|
+
batchProcess(items: number[]) {
|
|
21
|
+
return items.map((item) => item * 2);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
expose(mathApi);
|
|
26
|
+
export type MathApi = typeof mathApi;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { wrap } from "comlink";
|
|
31
|
+
import MathWorker from "./math.worker?worker";
|
|
32
|
+
import type { MathApi } from "./math.worker";
|
|
33
|
+
|
|
34
|
+
const mathApi = wrap<MathApi>(new MathWorker());
|
|
35
|
+
const result = await mathApi.batchProcess([1, 2, 3]);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Worker 池
|
|
39
|
+
|
|
40
|
+
- 适合大量独立任务,不适合强顺序依赖任务。
|
|
41
|
+
- 默认 pool size 不要超过 `navigator.hardwareConcurrency`。
|
|
42
|
+
- 队列中任务需要超时、取消或页面卸载清理策略。
|
|
43
|
+
|
|
44
|
+
## SharedWorker
|
|
45
|
+
|
|
46
|
+
- 适合跨 Tab 共享连接或广播状态。
|
|
47
|
+
- 兼容性弱于 Dedicated Worker,必须先确认目标浏览器。
|
|
48
|
+
- 每个连接使用 `MessagePort`,需要 `port.start()`。
|
|
49
|
+
|
|
50
|
+
## 安全与兼容
|
|
51
|
+
|
|
52
|
+
- CSP 需允许 `worker-src`。
|
|
53
|
+
- `SharedArrayBuffer` 需要 COOP/COEP 头。
|
|
54
|
+
- Worker 中可用 IndexedDB,但不可用同步 localStorage。
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# 基础 Worker 与生命周期
|
|
2
|
+
|
|
3
|
+
## Worker 文件
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
// workers/heavy-compute.worker.ts
|
|
7
|
+
self.onmessage = (event: MessageEvent<{ numbers: number[] }>) => {
|
|
8
|
+
const result = [...event.data.numbers].sort((a, b) => a - b);
|
|
9
|
+
self.postMessage(result);
|
|
10
|
+
};
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Vite 导入
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import HeavyComputeWorker from "./workers/heavy-compute.worker?worker";
|
|
17
|
+
|
|
18
|
+
const worker = new HeavyComputeWorker();
|
|
19
|
+
worker.postMessage({ numbers: [3, 1, 4, 1, 5] });
|
|
20
|
+
worker.onmessage = (event: MessageEvent<number[]>) => {
|
|
21
|
+
console.log(event.data);
|
|
22
|
+
};
|
|
23
|
+
worker.onerror = (error) => {
|
|
24
|
+
console.error(error.message);
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## React 生命周期封装
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
32
|
+
|
|
33
|
+
export function useWorker<TRequest, TResult>(factory: () => Worker) {
|
|
34
|
+
const workerRef = useRef<Worker | null>(null);
|
|
35
|
+
const [result, setResult] = useState<TResult | null>(null);
|
|
36
|
+
const [error, setError] = useState<string | null>(null);
|
|
37
|
+
const [isRunning, setIsRunning] = useState(false);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const worker = factory();
|
|
41
|
+
workerRef.current = worker;
|
|
42
|
+
worker.onmessage = (event: MessageEvent<TResult>) => {
|
|
43
|
+
setResult(event.data);
|
|
44
|
+
setIsRunning(false);
|
|
45
|
+
};
|
|
46
|
+
worker.onerror = (event) => {
|
|
47
|
+
setError(event.message);
|
|
48
|
+
setIsRunning(false);
|
|
49
|
+
};
|
|
50
|
+
return () => worker.terminate();
|
|
51
|
+
}, [factory]);
|
|
52
|
+
|
|
53
|
+
const run = useCallback((data: TRequest) => {
|
|
54
|
+
setIsRunning(true);
|
|
55
|
+
setError(null);
|
|
56
|
+
workerRef.current?.postMessage(data);
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
return { run, result, error, isRunning };
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 验证
|
|
64
|
+
|
|
65
|
+
- Performance 面板中长任务减少。
|
|
66
|
+
- 用户输入延迟下降。
|
|
67
|
+
- 组件卸载后没有继续收到 worker message。
|