name: pptx description: >- Read, create, and edit PowerPoint PPTX/PPT presentations. Covers: parsing, summarizing, extracting content, inspecting themes/layouts, creating new decks with PptxGenJS, and editing existing PPTX while preserving formatting. descriptions:
Use this skill for PowerPoint .pptx work.
Replace <skill_dir> with the actual skill path shown by the loader.
| Need | Workflow |
|---|---|
| Existing PPTX inspection, extraction, search, preview, or audit | Use the inspection commands below |
PPTX preview selection edit context (mavis.ppt_artifact_edit_request.v1) |
Read references/preview-selection-writeback.md; use the targeted workflow there, not the template-wide editing workflow |
| Existing PPTX provided and layout/style must be preserved | Follow references/editing.md |
| Reference PPTX provided for style imitation, but content is new | Run the Template Imitation Workflow |
| No source deck, or a fresh deck is acceptable | Run the From-Scratch Workflow |
If the request says "edit" but no source deck is available, assume from-scratch generation and state that assumption.
Default to uv run --with python-pptx for all Python workflows except comments, which has no extra dependency.
# Text, tables, notes, search
uv run --with python-pptx <skill_dir>/scripts/extract_pptx.py file.pptx
# Embedded images
uv run --with python-pptx <skill_dir>/scripts/extract_images.py file.pptx
# Review comments
uv run <skill_dir>/scripts/extract_comments.py file.pptx
# Format / metadata audit
uv run --with python-pptx <skill_dir>/scripts/audit_pptx.py file.pptx
# Screenshots (macOS only)
bash <skill_dir>/scripts/pptx-screenshot.sh file.pptx
High-value inspection flags:
--slides 1,3,5 or --range 2-4--search "term", --regex, --ignore-caseextract_pptx.py --notesextract_images.py --list-onlyextract_comments.py --format jsonaudit_pptx.py --sections metadata,themes,...pptx-screenshot.sh --pages "1,3,5" --outdir ./previewsaudit_pptx.py supports these sections:
metadata: document propertiesmasters: slide masters, layouts, usage countsthemes: theme colors and font schemesshapes: per-slide shape inventory with position and text previewhyperlinks: URLs, actions, tooltipsembedded: embedded files and OLE objectssecurity: MSIP labels and custom XML partsUse --format text only for human inspection. Prefer JSON when downstream processing is likely.
Use these defaults unless the user specifies otherwise and no template PPTX is provided for imitation:
LAYOUT_16x9Microsoft YaHeiArial unless a better option is justifiedreferences/design-system.mdWhen a template PPTX is provided for imitation, the template's actual colors and fonts override these defaults.
When creating a new PPTX from scratch for Mavis, also write an optional sidecar element map:
slides/output/<descriptive-name>.mavis-ppt-map.json
This sidecar is editing metadata only. It must not replace the standard .pptx output, change
visible slide layout, or change the createSlide(pres, theme) slide-module contract. Use
references/element-map.md and scripts/mavis-ppt-map.cjs to record stable elementId, role,
text, style, and rectIn / normalizedRect coordinates for meaningful editable elements.
If the sidecar is unavailable for a deck, the PPTX is still valid and should be delivered after the normal QA process. Future artifact-edit flows can then fall back to preview text, screenshots, and coordinates as locator evidence.
These are mandatory unless the user explicitly overrides them:
LAYOUT_16x9.LAYOUT_16x9 is 10" wide x 5.625" tall. Every element must satisfy x + w <= 10.0 and y + h <= 5.625. Coordinates that exceed these bounds will be clipped or overflow the slide edge. Do NOT assume the canvas is 13.3" wide — that is LAYOUT_WIDE, a different layout.slides/slide-01.js, slides/slide-02.js, ...createSlide(pres, theme).async / await in createSlide().primary, secondary, accent, light, bg.#.9.3, y 5.1.Microsoft YaHei.presentation.pptx.references/pitfalls.md for the QA process.references/design-system.md font pairings when no template is provided.Use this when no source PPTX must be preserved.
references/design-system.md.references/slide-types.md.slides/slide-XX.js modules and keep layout variety where the outline calls for it.references/pitfalls.md#pre-compile-lint before compiling.slides/compile.js, load slide modules in final order, and write slides/output/<descriptive-name>.pptx.slides/output/<descriptive-name>.mavis-ppt-map.json as a sidecar using references/element-map.md.references/pitfalls.md#qa-process, fix issues, and re-verify.Minimal compile shape:
const pptxgen = require('pptxgenjs');
const pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
const theme = {
primary: '22223b',
secondary: '4a4e69',
accent: '9a8c98',
light: 'c9ada7',
bg: 'f2e9e4'
};
require('./slide-01.js').createSlide(pres, theme);
pres.writeFile({ fileName: './output/my-deck-name.pptx' });
Use this when the user provides a reference PPTX for visual style, but all content is new.
audit_pptx.py --sections themes,masters,shapes to extract theme colors, fonts, and layout usage.dk1/dk2 colors with dark values such as 1A1A1A or 0D0D0D, the template is dark-mode.Map the template's actual colors to the 5-key theme, respecting the template's color roles:
bg = actual slide background color (may be dark)
primary = actual body text color (may be light)
accent = primary accent/highlight color
secondary = secondary/muted text color
light = card/panel background color
Do not pick from references/design-system.md palettes. Use the template's actual colors.
Do not assume bg is light and primary is dark. Dark-mode templates flip this.
Use the font families from the template audit, not references/design-system.md recommendations. Only fall back to recommended pairings if the template fonts are unavailable on the target system.
Do all of the following (these are the From-Scratch Workflow steps, adapted — do NOT skip any):
references/slide-types.md.slides/slide-XX.js modules and keep layout variety where the outline calls for it.references/pitfalls.md#pre-compile-lint before compiling.slides/compile.js, load slide modules in final order, and write slides/output/<descriptive-name>.pptx.slides/output/<descriptive-name>.mavis-ppt-map.json as a sidecar using references/element-map.md.references/pitfalls.md#qa-process, fix issues, and re-verify. Do NOT return the deck until QA passes.Skip palette/font selection (step 2 of From-Scratch) because palette and fonts come from the template.
Use this when the user provides a source PPTX and expects structure or layout to survive.
references/editing.md for XML-level workflow and pitfalls.LAYOUT_16x9# in colors.pptx output contractsoffice plus swiftc.extract_comments.py supports classic comments only, not modern Office 365 collaborative comments.python-pptx editing is needed, read references/python-pptx-recipes.md on demand instead of keeping those patterns in main context.On Windows, invoke bash scripts and piped commands via Git Bash:
# QA verification with markitdown
bash -c "python -m markitdown output.pptx | grep -iE 'xxxx|lorem|ipsum|placeholder'"
# Python inspection via uv
uv run --with python-pptx scripts/extract_pptx.py file.pptx
Note:
scripts/pptx-screenshot.shis macOS-only (requires Swift compiler + soffice). On Windows, use LibreOffice GUI export orpython-pptx+ pillow for slide previews.
| Unix reference | Windows handling |
|---|---|
python3 / python -m |
python — works in both PowerShell and Git Bash |
/tmp/ for temp writes |
Git Bash maps /tmp/ automatically |
soffice |
Must be on PATH — winget install TheDocumentFoundation.LibreOffice |
If Git Bash or any tool is missing, read the mavis skill's
references/windows-tool-bootstrap.md for detection + auto-install commands.
Read these before writing any slide code. Do not skip them even if you think you already know the API:
references/pitfalls.md: pre-compile lint, QA process, common PptxGenJS failures — must run lint and QAreferences/pptxgenjs.md: PptxGenJS API, layout dimensions, text/shape/table options — must verify canvas dimensionsreferences/slide-types.md: page type classification and layout patterns — must assign a type to each slidereferences/element-map.md: optional sidecar metadata for Mavis-generated decks — must not replace the PPTX output contractreferences/design-system.md: palette, typography, style recipes (skip when imitating a template)references/editing.md: template-preserving editing workflowreferences/python-pptx-recipes.md: targeted python-pptx inspection or editing patterns