sandbox-file-discovery-and-validation
What it does
This skill guides the AI agent to find files in the folders it can actually reach and to confirm its output afterward. It is for people working in limited or temporary environments where common folders may not exist.
When to use it
- ✓When you need the agent to find input files in an unfamiliar or temporary environment.
- ✓When common folders such as Desktop or Documents may not exist on the system.
- ✓When you need proof that the output file was created and matches what you asked for.
Skill link
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-file-discovery-and-validation/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Find the spreadsheets I uploaded in this environment, make a summary file, and check that it was saved correctly.”
5 new skills a week. 1 minute to read.
How it works
The agent starts from the current working folder and other confirmed workspace folders, searches them for the files it needs, and saves outputs to known locations. It then checks that each output exists, can be read and matches the requested form.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
FAQ
Why does the agent avoid folders like Desktop?
The skill says these folders may not exist in a sandbox, so the agent starts from the working folder instead.
How deep does it search?
The skill suggests limited searches from known roots, not the whole system, unless needed.
What does the final check cover?
It confirms the file exists, can be read and has the expected form.
Details
Original description by the author
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
Popularity
- GitHub stars
- 7.8k
- Ranking position
- #12993
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
agentpilot
7.8kHelps your agent improve a project step by step by preparing a task and running the AgentPilot loop that proposes, tests and scores changes.
openspace
7.8kHelps your agent set up OpenSpace, a tool that stores and fetches agent skills, and connect it to your AI app through MCP.
rsi-arena
7.8kHelps your agent set up and run standard AI benchmark tests, such as AIME and Terminal-Bench, to compare different improvement methods.
experiment-guide
7.8kHelps your agent plan small experiments, read their results and record findings while it investigates how to improve a program.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.