Home / All Skills / Docs & Knowledge / pptx
Docs & Knowledge · anthropics/skills

pptx

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandWrite FileDual-pass Audit
Author anthropicsGitHub anthropics/skills ↗Stars 175386License Proprietary(skill 自带 LICENSE.txt:© 2025 Anthropic, PBC. All rights reserved. 按 Anthropic Consumer/Commercial Terms of Service 授权并附 ADDITIONAL RESTRICTIONS;非开源许可)Commit 41bbe19d1a
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

Shares the container philosophy with docx/xlsx: `.pptx` is also ZIP+XML. Route selection depends on the task—generate programmatically via pptxgenjs (npm) for new decks; edit existing/template decks via unzip → modify slideN.xml → zip; read files via markitdown.

skills/pptx/SKILL.md
A `.pptx` is a ZIP archive of XML files. Choose your approach by task:
Routing table: '| **Create** a new deck | Write a `pptxgenjs` script — see gotchas below |', '| **Edit** an existing deck, or build from a template | unzip → edit `ppt/slides/slideN.xml` → zip |'. Template transformation is a high-frequency scenario with dedicated full-lifecycle workflows.

Structural operations must rely on scripts rather than manual copying: add_slide.py clones slides/layouts and fixes package-internal registrations (rels/content-type/sldIdLst), while clean.py removes orphaned components—file-level consistency is guaranteed by tooling.

skills/pptx/SKILL.md
`add_slide.py` does every registration a new slide needs and reports what it made
Script table: '`scripts/clean.py unpacked/` | Delete slides, media, and rels no longer referenced. Run **after** `<p:sldIdLst>` is final'. The SKILL emphasizes: 'Do all structural work — add, delete, reorder — before editing any slide's content.'

Extensive list of gotchas on the creation side (pptxgenjs pitfalls): no '#' or 8-digit hex for colors, transparency uses 'transparency', shadow offset ≥ 0, list items need bullet:true, combo charts require dual-axis declarations (valAxes + catAxes), dataLabelPosition outEnd corrupts files, etc.—all safeguarded by validate.py for final checks.

skills/pptx/SKILL.md
It reports the two chart faults above and the slide-XML defects PowerPoint refuses, and names the fix for each.
SKILL explicitly highlights ecosystem mismatches: 'pptxgenjs emits chart XML PowerPoint refuses to open, and every other tool accepts: python-pptx opens those decks, LibreOffice renders them, the XSD passes them.'—making validate.py the definitive gatekeeper.

Chart strategy: 'Never use an image when native is possible'—use addChart() where PowerPoint supports it natively; calculate series manually or post-process OOXML for unsupported features (trendlines/error bars); only fall back to rasterized images for charts PowerPoint cannot represent natively (Sankey/network/chord).

skills/pptx/SKILL.md
Use `addChart()` for everything PowerPoint can chart
The icon pipeline operates in reverse: react-icons renders SVG → sharp rasterizes to ≥256px → inserts as base64 ('the `image/png;base64,` prefix is required').

XML security requirements for template editing: transformations must be parsed with defusedxml.minidom, strictly forbidding xml.etree (which rewrites namespace prefixes and corrupts files); template slots ≠ source items (e.g., delete the entire group rather than just clearing text when fitting 3 people into a 4-person template).

skills/pptx/SKILL.md
If you script an XML transform, parse with `defusedxml.minidom` — round-tripping OOXML through `xml.etree.ElementTree` rewrites namespace prefixes and corrupts the deck.
Includes XML detail rules such as leading/trailing spaces in `<a:t>` requiring xml:space="preserve", one-to-one mapping between list items and `<a:p>`, and bullet inheritance from layouts.

Three-tiered mandatory QA: Content QA (markitdown text verification + placeholder remnant grep), File QA (validate.py mandatory check, template derivatives must baseline against --original), and Visual QA (soffice conversion to PDF → pdftoppm visual rendering for per-slide inspection, ideally using a subagent for a fresh perspective).

skills/pptx/SKILL.md
After staring at the generating code you tend to see what you expect rather than what rendered, so look at the images fresh (a subagent works well for this if you have one)
Visual QA checklist covers overflows, overlaps, alignments, contrast, placeholder remnants, and other concrete defects: 'Text overflow or text cut off at a box or slide boundary — check this first.'

Design layer includes built-in 'anti-AI-slop' guidelines: theme palette first, 60-70% dominant color ratio, avoid colored accent stripes/underline motifs, ban default blue/cream backgrounds, and classify fonts into QA-trustworthy and untrustworthy tiers (LibreOffice font-width metric differences can mislead overflow checks).

skills/pptx/SKILL.md
**NEVER use accent lines under titles** — these are a hallmark of AI-generated slides
Font strategy: 'Safe fonts (render true-to-width in QA *and* ship with Office): Arial, Calibri, Cambria…'—explicitly manages font metric discrepancies, as QA renders via LibreOffice while delivery targets PowerPoint.

2Core Capabilities

01Programmatic deck generation via pptxgenjs (including native charts, combo charts, icon pipeline, speaker notes) with comprehensive footgun guards
02Template & existing deck editing: unpack → slide XML editing → repackaging, thumbnail-based layout selection (thumbnail.py)
03Package-level bookkeeping for adding, deleting, and reordering slides (add_slide.py / clean.py)
04Structural validation: schema, relationships, content-type, chart validation, with --original template baselining
05Three-tiered QA: Content (markitdown + placeholder grep), File (validate.py), and Visual (rasterization inspection)
06Reading & parsing: markitdown text blocks + thumbnail grid; python-pptx compatibility warnings (cannot copy slides, lossy formatting, cannot read SVG-EMF)
07Design system: theme palette library (10 presets), layout, spacing, typography rules, and banned anti-pattern checklists

3External Dependencies

KindDependency / Endpoint
packagepptxgenjs(npm,deck 生成)
packagemarkitdown[pptx] / Pillow / defusedxml / lxml(pip:文本转储/缩略图/clean/validate)
packagereact-icons / react / react-dom / sharp(npm,图标管线,条件安装)
cliLibreOffice soffice(视觉 QA 渲染/.ppt 转换,经 soffice.py 包装)
clipdftoppm(Poppler,出图)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Executes local scripts or commands: add_slide.py / clean.py / thumbnail.py / validate.py / soffice.py (bundled Python
  • 本地工作目录: File I/O and artifact output: outputs deck/out.pptx, unpacked/ directory, thumbnail jpg files, and C source/shim/profiles in soffice.py tempdir
Audit Notes: Executes bundled Python/Node scripts and local CLIs (soffice/pdftoppm) to read and write local files, without outbound network traffic by default (npm/pip only conditionally fall back to official registries) and without reading credentials. Key considerations: 1) defusedxml (safe parser) is used instead of xml.etree when parsing/editing OOXML, mitigating XXE risks; 2) The icon pipeline runs Node locally (react-icons → sharp), relying on pre-installed or conditionally installed packages; 3) validate.py acts as a fallback gatekeeper for 'PowerPoint compatibility', addressing quality risks rather than security issues; 4) Proprietary license.

5Second-Pass Verification

  • [ok] office/ 树与 docx/xlsx 一致 — diff -rq 三目录 office/ 零差异;soffice.py/validate.py 为同一文件副本。
  • [ok] add_slide/clean/thumbnail 行为声明 — SKILL.md 表与正文描述(注册报路径、孤儿清理、labeled 网格)与各脚本 docstring/实现相符。
  • [ok] pptxgenjs 坑清单与 validate 兜底 — 'corrupts the file' 类规则 + 'After writeFile(), run validate.py' 原文在;validate.py 确有 chart/slide 检查逻辑。
  • [ok] defusedxml 安全解析 — SKILL.md 明文禁止 xml.etree 做变换并指定 defusedxml.minidom;脚本中实际使用 defusedxml。
  • [ok] 网络/凭证零命中 — 脚本无网络调用;环境变量仅 soffice.py 拷贝环境设 VCL 插件与 LD_PRELOAD(无读取密钥)。
  • [ok] 夸大检查 — description 'any time a .pptx or .potx file is involved'——正文覆盖 create/edit/template/read/QA 全链,无越界承诺;设计指导属 prompt 层(依赖模型遵循+validate 兜底)。
  • [ok] 元数据 — 本地 HEAD==pin 41bbe19;LICENSE 专有与 frontmatter 'Proprietary' 一致。

6Verdict & Scenarios

  • Ensures the delivery baseline: 'Guaranteed to open in PowerPoint'—the only workflow that explicitly flags pptxgenjs chart XML compatibility issues (which other tools pass) and enforces a validate checkpoint.
  • Engineered template templating: thumbnail selection → add_slide/clean package management → XML micro-edits → validate --original, directly applicable to branded template mass production.
  • Built-in QA and anti-slop guidelines: three-tiered QA paired with explicit bans on 'AI-generated looks' (accent underlines, color stripes, default blue).
  • Systematic handling of rendering differences: font QA trustworthiness grading and margin buffers make visual QA findings reliable.
  • Defensive XML editing using defusedxml with strict operational discipline (structure before content, slot ≠ item, single a:p per list item).
  • Best for: Ideal for batch production or templated creation of presentation decks (sales, training, reports) in managed environments, especially when strict template adherence and guaranteed PowerPoint opening are mandatory; design rules (palettes/layouts/fonts) also serve as an excellent team deck style baseline.
    Not for: Not suitable for environments lacking LibreOffice, poppler, or Node.js (breaks generation and visual QA); not suitable when pixel-perfect chart duplication is required over native PowerPoint chart semantics; not suitable for rapid plain-text drafting (process overhead is high); not suitable for organizations unable to accept proprietary licenses.
    Install Agent-Ready
    ① Verified Mirror 2026-09-09
    Option A · Direct DownloadDownload pptx.tar.gz
    sha256: fa29d7374c319c8e…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 41bbe19d1a.