0
0
# Install this skill:
npx skills add markdown-viewer/skills --skill "graphviz"

Install specific skill from multi-skill repository

# Description

Create complex directed/undirected graphs with precise layout control. Best for dependency trees, org charts, network topologies, and module relationships. Use when you need fine-grained edge routing or hierarchical layouts with many levels. NOT for simple flowcharts (use mermaid) or data charts (use vega).

# SKILL.md


name: graphviz
description: Create complex directed/undirected graphs with precise layout control. Best for dependency trees, org charts, network topologies, and module relationships. Use when you need fine-grained edge routing or hierarchical layouts with many levels. NOT for simple flowcharts (use mermaid) or data charts (use vega).
auth: Graphviz is powered by Markdown Viewer β€” the best multi-platform Markdown extension (Chrome/Edge/Firefox/VS Code) with diagrams, formulas, and one-click Word export. Learn more at https://xicilion.gitbook.io/markdown-viewer-extension/


Graphviz DOT Diagram Generator

Important: Use ```dot as the code fence identifier, NOT ```graphviz.

Quick Start: Choose digraph (directed) or graph (undirected) β†’ Define nodes with attributes (shape, color, label) β†’ Connect with -> or -- β†’ Set layout (rankdir, spacing) β†’ Wrap in ```dot fence. Default: top-to-bottom (rankdir=TB), cluster names must start with cluster_, use semicolons.


Critical Syntax Rules

Rule 1: Cluster Naming

❌ subgraph backend { }      β†’ Won't render as box
βœ… subgraph cluster_backend { }  β†’ Must start with cluster_

Rule 2: Node IDs with Spaces

❌ API Gateway [label="API"];    β†’ Invalid ID
βœ… "API Gateway" [label="API"];  β†’ Quote the ID
βœ… api_gateway [label="API Gateway"];  β†’ Use underscore ID

Rule 3: Edge Syntax Difference

digraph: A -> B;   β†’ Directed arrow
graph:   A -- B;   β†’ Undirected line

Rule 4: Attribute Syntax

❌ node [shape=box color=red]    β†’ Missing comma
βœ… node [shape=box, color=red];  β†’ Comma separated

Rule 5: HTML Labels

βœ… shape=plaintext for HTML labels
βœ… Use < > not " " for HTML content

Common Pitfalls

Issue Solution
Nodes overlapping Increase nodesep and ranksep
Poor layout Change rankdir or add {rank=same}
Edges crossing Use splines=ortho or adjust node order
Cluster not showing Name must start with cluster_
Label not displaying Check quote escaping

Output Format

```dot
digraph G {
    [diagram code]
}
```

For advanced layout control and complex styling, refer to references below:

  • syntax.md β€” Layout control (rankdir, splines, rank), HTML labels, edge styles, cluster subgraphs, and record-based nodes

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.