pdf-extract
Skill2 starsChanged 7 months agoMITView on GitHub
Extract text, tables, form fields, and structural metadata from PDF documents. Use when the user uploads PDFs and requests text conversion, table parsing, form field mapping, or layout analysis. Supports both digital (text-based) and scanned (image-based) PDFs with OCR fallback. Do NOT use for PDF generation, editing, merging, or extracting from password-protected/encrypted documents without explicit user authorization.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- wsy1022/china-audit-toolkittheir own version, first seen Nov 1, 2026
- MH221B/skillstheir own version, first seen Oct 13, 2026
- stonegiantstudio/skillstheir own version, first seen Sep 29, 2026
- ghbhiee/skillstheir own version, first seen Aug 21, 2026
- THEROCKSSS/hermes-skills-portfoliotheir own version, first seen Aug 3, 2026
- moriwo-dev-ai/amateras-registrytheir own version, first seen Jul 26, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- stonegiantstudio/skills★ 3same name
- MH221B/skills★ 2same name
- wsy1022/china-audit-toolkit★ 2same name
- ghbhiee/skills★ 1same name
- THEROCKSSS/hermes-skills-portfolio★ 1same name
- moriwo-dev-ai/amateras-registry★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- api-design-standardizerSkill
- api-documentation-generatorSkill
- cloud-infrastructure-architectSkill
- cobol-to-javaSkill
- code-reviewSkill
- compliance-policy-auditorSkill
- database-performance-auditorSkill
- data-cleanupSkill
- incident-post-mortem-generatorSkill
- kaggle-notebook-generatorSkill
- meeting-transcriberSkill
- python-structure-generatorSkill
- python-type-hinterSkill
- refactor-simplifySkill
- github-repo-structure-builderSkill
- security-vulnerability-scannerSkill
- sql-query-optimizerSkill
- unit-test-generatorSkill
- user-story-generatorSkill
- web-researchSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Document contains mixed content: digital text + embedded images + form fields
- Distinctive: line 24
Do NOT use: when the user wants to generate, edit, merge, or compress PDFs — refer them to appropriate document manipulation workflows
- Distinctive: line 79
Always include extraction metadata, confidence indicators, and warnings for low-fidelity regions.
- Very specific: line 139
If requested, provide cleaned text in Markdown, CSV for tables, or key-value pairs for form fields.
- Very specific: line 141
Add <!-- EXTRACTION_NOTE: ...
- Distinctive: line 144
If the input cannot be parsed as a valid PDF, respond with:
- Distinctive: line 152
If the user's extraction goal is ambiguous (e.g., "get the data" without specifying tables vs.
- Distinctive: line 154
Never silently choose an interpretation that could omit critical content or misrepresent document structure.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PDF Extraction
This skill guides systematic extraction and structuring of content from PDF documents. The user provides a PDF file (uploaded or URL) and optionally specifies extraction targets (e.g., "tables only", "form fields", "full text"). Apply the workflow below, then return structured output alongside an extraction audit log.
🎯 When to Use
- User uploads a PDF and requests text extraction, table conversion, or form field mapping
- User mentions scanned documents, OCR, layout parsing, or "convert PDF to JSON/CSV"
- Document contains mixed content: digital text + embedded images + form fields
- Do NOT use when the user wants to generate, edit, merge, or compress PDFs — refer them to appropriate document manipulation workflows
- Do NOT use for password-protected, encrypted, or digitally signed PDFs unless the user explicitly provides decryption credentials and authorizes processing
- Do NOT use for non-PDF inputs (Word docs, images, HTML) — this skill targets PDF format only; refer other formats to conversion workflows first
🧠 Core Workflow
Step 1 — Ingest & Classify Parse the PDF metadata and detect document characteristics:
- Text layer presence: digital text vs. scanned/image-based pages
- Page count, dimensions, and orientation consistency
- Form field detection (AcroForm, XFA) and interactive element inventory
- Security flags: encryption, printing restrictions, copy protection Report detected structure and note any processing constraints (e.g., "Pages 5-7 are scanned images requiring OCR").
Step 2 — Profile Content Types For each page or region, categorize extractable elements:
- Text blocks: font metadata, reading order, column layout detection
- Tables: border detection, cell alignment, merged cell handling
- Form fields: field names, types (text, checkbox, dropdown), current values
- Images/figures: alt text presence, caption association, OCR eligibility
- Headers/footers: repeating patterns that may require deduplication
Step 3 — Apply Extraction Rules Execute extraction in order of reliability. Log every operation and confidence level.
- Digital Text Priority — For pages with selectable text, extract using
pdfplumber(preferred) orPyPDF2. Preserve reading order and logical paragraph breaks. Never split words across lines unless original layout demands it. - OCR Fallback — For scanned/image-based pages, use
pytesseract+pdf2imagewith language auto-detection. Apply deskewing and contrast enhancement if text confidence <90%. Flag low-confidence extractions with⚠️ OCR-uncertainmarker. - Table Structuring — Detect table boundaries via border analysis or whitespace
clustering. Output as nested JSON arrays with header row identification. For
complex/multi-page tables, add
table_idandcontinues_on_pagemetadata. - Form Field Mapping — Extract field names, types, and values. For unchecked
checkboxes or empty fields, include
value: nullrather than omitting the field. Preserve field hierarchy (e.g., grouped radio buttons). - Layout Cleanup — Remove repeating headers/footers if detected across ≥3 pages. Fix hyphenated line breaks. Normalize whitespace without collapsing intentional indentation (e.g., code snippets, poetry).
- Encoding & Special Characters — Detect and preserve Unicode characters. Flag any substitution artifacts (e.g., `` replacement characters) in warnings.
Step 4 — Validate & Synthesize Cross-check extraction completeness:
- Text length sanity check vs. visual page content (flag unusually short extractions)
- Table row/column consistency across pages
- Form field count matches AcroForm dictionary
- OCR confidence averages reported per page Group findings by page and extraction type. Verify all line references and coordinates map to the original PDF coordinate system when applicable.
Step 5 — Return Output Provide structured JSON output followed by optional human-readable formats. Always include extraction metadata, confidence indicators, and warnings for low-fidelity regions. Never silently drop content due to parsing complexity — flag it explicitly for human review.
📋 Output Format
Return two sections: Section 1 — Extraction Report
{
"status": "success | partial | error",
"metadata": {
"page_count": 0,
"extraction_method": "pdfplumber | pytesseract | hybrid",
"processing_time_seconds": 0.0,
"ocr_languages_detected": ["eng"],
"security_flags": ["encrypted", "copy_restricted"]
},
"text_blocks": [
{
"page": 1,
"bbox": [x1, y1, x2, y2],
"content": "Extracted text content",
"confidence": 0.98,
"font_info": {"name": "Arial", "size": 12}
}
],
"tables": [
{
"page": 2,
"table_id": "tbl_001",
"headers": ["Name", "Date", "Amount"],
"rows": [["Alice", "2024-01-15", "100.00"]],
"bbox": [x1, y1, x2, y2],
"confidence": 0.95,
"continues_on_page": 3
}
],
"form_fields": [
{
"name": "applicant_name",
"type": "text",
"value": "John Doe",
"page": 1,
"required": true
}
],
"summary": "Extracted 3 pages: 2 digital, 1 OCR. 2 tables, 5 form fields. OCR confidence avg: 92%.",
"warnings": [
{
"page": 3,
"element_type": "text_block | table | form_field",
"issue": "Description of extraction limitation (e.g., 'Low OCR confidence due to image quality')",
"bbox": [x1, y1, x2, y2],
"suggestion": "Manual review recommended for this region"
}
]
}Section 2 — Optional Human-Readable Output
If requested, provide cleaned text in Markdown, CSV for tables, or key-value pairs
for form fields. Only include this section if explicitly requested by the user.
Add <!-- EXTRACTION_NOTE: ... --> comments highlighting low-confidence regions.
⚠️ Fallback Behavior
If the input cannot be parsed as a valid PDF, respond with:
{
"status": "error",
"message": "Input does not appear to be a valid PDF document. File may be corrupted, password-protected, or non-PDF format.",
"suggestion": "Please verify the file is a standard PDF and not encrypted. If scanned, ensure image quality is sufficient for OCR."
}If the user's extraction goal is ambiguous (e.g., "get the data" without specifying tables vs. text vs. forms), ask one targeted clarifying question before proceeding. Never silently choose an interpretation that could omit critical content or misrepresent document structure. For password-protected PDFs, request explicit authorization before attempting any decryption or processing.
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
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.

