superjj007/agent-document-skills/pdf-ocr
Claude Code and agent skill by superjj007/agent-document-skills
- community
Checking that the SKILL.md file is still in the repository.
Convert text-layer or scanned PDF files to clean Markdown and extracted images with MinerU, then run deterministic quality checks and optional LLM-assisted formula review. Use when a user asks to OCR a PDF, extract a PDF to Markdown, preserve formulas or tables from a PDF, or prepare a PDF for translation.
Install
npx vskill@latest install superjj007/agent-document-skills/pdf-ocrSKILL.md
PDF OCR
Convert a PDF to <output>/full.md and <output>/images/. Default to MinerU's cloud vlm API. Keep the source PDF unchanged.
Privacy and authorization gate
Before the first network call for each input document:
- State that selected PDF pages will be uploaded to MinerU for processing.
- State the input path, selected page range, and output directory.
- If the document may be confidential, contain personal data, or the user's authorization is unclear, obtain confirmation before uploading. A request that explicitly names MinerU and the exact document can count as confirmation when no sensitivity is apparent.
- Never ask the user to paste an API token into chat. Never print, log, or write the token into the workspace.
Preflight
- Locate this skill directory from the loaded
SKILL.md; do not assume it is under~/.codexor any other platform-specific root. - Inspect the PDF with
pdfinfowhen available. Samplepdftotextoutput when deciding whether--method ocris useful. - Require Python 3.9+. Prefer
uv: the cloud entry script declaresrequestsandpypdfwith PEP 723, souv runcreates an isolated cached environment automatically. - If
uvis unavailable, requirerequestsandpypdfin the selected Python environment. Installrequirements.txtonly with the user's approval; it also includes optionalhttpxfor external LLM review. - Check only whether
MINERU_API_TOKENexists. If absent, stop before uploading and direct the user to MinerU's current API management documentation. Do not claim a fixed token lifetime, quota, or price. - MinerU cloud API requests, presigned uploads, polling, and result downloads use a direct HTTP session by default. Proxy environment variables are intentionally ignored for this workflow.
- Default to a small page sample for a large or uncertain document, then inspect quality before processing the full file.
Run OCR
From the skill root, run cloud OCR with isolated, automatically resolved dependencies:
start and end are zero-based and inclusive. Keep each cloud chunk within the provider's current limits; the script rejects values above 600 pages per chunk. Provider limits may change, so provider errors and current documentation are authoritative.
For local backends, require a working mineru executable on PATH. The local path can use python3 scripts/ocr.py ... because it does not need the cloud Python packages. Do not install MinerU or download models without the user's approval.
Fallback when uv is unavailable and the user authorizes installing into their selected Python environment:
Quality control
scripts/ocr.py automatically runs scripts/qc.py in report mode after OCR. Treat missing images as blocking. Review the report for:
- broken Markdown or HTML image references;
- spaced digits and suspicious formula patterns;
- degraded mathematical tables;
[Unreadable]markers;- domain-incongruent hallucination markers.
Apply deterministic fixes only after inspecting the report:
Use --fix-hallucination only after confirming the flagged language is inconsistent with the document's domain.
Optional LLM formula review
Default to host review: use the current agent to inspect flagged formulas and nearby context without an external LLM call. Keep this optional layer separate from deterministic QC, review changes before writing, and do not claim a complete mathematical proof check.
For automated batch review, the user may explicitly choose openai-chat, openai-responses, or anthropic-messages. Before that external call, disclose the selected context scope, protocol, model, and endpoint host; require LLM_API_KEY and LLM_MODEL; never expose the key. These are wire protocols, not a provider catalog.
Run repair without --apply first. The script only auto-applies small edits and creates .bak files plus _llm_fix_log.md when writing.
Handoff to translation
If the user also requests translation, pass <output>/full.md to the md-translate skill only after OCR QC. Do not translate inside this skill.
Report
Report the backend, exact output paths, processed page range, Markdown line/word counts, image count, QC findings, and whether LLM review was run. Distinguish NOT-RUN from a successful check.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pdf-ocr/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/superjj007/agent-document-skills/pdf-ocr)