본문으로 건너뛰기
Skillpedia
일반 코딩7.8k · #12888

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/file-locate-verify/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 -iname for case-insensitive matching
  • Redirect stderr with 2>/dev/null to 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

  1. Skipping verification: Never assume the path from find is correct without checking
  2. Using relative paths blindly: Always convert to absolute paths when possible
  3. Ignoring permissions: ls -la reveals if you have read/write access
  4. Hardcoding paths: Always dynamically locate files when location is uncertain

Related Tools

  • list_dir: Inspect directory contents
  • run_shell: Execute find and ls commands
  • read_file: Read file contents after verification
  • shell_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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬