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_*.md |
Detailed orchestration guides |
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: strong contrast, appropriately sized text, 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 |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: costa-marcello-skillkit-pptx3description: PPTX creation, editing, and analysis4---56# PPTX creation, editing, and analysis78<context>9A .pptx file is a ZIP archive containing XML files and other resources. This skill provides different workflows for creating, editing, and analysing presentations.10</context>1112## Creating from Topic (Content-First)1314For generating complete decks from a topic, document, or brief, use the content-first workflow built on the **Pyramid Principle** (conclusion, reasons, evidence):15161. **Intake**: Use questionnaire at `references/content-workflow/INTAKE.md`172. **Follow 9-stage workflow**: `references/content-workflow/WORKFLOW.md`183. **Score with rubric** (must reach 75+): `references/content-workflow/RUBRIC.md`1920### Content-First Reference Files2122| File | Purpose |23|------|---------|24| `INTAKE.md` | Questionnaire to gather requirements |25| `WORKFLOW.md` | 9-stage content generation process |26| `TEMPLATES.md` | Slide layout templates |27| `VIS-GUIDE.md` | Chart and visualisation selection |28| `STYLE-GUIDE.md` | WCAG 2.1 AA compliance, typography |29| `RUBRIC.md` | Quality scoring (10 dimensions, 75+ to pass) |30| `CHECKLIST.md` | Pre-delivery verification |31| `ORCHESTRATION_*.md` | Detailed orchestration guides |32| `EXAMPLES.md` | Sample presentations |3334### Chart Generation3536For data-driven charts, use chartkit:3738<example>39```bash40python scripts/chartkit.py \41 --data data.csv \42 --type line \43 --x date \44 --y sales profit \45 --out output/assets \46 --filename kpi_trend.png \47 --title "Monthly KPIs"48```49Creates: `kpi_trend.png` line chart in output/assets50</example>5152Supported chart types: `line`, `area`, `bar`, `barh`, `scatter`, `hist`, `waterfall`5354## Reading and analysing content5556### Text extraction5758To read text contents, convert the document to markdown:5960<example>61```bash62python -m markitdown path-to-file.pptx63```64Outputs: Markdown text content from all slides65</example>6667### Raw XML access6869Raw 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.7071<example>72```bash73python ooxml/scripts/unpack.py presentation.pptx unpacked/74```75Creates: Directory with extracted XML files and media76</example>7778**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.7980<context>81#### Key file structures82* `ppt/presentation.xml` - Main presentation metadata and slide references83* `ppt/slides/slide{N}.xml` - Individual slide contents (slide1.xml, slide2.xml, etc.)84* `ppt/notesSlides/notesSlide{N}.xml` - Speaker notes for each slide85* `ppt/comments/modernComment_*.xml` - Comments for specific slides86* `ppt/slideLayouts/` - Layout templates for slides87* `ppt/slideMasters/` - Master slide templates88* `ppt/theme/` - Theme and styling information89* `ppt/media/` - Images and other media files90</context>9192#### Typography and colour extraction9394**When given an example design to emulate**: Analyse the presentation's typography and colours first:95961. **Read theme file**: Check `ppt/theme/theme1.xml` for colours (`<a:clrScheme>`) and fonts (`<a:fontScheme>`)972. **Sample slide content**: Examine `ppt/slides/slide1.xml` for actual font usage (`<a:rPr>`) and colours983. **Search for patterns**: Use grep to find colour (`<a:solidFill>`, `<a:srgbClr>`) and font references across all XML files99100## Creating a new presentation without a template101102<instructions>103104Use the **html2pptx** workflow to convert HTML slides to PowerPoint with accurate positioning.105106### Design Approach107108Before creating any presentation, analyse the content and choose appropriate design elements:1091101. **Identify the subject matter**: What is this presentation about? What tone, industry, or mood does it suggest?1112. **Check for branding**: If the user mentions a company or organisation, use their brand colours and identity1123. **Match palette to content**: Select colours that reflect the subject1134. **State your approach**: Explain your design choices before writing code114115**Requirements**:116- State your content-informed design approach before writing code117- Use web-safe fonts only: Arial, Helvetica, Times New Roman, Georgia, Courier New, Verdana, Tahoma, Trebuchet MS, Impact118- Create clear visual hierarchy through size, weight, and colour119- Check readability: strong contrast, appropriately sized text, clean alignment120- Repeat patterns, spacing, and visual language across slides121122#### Design Resources123124For colour palettes and visual design elements, read:125- `references/color-palettes.md` - 18 curated colour schemes126- `references/design-elements.md` - Geometric patterns, typography, layouts127128### Layout Tips129130**When creating slides with charts or tables:**131- **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)132- **Full-slide layout**: Let the featured content take up the entire slide for maximum readability133- **Do not vertically stack**: Do not place charts/tables below text in a single column -- this causes poor readability and layout issues134135### Workflow1361371. Read [`references/html2pptx-guide.md`](references/html2pptx-guide.md) completely from start to finish before proceeding1382. Create an HTML file for each slide with proper dimensions (e.g., 720pt x 405pt for 16:9)139 - Use `<p>`, `<h1>`-`<h6>`, `<ul>`, `<ol>` for all text content140 - Use `class="placeholder"` for areas where charts/tables will be added (render with grey background for visibility)141 - Rasterise gradients and icons as PNG images first using Sharp, then reference in HTML142 - For slides with charts/tables/images, use either full-slide layout or two-column layout1433. Create and run a JavaScript file using the [`html2pptx.js`](scripts/html2pptx.js) library to convert HTML slides to PowerPoint and save the presentation144 - Use the `html2pptx()` function to process each HTML file145 - Add charts and tables to placeholder areas using PptxGenJS API146 - Save the presentation using `pptx.writeFile()`1474. **Visual validation**: Generate thumbnails and inspect for layout issues148 <example>149 ```bash150 python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4151 ```152 Creates: `workspace/thumbnails.jpg` grid for visual validation153 </example>154 - Read and examine the thumbnail image for:155 - **Text cutoff**: Text being cut off by header bars, shapes, or slide edges156 - **Text overlap**: Text overlapping with other text or shapes157 - **Positioning issues**: Content too close to slide boundaries or other elements158 - **Contrast issues**: Insufficient contrast between text and backgrounds159 - If issues found, adjust HTML margins/spacing/colours and regenerate the presentation160 - Repeat until all slides are visually correct161162</instructions>163164## Editing an existing presentation165166<instructions>167168Work with the raw Office Open XML (OOXML) format: unpack the .pptx file, edit the XML content, and repack it.169170### Workflow1711721. Read [`references/ooxml-reference.md`](references/ooxml-reference.md) (~500 lines) completely from start to finish before any editing1732. Unpack the presentation:174 <example>175 ```bash176 python ooxml/scripts/unpack.py presentation.pptx unpacked/177 ```178 </example>1793. Edit the XML files (primarily `ppt/slides/slide{N}.xml` and related files)1804. Validate immediately after each edit:181 <example>182 ```bash183 python ooxml/scripts/validate.py unpacked/ --original presentation.pptx184 ```185 </example>1865. Pack the final presentation:187 <example>188 ```bash189 python ooxml/scripts/pack.py unpacked/ output.pptx190 ```191 </example>192193</instructions>194195## Creating a presentation using a template196197<instructions>198199Read [`references/template-workflow.md`](references/template-workflow.md) completely from start to finish. It covers the full 7-step process:2002011. Extract template text and create visual thumbnail grid2022. Analyse template and save inventory to a file2033. Create presentation outline based on template inventory2044. Duplicate, reorder, and delete slides using `rearrange.py`2055. Extract all text using `inventory.py`2066. Generate replacement text and save to JSON2077. Apply replacements using `replace.py`208209</instructions>210211## Creating Thumbnail Grids212213<example>214```bash215python scripts/thumbnail.py template.pptx [output_prefix]216```217Creates: `thumbnails.jpg` (or `output_prefix.jpg` if specified)218</example>219220**Features**:221- Creates: `thumbnails.jpg` (or `thumbnails-1.jpg`, `thumbnails-2.jpg`, etc. for large decks)222- Default: 5 columns, max 30 slides per grid (5x6)223- Custom prefix: `python scripts/thumbnail.py template.pptx my-grid`224 - Note: The output prefix should include the path if you want output in a specific directory (e.g., `workspace/my-grid`)225- Adjust columns: `--cols 4` (range: 3-6, affects slides per grid)226- Grid limits: 3 cols = 12 slides/grid, 4 cols = 20, 5 cols = 30, 6 cols = 42227- Slides are zero-indexed (Slide 0, Slide 1, etc.)228229**Use cases**:230- Template analysis: Quickly understand slide layouts and design patterns231- Content review: Visual overview of entire presentation232- Navigation reference: Find specific slides by their visual appearance233- Quality check: Verify all slides are properly formatted234235<example>236```bash237# Basic usage238python scripts/thumbnail.py presentation.pptx239240# Combine options: custom name, columns241python scripts/thumbnail.py template.pptx analysis --cols 4242```243</example>244245## Converting Slides to Individual Images246247For cases where you need individual slide images rather than a grid:248249<example>250```bash251# Step 1: Convert PPTX to PDF252soffice --headless --convert-to pdf template.pptx253254# Step 2: Convert PDF pages to JPEG images255pdftoppm -jpeg -r 150 template.pdf slide256```257Creates: `slide-1.jpg`, `slide-2.jpg`, etc.258</example>259260Options: `-r 150` (DPI), `-jpeg` or `-png` (format), `-f N -l N` (page range)261262## Code Style Guidelines263264When generating code for PPTX operations, write concise code. Avoid verbose variable names, redundant operations, and unnecessary print statements.265266## Dependencies267268Required dependencies (should already be installed):269270| Package | Install (pip) | Install (npm) | Purpose |271|---------|--------------|---------------|---------|272| markitdown | `pip install "markitdown[pptx]"` | -- | Text extraction from presentations |273| pptxgenjs | -- | `npm install -g pptxgenjs` | Creating presentations via html2pptx |274| playwright | -- | `npm install -g playwright` | HTML rendering in html2pptx |275| react-icons | -- | `npm install -g react-icons react react-dom` | Icons |276| sharp | -- | `npm install -g sharp` | SVG rasterisation and image processing |277| defusedxml | `pip install defusedxml` | -- | Secure XML parsing |278| LibreOffice | System package: `brew install libreoffice` (macOS) or `apt-get install libreoffice` (Linux) | -- | PDF conversion |279| Poppler | System package: `brew install poppler` (macOS) or `apt-get install poppler-utils` (Linux) | -- | PDF to image conversion via pdftoppm |280281---282> Converted and distributed by [TomeVault](https://tomevault.io/claim/costa-marcello) — claim your Tome and manage your conversions.283<!-- tomevault:4.0:skill_md:2026-04-13 -->