@oriro/orirocli 0.1.8 → 0.1.11
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/ATTRIBUTION.md +53 -45
- package/LICENSE +21 -0
- package/README.md +20 -17
- package/dist/cli.js +4425 -2975
- package/package.json +64 -64
- package/skills/1password/SKILL.md +118 -118
- package/skills/1password/references/cli-examples.md +29 -29
- package/skills/1password/references/get-started.md +21 -21
- package/skills/21stdev/SKILL.md +64 -0
- package/skills/algorithmic-art/LICENSE +21 -21
- package/skills/algorithmic-art/SKILL.md +446 -446
- package/skills/algorithmic-art/templates/generator_template.js +223 -223
- package/skills/algorithmic-art/templates/viewer.html +598 -598
- package/skills/apple-notes/SKILL.md +81 -81
- package/skills/apple-reminders/SKILL.md +122 -122
- package/skills/bear-notes/SKILL.md +111 -111
- package/skills/blogwatcher/SKILL.md +73 -73
- package/skills/blucli/SKILL.md +51 -51
- package/skills/brand-guidelines/LICENSE +21 -21
- package/skills/brand-guidelines/SKILL.md +76 -76
- package/skills/business/biz-analysis/LICENSE +21 -21
- package/skills/business/biz-analysis/SKILL.md +103 -103
- package/skills/business/biz-corporate-strategy/LICENSE +21 -21
- package/skills/business/biz-corporate-strategy/SKILL.md +76 -76
- package/skills/business/biz-customer-success/LICENSE +21 -21
- package/skills/business/biz-customer-success/SKILL.md +55 -55
- package/skills/business/biz-entrepreneurship/LICENSE +21 -21
- package/skills/business/biz-entrepreneurship/SKILL.md +72 -72
- package/skills/business/biz-hr/LICENSE +21 -21
- package/skills/business/biz-hr/SKILL.md +67 -67
- package/skills/business/biz-international/LICENSE +21 -21
- package/skills/business/biz-international/SKILL.md +51 -51
- package/skills/business/biz-leadership/LICENSE +21 -21
- package/skills/business/biz-leadership/SKILL.md +106 -106
- package/skills/business/biz-marketing-strategy/LICENSE +21 -21
- package/skills/business/biz-marketing-strategy/SKILL.md +119 -119
- package/skills/business/biz-negotiation/LICENSE +21 -21
- package/skills/business/biz-negotiation/SKILL.md +152 -152
- package/skills/business/biz-operations/LICENSE +21 -21
- package/skills/business/biz-operations/SKILL.md +74 -74
- package/skills/business/biz-project/LICENSE +21 -21
- package/skills/business/biz-project/SKILL.md +203 -203
- package/skills/business/biz-risk/LICENSE +21 -21
- package/skills/business/biz-risk/SKILL.md +85 -85
- package/skills/business/biz-sales/LICENSE +21 -21
- package/skills/business/biz-sales/SKILL.md +92 -92
- package/skills/business/biz-startup-ops/LICENSE +21 -21
- package/skills/business/biz-startup-ops/SKILL.md +70 -70
- package/skills/business/biz-strategy/LICENSE +21 -21
- package/skills/business/biz-strategy/SKILL.md +233 -233
- package/skills/business/biz-supply-chain-advanced/LICENSE +21 -21
- package/skills/business/biz-supply-chain-advanced/SKILL.md +68 -68
- package/skills/business/fin-chartered-exams/LICENSE +21 -21
- package/skills/business/fin-chartered-exams/SKILL.md +69 -69
- package/skills/camsnap/SKILL.md +49 -49
- package/skills/canvas/SKILL.md +82 -82
- package/skills/canvas-design/LICENSE +21 -21
- package/skills/canvas-design/SKILL.md +140 -140
- package/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -94
- package/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -93
- package/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -93
- package/skills/coding-agent/SKILL.md +146 -146
- package/skills/communication/comm-business-writing/LICENSE +21 -21
- package/skills/communication/comm-business-writing/SKILL.md +67 -67
- package/skills/communication/comm-cross-cultural/LICENSE +21 -21
- package/skills/communication/comm-cross-cultural/SKILL.md +88 -88
- package/skills/communication/comm-journalism/LICENSE +21 -21
- package/skills/communication/comm-journalism/SKILL.md +81 -81
- package/skills/communication/comm-linguistics/LICENSE +21 -21
- package/skills/communication/comm-linguistics/SKILL.md +82 -82
- package/skills/communication/comm-negotiation/LICENSE +21 -21
- package/skills/communication/comm-negotiation/SKILL.md +120 -120
- package/skills/communication/comm-presentations/LICENSE +21 -21
- package/skills/communication/comm-presentations/SKILL.md +93 -93
- package/skills/communication/comm-public-speaking/LICENSE +21 -21
- package/skills/communication/comm-public-speaking/SKILL.md +68 -68
- package/skills/communication/comm-writing/LICENSE +21 -21
- package/skills/communication/comm-writing/SKILL.md +69 -69
- package/skills/craft/ai-engineering/LICENSE +21 -21
- package/skills/craft/ai-engineering/SKILL.md +828 -828
- package/skills/craft/app-builder-guide/LICENSE +21 -21
- package/skills/craft/app-builder-guide/SKILL.md +332 -332
- package/skills/craft/become-an-ai-engineer-26/CONTRIBUTING.md +46 -46
- package/skills/craft/become-an-ai-engineer-26/LICENSE +21 -21
- package/skills/craft/become-an-ai-engineer-26/README.md +270 -270
- package/skills/craft/become-an-ai-engineer-26/SKILL.md +667 -667
- package/skills/craft/become-an-ai-engineer-26/community/BUILDS.md +13 -13
- package/skills/craft/become-an-ai-engineer-26/community/DISCUSSIONS.md +8 -8
- package/skills/craft/become-an-ai-engineer-26/phases/phase-0-mental-models/README.md +14 -14
- package/skills/craft/become-an-ai-engineer-26/phases/phase-0-mental-models/project/TEMPLATE.md +33 -33
- package/skills/craft/become-an-ai-engineer-26/phases/phase-1-first-agent/README.md +25 -25
- package/skills/craft/become-an-ai-engineer-26/phases/phase-1-first-agent/code/raw_loop.py +126 -126
- package/skills/craft/become-an-ai-engineer-26/phases/phase-2-architecture/README.md +17 -17
- package/skills/craft/become-an-ai-engineer-26/phases/phase-3-harness/README.md +17 -17
- package/skills/craft/become-an-ai-engineer-26/phases/phase-4-evals/README.md +21 -21
- package/skills/craft/become-an-ai-engineer-26/phases/phase-4-evals/code/.github/workflows/eval.yml +40 -40
- package/skills/craft/become-an-ai-engineer-26/phases/phase-5-production/README.md +16 -16
- package/skills/craft/become-an-ai-engineer-26/projects/1-mobile-app-slm/README.md +11 -11
- package/skills/craft/become-an-ai-engineer-26/projects/2-self-improving-coder/README.md +11 -11
- package/skills/craft/become-an-ai-engineer-26/projects/3-video-editor-agent/README.md +11 -11
- package/skills/craft/become-an-ai-engineer-26/projects/4-personal-life-os/README.md +12 -12
- package/skills/craft/become-an-ai-engineer-26/projects/5-enterprise-workflow/README.md +12 -12
- package/skills/craft/become-an-ai-engineer-26/references/benchmark-numbers.md +41 -41
- package/skills/craft/become-an-ai-engineer-26/references/mhc-stable-training.md +73 -73
- package/skills/craft/become-an-ai-engineer-26/references/stack-decisions.md +37 -37
- package/skills/craft/become-an-ai-engineer-26/references/yarn-context-extension.md +123 -123
- package/skills/craft/codex-result-handling/LICENSE +21 -21
- package/skills/craft/codex-result-handling/SKILL.md +26 -26
- package/skills/craft/debug-and-build-methodology/LICENSE +21 -21
- package/skills/craft/debug-and-build-methodology/SKILL.md +432 -432
- package/skills/craft/design/LICENSE +21 -21
- package/skills/craft/design/SKILL.md +274 -274
- package/skills/craft/dev/LICENSE +21 -21
- package/skills/craft/dev/SKILL.md +12 -12
- package/skills/craft/dev/release.md +85 -85
- package/skills/craft/dev/roll.md +50 -50
- package/skills/craft/doc-coauthoring/LICENSE +21 -21
- package/skills/craft/doc-coauthoring/SKILL.md +397 -397
- package/skills/craft/focus/LICENSE +21 -21
- package/skills/craft/focus/SKILL.md +432 -432
- package/skills/craft/focus/UPSTREAM_README.md +233 -233
- package/skills/craft/gh/LICENSE +21 -21
- package/skills/craft/gh/SKILL.md +84 -84
- package/skills/craft/gh-skill/LICENSE +21 -21
- package/skills/craft/gh-skill/SKILL.md +121 -121
- package/skills/craft/godmode/LICENSE +21 -21
- package/skills/craft/godmode/SKILL.md +87 -87
- package/skills/craft/godmode/references/android-launch.md +680 -680
- package/skills/craft/godmode/references/data-gcp.md +1038 -1038
- package/skills/craft/godmode/references/expo-eas.md +816 -816
- package/skills/craft/godmode/references/ios-launch.md +734 -734
- package/skills/craft/google-ai-latest/LICENSE +21 -21
- package/skills/craft/google-ai-latest/SKILL.md +682 -682
- package/skills/craft/gpt-5-4-prompting/LICENSE +21 -21
- package/skills/craft/gpt-5-4-prompting/SKILL.md +63 -63
- package/skills/craft/gpt-5-4-prompting/references/codex-prompt-antipatterns.md +101 -101
- package/skills/craft/gpt-5-4-prompting/references/codex-prompt-recipes.md +150 -150
- package/skills/craft/gpt-5-4-prompting/references/prompt-blocks.md +172 -172
- package/skills/craft/grill-me/LICENSE +21 -21
- package/skills/craft/grill-me/SKILL.md +13 -13
- package/skills/craft/idea-to-deploy/LICENSE +21 -21
- package/skills/craft/idea-to-deploy/SKILL.md +292 -292
- package/skills/craft/idea-to-deploy/references/auth-playbook.md +195 -195
- package/skills/craft/idea-to-deploy/references/gcp-deployment.md +268 -268
- package/skills/craft/idea-to-deploy/references/stack-selection.md +117 -117
- package/skills/craft/image-generation-engineer/LICENSE +21 -21
- package/skills/craft/image-generation-engineer/SKILL.md +183 -183
- package/skills/craft/image-generation-engineer/references/architectures.md +260 -260
- package/skills/craft/image-generation-engineer/references/foundations.md +107 -107
- package/skills/craft/image-generation-engineer/references/inference-and-serving.md +253 -253
- package/skills/craft/image-generation-engineer/references/training.md +149 -149
- package/skills/craft/marketing/LICENSE +21 -21
- package/skills/craft/marketing/SKILL.md +1954 -1954
- package/skills/craft/master-architect/LICENSE +21 -21
- package/skills/craft/master-architect/SKILL.md +361 -361
- package/skills/craft/master-architect/references/ai-ml.md +317 -317
- package/skills/craft/master-architect/references/architecture.md +268 -268
- package/skills/craft/master-architect/references/auth-playbook.md +195 -195
- package/skills/craft/master-architect/references/cloud.md +323 -323
- package/skills/craft/master-architect/references/cyber.md +839 -839
- package/skills/craft/master-architect/references/data-eng.md +366 -366
- package/skills/craft/master-architect/references/devops.md +550 -550
- package/skills/craft/master-architect/references/gcp-deployment.md +268 -268
- package/skills/craft/master-architect/references/languages.md +748 -748
- package/skills/craft/master-architect/references/legacy.md +240 -240
- package/skills/craft/master-architect/references/mobile.md +447 -447
- package/skills/craft/master-architect/references/patterns.md +451 -451
- package/skills/craft/master-architect/references/saas-patterns.md +379 -379
- package/skills/craft/master-architect/references/sdlc.md +349 -349
- package/skills/craft/master-architect/references/stack-selection.md +117 -117
- package/skills/craft/oriro-ui-2026/LICENSE +21 -21
- package/skills/craft/oriro-ui-2026/SKILL.md +329 -329
- package/skills/craft/playwright-cli/LICENSE +21 -21
- package/skills/craft/playwright-cli/SKILL.md +393 -393
- package/skills/craft/playwright-cli/references/element-attributes.md +23 -23
- package/skills/craft/playwright-cli/references/playwright-tests.md +39 -39
- package/skills/craft/playwright-cli/references/request-mocking.md +87 -87
- package/skills/craft/playwright-cli/references/running-code.md +240 -240
- package/skills/craft/playwright-cli/references/session-management.md +226 -226
- package/skills/craft/playwright-cli/references/spec-driven-testing.md +312 -312
- package/skills/craft/playwright-cli/references/storage-state.md +275 -275
- package/skills/craft/playwright-cli/references/test-generation.md +134 -134
- package/skills/craft/playwright-cli/references/tracing.md +142 -142
- package/skills/craft/playwright-cli/references/video-recording.md +150 -150
- package/skills/craft/remotion-best-practices/LICENSE +21 -21
- package/skills/craft/remotion-best-practices/SKILL.md +345 -345
- package/skills/craft/remotion-best-practices/rules/3d.md +86 -86
- package/skills/craft/remotion-best-practices/rules/assets/charts-bar-chart.tsx +165 -165
- package/skills/craft/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +89 -89
- package/skills/craft/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +101 -101
- package/skills/craft/remotion-best-practices/rules/audio-visualization.md +195 -195
- package/skills/craft/remotion-best-practices/rules/audio.md +167 -167
- package/skills/craft/remotion-best-practices/rules/calculate-metadata.md +118 -118
- package/skills/craft/remotion-best-practices/rules/compositions.md +132 -132
- package/skills/craft/remotion-best-practices/rules/display-captions.md +176 -176
- package/skills/craft/remotion-best-practices/rules/ffmpeg.md +34 -34
- package/skills/craft/remotion-best-practices/rules/get-audio-duration.md +58 -58
- package/skills/craft/remotion-best-practices/rules/get-video-dimensions.md +68 -68
- package/skills/craft/remotion-best-practices/rules/get-video-duration.md +60 -60
- package/skills/craft/remotion-best-practices/rules/gifs.md +135 -135
- package/skills/craft/remotion-best-practices/rules/google-fonts.md +72 -72
- package/skills/craft/remotion-best-practices/rules/html-in-canvas.md +122 -122
- package/skills/craft/remotion-best-practices/rules/images.md +67 -67
- package/skills/craft/remotion-best-practices/rules/import-srt-captions.md +69 -69
- package/skills/craft/remotion-best-practices/rules/light-leaks.md +73 -73
- package/skills/craft/remotion-best-practices/rules/local-fonts.md +65 -65
- package/skills/craft/remotion-best-practices/rules/lottie.md +67 -67
- package/skills/craft/remotion-best-practices/rules/maplibre.md +441 -441
- package/skills/craft/remotion-best-practices/rules/measuring-dom-nodes.md +34 -34
- package/skills/craft/remotion-best-practices/rules/measuring-text.md +140 -140
- package/skills/craft/remotion-best-practices/rules/parameters.md +109 -109
- package/skills/craft/remotion-best-practices/rules/sequencing.md +144 -144
- package/skills/craft/remotion-best-practices/rules/sfx.md +30 -30
- package/skills/craft/remotion-best-practices/rules/silence-detection.md +73 -73
- package/skills/craft/remotion-best-practices/rules/subtitles.md +36 -36
- package/skills/craft/remotion-best-practices/rules/tailwind.md +11 -11
- package/skills/craft/remotion-best-practices/rules/text-animations.md +20 -20
- package/skills/craft/remotion-best-practices/rules/timing.md +130 -130
- package/skills/craft/remotion-best-practices/rules/transcribe-captions.md +70 -70
- package/skills/craft/remotion-best-practices/rules/transitions.md +193 -193
- package/skills/craft/remotion-best-practices/rules/transparent-videos.md +102 -102
- package/skills/craft/remotion-best-practices/rules/trimming.md +51 -51
- package/skills/craft/remotion-best-practices/rules/videos.md +169 -169
- package/skills/craft/remotion-best-practices/rules/voiceover.md +94 -94
- package/skills/craft/supabase-postgres-best-practices/CHANGELOG.md +25 -25
- package/skills/craft/supabase-postgres-best-practices/LICENSE +21 -21
- package/skills/craft/supabase-postgres-best-practices/SKILL.md +69 -69
- package/skills/craft/supabase-postgres-best-practices/references/_contributing.md +166 -166
- package/skills/craft/supabase-postgres-best-practices/references/_sections.md +47 -47
- package/skills/craft/supabase-postgres-best-practices/references/_template.md +34 -34
- package/skills/craft/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -55
- package/skills/craft/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -49
- package/skills/craft/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -46
- package/skills/craft/supabase-postgres-best-practices/references/conn-limits.md +44 -44
- package/skills/craft/supabase-postgres-best-practices/references/conn-pooling.md +41 -41
- package/skills/craft/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -46
- package/skills/craft/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -54
- package/skills/craft/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -53
- package/skills/craft/supabase-postgres-best-practices/references/data-pagination.md +50 -50
- package/skills/craft/supabase-postgres-best-practices/references/data-upsert.md +50 -50
- package/skills/craft/supabase-postgres-best-practices/references/lock-advisory.md +56 -56
- package/skills/craft/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -68
- package/skills/craft/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -50
- package/skills/craft/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -54
- package/skills/craft/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -45
- package/skills/craft/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -55
- package/skills/craft/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -55
- package/skills/craft/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -44
- package/skills/craft/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -40
- package/skills/craft/supabase-postgres-best-practices/references/query-index-types.md +48 -48
- package/skills/craft/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -43
- package/skills/craft/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -45
- package/skills/craft/supabase-postgres-best-practices/references/schema-constraints.md +80 -80
- package/skills/craft/supabase-postgres-best-practices/references/schema-data-types.md +46 -46
- package/skills/craft/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -59
- package/skills/craft/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -55
- package/skills/craft/supabase-postgres-best-practices/references/schema-partitioning.md +55 -55
- package/skills/craft/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -61
- package/skills/craft/supabase-postgres-best-practices/references/security-privileges.md +54 -54
- package/skills/craft/supabase-postgres-best-practices/references/security-rls-basics.md +50 -50
- package/skills/craft/supabase-postgres-best-practices/references/security-rls-performance.md +63 -63
- package/skills/craft/uipm-banner-design/LICENSE +21 -21
- package/skills/craft/uipm-banner-design/SKILL.md +201 -201
- package/skills/craft/uipm-banner-design/references/banner-sizes-and-styles.md +129 -129
- package/skills/craft/uipm-brand/LICENSE +21 -21
- package/skills/craft/uipm-brand/SKILL.md +104 -104
- package/skills/craft/uipm-brand/references/approval-checklist.md +184 -184
- package/skills/craft/uipm-brand/references/asset-organization.md +167 -167
- package/skills/craft/uipm-brand/references/brand-guideline-template.md +161 -161
- package/skills/craft/uipm-brand/references/color-palette-management.md +203 -203
- package/skills/craft/uipm-brand/references/consistency-checklist.md +105 -105
- package/skills/craft/uipm-brand/references/logo-usage-rules.md +204 -204
- package/skills/craft/uipm-brand/references/messaging-framework.md +91 -91
- package/skills/craft/uipm-brand/references/typography-specifications.md +265 -265
- package/skills/craft/uipm-brand/references/update.md +128 -128
- package/skills/craft/uipm-brand/references/visual-identity.md +109 -109
- package/skills/craft/uipm-brand/references/voice-framework.md +99 -99
- package/skills/craft/uipm-brand/scripts/extract-colors.cjs +333 -333
- package/skills/craft/uipm-brand/scripts/inject-brand-context.cjs +324 -324
- package/skills/craft/uipm-brand/scripts/sync-brand-to-tokens.cjs +269 -269
- package/skills/craft/uipm-brand/scripts/validate-asset.cjs +361 -361
- package/skills/craft/uipm-brand/templates/brand-guidelines-starter.md +280 -280
- package/skills/craft/uipm-design/LICENSE +21 -21
- package/skills/craft/uipm-design/SKILL.md +305 -305
- package/skills/craft/uipm-design/data/cip/deliverables.csv +50 -50
- package/skills/craft/uipm-design/data/cip/industries.csv +20 -20
- package/skills/craft/uipm-design/data/cip/mockup-contexts.csv +20 -20
- package/skills/craft/uipm-design/data/cip/styles.csv +20 -20
- package/skills/craft/uipm-design/data/icon/styles.csv +16 -16
- package/skills/craft/uipm-design/data/logo/colors.csv +56 -56
- package/skills/craft/uipm-design/data/logo/industries.csv +56 -56
- package/skills/craft/uipm-design/data/logo/styles.csv +56 -56
- package/skills/craft/uipm-design/references/banner-sizes-and-styles.md +129 -129
- package/skills/craft/uipm-design/references/cip-deliverable-guide.md +111 -111
- package/skills/craft/uipm-design/references/cip-design.md +121 -121
- package/skills/craft/uipm-design/references/cip-prompt-engineering.md +94 -94
- package/skills/craft/uipm-design/references/cip-style-guide.md +76 -76
- package/skills/craft/uipm-design/references/design-routing.md +226 -226
- package/skills/craft/uipm-design/references/icon-design.md +122 -122
- package/skills/craft/uipm-design/references/logo-color-psychology.md +113 -113
- package/skills/craft/uipm-design/references/logo-design.md +92 -92
- package/skills/craft/uipm-design/references/logo-prompt-engineering.md +176 -176
- package/skills/craft/uipm-design/references/logo-style-guide.md +129 -129
- package/skills/craft/uipm-design/references/slides-copywriting-formulas.md +92 -92
- package/skills/craft/uipm-design/references/slides-create.md +5 -5
- package/skills/craft/uipm-design/references/slides-html-template.md +374 -374
- package/skills/craft/uipm-design/references/slides-layout-patterns.md +155 -155
- package/skills/craft/uipm-design/references/slides-strategies.md +97 -97
- package/skills/craft/uipm-design/references/slides.md +42 -42
- package/skills/craft/uipm-design/references/social-photos-design.md +353 -353
- package/skills/craft/uipm-design/scripts/cip/core.py +215 -215
- package/skills/craft/uipm-design/scripts/cip/generate.py +484 -484
- package/skills/craft/uipm-design/scripts/cip/render-html.py +424 -424
- package/skills/craft/uipm-design/scripts/cip/search.py +127 -127
- package/skills/craft/uipm-design/scripts/icon/generate.py +487 -487
- package/skills/craft/uipm-design/scripts/logo/core.py +175 -175
- package/skills/craft/uipm-design/scripts/logo/generate.py +362 -362
- package/skills/craft/uipm-design/scripts/logo/search.py +114 -114
- package/skills/craft/uipm-design-system/LICENSE +21 -21
- package/skills/craft/uipm-design-system/SKILL.md +255 -255
- package/skills/craft/uipm-design-system/data/slide-backgrounds.csv +11 -11
- package/skills/craft/uipm-design-system/data/slide-charts.csv +26 -26
- package/skills/craft/uipm-design-system/data/slide-color-logic.csv +14 -14
- package/skills/craft/uipm-design-system/data/slide-copy.csv +26 -26
- package/skills/craft/uipm-design-system/data/slide-layout-logic.csv +16 -16
- package/skills/craft/uipm-design-system/data/slide-layouts.csv +26 -26
- package/skills/craft/uipm-design-system/data/slide-strategies.csv +16 -16
- package/skills/craft/uipm-design-system/data/slide-typography.csv +15 -15
- package/skills/craft/uipm-design-system/references/component-specs.md +236 -236
- package/skills/craft/uipm-design-system/references/component-tokens.md +214 -214
- package/skills/craft/uipm-design-system/references/primitive-tokens.md +199 -199
- package/skills/craft/uipm-design-system/references/semantic-tokens.md +215 -215
- package/skills/craft/uipm-design-system/references/states-and-variants.md +243 -243
- package/skills/craft/uipm-design-system/references/tailwind-integration.md +257 -257
- package/skills/craft/uipm-design-system/references/token-architecture.md +226 -226
- package/skills/craft/uipm-design-system/scripts/embed-tokens.cjs +97 -97
- package/skills/craft/uipm-design-system/scripts/fetch-background.py +317 -317
- package/skills/craft/uipm-design-system/scripts/generate-slide.py +753 -753
- package/skills/craft/uipm-design-system/scripts/generate-tokens.cjs +213 -213
- package/skills/craft/uipm-design-system/scripts/html-token-validator.py +327 -327
- package/skills/craft/uipm-design-system/scripts/search-slides.py +218 -218
- package/skills/craft/uipm-design-system/scripts/slide-token-validator.py +35 -35
- package/skills/craft/uipm-design-system/scripts/slide_search_core.py +453 -453
- package/skills/craft/uipm-design-system/scripts/validate-tokens.cjs +254 -254
- package/skills/craft/uipm-design-system/templates/design-tokens-starter.json +143 -143
- package/skills/craft/uipm-slides/LICENSE +21 -21
- package/skills/craft/uipm-slides/SKILL.md +45 -45
- package/skills/craft/uipm-slides/references/copywriting-formulas.md +92 -92
- package/skills/craft/uipm-slides/references/create.md +5 -5
- package/skills/craft/uipm-slides/references/html-template.md +374 -374
- package/skills/craft/uipm-slides/references/layout-patterns.md +155 -155
- package/skills/craft/uipm-slides/references/slide-strategies.md +97 -97
- package/skills/craft/uipm-ui-ux-pro-max/LICENSE +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/SKILL.md +678 -678
- package/skills/craft/uipm-ui-ux-pro-max/data/_sync_all.py +414 -414
- package/skills/craft/uipm-ui-ux-pro-max/data/app-interface.csv +30 -30
- package/skills/craft/uipm-ui-ux-pro-max/data/charts.csv +26 -26
- package/skills/craft/uipm-ui-ux-pro-max/data/colors.csv +161 -161
- package/skills/craft/uipm-ui-ux-pro-max/data/design.csv +1775 -1775
- package/skills/craft/uipm-ui-ux-pro-max/data/draft.csv +1778 -1778
- package/skills/craft/uipm-ui-ux-pro-max/data/google-fonts.csv +1924 -1924
- package/skills/craft/uipm-ui-ux-pro-max/data/icons.csv +105 -105
- package/skills/craft/uipm-ui-ux-pro-max/data/landing.csv +35 -35
- package/skills/craft/uipm-ui-ux-pro-max/data/products.csv +162 -162
- package/skills/craft/uipm-ui-ux-pro-max/data/react-performance.csv +45 -45
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/angular.csv +51 -51
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/astro.csv +54 -54
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/flutter.csv +53 -53
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -56
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -53
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/laravel.csv +51 -51
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/nextjs.csv +53 -53
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -51
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -59
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/react-native.csv +52 -52
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/react.csv +54 -54
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/shadcn.csv +61 -61
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/svelte.csv +54 -54
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/swiftui.csv +51 -51
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/threejs.csv +54 -54
- package/skills/craft/uipm-ui-ux-pro-max/data/stacks/vue.csv +50 -50
- package/skills/craft/uipm-ui-ux-pro-max/data/styles.csv +85 -85
- package/skills/craft/uipm-ui-ux-pro-max/data/typography.csv +74 -74
- package/skills/craft/uipm-ui-ux-pro-max/data/ui-reasoning.csv +162 -162
- package/skills/craft/uipm-ui-ux-pro-max/data/ux-guidelines.csv +99 -99
- package/skills/craft/uipm-ui-ux-pro-max/scripts/core.py +262 -262
- package/skills/craft/uipm-ui-ux-pro-max/scripts/design_system.py +1148 -1148
- package/skills/craft/uipm-ui-ux-pro-max/scripts/search.py +114 -114
- package/skills/craft/uipm-ui-ux-pro-max/templates/base/quick-reference.md +297 -297
- package/skills/craft/uipm-ui-ux-pro-max/templates/base/skill-content.md +375 -375
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/agent.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/augment.json +18 -18
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/claude.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/codebuddy.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/codex.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/continue.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/copilot.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/cursor.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/droid.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/gemini.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/kilocode.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/kiro.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/opencode.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/qoder.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/roocode.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/trae.json +21 -21
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/warp.json +18 -18
- package/skills/craft/uipm-ui-ux-pro-max/templates/platforms/windsurf.json +21 -21
- package/skills/craft/vercel-optimize/AGENTS.md +48 -48
- package/skills/craft/vercel-optimize/CONTRIBUTING.md +41 -41
- package/skills/craft/vercel-optimize/LICENSE +21 -21
- package/skills/craft/vercel-optimize/README.md +91 -91
- package/skills/craft/vercel-optimize/SKILL.md +325 -325
- package/skills/craft/vercel-optimize/lib/auth-route.mjs +23 -23
- package/skills/craft/vercel-optimize/lib/budget-summary.mjs +208 -208
- package/skills/craft/vercel-optimize/lib/citations.mjs +147 -147
- package/skills/craft/vercel-optimize/lib/cost-coverage.mjs +162 -162
- package/skills/craft/vercel-optimize/lib/dedup-recs.mjs +340 -340
- package/skills/craft/vercel-optimize/lib/deep-dive.mjs +371 -371
- package/skills/craft/vercel-optimize/lib/display-labels.mjs +219 -219
- package/skills/craft/vercel-optimize/lib/extract-claims.mjs +640 -640
- package/skills/craft/vercel-optimize/lib/framework-support.mjs +69 -69
- package/skills/craft/vercel-optimize/lib/gates/build-minutes-fanout.mjs +73 -73
- package/skills/craft/vercel-optimize/lib/gates/cold-start.mjs +72 -72
- package/skills/craft/vercel-optimize/lib/gates/contract.mjs +82 -82
- package/skills/craft/vercel-optimize/lib/gates/cwv-poor.mjs +95 -95
- package/skills/craft/vercel-optimize/lib/gates/external-api-slow.mjs +60 -60
- package/skills/craft/vercel-optimize/lib/gates/hard-gates.mjs +70 -70
- package/skills/craft/vercel-optimize/lib/gates/index.mjs +45 -45
- package/skills/craft/vercel-optimize/lib/gates/isr-overrevalidation.mjs +62 -62
- package/skills/craft/vercel-optimize/lib/gates/middleware-heavy.mjs +53 -53
- package/skills/craft/vercel-optimize/lib/gates/observability-events-attribution.mjs +58 -58
- package/skills/craft/vercel-optimize/lib/gates/platform-bot-protection.mjs +123 -123
- package/skills/craft/vercel-optimize/lib/gates/platform-fluid-compute.mjs +94 -94
- package/skills/craft/vercel-optimize/lib/gates/region-misconfig.mjs +71 -71
- package/skills/craft/vercel-optimize/lib/gates/route-errors.mjs +95 -95
- package/skills/craft/vercel-optimize/lib/gates/scanner-driven.mjs +150 -150
- package/skills/craft/vercel-optimize/lib/gates/select-candidates.mjs +137 -137
- package/skills/craft/vercel-optimize/lib/gates/slow-route.mjs +97 -97
- package/skills/craft/vercel-optimize/lib/gates/types.d.ts +38 -38
- package/skills/craft/vercel-optimize/lib/gates/uncached-route.mjs +103 -103
- package/skills/craft/vercel-optimize/lib/gates/usage-spike-triage.mjs +122 -122
- package/skills/craft/vercel-optimize/lib/grade-recommendation.mjs +170 -170
- package/skills/craft/vercel-optimize/lib/impact-label.mjs +128 -128
- package/skills/craft/vercel-optimize/lib/impact-magnitude.mjs +66 -66
- package/skills/craft/vercel-optimize/lib/investigation-brief.mjs +751 -751
- package/skills/craft/vercel-optimize/lib/observation-safety.mjs +217 -217
- package/skills/craft/vercel-optimize/lib/project-facts.mjs +101 -101
- package/skills/craft/vercel-optimize/lib/queries.mjs +333 -333
- package/skills/craft/vercel-optimize/lib/reconcile-candidates.mjs +388 -388
- package/skills/craft/vercel-optimize/lib/render-report.mjs +1065 -1065
- package/skills/craft/vercel-optimize/lib/repo-root.mjs +97 -97
- package/skills/craft/vercel-optimize/lib/route-normalize.mjs +224 -224
- package/skills/craft/vercel-optimize/lib/sanitizers/bot-protection-certainty.mjs +56 -56
- package/skills/craft/vercel-optimize/lib/sanitizers/cache-tag-invalidation-certainty.mjs +33 -33
- package/skills/craft/vercel-optimize/lib/sanitizers/count-correct.mjs +53 -53
- package/skills/craft/vercel-optimize/lib/sanitizers/function-duration-invocations.mjs +32 -32
- package/skills/craft/vercel-optimize/lib/sanitizers/index.mjs +87 -87
- package/skills/craft/vercel-optimize/lib/sanitizers/middleware-conflict.mjs +37 -37
- package/skills/craft/vercel-optimize/lib/sanitizers/missing-citation.mjs +16 -16
- package/skills/craft/vercel-optimize/lib/sanitizers/pre-release.mjs +75 -75
- package/skills/craft/vercel-optimize/lib/sanitizers/rate-limit.mjs +73 -73
- package/skills/craft/vercel-optimize/lib/sanitizers/rendering-mode-mislabel.mjs +42 -42
- package/skills/craft/vercel-optimize/lib/sanitizers/undeclared-dep.mjs +110 -110
- package/skills/craft/vercel-optimize/lib/sanitizers/vercel-directive-strip.mjs +37 -37
- package/skills/craft/vercel-optimize/lib/sanitizers/window-units.mjs +26 -26
- package/skills/craft/vercel-optimize/lib/scanners/cache-components-suspense-dedupe.mjs +114 -114
- package/skills/craft/vercel-optimize/lib/scanners/edge-heavy-import.mjs +102 -102
- package/skills/craft/vercel-optimize/lib/scanners/force-dynamic.mjs +39 -39
- package/skills/craft/vercel-optimize/lib/scanners/headers-in-page.mjs +43 -43
- package/skills/craft/vercel-optimize/lib/scanners/index.mjs +35 -35
- package/skills/craft/vercel-optimize/lib/scanners/large-static-asset.mjs +93 -93
- package/skills/craft/vercel-optimize/lib/scanners/max-age-without-s-maxage.mjs +47 -47
- package/skills/craft/vercel-optimize/lib/scanners/middleware-broad-matcher.mjs +53 -53
- package/skills/craft/vercel-optimize/lib/scanners/missing-cache-headers.mjs +97 -97
- package/skills/craft/vercel-optimize/lib/scanners/prisma-include-tree.mjs +39 -39
- package/skills/craft/vercel-optimize/lib/scanners/region-pin-in-config.mjs +89 -89
- package/skills/craft/vercel-optimize/lib/scanners/source-maps-production.mjs +33 -33
- package/skills/craft/vercel-optimize/lib/scanners/sveltekit-prerender-missing.mjs +47 -47
- package/skills/craft/vercel-optimize/lib/scanners/turbo-force-bypass.mjs +136 -136
- package/skills/craft/vercel-optimize/lib/scanners/unoptimized-image.mjs +127 -127
- package/skills/craft/vercel-optimize/lib/scanners/use-cache-date-stamp.mjs +112 -112
- package/skills/craft/vercel-optimize/lib/support-topics.mjs +365 -365
- package/skills/craft/vercel-optimize/lib/throttle.mjs +280 -280
- package/skills/craft/vercel-optimize/lib/util.mjs +17 -17
- package/skills/craft/vercel-optimize/lib/vercel.mjs +855 -855
- package/skills/craft/vercel-optimize/lib/verify-claim.mjs +1843 -1843
- package/skills/craft/vercel-optimize/lib/workspace-resolver.mjs +552 -552
- package/skills/craft/vercel-optimize/metadata.json +14 -14
- package/skills/craft/vercel-optimize/references/candidates.md +176 -176
- package/skills/craft/vercel-optimize/references/data-collection.md +224 -224
- package/skills/craft/vercel-optimize/references/docs-library.json +683 -683
- package/skills/craft/vercel-optimize/references/doctrine.md +108 -108
- package/skills/craft/vercel-optimize/references/observability-plus.md +109 -109
- package/skills/craft/vercel-optimize/references/playbooks/README.md +57 -57
- package/skills/craft/vercel-optimize/references/playbooks/ai-application.md +32 -32
- package/skills/craft/vercel-optimize/references/playbooks/api-service.md +30 -30
- package/skills/craft/vercel-optimize/references/playbooks/content-site.md +30 -30
- package/skills/craft/vercel-optimize/references/playbooks/ecommerce.md +30 -30
- package/skills/craft/vercel-optimize/references/playbooks/marketing.md +30 -30
- package/skills/craft/vercel-optimize/references/playbooks/saas.md +31 -31
- package/skills/craft/vercel-optimize/references/playbooks/sveltekit.md +75 -75
- package/skills/craft/vercel-optimize/references/recommendations.md +214 -214
- package/skills/craft/vercel-optimize/references/scanner-patterns.md +266 -266
- package/skills/craft/vercel-optimize/references/scoring.md +208 -208
- package/skills/craft/vercel-optimize/references/support-topics/README.md +50 -50
- package/skills/craft/vercel-optimize/references/support-topics/astro-edge-middleware-scope.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/astro-output-mode-and-isr.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/auth-preserving-parallelization.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/bot-protection-product-guardrails.md +32 -32
- package/skills/craft/vercel-optimize/references/support-topics/build-minutes-monorepo-fanout.md +32 -32
- package/skills/craft/vercel-optimize/references/support-topics/cache-components-static-shell-boundaries.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/cache-components-suspense-dedupe-pitfall.md +32 -32
- package/skills/craft/vercel-optimize/references/support-topics/cdn-cache-auth-safety.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/cold-start-initialization-bundle.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/core-web-vitals-client-bottlenecks.md +33 -33
- package/skills/craft/vercel-optimize/references/support-topics/database-egress-pooling-region.md +32 -32
- package/skills/craft/vercel-optimize/references/support-topics/dynamic-rendering-traps.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/external-api-critical-path-platform.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/external-api-critical-path.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/fast-data-transfer-payloads.md +26 -26
- package/skills/craft/vercel-optimize/references/support-topics/fluid-compute-caveats.md +26 -26
- package/skills/craft/vercel-optimize/references/support-topics/function-duration-io-and-after.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/function-invocation-reduction.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/function-region-misconfiguration-ttfb.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/image-optimization-cost-control.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/isr-revalidation-static-generation.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/middleware-proxy-edge-cost.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/next-fetch-revalidate-floor.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/next-font-cls-self-hosting.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/next-heavy-ui-lazy-load-boundaries.md +28 -28
- package/skills/craft/vercel-optimize/references/support-topics/next-image-lcp-preload-sizes.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/next-route-handler-get-cache-defaults.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/next-script-third-party-strategy.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/nextjs-version-cache-semantics.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/not-found-catchall-request-waste.md +33 -33
- package/skills/craft/vercel-optimize/references/support-topics/nuxt-route-rules-cache-isr.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/observability-events-cost-attribution.md +27 -27
- package/skills/craft/vercel-optimize/references/support-topics/post-response-work-waituntil.md +26 -26
- package/skills/craft/vercel-optimize/references/support-topics/route-error-durable-offload.md +33 -33
- package/skills/craft/vercel-optimize/references/support-topics/route-error-runtime-limits.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/runtime-cache-reusable-data.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/sveltekit-isr-prerender-safety.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/sveltekit-split-cold-start-tradeoff.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/usage-spike-triage.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/use-cache-date-stamp-isr-write-amplifier.md +31 -31
- package/skills/craft/vercel-optimize/references/support-topics/use-cache-remote-shared-origin-data.md +30 -30
- package/skills/craft/vercel-optimize/references/support-topics/workflow-resumable-stream-routes.md +32 -32
- package/skills/craft/vercel-optimize/references/verification.md +102 -102
- package/skills/craft/vercel-optimize/references/voice.md +76 -76
- package/skills/craft/vercel-optimize/scripts/budget-summary.mjs +58 -58
- package/skills/craft/vercel-optimize/scripts/build-docs.mjs +76 -76
- package/skills/craft/vercel-optimize/scripts/check-citations.mjs +91 -91
- package/skills/craft/vercel-optimize/scripts/check-docs-fresh.mjs +100 -100
- package/skills/craft/vercel-optimize/scripts/collect-signals.mjs +638 -638
- package/skills/craft/vercel-optimize/scripts/collect-sub-agent-outputs.mjs +306 -306
- package/skills/craft/vercel-optimize/scripts/deep-dive.mjs +358 -358
- package/skills/craft/vercel-optimize/scripts/gate-investigations.mjs +178 -178
- package/skills/craft/vercel-optimize/scripts/merge-signals.mjs +203 -203
- package/skills/craft/vercel-optimize/scripts/prepare-investigation-brief.mjs +249 -249
- package/skills/craft/vercel-optimize/scripts/reconcile-candidates.mjs +69 -69
- package/skills/craft/vercel-optimize/scripts/render-report.mjs +462 -462
- package/skills/craft/vercel-optimize/scripts/scan-codebase.mjs +361 -361
- package/skills/craft/vercel-optimize/scripts/verify-and-regen.mjs +379 -379
- package/skills/craft/vercel-optimize/scripts/verify-finding.mjs +21 -21
- package/skills/craft/web-design-guidelines/LICENSE +21 -21
- package/skills/craft/web-design-guidelines/SKILL.md +43 -43
- package/skills/craft/zero-to-live/LICENSE +21 -21
- package/skills/craft/zero-to-live/SKILL.md +422 -422
- package/skills/creative/creative-3d-modeling/LICENSE +21 -21
- package/skills/creative/creative-3d-modeling/SKILL.md +70 -70
- package/skills/creative/creative-architecture/LICENSE +21 -21
- package/skills/creative/creative-architecture/SKILL.md +94 -94
- package/skills/creative/creative-design-principles/LICENSE +21 -21
- package/skills/creative/creative-design-principles/SKILL.md +95 -95
- package/skills/creative/creative-fashion-advanced/LICENSE +21 -21
- package/skills/creative/creative-fashion-advanced/SKILL.md +68 -68
- package/skills/creative/creative-fashion-design/LICENSE +21 -21
- package/skills/creative/creative-fashion-design/SKILL.md +66 -66
- package/skills/creative/creative-game-design/LICENSE +21 -21
- package/skills/creative/creative-game-design/SKILL.md +77 -77
- package/skills/creative/creative-industrial-design/LICENSE +21 -21
- package/skills/creative/creative-industrial-design/SKILL.md +57 -57
- package/skills/creative/creative-interior-design/LICENSE +21 -21
- package/skills/creative/creative-interior-design/SKILL.md +59 -59
- package/skills/creative/creative-music-theory/LICENSE +21 -21
- package/skills/creative/creative-music-theory/SKILL.md +98 -98
- package/skills/creative/creative-photography/LICENSE +21 -21
- package/skills/creative/creative-photography/SKILL.md +87 -87
- package/skills/creative/creative-textile-science/LICENSE +21 -21
- package/skills/creative/creative-textile-science/SKILL.md +67 -67
- package/skills/creative/creative-ux/LICENSE +21 -21
- package/skills/creative/creative-ux/SKILL.md +81 -81
- package/skills/creative/creative-video/LICENSE +21 -21
- package/skills/creative/creative-video/SKILL.md +84 -84
- package/skills/creative/creative-writing-craft/LICENSE +21 -21
- package/skills/creative/creative-writing-craft/SKILL.md +91 -91
- package/skills/diagram-maker/SKILL.md +56 -56
- package/skills/diagram-maker/references/excalidraw-patterns.md +85 -85
- package/skills/diagram-maker/references/svg-template.md +112 -112
- package/skills/discord/SKILL.md +140 -140
- package/skills/education/edu-adult-learning/LICENSE +21 -21
- package/skills/education/edu-adult-learning/SKILL.md +81 -81
- package/skills/education/edu-africa-multilingual/LICENSE +21 -21
- package/skills/education/edu-africa-multilingual/SKILL.md +55 -55
- package/skills/education/edu-arabic/LICENSE +21 -21
- package/skills/education/edu-arabic/SKILL.md +60 -60
- package/skills/education/edu-australia-nz/LICENSE +21 -21
- package/skills/education/edu-australia-nz/SKILL.md +48 -48
- package/skills/education/edu-china-mandarin/LICENSE +21 -21
- package/skills/education/edu-china-mandarin/SKILL.md +58 -58
- package/skills/education/edu-critical-thinking/LICENSE +21 -21
- package/skills/education/edu-critical-thinking/SKILL.md +86 -86
- package/skills/education/edu-curriculum/LICENSE +21 -21
- package/skills/education/edu-curriculum/SKILL.md +87 -87
- package/skills/education/edu-ed-tech/LICENSE +21 -21
- package/skills/education/edu-ed-tech/SKILL.md +73 -73
- package/skills/education/edu-france/LICENSE +21 -21
- package/skills/education/edu-france/SKILL.md +42 -42
- package/skills/education/edu-germany/LICENSE +21 -21
- package/skills/education/edu-germany/SKILL.md +46 -46
- package/skills/education/edu-india-competitive/LICENSE +21 -21
- package/skills/education/edu-india-competitive/SKILL.md +159 -159
- package/skills/education/edu-india-east/LICENSE +21 -21
- package/skills/education/edu-india-east/SKILL.md +60 -60
- package/skills/education/edu-india-hindi/LICENSE +21 -21
- package/skills/education/edu-india-hindi/SKILL.md +107 -107
- package/skills/education/edu-india-south/LICENSE +21 -21
- package/skills/education/edu-india-south/SKILL.md +64 -64
- package/skills/education/edu-india-west/LICENSE +21 -21
- package/skills/education/edu-india-west/SKILL.md +68 -68
- package/skills/education/edu-indonesia-malay/LICENSE +21 -21
- package/skills/education/edu-indonesia-malay/SKILL.md +57 -57
- package/skills/education/edu-international-ib/LICENSE +21 -21
- package/skills/education/edu-international-ib/SKILL.md +61 -61
- package/skills/education/edu-japan/LICENSE +21 -21
- package/skills/education/edu-japan/SKILL.md +48 -48
- package/skills/education/edu-korea/LICENSE +21 -21
- package/skills/education/edu-korea/SKILL.md +48 -48
- package/skills/education/edu-learning-science/LICENSE +21 -21
- package/skills/education/edu-learning-science/SKILL.md +76 -76
- package/skills/education/edu-portuguese-brazil/LICENSE +21 -21
- package/skills/education/edu-portuguese-brazil/SKILL.md +51 -51
- package/skills/education/edu-russia/LICENSE +21 -21
- package/skills/education/edu-russia/SKILL.md +50 -50
- package/skills/education/edu-spain-latam/LICENSE +21 -21
- package/skills/education/edu-spain-latam/SKILL.md +55 -55
- package/skills/education/edu-special/LICENSE +21 -21
- package/skills/education/edu-special/SKILL.md +76 -76
- package/skills/education/edu-thailand/LICENSE +21 -21
- package/skills/education/edu-thailand/SKILL.md +55 -55
- package/skills/education/edu-turkey/LICENSE +21 -21
- package/skills/education/edu-turkey/SKILL.md +58 -58
- package/skills/education/edu-uk-gcse-alevel/LICENSE +21 -21
- package/skills/education/edu-uk-gcse-alevel/SKILL.md +51 -51
- package/skills/education/edu-usa-graduate/LICENSE +21 -21
- package/skills/education/edu-usa-graduate/SKILL.md +57 -57
- package/skills/education/edu-usa-sat-act/LICENSE +21 -21
- package/skills/education/edu-usa-sat-act/SKILL.md +55 -55
- package/skills/education/edu-vietnam/LICENSE +21 -21
- package/skills/education/edu-vietnam/SKILL.md +53 -53
- package/skills/eightctl/SKILL.md +54 -54
- package/skills/engineering/eng-aerospace/LICENSE +21 -21
- package/skills/engineering/eng-aerospace/SKILL.md +117 -117
- package/skills/engineering/eng-chemical/LICENSE +21 -21
- package/skills/engineering/eng-chemical/SKILL.md +63 -63
- package/skills/engineering/eng-civil/LICENSE +21 -21
- package/skills/engineering/eng-civil/SKILL.md +223 -223
- package/skills/engineering/eng-control-systems/LICENSE +21 -21
- package/skills/engineering/eng-control-systems/SKILL.md +158 -158
- package/skills/engineering/eng-cryogenics/LICENSE +21 -21
- package/skills/engineering/eng-cryogenics/SKILL.md +151 -151
- package/skills/engineering/eng-electrical/LICENSE +21 -21
- package/skills/engineering/eng-electrical/SKILL.md +70 -70
- package/skills/engineering/eng-electronics-embedded/LICENSE +21 -21
- package/skills/engineering/eng-electronics-embedded/SKILL.md +89 -89
- package/skills/engineering/eng-environmental/LICENSE +21 -21
- package/skills/engineering/eng-environmental/SKILL.md +66 -66
- package/skills/engineering/eng-manufacturing/LICENSE +21 -21
- package/skills/engineering/eng-manufacturing/SKILL.md +78 -78
- package/skills/engineering/eng-mechanical/LICENSE +21 -21
- package/skills/engineering/eng-mechanical/SKILL.md +66 -66
- package/skills/engineering/eng-project/LICENSE +21 -21
- package/skills/engineering/eng-project/SKILL.md +72 -72
- package/skills/engineering/eng-propulsion/LICENSE +21 -21
- package/skills/engineering/eng-propulsion/SKILL.md +133 -133
- package/skills/engineering/eng-robotics/LICENSE +21 -21
- package/skills/engineering/eng-robotics/SKILL.md +92 -92
- package/skills/engineering/eng-systems/LICENSE +21 -21
- package/skills/engineering/eng-systems/SKILL.md +81 -81
- package/skills/environment/env-biodiversity/LICENSE +21 -21
- package/skills/environment/env-biodiversity/SKILL.md +66 -66
- package/skills/environment/env-circular-economy/LICENSE +21 -21
- package/skills/environment/env-circular-economy/SKILL.md +71 -71
- package/skills/environment/env-climate-action/LICENSE +21 -21
- package/skills/environment/env-climate-action/SKILL.md +55 -55
- package/skills/environment/env-energy/LICENSE +21 -21
- package/skills/environment/env-energy/SKILL.md +83 -83
- package/skills/environment/env-sustainability-biz/LICENSE +21 -21
- package/skills/environment/env-sustainability-biz/SKILL.md +65 -65
- package/skills/environment/env-water/LICENSE +21 -21
- package/skills/environment/env-water/SKILL.md +67 -67
- package/skills/finance/finance-accounting/LICENSE +21 -21
- package/skills/finance/finance-accounting/SKILL.md +239 -239
- package/skills/finance/finance-banking/LICENSE +21 -21
- package/skills/finance/finance-banking/SKILL.md +54 -54
- package/skills/finance/finance-corporate/LICENSE +21 -21
- package/skills/finance/finance-corporate/SKILL.md +105 -105
- package/skills/finance/finance-crypto/LICENSE +21 -21
- package/skills/finance/finance-crypto/SKILL.md +94 -94
- package/skills/finance/finance-debt-management/LICENSE +21 -21
- package/skills/finance/finance-debt-management/SKILL.md +87 -87
- package/skills/finance/finance-insurance/LICENSE +21 -21
- package/skills/finance/finance-insurance/SKILL.md +91 -91
- package/skills/finance/finance-investing/LICENSE +21 -21
- package/skills/finance/finance-investing/SKILL.md +269 -269
- package/skills/finance/finance-options-derivatives/LICENSE +21 -21
- package/skills/finance/finance-options-derivatives/SKILL.md +68 -68
- package/skills/finance/finance-personal/LICENSE +21 -21
- package/skills/finance/finance-personal/SKILL.md +268 -268
- package/skills/finance/finance-real-estate/LICENSE +21 -21
- package/skills/finance/finance-real-estate/SKILL.md +110 -110
- package/skills/finance/finance-startup/LICENSE +21 -21
- package/skills/finance/finance-startup/SKILL.md +253 -253
- package/skills/finance/finance-tax-planning/LICENSE +21 -21
- package/skills/finance/finance-tax-planning/SKILL.md +89 -89
- package/skills/finance/finance-trading/LICENSE +21 -21
- package/skills/finance/finance-trading/SKILL.md +112 -112
- package/skills/gemini/SKILL.md +51 -51
- package/skills/gh-issues/SKILL.md +216 -216
- package/skills/gifgrep/SKILL.md +89 -89
- package/skills/github/SKILL.md +87 -87
- package/skills/gog/SKILL.md +120 -120
- package/skills/goplaces/SKILL.md +56 -56
- package/skills/graphify/SKILL.md +619 -0
- package/skills/graphify/__init__.py +28 -0
- package/skills/graphify/__main__.py +4582 -0
- package/skills/graphify/affected.py +154 -0
- package/skills/graphify/always_on/agents-md.md +12 -0
- package/skills/graphify/always_on/antigravity-rules.md +14 -0
- package/skills/graphify/always_on/claude-md.md +9 -0
- package/skills/graphify/always_on/gemini-md.md +9 -0
- package/skills/graphify/always_on/kiro-steering.md +5 -0
- package/skills/graphify/always_on/vscode-instructions.md +17 -0
- package/skills/graphify/analyze.py +724 -0
- package/skills/graphify/benchmark.py +155 -0
- package/skills/graphify/build.py +487 -0
- package/skills/graphify/cache.py +417 -0
- package/skills/graphify/callflow_html.py +2020 -0
- package/skills/graphify/cluster.py +272 -0
- package/skills/graphify/command-kilo.md +15 -0
- package/skills/graphify/dedup.py +429 -0
- package/skills/graphify/detect.py +1379 -0
- package/skills/graphify/diagnostics.py +390 -0
- package/skills/graphify/export.py +1408 -0
- package/skills/graphify/extract.py +11570 -0
- package/skills/graphify/global_graph.py +159 -0
- package/skills/graphify/google_workspace.py +223 -0
- package/skills/graphify/hooks.py +457 -0
- package/skills/graphify/ingest.py +331 -0
- package/skills/graphify/llm.py +1896 -0
- package/skills/graphify/manifest.py +4 -0
- package/skills/graphify/mcp_ingest.py +392 -0
- package/skills/graphify/multigraph_compat.py +212 -0
- package/skills/graphify/pg_introspect.py +142 -0
- package/skills/graphify/prs.py +748 -0
- package/skills/graphify/querylog.py +70 -0
- package/skills/graphify/report.py +218 -0
- package/skills/graphify/scip_ingest.py +363 -0
- package/skills/graphify/security.py +336 -0
- package/skills/graphify/semantic_cleanup.py +319 -0
- package/skills/graphify/serve.py +1309 -0
- package/skills/graphify/skill-aider.md +1246 -0
- package/skills/graphify/skill-amp.md +613 -0
- package/skills/graphify/skill-claw.md +616 -0
- package/skills/graphify/skill-codex.md +613 -0
- package/skills/graphify/skill-copilot.md +616 -0
- package/skills/graphify/skill-devin.md +1372 -0
- package/skills/graphify/skill-droid.md +613 -0
- package/skills/graphify/skill-kilo.md +625 -0
- package/skills/graphify/skill-kiro.md +615 -0
- package/skills/graphify/skill-opencode.md +608 -0
- package/skills/graphify/skill-pi.md +615 -0
- package/skills/graphify/skill-trae.md +614 -0
- package/skills/graphify/skill-vscode.md +612 -0
- package/skills/graphify/skill-windows.md +651 -0
- package/skills/graphify/skills/amp/references/add-watch.md +56 -0
- package/skills/graphify/skills/amp/references/exports.md +71 -0
- package/skills/graphify/skills/amp/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/amp/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/amp/references/hooks.md +33 -0
- package/skills/graphify/skills/amp/references/query.md +249 -0
- package/skills/graphify/skills/amp/references/transcribe.md +48 -0
- package/skills/graphify/skills/amp/references/update.md +179 -0
- package/skills/graphify/skills/claude/references/add-watch.md +56 -0
- package/skills/graphify/skills/claude/references/exports.md +71 -0
- package/skills/graphify/skills/claude/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/claude/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/claude/references/hooks.md +33 -0
- package/skills/graphify/skills/claude/references/query.md +103 -0
- package/skills/graphify/skills/claude/references/transcribe.md +48 -0
- package/skills/graphify/skills/claude/references/update.md +179 -0
- package/skills/graphify/skills/claw/references/add-watch.md +56 -0
- package/skills/graphify/skills/claw/references/exports.md +71 -0
- package/skills/graphify/skills/claw/references/extraction-spec.md +29 -0
- package/skills/graphify/skills/claw/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/claw/references/hooks.md +33 -0
- package/skills/graphify/skills/claw/references/query.md +249 -0
- package/skills/graphify/skills/claw/references/transcribe.md +48 -0
- package/skills/graphify/skills/claw/references/update.md +179 -0
- package/skills/graphify/skills/codex/references/add-watch.md +56 -0
- package/skills/graphify/skills/codex/references/exports.md +71 -0
- package/skills/graphify/skills/codex/references/extraction-spec.md +29 -0
- package/skills/graphify/skills/codex/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/codex/references/hooks.md +33 -0
- package/skills/graphify/skills/codex/references/query.md +249 -0
- package/skills/graphify/skills/codex/references/transcribe.md +48 -0
- package/skills/graphify/skills/codex/references/update.md +179 -0
- package/skills/graphify/skills/copilot/references/add-watch.md +56 -0
- package/skills/graphify/skills/copilot/references/exports.md +71 -0
- package/skills/graphify/skills/copilot/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/copilot/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/copilot/references/hooks.md +33 -0
- package/skills/graphify/skills/copilot/references/query.md +249 -0
- package/skills/graphify/skills/copilot/references/transcribe.md +48 -0
- package/skills/graphify/skills/copilot/references/update.md +179 -0
- package/skills/graphify/skills/droid/references/add-watch.md +56 -0
- package/skills/graphify/skills/droid/references/exports.md +71 -0
- package/skills/graphify/skills/droid/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/droid/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/droid/references/hooks.md +33 -0
- package/skills/graphify/skills/droid/references/query.md +249 -0
- package/skills/graphify/skills/droid/references/transcribe.md +48 -0
- package/skills/graphify/skills/droid/references/update.md +179 -0
- package/skills/graphify/skills/kilo/references/add-watch.md +56 -0
- package/skills/graphify/skills/kilo/references/exports.md +71 -0
- package/skills/graphify/skills/kilo/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/kilo/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/kilo/references/hooks.md +33 -0
- package/skills/graphify/skills/kilo/references/query.md +249 -0
- package/skills/graphify/skills/kilo/references/transcribe.md +48 -0
- package/skills/graphify/skills/kilo/references/update.md +179 -0
- package/skills/graphify/skills/kiro/references/add-watch.md +56 -0
- package/skills/graphify/skills/kiro/references/exports.md +71 -0
- package/skills/graphify/skills/kiro/references/extraction-spec.md +29 -0
- package/skills/graphify/skills/kiro/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/kiro/references/hooks.md +33 -0
- package/skills/graphify/skills/kiro/references/query.md +249 -0
- package/skills/graphify/skills/kiro/references/transcribe.md +48 -0
- package/skills/graphify/skills/kiro/references/update.md +179 -0
- package/skills/graphify/skills/opencode/references/add-watch.md +56 -0
- package/skills/graphify/skills/opencode/references/exports.md +71 -0
- package/skills/graphify/skills/opencode/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/opencode/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/opencode/references/hooks.md +33 -0
- package/skills/graphify/skills/opencode/references/query.md +249 -0
- package/skills/graphify/skills/opencode/references/transcribe.md +48 -0
- package/skills/graphify/skills/opencode/references/update.md +179 -0
- package/skills/graphify/skills/pi/references/add-watch.md +56 -0
- package/skills/graphify/skills/pi/references/exports.md +71 -0
- package/skills/graphify/skills/pi/references/extraction-spec.md +29 -0
- package/skills/graphify/skills/pi/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/pi/references/hooks.md +33 -0
- package/skills/graphify/skills/pi/references/query.md +249 -0
- package/skills/graphify/skills/pi/references/transcribe.md +48 -0
- package/skills/graphify/skills/pi/references/update.md +179 -0
- package/skills/graphify/skills/trae/references/add-watch.md +56 -0
- package/skills/graphify/skills/trae/references/exports.md +71 -0
- package/skills/graphify/skills/trae/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/trae/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/trae/references/hooks.md +35 -0
- package/skills/graphify/skills/trae/references/query.md +249 -0
- package/skills/graphify/skills/trae/references/transcribe.md +48 -0
- package/skills/graphify/skills/trae/references/update.md +179 -0
- package/skills/graphify/skills/vscode/references/add-watch.md +56 -0
- package/skills/graphify/skills/vscode/references/exports.md +71 -0
- package/skills/graphify/skills/vscode/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/vscode/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/vscode/references/hooks.md +33 -0
- package/skills/graphify/skills/vscode/references/query.md +249 -0
- package/skills/graphify/skills/vscode/references/transcribe.md +48 -0
- package/skills/graphify/skills/vscode/references/update.md +179 -0
- package/skills/graphify/skills/windows/references/add-watch.md +56 -0
- package/skills/graphify/skills/windows/references/exports.md +71 -0
- package/skills/graphify/skills/windows/references/extraction-spec.md +68 -0
- package/skills/graphify/skills/windows/references/github-and-merge.md +46 -0
- package/skills/graphify/skills/windows/references/hooks.md +33 -0
- package/skills/graphify/skills/windows/references/query.md +249 -0
- package/skills/graphify/skills/windows/references/transcribe.md +48 -0
- package/skills/graphify/skills/windows/references/update.md +179 -0
- package/skills/graphify/symbol_resolution.py +538 -0
- package/skills/graphify/transcribe.py +184 -0
- package/skills/graphify/tree_html.py +582 -0
- package/skills/graphify/validate.py +72 -0
- package/skills/graphify/watch.py +898 -0
- package/skills/graphify/wiki.py +282 -0
- package/skills/health/health-aging/LICENSE +21 -21
- package/skills/health/health-aging/SKILL.md +82 -82
- package/skills/health/health-chronic/LICENSE +21 -21
- package/skills/health/health-chronic/SKILL.md +202 -202
- package/skills/health/health-dental/LICENSE +21 -21
- package/skills/health/health-dental/SKILL.md +41 -41
- package/skills/health/health-eye-care/LICENSE +21 -21
- package/skills/health/health-eye-care/SKILL.md +56 -56
- package/skills/health/health-first-aid/LICENSE +21 -21
- package/skills/health/health-first-aid/SKILL.md +201 -201
- package/skills/health/health-fitness/LICENSE +21 -21
- package/skills/health/health-fitness/SKILL.md +111 -111
- package/skills/health/health-general/LICENSE +21 -21
- package/skills/health/health-general/SKILL.md +277 -277
- package/skills/health/health-mens/LICENSE +21 -21
- package/skills/health/health-mens/SKILL.md +53 -53
- package/skills/health/health-mental/LICENSE +21 -21
- package/skills/health/health-mental/SKILL.md +221 -221
- package/skills/health/health-naturopathy-ayurveda/LICENSE +21 -21
- package/skills/health/health-naturopathy-ayurveda/SKILL.md +60 -60
- package/skills/health/health-nutrition/LICENSE +21 -21
- package/skills/health/health-nutrition/SKILL.md +262 -262
- package/skills/health/health-pediatric/LICENSE +21 -21
- package/skills/health/health-pediatric/SKILL.md +94 -94
- package/skills/health/health-pharmacology/LICENSE +21 -21
- package/skills/health/health-pharmacology/SKILL.md +87 -87
- package/skills/health/health-pregnancy/LICENSE +21 -21
- package/skills/health/health-pregnancy/SKILL.md +71 -71
- package/skills/health/health-skin/LICENSE +21 -21
- package/skills/health/health-skin/SKILL.md +71 -71
- package/skills/health/health-sleep/LICENSE +21 -21
- package/skills/health/health-sleep/SKILL.md +81 -81
- package/skills/health/health-womens/LICENSE +21 -21
- package/skills/health/health-womens/SKILL.md +72 -72
- package/skills/health/health-yoga-wellness/LICENSE +21 -21
- package/skills/health/health-yoga-wellness/SKILL.md +58 -58
- package/skills/healthcare-systems/health-sys-global/LICENSE +21 -21
- package/skills/healthcare-systems/health-sys-global/SKILL.md +69 -69
- package/skills/healthcare-systems/health-sys-management/LICENSE +21 -21
- package/skills/healthcare-systems/health-sys-management/SKILL.md +71 -71
- package/skills/healthcare-systems/health-sys-navigation/LICENSE +21 -21
- package/skills/healthcare-systems/health-sys-navigation/SKILL.md +60 -60
- package/skills/healthcare-systems/health-sys-public/LICENSE +21 -21
- package/skills/healthcare-systems/health-sys-public/SKILL.md +71 -71
- package/skills/healthcheck/SKILL.md +109 -109
- package/skills/himalaya/SKILL.md +84 -84
- package/skills/himalaya/references/configuration.md +184 -184
- package/skills/himalaya/references/message-composition.md +199 -199
- package/skills/humanities/humanities-history-world/LICENSE +21 -21
- package/skills/humanities/humanities-history-world/SKILL.md +59 -59
- package/skills/humanities/humanities-indian-classical/LICENSE +21 -21
- package/skills/humanities/humanities-indian-classical/SKILL.md +104 -104
- package/skills/humanities/humanities-philosophy/LICENSE +21 -21
- package/skills/humanities/humanities-philosophy/SKILL.md +105 -105
- package/skills/humanities/humanities-world-religions/LICENSE +21 -21
- package/skills/humanities/humanities-world-religions/SKILL.md +67 -67
- package/skills/impeccable/SKILL.md +186 -0
- package/skills/impeccable/agents/impeccable_asset_producer.toml +92 -0
- package/skills/impeccable/agents/impeccable_manual_edit_applier.toml +95 -0
- package/skills/impeccable/agents/openai.yaml +4 -0
- package/skills/impeccable/reference/adapt.md +311 -0
- package/skills/impeccable/reference/animate.md +201 -0
- package/skills/impeccable/reference/audit.md +133 -0
- package/skills/impeccable/reference/bolder.md +113 -0
- package/skills/impeccable/reference/brand.md +108 -0
- package/skills/impeccable/reference/clarify.md +288 -0
- package/skills/impeccable/reference/codex.md +105 -0
- package/skills/impeccable/reference/colorize.md +257 -0
- package/skills/impeccable/reference/craft.md +123 -0
- package/skills/impeccable/reference/critique.md +790 -0
- package/skills/impeccable/reference/delight.md +302 -0
- package/skills/impeccable/reference/distill.md +111 -0
- package/skills/impeccable/reference/document.md +429 -0
- package/skills/impeccable/reference/extract.md +69 -0
- package/skills/impeccable/reference/harden.md +347 -0
- package/skills/impeccable/reference/init.md +172 -0
- package/skills/impeccable/reference/interaction-design.md +189 -0
- package/skills/impeccable/reference/layout.md +161 -0
- package/skills/impeccable/reference/live.md +720 -0
- package/skills/impeccable/reference/onboard.md +234 -0
- package/skills/impeccable/reference/optimize.md +258 -0
- package/skills/impeccable/reference/overdrive.md +130 -0
- package/skills/impeccable/reference/polish.md +241 -0
- package/skills/impeccable/reference/product.md +60 -0
- package/skills/impeccable/reference/quieter.md +99 -0
- package/skills/impeccable/reference/shape.md +165 -0
- package/skills/impeccable/reference/typeset.md +279 -0
- package/skills/impeccable/scripts/cleanup-deprecated.mjs +284 -0
- package/skills/impeccable/scripts/command-metadata.json +94 -0
- package/skills/impeccable/scripts/context-signals.mjs +225 -0
- package/skills/impeccable/scripts/context.mjs +266 -0
- package/skills/impeccable/scripts/critique-storage.mjs +242 -0
- package/skills/impeccable/scripts/design-parser.mjs +835 -0
- package/skills/impeccable/scripts/detect-csp.mjs +198 -0
- package/skills/impeccable/scripts/detect.mjs +21 -0
- package/skills/impeccable/scripts/detector/browser/injected/index.mjs +1733 -0
- package/skills/impeccable/scripts/detector/cli/main.mjs +244 -0
- package/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +4618 -0
- package/skills/impeccable/scripts/detector/detect-antipatterns.mjs +43 -0
- package/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +252 -0
- package/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +535 -0
- package/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +986 -0
- package/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +208 -0
- package/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
- package/skills/impeccable/scripts/detector/findings.mjs +12 -0
- package/skills/impeccable/scripts/detector/node/file-system.mjs +198 -0
- package/skills/impeccable/scripts/detector/profile/profiler.mjs +166 -0
- package/skills/impeccable/scripts/detector/registry/antipatterns.mjs +419 -0
- package/skills/impeccable/scripts/detector/rules/checks.mjs +2384 -0
- package/skills/impeccable/scripts/detector/shared/color.mjs +124 -0
- package/skills/impeccable/scripts/detector/shared/constants.mjs +101 -0
- package/skills/impeccable/scripts/detector/shared/page.mjs +7 -0
- package/skills/impeccable/scripts/impeccable-paths.mjs +126 -0
- package/skills/impeccable/scripts/is-generated.mjs +69 -0
- package/skills/impeccable/scripts/live-accept.mjs +812 -0
- package/skills/impeccable/scripts/live-browser-session.js +123 -0
- package/skills/impeccable/scripts/live-browser.js +10295 -0
- package/skills/impeccable/scripts/live-commit-manual-edits.mjs +1241 -0
- package/skills/impeccable/scripts/live-complete.mjs +75 -0
- package/skills/impeccable/scripts/live-completion.mjs +19 -0
- package/skills/impeccable/scripts/live-copy-edit-agent.mjs +683 -0
- package/skills/impeccable/scripts/live-discard-manual-edits.mjs +51 -0
- package/skills/impeccable/scripts/live-event-validation.mjs +137 -0
- package/skills/impeccable/scripts/live-inject.mjs +557 -0
- package/skills/impeccable/scripts/live-insert-ui.mjs +458 -0
- package/skills/impeccable/scripts/live-insert.mjs +272 -0
- package/skills/impeccable/scripts/live-manual-edit-evidence.mjs +363 -0
- package/skills/impeccable/scripts/live-manual-edits-buffer.mjs +152 -0
- package/skills/impeccable/scripts/live-poll.mjs +379 -0
- package/skills/impeccable/scripts/live-resume.mjs +94 -0
- package/skills/impeccable/scripts/live-server.mjs +2326 -0
- package/skills/impeccable/scripts/live-session-store.mjs +289 -0
- package/skills/impeccable/scripts/live-status.mjs +61 -0
- package/skills/impeccable/scripts/live-svelte-component.mjs +826 -0
- package/skills/impeccable/scripts/live-sveltekit-adapter.mjs +274 -0
- package/skills/impeccable/scripts/live-ui-core.mjs +179 -0
- package/skills/impeccable/scripts/live-vocabulary.mjs +36 -0
- package/skills/impeccable/scripts/live-wrap.mjs +894 -0
- package/skills/impeccable/scripts/live.mjs +246 -0
- package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/skills/impeccable/scripts/palette.mjs +633 -0
- package/skills/impeccable/scripts/pin.mjs +214 -0
- package/skills/imsg/SKILL.md +126 -126
- package/skills/industry/industry-construction/LICENSE +21 -21
- package/skills/industry/industry-construction/SKILL.md +81 -81
- package/skills/industry/industry-education-sector/LICENSE +21 -21
- package/skills/industry/industry-education-sector/SKILL.md +49 -49
- package/skills/industry/industry-fashion/LICENSE +21 -21
- package/skills/industry/industry-fashion/SKILL.md +82 -82
- package/skills/industry/industry-food/LICENSE +21 -21
- package/skills/industry/industry-food/SKILL.md +79 -79
- package/skills/industry/industry-government/LICENSE +21 -21
- package/skills/industry/industry-government/SKILL.md +80 -80
- package/skills/industry/industry-hospitality/LICENSE +21 -21
- package/skills/industry/industry-hospitality/SKILL.md +73 -73
- package/skills/industry/industry-insurance-sector/LICENSE +21 -21
- package/skills/industry/industry-insurance-sector/SKILL.md +57 -57
- package/skills/industry/industry-logistics/LICENSE +21 -21
- package/skills/industry/industry-logistics/SKILL.md +80 -80
- package/skills/industry/industry-media/LICENSE +21 -21
- package/skills/industry/industry-media/SKILL.md +66 -66
- package/skills/industry/industry-nonprofit/LICENSE +21 -21
- package/skills/industry/industry-nonprofit/SKILL.md +77 -77
- package/skills/industry/industry-pharma/LICENSE +21 -21
- package/skills/industry/industry-pharma/SKILL.md +69 -69
- package/skills/industry/industry-real-estate/LICENSE +21 -21
- package/skills/industry/industry-real-estate/SKILL.md +61 -61
- package/skills/industry/industry-sports/LICENSE +21 -21
- package/skills/industry/industry-sports/SKILL.md +71 -71
- package/skills/industry/industry-tech-startup/LICENSE +21 -21
- package/skills/industry/industry-tech-startup/SKILL.md +82 -82
- package/skills/internal-comms/LICENSE +21 -21
- package/skills/internal-comms/SKILL.md +38 -38
- package/skills/internal-comms/examples/3p-updates.md +49 -49
- package/skills/internal-comms/examples/company-newsletter.md +76 -76
- package/skills/internal-comms/examples/faq-answers.md +35 -35
- package/skills/internal-comms/examples/general-comms.md +19 -19
- package/skills/legal/legal-business/LICENSE +21 -21
- package/skills/legal/legal-business/SKILL.md +227 -227
- package/skills/legal/legal-consumer/LICENSE +21 -21
- package/skills/legal/legal-consumer/SKILL.md +155 -155
- package/skills/legal/legal-contracts/LICENSE +21 -21
- package/skills/legal/legal-contracts/SKILL.md +268 -268
- package/skills/legal/legal-corporate-governance/LICENSE +21 -21
- package/skills/legal/legal-corporate-governance/SKILL.md +53 -53
- package/skills/legal/legal-employment/LICENSE +21 -21
- package/skills/legal/legal-employment/SKILL.md +291 -291
- package/skills/legal/legal-immigration/LICENSE +21 -21
- package/skills/legal/legal-immigration/SKILL.md +146 -146
- package/skills/legal/legal-international/LICENSE +21 -21
- package/skills/legal/legal-international/SKILL.md +51 -51
- package/skills/legal/legal-ip/LICENSE +21 -21
- package/skills/legal/legal-ip/SKILL.md +264 -264
- package/skills/legal/legal-privacy/LICENSE +21 -21
- package/skills/legal/legal-privacy/SKILL.md +161 -161
- package/skills/legal/legal-real-estate/LICENSE +21 -21
- package/skills/legal/legal-real-estate/SKILL.md +142 -142
- package/skills/legal/legal-startup/LICENSE +21 -21
- package/skills/legal/legal-startup/SKILL.md +182 -182
- package/skills/legal/legal-tax/LICENSE +21 -21
- package/skills/legal/legal-tax/SKILL.md +156 -156
- package/skills/mcp-builder/LICENSE +21 -21
- package/skills/mcp-builder/SKILL.md +257 -257
- package/skills/mcp-builder/reference/evaluation.md +630 -630
- package/skills/mcp-builder/reference/mcp_best_practices.md +269 -269
- package/skills/mcp-builder/reference/node_mcp_server.md +980 -980
- package/skills/mcp-builder/reference/python_mcp_server.md +737 -737
- package/skills/mcp-builder/scripts/connections.py +151 -151
- package/skills/mcp-builder/scripts/evaluation.py +373 -373
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -22
- package/skills/mcp-builder/scripts/requirements.txt +2 -2
- package/skills/mcporter/SKILL.md +65 -65
- package/skills/meme-maker/SKILL.md +46 -46
- package/skills/meme-maker/references/templates.json +358 -358
- package/skills/meme-maker/scripts/meme.mjs +398 -398
- package/skills/mental-health/mental-health-cbt/LICENSE +21 -21
- package/skills/mental-health/mental-health-cbt/SKILL.md +254 -254
- package/skills/mental-health/psych-addiction/LICENSE +21 -21
- package/skills/mental-health/psych-addiction/SKILL.md +79 -79
- package/skills/mental-health/psych-behavioral-econ/LICENSE +21 -21
- package/skills/mental-health/psych-behavioral-econ/SKILL.md +84 -84
- package/skills/mental-health/psych-child/LICENSE +21 -21
- package/skills/mental-health/psych-child/SKILL.md +84 -84
- package/skills/mental-health/psych-grief/LICENSE +21 -21
- package/skills/mental-health/psych-grief/SKILL.md +85 -85
- package/skills/mental-health/psych-mindfulness/LICENSE +21 -21
- package/skills/mental-health/psych-mindfulness/SKILL.md +71 -71
- package/skills/mental-health/psych-org/LICENSE +21 -21
- package/skills/mental-health/psych-org/SKILL.md +115 -115
- package/skills/mental-health/psych-positive/LICENSE +21 -21
- package/skills/mental-health/psych-positive/SKILL.md +86 -86
- package/skills/mental-health/psych-relationships/LICENSE +21 -21
- package/skills/mental-health/psych-relationships/SKILL.md +100 -100
- package/skills/mental-health/psych-trauma/LICENSE +21 -21
- package/skills/mental-health/psych-trauma/SKILL.md +109 -109
- package/skills/model-usage/SKILL.md +75 -75
- package/skills/model-usage/references/codexbar-cli.md +33 -33
- package/skills/model-usage/scripts/model_usage.py +319 -319
- package/skills/model-usage/scripts/test_model_usage.py +40 -40
- package/skills/nano-pdf/SKILL.md +42 -42
- package/skills/node-connect/SKILL.md +147 -147
- package/skills/node-inspect-debugger/SKILL.md +88 -88
- package/skills/notion/SKILL.md +154 -154
- package/skills/obsidian/SKILL.md +123 -123
- package/skills/openai-whisper/SKILL.md +42 -42
- package/skills/openai-whisper-api/SKILL.md +75 -75
- package/skills/openai-whisper-api/scripts/transcribe.sh +154 -154
- package/skills/openhue/SKILL.md +116 -116
- package/skills/oracle/SKILL.md +130 -130
- package/skills/ordercli/SKILL.md +82 -82
- package/skills/peekaboo/SKILL.md +217 -217
- package/skills/pyproject.toml +10 -10
- package/skills/python-debugpy/SKILL.md +76 -76
- package/skills/sag/SKILL.md +91 -91
- package/skills/science/sci-astronomy/LICENSE +21 -21
- package/skills/science/sci-astronomy/SKILL.md +80 -80
- package/skills/science/sci-biology/LICENSE +21 -21
- package/skills/science/sci-biology/SKILL.md +74 -74
- package/skills/science/sci-chemistry/LICENSE +21 -21
- package/skills/science/sci-chemistry/SKILL.md +89 -89
- package/skills/science/sci-climate/LICENSE +21 -21
- package/skills/science/sci-climate/SKILL.md +72 -72
- package/skills/science/sci-data-analysis/LICENSE +21 -21
- package/skills/science/sci-data-analysis/SKILL.md +87 -87
- package/skills/science/sci-environmental-science/LICENSE +21 -21
- package/skills/science/sci-environmental-science/SKILL.md +69 -69
- package/skills/science/sci-geology/LICENSE +21 -21
- package/skills/science/sci-geology/SKILL.md +56 -56
- package/skills/science/sci-method/LICENSE +21 -21
- package/skills/science/sci-method/SKILL.md +77 -77
- package/skills/science/sci-neuroscience/LICENSE +21 -21
- package/skills/science/sci-neuroscience/SKILL.md +79 -79
- package/skills/science/sci-physics/LICENSE +21 -21
- package/skills/science/sci-physics/SKILL.md +78 -78
- package/skills/science/sci-research-methods/LICENSE +21 -21
- package/skills/science/sci-research-methods/SKILL.md +83 -83
- package/skills/science/sci-statistics/LICENSE +21 -21
- package/skills/science/sci-statistics/SKILL.md +249 -249
- package/skills/session-logs/SKILL.md +155 -155
- package/skills/sherpa-onnx-tts/SKILL.md +113 -113
- package/skills/skill-creator/SKILL.md +81 -81
- package/skills/skill-creator/license.txt +202 -202
- package/skills/skill-creator/scripts/init_skill.py +378 -378
- package/skills/skill-creator/scripts/package_skill.py +144 -144
- package/skills/skill-creator/scripts/quick_validate.py +169 -169
- package/skills/skill-creator/scripts/test_init_skill.py +51 -51
- package/skills/skill-creator/scripts/test_package_skill.py +199 -199
- package/skills/skill-creator/scripts/test_quick_validate.py +116 -116
- package/skills/slack/SKILL.md +82 -82
- package/skills/slack-gif-creator/LICENSE +21 -21
- package/skills/slack-gif-creator/SKILL.md +293 -293
- package/skills/slack-gif-creator/requirements.txt +3 -3
- package/skills/social-sciences/social-anthropology/LICENSE +21 -21
- package/skills/social-sciences/social-anthropology/SKILL.md +62 -62
- package/skills/social-sciences/social-economics/LICENSE +21 -21
- package/skills/social-sciences/social-economics/SKILL.md +88 -88
- package/skills/social-sciences/social-geography/LICENSE +21 -21
- package/skills/social-sciences/social-geography/SKILL.md +61 -61
- package/skills/social-sciences/social-international-dev/LICENSE +21 -21
- package/skills/social-sciences/social-international-dev/SKILL.md +76 -76
- package/skills/social-sciences/social-political-science/LICENSE +21 -21
- package/skills/social-sciences/social-political-science/SKILL.md +70 -70
- package/skills/social-sciences/social-public-policy/LICENSE +21 -21
- package/skills/social-sciences/social-public-policy/SKILL.md +73 -73
- package/skills/social-sciences/social-sociology/LICENSE +21 -21
- package/skills/social-sciences/social-sociology/SKILL.md +78 -78
- package/skills/songsee/SKILL.md +53 -53
- package/skills/sonoscli/SKILL.md +69 -69
- package/skills/spike/SKILL.md +55 -55
- package/skills/spotify-player/SKILL.md +68 -68
- package/skills/summarize/SKILL.md +90 -90
- package/skills/taskflow/SKILL.md +153 -153
- package/skills/taskflow/examples/inbox-triage.lobster +33 -33
- package/skills/taskflow/examples/pr-intake.lobster +32 -32
- package/skills/taskflow-inbox-triage/SKILL.md +123 -123
- package/skills/technical/ai-ethics/LICENSE +21 -21
- package/skills/technical/ai-ethics/SKILL.md +92 -92
- package/skills/technical/ai-product-builder/LICENSE +21 -21
- package/skills/technical/ai-product-builder/SKILL.md +180 -180
- package/skills/technical/analytics-setup/LICENSE +21 -21
- package/skills/technical/analytics-setup/SKILL.md +125 -125
- package/skills/technical/api-builder/LICENSE +21 -21
- package/skills/technical/api-builder/SKILL.md +202 -202
- package/skills/technical/architecture-decisions/LICENSE +21 -21
- package/skills/technical/architecture-decisions/SKILL.md +120 -120
- package/skills/technical/auth-security/LICENSE +21 -21
- package/skills/technical/auth-security/SKILL.md +209 -209
- package/skills/technical/blockchain-web3/LICENSE +21 -21
- package/skills/technical/blockchain-web3/SKILL.md +84 -84
- package/skills/technical/cloud-architecture/LICENSE +21 -21
- package/skills/technical/cloud-architecture/SKILL.md +85 -85
- package/skills/technical/content-platform/LICENSE +21 -21
- package/skills/technical/content-platform/SKILL.md +134 -134
- package/skills/technical/cybersecurity-advanced/LICENSE +21 -21
- package/skills/technical/cybersecurity-advanced/SKILL.md +99 -99
- package/skills/technical/data-engineering/LICENSE +21 -21
- package/skills/technical/data-engineering/SKILL.md +117 -117
- package/skills/technical/database-design/LICENSE +21 -21
- package/skills/technical/database-design/SKILL.md +185 -185
- package/skills/technical/devops-cicd/LICENSE +21 -21
- package/skills/technical/devops-cicd/SKILL.md +181 -181
- package/skills/technical/ecommerce-builder/LICENSE +21 -21
- package/skills/technical/ecommerce-builder/SKILL.md +123 -123
- package/skills/technical/email-marketing/LICENSE +21 -21
- package/skills/technical/email-marketing/SKILL.md +128 -128
- package/skills/technical/fintech-builder/LICENSE +21 -21
- package/skills/technical/fintech-builder/SKILL.md +141 -141
- package/skills/technical/full-stack-web/LICENSE +21 -21
- package/skills/technical/full-stack-web/SKILL.md +173 -173
- package/skills/technical/gdpr-basics/LICENSE +21 -21
- package/skills/technical/gdpr-basics/SKILL.md +145 -145
- package/skills/technical/launch-playbook/LICENSE +21 -21
- package/skills/technical/launch-playbook/SKILL.md +95 -95
- package/skills/technical/marketing-copy/LICENSE +21 -21
- package/skills/technical/marketing-copy/SKILL.md +126 -126
- package/skills/technical/marketplace-builder/LICENSE +21 -21
- package/skills/technical/marketplace-builder/SKILL.md +105 -105
- package/skills/technical/mobile-pwa/LICENSE +21 -21
- package/skills/technical/mobile-pwa/SKILL.md +191 -191
- package/skills/technical/no-code-tools/LICENSE +21 -21
- package/skills/technical/no-code-tools/SKILL.md +80 -80
- package/skills/technical/open-source/LICENSE +21 -21
- package/skills/technical/open-source/SKILL.md +71 -71
- package/skills/technical/performance-optimization/LICENSE +21 -21
- package/skills/technical/performance-optimization/SKILL.md +155 -155
- package/skills/technical/pricing-design/LICENSE +21 -21
- package/skills/technical/pricing-design/SKILL.md +87 -87
- package/skills/technical/product-management/LICENSE +21 -21
- package/skills/technical/product-management/SKILL.md +94 -94
- package/skills/technical/saas-builder/LICENSE +21 -21
- package/skills/technical/saas-builder/SKILL.md +138 -138
- package/skills/technical/scope-estimation/LICENSE +21 -21
- package/skills/technical/scope-estimation/SKILL.md +99 -99
- package/skills/technical/secrets-management/LICENSE +21 -21
- package/skills/technical/secrets-management/SKILL.md +135 -135
- package/skills/technical/seo-technical/LICENSE +21 -21
- package/skills/technical/seo-technical/SKILL.md +136 -136
- package/skills/technical/technical-writing/LICENSE +21 -21
- package/skills/technical/technical-writing/SKILL.md +149 -149
- package/skills/technical/ux-research-tools/LICENSE +21 -21
- package/skills/technical/ux-research-tools/SKILL.md +54 -54
- package/skills/theme-factory/LICENSE +21 -21
- package/skills/theme-factory/SKILL.md +65 -65
- package/skills/theme-factory/themes/arctic-frost.md +19 -19
- package/skills/theme-factory/themes/botanical-garden.md +19 -19
- package/skills/theme-factory/themes/desert-rose.md +19 -19
- package/skills/theme-factory/themes/forest-canopy.md +19 -19
- package/skills/theme-factory/themes/golden-hour.md +19 -19
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -19
- package/skills/theme-factory/themes/modern-minimalist.md +19 -19
- package/skills/theme-factory/themes/ocean-depths.md +19 -19
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -19
- package/skills/theme-factory/themes/tech-innovation.md +19 -19
- package/skills/things-mac/SKILL.md +90 -90
- package/skills/tmux/SKILL.md +95 -95
- package/skills/tmux/scripts/find-sessions.sh +112 -112
- package/skills/tmux/scripts/wait-for-text.sh +83 -83
- package/skills/trades/trades-agriculture/LICENSE +21 -21
- package/skills/trades/trades-agriculture/SKILL.md +80 -80
- package/skills/trades/trades-automotive/LICENSE +21 -21
- package/skills/trades/trades-automotive/SKILL.md +84 -84
- package/skills/trades/trades-carpentry/LICENSE +21 -21
- package/skills/trades/trades-carpentry/SKILL.md +71 -71
- package/skills/trades/trades-cooking-pro/LICENSE +21 -21
- package/skills/trades/trades-cooking-pro/SKILL.md +90 -90
- package/skills/trades/trades-electrical/LICENSE +21 -21
- package/skills/trades/trades-electrical/SKILL.md +146 -146
- package/skills/trades/trades-hvac/LICENSE +21 -21
- package/skills/trades/trades-hvac/SKILL.md +80 -80
- package/skills/trades/trades-landscaping/LICENSE +21 -21
- package/skills/trades/trades-landscaping/SKILL.md +60 -60
- package/skills/trades/trades-metalworking/LICENSE +21 -21
- package/skills/trades/trades-metalworking/SKILL.md +64 -64
- package/skills/trades/trades-painting/LICENSE +21 -21
- package/skills/trades/trades-painting/SKILL.md +70 -70
- package/skills/trades/trades-plumbing/LICENSE +21 -21
- package/skills/trades/trades-plumbing/SKILL.md +160 -160
- package/skills/trades/trades-welding/LICENSE +21 -21
- package/skills/trades/trades-welding/SKILL.md +82 -82
- package/skills/trello/SKILL.md +112 -112
- package/skills/uipm-ui-styling/LICENSE.txt +202 -0
- package/skills/uipm-ui-styling/SKILL.md +328 -0
- package/skills/uipm-ui-styling/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills/uipm-ui-styling/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills/uipm-ui-styling/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills/uipm-ui-styling/references/canvas-design-system.md +320 -0
- package/skills/uipm-ui-styling/references/shadcn-accessibility.md +471 -0
- package/skills/uipm-ui-styling/references/shadcn-components.md +424 -0
- package/skills/uipm-ui-styling/references/shadcn-theming.md +373 -0
- package/skills/uipm-ui-styling/references/tailwind-customization.md +483 -0
- package/skills/uipm-ui-styling/references/tailwind-responsive.md +382 -0
- package/skills/uipm-ui-styling/references/tailwind-utilities.md +455 -0
- package/skills/uipm-ui-styling/scripts/.coverage +0 -0
- package/skills/uipm-ui-styling/scripts/requirements.txt +17 -0
- package/skills/uipm-ui-styling/scripts/shadcn_add.py +292 -0
- package/skills/uipm-ui-styling/scripts/tailwind_config_gen.py +456 -0
- package/skills/uipm-ui-styling/scripts/tests/coverage-ui.json +1 -0
- package/skills/uipm-ui-styling/scripts/tests/requirements.txt +3 -0
- package/skills/uipm-ui-styling/scripts/tests/test_shadcn_add.py +266 -0
- package/skills/uipm-ui-styling/scripts/tests/test_tailwind_config_gen.py +336 -0
- package/skills/video-frames/SKILL.md +50 -50
- package/skills/video-frames/scripts/frame.sh +81 -81
- package/skills/voice-call/SKILL.md +49 -49
- package/skills/wacli/SKILL.md +76 -76
- package/skills/weather/SKILL.md +91 -91
- package/skills/web-artifacts-builder/LICENSE +21 -21
- package/skills/web-artifacts-builder/SKILL.md +82 -82
- package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +53 -53
- package/skills/web-artifacts-builder/scripts/init-artifact.sh +322 -322
- package/skills/xurl/SKILL.md +124 -124
|
@@ -0,0 +1,1408 @@
|
|
|
1
|
+
# write graph to HTML, JSON, SVG, GraphML, Obsidian vault, and Neo4j Cypher
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
import hashlib
|
|
4
|
+
import html as _html
|
|
5
|
+
import json
|
|
6
|
+
import math
|
|
7
|
+
import os
|
|
8
|
+
import re
|
|
9
|
+
import shutil
|
|
10
|
+
from collections import Counter
|
|
11
|
+
from datetime import date
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
import networkx as nx
|
|
14
|
+
from networkx.readwrite import json_graph
|
|
15
|
+
from graphify.security import sanitize_label
|
|
16
|
+
from graphify.analyze import _node_community_map
|
|
17
|
+
from graphify.build import edge_data
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# Artifacts worth preserving across rebuilds (non-regenerable without LLM or curation).
|
|
21
|
+
_BACKUP_ARTIFACTS = [
|
|
22
|
+
"graph.json",
|
|
23
|
+
"GRAPH_REPORT.md",
|
|
24
|
+
".graphify_labels.json",
|
|
25
|
+
".graphify_analysis.json",
|
|
26
|
+
"manifest.json",
|
|
27
|
+
".graphify_semantic_marker",
|
|
28
|
+
"cost.json",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def backup_if_protected(out_dir: Path) -> "Path | None":
|
|
33
|
+
"""Snapshot graph artifacts to a dated subfolder before an overwrite.
|
|
34
|
+
|
|
35
|
+
Triggers when graph.json exists AND either:
|
|
36
|
+
- .graphify_semantic_marker is present (graph cost real LLM tokens), or
|
|
37
|
+
- .graphify_labels.json contains at least one non-default community label
|
|
38
|
+
(graph has been curated by a human or skill).
|
|
39
|
+
|
|
40
|
+
Returns the backup folder path, or None if no backup was taken.
|
|
41
|
+
Never raises — backup failure prints a warning but never blocks the write.
|
|
42
|
+
Set GRAPHIFY_NO_BACKUP=1 to disable.
|
|
43
|
+
"""
|
|
44
|
+
if os.environ.get("GRAPHIFY_NO_BACKUP"):
|
|
45
|
+
return None
|
|
46
|
+
out = Path(out_dir)
|
|
47
|
+
if not (out / "graph.json").exists():
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
is_semantic = (out / ".graphify_semantic_marker").exists()
|
|
51
|
+
is_curated = False
|
|
52
|
+
labels_file = out / ".graphify_labels.json"
|
|
53
|
+
if labels_file.exists():
|
|
54
|
+
try:
|
|
55
|
+
labels = json.loads(labels_file.read_text(encoding="utf-8"))
|
|
56
|
+
is_curated = any(v != f"Community {k}" for k, v in labels.items())
|
|
57
|
+
except Exception:
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
if not is_semantic and not is_curated:
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
reason = "+".join(filter(None, ["semantic" if is_semantic else "", "curated" if is_curated else ""]))
|
|
64
|
+
today = date.today().isoformat()
|
|
65
|
+
backup_dir = out / today
|
|
66
|
+
graph_src = out / "graph.json"
|
|
67
|
+
|
|
68
|
+
# Skip re-copying if today's backup already has identical graph.json content.
|
|
69
|
+
# If content differs (graph changed since the last backup today), overwrite
|
|
70
|
+
# the backup in place — one folder per day, always the latest pre-overwrite state.
|
|
71
|
+
if backup_dir.exists() and (backup_dir / "graph.json").exists():
|
|
72
|
+
src_hash = hashlib.sha256(graph_src.read_bytes()).hexdigest()
|
|
73
|
+
bak_hash = hashlib.sha256((backup_dir / "graph.json").read_bytes()).hexdigest()
|
|
74
|
+
if src_hash == bak_hash:
|
|
75
|
+
return backup_dir # identical content, nothing to do
|
|
76
|
+
|
|
77
|
+
try:
|
|
78
|
+
backup_dir.mkdir(parents=True, exist_ok=True)
|
|
79
|
+
copied = 0
|
|
80
|
+
for name in _BACKUP_ARTIFACTS:
|
|
81
|
+
src = out / name
|
|
82
|
+
if src.exists():
|
|
83
|
+
try:
|
|
84
|
+
shutil.copy2(src, backup_dir / name)
|
|
85
|
+
copied += 1
|
|
86
|
+
except Exception:
|
|
87
|
+
pass
|
|
88
|
+
if copied:
|
|
89
|
+
print(f"[graphify] backed up {reason} graph ({copied} files) -> {backup_dir.name}/")
|
|
90
|
+
return backup_dir
|
|
91
|
+
except Exception as exc:
|
|
92
|
+
import sys
|
|
93
|
+
print(f"[graphify] warning: backup failed ({exc}) - continuing with overwrite", file=sys.stderr)
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
def _obsidian_tag(name: str) -> str:
|
|
97
|
+
"""Sanitize a community name for use as an Obsidian tag.
|
|
98
|
+
|
|
99
|
+
Obsidian tags only allow alphanumerics, hyphens, underscores, and slashes.
|
|
100
|
+
Spaces become underscores; everything else is stripped.
|
|
101
|
+
"""
|
|
102
|
+
return re.sub(r"[^a-zA-Z0-9_\-/]", "", name.replace(" ", "_"))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _strip_diacritics(text: str) -> str:
|
|
106
|
+
import unicodedata
|
|
107
|
+
nfkd = unicodedata.normalize("NFKD", text)
|
|
108
|
+
return "".join(c for c in nfkd if not unicodedata.combining(c))
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _yaml_str(s: str) -> str:
|
|
112
|
+
"""Escape a value for safe embedding in a YAML double-quoted scalar (F-009).
|
|
113
|
+
|
|
114
|
+
See `graphify.ingest._yaml_str` for the full rationale; duplicated here to
|
|
115
|
+
avoid pulling the URL-fetching `ingest` module into export's dependency
|
|
116
|
+
graph. Handles backslash, double-quote, all line breaks (\\n, \\r,
|
|
117
|
+
U+2028, U+2029), tab, NUL, and other C0/DEL control characters that
|
|
118
|
+
would otherwise let a hostile `source_file` / `community` / etc. break
|
|
119
|
+
out of the YAML scalar and inject sibling keys.
|
|
120
|
+
"""
|
|
121
|
+
if s is None:
|
|
122
|
+
return ""
|
|
123
|
+
out: list[str] = []
|
|
124
|
+
for ch in str(s):
|
|
125
|
+
cp = ord(ch)
|
|
126
|
+
if ch == "\\":
|
|
127
|
+
out.append("\\\\")
|
|
128
|
+
elif ch == '"':
|
|
129
|
+
out.append('\\"')
|
|
130
|
+
elif ch == "\n":
|
|
131
|
+
out.append("\\n")
|
|
132
|
+
elif ch == "\r":
|
|
133
|
+
out.append("\\r")
|
|
134
|
+
elif ch == "\t":
|
|
135
|
+
out.append("\\t")
|
|
136
|
+
elif ch == "\0":
|
|
137
|
+
out.append("\\0")
|
|
138
|
+
elif cp == 0x2028:
|
|
139
|
+
out.append("\\L")
|
|
140
|
+
elif cp == 0x2029:
|
|
141
|
+
out.append("\\P")
|
|
142
|
+
elif cp < 0x20 or cp == 0x7F:
|
|
143
|
+
out.append(f"\\x{cp:02x}")
|
|
144
|
+
else:
|
|
145
|
+
out.append(ch)
|
|
146
|
+
return "".join(out)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
COMMUNITY_COLORS = [
|
|
150
|
+
"#4E79A7", "#F28E2B", "#E15759", "#76B7B2", "#59A14F",
|
|
151
|
+
"#EDC948", "#B07AA1", "#FF9DA7", "#9C755F", "#BAB0AC",
|
|
152
|
+
]
|
|
153
|
+
|
|
154
|
+
MAX_NODES_FOR_VIZ = 5_000
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def _viz_node_limit() -> int:
|
|
158
|
+
"""Return the effective viz node limit, honoring GRAPHIFY_VIZ_NODE_LIMIT env var.
|
|
159
|
+
|
|
160
|
+
Falls back to MAX_NODES_FOR_VIZ when the env var is unset, empty, or non-integer.
|
|
161
|
+
Set to 0 to disable HTML viz unconditionally (useful for CI runners).
|
|
162
|
+
"""
|
|
163
|
+
import os
|
|
164
|
+
raw = os.environ.get("GRAPHIFY_VIZ_NODE_LIMIT")
|
|
165
|
+
if raw is None or not raw.strip():
|
|
166
|
+
return MAX_NODES_FOR_VIZ
|
|
167
|
+
try:
|
|
168
|
+
return int(raw)
|
|
169
|
+
except ValueError:
|
|
170
|
+
return MAX_NODES_FOR_VIZ
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def _html_styles() -> str:
|
|
174
|
+
return """<style>
|
|
175
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
176
|
+
body { background: #0f0f1a; color: #e0e0e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; display: flex; height: 100vh; overflow: hidden; }
|
|
177
|
+
#graph { flex: 1; }
|
|
178
|
+
#sidebar { width: 280px; background: #1a1a2e; border-left: 1px solid #2a2a4e; display: flex; flex-direction: column; overflow: hidden; }
|
|
179
|
+
#search-wrap { padding: 12px; border-bottom: 1px solid #2a2a4e; }
|
|
180
|
+
#search { width: 100%; background: #0f0f1a; border: 1px solid #3a3a5e; color: #e0e0e0; padding: 7px 10px; border-radius: 6px; font-size: 13px; outline: none; }
|
|
181
|
+
#search:focus { border-color: #4E79A7; }
|
|
182
|
+
#search-results { max-height: 140px; overflow-y: auto; padding: 4px 12px; border-bottom: 1px solid #2a2a4e; display: none; }
|
|
183
|
+
.search-item { padding: 4px 6px; cursor: pointer; border-radius: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
184
|
+
.search-item:hover { background: #2a2a4e; }
|
|
185
|
+
#info-panel { padding: 14px; border-bottom: 1px solid #2a2a4e; min-height: 140px; }
|
|
186
|
+
#info-panel h3 { font-size: 13px; color: #aaa; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
187
|
+
#info-content { font-size: 13px; color: #ccc; line-height: 1.6; }
|
|
188
|
+
#info-content .field { margin-bottom: 5px; }
|
|
189
|
+
#info-content .field b { color: #e0e0e0; }
|
|
190
|
+
#info-content .empty { color: #555; font-style: italic; }
|
|
191
|
+
.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; }
|
|
192
|
+
.neighbor-link:hover { background: #2a2a4e; }
|
|
193
|
+
#neighbors-list { max-height: 160px; overflow-y: auto; margin-top: 4px; }
|
|
194
|
+
#legend-wrap { flex: 1; overflow-y: auto; padding: 12px; }
|
|
195
|
+
#legend-wrap h3 { font-size: 13px; color: #aaa; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
196
|
+
.legend-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; border-radius: 4px; font-size: 12px; }
|
|
197
|
+
.legend-item:hover { background: #2a2a4e; padding-left: 4px; }
|
|
198
|
+
.legend-item.dimmed { opacity: 0.35; }
|
|
199
|
+
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
|
|
200
|
+
.legend-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
201
|
+
.legend-count { color: #666; font-size: 11px; }
|
|
202
|
+
#stats { padding: 10px 14px; border-top: 1px solid #2a2a4e; font-size: 11px; color: #555; }
|
|
203
|
+
#legend-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 4px 0; }
|
|
204
|
+
#legend-controls label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: #aaa; user-select: none; }
|
|
205
|
+
#legend-controls label:hover { color: #e0e0e0; }
|
|
206
|
+
.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; }
|
|
207
|
+
.legend-cb:checked, #select-all-cb:checked { background: #4E79A7; border-color: #4E79A7; }
|
|
208
|
+
.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); }
|
|
209
|
+
#select-all-cb:indeterminate { background: #4E79A7; border-color: #4E79A7; }
|
|
210
|
+
#select-all-cb:indeterminate::after { content: ''; position: absolute; left: 2px; top: 5px; width: 8px; height: 2px; background: #fff; border: none; transform: none; }
|
|
211
|
+
</style>"""
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def _hyperedge_script(hyperedges_json: str) -> str:
|
|
215
|
+
return f"""<script>
|
|
216
|
+
// Render hyperedges as shaded regions
|
|
217
|
+
const hyperedges = {hyperedges_json};
|
|
218
|
+
// afterDrawing passes ctx already transformed to network coordinate space.
|
|
219
|
+
// Draw node positions raw — no manual pan/zoom/DPR math needed.
|
|
220
|
+
network.on('afterDrawing', function(ctx) {{
|
|
221
|
+
hyperedges.forEach(h => {{
|
|
222
|
+
const positions = h.nodes
|
|
223
|
+
.map(nid => network.getPositions([nid])[nid])
|
|
224
|
+
.filter(p => p !== undefined);
|
|
225
|
+
if (positions.length < 2) return;
|
|
226
|
+
ctx.save();
|
|
227
|
+
ctx.globalAlpha = 0.12;
|
|
228
|
+
ctx.fillStyle = '#6366f1';
|
|
229
|
+
ctx.strokeStyle = '#6366f1';
|
|
230
|
+
ctx.lineWidth = 2;
|
|
231
|
+
ctx.beginPath();
|
|
232
|
+
// Centroid and expanded hull in network coordinates
|
|
233
|
+
const cx = positions.reduce((s, p) => s + p.x, 0) / positions.length;
|
|
234
|
+
const cy = positions.reduce((s, p) => s + p.y, 0) / positions.length;
|
|
235
|
+
const expanded = positions.map(p => ({{
|
|
236
|
+
x: cx + (p.x - cx) * 1.15,
|
|
237
|
+
y: cy + (p.y - cy) * 1.15
|
|
238
|
+
}}));
|
|
239
|
+
ctx.moveTo(expanded[0].x, expanded[0].y);
|
|
240
|
+
expanded.slice(1).forEach(p => ctx.lineTo(p.x, p.y));
|
|
241
|
+
ctx.closePath();
|
|
242
|
+
ctx.fill();
|
|
243
|
+
ctx.globalAlpha = 0.4;
|
|
244
|
+
ctx.stroke();
|
|
245
|
+
// Label
|
|
246
|
+
ctx.globalAlpha = 0.8;
|
|
247
|
+
ctx.fillStyle = '#4f46e5';
|
|
248
|
+
ctx.font = 'bold 11px sans-serif';
|
|
249
|
+
ctx.textAlign = 'center';
|
|
250
|
+
ctx.fillText(h.label, cx, cy - 5);
|
|
251
|
+
ctx.restore();
|
|
252
|
+
}});
|
|
253
|
+
}});
|
|
254
|
+
</script>"""
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def _html_script(nodes_json: str, edges_json: str, legend_json: str) -> str:
|
|
258
|
+
return f"""<script>
|
|
259
|
+
const RAW_NODES = {nodes_json};
|
|
260
|
+
const RAW_EDGES = {edges_json};
|
|
261
|
+
const LEGEND = {legend_json};
|
|
262
|
+
|
|
263
|
+
// HTML-escape helper — prevents XSS when injecting graph data into innerHTML
|
|
264
|
+
function esc(s) {{
|
|
265
|
+
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');
|
|
266
|
+
}}
|
|
267
|
+
|
|
268
|
+
// Build vis datasets
|
|
269
|
+
const nodesDS = new vis.DataSet(RAW_NODES.map(n => ({{
|
|
270
|
+
id: n.id, label: n.label, color: n.color, size: n.size,
|
|
271
|
+
font: n.font, title: n.title,
|
|
272
|
+
_community: n.community, _community_name: n.community_name,
|
|
273
|
+
_source_file: n.source_file, _file_type: n.file_type, _degree: n.degree,
|
|
274
|
+
}})));
|
|
275
|
+
|
|
276
|
+
const edgesDS = new vis.DataSet(RAW_EDGES.map((e, i) => ({{
|
|
277
|
+
id: i, from: e.from, to: e.to,
|
|
278
|
+
label: '',
|
|
279
|
+
title: e.title,
|
|
280
|
+
dashes: e.dashes,
|
|
281
|
+
width: e.width,
|
|
282
|
+
color: e.color,
|
|
283
|
+
arrows: {{ to: {{ enabled: true, scaleFactor: 0.5 }} }},
|
|
284
|
+
}})));
|
|
285
|
+
|
|
286
|
+
const container = document.getElementById('graph');
|
|
287
|
+
const network = new vis.Network(container, {{ nodes: nodesDS, edges: edgesDS }}, {{
|
|
288
|
+
physics: {{
|
|
289
|
+
enabled: true,
|
|
290
|
+
solver: 'forceAtlas2Based',
|
|
291
|
+
forceAtlas2Based: {{
|
|
292
|
+
gravitationalConstant: -60,
|
|
293
|
+
centralGravity: 0.005,
|
|
294
|
+
springLength: 120,
|
|
295
|
+
springConstant: 0.08,
|
|
296
|
+
damping: 0.4,
|
|
297
|
+
avoidOverlap: 0.8,
|
|
298
|
+
}},
|
|
299
|
+
stabilization: {{ iterations: 200, fit: true }},
|
|
300
|
+
}},
|
|
301
|
+
interaction: {{
|
|
302
|
+
hover: true,
|
|
303
|
+
tooltipDelay: 100,
|
|
304
|
+
hideEdgesOnDrag: true,
|
|
305
|
+
navigationButtons: false,
|
|
306
|
+
keyboard: false,
|
|
307
|
+
}},
|
|
308
|
+
nodes: {{ shape: 'dot', borderWidth: 1.5 }},
|
|
309
|
+
edges: {{ smooth: {{ type: 'continuous', roundness: 0.2 }}, selectionWidth: 3 }},
|
|
310
|
+
}});
|
|
311
|
+
|
|
312
|
+
network.once('stabilizationIterationsDone', () => {{
|
|
313
|
+
network.setOptions({{ physics: {{ enabled: false }} }});
|
|
314
|
+
}});
|
|
315
|
+
|
|
316
|
+
function showInfo(nodeId) {{
|
|
317
|
+
const n = nodesDS.get(nodeId);
|
|
318
|
+
if (!n) return;
|
|
319
|
+
const neighborIds = network.getConnectedNodes(nodeId);
|
|
320
|
+
const neighborItems = neighborIds.map(nid => {{
|
|
321
|
+
const nb = nodesDS.get(nid);
|
|
322
|
+
const color = nb ? nb.color.background : '#555';
|
|
323
|
+
return `<span class="neighbor-link" style="border-left-color:${{esc(color)}}" onclick="focusNode(${{JSON.stringify(nid)}})">${{esc(nb ? nb.label : nid)}}</span>`;
|
|
324
|
+
}}).join('');
|
|
325
|
+
document.getElementById('info-content').innerHTML = `
|
|
326
|
+
<div class="field"><b>${{esc(n.label)}}</b></div>
|
|
327
|
+
<div class="field">Type: ${{esc(n._file_type || 'unknown')}}</div>
|
|
328
|
+
<div class="field">Community: ${{esc(n._community_name)}}</div>
|
|
329
|
+
<div class="field">Source: ${{esc(n._source_file || '-')}}</div>
|
|
330
|
+
<div class="field">Degree: ${{n._degree}}</div>
|
|
331
|
+
${{neighborIds.length ? `<div class="field" style="margin-top:8px;color:#aaa;font-size:11px">Neighbors (${{neighborIds.length}})</div><div id="neighbors-list">${{neighborItems}}</div>` : ''}}
|
|
332
|
+
`;
|
|
333
|
+
}}
|
|
334
|
+
|
|
335
|
+
function focusNode(nodeId) {{
|
|
336
|
+
network.focus(nodeId, {{ scale: 1.4, animation: true }});
|
|
337
|
+
network.selectNodes([nodeId]);
|
|
338
|
+
showInfo(nodeId);
|
|
339
|
+
}}
|
|
340
|
+
|
|
341
|
+
// Track hovered node — hover detection is more reliable than click params
|
|
342
|
+
let hoveredNodeId = null;
|
|
343
|
+
network.on('hoverNode', params => {{
|
|
344
|
+
hoveredNodeId = params.node;
|
|
345
|
+
container.style.cursor = 'pointer';
|
|
346
|
+
}});
|
|
347
|
+
network.on('blurNode', () => {{
|
|
348
|
+
hoveredNodeId = null;
|
|
349
|
+
container.style.cursor = 'default';
|
|
350
|
+
}});
|
|
351
|
+
container.addEventListener('click', () => {{
|
|
352
|
+
if (hoveredNodeId !== null) {{
|
|
353
|
+
showInfo(hoveredNodeId);
|
|
354
|
+
network.selectNodes([hoveredNodeId]);
|
|
355
|
+
}}
|
|
356
|
+
}});
|
|
357
|
+
network.on('click', params => {{
|
|
358
|
+
if (params.nodes.length > 0) {{
|
|
359
|
+
showInfo(params.nodes[0]);
|
|
360
|
+
}} else if (hoveredNodeId === null) {{
|
|
361
|
+
document.getElementById('info-content').innerHTML = '<span class="empty">Click a node to inspect it</span>';
|
|
362
|
+
}}
|
|
363
|
+
}});
|
|
364
|
+
|
|
365
|
+
const searchInput = document.getElementById('search');
|
|
366
|
+
const searchResults = document.getElementById('search-results');
|
|
367
|
+
searchInput.addEventListener('input', () => {{
|
|
368
|
+
const q = searchInput.value.toLowerCase().trim();
|
|
369
|
+
searchResults.innerHTML = '';
|
|
370
|
+
if (!q) {{ searchResults.style.display = 'none'; return; }}
|
|
371
|
+
const matches = RAW_NODES.filter(n => n.label.toLowerCase().includes(q)).slice(0, 20);
|
|
372
|
+
if (!matches.length) {{ searchResults.style.display = 'none'; return; }}
|
|
373
|
+
searchResults.style.display = 'block';
|
|
374
|
+
matches.forEach(n => {{
|
|
375
|
+
const el = document.createElement('div');
|
|
376
|
+
el.className = 'search-item';
|
|
377
|
+
el.textContent = n.label;
|
|
378
|
+
el.style.borderLeft = `3px solid ${{n.color.background}}`;
|
|
379
|
+
el.style.paddingLeft = '8px';
|
|
380
|
+
el.onclick = () => {{
|
|
381
|
+
network.focus(n.id, {{ scale: 1.5, animation: true }});
|
|
382
|
+
network.selectNodes([n.id]);
|
|
383
|
+
showInfo(n.id);
|
|
384
|
+
searchResults.style.display = 'none';
|
|
385
|
+
searchInput.value = '';
|
|
386
|
+
}};
|
|
387
|
+
searchResults.appendChild(el);
|
|
388
|
+
}});
|
|
389
|
+
}});
|
|
390
|
+
document.addEventListener('click', e => {{
|
|
391
|
+
if (!searchResults.contains(e.target) && e.target !== searchInput)
|
|
392
|
+
searchResults.style.display = 'none';
|
|
393
|
+
}});
|
|
394
|
+
|
|
395
|
+
const hiddenCommunities = new Set();
|
|
396
|
+
|
|
397
|
+
const selectAllCb = document.getElementById('select-all-cb');
|
|
398
|
+
|
|
399
|
+
function updateSelectAllState() {{
|
|
400
|
+
const total = LEGEND.length;
|
|
401
|
+
const hidden = hiddenCommunities.size;
|
|
402
|
+
selectAllCb.checked = hidden === 0;
|
|
403
|
+
selectAllCb.indeterminate = hidden > 0 && hidden < total;
|
|
404
|
+
}}
|
|
405
|
+
|
|
406
|
+
function toggleAllCommunities(hide) {{
|
|
407
|
+
document.querySelectorAll('.legend-item').forEach(item => {{
|
|
408
|
+
hide ? item.classList.add('dimmed') : item.classList.remove('dimmed');
|
|
409
|
+
}});
|
|
410
|
+
document.querySelectorAll('.legend-cb').forEach(cb => {{
|
|
411
|
+
cb.checked = !hide;
|
|
412
|
+
}});
|
|
413
|
+
LEGEND.forEach(c => {{
|
|
414
|
+
if (hide) hiddenCommunities.add(c.cid); else hiddenCommunities.delete(c.cid);
|
|
415
|
+
}});
|
|
416
|
+
const updates = RAW_NODES.map(n => ({{ id: n.id, hidden: hide }}));
|
|
417
|
+
nodesDS.update(updates);
|
|
418
|
+
updateSelectAllState();
|
|
419
|
+
}}
|
|
420
|
+
|
|
421
|
+
const legendEl = document.getElementById('legend');
|
|
422
|
+
LEGEND.forEach(c => {{
|
|
423
|
+
const item = document.createElement('div');
|
|
424
|
+
item.className = 'legend-item';
|
|
425
|
+
const cb = document.createElement('input');
|
|
426
|
+
cb.type = 'checkbox';
|
|
427
|
+
cb.className = 'legend-cb';
|
|
428
|
+
cb.checked = true;
|
|
429
|
+
cb.addEventListener('change', (e) => {{
|
|
430
|
+
e.stopPropagation();
|
|
431
|
+
if (cb.checked) {{
|
|
432
|
+
hiddenCommunities.delete(c.cid);
|
|
433
|
+
item.classList.remove('dimmed');
|
|
434
|
+
}} else {{
|
|
435
|
+
hiddenCommunities.add(c.cid);
|
|
436
|
+
item.classList.add('dimmed');
|
|
437
|
+
}}
|
|
438
|
+
const updates = RAW_NODES
|
|
439
|
+
.filter(n => n.community === c.cid)
|
|
440
|
+
.map(n => ({{ id: n.id, hidden: !cb.checked }}));
|
|
441
|
+
nodesDS.update(updates);
|
|
442
|
+
updateSelectAllState();
|
|
443
|
+
}});
|
|
444
|
+
item.innerHTML = `<div class="legend-dot" style="background:${{c.color}}"></div>
|
|
445
|
+
<span class="legend-label">${{c.label}}</span>
|
|
446
|
+
<span class="legend-count">${{c.count}}</span>`;
|
|
447
|
+
item.prepend(cb);
|
|
448
|
+
item.onclick = (e) => {{
|
|
449
|
+
if (e.target === cb) return;
|
|
450
|
+
cb.checked = !cb.checked;
|
|
451
|
+
cb.dispatchEvent(new Event('change'));
|
|
452
|
+
}};
|
|
453
|
+
legendEl.appendChild(item);
|
|
454
|
+
}});
|
|
455
|
+
</script>"""
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
_CONFIDENCE_SCORE_DEFAULTS = {"EXTRACTED": 1.0, "INFERRED": 0.5, "AMBIGUOUS": 0.2}
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
def attach_hyperedges(G: nx.Graph, hyperedges: list) -> None:
|
|
462
|
+
"""Store hyperedges in the graph's metadata dict."""
|
|
463
|
+
existing = G.graph.get("hyperedges", [])
|
|
464
|
+
seen_ids = {h["id"] for h in existing}
|
|
465
|
+
for h in hyperedges:
|
|
466
|
+
if h.get("id") and h["id"] not in seen_ids:
|
|
467
|
+
existing.append(h)
|
|
468
|
+
seen_ids.add(h["id"])
|
|
469
|
+
G.graph["hyperedges"] = existing
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
def _git_head() -> str | None:
|
|
473
|
+
"""Return the current git HEAD commit hash, or None if not in a git repo."""
|
|
474
|
+
import subprocess as _sp
|
|
475
|
+
try:
|
|
476
|
+
r = _sp.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, timeout=3)
|
|
477
|
+
return r.stdout.strip() if r.returncode == 0 else None
|
|
478
|
+
except Exception:
|
|
479
|
+
return None
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
def to_json(G: nx.Graph, communities: dict[int, list[str]], output_path: str, *, force: bool = False, built_at_commit: str | None = None) -> bool:
|
|
483
|
+
# Safety check: refuse to silently shrink an existing graph (#479)
|
|
484
|
+
existing_path = Path(output_path)
|
|
485
|
+
if not force and existing_path.exists():
|
|
486
|
+
try:
|
|
487
|
+
from graphify.security import check_graph_file_size_cap
|
|
488
|
+
check_graph_file_size_cap(existing_path)
|
|
489
|
+
existing_data = json.loads(existing_path.read_text(encoding="utf-8"))
|
|
490
|
+
existing_n = len(existing_data.get("nodes", []))
|
|
491
|
+
new_n = G.number_of_nodes()
|
|
492
|
+
if new_n < existing_n:
|
|
493
|
+
import sys as _sys
|
|
494
|
+
print(
|
|
495
|
+
f"[graphify] WARNING: new graph has {new_n} nodes but existing "
|
|
496
|
+
f"graph.json has {existing_n} (net -{existing_n - new_n}). "
|
|
497
|
+
f"Refusing to overwrite. Possible causes: missing chunk files from "
|
|
498
|
+
f"a previous session, or fuzzy dedup collapsed same-named symbols "
|
|
499
|
+
f"across files during an --update on an already-current graph. "
|
|
500
|
+
f"Run a full rebuild (/graphify .) to be safe, or pass force=True "
|
|
501
|
+
f"only if you have verified the reduction is legitimate.",
|
|
502
|
+
file=_sys.stderr,
|
|
503
|
+
)
|
|
504
|
+
return False
|
|
505
|
+
except Exception:
|
|
506
|
+
pass # unreadable existing file — proceed with write
|
|
507
|
+
|
|
508
|
+
node_community = _node_community_map(communities)
|
|
509
|
+
try:
|
|
510
|
+
data = json_graph.node_link_data(G, edges="links")
|
|
511
|
+
except TypeError:
|
|
512
|
+
data = json_graph.node_link_data(G)
|
|
513
|
+
for node in data["nodes"]:
|
|
514
|
+
node["community"] = node_community.get(node["id"])
|
|
515
|
+
node["norm_label"] = _strip_diacritics(node.get("label", "")).lower()
|
|
516
|
+
for link in data["links"]:
|
|
517
|
+
if "confidence_score" not in link:
|
|
518
|
+
conf = link.get("confidence", "EXTRACTED")
|
|
519
|
+
link["confidence_score"] = _CONFIDENCE_SCORE_DEFAULTS.get(conf, 1.0)
|
|
520
|
+
# Restore original edge direction. Undirected NetworkX storage may
|
|
521
|
+
# canonicalize endpoint order, flipping `calls` and other directional
|
|
522
|
+
# edges in graph.json. The build path stashes the true endpoints in
|
|
523
|
+
# _src/_tgt for exactly this purpose (#563).
|
|
524
|
+
true_src = link.pop("_src", None)
|
|
525
|
+
true_tgt = link.pop("_tgt", None)
|
|
526
|
+
if true_src is not None and true_tgt is not None:
|
|
527
|
+
link["source"] = true_src
|
|
528
|
+
link["target"] = true_tgt
|
|
529
|
+
data["hyperedges"] = getattr(G, "graph", {}).get("hyperedges", [])
|
|
530
|
+
commit = built_at_commit if built_at_commit is not None else _git_head()
|
|
531
|
+
if commit:
|
|
532
|
+
data["built_at_commit"] = commit
|
|
533
|
+
with open(output_path, "w", encoding="utf-8") as f: # nosec
|
|
534
|
+
json.dump(data, f, indent=2)
|
|
535
|
+
return True
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def prune_dangling_edges(graph_data: dict) -> tuple[dict, int]:
|
|
539
|
+
"""Remove edges whose source or target node is not in the node set.
|
|
540
|
+
|
|
541
|
+
Returns the cleaned graph_data dict and the number of pruned edges.
|
|
542
|
+
"""
|
|
543
|
+
node_ids = {n["id"] for n in graph_data["nodes"]}
|
|
544
|
+
links_key = "links" if "links" in graph_data else "edges"
|
|
545
|
+
before = len(graph_data[links_key])
|
|
546
|
+
graph_data[links_key] = [
|
|
547
|
+
e for e in graph_data[links_key]
|
|
548
|
+
if e["source"] in node_ids and e["target"] in node_ids
|
|
549
|
+
]
|
|
550
|
+
return graph_data, before - len(graph_data[links_key])
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
def _cypher_escape(s: str) -> str:
|
|
554
|
+
"""Escape a string for safe embedding in a Cypher single-quoted literal.
|
|
555
|
+
|
|
556
|
+
Handles all characters that could prematurely terminate the literal or
|
|
557
|
+
inject control sequences:
|
|
558
|
+
- `\\` and `'` (literal terminators)
|
|
559
|
+
- newlines/CRs (would break the per-line statement framing)
|
|
560
|
+
- NUL/control bytes (defensive — Neo4j errors on raw NULs)
|
|
561
|
+
|
|
562
|
+
Also strips any leading/trailing whitespace that would let an attacker
|
|
563
|
+
break the `;`-terminated statement boundary used by `cypher-shell`.
|
|
564
|
+
Closing `}` and `)` are NOT special inside a single-quoted Cypher string,
|
|
565
|
+
so escaping the quote and backslash correctly is sufficient (a `}` inside
|
|
566
|
+
a properly-closed `'...'` literal is just a character) — but we previously
|
|
567
|
+
missed `\\n` / `\\r` which DO let a payload break out of the statement
|
|
568
|
+
line and inject a fresh MATCH/DELETE on the following line. See F-008.
|
|
569
|
+
"""
|
|
570
|
+
# First normalise: drop NUL and other C0 control chars except tab.
|
|
571
|
+
s = "".join(ch for ch in s if ch >= " " or ch == "\t")
|
|
572
|
+
return (
|
|
573
|
+
s.replace("\\", "\\\\")
|
|
574
|
+
.replace("'", "\\'")
|
|
575
|
+
.replace("\n", "\\n")
|
|
576
|
+
.replace("\r", "\\r")
|
|
577
|
+
)
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
# Restrict identifier-position values (labels and relationship types are NOT
|
|
581
|
+
# quoted in Cypher and so cannot be safely escaped — they must be allowlisted).
|
|
582
|
+
_CYPHER_IDENT_RE = re.compile(r"[^A-Za-z0-9_]")
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
def _cypher_label(raw: str, fallback: str) -> str:
|
|
586
|
+
"""Sanitise a value used in identifier position (node label / rel type).
|
|
587
|
+
|
|
588
|
+
Cypher does not provide a way to escape `:Foo` label syntax, so we must
|
|
589
|
+
strip everything except `[A-Za-z0-9_]` and require the result to start
|
|
590
|
+
with a letter; otherwise we fall back to a safe constant.
|
|
591
|
+
"""
|
|
592
|
+
cleaned = _CYPHER_IDENT_RE.sub("", raw or "")
|
|
593
|
+
if not cleaned or not cleaned[0].isalpha():
|
|
594
|
+
return fallback
|
|
595
|
+
return cleaned
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
def to_cypher(G: nx.Graph, output_path: str) -> None:
|
|
599
|
+
lines = ["// Neo4j Cypher import - generated by /graphify", ""]
|
|
600
|
+
for node_id, data in G.nodes(data=True):
|
|
601
|
+
label = _cypher_escape(data.get("label", node_id))
|
|
602
|
+
node_id_esc = _cypher_escape(node_id)
|
|
603
|
+
ftype = _cypher_label(
|
|
604
|
+
(data.get("file_type", "unknown") or "unknown").capitalize(),
|
|
605
|
+
"Entity",
|
|
606
|
+
)
|
|
607
|
+
lines.append(f"MERGE (n:{ftype} {{id: '{node_id_esc}', label: '{label}'}});")
|
|
608
|
+
lines.append("")
|
|
609
|
+
for u, v, data in G.edges(data=True):
|
|
610
|
+
rel = _cypher_label(
|
|
611
|
+
(data.get("relation", "RELATES_TO") or "RELATES_TO").upper(),
|
|
612
|
+
"RELATES_TO",
|
|
613
|
+
)
|
|
614
|
+
conf = _cypher_escape(data.get("confidence", "EXTRACTED"))
|
|
615
|
+
u_esc = _cypher_escape(u)
|
|
616
|
+
v_esc = _cypher_escape(v)
|
|
617
|
+
lines.append(
|
|
618
|
+
f"MATCH (a {{id: '{u_esc}'}}), (b {{id: '{v_esc}'}}) "
|
|
619
|
+
f"MERGE (a)-[:{rel} {{confidence: '{conf}'}}]->(b);"
|
|
620
|
+
)
|
|
621
|
+
with open(output_path, "w", encoding="utf-8") as f: # nosec
|
|
622
|
+
f.write("\n".join(lines))
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
def to_html(
|
|
626
|
+
G: nx.Graph,
|
|
627
|
+
communities: dict[int, list[str]],
|
|
628
|
+
output_path: str,
|
|
629
|
+
community_labels: dict[int, str] | None = None,
|
|
630
|
+
member_counts: dict[int, int] | None = None,
|
|
631
|
+
node_limit: int | None = None,
|
|
632
|
+
) -> None:
|
|
633
|
+
"""Generate an interactive vis.js HTML visualization of the graph.
|
|
634
|
+
|
|
635
|
+
Features: node size by degree, click-to-inspect panel, search box,
|
|
636
|
+
community filter, physics clustering by community, confidence-styled edges.
|
|
637
|
+
Raises ValueError if graph exceeds MAX_NODES_FOR_VIZ.
|
|
638
|
+
|
|
639
|
+
If member_counts is provided (aggregated community view), node sizes are
|
|
640
|
+
based on community member counts rather than graph degree.
|
|
641
|
+
|
|
642
|
+
If node_limit is set and the graph exceeds it, automatically builds an
|
|
643
|
+
aggregated community-level meta-graph instead of raising ValueError.
|
|
644
|
+
"""
|
|
645
|
+
limit = node_limit if node_limit is not None else _viz_node_limit()
|
|
646
|
+
if G.number_of_nodes() > limit:
|
|
647
|
+
if node_limit is not None:
|
|
648
|
+
# Build aggregated community meta-graph
|
|
649
|
+
from collections import Counter as _Counter
|
|
650
|
+
import networkx as _nx
|
|
651
|
+
print(f"Graph has {G.number_of_nodes()} nodes (above {limit} limit). Building aggregated community view...")
|
|
652
|
+
node_to_community = {nid: cid for cid, members in communities.items() for nid in members}
|
|
653
|
+
meta = _nx.Graph()
|
|
654
|
+
for cid, members in communities.items():
|
|
655
|
+
meta.add_node(str(cid), label=(community_labels or {}).get(cid, f"Community {cid}"))
|
|
656
|
+
edge_counts = _Counter()
|
|
657
|
+
for u, v in G.edges():
|
|
658
|
+
cu, cv = node_to_community.get(u), node_to_community.get(v)
|
|
659
|
+
if cu is not None and cv is not None and cu != cv:
|
|
660
|
+
edge_counts[(min(cu, cv), max(cu, cv))] += 1
|
|
661
|
+
for (cu, cv), w in edge_counts.items():
|
|
662
|
+
meta.add_edge(str(cu), str(cv), weight=w,
|
|
663
|
+
relation=f"{w} cross-community edges", confidence="AGGREGATED")
|
|
664
|
+
if meta.number_of_nodes() <= 1:
|
|
665
|
+
print("Single community - aggregated view not useful. Skipping graph.html.")
|
|
666
|
+
return
|
|
667
|
+
meta_communities = {cid: [str(cid)] for cid in communities}
|
|
668
|
+
mc = {cid: len(members) for cid, members in communities.items()}
|
|
669
|
+
# Remap hyperedges from semantic node IDs to community IDs
|
|
670
|
+
raw_hyperedges = G.graph.get("hyperedges", [])
|
|
671
|
+
if raw_hyperedges:
|
|
672
|
+
remapped = []
|
|
673
|
+
for he in raw_hyperedges:
|
|
674
|
+
he_members = he.get("nodes") or he.get("members") or []
|
|
675
|
+
comm_ids, seen = [], set()
|
|
676
|
+
for nid in he_members:
|
|
677
|
+
c = node_to_community.get(nid)
|
|
678
|
+
if c is None:
|
|
679
|
+
continue
|
|
680
|
+
s = str(c)
|
|
681
|
+
if s in seen:
|
|
682
|
+
continue
|
|
683
|
+
seen.add(s)
|
|
684
|
+
comm_ids.append(s)
|
|
685
|
+
if len(comm_ids) < 2:
|
|
686
|
+
continue
|
|
687
|
+
remapped.append({
|
|
688
|
+
"id": he.get("id", ""),
|
|
689
|
+
"label": he.get("label") or he.get("relation", "").replace("_", " "),
|
|
690
|
+
"nodes": comm_ids,
|
|
691
|
+
})
|
|
692
|
+
meta.graph["hyperedges"] = remapped
|
|
693
|
+
to_html(meta, meta_communities, output_path,
|
|
694
|
+
community_labels=community_labels, member_counts=mc)
|
|
695
|
+
print(f"graph.html written (aggregated: {meta.number_of_nodes()} community nodes, {meta.number_of_edges()} cross-community edges)")
|
|
696
|
+
print("Tip: run with --obsidian for full node-level detail.")
|
|
697
|
+
return
|
|
698
|
+
raise ValueError(
|
|
699
|
+
f"Graph has {G.number_of_nodes()} nodes - too large for HTML viz "
|
|
700
|
+
f"(limit: {limit}). Use --no-viz, raise GRAPHIFY_VIZ_NODE_LIMIT, "
|
|
701
|
+
f"or reduce input size."
|
|
702
|
+
)
|
|
703
|
+
|
|
704
|
+
node_community = _node_community_map(communities)
|
|
705
|
+
degree = dict(G.degree())
|
|
706
|
+
max_deg = max(degree.values(), default=1) or 1
|
|
707
|
+
max_mc = (max(member_counts.values(), default=1) or 1) if member_counts else 1
|
|
708
|
+
|
|
709
|
+
# Build nodes list for vis.js
|
|
710
|
+
vis_nodes = []
|
|
711
|
+
for node_id, data in G.nodes(data=True):
|
|
712
|
+
cid = node_community.get(node_id, 0)
|
|
713
|
+
color = COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)]
|
|
714
|
+
label = sanitize_label(data.get("label", node_id))
|
|
715
|
+
deg = degree.get(node_id, 1)
|
|
716
|
+
if member_counts:
|
|
717
|
+
mc = member_counts.get(cid, 1)
|
|
718
|
+
size = 10 + 30 * (mc / max_mc)
|
|
719
|
+
font_size = 12
|
|
720
|
+
else:
|
|
721
|
+
size = 10 + 30 * (deg / max_deg)
|
|
722
|
+
# Only show label for high-degree nodes by default; others show on hover
|
|
723
|
+
font_size = 12 if deg >= max_deg * 0.15 else 0
|
|
724
|
+
vis_nodes.append({
|
|
725
|
+
"id": node_id,
|
|
726
|
+
"label": label,
|
|
727
|
+
"color": {"background": color, "border": color, "highlight": {"background": "#ffffff", "border": color}},
|
|
728
|
+
"size": round(size, 1),
|
|
729
|
+
"font": {"size": font_size, "color": "#ffffff"},
|
|
730
|
+
"title": _html.escape(label),
|
|
731
|
+
"community": cid,
|
|
732
|
+
"community_name": sanitize_label((community_labels or {}).get(cid, f"Community {cid}")),
|
|
733
|
+
"source_file": sanitize_label(str(data.get("source_file") or "")),
|
|
734
|
+
"file_type": data.get("file_type", ""),
|
|
735
|
+
"degree": deg,
|
|
736
|
+
})
|
|
737
|
+
|
|
738
|
+
# Build edges list. Restore original edge direction from _src/_tgt
|
|
739
|
+
# (stashed by build.py for exactly this reason): undirected NetworkX
|
|
740
|
+
# canonicalizes endpoint order, which would otherwise flip the arrow
|
|
741
|
+
# for `calls` and `rationale_for` in the rendered graph (#563).
|
|
742
|
+
vis_edges = []
|
|
743
|
+
for u, v, data in G.edges(data=True):
|
|
744
|
+
confidence = data.get("confidence", "EXTRACTED")
|
|
745
|
+
relation = data.get("relation", "")
|
|
746
|
+
true_src = data.get("_src", u)
|
|
747
|
+
true_tgt = data.get("_tgt", v)
|
|
748
|
+
vis_edges.append({
|
|
749
|
+
"from": true_src,
|
|
750
|
+
"to": true_tgt,
|
|
751
|
+
"label": relation,
|
|
752
|
+
"title": _html.escape(f"{relation} [{confidence}]"),
|
|
753
|
+
"dashes": confidence != "EXTRACTED",
|
|
754
|
+
"width": 2 if confidence == "EXTRACTED" else 1,
|
|
755
|
+
"color": {"opacity": 0.7 if confidence == "EXTRACTED" else 0.35},
|
|
756
|
+
"confidence": confidence,
|
|
757
|
+
})
|
|
758
|
+
|
|
759
|
+
# Build community legend data
|
|
760
|
+
legend_data = []
|
|
761
|
+
for cid in sorted((community_labels or {}).keys()):
|
|
762
|
+
color = COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)]
|
|
763
|
+
lbl = _html.escape(sanitize_label((community_labels or {}).get(cid, f"Community {cid}")))
|
|
764
|
+
n = member_counts.get(cid, len(communities.get(cid, []))) if member_counts else len(communities.get(cid, []))
|
|
765
|
+
legend_data.append({"cid": cid, "color": color, "label": lbl, "count": n})
|
|
766
|
+
|
|
767
|
+
# Escape </script> sequences so embedded JSON cannot break out of the script tag
|
|
768
|
+
def _js_safe(obj) -> str:
|
|
769
|
+
return json.dumps(obj).replace("</", "<\\/")
|
|
770
|
+
|
|
771
|
+
nodes_json = _js_safe(vis_nodes)
|
|
772
|
+
edges_json = _js_safe(vis_edges)
|
|
773
|
+
legend_json = _js_safe(legend_data)
|
|
774
|
+
hyperedges_json = _js_safe(getattr(G, "graph", {}).get("hyperedges", []))
|
|
775
|
+
title = _html.escape(sanitize_label(str(output_path)))
|
|
776
|
+
stats = f"{G.number_of_nodes()} nodes · {G.number_of_edges()} edges · {len(communities)} communities"
|
|
777
|
+
|
|
778
|
+
html = f"""<!DOCTYPE html>
|
|
779
|
+
<html lang="en">
|
|
780
|
+
<head>
|
|
781
|
+
<meta charset="UTF-8">
|
|
782
|
+
<title>graphify - {title}</title>
|
|
783
|
+
<script src="https://unpkg.com/vis-network@9.1.6/standalone/umd/vis-network.min.js"
|
|
784
|
+
integrity="sha384-Ux6phic9PEHJ38YtrijhkzyJ8yQlH8i/+buBR8s3mAZOJrP1gwyvAcIYl3GWtpX1"
|
|
785
|
+
crossorigin="anonymous"></script>
|
|
786
|
+
{_html_styles()}
|
|
787
|
+
</head>
|
|
788
|
+
<body>
|
|
789
|
+
<div id="graph"></div>
|
|
790
|
+
<div id="sidebar">
|
|
791
|
+
<div id="search-wrap">
|
|
792
|
+
<input id="search" type="text" placeholder="Search nodes..." autocomplete="off">
|
|
793
|
+
<div id="search-results"></div>
|
|
794
|
+
</div>
|
|
795
|
+
<div id="info-panel">
|
|
796
|
+
<h3>Node Info</h3>
|
|
797
|
+
<div id="info-content"><span class="empty">Click a node to inspect it</span></div>
|
|
798
|
+
</div>
|
|
799
|
+
<div id="legend-wrap">
|
|
800
|
+
<h3>Communities</h3>
|
|
801
|
+
<div id="legend-controls">
|
|
802
|
+
<label><input type="checkbox" id="select-all-cb" checked onchange="toggleAllCommunities(!this.checked)">Select All</label>
|
|
803
|
+
</div>
|
|
804
|
+
<div id="legend"></div>
|
|
805
|
+
</div>
|
|
806
|
+
<div id="stats">{stats}</div>
|
|
807
|
+
</div>
|
|
808
|
+
{_html_script(nodes_json, edges_json, legend_json)}
|
|
809
|
+
{_hyperedge_script(hyperedges_json)}
|
|
810
|
+
</body>
|
|
811
|
+
</html>"""
|
|
812
|
+
|
|
813
|
+
Path(output_path).write_text(html, encoding="utf-8") # nosec
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
# Keep backward-compatible alias - skill.md calls generate_html
|
|
817
|
+
generate_html = to_html
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
def _cap_filename(s: str, limit: int = 200) -> str:
|
|
821
|
+
"""Cap a filename stem to ``limit`` UTF-8 bytes so it stays under the 255-byte
|
|
822
|
+
filesystem limit even after the ``.md`` extension and dedup suffix are added
|
|
823
|
+
(#1094). The cap is on BYTES, not chars, because a label of multibyte
|
|
824
|
+
characters (CJK, accented) can exceed 255 bytes well under 255 chars. When
|
|
825
|
+
truncation happens, an 8-char hash of the full label is appended so two
|
|
826
|
+
distinct labels sharing a long prefix produce distinct, deterministic
|
|
827
|
+
filenames instead of colliding."""
|
|
828
|
+
b = s.encode("utf-8")
|
|
829
|
+
if len(b) <= limit:
|
|
830
|
+
return s
|
|
831
|
+
digest = hashlib.sha1(s.encode("utf-8")).hexdigest()[:8] # nosec - not security
|
|
832
|
+
keep = limit - 9 # "_" + 8 hex chars
|
|
833
|
+
truncated = b[:keep].decode("utf-8", "ignore") # "ignore" drops a split trailing char
|
|
834
|
+
return f"{truncated}_{digest}"
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
def to_obsidian(
|
|
838
|
+
G: nx.Graph,
|
|
839
|
+
communities: dict[int, list[str]],
|
|
840
|
+
output_dir: str,
|
|
841
|
+
community_labels: dict[int, str] | None = None,
|
|
842
|
+
cohesion: dict[int, float] | None = None,
|
|
843
|
+
) -> int:
|
|
844
|
+
"""Export graph as an Obsidian vault - one .md file per node with [[wikilinks]],
|
|
845
|
+
plus one _COMMUNITY_name.md overview note per community (sorted to top by underscore prefix).
|
|
846
|
+
|
|
847
|
+
Open the output directory as a vault in Obsidian to get an interactive
|
|
848
|
+
graph view with community colors and full-text search over node metadata.
|
|
849
|
+
|
|
850
|
+
Returns the number of node notes + community notes written.
|
|
851
|
+
"""
|
|
852
|
+
out = Path(output_dir)
|
|
853
|
+
out.mkdir(parents=True, exist_ok=True)
|
|
854
|
+
|
|
855
|
+
node_community = _node_community_map(communities)
|
|
856
|
+
|
|
857
|
+
# Map node_id → safe filename so wikilinks stay consistent.
|
|
858
|
+
# Deduplicate: if two nodes produce the same filename, append a numeric suffix.
|
|
859
|
+
def safe_name(label: str) -> str:
|
|
860
|
+
cleaned = re.sub(r'[\\/*?:"<>|#^[\]]', "", label.replace("\r\n", " ").replace("\r", " ").replace("\n", " ")).strip()
|
|
861
|
+
# Strip trailing .md/.mdx/.markdown so "CLAUDE.md" doesn't become "CLAUDE.md.md"
|
|
862
|
+
cleaned = re.sub(r"\.(md|mdx|qmd|markdown)$", "", cleaned, flags=re.IGNORECASE)
|
|
863
|
+
return _cap_filename(cleaned) if cleaned else "unnamed"
|
|
864
|
+
|
|
865
|
+
node_filename: dict[str, str] = {}
|
|
866
|
+
seen_names: dict[str, int] = {}
|
|
867
|
+
for node_id, data in G.nodes(data=True):
|
|
868
|
+
base = safe_name(data.get("label", node_id))
|
|
869
|
+
if base in seen_names:
|
|
870
|
+
seen_names[base] += 1
|
|
871
|
+
node_filename[node_id] = f"{base}_{seen_names[base]}"
|
|
872
|
+
else:
|
|
873
|
+
seen_names[base] = 0
|
|
874
|
+
node_filename[node_id] = base
|
|
875
|
+
|
|
876
|
+
# Helper: compute dominant confidence for a node across all its edges
|
|
877
|
+
def _dominant_confidence(node_id: str) -> str:
|
|
878
|
+
confs = []
|
|
879
|
+
for u, v, edata in G.edges(node_id, data=True):
|
|
880
|
+
confs.append(edata.get("confidence", "EXTRACTED"))
|
|
881
|
+
if not confs:
|
|
882
|
+
return "EXTRACTED"
|
|
883
|
+
return Counter(confs).most_common(1)[0][0]
|
|
884
|
+
|
|
885
|
+
# Map file_type → graphify tag
|
|
886
|
+
_FTYPE_TAG = {
|
|
887
|
+
"code": "graphify/code",
|
|
888
|
+
"document": "graphify/document",
|
|
889
|
+
"paper": "graphify/paper",
|
|
890
|
+
"image": "graphify/image",
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
# Write one .md file per node
|
|
894
|
+
for node_id, data in G.nodes(data=True):
|
|
895
|
+
label = data.get("label", node_id)
|
|
896
|
+
cid = node_community.get(node_id)
|
|
897
|
+
community_name = (
|
|
898
|
+
community_labels.get(cid, f"Community {cid}")
|
|
899
|
+
if community_labels and cid is not None
|
|
900
|
+
else f"Community {cid}"
|
|
901
|
+
)
|
|
902
|
+
|
|
903
|
+
# Build tags for this node
|
|
904
|
+
ftype = data.get("file_type", "")
|
|
905
|
+
ftype_tag = _FTYPE_TAG.get(ftype, f"graphify/{ftype}" if ftype else "graphify/document")
|
|
906
|
+
dom_conf = _dominant_confidence(node_id)
|
|
907
|
+
conf_tag = f"graphify/{dom_conf}"
|
|
908
|
+
comm_tag = f"community/{_obsidian_tag(community_name)}"
|
|
909
|
+
node_tags = [ftype_tag, conf_tag, comm_tag]
|
|
910
|
+
|
|
911
|
+
lines: list[str] = []
|
|
912
|
+
|
|
913
|
+
# YAML frontmatter - readable in Obsidian's properties panel.
|
|
914
|
+
# All scalars pass through _yaml_str so a hostile source_file or
|
|
915
|
+
# community label cannot break out and inject sibling keys (F-009).
|
|
916
|
+
lines += [
|
|
917
|
+
"---",
|
|
918
|
+
f'source_file: "{_yaml_str(data.get("source_file", ""))}"',
|
|
919
|
+
f'type: "{_yaml_str(ftype)}"',
|
|
920
|
+
f'community: "{_yaml_str(community_name)}"',
|
|
921
|
+
]
|
|
922
|
+
if data.get("source_location"):
|
|
923
|
+
lines.append(f'location: "{_yaml_str(str(data["source_location"]))}"')
|
|
924
|
+
# Add tags list to frontmatter
|
|
925
|
+
lines.append("tags:")
|
|
926
|
+
for tag in node_tags:
|
|
927
|
+
lines.append(f" - {tag}")
|
|
928
|
+
lines += ["---", "", f"# {label}", ""]
|
|
929
|
+
|
|
930
|
+
# Outgoing edges as wikilinks
|
|
931
|
+
neighbors = list(G.neighbors(node_id))
|
|
932
|
+
if neighbors:
|
|
933
|
+
lines.append("## Connections")
|
|
934
|
+
for neighbor in sorted(neighbors, key=lambda n: G.nodes[n].get("label", n)):
|
|
935
|
+
edata = edge_data(G, node_id, neighbor)
|
|
936
|
+
neighbor_label = node_filename[neighbor]
|
|
937
|
+
relation = edata.get("relation", "")
|
|
938
|
+
confidence = edata.get("confidence", "EXTRACTED")
|
|
939
|
+
lines.append(f"- [[{neighbor_label}]] - `{relation}` [{confidence}]")
|
|
940
|
+
lines.append("")
|
|
941
|
+
|
|
942
|
+
# Inline tags at bottom of note body (for Obsidian tag panel)
|
|
943
|
+
inline_tags = " ".join(f"#{t}" for t in node_tags)
|
|
944
|
+
lines.append(inline_tags)
|
|
945
|
+
|
|
946
|
+
fname = node_filename[node_id] + ".md"
|
|
947
|
+
(out / fname).write_text("\n".join(lines), encoding="utf-8") # nosec
|
|
948
|
+
|
|
949
|
+
# Write one _COMMUNITY_name.md overview note per community
|
|
950
|
+
# Build inter-community edge counts for "Connections to other communities"
|
|
951
|
+
inter_community_edges: dict[int, dict[int, int]] = {}
|
|
952
|
+
for cid in communities:
|
|
953
|
+
inter_community_edges[cid] = {}
|
|
954
|
+
for u, v in G.edges():
|
|
955
|
+
cu = node_community.get(u)
|
|
956
|
+
cv = node_community.get(v)
|
|
957
|
+
if cu is not None and cv is not None and cu != cv:
|
|
958
|
+
inter_community_edges.setdefault(cu, {})
|
|
959
|
+
inter_community_edges.setdefault(cv, {})
|
|
960
|
+
inter_community_edges[cu][cv] = inter_community_edges[cu].get(cv, 0) + 1
|
|
961
|
+
inter_community_edges[cv][cu] = inter_community_edges[cv].get(cu, 0) + 1
|
|
962
|
+
|
|
963
|
+
# Precompute per-node community reach (number of distinct communities a node connects to)
|
|
964
|
+
def _community_reach(node_id: str) -> int:
|
|
965
|
+
neighbor_cids = {
|
|
966
|
+
node_community[nb]
|
|
967
|
+
for nb in G.neighbors(node_id)
|
|
968
|
+
if nb in node_community and node_community[nb] != node_community.get(node_id)
|
|
969
|
+
}
|
|
970
|
+
return len(neighbor_cids)
|
|
971
|
+
|
|
972
|
+
community_notes_written = 0
|
|
973
|
+
for cid, members in communities.items():
|
|
974
|
+
community_name = (
|
|
975
|
+
community_labels.get(cid, f"Community {cid}")
|
|
976
|
+
if community_labels and cid is not None
|
|
977
|
+
else f"Community {cid}"
|
|
978
|
+
)
|
|
979
|
+
n_members = len(members)
|
|
980
|
+
coh_value = cohesion.get(cid) if cohesion else None
|
|
981
|
+
|
|
982
|
+
lines: list[str] = []
|
|
983
|
+
|
|
984
|
+
# YAML frontmatter
|
|
985
|
+
lines.append("---")
|
|
986
|
+
lines.append("type: community")
|
|
987
|
+
if coh_value is not None:
|
|
988
|
+
lines.append(f"cohesion: {coh_value:.2f}")
|
|
989
|
+
lines.append(f"members: {n_members}")
|
|
990
|
+
lines.append("---")
|
|
991
|
+
lines.append("")
|
|
992
|
+
lines.append(f"# {community_name}")
|
|
993
|
+
lines.append("")
|
|
994
|
+
|
|
995
|
+
# Cohesion + member count summary
|
|
996
|
+
if coh_value is not None:
|
|
997
|
+
cohesion_desc = (
|
|
998
|
+
"tightly connected" if coh_value >= 0.7
|
|
999
|
+
else "moderately connected" if coh_value >= 0.4
|
|
1000
|
+
else "loosely connected"
|
|
1001
|
+
)
|
|
1002
|
+
lines.append(f"**Cohesion:** {coh_value:.2f} - {cohesion_desc}")
|
|
1003
|
+
lines.append(f"**Members:** {n_members} nodes")
|
|
1004
|
+
lines.append("")
|
|
1005
|
+
|
|
1006
|
+
# Members section
|
|
1007
|
+
lines.append("## Members")
|
|
1008
|
+
for node_id in sorted(members, key=lambda n: G.nodes[n].get("label", n)):
|
|
1009
|
+
data = G.nodes[node_id]
|
|
1010
|
+
node_label = node_filename[node_id]
|
|
1011
|
+
ftype = data.get("file_type", "")
|
|
1012
|
+
source = data.get("source_file", "")
|
|
1013
|
+
entry = f"- [[{node_label}]]"
|
|
1014
|
+
if ftype:
|
|
1015
|
+
entry += f" - {ftype}"
|
|
1016
|
+
if source:
|
|
1017
|
+
entry += f" - {source}"
|
|
1018
|
+
lines.append(entry)
|
|
1019
|
+
lines.append("")
|
|
1020
|
+
|
|
1021
|
+
# Dataview live query (improvement 2)
|
|
1022
|
+
comm_tag_name = _obsidian_tag(community_name)
|
|
1023
|
+
lines.append("## Live Query (requires Dataview plugin)")
|
|
1024
|
+
lines.append("")
|
|
1025
|
+
lines.append("```dataview")
|
|
1026
|
+
lines.append(f"TABLE source_file, type FROM #community/{comm_tag_name}")
|
|
1027
|
+
lines.append("SORT file.name ASC")
|
|
1028
|
+
lines.append("```")
|
|
1029
|
+
lines.append("")
|
|
1030
|
+
|
|
1031
|
+
# Connections to other communities
|
|
1032
|
+
cross = inter_community_edges.get(cid, {})
|
|
1033
|
+
if cross:
|
|
1034
|
+
lines.append("## Connections to other communities")
|
|
1035
|
+
for other_cid, edge_count in sorted(cross.items(), key=lambda x: -x[1]):
|
|
1036
|
+
other_name = (
|
|
1037
|
+
community_labels.get(other_cid, f"Community {other_cid}")
|
|
1038
|
+
if community_labels and other_cid is not None
|
|
1039
|
+
else f"Community {other_cid}"
|
|
1040
|
+
)
|
|
1041
|
+
other_safe = safe_name(other_name)
|
|
1042
|
+
lines.append(f"- {edge_count} edge{'s' if edge_count != 1 else ''} to [[_COMMUNITY_{other_safe}]]")
|
|
1043
|
+
lines.append("")
|
|
1044
|
+
|
|
1045
|
+
# Top bridge nodes - highest degree nodes that connect to other communities
|
|
1046
|
+
bridge_nodes = [
|
|
1047
|
+
(node_id, G.degree(node_id), _community_reach(node_id))
|
|
1048
|
+
for node_id in members
|
|
1049
|
+
if _community_reach(node_id) > 0
|
|
1050
|
+
]
|
|
1051
|
+
bridge_nodes.sort(key=lambda x: (-x[2], -x[1]))
|
|
1052
|
+
top_bridges = bridge_nodes[:5]
|
|
1053
|
+
if top_bridges:
|
|
1054
|
+
lines.append("## Top bridge nodes")
|
|
1055
|
+
for node_id, degree, reach in top_bridges:
|
|
1056
|
+
node_label = node_filename[node_id]
|
|
1057
|
+
lines.append(
|
|
1058
|
+
f"- [[{node_label}]] - degree {degree}, connects to {reach} "
|
|
1059
|
+
f"{'community' if reach == 1 else 'communities'}"
|
|
1060
|
+
)
|
|
1061
|
+
|
|
1062
|
+
community_safe = safe_name(community_name)
|
|
1063
|
+
fname = f"_COMMUNITY_{community_safe}.md"
|
|
1064
|
+
(out / fname).write_text("\n".join(lines), encoding="utf-8") # nosec
|
|
1065
|
+
community_notes_written += 1
|
|
1066
|
+
|
|
1067
|
+
# Improvement 4: write .obsidian/graph.json to color nodes by community in graph view
|
|
1068
|
+
obsidian_dir = out / ".obsidian"
|
|
1069
|
+
obsidian_dir.mkdir(exist_ok=True)
|
|
1070
|
+
graph_config = {
|
|
1071
|
+
"colorGroups": [
|
|
1072
|
+
{
|
|
1073
|
+
"query": f"tag:#community/{label.replace(' ', '_')}",
|
|
1074
|
+
"color": {"a": 1, "rgb": int(COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)].lstrip('#'), 16)}
|
|
1075
|
+
}
|
|
1076
|
+
for cid, label in sorted((community_labels or {}).items())
|
|
1077
|
+
]
|
|
1078
|
+
}
|
|
1079
|
+
(obsidian_dir / "graph.json").write_text(json.dumps(graph_config, indent=2), encoding="utf-8") # nosec
|
|
1080
|
+
|
|
1081
|
+
return G.number_of_nodes() + community_notes_written
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
def to_canvas(
|
|
1085
|
+
G: nx.Graph,
|
|
1086
|
+
communities: dict[int, list[str]],
|
|
1087
|
+
output_path: str,
|
|
1088
|
+
community_labels: dict[int, str] | None = None,
|
|
1089
|
+
node_filenames: dict[str, str] | None = None,
|
|
1090
|
+
) -> None:
|
|
1091
|
+
"""Export graph as an Obsidian Canvas file - communities as groups, nodes as cards.
|
|
1092
|
+
|
|
1093
|
+
Generates a structured layout: communities arranged in a grid, nodes within
|
|
1094
|
+
each community arranged in rows. Edges shown between connected nodes.
|
|
1095
|
+
Opens in Obsidian as an infinite canvas with community groupings visible.
|
|
1096
|
+
"""
|
|
1097
|
+
# Obsidian canvas color codes (cycle through for communities)
|
|
1098
|
+
CANVAS_COLORS = ["1", "2", "3", "4", "5", "6"] # red, orange, yellow, green, cyan, purple
|
|
1099
|
+
|
|
1100
|
+
def safe_name(label: str) -> str:
|
|
1101
|
+
cleaned = re.sub(r'[\\/*?:"<>|#^[\]]', "", label.replace("\r\n", " ").replace("\r", " ").replace("\n", " ")).strip()
|
|
1102
|
+
cleaned = re.sub(r"\.(md|mdx|qmd|markdown)$", "", cleaned, flags=re.IGNORECASE)
|
|
1103
|
+
return _cap_filename(cleaned) if cleaned else "unnamed"
|
|
1104
|
+
|
|
1105
|
+
# Build node_filenames if not provided (same dedup logic as to_obsidian)
|
|
1106
|
+
if node_filenames is None:
|
|
1107
|
+
node_filenames = {}
|
|
1108
|
+
seen_names: dict[str, int] = {}
|
|
1109
|
+
for node_id, data in G.nodes(data=True):
|
|
1110
|
+
base = safe_name(data.get("label", node_id))
|
|
1111
|
+
if base in seen_names:
|
|
1112
|
+
seen_names[base] += 1
|
|
1113
|
+
node_filenames[node_id] = f"{base}_{seen_names[base]}"
|
|
1114
|
+
else:
|
|
1115
|
+
seen_names[base] = 0
|
|
1116
|
+
node_filenames[node_id] = base
|
|
1117
|
+
|
|
1118
|
+
num_communities = len(communities)
|
|
1119
|
+
cols = math.ceil(math.sqrt(num_communities)) if num_communities > 0 else 1
|
|
1120
|
+
rows = math.ceil(num_communities / cols) if num_communities > 0 else 1
|
|
1121
|
+
|
|
1122
|
+
canvas_nodes: list[dict] = []
|
|
1123
|
+
canvas_edges: list[dict] = []
|
|
1124
|
+
|
|
1125
|
+
# Lay out communities in a grid
|
|
1126
|
+
gap = 80
|
|
1127
|
+
group_x_offsets: list[int] = []
|
|
1128
|
+
group_y_offsets: list[int] = []
|
|
1129
|
+
|
|
1130
|
+
# Precompute group sizes so we can calculate offsets
|
|
1131
|
+
sorted_cids = sorted(communities.keys())
|
|
1132
|
+
group_sizes: dict[int, tuple[int, int]] = {}
|
|
1133
|
+
for cid in sorted_cids:
|
|
1134
|
+
members = communities[cid]
|
|
1135
|
+
n = len(members)
|
|
1136
|
+
w = max(600, 220 * math.ceil(math.sqrt(n)) if n > 0 else 600)
|
|
1137
|
+
h = max(400, 100 * math.ceil(n / 3) + 120 if n > 0 else 400)
|
|
1138
|
+
group_sizes[cid] = (w, h)
|
|
1139
|
+
|
|
1140
|
+
# Compute cumulative row heights and col widths for grid placement
|
|
1141
|
+
# Each grid cell uses the max width/height in its col/row
|
|
1142
|
+
col_widths: list[int] = []
|
|
1143
|
+
row_heights: list[int] = []
|
|
1144
|
+
for col_idx in range(cols):
|
|
1145
|
+
max_w = 0
|
|
1146
|
+
for row_idx in range(rows):
|
|
1147
|
+
linear = row_idx * cols + col_idx
|
|
1148
|
+
if linear < len(sorted_cids):
|
|
1149
|
+
cid = sorted_cids[linear]
|
|
1150
|
+
w, _ = group_sizes[cid]
|
|
1151
|
+
max_w = max(max_w, w)
|
|
1152
|
+
col_widths.append(max_w)
|
|
1153
|
+
|
|
1154
|
+
for row_idx in range(rows):
|
|
1155
|
+
max_h = 0
|
|
1156
|
+
for col_idx in range(cols):
|
|
1157
|
+
linear = row_idx * cols + col_idx
|
|
1158
|
+
if linear < len(sorted_cids):
|
|
1159
|
+
cid = sorted_cids[linear]
|
|
1160
|
+
_, h = group_sizes[cid]
|
|
1161
|
+
max_h = max(max_h, h)
|
|
1162
|
+
row_heights.append(max_h)
|
|
1163
|
+
|
|
1164
|
+
# Map from cid → (group_x, group_y, group_w, group_h)
|
|
1165
|
+
group_layout: dict[int, tuple[int, int, int, int]] = {}
|
|
1166
|
+
for idx, cid in enumerate(sorted_cids):
|
|
1167
|
+
col_idx = idx % cols
|
|
1168
|
+
row_idx = idx // cols
|
|
1169
|
+
gx = sum(col_widths[:col_idx]) + col_idx * gap
|
|
1170
|
+
gy = sum(row_heights[:row_idx]) + row_idx * gap
|
|
1171
|
+
gw, gh = group_sizes[cid]
|
|
1172
|
+
group_layout[cid] = (gx, gy, gw, gh)
|
|
1173
|
+
|
|
1174
|
+
# Build set of all node_ids in canvas for edge filtering
|
|
1175
|
+
all_canvas_nodes: set[str] = set()
|
|
1176
|
+
for members in communities.values():
|
|
1177
|
+
all_canvas_nodes.update(members)
|
|
1178
|
+
|
|
1179
|
+
# Generate group and node canvas entries
|
|
1180
|
+
for idx, cid in enumerate(sorted_cids):
|
|
1181
|
+
members = communities[cid]
|
|
1182
|
+
community_name = (
|
|
1183
|
+
community_labels.get(cid, f"Community {cid}")
|
|
1184
|
+
if community_labels and cid is not None
|
|
1185
|
+
else f"Community {cid}"
|
|
1186
|
+
)
|
|
1187
|
+
gx, gy, gw, gh = group_layout[cid]
|
|
1188
|
+
canvas_color = CANVAS_COLORS[idx % len(CANVAS_COLORS)]
|
|
1189
|
+
|
|
1190
|
+
# Group node
|
|
1191
|
+
canvas_nodes.append({
|
|
1192
|
+
"id": f"g{cid}",
|
|
1193
|
+
"type": "group",
|
|
1194
|
+
"label": community_name,
|
|
1195
|
+
"x": gx,
|
|
1196
|
+
"y": gy,
|
|
1197
|
+
"width": gw,
|
|
1198
|
+
"height": gh,
|
|
1199
|
+
"color": canvas_color,
|
|
1200
|
+
})
|
|
1201
|
+
|
|
1202
|
+
# Node cards inside the group - rows of 3
|
|
1203
|
+
sorted_members = sorted(members, key=lambda n: G.nodes[n].get("label", n))
|
|
1204
|
+
for m_idx, node_id in enumerate(sorted_members):
|
|
1205
|
+
col = m_idx % 3
|
|
1206
|
+
row = m_idx // 3
|
|
1207
|
+
nx_x = gx + 20 + col * (180 + 20)
|
|
1208
|
+
nx_y = gy + 80 + row * (60 + 20)
|
|
1209
|
+
fname = node_filenames.get(node_id, safe_name(G.nodes[node_id].get("label", node_id)))
|
|
1210
|
+
canvas_nodes.append({
|
|
1211
|
+
"id": f"n_{node_id}",
|
|
1212
|
+
"type": "file",
|
|
1213
|
+
"file": f"{fname}.md",
|
|
1214
|
+
"x": nx_x,
|
|
1215
|
+
"y": nx_y,
|
|
1216
|
+
"width": 180,
|
|
1217
|
+
"height": 60,
|
|
1218
|
+
})
|
|
1219
|
+
|
|
1220
|
+
# Generate edges - only between nodes both in canvas, cap at 200 highest-weight
|
|
1221
|
+
all_edges_weighted: list[tuple[float, str, str, str]] = []
|
|
1222
|
+
for u, v, edata in G.edges(data=True):
|
|
1223
|
+
if u in all_canvas_nodes and v in all_canvas_nodes:
|
|
1224
|
+
weight = edata.get("weight", 1.0)
|
|
1225
|
+
relation = edata.get("relation", "")
|
|
1226
|
+
conf = edata.get("confidence", "EXTRACTED")
|
|
1227
|
+
label = f"{relation} [{conf}]" if relation else f"[{conf}]"
|
|
1228
|
+
all_edges_weighted.append((weight, u, v, label))
|
|
1229
|
+
|
|
1230
|
+
all_edges_weighted.sort(key=lambda x: -x[0])
|
|
1231
|
+
for weight, u, v, label in all_edges_weighted[:200]:
|
|
1232
|
+
canvas_edges.append({
|
|
1233
|
+
"id": f"e_{u}_{v}",
|
|
1234
|
+
"fromNode": f"n_{u}",
|
|
1235
|
+
"toNode": f"n_{v}",
|
|
1236
|
+
"label": label,
|
|
1237
|
+
})
|
|
1238
|
+
|
|
1239
|
+
canvas_data = {"nodes": canvas_nodes, "edges": canvas_edges}
|
|
1240
|
+
Path(output_path).write_text(json.dumps(canvas_data, indent=2), encoding="utf-8") # nosec
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
def push_to_neo4j(
|
|
1244
|
+
G: nx.Graph,
|
|
1245
|
+
uri: str,
|
|
1246
|
+
user: str,
|
|
1247
|
+
password: str,
|
|
1248
|
+
communities: dict[int, list[str]] | None = None,
|
|
1249
|
+
) -> dict[str, int]:
|
|
1250
|
+
"""Push graph directly to a running Neo4j instance via the Python driver.
|
|
1251
|
+
|
|
1252
|
+
Requires: pip install neo4j
|
|
1253
|
+
|
|
1254
|
+
Uses MERGE so re-running is safe - nodes and edges are upserted, not duplicated.
|
|
1255
|
+
Returns a dict with counts of nodes and edges pushed.
|
|
1256
|
+
"""
|
|
1257
|
+
try:
|
|
1258
|
+
from neo4j import GraphDatabase
|
|
1259
|
+
except ImportError as e:
|
|
1260
|
+
raise ImportError(
|
|
1261
|
+
"neo4j driver not installed. Run: pip install neo4j"
|
|
1262
|
+
) from e
|
|
1263
|
+
|
|
1264
|
+
node_community = _node_community_map(communities) if communities else {}
|
|
1265
|
+
|
|
1266
|
+
def _safe_rel(relation: str) -> str:
|
|
1267
|
+
return re.sub(r"[^A-Z0-9_]", "_", relation.upper().replace(" ", "_").replace("-", "_")) or "RELATED_TO"
|
|
1268
|
+
|
|
1269
|
+
def _safe_label(label: str) -> str:
|
|
1270
|
+
"""Sanitize a Neo4j node label to prevent Cypher injection."""
|
|
1271
|
+
sanitized = re.sub(r"[^A-Za-z0-9_]", "", label)
|
|
1272
|
+
return sanitized if sanitized else "Entity"
|
|
1273
|
+
|
|
1274
|
+
driver = GraphDatabase.driver(uri, auth=(user, password))
|
|
1275
|
+
nodes_pushed = 0
|
|
1276
|
+
edges_pushed = 0
|
|
1277
|
+
|
|
1278
|
+
with driver.session() as session:
|
|
1279
|
+
for node_id, data in G.nodes(data=True):
|
|
1280
|
+
props = {
|
|
1281
|
+
k: v for k, v in data.items()
|
|
1282
|
+
if isinstance(v, (str, int, float, bool)) and not k.startswith("_")
|
|
1283
|
+
}
|
|
1284
|
+
props["id"] = node_id
|
|
1285
|
+
cid = node_community.get(node_id)
|
|
1286
|
+
if cid is not None:
|
|
1287
|
+
props["community"] = cid
|
|
1288
|
+
ftype = _safe_label(data.get("file_type", "Entity").capitalize())
|
|
1289
|
+
session.run(
|
|
1290
|
+
f"MERGE (n:{ftype} {{id: $id}}) SET n += $props",
|
|
1291
|
+
id=node_id,
|
|
1292
|
+
props=props,
|
|
1293
|
+
)
|
|
1294
|
+
nodes_pushed += 1
|
|
1295
|
+
|
|
1296
|
+
for u, v, data in G.edges(data=True):
|
|
1297
|
+
rel = _safe_rel(data.get("relation", "RELATED_TO"))
|
|
1298
|
+
props = {
|
|
1299
|
+
k: v for k, v in data.items()
|
|
1300
|
+
if isinstance(v, (str, int, float, bool)) and not k.startswith("_")
|
|
1301
|
+
}
|
|
1302
|
+
session.run(
|
|
1303
|
+
f"MATCH (a {{id: $src}}), (b {{id: $tgt}}) "
|
|
1304
|
+
f"MERGE (a)-[r:{rel}]->(b) SET r += $props",
|
|
1305
|
+
src=u,
|
|
1306
|
+
tgt=v,
|
|
1307
|
+
props=props,
|
|
1308
|
+
)
|
|
1309
|
+
edges_pushed += 1
|
|
1310
|
+
|
|
1311
|
+
driver.close()
|
|
1312
|
+
return {"nodes": nodes_pushed, "edges": edges_pushed}
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
def to_graphml(
|
|
1316
|
+
G: nx.Graph,
|
|
1317
|
+
communities: dict[int, list[str]],
|
|
1318
|
+
output_path: str,
|
|
1319
|
+
) -> None:
|
|
1320
|
+
"""Export graph as GraphML - opens in Gephi, yEd, and any GraphML-compatible tool.
|
|
1321
|
+
|
|
1322
|
+
Community IDs are written as a node attribute so Gephi can colour by community.
|
|
1323
|
+
Edge confidence (EXTRACTED/INFERRED/AMBIGUOUS) is preserved as an edge attribute.
|
|
1324
|
+
"""
|
|
1325
|
+
H = G.copy()
|
|
1326
|
+
node_community = _node_community_map(communities)
|
|
1327
|
+
for node_id in H.nodes():
|
|
1328
|
+
H.nodes[node_id]["community"] = node_community.get(node_id, -1)
|
|
1329
|
+
# Drop internal markers (e.g. the AST-provenance "_origin" tag, #1116, and
|
|
1330
|
+
# the "_src"/"_tgt" direction markers) — they are persistence/runtime details,
|
|
1331
|
+
# not graph data, and should not leak into the exported file.
|
|
1332
|
+
for _, attrs in H.nodes(data=True):
|
|
1333
|
+
for k in [k for k in attrs if k.startswith("_")]:
|
|
1334
|
+
del attrs[k]
|
|
1335
|
+
for _, _, attrs in H.edges(data=True):
|
|
1336
|
+
for k in [k for k in attrs if k.startswith("_")]:
|
|
1337
|
+
del attrs[k]
|
|
1338
|
+
nx.write_graphml(H, output_path)
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
def to_svg(
|
|
1342
|
+
G: nx.Graph,
|
|
1343
|
+
communities: dict[int, list[str]],
|
|
1344
|
+
output_path: str,
|
|
1345
|
+
community_labels: dict[int, str] | None = None,
|
|
1346
|
+
figsize: tuple[int, int] = (20, 14),
|
|
1347
|
+
) -> None:
|
|
1348
|
+
"""Export graph as an SVG file using matplotlib + spring layout.
|
|
1349
|
+
|
|
1350
|
+
Lightweight and embeddable - works in Obsidian notes, Notion, GitHub READMEs,
|
|
1351
|
+
and any markdown renderer. No JavaScript required.
|
|
1352
|
+
|
|
1353
|
+
Node size scales with degree. Community colors match the HTML output.
|
|
1354
|
+
"""
|
|
1355
|
+
try:
|
|
1356
|
+
import matplotlib
|
|
1357
|
+
matplotlib.use("Agg")
|
|
1358
|
+
import matplotlib.pyplot as plt
|
|
1359
|
+
import matplotlib.patches as mpatches
|
|
1360
|
+
except ImportError as e:
|
|
1361
|
+
raise ImportError("matplotlib not installed. Run: pip install matplotlib") from e
|
|
1362
|
+
|
|
1363
|
+
node_community = _node_community_map(communities)
|
|
1364
|
+
|
|
1365
|
+
fig, ax = plt.subplots(figsize=figsize, facecolor="#1a1a2e")
|
|
1366
|
+
ax.set_facecolor("#1a1a2e")
|
|
1367
|
+
ax.axis("off")
|
|
1368
|
+
|
|
1369
|
+
pos = nx.spring_layout(G, seed=42, k=2.0 / (G.number_of_nodes() ** 0.5 + 1))
|
|
1370
|
+
|
|
1371
|
+
degree = dict(G.degree())
|
|
1372
|
+
max_deg = max(degree.values(), default=1) or 1
|
|
1373
|
+
|
|
1374
|
+
node_colors = [COMMUNITY_COLORS[node_community.get(n, 0) % len(COMMUNITY_COLORS)] for n in G.nodes()]
|
|
1375
|
+
node_sizes = [300 + 1200 * (degree.get(n, 1) / max_deg) for n in G.nodes()]
|
|
1376
|
+
|
|
1377
|
+
# Draw edges - dashed for non-EXTRACTED
|
|
1378
|
+
for u, v, data in G.edges(data=True):
|
|
1379
|
+
conf = data.get("confidence", "EXTRACTED")
|
|
1380
|
+
style = "solid" if conf == "EXTRACTED" else "dashed"
|
|
1381
|
+
alpha = 0.6 if conf == "EXTRACTED" else 0.3
|
|
1382
|
+
x0, y0 = pos[u]
|
|
1383
|
+
x1, y1 = pos[v]
|
|
1384
|
+
ax.plot([x0, x1], [y0, y1], color="#aaaaaa", linewidth=0.8,
|
|
1385
|
+
linestyle=style, alpha=alpha, zorder=1)
|
|
1386
|
+
|
|
1387
|
+
nx.draw_networkx_nodes(G, pos, ax=ax, node_color=node_colors,
|
|
1388
|
+
node_size=node_sizes, alpha=0.9)
|
|
1389
|
+
nx.draw_networkx_labels(G, pos, ax=ax,
|
|
1390
|
+
labels={n: G.nodes[n].get("label", n) for n in G.nodes()},
|
|
1391
|
+
font_size=7, font_color="white")
|
|
1392
|
+
|
|
1393
|
+
# Legend
|
|
1394
|
+
if community_labels:
|
|
1395
|
+
patches = [
|
|
1396
|
+
mpatches.Patch(
|
|
1397
|
+
color=COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)],
|
|
1398
|
+
label=f"{label} ({len(communities.get(cid, []))})",
|
|
1399
|
+
)
|
|
1400
|
+
for cid, label in sorted(community_labels.items())
|
|
1401
|
+
]
|
|
1402
|
+
ax.legend(handles=patches, loc="upper left", framealpha=0.7,
|
|
1403
|
+
facecolor="#2a2a4e", labelcolor="white", fontsize=8)
|
|
1404
|
+
|
|
1405
|
+
plt.tight_layout()
|
|
1406
|
+
plt.savefig(output_path, format="svg", bbox_inches="tight",
|
|
1407
|
+
facecolor=fig.get_facecolor())
|
|
1408
|
+
plt.close(fig)
|