Draws diagrams, infographics and slides as SVG and PNG from HTML and CSS - architecture with Azure and AWS icons, networks, processes and flowcharts (BPMN), sequence diagrams, plans and roadmaps, hierarchies and org charts, figures for proposals, and diagrams of Terraform code, each designed around the point it makes. Use it whenever the user wants something shown visually, even without the word diagram - "draw", "diagram", "visualise", "show me how this works", "document this architecture", ...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Graphally?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/kwilcz-graphally)
---
name: graphally
description: Draws diagrams, infographics and slides as SVG and PNG from HTML and CSS - architecture with Azure and AWS icons, networks, processes and flowcharts (BPMN), sequence diagrams, plans and roadmaps, hierarchies and org charts, figures for proposals, and diagrams of Terraform code, each designed around the point it makes. Use it whenever the user wants something shown visually, even without the word diagram - "draw", "diagram", "visualise", "show me how this works", "document this architecture", "make a slide or an infographic". Not for plotting datasets (axes, many data points).
license: Apache-2.0. Copyright (c) 2026 Kamil Wilczyński (kwilcz), https://github.com/kwilcz/graphally. LICENSE.txt has the terms.
compatibility: Requires Node.js 18 or later and Chrome, Chromium or Edge (or `npx playwright install chromium`). Internet once, to download the icon packs and any Google font a diagram names.
allowed-tools: Bash(node ${CLAUDE_SKILL_DIR}/scripts/graphally.mjs *) Bash(node ${CLAUDE_SKILL_DIR}/scripts/edit.mjs *) Bash(node ${CLAUDE_SKILL_DIR}/scripts/tf2graphally.mjs *) Bash(node ${CLAUDE_SKILL_DIR}/scripts/fetch-icons.mjs *)
metadata:
author: Kamil Wilczyński (kwilcz)
repository: https://github.com/kwilcz/graphally
version: "3.0.0"
---
# graphally
A diagram is a small web page: HTML holds the components and their nesting, CSS sets the
layout, a JSON list declares the connections, and a drawing script adds any mark a box
can't hold. graphally lays the page out in a browser, routes the connections around
the boxes, and writes an SVG. Never write coordinates, and never hand-write SVG.
**A canvas, not a catalogue.** Whatever a web page can lay out, graphally draws: a pyramid
cut from grid cells, rings, a track with stations, isometric slabs, a map, a building with
floors. No figure needs to be supported first. The references teach techniques to combine
and stretch; none of them lists the figures allowed.
## The standard to aim for
Make the most beautiful, original figure you can for the brief: the one a leading information
designer would be proud to put in front of its readers. Form, metaphor, layout, colour,
typography, density and emphasis are yours to choose; be bold and inventive. Three things stay
fixed:
- **The content is accurate to the brief.** Invent no steps, numbers, people, owners or facts;
where the brief leaves something open, choose, and say what you chose in the figure's note.
- **A notation the user asks for keeps its shapes and line styles**: BPMN for a BPMN process,
UML for a sequence diagram. Inside them, everything is designed. A flow, a path or a workflow
to explain needs no notation: design it freely, with flowchart symbols (ISO 5807) only when
the user asks for a standard flowchart.
- **The render finishes without errors.** A warning you choose to leave is fine when you can
say why.
Everything else in this skill and its references is advice: break any of it when the figure is
better for it. Look at the full-size PNG and iterate until you are proud of it. A plain figure in
the theme's building blocks is drawn only when the user asks for one (plain, standard, strict,
minimal).
## Design the figure first
**Every figure is designed.** A topology for a design document, a BPMN process, a runbook's
sequence, an org chart, a slide: each takes the method below in full and a look of its own, built
for its content and its reader ([references/design.md](references/design.md), The look); a page
of its own adds [references/infographics.md](references/infographics.md).
Design each figure for its reader before writing any HTML, by one method for every figure (a
network for a README, a BPMN process, a slide). Write it in a few lines, in your reply or a
comment in the file:
1. **The point**: who reads the figure, and the one thing it must make obvious to them. A brief
that asks one figure to carry several concerns gets a suggestion of one figure per concern
(design.md, The method); the user decides.
2. **The hero**: three candidate forms (metaphors a reader already knows), one sentence each,
each from a different source, then the one only this content has. A conveyor whose two slow stations stand out; a relay
baton passed between the shifts of an on-call rotation; walls in rings around what must be protected.
3. **The numbers**: what the brief compares (ranges, durations, shares), drawn to scale; counts
written; nothing drawn that the brief does not measure.
4. **The rest**: callouts, the key, and a note of what is assumed or left out.
5. **The build**: the techniques that make it: grid areas, `shape=`, `clip-path`, the
drawing script.
What a figure must hold, the research behind it and the checklist before handing over:
[references/design.md](references/design.md). Read it before designing any figure. The look is
the design's own choice; a notation's rules, and what its figure is free to design, are at the
top of [references/process.md](references/process.md) and [references/sequence.md](references/sequence.md);
slides, printed pages and posts add [references/infographics.md](references/infographics.md).
A request to make a figure better, clearer or more advanced asks for a new hero, built for this
content with whatever techniques it needs.
## Workflow
Copy this checklist and work through it; render as often as the figure needs.
**Try it rather than think it through.** A render takes a second or two; working out in your
head how a grid, a `clip-path`, a route or a typeface will look takes far longer, and the guess
is often wrong. When a question can be answered by rendering, render: write the smallest file
that answers it (`try.html` beside the diagram: one grid, one shape, two boxes and a line),
look, decide, and delete it. Write each version of the figure quickly and let the render show
what to change. Keep the thinking for what no render answers: who reads the figure, what it must
make obvious, which form shows that. Designers who iterate through more prototypes reach better
designs than those who plan longer (Dow et al., *Creativity & Cognition*, 2009).
```
- [ ] 1. Design: the point, three candidate heroes and the one chosen, the numbers, the rest, the build
- [ ] 2. Read design.md (and a notation's standard, infographics.md for a page of its own, documents.md for a proposal); look up techniques in the others as needed
- [ ] 3. Write diagram.html
- [ ] 4. Render: node ${CLAUDE_SKILL_DIR}/scripts/graphally.mjs render diagram.html --png
- [ ] 5. Fix every reported problem; render again until it prints ok
- [ ] 6. Look at diagram.png: the form shows the point before the labels are read; rework until it does
- [ ] 7. Render once more with --png1x --themes: check the full size and the dark copy
- [ ] 8. Hand over diagram.svg and diagram.html; a PNG to share is rendered with --png2x
```
1. **Design.** A few short lines, in your reply or a comment in the file. The design
decides the figure; the references only build it. Decide the broad form here and the
details on the page.
2. **The references.** Read `design.md` and, for a notation, its standard (the rules at the
top of `process.md` or `sequence.md`); for a page of its own (a slide, a poster, a
one-pager), `infographics.md`; for a figure in a proposal or a solution design,
`documents.md`. Every other reference is a lookup: search it for the
technique, class, shape or call you need rather than reading it whole. Everything the format offers is in these
references and the format in brief below: the engine's code in `scripts/` never needs
reading.
3. **Write.** Build each element the design needs for this content (`design.md`, The look).
The examples and the building blocks show techniques; a figure takes nothing from them
unchanged unless the user asked for a plain one. Ids name what the
connections and the script refer to; text is what the reader sees.
4. **Render.** The command writes `diagram.svg` (the deliverable) and `diagram.png` (a
half-size preview: enough to read every label and judge the form, at a quarter of the
tokens), then prints `ok` or one line per problem. Overlaps and overflows are the
problems' job, not the picture's; `--png1x` gives a full-size look when one is needed.
`${CLAUDE_SKILL_DIR}` is this skill's directory: Claude Code fills it in; elsewhere,
use the path of the folder that holds this file.
5. **Fix.** Each problem names its cause and a fix (table below). Edit the file and render
again. Change the file with small edits rather than rewriting it.
6. **Look.** `ok` means nothing collides, not that the figure works. Read it as its reader
would, labels last: the form alone shows the point from step 1. Then go through
`design.md`'s list (Before you hand it over): one element draws the eye first, numbers
that compare are to scale, every colour is in the key, nothing is invented. When the form
misses the point, change the form; improve it until it would stand among the best figures
of a design-led showcase.
7. **Check.** Iterate on the light half-size preview; render `--png1x --themes` once at the
end, to see the full size and the dark copy.
8. **Hand over.** Say in a few lines the idea, the candidates you weighed, and what you
assumed where the brief was open. The render adds a header to the `.html` (a doctype and a `<script>`
that loads graphally's viewer), so the file itself shows the diagram when opened in a
browser, with nothing installed. Keep the header; anyone can edit the text and reload.
Where a font's licence keeps it out of the SVG (`embed-fonts="no"`), readers outside get
the PNG rendered with `--png2x`.
**Changing an existing diagram:** edit its `.html` in place, then render. The render reads
the previous SVG, so what you did not change stays where it was. Keep `nudge`, `out` and
`in`: they are the user's corrections. `--recompute` lays everything out afresh. A request
to rethink a diagram (clearer, simpler, self-explanatory, more than boxes and arrows) is a
new design: start again at step 1, and render with `--recompute`.
## Examples
Two examples of the format at work, not looks to copy. A topology: the system's parts in
groups, as `figure` items (an icon over a name), joined by labelled lines.
```html
<diagram width=1200 title="Library catalogue" subtitle="Production, North Europe">
<div class="grid grid-cols-4 items-center justify-between gap-x-24">
<div class=figure id=reader><icon name=browser></icon>Reader<small>web browser</small></div>
<div class=figure id=fd><icon name="front door"></icon>Front Door<small>CDN</small></div>
<div class="group items-center gap-12"><h4>Application</h4>
<div class=figure id=api><icon name="app service"></icon>Catalogue API<small>App Service</small></div>
<div class=figure id=indexer><icon name=functions></icon>Indexer<small>Functions</small></div>
</div>
<div class="group items-center gap-12"><h4>Data</h4>
<div class=figure id=db><icon name=sql></icon>Catalogue DB<small>Azure SQL</small></div>
<div class=figure id=covers><icon name=storage></icon>Cover images<small>Storage</small></div>
</div>
</div>
<script type="application/json">
[
["reader", "fd", "HTTPS"],
["fd", "api"],
["api", "db", "reads"],
["api", "covers", "links"],
{ "from": "covers", "to": "indexer", "label": "new upload", "dashed": true }
]
</script>
</diagram>
```
A figure designed for its point, "two stations hold most of the delay". The track is the
application's path, so no lines join the stations; the red stops and their notes carry the point.
```html
<diagram width=1200 title="Passport renewal: where applications wait">
<style>
.line { display: grid; grid-template-columns: repeat(5, 1fr); justify-items: center; row-gap: 16px; }
.figure { width: 150px; }
.track { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; height: 36px; background: var(--icon-soft); clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 50%, calc(100% - 28px) 100%, 0 100%); }
.stop { grid-row: 2; align-self: center; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--woad); color: var(--card); font-weight: 700; }
.stop.slow { background: var(--rust); }
.stall { grid-row: 3; width: 200px; font-size: 12px; line-height: 16px; color: var(--muted); }
.stall b { display: block; font-size: 15px; color: var(--rust); }
</style>
<div class=line>
<div class=figure><icon name=browser></icon>Applied<small>online form</small></div>
<div class=figure><icon name=shield></icon>Photo checked<small>by an officer</small></div>
<div class=figure><icon name=database></icon>Identity confirmed<small>records office</small></div>
<div class=figure><icon name=building></icon>Printed<small>print centre</small></div>
<div class=figure><icon name=mail></icon>Delivered<small>post</small></div>
<i class=track></i>
<b class="stop col-[1]">1</b><b class="stop slow col-[2]">2</b><b class="stop col-[3]">3</b><b class="stop slow col-[4]">4</b><b class="stop col-[5]">5</b>
<div class="stall col-[2]"><b>3 days</b>photos wait for an officer to look at them</div>
<div class="stall col-[4]"><b>1 week</b>printing waits for the weekly batch</div>
</div>
<script type="graphally">
// A dashed leader from each slow station down to what holds it up.
const stalls = all('.stall');
all('.slow').forEach((s, i) => draw.moveTo(s.bottom).lineTo(pt(s.center.x, stalls[i].y)).style({ color: 'rust', dashed: true }));
</script>
</diagram>
```
## The format in brief
- **`<diagram>`**: `width` in pixels (default 1200; the height follows the content),
`title`, `subtitle`, `icons=aws` (AWS wins names both clouds share), `theme=dark`,
`background` (a colour, or `none`), `fonts` and `embed-fonts=no` (below), `icon-sets` (below).
- **Utility classes** have Tailwind's names and spacing (one step is 4px): `grid`,
`grid-cols-3`, `flex`, `flex-col`, `justify-between`, `items-center`, `gap-6`, `p-4`,
`mt-10`, `col-span-2`, `w-40`, `text-center`, `font-semibold`, `rounded-lg`, `border-dashed`.
Brackets take any value or property: `w-[130px]`, `grid-cols-[160px_1fr]`,
`[grid-area:edge]`. Colours are the theme's tokens (`bg-wash`, `text-muted`,
`border-woad`); text sizes follow the diagram's scale (`text-base` is 13px).
- **Building blocks**: `figure` (an icon over its name and a `<small>` line, with no
frame: the item of a topology; `external` mutes it, `accent` colours it), `node` (the
same in a framed card), `group` with an `<h4>` title (`plain`, `dashed`, `external`,
`vnet`, `subnet`, `region`; `badges` of `badge` icons in the title, or at a figure's icon), `tile` (an icon over
its name in a small frame), `band` (a strip of shared services), `key` with `swatch` (a
legend), `card`, `box`, `pill`, `tag`, `banner`; `disabled` on any of them greys a
part that is there but does not run, icon and lines included. These class names are taken, and so are
the sequence helper's (`seq`, `msg`, `num`, `guard`, `lifeline`, `activation`, `frag-…`):
name your own differently.
- **Motion**: `"flow": true` on a connection moves gaps and a dot along it; `data-step="1"`,
`"2"`… make elements appear in order, once; `animate(target, keyframes, options)` in the
drawing script moves an element or a drawn mark, as `element.animate` does. The still figure stays complete: PNGs, print
and reduced motion show it. Move only what carries the point.
- **Labels that must not move boxes** (a column's heading, a caption, a note): hang them
with `position: absolute` from a `relative` parent, so centring counts only the boxes and
lines run straight; leave them room.
- **Shapes**: `shape="cylinder"` on any element draws it as that shape: `diamond`,
`hexagon`, `chevron`, `semicircle`, `document`, `cloud`, BPMN `task`, `start`, `end`,
`gateway exclusive`, `event timer` and more. `clip-path: polygon(…)` cuts any other
straight-edged shape.
- **Icons**: `<icon name="app service">`: Azure and AWS services by loose names, a generic
set (`user`, `database`), Phosphor line icons for any other idea (`ph:rocket-launch`), and a
company's own set from a folder or a sprite (`icon-sets="acme: ../brand/icons"` on
`<diagram>`, then `acme:shield`). An unknown name is reported with the nearest names.
[references/icons.md](references/icons.md) has the names, weights, colours and own sets.
- **Fonts**: the theme's Inter unless the figure says otherwise.
`fonts="IBM Plex Sans:400,600"` on `<diagram>` with `:root { font-family: 'IBM Plex Sans',
sans-serif }` sets the whole figure, title included; an `@font-face` rule in the `<style>` loads a
font file of your own (a licensed brand font, the path relative to the diagram). Both are
measured for layout and embedded in the SVG. [references/fonts.md](references/fonts.md) has
choosing, loading and licences.
- **Connections**: `<script type="application/json">`, a list of `["from", "to", "label"]`
or objects with `dashed`, `out`/`in` (the sides), `both`, `via`, `color`. A list in `to`
or `from` draws one bundle with a shared trunk.
- **Drawing script**: `<script type="graphally">` runs after layout with every element's
box, for marks no box gives (tracks, rings, leaders, brackets, slabs): the drawn line, `line`,
`track` and `area` (one long line through points, each passed level, upright, at an angle or
straight on, turning in rounded right angles, smooth curves or straight, swelling with a width
per point, marking and labelling itself; `area` closes and fills it behind the page), `arrow`,
`connect` (`radius` softens its corners; `route: 'direct'` draws it as the drawn line through
its via points), `curve`, `depend`, `draw.moveTo(…).lineTo(…)`,
`draw.arc`, `gate`, `text`, `icon`, `shape`. Drawn lines and text are checked like routed ones.
- **Helpers**: `<script type="graphally" before>` calls `schedule()` and `timeline()`
(plans) or `sequence()` (sequence diagrams) before layout.
- **Colour tokens**: `--ink`, `--muted`, `--line`, `--rule` (light separators), `--wire` (lines), `--woad` (blue), `--rust`
(red), `--teal`, `--green`, `--purple`, `--amber`; grounds `--bg`, `--card`, `--wash`,
`--icon-soft`, `--vnet`, `--note`, and lane tints `--lane-a` to `--lane-d`. Each has a dark
value, so a figure built from them follows the dark theme. A colour worked out from tokens
(`color-mix(in srgb, var(--woad) 30%, var(--card))`, in page CSS or in the script) follows it
too: the render reads it in both themes. A colour with opacity (`rgb(31 99 182 / 12%)`)
follows, but darkens on the dark ground, so a light-to-strong run of tints flattens there; a
mix of two tokens keeps its contrast. Hex colours stay as written.
- **Themes**: `--themes` writes `diagram-dark.svg` beside the light one; `--dark` draws
dark only.
The whole format, with every class, shape, option and call: [references/format.md](references/format.md).
## Problems and fixes
| Problem | Fix |
|---|---|
| `unknown-id` | a connection names an id that does not exist: the suggestion is the closest |
| `unknown-icon`, `unknown-shape`, `unknown-utility` | use the suggested name, or a theme colour for a colour class |
| `label-crowded` | widen the gap the line runs through, or shorten the label |
| `override-ignored … by=x` | the side named in `out`/`in` is blocked by `x`: choose another side |
| `short-end` | an arrowhead sits on a bend right before its box: give the line more room there |
| `lines-overlap` | two lines share a stretch: give one other sides (`out`/`in`) or `via` points |
| `unroutable` | the line has no way through: widen a gap, or give it `via` points |
| `page-overflow` | the content is wider than `width`: widen `width`, or narrow the columns |
| `text-overlap` | two texts collide (quoted in `texts`): give one more room, or move one |
| `warning: flow-missing` | a BPMN step no sequence flow reaches or leaves: add the flow it names |
| `line-through-text`, `text-cut`, `marker-overlap` | a line through a title, a label past the page's edge, a label under a task's marker: move it clear (`format.md`, Problems) |
| `warning: class-taken` | a class of yours shares a building block's name, and the block's look stays under your rule: set what it names, or rename your class |
| `warning: font-missing` | a Google family or an `@font-face` file could not be loaded: check the name on fonts.google.com, or the file's path; the text falls back |
| `warning: box-overflow` | a box or text sticks out of the drawn box holding it: widen the holder or narrow what is inside. A warning, so the render passes: leave it when it is meant |
| `label-ambiguous` | a label sits between its line and another nearly as close, so it may read as the other's: give its line a level run with room above it, or move the lines apart |
| `mark-near-end` | a mark on a line leaves the arrowhead next to it too little line: move the item further from the mark |
| `warning: detour` | a title stands in a line's straight way between two lined-up items, so the line goes round it: move the title as the hint says |
| `warning: off-centre` | two connected items nearly share a column or row, so the line meets one off its centre or steps: line up their centres as the hint says |
| `warning: text-small` | a page shows the figure at most 880px wide, and its labels would shrink below 9px: set the `--text-size` it names, or narrow the figure; a slide or a print shown at full size can leave it |
| `script-error` | the message and line say what failed in a script |
## References
`design.md` is read before designing, and with it a notation's standard, `infographics.md`
for a page of its own and `documents.md` for a proposal; the rest are lookups for techniques,
searched when the build needs one.
| Techniques | Reference |
|---|---|
| Designing any figure: what it holds (point, hero, numbers, the rest), what the reader needs, the hand-over list | [references/design.md](references/design.md) |
| Slides, printed pages and posts: the page's standard (headline, ground, type), formats, sizes, numbers drawn to scale | [references/infographics.md](references/infographics.md) |
| Fonts: choosing type, Google fonts, a company's licensed font files, licences and embedding | [references/fonts.md](references/fonts.md) |
| Icons: choosing a set, cloud services, line icons, a company's own icon set | [references/icons.md](references/icons.md) |
| Zones (internet, cloud estate, on-premises) and the crossings between them, containers in containers (VNets, subnets), peering and private links | [references/network.md](references/network.md) |
| Hierarchies and org charts: levels named, how much sits under each node, branches by colour; the grid and buses underneath | [references/hierarchy.md](references/hierarchy.md) |
| BPMN: the standard, lanes, events and gateways, and what is designed within it | [references/process.md](references/process.md) |
| UML sequence standard and what is designed within it; participants, messages, fragments | [references/sequence.md](references/sequence.md) |
| Dates as grid columns: bars, milestones, dependencies | [references/plan.md](references/plan.md) |
| Rows lined up across stages (subgrid), phases, gates on boundaries, matrices | [references/charts.md](references/charts.md) |
| Shapes cut with `clip-path`, placing by angle and distance, geometry drawn around the layout | [references/documents.md](references/documents.md) |
| Drafting a diagram of a Terraform repository from the code | [references/terraform.md](references/terraform.md) |
| The whole format: every class, shape, option and call | [references/format.md](references/format.md) |
## Scripts
- `scripts/graphally.mjs render <file.html>... [--png | --png1x | --png2x] [--themes |
--dark] [--frames ms,ms] [--out dir] [--recompute]`: compiles every `<diagram>` in the file to SVG;
`--png` adds a half-size preview, `--png1x` a full-size one, `--png2x` a sharp PNG to
publish (each written as `<name>.png`, in place of the last one), `--themes` a dark copy,
`--frames` a PNG of a moving figure at each time (`<name>-600ms.png`), `--recompute` ignores the previous layout. Several
files render in one call, in parallel; render them together rather than one by one.
- `scripts/edit.mjs <file.html> --move id dx,dy | --connect from to [label] | --line 'a->b' json | --unline 'a->b' | --edits json | --lines`:
patches moves, connections, text, structure and CSS and keeps the rest of the file as written.
- `scripts/tf2graphally.mjs <terraform dir> [--out file.html] [--title "…"]`: drafts a
diagram of a Terraform configuration.
- `scripts/fetch-icons.mjs [azure] [aws] [--force]`: downloads the icon packs; the first
render does it by itself.
They need only Node.js and an installed Chrome, Chromium or Edge. If the render prints
`graphally needs Chrome, Chromium or Edge`, run `npx playwright install chromium` once, or
set `CHROMIUM_PATH` to a browser executable. Offline, diagrams render without vendor icons
and say how to fetch them later.
---
graphally · Copyright (c) 2026 Kamil Wilczyński (kwilcz) · https://github.com/kwilcz/graphally ·
Apache License 2.0 (LICENSE.txt, NOTICE.txt).