agentleFS
DeconBearDeconBear/skills/ocr-parser/SKILL.md

ocr-parser

Skill1 starsChanged 4 months agoMITView on GitHub

This skill should be used when the user wants to perform OCR (extract text from images or PDFs) and wants the agent to invoke a provider-agnostic OCR tool. Supports Alibaba DashScope Qwen (default model qwen3.5-ocr; PDF via Response API, images via chat), Volcano Engine Ark Doubao vision OCR, and Unisound U1 OCR — via scripts/ocr_parser.py and scripts/qwen_pdf_package.py. Use when the user says "OCR this image", "把 PDF 转成文字 / Markdown", "识别图片中的文字", "extract text from this PDF", or explicitly invokes one of the supported providers.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not use for handwritten signature verification or languages the chosen model does not support.

    line 22
  2. Very specific:

    Write a package folder (same convention as math_ai/QM/reference/<name>/):

    line 48
  3. Very specific:

    Prefer scripts/qwen_pdf_package.py for PDFs when using Qwen (handles split ≤50 pages, merge, image download, meta).

    line 62
  4. Very specific:

    Place literature under a project ref/ (or equivalent).

    line 63
  5. Very specific:

    No real keys in the source repo.

    line 87
  6. Very specific:

    PDF + Qwen (default): run python scripts/qwen_pdf_package.py <pdf> [--out-dir <package_dir>].

    line 96
  7. Very specific:

    Use unisound only if the user asks for Unisound / U1, or Qwen PDF fails.

    line 98
  8. Very specific:

    Document changes in references/providers.md.

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

OCR Parser (multi-provider)

Extract text from images and PDFs via a single skill. Default OCR model is qwen3.5-ocr.

ProviderInputWorkflowOutputBest for
qwenimage or PDFsynctext/mddefault; PDF native + CJK
volcanoimagesynctextVolcano Ark alternative
unisoundPDFasync 4-stepmarkdownalternative PDF layout parser

When to use

  • Image or PDF text extraction / OCR.
  • Mentions of Qwen / 通义 / DashScope, Volcano / 火山 / Doubao, Unisound / 云知声 / U1.
  • Workflow step that needs OCR as a sub-task.

Do not use for handwritten signature verification or languages the chosen model does not support.

Quick start

# Image (default provider qwen, default model qwen3.5-ocr → falls back to qwen-vl-plus chat OCR if needed)
python scripts/ocr_parser.py ./receipt.png

# PDF → QM/reference-style package (recommended for papers)
python scripts/qwen_pdf_package.py ./paper.pdf
python scripts/qwen_pdf_package.py ./paper.pdf --out-dir ./ref/paper

# Or via ocr_parser with explicit PDF provider path
python scripts/ocr_parser.py --provider qwen ./paper.pdf -o ./paper.md

# Volcano / Unisound
python scripts/ocr_parser.py --provider volcano "https://example.com/page.png"
python scripts/ocr_parser.py --provider unisound ./paper.pdf -o paper.md

# Override model
python scripts/ocr_parser.py --provider qwen --model qwen-vl-plus ./img.jpg

PDF OCR output layout (required)

For academic PDFs / multi-page docs, do not leave a bare .md next to the PDF. Write a package folder (same convention as math_ai/QM/reference/<name>/):

<name>/
  <name>.pdf          # source PDF (copied into the package)
  <name>.md           # merged Markdown; image refs are relative: images/...
  images/             # downloaded figures / crops from OCR
  _pages/             # per-chunk markdown (≤50 pages per chunk for qwen3.5-ocr)
  _ocr_raw/           # optional raw intermediates
  _ocr_meta.json      # model, page count, image count, timestamps

Rules for the agent:

  1. Prefer scripts/qwen_pdf_package.py for PDFs when using Qwen (handles split ≤50 pages, merge, image download, meta).
  2. Place literature under a project ref/ (or equivalent); each OCR’d paper is one subfolder as above.
  3. Loose PDFs that are not yet OCR’d may sit directly in ref/; after OCR, move/copy into <name>/.
  4. Markdown must reference local images/... paths, not expiring OSS URLs.
  5. qwen3.5-ocr PDF limit: ≤50 pages and ≤100 MB per request — longer PDFs are split automatically.

Example _ocr_meta.json:

{
  "source_pdf": "paper.pdf",
  "model": "qwen3.5-ocr",
  "task": "document_parsing",
  "pages": 13,
  "chunks": 1,
  "pages_per_chunk": 50,
  "embedded_images": 4,
  "page_renders": 0,
  "md_chars": 12345,
  "finished_at": "2026-08-09 14:00:00"
}

Configuration (API keys)

No real keys in the source repo. The script auto-loads <skill_dir>/.env.

cp ocr-parser/.env.example ~/.claude/skills/ocr-parser/.env
# fill DASHSCOPE_API_KEY / VOLCANO_API_KEY / UNISOUND_API_KEY as needed

Workflow

  1. PDF + Qwen (default): run python scripts/qwen_pdf_package.py <pdf> [--out-dir <package_dir>].
  2. Image + Qwen: python scripts/ocr_parser.py <image> (default provider qwen, default model qwen3.5-ocr).
  3. Use unisound only if the user asks for Unisound / U1, or Qwen PDF fails.
  4. On auth errors, surface the missing env var name.
  5. On empty/garbled output, try another model/provider — see references/providers.md.

Extending

  • Image providers: add <name>_ocr(...) in scripts/ocr_parser.py and register in PROVIDERS.
  • PDF packaging / model defaults: edit scripts/qwen_pdf_package.py and QWEN_DEFAULT_MODEL in ocr_parser.py.
  • Document changes in references/providers.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.