Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codex-paper-figure-skill

中文 README

codex-paper-figure-skill overview

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.

Features

  • Generate paper-style workflow diagrams, mechanism figures, model architecture figures, experimental design diagrams, and graphical abstract drafts from manuscript text.
  • Use image_gen for 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 Browser to search Flaticon when icon-assisted figures are useful.
  • Produce .drawio as the primary artifact, so readers can keep refining the figure after generation; PDF/SVG/PNG exports are optional presentation formats.

Requirements

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 .drawio files.
  • 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.

Quick Start

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 .drawio file that can be reopened and modified in draw.io / diagrams.net.
  • Optional preview/export files if requested and supported by the local environment.

Installation

You can use this skill in either of two ways.

Option 1: Reference It From This Repository

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.

Option 2: Install It As A Local Codex Skill

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.

Repository Structure

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

How It Works

  1. Parse the input into a figure brief: scientific message, entities, relationships, required labels, layout constraints, and output format.
  2. Use Codex image_gen to generate a raster reference for layout, style, and visual hierarchy.
  3. Rebuild the figure as native draw.io mxGraphModel XML.
  4. Keep labels, shapes, arrows, groups, and icon elements editable in draw.io.
  5. Validate the .drawio XML for required root cells and parseability.
  6. Export PDF/SVG/PNG only when requested and when draw.io Desktop CLI is available.

Outputs

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.

Examples

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.

Multimodal GNN Pipeline

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:

Multimodal GNN reference

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.

Icon-Assisted CRISPR Screen

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:

Icon CRISPR reference

Preview rebuilt with Flaticon icons:

Icon CRISPR preview

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.

Icon Workflow

Icons are optional. Use them only when they make a scientific figure clearer.

  1. Use Codex built-in Browser to open Flaticon.
  2. Search for the exact concept plus a style term such as line, outline, filled, flat, or science.
  3. Prefer free, non-premium icons from the same author or style family.
  4. Open each icon detail page and record the icon URL, author/designer, license, and attribution requirement.
  5. Prefer SVG/vector assets when available and permitted.
  6. Save downloaded project icons under the current output folder, preferably icons/.
  7. If license terms, author, or download source are unclear, use an editable draw.io shape instead.

draw.io Export

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.drawio

Common CLI locations:

  • macOS: /Applications/draw.io.app/Contents/MacOS/draw.io
  • Windows: C:\Program Files\draw.io\draw.io.exe
  • Linux: drawio on PATH

If the CLI is not available, open the .drawio file in app.diagrams.net or draw.io Desktop and export manually.

Validation

Validate the skill metadata:

python <path-to-skill-creator>/scripts/quick_validate.py ./codex-paper-figure-skill

Recommended diagram checks before publishing generated figures:

  • XML parses successfully.
  • Root cells 0 and 1 exist.
  • 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.

Limitations

  • image_gen output 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.

License And Attribution

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.

Acknowledgements

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:

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors