Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Create, edit, and inspect PowerPoint presentations with professional design and automated visual QA
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
editing.md
1# Editing Presentations23## Template-Based Workflow45When using an existing presentation as a template:671. **Analyze existing slides**:8```bash9python scripts/thumbnail.py template.pptx10python -m markitdown template.pptx11```12Review `thumbnails.jpg` to see layouts, and markitdown output to see placeholder text.13142. **Plan slide mapping**: For each content section, choose a template slide.1516⚠️ **USE VARIED LAYOUTS** — monotonous presentations are a common failure mode. Don't default to basic title + bullet slides. Actively seek out:17- Multi-column layouts (2-column, 3-column)18- Image + text combinations19- Full-bleed images with text overlay20- Quote or callout slides21- Section dividers22- Stat/number callouts23- Icon grids or icon + text rows2425**Avoid:** Repeating the same text-heavy layout for every slide.2627Match content type to layout style (e.g., key points → bullet slide, team info → multi-column, testimonials → quote slide).28293. **Unpack**: `python scripts/office/unpack.py template.pptx unpacked/`30314. **Build presentation** (do this yourself, not with subagents):32- Delete unwanted slides (remove from `<p:sldIdLst>`)33- Duplicate slides you want to reuse (`add_slide.py`)34- Reorder slides in `<p:sldIdLst>`35- **Complete all structural changes before step 5**36375. **Edit content**: Update text in each `slide{N}.xml`.38**Use subagents here if available** — slides are separate XML files, so subagents can edit in parallel.39406. **Clean**: `python scripts/clean.py unpacked/`41427. **Pack**: `python scripts/office/pack.py unpacked/ output.pptx --original template.pptx`4344---4546## Scripts4748| Script | Purpose |49|--------|---------|50| `unpack.py` | Extract and pretty-print PPTX |51| `add_slide.py` | Duplicate slide or create from layout |52| `clean.py` | Remove orphaned files |53| `pack.py` | Repack with validation |54| `thumbnail.py` | Create visual grid of slides |5556### unpack.py5758```bash59python scripts/office/unpack.py input.pptx unpacked/60```6162Extracts PPTX, pretty-prints XML, escapes smart quotes.6364### add_slide.py6566```bash67python scripts/add_slide.py unpacked/ slide2.xml # Duplicate slide68python scripts/add_slide.py unpacked/ slideLayout2.xml # From layout69```7071Prints `<p:sldId>` to add to `<p:sldIdLst>` at desired position.7273### clean.py7475```bash76python scripts/clean.py unpacked/77```7879Removes slides not in `<p:sldIdLst>`, unreferenced media, orphaned rels.8081### pack.py8283```bash84python scripts/office/pack.py unpacked/ output.pptx --original input.pptx85```8687Validates, repairs, condenses XML, re-encodes smart quotes.8889### thumbnail.py9091```bash92python scripts/thumbnail.py input.pptx [output_prefix] [--cols N]93```9495Creates `thumbnails.jpg` with slide filenames as labels. Default 3 columns, max 12 per grid.9697**Use for template analysis only** (choosing layouts). For visual QA, use `soffice` + `pdftoppm` to create full-resolution individual slide images—see SKILL.md.9899---100101## Slide Operations102103Slide order is in `ppt/presentation.xml` → `<p:sldIdLst>`.104105**Reorder**: Rearrange `<p:sldId>` elements.106107**Delete**: Remove `<p:sldId>`, then run `clean.py`.108109**Add**: Use `add_slide.py`. Never manually copy slide files—the script handles notes references, Content_Types.xml, and relationship IDs that manual copying misses.110111---112113## Editing Content114115**Subagents:** If available, use them here (after completing step 4). Each slide is a separate XML file, so subagents can edit in parallel. In your prompt to subagents, include:116- The slide file path(s) to edit117- **"Use the Edit tool for all changes"**118- The formatting rules and common pitfalls below119120For each slide:1211. Read the slide's XML1222. Identify ALL placeholder content—text, images, charts, icons, captions1233. Replace each placeholder with final content124125**Use the Edit tool, not sed or Python scripts.** The Edit tool forces specificity about what to replace and where, yielding better reliability.126127### Formatting Rules128129- **Bold all headers, subheadings, and inline labels**: Use `b="1"` on `<a:rPr>`. This includes:130- Slide titles131- Section headers within a slide132- Inline labels like (e.g.: "Status:", "Description:") at the start of a line133- **Never use unicode bullets (•)**: Use proper list formatting with `<a:buChar>` or `<a:buAutoNum>`134- **Bullet consistency**: Let bullets inherit from the layout. Only specify `<a:buChar>` or `<a:buNone>`.135136---137138## Common Pitfalls139140### Template Adaptation141142When source content has fewer items than the template:143- **Remove excess elements entirely** (images, shapes, text boxes), don't just clear text144- Check for orphaned visuals after clearing text content145- Run visual QA to catch mismatched counts146147When replacing text with different length content:148- **Shorter replacements**: Usually safe149- **Longer replacements**: May overflow or wrap unexpectedly150- Test with visual QA after text changes151- Consider truncating or splitting content to fit the template's design constraints152153**Template slots ≠ Source items**: If template has 4 team members but source has 3 users, delete the 4th member's entire group (image + text boxes), not just the text.154155### Multi-Item Content156157If source has multiple items (numbered lists, multiple sections), create separate `<a:p>` elements for each — **never concatenate into one string**.158159**❌ WRONG** — all items in one paragraph:160```xml161<a:p>162<a:r><a:rPr .../><a:t>Step 1: Do the first thing. Step 2: Do the second thing.</a:t></a:r>163</a:p>164```165166**✅ CORRECT** — separate paragraphs with bold headers:167```xml168<a:p>169<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>170<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 1</a:t></a:r>171</a:p>172<a:p>173<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>174<a:r><a:rPr lang="en-US" sz="2799" .../><a:t>Do the first thing.</a:t></a:r>175</a:p>176<a:p>177<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>178<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 2</a:t></a:r>179</a:p>180<!-- continue pattern -->181```182183Copy `<a:pPr>` from the original paragraph to preserve line spacing. Use `b="1"` on headers.184185### Smart Quotes186187Handled automatically by unpack/pack. But the Edit tool converts smart quotes to ASCII.188189**When adding new text with quotes, use XML entities:**190191```xml192<a:t>the “Agreement”</a:t>193```194195| Character | Name | Unicode | XML Entity |196|-----------|------|---------|------------|197| `“` | Left double quote | U+201C | `“` |198| `”` | Right double quote | U+201D | `”` |199| `‘` | Left single quote | U+2018 | `‘` |200| `’` | Right single quote | U+2019 | `’` |201202### Other203204- **Whitespace**: Use `xml:space="preserve"` on `<a:t>` with leading/trailing spaces205- **XML parsing**: Use `defusedxml.minidom`, not `xml.etree.ElementTree` (corrupts namespaces)206