pptx
它能做什么
这项技能处理 PowerPoint 演示文稿,从读取幻灯片文字到根据简要说明制作新演示文稿。它适合需要以 PowerPoint 格式制作或更新幻灯片的人。
适用场景
- ✓当你需要根据简要说明或大纲创建 PowerPoint 文件时。
- ✓当你需要更新现有演示文稿、并保留其模板的时候。
- ✓当你需要提取 .pptx 文件中的文字和演讲者备注的时候。
技能链接
https://github.com/TokenRhythm/opensquilla/blob/main/src/opensquilla/skills/bundled/pptx/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我把这份大纲做成一份十页的 PowerPoint,并使用我们公司的模板。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在工作区中使用模板的版式制作演示文稿,然后检查幻灯片并发布完成的文件。如果当前会话无法创建文件,智能体会直接说明,而不是粘贴代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
pptx
Work with PowerPoint .pptx decks. The pptx file format is OOXML — a zip
container holding XML descriptions of slides, layouts, masters, and media.
Delivery rule
First, use the available tool list for this session to choose the delivery path.
If write_file, edit_file, apply_patch, or execute_code is available:
- Build the
.pptxin the active workspace using the paths below. - Call
publish_artifactfor the final.pptxbefore your final reply when that tool is available. - The code examples later in this document apply.
In restricted channels, run the inline Python examples with execute_code
and save workspace-relative files before calling publish_artifact. Shell,
Node, and LibreOffice commands require the corresponding exposed tool and
runtime. Do not use Python subprocesses to bypass an unavailable shell tool,
and do not retry generation on the host when sandbox execution fails.
If none of those file-authoring tools are available:
- Do not attempt to generate, save, or modify the
.pptx. - Do not paste OOXML, Python, JavaScript, HTML, or other source as a substitute for sending the deck.
- Ignore the Path B, Path C, and Visual QA sections below; they do not apply when file authoring is unavailable.
- Reply plainly: explain that the current session cannot create files, and
offer to publish an existing
.pptxby path, describe the slide contents in text, or continue in a file-authoring surface such as the OpenSquilla Web UI.
In all cases, do not paste full file source as the deliverable. Source code is appropriate only when the user explicitly asks for code.
Decide the path first
Pick one of three paths up front; do not mix them. The right path depends only on what is on disk before you start.
| You have | Goal | Path |
|---|---|---|
Existing .pptx |
Read text only | A. Read |
Existing .pptx |
Modify content while keeping the design | B. Edit-in-place |
| Nothing, or a brief | Build a new deck | C. Create from scratch |
If the user hands you a deck and asks for changes, default to path B and treat the input deck as the visual style baseline. Only fall back to path C when the user explicitly says "start fresh" or there is no input deck.
Path A: Read text from a .pptx
When shell execution is available, use the helper script. It walks slides via
the python-pptx public API and prints text grouped by slide. With
execute_code, use the inline Python example instead.
python {baseDir}/scripts/extract_text.py /path/to/deck.pptx
python {baseDir}/scripts/extract_text.py /path/to/deck.pptx --json
For programmatic use, call python-pptx directly:
from pptx import Presentation
prs = Presentation("deck.pptx")
for i, slide in enumerate(prs.slides, 1):
for shape in slide.shapes:
if shape.has_text_frame:
for para in shape.text_frame.paragraphs:
print(i, "".join(run.text for run in para.runs))
If markitdown is available, it gives a faster Markdown rendering:
python -m markitdown deck.pptx
Path B: Edit an existing deck
Two sub-strategies; pick by how invasive the edit is.
B1. Text-only edits (preferred)
When the change is "swap this string for that one" or "fill these placeholders": use python-pptx to mutate runs in place. This preserves all theme/master/font settings.
from pptx import Presentation
prs = Presentation("input.pptx")
slide = prs.slides[0]
for shape in slide.shapes:
if not shape.has_text_frame:
continue
for para in shape.text_frame.paragraphs:
for run in para.runs:
if run.text == "{{TITLE}}":
run.text = "Q3 Review"
prs.save("output.pptx")
Edit at the run level, not the paragraph level — replacing whole paragraph
text drops formatting. If a placeholder spans multiple runs (often happens
when the original template had partial bold/italic), concatenate the runs into
the first run and clear the others.
B2. Structural edits (add/remove/reorder slides, change layouts)
python-pptx's slide-level mutation is limited (no public reorder API). For
structural work, unzip the .pptx, patch ppt/presentation.xml and the
slide files, and repack:
mkdir _unpacked && (cd _unpacked && unzip -q ../input.pptx)
# edit _unpacked/ppt/presentation.xml (sldIdLst order)
# edit _unpacked/ppt/slides/slideN.xml content
(cd _unpacked && zip -q -r ../output.pptx . -x "*.DS_Store")
Rules
常见问题
如果会话无法创建文件怎么办?
该技能说明,智能体应解释这一限制,并提出改为处理现有文件。
它会保留我的模板吗?
会。该技能在编辑时会保留模板及其版式。
它能读取演讲者备注吗?
能。该技能涵盖从演示文稿中提取文字和演讲者备注。
详情
作者的原始描述
Read, inspect, edit, or create PowerPoint `.pptx` presentations, including text extraction, template-preserving changes, slide review, and generation from a brief.
repo: TokenRhythm/opensquilla
热度
- GitHub 星标
- 7.1k
- 排名
- #13591
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
browser-use
7.1k让你的智能体在 OpenSquilla Desktop 侧边栏浏览器中打开、阅读和操作网页,包括填写表单和进行视觉检查。
deep-research
7.1k教你的智能体进行多轮研究,使用已保存的计划、已追踪的来源,并生成带引用的长篇报告。
docx
7.1k帮你的智能体阅读、编辑或创建 Word .docx 文件,同时保持格式、修订记录和结构完整。
html-coder
7.1k帮你的智能体编写结构清晰的 HTML 页面,包含无障碍表单、媒体和 HTML5 功能,并可作为网页预览打开。