figure-composer
Skill0 starsChanged 31 days agoMITView on GitHub
Complete multi-panel scientific figure workflow for PPTX: compose panels from scratch, edit existing panels (replace images, manage labels) and clean labels out of a PDF. Use instead of any single-purpose figure tool. Use when the user needs to compose a figure, merge panels, add or remove or swap a panel, replace a figure inside a panel, unify label styles, or strip labels out of a PDF. Chinese trigger words: 拼图, 多面板合成, 替换面板, 调整标签, 统一标签, 去标签.
- Installs packages
5 other projects use a version of this.
Adopted by
Most recently taken up by
- HughYau/AcademicForgetheir own version, first seen Nov 8, 2026
- JonathanChan-geek/claude-science-skillstheir own version, first seen Oct 25, 2026
- HughYau/pengsida-learning-research-skillstheir own version, first seen Oct 8, 2026
- xuzhougeng/wisp-sciencetheir own version, first seen Jul 22, 2026
- JimLiu/science-skillstheir own version, first seen Jul 1, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- HughYau/AcademicForge★ 2.6ksame name
- xuzhougeng/wisp-science★ 1.1ksame name
- JimLiu/science-skills★ 228same name
- HughYau/pengsida-learning-research-skills★ 27same name
- JonathanChan-geek/claude-science-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Ask the user for input files, rows, cols.
- Distinctive: line 41
Ask the user: "Detected X candidate labels.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Figure Composer
Three-mode figure workflow: compose (from scratch), edit (modify existing), clean (PDF label removal).
Quick Dispatch
| User says | Mode | Entry |
| compose / merge panels / multi-panel | compose | scripts/compose.py |
| swap / replace panel, add / remove / modify label | edit | scripts/replace_panel.py + scripts/manage_labels.py |
| clean PDF label / redact text | clean | scripts/replace_pdf_label.py |
Mode 1: Compose (from scratch)
Phase 1: Collect & confirm layout
Ask the user for input files, rows, cols. Draw an ASCII diagram:
Proposed: 2×3 (5 files, 1 empty)
┌──────┬──────┬──────┐
│ a │ b │ c │
├──────┼──────┼──────┤
│ d │ e │ (empty)│
└──────┴──────┴──────┘Always confirm before proceeding.
Phase 2: Clean old labels (ask first)
Ask the user: "Detected X candidate labels. Remove them?" Default is yes, but the user can say "keep the original labels" to skip.
For PDF: python scripts/replace_pdf_label.py --pdf <file> --detect
Then: python scripts/replace_pdf_label.py --pdf <file> --old "X" --new ""
For SVG, do inline search-and-remove. For PNG, overlay white rectangle with Pillow.
Phase 3: Compose
python scripts/compose.py \
--files <file1> <file2> ... \
--rows <N> --cols <N> \
--labels "a,b,c,d,e" \
--output <output.pptx>- PDF → SVG via PyMuPDF (vector preserved)
- SVG/PNG embedded directly
- Labels added as native PPTX text boxes (Arial Bold, inside panel top-left)
- No Windows/PowerPoint dependency — pure Python (PyMuPDF + lxml + zipfile)
Phase 4: Verify
python scripts/manage_labels.py detect --pptx <output.pptx>
python scripts/replace_panel.py --pptx <output.pptx> --listTell user: right-click SVG → "Convert to Shape" for full editability.
Mode 2: Edit (modify existing PPTX)
Step 1: Inspect current state
python scripts/replace_panel.py --pptx <file.pptx> --list
python scripts/manage_labels.py detect --pptx <file.pptx>Step 2a: Replace a panel
python scripts/replace_panel.py \
--pptx <file.pptx> \
--panel <media_name> \ # e.g. image1.svg
--with <new_file.pdf> \ # PDF→SVG automatic
--output <file.pptx>Automatically creates .bak backup. Only page 1 of multi-page PDF is used.
Step 2b: Manage labels
# Add labels (mapped from SVG coords to slide position)
python scripts/manage_labels.py add \
--pptx <file.pptx> \
--labels "a,62,20 b,455,20 c,843,20" \
--size 20 --bold \
--panel-x <panel_emu_x> --panel-y <panel_emu_y> \
--panel-w <panel_emu_w> --panel-h <panel_emu_h>
# Remove labels
python scripts/manage_labels.py remove --pptx <file.pptx> --labels "a,b,c"
# Modify label properties (font, size, bold)
python scripts/manage_labels.py modify \
--pptx <file.pptx> --labels "a,b,c" --size 24 --font "Arial" --boldStep 3: Verify
Re-run detect to confirm changes. To export a raster/vector copy afterwards, see the
conversion pipeline in the r-figures-to-editable-pptx skill.
Mode 3: Clean (PDF label removal)
For sophisticated label replacement with font matching and border preservation:
# Detect labels in PDF
python scripts/replace_pdf_label.py --pdf <file.pdf> --detect
# Replace specific text (no-fill redaction preserves borders)
python scripts/replace_pdf_label.py --pdf <file.pdf> \
--old "a Translocated species richness" --new ""
# Replace with different text at same position/size/font
python scripts/replace_pdf_label.py --pdf <file.pdf> \
--old "a" --new "d" -o <output.pdf>Key capabilities (absent from simpler tools):
- No-fill redaction: preserves border/axis lines passing behind the label
- Font matching: detects and matches Times/Arial/Helvetica/Courier
- Border integrity check: verifies surrounding drawing lines are intact
- Preview PNG: generates 150 DPI preview for visual confirmation
Scripts Reference
| Script | Purpose |
scripts/compose.py | Compose multi-panel PPTX from scratch (grid layout + labels) |
scripts/replace_panel.py | List / replace SVG panel media in existing PPTX |
scripts/manage_labels.py | Detect / add / remove / modify PPTX overlay text labels |
scripts/replace_pdf_label.py | Detect / replace short text labels in PDFs (with font matching) |
Dependencies
python -m pip install pymupdf pillow lxml python-pptx- PyMuPDF (fitz) — PDF manipulation, PDF→SVG, label detection/redaction
- Pillow — PNG label cleaning
- lxml — PPTX XML manipulation
- python-pptx — PPTX base template creation (minimal use)
- Ghostscript (optional) — for preview PNG in label replacement
- No Windows/PowerPoint dependency for compose and label operations
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
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.

