pptx-shell-verify
Verify PowerPoint presentation contents using python-pptx via shell when standard file readers fail
- License 许可
- MIT
- 所属仓库
- HKUDS/AgentPilot
- 最近更新
- 2026-11-12
- Stars
- ★ 8.0k
- Forks
- 944
01 前言 Front Matter
- name
- pptx-shell-verify
- description
- Verify PowerPoint presentation contents using python-pptx via shell when standard file readers fail
02 资源文件 1
- 其他.skill_id31 B
03 SKILL.md 正文
PowerPoint Shell Verification
When to Use This Skill
Use this skill when:
read_fileor other built-in tools fail to read PowerPoint (.pptx) files- You need to verify presentation structure (slide count, titles, content)
- Standard file inspection methods return errors or incomplete data
Prerequisites
- Python 3.x installed in the execution environment
python-pptxlibrary available (install if needed)
Step-by-Step Instructions
Step 1: Attempt Standard File Read
First, try to read the file using standard methods:
read_file: path/to/presentation.pptx
If this fails or returns unusable data, proceed to Step 2.
Step 2: Verify python-pptx Availability
Check if the library is installed:
run_shell: python -c "import pptx; print('pptx available')"
If not available, install it:
run_shell: pip install python-pptx
Step 3: Create Verification Script
Create a Python script to extract presentation metadata:
# verify_pptx.py
from pptx import Presentation
import sys
import json
def verify_presentation(filepath):
try:
prs = Presentation(filepath)
data = {
"slide_count": len(prs.slides),
"slides": []
}
for i, slide in enumerate(prs.slides):
slide_data = {
"slide_number": i + 1,
"title": None,
"shapes_count": len(slide.shapes)
}
# Extract title if present
if slide.shapes.title:
slide_data["title"] = slide.shapes.title.text
data["slides"].append(slide_data)
print(json.dumps(data, indent=2))
return True
except Exception as e:
print(f"ERROR: {str(e)}", file=sys.stderr)
return False
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python verify_pptx.py <file.pptx>", file=sys.stderr)
sys.exit(1)
success = verify_presentation(sys.argv[1])
sys.exit(0 if success else 1)
Step 4: Execute Verification
Run the verification script:
run_shell: python verify_pptx.py path/to/presentation.pptx
Step 5: Interpret Results
Expected output format:
{
"slide_count": 10,
"slides": [
{
"slide_number": 1,
"title": "Introduction",
"shapes_count": 3
},
...
]
}
Use this data to:
- Confirm expected slide count matches
- Verify slide titles are present
- Validate presentation structure before delivery
Example Validation Checks
# Check slide count matches requirement
assert data["slide_count"] >= expected_min_slides
# Check all slides have titles
for slide in data["slides"]:
assert slide["title"] is not None, f"Slide {slide['slide_number']} missing title"
Troubleshooting
| Issue | Solution |
|---|---|
| Corrupted file | Verify file was created successfully, check file size |
| Permission denied | Ensure file path is accessible, check read permissions |
| Library not found | Install with pip install python-pptx |
| Empty presentation | File may be 0 bytes or incomplete write |
Best Practices
- Always verify after creation: Run verification immediately after generating a PowerPoint file
- Keep verification script reusable: Store the script for future presentations
- Validate before delivery: Never deliver a presentation without confirming structure
- Log verification results: Keep verification output for audit trails
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.