A Codex skill for turning paper sections, method descriptions, and figure concepts into editable draw.io academic figures.
codex-paper-figure-skill takes natural-language scientific content, uses Codex image_gen to explore a visual reference, and then rebuilds the final result as a native .drawio diagram. The main output is not a flattened PNG: readers can open the .drawio file later and edit labels, shapes, arrows, groups, layout, colors, and icon elements directly in draw.io / diagrams.net.
Editable-first output: the generated .drawio file is the primary deliverable. Raster images are used only as references or previews unless you explicitly request otherwise.
- Generate paper-style workflow diagrams, mechanism figures, model architecture figures, experimental design diagrams, and graphical abstract drafts from manuscript text.
- Use
image_genfor composition exploration, then recreate the final figure as editable draw.io XML. - Keep scientific labels, shapes, arrows, groups, and icons editable in draw.io instead of flattening them into a single raster image.
- Use Codex built-in
Browserto search Flaticon when icon-assisted figures are useful. - Produce
.drawioas the primary artifact, so readers can keep refining the figure after generation; PDF/SVG/PNG exports are optional presentation formats.
Required:
- Codex with local skill support.
- Codex
image_gen, used to generate the raster reference image.
Optional:
- Codex built-in
Browser, used when the figure needs icons from Flaticon. - draw.io / diagrams.net for opening and editing generated
.drawiofiles. - draw.io Desktop, recommended on macOS and useful on Windows/Linux, because it provides a local app and CLI that Codex can use to export PDF/SVG/PNG automatically.
The diagrams.net web app at app.diagrams.net can open, edit, and manually export .drawio files. It is enough for editing. For automated PDF/SVG/PNG rendering from Codex, install draw.io Desktop.
Use the skill directly from this repository:
[$codex-paper-figure-skill](./codex-paper-figure-skill/SKILL.md)
Create an editable draw.io academic figure from the paper text below:
<paste a paper section, methods paragraph, results summary, or figure idea>
Expected output:
- A generated reference image from
image_gen. - An editable
.drawiofile that can be reopened and modified in draw.io / diagrams.net. - Optional preview/export files if requested and supported by the local environment.
You can use this skill in either of two ways.
Keep the repository as-is and explicitly reference the skill file in Codex:
[$codex-paper-figure-skill](./codex-paper-figure-skill/SKILL.md)
This is the simplest way to test the skill and reproduce the examples.
Copy the skill folder into your Codex skills directory:
<Codex skills directory>/
└── codex-paper-figure-skill/
├── SKILL.md
└── agents/
└── openai.yaml
Only copy the inner codex-paper-figure-skill/ folder. The repository-level outputs/ directory contains examples and is not required for installation.
codex-paper-figure-skill/
├── assets/
│ └── repo-hero.png
├── codex-paper-figure-skill/
│ ├── SKILL.md
│ └── agents/
│ └── openai.yaml
├── LICENSE
├── outputs/
│ ├── multimodal-gnn/
│ │ ├── demo-multimodal-gnn-reference.png
│ │ └── demo-multimodal-gnn.drawio
│ └── icon-crispr/
│ ├── demo-icon-crispr-reference.png
│ ├── demo-icon-crispr-preview.png
│ ├── demo-icon-crispr-preview.svg
│ └── demo-icon-crispr.drawio
└── README.md
- Parse the input into a figure brief: scientific message, entities, relationships, required labels, layout constraints, and output format.
- Use Codex
image_gento generate a raster reference for layout, style, and visual hierarchy. - Rebuild the figure as native draw.io mxGraphModel XML.
- Keep labels, shapes, arrows, groups, and icon elements editable in draw.io.
- Validate the
.drawioXML for required root cells and parseability. - Export PDF/SVG/PNG only when requested and when draw.io Desktop CLI is available.
The skill prioritizes editable output:
| Output | Purpose |
|---|---|
.drawio |
Primary editable figure artifact. Open it later in draw.io / diagrams.net to edit text, shapes, arrows, layout, and styling. |
*-reference.png |
Raster reference generated by image_gen; used for composition, not as the final editable figure. |
*-preview.png / *-preview.svg |
Optional visual preview for README, review, or sharing. |
.drawio.pdf / .drawio.svg / .drawio.png |
Optional draw.io Desktop CLI exports when available. |
icons/ |
Optional folder for downloaded icon assets when external icons are used. |
| Example | Reference | Editable Output | Preview | Notes |
|---|---|---|---|---|
| Multimodal GNN pipeline | PNG | draw.io | - | Native draw.io shapes only; no external icons. |
| Icon-assisted CRISPR screen | PNG | draw.io | PNG, SVG | Uses Flaticon icon image cells. |
Example input:
A multimodal analysis pipeline integrates raw microscopy images and gene-expression tables. Images are segmented into cell instances, expression profiles are normalized, a graph neural network combines morphology and molecular features, and the model outputs cell-state predictions with uncertainty scores. Results are validated against expert annotations and summarized as biomarker panels.
Reference image generated with image_gen:
Editable draw.io file:
outputs/multimodal-gnn/demo-multimodal-gnn.drawio
Validation: XML parsed successfully with required root cell 0, default parent cell 1, and 199 mxCell elements.
Example input:
An icon-assisted CRISPR imaging screen links perturbation design, microscopy phenotyping, feature storage, neural network modeling, and orthogonal validation. Guide RNA libraries target candidate regulators, microscopy images are collected after perturbation, phenotypic and molecular features are stored in a unified database, a neural network predicts regulator effects, and top hits are validated with checklist-style orthogonal assays.
Reference image generated with image_gen:
Preview rebuilt with Flaticon icons:
Editable draw.io file:
outputs/icon-crispr/demo-icon-crispr.drawio
SVG preview:
outputs/icon-crispr/demo-icon-crispr-preview.svg
Validation: XML parsed successfully with required root cell 0, default parent cell 1, 49 mxCell elements, and 5 icon image cells. The SVG preview also parsed successfully and contains 5 icon image elements.
Icon sources:
Attribution: icons designed by Freepik from Flaticon. Flaticon free assets commonly require attribution; verify the current icon page and license before reuse or redistribution.
Icons are optional. Use them only when they make a scientific figure clearer.
- Use Codex built-in
Browserto open Flaticon. - Search for the exact concept plus a style term such as
line,outline,filled,flat, orscience. - Prefer free, non-premium icons from the same author or style family.
- Open each icon detail page and record the icon URL, author/designer, license, and attribution requirement.
- Prefer SVG/vector assets when available and permitted.
- Save downloaded project icons under the current output folder, preferably
icons/. - If license terms, author, or download source are unclear, use an editable draw.io shape instead.
The skill always creates a .drawio file first.
If draw.io Desktop CLI is installed, Codex can try to export:
drawio -x -f pdf -e -b 10 -o figure.drawio.pdf figure.drawio
drawio -x -f svg -e -b 10 -o figure.drawio.svg figure.drawio
drawio -x -f png -e -b 10 -o figure.drawio.png figure.drawioCommon CLI locations:
- macOS:
/Applications/draw.io.app/Contents/MacOS/draw.io - Windows:
C:\Program Files\draw.io\draw.io.exe - Linux:
drawioonPATH
If the CLI is not available, open the .drawio file in app.diagrams.net or draw.io Desktop and export manually.
Validate the skill metadata:
python <path-to-skill-creator>/scripts/quick_validate.py ./codex-paper-figure-skillRecommended diagram checks before publishing generated figures:
- XML parses successfully.
- Root cells
0and1exist. - Labels are editable draw.io text.
- Arrows and panel order match the manuscript logic.
- Icon sources and attribution are recorded when external icons are used.
- Exported previews are not blank, clipped, or text-overlapping.
image_genoutput is a visual reference, not the final editable deliverable.- Generated raster text may be inaccurate; final labels should be recreated as draw.io text.
- Without draw.io Desktop CLI, automatic PDF/SVG/PNG export may be unavailable.
- External icons can introduce licensing obligations. Always check the source page before publication.
- The skill does not guarantee journal compliance; users should still check target journal figure size, resolution, color, and attribution requirements.
This repository is released under the MIT License.
The MIT license covers the skill files, README, and repository code/documentation authored for this project. Example outputs may include generated images and third-party icon references; those assets may have separate terms. Flaticon icons used in the icon demo are attributed to Freepik from Flaticon. Verify current license terms on each icon page before reuse or redistribution.
This skill borrows the core draw.io generation pattern from the draw.io SKILL.md approach: native mxGraphModel XML, editable .drawio files, XML validation, and optional export through draw.io Desktop CLI. The draw.io rules needed for this workflow are embedded in codex-paper-figure-skill/SKILL.md, so this repository exposes one self-contained skill.
Useful references:

