@bovinphang/frontend-craft 2.9.0 → 3.0.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 +403 -378
- package/CHANGELOG.zh-CN.md +402 -377
- package/CONTRIBUTING.md +381 -371
- package/CONTRIBUTING.zh-CN.md +383 -371
- package/README.md +605 -545
- package/README.openclaw.md +395 -359
- package/README.openclaw.zh-CN.md +395 -359
- package/README.zh-CN.md +605 -545
- package/agents/fec-typescript-reviewer.md +1 -1
- package/common-content.lock.json +3795 -0
- package/dist/bin/frontend-craft.js +353 -174
- package/docs/common-migration.md +61 -0
- package/docs/example-prompts.md +157 -157
- package/docs/ja-JP/README.md +588 -534
- package/docs/ko-KR/README.md +588 -534
- package/docs/project-structure.md +166 -151
- package/docs/review-and-diagram-workflows.md +5 -5
- package/docs/runtimes/antigravity.md +18 -18
- package/docs/runtimes/augment.md +18 -18
- package/docs/runtimes/claude.md +193 -191
- package/docs/runtimes/claude.zh-CN.md +191 -189
- package/docs/runtimes/cline.md +18 -18
- package/docs/runtimes/codebuddy.md +18 -18
- package/docs/runtimes/codex.md +18 -18
- package/docs/runtimes/compatibility.md +42 -27
- package/docs/runtimes/copilot.md +18 -18
- package/docs/runtimes/cursor.md +18 -18
- package/docs/runtimes/gemini.md +18 -18
- package/docs/runtimes/kilo.md +18 -18
- package/docs/runtimes/openclaw.md +18 -18
- package/docs/runtimes/opencode.md +18 -18
- package/docs/runtimes/qoder.md +18 -18
- package/docs/runtimes/trae.md +18 -18
- package/docs/runtimes/windsurf.md +18 -18
- package/docs/zh-CN/common-migration.md +57 -0
- package/docs/zh-CN/example-prompts.md +157 -157
- package/docs/zh-CN/project-structure.md +166 -148
- package/docs/zh-CN/review-and-diagram-workflows.md +5 -5
- package/docs/zh-TW/README.md +588 -534
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +1 -1
- package/localized/zh-CN/skills/cc-c-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
- package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-c-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-cpp-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-debug-methodology/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-debug-methodology/references/method.md +13 -0
- package/localized/zh-CN/skills/cc-doc-sync-core/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-doc-sync-core/references/method.md +12 -0
- package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/SKILL.md +5 -5
- package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/flowchart-quality.md +1 -1
- package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/layout-and-export.md +9 -9
- package/localized/zh-CN/skills/cc-electron-project-standard/SKILL.md +21 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/practice.md +19 -0
- package/localized/zh-CN/skills/cc-electron-project-standard/references/verification.md +17 -0
- package/localized/zh-CN/skills/cc-go-concurrency/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-go-concurrency/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-go-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
- package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-go-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-java-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/README.md +5 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
- package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-java-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-java-runtime/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-java-runtime/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-native-memory-safety/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-python-async/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-python-async/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-python-async/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-python-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
- package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-python-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-refactoring-core/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-refactoring-core/references/method.md +16 -0
- package/localized/zh-CN/skills/cc-rust-async/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-rust-async/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-rust-async/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/SKILL.md +25 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/cc-rust-project-standard/references/practice.md +37 -0
- package/localized/zh-CN/skills/cc-source-driven-development/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-source-driven-development/references/method.md +19 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/SKILL.md +21 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/practice.md +20 -0
- package/localized/zh-CN/skills/cc-tauri-project-standard/references/verification.md +18 -0
- package/localized/zh-CN/skills/cc-tdd-methodology/SKILL.md +8 -0
- package/localized/zh-CN/skills/cc-tdd-methodology/references/method.md +13 -0
- package/localized/zh-CN/skills/cc-technical-diagrams/SKILL.md +34 -0
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/interactive-diagram.html +371 -371
- package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.mmd +21 -21
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.mmd +7 -7
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/references/diagram-workflows.md +3 -3
- package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/references/html-technical-diagrams.md +7 -7
- package/localized/zh-CN/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
- package/{skills/fec-image-generation → localized/zh-CN/skills/cc-technical-diagrams}/scripts/diagram-browser.mjs +77 -14
- package/localized/zh-CN/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
- package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/SKILL.md +10 -4
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
- package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety-patterns.md +5 -34
- package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety.md +6 -0
- package/localized/zh-CN/skills/eval_queries.json +741 -319
- package/localized/zh-CN/skills/fec-api-integration/SKILL.md +5 -1
- package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-api-integration/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-code-review/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +1 -50
- package/localized/zh-CN/skills/fec-debug-framework/references/common/debug.md +13 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +7 -28
- package/localized/zh-CN/skills/fec-doc-sync/references/common/doc-sync.md +12 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +7 -101
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +1 -1
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +1 -1
- package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +6 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/README.md +7 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/package.json +15 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/pnpm-lock.yaml +662 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/request-view.mjs +24 -0
- package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/request-view.test.mjs +33 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/generic-component-types.md +37 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +3 -3
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +1 -1
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +12 -70
- package/localized/zh-CN/skills/fec-refactoring/references/common/refactoring.md +16 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +9 -39
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +4 -56
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-security-review/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +12 -43
- package/localized/zh-CN/skills/fec-tdd-workflow/references/common/tdd.md +13 -0
- package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-testing-strategy/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +4 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.md +237 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/engineering-practices.md +73 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +2 -2
- package/localized/zh-CN/skills/metadata.json +2246 -1008
- package/localized/zh-CN/skills/relations.json +501 -372
- package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +3 -29
- package/localized/zh-CN/templates/shared/rules/fec-typescript.md +4 -4
- package/localized/zh-CN/templates/shared/rules/references/common/source-driven-development.md +19 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +11 -4
- package/skills/cc-c-project-standard/SKILL.md +25 -0
- package/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
- package/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-c-project-standard/references/practice.md +37 -0
- package/skills/cc-cpp-project-standard/SKILL.md +25 -0
- package/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
- package/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-cpp-project-standard/references/practice.md +37 -0
- package/skills/cc-debug-methodology/SKILL.md +8 -0
- package/skills/cc-debug-methodology/references/method.md +13 -0
- package/skills/cc-doc-sync-core/SKILL.md +8 -0
- package/skills/cc-doc-sync-core/references/method.md +12 -0
- package/skills/{fec-drawio-studio → cc-drawio-studio}/SKILL.md +5 -5
- package/skills/{fec-drawio-studio → cc-drawio-studio}/references/flowchart-quality.md +1 -1
- package/skills/{fec-drawio-studio → cc-drawio-studio}/references/layout-and-export.md +9 -9
- package/skills/cc-electron-project-standard/SKILL.md +21 -0
- package/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
- package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
- package/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
- package/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
- package/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
- package/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
- package/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
- package/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
- package/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
- package/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
- package/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
- package/skills/cc-electron-project-standard/references/practice.md +19 -0
- package/skills/cc-electron-project-standard/references/verification.md +17 -0
- package/skills/cc-go-concurrency/SKILL.md +25 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
- package/skills/cc-go-concurrency/references/practice.md +37 -0
- package/skills/cc-go-project-standard/SKILL.md +25 -0
- package/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
- package/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
- package/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-go-project-standard/references/practice.md +37 -0
- package/skills/cc-java-project-standard/SKILL.md +25 -0
- package/skills/cc-java-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
- package/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-java-project-standard/references/practice.md +35 -0
- package/skills/cc-java-runtime/SKILL.md +25 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-java-runtime/references/engineering-practices.md +73 -0
- package/skills/cc-java-runtime/references/practice.md +37 -0
- package/skills/cc-native-memory-safety/SKILL.md +25 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
- package/skills/cc-native-memory-safety/references/practice.md +37 -0
- package/skills/cc-python-async/SKILL.md +25 -0
- package/skills/cc-python-async/references/common/engineering-practices.md +237 -0
- package/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-python-async/references/engineering-practices.md +73 -0
- package/skills/cc-python-async/references/practice.md +37 -0
- package/skills/cc-python-project-standard/SKILL.md +25 -0
- package/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
- package/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
- package/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-python-project-standard/references/practice.md +37 -0
- package/skills/cc-refactoring-core/SKILL.md +8 -0
- package/skills/cc-refactoring-core/references/method.md +16 -0
- package/skills/cc-rust-async/SKILL.md +25 -0
- package/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
- package/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-rust-async/references/engineering-practices.md +73 -0
- package/skills/cc-rust-async/references/practice.md +37 -0
- package/skills/cc-rust-project-standard/SKILL.md +25 -0
- package/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
- package/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
- package/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
- package/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
- package/skills/cc-rust-project-standard/references/practice.md +37 -0
- package/skills/cc-source-driven-development/SKILL.md +8 -0
- package/skills/cc-source-driven-development/references/method.md +19 -0
- package/skills/cc-tauri-project-standard/SKILL.md +21 -0
- package/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
- package/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
- package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
- package/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
- package/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
- package/skills/cc-tauri-project-standard/references/practice.md +20 -0
- package/skills/cc-tauri-project-standard/references/verification.md +18 -0
- package/skills/cc-tdd-methodology/SKILL.md +8 -0
- package/skills/cc-tdd-methodology/references/method.md +13 -0
- package/skills/cc-technical-diagrams/SKILL.md +34 -0
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/interactive-diagram.html +371 -371
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/README.md +5 -5
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.mmd +21 -21
- package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.mmd +7 -7
- package/skills/{fec-image-generation → cc-technical-diagrams}/references/diagram-workflows.md +3 -3
- package/skills/{fec-image-generation → cc-technical-diagrams}/references/html-technical-diagrams.md +7 -7
- package/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
- package/{localized/zh-CN/skills/fec-image-generation → skills/cc-technical-diagrams}/scripts/diagram-browser.mjs +77 -14
- package/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
- package/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
- package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/SKILL.md +10 -4
- package/skills/cc-typescript-project-standard/examples/engineering/README.md +9 -0
- package/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
- package/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
- package/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
- package/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
- package/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
- package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety-patterns.md +6 -35
- package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety.md +7 -1
- package/skills/eval_queries.json +741 -319
- package/skills/fec-api-integration/SKILL.md +5 -1
- package/skills/fec-api-integration/references/common/engineering-practices.md +237 -0
- package/skills/fec-api-integration/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-api-integration/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-api-integration/references/engineering-practices.md +73 -0
- package/skills/fec-code-review/SKILL.md +4 -0
- package/skills/fec-code-review/references/common/engineering-practices.md +237 -0
- package/skills/fec-code-review/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-code-review/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-code-review/references/engineering-practices.md +73 -0
- package/skills/fec-data-fetching/SKILL.md +4 -0
- package/skills/fec-data-fetching/references/common/engineering-practices.md +237 -0
- package/skills/fec-data-fetching/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-data-fetching/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-data-fetching/references/engineering-practices.md +73 -0
- package/skills/fec-debug-framework/SKILL.md +2 -51
- package/skills/fec-debug-framework/references/common/debug.md +13 -0
- package/skills/fec-dependency-upgrade/SKILL.md +4 -0
- package/skills/fec-dependency-upgrade/references/common/engineering-practices.md +237 -0
- package/skills/fec-dependency-upgrade/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-dependency-upgrade/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-dependency-upgrade/references/engineering-practices.md +73 -0
- package/skills/fec-doc-sync/SKILL.md +7 -28
- package/skills/fec-doc-sync/references/common/doc-sync.md +12 -0
- package/skills/fec-image-generation/SKILL.md +7 -102
- package/skills/fec-image-generation/references/png-qa-autofix.md +1 -1
- package/skills/fec-image-generation/scripts/png-qa.mjs +1 -1
- package/skills/fec-react-project-standard/SKILL.md +6 -0
- package/skills/fec-react-project-standard/examples/engineering/README.md +7 -0
- package/skills/fec-react-project-standard/examples/engineering/package.json +15 -0
- package/skills/fec-react-project-standard/examples/engineering/pnpm-lock.yaml +662 -0
- package/skills/fec-react-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
- package/skills/fec-react-project-standard/examples/engineering/request-view.mjs +24 -0
- package/skills/fec-react-project-standard/examples/engineering/request-view.test.mjs +33 -0
- package/skills/fec-react-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/fec-react-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-react-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-react-project-standard/references/engineering-practices.md +73 -0
- package/skills/fec-react-project-standard/references/generic-component-types.md +37 -0
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +3 -3
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +1 -1
- package/skills/fec-refactoring/SKILL.md +12 -70
- package/skills/fec-refactoring/references/common/refactoring.md +16 -0
- package/skills/fec-refactoring/references/principles.md +9 -56
- package/skills/fec-refactoring/references/workflow.md +4 -87
- package/skills/fec-security-review/SKILL.md +4 -0
- package/skills/fec-security-review/references/common/engineering-practices.md +237 -0
- package/skills/fec-security-review/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-security-review/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-security-review/references/engineering-practices.md +73 -0
- package/skills/fec-tdd-workflow/SKILL.md +13 -45
- package/skills/fec-tdd-workflow/references/common/tdd.md +13 -0
- package/skills/fec-testing-strategy/SKILL.md +4 -0
- package/skills/fec-testing-strategy/references/common/engineering-practices.md +237 -0
- package/skills/fec-testing-strategy/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-testing-strategy/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-testing-strategy/references/engineering-practices.md +73 -0
- package/skills/fec-vue3-project-standard/SKILL.md +4 -0
- package/skills/fec-vue3-project-standard/references/common/engineering-practices.md +237 -0
- package/skills/fec-vue3-project-standard/references/common/engineering-practices.rules.json +121 -0
- package/skills/fec-vue3-project-standard/references/common/engineering-practices.sources.json +377 -0
- package/skills/fec-vue3-project-standard/references/engineering-practices.md +73 -0
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +2 -2
- package/skills/metadata.json +2246 -1008
- package/skills/relations.json +501 -372
- package/templates/shared/rules/fec-source-driven-development.md +3 -29
- package/templates/shared/rules/fec-typescript.md +4 -4
- package/templates/shared/rules/references/common/source-driven-development.md +19 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +0 -14
- package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +0 -87
- package/skills/fec-source-driven-development/SKILL.md +0 -87
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/THIRD_PARTY_NOTICES.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/brand-icons.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/shape-index.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/data-residency.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/diagram-patterns.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/troubleshooting.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/xml-and-mermaid.md +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/brand-symbols.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-lint.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-url.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/drawio-export.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/layout-graph.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/png-embed-fix.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-go-packages.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-js-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-classes.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-rust-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-ts-modules.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/shape-query.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/studio-core.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/corporate.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/default.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/handdrawn.json +0 -0
- /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/schema.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/architecture.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/invalid-explicit.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.json +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/export-diagram.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/interactive-diagram-server.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/mermaid-render.mjs +0 -0
- /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/tech-diagram-render.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/THIRD_PARTY_NOTICES.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/brand-icons.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/shape-index.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/data-residency.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/diagram-patterns.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/troubleshooting.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/xml-and-mermaid.md +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/brand-symbols.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-lint.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-url.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/drawio-export.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/layout-graph.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/png-embed-fix.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-go-packages.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-js-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-classes.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-rust-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-ts-modules.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/shape-query.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/studio-core.mjs +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/corporate.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/default.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/handdrawn.json +0 -0
- /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/schema.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/architecture.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/invalid-explicit.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.json +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/export-diagram.mjs +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/interactive-diagram-server.mjs +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/mermaid-render.mjs +0 -0
- /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/tech-diagram-render.mjs +0 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import zlib from "node:zlib";
|
|
6
|
+
import { segmentHits } from "./diagram-layout.mjs";
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
8
|
+
|
|
9
|
+
if (process.argv[1] && pathToFileURL(path.resolve(process.argv[1])).href === import.meta.url) {
|
|
10
|
+
const args = parseArgs(process.argv.slice(2));
|
|
11
|
+
|
|
12
|
+
if (!args.png || args.help) {
|
|
13
|
+
printHelp();
|
|
14
|
+
process.exit(args.help ? 0 : 1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const image = readPng(args.png);
|
|
19
|
+
const manifest = args.manifest ? readManifest(args.manifest) : undefined;
|
|
20
|
+
const report = analyze(image, manifest, Boolean(args.strict));
|
|
21
|
+
if ((args.format ?? "markdown") === "json") {
|
|
22
|
+
console.log(JSON.stringify(report, null, 2));
|
|
23
|
+
} else {
|
|
24
|
+
console.log(renderMarkdown(report));
|
|
25
|
+
}
|
|
26
|
+
process.exit(report.ok ? 0 : 2);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function parseArgs(values) {
|
|
35
|
+
const parsed = { format: "markdown", strict: false, help: false };
|
|
36
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
37
|
+
const value = values[index];
|
|
38
|
+
if (value === "--help" || value === "-h") parsed.help = true;
|
|
39
|
+
else if (value === "--strict") parsed.strict = true;
|
|
40
|
+
else if (value === "--png") parsed.png = values[++index];
|
|
41
|
+
else if (value === "--manifest") parsed.manifest = values[++index];
|
|
42
|
+
else if (value === "--format") parsed.format = values[++index];
|
|
43
|
+
else throw new Error(`Unknown argument: ${value}`);
|
|
44
|
+
}
|
|
45
|
+
if (parsed.format !== "json" && parsed.format !== "markdown") {
|
|
46
|
+
throw new Error("--format must be json or markdown");
|
|
47
|
+
}
|
|
48
|
+
return parsed;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function printHelp() {
|
|
52
|
+
console.log(`Usage: node skills/cc-technical-diagrams/scripts/png-qa.mjs --png <file> [--manifest <layout.json>] [--format json|markdown] [--strict]`);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function readManifest(filePath) {
|
|
56
|
+
const manifest = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
57
|
+
return {
|
|
58
|
+
...manifest,
|
|
59
|
+
canvas: manifest.canvas,
|
|
60
|
+
boxes: Array.isArray(manifest.boxes) ? manifest.boxes : [],
|
|
61
|
+
connectors: Array.isArray(manifest.connectors) ? manifest.connectors : [],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function readPng(filePath) {
|
|
66
|
+
const buffer = fs.readFileSync(filePath);
|
|
67
|
+
const signature = "89504e470d0a1a0a";
|
|
68
|
+
if (buffer.subarray(0, 8).toString("hex") !== signature) {
|
|
69
|
+
throw new Error(`Not a PNG file: ${filePath}`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let offset = 8;
|
|
73
|
+
let ihdr;
|
|
74
|
+
const idat = [];
|
|
75
|
+
while (offset < buffer.length) {
|
|
76
|
+
const length = buffer.readUInt32BE(offset);
|
|
77
|
+
const type = buffer.subarray(offset + 4, offset + 8).toString("ascii");
|
|
78
|
+
const data = buffer.subarray(offset + 8, offset + 8 + length);
|
|
79
|
+
offset += 12 + length;
|
|
80
|
+
if (type === "IHDR") {
|
|
81
|
+
ihdr = {
|
|
82
|
+
width: data.readUInt32BE(0),
|
|
83
|
+
height: data.readUInt32BE(4),
|
|
84
|
+
bitDepth: data[8],
|
|
85
|
+
colorType: data[9],
|
|
86
|
+
compression: data[10],
|
|
87
|
+
filter: data[11],
|
|
88
|
+
interlace: data[12],
|
|
89
|
+
};
|
|
90
|
+
} else if (type === "IDAT") {
|
|
91
|
+
idat.push(data);
|
|
92
|
+
} else if (type === "IEND") {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!ihdr) throw new Error("PNG is missing IHDR");
|
|
98
|
+
if (ihdr.bitDepth !== 8) throw new Error(`Unsupported PNG bit depth: ${ihdr.bitDepth}`);
|
|
99
|
+
if (ihdr.compression !== 0 || ihdr.filter !== 0 || ihdr.interlace !== 0) {
|
|
100
|
+
throw new Error("Unsupported PNG compression/filter/interlace settings");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const channels = channelsForColorType(ihdr.colorType);
|
|
104
|
+
const inflated = zlib.inflateSync(Buffer.concat(idat));
|
|
105
|
+
const pixels = unfilter(inflated, ihdr.width, ihdr.height, channels);
|
|
106
|
+
return {
|
|
107
|
+
path: path.resolve(filePath),
|
|
108
|
+
width: ihdr.width,
|
|
109
|
+
height: ihdr.height,
|
|
110
|
+
colorType: ihdr.colorType,
|
|
111
|
+
channels,
|
|
112
|
+
pixels,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function channelsForColorType(colorType) {
|
|
117
|
+
if (colorType === 0) return 1;
|
|
118
|
+
if (colorType === 2) return 3;
|
|
119
|
+
if (colorType === 4) return 2;
|
|
120
|
+
if (colorType === 6) return 4;
|
|
121
|
+
throw new Error(`Unsupported PNG color type: ${colorType}`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function unfilter(data, width, height, channels) {
|
|
125
|
+
const stride = width * channels;
|
|
126
|
+
const output = Buffer.alloc(stride * height);
|
|
127
|
+
let sourceOffset = 0;
|
|
128
|
+
|
|
129
|
+
for (let y = 0; y < height; y += 1) {
|
|
130
|
+
const filterType = data[sourceOffset];
|
|
131
|
+
sourceOffset += 1;
|
|
132
|
+
const rowOffset = y * stride;
|
|
133
|
+
const previousRowOffset = (y - 1) * stride;
|
|
134
|
+
|
|
135
|
+
for (let x = 0; x < stride; x += 1) {
|
|
136
|
+
const raw = data[sourceOffset + x];
|
|
137
|
+
const left = x >= channels ? output[rowOffset + x - channels] : 0;
|
|
138
|
+
const up = y > 0 ? output[previousRowOffset + x] : 0;
|
|
139
|
+
const upLeft = y > 0 && x >= channels ? output[previousRowOffset + x - channels] : 0;
|
|
140
|
+
let value;
|
|
141
|
+
if (filterType === 0) value = raw;
|
|
142
|
+
else if (filterType === 1) value = raw + left;
|
|
143
|
+
else if (filterType === 2) value = raw + up;
|
|
144
|
+
else if (filterType === 3) value = raw + Math.floor((left + up) / 2);
|
|
145
|
+
else if (filterType === 4) value = raw + paeth(left, up, upLeft);
|
|
146
|
+
else throw new Error(`Unsupported PNG filter type: ${filterType}`);
|
|
147
|
+
output[rowOffset + x] = value & 0xff;
|
|
148
|
+
}
|
|
149
|
+
sourceOffset += stride;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return output;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function paeth(left, up, upLeft) {
|
|
156
|
+
const estimate = left + up - upLeft;
|
|
157
|
+
const leftDistance = Math.abs(estimate - left);
|
|
158
|
+
const upDistance = Math.abs(estimate - up);
|
|
159
|
+
const upLeftDistance = Math.abs(estimate - upLeft);
|
|
160
|
+
if (leftDistance <= upDistance && leftDistance <= upLeftDistance) return left;
|
|
161
|
+
if (upDistance <= upLeftDistance) return up;
|
|
162
|
+
return upLeft;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function analyze(image, manifest, strict) {
|
|
166
|
+
const issues = [];
|
|
167
|
+
const nextActions = new Set();
|
|
168
|
+
const ink = measureInk(image, strict ? 10 : 18);
|
|
169
|
+
|
|
170
|
+
if (image.width < 64 || image.height < 64) {
|
|
171
|
+
addIssue(issues, nextActions, "image-too-small", "PNG is too small for reliable visual QA.", "Export a larger PNG before review.");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (ink.coverage < (strict ? 0.001 : 0.0002)) {
|
|
175
|
+
addIssue(issues, nextActions, "blank-image", "PNG appears blank or nearly blank.", "Check the renderer/export target and regenerate the image.");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (ink.bounds) {
|
|
179
|
+
const pad = strict ? 6 : 3;
|
|
180
|
+
if (ink.bounds.minX <= pad || ink.bounds.minY <= pad || image.width - ink.bounds.maxX <= pad || image.height - ink.bounds.maxY <= pad) {
|
|
181
|
+
addIssue(issues, nextActions, "edge-clipping", "Visible content is very close to the PNG edge.", "Increase canvas/viewBox padding or reduce subject scale.");
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (manifest) analyzeManifest(image, manifest, issues, nextActions, strict);
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
ok: issues.length === 0,
|
|
189
|
+
image: {
|
|
190
|
+
path: image.path,
|
|
191
|
+
width: image.width,
|
|
192
|
+
height: image.height,
|
|
193
|
+
colorType: image.colorType,
|
|
194
|
+
inkCoverage: Number(ink.coverage.toFixed(6)),
|
|
195
|
+
inkBounds: ink.bounds,
|
|
196
|
+
},
|
|
197
|
+
measurement: manifest?.measurement ?? "image-only",
|
|
198
|
+
verification: { image: "checked", geometry: manifest ? "checked" : "unavailable", text: manifest?.measurement === "browser" ? "browser-measured" : "estimated-or-unavailable", visual: "pending" },
|
|
199
|
+
issues,
|
|
200
|
+
nextActions: [...nextActions],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function measureInk(image, threshold) {
|
|
205
|
+
const first = samplePixel(image, 0, 0);
|
|
206
|
+
let inkPixels = 0;
|
|
207
|
+
let minX = image.width;
|
|
208
|
+
let minY = image.height;
|
|
209
|
+
let maxX = -1;
|
|
210
|
+
let maxY = -1;
|
|
211
|
+
|
|
212
|
+
for (let y = 0; y < image.height; y += 1) {
|
|
213
|
+
for (let x = 0; x < image.width; x += 1) {
|
|
214
|
+
const pixel = samplePixel(image, x, y);
|
|
215
|
+
const differs = colorDistance(pixel, first) > threshold && pixel.a > 8;
|
|
216
|
+
if (differs) {
|
|
217
|
+
inkPixels += 1;
|
|
218
|
+
minX = Math.min(minX, x);
|
|
219
|
+
minY = Math.min(minY, y);
|
|
220
|
+
maxX = Math.max(maxX, x);
|
|
221
|
+
maxY = Math.max(maxY, y);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return {
|
|
227
|
+
coverage: inkPixels / (image.width * image.height),
|
|
228
|
+
bounds: inkPixels > 0 ? { minX, minY, maxX, maxY } : null,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function samplePixel(image, x, y) {
|
|
233
|
+
const offset = (y * image.width + x) * image.channels;
|
|
234
|
+
if (image.channels === 1) {
|
|
235
|
+
const value = image.pixels[offset];
|
|
236
|
+
return { r: value, g: value, b: value, a: 255 };
|
|
237
|
+
}
|
|
238
|
+
if (image.channels === 2) {
|
|
239
|
+
const value = image.pixels[offset];
|
|
240
|
+
return { r: value, g: value, b: value, a: image.pixels[offset + 1] };
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
r: image.pixels[offset],
|
|
244
|
+
g: image.pixels[offset + 1],
|
|
245
|
+
b: image.pixels[offset + 2],
|
|
246
|
+
a: image.channels === 4 ? image.pixels[offset + 3] : 255,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function colorDistance(left, right) {
|
|
251
|
+
return Math.abs(left.r - right.r) + Math.abs(left.g - right.g) + Math.abs(left.b - right.b) + Math.abs(left.a - right.a);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function analyzeManifest(image, manifest, issues, nextActions, strict) {
|
|
255
|
+
if (manifest.canvas && (manifest.canvas.width !== image.width || manifest.canvas.height !== image.height)) {
|
|
256
|
+
addIssue(
|
|
257
|
+
issues,
|
|
258
|
+
nextActions,
|
|
259
|
+
"manifest-canvas-mismatch",
|
|
260
|
+
`Manifest canvas ${manifest.canvas.width}x${manifest.canvas.height} does not match PNG ${image.width}x${image.height}.`,
|
|
261
|
+
"Regenerate the manifest from the final export dimensions.",
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
for (const box of manifest.boxes) if (![box.x,box.y,box.width,box.height].every(Number.isFinite) || box.width <= 0 || box.height <= 0) addIssue(issues,nextActions,"invalid-box-geometry",`Invalid geometry for "${box.id}".`,"Correct source dimensions.");
|
|
266
|
+
const allBoxes = manifest.boxes.map(normalizeBox).filter(Boolean);
|
|
267
|
+
const boxes = allBoxes.filter((box) => box.kind !== "group");
|
|
268
|
+
for (const issue of manifest.issues ?? []) addIssue(issues, nextActions, issue.code, issue.message, "Fix the source layout and render again.");
|
|
269
|
+
const labels = manifest.labels ?? [];
|
|
270
|
+
for (const label of labels) {
|
|
271
|
+
const owner = allBoxes.find((box) => box.id === label.owner);
|
|
272
|
+
if (label.kind === "node" && !owner) addIssue(issues,nextActions,"label-owner-missing",`Label "${label.id}" has an unknown node owner.`,"Correct label ownership in the manifest.");
|
|
273
|
+
if (![label.x,label.y,label.width,label.height].every(Number.isFinite) || label.width < 0 || label.height < 0) addIssue(issues,nextActions,"invalid-label-geometry",`Label "${label.id}" has invalid bounds.`,"Measure source labels again.");
|
|
274
|
+
if (label.x < 0 || label.y < 0 || label.x + label.width > image.width || label.y + label.height > image.height) addIssue(issues, nextActions, "label-out-of-bounds", `Label "${label.id}" exceeds the canvas.`, "Expand the canvas or adjust the source label position.");
|
|
275
|
+
if (label.kind === "node" && owner && (label.x < owner.x || label.y < owner.y || label.x + label.width > owner.x + owner.width || label.y + label.height > owner.y + owner.height)) addIssue(issues, nextActions, "node-text-overflow", `Label "${label.id}" exceeds node "${owner.id}".`, "Expand the source node or adjust its text layout.");
|
|
276
|
+
if (Array.isArray(label.lines) && label.lines.join("").replace(/\r?\n/g, "") !== String(label.text ?? "").replace(/\r?\n/g, "")) addIssue(issues, nextActions, "label-content-loss", `Label "${label.id}" does not preserve source text.`, "Restore the complete source label.");
|
|
277
|
+
if (label.kind === "edge") for (const box of boxes) if (overlapArea(label, box) > 0) addIssue(issues, nextActions, "edge-label-collision", `Label "${label.id}" overlaps node "${box.id}".`, "Move the edge label to a clear route segment.");
|
|
278
|
+
}
|
|
279
|
+
for (let i = 0; i < labels.length; i++) for (let j = i + 1; j < labels.length; j++) if (overlapArea(labels[i], labels[j]) > 0) addIssue(issues, nextActions, "text-overlap", `Labels "${labels[i].id}" and "${labels[j].id}" overlap.`, "Increase label spacing in the source.");
|
|
280
|
+
for (const box of boxes) {
|
|
281
|
+
if (box.x < 0 || box.y < 0 || box.x + box.width > image.width || box.y + box.height > image.height) {
|
|
282
|
+
addIssue(issues, nextActions, "box-out-of-bounds", `Box "${box.id}" is outside the canvas.`, "Move out-of-bounds nodes inside the canvas or expand the canvas.");
|
|
283
|
+
}
|
|
284
|
+
if (!labels.length && box.label && estimateLabelOverflow(box, strict)) {
|
|
285
|
+
addIssue(issues, nextActions, "label-overflow", `Box "${box.id}" label is likely to overflow.`, "Wrap or shorten labels, widen boxes, or increase export scale.");
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
for (let i = 0; i < boxes.length; i += 1) {
|
|
290
|
+
for (let j = i + 1; j < boxes.length; j += 1) {
|
|
291
|
+
const overlap = overlapArea(boxes[i], boxes[j]);
|
|
292
|
+
if (overlap > 0) {
|
|
293
|
+
addIssue(issues, nextActions, "box-overlap", `Boxes "${boxes[i].id}" and "${boxes[j].id}" overlap by ${Math.round(overlap)}px^2.`, "Increase node spacing or split dense groups.");
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const boxById = new Map(boxes.map((box) => [box.id, box]));
|
|
299
|
+
const segments = [];
|
|
300
|
+
for (const connector of manifest.connectors) {
|
|
301
|
+
const points = normalizePoints(connector.points);
|
|
302
|
+
if(points.some(point=>point.x<0||point.y<0||point.x>image.width||point.y>image.height)) addIssue(issues,nextActions,"connector-out-of-bounds",`Connector "${connector.id}" exceeds the canvas.`,"Correct explicit waypoints or expand the source canvas.");
|
|
303
|
+
if (points.length < 2 || points.every((point) => point.x === points[0].x && point.y === points[0].y)) addIssue(issues, nextActions, "degenerate-connector", `Connector "${connector.id ?? "unnamed"}" has no visible path.`, "Give self calls a loop and other connectors distinct endpoints.");
|
|
304
|
+
for (let index = 0; index < points.length - 1; index += 1) {
|
|
305
|
+
const segment = { connector, a: points[index], b: points[index + 1] };
|
|
306
|
+
segments.push(segment);
|
|
307
|
+
for (const label of labels) if (segmentHits([segment.a.x,segment.a.y],[segment.b.x,segment.b.y],label)) addIssue(issues,nextActions,"connector-through-text",`Connector "${connector.id}" crosses label "${label.id}".`,"Move the source label or route around its text.");
|
|
308
|
+
for (const box of boxes) {
|
|
309
|
+
if (box.id === connector.from || box.id === connector.to) continue;
|
|
310
|
+
if (segmentIntersectsBox(segment, box)) {
|
|
311
|
+
addIssue(issues, nextActions, "connector-through-label", `Connector "${connector.id ?? "unnamed"}" crosses box "${box.id}".`, "Add waypoints around labels or use orthogonal routing.");
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if ((connector.from && !boxById.has(connector.from)) || (connector.to && !boxById.has(connector.to))) {
|
|
316
|
+
addIssue(issues, nextActions, "connector-endpoint-missing", `Connector "${connector.id ?? "unnamed"}" references a missing endpoint.`, "Update connector endpoints to match manifest box ids.");
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
for (let i = 0; i < segments.length; i += 1) {
|
|
321
|
+
for (let j = i + 1; j < segments.length; j += 1) {
|
|
322
|
+
if (segments[i].connector === segments[j].connector) continue;
|
|
323
|
+
if (segmentsStack(segments[i], segments[j], strict ? 4 : 2)) {
|
|
324
|
+
addIssue(issues, nextActions, "connector-stacking", "Two connector segments are stacked or nearly stacked.", "Offset parallel connectors or bundle them into a labeled shared route.");
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function normalizeBox(box) {
|
|
331
|
+
if (!box || typeof box.id !== "string") return null;
|
|
332
|
+
const normalized = {
|
|
333
|
+
id: box.id,
|
|
334
|
+
kind: box.kind,
|
|
335
|
+
x: Number(box.x),
|
|
336
|
+
y: Number(box.y),
|
|
337
|
+
width: Number(box.width),
|
|
338
|
+
height: Number(box.height),
|
|
339
|
+
label: typeof box.label === "string" ? box.label : "",
|
|
340
|
+
};
|
|
341
|
+
if ([normalized.x, normalized.y, normalized.width, normalized.height].some((value) => !Number.isFinite(value))) return null;
|
|
342
|
+
return normalized;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function normalizePoints(points) {
|
|
346
|
+
if (!Array.isArray(points)) return [];
|
|
347
|
+
return points
|
|
348
|
+
.map((point) => {
|
|
349
|
+
if (Array.isArray(point)) return { x: Number(point[0]), y: Number(point[1]) };
|
|
350
|
+
return { x: Number(point?.x), y: Number(point?.y) };
|
|
351
|
+
})
|
|
352
|
+
.filter((point) => Number.isFinite(point.x) && Number.isFinite(point.y));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function estimateLabelOverflow(box, strict) {
|
|
356
|
+
const label = box.label.trim();
|
|
357
|
+
if (!label) return false;
|
|
358
|
+
const lines = label.split(/\r?\n/);
|
|
359
|
+
const maxLine = Math.max(...lines.map((line) => visualLength(line)));
|
|
360
|
+
const estimatedWidth = maxLine * (strict ? 7.5 : 7);
|
|
361
|
+
const estimatedHeight = lines.length * (strict ? 18 : 16);
|
|
362
|
+
return estimatedWidth > Math.max(0, box.width - 12) || estimatedHeight > Math.max(0, box.height - 8);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function visualLength(value) {
|
|
366
|
+
return [...value].reduce((total, char) => total + (/[\u4e00-\u9fff]/.test(char) ? 2 : 1), 0);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function overlapArea(left, right) {
|
|
370
|
+
const width = Math.max(0, Math.min(left.x + left.width, right.x + right.width) - Math.max(left.x, right.x));
|
|
371
|
+
const height = Math.max(0, Math.min(left.y + left.height, right.y + right.height) - Math.max(left.y, right.y));
|
|
372
|
+
return width * height;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function segmentIntersectsBox(segment, box) {
|
|
376
|
+
return segmentHits([segment.a.x,segment.a.y],[segment.b.x,segment.b.y],box);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function legacySegmentIntersectsBox(segment, box) {
|
|
380
|
+
if (pointInsideBox(segment.a, box) || pointInsideBox(segment.b, box)) return true;
|
|
381
|
+
const edges = [
|
|
382
|
+
[{ x: box.x, y: box.y }, { x: box.x + box.width, y: box.y }],
|
|
383
|
+
[{ x: box.x + box.width, y: box.y }, { x: box.x + box.width, y: box.y + box.height }],
|
|
384
|
+
[{ x: box.x + box.width, y: box.y + box.height }, { x: box.x, y: box.y + box.height }],
|
|
385
|
+
[{ x: box.x, y: box.y + box.height }, { x: box.x, y: box.y }],
|
|
386
|
+
];
|
|
387
|
+
return edges.some(([a, b]) => segmentsIntersect(segment.a, segment.b, a, b));
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function pointInsideBox(point, box) {
|
|
391
|
+
return point.x >= box.x && point.x <= box.x + box.width && point.y >= box.y && point.y <= box.y + box.height;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function segmentsIntersect(a, b, c, d) {
|
|
395
|
+
const o1 = orientation(a, b, c);
|
|
396
|
+
const o2 = orientation(a, b, d);
|
|
397
|
+
const o3 = orientation(c, d, a);
|
|
398
|
+
const o4 = orientation(c, d, b);
|
|
399
|
+
if (o1 !== o2 && o3 !== o4) return true;
|
|
400
|
+
return false;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function orientation(a, b, c) {
|
|
404
|
+
const value = (b.y - a.y) * (c.x - b.x) - (b.x - a.x) * (c.y - b.y);
|
|
405
|
+
if (Math.abs(value) < 0.0001) return 0;
|
|
406
|
+
return value > 0 ? 1 : 2;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function segmentsStack(left, right, tolerance) {
|
|
410
|
+
const leftHorizontal = Math.abs(left.a.y - left.b.y) <= tolerance;
|
|
411
|
+
const rightHorizontal = Math.abs(right.a.y - right.b.y) <= tolerance;
|
|
412
|
+
const leftVertical = Math.abs(left.a.x - left.b.x) <= tolerance;
|
|
413
|
+
const rightVertical = Math.abs(right.a.x - right.b.x) <= tolerance;
|
|
414
|
+
|
|
415
|
+
if (leftHorizontal && rightHorizontal && Math.abs(left.a.y - right.a.y) <= tolerance) {
|
|
416
|
+
return rangesOverlap([left.a.x, left.b.x], [right.a.x, right.b.x]) > tolerance;
|
|
417
|
+
}
|
|
418
|
+
if (leftVertical && rightVertical && Math.abs(left.a.x - right.a.x) <= tolerance) {
|
|
419
|
+
return rangesOverlap([left.a.y, left.b.y], [right.a.y, right.b.y]) > tolerance;
|
|
420
|
+
}
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function rangesOverlap(left, right) {
|
|
425
|
+
const a = [Math.min(...left), Math.max(...left)];
|
|
426
|
+
const b = [Math.min(...right), Math.max(...right)];
|
|
427
|
+
return Math.max(0, Math.min(a[1], b[1]) - Math.max(a[0], b[0]));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function addIssue(issues, nextActions, code, message, action) {
|
|
431
|
+
issues.push({ code, message, action });
|
|
432
|
+
if (typeof nextActions.add === "function") nextActions.add(action);
|
|
433
|
+
else if (!nextActions.includes(action)) nextActions.push(action);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function renderMarkdown(report) {
|
|
437
|
+
const lines = [
|
|
438
|
+
"# PNG QA Report",
|
|
439
|
+
"",
|
|
440
|
+
`- Status: ${report.ok ? "ok" : "issues-found"}`,
|
|
441
|
+
`- Image: ${report.image.width}x${report.image.height}`,
|
|
442
|
+
`- Ink coverage: ${report.image.inkCoverage}`,
|
|
443
|
+
];
|
|
444
|
+
if (report.image.inkBounds) {
|
|
445
|
+
lines.push(`- Ink bounds: ${JSON.stringify(report.image.inkBounds)}`);
|
|
446
|
+
}
|
|
447
|
+
lines.push("", "## Issues");
|
|
448
|
+
if (report.issues.length === 0) {
|
|
449
|
+
lines.push("- None");
|
|
450
|
+
} else {
|
|
451
|
+
for (const issue of report.issues) {
|
|
452
|
+
lines.push(`- ${issue.code}: ${issue.message}`);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
lines.push("", "## Next Actions");
|
|
456
|
+
if (report.nextActions.length === 0) {
|
|
457
|
+
lines.push("- None");
|
|
458
|
+
} else {
|
|
459
|
+
for (const action of report.nextActions) lines.push(`- ${action}`);
|
|
460
|
+
}
|
|
461
|
+
return `${lines.join("\n")}\n`;
|
|
462
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: cc-typescript-project-standard
|
|
3
|
+
description: 用于TypeScript 工程配置、模块解析、公共类型、声明文件、包导出、类型收窄或泛型契约需要设计审查,适用于应用、SDK、CLI、桌面进程与库。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# TypeScript 项目规范
|
|
7
7
|
|
|
8
|
+
本入口面向库、CLI、桌面核心及服务中的语言工程;应用角色由实际子工程证据决定,不由前端/后端产品名决定。
|
|
9
|
+
|
|
8
10
|
## 用途
|
|
9
11
|
|
|
10
12
|
统一 TypeScript 层的工程配置、类型边界和发布产物规则。适用于前端应用、组件库、SDK、CLI、monorepo package 和纯 TypeScript 工具库,但不接管 React、Vue、Next.js、Nuxt 或 Vite 的框架架构职责。
|
|
@@ -19,7 +21,7 @@ description: 用于创建、配置、审查或调试前端应用、库、SDK、C
|
|
|
19
21
|
- React、Vue、Next.js、Nuxt 等框架的组件架构、路由组织和状态管理归对应框架 skill;本流程只处理跨框架 TypeScript 契约和工程边界。
|
|
20
22
|
|
|
21
23
|
2. 收敛 `tsconfig`
|
|
22
|
-
-
|
|
24
|
+
- 新代码优先 `strict` 并保留已有检查,不为掩盖缺陷关闭 `noImplicitAny` 或 `strictNullChecks`。`exactOptionalPropertyTypes` 是独立选项;有依据时以局部、兼容迁移引入更严格配置。
|
|
23
25
|
- 按运行环境选择 `target`、`lib`、`module` 和 `moduleResolution`;浏览器应用、Node 脚本、库包不要共用一份含混配置。
|
|
24
26
|
- 将基础配置、应用配置、测试配置和构建声明配置拆开,避免测试全局类型污染生产代码。
|
|
25
27
|
- 路径别名必须同时被 TypeScript、bundler、test runner 和发布产物理解;库包不得发布无法解析的源码别名。
|
|
@@ -43,7 +45,7 @@ description: 用于创建、配置、审查或调试前端应用、库、SDK、C
|
|
|
43
45
|
|
|
44
46
|
## 约束
|
|
45
47
|
|
|
46
|
-
- 不用 `
|
|
48
|
+
- 不用 `any`、无守卫非空断言或宽泛 `as` 掩盖未经验证的边界。合理的 `skipLibCheck` 依赖政策与检查自身公共API有别,需记录其限制。
|
|
47
49
|
- 不在应用代码中依赖发布包私有深层路径。
|
|
48
50
|
- 不把框架目录结构、组件分层、路由组织或状态管理决策放进本流程;这些交给对应框架或专项流程。
|
|
49
51
|
- 不让生成类型、测试类型或 Node-only 类型污染浏览器运行代码。
|
|
@@ -52,3 +54,7 @@ description: 用于创建、配置、审查或调试前端应用、库、SDK、C
|
|
|
52
54
|
## 预期输出
|
|
53
55
|
|
|
54
56
|
输出应包含 TypeScript 上下文判断、关键 `tsconfig`/package 类型入口建议、类型边界方案、声明文件或 public API 风险、验证命令。完成后项目应能独立 typecheck,公开类型可被消费方解析,类型安全问题有明确收窄或建模方案。
|
|
57
|
+
|
|
58
|
+
## 工程实践
|
|
59
|
+
|
|
60
|
+
按当前任务读取[本入口工程细则](references/engineering-practices.md),再按链接选择公共原则。规则级别与例外以实际项目契约为准;不因产品前后端标签限制语言或职责。
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 外部输入边界 — EP-TS-01
|
|
2
|
+
|
|
3
|
+
将此目录复制到可写临时位置。样例自有Node >=22.18目标(原生类型擦除),不升级父项目。显式准备:pnpm install --ignore-scripts --frozen-lockfile,然后pnpm typecheck。PowerShell设$env:CRAFT_ENGINEERING_DEFECTIVE为1,运行pnpm test,非法输入命名断言应失败;设为0或移除变量后同组两个测试通过。POSIX可在测试命令前设置同名环境变量。
|
|
4
|
+
|
|
5
|
+
回调记录校验前后的真实副作用,缺陷分支故意以断言替代校验;默认受保护。这里不验证付款服务、浏览器、异步状态及声明发布。仅依赖本目录源码和已声明工具,node_modules/build/log应留在可写副本。
|
|
6
|
+
|
|
7
|
+
[Node.js 类型擦除历史与限制](https://nodejs.org/api/typescript.html):运行时类型擦除与显式 TypeScript 类型检查分开。
|
package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { acceptAmount } from "./input.ts";
|
|
4
|
+
|
|
5
|
+
test("EP-TS-01 rejects invalid input before any effect", () => {
|
|
6
|
+
const effects: number[] = [];
|
|
7
|
+
for (const input of [{ amount: "10" }, { amount: -1 }, { amount: Number.MAX_SAFE_INTEGER + 1 }, null]) {
|
|
8
|
+
assert.throws(() => acceptAmount(input, amount => effects.push(amount)), /invalid amount/);
|
|
9
|
+
assert.deepEqual(effects, []);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
test("EP-TS-01 accepts a valid input exactly once", () => {
|
|
13
|
+
const effects: number[] = [];
|
|
14
|
+
acceptAmount({ amount: 10 }, amount => effects.push(amount));
|
|
15
|
+
assert.deepEqual(effects, [10]);
|
|
16
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Test switch only; normal use always validates the external boundary. */
|
|
2
|
+
export function acceptAmount(value: unknown, effect: (amount: number) => void): void {
|
|
3
|
+
if (process.env.CRAFT_ENGINEERING_DEFECTIVE === "1") {
|
|
4
|
+
effect((value as { amount: number }).amount);
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
if (typeof value !== "object" || value === null || !("amount" in value)
|
|
8
|
+
|| typeof value.amount !== "number" || !Number.isSafeInteger(value.amount) || value.amount <= 0) {
|
|
9
|
+
throw new TypeError("invalid amount");
|
|
10
|
+
}
|
|
11
|
+
effect(value.amount);
|
|
12
|
+
}
|
package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "engineering-typescript-boundary-example",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": { "node": ">=22.18.0" },
|
|
7
|
+
"scripts": {
|
|
8
|
+
"typecheck": "tsc --noEmit",
|
|
9
|
+
"test": "node --experimental-strip-types --test --test-reporter=tap boundary.test.ts"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": { "typescript": "5.9.3", "@types/node": "22.20.5" }
|
|
12
|
+
}
|
package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
lockfileVersion: '9.0'
|
|
2
|
+
|
|
3
|
+
settings:
|
|
4
|
+
autoInstallPeers: true
|
|
5
|
+
excludeLinksFromLockfile: false
|
|
6
|
+
|
|
7
|
+
importers:
|
|
8
|
+
|
|
9
|
+
.:
|
|
10
|
+
devDependencies:
|
|
11
|
+
'@types/node':
|
|
12
|
+
specifier: 22.20.5
|
|
13
|
+
version: 22.20.5
|
|
14
|
+
typescript:
|
|
15
|
+
specifier: 5.9.3
|
|
16
|
+
version: 5.9.3
|
|
17
|
+
|
|
18
|
+
packages:
|
|
19
|
+
|
|
20
|
+
'@types/node@22.20.5':
|
|
21
|
+
resolution: {integrity: sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==}
|
|
22
|
+
|
|
23
|
+
typescript@5.9.3:
|
|
24
|
+
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
|
|
25
|
+
engines: {node: '>=14.17'}
|
|
26
|
+
hasBin: true
|
|
27
|
+
|
|
28
|
+
undici-types@6.21.0:
|
|
29
|
+
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
|
30
|
+
|
|
31
|
+
snapshots:
|
|
32
|
+
|
|
33
|
+
'@types/node@22.20.5':
|
|
34
|
+
dependencies:
|
|
35
|
+
undici-types: 6.21.0
|
|
36
|
+
|
|
37
|
+
typescript@5.9.3: {}
|
|
38
|
+
|
|
39
|
+
undici-types@6.21.0: {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
packages: []
|