@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
package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/README.md
RENAMED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
The JSON fixtures cover sequence self calls, workflow decisions and loops, and architecture groups with reverse/data/async edges. The Mermaid sources are equivalent text-first examples for standard sequence/workflow rendering. Preserve their labels and relationships when changing layout.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
node skills/
|
|
7
|
-
node skills/
|
|
8
|
-
node skills/
|
|
9
|
-
node skills/
|
|
6
|
+
node skills/cc-technical-diagrams/scripts/tech-diagram-render.mjs --input skills/cc-technical-diagrams/assets/quality-examples/workflow.json --type workflow --output workflow.html --manifest workflow.layout.json
|
|
7
|
+
node skills/cc-technical-diagrams/scripts/export-diagram.mjs --input workflow.html --format png --output workflow.png --theme light --scale 2 --manifest workflow.layout.json --output-manifest workflow.actual.json
|
|
8
|
+
node skills/cc-technical-diagrams/scripts/png-qa.mjs --png workflow.png --manifest workflow.actual.json --format json
|
|
9
|
+
node skills/cc-technical-diagrams/scripts/mermaid-render.mjs --input skills/cc-technical-diagrams/assets/quality-examples/sequence.mmd --output sequence.svg --report sequence.render.json
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Use a local Chromium browser for PNG; set FEC_BROWSER_PATH to its executable when detection fails. Mermaid needs an already installed mmdc; no automatic install or CDN is used. Missing Mermaid must be recorded as unavailable and the HTML route selected. Architecture editing uses the existing
|
|
12
|
+
Use a local Chromium browser for PNG; set FEC_BROWSER_PATH to its executable when detection fails. Mermaid needs an already installed mmdc; no automatic install or CDN is used. Missing Mermaid must be recorded as unavailable and the HTML route selected. Architecture editing uses the existing cc-drawio-studio skill when available, otherwise the JSON/HTML fixture. Graphviz is optional for dense topology and is not installed automatically.
|
|
13
13
|
|
|
14
14
|
Inspect final PNGs at intended reading size. Check node text against shape interiors, edge labels against arrowheads, branch/return directions, loop visibility, group boundaries and light/dark contrast. Run at 1x and 2x and inspect both. Geometry QA is evidence, not a substitute for visual review. Small explicit node sizes, overlapping explicit coordinates or obstructed explicit waypoints are reported; change the source with user intent preserved. Limit automatic source repairs to two rounds (five only when requested), and report partial acceptance if unresolved.
|
package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.mmd
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
sequenceDiagram
|
|
2
|
-
participant Web as Browser client
|
|
3
|
-
participant API as Order service API
|
|
4
|
-
participant DB as Persistent database
|
|
5
|
-
Web->>API: Query order details and current payment status
|
|
6
|
-
API->>API: Validate identity and order access
|
|
7
|
-
API->>DB: Cache miss: read order records
|
|
8
|
-
DB-->>API: Return order records and payment status
|
|
9
|
-
API-->>Web: Return results and update the page
|
|
10
|
-
|
|
11
|
-
activate API
|
|
12
|
-
alt Cache hit
|
|
13
|
-
API-->>Web: Return cached result
|
|
14
|
-
else Cache miss
|
|
15
|
-
loop Retry failed query
|
|
16
|
-
API->>DB: Read records
|
|
17
|
-
DB-->>API: Return result
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
API-)Web: Async update notification
|
|
21
|
-
deactivate API
|
|
1
|
+
sequenceDiagram
|
|
2
|
+
participant Web as Browser client
|
|
3
|
+
participant API as Order service API
|
|
4
|
+
participant DB as Persistent database
|
|
5
|
+
Web->>API: Query order details and current payment status
|
|
6
|
+
API->>API: Validate identity and order access
|
|
7
|
+
API->>DB: Cache miss: read order records
|
|
8
|
+
DB-->>API: Return order records and payment status
|
|
9
|
+
API-->>Web: Return results and update the page
|
|
10
|
+
|
|
11
|
+
activate API
|
|
12
|
+
alt Cache hit
|
|
13
|
+
API-->>Web: Return cached result
|
|
14
|
+
else Cache miss
|
|
15
|
+
loop Retry failed query
|
|
16
|
+
API->>DB: Read records
|
|
17
|
+
DB-->>API: Return result
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
API-)Web: Async update notification
|
|
21
|
+
deactivate API
|
package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.mmd
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
flowchart TD
|
|
2
|
-
A([Submit order request]) --> B{Check order completeness and approval eligibility}
|
|
3
|
-
B -->|Complete information| C[Review manually and record the decision]
|
|
4
|
-
B -->|More evidence needed| D[Add missing evidence and resubmit]
|
|
5
|
-
D -->|Review again| B
|
|
6
|
-
C -->|Approved| E[(Save approval and notify the applicant asynchronously)]
|
|
7
|
-
E -->|Notification sent| F([Completed])
|
|
1
|
+
flowchart TD
|
|
2
|
+
A([Submit order request]) --> B{Check order completeness and approval eligibility}
|
|
3
|
+
B -->|Complete information| C[Review manually and record the decision]
|
|
4
|
+
B -->|More evidence needed| D[Add missing evidence and resubmit]
|
|
5
|
+
D -->|Review again| B
|
|
6
|
+
C -->|Approved| E[(Save approval and notify the applicant asynchronously)]
|
|
7
|
+
E -->|Notification sent| F([Completed])
|
package/skills/{fec-image-generation → cc-technical-diagrams}/references/diagram-workflows.md
RENAMED
|
@@ -20,7 +20,7 @@ Use the live route when the diagram is part of the conversation and the user ben
|
|
|
20
20
|
Run the local server with:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
node skills/
|
|
23
|
+
node skills/cc-technical-diagrams/scripts/interactive-diagram-server.mjs --port 6100
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Open `http://127.0.0.1:6100/?s=meaningful-session-id`, then send commands to `/cmd?s=meaningful-session-id`. Always use a unique session id for each diagram. Start with `init`, add nodes before edges, and keep each command small enough that the browser can update incrementally.
|
|
@@ -67,7 +67,7 @@ For UML coverage, route class, ER, state-machine, activity, and sequence needs t
|
|
|
67
67
|
|
|
68
68
|
## Process workflows
|
|
69
69
|
|
|
70
|
-
Use HTML `workflow` IR when the user wants a browser-ready process map, approval flow, automation runbook, incident workflow, or cyclical operating loop with lanes, numbered steps, actors, decisions, exception paths, and summary cards. Use `
|
|
70
|
+
Use HTML `workflow` IR when the user wants a browser-ready process map, approval flow, automation runbook, incident workflow, or cyclical operating loop with lanes, numbered steps, actors, decisions, exception paths, and summary cards. Use `cc-drawio-studio` instead when the workflow must remain a `.drawio` file for diagrams.net editing, official shape libraries, manual swimlane maintenance, or stakeholder edits after handoff.
|
|
71
71
|
|
|
72
72
|
## Export guidance
|
|
73
73
|
|
|
@@ -76,6 +76,6 @@ Prefer exporting at 2x scale for raster PNGs, then downsample only if text remai
|
|
|
76
76
|
|
|
77
77
|
## Quality delivery contract
|
|
78
78
|
|
|
79
|
-
Prefer local Mermaid for standard sequence/workflow diagrams, reuse
|
|
79
|
+
Prefer local Mermaid for standard sequence/workflow diagrams, reuse cc-drawio-studio for manually editable architecture, and optionally use Graphviz for dense topology. Fall back to compatible JSON/HTML if local tools are missing, without automatic installation/downloads. Preview, standalone SVG and PNG share source theme styles; export with `--theme light|dark`. PNG export waits for fonts and measures text; use `--manifest source.layout.json --output-manifest image.actual.json` for scaled pixel coordinates. QA must read the actual manifest, not reuse estimated coordinates unchanged for a 2x PNG.
|
|
80
80
|
|
|
81
81
|
The extended manifest retains canvas/boxes/connectors and adds coordinateSpace, scale, measurement, groups, labels and issues. Group containment is not node overlap. New checks include node-text-overflow, label-content-loss, label-out-of-bounds, edge-label-collision, text-overlap and degenerate-connector. Legacy manifests retain estimated checks. Diagnose constrained explicit sizes/waypoints without dropping text, changing relationships or silently moving coordinates. Increasing export resolution cannot fix source overflow. Visually review the final PNG and record tool availability/version, theme, scale, repair rounds and remaining defects; report partial acceptance when unresolved.
|
package/skills/{fec-image-generation → cc-technical-diagrams}/references/html-technical-diagrams.md
RENAMED
|
@@ -7,7 +7,7 @@ This route complements, but does not replace, other diagram sources:
|
|
|
7
7
|
| Need | Prefer |
|
|
8
8
|
| ---- | ------ |
|
|
9
9
|
| Small markdown-maintained diagram | Mermaid, Graphviz, or SVG |
|
|
10
|
-
| Editable source for future manual changes | `
|
|
10
|
+
| Editable source for future manual changes | `cc-drawio-studio` and `.drawio` |
|
|
11
11
|
| Browser-ready themed technical diagram | HTML technical diagram route |
|
|
12
12
|
| Raster-first visual, poster, concept art, or image edit | Image generation or editing route |
|
|
13
13
|
|
|
@@ -19,7 +19,7 @@ This route complements, but does not replace, other diagram sources:
|
|
|
19
19
|
- `dataflow`: sources, ingest, processing, storage, consumers, PII boundaries, governance, analytics, and lineage.
|
|
20
20
|
- `lifecycle`: object states, terminal states, retries, waits, cancellation, timeout, deployment or order status transitions.
|
|
21
21
|
|
|
22
|
-
Use the `architecture` mode for browser-ready overview diagrams with explicit coordinates. Use `
|
|
22
|
+
Use the `architecture` mode for browser-ready overview diagrams with explicit coordinates. Use `cc-drawio-studio` instead when the priority is `.drawio` source, official vendor icons, diagrams.net manual editing, or complex auto-layout.
|
|
23
23
|
|
|
24
24
|
## Themed Semantic Diagrams
|
|
25
25
|
|
|
@@ -65,8 +65,8 @@ Keep the first blueprint readable:
|
|
|
65
65
|
For README or stakeholder handoff, keep the JSON IR and HTML as the editable source, then export SVG/PNG/JPG artifacts:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
node skills/
|
|
69
|
-
node skills/
|
|
68
|
+
node skills/cc-technical-diagrams/scripts/export-diagram.mjs --input docs/architecture/system-blueprint.html --format svg
|
|
69
|
+
node skills/cc-technical-diagrams/scripts/export-diagram.mjs --input docs/architecture/system-blueprint.html --format png --scale 2
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Raster export uses an existing Chromium-family browser when available. If the environment cannot rasterize SVG, deliver the generated HTML/SVG and state that PNG/JPG export needs a local browser.
|
|
@@ -198,7 +198,7 @@ Architecture output includes an automatic legend unless `legend` is set to `fals
|
|
|
198
198
|
## Render Command
|
|
199
199
|
|
|
200
200
|
```bash
|
|
201
|
-
node skills/
|
|
201
|
+
node skills/cc-technical-diagrams/scripts/tech-diagram-render.mjs \
|
|
202
202
|
--input diagram.json \
|
|
203
203
|
--output diagram.html \
|
|
204
204
|
--type architecture \
|
|
@@ -217,7 +217,7 @@ The generated HTML is self-contained and includes:
|
|
|
217
217
|
After exporting a PNG from the browser, run:
|
|
218
218
|
|
|
219
219
|
```bash
|
|
220
|
-
node skills/
|
|
220
|
+
node skills/cc-technical-diagrams/scripts/png-qa.mjs \
|
|
221
221
|
--png diagram.png \
|
|
222
222
|
--manifest diagram.layout.json \
|
|
223
223
|
--format markdown
|
|
@@ -238,6 +238,6 @@ Deliver the `.html` source together with any exported SVG/PNG/JPG requested by t
|
|
|
238
238
|
|
|
239
239
|
## Quality delivery contract
|
|
240
240
|
|
|
241
|
-
Prefer local Mermaid for standard sequence/workflow diagrams, reuse
|
|
241
|
+
Prefer local Mermaid for standard sequence/workflow diagrams, reuse cc-drawio-studio for manually editable architecture, and optionally use Graphviz for dense topology. Fall back to compatible JSON/HTML if local tools are missing, without automatic installation/downloads. Preview, standalone SVG and PNG share source theme styles; export with `--theme light|dark`. PNG export waits for fonts and measures text; use `--manifest source.layout.json --output-manifest image.actual.json` for scaled pixel coordinates. QA must read the actual manifest, not reuse estimated coordinates unchanged for a 2x PNG.
|
|
242
242
|
|
|
243
243
|
The extended manifest retains canvas/boxes/connectors and adds coordinateSpace, scale, measurement, groups, labels and issues. Group containment is not node overlap. New checks include node-text-overflow, label-content-loss, label-out-of-bounds, edge-label-collision, text-overlap and degenerate-connector. Legacy manifests retain estimated checks. Diagnose constrained explicit sizes/waypoints without dropping text, changing relationships or silently moving coordinates. Increasing export resolution cannot fix source overflow. Visually review the final PNG and record tool availability/version, theme, scale, repair rounds and remaining defects; report partial acceptance when unresolved.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# PNG QA And Autofix
|
|
2
|
+
|
|
3
|
+
## Loop
|
|
4
|
+
|
|
5
|
+
1. Export PNG from the editable source or image workflow.
|
|
6
|
+
2. Inspect the PNG visually.
|
|
7
|
+
3. Run `png-qa.mjs` with a manifest when available.
|
|
8
|
+
4. Convert each issue into source, prompt, or layout changes.
|
|
9
|
+
5. Repeat for 2 rounds by default, up to 5 when the user asks for more repair attempts.
|
|
10
|
+
|
|
11
|
+
## Issue mapping
|
|
12
|
+
|
|
13
|
+
| Issue | Repair |
|
|
14
|
+
| ----- | ------ |
|
|
15
|
+
| `blank-image` | Check export target, renderer errors, hidden layers, transparent fill, or failed image generation. |
|
|
16
|
+
| `edge-clipping` | Add canvas padding, expand SVG viewBox, reduce subject scale, or export a larger frame. |
|
|
17
|
+
| `box-overlap` | Increase spacing, reflow to grid/layers, split clusters, or wrap complete labels. |
|
|
18
|
+
| `box-out-of-bounds` | Move the node inside canvas or increase canvas dimensions. |
|
|
19
|
+
| `label-overflow` | Wrap text, widen the box, preserve complete copy, and increase font/container size together. |
|
|
20
|
+
| `connector-through-label` | Add waypoints around boxes, move labels, or use orthogonal routing. |
|
|
21
|
+
| `connector-stacking` | Offset parallel connectors or replace repeated lines with a labeled grouped path. |
|
|
22
|
+
| `manifest-canvas-mismatch` | Regenerate the manifest from final export dimensions. |
|
|
23
|
+
|
|
24
|
+
## Manifest quality
|
|
25
|
+
|
|
26
|
+
The helper can only reason about overlaps and connectors when the manifest coordinates match the exported PNG. If the manifest is stale, repair the manifest first, then rerun QA.
|
|
27
|
+
|
|
28
|
+
## Reporting
|
|
29
|
+
|
|
30
|
+
Report the number of QA rounds and the final issue list. If issues remain because the source renderer cannot expose layout coordinates, say which checks were image-only and which require manual visual review.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Quality delivery contract
|
|
34
|
+
|
|
35
|
+
Prefer local Mermaid for standard sequence/workflow diagrams, reuse cc-drawio-studio for manually editable architecture, and optionally use Graphviz for dense topology. Fall back to compatible JSON/HTML if local tools are missing, without automatic installation/downloads. Preview, standalone SVG and PNG share source theme styles; export with `--theme light|dark`. PNG export waits for fonts and measures text; use `--manifest source.layout.json --output-manifest image.actual.json` for scaled pixel coordinates. QA must read the actual manifest, not reuse estimated coordinates unchanged for a 2x PNG.
|
|
36
|
+
|
|
37
|
+
The extended manifest retains canvas/boxes/connectors and adds coordinateSpace, scale, measurement, groups, labels and issues. Group containment is not node overlap. New checks include node-text-overflow, label-content-loss, label-out-of-bounds, edge-label-collision, text-overlap and degenerate-connector. Legacy manifests retain estimated checks. Diagnose constrained explicit sizes/waypoints without dropping text, changing relationships or silently moving coordinates. Increasing export resolution cannot fix source overflow. Visually review the final PNG and record tool availability/version, theme, scale, repair rounds and remaining defects; report partial acceptance when unresolved.
|
|
@@ -22,6 +22,61 @@ export function findBrowser() {
|
|
|
22
22
|
|
|
23
23
|
/** @typedef {{evaluate:(expression:string)=>Promise<unknown>,screenshot:(width:number,height:number,scale?:number)=>Promise<Buffer>}} DiagramSession */
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Export failures must stay within the wording callers match on, so CDP details are wrapped here.
|
|
27
|
+
* @param {string} detail @returns {Error}
|
|
28
|
+
*/
|
|
29
|
+
const exportFailure = (detail) => new Error(`Browser raster export failed: ${detail}`);
|
|
30
|
+
|
|
31
|
+
/** @param {()=>string} read @param {number} deadline @returns {Promise<number>} */
|
|
32
|
+
export async function waitForDebuggingPort(read, deadline) {
|
|
33
|
+
while (Date.now() < deadline) {
|
|
34
|
+
try {
|
|
35
|
+
const value = read().split("\n")[0].trim();
|
|
36
|
+
const port = Number(value);
|
|
37
|
+
if (/^\d+$/.test(value) && Number.isInteger(port) && port > 0 && port <= 65535) return port;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
const code = error && typeof error === "object" && "code" in error ? String(error.code) : "";
|
|
40
|
+
if (!["EBUSY", "ENOENT", "EPERM"].includes(code)) throw exportFailure(error instanceof Error ? error.message : String(error));
|
|
41
|
+
}
|
|
42
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(50, Math.max(0, deadline - Date.now()))));
|
|
43
|
+
}
|
|
44
|
+
throw exportFailure("browser debugging port did not become readable before the initialization deadline.");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The target URL can be advertised before its execution context has finished navigating.
|
|
49
|
+
* Retry only that initialization window; action failures must propagate without replaying exports.
|
|
50
|
+
* @param {DiagramSession['evaluate']} evaluate @param {string} url @param {number} deadline
|
|
51
|
+
*/
|
|
52
|
+
export async function waitForDiagramReady(evaluate, url, deadline) {
|
|
53
|
+
while (Date.now() < deadline) {
|
|
54
|
+
try {
|
|
55
|
+
const ready = await evaluate(`(async()=>{if(location.href!==${JSON.stringify(url)})return false;if(document.readyState!=="complete")await new Promise(r=>window.addEventListener("load",r,{once:true}));await document.fonts.ready;await new Promise(r=>requestAnimationFrame(()=>requestAnimationFrame(r)));return true;})()`);
|
|
56
|
+
if (ready === true) return;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (!(error instanceof Error) || !/^Browser raster export failed: (?:Execution context was destroyed|Cannot find default execution context)\.?$/.test(error.message)) throw error;
|
|
59
|
+
}
|
|
60
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(50, Math.max(0, deadline - Date.now()))));
|
|
61
|
+
}
|
|
62
|
+
throw exportFailure("diagram page did not become ready before the initialization deadline.");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Chromium keeps profile files locked until its whole process tree is gone, so cleanup waits for
|
|
67
|
+
* the process instead of sleeping a fixed amount. @param {ReturnType<typeof spawn>} child @param {number} ms @returns {Promise<void>}
|
|
68
|
+
*/
|
|
69
|
+
const waitForExit = async (child, ms) => {
|
|
70
|
+
if (child.exitCode !== null) return;
|
|
71
|
+
/** @type {ReturnType<typeof setTimeout> | undefined} */
|
|
72
|
+
let timer;
|
|
73
|
+
await new Promise((resolve) => {
|
|
74
|
+
const finish = () => { if (timer) clearTimeout(timer); child.off("exit", finish); resolve(undefined); };
|
|
75
|
+
timer = setTimeout(finish, ms);
|
|
76
|
+
child.once("exit", finish);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
25
80
|
/** @template T @param {string} html @param {{theme:'light'|'dark',timeoutMs:number}} options @param {(session:DiagramSession)=>Promise<T>} action @returns {Promise<T>} */
|
|
26
81
|
export async function withDiagramPage(html, options, action) {
|
|
27
82
|
const browser = findBrowser();
|
|
@@ -38,26 +93,33 @@ export async function withDiagramPage(html, options, action) {
|
|
|
38
93
|
let timer;
|
|
39
94
|
try {
|
|
40
95
|
const work = async () => {
|
|
41
|
-
const deadline = Date.now() + Math.min(
|
|
96
|
+
const deadline = Date.now() + Math.min(15000, options.timeoutMs);
|
|
42
97
|
const portFile = path.join(profile, "DevToolsActivePort");
|
|
43
98
|
while (!fs.existsSync(portFile) && Date.now() < deadline && (child.exitCode === null || child.exitCode === 0) && !childError) await new Promise((resolve) => setTimeout(resolve, 50));
|
|
44
|
-
if (!fs.existsSync(portFile)) throw
|
|
45
|
-
const port =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
99
|
+
if (!fs.existsSync(portFile)) throw exportFailure(`browser did not start a debugging session${childError ? ` (${childError})` : ""}.`);
|
|
100
|
+
const port = await waitForDebuggingPort(() => fs.readFileSync(portFile, "utf8"), deadline);
|
|
101
|
+
// Select the intended target first; the readiness handshake below also waits for its context.
|
|
102
|
+
/** @type {{webSocketDebuggerUrl?:string}|undefined} */
|
|
103
|
+
let target;
|
|
104
|
+
while (Date.now() < deadline) {
|
|
105
|
+
const pages = await (await fetch(`http://127.0.0.1:${port}/json/list`, { signal: AbortSignal.timeout(Math.min(5000, options.timeoutMs)) })).json();
|
|
106
|
+
target = pages.find(/** @param {{type:string,url:string}} p */ (p) => p.type === "page" && p.url === pathToFileURL(page).href);
|
|
107
|
+
if (target) break;
|
|
108
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
109
|
+
}
|
|
110
|
+
if (!target?.webSocketDebuggerUrl) throw exportFailure("browser did not create a diagram page.");
|
|
49
111
|
socket = new WebSocket(target.webSocketDebuggerUrl);
|
|
50
112
|
await new Promise((resolve, reject) => { socket?.addEventListener("open", resolve, { once: true }); socket?.addEventListener("error", reject, { once: true }); });
|
|
51
113
|
/** @type {Map<number,{resolve:(value:Record<string,unknown>)=>void,reject:(reason:Error)=>void}>} */
|
|
52
114
|
const pending = new Map();
|
|
53
|
-
socket.addEventListener("close", () => { for (const entry of pending.values()) entry.reject(
|
|
115
|
+
socket.addEventListener("close", () => { for (const entry of pending.values()) entry.reject(exportFailure("session closed before export completed.")); pending.clear(); });
|
|
54
116
|
let serial = 0;
|
|
55
117
|
socket.addEventListener("message", (event) => {
|
|
56
118
|
const message = JSON.parse(String(event.data));
|
|
57
119
|
const entry = pending.get(message.id);
|
|
58
120
|
if (!entry) return;
|
|
59
121
|
pending.delete(message.id);
|
|
60
|
-
if (message.error) entry.reject(
|
|
122
|
+
if (message.error) entry.reject(exportFailure(message.error.message)); else entry.resolve(message.result ?? {});
|
|
61
123
|
});
|
|
62
124
|
/** @param {string} method @param {Record<string,unknown>} [params] @returns {Promise<Record<string,unknown>>} */
|
|
63
125
|
const call = (method, params = {}) => new Promise((resolve, reject) => { const id = ++serial; pending.set(id, { resolve, reject }); socket?.send(JSON.stringify({ id, method, params })); });
|
|
@@ -73,18 +135,19 @@ export async function withDiagramPage(html, options, action) {
|
|
|
73
135
|
const result = await call("Page.captureScreenshot", { format: "png", captureBeyondViewport: true, clip: { x: 0, y: 0, width, height, scale: 1 } });
|
|
74
136
|
return Buffer.from(String(result.data), "base64");
|
|
75
137
|
} };
|
|
76
|
-
await evaluate(
|
|
138
|
+
await waitForDiagramReady(evaluate, pathToFileURL(page).href, deadline);
|
|
77
139
|
return await action(session);
|
|
78
140
|
};
|
|
79
|
-
return await Promise.race([work(), new Promise(/** @param {(reason:Error)=>void} reject */ (_, reject) => { timer = setTimeout(() => reject(
|
|
141
|
+
return await Promise.race([work(), new Promise(/** @param {(reason:Error)=>void} reject */ (_, reject) => { timer = setTimeout(() => reject(exportFailure("export timed out.")), options.timeoutMs); })]);
|
|
80
142
|
} finally {
|
|
81
143
|
if (timer) clearTimeout(timer);
|
|
82
144
|
if (socket?.readyState === WebSocket.OPEN) socket.send(JSON.stringify({ id: 999999, method: "Browser.close" }));
|
|
83
|
-
|
|
145
|
+
// Browser.close is graceful, so wait for the process rather than guessing with a fixed sleep:
|
|
146
|
+
// Chromium's child processes keep profile files locked until the tree is gone.
|
|
147
|
+
await waitForExit(child, 2000);
|
|
84
148
|
socket?.close();
|
|
85
|
-
child.kill();
|
|
149
|
+
if (child.exitCode === null) child.kill();
|
|
86
150
|
// The Chromium profile is owned by this invocation only. Windows may release locks after exit.
|
|
87
|
-
|
|
88
|
-
try { fs.rmSync(dir, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }); } catch { /* A locked temporary profile can be removed by OS cleanup. */ }
|
|
151
|
+
try { fs.rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 200 }); } catch { /* A locked temporary profile can be removed by OS cleanup. */ }
|
|
89
152
|
}
|
|
90
153
|
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/** @typedef {{x:number,y:number,width:number,height:number}} Rect */
|
|
4
|
+
/** @typedef {[number,number]} Point */
|
|
5
|
+
/** @typedef {{code:string,id:string,message:string}} QualityIssue */
|
|
6
|
+
/** @typedef {{lines:string[],width:number,height:number,fontSize:number,lineHeight:number}} TextLayout */
|
|
7
|
+
/** @typedef {Rect & {id:string,label:string,sublabel:string,type:string,actor?:string,step?:string,shape?:"box"|"diamond"|"terminal"}} Box */
|
|
8
|
+
|
|
9
|
+
/** @param {string} text @param {number} fontSize */
|
|
10
|
+
function textWidth(text, fontSize) {
|
|
11
|
+
return [...new Intl.Segmenter(undefined, { granularity: "grapheme" }).segment(text)]
|
|
12
|
+
.reduce((sum, item) => sum + (/^[\x00-\x7f]+$/.test(item.segment) ? fontSize * 0.6 : fontSize), 0);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** @param {string} text @param {number} maxWidth @param {number} [fontSize] @param {number} [lineHeight] @returns {TextLayout} */
|
|
16
|
+
export function layoutText(text, maxWidth, fontSize = 14, lineHeight = 20) {
|
|
17
|
+
const limit = Math.max(fontSize, maxWidth);
|
|
18
|
+
/** @type {string[]} */
|
|
19
|
+
const lines = [];
|
|
20
|
+
for (const paragraph of text.split(/\r?\n/)) {
|
|
21
|
+
let line = "";
|
|
22
|
+
for (const { segment: word } of new Intl.Segmenter(undefined, { granularity: "word" }).segment(paragraph)) {
|
|
23
|
+
if (line && textWidth(word,fontSize) <= limit && textWidth(line+word,fontSize)>limit) {lines.push(line);line="";}
|
|
24
|
+
for (const { segment } of new Intl.Segmenter(undefined, { granularity: "grapheme" }).segment(word)) {
|
|
25
|
+
if (line && textWidth(line + segment, fontSize) > limit) {
|
|
26
|
+
lines.push(line);
|
|
27
|
+
line = "";
|
|
28
|
+
}
|
|
29
|
+
line += segment;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
lines.push(line);
|
|
33
|
+
}
|
|
34
|
+
return { lines, width: Math.max(0, ...lines.map((line) => textWidth(line, fontSize))), height: lines.length * lineHeight, fontSize, lineHeight };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** @param {Box} source @param {{width:boolean,height:boolean}} explicit */
|
|
38
|
+
export function fitNodeText(source, explicit) {
|
|
39
|
+
const box = { ...source };
|
|
40
|
+
if (![box.width, box.height].every((v) => Number.isFinite(v) && v > 0)) throw new Error(`Invalid size for node "${box.id}".`);
|
|
41
|
+
const diamond = box.shape === "diamond" || box.type === "decision";
|
|
42
|
+
const semantic = ["agent", "model", "memory", "vectorstore", "graphdb", "tool", "document", "queue", "browser", "user", "gateway"].includes(box.type);
|
|
43
|
+
if (!explicit.width) box.width = Math.max(box.width, diamond ? 240 : 200);
|
|
44
|
+
const available = diamond ? box.width * 0.5 - 12 : (box.type === "queue" ? box.width - 64 : box.width - 32);
|
|
45
|
+
const main = layoutText(box.label, available);
|
|
46
|
+
const sub = layoutText(box.sublabel, available, 12, 16);
|
|
47
|
+
const header = ["database", "vectorstore"].includes(box.type) ? 30 : box.type === "queue" ? 20 : semantic ? 46 : box.actor ? 40 : 20;
|
|
48
|
+
const contentHeight = main.height + (box.sublabel ? sub.height + 6 : 0);
|
|
49
|
+
const needed = diamond ? (contentHeight + 24) * 2 : header + contentHeight + (["database", "vectorstore"].includes(box.type) ? 30 : 18);
|
|
50
|
+
if (!explicit.height) box.height = Math.max(box.height, needed, 72);
|
|
51
|
+
/** @type {QualityIssue[]} */
|
|
52
|
+
const issues = [];
|
|
53
|
+
if (box.height < needed || available < main.width) issues.push({ code: "node-text-overflow", id: box.id, message: `Node "${box.id}" has an explicit size too small for its complete text.` });
|
|
54
|
+
return { box, labels: [main, sub], issues };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @param {Rect} box @param {'top'|'right'|'bottom'|'left'} side @returns {Point} */
|
|
58
|
+
export function boundaryPort(box, side) {
|
|
59
|
+
if (side === "top") return [box.x + box.width / 2, box.y];
|
|
60
|
+
if (side === "bottom") return [box.x + box.width / 2, box.y + box.height];
|
|
61
|
+
if (side === "left") return [box.x, box.y + box.height / 2];
|
|
62
|
+
return [box.x + box.width, box.y + box.height / 2];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Strict interior intersection; boundary contact is allowed. @param {Point} a @param {Point} b @param {Rect} r */
|
|
66
|
+
export function segmentHits(a, b, r) {
|
|
67
|
+
let lo = 0, hi = 1;
|
|
68
|
+
for (const axis of [0, 1]) {
|
|
69
|
+
const start = axis === 0 ? r.x : r.y;
|
|
70
|
+
const end = start + (axis === 0 ? r.width : r.height);
|
|
71
|
+
const delta = b[axis] - a[axis];
|
|
72
|
+
if (Math.abs(delta) < 1e-8) {
|
|
73
|
+
if (a[axis] <= start + 1e-6 || a[axis] >= end - 1e-6) return false;
|
|
74
|
+
} else {
|
|
75
|
+
const t1 = (start - a[axis]) / delta, t2 = (end - a[axis]) / delta;
|
|
76
|
+
lo = Math.max(lo, Math.min(t1, t2)); hi = Math.min(hi, Math.max(t1, t2));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return hi - lo > 1e-6;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** @param {Rect} a @param {Rect} b */
|
|
83
|
+
export function overlaps(a, b) {
|
|
84
|
+
return Math.min(a.x + a.width, b.x + b.width) > Math.max(a.x, b.x) + 1e-6 && Math.min(a.y + a.height, b.y + b.height) > Math.max(a.y, b.y) + 1e-6;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** @param {Point[]} points @returns {Point[]} */
|
|
88
|
+
function simplify(points) {
|
|
89
|
+
return points.filter((p, i) => {
|
|
90
|
+
if (i && p[0] === points[i - 1][0] && p[1] === points[i - 1][1]) return false;
|
|
91
|
+
if (!i || i === points.length - 1) return true;
|
|
92
|
+
const prev = points[i - 1], next = points[i + 1];
|
|
93
|
+
return !((prev[0] === p[0] && next[0] === p[0]) || (prev[1] === p[1] && next[1] === p[1]));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** @param {Rect & {id:string}} from @param {Rect & {id:string}} to @param {Rect[]} obstacles @param {Point[][]} occupied @param {Point[]} [waypoints] */
|
|
98
|
+
export function routeConnector(from, to, obstacles, occupied, waypoints) {
|
|
99
|
+
const horizontal = Math.abs(to.x - from.x) >= Math.abs(to.y - from.y);
|
|
100
|
+
const forward = horizontal ? to.x >= from.x : to.y >= from.y;
|
|
101
|
+
const start = boundaryPort(from, horizontal ? (forward ? "right" : "left") : (forward ? "bottom" : "top"));
|
|
102
|
+
const end = boundaryPort(to, horizontal ? (forward ? "left" : "right") : (forward ? "top" : "bottom"));
|
|
103
|
+
/** @type {QualityIssue[]} */
|
|
104
|
+
const issues = [];
|
|
105
|
+
if (waypoints) {
|
|
106
|
+
const points = [start, ...waypoints, end];
|
|
107
|
+
if (points.some((p, i) => i > 0 && obstacles.some((r) => segmentHits(points[i - 1], p, r)))) issues.push({ code: "route-obstructed", id: `${from.id}-${to.id}`, message: "Explicit waypoints cross a non-endpoint node." });
|
|
108
|
+
return { points, issues };
|
|
109
|
+
}
|
|
110
|
+
if (from.id === to.id) {
|
|
111
|
+
const x = from.x + from.width + 40 + occupied.length * 4;
|
|
112
|
+
return { points: /** @type {Point[]} */ ([[from.x + from.width, from.y + from.height / 3], [x, from.y + from.height / 3], [x, from.y + from.height * 2 / 3], [from.x + from.width, from.y + from.height * 2 / 3]]), issues };
|
|
113
|
+
}
|
|
114
|
+
const padded = obstacles.map((r) => ({ x: r.x - 12, y: r.y - 12, width: r.width + 24, height: r.height + 24 }));
|
|
115
|
+
const xSet = new Set([start[0], end[0], 28]), ySet = new Set([start[1], end[1], 28]);
|
|
116
|
+
for (const r of [...padded, from, to]) { xSet.add(r.x - 16); xSet.add(r.x + r.width + 16); ySet.add(r.y - 16); ySet.add(r.y + r.height + 16); }
|
|
117
|
+
for (const route of occupied) for (const [x, y] of route) { xSet.add(x - 16); xSet.add(x + 16); ySet.add(y - 16); ySet.add(y + 16); }
|
|
118
|
+
const xs = [...xSet].filter((x) => x >= 24).sort((a, b) => a - b), ys = [...ySet].filter((y) => y >= 24).sort((a, b) => a - b);
|
|
119
|
+
if (xs.length > 128 || ys.length > 128) return { points: [start, end], issues: [{ code: "route-unresolved", id: `${from.id}-${to.id}`, message: "Routing grid exceeded its bounded search budget." }] };
|
|
120
|
+
const nx = xs.length, ny = ys.length;
|
|
121
|
+
const startId = ys.indexOf(start[1]) * nx + xs.indexOf(start[0]), endId = ys.indexOf(end[1]) * nx + xs.indexOf(end[0]);
|
|
122
|
+
/** @param {number} id @returns {Point} */
|
|
123
|
+
const point = (id) => [xs[id % nx], ys[Math.floor(id / nx)]];
|
|
124
|
+
/** @type {Array<{node:number,dir:number,cost:number,key:string}>} */
|
|
125
|
+
const pending = [{ node: startId, dir: 0, cost: 0, key: `${startId}:0` }];
|
|
126
|
+
const best = new Map([[`${startId}:0`, 0]]), previous = new Map();
|
|
127
|
+
let finish = "";
|
|
128
|
+
while (pending.length) {
|
|
129
|
+
pending.sort((a, b) => a.cost - b.cost || a.node - b.node || a.dir - b.dir);
|
|
130
|
+
const current = pending.shift();
|
|
131
|
+
if (!current || current.cost !== best.get(current.key)) continue;
|
|
132
|
+
if (current.node === endId) { finish = current.key; break; }
|
|
133
|
+
const ix = current.node % nx, iy = Math.floor(current.node / nx);
|
|
134
|
+
for (const [dx, dy] of [[-1, 0], [1, 0], [0, -1], [0, 1]]) {
|
|
135
|
+
if (ix + dx < 0 || ix + dx >= nx || iy + dy < 0 || iy + dy >= ny) continue;
|
|
136
|
+
const next = (iy + dy) * nx + ix + dx, a = point(current.node), b = point(next);
|
|
137
|
+
if ([...padded, from, to].some((r) => segmentHits(a, b, r))) continue;
|
|
138
|
+
const dir = dx ? 1 : 2;
|
|
139
|
+
let penalty = 0;
|
|
140
|
+
for (const route of occupied) for (let i = 1; i < route.length; i++) {
|
|
141
|
+
const p = route[i - 1], q = route[i];
|
|
142
|
+
if ((a[0] === b[0] && p[0] === q[0] && a[0] === p[0] && Math.min(b[1], a[1]) < Math.max(p[1], q[1]) && Math.max(b[1], a[1]) > Math.min(p[1], q[1])) || (a[1] === b[1] && p[1] === q[1] && a[1] === p[1] && Math.min(b[0], a[0]) < Math.max(p[0], q[0]) && Math.max(b[0], a[0]) > Math.min(p[0], q[0]))) penalty += 80;
|
|
143
|
+
}
|
|
144
|
+
const cost = current.cost + Math.abs(b[0] - a[0]) + Math.abs(b[1] - a[1]) + (current.dir && current.dir !== dir ? 24 : 0) + penalty;
|
|
145
|
+
const key = `${next}:${dir}`;
|
|
146
|
+
if (cost < (best.get(key) ?? Infinity)) { best.set(key, cost); previous.set(key, current.key); pending.push({ node: next, dir, cost, key }); }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!finish) return { points: [start, end], issues: [{ code: "route-unresolved", id: `${from.id}-${to.id}`, message: "No obstacle-free route exists without moving explicit nodes." }] };
|
|
150
|
+
/** @type {Point[]} */
|
|
151
|
+
const route = [];
|
|
152
|
+
for (let key = finish; key; key = previous.get(key)) route.unshift(point(Number(key.split(":")[0])));
|
|
153
|
+
return { points: simplify(route), issues };
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** @param {Point[]} points @param {TextLayout} layout @param {Rect[]} obstacles @param {Point[][]} [routes] */
|
|
157
|
+
export function placeEdgeLabel(points, layout, obstacles, routes = []) {
|
|
158
|
+
const lengths = points.slice(1).map((p, i) => Math.hypot(p[0] - points[i][0], p[1] - points[i][1]));
|
|
159
|
+
let remaining = lengths.reduce((a, b) => a + b, 0) / 2;
|
|
160
|
+
let cx = points[0][0], cy = points[0][1];
|
|
161
|
+
for (let i = 0; i < lengths.length; i++) {
|
|
162
|
+
if (remaining <= lengths[i]) {
|
|
163
|
+
const ratio = lengths[i] ? remaining / lengths[i] : 0;
|
|
164
|
+
cx = points[i][0] + (points[i + 1][0] - points[i][0]) * ratio;
|
|
165
|
+
cy = points[i][1] + (points[i + 1][1] - points[i][1]) * ratio;
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
remaining -= lengths[i];
|
|
169
|
+
}
|
|
170
|
+
let rect = { x: cx - layout.width / 2, y: cy - layout.height - 12, width: layout.width, height: layout.height };
|
|
171
|
+
for (const offset of [12,24,36,52,72,96]) for (const direction of ["above","below","left","right"]) {
|
|
172
|
+
const candidate = direction === "above" ? {...rect,y:cy-layout.height-offset} : direction === "below" ? {...rect,y:cy+offset} : direction === "left" ? {...rect,x:cx-layout.width-offset,y:cy-layout.height/2} : {...rect,x:cx+offset,y:cy-layout.height/2};
|
|
173
|
+
if (candidate.x >= 24 && candidate.y >= 24 && !obstacles.some((r) => overlaps(candidate, r)) && !routes.some(route=>route.slice(1).some((point,index)=>segmentHits(route[index],point,{x:candidate.x-4,y:candidate.y-4,width:candidate.width+8,height:candidate.height+8})))) return { rect: candidate, issues: /** @type {QualityIssue[]} */ ([]) };
|
|
174
|
+
}
|
|
175
|
+
return { rect, issues: [{ code: "edge-label-collision", id: "edge", message: "No free label position near route midpoint." }] };
|
|
176
|
+
}
|