diegomarino/claude-toolshed/d2-render
Claude Code and agent skill by diegomarino/claude-toolshed
- community
Checking that the SKILL.md file is still in the repository.
Render .d2 files to SVG or PNG images
Install
npx vskill@latest install diegomarino/claude-toolshed/d2-renderSKILL.md
/d2-render
User request: "$ARGUMENTS"
Task
Render D2 diagrams from an existing .d2 file or a .md file with D2 code blocks to SVG or PNG images.
Process
Step 1: Resolve Plugin Path
Step 2: Ensure D2 is installed
If .claude/d2.json does not exist, display a one-time nudge before continuing:
First time using the d2 plugin? Run/d2-configto pick a theme and output settings. Using defaults for now (theme 0 / Neutral,./diagrams).
Step 3: Read Config
If .claude/d2.json exists, read:
output_directory(default: ./diagrams)output_format(default: svg)
Resolve output path:
- If
output_directoryis"same"AND input file path is known:
OUTPUT_DIR=$(dirname {input_file})
- If
output_directoryis"same"AND no input file:
OUTPUT_DIR=./diagrams
- Otherwise:
OUTPUT_DIR={output_directory}
Step 4: Determine Input
From $ARGUMENTS:
- `.d2` file → render directly
- `.md` file → extract D2 blocks first:
bash "$PLUGIN_DIR/scripts/extract_d2.sh" {file.md}
- Directory → find all
.d2files:
find {dir} -name "*.d2" -not -path "*/node_modules/*"
- No argument → ask: "Which file or directory should I render?"
Step 5: Render
Run for each .d2 file:
For PNG output: Warn the user if PNG fails that it requires Playwright:
Note: Generated .d2 files already contain the vars { d2-config } block with the theme and layout settings — no additional CLI flags are needed. The d2 command will use the embedded configuration automatically.
Step 6: Report
List all output files generated with full paths:
If any rendering failed:
Output Format
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/d2/skills/d2-render/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/diegomarino/claude-toolshed/d2-render)