Agent skill

Universal Document Reader

by HKUDS in HKUDS/Vibe-Trading

Reads PDF, Word, Excel, PowerPoint, image (OCR), CSV, text, config and source files through one read_document tool that returns extracted text in a uniform JSON envelope.

MITAuto-check: notesDocuments & Office

Install Universal Document Reader

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill doc-reader -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading doc-reader --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/doc-reader .claude/skills/doc-reader && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
doc-reader
GitHub stars
35k
Token cost
~1.5k tokens
SKILL.md length
534 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Reads PDF, Word, Excel, PowerPoint, image (OCR), CSV, text, config and source files through one read_document tool that returns extracted text in a uniform JSON envelope.

  • Extracting text from a PDF, including scanned pages
  • SKILL.md covers Purpose, Usage, Return envelope and Workflows, plus 2 more sections
  • Calls pip
  • Reading a contract in Word to flag key clauses

What it does

A single read_document tool dispatches by file extension, so the agent calls the same tool for every format and always gets back the same JSON structure with the extracted text. PDFs use fast text extraction and fall back to OCR for scanned pages, Word files return paragraphs and table cells, Excel files return all sheets with a 100-row preview each, PowerPoint returns slide text and images go through OCR.

Other text-like formats such as CSV, JSON, YAML, HTML and source code come back as raw text with an encoding fallback. A pages parameter slices PDFs, and content over 15000 characters is truncated, so long documents are read in parts. Executables and archives are rejected at upload, and the agent should ask you to unpack archives first. Suggested workflows cover summarizing a paper, flagging key contract clauses and taking a quick look at a spreadsheet.

When your agent uses it

  • Extracting text from a PDF, including scanned pages
  • Reading a contract in Word to flag key clauses
  • Getting a quick preview of every sheet in an Excel workbook
  • Summarizing a paper or annual report from a PDF

Example prompts

  • “Read uploads/annual_report.pdf pages 1-10 and summarize the business outlook.”
  • “Open uploads/contract.docx and flag the termination, liability and payment clauses.”
  • “Preview the sheets in sales.xlsx.”
  • “Extract the text from this scanned receipt image.”

Requirements

  • The read_document tool

What it can do on your machine

Read from SKILL.md and the folder at commit 7f6908b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Universal Document Reader loads about 1.5k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 534 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:25
    nfig | `.json/.yaml/.yml/.toml/.ini/.cfg/.env` | Raw text |

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit 7f6908b, republished under its MIT licence (© HKUDS). 534 words, ~1,504 tokens.

Download SKILL.mdSave it as .claude/skills/doc-reader/SKILL.md (or your agent's skills folder).
name
doc-reader
description
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.
category
tool

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
CategoryExtensionsNotes
PDF.pdfText pages extracted in ms; scanned/image pages fall back to OCR
Word.docxParagraphs + table cells
Excel.xlsx, .xlsAll sheets, first 100 rows per sheet as preview
PowerPoint.pptxSlide text content
Images.png/.jpg/.jpeg/.gif/.bmp/.webp/.tiffOCR only
CSV / TSV.csv, .tsvRaw text with encoding fallback
Plain text.txt/.md/.log/.rstEncoding fallback
Config.json/.yaml/.yml/.toml/.ini/.cfg/.envRaw text
Markup.html/.htm/.xmlRaw text (no HTML stripping)
Source code.py/.js/.ts/.tsx/.go/.rs/.java/.cpp/.c/.sql/.sh/...Raw text
Unknown extensionanything elseBest-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:

json
{
  "status": "ok",
  "file": "paper.pdf",
  "format": "pdf",
  "char_count": 52000,
  "truncated": true,
  "text": "..."
}

Format-specific extra fields:

FormatExtra keys
pdftotal_pages, pages_read, ocr_pages, ocr_engine, ocr_quality, skipped_pages
docxparagraphs, tables
excelsheets (array of {name, rows, cols})
pptxslides
textencoding, 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):

python
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
Show full SKILL.md (288 more words)Show less
OCR Engine Configuration

Two OCR engines are built in — no extra packages needed beyond the engine SDK:

EngineTypeRequiresInstall
rapidLocal (offline)rapidocr_onnxruntimepip install rapidocr_onnxruntime
llm-visionCloudA vision-capable LLM model + API keyNo 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: document pages never leave the machine)
  • rapid: force RapidOCR (local, ONNX)
  • llm-vision: force LLM vision OCR (cloud — pages are sent to your configured LLM provider)
  • none: disable OCR entirely
Response Fields

PDF responses include OCR metadata:

  • ocr_engine: name of the OCR engine used (e.g. "rapid", "llm-vision") or null
  • ocr_pages: number of pages processed via OCR
  • skipped_pages: number of pages skipped (no OCR engine available)
  • ocr_quality: object with quality_flag (good/degraded/no_ocr_engine/no_ocr_needed), ocr_pages, and text_density (chars per page)

Notes

  • Encoding fallback order for text: utf-8 → utf-8-sig → gbk → gb2312 → big5 → latin-1.
  • OCR uses the configured engine (RapidOCR for local, or LLM vision for cloud). If no engine is available, image/scanned files return empty text with a note field — tell the user to install rapidocr-onnxruntime or set VIBE_TRADING_OCR_ENGINE=llm-vision with a vision-capable model.
  • Excel previews are limited to 100 rows per sheet to stay in budget. If the user needs full data (e.g. trade journals), call analyze_trade_journal instead.
  • Source-code files are returned raw; do not re-format or re-indent.

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agent/src/skills/doc-reader of HKUDS/Vibe-Trading.

Open the folder on GitHubat commit 7f6908b

Compare with similar skills

Universal Document Reader next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Universal Document Reader compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Universal Document Reader this skillHKUDS/Vibe-Trading35k—~1.5kAutomated safety check: NotesMIT
MarkitdownImCa0/just-laws78114 repos~3.2kAutomated safety check: NotesMIT
MinerU Document Readeropendatalab/MinerU81k—~9.4kAutomated safety check: WarnCustom licence
Markitdownjimmc414/Kosmos5942 repos~1.7kAutomated safety check: PassNone
Markdown ConverterTeam-Commonly/commonly1.4k—~557Automated safety check: PassApache-2.0
Nutrient Document Processingaffaan-m/ECC274k4 repos~1.5kAutomated safety check: PassMIT

Similar skills

  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    781 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes
  • MinerU Document Reader

    opendatalab/MinerU

    Reads, OCRs, searches and cites local documents through the mineru CLI, covering PDF, images, Office files, EPUB, HTML and CSV.

    81k GitHub stars~9.4k tokensUpdated yesterday
    Documents & OfficeAuto-check: warnings
  • Markitdown

    jimmc414/Kosmos

    Convert various file formats (PDF, Office documents, images, audio, web content, structured data) to Markdown optimized for LLM processing.

    594 GitHub starsUsed in 2 repos~1.7k tokens
    Documents & OfficeAuto-check passed
  • Markdown Converter

    Team-Commonly/commonly

    Convert binary documents (PDF, DOCX, XLSX, PPTX, HTML, EPUB, images) to clean LLM-friendly Markdown using Microsoft's markitdown Python tool.

    1.4k GitHub stars~557 tokensUpdated today
    Documents & OfficeAuto-check passed
  • Process, convert, OCR, extract, redact, sign, and fill documents using the Nutrient DWS API.

    274k GitHub starsUsed in 4 repos~1.5k tokens
    Documents & OfficeAuto-check passed
  • Document Converter

    wentorai/Research-Claw

    Convert Office documents (PPTX, DOCX, XLSX, PDF, HTML, CSV, JSON, XML, images) to Markdown using Microsoft MarkItDown.

    858 GitHub stars~1.3k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated yesterday
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Questions about Universal Document Reader

What does Universal Document Reader do?

Reads PDF, Word, Excel, PowerPoint, image (OCR), CSV, text, config and source files through one read_document tool that returns extracted text in a uniform JSON envelope. A single read_document tool dispatches by file extension, so the agent calls the same tool for every format and always gets back the same JSON structure with the extracted text. PDFs use fast text extraction and fall back to OCR for scanned pages, Word files return paragraphs and table cells, Excel files return all sheets with a 100-row preview each, PowerPoint returns slide text and images go through OCR.

When should I use Universal Document Reader?

Universal Document Reader fits situations like: extracting text from a PDF, including scanned pages; reading a contract in Word to flag key clauses; getting a quick preview of every sheet in an Excel workbook; summarizing a paper or annual report from a PDF.

How do I install Universal Document Reader in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill doc-reader -a claude-code`. Or copy the skill folder (agent/src/skills/doc-reader in HKUDS/Vibe-Trading) into .claude/skills/doc-reader in your project. Claude Code loads it when a task matches its description.

How do I install Universal Document Reader in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill doc-reader -a codex`. Or copy the skill folder (agent/src/skills/doc-reader in HKUDS/Vibe-Trading) into .agents/skills/doc-reader in your project. Codex loads it when a task matches its description.

Can I use Universal Document Reader in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill doc-reader -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/doc-reader, .gemini/skills/doc-reader, .github/skills/doc-reader and .opencode/skills/doc-reader in your project.

What does Universal Document Reader need to run?

Going by SKILL.md and its folder, Universal Document Reader needs the command-line tools its instructions call (pip). Our summary lists: The read_document tool.

Does Universal Document Reader access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Universal Document Reader safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Universal Document Reader use?

Universal Document Reader is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Universal Document Reader use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Universal Document Reader?

Skills that share tags, products or a category with Universal Document Reader: Markitdown (ImCa0/just-laws, 781 stars), MinerU Document Reader (opendatalab/MinerU, 81k stars), Markitdown (jimmc414/Kosmos, 594 stars) and Markdown Converter (Team-Commonly/commonly, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Universal Document Reader?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 34,884 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 6, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.