---
name: line-illustrations
description: Draw small, Linear-style monochrome line illustrations (spot art for cards, empty states, catalog tiles, onboarding steps) as bounded JSON path geometry that renders to a clean SVG in both themes. One recognizable object per illustration, in a 2:1 isometric view (flat tiles and boxes with real thickness, details lying on the top face), fine strokes, 8-unit radii, no text or color. Use whenever asked for a spot illustration, card artwork, a thumbnail drawing, an empty-state picture, an icon-like illustration of a concept, or "Linear-style" / "line-art" illustrations, and whenever a list of items (skills, apps, templates, integrations) needs one consistent drawing per item.
---

# Line illustrations

Small line drawings fail in one of two ways. Either every item gets the same rounded panel with a few lines in it, so the set looks consistent and says nothing, or each one is drawn freely and the set stops looking like a set. This skill keeps both: **one shared drawing style, and one recognizable object per item, chosen for what that item means.**

The output is not raw SVG. It is a small JSON object of path geometry that a fixed renderer turns into SVG. The renderer owns stroke width, color, contrast and occlusion, so every drawing in the set looks like it was made with the same pen.

## The format

```json
{
  "subject": "A minimal terminal window with a command prompt",
  "paths": [
    { "d": "M34 34 … Z", "tone": "secondary", "occludes": false },
    { "d": "M29 28 … Z", "tone": "primary", "occludes": true },
    { "d": "M29 53L206 53", "tone": "primary", "occludes": false }
  ]
}
```

- **Canvas** 240 × 180. Draw within x = 24…216, y = 20…160. Every coordinate, curve controls included, stays inside the canvas. (Drawings written as isometric `parts` are projected and fitted for you; see below.)
- **Commands** absolute `M`, `L`, `C`, `Q`, `Z` only. No arcs, no relative commands, no transforms, no `<rect>`/`<circle>`. Circles are four `C` segments.
- **Order** back to front. The first path is usually the backing layer.
- **`occludes: true`** only for closed solid silhouettes (every subpath ends in `Z`). The renderer masks every earlier path behind it, so rear edges disappear under front faces. Open lines and interior marks are `false`.
- **`tone`** sets one of three brightness levels, as in Linear's illustrations, where the object's edge catches the light and everything inside it sits back:
  - **highlight** (100%): solid silhouettes get it automatically (`occludes: true`); set it by hand only on an open line that is part of the outer contour.
  - **`primary`** (60%): interior marks needed to recognize the object.
  - **`secondary`** (30%): the backing layer and less important interior lines.
- **Size** 4–10 paths is typical; never more than 24. Group related marks in one path rather than dropping anatomy to hit a count.

### One animated detail: the dot matrix

Like the twinkling 8 px grids in Linear's illustrations, a drawing may carry **one** small dot matrix that moves. It is the only filled element and the only motion in the style, so it draws the eye: use it where the item is *doing* something (thinking, syncing, counting), on two to four drawings of a set, never all of them.

```json
{ "matrix": [105, 74, 6, 3], "mode": "twinkle" }
{ "matrix": [100, 97, 6, 2], "mode": "wave", "pitch": 5, "r": 1.2 }
{ "matrix": [70, 44], "mode": "digits", "digits": ["12", "18", "24", "31"], "pitch": 4, "r": 1.1 }
```

- **`twinkle`**: each dot glows and dims at its own pace, a few flash to full brightness. Activity, data, a live system.
- **`wave`**: a diagonal sweep of light across the grid. Progress, running, thinking.
- **`digits`**: a 3 × 5 pixel readout that steps through the frames (up to 12 frames of 1–4 digits each, equal length). Counts, versions, dates. Unlit dots stay faintly visible, as on a real dot-matrix display.

`x, y` is the first dot's center; `pitch` (default 6) is the spacing, `r` (default 1.3) the dot radius, `speed` (0.25–4, default 1) scales the tempo. Grids run up to 12 × 12; keep them small, around 6 × 3, about a fifth of the object's width. Place the matrix on a quiet face of the object, never over a line. The motion is pure CSS inside the SVG, seeded by the drawing so it repeats identically, and it stops under `prefers-reduced-motion` (a digits readout then shows its first frame).

### Write parts in the isometric view

Don't compute Bézier corners or projections by hand; that is where drawings break. Write `parts` with `"view": "iso"` and the scripts do the rest: you draw the object **from above, as a plan**, and say how thick each piece is. The script projects it to the 2:1 isometric angle (x runs right-down, y left-down, z up), builds each slab's silhouette and top edge from the curves, and scales the whole drawing to fit the canvas.

```json
{
  "view": "iso",
  "subject": "A calendar page with a two-way sync mark",
  "parts": [
    { "rect": [56, 32, 128, 112], "h": 10 },
    { "line": [[56, 60], [184, 60]], "tone": "secondary", "z": 10 },
    { "circle": [88, 46, 4], "h": 8, "z": 10 },
    { "circle": [152, 46, 4], "h": 8, "z": 10 },
    { "arc": [120, 102, 22, 190, 340], "arrow": "end", "z": 10 },
    { "arc": [120, 102, 22, 10, 160], "arrow": "end", "z": 10 }
  ]
}
```

- **`h`** extrudes a closed shape (rect, circle, closed line, closed path) into a slab or box `h` units tall. A rect becomes a tile or a cube, a circle a coin, a disc or a cylinder. The silhouette is solid, so it hides everything drawn before it.
- **`z`** lifts a part to that height. Marks on a slab's top face get `z` equal to the slab's `h` (plus its own `z`). Stack pieces by giving each the top of the one below, like the database's three discs.
- **`plane: "xz"`** with `at: y` draws a part on an upright face instead, for a laptop screen or a shackle standing on a lock: `u` runs along x, and `v` runs down from height `z`.
- **Order** is still back to front: pieces further back (smaller x + y) and lower first.
- **One object, one outline.** A shape with a bump or a notch (a speech bubble with its tail, a cloud, a torn receipt) is one closed `line` or `path` extruded once, never two slabs pushed together: the script draws its top face without seams and its walls with real creases at inner corners.
- `back` and `depth` belong to the older flat view and do nothing here: thickness replaces the offset copy.

| Part | Value | Notes |
| --- | --- | --- |
| `rect` | `[x, y, w, h]` | `r` defaults to 8; use 1–3 for small controls |
| `circle` | `[cx, cy, r]` | |
| `ellipse` | `[cx, cy, rx, ry]` | |
| `line` | `[[x, y], …]` | `closed: true` for a polygon; `r` rounds its corners (use 1–3) |
| `arc` | `[cx, cy, r, from, to]` | degrees, 0 = right, 90 = down; `to > from` runs clockwise |
| `check` | `[x, y, size]` | short entry, longer rising exit, inside the size box |
| `cross` | `[cx, cy, size]` | two diagonals |
| `chevron` | `[x, y, size]` | tip at x, y; `dir`: right, left, up, down |
| `path` | `"M… "` | raw path for anything the helpers can't draw |
| `matrix` | `[x, y, cols, rows]` | the animated dot grid, see above; for `digits` only `[x, y]`; in the isometric view it lies on its face like any mark |

Options on any part: `h`, `z`, `plane` and `at` (see above), `tone` (`primary` by default; slabs are always highlight), `solid: true` (a flat closed shape that hides what's behind it), and on `line` and `arc`, `arrow: "end" | "start" | "both"` with `arrowSize` (default 6).

`node scripts/shapes.mjs parts.json` prints the expanded paths if you need them; the renderer accepts `parts` directly.

## The style

- **2:1 isometric, like Linear's figures.** Every object sits at the same angle: tiles, boxes and discs seen from above-front, with real thickness. Flat things (pages, windows, cards) lie down as thin slabs, 4–12 units thick, with their content on the top face. Things that stand (a laptop screen, a shackle) go on an upright `xz` face. Never mix in a straight-on drawing.
- **Depth from parts, not decoration.** One focal piece may rise from the top face as its own small box or coin (a raised panel, a lock, a badge, timeline nodes, chart bars). That raised piece is often the best context detail.
- **8-unit radius** on main structural contours, tangent-continuous. Small controls and symbols get 1–3 units, so a check never becomes a bowl and a chevron never becomes a parenthesis.
- **Monochrome lines only.** No fills, hatching, shadows, gradients, text, letters, logos or numbers. The renderer supplies one stroke color.
- **Icon-like simplicity.** One characteristic silhouette, two to five identifying parts, one detail that ties it to the item's context, and quiet space. Remove repeated rows, tiny controls and nested frames first.
- **Few details, each one finished.** Like Linear's illustrations, the craft is in the edges and one precise mark, not in the amount of content:
  - **Budget:** at most four marks inside the silhouette; two or three is usually right. A header line counts as one.
  - **One focal mark** (a pointer, a lock, a check, a sync arrow) in `primary`, sized to read at card size. Everything else that is only structure (header lines, divider rows, rear contours) goes to `secondary`.
  - **Use the object's own anatomy before adding content.** A folded corner says "document" better than three text rows; a pill says "address bar" without two traffic-light dots beside it.
  - **No placeholder content.** Drop text rows, dots and boxes that only fill space. If a row must stay, make it one short line, not a stack.
  - **Never dim what makes the object recognizable.** A globe's meridian and equator stay `primary`; only lines the object reads without go to `secondary`.
- **Interior details lie on the top face** (or the upright face they belong to), never floating in between.

## Workflow

### 1. Plan the object before drawing

For each item, read its full title **and** description, then write down:

- **object**: one concrete thing that stands for what the item does. Choose by meaning, not by keyword. A "sports news digest" is a pitch, not a browser.
- **essential features**: two to five visible parts that identify it, and how they connect.
- **lookalike**: the nearest thing it could be mistaken for, and the feature that separates them.
- **context detail**: one detail inside the object that relates it to this item (a lock inside the shield, a failed row in the test window).

If the object needs a label or an unrelated prop to be understood, choose a clearer object. Only use a window or panel when the subject really is an interface, and then give it the right chrome.

The context detail is where drawings fail most. Make it **specific** (a flag means "urgent", a plain dot means nothing; an arrow on a database could mean anything) and **big enough**: a badge needs a diameter of about 40–50 units and its symbol about half of that, or it turns into a smudge at card size.

### 2. Draw it

Write `parts` with `"view": "iso"` (see above). Draw the plan first: the main slab with its `h`, then the marks on its top face with `z`, then any raised pieces, back to front.

The script fits every drawing to the canvas, so size is relative: keep the **plan about 120–150 units on its longer side** and thicknesses in proportion (a page 4–6, a window 10–12, a cube as tall as it is wide).

### 3. Validate and render

```bash
node <this-skill>/scripts/render-illustration.mjs drawing.json            # → drawing.svg
node <this-skill>/scripts/render-illustration.mjs examples/previews.json out/   # a set → one SVG each + index.html
node <this-skill>/scripts/render-illustration.mjs drawing.json --static   # without the drawing animation
```

The script expands `parts`, then rejects anything outside the format (bad commands, out-of-canvas coordinates, unclosed occluders, too many paths) with the reason, then writes SVGs with masks and a tight viewBox. `index.html` shows the whole set at card size in light and dark side by side.

### 4. Review at card size, title hidden

Validation proves the geometry is safe, not that it is recognizable. Open `index.html` and, for each drawing, ignore the title and check:

- Can you name the object?
- Is every planned feature visible and distinguishable at ~80 px tall?
- Is the context detail readable?
- Does any line cross a solid foreground form it should be hidden behind?
- Small marks: checks have a short entry and a longer rising exit; crosses are two diagonals; a command chevron has its baseline; a lock has a distinct shackle and body; timelines have ordered entries; a profile has a head and bust.

Fix the drawing, not the review. Then look at the set together: same weight, same depth offset, same radius, no two items reading as the same object.

## Recognition cues

Examples of what to keep and what to cut. These are criteria, not a menu: derive equivalent anatomy for unfamiliar subjects instead of forcing them into one of these.

| Object | Keep | Omit |
| --- | --- | --- |
| Browser | Navigation chrome, address field, distinct page area | Tiny text, favicons, decorative cursors |
| Laptop | Screen inset in its bezel, hinge, sparse keyboard rows, trackpad | Individual keys, ports, vents |
| Terminal | Window chrome, a command chevron with baseline | Code text, many output lines |
| Document or checklist | Page edge, a few rows; checks with short entry and long exit | Stamps, floating icons |
| Test-results window | Header, distinct run rows, a pass/fail mark per row | Unexplained crosses, dense logs |
| Sports field | Boundary, center line and circle, end zones | Balls, trophies, score labels |
| Incident timeline | Chronological axis with ordered entries | Sliders, separate clock props |
| Shield | Protective outline with an integrated lock | Extra devices, zigzags |

## Examples

`examples/previews.json` holds eighteen finished drawings in this style, written as isometric `parts`: pitch, terminal, browser with a raised panel, folded page, browser with a pointer, shield with a standing lock, checklist, CI result window, laptop with its user on the screen, incident timeline with raised nodes, envelope with a retry coin, receipt, calendar with sync, database of stacked discs, inbox tray, speech bubble with a globe, report card with rising bars, and cloud upload. Read two or three before drawing a new set, and match their thickness, radius and detail budget.

## Motion

Every rendered SVG draws itself once, like a technical drawing, in CSS inside the SVG (no script, so it works inlined or as an `<img>`):

1. **Construction lines**: the drawing's long straight edges, extended past both ends so they cross at the true corners, draw in faintly.
2. **Plotting**: the pen draws each path in order (back to front) at a steady speed, about 1.5 s for the whole drawing.
3. **Erase**: the construction lines are wiped away along their own direction, then the dot matrix switches on.

At rest, and under `prefers-reduced-motion`, the SVG is simply the finished drawing. Pass `--static` to the script (or `animate: false` to `render`) for SVGs without it, for example when your app runs its own entrance animation. Timings live in `MOTION` in the renderer.

## Rendering in an app

Use the same rules as the script: `fill="none"`, `stroke="currentColor"`, round caps and joins, `vector-effect="non-scaling-stroke"`, stroke width 0.75–1 px, the color at about 92% of the foreground, and opacity by tone: solid silhouettes 1, `primary` 0.6, `secondary` 0.3. For each path, mask out every later `occludes` path (white rect, the occluder in black fill and stroke). Fit the viewBox to the drawing's bounding box plus 1/120 of its longest side, so every drawing fills its tile the same way. Accept only geometry that passes the same validation; never render model output as raw SVG markup. A `matrix` renders as filled `currentColor` circles (in the isometric view inside a `transform="matrix(…)"` group that lays them on their face) with its animation in a `<style>` block inside the SVG, so the SVG animates wherever it's inlined or loaded as an image.
