Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By heathduttonv2.0.0MITIn 1 marketplace
Draws infrastructure and architecture diagrams from your code as D2 sources and themed SVGs, then refreshes them when code changes. Needs the D2 CLI 0.9.0 or newer installed.
Trending plugins
7-day copy clicks
Claude hands work to one, or you mention it with @.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A Claude Code plugin that reads your codebase and draws its infrastructure and architecture with D2, then keeps those diagrams in step with the code as it changes.
Command: /d2:diagram
Detailed diagrams are generated alongside these.
diagrams/
├── README.md landing page embedding every diagram
├── manifest.json commit the set was built from, and the paths it depends on
├── infrastructure.md / .d2 / -light.svg / -dark.svg
├── infrastructure-simplified.md / .d2 / -light.svg / -dark.svg
├── architecture.md / .d2 / -light.svg / -dark.svg
└── architecture-simplified.md / .d2 / -light.svg / -dark.svg
Your root README.md gets the two simplified diagrams and a link to the rest.
prefers-reduced-motion)diagrams/manifest.json records the commit the diagrams were built from and the source paths they depend on (IaC, service manifests, entrypoints, API specs). Ordinary code changes don't touch it. A new queue in Terraform does.
/d2:diagram refreshes only what the changed files affect, editing docs and D2 sources in place so the diff shows the change in your system rather than a rewrite./d2:diagram --ci installs a GitHub Actions workflow. On each push to the default branch it checks for drift with plain git diff, and only when something drifted does it run Claude and open a PR with the refreshed diagrams.claude plugin marketplace add https://github.com/heathdutton/claude-d2-diagrams
claude plugin install d2@claude-d2-diagrams
Or from a clone: claude --plugin-dir ./claude-d2-diagrams
Requires:
brew install d2, or curl -fsSL https://d2lang.com/install.sh | sh -s --xcode-select --install)./d2:diagram # build, or refresh whatever drifted
/d2:diagram --check # report drift, change nothing
/d2:diagram --full # rebuild everything from scratch
/d2:diagram --infrastructure-only # one family only
/d2:diagram --architecture-only
/d2:diagram --scope=src/ # limit what gets read
/d2:diagram --ci # install the refresh workflow
Create ./diagrams/rules.md. It overrides naming, scope, icons and layout:
## Naming
- Use "API Gateway" not "APIGW"
## Exclude
- test/
- examples/
## Include (even if not in IaC)
- Cloudflare CDN
- Datadog monitoring
## Icons
- MySQL: https://example.com/mysql.svg
## Layout
- elk
To restyle the animations, copy assets/animations.css to ./diagrams/animations.css and edit it.
The first /d2:diagram run detects diagrams made before manifests existed. It refreshes the docs against the code, re-renders every SVG, and stamps a manifest. The re-render fixes two 1.x bugs: icons that came out blank or recolored, and dashed lines whose animation jumped once per loop. The .diagram/ state folder is no longer used and can be deleted.
MIT
7-day copy clicks
npx claudepluginhub heathdutton/claude-d2-diagrams --plugin d2Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground