Agent Skillsmanagedcode/dotnet-skills › graphify-dotnet

graphify-dotnet

GitHub

用于生成 .NET 代码库的知识图谱、架构快照和仓库映射,支持 AST 解析与 AI 语义增强,可导出为 JSON、HTML、SVG、Cypher 等格式,辅助架构审查、依赖发现和文档构建。

catalog/Tools/Graphify/skills/graphify-dotnet/SKILL.md managedcode/dotnet-skills

Trigger Scenarios

执行 graphify 命令生成代码库图谱或架构快照 需要导出仓库结构为 graph.json、HTML、SVG 或 Neo4j 格式 进行代码库依赖分析或新成员入职导航图构建

Install

npx skills add managedcode/dotnet-skills --skill graphify-dotnet -g -y
More Options

Non-standard path

npx skills add https://github.com/managedcode/dotnet-skills/tree/main/catalog/Tools/Graphify/skills/graphify-dotnet -g -y

Use without installing

npx skills use managedcode/dotnet-skills@graphify-dotnet

指定 Agent (Claude Code)

npx skills add managedcode/dotnet-skills --skill graphify-dotnet -a claude-code -g -y

安装 repo 全部 skill

npx skills add managedcode/dotnet-skills --all -g -y

预览 repo 内 skill

npx skills add managedcode/dotnet-skills --list

SKILL.md

Frontmatter
{
    "name": "graphify-dotnet",
    "description": "Use `graphify-dotnet` to generate codebase knowledge graphs, architecture snapshots, and exportable repository maps from .NET or polyglot source trees, with optional AI-enriched semantic relationships. USE FOR: graphify commands; graph JSON, HTML, SVG, Cypher, Markdown, and Obsidian exports; repository map and architecture snapshot generation. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.",
    "compatibility": "Requires the `graphify-dotnet` global tool and a .NET 10 SDK; AST-only extraction works with zero model setup, while semantic enrichment needs Azure OpenAI, Ollama, or GitHub Copilot SDK."
}

graphify-dotnet

Trigger On

  • graphify, graphify run, graphify watch, graphify benchmark, or graphify config
  • generating graph.json, graph.html, graph.svg, graph.cypher, GRAPH_REPORT.md, obsidian/, or wiki/
  • building onboarding maps, architecture snapshots, or dependency-discovery artifacts from a repository
  • choosing between AST-only extraction and AI-enriched semantic extraction
  • pushing graph output into Neo4j, Obsidian, wiki docs, or CI artifacts

Workflow

  1. Confirm the problem is structural discovery, architecture review, onboarding, or graph export. If the user only needs one symbol lookup, one bug fix, or one dependency trace, normal repo search and tests are cheaper than a full graph run.
  2. Install and verify the tool before doing anything else:
    dotnet --version
    dotnet tool install -g graphify-dotnet
    graphify --version
    
  3. Start with a bounded AST-only run so the first output is fast and deterministic:
    graphify run ./src --format json,html,report --provider none --verbose
    
  4. Review outputs in this order:
    • GRAPH_REPORT.md for quick signal
    • graph.html for visual exploration
    • graph.json for scripting and downstream tooling
  5. Add AI enrichment only when inferred relationships or conceptual grouping matter more than strict syntax-only structure.
  6. Expand export formats for the real consumer:
    • svg for static docs and PRs
    • neo4j for graph queries
    • obsidian,wiki for knowledge-base or onboarding flows
  7. Use watch for iterative architecture work, but rerun a clean run periodically because deletes and renames can leave stale references behind.
  8. Run benchmark only after you already trust the generated graph.json; its value is comparative token-reduction evidence, not billing-grade accounting.

Architecture

flowchart LR
  A["Repository or subtree"] --> B["graphify run / watch"]
  B --> C{"AI provider configured?"}
  C -->|No| D["AST extraction only"]
  C -->|Yes| E["AST + semantic extraction"]
  D --> F["Knowledge graph + Louvain communities"]
  E --> F
  F --> G{"Output target"}
  G -->|Human review| H["graph.html + GRAPH_REPORT.md"]
  G -->|Automation| I["graph.json"]
  G -->|Static docs| J["graph.svg"]
  G -->|Knowledge base| K["obsidian/ or wiki/"]
  G -->|Graph queries| L["graph.cypher for Neo4j"]

Practical Recipes

Write a quick architecture snapshot

graphify run . --format html,report --output ./artifacts/graph

Use this when you need a fast human-readable map of the current repo. Read ./artifacts/graph/GRAPH_REPORT.md first, then open ./artifacts/graph/graph.html.

Write queryable and documentation exports

graphify run ./src --format json,neo4j,svg,obsidian,wiki --output ./graphify-out

Use this when the graph will be consumed by scripts, Neo4j, docs, or knowledge-base tooling instead of only a browser.

Read and benchmark an existing graph

graphify benchmark ./graphify-out/graph.json

Treat this as a heuristic efficiency check for AI-context workflows after the graph already exists.

Provider Choice

  • none: best first run, deterministic, fast, no external dependencies
  • ollama: local and privacy-friendly; good for sensitive code or low-cost experimentation
  • azureopenai: enterprise-hosted semantic extraction with explicit endpoint, key, and deployment
  • copilotsdk: lowest-friction option for teams that already authenticate with GitHub Copilot

Choose the provider by operational constraint first, not by model hype:

  • privacy or offline requirements: ollama
  • enterprise Azure governance: azureopenai
  • fastest setup for existing subscribers: copilotsdk
  • no semantic extraction required: none

Configuration Patterns

graphify resolves settings in this priority order:

  1. CLI arguments
  2. user secrets
  3. environment variables
  4. appsettings.local.json
  5. appsettings.json

Use graphify config for the interactive wizard and graphify config show to inspect the resolved effective settings.

Common environment-variable patterns:

# AST-only explicit override
export GRAPHIFY__Provider=None

# Ollama
export GRAPHIFY__Provider=Ollama
export GRAPHIFY__Ollama__Endpoint=http://localhost:11434
export GRAPHIFY__Ollama__ModelId=llama3.2

# Azure OpenAI
export GRAPHIFY__Provider=AzureOpenAI
export GRAPHIFY__AzureOpenAI__Endpoint=https://myresource.openai.azure.com/
export GRAPHIFY__AzureOpenAI__ApiKey=...
export GRAPHIFY__AzureOpenAI__DeploymentName=gpt-4o

# GitHub Copilot SDK
export GRAPHIFY__Provider=CopilotSdk
export GRAPHIFY__CopilotSdk__ModelId=gpt-4.1

Tradeoffs And Constraints

  • AST-only mode is reliable for structural facts such as files, classes, methods, and imports, but it will not infer conceptual links that are absent from syntax.
  • AI enrichment produces richer graphs but adds latency, provider setup, quota or subscription concerns, and privacy review.
  • watch mode is an inner-loop accelerator, not a perfect source of truth. Deleted files are not fully removed from the graph until a clean rebuild, and renames can temporarily duplicate nodes.
  • graph.html is great for quick inspection, but large graphs can render slowly and some browsers block file:// loading. Serve the output folder locally if the page renders blank.
  • graphify respects .gitignore, so an empty graph can be a path-selection problem instead of a parser failure.
  • benchmark is approximate. The source uses heuristic token estimation, so treat the numbers as directional rather than invoice-grade.

Deliver

  • a justified choice of AST-only vs AI-enriched extraction
  • concrete graphify commands for the repo, folder, or output consumer
  • the right export-format set for humans, docs, scripts, or graph databases
  • configuration guidance that fits the chosen provider and operating model
  • a validation path for the produced graph artifacts

Validate

  • dotnet --version shows a .NET 10 SDK
  • graphify --version resolves after installation
  • graphify run <path> --format json,html,report -v completes without provider or path errors
  • the output folder contains the expected artifacts for the selected formats
  • graphify config show reflects the intended provider configuration when AI enrichment is enabled
  • graphify benchmark <graph.json> runs only after a real graph file exists

Load References

  • references/source-map.md - upstream repository and docs map with direct links to the README, CLI docs, provider setup guides, sample project, and export-format docs
  • references/usage-and-operations.md - practical commands, provider setup patterns, export selection, watch-mode behavior, troubleshooting, and benchmark caveats

Version History

  • 7ab7f03 Current 2026-07-25 05:26

Same Skill Collection

catalog/Frameworks/gRPC/skills/grpc/SKILL.md
catalog/Frameworks/Official-Astro/skills/astro-developer/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/configuring-opentelemetry-dotnet/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/dotnet-webapi/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/minimal-api-file-upload/SKILL.md
catalog/Frameworks/Orleans/skills/orleans/SKILL.md
catalog/Frameworks/ThreeJS-WebGPU-TSL/skills/webgpu-threejs-tsl/SKILL.md
catalog/Libraries/ManagedCode-Orleans-SignalR/skills/managedcode-orleans-signalr/SKILL.md
catalog/Libraries/Official-DotNet-Data/skills/optimizing-ef-core-queries/SKILL.md
catalog/Platform/Official-DotNet-Advanced/skills/csharp-scripts/SKILL.md
catalog/Platform/Official-DotNet-Advanced/skills/nuget-trusted-publishing/SKILL.md
catalog/Platform/Official-DotNet-Advanced/skills/vectorization/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/create-blazor-project/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/fetch-and-send-data/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/support-prerendering/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/use-js-interop/SKILL.md
catalog/Platform/Official-DotNet-Experimental/skills/exp-mock-usage-analysis/SKILL.md
catalog/Platform/Official-DotNet-Experimental/skills/exp-simd-vectorization/SKILL.md
catalog/Platform/Official-DotNet-Upgrade/skills/dotnet-aot-compat/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/code-testing-extensions/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/crap-score/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/filter-syntax/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/find-untested-sources/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/test-tagging/SKILL.md
catalog/Testing/Playwright/skills/playwright-visual-testing/SKILL.md
catalog/Testing/TUnit/skills/tunit/SKILL.md
catalog/Testing/xUnit/skills/xunit/SKILL.md
catalog/Tools/Code-Analysis/skills/code-analysis/SKILL.md
catalog/Tools/Format/skills/format/SKILL.md
catalog/Tools/HTMLHint/skills/htmlhint/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/analyzing-dotnet-performance/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/clr-activation-debugging/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/dotnet-trace-collect/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/dump-collect/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/binlog-failure-analysis/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/copy-to-output-directory/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/msbuild-server/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/resolve-project-references/SKILL.md
catalog/Tools/ReportGenerator/skills/reportgenerator/SKILL.md
catalog/Tools/ReSharper-CLT/skills/resharper-clt/SKILL.md
catalog/Tools/Roslynator/skills/roslynator/SKILL.md
catalog/Tools/Stylelint/skills/stylelint/SKILL.md
external-sources/upstreams/webgpu-claude-skill/skills/webgpu-threejs-tsl/SKILL.md
catalog/Frameworks/ASP.NET-Core/skills/aspnet-core/SKILL.md
catalog/Frameworks/Aspire/skills/aspire/SKILL.md
catalog/Frameworks/Azure-Functions/skills/azure-functions/SKILL.md
catalog/Frameworks/Blazor/skills/blazor/SKILL.md
catalog/Frameworks/Entity-Framework-6/skills/entity-framework6/SKILL.md
catalog/Frameworks/Entity-Framework-Core/skills/entity-framework-core/SKILL.md
catalog/Frameworks/MAUI/skills/maui/SKILL.md

Metadata

Files
0
Version
d26ba3c
Hash
907ccb7c
Indexed
2026-07-25 05:26

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-18 12:04
浙ICP备14020137号-1