pptx-file-validation
Validate PowerPoint files using python-pptx when standard file readers fail
- License 许可
- MIT
- 所属仓库
- HKUDS/AgentPilot
- 最近更新
- 2026-11-12
- Stars
- ★ 8.0k
- Forks
- 941
01 前言 Front Matter
- name
- pptx-file-validation
- description
- Validate PowerPoint files using python-pptx when standard file readers fail
02 资源文件 1
- 其他.skill_id34 B
03 SKILL.md 正文
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
04 同仓库更多 Skills
agentpilot
Set up AgentPilot and use its single entry to prepare missing inputs and run configured RSI experiments. Use when the user requests AgentPilot installation or work with AgentPilot.
remember
Review auto-memory entries and propose promotions to OPENSPACE.md, OPENSPACE.local.md, or retained auto-memory topics; detect duplicates, stale facts, conflicts, and ambiguous entries before making changes.
skill-discovery
Search reusable OpenSpace skills locally, and browse cloud packages step by step when a cloud skill may help. Reusing proven skills saves tokens, improves reliability, and extends your capabilities beyond built-in tools.
delegate-task
Delegate tasks to OpenSpace — a full-stack autonomous worker for coding, DevOps, web research, and desktop automation, backed by an extensive MCP tool and skill library. Skills auto-improve through use, reducing token consumption over time. A cloud community lets agents share and collectively evolve reusable skills.
write-special-chars-ts-check
Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.
write-special-chars-readback
Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of /tmp helper scripts.