doc-reader
What it does
This skill gives an agent a single tool to pull readable text out of many common file types. It is for anyone who needs an AI to read a report, contract, spreadsheet or scanned page.
When to use it
- βWhen you need an AI to read a PDF, Word document, Excel sheet or PowerPoint file.
- βWhen a scanned page or image needs to be turned into text.
- βWhen you want text from a CSV, JSON or code file without opening it by hand.
Skill link
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/doc-reader/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
βRead this annual report PDF, pages one to ten, and summarize the main points.β
5 new skills a week. 1 minute to read.
How it works
The agent calls one document reader that chooses the right method based on the file type. Scanned pages go through text recognition, and spreadsheets are shown in a preview. Archives and program files are blocked for safety.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Universal Document Reader
Purpose
Return extracted text from any supported file in a single unified JSON envelope. The tool dispatches by file extension β you always call the same tool regardless of format.
Supported formats
| Category | Extensions | Notes |
|---|---|---|
.pdf |
Text pages extracted in ms; scanned/image pages fall back to OCR | |
| Word | .docx |
Paragraphs + table cells |
| Excel | .xlsx, .xls |
All sheets, first 100 rows per sheet as preview |
| PowerPoint | .pptx |
Slide text content |
| Images | .png/.jpg/.jpeg/.gif/.bmp/.webp/.tiff |
OCR only |
| CSV / TSV | .csv, .tsv |
Raw text with encoding fallback |
| Plain text | .txt/.md/.log/.rst |
Encoding fallback |
| Config | .json/.yaml/.yml/.toml/.ini/.cfg/.env |
Raw text |
| Markup | .html/.htm/.xml |
Raw text (no HTML stripping) |
| Source code | .py/.js/.ts/.tsx/.go/.rs/.java/.cpp/.c/.sql/.sh/... |
Raw text |
| Unknown extension | anything else | Best-effort read as UTF-8/GBK text |
Blocked (rejected at /upload): executables (.exe/.dll/.so/...) and
archives (.zip/.tar/...). Ask the user to unpack archives locally first.
Usage
Always call the tool directly β do not run Python from bash.
read_document(file_path="uploads/paper.pdf")
read_document(file_path="uploads/annual_report.pdf", pages="1-10")
read_document(file_path="uploads/contract.docx")
read_document(file_path="uploads/sales.xlsx")
read_document(file_path="uploads/deck.pptx")
read_document(file_path="uploads/chart.png") # image β OCR
read_document(file_path="uploads/config.yaml")
read_document(file_path="uploads/notes.md")
The pages parameter only applies to PDF; other formats ignore it.
Return envelope
All formats share this shape:
{
"status": "ok",
"file": "paper.pdf",
"format": "pdf",
"char_count": 52000,
"truncated": true,
"text": "..."
}
Format-specific extra fields:
| Format | Extra keys |
|---|---|
pdf |
total_pages, pages_read, ocr_pages, ocr_engine, ocr_quality, skipped_pages |
docx |
paragraphs, tables |
excel |
sheets (array of {name, rows, cols}) |
pptx |
slides |
text |
encoding, size |
Content longer than 15000 chars is truncated; for PDFs use the pages
parameter to read slices.
Workflows
Paper / report summary
1. read_document(file_path="paper.pdf") β full text
2. Extract abstract, methodology, conclusion β summarize
Contract review
1. read_document(file_path="contract.docx") β paragraphs + tables
2. Flag key clauses (termination, liability, payment, IP)
Spreadsheet quick-look
1. read_document(file_path="sales.xlsx") β all sheet previews
2. If user wants trade journal analysis specifically, pivot to
`analyze_trade_journal` tool instead (see trade-journal skill).
Chart / screenshot / scanned PDF
1. read_document(file_path="scan.png") β OCR text
2. If OCR returns empty, tell the user; don't fabricate.
OCR Configuration
The read_document tool automatically uses OCR for PDF pages with insufficient extractable text.
OCR Threshold
Use min_text_per_page to control when OCR is triggered (default: 50 characters):
read_document("scanned_report.pdf", min_text_per_page=10) # More aggressive OCR
read_document("mixed_pdf.pdf", min_text_per_page=100) # Less aggressive OCR
OCR Engine Configuration
Two OCR engines are built in β no extra packages needed beyond the engine SDK:
| Engine | Type | Requires | Install |
|---|---|---|---|
rapid |
Local (offline) | rapidocr_onnxruntime |
pip install rapidocr_onnxruntime |
llm-vision |
Cloud | A vision-capable LLM model + API key | No extra install β uses your existing LLM provider config |
The llm-vision engine works with any OpenAI-compatible vision model (GPT-4o, Qwen-VL, Gemini, Claude, GLM-4V, etc.). It reuses your existing LANGCHAIN_PROVIDER / LANGCHAIN_MODEL_NAME / API key configuration β no separate provider mapping needed. If you explicitly set VIBE_TRADING_OCR_ENGINE=llm-vision, your model choice is trusted; a real API error from the provider is clearer feedback than a heuristic guess.
To override the model used for OCR (without changing your agent's main model):
VIBE_TRADING_OCR_LLM_MODEL=qwen3.7-plus
Set VIBE_TRADING_OCR_ENGINE to select the engine:
auto(default): use local engines only, never cloud (privacy: docum
FAQ
Which file types can it read?
PDF, Word, Excel, PowerPoint, common image formats, CSV, plain text, configuration files, web markup and many source-code files.
Why can't it open zip files?
Archives and executable files are blocked, so you need to unpack archives on your own computer first.
Does it read scanned pages?
Yes. Scanned or image-only pages are read with text recognition.
Details
Original description by the author
Read any common document/data file β PDF, Word (.docx), Excel (.xlsx/.xls), PowerPoint (.pptx), images (OCR), CSV/TSV, plain text, JSON/YAML/TOML, HTML/XML, and most source-code files. Use the `read_document` tool.
repo: HKUDS/Vibe-Trading
Popularity
- GitHub stars
- 37k
- Ranking position
- #7513
- License
- MIT
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
vibe-trading
37kGives your agent a full finance research toolkit, covering backtests, factor analysis, options pricing and market data across many markets.
adr-hshare
37kShows your agent how to compare the price of a Chinese company listed in several markets, such as a US ADR and a Hong Kong share.
akshare
37kLets your agent pull free market data for Chinese and global stocks, futures, forex and economic indicators, with no API key needed.
alpha-zoo
37kLets your agent browse a library of ready-made stock factors and test how well a whole set of them predicts returns on a chosen market.
Similar skills
feishu-doc
394kHelps your agent read, create, and edit Feishu cloud documents, including text, images, and tables, using the document tool.
feishu-drive
394kLets your agent browse, organize, and comment on files in a Feishu cloud folder that has been shared with the bot.
feishu-perm
394kHelps your agent check and change who can access a Feishu file, choosing the smallest permission that meets your request.