Skip to content
Back to skills

Figure View

ASecurity

Use when an agent produces or hands over a diagram, chart, screenshot or other image file: render HTML, SVG, PNG, JPG, GIF or WebP figures to a PNG the agent can look at before claiming the figure is right, deliver figures as file:// links with browser zoom controls instead of inline previews that cannot be enlarged, and show them enlarged in the terminal with zoom, pan and fit. Standard-library scripts plus a local Chrome, Chromium or Edge; the viewer works in Kitty-graphics terminals (kitty...

  • 30,870 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added December 3, 2026
ai-agentspythonrustgobashnodegitapisecurity

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add alirezarezvani/claude-skills --skill figure-view --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Figure View?

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

Security grade badge for Figure View
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alirezarezvani-figure-view/badge)](https://www.skillsdirectory.com/skills/alirezarezvani-figure-view)

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: figure-view
description: "Use when an agent produces or hands over a diagram, chart, screenshot or other image file: render HTML, SVG, PNG, JPG, GIF or WebP figures to a PNG the agent can look at before claiming the figure is right, deliver figures as file:// links with browser zoom controls instead of inline previews that cannot be enlarged, and show them enlarged in the terminal with zoom, pan and fit. Standard-library scripts plus a local Chrome, Chromium or Edge; the viewer works in Kitty-graphics terminals (kitty, Ghostty, WezTerm, Konsole, herdr). Not for designing the figure itself."
license: MIT
metadata:
  version: 1.1.0
  author: whatthetaff
  category: engineering
  updated: 2026-12-01
---

# Figure View

A figure is only finished when someone has looked at it. Agents write diagrams as HTML or SVG and never see
them render; people get a thumbnail in chat they cannot enlarge. This skill closes both gaps with two
standard-library scripts:

- `scripts/render_figure.py` turns any figure into a PNG, so the agent can open the picture and check it.
- `scripts/view_figure.py` shows a figure enlarged in the terminal, with zoom, pan and fit.

Do not use it to design the figure (use a diagram skill), for remote files the browser cannot read, or as a
general image editor.

## Before starting

Check the machine instead of asking:

```bash
python3 scripts/render_figure.py --sample --json     # the script runs; no browser needed for this
python3 scripts/render_figure.py fig.html --json     # a clear error names the fix if no Chrome is found
```

HTML, SVG, JPG, GIF and WebP need a local Chrome, Chromium or Edge (found automatically, or set with
`--browser` / `FIGURE_VIEW_BROWSER`). A PNG within the 4-megapixel cap needs nothing.

## Modes

- **Look** (default for agents): render the figure and inspect the PNG before saying it is done.
- **Deliver**: hand the figure to the person so they can enlarge it.
- **View**: show it enlarged in the person's terminal.
- **Wire in**: connect the viewer to a harness's link clicks or panes.

## Workflow: look at your own figure

1. Write the figure to a stable absolute path, for example `/tmp/billing-architecture.html`.
2. `python3 scripts/render_figure.py /tmp/billing-architecture.html --json` prints `{png, width, height}`.
   Renders are cached until the file changes.
3. Open the PNG with the harness's image reading and check it: labels clipped, arrows crossing nodes,
   text too small, the legend cut off. Fix the source and render again. Never describe a figure you have
   not looked at.
4. Limit: for an HTML page, only its largest inline `<svg>` is rendered, with the page's Google Fonts
   and paper colour. Other page `<style>` rules and `:root` custom properties are not carried over, so
   an SVG styled by page CSS renders unstyled. Inline the styles into the SVG before you check it.

## Workflow: deliver a figure

1. For HTML diagrams, paste [assets/enlarge-controls.html](assets/enlarge-controls.html) into the page
   (style block in `<head>`, controls before the `.diagram-container`) and replace `SLUG` with the
   diagram's slug. The CSS-only Normal / Fit screen / 2x / 3x buttons work in any browser and add no script.
2. In the reply, put the figure's `file://` URL on its own line. Most terminals open it on a modified click.
3. Offer the terminal view when the person works in a Kitty-graphics terminal (next workflow).

## Workflow: view in the terminal

```bash
python3 scripts/view_figure.py /tmp/billing-architecture.html   # in a terminal pane or split
```

The viewer checks for Kitty graphics first. Without them it prints the rendered PNG's path and exits `1`,
so the person can open it in an image viewer. Run it in a split pane beside the session where the harness
allows, so the conversation stays visible.

To keep one viewer and switch figures, start it with `--follow` and hand figures to it:

```bash
python3 scripts/view_figure.py --follow                          # the long-running viewer pane
python3 scripts/view_figure.py --send /tmp/next-figure.png --json
# {"sent": true, "viewer_running": true, "viewer_command": [".../python3", ".../view_figure.py", "--follow"]}
```

When `viewer_running` is false, start `viewer_command` in a new pane. That pair is the whole integration
contract for a harness; see the README for a Herdr example.

## Example

```markdown
The diagram shows the four billing services and the two queues between them.

file:///tmp/billing-architecture.html

Open it to zoom in, or view it here: python3 scripts/view_figure.py /tmp/billing-architecture.html
```

## Viewer controls

| Input | Action |
| --- | --- |
| `[ - ]` `[ + ]`, `+` `-`, wheel at the pointer | Zoom between fit (100%) and 800% |
| `[ Fit ]`, `0`, double-click | Back to fit (double-click toggles fit and 200% at the pointer) |
| Drag, arrows, `h j k l` | Pan; the figure always covers the frame |
| `[ Open in browser ]`, `o` | The original file in the default browser |
| `r` | Render again |
| `[ Close ]`, `q`, Esc | Close the viewer |

## Troubleshoot

| Symptom | Cause and fix |
| --- | --- |
| `No Chrome, Chromium or Edge found` | Install one, or pass `--browser` / set `FIGURE_VIEW_BROWSER` to its executable |
| Viewer prints a PNG path and exits 1 | The terminal has no Kitty graphics; open the PNG, or use kitty, Ghostty, WezTerm or Konsole |
| Pane shows "could not draw the image" | The terminal refused the image size; set `FIGURE_VIEW_MAX_PIXELS` lower (default 4000000) |
| Web fonts missing in the PNG | The render had no network; the figure falls back to system fonts |

Rendering limits, the security model and terminal quirks: [references/design.md](references/design.md).

## Anti-patterns

- **Claiming a figure looks right without rendering it.** Look at the PNG first.
- **Delivering only an inline image.** Chat previews cannot be enlarged; always give the `file://` URL.
- **Rendering untrusted pages with scripts on.** Keep the script-blocking wrapper; never pass pages to a
  browser that runs their code.
- **Starting a new viewer for every figure.** Use `--follow` and `--send` so one pane switches figures.
- **Editing the cached PNG.** Fix the source; the cache follows it.

## Proactive Triggers

- An agent writes a diagram, chart or screenshot to a file and is about to describe it.
- The person squints at, or asks to enlarge, an inline preview.
- A diagram skill produces HTML that will be viewed both in a browser and in the terminal.
- Several figures are delivered in one session (one `--follow` viewer, not one per figure).
- A figure's labels or layout were changed and need a visual re-check.

## Output Artifacts

| Artifact | Where |
| --- | --- |
| Rendered PNG | `render_figure.py --json` prints its path (cache in `~/.cache/figure-view/renders/`) |
| Figure with browser zoom controls | the HTML path given in the reply |
| `file://` link on its own line | the reply |
| Enlarged terminal view | a pane running `view_figure.py` |
| Viewer state and log | `~/.cache/figure-view/` |

## Related Skills

- `diagramming-processes` and other diagram skills: use them to design the figure; use figure-view to check
  and deliver it. Not a replacement for either.
- `chart-designer`: use it for chart configs; render the chart's HTML here to check it.
- `readme-polish`: use it for figures inside a README on GitHub; figure-view covers local viewing only.
- `demo-video`: use it for motion; figure-view shows still images (an animated GIF shows its first frame).

Files in this skill

  • .claude-plugin/plugin.json622 B
  • README.md2.9 KB
  • SKILL.md7.4 KB
  • assets/enlarge-controls.html2.6 KB
  • evals/evals.json1.9 KB
  • references/design.md4.9 KB
  • scripts/render_figure.py14.3 KB
  • scripts/view_figure.py27.4 KB

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.