Scope
Use this skill for PowerPoint .pptx work.
- Read slide text, tables, speaker notes, or comments
- Search existing deck content
- Extract embedded images
- Render slide screenshots
- Audit theme, layout, font, color, hyperlink, embedded object, and security metadata
- Create a new deck from scratch with PptxGenJS
- Imitate an existing deck's visual style with new content
- Edit an existing PPTX or template while preserving layout
Replace <skill_dir> with the actual skill path shown by the loader.
Router
| Need |
Workflow |
| Existing PPTX inspection, extraction, search, preview, or audit |
Use the inspection commands below |
| 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.
Inspection Commands
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:
- Slide subset:
--slides 1,3,5 or --range 2-4
- Text filtering:
--search "term", --regex, --ignore-case
- Speaker notes:
extract_pptx.py --notes
- Image dry run:
extract_images.py --list-only
- Comment output:
extract_comments.py --format json
- Audit scope:
audit_pptx.py --sections metadata,themes,...
- Screenshot subset:
pptx-screenshot.sh --pages "1,3,5" --outdir ./previews
audit_pptx.py supports these sections:
metadata: document properties
masters: slide masters, layouts, usage counts
themes: theme colors and font schemes
shapes: per-slide shape inventory with position and text preview
hyperlinks: URLs, actions, tooltips
embedded: embedded files and OLE objects
security: MSIP labels and custom XML parts
Use --format text only for human inspection. Prefer JSON when downstream processing is likely.
Generation Defaults
Use these defaults unless the user specifies otherwise and no template PPTX is provided for imitation:
- audience: business / professional
- tone: clear, restrained, presentation-ready
- layout:
LAYOUT_16x9
- Chinese font:
Microsoft YaHei
- English font:
Arial unless a better option is justified
- palette and typography: choose from
references/design-system.md
- page numbers: required on all non-cover slides
When a template PPTX is provided for imitation, the template's actual colors and fonts override these defaults.
Hard Constraints
These are mandatory unless the user explicitly overrides them:
- Use
LAYOUT_16x9.
- Canvas boundary rule:
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.
- Create one file per slide:
slides/slide-01.js, slides/slide-02.js, ...
- Each slide file must export synchronous
createSlide(pres, theme).
- Never use
async / await in createSlide().
- Theme keys must be exactly
primary, secondary, accent, light, bg.
- Colors must be 6-character hex strings without
#.
- Do not encode opacity into hex strings.
- All non-cover slides must include a page number badge near x
9.3, y 5.1.
- Chinese text should use
Microsoft YaHei.
- No gradients or animation-style gimmicks.
- Do not reuse mutable PptxGenJS option objects across calls.
- Output filename must be descriptive; never use
presentation.pptx.
- Run QA before returning the deck — this is a blocking gate, not optional. Do NOT return the deck to the user until QA is complete. See
references/pitfalls.md for the QA process.
- When imitating a template, use the template's actual fonts. Only fall back to
references/design-system.md font pairings when no template is provided.
From-Scratch Workflow
Use this when no source PPTX must be preserved.
- Derive a concise outline from topic, audience, purpose, and expected depth.
- Pick one palette, font pairing, and style recipe from
references/design-system.md.
- Assign each slide one page type from
references/slide-types.md.
- Create
slides/slide-XX.js modules and keep layout variety where the outline calls for it.
- Run the pre-compile lint in
references/pitfalls.md#pre-compile-lint before compiling.
- Create
slides/compile.js, load slide modules in final order, and write slides/output/<descriptive-name>.pptx.
- Run the QA process in
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' });
Template Imitation Workflow
Use this when the user provides a reference PPTX for visual style, but all content is new.
Step 1: Analyze Template Visual Identity
- Take screenshots of 3-5 representative slides: cover, a content-heavy slide, and a data slide.
- Run
audit_pptx.py --sections themes,masters,shapes to extract theme colors, fonts, and layout usage.
- Determine dark-mode vs light-mode:
- Check the most-used slide layouts. If their backgrounds use
dk1/dk2 colors with dark values such as 1A1A1A or 0D0D0D, the template is dark-mode.
- Look at screenshots: dark backgrounds with light text indicate dark-mode.
- Record the template's visual identity:
- Slide background color
- Primary text color
- Accent color(s)
- Card/panel background color
- Font families for title and body
Step 2: Map to Theme Keys Faithfully
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.
Step 3: Use Template Fonts
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.
Step 4: Generate
Do all of the following (these are the From-Scratch Workflow steps, adapted — do NOT skip any):
- Derive a concise outline from topic, audience, purpose, and expected depth.
- Assign each slide one page type from
references/slide-types.md.
- Create
slides/slide-XX.js modules and keep layout variety where the outline calls for it.
- Run the pre-compile lint in
references/pitfalls.md#pre-compile-lint before compiling.
- Create
slides/compile.js, load slide modules in final order, and write slides/output/<descriptive-name>.pptx.
- Run the QA process in
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.
Template Editing Workflow
Use this when the user provides a source PPTX and expects structure or layout to survive.
- Prefer preserving slide masters, theme relationships, and layout semantics.
- Complete structural edits first, then content edits.
- Follow
references/editing.md for XML-level workflow and pitfalls.
- Only switch to from-scratch generation if it does not violate the user's intent.
Delivery Checklist
- slides render without runtime errors
- layout is
LAYOUT_16x9
- no
# in colors
- all slide modules are synchronous
- all non-cover slides include page numbers
- no placeholder/demo text remains
- titles do not wrap awkwardly
- repeated elements align consistently
- final file is written successfully
- inspection/editing tasks preserve the source file unless explicitly replacing it
- template imitation background color matches the template's dark/light mode
- template imitation fonts match the template's font families
Operational Notes
- Screenshots are macOS-only and require
soffice plus swiftc.
extract_comments.py supports classic comments only, not modern Office 365 collaborative comments.
- If targeted
python-pptx editing is needed, read references/python-pptx-recipes.md on demand instead of keeping those patterns in main context.
Windows (win32) platform notes
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.sh is macOS-only (requires Swift compiler + soffice).
On Windows, use LibreOffice GUI export or python-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.
References
Mandatory for Generation Tasks
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 QA
references/pptxgenjs.md: PptxGenJS API, layout dimensions, text/shape/table options — must verify canvas dimensions
references/slide-types.md: page type classification and layout patterns — must assign a type to each slide
Load On Demand
references/design-system.md: palette, typography, style recipes (skip when imitating a template)
references/editing.md: template-preserving editing workflow
references/python-pptx-recipes.md: targeted python-pptx inspection or editing patterns
1---2name: pptx3description: Read, create, and edit PowerPoint PPTX/PPT presentations. Use when the user explicitly mentions "ppt" or "PPT" (e.g. "做个PPT", "make a ppt"). If the user only says "演示文稿" or "presentation" without mentioning PPT, route to html-deck instead. Covers: parsing, summarizing, extracting content, inspecting themes/layouts, creating new decks with PptxGenJS, and editing existing PPTX while preserving formatting.4---56## Scope78Use this skill for PowerPoint `.pptx` work.910- Read slide text, tables, speaker notes, or comments11- Search existing deck content12- Extract embedded images13- Render slide screenshots14- Audit theme, layout, font, color, hyperlink, embedded object, and security metadata15- Create a new deck from scratch with PptxGenJS16- Imitate an existing deck's visual style with new content17- Edit an existing PPTX or template while preserving layout1819Replace `<skill_dir>` with the actual skill path shown by the loader.2021## Router2223| Need | Workflow |24| --- | --- |25| Existing PPTX inspection, extraction, search, preview, or audit | Use the inspection commands below |26| Existing PPTX provided and layout/style must be preserved | Follow `references/editing.md` |27| Reference PPTX provided for style imitation, but content is new | Run the Template Imitation Workflow |28| No source deck, or a fresh deck is acceptable | Run the From-Scratch Workflow |2930If the request says "edit" but no source deck is available, assume from-scratch generation and state that assumption.3132## Inspection Commands3334Default to `uv run --with python-pptx` for all Python workflows except comments, which has no extra dependency.3536```bash37# Text, tables, notes, search38uv run --with python-pptx <skill_dir>/scripts/extract_pptx.py file.pptx3940# Embedded images41uv run --with python-pptx <skill_dir>/scripts/extract_images.py file.pptx4243# Review comments44uv run <skill_dir>/scripts/extract_comments.py file.pptx4546# Format / metadata audit47uv run --with python-pptx <skill_dir>/scripts/audit_pptx.py file.pptx4849# Screenshots (macOS only)50bash <skill_dir>/scripts/pptx-screenshot.sh file.pptx51```5253High-value inspection flags:5455- Slide subset: `--slides 1,3,5` or `--range 2-4`56- Text filtering: `--search "term"`, `--regex`, `--ignore-case`57- Speaker notes: `extract_pptx.py --notes`58- Image dry run: `extract_images.py --list-only`59- Comment output: `extract_comments.py --format json`60- Audit scope: `audit_pptx.py --sections metadata,themes,...`61- Screenshot subset: `pptx-screenshot.sh --pages "1,3,5" --outdir ./previews`6263`audit_pptx.py` supports these sections:6465- `metadata`: document properties66- `masters`: slide masters, layouts, usage counts67- `themes`: theme colors and font schemes68- `shapes`: per-slide shape inventory with position and text preview69- `hyperlinks`: URLs, actions, tooltips70- `embedded`: embedded files and OLE objects71- `security`: MSIP labels and custom XML parts7273Use `--format text` only for human inspection. Prefer JSON when downstream processing is likely.7475## Generation Defaults7677Use these defaults unless the user specifies otherwise **and no template PPTX is provided for imitation**:7879- audience: business / professional80- tone: clear, restrained, presentation-ready81- layout: `LAYOUT_16x9`82- Chinese font: `Microsoft YaHei`83- English font: `Arial` unless a better option is justified84- palette and typography: choose from `references/design-system.md`85- page numbers: required on all non-cover slides8687When a template PPTX is provided for imitation, the template's actual colors and fonts override these defaults.8889## Hard Constraints9091These are mandatory unless the user explicitly overrides them:92931. Use `LAYOUT_16x9`.942. **Canvas boundary rule**: `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.953. Create one file per slide: `slides/slide-01.js`, `slides/slide-02.js`, ...964. Each slide file must export synchronous `createSlide(pres, theme)`.975. Never use `async` / `await` in `createSlide()`.986. Theme keys must be exactly `primary`, `secondary`, `accent`, `light`, `bg`.997. Colors must be 6-character hex strings without `#`.1008. Do not encode opacity into hex strings.1019. All non-cover slides must include a page number badge near x `9.3`, y `5.1`.10210. Chinese text should use `Microsoft YaHei`.10311. No gradients or animation-style gimmicks.10412. Do not reuse mutable PptxGenJS option objects across calls.10513. Output filename must be descriptive; never use `presentation.pptx`.10614. Run QA before returning the deck — this is a **blocking gate**, not optional. Do NOT return the deck to the user until QA is complete. See `references/pitfalls.md` for the QA process.10715. When imitating a template, use the template's actual fonts. Only fall back to `references/design-system.md` font pairings when no template is provided.108109## From-Scratch Workflow110111Use this when no source PPTX must be preserved.1121131. Derive a concise outline from topic, audience, purpose, and expected depth.1142. Pick one palette, font pairing, and style recipe from `references/design-system.md`.1153. Assign each slide one page type from `references/slide-types.md`.1164. Create `slides/slide-XX.js` modules and keep layout variety where the outline calls for it.1175. Run the pre-compile lint in `references/pitfalls.md#pre-compile-lint` before compiling.1186. Create `slides/compile.js`, load slide modules in final order, and write `slides/output/<descriptive-name>.pptx`.1197. Run the QA process in `references/pitfalls.md#qa-process`, fix issues, and re-verify.120121Minimal compile shape:122123```javascript124const pptxgen = require('pptxgenjs');125const pres = new pptxgen();126pres.layout = 'LAYOUT_16x9';127128const theme = {129 primary: '22223b',130 secondary: '4a4e69',131 accent: '9a8c98',132 light: 'c9ada7',133 bg: 'f2e9e4'134};135136require('./slide-01.js').createSlide(pres, theme);137pres.writeFile({ fileName: './output/my-deck-name.pptx' });138```139140## Template Imitation Workflow141142Use this when the user provides a reference PPTX for visual style, but all content is new.143144### Step 1: Analyze Template Visual Identity1451461. Take screenshots of 3-5 representative slides: cover, a content-heavy slide, and a data slide.1472. Run `audit_pptx.py --sections themes,masters,shapes` to extract theme colors, fonts, and layout usage.1483. Determine dark-mode vs light-mode:149 - Check the most-used slide layouts. If their backgrounds use `dk1`/`dk2` colors with dark values such as `1A1A1A` or `0D0D0D`, the template is dark-mode.150 - Look at screenshots: dark backgrounds with light text indicate dark-mode.1514. Record the template's visual identity:152 - Slide background color153 - Primary text color154 - Accent color(s)155 - Card/panel background color156 - Font families for title and body157158### Step 2: Map to Theme Keys Faithfully159160Map the template's actual colors to the 5-key theme, respecting the template's color roles:161162```text163bg = actual slide background color (may be dark)164primary = actual body text color (may be light)165accent = primary accent/highlight color166secondary = secondary/muted text color167light = card/panel background color168```169170Do not pick from `references/design-system.md` palettes. Use the template's actual colors.171172Do not assume `bg` is light and `primary` is dark. Dark-mode templates flip this.173174### Step 3: Use Template Fonts175176Use 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.177178### Step 4: Generate179180Do all of the following (these are the From-Scratch Workflow steps, adapted — do NOT skip any):1811821. Derive a concise outline from topic, audience, purpose, and expected depth.1832. Assign each slide one page type from `references/slide-types.md`.1843. Create `slides/slide-XX.js` modules and keep layout variety where the outline calls for it.1854. Run the pre-compile lint in `references/pitfalls.md#pre-compile-lint` before compiling.1865. Create `slides/compile.js`, load slide modules in final order, and write `slides/output/<descriptive-name>.pptx`.1876. Run the QA process in `references/pitfalls.md#qa-process`, fix issues, and re-verify. **Do NOT return the deck until QA passes.**188189Skip palette/font selection (step 2 of From-Scratch) because palette and fonts come from the template.190191## Template Editing Workflow192193Use this when the user provides a source PPTX and expects structure or layout to survive.194195- Prefer preserving slide masters, theme relationships, and layout semantics.196- Complete structural edits first, then content edits.197- Follow `references/editing.md` for XML-level workflow and pitfalls.198- Only switch to from-scratch generation if it does not violate the user's intent.199200## Delivery Checklist201202- slides render without runtime errors203- layout is `LAYOUT_16x9`204- no `#` in colors205- all slide modules are synchronous206- all non-cover slides include page numbers207- no placeholder/demo text remains208- titles do not wrap awkwardly209- repeated elements align consistently210- final file is written successfully211- inspection/editing tasks preserve the source file unless explicitly replacing it212- template imitation background color matches the template's dark/light mode213- template imitation fonts match the template's font families214215## Operational Notes216217- Screenshots are macOS-only and require `soffice` plus `swiftc`.218- `extract_comments.py` supports classic comments only, not modern Office 365 collaborative comments.219- If targeted `python-pptx` editing is needed, read `references/python-pptx-recipes.md` on demand instead of keeping those patterns in main context.220221## Windows (win32) platform notes222223On Windows, invoke bash scripts and piped commands via **Git Bash**:224225```powershell226# QA verification with markitdown227bash -c "python -m markitdown output.pptx | grep -iE 'xxxx|lorem|ipsum|placeholder'"228229# Python inspection via uv230uv run --with python-pptx scripts/extract_pptx.py file.pptx231```232233> **Note:** `scripts/pptx-screenshot.sh` is **macOS-only** (requires Swift compiler + soffice).234> On Windows, use LibreOffice GUI export or `python-pptx` + pillow for slide previews.235236| Unix reference | Windows handling |237|---|---|238| `python3` / `python -m` | `python` — works in both PowerShell and Git Bash |239| `/tmp/` for temp writes | Git Bash maps `/tmp/` automatically |240| `soffice` | Must be on PATH — `winget install TheDocumentFoundation.LibreOffice` |241242**If Git Bash or any tool is missing**, read the `mavis` skill's243`references/windows-tool-bootstrap.md` for detection + auto-install commands.244245## References246247### Mandatory for Generation Tasks248249Read these **before writing any slide code**. Do not skip them even if you think you already know the API:250251- `references/pitfalls.md`: pre-compile lint, QA process, common PptxGenJS failures — **must run lint and QA**252- `references/pptxgenjs.md`: PptxGenJS API, layout dimensions, text/shape/table options — **must verify canvas dimensions**253- `references/slide-types.md`: page type classification and layout patterns — **must assign a type to each slide**254255### Load On Demand256257- `references/design-system.md`: palette, typography, style recipes (skip when imitating a template)258- `references/editing.md`: template-preserving editing workflow259- `references/python-pptx-recipes.md`: targeted python-pptx inspection or editing patterns