PPTX creation, editing, and analysis
Creating from Topic (Content-First)
For generating complete decks from a topic, document, or brief, use the content-first workflow built on the Pyramid Principle (conclusion, reasons, evidence):
- Intake: Use questionnaire at
references/content-workflow/INTAKE.md
- Follow 9-stage workflow:
references/content-workflow/WORKFLOW.md
- Score with rubric (must reach 75+):
references/content-workflow/RUBRIC.md
Content-First Reference Files
| File |
Purpose |
INTAKE.md |
Questionnaire to gather requirements |
WORKFLOW.md |
9-stage content generation process |
TEMPLATES.md |
Slide layout templates |
VIS-GUIDE.md |
Chart and visualisation selection |
STYLE-GUIDE.md |
WCAG 2.1 AA compliance, typography |
RUBRIC.md |
Quality scoring (10 dimensions, 75+ to pass) |
CHECKLIST.md |
Pre-delivery verification |
ORCHESTRATION_OVERVIEW.md |
High-level orchestration map across the 9 stages |
ORCHESTRATION_PPTX.md |
Slide-build orchestration (HTML, layout, packaging) |
ORCHESTRATION_DATA_CHARTS.md |
Chart and data-visual orchestration (chartkit) |
EXAMPLES.md |
Sample presentations |
Chart Generation
For data-driven charts, use chartkit:
Supported chart types: line, area, bar, barh, scatter, hist, waterfall
Reading and analysing content
Text extraction
To read text contents, convert the document to markdown:
Raw XML access
Raw XML access is needed for: comments, speaker notes, slide layouts, animations, design elements, and complex formatting. Unpack the presentation and read its raw XML contents.
Note: The unpack.py script is at skills/pptx/ooxml/scripts/unpack.py relative to the project root. If the script is not at this path, use find . -name "unpack.py" to locate it.
Typography and colour extraction
When given an example design to emulate: Analyse the presentation's typography and colours first:
- Read theme file: Check
ppt/theme/theme1.xml for colours (<a:clrScheme>) and fonts (<a:fontScheme>)
- Sample slide content: Examine
ppt/slides/slide1.xml for actual font usage (<a:rPr>) and colours
- Search for patterns: Use grep to find colour (
<a:solidFill>, <a:srgbClr>) and font references across all XML files
Creating a new presentation without a template
Use the html2pptx workflow to convert HTML slides to PowerPoint with accurate positioning.
Design Approach
Before creating any presentation, analyse the content and choose appropriate design elements:
- Identify the subject matter: What is this presentation about? What tone, industry, or mood does it suggest?
- Check for branding: If the user mentions a company or organisation, use their brand colours and identity
- Match palette to content: Select colours that reflect the subject
- State your approach: Explain your design choices before writing code
Requirements:
- State your content-informed design approach before writing code
- Use web-safe fonts only: Arial, Helvetica, Times New Roman, Georgia, Courier New, Verdana, Tahoma, Trebuchet MS, Impact
- Create clear visual hierarchy through size, weight, and colour
- Check readability: WCAG 2.1 AA contrast (>= 4.5:1 for body, >= 3:1 for large text), body text >= 18pt, headings >= 28pt, clean alignment
- Repeat patterns, spacing, and visual language across slides
Design Resources
For colour palettes and visual design elements, read:
references/color-palettes.md - 18 curated colour schemes
references/design-elements.md - Geometric patterns, typography, layouts
Layout Tips
When creating slides with charts or tables:
- Two-column layout (preferred): Use a header spanning the full width, then two columns below -- text/bullets in one column and the featured content in the other. Use flexbox with unequal column widths (e.g., 40%/60% split)
- Full-slide layout: Let the featured content take up the entire slide for maximum readability
- Do not vertically stack: Do not place charts/tables below text in a single column -- this causes poor readability and layout issues
Workflow
- Read
references/html2pptx-guide.md completely from start to finish before proceeding
- Create an HTML file for each slide with proper dimensions (e.g., 720pt x 405pt for 16:9)
- Use
<p>, <h1>-<h6>, <ul>, <ol> for all text content
- Use
class="placeholder" for areas where charts/tables will be added (render with grey background for visibility)
- Rasterise gradients and icons as PNG images first using Sharp, then reference in HTML
- For slides with charts/tables/images, use either full-slide layout or two-column layout
- Create and run a JavaScript file using the
html2pptx.js library to convert HTML slides to PowerPoint and save the presentation
- 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()
- Visual validation: Generate thumbnails and inspect for layout issues
Editing an existing presentation
Work with the raw Office Open XML (OOXML) format: unpack the .pptx file, edit the XML content, and repack it.
Workflow
- Read
references/ooxml-reference.md (~500 lines) completely from start to finish before any editing
- Unpack the presentation:
- Edit the XML files (primarily
ppt/slides/slide{N}.xml and related files)
- Validate immediately after each edit:
- Pack the final presentation:
Creating a presentation using a template
Read references/template-workflow.md completely from start to finish. It covers the full 7-step process:
- Extract template text and create visual thumbnail grid
- Analyse template and save inventory to a file
- Create presentation outline based on template inventory
- Duplicate, reorder, and delete slides using
rearrange.py
- Extract all text using
inventory.py
- Generate replacement text and save to JSON
- Apply replacements using
replace.py
Creating Thumbnail Grids
Features:
- Creates:
thumbnails.jpg (or thumbnails-1.jpg, thumbnails-2.jpg, etc. for large decks)
- Default: 5 columns, max 30 slides per grid (5x6)
- Custom prefix:
python 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
Combine options: custom name, columns
python scripts/thumbnail.py template.pptx analysis --cols 4
</example>
## Converting Slides to Individual Images
For cases where you need individual slide images rather than a grid:
<example>
```bash
# Step 1: Convert PPTX to PDF
soffice --headless --convert-to pdf template.pptx
# Step 2: Convert PDF pages to JPEG images
pdftoppm -jpeg -r 150 template.pdf slide
Creates: slide-1.jpg, slide-2.jpg, etc.
Options: -r 150 (DPI), -jpeg or -png (format), -f N -l N (page range)
Code Style Guidelines
When generating code for PPTX operations, write concise code. Avoid verbose variable names, redundant operations, and unnecessary print statements.
Dependencies
Required dependencies (should already be installed):
| Package |
Install (pip) |
Install (npm) |
Purpose |
| markitdown |
pip install "markitdown[pptx]" |
-- |
Text extraction from presentations |
| pptxgenjs |
-- |
npm install -g pptxgenjs |
Creating presentations via html2pptx |
| playwright |
-- |
npm install -g playwright |
HTML rendering in html2pptx |
| react-icons |
-- |
npm install -g react-icons react react-dom |
Icons |
| sharp |
-- |
npm install -g sharp |
SVG rasterisation and image processing |
| defusedxml |
pip install defusedxml |
-- |
Secure XML parsing |
| LibreOffice |
System package: brew install libreoffice (macOS) or apt-get install libreoffice (Linux) |
-- |
PDF conversion |
| Poppler |
System package: brew install poppler (macOS) or apt-get install poppler-utils (Linux) |
-- |
PDF to image conversion via pdftoppm |
1---2name: pptx3description: "Creates, edits, and analyses PowerPoint presentations with layouts, speaker notes, and design elements. Use when working with .pptx files, creating presentations from topics, modifying slides, or extracting content. Triggers: 'create presentation from topic', 'slide deck from document', 'powerpoint from scratch'."4license: MIT5context: fork6---78# PPTX creation, editing, and analysis910<context>11A .pptx file is a ZIP archive containing XML files and other resources. This skill provides different workflows for creating, editing, and analysing presentations.12</context>1314## Creating from Topic (Content-First)1516For generating complete decks from a topic, document, or brief, use the content-first workflow built on the **Pyramid Principle** (conclusion, reasons, evidence):17181. **Intake**: Use questionnaire at `references/content-workflow/INTAKE.md`192. **Follow 9-stage workflow**: `references/content-workflow/WORKFLOW.md`203. **Score with rubric** (must reach 75+): `references/content-workflow/RUBRIC.md`2122### Content-First Reference Files2324| File | Purpose |25|------|---------|26| `INTAKE.md` | Questionnaire to gather requirements |27| `WORKFLOW.md` | 9-stage content generation process |28| `TEMPLATES.md` | Slide layout templates |29| `VIS-GUIDE.md` | Chart and visualisation selection |30| `STYLE-GUIDE.md` | WCAG 2.1 AA compliance, typography |31| `RUBRIC.md` | Quality scoring (10 dimensions, 75+ to pass) |32| `CHECKLIST.md` | Pre-delivery verification |33| `ORCHESTRATION_OVERVIEW.md` | High-level orchestration map across the 9 stages |34| `ORCHESTRATION_PPTX.md` | Slide-build orchestration (HTML, layout, packaging) |35| `ORCHESTRATION_DATA_CHARTS.md` | Chart and data-visual orchestration (chartkit) |36| `EXAMPLES.md` | Sample presentations |3738### Chart Generation3940For data-driven charts, use chartkit:4142<example>43```bash44python scripts/chartkit.py \45 --data data.csv \46 --type line \47 --x date \48 --y sales profit \49 --out output/assets \50 --filename kpi_trend.png \51 --title "Monthly KPIs"52```53Creates: `kpi_trend.png` line chart in output/assets54</example>5556Supported chart types: `line`, `area`, `bar`, `barh`, `scatter`, `hist`, `waterfall`5758## Reading and analysing content5960### Text extraction6162To read text contents, convert the document to markdown:6364<example>65```bash66python -m markitdown path-to-file.pptx67```68Outputs: Markdown text content from all slides69</example>7071### Raw XML access7273Raw XML access is needed for: comments, speaker notes, slide layouts, animations, design elements, and complex formatting. Unpack the presentation and read its raw XML contents.7475<example>76```bash77python ooxml/scripts/unpack.py presentation.pptx unpacked/78```79Creates: Directory with extracted XML files and media80</example>8182**Note**: The unpack.py script is at `skills/pptx/ooxml/scripts/unpack.py` relative to the project root. If the script is not at this path, use `find . -name "unpack.py"` to locate it.8384<context>85#### Key file structures86* `ppt/presentation.xml` - Main presentation metadata and slide references87* `ppt/slides/slide{N}.xml` - Individual slide contents (slide1.xml, slide2.xml, etc.)88* `ppt/notesSlides/notesSlide{N}.xml` - Speaker notes for each slide89* `ppt/comments/modernComment_*.xml` - Comments for specific slides90* `ppt/slideLayouts/` - Layout templates for slides91* `ppt/slideMasters/` - Master slide templates92* `ppt/theme/` - Theme and styling information93* `ppt/media/` - Images and other media files94</context>9596#### Typography and colour extraction9798**When given an example design to emulate**: Analyse the presentation's typography and colours first:991001. **Read theme file**: Check `ppt/theme/theme1.xml` for colours (`<a:clrScheme>`) and fonts (`<a:fontScheme>`)1012. **Sample slide content**: Examine `ppt/slides/slide1.xml` for actual font usage (`<a:rPr>`) and colours1023. **Search for patterns**: Use grep to find colour (`<a:solidFill>`, `<a:srgbClr>`) and font references across all XML files103104## Creating a new presentation without a template105106<instructions>107108Use the **html2pptx** workflow to convert HTML slides to PowerPoint with accurate positioning.109110### Design Approach111112Before creating any presentation, analyse the content and choose appropriate design elements:1131141. **Identify the subject matter**: What is this presentation about? What tone, industry, or mood does it suggest?1152. **Check for branding**: If the user mentions a company or organisation, use their brand colours and identity1163. **Match palette to content**: Select colours that reflect the subject1174. **State your approach**: Explain your design choices before writing code118119**Requirements**:120- State your content-informed design approach before writing code121- Use web-safe fonts only: Arial, Helvetica, Times New Roman, Georgia, Courier New, Verdana, Tahoma, Trebuchet MS, Impact122- Create clear visual hierarchy through size, weight, and colour123- Check readability: WCAG 2.1 AA contrast (>= 4.5:1 for body, >= 3:1 for large text), body text >= 18pt, headings >= 28pt, clean alignment124- Repeat patterns, spacing, and visual language across slides125126#### Design Resources127128For colour palettes and visual design elements, read:129- `references/color-palettes.md` - 18 curated colour schemes130- `references/design-elements.md` - Geometric patterns, typography, layouts131132### Layout Tips133134**When creating slides with charts or tables:**135- **Two-column layout (preferred)**: Use a header spanning the full width, then two columns below -- text/bullets in one column and the featured content in the other. Use flexbox with unequal column widths (e.g., 40%/60% split)136- **Full-slide layout**: Let the featured content take up the entire slide for maximum readability137- **Do not vertically stack**: Do not place charts/tables below text in a single column -- this causes poor readability and layout issues138139### Workflow1401411. Read [`references/html2pptx-guide.md`](references/html2pptx-guide.md) completely from start to finish before proceeding1422. Create an HTML file for each slide with proper dimensions (e.g., 720pt x 405pt for 16:9)143 - Use `<p>`, `<h1>`-`<h6>`, `<ul>`, `<ol>` for all text content144 - Use `class="placeholder"` for areas where charts/tables will be added (render with grey background for visibility)145 - Rasterise gradients and icons as PNG images first using Sharp, then reference in HTML146 - For slides with charts/tables/images, use either full-slide layout or two-column layout1473. Create and run a JavaScript file using the [`html2pptx.js`](scripts/html2pptx.js) library to convert HTML slides to PowerPoint and save the presentation148 - Use the `html2pptx()` function to process each HTML file149 - Add charts and tables to placeholder areas using PptxGenJS API150 - Save the presentation using `pptx.writeFile()`1514. **Visual validation**: Generate thumbnails and inspect for layout issues152 <example>153 ```bash154 python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4155 ```156 Creates: `workspace/thumbnails.jpg` grid for visual validation157 </example>158 - Read and examine the thumbnail image for:159 - **Text cutoff**: Text being cut off by header bars, shapes, or slide edges160 - **Text overlap**: Text overlapping with other text or shapes161 - **Positioning issues**: Content too close to slide boundaries or other elements162 - **Contrast issues**: Insufficient contrast between text and backgrounds163 - If issues found, adjust HTML margins/spacing/colours and regenerate the presentation164 - Repeat until all slides are visually correct165166</instructions>167168## Editing an existing presentation169170<instructions>171172Work with the raw Office Open XML (OOXML) format: unpack the .pptx file, edit the XML content, and repack it.173174### Workflow1751761. Read [`references/ooxml-reference.md`](references/ooxml-reference.md) (~500 lines) completely from start to finish before any editing1772. Unpack the presentation:178 <example>179 ```bash180 python ooxml/scripts/unpack.py presentation.pptx unpacked/181 ```182 </example>1833. Edit the XML files (primarily `ppt/slides/slide{N}.xml` and related files)1844. Validate immediately after each edit:185 <example>186 ```bash187 python ooxml/scripts/validate.py unpacked/ --original presentation.pptx188 ```189 </example>1905. Pack the final presentation:191 <example>192 ```bash193 python ooxml/scripts/pack.py unpacked/ output.pptx194 ```195 </example>196197</instructions>198199## Creating a presentation using a template200201<instructions>202203Read [`references/template-workflow.md`](references/template-workflow.md) completely from start to finish. It covers the full 7-step process:2042051. Extract template text and create visual thumbnail grid2062. Analyse template and save inventory to a file2073. Create presentation outline based on template inventory2084. Duplicate, reorder, and delete slides using `rearrange.py`2095. Extract all text using `inventory.py`2106. Generate replacement text and save to JSON2117. Apply replacements using `replace.py`212213</instructions>214215## Creating Thumbnail Grids216217<example>218```bash219python scripts/thumbnail.py template.pptx [output_prefix]220```221Creates: `thumbnails.jpg` (or `output_prefix.jpg` if specified)222</example>223224**Features**:225- Creates: `thumbnails.jpg` (or `thumbnails-1.jpg`, `thumbnails-2.jpg`, etc. for large decks)226- Default: 5 columns, max 30 slides per grid (5x6)227- Custom prefix: `python scripts/thumbnail.py template.pptx my-grid`228 - Note: The output prefix should include the path if you want output in a specific directory (e.g., `workspace/my-grid`)229- Adjust columns: `--cols 4` (range: 3-6, affects slides per grid)230- Grid limits: 3 cols = 12 slides/grid, 4 cols = 20, 5 cols = 30, 6 cols = 42231- Slides are zero-indexed (Slide 0, Slide 1, etc.)232233**Use cases**:234- Template analysis: Quickly understand slide layouts and design patterns235- Content review: Visual overview of entire presentation236- Navigation reference: Find specific slides by their visual appearance237- Quality check: Verify all slides are properly formatted238239<example>240```bash241# Basic usage242python scripts/thumbnail.py presentation.pptx243244# Combine options: custom name, columns245python scripts/thumbnail.py template.pptx analysis --cols 4246```247</example>248249## Converting Slides to Individual Images250251For cases where you need individual slide images rather than a grid:252253<example>254```bash255# Step 1: Convert PPTX to PDF256soffice --headless --convert-to pdf template.pptx257258# Step 2: Convert PDF pages to JPEG images259pdftoppm -jpeg -r 150 template.pdf slide260```261Creates: `slide-1.jpg`, `slide-2.jpg`, etc.262</example>263264Options: `-r 150` (DPI), `-jpeg` or `-png` (format), `-f N -l N` (page range)265266## Code Style Guidelines267268When generating code for PPTX operations, write concise code. Avoid verbose variable names, redundant operations, and unnecessary print statements.269270## Dependencies271272Required dependencies (should already be installed):273274| Package | Install (pip) | Install (npm) | Purpose |275|---------|--------------|---------------|---------|276| markitdown | `pip install "markitdown[pptx]"` | -- | Text extraction from presentations |277| pptxgenjs | -- | `npm install -g pptxgenjs` | Creating presentations via html2pptx |278| playwright | -- | `npm install -g playwright` | HTML rendering in html2pptx |279| react-icons | -- | `npm install -g react-icons react react-dom` | Icons |280| sharp | -- | `npm install -g sharp` | SVG rasterisation and image processing |281| defusedxml | `pip install defusedxml` | -- | Secure XML parsing |282| LibreOffice | System package: `brew install libreoffice` (macOS) or `apt-get install libreoffice` (Linux) | -- | PDF conversion |283| Poppler | System package: `brew install poppler` (macOS) or `apt-get install poppler-utils` (Linux) | -- | PDF to image conversion via pdftoppm |