pptx-file-validation
它能做什么
这项技能通过 python-pptx 读取幻灯片,来检查 .pptx 文件的内容。它适合在使用演示文稿之前,需要确认其幻灯片是否正确的人。
适用场景
- ✓当文件读取器无法读取 PowerPoint 文件的时候。
- ✓当我需要确认演示文稿的幻灯片数量和标题的时候。
- ✓当我希望检查演示文稿的结构是否完整的时候。
技能链接
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pptx-file-validation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的文件读取器无法打开这份 PowerPoint。请检查它有多少张幻灯片,并列出每张幻灯片的标题。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会在 shell 中运行一段简短的 Python 命令,加载演示文稿,统计幻灯片数量并打印每张幻灯片的标题,然后报告任何缺失的项目。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
PPTX File Validation Workflow
This skill provides a reliable method to validate PowerPoint (.pptx) files when the built-in read_file function fails or returns insufficient information.
When to Use
read_filefails to read a .pptx file- You need to verify presentation contents (slide count, titles, structure)
- Standard file readers return incomplete or unreadable data
Step-by-Step Instructions
Step 1: Detect read_file Failure
Attempt to read the PowerPoint file using read_file. If it fails, returns garbled content, or doesn't provide the structural information you need, proceed to Step 2.
Step 2: Use run_shell with python-pptx
Execute a Python script using run_shell with the python-pptx library to inspect the presentation:
python3 -c "
from pptx import Presentation
prs = Presentation('path/to/file.pptx')
print(f'Total slides: {len(prs.slides)}')
for i, slide in enumerate(prs.slides, 1):
print(f'Slide {i}: {slide.shapes.title.text if slide.shapes.title else \"[No Title]\"}')
"
Step 3: Parse and Validate Output
Analyze the output to verify:
- Slide count matches expected number
- Slide titles align with required topics
- Structure is complete and properly formatted
Step 4: Report Validation Results
Document the validation findings, including:
- Total number of slides
- List of slide titles
- Any missing or problematic content
Example Usage
# In your agent workflow
run_shell(command="python3 -c \"from pptx import Presentation; prs = Presentation('output.pptx'); print(f'Slides: {len(prs.slides)}'); [print(f'{i}: {s.shapes.title.text}') for i, s in enumerate(prs.slides, 1) if s.shapes.title]\"")
Prerequisites
Ensure python-pptx is available in the environment:
pip install python-pptx
Benefits
- Reliable: Works when built-in readers fail
- Detailed: Provides slide-by-slide breakdown
- Programmatic: Easy to parse and validate against requirements
- Lightweight: No need for PowerPoint software installation
常见问题
检查会报告什么?
幻灯片的总数,以及每张幻灯片的标题。
缺少标题时如何显示?
示例会为没有标题的幻灯片打印占位文字 No Title。
这项检查是只读的吗?
是的。示例只读取演示文稿,不会修改它。
详情
作者的原始描述
Validate PowerPoint files using python-pptx when standard file readers fail
repo: HKUDS/AgentPilot
热度
- GitHub 星标
- 7.8k
- 排名
- #12948
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
agentpilot
7.8k帮你的智能体准备任务并运行 AgentPilot 循环,逐步改进项目:循环会提出修改、测试修改并为其打分。
openspace
7.8k帮你的智能体设置 OpenSpace,这是一个用于存储和获取智能体技能的工具,并通过 MCP 将其连接到你的 AI 应用。
rsi-arena
7.8k帮你的智能体设置并运行标准 AI 基准测试,例如 AIME 和 Terminal-Bench,用来比较不同的改进方法。
experiment-guide
7.8k帮你的智能体规划小型实验、阅读实验结果并记录发现,同时研究如何改进一个程序。