powerpoint

/home/avalon/.hermes/skills/productivity/powerpoint/SKILL.md · raw

Powerpoint Skill

Create, read, and edit PowerPoint decks — from-scratch generation with pptxgenjs, template-based editing via direct XML manipulation, speaker notes, charts, and design QA. A .pptx is a ZIP archive of XML files.

When to Use

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both: creating slide decks, pitch decks, or presentations; reading or extracting text from any .pptx; editing existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx/.potx filename.

Prerequisites

npm ls pptxgenjs --depth=0 2>/dev/null | grep -q pptxgenjs || npm install pptxgenjs
pip install "markitdown[pptx]" Pillow defusedxml lxml
which soffice || sudo apt install -y libreoffice     # rendering/QA
which pdftoppm || sudo apt install -y poppler-utils  # PDF → images

macOS: brew install libreoffice poppler. Icons in generated decks additionally use react-icons react react-dom sharp (npm).

Quick Reference

Task Approach
Create a new deck Write a pptxgenjs script — see gotchas below
Edit an existing deck, or build from a template unzip → edit ppt/slides/slideN.xml → zip
Read content markitdown deck.pptx (one block per slide under <!-- Slide number: N --> markers); visual grid: python scripts/thumbnail.py deck.pptx

Scripts

Paths are relative to this skill's directory. Everything else is plain Python, node, or shell.

Script What it does
scripts/thumbnail.py deck.pptx [prefix] Labeled grid of every slide, for picking template layouts. .pptx only. Pass prefix — it defaults to thumbnails, which overwrites the grids of any other deck done in the same directory
scripts/add_slide.py unpacked/ slide2.xml [--after slideN.xml] Duplicate a slide (or a slideLayoutN.xml) with all the package bookkeeping. Also takes a .pptx directly with -o out.pptx
scripts/clean.py unpacked/ Delete slides, media, and rels no longer referenced. Run after <p:sldIdLst> is final
scripts/office/validate.py deck.pptx [--original src.pptx] Schema, relationship, content-type, chart and slide checks; each failure names its fix. Pass --original for any template-derived deck — it baselines the schema checks against the template, so the template's own XSD errors don't read as yours
scripts/office/soffice.py --headless --convert-to pdf deck.pptx LibreOffice wrapper — bare soffice hangs in sandboxed environments

Creating with pptxgenjs — gotchas

Write the script and require('pptxgenjs'). The model knows the API; these are the footguns:

Editing existing decks and templates

Pick layouts first: python scripts/thumbnail.py template.pptx template-thumbs writes a labeled grid of every slide and prints the file(s) it created — template-thumbs.jpg, split into template-thumbs-N.jpg past 12 slides. Always pass that second argument, named after the deck. It defaults to thumbnails, so two decks thumbnailed in one directory silently overwrite each other's grids (template analysis only — visual QA needs the full-resolution renders from Converting to Images; it only accepts .pptx, so copy a .potx to a .pptx name first). Use it with markitdown to map each content section onto a template slide, and vary the layouts — don't put every section on the same title-and-bullets slide.

python3 -c "import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall('unpacked')" deck.pptx
python scripts/add_slide.py unpacked/ slide2.xml --after slide2.xml   # duplicate a slide (or slideLayoutN.xml); prints the new slide's path
# reorder / delete slides = edit <p:sldIdLst> in ppt/presentation.xml
python scripts/clean.py unpacked/                                     # after deletions: removes orphaned slides, media, rels
# edit slide content in ppt/slides/slideN.xml
(cd unpacked && rm -f ../out.pptx && zip -Xr ../out.pptx .)           # zip from INSIDE the dir; rm first or deleted parts survive
python scripts/office/validate.py out.pptx --original deck.pptx

When filling in a template:

Design Ideas

Don't create boring slides. Plain bullets on a white background won't impress anyone. Consider ideas from this list for each slide.

Before Starting

Color Palettes

Choose colors that match your topic — don't default to generic blue. Use these palettes as inspiration:

Theme Primary Secondary Accent
Midnight Executive 1E2761 (navy) CADCFC (ice blue) FFFFFF (white)
Forest & Moss 2C5F2D (forest) 97BC62 (moss) F5F5F5 (cream)
Coral Energy F96167 (coral) F9E795 (gold) 2F3C7E (navy)
Warm Terracotta B85042 (terracotta) E7E8D1 (sand) A7BEAE (sage)
Ocean Gradient 065A82 (deep blue) 1C7293 (teal) 21295C (midnight)
Charcoal Minimal 36454F (charcoal) F2F2F2 (off-white) 212121 (black)
Teal Trust 028090 (teal) 00A896 (seafoam) 02C39A (mint)
Berry & Cream 6D2E46 (berry) A26769 (dusty rose) ECE2D0 (cream)
Sage Calm 84B59F (sage) 69A297 (eucalyptus) 50808E (slate)
Cherry Bold 990011 (cherry) FCF6F5 (off-white) 2F3C7E (navy)

For Each Slide

Every slide needs a visual element — image, chart, icon, or shape. Text-only slides are forgettable.

Layout options: - Two-column (text left, illustration on right) - Icon + text rows (icon in colored circle, bold header, description below) - 2x2 or 2x3 grid (image on one side, grid of content blocks on other) - Half-bleed image (full left or right side) with content overlay

Data display: - Large stat callouts (big numbers 60-72pt with small labels below) - Comparison columns (before/after, pros/cons, side-by-side options) - Timeline or process flow (numbered steps, arrows)

Visual polish: - Icons in small colored circles next to section headers - Italic accent text for key stats or taglines

Typography

Font names you write into the .pptx are rendered by the user's PowerPoint, not by this environment. Your visual QA renders via LibreOffice, which substitutes fonts it doesn't have — and for some fonts the substitute has different widths, so your QA preview can show text overflow (or fit) that the real deck won't have. To keep your QA trustworthy:

Element Size
Slide title 36-44pt bold
Section header 20-24pt bold
Body text 14-16pt
Captions 10-12pt muted

Spacing

Avoid (Common Mistakes)

QA (Required)

Your first render usually has a few real issues — overlaps, overflow, misalignment. Find and fix those, re-render only the slides you changed, and stop.

Content QA

markitdown output.pptx

Check for missing content, typos, wrong order.

When using templates, check for leftover placeholder text:

markitdown output.pptx | grep -iE "\bx{3,}\b|lorem|ipsum|\bTODO|\[insert|this.*(page|slide).*layout"

If grep returns results, fix them before declaring success.

File QA (required)

python scripts/office/validate.py output.pptx                      # built from scratch
python scripts/office/validate.py output.pptx --original src.pptx  # built from a template

If the deck came from a template, always pass --original. A template may itself contain parts the XSD rejects, so a bare run can report failures you never caused — and a genuine regression can hide among them. --original baselines the schema and slide checks against the template. The structural checks — relationships, content types, charts — ignore --original and report template-inherited problems either way, so read those on their own merits.

pptxgenjs emits chart XML PowerPoint refuses to open, and every other tool accepts: python-pptx opens those decks, LibreOffice renders them, the XSD passes them. Every failure names its fix. Fix it in the generator and rebuild.

Visual QA

Convert the slides to images (see Converting to Images) and inspect every one with vision_analyze. After staring at the generating code you tend to see what you expect rather than what rendered, so look at the images fresh (a delegate_task subagent works well for this). User-visible defects to look for:

Converting to Images

Convert presentations to individual slide images for visual inspection:

python scripts/office/soffice.py --headless --convert-to pdf output.pptx
rm -f slide-*.jpg
pdftoppm -jpeg -r 150 output.pdf slide
ls -1 "$PWD"/slide-*.jpg

Pass the absolute paths printed above directly to vision_analyze. The rm clears stale images from prior runs. pdftoppm zero-pads based on page count: slide-1.jpg for decks under 10 pages, slide-01.jpg for 10-99, slide-001.jpg for 100+.

After fixes, rerun all four commands above — the PDF must be regenerated from the edited .pptx before pdftoppm can reflect your changes.

docx (Word documents), xlsx (spreadsheets), pdf (PDF work), optional pptx-author (finance-grade model-backed decks).