本文へスキップ
Skillpedia
一般的なプログラミング7.8k · #12993

sandbox-file-discovery-and-validation

できること

このスキルは、AIエージェントが実際にアクセスできるフォルダーでファイルを探し、その後、出力を確認するよう導きます。デスクトップなどの一般的なフォルダーがない、限られた環境や一時的な環境で作業する人向けです。

使う場面

  • ✓なじみのない一時的な環境で、入力ファイルを見つける必要があるとき。
  • ✓デスクトップやドキュメントなどの一般的なフォルダーが存在しない可能性があるとき。
  • ✓出力ファイルが作られ、依頼した形式と一致したという証拠が必要なとき。

スキルのリンク

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-file-discovery-and-validation/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-file-discovery-and-validation/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“この環境でアップロードしたスプレッドシートを探し、まとめファイルを作成して、正しく保存されたか確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは現在のワーキングフォルダーと確認済みのワークスペースフォルダーから始め、そこで必要なファイルを探します。出力は既知の場所に保存し、各出力が存在し、読み取れ、依頼した形式と一致するか確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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:

  1. discover files from actual accessible roots,
  2. avoid brittle path assumptions,
  3. generate outputs in known locations, and
  4. 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/null when 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
よくある質問

エージェントがデスクトップなどのフォルダーを避けるのはなぜですか?

サンドボックスではこれらのフォルダーが存在しないことがあるため、スキルはワーキングフォルダーから始めるよう述べています。

検索はどのくらい深く行いますか?

必要な場合を除き、システム全体ではなく既知のルートから限定的に検索するよう提案しています。

最後の確認では何を確かめますか?

ファイルが存在し、読み取れ、想定した形式になっているかを確認します。

詳細

作者による元の説明

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

人気

GitHubのスター
7.8k
ランキング
#12993
ライセンス
MIT
更新日
2026/11/1

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル