file-locate-verify
하는 일
이 스킬은 위치를 모르는 파일을 찾은 뒤 확인하는 단계별 방법입니다. 스크립트나 AI 작업이 파일 없음 오류로 멈추는 사람에게 맞습니다.
사용하는 경우
- ✓FileNotFoundError나 비슷한 경로 오류를 받았을 때.
- ✓컴퓨터에서 파일이 정확히 어디에 있는지 모를 때.
- ✓다음 단계가 의존하기 전에 파일이 있는지 확인하고 싶은 경우.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/file-locate-verify/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“스크립트가 파일을 찾지 못한다고 합니다. 아무것도 실행하기 전에 이 컴퓨터에서 파일을 찾고 경로를 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 현재 폴더를 나열하고, find로 파일 이름을 검색한 뒤, 다음 단계에서 쓰기 전에 찾은 경로를 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
File Locate and Verify Workflow
When encountering FileNotFoundError or uncertain file paths, follow this systematic pattern to safely locate and verify files before executing operations.
When to Use
- You receive a FileNotFoundError or similar path-related error
- You need to work with files whose exact location is unknown
- You want to verify file existence before executing operations that depend on those files
Step-by-Step Procedure
Step 1: Check Current Directory Contents
First, use list_dir to inspect what files exist in your current working directory:
# Use the list_dir tool to see current directory contents
list_dir(path=".")
This reveals files in the immediate context and helps determine if you need to search elsewhere.
Step 2: Search for the File Using Find
If the file is not in the current directory, use the find command to locate it by name:
# Search for a specific file by name (case-insensitive)
find . -iname "filename.pdf" 2>/dev/null
# Or search from root for system-wide files
find / -name "filename.pdf" 2>/dev/null
Tips:
- Use
-inamefor case-insensitive matching - Redirect stderr with
2>/dev/nullto suppress permission errors - Narrow the search scope when possible for better performance
Step 3: Verify the Discovered Path
Before executing any operations on the discovered file, verify it exists and check its properties:
# Verify file existence and permissions at the full path
ls -la /full/path/to/discovered/file.pdf
This confirms:
- The file actually exists at the located path
- File permissions (can you read/write it?)
- File size and modification time
Step 4: Execute Your Operation Safely
Only after verification, proceed with your intended operation:
# Now safe to work with the verified path
file_path = "/full/path/to/discovered/file.pdf"
# ... your extraction or processing code here
Complete Example
# Task: Process a file that may be in an unknown location
# Step 1: Check current directory
dir_contents = list_dir(path=".")
print(f"Current directory contains: {dir_contents}")
# Step 2: Find the file if not present
if "target_file.xlsx" not in dir_contents:
result = run_shell(command='find . -iname "target_file.xlsx" 2>/dev/null')
file_path = result.stdout.strip().split('\n')[0]
print(f"Found file at: {file_path}")
# Step 3: Verify before proceeding
verification = run_shell(command=f'ls -la {file_path}')
print(f"Verification: {verification.stdout}")
# Step 4: Proceed with operation
# ... your code to process the file
Common Pitfalls to Avoid
- Skipping verification: Never assume the path from
findis correct without checking - Using relative paths blindly: Always convert to absolute paths when possible
- Ignoring permissions:
ls -lareveals if you have read/write access - Hardcoding paths: Always dynamically locate files when location is uncertain
Related Tools
list_dir: Inspect directory contentsrun_shell: Execute find and ls commandsread_file: Read file contents after verificationshell_agent: Delegate complex file operations after path is confirmed
자주 묻는 질문
검색에서 대소문자를 무시할 수 있나요?
네, 가이드는 파일 이름 검색에 대소문자를 구분하지 않는 방법을 씁니다.
검색에서 권한 오류가 보이나요?
가이드는 결과를 깔끔하게 유지하려고 오류 출력을 따로 보내 숨깁니다.
검색은 어디서 시작하나요?
현재 폴더에서 시작하며, 필요하면 전체 시스템으로 넓힐 수 있습니다.
상세 정보
작성자의 원본 설명
Systematic workflow to resolve FileNotFoundError by locating and verifying file paths
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12888
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.