Office PPT
When to Use
Use when the user provides or asks about an existing .pptx presentation and wants inspection, QA, text extraction, template residue detection, global wording changes, notes edits, or simple slide insertion.
Do not use as the main workflow for creating a complete new presentation from a topic. Use a presentation-making workflow for brief, research, outline, and planning first.
Do not use for HTML-to-PPTX conversion; that is a separate preset-driven conversion task.
Script
Run:
python3 <skill_dir>/scripts/pptx_tool.py <subcommand> <path> [args...]
Subcommands:
| Subcommand | Arguments | Purpose |
|---|---|---|
inspect |
<path> |
Full structural report: slides, layouts, shapes, text, placeholders, notes. |
check |
<path> |
Detect template text, empty placeholders, and notes issues. |
list-layouts |
<path> |
List available layouts and placeholders. |
set-text |
<path> <slide_idx> <shape_name_substr> <text> |
Replace text in the first matching text-enabled shape. |
replace-text |
<path> <old_text> <new_text> |
Replace exact text occurrences across the deck. |
add-slide |
<path> <layout_name_substr> |
Add a blank slide using a matching existing layout. |
set-notes |
<path> <slide_idx> <text> |
Replace speaker notes on a slide. |
export-text |
<path> |
Extract slide text and notes as JSON. |
slide_idx is 1-based.
Write commands automatically create a sibling backup named <file>.bak-<timestamp> before saving and return backup_path in JSON. Still create a working copy first for important files.
Workflow
- Run
inspectorexport-textbefore edits to understand the deck structure. - For QA, run
checkand summarize issues by slide. - For write operations, prefer editing a copy of the deck. The script creates a backup, but a working copy keeps the user's original source clean.
- After any edit, rerun
checkorinspectto verify the change landed on the intended slide/shape. - If layout, fonts, overflow, animation, media, or visual fidelity matter, open/render the deck in a presentation viewer before final delivery.
Return Format
Every script invocation returns JSON.
Success:
{"ok": true, "data": {"path": "/absolute/path/to/deck.pptx"}}
Write success includes:
{"ok": true, "data": {"path": "/absolute/path/to/deck.pptx", "backup_path": "/absolute/path/to/deck.pptx.bak-20260604T123456"}}
Failure:
{"ok": false, "error": "human-readable message"}
External Dependencies
- Python 3.
python-pptx.- A valid source
.pptxfile. - A presentation viewer is recommended for visual QA.
Limits and Known Issues
- This is a structure/text tool. It does not deeply analyze z-order, animations, transitions, embedded media, charts, theme fonts, or exact visual overflow.
- Notes editing may fail if the deck lacks a notes slide in a shape that
python-pptxcan update. - Shape matching uses case-insensitive substring matching, so inspect shape names before
set-text. - Global text replacement may change more places than intended. Use exact strings and inspect output.
- Chart data and embedded workbook data are not edited.
Examples
python3 <skill_dir>/scripts/pptx_tool.py check /path/to/deck.pptx
python3 <skill_dir>/scripts/pptx_tool.py replace-text /path/to/deck.pptx "Old Company" "New Company"
python3 <skill_dir>/scripts/pptx_tool.py set-notes /path/to/deck.pptx 3 "Speaker notes for slide 3"