ocr-pipeline-and-quality

ocr-pipeline-and-quality is a skill for Claude Code, Codex from xberg-io/xberg. It costs 53 tokens per session (801 once invoked), scanned A, original, MIT.

Development guidance for Xberg's OCR pipeline, which converts text in scanned images or PDFs into machine-readable text. It covers OCR engines, preprocessing, caching, page checks, layout, and tables.

In plain words
What is it for?
Changing or testing OCR backends, language handling, preprocessing, cache keys, page acceptance, text geometry, hOCR output, or table reconstruction.
Why use it?
OCR backends can produce different results and quality measurements, so changes need to be evaluated across the full processing pipeline.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Changing or testing OCR backends, language handling, preprocessing, cache keys, page acceptance, text geometry, hOCR output, or table reconstruction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xberg-io/xberg/ocr-pipeline-and-quality
About the project

Xberg is a document-intelligence engine that reads files, URLs, archives, and source trees and extracts text, metadata, images, tables, and structured data, with additional code-language understanding. Developers use it through language bindings, a command-line tool, REST API, or MCP server, and the catalogue entries support those integrations.

xberg-io/xberg · 9,285 stars · on GitHub · docs.xberg.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xberg-io/xberg --skill ocr-pipeline-and-quality
Clone the repo
git clone --depth 1 https://github.com/xberg-io/xberg

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ocr-pipeline-and-quality

README.md
[![agentmods](https://agentmods.dev/badge/skills/xberg-io/xberg/ocr-pipeline-and-quality/github.svg)](https://agentmods.dev/skills/xberg-io/xberg/ocr-pipeline-and-quality)
Your own site
<a href="https://agentmods.dev/skills/xberg-io/xberg/ocr-pipeline-and-quality"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/ocr-pipeline-and-quality/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ocr-pipeline-and-quality

Your own site · 80×15
<a href="https://agentmods.dev/skills/xberg-io/xberg/ocr-pipeline-and-quality"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/ocr-pipeline-and-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 801 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.00801
Opus 5 $0.00026 $0.00400
Sonnet 5 $0.00011 $0.00160
Haiku 4.5 $0.00005 $0.00080

Measured 11d ago against content hash c16597e2ff2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ocr-pipeline-and-quality scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.ai-rulez/skills/ocr-pipeline-and-quality/SKILL.md · 60 lines

How it starts

The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OCR pipeline and quality

OCR flows through preprocessing, backend execution, structured conversion, page acceptance, and caching. Backend outputs are not interchangeable measurements.

Backends and execution

  • All backends implement OcrBackend. Tesseract is the default and is bound through the in-repo crates/xberg-tesseract C FFI crate; there is no leptess dependency.
  • OcrBackendType is Tesseract | PaddleOCR | Candle | Custom. Sceptre is selected by name through Custom, not a dedicated enum variant.
  • Run blocking OCR work through tokio::task::spawn_blocking, minimize runtime/FFI lock duration, and respect backend resource limits.
  • Check PageOrientationHandling before assuming a backend handles rotated input.
  • Validate ISO 639 language codes and required tessdata before execution. Language detection runs after extraction and does not choose traineddata automatically.

Configuration and cache

  • Public types::formats::TesseractConfig and internal ocr::types::TesseractConfig have independent defaults. Change both and keep their synchronization test passing.
  • The OCR cache key combines image hash, backend, config hash, and output format. The config hash includes TESSERACT_RESULT_SCHEMA_VERSION and the ordered Tesseract variable set; it contains no build or code identity.
  • Bump TESSERACT_RESULT_SCHEMA_VERSION when unchanged image/config inputs can produce different output, or disable the cache for an A/B or revert check.
  • Default preprocessing is 300 DPI, deskew, and Otsu binarization. Auto-rotation, denoise, contrast enhancement, and color inversion are off unless configured. Native PSM defaults to 3; WASM defaults to 6.

Quality invariants

  • Query confidence_semantics() before interpreting confidence. Never threshold Uncalibrated output using a Tesseract-derived scale.
  • Tesseract font size is typography from hOCR x_fsize; Sceptre/Paddle font size is a geometric detection-box proxy. Do not compare or threshold them as the same quantity.
  • hocr_font_info=1 is required for Tesseract typography; without it font sizes fall back to 12 pt. Sceptre/Paddle do not provide hOCR style fractions.
  • accept_or_reject_ocr_page can discard an entire page and its structured paragraphs. Compare accepted pages before word counts. A missing dictionary-invalid ratio is unknown, not zero.
  • Precision is the scarce resource on the current benchmark corpus. Require an independently grounded F1 A/B for recall-oriented rewrites; use the benchmark-workflow skill.
  • Measure structural output such as headings and lists in Markdown, not Plain.

Read the full file on GitHub · 60 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 60 lines · 53 tokens per session scan A c16597e2ff2f

Subscribe to this mod's changes

ocr-pipeline-and-quality is a skill published in the GitHub repository xberg-io/xberg (9,285 stars, last pushed yesterday), licensed MIT. It adds 53 tokens to every session and 801 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

using-the-mcp-server

Use when converting HTML to Markdown or extracting metadata and tables through the html-to-markdown MCP server's tools, rather than shelling out to the CLI. Covers the tool surface, the auto-installing launcher, and when MCP beats the CLI or SDK.

xberg-io/html-to-markdown · 57 tokens

extraction-pipeline-patterns

Kreuzberg's format detection -> extraction -> fallback orchestration for 75+ file formats.

kreuzberg-dev/kreuzberg-lts · 11 tokens

doc-reader

PDF/DOCX/XLSX/image document intelligence — text extraction, table parsing, OCR, financial statement analysis, contract clause detection, document classification, and format conversion. Use when reading, analyzing, extracting data from, or converting documents.

JansenAnalytics/claudex · 51 tokens

2slides-ppt-generator

AI-powered presentation generation via the 2slides API — create slides from text, match a reference image style, summarize documents into decks, add AI voice narration, and export pages/audio. Use f.

ranbot-ai/awesome-skills · 45 tokens

advogado-criminal

Advogado criminalista especializado em Maria da Penha, violencia domestica, feminicidio, direito penal brasileiro, medidas protetivas, inquerito policial e acao penal.

ranbot-ai/awesome-skills · 42 tokens

sf-metadata-parser

Use this skill whenever the user wants to parse, analyze, document, or export SAP SuccessFactors OData metadata ($metadata XML). Triggers include: any mention of 'metadata', '$metadata', 'OData entities', 'entity fields', 'SF metadata', 'SuccessFactors schema', 'data dictionary', or requests to understand, compare, or…

shaktibarath/sf-metadata-parser · 175 tokens