prioritize-reference-files
できること
このスキルは、タスクの中の参考ファイルを見つけて、ほかの何よりも先に読むようAIエージェントを導きます。自分のファイルを使ってほしい人向けです。
使う場面
- ✓ファイルを添付して、その内容を回答の根拠にしてほしいとき。
- ✓AIが、あなたの文書にないデータを報告しているとき。
- ✓Word、PDF、Excelのファイルを読んでエラーが出て、AIに別の方法を見つけてほしいとき。
スキルのリンク
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/prioritize-reference-files/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“添付したExcelとPDFを使って、私の質問に答えてください。数字は作らないでください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは添付されたファイルを探し、各種類に適したリーダーを使い、ウェブ検索の前に読みます。ファイルの読み取りが失敗すれば、スクリプトなど別の方法で開いてデータを読みます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Prioritize Reference Files
Purpose
This skill ensures that when reference files are provided in task context, you MUST read and extract data from them FIRST before attempting web searches or generating synthetic data. Ignoring available structured data leads to fabricated outputs and incorrect results.
Core Principle
Reference files in context > Web search > Data fabrication (never)
Workflow
Step 1: Scan Task Context for Reference Files
Before taking any action, identify all files provided in the task context:
- Look for file attachments, uploads, or references in the task description
- Common formats:
.xlsx,.csv,.json,.pdf,.docx,.txt - Check for phrases like "attached", "provided", "reference file", "see file"
Step 2: Read Reference Files First
Use the appropriate tool to read each reference file:
# For Excel files
read_file(filetype="xlsx", file_path="path/to/file.xlsx")
# For CSV files
read_file(filetype="csv", file_path="path/to/file.csv")
# For PDF files
read_file(filetype="pdf", file_path="path/to/file.pdf")
# For JSON files
read_file(filetype="json", file_path="path/to/file.json")
# For text files
read_file(filetype="txt", file_path="path/to/file.txt")
If read_file fails on .docx files (returns error, empty content, or 'unknown error'):
Fallback Approach 1: Direct zipfile/XML extraction via run_shell
# .docx files are ZIP archives containing XML; extract document.xml directly
unzip -p path/to/file.docx word/document.xml | grep -oP '(?<=<w:t>)[^<]+' | tr '\n' ' '
Or for more complete extraction:
mkdir -p /tmp/docx_extract && cd /tmp/docx_extract && unzip path/to/file.docx && cat word/document.xml
Fallback Approach 2: Use shell_agent for complex extraction If direct extraction fails, delegate to shell_agent:
shell_agent(task="Extract text content from path/to/file.docx using zipfile and XML parsing")
The agent will attempt multiple extraction methods and report results.
Fallback Approach 3: Verify extraction success before proceeding After any extraction method, confirm content was retrieved:
- Check that output is non-empty and contains expected document structure
- Look for familiar text from the document (headings, known phrases)
- If extraction appears incomplete, try an alternative method
- Document which method succeeded: "Content extracted using [method] after read_file failed"
Important: Never proceed to data fabrication if reference files exist but read_file fails. Always attempt at least one fallback extraction method first.
Step 3: Extract and Validate Data
After reading:
- Parse the content to understand the data structure
- Identify relevant fields/columns for your task
- Verify the data is complete and usable
- Note any limitations or missing information
Step 4: Use Reference Data as Primary Source
- Base all outputs on the reference file data
- Only supplement with web search if reference data is incomplete
- NEVER fabricate data when reference files exist
- If reference data is insufficient, explicitly state what's missing
Step 5: Document Data Source
In your outputs, acknowledge the source:
- "Data sourced from [filename]"
- "Based on provided reference file: [filename]"
- This confirms you used the actual provided data
Anti-Patterns to Avoid
❌ Ignoring reference files and searching the web instead ❌ Fabricating data when structured data is available ❌ Assuming file contents without reading them ❌ Using outdated web data when current reference files exist ❌ Giving up after read_file fails without trying fallback extraction methods
Example
Task Context: "Create a property listings report. See Massabama_active_listings.xlsx for current data."
Correct Approach:
1. Read Massabama_active_listings.xlsx first
2. Extract property addresses, prices, specifications
3. Generate report using actual listing data
4. Note: "Data sourced from Massabama_active_listings.xlsx"
Incorrect Approach:
1. Search web for "Massabama property listings"
2. Fabricate property data from search results
3. Create report with unverified/generated data
Verification Checklist
Before completing any task with reference files:
- I have identified all reference files in the task context
- I have read each reference file using appropriate tools
- I have extracted relevant data from the files
- My output is ba
よくある質問
エージェントはどのファイルを先に読むか、どう決めますか?
添付ファイルや、「添付された」「提供された」といった言葉を探して、そのファイルを先に読みます。
Excelのリーダーが失敗したら?
スクリプトなど別の方法を使って、ファイルを開きデータを読めます。
データ作業だけに使えるスキルですか?
いいえ。レポート、分析、要約など、提供されたファイルに依存するタスク向けです。
詳細
作者による元の説明
Ensures agents read and use provided reference files before searching or fabricating data
repo: HKUDS/AgentPilot
人気
- GitHubのスター
- 7.8k
- ランキング
- #12954
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
agentpilot
7.8kエージェントが、作業を準備し、変更案を提案してテストし、評価するAgentPilotのループを実行することで、プロジェクトを段階的に改善できるよう支援します。
openspace
7.8kエージェントが、スキルを保存し取り出すツールであるOpenSpaceをセットアップし、MCPを通じてAIアプリに接続できるよう支援します。
rsi-arena
7.8kエージェントが、AIMEやTerminal-Benchなどの標準的なAIベンチマークテストをセットアップして実行し、異なる改善方法を比較できるよう支援します。
experiment-guide
7.8kエージェントが、プログラムを改善する方法を調べる間に、小さな実験を計画し、その結果を読み、発見を記録できるよう支援します。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。