Skip to content

Commit 6f99865

Browse files
richlanderCopilot
andauthored
Document --mermaid in SKILL.md and README.md (#306)
* Document mermaid diagram output in SKILL.md and README.md Add --mermaid to decision tree, format descriptions, and command examples. Add depends command section to README. Bump SKILL.md version to 0.7.4. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Bump version to 0.7.5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 700859c commit 6f99865

3 files changed

Lines changed: 42 additions & 4 deletions

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dnx dotnet-inspect -y -- <command>
2525
| `diff X` | Compare versions with breaking/additive classification |
2626
| `extensions X` | Find extension methods/properties for a type |
2727
| `implements X` | Find types implementing an interface or extending a class |
28+
| `depends X` | Walk dependency graphs — type hierarchy, package deps, library refs (`--mermaid` for diagrams) |
2829
| `find X` | Search for types across packages, frameworks, and local assets |
2930
| `source X` | SourceLink URLs — type or member level, `--cat` to fetch content |
3031

@@ -40,6 +41,7 @@ A bare name like `dotnet-inspect System.Text.Json` uses a router to pick the bes
4041
| `--oneline` | Compact columnar output, one result per line |
4142
| `--platform` | Search all platform frameworks (find, extensions, implements) |
4243
| `--json` | JSON output |
44+
| `--mermaid` | Mermaid diagram output (`depends` command) |
4345
| `-s Name` | Include section (glob-capable: `-s Ext*`) |
4446
| `-x Name` | Exclude section |
4547
| `--shape` | Type shape diagram (hierarchy + members) — `type` command |
@@ -199,6 +201,20 @@ dotnet-inspect implements IDisposable --platform # All platform fram
199201
dotnet-inspect implements IJsonTypeInfoResolver --package System.Text.Json
200202
```
201203

204+
### depends
205+
206+
Walk dependency graphs — type hierarchy, library references, or package dependencies. Supports `--mermaid` for diagram output.
207+
208+
```bash
209+
dotnet-inspect depends Stream # Type hierarchy (markdown tree)
210+
dotnet-inspect depends 'INumber<TSelf>' # Deep interface hierarchy
211+
dotnet-inspect depends Command --package System.CommandLine # NuGet package type
212+
dotnet-inspect depends --library System.Text.Json # Assembly reference graph
213+
dotnet-inspect depends --package Markout # Package dependency graph
214+
dotnet-inspect depends Stream --mermaid # Standalone mermaid diagram
215+
dotnet-inspect depends Stream --markdown --mermaid # Mermaid embedded in markdown
216+
```
217+
202218
### source
203219

204220
SourceLink URLs for type source files. Supports member-level resolution with line numbers.
@@ -228,14 +244,16 @@ dotnet-inspect -v:q # Command names only (onelin
228244

229245
## Output Control
230246

231-
**Format**: Default is **markdown** (headings, tables, field lists). Use `--oneline` for compact columnar output, `--plaintext` for plain text, or `--json` for JSON.
247+
**Format**: Default is **markdown** (headings, tables, field lists). Use `--oneline` for compact columnar output, `--plaintext` for plain text, `--json` for JSON, or `--mermaid` for Mermaid diagrams.
232248

233249
**Verbosity** (`-v`): q(uiet) → m(inimal) → n(ormal) → d(etailed). Controls which sections are included.
234250

235251
**Sections**: Use `-s Name` to include or `-x Name` to exclude sections by name. Bare `-s` lists available sections. Supports glob patterns (`-s Ext*`).
236252

237253
**JSON**: `--json` for full JSON, `--json --compact` for minified.
238254

255+
**Mermaid**: `--mermaid` for standalone mermaid (`graph TD`), `--markdown --mermaid` for mermaid fenced blocks inside markdown. Currently supported on the `depends` command.
256+
239257
## LLM Integration
240258

241259
This tool is [designed for LLM-driven development](docs/llm-design.md). A skill is available in the [dotnet/skills](https://github.com/dotnet/skills) marketplace for use with GitHub Copilot and Claude Code.

skills/dotnet-inspect/SKILL.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: dotnet-inspect
3-
version: 0.7.2
3+
version: 0.7.5
44
description: Query .NET APIs across NuGet packages, platform libraries, and local files. Search for types, list API surfaces, compare and diff versions, find extension methods and implementors. Use whenever you need to answer questions about .NET library contents.
55
---
66

@@ -23,6 +23,7 @@ Query .NET library APIs — the same commands work across NuGet packages, platfo
2323
- **How many overloads?**`member Type --package Foo --show-index` (shows `Name:N` indices)
2424
- **What does this package depend on?**`depends --package Foo`
2525
- **What does this type inherit?**`depends 'INumber<TSelf>'`
26+
- **Want a dependency diagram?**`depends --mermaid` (standalone) or `depends --markdown --mermaid` (embedded)
2627
- **What metadata fields exist?**`-S Section --fields "PDB*"` (structured query, no DSL)
2728
- **What version is available?**`Foo --version` (cache-first), `Foo --latest-version` (always NuGet), `Foo --versions` (list all)
2829

@@ -36,6 +37,7 @@ Query .NET library APIs — the same commands work across NuGet packages, platfo
3637
- **"What extends this type?"**`extensions` finds extension methods/properties (`--reachable` for transitive)
3738
- **"What implements this interface?"**`implements` finds concrete types
3839
- **"What does this type depend on?"**`depends` walks type hierarchy, package deps, or library refs
40+
- **"Show dependencies as a diagram"**`depends --mermaid` for standalone mermaid, `--markdown --mermaid` for embedded
3941
- **"Where is the source code?"**`source` returns SourceLink URLs; add member name for line numbers
4042
- **"What version/metadata does this have?"**`package` and `library` inspect metadata
4143
- **"What version is available?"**`Foo --version` (fast, cache-first — like `docker run`)
@@ -56,12 +58,14 @@ dnx dotnet-inspect -y -- type --package System.Text.Json # s
5658
dnx dotnet-inspect -y -- diff --package System.CommandLine@2.0.0-beta4.22272.1..2.0.3 # triage changes
5759
```
5860

59-
Default format is **markdown** — no flags needed. Optional formats: **oneline** (`--oneline`), **plaintext** (`--plaintext`), **json** (`--json`). Verbosity (`-v:q/m/n/d`) controls which sections are included; formatter controls how they render. They compose freely — except `--oneline` and `-v` cannot be combined.
61+
Default format is **markdown** — no flags needed. Optional formats: **oneline** (`--oneline`), **plaintext** (`--plaintext`), **json** (`--json`), **mermaid** (`--mermaid`). Verbosity (`-v:q/m/n/d`) controls which sections are included; formatter controls how they render. They compose freely — except `--oneline` and `-v` cannot be combined.
6062

6163
```bash
6264
dnx dotnet-inspect -y -- member JsonSerializer --package System.Text.Json -v:d # detailed (source/IL)
6365
dnx dotnet-inspect -y -- System.Text.Json -v:n --plaintext # all local sections, plaintext
6466
dnx dotnet-inspect -y -- type --package System.Text.Json --oneline # compact columnar output
67+
dnx dotnet-inspect -y -- depends Stream --mermaid # standalone mermaid diagram
68+
dnx dotnet-inspect -y -- depends Stream --markdown --mermaid # mermaid embedded in markdown
6569
```
6670

6771
Use `diff` first when fixing broken code — triage changes, then drill into specifics:
@@ -145,6 +149,22 @@ dnx dotnet-inspect -y -- System.Text.Json -S Symbols --fields "PDB*" # project
145149
dnx dotnet-inspect -y -- type System.Text.Json --columns Kind,Type # project specific columns
146150
```
147151

152+
## Mermaid Diagrams
153+
154+
The `depends` command supports `--mermaid` for Mermaid diagram output. Two modes:
155+
156+
| Flags | Output | Use case |
157+
| ----- | ------ | -------- |
158+
| `--mermaid` | Standalone mermaid (`graph TD`) | Pipe to `mmdc`, embed in tooling |
159+
| `--markdown --mermaid` | Mermaid fenced blocks inside markdown | Render in GitHub, VS Code, docs |
160+
161+
```bash
162+
dnx dotnet-inspect -y -- depends Stream --mermaid # type hierarchy as mermaid
163+
dnx dotnet-inspect -y -- depends Stream --markdown --mermaid # embedded in markdown
164+
dnx dotnet-inspect -y -- depends --library System.Text.Json --mermaid # assembly reference graph
165+
dnx dotnet-inspect -y -- depends --package Markout --mermaid # package dependency graph
166+
```
167+
148168
## Search Scope
149169

150170
Search commands (`find`, `extensions`, `implements`, `depends`) use scope flags:

src/dotnet-inspect/dotnet-inspect.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<Authors>Richard Lander</Authors>
2222
<PackAsTool>true</PackAsTool>
2323
<ToolCommandName>dotnet-inspect</ToolCommandName>
24-
<VersionPrefix>0.7.4</VersionPrefix>
24+
<VersionPrefix>0.7.5</VersionPrefix>
2525
<PackageId>dotnet-inspect</PackageId>
2626
<Description>A CLI tool for inspecting .NET assemblies and NuGet packages</Description>
2727
<PackageLicenseExpression>MIT</PackageLicenseExpression>

0 commit comments

Comments
 (0)