跳到正文
Skillpedia
PDF、Word 与幻灯片7.8k · #12999

shell-doc-gen-and-locate

它能做什么

这项技能展示当直接的库调用失败时,AI 智能体如何通过脚本制作演示文稿或 PDF,然后把文件移到工作文件夹。它适合需要通过脚本生成幻灯片或 PDF 的人。

适用场景

  • ✓当直接的文档创建失败,而 shell 脚本可以生成该文件的时候。
  • ✓当你需要的 PowerPoint 或 PDF 文件被脚本保存到了意想不到的位置的时候。
  • ✓当你希望把完成的文件移到工作文件夹,方便访问的时候。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-doc-gen-and-locate/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用脚本根据我的大纲生成一份 PowerPoint,然后找到该文件,并把它移到我的工作文件夹。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会编写一个创建文件并打印确认信息的脚本。随后它用 find 在工作区中搜索输出,必要时按最近修改时间筛选,并把文件复制到工作文件夹。

技术内容(原始 SKILL.md)

作者在 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.
常见问题

为什么脚本需要打印一条信息?

打印的确认信息表明脚本已经完成,帮助智能体知道何时去查找文件。

智能体如何找到 PDF?

它会在整个工作区中递归搜索 PDF 文件。

它能选出正确的版本吗?

可以。这项技能建议在存在多个版本时,按修改时间进行筛选。

详情

作者的原始描述

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

repo: HKUDS/AgentPilot

热度

GitHub 星标
7.8k
排名
#12999
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能