| name | pptx |
| description | Presentation creation, editing, and analysis. When Assistant needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks |
| license | Proprietary. LICENSE.txt has complete terms |
PPTX creation, editing, and analysis
Overview
Create, edit, or analyze the contents of .pptx files when requested. A .pptx file is essentially a ZIP archive containing XML files and other resources. Different tools and workflows are available for different tasks.
Reading and analyzing content
Text extraction
To read just the text content of a presentation, convert the document to markdown:
python -m markitdown path-to-file.pptx
Raw XML access
Use raw XML access for: comments, speaker notes, slide layouts, animations, design elements, and complex formatting. To access these features, unpack a presentation and read its raw XML contents.
Unpacking a file
python /mnt/skills/public/pptx/ooxml/scripts/unpack.py <office_file> <output_dir>
Key file structures
ppt/presentation.xml - Main presentation metadata and slide references
ppt/slides/slide{N}.xml - Individual slide contents (slide1.xml, slide2.xml, etc.)
ppt/notesSlides/notesSlide{N}.xml - Speaker notes for each slide
ppt/comments/modernComment_*.xml - Comments for specific slides
ppt/slideLayouts/ - Layout templates for slides
ppt/slideMasters/ - Master slide templates
ppt/theme/ - Theme and styling information
ppt/media/ - Images and other media files
Typography and color extraction
To emulate example designs, analyze the presentation's typography and colors first using the methods below:
- Read theme file: Check
ppt/theme/theme1.xml for colors (<a:clrScheme>) and fonts (<a:fontScheme>)
- Sample slide content: Examine
ppt/slides/slide1.xml for actual font usage (<a:rPr>) and colors
- Search for patterns: Use grep to find color (
<a:solidFill>, <a:srgbClr>) and font references across all XML files
Creating a new PowerPoint presentation without a template
When creating a new PowerPoint presentation from scratch, use the html2pptx workflow to convert HTML slides to PowerPoint with accurate positioning.
IMPORTANT: html2pptx is a JavaScript LIBRARY, not a CLI tool. You MUST create a .js script with import { html2pptx } and run it with node script.js. Do NOT run html2pptx, npx html2pptx, or create config.json files — html2pptx has no CLI interface.
Workflow
-
MANDATORY - READ ENTIRE FILE NOW: Read html2pptx.md completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with presentation creation.
-
PREREQUISITE - Install html2pptx library:
- Check and install if needed:
npm list -g @ant/html2pptx || npm install -g skills/pptx/html2pptx.tgz
- Note: If you see "Cannot find module '@ant/html2pptx'" error later, the package isn't installed
-
CRITICAL: Plan the presentation
- Plan the shared aspects of the presentation. Describe the tone of the presentation's content and the colors and typography that should be used in the presentation.
- Write a DETAILED outline of the presentation
- For each slide, describe the slide's layout and contents
- For each slide, write presenter notes (1 to 3 sentences per slide)
-
CRITICAL: Set CSS variables
- In a shared
.css file, override CSS variables to use on each slide for colors, typography, and spacing. DO NOT create classes in this file.
-
Create an HTML file for each slide with proper dimensions (e.g., 960px × 540px for 16:9)
- Recall the outline, layout/content description, and speaker notes you wrote for this slide in Step 3. Think out loud how to best apply them to this slide.
- Embed the contents of the shared
.css file in a <style> element
- Use
<p>, <h1>-<h6>, <ul>, <ol> for all text content
- IMPORTANT: Use CSS variables for colors, typography, and spacing
- IMPORTANT: Use
row col and fit classes for layout INSTEAD OF flexbox
- Use
class="placeholder" for areas where charts/tables will be added (render with gray background for visibility)
- CSS gradients: Use
linear-gradient() or radial-gradient() in CSS on block element backgrounds - automatically converted to PowerPoint
Editing an existing PowerPoint presentation
To edit slides in an existing PowerPoint presentation, work with the raw Office Open XML (OOXML) format. This involves unpacking the .pptx file, editing the XML content, and repacking it.
Workflow
- MANDATORY - READ ENTIRE FILE: Read
ooxml.md (~500 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed guidance on OOXML structure and editing workflows before any presentation editing.
- Unpack the presentation:
python /mnt/skills/public/pptx/ooxml/scripts/unpack.py <office_file> <output_dir>
- Edit the XML files (primarily
ppt/slides/slide{N}.xml and related files)
- CRITICAL: Validate immediately after each edit and fix any validation errors before proceeding:
python /mnt/skills/public/pptx/ooxml/scripts/validate.py <dir> --original <file>
- Pack the final presentation:
python /mnt/skills/public/pptx/ooxml/scripts/pack.py <input_directory> <office_file>
Creating a new PowerPoint presentation using a template
To create a presentation that follows an existing template's design, duplicate and re-arrange template slides before replacing placeholder content.
Workflow
-
Extract template text AND create visual thumbnail grid:
- Extract text:
python -m markitdown template.pptx > template-content.md
- Read
template-content.md: Read the entire file to understand the contents of the template presentation. NEVER set any range limits when reading this file.
- Create thumbnail grids:
python /mnt/skills/public/pptx/scripts/thumbnail.py template.pptx
- See Creating Thumbnail Grids section for more details
-
Analyze template and save inventory to a file:
-
Visual Analysis: Review thumbnail grid(s) to understand slide layouts, design patterns, and visual structure
-
Create and save a template inventory file at template-inventory.md containing:
# Template Inventory Analysis
**Total Slides: [count]**
**IMPORTANT: Slides are 0-indexed (first slide = 0, last slide = count-1)**
## [Category Name]
- Slide 0: [Layout code if available] - Description/purpose
- Slide 1: [Layout code] - Description/purpose
- Slide 2: [Layout code] - Description/purpose
[... EVERY slide must be listed individually with its index ...]
-
Using the thumbnail grid: Reference the visual thumbnails to identify:
- Layout patterns (title slides, content layouts, section dividers)
- Image placeholder locations and counts
- Design consistency across slide groups
- Visual hierarchy and structure
-
This inventory file is REQUIRED for selecting appropriate templates in the next step
-
Create presentation outline based on template inventory:
- Review available templates from step 2.
- Choose an intro or title template for the first slide. This should be one of the first templates.
- Choose safe, text-based layouts for the other slides.
- CRITICAL: Match layout structure to actual content:
- Single-column layouts: Use for unified narrative or single topic
- Two-column layouts: Use ONLY when there are exactly 2 distinct items/concepts
Creating Thumbnail Grids
To create visual thumbnail grids of PowerPoint slides for quick analysis and reference:
python /mnt/skills/public/pptx/scripts/thumbnail.py template.pptx [output_prefix]
Features:
- Creates:
thumbnails.jpg (or thumbnails-1.jpg, thumbnails-2.jpg, etc. for large decks)
- Default: 5 columns, max 30 slides per grid (5×6)
- Custom prefix:
python /mnt/skills/public/pptx/scripts/thumbnail.py template.pptx my-grid
- Note: The output prefix should include the path if you want output in a specific directory (e.g.,
workspace/my-grid)
- Adjust columns:
--cols 4 (range: 3-6, affects slides per grid)
- Grid limits: 3 cols = 12 slides/grid, 4 cols = 20, 5 cols = 30, 6 cols = 42
- Slides are zero-indexed (Slide 0, Slide 1, etc.)
Use cases:
- Template analysis: Quickly understand slide layouts and design patterns
- Content review: Visual overview of entire presentation
- Navigation reference: Find specific slides by their visual appearance
- Quality check: Verify all slides are properly formatted
Examples:
python /mnt/skills/public/pptx/scripts/thumbnail.py presentation.pptx
python /mnt/skills/public/pptx/scripts/thumbnail.py template.pptx analysis --cols 4
Converting Slides to Images
To visually analyze PowerPoint slides, convert them to images using a two-step process:
-
Convert PPTX to PDF:
soffice --headless --convert-to pdf template.pptx
-
Convert PDF pages to JPEG images:
pdftoppm -jpeg -r 150 template.pdf slide
This creates files like slide-1.jpg, slide-2.jpg, etc.
Options:
-r 150: Sets resolution to 150 DPI (adjust for quality/size balance)
-jpeg: Output JPEG format (use -png for PNG if preferred)
-f N: First page to convert (e.g., -f 2 starts from page 2)
-l N: Last page to convert (e.g., -l 5 stops at page 5)
slide: Prefix for output files
Example for specific range:
pdftoppm -jpeg -r 150 -f 2 -l 5 template.pdf slide
Design Guidelines (MANDATORY)
Every presentation must have intentional visual design. Never create unstyled slides.
- Analyze the topic first: What colors, mood, and tone fit the subject?
- Choose a color palette: Select 2-3 colors that match the content. Reference
css.md for available CSS variables.
- Use consistent typography: Headings in bold/larger size, body in regular weight. Stick to web-safe fonts.
- Apply visual hierarchy: Use size, weight, color, and spacing to guide the reader's eye.
- Keep slides concise: 3-5 bullet points max, 1-2 sentence paragraphs. This is a presentation, not a report.
Example CSS override for a tech presentation:
:root {
--color-primary: #2563eb;
--color-surface: #0f172a;
--color-surface-foreground: #f8fafc;
--font-family-display: 'Trebuchet MS', sans-serif;
}
For brand-specific presentations, ask the user for brand colors/fonts and apply them as CSS variable overrides.
Code Style Guidelines
IMPORTANT: When generating code for PPTX operations:
- Write concise code
- Avoid verbose variable names and redundant operations
- Avoid unnecessary print statements
Dependencies
Required dependencies (should already be installed):
- markitdown:
pip install "markitdown[pptx]" (for text extraction from presentations)
- pptxgenjs:
npm install -g pptxgenjs (for creating presentations via html2pptx)
- playwright:
npm install -g playwright (for HTML rendering in html2pptx)
- react-icons:
npm install -g react-icons react react-dom (for icons in SVG format)
- LibreOffice:
sudo apt-get install libreoffice (for PDF conversion)
- Poppler:
sudo apt-get install poppler-utils (for pdftoppm to convert PDF to images)
- defusedxml:
pip install defusedxml (for secure XML parsing)