원클릭으로
d2-render
Render .d2 files to SVG or PNG images
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Render .d2 files to SVG or PNG images
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when checking Paperclip org health, reviewing agent efficiency, diagnosing token waste, verifying governance compliance, or before and after making org changes. Also use when agents seem idle or unproductive, costs spike, tasks stall, heartbeats fail silently, you see 409 conflicts, stale locks, blocked deadlocks, or suspect agents burning tokens with no progress.
This skill should be used when the user asks to "show dev-setup config", "change the worktrees directory", "update the port pattern", "configure dev-setup settings", or wants to view or update settings in .claude/dev-setup.json.
Generate dev server lifecycle scripts (start/stop/status/ports) from detected project structure
This skill should be used when the user asks to "create a worktree", "set up an isolated workspace", "create a branch for a feature", "start working on a new branch", or before executing an implementation plan that needs an isolated git workspace.
Scan a codebase and auto-generate relevant diagrams from its structure
Generate a D2 diagram from a text description
| name | d2-render |
| description | Render .d2 files to SVG or PNG images |
| argument-hint | ["path"] |
| allowed-tools | Read, Bash, Write |
User request: "$ARGUMENTS"
Render D2 diagrams from an existing .d2 file or a .md file with D2 code blocks to SVG or PNG images.
PLUGIN_DIR=$(find "$HOME/.claude/plugins/cache" -type d -name "d2" -path "*/skills/d2" 2>/dev/null | head -1)
[ -z "$PLUGIN_DIR" ] && PLUGIN_DIR=$(find "$HOME" -maxdepth 8 -type d -name "d2" -path "*/skills/d2" 2>/dev/null | head -1)
bash "$PLUGIN_DIR/scripts/ensure-deps.sh"
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).
If .claude/d2.json exists, read:
output_directory (default: ./diagrams)output_format (default: svg)Resolve output path:
output_directory is "same" AND input file path is known:
OUTPUT_DIR=$(dirname {input_file})output_directory is "same" AND no input file:
OUTPUT_DIR=./diagramsOUTPUT_DIR={output_directory}From $ARGUMENTS:
.d2 file → render directly.md file → extract D2 blocks first:
bash "$PLUGIN_DIR/scripts/extract_d2.sh" {file.md}.d2 files:
find {dir} -name "*.d2" -not -path "*/node_modules/*"Run for each .d2 file:
mkdir -p {OUTPUT_DIR}
d2 {input_file} {OUTPUT_DIR}/{basename}.{output_format}
For PNG output: Warn the user if PNG fails that it requires Playwright:
PNG rendering failed. Playwright is required for PNG export.
Install: npm install -g playwright && playwright install chromium
Or switch to SVG: /d2-config → option 7
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.
List all output files generated with full paths:
Rendered {N} diagrams:
✅ diagrams/architecture-services-20260310.svg
✅ diagrams/sequence-auth-flow-20260310.svg
If any rendering failed:
❌ diagrams/er-schema-20260310.svg — {error message}
Run /d2-config → health check to diagnose issues.
Rendered {N} / {total} diagrams:
✅ {output_path_1}
✅ {output_path_2}
❌ {output_path_3} — {error}