Skip to content
Back to skills

Paper Figures

ASecurity

Compile a paper figure from a JSON spec with diagram_write({kind:"figure"}) - the grammar, the measured layout, the geometry diagnostics, the print contract, and the two-figure reference corpus to copy from.

  • 11 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
ai-agentsgonodeexpress

Security analysis

A100/100

Scanned November 29, 2026

npx -y skills add vecnode/vn-code --skill paper-figures --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Paper Figures?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Paper Figures
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vecnode-paper-figures/badge)](https://www.skillsdirectory.com/skills/vecnode-paper-figures)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: paper-figures
description: Compile a paper figure from a JSON spec with diagram_write({kind:"figure"}) - the grammar, the measured layout, the geometry diagnostics, the print contract, and the two-figure reference corpus to copy from.
---

# Paper figures

A figure in a paper is not a drawing, it is a **layout problem**: 40–200 labelled
boxes, a caption that states the claim, leaders anchored to one byte of a bar, and
a width the journal fixes at 3.5 or 7.16 inches. Freehand SVG fails at this size
because nothing measures the text; TikZ survives it but costs a compile per
keystroke. `kind: "figure"` is the third way: you write the **structure**, the host
compiles the geometry.

```
diagram_write({ kind: "figure", id: "my-figure", source: <JSON> })
```

If it returns `status: "ok"` you have a vector figure at `f2-paper`. If it returns
`status: "error"` you have a line-addressable geometry problem, which is the point.

## When to use which kind

| you want | kind |
|---|---|
| a flow, a sequence, a state machine, anything under ~12 nodes | `mermaid` |
| a photograph-like arrangement of exactly-placed marks, or a kit example | `html` |
| a figure for a paper: dense, measured, printed at a fixed width | **`figure`** |
| a formula-heavy picture that must be TeX | `tikz` |

## The spec

```json
{
  "figure": {
    "preset": "ieee-double",
    "theme": "paper",
    "margin": 8,
    "gap": 7,
    "caption": "One sentence stating what the reader must get from the figure."
  },
  "blocks": [
    { "type": "text", "text": "**model.gguf** is a header, then metadata, then weights." },
    { "type": "strip", "id": "bar", "segments": [
        { "id": "magic", "weight": 1, "label": "4 bytes", "tone": "ink" },
        { "id": "meta", "weight": 2, "label": "metadata", "tone": "meta" },
        { "id": "rest", "weight": 6, "label": "tensor data", "tone": "ink" } ] }
  ],
  "links": [
    { "kind": "leader", "from": "bar.meta.bottom", "to": "bar.rest.bottom", "dash": true, "tone": "meta" }
  ]
}
```

Only `blocks` is required alongside `figure`. Sizes are **points**: a 7 pt label is
`"size": 7`, and that is what prints.

## The primitives

| type | is | key fields |
|---|---|---|
| `rows` / `columns` | the whole layout model | `children`, `gap`; a column child may be `{ "block": …, "weight": 2 }` |
| `panel` | a titled group | `title`, `tone`, `dash`, `fill: true` (tint), `radius`, `pad` |
| `text` | a paragraph | `text`, `size`, `align`, `weight: "bold"`, `mono` |
| `list` | numbered or bulleted items | `items`, `numbered`, `size`, `itemGap` |
| `code` | a monospaced pane | `lines`, `size`, `frame: false` inside a panel |
| `strip` | a bar whose segment widths are data | `segments[{id, weight, label, tone, text}]`, `labels`, `tail` |
| `node` | one actor in a box | `title`, `sub`, `w`, `h`, `shape` |
| `matrix` | a labelled grid | `rows`, `cols`, `cell`, `cells[{r,c,tone}]`, `rowLabels`, `colLabels` |
| `badge` | a pill | `text`, `tone`, `align` |
| `legend` | the colour key | `items[{tone,label}]` — a print figure needs one |
| `rule` / `spacer` | a hairline / a gap | `h` |
| `stack` | explicit placement, for one inset | `h`, `children[{block,x,y,w,h}]` |

Inline markup inside any text: `**bold**`, `` `mono` ``, `{tone:text}`.

**Tones are roles, not colours**: `ink`, `muted`, `soft`, `meta`, `tensor`, `link`,
`accent`, `warn`, `teal`, `yellow`. The theme resolves them, and the greyscale
check compares their luminance — so a figure survives being printed in black and
white, which is how most of them are read.

## Connectors

```json
{ "kind": "leader", "from": "card-magic.top", "to": "bar.magic.bottom", "tone": "ink", "dash": true, "dot": true }
{ "kind": "arrow",  "from": "n-llm.right",  "to": "n-vlm.left", "out": 3 }
{ "kind": "brace",  "from": "bar.magic",    "to": "bar.kv", "label": "header · 24 bytes" }
```

An end is `"id"` (centre), `"id.top|bottom|left|right"`, or `"bar.<segment>.top"`
for one segment of a strip. Routing is orthogonal with rounded corners, and the
clearance is clamped to the gap you left, so a 5 pt elbow in an 8 pt gutter does
not overshoot.

## The loop

1. **Write the claim first.** One sentence: what must the reader believe after five
   seconds? That sentence is `figure.caption`, and it decides the panels.
2. **Pick an archetype** from `reference/figures/` and read its `anatomy.md`:
   `gguf-file-layout` for a byte/record layout, `neo-motivation` for a multi-panel
   motivation plate.
3. **Write the spec top-down**: columns first, then panels, then text. Do not reach
   for `stack` until the flow layout genuinely cannot express the inset.
4. **Read the diagnostics.** `overlap` means two solid boxes share space; `bounds`
   means the page is too narrow; `link` means an anchor name is wrong. Fix the
   structure, not the pixels.
5. **Look at it.** `diagram_figure`-class renders come from the tab; for a host-side
   PNG, export `png` (the panel rasterises at 3×) and open it.
6. **Check the warnings**, which are the ones a reader would notice: type below
   5.5 pt, two tones that merge in greyscale, a code line wider than its pane, no
   caption.

## Rules that keep a figure printable

- **Width is a decision, not a default.** `ieee-single` 252 pt, `ieee-double` 516,
  `acm-single` 240, `neurips` 397, `cvpr` 495. Design at the width it will print.
- **Density is the enemy.** Over ~120 text runs, split into two figures. The kit's
  own budget is 9 nodes; a paper plate earns its density one panel at a time.
- **One colour role, one meaning, kept everywhere.** If `meta` is the metadata
  section, it is not also "good".
- **Every colour gets a legend**, or the figure is unreadable in print.
- **The caption states the claim**; the figure does not restate the caption.
- **Never pixel-place.** If you find yourself writing `stack` with hand-computed
  coordinates at the top level, the composition is wrong.

## Common diagnostics, and what they mean

| diagnostic | fix |
|---|---|
| `overlap … by W×Hpt` | two solids share space: shorten a column, raise a `gap`, or move the block into its own row |
| `bounds … outside the Npt page` | the content is wider than the preset: reduce sizes, or use a wider preset |
| `link … does not resolve` | the anchor names a block that does not exist, or the side is not `top/bottom/left/right` |
| `print … below the 5.5pt floor` | raise `size`, or cut content |
| `grey … merge in a black-and-white print` | use two tones with different luminance, or label them |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.