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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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_agentcapability 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.pyormake_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
findcommand 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
评论
- …
同一仓库的更多技能
agentpilot
7.8k帮你的智能体准备任务并运行 AgentPilot 循环,逐步改进项目:循环会提出修改、测试修改并为其打分。
openspace
7.8k帮你的智能体设置 OpenSpace,这是一个用于存储和获取智能体技能的工具,并通过 MCP 将其连接到你的 AI 应用。
rsi-arena
7.8k帮你的智能体设置并运行标准 AI 基准测试,例如 AIME 和 Terminal-Bench,用来比较不同的改进方法。
experiment-guide
7.8k帮你的智能体规划小型实验、阅读实验结果并记录发现,同时研究如何改进一个程序。