document-processing

document-processing is a skill for Claude Code, Codex from ericrisco/rsc-harness. It costs 84 tokens per session (2,557 once invoked), scanned A, original, MIT.

A guide to reading and creating document files, especially PDFs, DOCX files, and scanned pages. It handles literal text, tables, form fields, page operations, templates, and OCR, which turns text in an image into selectable text.

In plain words
What is it for?
Use it to extract text and tables from PDFs, fill or flatten PDF forms, merge or split pages, create PDF or DOCX files from templates, and read image-only scans.
Why use it?
It helps choose the right processing path, such as extracting an existing text layer instead of unnecessarily running OCR. It also separates raw document handling from extracting structured records or signing documents.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/ericrisco/rsc-harness/document-processing
Any agent
npx skills add ericrisco/rsc-harness --skill document-processing
Clone the repo
git clone --depth 1 https://github.com/ericrisco/rsc-harness

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 document-processing

README.md
[![agentmods](https://agentmods.dev/badge/skills/ericrisco/rsc-harness/document-processing.svg)](https://agentmods.dev/skills/ericrisco/rsc-harness/document-processing)
Your own site
<a href="https://agentmods.dev/skills/ericrisco/rsc-harness/document-processing"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/document-processing.svg" alt="Measured on agentmods" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,557 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00084 $0.02557
Opus 5 $0.00042 $0.01278
Sonnet 5 $0.00017 $0.00511
Haiku 4.5 $0.00008 $0.00256

Measured yesterday against content hash c213bfbe95a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

document-processing 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/document-processing/SKILL.md · 207 lines

How it starts

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

Document processing

File in, content out — or data in, file out. You open a byte stream (PDF, DOCX, scan) and either pull the content out, or you build a new document from a template and a data dict. That is the whole job: the deliverable is bytes of a document or the literal content of one.

The boundary test, apply it first:

  • Deliverable is raw text / Markdown / table cells / a generated file → you are in the right place.
  • Deliverable is a typed object matching a schema ({parties: [...], total: 1234.50}) → that is structured-extraction. This skill stops at "clean Markdown out of the file"; the schema-constrained extraction runs on that Markdown.

Everything else routes too: signing with an audit trail → e-signature, spreadsheet grids/formulas/XLSX-as-data → spreadsheet-ops, indexing for cross-document Q&A → rag (this skill produces the text rag ingests, it does not index it), downloading the files off a site → data-scraper.

Step 0 — does the PDF have a text layer?

The most expensive mistake in this skill is OCR'ing a PDF that already has a text layer. A digital PDF (exported from Word, a browser, a report tool) carries selectable text — extracting it is free, instant, and lossless. OCR is slow, costs money or GPU, and introduces errors. Never OCR a PDF you can extract.

Check before you pick an engine:

import pdfplumber

with pdfplumber.open("doc.pdf") as pdf:
    txt = pdf.pages[0].extract_text() or ""

if len(txt.strip()) > 20:
    print("text layer present -> extract directly (pdfplumber / pypdf)")
else:
    print("image-only or empty -> this is an OCR job")

If extract_text() returns empty (or near-empty) across the first few pages, it is a scan or image-only PDF and you go to the OCR branch. Symptom from the user's side: "the text copies out as garbage / random symbols" usually means a broken/embedded font, not a missing text layer — try pypdf extraction too before assuming OCR.

Engine selection

Read the full file on GitHub · 207 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 207 lines · 84 tokens per session scan A c213bfbe95a4

Subscribe to this mod's changes

document-processing is a skill published in the GitHub repository ericrisco/rsc-harness (60 stars, last pushed 2d ago), licensed MIT. It adds 84 tokens to every session and 2,557 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

pdf-handling

PDF creation, text extraction, merging, splitting, and form-filling.

furkangonel/cowrangler · 19 tokens

kreuzberg

Extract text, tables, metadata, and images from 91+ document formats (PDF, Office, images, HTML, email, archives, academic) using Kreuzberg. Use when writing code that calls Kreuzberg APIs in Python, Node.js/TypeScript, Rust, or CLI. Covers installation, extraction (sync/async), configuration (OCR, chunking, output…

kreuzberg-dev/kreuzberg-lts · 89 tokens

format-specific-extraction

ZIP archive → Security validation → XML parsing → Text + tables + metadata.

kreuzberg-dev/kreuzberg-lts · 3 tokens

pdf-table-to-excel

TablePack: Convert PDF tables to multi-sheet Excel packages with MinerU — original table screenshots, figures, QC notes, no fabricated data. Path A: existing MinerU users. Path B: run scripts/installmineru. first. REQUIRES multimodal/vision model for QC (open 原始表格/.jpg). Triggers: 转表格, 转excel, 转Excel, PDF表格…

kujiangmudao/tablepack · 132 tokens

smart-ocr

This skill enables intelligent text extraction from images and scanned documents using PaddleOCR - a leading OCR engine supporting 100+ languages. Extract text from photos, screenshots, scanned PDFs, and handwritten documents with high accuracy.

claude-office-skills/skills · 5 tokens

PDF Content Extractor & Annotator

提取与分析 PDF:文本、表格、元数据、图片;支持合并、注释与去水印,提供 OCR 兜底与综合报告.

davidtoby/agent-skills · 44 tokens