@bovinphang/frontend-craft 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +34 -0
- package/CHANGELOG.zh-CN.md +34 -0
- package/README.md +1 -1
- package/README.openclaw.md +99 -43
- package/README.openclaw.zh-CN.md +99 -43
- package/README.zh-CN.md +1 -1
- package/agents/fec-architect.md +70 -70
- package/agents/fec-code-reviewer.md +82 -82
- package/agents/fec-debugger.md +20 -20
- package/agents/fec-design-token-mapper.md +36 -36
- package/agents/fec-doc-updater.md +13 -13
- package/agents/fec-e2e-runner.md +45 -45
- package/agents/fec-figma-implementer.md +59 -59
- package/agents/fec-performance-optimizer.md +128 -128
- package/agents/fec-refactor-cleaner.md +14 -14
- package/agents/fec-security-reviewer.md +66 -67
- package/agents/fec-test-planner.md +27 -27
- package/agents/fec-typescript-reviewer.md +87 -87
- package/agents/fec-ui-checker.md +74 -74
- package/commands/fec-debug.md +19 -19
- package/commands/fec-doc-sync.md +11 -11
- package/commands/fec-init.md +37 -38
- package/commands/fec-plan.md +58 -58
- package/commands/fec-refactor-clean.md +11 -11
- package/commands/fec-review.md +41 -41
- package/commands/fec-scaffold.md +41 -41
- package/commands/fec-tdd.md +13 -13
- package/dist/bin/frontend-craft.js +29 -27
- package/docs/example-prompts.md +3 -0
- package/docs/ja-JP/README.md +1 -1
- package/docs/ko-KR/README.md +1 -1
- package/docs/project-structure.md +13 -5
- package/docs/zh-CN/example-prompts.md +3 -0
- package/docs/zh-CN/project-structure.md +6 -1
- package/docs/zh-TW/README.md +1 -1
- package/localized/zh-CN/agents/fec-architect.md +125 -0
- package/localized/zh-CN/agents/fec-code-reviewer.md +152 -0
- package/localized/zh-CN/agents/fec-debugger.md +44 -0
- package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
- package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
- package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
- package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
- package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +32 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +116 -0
- package/localized/zh-CN/agents/fec-test-planner.md +50 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +142 -0
- package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
- package/localized/zh-CN/commands/fec-debug.md +30 -0
- package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
- package/localized/zh-CN/commands/fec-init.md +70 -0
- package/localized/zh-CN/commands/fec-plan.md +94 -0
- package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
- package/localized/zh-CN/commands/fec-review.md +66 -0
- package/localized/zh-CN/commands/fec-scaffold.md +205 -0
- package/localized/zh-CN/commands/fec-tdd.md +21 -0
- package/localized/zh-CN/skills/TEMPLATE.md +155 -0
- package/localized/zh-CN/skills/eval_queries.json +1013 -0
- package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
- package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
- package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
- package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
- package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
- package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +143 -0
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +29 -0
- package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
- package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
- package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
- package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
- package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
- package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
- package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
- package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +80 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +74 -0
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
- package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
- package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
- package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
- package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
- package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
- package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
- package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
- package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +51 -0
- package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
- package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
- package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +38 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +27 -0
- package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
- package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
- package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
- package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
- package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
- package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
- package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
- package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
- package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
- package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
- package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
- package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
- package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
- package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
- package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
- package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
- package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
- package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
- package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
- package/localized/zh-CN/skills/metadata.json +1646 -0
- package/localized/zh-CN/skills/relations.json +755 -0
- package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
- package/localized/zh-CN/templates/claude/settings.json +62 -0
- package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
- package/localized/zh-CN/templates/codex/config.toml +32 -0
- package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
- package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +54 -0
- package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
- package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
- package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
- package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
- package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
- package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
- package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
- package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
- package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
- package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
- package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
- package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
- package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
- package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
- package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -2
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +678 -678
- package/skills/fec-accessibility-check/SKILL.md +21 -21
- package/skills/fec-accessibility-check/references/report-template.md +12 -12
- package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
- package/skills/fec-alchemy/SKILL.md +50 -50
- package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
- package/skills/fec-alchemy/assets/intake-template.md +55 -55
- package/skills/fec-alchemy/assets/review-checklist.md +23 -23
- package/skills/fec-alchemy/references/methodology.md +66 -66
- package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
- package/skills/fec-api-integration/SKILL.md +61 -61
- package/skills/fec-api-integration/references/integration-patterns.md +30 -30
- package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
- package/skills/fec-browser-storage/SKILL.md +16 -16
- package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
- package/skills/fec-canvas-threejs/SKILL.md +21 -21
- package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
- package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
- package/skills/fec-code-review/SKILL.md +94 -94
- package/skills/fec-code-review/references/report-template.md +13 -13
- package/skills/fec-component-testing/SKILL.md +39 -39
- package/skills/fec-data-fetching/SKILL.md +16 -16
- package/skills/fec-data-fetching/references/query-patterns.md +27 -27
- package/skills/fec-debug-framework/SKILL.md +95 -95
- package/skills/fec-debug-framework/references/report-template.md +34 -34
- package/skills/fec-dependency-upgrade/SKILL.md +17 -17
- package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
- package/skills/fec-doc-sync/SKILL.md +23 -23
- package/skills/fec-drawio-studio/SKILL.md +42 -38
- package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
- package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
- package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
- package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
- package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
- package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
- package/skills/fec-e2e-testing/SKILL.md +24 -24
- package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
- package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
- package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
- package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
- package/skills/fec-form-handling/SKILL.md +21 -21
- package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
- package/skills/fec-image-generation/SKILL.md +54 -29
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +33 -2
- package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
- package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
- package/skills/fec-implement-from-design/SKILL.md +81 -81
- package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
- package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
- package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
- package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
- package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
- package/skills/fec-legacy-web-standard/SKILL.md +17 -17
- package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
- package/skills/fec-list-virtualization/SKILL.md +16 -16
- package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
- package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
- package/skills/fec-motion-interaction/SKILL.md +51 -51
- package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
- package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
- package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
- package/skills/fec-performance-optimization/SKILL.md +54 -54
- package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
- package/skills/fec-performance-optimization/references/report-template.md +31 -31
- package/skills/fec-pwa-implementation/SKILL.md +17 -17
- package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
- package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
- package/skills/fec-react-project-standard/SKILL.md +72 -72
- package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
- package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
- package/skills/fec-refactor-clean/SKILL.md +30 -30
- package/skills/fec-refactor-clean/references/report-template.md +23 -23
- package/skills/fec-responsive-layout/SKILL.md +17 -17
- package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
- package/skills/fec-route-protection/SKILL.md +26 -26
- package/skills/fec-security-review/SKILL.md +20 -20
- package/skills/fec-security-review/references/report-template.md +12 -12
- package/skills/fec-security-review/references/security-checklist.md +27 -27
- package/skills/fec-source-driven-development/SKILL.md +59 -59
- package/skills/fec-state-management/SKILL.md +34 -34
- package/skills/fec-state-management/references/state-patterns.md +19 -19
- package/skills/fec-storybook-component-doc/SKILL.md +19 -19
- package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
- package/skills/fec-svg-animation/SKILL.md +32 -32
- package/skills/fec-tailwind-design-system/SKILL.md +17 -17
- package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
- package/skills/fec-tdd-workflow/SKILL.md +28 -28
- package/skills/fec-testing-strategy/SKILL.md +29 -29
- package/skills/fec-typescript-project-standard/SKILL.md +38 -38
- package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
- package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
- package/skills/fec-ui-design/SKILL.md +90 -90
- package/skills/fec-ui-design/references/design-intelligence.md +61 -61
- package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
- package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
- package/skills/fec-validation-fix/SKILL.md +26 -26
- package/skills/fec-validation-fix/references/report-template.md +25 -25
- package/skills/fec-vite-project-standard/SKILL.md +39 -39
- package/skills/fec-vue3-project-standard/SKILL.md +38 -38
- package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
- package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
- package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
- package/skills/fec-web-video-presentation/SKILL.md +33 -33
- package/skills/fec-web-workers/SKILL.md +16 -16
- package/skills/fec-web-workers/references/advanced-workers.md +13 -13
- package/skills/fec-web-workers/references/basic-worker.md +8 -8
- package/skills/metadata.json +121 -115
- package/skills/relations.json +4 -0
- package/templates/claude/CLAUDE.md +60 -60
- package/templates/codex/AGENTS.md +76 -76
- package/templates/codex/config.toml +4 -4
- package/templates/openclaw/AGENTS.md +68 -68
- package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
- package/templates/shared/rules/fec-agent-workflow.md +40 -40
- package/templates/shared/rules/fec-api-layer.md +52 -52
- package/templates/shared/rules/fec-ci-cd.md +29 -29
- package/templates/shared/rules/fec-code-comments.md +22 -22
- package/templates/shared/rules/fec-design-system.md +53 -53
- package/templates/shared/rules/fec-error-handling.md +40 -40
- package/templates/shared/rules/fec-git-conventions.md +42 -42
- package/templates/shared/rules/fec-i18n.md +48 -48
- package/templates/shared/rules/fec-naming-conventions.md +91 -91
- package/templates/shared/rules/fec-performance.md +78 -78
- package/templates/shared/rules/fec-react.md +58 -58
- package/templates/shared/rules/fec-refactoring.md +34 -34
- package/templates/shared/rules/fec-rendering-patterns.md +36 -36
- package/templates/shared/rules/fec-responsive-design.md +37 -37
- package/templates/shared/rules/fec-source-driven-development.md +22 -22
- package/templates/shared/rules/fec-state-management.md +56 -56
- package/templates/shared/rules/fec-testing.md +64 -64
- package/templates/shared/rules/fec-typescript.md +75 -75
- package/templates/shared/rules/fec-vue.md +42 -42
- package/templates/shared/rules/fec-working-modes.md +34 -34
- package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
#E2E CI & Reporting
|
|
2
2
|
|
|
3
|
-
## CI
|
|
3
|
+
## CI integration (example)
|
|
4
4
|
|
|
5
5
|
```yaml
|
|
6
6
|
# .github/workflows/e2e.yml
|
|
@@ -29,34 +29,34 @@ jobs:
|
|
|
29
29
|
retention-days: 30
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Cypress
|
|
32
|
+
Cypress: Fixed `CYPRESS_baseUrl` or `baseUrl` in the configuration file. Failure screenshots/videos are also recommended to upload artifacts.
|
|
33
33
|
|
|
34
|
-
## E2E
|
|
34
|
+
## E2E report template (Markdown)
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
The following structure can be used when outputting or archiving test reports to facilitate review:
|
|
37
37
|
|
|
38
38
|
```markdown
|
|
39
|
-
# E2E
|
|
39
|
+
# E2E test report
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
**Date:** YYYY-MM-DD HH:mm
|
|
42
|
+
**Time taken:** X minutes Y seconds
|
|
43
|
+
**Result:** Pass/Fail
|
|
44
44
|
|
|
45
|
-
##
|
|
45
|
+
## Summary
|
|
46
46
|
|
|
47
|
-
-
|
|
47
|
+
- Total X | Pass Y | Fail Z | Unstable/Skip Description
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## Failed use case
|
|
50
50
|
|
|
51
|
-
###
|
|
51
|
+
### Use case name
|
|
52
52
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
53
|
+
- **File:** `tests/e2e/xxx.spec.ts:line number`
|
|
54
|
+
- **ERROR:** Brief assertion or timeout information
|
|
55
|
+
- **Screenshot/Trace:** path or artifact name
|
|
56
|
+
- **Suggested fix:** Executable conclusion
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## Product
|
|
59
59
|
|
|
60
|
-
- HTML
|
|
61
|
-
- Trace /
|
|
60
|
+
- HTML report: `playwright-report/index.html`
|
|
61
|
+
- Trace / Video / Screenshot: CI artifact or local `test-results/`
|
|
62
62
|
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
#E2E Special Scenario
|
|
2
2
|
|
|
3
|
-
## Web3
|
|
3
|
+
## Web3/Wallet Injection (Playwright)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Inject mock through `context.addInitScript` before **`page.goto` to avoid relying on real plugins:
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
|
-
test("
|
|
8
|
+
test("Connect wallet", async ({ page, context }) => {
|
|
9
9
|
await context.addInitScript(() => {
|
|
10
10
|
(window as unknown as { ethereum?: unknown }).ethereum = {
|
|
11
11
|
isMetaMask: true,
|
|
@@ -24,16 +24,16 @@ test("连接钱包", async ({ page, context }) => {
|
|
|
24
24
|
});
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Just keep the chain ID, account list and business contract consistent.
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Financial or high-risk operations
|
|
30
30
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
31
|
+
- **It is prohibited** to perform real fund operations in a real production environment; use **staging, mock or `test.skip`**.
|
|
32
|
+
- Assert **preview amount**, success status** and **key interface 200** before ending the use case, with sufficient timeout (such as on-chain confirmation scenario).
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
|
-
test("
|
|
36
|
-
test.skip(process.env.NODE_ENV === "production", "
|
|
35
|
+
test("Order preview and success status", async ({ page }) => {
|
|
36
|
+
test.skip(process.env.NODE_ENV === "production", "The production environment skips real transactions");
|
|
37
37
|
|
|
38
38
|
await page.goto("/markets/demo");
|
|
39
39
|
await page.getByTestId("position-yes").click();
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
#E2E visual regression testing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Detect unexpected UI changes through screenshot comparison. Suitable for CSS refactoring, design token update, component revision and other scenarios.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Basic usage
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
8
|
import { test, expect } from "@playwright/test";
|
|
9
9
|
|
|
10
|
-
test("
|
|
10
|
+
test("Homepage layout is consistent with baseline", async ({ page }) => {
|
|
11
11
|
await page.goto("/");
|
|
12
12
|
await page.waitForLoadState("networkidle");
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Compare full-page screenshots - automatically generate a baseline for the first run
|
|
15
15
|
await expect(page).toHaveScreenshot("homepage-full.png", {
|
|
16
16
|
fullPage: true,
|
|
17
|
-
maxDiffPixels: 100, //
|
|
17
|
+
maxDiffPixels: 100, // Slight pixel differences allowed (anti-aliasing, etc.)
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
test("
|
|
21
|
+
test("Button components are visually consistent", async ({ page }) => {
|
|
22
22
|
await page.goto("/components/buttons");
|
|
23
23
|
const submitButton = page.getByTestId("submit-button");
|
|
24
24
|
await expect(submitButton).toHaveScreenshot("submit-button.png");
|
|
25
25
|
});
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Block dynamic content
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Dynamic elements such as time, random IDs, and third-party ads can cause false positives. Use `mask` to block them:
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
33
|
await expect(page).toHaveScreenshot("dashboard.png", {
|
|
@@ -39,9 +39,9 @@ await expect(page).toHaveScreenshot("dashboard.png", {
|
|
|
39
39
|
});
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Disable animation
|
|
43
43
|
|
|
44
|
-
CSS
|
|
44
|
+
CSS animation will cause inconsistent screenshots. Inject the style to disable animation before taking screenshots:
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
47
|
await page.addStyleTag({
|
|
@@ -51,10 +51,10 @@ await page.addStyleTag({
|
|
|
51
51
|
await expect(page).toHaveScreenshot("animated-page.png");
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
##
|
|
54
|
+
## Baseline management
|
|
55
55
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
- **CI
|
|
59
|
-
-
|
|
60
|
-
-
|
|
56
|
+
- **First run**: `npx playwright test` fails but automatically generates baseline into `tests/` directory
|
|
57
|
+
- **Update baseline**: `npx playwright test --update-snapshots` when the UI is intentionally changed
|
|
58
|
+
- **CI consistency**: Baseline must be generated on the same OS (Linux/Ubuntu) as CI, font rendering differs between macOS and Linux
|
|
59
|
+
- **Multi-browser**: Each project generates a baseline independently (Chromium/Firefox/WebKit rendering results are different)
|
|
60
|
+
- **Baseline file**: Incorporate into `.gitignore` or Git LFS management to avoid warehouse expansion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Playwright / Cypress E2E
|
|
1
|
+
# Playwright / Cypress E2E Mode
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Directory structure
|
|
4
4
|
|
|
5
5
|
```text
|
|
6
6
|
tests/
|
|
@@ -46,8 +46,8 @@ export class ItemsPage {
|
|
|
46
46
|
import { expect, test } from "@playwright/test";
|
|
47
47
|
import { ItemsPage } from "../pages/ItemsPage";
|
|
48
48
|
|
|
49
|
-
test.describe("
|
|
50
|
-
test("
|
|
49
|
+
test.describe("Product Search", () => {
|
|
50
|
+
test("Search by keyword and there are results", async ({ page }) => {
|
|
51
51
|
const itemsPage = new ItemsPage(page);
|
|
52
52
|
await itemsPage.goto();
|
|
53
53
|
await itemsPage.search("test");
|
|
@@ -84,7 +84,7 @@ export default defineConfig({
|
|
|
84
84
|
});
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
## Flaky
|
|
87
|
+
## Flaky Debugging
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
npx playwright test path/to/spec.ts --repeat-each=10
|
|
@@ -92,4 +92,4 @@ npx playwright test path/to/spec.ts --retries=3
|
|
|
92
92
|
npx playwright show-trace path/to/trace.zip
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Common reasons: race conditions, network timing, animation, test data pollution, cross-test state leakage.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-form-handling
|
|
3
|
-
description: Use when building or reviewing substantial forms with React Hook Form, Zod schemas, typed validation, dynamic fields, controlled third-party inputs, file upload, multi-step flows, dependent validation, or form performance. Do not use for trivial 1-3 field forms without validation; Chinese triggers include
|
|
3
|
+
description: Use when building or reviewing substantial forms with React Hook Form, Zod schemas, typed validation, dynamic fields, controlled third-party inputs, file upload, multi-step flows, dependent validation, or form performance. Do not use for trivial 1-3 field forms without validation; Chinese triggers include form, form validation, dynamic fields.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Form processing
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Manage form status, verification and submission to avoid lags in complex form input.
|
|
11
11
|
|
|
12
12
|
## Procedure
|
|
13
13
|
|
|
14
|
-
1.
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
18
|
-
5.
|
|
14
|
+
1. First identify the framework, existing form library of the project, schema verification library, component library and complexity; then introduce special form solutions when there are 10+ fields, dynamic fields, linkage verification, file upload, multi-step process or input lag.
|
|
15
|
+
2. Select according to project stack: React can consider React Hook Form + Zod; Vue can consider vee-validate / FormKit + Zod, Yup or Valibot; simple forms can use the framework's native state and basic verification.
|
|
16
|
+
3. Use runtime schema or explicit validation functions to guard external input boundaries; TypeScript types can be deduced from the schema, but don’t just write TS types.
|
|
17
|
+
4. Clarify default values, field registration, controlled/uncontrolled boundaries and component library adaptation; use `aria-invalid`, `aria-describedby` and `role="alert"` for error prompts.
|
|
18
|
+
5. Handle loading, server-side errors, repeated submissions and resets when submitting; use local subscriptions and sub-component isolation to control re-rendering of large forms.
|
|
19
19
|
|
|
20
20
|
## React Quick Start
|
|
21
21
|
|
|
@@ -25,8 +25,8 @@ import { useForm } from "react-hook-form";
|
|
|
25
25
|
import { z } from "zod";
|
|
26
26
|
|
|
27
27
|
const loginSchema = z.object({
|
|
28
|
-
email: z.string().email("
|
|
29
|
-
password: z.string().min(8, "
|
|
28
|
+
email: z.string().email("Please enter a valid email address"),
|
|
29
|
+
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
type LoginForm = z.infer<typeof loginSchema>;
|
|
@@ -43,34 +43,34 @@ export function LoginFormView() {
|
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<form onSubmit={handleSubmit((data) => api.login(data))} noValidate>
|
|
46
|
-
<label htmlFor="email"
|
|
46
|
+
<label htmlFor="email">Email</label>
|
|
47
47
|
<input id="email" {...register("email")} aria-invalid={!!errors.email} />
|
|
48
48
|
{errors.email && <span role="alert">{errors.email.message}</span>}
|
|
49
49
|
|
|
50
|
-
<label htmlFor="password"
|
|
50
|
+
<label htmlFor="password">Password</label>
|
|
51
51
|
<input id="password" type="password" {...register("password")} />
|
|
52
52
|
{errors.password && <span role="alert">{errors.password.message}</span>}
|
|
53
53
|
|
|
54
54
|
<button disabled={isSubmitting}>
|
|
55
|
-
{isSubmitting ? "
|
|
55
|
+
{isSubmitting ? "Submitting..." : "Submitting"}
|
|
56
56
|
</button>
|
|
57
57
|
</form>
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
##
|
|
62
|
+
## Detailed reference
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
When it comes to whether you need a form library, framework selection, `Controller`, `useFieldArray`, linkage verification, file upload, multi-step form, asynchronous verification and performance mode, load [references/advanced-form-patterns.md](references/advanced-form-patterns.md).
|
|
65
65
|
|
|
66
66
|
## Constraints
|
|
67
67
|
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
- reset
|
|
71
|
-
-
|
|
72
|
-
-
|
|
68
|
+
- Inherit the existing form library, schema library and component library adaptation method of the warehouse, and do not introduce a second system for a single form.
|
|
69
|
+
- Default values must be complete to avoid undefined triggering controlled/uncontrolled warnings or initialization flutter.
|
|
70
|
+
- reset should be passed the full default object returned by the server or explicit.
|
|
71
|
+
- Asynchronous validation must be debounced or placed on a commit boundary to avoid typing requests every time.
|
|
72
|
+
- The error path of schema cascade dynamic verification must point to the actual field.
|
|
73
73
|
|
|
74
74
|
## Expected Output
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
The output form is type-safe, accessible, and has a clear submission status; complex fields and file uploads have schema constraints, there is no obvious lag in the input process, and server-side errors can be backfilled to a position that the user can understand.
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Advanced form mode
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## First determine whether a form library is needed
|
|
4
4
|
|
|
5
|
-
- 1-3
|
|
6
|
-
-
|
|
7
|
-
-
|
|
5
|
+
- A form with 1-3 fields, no complex validation, no dynamic fields, and no component library adaptation pressure. The native state of the framework, browser constraint verification, and lightweight submission state are available.
|
|
6
|
+
- When dynamic fields, cross-field verification, multi-step processes, file uploads, asynchronous verification, server-side error backfilling or obvious input lag are required, a special form solution will be introduced.
|
|
7
|
+
- The form library only manages field status and verification process, and does not replace API error mapping, permission judgment, accessibility annotation or server-side final verification.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Selection reference
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
First, use the existing form library, schema library and component library adaptation method of the project; when adding new dependencies, select them according to the scenario.
|
|
12
12
|
|
|
13
|
-
|
|
|
13
|
+
| Scenarios | Alternative solutions | Notes |
|
|
14
14
|
| --- | --- | --- |
|
|
15
|
-
| React
|
|
16
|
-
| Vue
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
15
|
+
| React complex form | React Hook Form + Zod | Uncontrolled first, use `Controller` for third-party controlled components. |
|
|
16
|
+
| Vue complex forms | vee-validate / FormKit + Zod, Yup or Valibot | Do not introduce React-only form API into Vue projects; give priority to using the existing Vue form library of the project. |
|
|
17
|
+
| Simple form | Framework native state + basic validation | Avoid introducing heavy form system for 1-3 fields. |
|
|
18
|
+
| Multi-step form | Step-by-step schema + final submission schema | Clear step-by-step data saving, return to the previous step and final verification strategies. |
|
|
19
|
+
| File upload | Form library field status + `FormData` | Verify file quantity, size, type; do not serialize `File` JSON. |
|
|
20
|
+
| Asynchronous validation | Submit bounds validation or debounce field validation | Avoid each type request; handle race conditions and old response overwrites. |
|
|
21
|
+
|
|
22
|
+
## General implementation principles
|
|
23
|
+
|
|
24
|
+
- The runtime schema or validation function is responsible for external input bounds; TypeScript types are not a substitute for runtime validation.
|
|
25
|
+
- The default value, reset data and server-side backfill data must have the same shape to avoid fields switching between controlled/uncontrolled.
|
|
26
|
+
- Field errors must be mapped to specific fields; global errors are used for non-field problems such as submission failure, permissions or service unavailability.
|
|
27
|
+
- The component library adaptation layer must transparently transmit value, onChange, onBlur, name/ref or equivalent field registration capabilities.
|
|
28
|
+
- Protect loading, duplicate submissions, cancellation/expiration requests, server-side error backfill and reset after success when submitting.
|
|
29
|
+
- File upload uses `FormData` or direct transfer process. Front-end verification is only for experience protection, and the server still needs final verification.
|
|
30
|
+
- Performance optimization prioritizes the use of field-level subscriptions, partial component splitting, and delayed verification. Do not watch the entire form and then drive the entire page to re-render.
|
|
31
31
|
|
|
32
32
|
## React Hook Form Controller
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<Controller
|
|
36
36
|
name="role"
|
|
37
37
|
control={control}
|
|
38
|
-
rules={{ required: "
|
|
38
|
+
rules={{ required: "Please select a role" }}
|
|
39
39
|
render={({ field, fieldState }) => (
|
|
40
40
|
<>
|
|
41
41
|
<Select {...field} options={roleOptions} />
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
/>
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Used for components such as Select, DatePicker, RichEditor, etc. that do not expose native `ref`.
|
|
49
49
|
|
|
50
|
-
## React Hook Form
|
|
50
|
+
## React Hook Form dynamic fields
|
|
51
51
|
|
|
52
52
|
```tsx
|
|
53
53
|
const { fields, append, remove } = useFieldArray({
|
|
@@ -58,14 +58,14 @@ const { fields, append, remove } = useFieldArray({
|
|
|
58
58
|
{fields.map((field, index) => (
|
|
59
59
|
<div key={field.id}>
|
|
60
60
|
<input {...register(`contacts.${index}.name`)} />
|
|
61
|
-
<button type="button" onClick={() => remove(index)}
|
|
61
|
+
<button type="button" onClick={() => remove(index)}>Delete</button>
|
|
62
62
|
</div>
|
|
63
63
|
))}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
`key`
|
|
66
|
+
`key` must use `field.id`, do not use array index.
|
|
67
67
|
|
|
68
|
-
## Zod
|
|
68
|
+
## Zod linkage verification
|
|
69
69
|
|
|
70
70
|
```ts
|
|
71
71
|
const schema = z
|
|
@@ -74,28 +74,28 @@ const schema = z
|
|
|
74
74
|
confirmPassword: z.string().min(8),
|
|
75
75
|
})
|
|
76
76
|
.refine((data) => data.password === data.confirmPassword, {
|
|
77
|
-
message: "
|
|
77
|
+
message: "The two passwords are inconsistent",
|
|
78
78
|
path: ["confirmPassword"],
|
|
79
79
|
});
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
## Zod
|
|
82
|
+
## Zod file upload verification
|
|
83
83
|
|
|
84
84
|
```ts
|
|
85
85
|
const schema = z.object({
|
|
86
86
|
avatar: z
|
|
87
87
|
.instanceof(FileList)
|
|
88
|
-
.refine((files) => files.length > 0, "
|
|
89
|
-
.refine((files) => files[0]?.size <= 5 * 1024 * 1024, "
|
|
90
|
-
.refine((files) => ["image/jpeg", "image/png"].includes(files[0]?.type), "
|
|
88
|
+
.refine((files) => files.length > 0, "Please upload an avatar")
|
|
89
|
+
.refine((files) => files[0]?.size <= 5 * 1024 * 1024, "The file size does not exceed 5MB")
|
|
90
|
+
.refine((files) => ["image/jpeg", "image/png"].includes(files[0]?.type), "Only JPG/PNG is supported"),
|
|
91
91
|
});
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
Use `FormData` when submitting, do not serialize `File` JSON.
|
|
95
95
|
|
|
96
|
-
##
|
|
96
|
+
## Performance
|
|
97
97
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
98
|
+
- Replace full form watch with `useWatch` or field level subscription.
|
|
99
|
+
- Split large forms into memoized sub-components or framework-equivalent local update units.
|
|
100
|
+
- For high-frequency input, do not trigger network verification every time you type.
|
|
101
|
+
- For multi-step forms, the schema of each step and the final schema of the step must be clear.
|
|
@@ -1,56 +1,81 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-image-generation
|
|
3
|
-
description: Use when generating or editing diagrams, charts, visual assets, posters, UI mockups, product images, infographics, academic figures, comics, avatars, storyboards, brand boards, or image-edit workflows, especially when exported PNGs need visual QA and bounded self-repair. Prefer deterministic Mermaid/SVG/HTML/canvas sources for text-heavy diagrams;
|
|
3
|
+
description: Use when generating or editing diagrams, charts, visual assets, posters, UI mockups, product images, infographics, academic figures, comics, avatars, storyboards, brand boards, or image-edit workflows, especially when exported PNGs need visual QA and bounded self-repair. Prefer deterministic Mermaid/SVG/HTML/canvas sources for text-heavy diagrams; use HTML technical diagrams for browser-ready system blueprints, architecture, deployment topology, agent runtime, memory flow, before-after architecture, workflow, sequence, data-flow, lifecycle, runbook, PII/data-lineage, and state-machine diagrams. Do not use for ordinary UI polish without generated imagery.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Image generation and chart workflow
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Generate or edit diagrams, visual assets, and image workflows, and perform reviewable self-checks and repair iterations on exported PNGs.
|
|
11
11
|
|
|
12
12
|
## Procedure
|
|
13
13
|
|
|
14
|
-
1.
|
|
15
|
-
-
|
|
16
|
-
-
|
|
14
|
+
1. Determine product type
|
|
15
|
+
- When accuracy of text, structure, and connections is a priority, use Mermaid, SVG, HTML/CSS, canvas, or a graphics library to generate editable sources and then export as PNG.
|
|
16
|
+
- Use HTML technical diagrams when the user needs a browser-ready single file with dark/light theme support for system blueprints, architecture, deployment topology, agent runtime, memory flow, before-after architecture, workflow, sequence, data-flow, lifecycle, runbook, state-machine, or PII/data-lineage diagrams.
|
|
17
|
+
- Use the HTML `workflow` route for process maps, approvals, automation runs, exception paths, and cyclical operating flows that need readable start/end, decision, actor, numbered-step, and summary treatment without requiring diagrams.net.
|
|
18
|
+
- Use themed HTML technical diagrams when a system, agent, memory, data, or tool-call map needs semantic node shapes, flow-aware arrows, and a browser-ready source that can still be exported and QA-checked.
|
|
19
|
+
- Use the interactive live diagram route when the user benefits from watching nodes and edges appear incrementally in a local browser, or when they want to drag, relabel, remove, zoom, and export a quick diagram during the session.
|
|
20
|
+
- When aesthetics, texture, photos, illustrations, comics, product images or brand atmosphere are priorities, use image generation or editing tools, and then save the final assets to the project or report directory.
|
|
17
21
|
|
|
18
|
-
2.
|
|
19
|
-
-
|
|
20
|
-
-
|
|
22
|
+
2. Clarify inputs and constraints
|
|
23
|
+
- Collect audience, purpose, dimensions, language, required text, branding restrictions, editable source format, export format, and disabled elements.
|
|
24
|
+
- For posters, UI mockups, brand boards and product images, first write a line of visual reading: target users, scenarios, sources of credibility, and main visual anchors.
|
|
21
25
|
|
|
22
|
-
3.
|
|
23
|
-
- ER
|
|
24
|
-
-
|
|
26
|
+
3. Select Generate Route
|
|
27
|
+
- ER diagrams, UML class diagrams, sequence diagrams, technical architecture diagrams, ML/deep learning, flow charts, etc., give priority to creating structured sources according to [diagram-workflows.md](references/diagram-workflows.md).
|
|
28
|
+
- For themed browser-ready system blueprints, architecture, workflow, sequence, data-flow and lifecycle diagrams, read [html-technical-diagrams.md](references/html-technical-diagrams.md), then render JSON IR with [tech-diagram-render.mjs](scripts/tech-diagram-render.mjs). For process workflows, model participants as `lanes`, ordered actions as `nodes`, and exception or loop paths as `edges` with optional `waypoints`:
|
|
29
|
+
```bash
|
|
30
|
+
node skills/fec-image-generation/scripts/tech-diagram-render.mjs --input diagram.json --output diagram.html --type architecture --manifest diagram.layout.json
|
|
31
|
+
```
|
|
32
|
+
- For agent and memory diagrams, prefer `architecture` IR with semantic node types such as `agent`, `model`, `memory`, `vectorstore`, `graphdb`, `tool`, `document`, `queue`, `browser`, `user`, and `gateway`. Add connection `flow` values (`control`, `data`, `read`, `write`, `async`, `feedback`) when arrow meaning matters; two or more flow types produce an automatic flow legend.
|
|
33
|
+
- Use optional `visual.style` for source-owned theme direction: `default`, `terminal`, `blueprint`, `minimal`, `glass`, `warm`, `openai`, or `editorial-dark`. Treat these as delivery themes, not brand guarantees.
|
|
34
|
+
- When README-friendly SVG, PNG, JPG, or JPEG artifacts are needed from generated HTML/SVG sources, export with [export-diagram.mjs](scripts/export-diagram.mjs):
|
|
35
|
+
```bash
|
|
36
|
+
node skills/fec-image-generation/scripts/export-diagram.mjs --input diagram.html --format svg
|
|
37
|
+
node skills/fec-image-generation/scripts/export-diagram.mjs --input diagram.html --format png --output diagram.png --scale 2
|
|
38
|
+
```
|
|
39
|
+
- For live interactive sketches, start [interactive-diagram-server.mjs](scripts/interactive-diagram-server.mjs), open the served [interactive-diagram.html](assets/interactive-diagram.html) page with a unique `?s=session-id`, then POST small JSON commands to `/cmd?s=session-id`:
|
|
40
|
+
```bash
|
|
41
|
+
node skills/fec-image-generation/scripts/interactive-diagram-server.mjs --port 6100
|
|
42
|
+
curl -s "http://127.0.0.1:6100/cmd?s=checkout-flow" -d '{"cmd":"init","title":"Checkout Flow","direction":"TB"}'
|
|
43
|
+
curl -s "http://127.0.0.1:6100/cmd?s=checkout-flow" -d '{"cmd":"node","id":"cart","label":"Review cart","type":"process"}'
|
|
44
|
+
```
|
|
45
|
+
- Use the draw.io studio workflow instead when the priority is editable `.drawio` source, official diagrams.net shapes, or long-term manual editing.
|
|
46
|
+
- Posters, UI mockups, product graphics, infographics, academic graphics, comics, avatars, storyboards, brand boards and image editing, press [artifact-routing.md](references/artifact-routing.md) to choose generate, edit or hybrid routing.
|
|
25
47
|
|
|
26
|
-
4.
|
|
27
|
-
-
|
|
28
|
-
-
|
|
48
|
+
4. Export and self-check PNG
|
|
49
|
+
- Read the exported PNG before each delivery to check whether the main body is truly rendered, whether the text is truncated, whether the connections are stacked, and whether the nodes overlap.
|
|
50
|
+
- Run when there is a layout manifest:
|
|
29
51
|
```bash
|
|
30
52
|
node skills/fec-image-generation/scripts/png-qa.mjs --png output.png --manifest layout.json --format markdown
|
|
31
53
|
```
|
|
32
|
-
-
|
|
54
|
+
- Still running PNG basic checks without manifest:
|
|
33
55
|
```bash
|
|
34
56
|
node skills/fec-image-generation/scripts/png-qa.mjs --png output.png --format json
|
|
35
57
|
```
|
|
36
58
|
|
|
37
|
-
5.
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
59
|
+
5. Automatic repair loop
|
|
60
|
+
- Default maximum of 2 rounds; can be increased to a soft cap of 5 rounds when explicitly requested by the user.
|
|
61
|
+
- The repair object is the source file, prompt, layout parameter or export size, and does not directly destructively modify PNG pixels.
|
|
62
|
+
- Click [png-qa-autofix.md](references/png-qa-autofix.md) to turn the problem into a specific fix: increase the canvas, wrap lines, move nodes, layer connections, adjust padding or re-export.
|
|
41
63
|
|
|
42
|
-
6.
|
|
43
|
-
-
|
|
64
|
+
6. Delivery records
|
|
65
|
+
- Describe final source files, PNG paths, build routes, QA rounds, issues found and fixed, text or branding risks that still require manual confirmation.
|
|
44
66
|
|
|
45
67
|
## Constraints
|
|
46
68
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
69
|
+
- Text-intensive images should not be generated solely from bitmap models; editable structured sources must be retained.
|
|
70
|
+
- HTML technical diagrams must keep the JSON source and generated HTML; exported PNG/SVG/JPG files are delivery artifacts, not the source of truth. Use `.drawio` instead when official vendor icons or long-term manual editing are the priority.
|
|
71
|
+
- Themed semantic diagrams are implemented through the Frontend Craft renderer. Do not add Python, shell, cairosvg, rsvg-convert, Puppeteer, CDN capture libraries, copied SVG templates, or external icon packs as required dependencies for this route.
|
|
72
|
+
- Interactive live diagrams are session-time previews. Save JSON/SVG/PNG exports when the diagram becomes a deliverable, and switch to HTML technical diagrams or `.drawio` when long-term source ownership matters.
|
|
73
|
+
- Do not treat screenshots, fake data, or placeholder images as final product images unless the user explicitly requests a concept draft.
|
|
74
|
+
- The original image is not directly overwritten; the editing workflow outputs a new file by default.
|
|
75
|
+
- Readable labels, line attributions, legends, axes, and accessible alternative descriptions are not sacrificed for aesthetics.
|
|
76
|
+
- PNG helper only does detection and suggestions; fixes must go back to source, prompt, or layout parameters.
|
|
77
|
+
- Self-check results cannot replace manual confirmation of proper nouns, formulas, paper illustrations, brand specifications and compliance information.
|
|
53
78
|
|
|
54
79
|
## Expected Output
|
|
55
80
|
|
|
56
|
-
|
|
81
|
+
Produce editable source, final PNG or edited image with generated routes and QA results. Diagrams should be clearly structured, with uncensored labels and uncluttered connections; visual assets should match purpose, size, brand tone, and delivery path.
|