Skip to content
Skillpedia
PDF, Word & slides7.8k · #12999

shell-doc-gen-and-locate

What it does

This skill shows the AI agent how to create presentations or PDFs by script when direct library calls fail, then bring the file to the working folder. It is for people who need slides or PDFs from a script.

When to use it

  • ✓When direct document creation fails and a shell script can produce the file instead.
  • ✓When you need a PowerPoint or PDF file that the script saved somewhere unexpected.
  • ✓When you want the finished file moved into the working folder for easy access.

Skill link

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-doc-gen-and-locate/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-doc-gen-and-locate/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Generate a PowerPoint from my outline with a script, then find the file and move it to my working folder.”

5 new skills a week. 1 minute to read.

How it works

The agent writes a script that creates the file and prints a confirmation. It then uses find to search the workspace for the output, filters by recent changes if needed, and copies the file to the working folder.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.
FAQ

Why does the script need to print a message?

The printed confirmation shows the script finished, which helps the agent know when to look for the file.

How does the agent find a PDF?

It runs a recursive find for PDF files across the workspace.

Can it pick the right version?

Yes, the skill suggests filtering by modification time when several versions exist.

Details

Original description by the author

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

repo: HKUDS/AgentPilot

Popularity

GitHub stars
7.8k
Ranking position
#12999
License
MIT
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills