@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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { formatResult, parseArgs, skillDir } from "./studio-core.mjs";
|
|
5
|
+
|
|
6
|
+
const INDEX = path.join(skillDir, "data", "shape-index.json");
|
|
7
|
+
const ALIASES = new Map([
|
|
8
|
+
["亚马逊", "aws"],
|
|
9
|
+
["阿里云", "alibaba cloud"],
|
|
10
|
+
["微软云", "azure"],
|
|
11
|
+
["谷歌云", "gcp"],
|
|
12
|
+
["云", "cloud"],
|
|
13
|
+
["数据库", "database"],
|
|
14
|
+
["队列", "queue"],
|
|
15
|
+
["网关", "gateway"],
|
|
16
|
+
["服务", "service"],
|
|
17
|
+
["用户", "user"],
|
|
18
|
+
["角色", "actor"],
|
|
19
|
+
["流程", "flowchart"],
|
|
20
|
+
["容器", "container"],
|
|
21
|
+
["网络", "network"],
|
|
22
|
+
["交换机", "switch"],
|
|
23
|
+
["路由器", "router"],
|
|
24
|
+
["函数", "lambda"],
|
|
25
|
+
["对象存储", "storage"],
|
|
26
|
+
["消息", "message"],
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
export function loadShapes() {
|
|
30
|
+
return JSON.parse(fs.readFileSync(INDEX).toString("utf8"));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function queryShapes(shapes, query, options = {}) {
|
|
34
|
+
const terms = expandTerms(query);
|
|
35
|
+
const category = options.category
|
|
36
|
+
? String(options.category).toLowerCase()
|
|
37
|
+
: "";
|
|
38
|
+
const scored = [];
|
|
39
|
+
for (const [index, shape] of shapes.entries()) {
|
|
40
|
+
const haystack =
|
|
41
|
+
`${shape.title ?? ""} ${shape.tags ?? ""} ${shape.style ?? ""}`.toLowerCase();
|
|
42
|
+
if (category && !haystack.includes(category)) continue;
|
|
43
|
+
let score = 0;
|
|
44
|
+
const title = String(shape.title ?? "").toLowerCase();
|
|
45
|
+
const tags = String(shape.tags ?? "").toLowerCase();
|
|
46
|
+
for (const term of terms) {
|
|
47
|
+
if (title === term) score += 80;
|
|
48
|
+
else if (title.includes(term)) score += 45;
|
|
49
|
+
if (tags.split(/\s+/).includes(term)) score += 30;
|
|
50
|
+
else if (tags.includes(term)) score += 12;
|
|
51
|
+
if (fuzzyContains(haystack, term)) score += 4;
|
|
52
|
+
}
|
|
53
|
+
if (score > 0)
|
|
54
|
+
scored.push({
|
|
55
|
+
index,
|
|
56
|
+
score,
|
|
57
|
+
titleHits: terms.filter((term) => title.includes(term)).length,
|
|
58
|
+
shape,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return scored
|
|
62
|
+
.sort(
|
|
63
|
+
(a, b) =>
|
|
64
|
+
b.score - a.score ||
|
|
65
|
+
b.titleHits - a.titleHits ||
|
|
66
|
+
String(a.shape.title).localeCompare(String(b.shape.title)) ||
|
|
67
|
+
a.index - b.index,
|
|
68
|
+
)
|
|
69
|
+
.slice(0, Number(options.limit ?? 10))
|
|
70
|
+
.map(({ shape, score }) => ({
|
|
71
|
+
title: shape.title,
|
|
72
|
+
w: shape.w,
|
|
73
|
+
h: shape.h,
|
|
74
|
+
style: shape.style,
|
|
75
|
+
score,
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function expandTerms(query) {
|
|
80
|
+
const normalized = String(query ?? "").toLowerCase();
|
|
81
|
+
const raw = normalized.match(/[\p{L}\p{N}._-]+/gu) ?? [];
|
|
82
|
+
const expanded = [];
|
|
83
|
+
for (const term of raw) {
|
|
84
|
+
expanded.push(ALIASES.get(term) ?? term);
|
|
85
|
+
if (term.includes("-")) expanded.push(...term.split("-"));
|
|
86
|
+
}
|
|
87
|
+
return [
|
|
88
|
+
...new Set(
|
|
89
|
+
expanded.join(" ").match(/[a-z0-9._-]+|[\u4e00-\u9fff]+/g) ?? [],
|
|
90
|
+
),
|
|
91
|
+
].filter((term) => term.length >= 2);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function fuzzyContains(text, term) {
|
|
95
|
+
if (term.length < 4) return false;
|
|
96
|
+
let cursor = 0;
|
|
97
|
+
for (const ch of text) {
|
|
98
|
+
if (ch === term[cursor]) cursor += 1;
|
|
99
|
+
if (cursor === term.length) return true;
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const args = parseArgs(process.argv.slice(2));
|
|
105
|
+
const query = args._.join(" ");
|
|
106
|
+
if (!query) {
|
|
107
|
+
console.error(
|
|
108
|
+
"usage: node shape-query.mjs <keywords> [--limit 10] [--category aws] [--format markdown|json]",
|
|
109
|
+
);
|
|
110
|
+
process.exit(2);
|
|
111
|
+
}
|
|
112
|
+
const results = queryShapes(loadShapes(), query, args);
|
|
113
|
+
if (results.length === 0) {
|
|
114
|
+
console.error(`no shapes matched ${JSON.stringify(query)}`);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
if ((args.format ?? (args.json ? "json" : "markdown")) === "json") {
|
|
118
|
+
process.stdout.write(`${JSON.stringify(results, null, 2)}\n`);
|
|
119
|
+
} else {
|
|
120
|
+
process.stdout.write(formatResult({ title: "Shape Query", query, results }));
|
|
121
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
export const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
export const skillDir = path.resolve(scriptDir, "..");
|
|
8
|
+
|
|
9
|
+
export function readText(filePath) {
|
|
10
|
+
return fs.readFileSync(filePath, "utf8");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function writeText(filePath, body) {
|
|
14
|
+
fs.mkdirSync(path.dirname(path.resolve(filePath)), { recursive: true });
|
|
15
|
+
fs.writeFileSync(filePath, body, "utf8");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function parseArgs(argv) {
|
|
19
|
+
const args = { _: [] };
|
|
20
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
21
|
+
const token = argv[i];
|
|
22
|
+
if (!token.startsWith("--")) {
|
|
23
|
+
args._.push(token);
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const [rawKey, inline] = token.slice(2).split("=", 2);
|
|
27
|
+
const key = rawKey.replace(/-([a-z])/g, (_, ch) => ch.toUpperCase());
|
|
28
|
+
if (inline !== undefined) {
|
|
29
|
+
args[key] = inline;
|
|
30
|
+
} else if (argv[i + 1] && !argv[i + 1].startsWith("--")) {
|
|
31
|
+
args[key] = argv[i + 1];
|
|
32
|
+
i += 1;
|
|
33
|
+
} else {
|
|
34
|
+
args[key] = true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return args;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function formatResult(result, format = "markdown") {
|
|
41
|
+
if (format === "json") return `${JSON.stringify(result, null, 2)}\n`;
|
|
42
|
+
const lines = [`# ${result.title ?? "Drawio Studio Result"}`, ""];
|
|
43
|
+
for (const [key, value] of Object.entries(result)) {
|
|
44
|
+
if (key === "title") continue;
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
lines.push(`## ${label(key)}`, "");
|
|
47
|
+
if (value.length === 0) lines.push("- None");
|
|
48
|
+
else for (const item of value) lines.push(`- ${typeof item === "string" ? item : JSON.stringify(item)}`);
|
|
49
|
+
lines.push("");
|
|
50
|
+
} else if (value && typeof value === "object") {
|
|
51
|
+
lines.push(`## ${label(key)}`, "", "```json", JSON.stringify(value, null, 2), "```", "");
|
|
52
|
+
} else {
|
|
53
|
+
lines.push(`- ${label(key)}: ${String(value)}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return `${lines.join("\n").trimEnd()}\n`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function label(value) {
|
|
60
|
+
return value.replace(/([A-Z])/g, " $1").replace(/^./, (ch) => ch.toUpperCase());
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function xmlEscape(value) {
|
|
64
|
+
return String(value)
|
|
65
|
+
.replaceAll("&", "&")
|
|
66
|
+
.replaceAll("<", "<")
|
|
67
|
+
.replaceAll(">", ">")
|
|
68
|
+
.replaceAll('"', """);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function snap(value, grid = 10) {
|
|
72
|
+
return Math.round(value / grid) * grid;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function walkFiles(root, predicate) {
|
|
76
|
+
const out = [];
|
|
77
|
+
const skip = new Set([".git", "node_modules", "dist", "target", "vendor", ".next", ".nuxt", "coverage"]);
|
|
78
|
+
function visit(dir) {
|
|
79
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
80
|
+
if (skip.has(entry.name)) continue;
|
|
81
|
+
const full = path.join(dir, entry.name);
|
|
82
|
+
if (entry.isDirectory()) visit(full);
|
|
83
|
+
else if (!predicate || predicate(full)) out.push(full);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
visit(path.resolve(root));
|
|
87
|
+
return out.sort();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function toPosix(value) {
|
|
91
|
+
return value.split(path.sep).join("/");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function commonPrefix(values) {
|
|
95
|
+
if (values.length === 0) return "";
|
|
96
|
+
let prefix = values[0];
|
|
97
|
+
for (const value of values.slice(1)) {
|
|
98
|
+
while (prefix && !value.startsWith(prefix)) prefix = prefix.slice(0, -1);
|
|
99
|
+
}
|
|
100
|
+
return prefix.replace(/[^/]*$/, "");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function reduceTransitive(nodes, edges) {
|
|
104
|
+
const ids = new Set(nodes.map((node) => node.id));
|
|
105
|
+
const unique = [];
|
|
106
|
+
const seen = new Set();
|
|
107
|
+
for (const edge of edges) {
|
|
108
|
+
if (!ids.has(edge.source) || !ids.has(edge.target) || edge.source === edge.target) continue;
|
|
109
|
+
const key = `${edge.source}\0${edge.target}`;
|
|
110
|
+
if (!seen.has(key)) {
|
|
111
|
+
seen.add(key);
|
|
112
|
+
unique.push({ source: edge.source, target: edge.target });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const adjacency = new Map();
|
|
116
|
+
for (const edge of unique) {
|
|
117
|
+
if (!adjacency.has(edge.source)) adjacency.set(edge.source, new Set());
|
|
118
|
+
adjacency.get(edge.source).add(edge.target);
|
|
119
|
+
}
|
|
120
|
+
return unique.filter((edge) => !hasAlternatePath(edge.source, edge.target, adjacency, edge));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function hasAlternatePath(source, target, adjacency, skipped) {
|
|
124
|
+
const stack = [...(adjacency.get(source) ?? [])].filter((next) => !(source === skipped.source && next === skipped.target));
|
|
125
|
+
const seen = new Set();
|
|
126
|
+
while (stack.length) {
|
|
127
|
+
const next = stack.pop();
|
|
128
|
+
if (next === target) return true;
|
|
129
|
+
if (!next || seen.has(next)) continue;
|
|
130
|
+
seen.add(next);
|
|
131
|
+
for (const child of adjacency.get(next) ?? []) stack.push(child);
|
|
132
|
+
}
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function printOrWrite(body, output) {
|
|
137
|
+
if (output) writeText(output, body);
|
|
138
|
+
else process.stdout.write(body);
|
|
139
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schema.json",
|
|
3
|
+
"name": "corporate",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"default": false,
|
|
6
|
+
"source": { "type": "built-in" },
|
|
7
|
+
"confidence": "high",
|
|
8
|
+
"palette": {
|
|
9
|
+
"primary": { "fillColor": "#e3f2fd", "strokeColor": "#1565c0" },
|
|
10
|
+
"success": { "fillColor": "#e8f5e9", "strokeColor": "#2e7d32" },
|
|
11
|
+
"warning": { "fillColor": "#fff9c4", "strokeColor": "#f57c00" },
|
|
12
|
+
"accent": { "fillColor": "#fff3e0", "strokeColor": "#e65100" },
|
|
13
|
+
"danger": { "fillColor": "#ffebee", "strokeColor": "#c62828" },
|
|
14
|
+
"neutral": { "fillColor": "#eceff1", "strokeColor": "#455a64" },
|
|
15
|
+
"secondary": { "fillColor": "#f3e5f5", "strokeColor": "#6a1b9a" }
|
|
16
|
+
},
|
|
17
|
+
"roles": {
|
|
18
|
+
"service": "primary",
|
|
19
|
+
"database": "success",
|
|
20
|
+
"queue": "warning",
|
|
21
|
+
"gateway": "accent",
|
|
22
|
+
"error": "danger",
|
|
23
|
+
"external": "neutral",
|
|
24
|
+
"security": "secondary"
|
|
25
|
+
},
|
|
26
|
+
"shapes": {
|
|
27
|
+
"service": "rounded=0",
|
|
28
|
+
"database": "shape=cylinder3",
|
|
29
|
+
"queue": "rounded=0",
|
|
30
|
+
"decision": "rhombus",
|
|
31
|
+
"external": "rounded=0;dashed=1",
|
|
32
|
+
"container": "swimlane;startSize=30"
|
|
33
|
+
},
|
|
34
|
+
"font": {
|
|
35
|
+
"fontFamily": "Arial",
|
|
36
|
+
"fontSize": 11,
|
|
37
|
+
"titleFontSize": 13,
|
|
38
|
+
"titleBold": true
|
|
39
|
+
},
|
|
40
|
+
"edges": {
|
|
41
|
+
"style": "edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1",
|
|
42
|
+
"arrow": "endArrow=classic;endFill=1",
|
|
43
|
+
"dashedFor": ["optional", "async"]
|
|
44
|
+
},
|
|
45
|
+
"extras": {
|
|
46
|
+
"sketch": false,
|
|
47
|
+
"globalStrokeWidth": 1
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schema.json",
|
|
3
|
+
"name": "default",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"default": false,
|
|
6
|
+
"source": { "type": "built-in" },
|
|
7
|
+
"confidence": "high",
|
|
8
|
+
"palette": {
|
|
9
|
+
"primary": { "fillColor": "#dae8fc", "strokeColor": "#6c8ebf" },
|
|
10
|
+
"success": { "fillColor": "#d5e8d4", "strokeColor": "#82b366" },
|
|
11
|
+
"warning": { "fillColor": "#fff2cc", "strokeColor": "#d6b656" },
|
|
12
|
+
"accent": { "fillColor": "#ffe6cc", "strokeColor": "#d79b00" },
|
|
13
|
+
"danger": { "fillColor": "#f8cecc", "strokeColor": "#b85450" },
|
|
14
|
+
"neutral": { "fillColor": "#f5f5f5", "strokeColor": "#666666" },
|
|
15
|
+
"secondary": { "fillColor": "#e1d5e7", "strokeColor": "#9673a6" }
|
|
16
|
+
},
|
|
17
|
+
"roles": {
|
|
18
|
+
"service": "primary",
|
|
19
|
+
"database": "success",
|
|
20
|
+
"queue": "warning",
|
|
21
|
+
"gateway": "accent",
|
|
22
|
+
"error": "danger",
|
|
23
|
+
"external": "neutral",
|
|
24
|
+
"security": "secondary"
|
|
25
|
+
},
|
|
26
|
+
"shapes": {
|
|
27
|
+
"service": "rounded=1",
|
|
28
|
+
"database": "shape=cylinder3",
|
|
29
|
+
"queue": "rounded=1",
|
|
30
|
+
"decision": "rhombus",
|
|
31
|
+
"external": "rounded=1;dashed=1",
|
|
32
|
+
"container": "swimlane;startSize=30"
|
|
33
|
+
},
|
|
34
|
+
"font": {
|
|
35
|
+
"fontFamily": "Helvetica",
|
|
36
|
+
"fontSize": 12,
|
|
37
|
+
"titleFontSize": 14,
|
|
38
|
+
"titleBold": true
|
|
39
|
+
},
|
|
40
|
+
"edges": {
|
|
41
|
+
"style": "edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1",
|
|
42
|
+
"arrow": "endArrow=classic;endFill=1",
|
|
43
|
+
"dashedFor": []
|
|
44
|
+
},
|
|
45
|
+
"extras": {
|
|
46
|
+
"sketch": false,
|
|
47
|
+
"globalStrokeWidth": 1
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schema.json",
|
|
3
|
+
"name": "handdrawn",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"default": false,
|
|
6
|
+
"source": { "type": "built-in" },
|
|
7
|
+
"confidence": "high",
|
|
8
|
+
"palette": {
|
|
9
|
+
"primary": { "fillColor": "#ffe4b5", "strokeColor": "#b8651e" },
|
|
10
|
+
"success": { "fillColor": "#def0dc", "strokeColor": "#5c8a49" },
|
|
11
|
+
"warning": { "fillColor": "#fff4cc", "strokeColor": "#b8901a" },
|
|
12
|
+
"accent": { "fillColor": "#ffd9b3", "strokeColor": "#c25100" },
|
|
13
|
+
"danger": { "fillColor": "#ffcdbf", "strokeColor": "#a53d3d" },
|
|
14
|
+
"neutral": { "fillColor": "#f5e6d3", "strokeColor": "#8b7355" },
|
|
15
|
+
"secondary": { "fillColor": "#e6d7e8", "strokeColor": "#7b4397" }
|
|
16
|
+
},
|
|
17
|
+
"roles": {
|
|
18
|
+
"service": "primary",
|
|
19
|
+
"database": "success",
|
|
20
|
+
"queue": "warning",
|
|
21
|
+
"gateway": "accent",
|
|
22
|
+
"error": "danger",
|
|
23
|
+
"external": "neutral",
|
|
24
|
+
"security": "secondary"
|
|
25
|
+
},
|
|
26
|
+
"shapes": {
|
|
27
|
+
"service": "rounded=1",
|
|
28
|
+
"database": "shape=cylinder3",
|
|
29
|
+
"queue": "rounded=1",
|
|
30
|
+
"decision": "rhombus",
|
|
31
|
+
"external": "rounded=1;dashed=1",
|
|
32
|
+
"container": "swimlane;startSize=30"
|
|
33
|
+
},
|
|
34
|
+
"font": {
|
|
35
|
+
"fontFamily": "Helvetica",
|
|
36
|
+
"fontSize": 12,
|
|
37
|
+
"titleFontSize": 14,
|
|
38
|
+
"titleBold": true
|
|
39
|
+
},
|
|
40
|
+
"edges": {
|
|
41
|
+
"style": "edgeStyle=orthogonalEdgeStyle;curved=1;rounded=1;orthogonalLoop=1;jettySize=auto;html=1",
|
|
42
|
+
"arrow": "endArrow=classic;endFill=1",
|
|
43
|
+
"dashedFor": ["optional"]
|
|
44
|
+
},
|
|
45
|
+
"extras": {
|
|
46
|
+
"sketch": true,
|
|
47
|
+
"globalStrokeWidth": 2
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://github.com/Agents365-ai/drawio-skill/styles/schema.json",
|
|
4
|
+
"title": "drawio-skill preset",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["name", "version", "palette", "roles", "shapes", "font", "edges"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": { "type": "string" },
|
|
10
|
+
"name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*$" },
|
|
11
|
+
"version": { "type": "integer", "const": 1 },
|
|
12
|
+
"default": { "type": "boolean" },
|
|
13
|
+
"confidence": { "type": "string", "enum": ["low", "medium", "high"] },
|
|
14
|
+
"source": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"properties": {
|
|
18
|
+
"type": { "type": "string", "enum": ["xml", "image", "built-in", "hand-authored"] },
|
|
19
|
+
"path": { "type": "string" },
|
|
20
|
+
"extracted_at": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"palette": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["primary", "success", "warning", "accent", "danger", "neutral", "secondary"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"primary": { "$ref": "#/$defs/colorPair" },
|
|
29
|
+
"success": { "$ref": "#/$defs/colorPair" },
|
|
30
|
+
"warning": { "$ref": "#/$defs/colorPair" },
|
|
31
|
+
"accent": { "$ref": "#/$defs/colorPair" },
|
|
32
|
+
"danger": { "$ref": "#/$defs/colorPair" },
|
|
33
|
+
"neutral": { "$ref": "#/$defs/colorPair" },
|
|
34
|
+
"secondary": { "$ref": "#/$defs/colorPair" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"roles": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"properties": {
|
|
41
|
+
"service": { "$ref": "#/$defs/slotName" },
|
|
42
|
+
"database": { "$ref": "#/$defs/slotName" },
|
|
43
|
+
"queue": { "$ref": "#/$defs/slotName" },
|
|
44
|
+
"gateway": { "$ref": "#/$defs/slotName" },
|
|
45
|
+
"error": { "$ref": "#/$defs/slotName" },
|
|
46
|
+
"external": { "$ref": "#/$defs/slotName" },
|
|
47
|
+
"security": { "$ref": "#/$defs/slotName" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"shapes": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": { "type": "string" },
|
|
53
|
+
"properties": {
|
|
54
|
+
"service": { "type": "string" },
|
|
55
|
+
"database": { "type": "string" },
|
|
56
|
+
"queue": { "type": "string" },
|
|
57
|
+
"decision": { "type": "string" },
|
|
58
|
+
"external": { "type": "string" },
|
|
59
|
+
"container": { "type": "string" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"font": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": ["fontFamily", "fontSize"],
|
|
66
|
+
"properties": {
|
|
67
|
+
"fontFamily": { "type": "string" },
|
|
68
|
+
"fontSize": { "type": "integer", "minimum": 8, "maximum": 36 },
|
|
69
|
+
"titleFontSize": { "type": "integer", "minimum": 8, "maximum": 48 },
|
|
70
|
+
"titleBold": { "type": "boolean" }
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"edges": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": ["style", "arrow"],
|
|
77
|
+
"properties": {
|
|
78
|
+
"style": { "type": "string" },
|
|
79
|
+
"arrow": { "type": "string" },
|
|
80
|
+
"dashedFor": { "type": "array", "items": { "type": "string" } }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"extras": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"properties": {
|
|
87
|
+
"sketch": { "type": "boolean" },
|
|
88
|
+
"globalStrokeWidth": { "type": "number", "minimum": 0.5, "maximum": 6 }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"$defs": {
|
|
93
|
+
"colorPair": {
|
|
94
|
+
"oneOf": [
|
|
95
|
+
{ "type": "null" },
|
|
96
|
+
{
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": false,
|
|
99
|
+
"required": ["fillColor", "strokeColor"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"fillColor": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
|
|
102
|
+
"strokeColor": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"slotName": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"enum": ["primary", "success", "warning", "accent", "danger", "neutral", "secondary"]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-e2e-testing
|
|
3
|
+
description: 用于创建、维护、调试或审查真实浏览器端到端测试,包括 Playwright/Cypress、Page Object、CI 产物、trace、不稳定用例、跨页面视觉回归以及登录、支付、权限或 CRUD 等关键用户旅程。若是测试层规划或靠近 UI 组件的测试,先选择对应测试工作流;中文触发词包括 E2E、端到端测试、Playwright、Cypress。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# E2E 测试规范
|
|
7
|
+
|
|
8
|
+
## 用途
|
|
9
|
+
|
|
10
|
+
用真实浏览器验证关键用户旅程,发现单元测试无法覆盖的集成风险。
|
|
11
|
+
|
|
12
|
+
## 流程
|
|
13
|
+
|
|
14
|
+
1. 明确关键旅程:登录、购买、创建、搜索、权限、支付等跨页面流程优先;若只是选择测试层级,先做测试分层规划。
|
|
15
|
+
2. 新项目优先 Playwright;已有 Cypress 项目沿用 Cypress,不为迁移而迁移。
|
|
16
|
+
3. 用 Page Object 或 fixtures 封装登录、页面定位器和共享数据,spec 中避免裸选择器。
|
|
17
|
+
4. 断言用户可见结果,依赖 Locator 自动等待、网络响应或可见状态,不使用固定 sleep。
|
|
18
|
+
5. CI 必须上传 HTML report、截图、trace 或视频;flaky 用例要隔离、复现、标注来源并关联 issue。
|
|
19
|
+
6. 调试失败时先读 trace、console、network 和截图,再改测试;不要把真实产品缺陷误判成 flaky。
|
|
20
|
+
7. 对关键浏览器能力、支付、权限、上传和实时通信流程,记录测试环境、种子数据和清理策略。
|
|
21
|
+
8. 测试数据必须可重复:优先使用 API seed、数据库 fixture、测试账号或 mock 服务;随机数据需带唯一前缀并在 teardown 清理。
|
|
22
|
+
|
|
23
|
+
## 详细参考
|
|
24
|
+
|
|
25
|
+
- 需要目录结构、Page Object、spec 组织、配置、flaky 调试和产物示例时,加载 [references/playwright-patterns.md](references/playwright-patterns.md)。
|
|
26
|
+
- 需要 CI 示例和 Markdown 报告模板时,加载 [references/e2e-ci-reporting.md](references/e2e-ci-reporting.md)。
|
|
27
|
+
- 需要 Web3/钱包流程或高风险金融流程时,加载 [references/e2e-special-scenarios.md](references/e2e-special-scenarios.md)。
|
|
28
|
+
- 需要跨页面截图或视觉回归配置时,加载 [references/e2e-visual-regression.md](references/e2e-visual-regression.md)。
|
|
29
|
+
|
|
30
|
+
## 约束
|
|
31
|
+
|
|
32
|
+
- 禁止依赖 `sleep` / 固定 `setTimeout` 作为主要同步手段。
|
|
33
|
+
- 不在生产环境跑真实 E2E。
|
|
34
|
+
- 避免在 E2E 中断言组件内部像素级样式;跨页面截图/视觉回归仅覆盖用户旅程中的关键页面状态。
|
|
35
|
+
- 失败必须能靠截图、trace 或视频定位。
|
|
36
|
+
- 组件内部契约测试分流到组件测试 workflow。
|
|
37
|
+
- 不把不稳定等待、随机数据或依赖测试顺序带入 CI。
|
|
38
|
+
- 不把重试次数当作 flaky 治理;重试只能保留证据,根因仍需定位。
|
|
39
|
+
|
|
40
|
+
## 预期输出
|
|
41
|
+
|
|
42
|
+
关键用户旅程有稳定 E2E 覆盖,失败产物可定位问题,CI 中报告和 trace 可下载;flaky 用例有复现命令、隔离策略和后续 issue。
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# E2E CI 与报告
|
|
2
|
+
|
|
3
|
+
## CI 集成(示例)
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
# .github/workflows/e2e.yml
|
|
7
|
+
name: E2E Tests
|
|
8
|
+
on: [push, pull_request]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: 20
|
|
18
|
+
- run: npm ci
|
|
19
|
+
- run: npx playwright install --with-deps
|
|
20
|
+
- run: npx playwright test
|
|
21
|
+
env:
|
|
22
|
+
CI: true
|
|
23
|
+
BASE_URL: ${{ vars.STAGING_URL }}
|
|
24
|
+
- uses: actions/upload-artifact@v4
|
|
25
|
+
if: always()
|
|
26
|
+
with:
|
|
27
|
+
name: playwright-report
|
|
28
|
+
path: playwright-report/
|
|
29
|
+
retention-days: 30
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Cypress:固定 `CYPRESS_baseUrl` 或配置文件中的 `baseUrl`,失败截图/视频同样建议上传 artifact。
|
|
33
|
+
|
|
34
|
+
## E2E 报告模板(Markdown)
|
|
35
|
+
|
|
36
|
+
输出或归档测试报告时可采用下列结构,便于复盘:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
# E2E 测试报告
|
|
40
|
+
|
|
41
|
+
**日期:** YYYY-MM-DD HH:mm
|
|
42
|
+
**耗时:** X 分 Y 秒
|
|
43
|
+
**结果:** 通过 / 失败
|
|
44
|
+
|
|
45
|
+
## 摘要
|
|
46
|
+
|
|
47
|
+
- 总计 X | 通过 Y | 失败 Z | 不稳定/跳过 说明
|
|
48
|
+
|
|
49
|
+
## 失败用例
|
|
50
|
+
|
|
51
|
+
### 用例名
|
|
52
|
+
|
|
53
|
+
- **文件:** `tests/e2e/xxx.spec.ts:行号`
|
|
54
|
+
- **错误:** 简述断言或超时信息
|
|
55
|
+
- **截图/Trace:** 路径或 artifact 名称
|
|
56
|
+
- **建议修复:** 可执行结论
|
|
57
|
+
|
|
58
|
+
## 产物
|
|
59
|
+
|
|
60
|
+
- HTML 报告:`playwright-report/index.html`
|
|
61
|
+
- Trace / 视频 / 截图:CI artifact 或本地 `test-results/`
|
|
62
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# E2E 特殊场景
|
|
2
|
+
|
|
3
|
+
## Web3 / 钱包注入(Playwright)
|
|
4
|
+
|
|
5
|
+
在 **`page.goto` 之前**通过 `context.addInitScript` 注入 mock,避免依赖真实插件:
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
test("连接钱包", async ({ page, context }) => {
|
|
9
|
+
await context.addInitScript(() => {
|
|
10
|
+
(window as unknown as { ethereum?: unknown }).ethereum = {
|
|
11
|
+
isMetaMask: true,
|
|
12
|
+
request: async ({ method }: { method: string }) => {
|
|
13
|
+
if (method === "eth_requestAccounts")
|
|
14
|
+
return ["0x1234567890123456789012345678901234567890"];
|
|
15
|
+
if (method === "eth_chainId") return "0x1";
|
|
16
|
+
return null;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
await page.goto("/");
|
|
22
|
+
await page.getByTestId("connect-wallet").click();
|
|
23
|
+
await expect(page.getByTestId("wallet-address")).toContainText("0x1234");
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
链 ID、账户列表与业务契约保持一致即可。
|
|
28
|
+
|
|
29
|
+
## 金融或高风险操作
|
|
30
|
+
|
|
31
|
+
- **禁止**在真实生产环境执行真实资金操作;使用 **staging、mock 或 `test.skip`**。
|
|
32
|
+
- 断言**预览金额、成功态**与**关键接口 200** 后再结束用例,超时给足(如链上确认场景)。
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
test("下单预览与成功态", async ({ page }) => {
|
|
36
|
+
test.skip(process.env.NODE_ENV === "production", "生产环境跳过真实交易");
|
|
37
|
+
|
|
38
|
+
await page.goto("/markets/demo");
|
|
39
|
+
await page.getByTestId("position-yes").click();
|
|
40
|
+
await page.getByTestId("trade-amount").fill("1.0");
|
|
41
|
+
|
|
42
|
+
const preview = page.getByTestId("trade-preview");
|
|
43
|
+
await expect(preview).toContainText("1.0");
|
|
44
|
+
|
|
45
|
+
await page.getByTestId("confirm-trade").click();
|
|
46
|
+
await page.waitForResponse(
|
|
47
|
+
(resp) => resp.url().includes("/api/trade") && resp.status() === 200,
|
|
48
|
+
{ timeout: 30_000 },
|
|
49
|
+
);
|
|
50
|
+
await expect(page.getByTestId("trade-success")).toBeVisible();
|
|
51
|
+
});
|
|
52
|
+
```
|