agentleFS
JihaoXinJihaoXin/paper-machine/skills/figure-integrity/SKILL.md

figure-integrity

Skill0 starsChanged 3 months agoMITView on GitHub

Produce figures that are real, readable, and actually referenced. Use when generating, inserting, resizing, or debugging figures in a paper, and when a vision model rejects an image. Covers data honesty, the JPEG-named-PNG failure that kills whole runs, upscaling, and dense bitmaps crushed into a column.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every figure plots values that exist in results/: No smoothing a curve because it looks noisy, no extending a trend past the data, no …

    line 10
  2. Distinctive:

    Check magic bytes after generating any image:

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Figure Integrity

Data honesty

Every figure plots values that exist in results/. No smoothing a curve because it looks noisy, no extending a trend past the data, no inventing a baseline bar. If a figure needs a number you do not have, the figure does not get made.

A figure is a claim. It carries the same burden as a sentence, and it is read first.

The bytes must match the extension

A file named .png must contain PNG bytes.

Image models return whatever format they like. Save that response as figure.png and you get a file whose name says PNG and whose content is JPEG. LaTeX sniffs content, so the paper compiles and nothing complains. The lie surfaces later, when a vision model is asked to look at the draft and the provider rejects the request:

The image was specified using the image/png media type,
but the image appears to be a image/jpeg image

That is a hard 400 in the middle of a run. Observed killing an entire paper at the review stage, twice, before it was understood.

Check magic bytes after generating any image:

from PIL import Image
img = Image.open(path)           # actual format
if img.format != expected_from_extension:
    img.save(path, expected)      # re-encode, keep the filename

Re-encode, do not rename. The filename is already referenced by main.tex, the figure manifest, and possibly a JSON spec. Changing the bytes keeps every reference valid. Changing the name breaks all of them.

Never upscale

\includegraphics[width=\linewidth] on a small bitmap produces a blurry figure that reviewers read as carelessness. Check the native pixel width before choosing a display width. If the image is 600 px wide, it does not belong at 7 inches. Regenerate it larger or place it smaller.

Vector output (PDF from matplotlib) has no such limit and should be your default for plots.

Do not crush dense figures into one column

A pipeline diagram or a heatmap with twenty labels, shrunk into a single-column figure, becomes unreadable. In a two-column layout, dense content belongs in figure* spanning both columns.

Decide placement from what the figure contains, not from what fits:

  • a two-panel plot with large labels: single column is fine
  • a system diagram, a wide table-like heatmap, anything with small text: full width

Every figure must be referenced

A figure that no sentence points at is either unnecessary or a sign the text is incomplete. Before delivery, confirm that each \includegraphics has a matching \ref in the prose. Generated-but-orphaned figures are a common artifact of agents that made a figure and then forgot about it.

Checklist

  • Values come from results/
  • File bytes match the file extension
  • Not displayed wider than its native resolution supports
  • Dense content spans both columns
  • Referenced by \ref in the text
  • Caption states what the reader should conclude, not just what is drawn

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.