跳到正文
Skillpedia
智能体7.8k · #12998

shell-agent-file-workflow

它能做什么

这项工作流程指导 AI 智能体让 shell 智能体制作复杂的文件,然后找到它们。它适合在幻灯片、文档或 PDF 等格式上,文件工具失败的人。

适用场景

  • ✓当直接的文件创建工具在幻灯片或文档等复杂格式上失败的时候。
  • ✓当文件的生成需要多个步骤、库或错误修复的时候。
  • ✓当生成的文件可能保存在你不易找到的嵌套文件夹中的时候。

技能链接

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-agent-file-workflow/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请为我的季度回顾制作一份 PowerPoint。直接工具失败了,请让 shell 智能体制作它,然后找到这个文件。”

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

工作原理

智能体会给 shell 智能体一项清晰的任务。shell 智能体完成后,智能体会按名称和最近修改时间,在工作区中搜索新文件,从而在任意嵌套文件夹中找到它。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Shell Agent File Generation Workflow

When direct document or file generation approaches fail, delegate the task to shell_agent which can autonomously write code, execute it, and retry on errors. Generated files may appear in nested workspace directories.

When to Use

  • Direct file generation tools or create_file functions fail for complex formats
  • Complex file creation requiring multiple steps, libraries, or error recovery
  • When you need an autonomous agent to figure out how to accomplish a goal
  • File generation that requires iteration and automatic error fixing

Workflow Steps

Step 1: Delegate File Generation to shell_agent

Use shell_agent with a clear, specific task description:

shell_agent(task="Create a [file type] with [specific content/structure requirements]")

The agent will:

  • Decide whether to use Python or Bash
  • Write and execute code
  • Inspect output and iterate
  • Automatically retry and fix errors (up to several rounds)

Step 2: Locate Generated Files

Files may be created in nested directories within the workspace. Use find to locate them:

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

For multiple file types:

find . -type f \( -name "*.pptx" -o -name "*.docx" -o -name "*.pdf" \)

For recently modified files (last 10 minutes):

find . -name "*.extension" -type f -mmin -10

Step 3: Copy Files to Working Directory

Once located, copy the file to your working directory:

cp /path/to/found/file.extension ./

Example

Creating a PowerPoint Presentation

# Step 1: Delegate to shell_agent
shell_agent(task="Create a 10-slide PowerPoint presentation covering: topic A, topic B, topic C")

# Step 2: Find the generated file
find . -name "*.pptx" -type f

# Output might show: ./workspace/nested/path/presentation.pptx

# Step 3: Copy to working directory
cp ./workspace/nested/path/presentation.pptx ./

Creating a PDF Report

# Step 1: Delegate generation
shell_agent(task="Generate a PDF report with charts and tables from the provided data")

# Step 2: Locate output
find . -name "*.pdf" -type f -mmin -5

# Step 3: Retrieve file
cp ./generated/reports/output.pdf ./

Tips

  • Be specific in task description: Include file format, structure, and content requirements explicitly
  • Check multiple extensions: If unsure of output format, search for common extensions
  • Use modification time: Filter by recent files to identify newly created outputs
  • Verify file integrity: After copying, check that the file is valid and complete

Troubleshooting

Issue Solution
No files found Expand search: remove extension filter, increase time window
Multiple files found Sort by modification time: find . -name "*.ext" -type f -printf '%T@ %p\n' | sort -n
File is corrupted Re-run shell_agent with more specific requirements
Permission errors Use sudo or check directory permissions
常见问题

智能体如何找到文件?

它使用 find 命令按文件类型搜索,并可以筛选出最近几分钟内修改过的文件。

它能搜索哪些文件类型?

这项技能以 PowerPoint、Word 和 PDF 文件为例。

如果存在多个版本怎么办?

这项技能建议按修改时间进行筛选,以选出最新的那个。

详情

作者的原始描述

Delegate file generation to shell_agent when direct tools fail, with systematic file location and retrieval

repo: HKUDS/AgentPilot

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能