$npx -y skills add neuromechanist/research-skills --skill ai-full-figureThis skill should be used when the user asks to "generate an AI figure", "make a full AI-generated figure", "make a poster figure", "make a presentation figure", "generate a figure with AI", "create a substrate image", "AI background for a figure", "create a poster background", o
| 1 | # AI Full Figure |
| 2 | |
| 3 | Generate a pictorial substrate via AI (Codex CLI or OpenAI Images API) and overlay labels, arrows, and scale bars programmatically. The output is an SVG that embeds the raster substrate and lets the `[[scientific-figure]]` composer place it as a panel. |
| 4 | |
| 5 | ## When to use this skill |
| 6 | |
| 7 | Reach for `ai-full-figure` when the figure's *picture* is the point: |
| 8 | |
| 9 | - A brain rendering for a methods overview slide |
| 10 | - A microscope or apparatus illustration for a poster |
| 11 | - An anatomical scene as the background of a graphical abstract |
| 12 | - Any "what does this setup look like" pictorial |
| 13 | |
| 14 | Reach for a different skill when the figure is **information-dense**: |
| 15 | |
| 16 | | Figure type | Skill | |
| 17 | |---|---| |
| 18 | | Data plot (matplotlib, seaborn, plotly) | `[[plot-styling]]` for the plot, then `[[scientific-figure]]` to compose | |
| 19 | | Schematic with boxes / arrows / process flow | `[[svg-primitives]]` (programmatic) or `[[svg-figure]]` (hand-authored conventions) | |
| 20 | | Flat scientific icon as part of a figure | `[[transparent-icons]]` | |
| 21 | | Multi-panel journal figure | `[[scientific-figure]]` as the composer | |
| 22 | |
| 23 | ## Hard ceiling on AI generation |
| 24 | |
| 25 | `gpt-image-2` and equivalent models cannot reliably render: |
| 26 | |
| 27 | - Data plots with axis numerals (axes hallucinate, tick labels are nonsense) |
| 28 | - Equations (LaTeX or Greek-letter math) |
| 29 | - Multi-arrow flowcharts (arrow direction inconsistent, arrows cross wrong) |
| 30 | - Long labels in specific positions ("> 5 labeled elements" is a useful threshold) |
| 31 | - Anything that needs to be **read** precisely — labels >1–2 words drift |
| 32 | |
| 33 | The right pattern when those are needed: **substrate-only generation, programmatic overlay**. |
| 34 | |
| 35 | 1. Prompt the model for the pictorial scene with **no text, no labels, no arrows**. |
| 36 | 2. Compose labels, arrows, scale bars, and panel letters as a separate SVG layer. |
| 37 | 3. Ship the combined SVG. |
| 38 | |
| 39 | If the user is asking for a figure that violates the hard ceiling, route to `[[svg-figure]]` or `[[scientific-figure]]` and explain why. AI generation for embedded text remains unreliable as of 2026. |
| 40 | |
| 41 | ## The theme bible (shared with transparent-icons) |
| 42 | |
| 43 | A `theme.json` keeps an AI-generated substrate visually consistent with the rest of the figure's palette and stroke language. The schema is the same one used by `[[transparent-icons]]`: |
| 44 | |
| 45 | ``` |
| 46 | plugins/figures/skills/transparent-icons/references/theme.schema.json |
| 47 | ``` |
| 48 | |
| 49 | Attach the theme to every generation call. The same fields apply: `palette`, `stroke`, `style_tokens`, `negative_tokens`, `composition`, `reference_images`, `model_preferences`. For substrates, the most load-bearing keys are: |
| 50 | |
| 51 | - `palette.primary / accent / neutral` — color tokens injected into the prompt. |
| 52 | - `negative_tokens` — must include `text`, `labels`, `watermark`, `arrows`, `caption`. The substrate must not contain any text the overlay will replace. |
| 53 | - `composition.aspect` — substrates are typically 16:9 (`"1920x1080"`) or 4:3; set this explicitly. |
| 54 | - `style_tokens` — e.g. "photorealistic illustration", "watercolor", "isometric 3D", "schematic line art". |
| 55 | - `reference_images` (optional, up to 16) — for consistency across a set of substrates. |
| 56 | |
| 57 | ## Usage |
| 58 | |
| 59 | ### Generate a substrate |
| 60 | |
| 61 | ```bash |
| 62 | uv run --with openai --with python-dotenv --with pillow \ |
| 63 | python scripts/generate_figure.py \ |
| 64 | "a stylized lateral view of a human brain in soft watercolor on a clean white background" \ |
| 65 | -o out/brain_substrate.png \ |
| 66 | --size 1920x1080 --backend codex |
| 67 | ``` |
| 68 | |
| 69 | `generate_figure.py` builds the prompt from the theme bible (when `--theme path/to/theme.json` is provided) and dispatches to the Codex CLI or the OpenAI Images API. Output is an opaque PNG at the requested size. No transparency post-process is applied — substrates are designed to be the bottom layer, not floated. |
| 70 | |
| 71 | ### Compose labels on top |
| 72 | |
| 73 | ```bash |
| 74 | uv run --with svgwrite --with pillow \ |
| 75 | python scripts/overlay_labels.py \ |
| 76 | out/brain_substrate.png \ |
| 77 | --label "lateral sulcus@600,420" \ |
| 78 | --label "central sulcus@800,300" \ |
| 79 | --scale-bar "1 cm@200,950" \ |
| 80 | -o out/brain_labeled.svg |
| 81 | ``` |
| 82 | |
| 83 | The output SVG embeds the PNG via `<image>` and adds `<text>` / `<line>` / arrow markers on top. The SVG's `viewBox` matches the PNG's pixel dimensions so coordinates are pixel-address |