Chuyển đến nội dung
Skillpedia
Agent7.8k · #12954

prioritize-reference-files

Skill này làm gì

Skill này hướng dẫn AI agent tìm và đọc các file tham khảo trong nhiệm vụ trước khi làm việc khác. Nó dành cho những người mong đợi AI dùng chính file của họ.

Khi nào nên dùng

  • ✓Khi bạn đính kèm file và mong AI dùng nội dung của chúng để trả lời.
  • ✓Khi AI báo cáo dữ liệu không xuất hiện trong file của bạn.
  • ✓Khi đọc file Word, PDF hoặc Excel gặp lỗi và bạn cần AI tìm cách khác.

Liên kết skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/prioritize-reference-files/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/prioritize-reference-files/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Dùng file Excel và PDF tôi đính kèm để trả lời câu hỏi của tôi, và đừng bịa ra bất kỳ con số nào.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các file đính kèm, dùng trình đọc phù hợp cho từng loại và đọc chúng trước khi tìm kiếm web. Nếu việc đọc file thất bại, skill liệt kê các phương pháp dự phòng để thử.

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.

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:

  1. Parse the content to understand the data structure
  2. Identify relevant fields/columns for your task
  3. Verify the data is complete and usable
  4. 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
Câu hỏi thường gặp

Agent quyết định đọc file nào trước bằng cách nào?

Nó tìm các file đính kèm và những cụm từ như đính kèm hoặc được cung cấp trong nhiệm vụ, rồi đọc các file đó trước.

Điều gì xảy ra nếu trình đọc Excel bị lỗi?

Agent có thể dùng cách khác, chẳng hạn một script, để mở file và đọc dữ liệu.

Skill này chỉ dành cho công việc dữ liệu thôi sao?

Nó nhắm đến các nhiệm vụ phụ thuộc vào file được cung cấp, như báo cáo, phân tích và bản tóm tắt.

Chi tiết

Mô tả gốc của tác giả

Ensures agents read and use provided reference files before searching or fabricating data

repo: HKUDS/AgentPilot

Độ phổ biến

Sao GitHub
7.8k
Vị trí xếp hạng
#12954
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự