| name | pptx |
| description | Use for PowerPoint tasks where a .pptx deck is read, created, edited, reformatted, compared, or validated, including slide layouts, placeholders, theme styles, speaker notes, images, charts, and reference-format matching. |
PPTX Presentations
When To Use
Use this skill whenever the task touches a slide deck. The main challenge is
preserving slide layout and visual intent while making deterministic content or
formatting changes.
First Pass
- Generate a visual and textual inventory: slide count, titles, layouts,
placeholders, speaker notes, images, charts, and theme colors.
- If a reference deck exists, treat it as the source of truth for typography,
colors, spacing, and element placement.
- Decide whether to edit existing XML, use
python-pptx, or create from
scratch with pptxgenjs.
- Keep slide IDs and order stable unless the task asks for structural changes.
Implementation Patterns
Inspect Deck Text and Structure
A .pptx file is a ZIP archive. To audit content without extra tooling, unzip
and read the relevant XML directly:
unzip -p deck.pptx ppt/slides/slide1.xml | head -c 2000
unzip -l deck.pptx | grep -E '(slides|notesSlides|media)/'
Inspect ppt/slides/slide*.xml, ppt/notesSlides/, and the media
relationships under ppt/slides/_rels/ to map shapes to images.
Edit Existing Shapes
Use shape names, placeholder types, or text patterns rather than coordinates
alone. Coordinates are useful for validation but brittle for selecting content.
Assigning to shape.text collapses all runs in the text frame into one run and
discards per-run font, size, color, bold/italic. Edit at the run level instead
so the first run keeps its formatting:
from pptx import Presentation
prs = Presentation("input.pptx")
for slide in prs.slides:
for shape in slide.shapes:
if not shape.has_text_frame:
continue
for para in shape.text_frame.paragraphs:
full = "".join(r.text for r in para.runs)
if "{{TITLE}}" not in full:
continue
new_text = full.replace("{{TITLE}}", "Quarterly Results")
if para.runs:
para.runs[0].text = new_text
for run in para.runs[1:]:
run.text = ""
prs.save("output.pptx")
When replacing images, preserve crop, size, and z-order. When changing text,
preserve paragraph and run formatting unless the task asks for a new style.
Reference Formatting
For format-transfer tasks:
- compare title/body font family, size, color, bold/italic, alignment;
- compare fills, outlines, chart styles, and table banding;
- copy layout-level defaults before shape-level overrides;
- validate by reopening the saved deck and re-reading XML, not only by
eyeballing text.
Validation
- Reopen the saved deck and confirm slide count, order, expected text, and media.
- Re-read
ppt/slides/slide*.xml and compare against reference structure.
- Check that required placeholders were replaced and no template markers remain.
- For layout tasks, inspect coordinates and sizes for key shapes.
Common Failures
- Recreating slides and losing master/theme relationships.
- Editing visible text while leaving speaker notes or comments stale.
- Using
shape.text = ... and silently flattening runs / killing formatting.
- Matching content but missing reference formatting.
- Breaking image relationships when replacing media.