ppt-generation-resilient
Skill này làm gì
Skill này mô tả cách đáng tin cậy để tạo tệp .pptx với hai lộ trình và kiểm tra thư mục. Dành cho người cần bộ slide được làm ổn định.
Khi nào nên dùng
- ✓Khi tôi cần một bản trình bày với nội dung và cấu trúc slide cụ thể.
- ✓Khi việc tạo PowerPoint của trợ lý trả về lỗi mơ hồ.
- ✓Khi tôi muốn xác nhận vị trí tệp sau khi tạo.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/ppt-workflow-location-enhanced-877e03/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo một bản trình bày có slide tiêu đề và sáu slide nội dung về kết quả quý của chúng tôi. Hãy xác nhận tệp được lưu ở đâu.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI ghi lại thư mục làm việc, nhờ trợ lý tạo bộ slide với đường dẫn tệp đã nêu, và chuyển sang python-pptx có ghi lỗi nếu trợ lý thất bại.
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.
Resilient PowerPoint Generation Workflow
When to Use This Skill
Use this workflow when:
- You need to create PowerPoint presentations with specific slide content and structure
- Direct document generation tools fail or are unavailable
- shell_agent encounters opaque errors during PowerPoint generation
- Output files may be created in unexpected nested directories within the workspace
Overview
This workflow provides a resilient approach with two tiers:
- Primary: shell_agent delegation with clear specifications
- Fallback: Direct Python execution using python-pptx library with proper error capture
Step 0: Verify Working Directory
Before starting, establish your working directory context:
# Capture current working directory
pwd
# Store for later reference
WORK_DIR=$(pwd)
echo "Working directory: $WORK_DIR"
Step 1: Attempt PowerPoint Generation via shell_agent (Primary)
Delegate the PowerPoint creation task to shell_agent with explicit specifications:
Use shell_agent to create a PowerPoint presentation with:
- Specify the exact number of slides needed
- Define the content/topic for each slide
- Request the file be saved with a clear filename (e.g., presentation.pptx)
- Ask the agent to confirm the file path after creation using: echo "FILE_PATH: $(pwd)/presentation.pptx"
- Request that any errors be printed to stderr with full tracebacks
Example task description:
Create a PowerPoint presentation with 10 slides covering [topic]. Each slide should have a title and bullet points. Save it as presentation.pptx in the current working directory. After creation, run: echo "FILE_PATH: $(pwd)/presentation.pptx" and report any errors with full tracebacks.
Wait for shell_agent response. If successful with file path confirmed, proceed to Step 4. If shell_agent fails or returns opaque errors, proceed to Step 2.
Step 2: Fallback to Direct Python Execution with python-pptx
When shell_agent fails, create and execute a Python script directly:
2a: Create the Python Script
Write the PowerPoint generation script to a .py file first:
# save as generate_pptx.py
from pptx import Presentation
from pptx.util import Inches, Pt
import os
# Verify working directory
print(f"Working directory: {os.getcwd()}")
# Create presentation
prs = Presentation()
# Slide 1: Title slide
slide_layout = prs.slide_layouts[0]
slide = prs.slides.add_slide(slide_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "Your Title"
subtitle.text = "Your Subtitle"
# Additional slides (add as needed)
for i in range(2, 11):
slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(slide_layout)
title = slide.shapes.title
content = slide.placeholders[1]
title.text = f"Slide {i} Title"
content.text = f"• Bullet point 1\n• Bullet point 2\n• Bullet point 3"
# Save with full path verification
output_path = os.path.join(os.getcwd(), "presentation.pptx")
prs.save(output_path)
print(f"FILE_PATH: {output_path}")
print(f"File size: {os.path.getsize(output_path)} bytes")
2b: Execute with Full Error Capture
Run the script with stderr redirected to capture actual errors:
# Execute with full error output capture
python generate_pptx.py 2>&1 | tee execution_log.txt
# Or if using run_shell tool, ensure 2>&1 is included
python generate_pptx.py 2>&1
Critical: The 2>&1 redirect ensures Python exceptions are captured, not masked as "unknown error".
2c: Verify Script Execution Output
Check the execution log for:
FILE_PATH:confirmation line- File size confirmation
- Any error tracebacks in
execution_log.txt
Step 3: Locate the Output File
PowerPoint files may be in nested workspace directories. Use find to locate them:
# Find all .pptx files in the workspace
find . -name "*.pptx" -type f 2>&1
# Or search for a specific filename
find . -name "presentation.pptx" -type f 2>&1
# If not found, search broader (may require elevated permissions)
find /workspace -name "*.pptx" -type f 2>/dev/null
Expected output format:
./presentation.pptx
or
./workspace/task_123/output/presentation.pptx
Step 4: Copy to Working Directory
Once located, copy the file to your working directory:
# Copy the found file to current directory
cp /path/to/found/presentation.pptx .
# Or move it if you prefer
mv /path/to/found/presentation.pptx .
# Verify copy succeeded
ls -la presentati
Câu hỏi thường gặp
Vì sao lưu thư mục làm việc trước?
Nó cho một điểm tham chiếu để tìm nơi tệp được lưu.
Đường dẫn tệp được xác nhận thế nào?
Trợ lý được yêu cầu in đường dẫn đầy đủ sau khi lưu.
Lỗi có hiển thị không?
Hướng dẫn yêu cầu in lỗi với chi tiết đầy đủ.
Chi tiết
Mô tả gốc của tác giả
Robust PowerPoint generation with shell_agent primary approach and python-pptx fallback, including working directory verification and inline error debugging
repo: HKUDS/AgentPilot
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12944
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agentpilot
7.8kGiúp agent của bạn cải thiện dự án từng bước bằng cách chuẩn bị tác vụ và chạy vòng lặp AgentPilot, gồm đề xuất, kiểm thử và chấm điểm thay đổi.
openspace
7.8kGiúp agent của bạn thiết lập OpenSpace, công cụ lưu và lấy lại skill của agent, rồi kết nối nó với ứng dụng AI của bạn qua MCP.
rsi-arena
7.8kGiúp agent của bạn thiết lập và chạy các bài kiểm thử benchmark AI chuẩn, như AIME và Terminal-Bench, để so sánh các phương pháp cải tiến khác nhau.
experiment-guide
7.8kGiúp agent của bạn lên kế hoạch các thí nghiệm nhỏ, đọc kết quả và ghi lại phát hiện khi tìm cách cải thiện một chương trình.
Skill tương tự
feishu-doc
394kGiúp agent của bạn đọc, tạo và sửa tài liệu đám mây Feishu, gồm văn bản, hình ảnh và bảng, bằng công cụ tài liệu.
feishu-drive
394kCho phép agent của bạn duyệt, sắp xếp và bình luận các file trong một thư mục đám mây Feishu đã được chia sẻ với bot.
feishu-perm
394kGiúp agent của bạn kiểm tra và thay đổi ai có quyền truy cập một file Feishu, chọn quyền nhỏ nhất đáp ứng yêu cầu của bạn.