| name | dotnet-inspect-relationships |
| version | 0.1.0 |
| description | Map how code connects — implementors and subclasses, extension methods, dependency graphs, reverse callers, and ecosystem integrations. Many outputs are graph-shaped (add --mermaid). |
dotnet-inspect: relationships and dependency graphs
Use this skill to map how code connects: what implements or extends a type, what
it depends on, and who calls it. Many of these outputs are graph-shaped — add
--mermaid for a diagram (or --mermaid --markdown to embed one).
dnx dotnet-inspect -y -- <command>
Scope any of these commands the same way: --project path/to.csproj (restored
project references), --package Foo (repeatable), --library path.dll,
--platform (all in-box frameworks), --extensions or --aspnetcore (curated
Microsoft.* sets), --package-prefix Azure.AI (every package under a NuGet ID
prefix), and --tfm net9.0.
--project reads existing restored assets; restore/build first if dependencies
changed.
What implements or extends it?
implements Interface finds concrete implementors and subclasses;
extensions Type finds extension methods. Add --reachable (with --depth N)
to include extensions on types reachable through properties and methods.
dnx dotnet-inspect -y -- implements IDisposable --platform
dnx dotnet-inspect -y -- extensions HttpClient --platform --reachable
dnx dotnet-inspect -y -- implements ILogger --package-prefix Microsoft.Extensions
dnx dotnet-inspect -y -- implements IEquatable --project ./src/App/App.csproj -v:q
dnx dotnet-inspect -y -- extensions string --project ./src/App/App.csproj -v:n
What does it depend on?
depends Type walks dependency graphs upward — type hierarchy, library
references, or package dependencies, depending on scope. Add --mermaid for a
diagram.
dnx dotnet-inspect -y -- depends JsonSerializer --package System.Text.Json
dnx dotnet-inspect -y -- depends MyType --library MyLib.dll --mermaid
dnx dotnet-inspect -y -- depends Command --project ./src/App/App.csproj -v:q
Who calls it? (reverse edges)
member Type Method:1 -S Calls lists what a method calls; -S Callers lists
the call sites that reach it. With an explicit source, widen the caller search
with --bin, --project, or --caller-package. With no explicit source, the
first --project is the source context; repeated --project values after it
remain caller scopes.
dnx dotnet-inspect -y -- member Type Method:1 -S Calls
dnx dotnet-inspect -y -- member string IndexOf:7 -S Callers --caller-package System.Text.Json@9.0.0 --tfm net9.0
What does it integrate with? (ecosystem)
-S @Integrations on library or package --library rolls up the ecosystem
frameworks a library plugs into — DI, hosting, ASP.NET Core, AI, OpenTelemetry,
configuration, logging, and more — plus Integration Opportunities and
language/runtime integration signals like C# union types.
dnx dotnet-inspect -y -- package Microsoft.Extensions.AI --library -S @Integrations
dnx dotnet-inspect -y -- library MyLibrary.dll -S "Union Types" --tsv
dnx dotnet-inspect -y -- library --platform System.Text.Json -S "Union Types" --tsv
Use Union Types when looking for C# union adoption in libraries. It reports
types annotated with System.Runtime.CompilerServices.UnionAttribute, whether
they implement IUnion, and constructor-derived case types. Current platform
libraries may expose the runtime infrastructure before any production library
declares union types, so an empty table is still a useful signal.