Chuyển đến nội dung
Skillpedia
PDF, Word và slide7.8k · #12948

pptx-file-validation

Skill này làm gì

Skill này kiểm tra nội dung của tệp .pptx bằng cách đọc các slide bằng python-pptx. Dành cho người cần xác nhận một bản trình bày có đúng các slide trước khi dùng.

Khi nào nên dùng

  • ✓Khi trình đọc tệp thất bại khi đọc một tệp PowerPoint.
  • ✓Khi tôi cần xác nhận số slide và tiêu đề của một bộ slide.
  • ✓Khi tôi muốn kiểm tra cấu trúc của bản trình bày đã đầy đủ chưa.

Liên kết skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pptx-file-validation/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pptx-file-validation/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Trình đọc tệp của tôi không mở được PowerPoint này. Hãy kiểm tra xem nó có bao nhiêu slide và liệt kê từng tiêu đề slide.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI chạy một lệnh Python ngắn qua shell để tải bản trình bày, đếm slide và in tiêu đề từng slide, rồi báo mọi mục còn thiếu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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_file fails 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
Câu hỏi thường gặp

Kiểm tra báo cáo những gì?

Tổng số slide và tiêu đề của từng slide.

Tiêu đề thiếu được hiển thị thế nào?

Ví dụ in một chỗ giữ như No Title cho slide không có tiêu đề.

Kiểm tra có chỉ đọc không?

Có. Ví dụ chỉ đọc bản trình bày và không thay đổi nó.

Chi tiết

Mô tả gốc của tác giả

Validate PowerPoint files using python-pptx when standard file readers fail

repo: HKUDS/AgentPilot

Độ phổ biến

Sao GitHub
7.8k
Vị trí xếp hạng
#12948
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự