@bovinphang/frontend-craft 2.7.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +378 -305
- package/CHANGELOG.zh-CN.md +377 -304
- package/CONTRIBUTING.md +371 -361
- package/CONTRIBUTING.zh-CN.md +371 -361
- package/README.md +545 -493
- package/README.openclaw.md +359 -264
- package/README.openclaw.zh-CN.md +359 -264
- package/README.zh-CN.md +545 -493
- package/agents/fec-architect.md +70 -70
- package/agents/fec-code-reviewer.md +103 -82
- package/agents/fec-debugger.md +20 -20
- package/agents/fec-design-token-mapper.md +36 -36
- package/agents/fec-doc-updater.md +13 -13
- package/agents/fec-e2e-runner.md +45 -45
- package/agents/fec-figma-implementer.md +59 -59
- package/agents/fec-performance-optimizer.md +128 -128
- package/agents/fec-refactor-cleaner.md +17 -14
- package/agents/fec-refactoring-expert.md +81 -0
- package/agents/fec-security-reviewer.md +82 -67
- package/agents/fec-test-planner.md +27 -27
- package/agents/fec-typescript-reviewer.md +103 -87
- package/agents/fec-ui-checker.md +64 -64
- package/commands/fec-debug.md +19 -19
- package/commands/fec-doc-sync.md +11 -11
- package/commands/fec-init.md +37 -38
- package/commands/fec-plan.md +58 -58
- package/commands/fec-refactor-clean.md +11 -11
- package/commands/fec-refactor-plan.md +17 -0
- package/commands/fec-refactor.md +18 -0
- package/commands/fec-review.md +71 -41
- package/commands/fec-scaffold.md +41 -41
- package/commands/fec-smell.md +17 -0
- package/commands/fec-tdd.md +17 -13
- package/dist/bin/frontend-craft.js +190 -36
- package/dist/hooks/fec-run-tests.js +5 -1
- package/dist/hooks/fec-session-start.js +1 -1
- package/docs/example-prompts.md +157 -137
- package/docs/ja-JP/README.md +534 -493
- package/docs/ko-KR/README.md +534 -493
- package/docs/project-structure.md +151 -123
- package/docs/refactoring/README.md +50 -0
- package/docs/refactoring/catalog.md +105 -0
- package/docs/refactoring/smell-refactoring-matrix.md +41 -0
- package/docs/review-and-diagram-workflows.md +39 -0
- package/docs/runtimes/antigravity.md +18 -10
- package/docs/runtimes/augment.md +18 -10
- package/docs/runtimes/claude.md +191 -177
- package/docs/runtimes/claude.zh-CN.md +189 -175
- package/docs/runtimes/cline.md +18 -10
- package/docs/runtimes/codebuddy.md +18 -10
- package/docs/runtimes/codex.md +18 -10
- package/docs/runtimes/compatibility.md +27 -0
- package/docs/runtimes/copilot.md +18 -10
- package/docs/runtimes/cursor.md +18 -10
- package/docs/runtimes/gemini.md +18 -10
- package/docs/runtimes/kilo.md +18 -10
- package/docs/runtimes/openclaw.md +18 -10
- package/docs/runtimes/opencode.md +18 -10
- package/docs/runtimes/qoder.md +18 -19
- package/docs/runtimes/trae.md +18 -10
- package/docs/runtimes/windsurf.md +18 -10
- package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
- package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
- package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
- package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
- package/docs/zh-CN/example-prompts.md +157 -137
- package/docs/zh-CN/project-structure.md +148 -123
- package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
- package/docs/zh-TW/README.md +534 -493
- package/localized/zh-CN/agents/fec-architect.md +125 -0
- package/localized/zh-CN/agents/fec-code-reviewer.md +171 -0
- package/localized/zh-CN/agents/fec-debugger.md +44 -0
- package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
- package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
- package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
- package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
- package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +35 -0
- package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +132 -0
- package/localized/zh-CN/agents/fec-test-planner.md +50 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +158 -0
- package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
- package/localized/zh-CN/commands/fec-debug.md +30 -0
- package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
- package/localized/zh-CN/commands/fec-init.md +70 -0
- package/localized/zh-CN/commands/fec-plan.md +94 -0
- package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
- package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
- package/localized/zh-CN/commands/fec-refactor.md +14 -0
- package/localized/zh-CN/commands/fec-review.md +97 -0
- package/localized/zh-CN/commands/fec-scaffold.md +205 -0
- package/localized/zh-CN/commands/fec-smell.md +13 -0
- package/localized/zh-CN/commands/fec-tdd.md +25 -0
- package/localized/zh-CN/skills/TEMPLATE.md +155 -0
- package/localized/zh-CN/skills/eval_queries.json +1257 -0
- package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
- package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
- package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
- package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
- package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
- package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +162 -0
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +39 -0
- package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
- package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
- package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
- package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
- package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
- package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
- package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
- package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
- package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +110 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +81 -0
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +37 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +462 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
- package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
- package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
- package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
- package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
- package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
- package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
- package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
- package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
- package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
- package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
- package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
- package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
- package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +37 -0
- package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
- package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
- package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
- package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
- package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +55 -0
- package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
- package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
- package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
- package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
- package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
- package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
- package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
- package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
- package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
- package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
- package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
- package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
- package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
- package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
- package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
- package/localized/zh-CN/skills/metadata.json +2004 -0
- package/localized/zh-CN/skills/relations.json +1023 -0
- package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
- package/localized/zh-CN/templates/claude/settings.json +62 -0
- package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
- package/localized/zh-CN/templates/codex/config.toml +32 -0
- package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
- package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +55 -0
- package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
- package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
- package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
- package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
- package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
- package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
- package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
- package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
- package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
- package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
- package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
- package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
- package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
- package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
- package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
- package/openclaw.plugin.json +2 -3
- package/package.json +28 -17
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +922 -678
- package/skills/fec-accessibility-check/SKILL.md +21 -21
- package/skills/fec-accessibility-check/references/report-template.md +12 -12
- package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
- package/skills/fec-alchemy/SKILL.md +50 -50
- package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
- package/skills/fec-alchemy/assets/intake-template.md +55 -55
- package/skills/fec-alchemy/assets/review-checklist.md +23 -23
- package/skills/fec-alchemy/references/methodology.md +66 -66
- package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
- package/skills/fec-api-integration/SKILL.md +61 -61
- package/skills/fec-api-integration/references/integration-patterns.md +30 -30
- package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
- package/skills/fec-browser-storage/SKILL.md +16 -16
- package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
- package/skills/fec-canvas-threejs/SKILL.md +21 -21
- package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
- package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
- package/skills/fec-code-review/SKILL.md +113 -94
- package/skills/fec-code-review/references/report-template.md +23 -13
- package/skills/fec-code-smells/SKILL.md +33 -0
- package/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/skills/fec-code-smells/references/smell-catalog.md +861 -0
- package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/skills/fec-component-testing/SKILL.md +39 -39
- package/skills/fec-data-fetching/SKILL.md +16 -16
- package/skills/fec-data-fetching/references/query-patterns.md +27 -27
- package/skills/fec-debug-framework/SKILL.md +95 -95
- package/skills/fec-debug-framework/references/report-template.md +34 -34
- package/skills/fec-dependency-upgrade/SKILL.md +17 -17
- package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
- package/skills/fec-doc-sync/SKILL.md +23 -23
- package/skills/fec-drawio-studio/SKILL.md +42 -38
- package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
- package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
- package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
- package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
- package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
- package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
- package/skills/fec-e2e-testing/SKILL.md +24 -24
- package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
- package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
- package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
- package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
- package/skills/fec-form-handling/SKILL.md +21 -21
- package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
- package/skills/fec-image-generation/SKILL.md +84 -29
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +41 -3
- package/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
- package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
- package/skills/fec-implement-from-design/SKILL.md +81 -81
- package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
- package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
- package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
- package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
- package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
- package/skills/fec-legacy-web-standard/SKILL.md +17 -17
- package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
- package/skills/fec-list-virtualization/SKILL.md +16 -16
- package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
- package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
- package/skills/fec-motion-interaction/SKILL.md +51 -51
- package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
- package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
- package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
- package/skills/fec-performance-optimization/SKILL.md +54 -54
- package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
- package/skills/fec-performance-optimization/references/report-template.md +31 -31
- package/skills/fec-pwa-implementation/SKILL.md +17 -17
- package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
- package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
- package/skills/fec-react-project-standard/SKILL.md +72 -72
- package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
- package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
- package/skills/fec-refactor-clean/SKILL.md +33 -30
- package/skills/fec-refactor-clean/references/report-template.md +23 -23
- package/skills/fec-refactoring/SKILL.md +83 -0
- package/skills/fec-refactoring/references/principles.md +60 -0
- package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
- package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
- package/skills/fec-refactoring/references/workflow.md +90 -0
- package/skills/fec-refactoring-api/SKILL.md +25 -0
- package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/skills/fec-refactoring-catalog/SKILL.md +28 -0
- package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
- package/skills/fec-refactoring-control/SKILL.md +25 -0
- package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/skills/fec-refactoring-data/SKILL.md +25 -0
- package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/skills/fec-refactoring-validation/SKILL.md +59 -0
- package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
- package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
- package/skills/fec-responsive-layout/SKILL.md +17 -17
- package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
- package/skills/fec-route-protection/SKILL.md +26 -26
- package/skills/fec-security-review/SKILL.md +36 -20
- package/skills/fec-security-review/references/report-template.md +22 -12
- package/skills/fec-security-review/references/security-checklist.md +27 -27
- package/skills/fec-source-driven-development/SKILL.md +59 -59
- package/skills/fec-state-management/SKILL.md +34 -34
- package/skills/fec-state-management/references/state-patterns.md +19 -19
- package/skills/fec-storybook-component-doc/SKILL.md +19 -19
- package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
- package/skills/fec-svg-animation/SKILL.md +32 -32
- package/skills/fec-tailwind-design-system/SKILL.md +17 -17
- package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
- package/skills/fec-tdd-workflow/SKILL.md +32 -28
- package/skills/fec-testing-strategy/SKILL.md +29 -29
- package/skills/fec-typescript-project-standard/SKILL.md +38 -38
- package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
- package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
- package/skills/fec-ui-design/SKILL.md +90 -90
- package/skills/fec-ui-design/references/design-intelligence.md +61 -61
- package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
- package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
- package/skills/fec-validation-fix/SKILL.md +26 -26
- package/skills/fec-validation-fix/references/report-template.md +25 -25
- package/skills/fec-vite-project-standard/SKILL.md +39 -39
- package/skills/fec-vue3-project-standard/SKILL.md +38 -38
- package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
- package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
- package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
- package/skills/fec-web-video-presentation/SKILL.md +33 -33
- package/skills/fec-web-workers/SKILL.md +16 -16
- package/skills/fec-web-workers/references/advanced-workers.md +13 -13
- package/skills/fec-web-workers/references/basic-worker.md +8 -8
- package/skills/metadata.json +485 -116
- package/skills/relations.json +268 -0
- package/templates/claude/CLAUDE.md +60 -60
- package/templates/codex/AGENTS.md +76 -76
- package/templates/codex/config.toml +4 -4
- package/templates/openclaw/AGENTS.md +68 -68
- package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
- package/templates/shared/rules/fec-agent-workflow.md +41 -40
- package/templates/shared/rules/fec-api-layer.md +52 -52
- package/templates/shared/rules/fec-ci-cd.md +29 -29
- package/templates/shared/rules/fec-code-comments.md +22 -22
- package/templates/shared/rules/fec-design-system.md +53 -53
- package/templates/shared/rules/fec-error-handling.md +40 -40
- package/templates/shared/rules/fec-git-conventions.md +42 -42
- package/templates/shared/rules/fec-i18n.md +48 -48
- package/templates/shared/rules/fec-naming-conventions.md +91 -91
- package/templates/shared/rules/fec-performance.md +78 -78
- package/templates/shared/rules/fec-react.md +58 -58
- package/templates/shared/rules/fec-refactoring.md +34 -34
- package/templates/shared/rules/fec-rendering-patterns.md +36 -36
- package/templates/shared/rules/fec-responsive-design.md +37 -37
- package/templates/shared/rules/fec-source-driven-development.md +22 -22
- package/templates/shared/rules/fec-state-management.md +56 -56
- package/templates/shared/rules/fec-testing.md +64 -64
- package/templates/shared/rules/fec-typescript.md +75 -75
- package/templates/shared/rules/fec-vue.md +42 -42
- package/templates/shared/rules/fec-working-modes.md +34 -34
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
- package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
package/CONTRIBUTING.zh-CN.md
CHANGED
|
@@ -1,361 +1,371 @@
|
|
|
1
|
-
# 贡献指南
|
|
2
|
-
|
|
3
|
-
> **English:** [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
4
|
-
|
|
5
|
-
感谢你对 `frontend-craft` 的关注。欢迎通过 Issue、Pull Request、文档修正、runtime 适配、示例补充等方式参与贡献。
|
|
6
|
-
|
|
7
|
-
## 开发环境
|
|
8
|
-
|
|
9
|
-
- Node.js >= 22,用于通用安装器与 OpenClaw 包构建。
|
|
10
|
-
- Git。
|
|
11
|
-
- 本地开发前运行 `
|
|
12
|
-
|
|
13
|
-
仅修改文档时,重点阅读语言与文档策略以及 Pull Request 自检。修改 skill 或 OpenClaw 时,请在提交 PR 前参考下方对应章节。
|
|
14
|
-
|
|
15
|
-
快速自检(最小推荐):
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
完整的场景化命令请见后文 npm scripts 与 Pull Request 自检。
|
|
25
|
-
|
|
26
|
-
## 项目结构
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
├── agents/ # Agent 定义(Markdown + YAML frontmatter)
|
|
30
|
-
├── bin/ # CLI 入口 (frontend-craft.ts)
|
|
31
|
-
├── commands/ # 自定义命令定义 (fec-init, fec-review, fec-scaffold)
|
|
32
|
-
├── docs/ # 各 runtime 安装文档与多语言 README
|
|
33
|
-
├── hooks/ # Hook 配置 (hooks.json)
|
|
34
|
-
├── scripts/ # 源码运行的维护脚本(构建、打包、发布校验)
|
|
35
|
-
├── skills/ # Skill 定义 (SKILL.md + metadata.json)
|
|
36
|
-
├── src/ # 源代码
|
|
37
|
-
│ ├── hooks/ # runtime hook 源码,打包到 dist/hooks/
|
|
38
|
-
│ ├── install/ # 安装器核心 (CLI、交互式向导、各 runtime 转换器)
|
|
39
|
-
│ └── openclaw/ # OpenClaw runtime TypeScript 源码
|
|
40
|
-
├── templates/ # 模板文件 (Claude/Codex/OpenClaw 配置 + 共享规则)
|
|
41
|
-
├── tests/ # 测试用例
|
|
42
|
-
│ ├── converters/ # 转换器测试
|
|
43
|
-
│ └── install/ # 安装器测试 (CLI、端到端、全 runtime dry-run)
|
|
44
|
-
└── package.json # 项目配置与脚本
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## 本地开发与调试
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
# 1. 安装依赖
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# 2. 构建 dist/bin 与 dist/hooks
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# 3. 本地安装到指定 runtime(如 claude)
|
|
57
|
-
node dist/bin/frontend-craft.js install claude --local --dry-run # 先 dry-run 预览
|
|
58
|
-
node dist/bin/frontend-craft.js install claude --local # 实际安装
|
|
59
|
-
|
|
60
|
-
# 4. 安装到所有 runtime
|
|
61
|
-
node dist/bin/frontend-craft.js install --all --dry-run
|
|
62
|
-
|
|
63
|
-
# 5. 列出所有支持的 runtime
|
|
64
|
-
node dist/bin/frontend-craft.js list
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
`
|
|
68
|
-
|
|
69
|
-
## 测试指南
|
|
70
|
-
|
|
71
|
-
测试使用 Node.js 内置 `node:test` + `assert/strict`。
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
# 运行所有测试
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
# 运行单个测试文件
|
|
78
|
-
node --import tsx --test tests/install/cli.test.ts
|
|
79
|
-
|
|
80
|
-
# 运行安装器相关测试
|
|
81
|
-
node --import tsx --test tests/install/*.test.ts
|
|
82
|
-
|
|
83
|
-
# 运行转换器相关测试
|
|
84
|
-
node --import tsx --test tests/converters/*.test.ts
|
|
85
|
-
|
|
86
|
-
# 运行全 runtime dry-run 测试
|
|
87
|
-
node --import tsx --test tests/install/all-runtimes-dry.test.ts
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
测试交互式安装向导时,设置 `FRONTEND_CRAFT_FORCE_INTERACTIVE=1` 环境变量:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
FRONTEND_CRAFT_FORCE_INTERACTIVE=1 node --import tsx --test tests/install/cli.test.ts
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
`
|
|
97
|
-
|
|
98
|
-
## OpenClaw 构建流程
|
|
99
|
-
|
|
100
|
-
OpenClaw runtime 有独立的构建管线:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
源码路径:`src/openclaw/`(TypeScript)→ `dist/openclaw/index.js`(打包后的 ESM)。
|
|
110
|
-
TypeScript 配置:`tsconfig.openclaw.json`。
|
|
111
|
-
|
|
112
|
-
## 独立 Skill 发布包
|
|
113
|
-
|
|
114
|
-
Skill 的权威源文件位于 `skills/<skill-id>/`。不要手动修改 `skill-packages/` 下的生成产物。
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
`
|
|
123
|
-
|
|
124
|
-
修改 skill 时,请保持这些源文件一致:
|
|
125
|
-
|
|
126
|
-
- `skills/<skill-id>/SKILL.md` — runtime 使用的权威说明。
|
|
127
|
-
- `skills/metadata.json` — 发布元数据、分类、标签、关键词、目标平台和包版本。
|
|
128
|
-
- `skills/eval_queries.json` — 用于路由质量检查的正向/负向触发样例。
|
|
129
|
-
- 当公开 skill 列表或用户可见行为变化时,同步 `README.md` 和各语言 README 摘要。
|
|
130
|
-
|
|
131
|
-
##
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
| `
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
| `
|
|
152
|
-
| `
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
| `scripts/
|
|
174
|
-
| `scripts/
|
|
175
|
-
| `scripts/
|
|
176
|
-
| `scripts/
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
##
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
- [ ]
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
1
|
+
# 贡献指南
|
|
2
|
+
|
|
3
|
+
> **English:** [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
4
|
+
|
|
5
|
+
感谢你对 `frontend-craft` 的关注。欢迎通过 Issue、Pull Request、文档修正、runtime 适配、示例补充等方式参与贡献。
|
|
6
|
+
|
|
7
|
+
## 开发环境
|
|
8
|
+
|
|
9
|
+
- Node.js >= 22,用于通用安装器与 OpenClaw 包构建。
|
|
10
|
+
- Git。
|
|
11
|
+
- 本地开发前运行 `pnpm install`。
|
|
12
|
+
|
|
13
|
+
仅修改文档时,重点阅读语言与文档策略以及 Pull Request 自检。修改 skill 或 OpenClaw 时,请在提交 PR 前参考下方对应章节。
|
|
14
|
+
|
|
15
|
+
快速自检(最小推荐):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm test # 通用校验
|
|
19
|
+
pnpm run pack:skills # Skill 变更
|
|
20
|
+
pnpm run check:skills-publish # Skill 变更
|
|
21
|
+
pnpm run typecheck:openclaw # OpenClaw 变更
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
完整的场景化命令请见后文 npm scripts 与 Pull Request 自检。
|
|
25
|
+
|
|
26
|
+
## 项目结构
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
├── agents/ # Agent 定义(Markdown + YAML frontmatter)
|
|
30
|
+
├── bin/ # CLI 入口 (frontend-craft.ts)
|
|
31
|
+
├── commands/ # 自定义命令定义 (fec-init, fec-review, fec-scaffold)
|
|
32
|
+
├── docs/ # 各 runtime 安装文档与多语言 README
|
|
33
|
+
├── hooks/ # Hook 配置 (hooks.json)
|
|
34
|
+
├── scripts/ # 源码运行的维护脚本(构建、打包、发布校验)
|
|
35
|
+
├── skills/ # Skill 定义 (SKILL.md + metadata.json)
|
|
36
|
+
├── src/ # 源代码
|
|
37
|
+
│ ├── hooks/ # runtime hook 源码,打包到 dist/hooks/
|
|
38
|
+
│ ├── install/ # 安装器核心 (CLI、交互式向导、各 runtime 转换器)
|
|
39
|
+
│ └── openclaw/ # OpenClaw runtime TypeScript 源码
|
|
40
|
+
├── templates/ # 模板文件 (Claude/Codex/OpenClaw 配置 + 共享规则)
|
|
41
|
+
├── tests/ # 测试用例
|
|
42
|
+
│ ├── converters/ # 转换器测试
|
|
43
|
+
│ └── install/ # 安装器测试 (CLI、端到端、全 runtime dry-run)
|
|
44
|
+
└── package.json # 项目配置与脚本
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 本地开发与调试
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# 1. 安装依赖
|
|
51
|
+
pnpm install
|
|
52
|
+
|
|
53
|
+
# 2. 构建 dist/bin 与 dist/hooks
|
|
54
|
+
pnpm run build
|
|
55
|
+
|
|
56
|
+
# 3. 本地安装到指定 runtime(如 claude)
|
|
57
|
+
node dist/bin/frontend-craft.js install claude --local --dry-run # 先 dry-run 预览
|
|
58
|
+
node dist/bin/frontend-craft.js install claude --local # 实际安装
|
|
59
|
+
|
|
60
|
+
# 4. 安装到所有 runtime
|
|
61
|
+
node dist/bin/frontend-craft.js install --all --dry-run
|
|
62
|
+
|
|
63
|
+
# 5. 列出所有支持的 runtime
|
|
64
|
+
node dist/bin/frontend-craft.js list
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`pnpm run build` 会依次运行 `clean`、`typecheck` 和 `scripts/build-dist.ts`。本地使用 `dist/bin/frontend-craft.js` 或打包后的 hook 脚本前,请先运行它。
|
|
68
|
+
|
|
69
|
+
## 测试指南
|
|
70
|
+
|
|
71
|
+
测试使用 Node.js 内置 `node:test` + `assert/strict`。
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# 运行所有测试
|
|
75
|
+
pnpm test
|
|
76
|
+
|
|
77
|
+
# 运行单个测试文件
|
|
78
|
+
node --import tsx --test tests/install/cli.test.ts
|
|
79
|
+
|
|
80
|
+
# 运行安装器相关测试
|
|
81
|
+
node --import tsx --test tests/install/*.test.ts
|
|
82
|
+
|
|
83
|
+
# 运行转换器相关测试
|
|
84
|
+
node --import tsx --test tests/converters/*.test.ts
|
|
85
|
+
|
|
86
|
+
# 运行全 runtime dry-run 测试
|
|
87
|
+
node --import tsx --test tests/install/all-runtimes-dry.test.ts
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
测试交互式安装向导时,设置 `FRONTEND_CRAFT_FORCE_INTERACTIVE=1` 环境变量:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
FRONTEND_CRAFT_FORCE_INTERACTIVE=1 node --import tsx --test tests/install/cli.test.ts
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`pnpm test` 会先运行 `pnpm run build`,再通过 `tsx` 执行 `tests/` 下精选的 converter 与 installer 测试。
|
|
97
|
+
|
|
98
|
+
## OpenClaw 构建流程
|
|
99
|
+
|
|
100
|
+
OpenClaw runtime 有独立的构建管线:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pnpm run build:openclaw # 使用 esbuild 将 TypeScript 打包到 dist/openclaw/
|
|
104
|
+
pnpm run typecheck:openclaw # TypeScript 类型检查
|
|
105
|
+
pnpm run check:openclaw-dist # 验证 dist 完整性
|
|
106
|
+
pnpm run pack:openclaw # 完整构建 + 验证 + 打包
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
源码路径:`src/openclaw/`(TypeScript)→ `dist/openclaw/index.js`(打包后的 ESM)。
|
|
110
|
+
TypeScript 配置:`tsconfig.openclaw.json`。
|
|
111
|
+
|
|
112
|
+
## 独立 Skill 发布包
|
|
113
|
+
|
|
114
|
+
Skill 的权威源文件位于 `skills/<skill-id>/`。不要手动修改 `skill-packages/` 下的生成产物。
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pnpm run pack:skills # 为每个 skill 生成独立发布包
|
|
118
|
+
pnpm run check:skills-publish # 校验包元数据、索引和引用文件
|
|
119
|
+
pnpm run pack:all # 构建 + 测试 + OpenClaw 包 + 独立 skill 包
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`pnpm run pack:skills` 会生成 `skill-packages/<skill-id>/`,其中包含 `SKILL.md`、该 skill 实际引用的 `references/` 文件、`metadata.json`、`package.json`、`README.md` 和 `LICENSE`。同时会生成 `skill-packages/index.json`,供平台索引或发布自动化使用。
|
|
123
|
+
|
|
124
|
+
修改 skill 时,请保持这些源文件一致:
|
|
125
|
+
|
|
126
|
+
- `skills/<skill-id>/SKILL.md` — runtime 使用的权威说明。
|
|
127
|
+
- `skills/metadata.json` — 发布元数据、分类、标签、关键词、目标平台和包版本。
|
|
128
|
+
- `skills/eval_queries.json` — 用于路由质量检查的正向/负向触发样例。
|
|
129
|
+
- 当公开 skill 列表或用户可见行为变化时,同步 `README.md` 和各语言 README 摘要。
|
|
130
|
+
|
|
131
|
+
## 开发 scripts
|
|
132
|
+
|
|
133
|
+
包管理器固定为 pnpm 12.4.1,唯一依赖锁文件为 pnpm-lock.yaml。通过 npm 安装 pnpm 需要 Node.js >=22.13;发布插件的运行要求仍为 Node.js >=22.0.0。使用 `pnpm install --frozen-lockfile` 安装依赖。pnpm-workspace.yaml 仅允许 esbuild 构建脚本,其余当前未使用的 SDK/原生初始化显式跳过。
|
|
134
|
+
|
|
135
|
+
`pnpm lint` 检查代码和中英文内容声明;`pnpm format:check` 只检查变更的源码与配置,不修改文件。`pnpm test` 自动发现 tests 下的所有 *.test.ts,无需手动维护清单。
|
|
136
|
+
|
|
137
|
+
请把 `package.json` scripts 作为公开的开发入口。
|
|
138
|
+
|
|
139
|
+
| Script | 用途 |
|
|
140
|
+
| ------------------------------ | -------------------------------------------------------------------------- |
|
|
141
|
+
| `pnpm run lint` | 检查代码和中英文内容声明。 |
|
|
142
|
+
| `pnpm run format:check` | 检查变更源码的格式。 |
|
|
143
|
+
| `pnpm run check:content` | 校验 YAML、名称、引用及本地化结构。 |
|
|
144
|
+
| `pnpm run clean` | 删除 `dist/`。 |
|
|
145
|
+
| `pnpm run typecheck` | 运行主项目 TypeScript 检查,并检查 skill 辅助脚本。 |
|
|
146
|
+
| `pnpm run build` | 运行 `clean`、`typecheck`,并通过 `scripts/build-dist.ts` 打包 CLI/hooks。 |
|
|
147
|
+
| `pnpm test` | 先构建,再通过 `tsx` 运行精选的 `node:test` 测试集。 |
|
|
148
|
+
| `pnpm run build:openclaw` | 构建主项目,然后打包 OpenClaw runtime 输出。 |
|
|
149
|
+
| `pnpm run audit:skills` | 构建后输出 skill 说明长度与描述重叠度信号。 |
|
|
150
|
+
| `pnpm run typecheck:openclaw` | 使用 `tsconfig.openclaw.json` 检查 OpenClaw 类型。 |
|
|
151
|
+
| `pnpm run check:openclaw-dist` | 校验生成的 OpenClaw dist 输出。 |
|
|
152
|
+
| `pnpm run pack:openclaw` | 构建、校验并打包 OpenClaw 插件。 |
|
|
153
|
+
| `pnpm run pack:skills` | 先构建,再在 `skill-packages/` 下生成独立 skill 包。 |
|
|
154
|
+
| `pnpm run check:skills-publish` | 先构建,再校验独立 skill 包元数据与复制文件。 |
|
|
155
|
+
| `pnpm run pack:all` | 构建、运行测试、打包 OpenClaw、打包 skills,并校验 skill 产物。 |
|
|
156
|
+
| `pnpm run sync:version` | 同步发布清单中的 package 版本元数据。 |
|
|
157
|
+
| `pnpm run version` | 运行 `sync:version` 同步版本元数据,不自动暂存文件。 |
|
|
158
|
+
| `pnpm run prepack` | 在 `npm pack` 前构建。 |
|
|
159
|
+
| `pnpm run prepublishOnly` | 在 npm publish 前同步版本并运行测试。 |
|
|
160
|
+
|
|
161
|
+
常见变更类型建议:
|
|
162
|
+
|
|
163
|
+
- Skill 变更:运行 `pnpm test`、`pnpm run audit:skills`、`pnpm run pack:skills` 和 `pnpm run check:skills-publish`。
|
|
164
|
+
- OpenClaw 变更:运行 `pnpm run typecheck:openclaw` 和 `pnpm run pack:openclaw`。
|
|
165
|
+
- 发布打包:运行 `pnpm run pack:all`;`prepublishOnly` 也会在发布前执行版本同步和测试。
|
|
166
|
+
|
|
167
|
+
## 源码维护脚本
|
|
168
|
+
|
|
169
|
+
维护脚本位于 `scripts/`,通过 `tsx` 直接运行源码;它们不会以 `dist/scripts` 形式发布。
|
|
170
|
+
|
|
171
|
+
| 文件 | 用途 |
|
|
172
|
+
| ------------------------------------------ | ------------------------------ |
|
|
173
|
+
| `scripts/audit-skills.ts` | Skill 大小与触发描述重叠度审计 |
|
|
174
|
+
| `scripts/build-dist.ts` | CLI 与 runtime hook 打包 |
|
|
175
|
+
| `scripts/clean-dist.mjs` | 删除生成的 `dist/` 输出 |
|
|
176
|
+
| `scripts/sync-codex-agents-toml.ts` | 同步 Codex agents 配置 |
|
|
177
|
+
| `scripts/sync-version.ts` | 同步发布版本元数据 |
|
|
178
|
+
| `scripts/pack-skills.ts` | 独立 skill 包构建 |
|
|
179
|
+
| `scripts/check-skills-publish.ts` | 独立 skill 包校验 |
|
|
180
|
+
| `scripts/skill-packaging.ts` | skill 打包共享辅助函数 |
|
|
181
|
+
| `scripts/openclaw/build.ts` | OpenClaw esbuild 打包 |
|
|
182
|
+
| `scripts/openclaw/pack-openclaw.ts` | OpenClaw 打包 |
|
|
183
|
+
| `scripts/openclaw/verify-openclaw-dist.ts` | 验证 OpenClaw dist 完整性 |
|
|
184
|
+
|
|
185
|
+
## Runtime Hook 脚本
|
|
186
|
+
|
|
187
|
+
Hook 脚本位于 `src/hooks/`,发布时会打包到 `dist/hooks/` 供 runtime 使用。维护脚本位于 `scripts/`,通过 `tsx` 直接运行源码,不再发布为 `dist/scripts`。
|
|
188
|
+
|
|
189
|
+
| 源文件 | 打包输出 | 用途 |
|
|
190
|
+
| ---------------------------------- | ----------------------------------- | -------------- |
|
|
191
|
+
| `src/hooks/cleanup-claude-cache.ts` | `dist/hooks/fec-cleanup-claude-cache.js` | 缓存清理 |
|
|
192
|
+
| `src/hooks/run-tests.ts` | `dist/hooks/fec-run-tests.js` | 测试运行辅助 |
|
|
193
|
+
| `src/hooks/format-changed-file.ts` | `dist/hooks/fec-format-changed-file.js` | 格式化变更文件 |
|
|
194
|
+
| `src/hooks/security-check.ts` | `dist/hooks/fec-security-check.js` | 安全检查 |
|
|
195
|
+
| `src/hooks/notify.ts` | `dist/hooks/fec-notify.js` | 通知脚本 |
|
|
196
|
+
| `src/hooks/session-start.ts` | `dist/hooks/fec-session-start.js` | 会话初始化 |
|
|
197
|
+
|
|
198
|
+
## 架构概览
|
|
199
|
+
|
|
200
|
+
通用安装器的架构如下:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
bin/frontend-craft.ts
|
|
204
|
+
└─ src/install/cli.ts # CLI 入口(解析命令:install/list/version/uninstall)
|
|
205
|
+
├─ src/install/registry.ts # runtime 注册表(名称 + 安装器映射)
|
|
206
|
+
├─ src/install/converters/ # 各 runtime 适配器(claude, codex, cursor, copilot 等)
|
|
207
|
+
├─ src/install/interactive.ts # 交互式安装向导(runtime/位置选择)
|
|
208
|
+
├─ src/install/runtime-homes.ts # 全局/本地目录约定
|
|
209
|
+
└─ src/install/types.ts # 共享 TypeScript 类型
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
`src/install/converters/` 下的每个 runtime 转换器都实现了 `types.ts` 中定义的 `InstallContext` 接口,将 skills、agents、commands、hooks 和模板写入目标 runtime 的配置目录。
|
|
213
|
+
|
|
214
|
+
## 分支策略
|
|
215
|
+
|
|
216
|
+
- `main` — 稳定发布分支。
|
|
217
|
+
- `develop` — 开发分支(如使用)。
|
|
218
|
+
- `feature/<name>` — 新功能。
|
|
219
|
+
- `fix/<name>` — Bug 修复。
|
|
220
|
+
- `docs/<name>` — 文档更新。
|
|
221
|
+
|
|
222
|
+
## 提交规范
|
|
223
|
+
|
|
224
|
+
遵循 [Conventional Commits](https://www.conventionalcommits.org/):
|
|
225
|
+
|
|
226
|
+
```text
|
|
227
|
+
<type>(<scope>): <description>
|
|
228
|
+
|
|
229
|
+
[optional body]
|
|
230
|
+
[optional footer]
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
常见类型:
|
|
234
|
+
|
|
235
|
+
| Type | 含义 |
|
|
236
|
+
| ---------- | ---------------- |
|
|
237
|
+
| `feat` | 新功能 |
|
|
238
|
+
| `fix` | Bug 修复 |
|
|
239
|
+
| `docs` | 文档 |
|
|
240
|
+
| `refactor` | 重构 |
|
|
241
|
+
| `test` | 测试 |
|
|
242
|
+
| `chore` | 构建、工具或维护 |
|
|
243
|
+
|
|
244
|
+
示例:
|
|
245
|
+
|
|
246
|
+
```text
|
|
247
|
+
feat(skills): add e2e testing skill
|
|
248
|
+
fix(hooks): resolve Windows path handling
|
|
249
|
+
docs(readme): update installation steps
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## 语言与文档策略
|
|
253
|
+
|
|
254
|
+
英文是公开项目治理、runtime 文档、发布说明和 GitHub 协作模板的**源语言**。多语言 README 应聚焦用户向摘要,并在贡献者或维护者细节上链接回英文文档。
|
|
255
|
+
|
|
256
|
+
当 Pull Request 修改公共行为、安装步骤、runtime、agent、skill、command 或 hook 时:
|
|
257
|
+
|
|
258
|
+
- 优先更新 `README.md` 与 `CHANGELOG.md`(及对应的 [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md) 若需同步中文读者)。
|
|
259
|
+
- 若影响用户,需同步 `README.zh-CN.md`、`docs/zh-TW/README.md`、`docs/ja-JP/README.md` 和 `docs/ko-KR/README.md` 中的用户向摘要。
|
|
260
|
+
- Claude Code Marketplace 的安装与更新说明以 [`docs/runtimes/claude.md`](docs/runtimes/claude.md) 与 [`docs/runtimes/claude.zh-CN.md`](docs/runtimes/claude.zh-CN.md) 为准;修改该流程时请更新这两份文件(根 README 与各语言 README 仅链向它们)。
|
|
261
|
+
- 若同一 PR 无法完成翻译,请创建或链接后续 Issue,并在 PR 描述中说明。
|
|
262
|
+
- 各语言版本中的代码示例、runtime 名称、命令名、文件路径和包名应保持一致。
|
|
263
|
+
|
|
264
|
+
Issue 与 PR 使用英文最便于全球社区检索与 Review。若你更习惯中文,也欢迎提交;维护者可协助翻译标题和摘要。
|
|
265
|
+
|
|
266
|
+
## 如何添加 Skill
|
|
267
|
+
|
|
268
|
+
1. 在 `skills/` 下创建目录,例如 `skills/fec-my-skill/`。
|
|
269
|
+
2. 创建 `SKILL.md`,包含 YAML frontmatter 与简洁说明:
|
|
270
|
+
|
|
271
|
+
```markdown
|
|
272
|
+
---
|
|
273
|
+
name: fec-my-skill
|
|
274
|
+
description: Use when the user needs ...
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
# Skill Title
|
|
278
|
+
|
|
279
|
+
## When to Use
|
|
280
|
+
|
|
281
|
+
- ...
|
|
282
|
+
|
|
283
|
+
## Core Rules
|
|
284
|
+
|
|
285
|
+
- ...
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
3. 在 `skills/metadata.json` 中新增条目,包括 `id`、展示名称 `name`、分类 `category`、`tags`、`summary`、发布元数据、`keywords` 和 `platforms`。其中 `version`、`license`、`homepage`、`repository` 应与 `package.json` 保持一致。
|
|
289
|
+
4. 在 `skills/eval_queries.json` 中补充正向和负向触发样例。
|
|
290
|
+
5. 在 `README.md` 的 Skills 表格中新增一行。
|
|
291
|
+
6. 若可见目录结构变化,同步 `README.md` 与各语言 README 的目录树。
|
|
292
|
+
7. 运行 `pnpm test`、`pnpm run pack:skills` 和 `pnpm run check:skills-publish`。
|
|
293
|
+
|
|
294
|
+
## 如何添加 Agent
|
|
295
|
+
|
|
296
|
+
1. 创建 `agents/my-agent.md`。
|
|
297
|
+
2. 定义 YAML frontmatter:
|
|
298
|
+
|
|
299
|
+
```markdown
|
|
300
|
+
---
|
|
301
|
+
name: my-agent
|
|
302
|
+
description: Use this agent when ...
|
|
303
|
+
tools: Read, Edit, Write, Glob, Grep, Bash
|
|
304
|
+
model: sonnet
|
|
305
|
+
skills:
|
|
306
|
+
- relevant-skill
|
|
307
|
+
---
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
3. 在 `README.md` 的 Agents 表格中新增一行。
|
|
311
|
+
4. 当数量或用户向描述变化时,同步 `README.zh-CN.md`、`docs/*/README.md` 与 `.claude-plugin/marketplace.json`。
|
|
312
|
+
|
|
313
|
+
## 如何添加 Command
|
|
314
|
+
|
|
315
|
+
1. 创建 `commands/my-command.md`。
|
|
316
|
+
2. 使用 YAML frontmatter 与 Markdown 描述执行步骤。
|
|
317
|
+
3. 在 `README.md` 的 Commands 表格中新增一行,并按需同步多语言用户向摘要。
|
|
318
|
+
|
|
319
|
+
## 如何添加 Rule 模板
|
|
320
|
+
|
|
321
|
+
1. 在 `templates/shared/rules/` 下创建 `my-rule.md`。
|
|
322
|
+
2. 在 `commands/fec-init.md` 的复制清单中新增该文件。
|
|
323
|
+
3. 在 `templates/claude/CLAUDE.md` 的规则导入示例中补充(如适用)。
|
|
324
|
+
|
|
325
|
+
## 多工具安装器
|
|
326
|
+
|
|
327
|
+
- 入口:`bin/frontend-craft.ts`。
|
|
328
|
+
- 实现目录:`src/install/`(安装器、注册表、路径辅助)。
|
|
329
|
+
- 交互向导与输入解析:`src/install/interactive.ts`(测试可将 `FRONTEND_CRAFT_FORCE_INTERACTIVE` 设为 `1` 以模拟管道输入下的问答)。
|
|
330
|
+
- 新增 runtime 时,在 `src/install/registry.ts` 注册。
|
|
331
|
+
- 在 `src/install/converters/` 下添加 runtime 安装器。
|
|
332
|
+
- 参考 `src/install/runtime-homes.ts` 中的全局目录约定。
|
|
333
|
+
- 在 `tests/install/` 中新增或更新测试。
|
|
334
|
+
|
|
335
|
+
## 如何添加 Hook
|
|
336
|
+
|
|
337
|
+
1. 更新 `hooks/hooks.json`。
|
|
338
|
+
2. 如需 runtime hook 脚本,放在 `src/hooks/` 下,并优先使用跨平台 Node.js。
|
|
339
|
+
3. 在 `scripts/build-dist.ts` 中新增对应入口,确保 `pnpm run build` 会将其打包到 `dist/hooks/`。
|
|
340
|
+
4. 在 `hooks/hooks.json` 中,引用内置 hook 入口请使用 **`${CLAUDE_PLUGIN_ROOT}/dist/hooks/<script>.js`**(Claude Code 会在运行时替换根路径;见官方 [Plugins reference](https://code.claude.com/docs/en/plugins-reference))。本仓库的 Claude 安装器在将 `hooks.json` 写入 `.claude/` 时,也会把 **`${CLAUDE_PLUGIN_ROOT}`** 及旧占位符 **`${FRONTEND_CRAFT_ROOT}`** 展开为绝对路径。
|
|
341
|
+
5. 仓库维护脚本继续放在 `scripts/`,不要在 runtime hook 配置中直接引用它们。
|
|
342
|
+
6. 更新 `README.md` 的 Hooks 表格。
|
|
343
|
+
|
|
344
|
+
## Pull Request 自检
|
|
345
|
+
|
|
346
|
+
提交 PR 前请确认:
|
|
347
|
+
|
|
348
|
+
- [ ] 变更范围清晰,描述明确。
|
|
349
|
+
- [ ] `pnpm test` 通过。
|
|
350
|
+
- [ ] 修改 skill 时,`pnpm run audit:skills`、`pnpm run pack:skills` 与 `pnpm run check:skills-publish` 通过。
|
|
351
|
+
- [ ] 修改 OpenClaw 代码或模板时,`pnpm run typecheck:openclaw` 与 `pnpm run pack:openclaw` 通过。
|
|
352
|
+
- [ ] 用户可见行为变化已更新 `README.md` 与 `CHANGELOG.md`(及 [CHANGELOG.zh-CN.md](CHANGELOG.zh-CN.md) 如适用)。
|
|
353
|
+
- [ ] 多语言 README 已同步,或已链接后续翻译 Issue。
|
|
354
|
+
- [ ] 新增 runtime、agent、skill、command、hook 或模板时,包含相关测试或 dry-run 覆盖。
|
|
355
|
+
- [ ] 发布打包相关变更已通过 `pnpm run pack:all`,或已由 `prepublishOnly` 发布门禁覆盖。
|
|
356
|
+
- [ ] 涉及安全敏感逻辑时,已按 [SECURITY.zh-CN.md](SECURITY.zh-CN.md) / [SECURITY.md](SECURITY.md) 检查。
|
|
357
|
+
|
|
358
|
+
## 代码风格
|
|
359
|
+
|
|
360
|
+
- Markdown 使用稳定标题和清晰表格。
|
|
361
|
+
- Skill 与 Agent 描述保持简洁,因为模型路由依赖这些描述。
|
|
362
|
+
- 自动化脚本优先使用跨平台 Node.js。
|
|
363
|
+
- 除非特定 runtime 明确需要,否则避免依赖某个 shell 的特性。
|
|
364
|
+
|
|
365
|
+
## 问题反馈
|
|
366
|
+
|
|
367
|
+
使用 [GitHub Issues](https://github.com/bovinphang/frontend-craft/issues) 提交 Bug 或功能建议。请尽量包含 runtime、操作系统、Node.js 版本、执行命令、预期行为和实际行为。
|
|
368
|
+
|
|
369
|
+
**安全敏感漏洞**不要提交公开 Issue,请按 [SECURITY.zh-CN.md](SECURITY.zh-CN.md)(或 [SECURITY.md](SECURITY.md))处理。
|
|
370
|
+
|
|
371
|
+
修改审核或图表能力时,同步各语言 README 与运行时指南中的范围默认值、自然语言示例、工具前提、QA 边界和覆盖报告要求。参见 [审核范围与技术图交付](docs/zh-CN/review-and-diagram-workflows.md).
|