Zum Inhalt springen
Skillpedia
PDF, Word & Folien7.8k · #12950

pptx-validation-fallback

Was er macht

Dieser Skill ist ein Ausweichweg, um .pptx-Dateien mit python-pptx zu prüfen. Er richtet sich an Menschen, die die Folienanzahl und die Titel eines Decks bestätigen müssen, das der Dateileser nicht verarbeiten kann.

Wann du ihn nutzt

  • ✓Wenn read_file bei einer PowerPoint-Datei scheitert oder unvollständige Informationen liefert.
  • ✓Wenn ich prüfen muss, dass eine Präsentation die erwartete Anzahl Folien hat.
  • ✓Wenn ich die Titel der Folien zur Durchsicht aufgelistet haben möchte.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pptx-validation-fallback/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Prüfe, dass meine Präsentation zehn Folien hat, und liste den Titel jeder Folie auf. Der normale Dateileser funktioniert hier nicht.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Die KI führt ein python-pptx-Skript über die Shell aus, das die Präsentation lädt, die Folienanzahl und jeden Titel ausgibt und die Anzahl mit der erwarteten vergleicht.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

PowerPoint Validation Fallback

When to Use

Use this skill when read_file fails to properly read or validate PowerPoint (.pptx) files. This provides a reliable alternative for verifying presentation contents including slide count, titles, and structure.

Procedure

Step 1: Check if read_file Failed

If read_file with filetype pptx returns errors, incomplete content, or cannot extract slide information, proceed to the fallback method.

Step 2: Use run_shell with python-pptx

Execute Python code via run_shell using the python-pptx library to inspect the presentation:

from pptx import Presentation

# Load the presentation
prs = Presentation('path/to/file.pptx')

# Get basic info
slide_count = len(prs.slides)
print(f"Total slides: {slide_count}")

# Extract slide titles
for i, slide in enumerate(prs.slides):
    if slide.shapes.title:
        title = slide.shapes.title.text
        print(f"Slide {i+1}: {title}")
    else:
        print(f"Slide {i+1}: [No title]")

Step 3: Validate Structure

Check that the presentation meets expected requirements:

from pptx import Presentation

prs = Presentation('path/to/file.pptx')

# Validation checks
expected_slides = 10  # Adjust based on requirements
actual_slides = len(prs.slides)

if actual_slides >= expected_slides:
    print(f"✓ Slide count OK: {actual_slides} slides")
else:
    print(f"✗ Insufficient slides: {actual_slides}/{expected_slides}")

# Check for content on each slide
for i, slide in enumerate(prs.slides):
    has_title = slide.shapes.title is not None
    has_content = len(slide.shapes) > 1
    print(f"Slide {i+1}: title={has_title}, content={has_content}")

Step 4: Extract Detailed Content (Optional)

For deeper validation, extract text content from all shapes:

from pptx import Presentation

prs = Presentation('path/to/file.pptx')

for i, slide in enumerate(prs.slides):
    print(f"\n=== Slide {i+1} ===")
    for shape in slide.shapes:
        if hasattr(shape, "text") and shape.text.strip():
            print(shape.text)

Expected Output

Successful validation should provide:

  • Confirmed slide count
  • List of slide titles
  • Verification that each slide has expected content structure

Common Use Cases

  • Verifying generated presentations have correct number of slides
  • Confirming slide titles match required topics
  • Validating presentation structure before delivery
  • Debugging why read_file cannot parse a .pptx file

Dependencies

The python-pptx library must be available in the execution environment. Most Python environments support it via pip:

pip install python-pptx
Häufige Fragen

Wie werden Folien ohne Titel behandelt?

Das Skript gibt einen Hinweis aus, dass die Folie keinen Titel hat.

Wie wird die Folienanzahl geprüft?

Das Skript vergleicht die tatsächliche Anzahl mit der erwarteten und meldet, ob die Prüfung besteht.

Welche Bibliothek liest die Datei?

python-pptx liest die Präsentation.

Details

Originalbeschreibung des Autors

Validate PowerPoint files using python-pptx when read_file fails

repo: HKUDS/AgentPilot

Beliebtheit

GitHub-Sterne
7.8k
Platz im Ranking
#12950
Lizenz
MIT
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills