agentleFS
mumu-scimumu-sci/figure-composer/SKILL.md

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

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. HughYau/AcademicForge★ 2.6ksame name
    2. xuzhougeng/wisp-science★ 1.1ksame name
    3. JimLiu/science-skills★ 228same name
    4. HughYau/pengsida-learning-research-skills★ 27same name
    5. 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
  1. Distinctive:

    Ask the user for input files, rows, cols.

    line 26
  2. Distinctive:

    Ask the user: "Detected X candidate labels.

    line 41

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

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

Figure Composer

Three-mode figure workflow: compose (from scratch), edit (modify existing), clean (PDF label removal).

Quick Dispatch

User saysModeEntry
compose / merge panels / multi-panelcomposescripts/compose.py
swap / replace panel, add / remove / modify labeleditscripts/replace_panel.py + scripts/manage_labels.py
clean PDF label / redact textcleanscripts/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> --list

Tell 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" --bold

Step 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

ScriptPurpose
scripts/compose.pyCompose multi-panel PPTX from scratch (grid layout + labels)
scripts/replace_panel.pyList / replace SVG panel media in existing PPTX
scripts/manage_labels.pyDetect / add / remove / modify PPTX overlay text labels
scripts/replace_pdf_label.pyDetect / 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

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.