| name | pptx |
| description | Presentation creation, editing, and analysis. When Claude 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.
CRITICAL: Read All Documentation First
Before starting any presentation task, read ALL relevant documentation files completely to understand the full workflow:
- For creating new presentations: Read
html2pptx.md and css.md in their entirety
- For editing existing presentations: Read
ooxml.md in its entirety
- For template-based creation: Read the relevant sections of this file plus
css.md
NEVER set any range limits when reading these files. Understanding the complete workflow, constraints, and best practices before starting is essential for producing high-quality presentations. Partial knowledge leads to errors, inconsistent styling, and visual defects that require rework.
Reading and analyzing content
Text extraction
To read just the text content of a presentation, convert the document to markdown:
python3 -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
python3 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.
Workflow
-
Read documentation: Read html2pptx.md and css.md completely (see "CRITICAL: Read All Documentation First" section above)
-
PREREQUISITE - Extract html2pptx library:
- Extract the library next to your script:
mkdir -p html2pptx && tar -xzf html2pptx.tgz -C html2pptx
- This creates a
html2pptx/ directory with the library files and CLI binaries
-
Plan the presentation: Follow html2pptx.md "Design Philosophy" section for:
- Aesthetic direction and bold design choices
- Color palette selection (see "Creating your color palette")
- Typography strategy
- Write DETAILED outline with slide layouts and presenter notes (1-3 sentences per slide)
-
Set CSS variables: Override CSS variables in a shared .css file for colors, typography, and spacing (see css.md "Design System Variables")
-
Create HTML slides (960px × 540px for 16:9): Follow html2pptx.md for:
- Slide layout zones (title, content, footnote)
- Critical text rules (proper HTML tags)
- Supported elements and styling
-
Create and run a JavaScript file using the html2pptx library to convert HTML slides to PowerPoint and save the presentation
-
Run with: NODE_PATH="$(npm root -g)" node your-script.js 2>&1
-
Use the html2pptx function to process each HTML file
-
Add charts and tables to placeholder areas using PptxGenJS API
-
Save the presentation using pptx.writeFile()
-
⚠️ CRITICAL: Your script MUST follow this example structure. Think aloud before writing the script to make sure that you correctly use the APIs. Do NOT call pptx.addSlide.
const pptxgen = require("pptxgenjs");
const { html2pptx } = require("./html2pptx");
pptx = ();
pptx. = ;
(, pptx);
{ : slide2, placeholders } = (, pptx);
slide.(pptx.., chartData, placeholders[]);
pptx.();
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
- Read documentation: Read
ooxml.md completely (see "CRITICAL: Read All Documentation First" section above)
- Unpack the presentation:
python3 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:
python3 ooxml/scripts/validate.py <dir> --original <file>
- Pack the final presentation:
python3 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:
python3 -m markitdown template.pptx > template-content.md
- Read
template-content.md completely to understand the template contents
- Create thumbnail grids:
python3 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
- Three-column layouts: Use ONLY when there are exactly 3 distinct items/concepts
Creating Thumbnail Grids
To create visual thumbnail grids of PowerPoint slides for quick analysis and reference:
python3 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:
python3 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:
python3 scripts/thumbnail.py presentation.pptx
python3 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
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:
pip3 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: For PDF conversion (required for visual validation step)
- macOS:
brew install --cask libreoffice
- Linux:
sudo apt-get install libreoffice
- Poppler:
sudo apt-get install poppler-utils (for pdftoppm to convert PDF to images)
- defusedxml:
pip3 install defusedxml (for secure XML parsing)