graphify-dotnet
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.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 515
- Forks
- 41
01 前言 Front Matter
- 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.
02 资源文件 4
- 参考文档index.json624 B
- 参考文档manifest.json98 B
- 参考文档references/source-map.md4.4 KB
- 参考文档references/usage-and-operations.md7.0 KB
03 SKILL.md 正文
graphify-dotnet
Trigger On
graphify,graphify run,graphify watch,graphify benchmark, orgraphify config- generating
graph.json,graph.html,graph.svg,graph.cypher,GRAPH_REPORT.md,obsidian/, orwiki/ - 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
- 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.
- Install and verify the tool before doing anything else:
dotnet --version dotnet tool install -g graphify-dotnet graphify --version - 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 - Review outputs in this order:
GRAPH_REPORT.mdfor quick signalgraph.htmlfor visual explorationgraph.jsonfor scripting and downstream tooling
- Add AI enrichment only when inferred relationships or conceptual grouping matter more than strict syntax-only structure.
- Expand export formats for the real consumer:
svgfor static docs and PRsneo4jfor graph queriesobsidian,wikifor knowledge-base or onboarding flows
- Use
watchfor iterative architecture work, but rerun a cleanrunperiodically because deletes and renames can leave stale references behind. - Run
benchmarkonly after you already trust the generatedgraph.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 dependenciesollama: local and privacy-friendly; good for sensitive code or low-cost experimentationazureopenai: enterprise-hosted semantic extraction with explicit endpoint, key, and deploymentcopilotsdk: 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:
- CLI arguments
- user secrets
- environment variables
appsettings.local.jsonappsettings.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.
watchmode 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.htmlis great for quick inspection, but large graphs can render slowly and some browsers blockfile://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. benchmarkis 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
graphifycommands 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 --versionshows a .NET 10 SDKgraphify --versionresolves after installationgraphify run <path> --format json,html,report -vcompletes without provider or path errors- the output folder contains the expected artifacts for the selected formats
graphify config showreflects the intended provider configuration when AI enrichment is enabledgraphify 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
04 同仓库更多 Skills
xtwitter-scraper
Use XTwitterScraper when a .NET application needs typed access to Xquik's X automation REST API for tweet search, user lookup, posting workflows, extraction jobs, monitors, webhooks, or giveaway draws. USE FOR: integrating the XTwitterScraper NuGet package; reviewing Xquik API client usage; modeling API-key configuration, pagination, binary exports, raw responses, retries, and webhook/event flows in .NET. DO NOT USE FOR: unrelated stacks; direct browser automation; generic social-media strategy; or code that does not call Xquik. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
sep
Use Sep for high-performance separated-value parsing and writing in .NET, including delimiter inference, explicit parser/writer options, and low-allocation row/column workflows. USE FOR: delimited data needs are performance-sensitive and allocation-aware; project needs explicit control over separator inference, escaping, trimming, and header behavior;. 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.
webgpu-threejs-tsl
Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.
roslynk
Use Roslynk for semantic inspection and edits of *.cs, *.razor and *.cshtml solution files.
system-text-json-net11
Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed generic `JsonSerializerOptions.GetTypeInfo` and `JsonSerializerOptions.TryGetTypeInfo` metadata accessors (generic overloads that return a typed `JsonTypeInfo`). USE ONLY when the user is targeting net11.0 or later and needs PascalCase JSON property or dictionary-key names without writing a custom naming policy, a strongly-typed generic `JsonTypeInfo` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe whether a type's serialization metadata is resolved. DO NOT USE when the target is earlier than net11.0, the requested behavior uses an established pre-net11 naming policy, or the user explicitly selected another JSON library.
process-api-net11
Provides guidance on the new System.Diagnostics.Process APIs introduced in .NET 11: Process.Run, Process.RunAndCaptureText, Process.StartAndForget, Process.ReadAllText/Bytes/Lines, KillOnParentExit, InheritedHandles, and StartDetached. USE FOR: starting, orchestrating, or capturing output from external processes in applications targeting net11.0 or later. DO NOT USE FOR: applications targeting .NET 10 or earlier, or basic pre-.NET 11 Process.Start usage without new APIs.