Rendered figures beat ASCII art for the key diagrams in a tutorial. Use the external
drawing skills by invoking them — graphviz for arrows-and-nodes, architecture
for stacked tiers. (Install info for those skills is in this repo's top-level README.md.)
Be selective. Convert the high-value diagrams (the flow main-line, the architecture stack, a dispatch
switch). Leave directory trees, code snippets, and JSON examples as monospace text — turning those into figures makes them harder to read.
| Your diagram is… | Use | Output |
|---|---|---|
A flow / call chain / data-flow / switch dispatch (arrows between boxes) |
graphviz |
```dot fenced block |
| A layered/tiered architecture (stacked colored bands) | architecture |
embedded HTML/CSS |
| A directory tree, code, or JSON | (leave as text) | fenced code block |
1. Linear flow chain — the simplest main-line hop sequence:
digraph flow {
rankdir=LR;
bgcolor="transparent";
node [shape=box, style="rounded,filled", fontname="sans-serif", fontsize=11];
edge [color="#64748b", fontsize=9];
a [label="user input", fillcolor="#dbeafe", color="#3b82f6"];
b [label="handler()\nfile.ext:42", fillcolor="#dcfce7", color="#16a34a"];
c [label="effect", fillcolor="#fef9c3", color="#eab308"];
a -> b [label="step 1"];
b -> c [label="step 2"];
}2. Cluster grouping — show which hops live in which subsystem/"world":
digraph grouped {
rankdir=TB;
bgcolor="transparent";
compound=true;
node [shape=box, style="rounded,filled", fontname="sans-serif", fontsize=10];
you [label="user"];
subgraph cluster_app {
label="Your codebase";
style="rounded,filled"; fillcolor="#faf5ff"; color="#c026d3";
h1 [label="entry()\nindex.ext:10"];
h2 [label="core()\ncore.ext:55"];
h1 -> h2;
}
ext [label="external service"];
you -> h1 [lhead=cluster_app];
h2 -> ext [ltail=cluster_app];
}3. Switch / dispatch — how inbound messages route back to the right waiter:
digraph dispatch {
rankdir=LR;
bgcolor="transparent";
node [shape=box, style="rounded,filled", fontname="sans-serif", fontsize=10];
inbound [label="inbound msg\nparse → read type", fillcolor="#ffedd5", color="#ea580c"];
sw [label="switch(type)", shape=diamond, fillcolor="#fef9c3", color="#eab308"];
a [label="type A → fire subscribers", fillcolor="#dcfce7", color="#16a34a"];
b [label="type B → resolve pending by id", fillcolor="#dcfce7", color="#16a34a"];
inbound -> sw; sw -> a; sw -> b;
}- Cluster subgraph names must start with
cluster_. - Quote node IDs with spaces, or use underscores:
"my node"ormy_node. - Comma-separate attributes:
[shape=box, color=red]. - For cross-cluster edges, set
compound=trueand uselhead=cluster_x/ltail=cluster_x.
For a stacked, color-coded tier diagram (e.g. UI layer / logic layer / data layer),
invoke the architecture skill. It emits embedded HTML (not a fenced block).
Two rules from that skill that matter:
- Embed the HTML directly in Markdown — do not wrap it in a
```htmlfence. - Keep the HTML block continuous — no blank lines inside the structure (blank lines break the rendering).
Use it when the relationship is "layers stacked on layers," not "A calls B."
dotblocks: pipe throughdot -Tsvg(exit 0 = valid) or check the Markdown preview.- architecture HTML: confirm
<div>/</div>counts match and there are no blank lines inside the block.