verify-directory-structure
它能做什么
这个技能提供一种修复文件访问问题的简单方法。它先检查文件夹,再重试任务。适合智能体无法在预期位置打开或保存文件的任何人。
适用场景
- ✓当脚本或文件操作因为文件夹似乎不存在而失败时。
- ✓当你怀疑权限问题阻止了文件的读取或保存时。
- ✓当你想在运行任务前检查文件夹结构时。
技能链接
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/verify-directory-structure/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查我指定的文件夹是否存在,如果不存在就修复它。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体列出文件夹及其内容,如果文件夹缺失就创建它或修复权限,然后重试原来的步骤。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Verify Directory Structure
This skill provides a systematic approach to diagnosing and resolving file access issues by first verifying the directory structure. It is particularly useful when dealing with file operations, script executions, or any task that involves accessing files.
Steps
- Identify the Target Path: Determine the file or directory path that is causing the access issue.
- Check Directory Existence: Use the
list_dirtool to verify if the directory exists and inspect its contents. - Verify Permissions: Ensure that the user has the necessary permissions to access the directory and its contents.
- Resolve Path Issues: If the directory does not exist, create it using appropriate commands or scripts. If permissions are insufficient, adjust them accordingly.
- Retry the Operation: After resolving the directory structure issues, retry the original operation.
Example
# Example of using the list_dir tool to verify directory structure
list_dir --path "/path/to/directory"
Best Practices
- Always verify the directory structure before performing file operations.
- Use absolute paths to avoid ambiguity.
- Log the directory structure for debugging purposes if issues persist.
常见问题
如果文件夹不存在怎么办?
技能建议先创建它,然后重试操作。
我应该使用完整的文件路径吗?
应该。技能推荐使用绝对路径,以避免混淆。
如果问题仍然存在怎么办?
技能建议记录文件夹内容,以便更容易找到原因。
详情
作者的原始描述
Diagnose and resolve file access issues by first verifying the directory structure.
repo: HKUDS/AgentPilot
热度
- GitHub 星标
- 7.8k
- 排名
- #13090
- 许可证
- 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帮你的智能体规划小型实验、阅读实验结果并记录发现,同时研究如何改进一个程序。