By heathdutton
Analyze codebase to discover IaC patterns and generate D2 diagrams of infrastructure and architecture, producing markdown docs, styled light/dark SVGs with animations, icons, and accessibility. Post-processes diagrams for GitHub, validates syntax/quality, and automates via hooks.
npx claudepluginhub heathdutton/claude-d2-diagrams --plugin d2Specialized agent for creating comprehensive infrastructure and architecture documentation.
Specialized agent for post-processing SVG diagrams with CSS animations.
Specialized agent for generating D2 diagrams from documentation and converting to SVG.
Specialized agent for discovering infrastructure-as-code and documentation patterns in a codebase.
Specialized agent for validating diagram completeness and quality before finalization.
A Claude Code plugin that generates infrastructure and architecture diagrams (and documentation) from your codebase using D2.
Command: /d2:diagram
More advanced/complex outputs will be generated as well.
diagrams/
├── README.md <-- Will contain embedded diagrams
├── architecture-dark.svg
├── architecture-light.svg
├── architecture-simplified-dark.svg
├── architecture-simplified-light.svg
├── architecture-simplified.d2
├── architecture-simplified.md
├── architecture.d2
├── architecture.md
├── infrastructure-dark.svg
├── infrastructure-light.svg
├── infrastructure-simplified-dark.svg
├── infrastructure-simplified-light.svg
├── infrastructure-simplified.d2
├── infrastructure-simplified.md
├── infrastructure.d2
└── infrastructure.md
prefers-reduced-motion)git clone https://github.com/heathdutton/claude-d2-diagrams.git
claude --plugin-dir ./claude-d2-diagrams
# or
claude plugin marketplace add https://github.com/heathdutton/claude-d2-diagrams
claude plugin install d2@claude-d2-diagrams
Requires D2:
brew install d2 # macOS
# or
curl -fsSL https://d2lang.com/install.sh | sh -s -- # Linux
Note: the plugin will guide you through installing D2 if not available.
/d2:diagram # Full generation
/d2:diagram --incremental # Only regenerate changes
/d2:diagram --infrastructure-only # Skip architecture
/d2:diagram --architecture-only # Skip infrastructure
/d2:diagram --scope=src/ # Limit scan to directory
Create ./diagrams/rules.md to customize. Example:
## Naming
- Use "API Gateway" not "APIGW"
## Exclude
- test/
- examples/
## Include (even if not in IaC)
- Cloudflare CDN
- Datadog monitoring
MIT
Generate, validate, render D2 diagrams from text or code
Modifies files
Hook triggers on file write and edit operations
Uses power tools
Uses Bash, Write, or Edit tools
Share bugs, ideas, or general feedback.
Generate architecture diagrams and technical design documents
Analyse software architecture and generate C4 models using Structurizr DSL, with diagram export support.
Diagrams-as-code tools for visualizing code, data, and systems using Mermaid and PlantUML
Turn complex codebases into clear, navigable architecture diagrams
Claude Code skill pack for Lucidchart (18 skills)