imhcode 1.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/.github/ISSUE_TEMPLATE/bug_report.md +41 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +39 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +29 -0
- package/.github/copilot-instructions.md +43 -0
- package/.github/workflows/framework-validator.yml +53 -0
- package/.gitignore.template +15 -0
- package/AGENTS.md +69 -0
- package/CLAUDE.md +27 -0
- package/README.md +63 -0
- package/SETUP.md +81 -0
- package/USER_MANUAL.md +70 -0
- package/agents/android-executor/SYSTEM.md +32 -0
- package/agents/android-executor/agent.yml +53 -0
- package/agents/debugger/SYSTEM.md +32 -0
- package/agents/debugger/agent.yml +56 -0
- package/agents/designer/SYSTEM.md +32 -0
- package/agents/designer/agent.yml +59 -0
- package/agents/devops-executor/SYSTEM.md +32 -0
- package/agents/devops-executor/agent.yml +56 -0
- package/agents/flutter-executor/SYSTEM.md +32 -0
- package/agents/flutter-executor/agent.yml +54 -0
- package/agents/ios-executor/SYSTEM.md +32 -0
- package/agents/ios-executor/agent.yml +53 -0
- package/agents/java-executor/SYSTEM.md +32 -0
- package/agents/java-executor/agent.yml +57 -0
- package/agents/laravel-executor/SYSTEM.md +32 -0
- package/agents/laravel-executor/agent.yml +59 -0
- package/agents/nextjs-executor/SYSTEM.md +32 -0
- package/agents/nextjs-executor/agent.yml +60 -0
- package/agents/planner/SYSTEM.md +32 -0
- package/agents/planner/agent.yml +56 -0
- package/agents/python-executor/SYSTEM.md +32 -0
- package/agents/python-executor/agent.yml +58 -0
- package/agents/react-executor/SYSTEM.md +32 -0
- package/agents/react-executor/agent.yml +58 -0
- package/agents/react-native-executor/SYSTEM.md +32 -0
- package/agents/react-native-executor/agent.yml +53 -0
- package/agents/security-auditor/SYSTEM.md +32 -0
- package/agents/security-auditor/agent.yml +56 -0
- package/agents/seo-optimizer/SYSTEM.md +32 -0
- package/agents/seo-optimizer/agent.yml +54 -0
- package/agents/systems-executor/SYSTEM.md +32 -0
- package/agents/systems-executor/agent.yml +54 -0
- package/agents/tester/SYSTEM.md +32 -0
- package/agents/tester/agent.yml +58 -0
- package/agents/vue-executor/SYSTEM.md +32 -0
- package/agents/vue-executor/agent.yml +58 -0
- package/agents/web3-executor/SYSTEM.md +32 -0
- package/agents/web3-executor/agent.yml +55 -0
- package/bin/imhcode.js +1634 -0
- package/dist/orchestrator/builder.d.ts +23 -0
- package/dist/orchestrator/builder.d.ts.map +1 -0
- package/dist/orchestrator/builder.js +231 -0
- package/dist/orchestrator/builder.js.map +1 -0
- package/dist/orchestrator/executor.d.ts +43 -0
- package/dist/orchestrator/executor.d.ts.map +1 -0
- package/dist/orchestrator/executor.js +356 -0
- package/dist/orchestrator/executor.js.map +1 -0
- package/dist/orchestrator/index.d.ts +35 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +490 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/loader.d.ts +33 -0
- package/dist/orchestrator/loader.d.ts.map +1 -0
- package/dist/orchestrator/loader.js +203 -0
- package/dist/orchestrator/loader.js.map +1 -0
- package/dist/orchestrator/registry.d.ts +63 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/orchestrator/registry.js +181 -0
- package/dist/orchestrator/registry.js.map +1 -0
- package/dist/orchestrator/schema.d.ts +132 -0
- package/dist/orchestrator/schema.d.ts.map +1 -0
- package/dist/orchestrator/schema.js +101 -0
- package/dist/orchestrator/schema.js.map +1 -0
- package/dist/orchestrator/session.d.ts +25 -0
- package/dist/orchestrator/session.d.ts.map +1 -0
- package/dist/orchestrator/session.js +80 -0
- package/dist/orchestrator/session.js.map +1 -0
- package/dist/orchestrator/types.d.ts +91 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +7 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/package.json +95 -0
- package/skills/AnimatePresence/SKILL.md +3 -0
- package/skills/accessibility/SKILL.md +146 -0
- package/skills/agent-architecture-audit/SKILL.md +256 -0
- package/skills/agent-eval/SKILL.md +145 -0
- package/skills/agent-introspection-debugging/SKILL.md +153 -0
- package/skills/agentic-engineering/SKILL.md +63 -0
- package/skills/ai-regression-testing/SKILL.md +385 -0
- package/skills/android-clean-architecture/SKILL.md +339 -0
- package/skills/animated-component-libraries/SKILL.md +8 -0
- package/skills/animejs/SKILL.md +8 -0
- package/skills/api-connector-builder/SKILL.md +120 -0
- package/skills/api-design/SKILL.md +523 -0
- package/skills/apple/SKILL.md +158 -0
- package/skills/apple/metadata.json +16 -0
- package/skills/architecture-decision-records/SKILL.md +179 -0
- package/skills/article-writing/SKILL.md +79 -0
- package/skills/automation-audit-ops/SKILL.md +142 -0
- package/skills/awwwards/SKILL.md +162 -0
- package/skills/awwwards/metadata.json +16 -0
- package/skills/babylonjs-engine/SKILL.md +8 -0
- package/skills/backend-patterns/SKILL.md +561 -0
- package/skills/baqir-docs/SKILL.md +3 -0
- package/skills/barba-js/SKILL.md +8 -0
- package/skills/benchmark/SKILL.md +93 -0
- package/skills/best-practice/SKILL.md +7 -0
- package/skills/best-practice/assets/claude-memory/claude-memory-monorepo.jpg +0 -0
- package/skills/best-practice/assets/claude-power-ups/dial-the-model-1.png +0 -0
- package/skills/best-practice/assets/claude-power-ups/dial-the-model-2.png +0 -0
- package/skills/best-practice/assets/claude-power-ups/dial-the-model-3.png +0 -0
- package/skills/best-practice/assets/claude-power-ups/powerup-menu.png +0 -0
- package/skills/best-practice/claude-cli-startup-flags.md +231 -0
- package/skills/best-practice/claude-commands.md +132 -0
- package/skills/best-practice/claude-mcp.md +132 -0
- package/skills/best-practice/claude-memory.md +121 -0
- package/skills/best-practice/claude-power-ups.md +66 -0
- package/skills/best-practice/claude-settings.md +1170 -0
- package/skills/best-practice/claude-skills.md +58 -0
- package/skills/best-practice/claude-subagents.md +56 -0
- package/skills/blender-motion-state-inspection/SKILL.md +164 -0
- package/skills/bootstrap-patterns/SKILL.md +316 -0
- package/skills/brand-guidelines/LICENSE.txt +202 -0
- package/skills/brand-guidelines/SKILL.md +73 -0
- package/skills/brand-voice/SKILL.md +97 -0
- package/skills/brand-voice/references/voice-profile-schema.md +55 -0
- package/skills/browser-qa/SKILL.md +87 -0
- package/skills/canary-watch/SKILL.md +107 -0
- package/skills/canvas-design/LICENSE.txt +202 -0
- package/skills/canvas-design/SKILL.md +8 -0
- package/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills/caveman/SKILL.md +74 -0
- package/skills/changelog-generator/SKILL.md +104 -0
- package/skills/cisco-ios-patterns/SKILL.md +163 -0
- package/skills/ckm:design-system/SKILL.md +3 -0
- package/skills/ckm:slides/SKILL.md +3 -0
- package/skills/claude-red/SKILL.md +35 -0
- package/skills/click-path-audit/SKILL.md +244 -0
- package/skills/clickhouse-io/SKILL.md +439 -0
- package/skills/codebase-onboarding/SKILL.md +233 -0
- package/skills/coding-standards/SKILL.md +549 -0
- package/skills/compose-multiplatform-patterns/SKILL.md +299 -0
- package/skills/computational-architecture/SKILL.md +31 -0
- package/skills/content-engine/SKILL.md +131 -0
- package/skills/content-research-writer/SKILL.md +538 -0
- package/skills/continuous-agent-loop/SKILL.md +45 -0
- package/skills/cost-aware-llm-pipeline/SKILL.md +183 -0
- package/skills/cpp-coding-standards/SKILL.md +723 -0
- package/skills/crosspost/SKILL.md +111 -0
- package/skills/css-container-queries/SKILL.md +132 -0
- package/skills/customer-billing-ops/SKILL.md +140 -0
- package/skills/customs-trade-compliance/SKILL.md +263 -0
- package/skills/dart-flutter-patterns/SKILL.md +563 -0
- package/skills/dashboard-builder/SKILL.md +108 -0
- package/skills/data-scraper-agent/SKILL.md +764 -0
- package/skills/database-migrations/SKILL.md +429 -0
- package/skills/deep-research/SKILL.md +159 -0
- package/skills/defi-amm-security/SKILL.md +166 -0
- package/skills/deployment-patterns/SKILL.md +427 -0
- package/skills/design-auditor/README.md +504 -0
- package/skills/design-auditor/README_KR.md +327 -0
- package/skills/design-auditor/SKILL.md +8 -0
- package/skills/design-auditor/references/animation.md +300 -0
- package/skills/design-auditor/references/color.md +241 -0
- package/skills/design-auditor/references/corner-radius.md +331 -0
- package/skills/design-auditor/references/elevation.md +249 -0
- package/skills/design-auditor/references/ethics.md +877 -0
- package/skills/design-auditor/references/figma-mcp.md +377 -0
- package/skills/design-auditor/references/heuristics.md +730 -0
- package/skills/design-auditor/references/i18n.md +254 -0
- package/skills/design-auditor/references/iconography.md +201 -0
- package/skills/design-auditor/references/microcopy.md +227 -0
- package/skills/design-auditor/references/navigation.md +311 -0
- package/skills/design-auditor/references/spacing.md +313 -0
- package/skills/design-auditor/references/states.md +254 -0
- package/skills/design-auditor/references/tokens.md +286 -0
- package/skills/design-auditor/references/typography.md +273 -0
- package/skills/design-system/SKILL.md +82 -0
- package/skills/design-tokens-system/SKILL.md +156 -0
- package/skills/development-workflows/SKILL.md +7 -0
- package/skills/development-workflows/cross-model-workflow/assets/cross-model-workflow.png +0 -0
- package/skills/development-workflows/cross-model-workflow/cross-model-workflow.md +55 -0
- package/skills/development-workflows/rpi/.claude/agents/code-reviewer.md +21 -0
- package/skills/development-workflows/rpi/.claude/agents/constitutional-validator.md +288 -0
- package/skills/development-workflows/rpi/.claude/agents/documentation-analyst-writer.md +64 -0
- package/skills/development-workflows/rpi/.claude/agents/product-manager.md +15 -0
- package/skills/development-workflows/rpi/.claude/agents/requirement-parser.md +238 -0
- package/skills/development-workflows/rpi/.claude/agents/senior-software-engineer.md +15 -0
- package/skills/development-workflows/rpi/.claude/agents/technical-cto-advisor.md +201 -0
- package/skills/development-workflows/rpi/.claude/agents/ux-designer.md +14 -0
- package/skills/development-workflows/rpi/.claude/commands/rpi/implement.md +634 -0
- package/skills/development-workflows/rpi/.claude/commands/rpi/plan.md +416 -0
- package/skills/development-workflows/rpi/.claude/commands/rpi/research.md +381 -0
- package/skills/development-workflows/rpi/rpi-workflow.md +101 -0
- package/skills/development-workflows/rpi/rpi-workflow.svg +178 -0
- package/skills/django-celery/SKILL.md +457 -0
- package/skills/django-patterns/SKILL.md +734 -0
- package/skills/django-security/SKILL.md +593 -0
- package/skills/django-tdd/SKILL.md +729 -0
- package/skills/dmux-workflows/SKILL.md +7 -0
- package/skills/docker-patterns/SKILL.md +364 -0
- package/skills/documentation-lookup/SKILL.md +90 -0
- package/skills/domain-name-brainstormer/SKILL.md +212 -0
- package/skills/dribbble/SKILL.md +160 -0
- package/skills/dribbble/metadata.json +16 -0
- package/skills/e2e-testing/SKILL.md +326 -0
- package/skills/empirical-research/SKILL.md +22 -0
- package/skills/error-handling/SKILL.md +376 -0
- package/skills/eval-harness/SKILL.md +270 -0
- package/skills/evm-token-decimals/SKILL.md +130 -0
- package/skills/fastapi-patterns/SKILL.md +327 -0
- package/skills/finance-billing-ops/SKILL.md +127 -0
- package/skills/flox-environments/SKILL.md +496 -0
- package/skills/flutter-dart-code-review/SKILL.md +435 -0
- package/skills/foundation-models-on-device/SKILL.md +243 -0
- package/skills/framer/SKILL.md +159 -0
- package/skills/framer/metadata.json +16 -0
- package/skills/frontend-design/LICENSE.txt +21 -0
- package/skills/frontend-design/README.md +71 -0
- package/skills/frontend-design/SKILL.md +115 -0
- package/skills/frontend-design-direction/SKILL.md +92 -0
- package/skills/frontend-patterns/SKILL.md +7 -0
- package/skills/frontend-slides/SKILL.md +184 -0
- package/skills/frontend-slides/STYLE_PRESETS.md +330 -0
- package/skills/frontend-slides/animation-patterns.md +122 -0
- package/skills/frontend-slides/html-template.md +419 -0
- package/skills/frontend-slides/scripts/export-pdf.sh +418 -0
- package/skills/frontend-slides/scripts/extract-pptx.py +96 -0
- package/skills/frontend-slides/viewport-base.css +153 -0
- package/skills/gateguard/SKILL.md +125 -0
- package/skills/git-workflow/SKILL.md +715 -0
- package/skills/github-ops/SKILL.md +144 -0
- package/skills/golang-patterns/SKILL.md +674 -0
- package/skills/golang-testing/SKILL.md +720 -0
- package/skills/graphify/__init__.py +28 -0
- package/skills/graphify/__main__.py +2899 -0
- package/skills/graphify/analyze.py +608 -0
- package/skills/graphify/benchmark.py +152 -0
- package/skills/graphify/build.py +366 -0
- package/skills/graphify/cache.py +244 -0
- package/skills/graphify/callflow_html.py +2014 -0
- package/skills/graphify/cluster.py +267 -0
- package/skills/graphify/dedup.py +414 -0
- package/skills/graphify/detect.py +1018 -0
- package/skills/graphify/export.py +1264 -0
- package/skills/graphify/extract.py +6646 -0
- package/skills/graphify/global_graph.py +155 -0
- package/skills/graphify/google_workspace.py +223 -0
- package/skills/graphify/hooks.py +304 -0
- package/skills/graphify/ingest.py +331 -0
- package/skills/graphify/llm.py +1111 -0
- package/skills/graphify/manifest.py +4 -0
- package/skills/graphify/prs.py +746 -0
- package/skills/graphify/report.py +203 -0
- package/skills/graphify/security.py +242 -0
- package/skills/graphify/serve.py +899 -0
- package/skills/graphify/skill-aider.md +1229 -0
- package/skills/graphify/skill-claw.md +1229 -0
- package/skills/graphify/skill-codex.md +1290 -0
- package/skills/graphify/skill-copilot.md +1317 -0
- package/skills/graphify/skill-droid.md +1285 -0
- package/skills/graphify/skill-kiro.md +1228 -0
- package/skills/graphify/skill-opencode.md +1340 -0
- package/skills/graphify/skill-pi.md +1228 -0
- package/skills/graphify/skill-trae.md +1254 -0
- package/skills/graphify/skill-vscode.md +258 -0
- package/skills/graphify/skill-windows.md +1434 -0
- package/skills/graphify/skill.md +1086 -0
- package/skills/graphify/transcribe.py +184 -0
- package/skills/graphify/tree_html.py +580 -0
- package/skills/graphify/validate.py +72 -0
- package/skills/graphify/watch.py +728 -0
- package/skills/graphify/wiki.py +259 -0
- package/skills/growth-marketing/SKILL.md +26 -0
- package/skills/gsap-scrolltrigger/SKILL.md +8 -0
- package/skills/healthcare-cdss-patterns/SKILL.md +245 -0
- package/skills/healthcare-emr-patterns/SKILL.md +159 -0
- package/skills/healthcare-phi-compliance/SKILL.md +145 -0
- package/skills/hexagonal-architecture/SKILL.md +276 -0
- package/skills/hipaa-compliance/SKILL.md +78 -0
- package/skills/homelab-network-setup/SKILL.md +129 -0
- package/skills/imhcode/SKILL.md +183 -0
- package/skills/imhcode-brainstorm/SKILL.md +37 -0
- package/skills/imhcode-codebase-knowledge/SKILL.md +37 -0
- package/skills/imhcode-codebase-knowledge/assets/templates/ARCHITECTURE.md +49 -0
- package/skills/imhcode-codebase-knowledge/assets/templates/CONCERNS.md +56 -0
- package/skills/imhcode-codebase-knowledge/assets/templates/CONVENTIONS.md +52 -0
- package/skills/imhcode-codebase-knowledge/assets/templates/INTEGRATIONS.md +48 -0
- package/skills/imhcode-codebase-knowledge/assets/templates/STACK.md +56 -0
- package/skills/imhcode-codebase-knowledge/assets/templates/STRUCTURE.md +44 -0
- package/skills/imhcode-codebase-knowledge/assets/templates/TESTING.md +57 -0
- package/skills/imhcode-codebase-knowledge/references/inquiry-checkpoints.md +70 -0
- package/skills/imhcode-codebase-knowledge/references/stack-detection.md +131 -0
- package/skills/imhcode-codebase-knowledge/scripts/scan.py +712 -0
- package/skills/imhcode-dispatch/SKILL.md +31 -0
- package/skills/imhcode-saas-architect/SKILL.md +55 -0
- package/skills/imhcode-security/SKILL.md +42 -0
- package/skills/imhcode-sprint-planner/SKILL.md +42 -0
- package/skills/inventory-demand-planning/SKILL.md +247 -0
- package/skills/investor-materials/SKILL.md +96 -0
- package/skills/investor-outreach/SKILL.md +91 -0
- package/skills/ios-icon-gen/SKILL.md +157 -0
- package/skills/ios-icon-gen/scripts/generate_icons.swift +258 -0
- package/skills/ios-icon-gen/scripts/iconify_gen.sh +235 -0
- package/skills/java-coding-standards/SKILL.md +383 -0
- package/skills/jpa-patterns/SKILL.md +151 -0
- package/skills/kotlin-ktor-patterns/SKILL.md +689 -0
- package/skills/kotlin-patterns/SKILL.md +711 -0
- package/skills/laravel-patterns/SKILL.md +415 -0
- package/skills/laravel-plugin-discovery/SKILL.md +229 -0
- package/skills/laravel-security/SKILL.md +285 -0
- package/skills/laravel-tdd/SKILL.md +283 -0
- package/skills/laravel-verification/SKILL.md +179 -0
- package/skills/lightweight-3d-effects/SKILL.md +8 -0
- package/skills/linear/SKILL.md +156 -0
- package/skills/linear/metadata.json +16 -0
- package/skills/liquid-glass-design/SKILL.md +279 -0
- package/skills/llm-trading-agent-security/SKILL.md +146 -0
- package/skills/locomotive-scroll/SKILL.md +8 -0
- package/skills/logistics-exception-management/SKILL.md +222 -0
- package/skills/lottie-animations/SKILL.md +8 -0
- package/skills/make-interfaces-feel-better/SKILL.md +151 -0
- package/skills/mcp-server-patterns/SKILL.md +69 -0
- package/skills/meeting-insights-analyzer/SKILL.md +327 -0
- package/skills/micro-interactions/SKILL.md +178 -0
- package/skills/mle-workflow/SKILL.md +346 -0
- package/skills/mobbin/SKILL.md +157 -0
- package/skills/mobbin/metadata.json +16 -0
- package/skills/mobile-app-design/README.md +302 -0
- package/skills/mobile-app-design/SKILL.md +330 -0
- package/skills/mobile-app-design/examples/design-system-config.ts +685 -0
- package/skills/mobile-app-design/examples/form-validation-example.tsx +501 -0
- package/skills/mobile-app-design/examples/optimized-list-example.tsx +384 -0
- package/skills/mobile-app-design/examples/profile-screen-example.tsx +450 -0
- package/skills/mobile-app-design/references/accessibility-checklist.md +525 -0
- package/skills/mobile-app-design/references/android-guidelines.md +582 -0
- package/skills/mobile-app-design/references/common-mistakes.md +834 -0
- package/skills/mobile-app-design/references/ios-guidelines.md +421 -0
- package/skills/mobile-app-design/references/performance-patterns.md +705 -0
- package/skills/mobile-app-design/references/platform-differences.md +353 -0
- package/skills/mobile-app-design/references/ui-libraries.md +729 -0
- package/skills/mobile-app-design/scripts/accessibility-audit.sh +281 -0
- package/skills/mobile-app-design/scripts/check-contrast.py +188 -0
- package/skills/mobile-app-design/scripts/validate-touch-targets.sh +228 -0
- package/skills/mobile-app-ui-design/INDEX.md +131 -0
- package/skills/mobile-app-ui-design/README.md +135 -0
- package/skills/mobile-app-ui-design/SKILL.md +7 -0
- package/skills/mobile-app-ui-design/references/industry-conventions.md +151 -0
- package/skills/modern-web-design/SKILL.md +8 -0
- package/skills/motion-advanced/SKILL.md +596 -0
- package/skills/motion-design/SKILL.md +21 -0
- package/skills/motion-foundations/SKILL.md +299 -0
- package/skills/motion-framer/SKILL.md +8 -0
- package/skills/motion-patterns/SKILL.md +435 -0
- package/skills/motion-ui/SKILL.md +575 -0
- package/skills/mysql-patterns/SKILL.md +412 -0
- package/skills/nestjs-patterns/SKILL.md +230 -0
- package/skills/network-config-validation/SKILL.md +210 -0
- package/skills/nextjs-turbopack/SKILL.md +44 -0
- package/skills/nodejs-keccak256/SKILL.md +102 -0
- package/skills/nothing-design/SKILL.md +177 -0
- package/skills/nothing-design/references/components.md +153 -0
- package/skills/nothing-design/references/platform-mapping.md +64 -0
- package/skills/nothing-design/references/tokens.md +142 -0
- package/skills/nuxt4-patterns/SKILL.md +100 -0
- package/skills/openclaw-persona-forge/SKILL.md +288 -0
- package/skills/openclaw-persona-forge/gacha.py +224 -0
- package/skills/openclaw-persona-forge/gacha.sh +5 -0
- package/skills/openclaw-persona-forge/references/avatar-style.md +124 -0
- package/skills/openclaw-persona-forge/references/boundary-rules.md +53 -0
- package/skills/openclaw-persona-forge/references/error-handling.md +53 -0
- package/skills/openclaw-persona-forge/references/identity-tension.md +48 -0
- package/skills/openclaw-persona-forge/references/naming-system.md +39 -0
- package/skills/openclaw-persona-forge/references/output-template.md +166 -0
- package/skills/orchestration-workflow/SKILL.md +199 -0
- package/skills/orchestration-workflow/orchestration-workflow.gif +0 -0
- package/skills/orchestration-workflow/orchestration-workflow.md +199 -0
- package/skills/orchestration-workflow/orchestration-workflow.svg +78 -0
- package/skills/orchestration-workflow/output.md +13 -0
- package/skills/orchestration-workflow/weather.svg +6 -0
- package/skills/pixijs-2d/SKILL.md +8 -0
- package/skills/plan-orchestrate/SKILL.md +262 -0
- package/skills/plankton-code-quality/SKILL.md +236 -0
- package/skills/postgres-patterns/SKILL.md +147 -0
- package/skills/ppt-mckinsey/SKILL.md +27 -0
- package/skills/prisma-patterns/SKILL.md +371 -0
- package/skills/product-capability/SKILL.md +141 -0
- package/skills/product-lens/SKILL.md +92 -0
- package/skills/production-audit/SKILL.md +206 -0
- package/skills/project-flow-ops/SKILL.md +111 -0
- package/skills/prompt-optimizer/SKILL.md +398 -0
- package/skills/python-patterns/SKILL.md +750 -0
- package/skills/python-testing/SKILL.md +816 -0
- package/skills/pytorch-patterns/SKILL.md +396 -0
- package/skills/quarkus-patterns/SKILL.md +722 -0
- package/skills/radix-ui-primitives/SKILL.md +86 -0
- package/skills/react-native-best-practices/SKILL.md +83 -0
- package/skills/react-native-brownfield-migration/SKILL.md +115 -0
- package/skills/react-spring-physics/SKILL.md +8 -0
- package/skills/react-three-fiber/SKILL.md +8 -0
- package/skills/recsys-pipeline-architect/SKILL.md +114 -0
- package/skills/redis-patterns/SKILL.md +403 -0
- package/skills/remotion-video-creation/SKILL.md +43 -0
- package/skills/remotion-video-creation/rules/3d.md +86 -0
- package/skills/remotion-video-creation/rules/animations.md +29 -0
- package/skills/remotion-video-creation/rules/assets/charts-bar-chart.tsx +173 -0
- package/skills/remotion-video-creation/rules/assets/text-animations-typewriter.tsx +100 -0
- package/skills/remotion-video-creation/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/skills/remotion-video-creation/rules/assets.md +78 -0
- package/skills/remotion-video-creation/rules/audio.md +172 -0
- package/skills/remotion-video-creation/rules/calculate-metadata.md +104 -0
- package/skills/remotion-video-creation/rules/can-decode.md +75 -0
- package/skills/remotion-video-creation/rules/charts.md +58 -0
- package/skills/remotion-video-creation/rules/compositions.md +146 -0
- package/skills/remotion-video-creation/rules/display-captions.md +126 -0
- package/skills/remotion-video-creation/rules/extract-frames.md +229 -0
- package/skills/remotion-video-creation/rules/fonts.md +152 -0
- package/skills/remotion-video-creation/rules/get-audio-duration.md +58 -0
- package/skills/remotion-video-creation/rules/get-video-dimensions.md +68 -0
- package/skills/remotion-video-creation/rules/get-video-duration.md +58 -0
- package/skills/remotion-video-creation/rules/gifs.md +138 -0
- package/skills/remotion-video-creation/rules/images.md +130 -0
- package/skills/remotion-video-creation/rules/import-srt-captions.md +67 -0
- package/skills/remotion-video-creation/rules/lottie.md +67 -0
- package/skills/remotion-video-creation/rules/measuring-dom-nodes.md +34 -0
- package/skills/remotion-video-creation/rules/measuring-text.md +143 -0
- package/skills/remotion-video-creation/rules/sequencing.md +106 -0
- package/skills/remotion-video-creation/rules/tailwind.md +11 -0
- package/skills/remotion-video-creation/rules/text-animations.md +20 -0
- package/skills/remotion-video-creation/rules/timing.md +179 -0
- package/skills/remotion-video-creation/rules/transcribe-captions.md +19 -0
- package/skills/remotion-video-creation/rules/transitions.md +122 -0
- package/skills/remotion-video-creation/rules/trimming.md +52 -0
- package/skills/remotion-video-creation/rules/videos.md +171 -0
- package/skills/repo-scan/SKILL.md +78 -0
- package/skills/responsive-email-templates/SKILL.md +110 -0
- package/skills/rive-interactive/SKILL.md +8 -0
- package/skills/rust-patterns/SKILL.md +499 -0
- package/skills/rust-testing/SKILL.md +500 -0
- package/skills/scroll-reveal-libraries/SKILL.md +8 -0
- package/skills/security-bounty-hunter/SKILL.md +99 -0
- package/skills/security-review/SKILL.md +503 -0
- package/skills/security-review/cloud-infrastructure-security.md +361 -0
- package/skills/security-scan/SKILL.md +165 -0
- package/skills/seo/SKILL.md +154 -0
- package/skills/seo-growth/SKILL.md +34 -0
- package/skills/shadcn-ui-patterns/SKILL.md +123 -0
- package/skills/spline-interactive/SKILL.md +8 -0
- package/skills/springboot-patterns/SKILL.md +314 -0
- package/skills/springboot-security/SKILL.md +272 -0
- package/skills/springboot-tdd/SKILL.md +158 -0
- package/skills/strategic-compact/SKILL.md +131 -0
- package/skills/stripe/SKILL.md +168 -0
- package/skills/stripe/metadata.json +16 -0
- package/skills/swift-actor-persistence/SKILL.md +143 -0
- package/skills/swift-concurrency-6-2/SKILL.md +216 -0
- package/skills/swiftui-patterns/SKILL.md +259 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +296 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/tailwindcss-v4/SKILL.md +107 -0
- package/skills/tdd-workflow/SKILL.md +463 -0
- package/skills/team-builder/SKILL.md +168 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/theme-factory/LICENSE.txt +202 -0
- package/skills/theme-factory/SKILL.md +59 -0
- package/skills/theme-factory/theme-showcase.pdf +0 -0
- package/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/theme-factory/themes/desert-rose.md +19 -0
- package/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/theme-factory/themes/golden-hour.md +19 -0
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/threejs-webgl/SKILL.md +8 -0
- package/skills/trailofbits-auditing/SKILL.md +30 -0
- package/skills/twitter-algorithm-optimizer/SKILL.md +327 -0
- package/skills/typeui-cli/SKILL.md +90 -0
- package/skills/typeui-main/DESIGN.md +114 -0
- package/skills/typeui-main/LICENSE.md +9 -0
- package/skills/typeui-main/README.md +84 -0
- package/skills/typeui-main/REGISTRY.md +60 -0
- package/skills/typeui-main/SKILL.md +114 -0
- package/skills/typeui-main/package-lock.json +2123 -0
- package/skills/typeui-main/package.json +56 -0
- package/skills/typeui-main/skills/typeui-cli/SKILL.md +90 -0
- package/skills/typeui-main/src/cli.ts +282 -0
- package/skills/typeui-main/src/config.ts +28 -0
- package/skills/typeui-main/src/domain/designSystemSchema.ts +77 -0
- package/skills/typeui-main/src/generation/existingDesignSystem.ts +228 -0
- package/skills/typeui-main/src/generation/randomDesignSystem.ts +348 -0
- package/skills/typeui-main/src/generation/runDesignGeneration.ts +31 -0
- package/skills/typeui-main/src/generation/runGeneration.ts +36 -0
- package/skills/typeui-main/src/generation/runPull.ts +62 -0
- package/skills/typeui-main/src/io/updateSkillFile.ts +118 -0
- package/skills/typeui-main/src/prompts/designSystem.ts +755 -0
- package/skills/typeui-main/src/prompts/registry.ts +72 -0
- package/skills/typeui-main/src/registry/registryClient.ts +246 -0
- package/skills/typeui-main/src/renderers/claudeRenderer.ts +10 -0
- package/skills/typeui-main/src/renderers/codexRenderer.ts +10 -0
- package/skills/typeui-main/src/renderers/cursorRenderer.ts +10 -0
- package/skills/typeui-main/src/renderers/index.ts +14 -0
- package/skills/typeui-main/src/renderers/openCodeRenderer.ts +10 -0
- package/skills/typeui-main/src/renderers/shared.ts +252 -0
- package/skills/typeui-main/src/skillMetadata.ts +19 -0
- package/skills/typeui-main/src/types.ts +204 -0
- package/skills/typeui-main/src/ui/banner.ts +20 -0
- package/skills/typeui-main/test/existingDesignSystem.test.ts +67 -0
- package/skills/typeui-main/test/orchestrator.test.ts +113 -0
- package/skills/typeui-main/test/randomDesignSystem.test.ts +20 -0
- package/skills/typeui-main/test/registryClient.test.ts +408 -0
- package/skills/typeui-main/test/renderers.test.ts +41 -0
- package/skills/typeui-main/test/runDesignGeneration.test.ts +52 -0
- package/skills/typeui-main/test/runPull.test.ts +92 -0
- package/skills/typeui-main/test/skillMetadata.test.ts +11 -0
- package/skills/typeui-main/test/updateSkillFile.test.ts +160 -0
- package/skills/typeui-main/tsconfig.json +16 -0
- package/skills/ui-demo/SKILL.md +465 -0
- package/skills/ui-to-vue/SKILL.md +134 -0
- package/skills/ui-ux-pro-max/.claude/skills/banner-design/SKILL.md +192 -0
- package/skills/ui-ux-pro-max/.claude/skills/banner-design/references/banner-sizes-and-styles.md +118 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/SKILL.md +97 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/approval-checklist.md +169 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/asset-organization.md +157 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/brand-guideline-template.md +140 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/color-palette-management.md +186 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/consistency-checklist.md +94 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/logo-usage-rules.md +185 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/messaging-framework.md +85 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/typography-specifications.md +214 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/update.md +118 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/visual-identity.md +96 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/references/voice-framework.md +88 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/scripts/extract-colors.cjs +341 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/scripts/inject-brand-context.cjs +349 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/scripts/sync-brand-to-tokens.cjs +266 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/scripts/validate-asset.cjs +387 -0
- package/skills/ui-ux-pro-max/.claude/skills/brand/templates/brand-guidelines-starter.md +275 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/SKILL.md +302 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/cip/deliverables.csv +51 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/cip/industries.csv +21 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/cip/mockup-contexts.csv +21 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/cip/styles.csv +21 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/icon/styles.csv +16 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/logo/colors.csv +56 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/logo/industries.csv +56 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/data/logo/styles.csv +56 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/banner-sizes-and-styles.md +118 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/cip-deliverable-guide.md +95 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/cip-design.md +121 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/cip-prompt-engineering.md +84 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/cip-style-guide.md +68 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/design-routing.md +207 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/icon-design.md +122 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/logo-color-psychology.md +101 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/logo-design.md +92 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/logo-prompt-engineering.md +158 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/logo-style-guide.md +109 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/slides-copywriting-formulas.md +84 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/slides-create.md +4 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/slides-html-template.md +295 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/slides-layout-patterns.md +137 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/slides-strategies.md +94 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/slides.md +42 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/references/social-photos-design.md +329 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/cip/core.py +215 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/cip/generate.py +484 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/cip/render-html.py +424 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/cip/search.py +127 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/icon/generate.py +487 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/logo/core.py +175 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/logo/generate.py +362 -0
- package/skills/ui-ux-pro-max/.claude/skills/design/scripts/logo/search.py +114 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/SKILL.md +244 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-backgrounds.csv +11 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-charts.csv +26 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-color-logic.csv +14 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-copy.csv +26 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-layout-logic.csv +16 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-layouts.csv +26 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-strategies.csv +16 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/data/slide-typography.csv +15 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/references/component-specs.md +236 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/references/component-tokens.md +214 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/references/primitive-tokens.md +203 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/references/semantic-tokens.md +215 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/references/states-and-variants.md +241 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/references/tailwind-integration.md +251 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/references/token-architecture.md +224 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/embed-tokens.cjs +99 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/fetch-background.py +317 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/generate-slide.py +753 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/generate-tokens.cjs +205 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/html-token-validator.py +327 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/search-slides.py +218 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/slide-token-validator.py +35 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/slide_search_core.py +453 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/scripts/validate-tokens.cjs +251 -0
- package/skills/ui-ux-pro-max/.claude/skills/design-system/templates/design-tokens-starter.json +143 -0
- package/skills/ui-ux-pro-max/.claude/skills/slides/SKILL.md +42 -0
- package/skills/ui-ux-pro-max/.claude/skills/slides/references/copywriting-formulas.md +84 -0
- package/skills/ui-ux-pro-max/.claude/skills/slides/references/create.md +4 -0
- package/skills/ui-ux-pro-max/.claude/skills/slides/references/html-template.md +295 -0
- package/skills/ui-ux-pro-max/.claude/skills/slides/references/layout-patterns.md +137 -0
- package/skills/ui-ux-pro-max/.claude/skills/slides/references/slide-strategies.md +94 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/LICENSE.txt +202 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/SKILL.md +324 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/references/canvas-design-system.md +320 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/references/shadcn-accessibility.md +471 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/references/shadcn-components.md +424 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/references/shadcn-theming.md +373 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/references/tailwind-customization.md +483 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/references/tailwind-responsive.md +382 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/references/tailwind-utilities.md +455 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/.coverage +0 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/requirements.txt +17 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/shadcn_add.py +292 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/tailwind_config_gen.py +456 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/tests/coverage-ui.json +1 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/tests/requirements.txt +3 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/tests/test_shadcn_add.py +266 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-styling/scripts/tests/test_tailwind_config_gen.py +336 -0
- package/skills/ui-ux-pro-max/.claude/skills/ui-ux-pro-max/SKILL.md +659 -0
- package/skills/ui-ux-pro-max/.claude-plugin/marketplace.json +35 -0
- package/skills/ui-ux-pro-max/.claude-plugin/plugin.json +11 -0
- package/skills/ui-ux-pro-max/.github/workflows/claude-code-review.yml +44 -0
- package/skills/ui-ux-pro-max/.github/workflows/claude.yml +50 -0
- package/skills/ui-ux-pro-max/.github/workflows/python-package-conda.yml +34 -0
- package/skills/ui-ux-pro-max/CLAUDE.md +98 -0
- package/skills/ui-ux-pro-max/LICENSE +21 -0
- package/skills/ui-ux-pro-max/README.md +513 -0
- package/skills/ui-ux-pro-max/SKILL.md +292 -0
- package/skills/ui-ux-pro-max/cli/README.md +63 -0
- package/skills/ui-ux-pro-max/cli/assets/data/_sync_all.py +414 -0
- package/skills/ui-ux-pro-max/cli/assets/data/app-interface.csv +31 -0
- package/skills/ui-ux-pro-max/cli/assets/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/cli/assets/data/colors.csv +162 -0
- package/skills/ui-ux-pro-max/cli/assets/data/design.csv +1776 -0
- package/skills/ui-ux-pro-max/cli/assets/data/draft.csv +1779 -0
- package/skills/ui-ux-pro-max/cli/assets/data/google-fonts.csv +1924 -0
- package/skills/ui-ux-pro-max/cli/assets/data/icons.csv +105 -0
- package/skills/ui-ux-pro-max/cli/assets/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/cli/assets/data/products.csv +162 -0
- package/skills/ui-ux-pro-max/cli/assets/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/angular.csv +51 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/laravel.csv +51 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/threejs.csv +54 -0
- package/skills/ui-ux-pro-max/cli/assets/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/cli/assets/data/styles.csv +85 -0
- package/skills/ui-ux-pro-max/cli/assets/data/typography.csv +74 -0
- package/skills/ui-ux-pro-max/cli/assets/data/ui-reasoning.csv +162 -0
- package/skills/ui-ux-pro-max/cli/assets/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/cli/assets/scripts/core.py +247 -0
- package/skills/ui-ux-pro-max/cli/assets/scripts/design_system.py +1148 -0
- package/skills/ui-ux-pro-max/cli/assets/scripts/search.py +114 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/base/quick-reference.md +297 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/base/skill-content.md +353 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/agent.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/augment.json +18 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/claude.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/codebuddy.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/codex.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/continue.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/copilot.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/cursor.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/droid.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/gemini.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/kilocode.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/kiro.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/opencode.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/qoder.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/roocode.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/trae.json +21 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/warp.json +18 -0
- package/skills/ui-ux-pro-max/cli/assets/templates/platforms/windsurf.json +21 -0
- package/skills/ui-ux-pro-max/cli/bun.lock +77 -0
- package/skills/ui-ux-pro-max/cli/package-lock.json +370 -0
- package/skills/ui-ux-pro-max/cli/package.json +48 -0
- package/skills/ui-ux-pro-max/cli/src/commands/init.ts +216 -0
- package/skills/ui-ux-pro-max/cli/src/commands/uninstall.ts +135 -0
- package/skills/ui-ux-pro-max/cli/src/commands/update.ts +36 -0
- package/skills/ui-ux-pro-max/cli/src/commands/versions.ts +42 -0
- package/skills/ui-ux-pro-max/cli/src/index.ts +83 -0
- package/skills/ui-ux-pro-max/cli/src/types/index.ts +68 -0
- package/skills/ui-ux-pro-max/cli/src/utils/detect.ts +120 -0
- package/skills/ui-ux-pro-max/cli/src/utils/extract.ts +149 -0
- package/skills/ui-ux-pro-max/cli/src/utils/github.ts +104 -0
- package/skills/ui-ux-pro-max/cli/src/utils/logger.ts +11 -0
- package/skills/ui-ux-pro-max/cli/src/utils/template.ts +243 -0
- package/skills/ui-ux-pro-max/cli/tsconfig.json +17 -0
- package/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/docs//344/270/211/344/270/252 data-scripts-templates /347/232/204/345/214/272/345/210/253.md" +30 -0
- package/skills/ui-ux-pro-max/preview/xiaomaomi-app.html +411 -0
- package/skills/ui-ux-pro-max/screenshots/website.png +0 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/skills/ui-ux-pro-max/skill.json +41 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/_sync_all.py +414 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/app-interface.csv +31 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/colors.csv +162 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/design.csv +1776 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/draft.csv +1779 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/google-fonts.csv +1924 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/icons.csv +106 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/landing.csv +35 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/products.csv +162 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/angular.csv +51 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/styles.csv +85 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/typography.csv +74 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/scripts/core.py +262 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/scripts/design_system.py +1148 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/scripts/search.py +114 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/base/quick-reference.md +297 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/base/skill-content.md +358 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/agent.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/augment.json +18 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/claude.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/codebuddy.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/codex.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/continue.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/copilot.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/cursor.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/droid.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/gemini.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/kilocode.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/kiro.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/opencode.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/qoder.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/roocode.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/trae.json +21 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/warp.json +18 -0
- package/skills/ui-ux-pro-max/src/ui-ux-pro-max/templates/platforms/windsurf.json +21 -0
- package/skills/uncloud/SKILL.md +343 -0
- package/skills/upgrading-react-native/SKILL.md +58 -0
- package/skills/using-git-worktrees/SKILL.md +215 -0
- package/skills/vercel/SKILL.md +161 -0
- package/skills/vercel/metadata.json +16 -0
- package/skills/verification-loop/SKILL.md +126 -0
- package/skills/view-transitions-api/SKILL.md +108 -0
- package/skills/vite-patterns/SKILL.md +449 -0
- package/skills/vue3-composition-patterns/SKILL.md +375 -0
- package/skills/waza-habits/SKILL.md +22 -0
- package/skills/webapp-testing/LICENSE.txt +202 -0
- package/skills/webapp-testing/SKILL.md +96 -0
- package/skills/webapp-testing/examples/console_logging.py +35 -0
- package/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/skills/webapp-testing/scripts/with_server.py +106 -0
- package/src/orchestrator/builder.ts +234 -0
- package/src/orchestrator/executor.ts +386 -0
- package/src/orchestrator/index.ts +535 -0
- package/src/orchestrator/loader.ts +237 -0
- package/src/orchestrator/registry.ts +211 -0
- package/src/orchestrator/schema.ts +141 -0
- package/src/orchestrator/session.ts +128 -0
- package/src/orchestrator/types.ts +109 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,1264 @@
|
|
|
1
|
+
# write graph to HTML, JSON, SVG, GraphML, Obsidian vault, and Neo4j Cypher
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
import html as _html
|
|
4
|
+
import json
|
|
5
|
+
import math
|
|
6
|
+
import re
|
|
7
|
+
from collections import Counter
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
import networkx as nx
|
|
10
|
+
from networkx.readwrite import json_graph
|
|
11
|
+
from graphify.security import sanitize_label
|
|
12
|
+
from graphify.analyze import _node_community_map
|
|
13
|
+
from graphify.build import edge_data
|
|
14
|
+
|
|
15
|
+
def _obsidian_tag(name: str) -> str:
|
|
16
|
+
"""Sanitize a community name for use as an Obsidian tag.
|
|
17
|
+
|
|
18
|
+
Obsidian tags only allow alphanumerics, hyphens, underscores, and slashes.
|
|
19
|
+
Spaces become underscores; everything else is stripped.
|
|
20
|
+
"""
|
|
21
|
+
return re.sub(r"[^a-zA-Z0-9_\-/]", "", name.replace(" ", "_"))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _strip_diacritics(text: str) -> str:
|
|
25
|
+
import unicodedata
|
|
26
|
+
nfkd = unicodedata.normalize("NFKD", text)
|
|
27
|
+
return "".join(c for c in nfkd if not unicodedata.combining(c))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _yaml_str(s: str) -> str:
|
|
31
|
+
"""Escape a value for safe embedding in a YAML double-quoted scalar (F-009).
|
|
32
|
+
|
|
33
|
+
See `graphify.ingest._yaml_str` for the full rationale; duplicated here to
|
|
34
|
+
avoid pulling the URL-fetching `ingest` module into export's dependency
|
|
35
|
+
graph. Handles backslash, double-quote, all line breaks (\\n, \\r,
|
|
36
|
+
U+2028, U+2029), tab, NUL, and other C0/DEL control characters that
|
|
37
|
+
would otherwise let a hostile `source_file` / `community` / etc. break
|
|
38
|
+
out of the YAML scalar and inject sibling keys.
|
|
39
|
+
"""
|
|
40
|
+
if s is None:
|
|
41
|
+
return ""
|
|
42
|
+
out: list[str] = []
|
|
43
|
+
for ch in str(s):
|
|
44
|
+
cp = ord(ch)
|
|
45
|
+
if ch == "\\":
|
|
46
|
+
out.append("\\\\")
|
|
47
|
+
elif ch == '"':
|
|
48
|
+
out.append('\\"')
|
|
49
|
+
elif ch == "\n":
|
|
50
|
+
out.append("\\n")
|
|
51
|
+
elif ch == "\r":
|
|
52
|
+
out.append("\\r")
|
|
53
|
+
elif ch == "\t":
|
|
54
|
+
out.append("\\t")
|
|
55
|
+
elif ch == "\0":
|
|
56
|
+
out.append("\\0")
|
|
57
|
+
elif cp == 0x2028:
|
|
58
|
+
out.append("\\L")
|
|
59
|
+
elif cp == 0x2029:
|
|
60
|
+
out.append("\\P")
|
|
61
|
+
elif cp < 0x20 or cp == 0x7F:
|
|
62
|
+
out.append(f"\\x{cp:02x}")
|
|
63
|
+
else:
|
|
64
|
+
out.append(ch)
|
|
65
|
+
return "".join(out)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
COMMUNITY_COLORS = [
|
|
69
|
+
"#4E79A7", "#F28E2B", "#E15759", "#76B7B2", "#59A14F",
|
|
70
|
+
"#EDC948", "#B07AA1", "#FF9DA7", "#9C755F", "#BAB0AC",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
MAX_NODES_FOR_VIZ = 5_000
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _viz_node_limit() -> int:
|
|
77
|
+
"""Return the effective viz node limit, honoring GRAPHIFY_VIZ_NODE_LIMIT env var.
|
|
78
|
+
|
|
79
|
+
Falls back to MAX_NODES_FOR_VIZ when the env var is unset, empty, or non-integer.
|
|
80
|
+
Set to 0 to disable HTML viz unconditionally (useful for CI runners).
|
|
81
|
+
"""
|
|
82
|
+
import os
|
|
83
|
+
raw = os.environ.get("GRAPHIFY_VIZ_NODE_LIMIT")
|
|
84
|
+
if raw is None or not raw.strip():
|
|
85
|
+
return MAX_NODES_FOR_VIZ
|
|
86
|
+
try:
|
|
87
|
+
return int(raw)
|
|
88
|
+
except ValueError:
|
|
89
|
+
return MAX_NODES_FOR_VIZ
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _html_styles() -> str:
|
|
93
|
+
return """<style>
|
|
94
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
95
|
+
body { background: #0f0f1a; color: #e0e0e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; display: flex; height: 100vh; overflow: hidden; }
|
|
96
|
+
#graph { flex: 1; }
|
|
97
|
+
#sidebar { width: 280px; background: #1a1a2e; border-left: 1px solid #2a2a4e; display: flex; flex-direction: column; overflow: hidden; }
|
|
98
|
+
#search-wrap { padding: 12px; border-bottom: 1px solid #2a2a4e; }
|
|
99
|
+
#search { width: 100%; background: #0f0f1a; border: 1px solid #3a3a5e; color: #e0e0e0; padding: 7px 10px; border-radius: 6px; font-size: 13px; outline: none; }
|
|
100
|
+
#search:focus { border-color: #4E79A7; }
|
|
101
|
+
#search-results { max-height: 140px; overflow-y: auto; padding: 4px 12px; border-bottom: 1px solid #2a2a4e; display: none; }
|
|
102
|
+
.search-item { padding: 4px 6px; cursor: pointer; border-radius: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
103
|
+
.search-item:hover { background: #2a2a4e; }
|
|
104
|
+
#info-panel { padding: 14px; border-bottom: 1px solid #2a2a4e; min-height: 140px; }
|
|
105
|
+
#info-panel h3 { font-size: 13px; color: #aaa; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
106
|
+
#info-content { font-size: 13px; color: #ccc; line-height: 1.6; }
|
|
107
|
+
#info-content .field { margin-bottom: 5px; }
|
|
108
|
+
#info-content .field b { color: #e0e0e0; }
|
|
109
|
+
#info-content .empty { color: #555; font-style: italic; }
|
|
110
|
+
.neighbor-link { display: block; padding: 2px 6px; margin: 2px 0; border-radius: 3px; cursor: pointer; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #333; }
|
|
111
|
+
.neighbor-link:hover { background: #2a2a4e; }
|
|
112
|
+
#neighbors-list { max-height: 160px; overflow-y: auto; margin-top: 4px; }
|
|
113
|
+
#legend-wrap { flex: 1; overflow-y: auto; padding: 12px; }
|
|
114
|
+
#legend-wrap h3 { font-size: 13px; color: #aaa; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
115
|
+
.legend-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; border-radius: 4px; font-size: 12px; }
|
|
116
|
+
.legend-item:hover { background: #2a2a4e; padding-left: 4px; }
|
|
117
|
+
.legend-item.dimmed { opacity: 0.35; }
|
|
118
|
+
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
|
|
119
|
+
.legend-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
120
|
+
.legend-count { color: #666; font-size: 11px; }
|
|
121
|
+
#stats { padding: 10px 14px; border-top: 1px solid #2a2a4e; font-size: 11px; color: #555; }
|
|
122
|
+
#legend-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 4px 0; }
|
|
123
|
+
#legend-controls label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: #aaa; user-select: none; }
|
|
124
|
+
#legend-controls label:hover { color: #e0e0e0; }
|
|
125
|
+
.legend-cb, #select-all-cb { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; border: 1.5px solid #3a3a5e; border-radius: 3px; background: #0f0f1a; cursor: pointer; position: relative; flex-shrink: 0; }
|
|
126
|
+
.legend-cb:checked, #select-all-cb:checked { background: #4E79A7; border-color: #4E79A7; }
|
|
127
|
+
.legend-cb:checked::after, #select-all-cb:checked::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
|
|
128
|
+
#select-all-cb:indeterminate { background: #4E79A7; border-color: #4E79A7; }
|
|
129
|
+
#select-all-cb:indeterminate::after { content: ''; position: absolute; left: 2px; top: 5px; width: 8px; height: 2px; background: #fff; border: none; transform: none; }
|
|
130
|
+
</style>"""
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def _hyperedge_script(hyperedges_json: str) -> str:
|
|
134
|
+
return f"""<script>
|
|
135
|
+
// Render hyperedges as shaded regions
|
|
136
|
+
const hyperedges = {hyperedges_json};
|
|
137
|
+
// afterDrawing passes ctx already transformed to network coordinate space.
|
|
138
|
+
// Draw node positions raw — no manual pan/zoom/DPR math needed.
|
|
139
|
+
network.on('afterDrawing', function(ctx) {{
|
|
140
|
+
hyperedges.forEach(h => {{
|
|
141
|
+
const positions = h.nodes
|
|
142
|
+
.map(nid => network.getPositions([nid])[nid])
|
|
143
|
+
.filter(p => p !== undefined);
|
|
144
|
+
if (positions.length < 2) return;
|
|
145
|
+
ctx.save();
|
|
146
|
+
ctx.globalAlpha = 0.12;
|
|
147
|
+
ctx.fillStyle = '#6366f1';
|
|
148
|
+
ctx.strokeStyle = '#6366f1';
|
|
149
|
+
ctx.lineWidth = 2;
|
|
150
|
+
ctx.beginPath();
|
|
151
|
+
// Centroid and expanded hull in network coordinates
|
|
152
|
+
const cx = positions.reduce((s, p) => s + p.x, 0) / positions.length;
|
|
153
|
+
const cy = positions.reduce((s, p) => s + p.y, 0) / positions.length;
|
|
154
|
+
const expanded = positions.map(p => ({{
|
|
155
|
+
x: cx + (p.x - cx) * 1.15,
|
|
156
|
+
y: cy + (p.y - cy) * 1.15
|
|
157
|
+
}}));
|
|
158
|
+
ctx.moveTo(expanded[0].x, expanded[0].y);
|
|
159
|
+
expanded.slice(1).forEach(p => ctx.lineTo(p.x, p.y));
|
|
160
|
+
ctx.closePath();
|
|
161
|
+
ctx.fill();
|
|
162
|
+
ctx.globalAlpha = 0.4;
|
|
163
|
+
ctx.stroke();
|
|
164
|
+
// Label
|
|
165
|
+
ctx.globalAlpha = 0.8;
|
|
166
|
+
ctx.fillStyle = '#4f46e5';
|
|
167
|
+
ctx.font = 'bold 11px sans-serif';
|
|
168
|
+
ctx.textAlign = 'center';
|
|
169
|
+
ctx.fillText(h.label, cx, cy - 5);
|
|
170
|
+
ctx.restore();
|
|
171
|
+
}});
|
|
172
|
+
}});
|
|
173
|
+
</script>"""
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def _html_script(nodes_json: str, edges_json: str, legend_json: str) -> str:
|
|
177
|
+
return f"""<script>
|
|
178
|
+
const RAW_NODES = {nodes_json};
|
|
179
|
+
const RAW_EDGES = {edges_json};
|
|
180
|
+
const LEGEND = {legend_json};
|
|
181
|
+
|
|
182
|
+
// HTML-escape helper — prevents XSS when injecting graph data into innerHTML
|
|
183
|
+
function esc(s) {{
|
|
184
|
+
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');
|
|
185
|
+
}}
|
|
186
|
+
|
|
187
|
+
// Build vis datasets
|
|
188
|
+
const nodesDS = new vis.DataSet(RAW_NODES.map(n => ({{
|
|
189
|
+
id: n.id, label: n.label, color: n.color, size: n.size,
|
|
190
|
+
font: n.font, title: n.title,
|
|
191
|
+
_community: n.community, _community_name: n.community_name,
|
|
192
|
+
_source_file: n.source_file, _file_type: n.file_type, _degree: n.degree,
|
|
193
|
+
}})));
|
|
194
|
+
|
|
195
|
+
const edgesDS = new vis.DataSet(RAW_EDGES.map((e, i) => ({{
|
|
196
|
+
id: i, from: e.from, to: e.to,
|
|
197
|
+
label: '',
|
|
198
|
+
title: e.title,
|
|
199
|
+
dashes: e.dashes,
|
|
200
|
+
width: e.width,
|
|
201
|
+
color: e.color,
|
|
202
|
+
arrows: {{ to: {{ enabled: true, scaleFactor: 0.5 }} }},
|
|
203
|
+
}})));
|
|
204
|
+
|
|
205
|
+
const container = document.getElementById('graph');
|
|
206
|
+
const network = new vis.Network(container, {{ nodes: nodesDS, edges: edgesDS }}, {{
|
|
207
|
+
physics: {{
|
|
208
|
+
enabled: true,
|
|
209
|
+
solver: 'forceAtlas2Based',
|
|
210
|
+
forceAtlas2Based: {{
|
|
211
|
+
gravitationalConstant: -60,
|
|
212
|
+
centralGravity: 0.005,
|
|
213
|
+
springLength: 120,
|
|
214
|
+
springConstant: 0.08,
|
|
215
|
+
damping: 0.4,
|
|
216
|
+
avoidOverlap: 0.8,
|
|
217
|
+
}},
|
|
218
|
+
stabilization: {{ iterations: 200, fit: true }},
|
|
219
|
+
}},
|
|
220
|
+
interaction: {{
|
|
221
|
+
hover: true,
|
|
222
|
+
tooltipDelay: 100,
|
|
223
|
+
hideEdgesOnDrag: true,
|
|
224
|
+
navigationButtons: false,
|
|
225
|
+
keyboard: false,
|
|
226
|
+
}},
|
|
227
|
+
nodes: {{ shape: 'dot', borderWidth: 1.5 }},
|
|
228
|
+
edges: {{ smooth: {{ type: 'continuous', roundness: 0.2 }}, selectionWidth: 3 }},
|
|
229
|
+
}});
|
|
230
|
+
|
|
231
|
+
network.once('stabilizationIterationsDone', () => {{
|
|
232
|
+
network.setOptions({{ physics: {{ enabled: false }} }});
|
|
233
|
+
}});
|
|
234
|
+
|
|
235
|
+
function showInfo(nodeId) {{
|
|
236
|
+
const n = nodesDS.get(nodeId);
|
|
237
|
+
if (!n) return;
|
|
238
|
+
const neighborIds = network.getConnectedNodes(nodeId);
|
|
239
|
+
const neighborItems = neighborIds.map(nid => {{
|
|
240
|
+
const nb = nodesDS.get(nid);
|
|
241
|
+
const color = nb ? nb.color.background : '#555';
|
|
242
|
+
return `<span class="neighbor-link" style="border-left-color:${{esc(color)}}" onclick="focusNode(${{JSON.stringify(nid)}})">${{esc(nb ? nb.label : nid)}}</span>`;
|
|
243
|
+
}}).join('');
|
|
244
|
+
document.getElementById('info-content').innerHTML = `
|
|
245
|
+
<div class="field"><b>${{esc(n.label)}}</b></div>
|
|
246
|
+
<div class="field">Type: ${{esc(n._file_type || 'unknown')}}</div>
|
|
247
|
+
<div class="field">Community: ${{esc(n._community_name)}}</div>
|
|
248
|
+
<div class="field">Source: ${{esc(n._source_file || '-')}}</div>
|
|
249
|
+
<div class="field">Degree: ${{n._degree}}</div>
|
|
250
|
+
${{neighborIds.length ? `<div class="field" style="margin-top:8px;color:#aaa;font-size:11px">Neighbors (${{neighborIds.length}})</div><div id="neighbors-list">${{neighborItems}}</div>` : ''}}
|
|
251
|
+
`;
|
|
252
|
+
}}
|
|
253
|
+
|
|
254
|
+
function focusNode(nodeId) {{
|
|
255
|
+
network.focus(nodeId, {{ scale: 1.4, animation: true }});
|
|
256
|
+
network.selectNodes([nodeId]);
|
|
257
|
+
showInfo(nodeId);
|
|
258
|
+
}}
|
|
259
|
+
|
|
260
|
+
// Track hovered node — hover detection is more reliable than click params
|
|
261
|
+
let hoveredNodeId = null;
|
|
262
|
+
network.on('hoverNode', params => {{
|
|
263
|
+
hoveredNodeId = params.node;
|
|
264
|
+
container.style.cursor = 'pointer';
|
|
265
|
+
}});
|
|
266
|
+
network.on('blurNode', () => {{
|
|
267
|
+
hoveredNodeId = null;
|
|
268
|
+
container.style.cursor = 'default';
|
|
269
|
+
}});
|
|
270
|
+
container.addEventListener('click', () => {{
|
|
271
|
+
if (hoveredNodeId !== null) {{
|
|
272
|
+
showInfo(hoveredNodeId);
|
|
273
|
+
network.selectNodes([hoveredNodeId]);
|
|
274
|
+
}}
|
|
275
|
+
}});
|
|
276
|
+
network.on('click', params => {{
|
|
277
|
+
if (params.nodes.length > 0) {{
|
|
278
|
+
showInfo(params.nodes[0]);
|
|
279
|
+
}} else if (hoveredNodeId === null) {{
|
|
280
|
+
document.getElementById('info-content').innerHTML = '<span class="empty">Click a node to inspect it</span>';
|
|
281
|
+
}}
|
|
282
|
+
}});
|
|
283
|
+
|
|
284
|
+
const searchInput = document.getElementById('search');
|
|
285
|
+
const searchResults = document.getElementById('search-results');
|
|
286
|
+
searchInput.addEventListener('input', () => {{
|
|
287
|
+
const q = searchInput.value.toLowerCase().trim();
|
|
288
|
+
searchResults.innerHTML = '';
|
|
289
|
+
if (!q) {{ searchResults.style.display = 'none'; return; }}
|
|
290
|
+
const matches = RAW_NODES.filter(n => n.label.toLowerCase().includes(q)).slice(0, 20);
|
|
291
|
+
if (!matches.length) {{ searchResults.style.display = 'none'; return; }}
|
|
292
|
+
searchResults.style.display = 'block';
|
|
293
|
+
matches.forEach(n => {{
|
|
294
|
+
const el = document.createElement('div');
|
|
295
|
+
el.className = 'search-item';
|
|
296
|
+
el.textContent = n.label;
|
|
297
|
+
el.style.borderLeft = `3px solid ${{n.color.background}}`;
|
|
298
|
+
el.style.paddingLeft = '8px';
|
|
299
|
+
el.onclick = () => {{
|
|
300
|
+
network.focus(n.id, {{ scale: 1.5, animation: true }});
|
|
301
|
+
network.selectNodes([n.id]);
|
|
302
|
+
showInfo(n.id);
|
|
303
|
+
searchResults.style.display = 'none';
|
|
304
|
+
searchInput.value = '';
|
|
305
|
+
}};
|
|
306
|
+
searchResults.appendChild(el);
|
|
307
|
+
}});
|
|
308
|
+
}});
|
|
309
|
+
document.addEventListener('click', e => {{
|
|
310
|
+
if (!searchResults.contains(e.target) && e.target !== searchInput)
|
|
311
|
+
searchResults.style.display = 'none';
|
|
312
|
+
}});
|
|
313
|
+
|
|
314
|
+
const hiddenCommunities = new Set();
|
|
315
|
+
|
|
316
|
+
const selectAllCb = document.getElementById('select-all-cb');
|
|
317
|
+
|
|
318
|
+
function updateSelectAllState() {{
|
|
319
|
+
const total = LEGEND.length;
|
|
320
|
+
const hidden = hiddenCommunities.size;
|
|
321
|
+
selectAllCb.checked = hidden === 0;
|
|
322
|
+
selectAllCb.indeterminate = hidden > 0 && hidden < total;
|
|
323
|
+
}}
|
|
324
|
+
|
|
325
|
+
function toggleAllCommunities(hide) {{
|
|
326
|
+
document.querySelectorAll('.legend-item').forEach(item => {{
|
|
327
|
+
hide ? item.classList.add('dimmed') : item.classList.remove('dimmed');
|
|
328
|
+
}});
|
|
329
|
+
document.querySelectorAll('.legend-cb').forEach(cb => {{
|
|
330
|
+
cb.checked = !hide;
|
|
331
|
+
}});
|
|
332
|
+
LEGEND.forEach(c => {{
|
|
333
|
+
if (hide) hiddenCommunities.add(c.cid); else hiddenCommunities.delete(c.cid);
|
|
334
|
+
}});
|
|
335
|
+
const updates = RAW_NODES.map(n => ({{ id: n.id, hidden: hide }}));
|
|
336
|
+
nodesDS.update(updates);
|
|
337
|
+
updateSelectAllState();
|
|
338
|
+
}}
|
|
339
|
+
|
|
340
|
+
const legendEl = document.getElementById('legend');
|
|
341
|
+
LEGEND.forEach(c => {{
|
|
342
|
+
const item = document.createElement('div');
|
|
343
|
+
item.className = 'legend-item';
|
|
344
|
+
const cb = document.createElement('input');
|
|
345
|
+
cb.type = 'checkbox';
|
|
346
|
+
cb.className = 'legend-cb';
|
|
347
|
+
cb.checked = true;
|
|
348
|
+
cb.addEventListener('change', (e) => {{
|
|
349
|
+
e.stopPropagation();
|
|
350
|
+
if (cb.checked) {{
|
|
351
|
+
hiddenCommunities.delete(c.cid);
|
|
352
|
+
item.classList.remove('dimmed');
|
|
353
|
+
}} else {{
|
|
354
|
+
hiddenCommunities.add(c.cid);
|
|
355
|
+
item.classList.add('dimmed');
|
|
356
|
+
}}
|
|
357
|
+
const updates = RAW_NODES
|
|
358
|
+
.filter(n => n.community === c.cid)
|
|
359
|
+
.map(n => ({{ id: n.id, hidden: !cb.checked }}));
|
|
360
|
+
nodesDS.update(updates);
|
|
361
|
+
updateSelectAllState();
|
|
362
|
+
}});
|
|
363
|
+
item.innerHTML = `<div class="legend-dot" style="background:${{c.color}}"></div>
|
|
364
|
+
<span class="legend-label">${{c.label}}</span>
|
|
365
|
+
<span class="legend-count">${{c.count}}</span>`;
|
|
366
|
+
item.prepend(cb);
|
|
367
|
+
item.onclick = (e) => {{
|
|
368
|
+
if (e.target === cb) return;
|
|
369
|
+
cb.checked = !cb.checked;
|
|
370
|
+
cb.dispatchEvent(new Event('change'));
|
|
371
|
+
}};
|
|
372
|
+
legendEl.appendChild(item);
|
|
373
|
+
}});
|
|
374
|
+
</script>"""
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
_CONFIDENCE_SCORE_DEFAULTS = {"EXTRACTED": 1.0, "INFERRED": 0.5, "AMBIGUOUS": 0.2}
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
def attach_hyperedges(G: nx.Graph, hyperedges: list) -> None:
|
|
381
|
+
"""Store hyperedges in the graph's metadata dict."""
|
|
382
|
+
existing = G.graph.get("hyperedges", [])
|
|
383
|
+
seen_ids = {h["id"] for h in existing}
|
|
384
|
+
for h in hyperedges:
|
|
385
|
+
if h.get("id") and h["id"] not in seen_ids:
|
|
386
|
+
existing.append(h)
|
|
387
|
+
seen_ids.add(h["id"])
|
|
388
|
+
G.graph["hyperedges"] = existing
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
def _git_head() -> str | None:
|
|
392
|
+
"""Return the current git HEAD commit hash, or None if not in a git repo."""
|
|
393
|
+
import subprocess as _sp
|
|
394
|
+
try:
|
|
395
|
+
r = _sp.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, timeout=3)
|
|
396
|
+
return r.stdout.strip() if r.returncode == 0 else None
|
|
397
|
+
except Exception:
|
|
398
|
+
return None
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def to_json(G: nx.Graph, communities: dict[int, list[str]], output_path: str, *, force: bool = False, built_at_commit: str | None = None) -> bool:
|
|
402
|
+
# Safety check: refuse to silently shrink an existing graph (#479)
|
|
403
|
+
existing_path = Path(output_path)
|
|
404
|
+
if not force and existing_path.exists():
|
|
405
|
+
try:
|
|
406
|
+
existing_data = json.loads(existing_path.read_text(encoding="utf-8"))
|
|
407
|
+
existing_n = len(existing_data.get("nodes", []))
|
|
408
|
+
new_n = G.number_of_nodes()
|
|
409
|
+
if new_n < existing_n:
|
|
410
|
+
import sys as _sys
|
|
411
|
+
print(
|
|
412
|
+
f"[graphify] WARNING: new graph has {new_n} nodes but existing "
|
|
413
|
+
f"graph.json has {existing_n}. Refusing to overwrite — you may be "
|
|
414
|
+
f"missing chunk files from a previous session. "
|
|
415
|
+
f"Pass force=True to override.",
|
|
416
|
+
file=_sys.stderr,
|
|
417
|
+
)
|
|
418
|
+
return False
|
|
419
|
+
except Exception:
|
|
420
|
+
pass # unreadable existing file — proceed with write
|
|
421
|
+
|
|
422
|
+
node_community = _node_community_map(communities)
|
|
423
|
+
try:
|
|
424
|
+
data = json_graph.node_link_data(G, edges="links")
|
|
425
|
+
except TypeError:
|
|
426
|
+
data = json_graph.node_link_data(G)
|
|
427
|
+
for node in data["nodes"]:
|
|
428
|
+
node["community"] = node_community.get(node["id"])
|
|
429
|
+
node["norm_label"] = _strip_diacritics(node.get("label", "")).lower()
|
|
430
|
+
for link in data["links"]:
|
|
431
|
+
if "confidence_score" not in link:
|
|
432
|
+
conf = link.get("confidence", "EXTRACTED")
|
|
433
|
+
link["confidence_score"] = _CONFIDENCE_SCORE_DEFAULTS.get(conf, 1.0)
|
|
434
|
+
# Restore original edge direction. Undirected NetworkX storage may
|
|
435
|
+
# canonicalize endpoint order, flipping `calls` and other directional
|
|
436
|
+
# edges in graph.json. The build path stashes the true endpoints in
|
|
437
|
+
# _src/_tgt for exactly this purpose (#563).
|
|
438
|
+
true_src = link.pop("_src", None)
|
|
439
|
+
true_tgt = link.pop("_tgt", None)
|
|
440
|
+
if true_src is not None and true_tgt is not None:
|
|
441
|
+
link["source"] = true_src
|
|
442
|
+
link["target"] = true_tgt
|
|
443
|
+
data["hyperedges"] = getattr(G, "graph", {}).get("hyperedges", [])
|
|
444
|
+
commit = built_at_commit if built_at_commit is not None else _git_head()
|
|
445
|
+
if commit:
|
|
446
|
+
data["built_at_commit"] = commit
|
|
447
|
+
with open(output_path, "w", encoding="utf-8") as f: # nosec
|
|
448
|
+
json.dump(data, f, indent=2)
|
|
449
|
+
return True
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
def prune_dangling_edges(graph_data: dict) -> tuple[dict, int]:
|
|
453
|
+
"""Remove edges whose source or target node is not in the node set.
|
|
454
|
+
|
|
455
|
+
Returns the cleaned graph_data dict and the number of pruned edges.
|
|
456
|
+
"""
|
|
457
|
+
node_ids = {n["id"] for n in graph_data["nodes"]}
|
|
458
|
+
links_key = "links" if "links" in graph_data else "edges"
|
|
459
|
+
before = len(graph_data[links_key])
|
|
460
|
+
graph_data[links_key] = [
|
|
461
|
+
e for e in graph_data[links_key]
|
|
462
|
+
if e["source"] in node_ids and e["target"] in node_ids
|
|
463
|
+
]
|
|
464
|
+
return graph_data, before - len(graph_data[links_key])
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def _cypher_escape(s: str) -> str:
|
|
468
|
+
"""Escape a string for safe embedding in a Cypher single-quoted literal.
|
|
469
|
+
|
|
470
|
+
Handles all characters that could prematurely terminate the literal or
|
|
471
|
+
inject control sequences:
|
|
472
|
+
- `\\` and `'` (literal terminators)
|
|
473
|
+
- newlines/CRs (would break the per-line statement framing)
|
|
474
|
+
- NUL/control bytes (defensive — Neo4j errors on raw NULs)
|
|
475
|
+
|
|
476
|
+
Also strips any leading/trailing whitespace that would let an attacker
|
|
477
|
+
break the `;`-terminated statement boundary used by `cypher-shell`.
|
|
478
|
+
Closing `}` and `)` are NOT special inside a single-quoted Cypher string,
|
|
479
|
+
so escaping the quote and backslash correctly is sufficient (a `}` inside
|
|
480
|
+
a properly-closed `'...'` literal is just a character) — but we previously
|
|
481
|
+
missed `\\n` / `\\r` which DO let a payload break out of the statement
|
|
482
|
+
line and inject a fresh MATCH/DELETE on the following line. See F-008.
|
|
483
|
+
"""
|
|
484
|
+
# First normalise: drop NUL and other C0 control chars except tab.
|
|
485
|
+
s = "".join(ch for ch in s if ch >= " " or ch == "\t")
|
|
486
|
+
return (
|
|
487
|
+
s.replace("\\", "\\\\")
|
|
488
|
+
.replace("'", "\\'")
|
|
489
|
+
.replace("\n", "\\n")
|
|
490
|
+
.replace("\r", "\\r")
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
# Restrict identifier-position values (labels and relationship types are NOT
|
|
495
|
+
# quoted in Cypher and so cannot be safely escaped — they must be allowlisted).
|
|
496
|
+
_CYPHER_IDENT_RE = re.compile(r"[^A-Za-z0-9_]")
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
def _cypher_label(raw: str, fallback: str) -> str:
|
|
500
|
+
"""Sanitise a value used in identifier position (node label / rel type).
|
|
501
|
+
|
|
502
|
+
Cypher does not provide a way to escape `:Foo` label syntax, so we must
|
|
503
|
+
strip everything except `[A-Za-z0-9_]` and require the result to start
|
|
504
|
+
with a letter; otherwise we fall back to a safe constant.
|
|
505
|
+
"""
|
|
506
|
+
cleaned = _CYPHER_IDENT_RE.sub("", raw or "")
|
|
507
|
+
if not cleaned or not cleaned[0].isalpha():
|
|
508
|
+
return fallback
|
|
509
|
+
return cleaned
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
def to_cypher(G: nx.Graph, output_path: str) -> None:
|
|
513
|
+
lines = ["// Neo4j Cypher import - generated by /graphify", ""]
|
|
514
|
+
for node_id, data in G.nodes(data=True):
|
|
515
|
+
label = _cypher_escape(data.get("label", node_id))
|
|
516
|
+
node_id_esc = _cypher_escape(node_id)
|
|
517
|
+
ftype = _cypher_label(
|
|
518
|
+
(data.get("file_type", "unknown") or "unknown").capitalize(),
|
|
519
|
+
"Entity",
|
|
520
|
+
)
|
|
521
|
+
lines.append(f"MERGE (n:{ftype} {{id: '{node_id_esc}', label: '{label}'}});")
|
|
522
|
+
lines.append("")
|
|
523
|
+
for u, v, data in G.edges(data=True):
|
|
524
|
+
rel = _cypher_label(
|
|
525
|
+
(data.get("relation", "RELATES_TO") or "RELATES_TO").upper(),
|
|
526
|
+
"RELATES_TO",
|
|
527
|
+
)
|
|
528
|
+
conf = _cypher_escape(data.get("confidence", "EXTRACTED"))
|
|
529
|
+
u_esc = _cypher_escape(u)
|
|
530
|
+
v_esc = _cypher_escape(v)
|
|
531
|
+
lines.append(
|
|
532
|
+
f"MATCH (a {{id: '{u_esc}'}}), (b {{id: '{v_esc}'}}) "
|
|
533
|
+
f"MERGE (a)-[:{rel} {{confidence: '{conf}'}}]->(b);"
|
|
534
|
+
)
|
|
535
|
+
with open(output_path, "w", encoding="utf-8") as f: # nosec
|
|
536
|
+
f.write("\n".join(lines))
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
def to_html(
|
|
540
|
+
G: nx.Graph,
|
|
541
|
+
communities: dict[int, list[str]],
|
|
542
|
+
output_path: str,
|
|
543
|
+
community_labels: dict[int, str] | None = None,
|
|
544
|
+
member_counts: dict[int, int] | None = None,
|
|
545
|
+
node_limit: int | None = None,
|
|
546
|
+
) -> None:
|
|
547
|
+
"""Generate an interactive vis.js HTML visualization of the graph.
|
|
548
|
+
|
|
549
|
+
Features: node size by degree, click-to-inspect panel, search box,
|
|
550
|
+
community filter, physics clustering by community, confidence-styled edges.
|
|
551
|
+
Raises ValueError if graph exceeds MAX_NODES_FOR_VIZ.
|
|
552
|
+
|
|
553
|
+
If member_counts is provided (aggregated community view), node sizes are
|
|
554
|
+
based on community member counts rather than graph degree.
|
|
555
|
+
|
|
556
|
+
If node_limit is set and the graph exceeds it, automatically builds an
|
|
557
|
+
aggregated community-level meta-graph instead of raising ValueError.
|
|
558
|
+
"""
|
|
559
|
+
limit = node_limit if node_limit is not None else _viz_node_limit()
|
|
560
|
+
if G.number_of_nodes() > limit:
|
|
561
|
+
if node_limit is not None:
|
|
562
|
+
# Build aggregated community meta-graph
|
|
563
|
+
from collections import Counter as _Counter
|
|
564
|
+
import networkx as _nx
|
|
565
|
+
print(f"Graph has {G.number_of_nodes()} nodes (above {limit} limit). Building aggregated community view...")
|
|
566
|
+
node_to_community = {nid: cid for cid, members in communities.items() for nid in members}
|
|
567
|
+
meta = _nx.Graph()
|
|
568
|
+
for cid, members in communities.items():
|
|
569
|
+
meta.add_node(str(cid), label=(community_labels or {}).get(cid, f"Community {cid}"))
|
|
570
|
+
edge_counts = _Counter()
|
|
571
|
+
for u, v in G.edges():
|
|
572
|
+
cu, cv = node_to_community.get(u), node_to_community.get(v)
|
|
573
|
+
if cu is not None and cv is not None and cu != cv:
|
|
574
|
+
edge_counts[(min(cu, cv), max(cu, cv))] += 1
|
|
575
|
+
for (cu, cv), w in edge_counts.items():
|
|
576
|
+
meta.add_edge(str(cu), str(cv), weight=w,
|
|
577
|
+
relation=f"{w} cross-community edges", confidence="AGGREGATED")
|
|
578
|
+
if meta.number_of_nodes() <= 1:
|
|
579
|
+
print("Single community - aggregated view not useful. Skipping graph.html.")
|
|
580
|
+
return
|
|
581
|
+
meta_communities = {cid: [str(cid)] for cid in communities}
|
|
582
|
+
mc = {cid: len(members) for cid, members in communities.items()}
|
|
583
|
+
to_html(meta, meta_communities, output_path,
|
|
584
|
+
community_labels=community_labels, member_counts=mc)
|
|
585
|
+
print(f"graph.html written (aggregated: {meta.number_of_nodes()} community nodes, {meta.number_of_edges()} cross-community edges)")
|
|
586
|
+
print("Tip: run with --obsidian for full node-level detail.")
|
|
587
|
+
return
|
|
588
|
+
raise ValueError(
|
|
589
|
+
f"Graph has {G.number_of_nodes()} nodes - too large for HTML viz "
|
|
590
|
+
f"(limit: {limit}). Use --no-viz, raise GRAPHIFY_VIZ_NODE_LIMIT, "
|
|
591
|
+
f"or reduce input size."
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
node_community = _node_community_map(communities)
|
|
595
|
+
degree = dict(G.degree())
|
|
596
|
+
max_deg = max(degree.values(), default=1) or 1
|
|
597
|
+
max_mc = (max(member_counts.values(), default=1) or 1) if member_counts else 1
|
|
598
|
+
|
|
599
|
+
# Build nodes list for vis.js
|
|
600
|
+
vis_nodes = []
|
|
601
|
+
for node_id, data in G.nodes(data=True):
|
|
602
|
+
cid = node_community.get(node_id, 0)
|
|
603
|
+
color = COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)]
|
|
604
|
+
label = sanitize_label(data.get("label", node_id))
|
|
605
|
+
deg = degree.get(node_id, 1)
|
|
606
|
+
if member_counts:
|
|
607
|
+
mc = member_counts.get(cid, 1)
|
|
608
|
+
size = 10 + 30 * (mc / max_mc)
|
|
609
|
+
font_size = 12
|
|
610
|
+
else:
|
|
611
|
+
size = 10 + 30 * (deg / max_deg)
|
|
612
|
+
# Only show label for high-degree nodes by default; others show on hover
|
|
613
|
+
font_size = 12 if deg >= max_deg * 0.15 else 0
|
|
614
|
+
vis_nodes.append({
|
|
615
|
+
"id": node_id,
|
|
616
|
+
"label": label,
|
|
617
|
+
"color": {"background": color, "border": color, "highlight": {"background": "#ffffff", "border": color}},
|
|
618
|
+
"size": round(size, 1),
|
|
619
|
+
"font": {"size": font_size, "color": "#ffffff"},
|
|
620
|
+
"title": _html.escape(label),
|
|
621
|
+
"community": cid,
|
|
622
|
+
"community_name": sanitize_label((community_labels or {}).get(cid, f"Community {cid}")),
|
|
623
|
+
"source_file": sanitize_label(str(data.get("source_file") or "")),
|
|
624
|
+
"file_type": data.get("file_type", ""),
|
|
625
|
+
"degree": deg,
|
|
626
|
+
})
|
|
627
|
+
|
|
628
|
+
# Build edges list. Restore original edge direction from _src/_tgt
|
|
629
|
+
# (stashed by build.py for exactly this reason): undirected NetworkX
|
|
630
|
+
# canonicalizes endpoint order, which would otherwise flip the arrow
|
|
631
|
+
# for `calls` and `rationale_for` in the rendered graph (#563).
|
|
632
|
+
vis_edges = []
|
|
633
|
+
for u, v, data in G.edges(data=True):
|
|
634
|
+
confidence = data.get("confidence", "EXTRACTED")
|
|
635
|
+
relation = data.get("relation", "")
|
|
636
|
+
true_src = data.get("_src", u)
|
|
637
|
+
true_tgt = data.get("_tgt", v)
|
|
638
|
+
vis_edges.append({
|
|
639
|
+
"from": true_src,
|
|
640
|
+
"to": true_tgt,
|
|
641
|
+
"label": relation,
|
|
642
|
+
"title": _html.escape(f"{relation} [{confidence}]"),
|
|
643
|
+
"dashes": confidence != "EXTRACTED",
|
|
644
|
+
"width": 2 if confidence == "EXTRACTED" else 1,
|
|
645
|
+
"color": {"opacity": 0.7 if confidence == "EXTRACTED" else 0.35},
|
|
646
|
+
"confidence": confidence,
|
|
647
|
+
})
|
|
648
|
+
|
|
649
|
+
# Build community legend data
|
|
650
|
+
legend_data = []
|
|
651
|
+
for cid in sorted((community_labels or {}).keys()):
|
|
652
|
+
color = COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)]
|
|
653
|
+
lbl = _html.escape(sanitize_label((community_labels or {}).get(cid, f"Community {cid}")))
|
|
654
|
+
n = member_counts.get(cid, len(communities.get(cid, []))) if member_counts else len(communities.get(cid, []))
|
|
655
|
+
legend_data.append({"cid": cid, "color": color, "label": lbl, "count": n})
|
|
656
|
+
|
|
657
|
+
# Escape </script> sequences so embedded JSON cannot break out of the script tag
|
|
658
|
+
def _js_safe(obj) -> str:
|
|
659
|
+
return json.dumps(obj).replace("</", "<\\/")
|
|
660
|
+
|
|
661
|
+
nodes_json = _js_safe(vis_nodes)
|
|
662
|
+
edges_json = _js_safe(vis_edges)
|
|
663
|
+
legend_json = _js_safe(legend_data)
|
|
664
|
+
hyperedges_json = _js_safe(getattr(G, "graph", {}).get("hyperedges", []))
|
|
665
|
+
title = _html.escape(sanitize_label(str(output_path)))
|
|
666
|
+
stats = f"{G.number_of_nodes()} nodes · {G.number_of_edges()} edges · {len(communities)} communities"
|
|
667
|
+
|
|
668
|
+
html = f"""<!DOCTYPE html>
|
|
669
|
+
<html lang="en">
|
|
670
|
+
<head>
|
|
671
|
+
<meta charset="UTF-8">
|
|
672
|
+
<title>graphify - {title}</title>
|
|
673
|
+
<script src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script>
|
|
674
|
+
{_html_styles()}
|
|
675
|
+
</head>
|
|
676
|
+
<body>
|
|
677
|
+
<div id="graph"></div>
|
|
678
|
+
<div id="sidebar">
|
|
679
|
+
<div id="search-wrap">
|
|
680
|
+
<input id="search" type="text" placeholder="Search nodes..." autocomplete="off">
|
|
681
|
+
<div id="search-results"></div>
|
|
682
|
+
</div>
|
|
683
|
+
<div id="info-panel">
|
|
684
|
+
<h3>Node Info</h3>
|
|
685
|
+
<div id="info-content"><span class="empty">Click a node to inspect it</span></div>
|
|
686
|
+
</div>
|
|
687
|
+
<div id="legend-wrap">
|
|
688
|
+
<h3>Communities</h3>
|
|
689
|
+
<div id="legend-controls">
|
|
690
|
+
<label><input type="checkbox" id="select-all-cb" checked onchange="toggleAllCommunities(!this.checked)">Select All</label>
|
|
691
|
+
</div>
|
|
692
|
+
<div id="legend"></div>
|
|
693
|
+
</div>
|
|
694
|
+
<div id="stats">{stats}</div>
|
|
695
|
+
</div>
|
|
696
|
+
{_html_script(nodes_json, edges_json, legend_json)}
|
|
697
|
+
{_hyperedge_script(hyperedges_json)}
|
|
698
|
+
</body>
|
|
699
|
+
</html>"""
|
|
700
|
+
|
|
701
|
+
Path(output_path).write_text(html, encoding="utf-8") # nosec
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
# Keep backward-compatible alias - skill.md calls generate_html
|
|
705
|
+
generate_html = to_html
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
def to_obsidian(
|
|
709
|
+
G: nx.Graph,
|
|
710
|
+
communities: dict[int, list[str]],
|
|
711
|
+
output_dir: str,
|
|
712
|
+
community_labels: dict[int, str] | None = None,
|
|
713
|
+
cohesion: dict[int, float] | None = None,
|
|
714
|
+
) -> int:
|
|
715
|
+
"""Export graph as an Obsidian vault - one .md file per node with [[wikilinks]],
|
|
716
|
+
plus one _COMMUNITY_name.md overview note per community (sorted to top by underscore prefix).
|
|
717
|
+
|
|
718
|
+
Open the output directory as a vault in Obsidian to get an interactive
|
|
719
|
+
graph view with community colors and full-text search over node metadata.
|
|
720
|
+
|
|
721
|
+
Returns the number of node notes + community notes written.
|
|
722
|
+
"""
|
|
723
|
+
out = Path(output_dir)
|
|
724
|
+
out.mkdir(parents=True, exist_ok=True)
|
|
725
|
+
|
|
726
|
+
node_community = _node_community_map(communities)
|
|
727
|
+
|
|
728
|
+
# Map node_id → safe filename so wikilinks stay consistent.
|
|
729
|
+
# Deduplicate: if two nodes produce the same filename, append a numeric suffix.
|
|
730
|
+
def safe_name(label: str) -> str:
|
|
731
|
+
cleaned = re.sub(r'[\\/*?:"<>|#^[\]]', "", label.replace("\r\n", " ").replace("\r", " ").replace("\n", " ")).strip()
|
|
732
|
+
# Strip trailing .md/.mdx/.markdown so "CLAUDE.md" doesn't become "CLAUDE.md.md"
|
|
733
|
+
cleaned = re.sub(r"\.(md|mdx|qmd|markdown)$", "", cleaned, flags=re.IGNORECASE)
|
|
734
|
+
return cleaned or "unnamed"
|
|
735
|
+
|
|
736
|
+
node_filename: dict[str, str] = {}
|
|
737
|
+
seen_names: dict[str, int] = {}
|
|
738
|
+
for node_id, data in G.nodes(data=True):
|
|
739
|
+
base = safe_name(data.get("label", node_id))
|
|
740
|
+
if base in seen_names:
|
|
741
|
+
seen_names[base] += 1
|
|
742
|
+
node_filename[node_id] = f"{base}_{seen_names[base]}"
|
|
743
|
+
else:
|
|
744
|
+
seen_names[base] = 0
|
|
745
|
+
node_filename[node_id] = base
|
|
746
|
+
|
|
747
|
+
# Helper: compute dominant confidence for a node across all its edges
|
|
748
|
+
def _dominant_confidence(node_id: str) -> str:
|
|
749
|
+
confs = []
|
|
750
|
+
for u, v, edata in G.edges(node_id, data=True):
|
|
751
|
+
confs.append(edata.get("confidence", "EXTRACTED"))
|
|
752
|
+
if not confs:
|
|
753
|
+
return "EXTRACTED"
|
|
754
|
+
return Counter(confs).most_common(1)[0][0]
|
|
755
|
+
|
|
756
|
+
# Map file_type → graphify tag
|
|
757
|
+
_FTYPE_TAG = {
|
|
758
|
+
"code": "graphify/code",
|
|
759
|
+
"document": "graphify/document",
|
|
760
|
+
"paper": "graphify/paper",
|
|
761
|
+
"image": "graphify/image",
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
# Write one .md file per node
|
|
765
|
+
for node_id, data in G.nodes(data=True):
|
|
766
|
+
label = data.get("label", node_id)
|
|
767
|
+
cid = node_community.get(node_id)
|
|
768
|
+
community_name = (
|
|
769
|
+
community_labels.get(cid, f"Community {cid}")
|
|
770
|
+
if community_labels and cid is not None
|
|
771
|
+
else f"Community {cid}"
|
|
772
|
+
)
|
|
773
|
+
|
|
774
|
+
# Build tags for this node
|
|
775
|
+
ftype = data.get("file_type", "")
|
|
776
|
+
ftype_tag = _FTYPE_TAG.get(ftype, f"graphify/{ftype}" if ftype else "graphify/document")
|
|
777
|
+
dom_conf = _dominant_confidence(node_id)
|
|
778
|
+
conf_tag = f"graphify/{dom_conf}"
|
|
779
|
+
comm_tag = f"community/{_obsidian_tag(community_name)}"
|
|
780
|
+
node_tags = [ftype_tag, conf_tag, comm_tag]
|
|
781
|
+
|
|
782
|
+
lines: list[str] = []
|
|
783
|
+
|
|
784
|
+
# YAML frontmatter - readable in Obsidian's properties panel.
|
|
785
|
+
# All scalars pass through _yaml_str so a hostile source_file or
|
|
786
|
+
# community label cannot break out and inject sibling keys (F-009).
|
|
787
|
+
lines += [
|
|
788
|
+
"---",
|
|
789
|
+
f'source_file: "{_yaml_str(data.get("source_file", ""))}"',
|
|
790
|
+
f'type: "{_yaml_str(ftype)}"',
|
|
791
|
+
f'community: "{_yaml_str(community_name)}"',
|
|
792
|
+
]
|
|
793
|
+
if data.get("source_location"):
|
|
794
|
+
lines.append(f'location: "{_yaml_str(str(data["source_location"]))}"')
|
|
795
|
+
# Add tags list to frontmatter
|
|
796
|
+
lines.append("tags:")
|
|
797
|
+
for tag in node_tags:
|
|
798
|
+
lines.append(f" - {tag}")
|
|
799
|
+
lines += ["---", "", f"# {label}", ""]
|
|
800
|
+
|
|
801
|
+
# Outgoing edges as wikilinks
|
|
802
|
+
neighbors = list(G.neighbors(node_id))
|
|
803
|
+
if neighbors:
|
|
804
|
+
lines.append("## Connections")
|
|
805
|
+
for neighbor in sorted(neighbors, key=lambda n: G.nodes[n].get("label", n)):
|
|
806
|
+
edata = edge_data(G, node_id, neighbor)
|
|
807
|
+
neighbor_label = node_filename[neighbor]
|
|
808
|
+
relation = edata.get("relation", "")
|
|
809
|
+
confidence = edata.get("confidence", "EXTRACTED")
|
|
810
|
+
lines.append(f"- [[{neighbor_label}]] - `{relation}` [{confidence}]")
|
|
811
|
+
lines.append("")
|
|
812
|
+
|
|
813
|
+
# Inline tags at bottom of note body (for Obsidian tag panel)
|
|
814
|
+
inline_tags = " ".join(f"#{t}" for t in node_tags)
|
|
815
|
+
lines.append(inline_tags)
|
|
816
|
+
|
|
817
|
+
fname = node_filename[node_id] + ".md"
|
|
818
|
+
(out / fname).write_text("\n".join(lines), encoding="utf-8") # nosec
|
|
819
|
+
|
|
820
|
+
# Write one _COMMUNITY_name.md overview note per community
|
|
821
|
+
# Build inter-community edge counts for "Connections to other communities"
|
|
822
|
+
inter_community_edges: dict[int, dict[int, int]] = {}
|
|
823
|
+
for cid in communities:
|
|
824
|
+
inter_community_edges[cid] = {}
|
|
825
|
+
for u, v in G.edges():
|
|
826
|
+
cu = node_community.get(u)
|
|
827
|
+
cv = node_community.get(v)
|
|
828
|
+
if cu is not None and cv is not None and cu != cv:
|
|
829
|
+
inter_community_edges.setdefault(cu, {})
|
|
830
|
+
inter_community_edges.setdefault(cv, {})
|
|
831
|
+
inter_community_edges[cu][cv] = inter_community_edges[cu].get(cv, 0) + 1
|
|
832
|
+
inter_community_edges[cv][cu] = inter_community_edges[cv].get(cu, 0) + 1
|
|
833
|
+
|
|
834
|
+
# Precompute per-node community reach (number of distinct communities a node connects to)
|
|
835
|
+
def _community_reach(node_id: str) -> int:
|
|
836
|
+
neighbor_cids = {
|
|
837
|
+
node_community[nb]
|
|
838
|
+
for nb in G.neighbors(node_id)
|
|
839
|
+
if nb in node_community and node_community[nb] != node_community.get(node_id)
|
|
840
|
+
}
|
|
841
|
+
return len(neighbor_cids)
|
|
842
|
+
|
|
843
|
+
community_notes_written = 0
|
|
844
|
+
for cid, members in communities.items():
|
|
845
|
+
community_name = (
|
|
846
|
+
community_labels.get(cid, f"Community {cid}")
|
|
847
|
+
if community_labels and cid is not None
|
|
848
|
+
else f"Community {cid}"
|
|
849
|
+
)
|
|
850
|
+
n_members = len(members)
|
|
851
|
+
coh_value = cohesion.get(cid) if cohesion else None
|
|
852
|
+
|
|
853
|
+
lines: list[str] = []
|
|
854
|
+
|
|
855
|
+
# YAML frontmatter
|
|
856
|
+
lines.append("---")
|
|
857
|
+
lines.append("type: community")
|
|
858
|
+
if coh_value is not None:
|
|
859
|
+
lines.append(f"cohesion: {coh_value:.2f}")
|
|
860
|
+
lines.append(f"members: {n_members}")
|
|
861
|
+
lines.append("---")
|
|
862
|
+
lines.append("")
|
|
863
|
+
lines.append(f"# {community_name}")
|
|
864
|
+
lines.append("")
|
|
865
|
+
|
|
866
|
+
# Cohesion + member count summary
|
|
867
|
+
if coh_value is not None:
|
|
868
|
+
cohesion_desc = (
|
|
869
|
+
"tightly connected" if coh_value >= 0.7
|
|
870
|
+
else "moderately connected" if coh_value >= 0.4
|
|
871
|
+
else "loosely connected"
|
|
872
|
+
)
|
|
873
|
+
lines.append(f"**Cohesion:** {coh_value:.2f} - {cohesion_desc}")
|
|
874
|
+
lines.append(f"**Members:** {n_members} nodes")
|
|
875
|
+
lines.append("")
|
|
876
|
+
|
|
877
|
+
# Members section
|
|
878
|
+
lines.append("## Members")
|
|
879
|
+
for node_id in sorted(members, key=lambda n: G.nodes[n].get("label", n)):
|
|
880
|
+
data = G.nodes[node_id]
|
|
881
|
+
node_label = node_filename[node_id]
|
|
882
|
+
ftype = data.get("file_type", "")
|
|
883
|
+
source = data.get("source_file", "")
|
|
884
|
+
entry = f"- [[{node_label}]]"
|
|
885
|
+
if ftype:
|
|
886
|
+
entry += f" - {ftype}"
|
|
887
|
+
if source:
|
|
888
|
+
entry += f" - {source}"
|
|
889
|
+
lines.append(entry)
|
|
890
|
+
lines.append("")
|
|
891
|
+
|
|
892
|
+
# Dataview live query (improvement 2)
|
|
893
|
+
comm_tag_name = _obsidian_tag(community_name)
|
|
894
|
+
lines.append("## Live Query (requires Dataview plugin)")
|
|
895
|
+
lines.append("")
|
|
896
|
+
lines.append("```dataview")
|
|
897
|
+
lines.append(f"TABLE source_file, type FROM #community/{comm_tag_name}")
|
|
898
|
+
lines.append("SORT file.name ASC")
|
|
899
|
+
lines.append("```")
|
|
900
|
+
lines.append("")
|
|
901
|
+
|
|
902
|
+
# Connections to other communities
|
|
903
|
+
cross = inter_community_edges.get(cid, {})
|
|
904
|
+
if cross:
|
|
905
|
+
lines.append("## Connections to other communities")
|
|
906
|
+
for other_cid, edge_count in sorted(cross.items(), key=lambda x: -x[1]):
|
|
907
|
+
other_name = (
|
|
908
|
+
community_labels.get(other_cid, f"Community {other_cid}")
|
|
909
|
+
if community_labels and other_cid is not None
|
|
910
|
+
else f"Community {other_cid}"
|
|
911
|
+
)
|
|
912
|
+
other_safe = safe_name(other_name)
|
|
913
|
+
lines.append(f"- {edge_count} edge{'s' if edge_count != 1 else ''} to [[_COMMUNITY_{other_safe}]]")
|
|
914
|
+
lines.append("")
|
|
915
|
+
|
|
916
|
+
# Top bridge nodes - highest degree nodes that connect to other communities
|
|
917
|
+
bridge_nodes = [
|
|
918
|
+
(node_id, G.degree(node_id), _community_reach(node_id))
|
|
919
|
+
for node_id in members
|
|
920
|
+
if _community_reach(node_id) > 0
|
|
921
|
+
]
|
|
922
|
+
bridge_nodes.sort(key=lambda x: (-x[2], -x[1]))
|
|
923
|
+
top_bridges = bridge_nodes[:5]
|
|
924
|
+
if top_bridges:
|
|
925
|
+
lines.append("## Top bridge nodes")
|
|
926
|
+
for node_id, degree, reach in top_bridges:
|
|
927
|
+
node_label = node_filename[node_id]
|
|
928
|
+
lines.append(
|
|
929
|
+
f"- [[{node_label}]] - degree {degree}, connects to {reach} "
|
|
930
|
+
f"{'community' if reach == 1 else 'communities'}"
|
|
931
|
+
)
|
|
932
|
+
|
|
933
|
+
community_safe = safe_name(community_name)
|
|
934
|
+
fname = f"_COMMUNITY_{community_safe}.md"
|
|
935
|
+
(out / fname).write_text("\n".join(lines), encoding="utf-8") # nosec
|
|
936
|
+
community_notes_written += 1
|
|
937
|
+
|
|
938
|
+
# Improvement 4: write .obsidian/graph.json to color nodes by community in graph view
|
|
939
|
+
obsidian_dir = out / ".obsidian"
|
|
940
|
+
obsidian_dir.mkdir(exist_ok=True)
|
|
941
|
+
graph_config = {
|
|
942
|
+
"colorGroups": [
|
|
943
|
+
{
|
|
944
|
+
"query": f"tag:#community/{label.replace(' ', '_')}",
|
|
945
|
+
"color": {"a": 1, "rgb": int(COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)].lstrip('#'), 16)}
|
|
946
|
+
}
|
|
947
|
+
for cid, label in sorted((community_labels or {}).items())
|
|
948
|
+
]
|
|
949
|
+
}
|
|
950
|
+
(obsidian_dir / "graph.json").write_text(json.dumps(graph_config, indent=2), encoding="utf-8") # nosec
|
|
951
|
+
|
|
952
|
+
return G.number_of_nodes() + community_notes_written
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
def to_canvas(
|
|
956
|
+
G: nx.Graph,
|
|
957
|
+
communities: dict[int, list[str]],
|
|
958
|
+
output_path: str,
|
|
959
|
+
community_labels: dict[int, str] | None = None,
|
|
960
|
+
node_filenames: dict[str, str] | None = None,
|
|
961
|
+
) -> None:
|
|
962
|
+
"""Export graph as an Obsidian Canvas file - communities as groups, nodes as cards.
|
|
963
|
+
|
|
964
|
+
Generates a structured layout: communities arranged in a grid, nodes within
|
|
965
|
+
each community arranged in rows. Edges shown between connected nodes.
|
|
966
|
+
Opens in Obsidian as an infinite canvas with community groupings visible.
|
|
967
|
+
"""
|
|
968
|
+
# Obsidian canvas color codes (cycle through for communities)
|
|
969
|
+
CANVAS_COLORS = ["1", "2", "3", "4", "5", "6"] # red, orange, yellow, green, cyan, purple
|
|
970
|
+
|
|
971
|
+
def safe_name(label: str) -> str:
|
|
972
|
+
cleaned = re.sub(r'[\\/*?:"<>|#^[\]]', "", label.replace("\r\n", " ").replace("\r", " ").replace("\n", " ")).strip()
|
|
973
|
+
cleaned = re.sub(r"\.(md|mdx|qmd|markdown)$", "", cleaned, flags=re.IGNORECASE)
|
|
974
|
+
return cleaned or "unnamed"
|
|
975
|
+
|
|
976
|
+
# Build node_filenames if not provided (same dedup logic as to_obsidian)
|
|
977
|
+
if node_filenames is None:
|
|
978
|
+
node_filenames = {}
|
|
979
|
+
seen_names: dict[str, int] = {}
|
|
980
|
+
for node_id, data in G.nodes(data=True):
|
|
981
|
+
base = safe_name(data.get("label", node_id))
|
|
982
|
+
if base in seen_names:
|
|
983
|
+
seen_names[base] += 1
|
|
984
|
+
node_filenames[node_id] = f"{base}_{seen_names[base]}"
|
|
985
|
+
else:
|
|
986
|
+
seen_names[base] = 0
|
|
987
|
+
node_filenames[node_id] = base
|
|
988
|
+
|
|
989
|
+
num_communities = len(communities)
|
|
990
|
+
cols = math.ceil(math.sqrt(num_communities)) if num_communities > 0 else 1
|
|
991
|
+
rows = math.ceil(num_communities / cols) if num_communities > 0 else 1
|
|
992
|
+
|
|
993
|
+
canvas_nodes: list[dict] = []
|
|
994
|
+
canvas_edges: list[dict] = []
|
|
995
|
+
|
|
996
|
+
# Lay out communities in a grid
|
|
997
|
+
gap = 80
|
|
998
|
+
group_x_offsets: list[int] = []
|
|
999
|
+
group_y_offsets: list[int] = []
|
|
1000
|
+
|
|
1001
|
+
# Precompute group sizes so we can calculate offsets
|
|
1002
|
+
sorted_cids = sorted(communities.keys())
|
|
1003
|
+
group_sizes: dict[int, tuple[int, int]] = {}
|
|
1004
|
+
for cid in sorted_cids:
|
|
1005
|
+
members = communities[cid]
|
|
1006
|
+
n = len(members)
|
|
1007
|
+
w = max(600, 220 * math.ceil(math.sqrt(n)) if n > 0 else 600)
|
|
1008
|
+
h = max(400, 100 * math.ceil(n / 3) + 120 if n > 0 else 400)
|
|
1009
|
+
group_sizes[cid] = (w, h)
|
|
1010
|
+
|
|
1011
|
+
# Compute cumulative row heights and col widths for grid placement
|
|
1012
|
+
# Each grid cell uses the max width/height in its col/row
|
|
1013
|
+
col_widths: list[int] = []
|
|
1014
|
+
row_heights: list[int] = []
|
|
1015
|
+
for col_idx in range(cols):
|
|
1016
|
+
max_w = 0
|
|
1017
|
+
for row_idx in range(rows):
|
|
1018
|
+
linear = row_idx * cols + col_idx
|
|
1019
|
+
if linear < len(sorted_cids):
|
|
1020
|
+
cid = sorted_cids[linear]
|
|
1021
|
+
w, _ = group_sizes[cid]
|
|
1022
|
+
max_w = max(max_w, w)
|
|
1023
|
+
col_widths.append(max_w)
|
|
1024
|
+
|
|
1025
|
+
for row_idx in range(rows):
|
|
1026
|
+
max_h = 0
|
|
1027
|
+
for col_idx in range(cols):
|
|
1028
|
+
linear = row_idx * cols + col_idx
|
|
1029
|
+
if linear < len(sorted_cids):
|
|
1030
|
+
cid = sorted_cids[linear]
|
|
1031
|
+
_, h = group_sizes[cid]
|
|
1032
|
+
max_h = max(max_h, h)
|
|
1033
|
+
row_heights.append(max_h)
|
|
1034
|
+
|
|
1035
|
+
# Map from cid → (group_x, group_y, group_w, group_h)
|
|
1036
|
+
group_layout: dict[int, tuple[int, int, int, int]] = {}
|
|
1037
|
+
for idx, cid in enumerate(sorted_cids):
|
|
1038
|
+
col_idx = idx % cols
|
|
1039
|
+
row_idx = idx // cols
|
|
1040
|
+
gx = sum(col_widths[:col_idx]) + col_idx * gap
|
|
1041
|
+
gy = sum(row_heights[:row_idx]) + row_idx * gap
|
|
1042
|
+
gw, gh = group_sizes[cid]
|
|
1043
|
+
group_layout[cid] = (gx, gy, gw, gh)
|
|
1044
|
+
|
|
1045
|
+
# Build set of all node_ids in canvas for edge filtering
|
|
1046
|
+
all_canvas_nodes: set[str] = set()
|
|
1047
|
+
for members in communities.values():
|
|
1048
|
+
all_canvas_nodes.update(members)
|
|
1049
|
+
|
|
1050
|
+
# Generate group and node canvas entries
|
|
1051
|
+
for idx, cid in enumerate(sorted_cids):
|
|
1052
|
+
members = communities[cid]
|
|
1053
|
+
community_name = (
|
|
1054
|
+
community_labels.get(cid, f"Community {cid}")
|
|
1055
|
+
if community_labels and cid is not None
|
|
1056
|
+
else f"Community {cid}"
|
|
1057
|
+
)
|
|
1058
|
+
gx, gy, gw, gh = group_layout[cid]
|
|
1059
|
+
canvas_color = CANVAS_COLORS[idx % len(CANVAS_COLORS)]
|
|
1060
|
+
|
|
1061
|
+
# Group node
|
|
1062
|
+
canvas_nodes.append({
|
|
1063
|
+
"id": f"g{cid}",
|
|
1064
|
+
"type": "group",
|
|
1065
|
+
"label": community_name,
|
|
1066
|
+
"x": gx,
|
|
1067
|
+
"y": gy,
|
|
1068
|
+
"width": gw,
|
|
1069
|
+
"height": gh,
|
|
1070
|
+
"color": canvas_color,
|
|
1071
|
+
})
|
|
1072
|
+
|
|
1073
|
+
# Node cards inside the group - rows of 3
|
|
1074
|
+
sorted_members = sorted(members, key=lambda n: G.nodes[n].get("label", n))
|
|
1075
|
+
for m_idx, node_id in enumerate(sorted_members):
|
|
1076
|
+
col = m_idx % 3
|
|
1077
|
+
row = m_idx // 3
|
|
1078
|
+
nx_x = gx + 20 + col * (180 + 20)
|
|
1079
|
+
nx_y = gy + 80 + row * (60 + 20)
|
|
1080
|
+
fname = node_filenames.get(node_id, safe_name(G.nodes[node_id].get("label", node_id)))
|
|
1081
|
+
canvas_nodes.append({
|
|
1082
|
+
"id": f"n_{node_id}",
|
|
1083
|
+
"type": "file",
|
|
1084
|
+
"file": f"{fname}.md",
|
|
1085
|
+
"x": nx_x,
|
|
1086
|
+
"y": nx_y,
|
|
1087
|
+
"width": 180,
|
|
1088
|
+
"height": 60,
|
|
1089
|
+
})
|
|
1090
|
+
|
|
1091
|
+
# Generate edges - only between nodes both in canvas, cap at 200 highest-weight
|
|
1092
|
+
all_edges_weighted: list[tuple[float, str, str, str]] = []
|
|
1093
|
+
for u, v, edata in G.edges(data=True):
|
|
1094
|
+
if u in all_canvas_nodes and v in all_canvas_nodes:
|
|
1095
|
+
weight = edata.get("weight", 1.0)
|
|
1096
|
+
relation = edata.get("relation", "")
|
|
1097
|
+
conf = edata.get("confidence", "EXTRACTED")
|
|
1098
|
+
label = f"{relation} [{conf}]" if relation else f"[{conf}]"
|
|
1099
|
+
all_edges_weighted.append((weight, u, v, label))
|
|
1100
|
+
|
|
1101
|
+
all_edges_weighted.sort(key=lambda x: -x[0])
|
|
1102
|
+
for weight, u, v, label in all_edges_weighted[:200]:
|
|
1103
|
+
canvas_edges.append({
|
|
1104
|
+
"id": f"e_{u}_{v}",
|
|
1105
|
+
"fromNode": f"n_{u}",
|
|
1106
|
+
"toNode": f"n_{v}",
|
|
1107
|
+
"label": label,
|
|
1108
|
+
})
|
|
1109
|
+
|
|
1110
|
+
canvas_data = {"nodes": canvas_nodes, "edges": canvas_edges}
|
|
1111
|
+
Path(output_path).write_text(json.dumps(canvas_data, indent=2), encoding="utf-8") # nosec
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
def push_to_neo4j(
|
|
1115
|
+
G: nx.Graph,
|
|
1116
|
+
uri: str,
|
|
1117
|
+
user: str,
|
|
1118
|
+
password: str,
|
|
1119
|
+
communities: dict[int, list[str]] | None = None,
|
|
1120
|
+
) -> dict[str, int]:
|
|
1121
|
+
"""Push graph directly to a running Neo4j instance via the Python driver.
|
|
1122
|
+
|
|
1123
|
+
Requires: pip install neo4j
|
|
1124
|
+
|
|
1125
|
+
Uses MERGE so re-running is safe - nodes and edges are upserted, not duplicated.
|
|
1126
|
+
Returns a dict with counts of nodes and edges pushed.
|
|
1127
|
+
"""
|
|
1128
|
+
try:
|
|
1129
|
+
from neo4j import GraphDatabase
|
|
1130
|
+
except ImportError as e:
|
|
1131
|
+
raise ImportError(
|
|
1132
|
+
"neo4j driver not installed. Run: pip install neo4j"
|
|
1133
|
+
) from e
|
|
1134
|
+
|
|
1135
|
+
node_community = _node_community_map(communities) if communities else {}
|
|
1136
|
+
|
|
1137
|
+
def _safe_rel(relation: str) -> str:
|
|
1138
|
+
return re.sub(r"[^A-Z0-9_]", "_", relation.upper().replace(" ", "_").replace("-", "_")) or "RELATED_TO"
|
|
1139
|
+
|
|
1140
|
+
def _safe_label(label: str) -> str:
|
|
1141
|
+
"""Sanitize a Neo4j node label to prevent Cypher injection."""
|
|
1142
|
+
sanitized = re.sub(r"[^A-Za-z0-9_]", "", label)
|
|
1143
|
+
return sanitized if sanitized else "Entity"
|
|
1144
|
+
|
|
1145
|
+
driver = GraphDatabase.driver(uri, auth=(user, password))
|
|
1146
|
+
nodes_pushed = 0
|
|
1147
|
+
edges_pushed = 0
|
|
1148
|
+
|
|
1149
|
+
with driver.session() as session:
|
|
1150
|
+
for node_id, data in G.nodes(data=True):
|
|
1151
|
+
props = {k: v for k, v in data.items() if isinstance(v, (str, int, float, bool))}
|
|
1152
|
+
props["id"] = node_id
|
|
1153
|
+
cid = node_community.get(node_id)
|
|
1154
|
+
if cid is not None:
|
|
1155
|
+
props["community"] = cid
|
|
1156
|
+
ftype = _safe_label(data.get("file_type", "Entity").capitalize())
|
|
1157
|
+
session.run(
|
|
1158
|
+
f"MERGE (n:{ftype} {{id: $id}}) SET n += $props",
|
|
1159
|
+
id=node_id,
|
|
1160
|
+
props=props,
|
|
1161
|
+
)
|
|
1162
|
+
nodes_pushed += 1
|
|
1163
|
+
|
|
1164
|
+
for u, v, data in G.edges(data=True):
|
|
1165
|
+
rel = _safe_rel(data.get("relation", "RELATED_TO"))
|
|
1166
|
+
props = {k: v for k, v in data.items() if isinstance(v, (str, int, float, bool))}
|
|
1167
|
+
session.run(
|
|
1168
|
+
f"MATCH (a {{id: $src}}), (b {{id: $tgt}}) "
|
|
1169
|
+
f"MERGE (a)-[r:{rel}]->(b) SET r += $props",
|
|
1170
|
+
src=u,
|
|
1171
|
+
tgt=v,
|
|
1172
|
+
props=props,
|
|
1173
|
+
)
|
|
1174
|
+
edges_pushed += 1
|
|
1175
|
+
|
|
1176
|
+
driver.close()
|
|
1177
|
+
return {"nodes": nodes_pushed, "edges": edges_pushed}
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
def to_graphml(
|
|
1181
|
+
G: nx.Graph,
|
|
1182
|
+
communities: dict[int, list[str]],
|
|
1183
|
+
output_path: str,
|
|
1184
|
+
) -> None:
|
|
1185
|
+
"""Export graph as GraphML - opens in Gephi, yEd, and any GraphML-compatible tool.
|
|
1186
|
+
|
|
1187
|
+
Community IDs are written as a node attribute so Gephi can colour by community.
|
|
1188
|
+
Edge confidence (EXTRACTED/INFERRED/AMBIGUOUS) is preserved as an edge attribute.
|
|
1189
|
+
"""
|
|
1190
|
+
H = G.copy()
|
|
1191
|
+
node_community = _node_community_map(communities)
|
|
1192
|
+
for node_id in H.nodes():
|
|
1193
|
+
H.nodes[node_id]["community"] = node_community.get(node_id, -1)
|
|
1194
|
+
nx.write_graphml(H, output_path)
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
def to_svg(
|
|
1198
|
+
G: nx.Graph,
|
|
1199
|
+
communities: dict[int, list[str]],
|
|
1200
|
+
output_path: str,
|
|
1201
|
+
community_labels: dict[int, str] | None = None,
|
|
1202
|
+
figsize: tuple[int, int] = (20, 14),
|
|
1203
|
+
) -> None:
|
|
1204
|
+
"""Export graph as an SVG file using matplotlib + spring layout.
|
|
1205
|
+
|
|
1206
|
+
Lightweight and embeddable - works in Obsidian notes, Notion, GitHub READMEs,
|
|
1207
|
+
and any markdown renderer. No JavaScript required.
|
|
1208
|
+
|
|
1209
|
+
Node size scales with degree. Community colors match the HTML output.
|
|
1210
|
+
"""
|
|
1211
|
+
try:
|
|
1212
|
+
import matplotlib
|
|
1213
|
+
matplotlib.use("Agg")
|
|
1214
|
+
import matplotlib.pyplot as plt
|
|
1215
|
+
import matplotlib.patches as mpatches
|
|
1216
|
+
except ImportError as e:
|
|
1217
|
+
raise ImportError("matplotlib not installed. Run: pip install matplotlib") from e
|
|
1218
|
+
|
|
1219
|
+
node_community = _node_community_map(communities)
|
|
1220
|
+
|
|
1221
|
+
fig, ax = plt.subplots(figsize=figsize, facecolor="#1a1a2e")
|
|
1222
|
+
ax.set_facecolor("#1a1a2e")
|
|
1223
|
+
ax.axis("off")
|
|
1224
|
+
|
|
1225
|
+
pos = nx.spring_layout(G, seed=42, k=2.0 / (G.number_of_nodes() ** 0.5 + 1))
|
|
1226
|
+
|
|
1227
|
+
degree = dict(G.degree())
|
|
1228
|
+
max_deg = max(degree.values(), default=1) or 1
|
|
1229
|
+
|
|
1230
|
+
node_colors = [COMMUNITY_COLORS[node_community.get(n, 0) % len(COMMUNITY_COLORS)] for n in G.nodes()]
|
|
1231
|
+
node_sizes = [300 + 1200 * (degree.get(n, 1) / max_deg) for n in G.nodes()]
|
|
1232
|
+
|
|
1233
|
+
# Draw edges - dashed for non-EXTRACTED
|
|
1234
|
+
for u, v, data in G.edges(data=True):
|
|
1235
|
+
conf = data.get("confidence", "EXTRACTED")
|
|
1236
|
+
style = "solid" if conf == "EXTRACTED" else "dashed"
|
|
1237
|
+
alpha = 0.6 if conf == "EXTRACTED" else 0.3
|
|
1238
|
+
x0, y0 = pos[u]
|
|
1239
|
+
x1, y1 = pos[v]
|
|
1240
|
+
ax.plot([x0, x1], [y0, y1], color="#aaaaaa", linewidth=0.8,
|
|
1241
|
+
linestyle=style, alpha=alpha, zorder=1)
|
|
1242
|
+
|
|
1243
|
+
nx.draw_networkx_nodes(G, pos, ax=ax, node_color=node_colors,
|
|
1244
|
+
node_size=node_sizes, alpha=0.9)
|
|
1245
|
+
nx.draw_networkx_labels(G, pos, ax=ax,
|
|
1246
|
+
labels={n: G.nodes[n].get("label", n) for n in G.nodes()},
|
|
1247
|
+
font_size=7, font_color="white")
|
|
1248
|
+
|
|
1249
|
+
# Legend
|
|
1250
|
+
if community_labels:
|
|
1251
|
+
patches = [
|
|
1252
|
+
mpatches.Patch(
|
|
1253
|
+
color=COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)],
|
|
1254
|
+
label=f"{label} ({len(communities.get(cid, []))})",
|
|
1255
|
+
)
|
|
1256
|
+
for cid, label in sorted(community_labels.items())
|
|
1257
|
+
]
|
|
1258
|
+
ax.legend(handles=patches, loc="upper left", framealpha=0.7,
|
|
1259
|
+
facecolor="#2a2a4e", labelcolor="white", fontsize=8)
|
|
1260
|
+
|
|
1261
|
+
plt.tight_layout()
|
|
1262
|
+
plt.savefig(output_path, format="svg", bbox_inches="tight",
|
|
1263
|
+
facecolor=fig.get_facecolor())
|
|
1264
|
+
plt.close(fig)
|