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

shell-doc-gen-and-locate

Skill này làm gì

Skill này chỉ cho AI agent cách tạo bài thuyết trình hoặc PDF bằng script khi các lệnh thư viện trực tiếp thất bại, rồi đưa file về thư mục làm việc. Nó dành cho những người cần slide hoặc PDF từ một script.

Khi nào nên dùng

  • ✓Khi tạo tài liệu trực tiếp thất bại và một script shell có thể tạo ra file thay thế.
  • ✓Khi bạn cần file PowerPoint hoặc PDF mà script đã lưu ở một nơi không mong đợi.
  • ✓Khi bạn muốn đưa file đã hoàn tất vào thư mục làm việc để dễ truy cập.

Liên kết skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-doc-gen-and-locate/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/shell-doc-gen-and-locate/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

“Tạo một bài PowerPoint từ dàn ý của tôi bằng một script, rồi tìm file và chuyển nó vào thư mục làm việc của tôi.”

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

Cách hoạt động

Agent viết một script tạo file và in một xác nhận. Sau đó nó dùng find để tìm đầu ra trong không gian làm việc, lọc theo thay đổi gần đây nếu cần, rồi sao chép file vào thư mục làm việc.

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.

Shell Document Generation and Retrieval Workflow

Objective

Enable reliable file creation (e.g., PowerPoint, PDFs) when direct API or library-based generation fails, ensuring the final artifact is located and moved to the working directory regardless of nested output paths.

When to Use

  • Standard document generation tools (e.g., direct Python library calls in-memory) fail or are unavailable.
  • The shell_agent capability is available for executing scripts.
  • Generated files may be saved in unpredictable nested directories within the workspace.

Procedure

1. Attempt Shell-Based Generation

If direct tool invocation fails, delegate file creation to a shell-executed script.

  • Write a script (e.g., generate_presentation.py or make_doc.sh) that produces the file.
  • Execute the script via the shell agent.
  • Ensure the script prints confirmation upon completion.

2. Locate the Output File

Do not assume the file is in the current directory. Shell scripts often create outputs in nested folders (e.g., ./workspace/output/, ./build/).

  • Use the find command to search the workspace recursively.

  • Example for PowerPoint files:

    find . -type f -name "*.pptx"

  • Example for PDF files:

    find . -type f -name "*.pdf"

  • Filter results by modification time if multiple versions exist (e.g., -mmin -10).

3. Retrieve to Working Directory

Once the file path is identified:

  • Copy the file to the root working directory or the expected delivery location.

    cp /path/to/nested/file.pptx ./

  • Verify the file exists and is non-zero size.

4. Verification

  • Confirm the file opens correctly or meets size expectations.
  • If the file is not found after find, check stderr of the generation script for path clues.

Best Practices

  • Explicit Paths: Whenever possible, configure generation scripts to output to a known relative path (e.g., ./output/filename.pptx).
  • Cleanup: Remove nested temporary copies after retrieving the final version to avoid confusion.
  • Logging: Echo the final absolute path of the generated file in the script stdout to simplify locating.
Câu hỏi thường gặp

Tại sao script cần in một thông báo?

Thông báo xác nhận cho thấy script đã kết thúc, giúp agent biết khi nào cần tìm file.

Agent tìm file PDF bằng cách nào?

Nó chạy find đệ quy để tìm các file PDF trong toàn bộ không gian làm việc.

Nó có chọn đúng phiên bản không?

Có, skill gợi ý lọc theo thời gian sửa đổi khi có nhiều phiên bản.

Chi tiết

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

Generate documents via shell commands and locate nested outputs using find.

repo: HKUDS/AgentPilot

Độ phổ biến

Sao GitHub
7.8k
Vị trí xếp hạng
#12999
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ự