| name | creating-presentations |
| description | Processes PowerPoint presentation files (.pptx). Creates slides, rewrites templates, converts HTML to presentations, validates thumbnails, swaps layouts, and performs deep OOXML editing. Use when working with presentation files or slide decks. Do NOT use for Word documents, spreadsheets, or PDF files. |
| user-invocable | false |
| allowed-tools | Bash, Read, Write, Edit, Glob |
| argument-hint | <file.pptx | task> |
PPTX Processing
.pptx is a ZIP archive of XML and resources. Choose workflow by intent.
Workflow Decision
Iron Rules
- Color choice is design โ see palettes.md, state your approach BEFORE code.
- Web-safe fonts only โ Arial, Helvetica, Times New Roman, Georgia, Courier New, Verdana, Tahoma, Trebuchet MS, Impact.
- Layout matches content count โ 2 items โ 2 columns; 3 โ 3; never force.
- Validate visually โ always generate thumbnails after creation, inspect for cutoff/overlap/contrast.
Create New (without template) โ html2pptx
- MANDATORY โ READ ENTIRE FILE:
html2pptx.md. NEVER set range limits.
- Create HTML per slide (e.g., 720pt ร 405pt for 16:9)
- Use
<p>, <h1>โ<h6>, <ul>, <ol>
class="placeholder" for chart/table areas (gray bg for visibility)
- CRITICAL: Rasterize gradients & icons as PNG via Sharp first, then reference in HTML
- Use full-slide or two-column layout for charts/tables โ never vertical stack
- Run
scripts/html2pptx.js to convert
html2pptx() per HTML file
- Charts/tables via PptxGenJS API on placeholders
pptx.writeFile() to save
- Visual validation โ
python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4
- Inspect for: text cutoff, overlap, positioning, contrast
- Adjust HTML margins/spacing/colors, regenerate, repeat
Create with Template
See template-workflow.md for full 7-step workflow (extract โ inventory โ outline โ rearrange โ inventory text โ generate replacements โ apply).
Edit Existing Presentation
- MANDATORY โ READ ENTIRE FILE:
ooxml.md (~500 lines). NEVER set range limits.
python ooxml/scripts/unpack.py <file> <dir>
- Edit XML (primarily
ppt/slides/slide{N}.xml)
- CRITICAL โ validate after each edit:
python ooxml/scripts/validate.py <dir> --original <file>
python ooxml/scripts/pack.py <dir> <file>
Code Style
Concise code, no verbose names, no unnecessary print statements.
Dependencies
| Package | Install | Purpose |
|---|
| markitdown | pip install "markitdown[pptx]" | Text extraction |
| pptxgenjs | npm i -g pptxgenjs | Create via html2pptx |
| playwright | npm i -g playwright | HTML rendering |
| react-icons | npm i -g react-icons react react-dom | Icons |
| sharp | npm i -g sharp | SVG rasterization |
| LibreOffice | apt install libreoffice | PDF conversion |
| Poppler | apt install poppler-utils | pdftoppm |
| defusedxml | pip install defusedxml | Secure XML |