跳到正文
Skillpedia
通用编程7.8k · #13090

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

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

可以这样问 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

  1. Identify the Target Path: Determine the file or directory path that is causing the access issue.
  2. Check Directory Existence: Use the list_dir tool to verify if the directory exists and inspect its contents.
  3. Verify Permissions: Ensure that the user has the necessary permissions to access the directory and its contents.
  4. Resolve Path Issues: If the directory does not exist, create it using appropriate commands or scripts. If permissions are insufficient, adjust them accordingly.
  5. 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能