sandbox-file-discovery-and-validation
Skill này làm gì
Skill này hướng dẫn AI agent tìm file trong các thư mục nó thực sự truy cập được và xác nhận đầu ra sau đó. Nó dành cho những người làm việc trong môi trường hạn chế hoặc tạm thời, nơi các thư mục thông thường có thể không tồn tại.
Khi nào nên dùng
- ✓Khi bạn cần agent tìm file đầu vào trong một môi trường lạ hoặc tạm thời.
- ✓Khi các thư mục phổ biến như Desktop hoặc Documents có thể không tồn tại trên hệ thống.
- ✓Khi bạn cần bằng chứng rằng file đầu ra đã được tạo và khớp với yêu cầu.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-file-discovery-and-validation/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tìm các bảng tính tôi đã tải lên trong môi trường này, tạo một file tóm tắt và kiểm tra xem nó đã được lưu đúng cách.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent bắt đầu từ thư mục làm việc hiện tại và các thư mục làm việc khác đã được xác nhận, tìm trong đó các file cần thiết, rồi lưu đầu ra vào các vị trí đã biết. Sau đó nó kiểm tra mỗi đầu ra có tồn tại, đọc được và đúng dạng yêu cầu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Sandbox File Discovery and Validation
Use this skill when working in constrained or sandboxed shell environments where common folders like ~/Desktop, ~/Documents, or ~/Downloads may not exist, may be inaccessible, or may not be where task files are stored.
The goal is to:
- discover files from actual accessible roots,
- avoid brittle path assumptions,
- generate outputs in known locations, and
- explicitly validate that outputs were created and match expectations.
Core principles
- Do not assume GUI-era user folders exist.
- Start from the current working directory and other confirmed workspace roots.
- Use recursive search from known roots, not from
/unless necessary. - Prefer deterministic output paths you control.
- After creating an artifact, verify it exists, is readable, and matches the requested form.
When to use this
Use this pattern when:
- you need to locate input files in an unfamiliar sandbox,
- the environment may be ephemeral or nonstandard,
- you are producing files for the user,
- success depends on the actual contents or structure of the output.
Recommended workflow
1) Establish your real working roots
Begin by identifying where you are and what directories are actually available.
Example:
pwd
ls -la
find . -maxdepth 2 -type d | sort
If needed, inspect nearby likely roots:
ls -la /tmp
ls -la /workspace 2>/dev/null || true
ls -la /workspaces 2>/dev/null || true
ls -la /mnt/data 2>/dev/null || true
Treat only confirmed, readable directories as search roots.
2) Avoid assumed folders
Do not begin with paths like:
~/Desktop~/Documents~/Downloads
unless you have already confirmed they exist and are relevant.
Bad:
find ~/Desktop -name "*.xlsx"
Better:
find . -type f -name "*.xlsx"
or, if a root is confirmed:
find /workspace -type f -name "*.xlsx" 2>/dev/null
3) Search from known roots with bounded, focused queries
Prefer targeted searches over broad filesystem scans.
Useful patterns:
find . -type f | sort
find . -type f -iname "*report*"
find . -type f \( -iname "*.csv" -o -iname "*.xlsx" -o -iname "*.json" \)
If multiple roots are known:
find . /workspace /mnt/data -type f 2>/dev/null | sort
Guidelines:
- suppress permission noise with
2>/dev/nullwhen appropriate, - filter by extension or name fragment,
- sort output for stable inspection,
- keep searches bounded to known roots.
4) Choose a deterministic output location
When generating a file, write it somewhere explicit and easy to re-check.
Good patterns:
- current directory,
- a task-specific subdirectory like
./output, - a confirmed writable workspace directory.
Example:
mkdir -p output
python make_result.py --out output/final.xlsx
Avoid writing to guessed locations that may not exist.
5) Immediately validate the output artifact
Never assume generation succeeded just because a command exited successfully.
At minimum, confirm:
- the file exists,
- the path is the one you intended,
- the file is non-empty when applicable,
- the format or structure matches the task.
Basic checks:
ls -l output/final.xlsx
test -f output/final.xlsx && echo "exists"
test -s output/final.xlsx && echo "non-empty"
file output/final.xlsx
For text-like outputs:
head -n 20 output/result.csv
wc -l output/result.csv
For structured outputs, inspect with the relevant tool:
- CSV: preview headers and row counts
- JSON: parse and inspect keys
- ZIP-like formats such as
.xlsx: verify internal structure or open with a library - generated code/config: run syntax or schema checks if available
6) Validate against task requirements, not just file existence
A file existing is necessary but not sufficient.
Check the artifact against the requested deliverable:
- expected filename or location,
- expected sheet names, tabs, columns, or keys,
- expected formulas, calculations, or derived values,
- expected number of records,
- expected transformations or formatting.
Examples:
- If a workbook was requested, verify the workbook contains the required sheets.
- If formulas were required, verify formulas are present, not just pasted values.
- If a filtered dataset was requested, verify row counts and selected columns.
- If a renamed file was requested, verify the actual output name.
7) Report with evidence
When you finish, cite the exact artifact path and the validation you performed.
Good completion style:
- “Created
output/final.xlsx.” - “Verified it e
Câu hỏi thường gặp
Tại sao agent tránh các thư mục như Desktop?
Skill nói những thư mục này có thể không tồn tại trong sandbox, nên agent bắt đầu từ thư mục làm việc.
Việc tìm kiếm đi sâu đến đâu?
Skill gợi ý tìm có giới hạn từ các thư mục gốc đã biết, không tìm toàn bộ hệ thống trừ khi cần.
Bước kiểm tra cuối cùng bao gồm những gì?
Nó xác nhận file tồn tại, đọc được và có dạng mong đợi.
Chi tiết
Mô tả gốc của tác giả
Use shell tools safely in sandboxed environments by discovering files from real workspace roots instead of assumed user folders, then explicitly verifying output artifacts after generation.
repo: HKUDS/AgentPilot
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12993
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agentpilot
7.8kGiúp agent của bạn cải thiện dự án từng bước bằng cách chuẩn bị tác vụ và chạy vòng lặp AgentPilot, gồm đề xuất, kiểm thử và chấm điểm thay đổi.
openspace
7.8kGiúp agent của bạn thiết lập OpenSpace, công cụ lưu và lấy lại skill của agent, rồi kết nối nó với ứng dụng AI của bạn qua MCP.
rsi-arena
7.8kGiúp agent của bạn thiết lập và chạy các bài kiểm thử benchmark AI chuẩn, như AIME và Terminal-Bench, để so sánh các phương pháp cải tiến khác nhau.
experiment-guide
7.8kGiúp agent của bạn lên kế hoạch các thí nghiệm nhỏ, đọc kết quả và ghi lại phát hiện khi tìm cách cải thiện một chương trình.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.