document-processor
Extract and process content from PDFs and DOCX files. Handles large files, OCR for scanned documents, page splitting, and markdown conversion. Use when: (1) Processing PDF references in notes, (2) Extracting text from large documents for analysis, (3) Converting DOCX to markdown, (4) Handling scanned/image PDFs with OCR, (5) Integrating with Obsidian or note-taking workflows, (6) Splitting large documents into manageable chunks. Invoke with: /process-document, /extract-pdf, /extract-docx, or say "use document-processor skill to..."
What this skill does
# Document Processor Extract content from PDFs and DOCX files for analysis, summarization, and note integration. ## Design Philosophy ### The Large File Problem Claude can read PDFs directly, but large files (>5MB) often fail or timeout. This skill provides extraction scripts that handle files of any size by processing page-by-page and optionally splitting output into chunks. ### Extract First, Summarize Second The Python scripts focus on extraction quality, not summarization. They produce clean text output that Claude can then analyze, summarize, or integrate into notes. This separation means extraction is deterministic and repeatable. ### Progressive Enhancement The tools work with minimal dependencies (pure Python) but support enhanced extraction when additional tools are installed: - **Base**: `pypdf` + `python-docx` (always works) - **Better PDF**: `pdftotext` via poppler (better text extraction) - **OCR**: `tesseract` + `pytesseract` (scanned documents) ### Format Preservation DOCX conversion to markdown preserves document structure: headings become `#`, bold becomes `**`, tables become markdown tables. This makes extracted content immediately useful in markdown-based note systems. --- ## Anti-Patterns: What to Avoid ### The Direct Read Timeout **Symptom:** Trying to read a 50MB PDF directly with Claude's Read tool. **Problem:** Large files timeout or consume excessive context. **Solution:** Use `extract_pdf.py` to process the file, then read the extracted text. ### The OCR Assumption **Symptom:** Running OCR on every PDF. **Problem:** OCR is slow and OCR dependencies are heavy. **Solution:** Only use `--ocr` flag when standard extraction returns minimal text. ### The Full Document Dump **Symptom:** Extracting 500 pages and asking Claude to summarize all of it. **Problem:** Context overflow, poor summaries. **Solution:** Use `--split 50` to process in chunks, summarize each chunk, then synthesize. ### The Missing Dependency Loop **Symptom:** User tries to use OCR but hasn't installed tesseract. **Problem:** Confusing errors, wasted time. **Solution:** Scripts detect missing dependencies and provide clear install instructions. --- ## Quick Start ### Check File Size First Before processing, check file size to choose the right strategy: ```bash ls -lh document.pdf ``` | Size | Strategy | |------|----------| | < 5MB | Try Claude's Read tool first | | 5-20MB | Use extraction scripts | | > 20MB | Use extraction scripts with `--split` | ### Basic Extraction ```bash # PDF extraction python scripts/extract_pdf.py --file document.pdf # DOCX to markdown python scripts/extract_docx.py --file document.docx --markdown ``` --- ## PDF Processing Workflow ### Step 1: Assess the PDF ```bash # Check file size and type ls -lh document.pdf # Quick metadata check python scripts/extract_pdf.py --file document.pdf --metadata-only ``` ### Step 2: Extract Content **For text-based PDFs:** ```bash python scripts/extract_pdf.py --file document.pdf ``` **For scanned/image PDFs:** ```bash # First, try normal extraction python scripts/extract_pdf.py --file document.pdf # If little text extracted, use OCR python scripts/extract_pdf.py --file document.pdf --ocr ``` ### Step 3: Handle Large Documents For documents > 50 pages, split into chunks: ```bash # Split into 50-page chunks python scripts/extract_pdf.py --file large.pdf --split 50 ``` ### Step 4: Extract Specific Pages ```bash # Single page python scripts/extract_pdf.py --file document.pdf --page 5 # Page range python scripts/extract_pdf.py --file document.pdf --pages 1-10 # Specific pages python scripts/extract_pdf.py --file document.pdf --pages 1,5,10,15 ``` --- ## DOCX Processing Workflow ### Step 1: Basic Extraction ```bash # Plain text python scripts/extract_docx.py --file document.docx # As markdown (preserves structure) python scripts/extract_docx.py --file document.docx --markdown ``` ### Step 2: Extract with Images ```bash # Extract text and save images python scripts/extract_docx.py --file document.docx --markdown --extract-images --output-dir ./images/ ``` ### Step 3: Metadata Only ```bash python scripts/extract_docx.py --file document.docx --metadata-only ``` --- ## Obsidian Integration ### Processing PDF References in Notes When a note contains PDF references like `[[document.pdf]]` or `[Report](attachments/report.pdf)`: 1. Identify the PDF path 2. Check file size 3. Extract content using appropriate strategy 4. Insert summary below the reference **Output format:** ```markdown > **PDF Summary: [Document Title]** > **Pages:** [count] | **Type:** [article/manual/report] > > **Overview:** [2-3 sentence summary] > > **Key Sections:** > - [Section 1]: [brief description] > - [Section 2]: [brief description] > > <details> > <summary>Extracted Content</summary> > > [Page-by-page text content] > > </details> ``` ### Processing DOCX References For `[[document.docx]]` or `[Document](path/to/file.docx)`: 1. Extract as markdown 2. Optionally extract images to attachments folder 3. Insert content or summary --- ## Script Reference ### extract_pdf.py | Flag | Description | |------|-------------| | `--file`, `-f` | PDF file to extract (required) | | `--ocr` | Use OCR for scanned documents | | `--use-pdftotext` | Use pdftotext instead of pypdf | | `--split N`, `-s N` | Split into chunks of N pages | | `--page N`, `-p N` | Extract only page N | | `--pages RANGE` | Extract page range (e.g., 1-10 or 1,3,5) | | `--metadata-only`, `-m` | Extract only metadata | | `--json`, `-j` | Output as JSON | ### extract_docx.py | Flag | Description | |------|-------------| | `--file`, `-f` | DOCX file to extract (required) | | `--markdown`, `-md` | Convert to markdown format | | `--extract-images`, `-i` | Extract embedded images | | `--output-dir`, `-o` | Directory for extracted images | | `--metadata-only`, `-m` | Extract only metadata | | `--json`, `-j` | Output as JSON | --- ## Dependency Installation ### Core Dependencies (Required) ```bash pip install pypdf python-docx ``` Or using the requirements file: ```bash pip install -r scripts/requirements.txt ``` ### Enhanced PDF Extraction (Optional) ```bash # macOS brew install poppler # Ubuntu/Debian sudo apt install poppler-utils ``` ### OCR Support (Optional) ```bash # macOS brew install tesseract poppler # Python packages pip install pytesseract pdf2image Pillow ``` --- ## JSON Output Mode For programmatic use, both scripts support JSON output: ```bash # PDF python scripts/extract_pdf.py --file document.pdf --json > output.json # DOCX python scripts/extract_docx.py --file document.docx --json > output.json ``` JSON schema includes: - `success`: boolean - `file_path`: string - `metadata`: object with document properties - `pages` or `content`: extracted text - `error`: string (if failed) --- ## Troubleshooting ### "pypdf not installed" ```bash pip install pypdf ``` ### "python-docx not installed" ```bash pip install python-docx ``` ### "tesseract not installed" (for OCR) ```bash brew install tesseract # macOS sudo apt install tesseract-ocr # Ubuntu ``` ### "Very little text extracted" The PDF may be scanned/image-based. Try: ```bash python scripts/extract_pdf.py --file document.pdf --ocr ``` ### "File too large for Claude to read" Use extraction scripts instead of Read tool: ```bash python scripts/extract_pdf.py --file large.pdf --split 50 ``` --- ## Examples ### Example 1: Process Research Paper ```bash # Extract with page numbers python scripts/extract_pdf.py --file research-paper.pdf # Get just abstract and intro (pages 1-3) python scripts/extract_pdf.py --file research-paper.pdf --pages 1-3 ``` ### Example 2: Convert Contract to Markdown ```bash # Full conversion with structure preserved python scripts/extract_docx.py --file contract.docx --markdown > contract.md ``` ### Example 3: Process Scanned Receipt ```bash # OCR extraction python scripts/extract_pdf.py --file receipt.pdf --ocr
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".