document-extraction
Turn unstructured or semi-structured documents — PDFs (digital or scanned), Word, HTML, emails — into clean, VALIDATED structured data (tables/records →…
Skill by gesmith0606
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/gesmith0606-document-extraction
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, spreadsheets, frontend, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/document-extraction
What's inside
- Skill name
document-extraction- Description
- Turn unstructured or semi-structured documents — PDFs (digital or scanned), Word, HTML, emails — into clean, VALIDATED structured data (tables/records → CSV/parquet/JSON). Use when extracting tables, line items, or key fields from financial statements, invoices, receipts, contracts, reports, or forms at any scale; covers OCR, table extraction, normalization, and tie-out validation.
- License
- MIT
- Instructions
- 67 lines in SKILL.md · view on GitHub
Files (3)
- SKILL.md
- extraction-methods.md · references/
- number-parsing.md · references/
SKILL.md (first lines)
# document-extraction
Extract **trustworthy structured data** from documents. The job isn't "read the PDF" — it's "produce
rows you'd stake a number on," with the failures surfaced rather than silently swallowed.
Run all tooling with **python3** (on Windows use a real interpreter / `py -3`, never the MS-Store stub).
For sensitive material see **Confidentiality** below.
## When to use vs neighbors
- **This skill** — document → structured data, with validation. The orchestration.
- `pdf` — the PDF mechanics this leans on (text/table extraction, OCR, forms, splitting).
- `docx` — Word read/extract. `xlsx` — spreadsheet read/write (use it to emit the result to Excel).
- `regex-vs-llm-structured-text` — the deterministic-first parse decision (used in step 3).
- `data-quality` — the assertion library behind step 4. `dataframes` — post-extraction cleanup.
## The pipeline (don't skip a step)
1. **Classify the source.** Digital-text PDF vs scanned-image PDF vs DOCX vs HTML vs already-tabular.
`pdfplumber`/`pdf` can tell you if a PDF has a real text layer (chars present) or is image-only.
2. **Extract** by type (see the matrix below). Tables ≠ prose — pick a table extractor for tables.
3. **Parse fields** deterministically first; escalate to an LLM only for the variable bits (step 3 detail).
4. **Validate** before you trust it — types, required fields, ranges, and **tie-outs** (totals, counts).
5. **Output** clean parquet/CSV/JSON **plus** an exceptions/confidence report. Never silently drop rows.
## Method by document type
| Source | Text | Tables | Notes |
|---|---|---|---|
| Digital PDF | `pypdf`, `pdfplumber` | `pdfplumber` (stream), `camelot`/`tabula` (lattice) | check for a text layer first |
| Scanned PDF / image | OCR: `ocrmypdf` → then digital path, or `pytesseract` | OCR then table-detect | 300+ dpi, deskew first |
| DOCX | `python-docx` (`docx` skill) | `python-docx` tables | styles/headers are reliable anchors |
| HTML / email | `selectolax`/BeautifulSoup | `pandas.read_html` | emails: strip quoted history |
| Already tabular (csv/xls) | — | `pandas`/`xlsx` | you probably don't need this skill |
Lattice = ruled/grid tables (use camelot `flavor='lattice'`); stream = whitespace-aligned columns
(`pdfplumber` or camelot `flavor='stream'`). Full library matrix → `references/extraction-methods.md`.
## Field parsing: deterministic first, LLM only for the hard parts
Anchor on **labels**, not pixel coordinates — layouts drift between document versions. Use regex /
positional rules for stable fields; reach for an LLM **only** when layout is variable or semantics are
fuzzy, and when you do, force a **schema** (e.g. pydantic / structured output) and keep a confidence
score per field. This is exactly the `regex-vs-llm-structured-text` decision — read it.
## Validation: never trust an un-tied-out extraction
Apply `data-quality` assertions to the *output*: required-not-null, type/range, accepted domain, and
the ones that catch extraction errors specifically —
- **Tie-outs:** sum(line items) == stated total; sum(parts) == subtotal == grand total; debits == credits.
- **Counts:** rows extracted == rows expected (e.g. "page says 42 transactions").
- **Cross-field:** dates in range, quantity × unit price == amount.
Route anything failing or low-confidence to an **exceptions report** for human review — don't drop it.
## Gotchas
- **Numbers:** currency symbols, thousands separators, `(123)` = negative, trailing footnote marks,
and **scale** ("in thousands/millions" in a header). Normalize explicitly → `references/number-parsing.md`.
- **OCR:** digit confusions (O/0, l/1, S/5, B/8); validate against checksums/tie-outs, not vibes.
- **Multi-page tables:** headers repeat per page; merged/spanned cells split wrong — verify column count.
- **Provenance:** keep the source file + page (+ bbox if you have it) for every extracted value. In
finance/audit contexts that audit trail is the deliverable, not a nicety.
## Confidentiality
For deal/financial/PII documents, extract **locally** (local `python3` + Tesseract/pdf tooling). Do
**not** send sensitive docs to hosted OCR/LLM extraction services without explicit authorization — see
the confidentiality posture in `~/.claude/CLAUDE.md`. Never commit extracted data rows.
## References
- `references/extraction-methods.md` — per-format library matrix, table extraction (lattice vs stream), OCR pipeline.
- `references/number-parsing.md` — number/currency normalization + the validation tie-out patterns.From gesmith0606/claude-config-public, MIT.
More from gesmith0606/claude-config-public
- 0.570score
comfyui-local-image
gesmith0606
Generate images locally through a running ComfyUI instance (Stable Diffusion / SDXL / Flux, IP-Adapter, PuLID/InsightFace face-consistency) on the user's own…
SkillAFreshness: AClaude Code +9 - 0.565score
animate
gesmith0606
Make a short procedural animation in any style — an explainer, a history, a little story — as a single-file canvas video with a synthesized score, rendered to…
SkillAFreshness: AClaude Code +9 - 0.565score
data-throughput-accelerator
gesmith0606
Diagnose and accelerate large data movement — ingestion, backfill, export, ETL, warehouse loading, manifest catch-up, and table synchronization — by isolating…
SkillAFreshness: AClaude Code +9 - 0.561score
browser-harness
gesmith0606
Use for INTERACTIVE/STATEFUL browser work: filling forms, auth/login flows, JS-rendered scraping, screenshots, and multi-step site/app automation or testing.
SkillAFreshness: AClaude Code +9 - 0.560score
bitwarden
gesmith0606
Operate the Bitwarden CLI (`bw`) as this config's secrets backend — unlocking per shell, adding machine secrets, resolving them at runtime, and diagnosing…
SkillAFreshness: AClaude Code +9 - 0.539score
codebase-design
gesmith0606
Shared vocabulary for designing deep modules.
SkillAFreshness: AClaude Code +9 - 0.530score
api-design
gesmith0606
REST API design patterns including resource naming, status codes, pagination, filtering, error responses, versioning, and rate limiting.
SkillAFreshness: AClaude Code +9 - 0.529score
dashboard
gesmith0606
Build data dashboards and visualizations — the right chart for the question, the right library, honest accessible encodings, clean layout.
SkillBFreshness: BClaude Code +9 - 0.529score
cheap-data-orchestration
gesmith0606
Cost-optimal scheduling for solo / small-team data pipelines: a GitHub Actions cron job that runs dbt-core or scripts, publishes results, and stays correct on…
SkillBFreshness: BClaude Code +9 - 0.529score
dataframes
gesmith0606
Correct and performant in-process dataframe work in pandas, polars, and duckdb.
SkillBFreshness: BClaude Code +9 - 0.529score
diagram
gesmith0606
Create technical diagrams-as-code (Mermaid by default) — architecture, flowcharts, sequence/state/ER/class/data-flow diagrams, mind maps, Gantt, C4 —…
SkillBFreshness: BClaude Code +9 - 0.529score
data-quality
gesmith0606
Data validation and quality contracts for pipelines — uniqueness/PK, not-null, range/domain, referential integrity, freshness/SLA, row-count tie-out…
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 9, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from gesmith0606
- 0.570score
comfyui-local-image
gesmith0606
Generate images locally through a running ComfyUI instance (Stable Diffusion / SDXL / Flux, IP-Adapter, PuLID/InsightFace face-consistency) on the user's own…
SkillAFreshness: AClaude Code +9 - 0.565score
data-throughput-accelerator
gesmith0606
Diagnose and accelerate large data movement — ingestion, backfill, export, ETL, warehouse loading, manifest catch-up, and table synchronization — by isolating…
SkillAFreshness: AClaude Code +9 - 0.565score
animate
gesmith0606
Make a short procedural animation in any style — an explainer, a history, a little story — as a single-file canvas video with a synthesized score, rendered to…
SkillAFreshness: AClaude Code +9 - 0.561score
browser-harness
gesmith0606
Use for INTERACTIVE/STATEFUL browser work: filling forms, auth/login flows, JS-rendered scraping, screenshots, and multi-step site/app automation or testing.
SkillAFreshness: AClaude Code +9 - 0.560score
bitwarden
gesmith0606
Operate the Bitwarden CLI (`bw`) as this config's secrets backend — unlocking per shell, adding machine secrets, resolving them at runtime, and diagnosing…
SkillAFreshness: AClaude Code +9 - 0.539score
codebase-design
gesmith0606
Shared vocabulary for designing deep modules.
SkillAFreshness: AClaude Code +9
Cite this page
document-extraction skill. Agent Mart. https://agentmart.dev/skills/gesmith0606-document-extraction (last updated 2026-10-24)