[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NT463CNZMZSCZKNCXE1AMB":3,"skill-same:01M6NT463CNZMZSCZKNCXE1AMB":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":13,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M6NT463CNZMZSCZKNCXE1AMB","ocr-and-documents",null,"Extract text from PDFs and scanned documents. Use web_extract for remote URLs, pymupdf for local text-based PDFs, marker-pdf for OCR\u002Fscanned docs. For DOCX use python-docx, for PPTX see the powerpoint skill.","qubit-calculus\u002FQubit","qubit-calculus","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F271071935?v=4","01M6NS19569VZ1F2Z0SACBWPS7","01M6NS1992MKFQVNP9AGRTSZXN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fproductivity\u002Focr-and-documents\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"documents","ocr","ocr and documents","hermes","for","text-extraction","python-docx","remote","pymupdf","local","arxiv","use","docx","text","powerpoint","web","research","python","pptx","PDF","2026-11-10 10:12:30",false,"---\nname: ocr-and-documents\ndescription: Extract text from PDFs and scanned documents. Use web_extract for remote URLs, pymupdf for local text-based PDFs, marker-pdf for OCR\u002Fscanned docs. For DOCX use python-docx, for PPTX see the powerpoint skill.\nversion: 2.3.0\nauthor: Hermes Agent\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [PDF, Documents, Research, Arxiv, Text-Extraction, OCR]\n    related_skills: [powerpoint]\n---\n\n# PDF & Document Extraction\n\nFor DOCX: use `python-docx` (parses actual document structure, far better than OCR).\nFor PPTX: see the `powerpoint` skill (uses `python-pptx` with full slide\u002Fnotes support).\nThis skill covers **PDFs and scanned documents**.\n\n## Step 1: Remote URL Available?\n\nIf the document has a URL, **always try `web_extract` first**:\n\n```\nweb_extract(urls=[\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2402.03300\"])\nweb_extract(urls=[\"https:\u002F\u002Fexample.com\u002Freport.pdf\"])\n```\n\nThis handles PDF-to-markdown conversion via Firecrawl with no local dependencies.\n\nOnly use local extraction when: the file is local, web_extract fails, or you need batch processing.\n\n## Step 2: Choose Local Extractor\n\n| Feature | pymupdf (~25MB) | marker-pdf (~3-5GB) |\n|---------|-----------------|---------------------|\n| **Text-based PDF** | ✅ | ✅ |\n| **Scanned PDF (OCR)** | ❌ | ✅ (90+ languages) |\n| **Tables** | ✅ (basic) | ✅ (high accuracy) |\n| **Equations \u002F LaTeX** | ❌ | ✅ |\n| **Code blocks** | ❌ | ✅ |\n| **Forms** | ❌ | ✅ |\n| **Headers\u002Ffooters removal** | ❌ | ✅ |\n| **Reading order detection** | ❌ | ✅ |\n| **Images extraction** | ✅ (embedded) | ✅ (with context) |\n| **Images → text (OCR)** | ❌ | ✅ |\n| **EPUB** | ✅ | ✅ |\n| **Markdown output** | ✅ (via pymupdf4llm) | ✅ (native, higher quality) |\n| **Install size** | ~25MB | ~3-5GB (PyTorch + models) |\n| **Speed** | Instant | ~1-14s\u002Fpage (CPU), ~0.2s\u002Fpage (GPU) |\n\n**Decision**: Use pymupdf unless you need OCR, equations, forms, or complex layout analysis.\n\nIf the user needs marker capabilities but the system lacks ~5GB free disk:\n> \"This document needs OCR\u002Fadvanced extraction (marker-pdf), which requires ~5GB for PyTorch and models. Your system has [X]GB free. Options: free up space, provide a URL so I can use web_extract, or I can try pymupdf which works for text-based PDFs but not scanned documents or equations.\"\n\n---\n\n## pymupdf (lightweight)\n\n```bash\npip install pymupdf pymupdf4llm\n```\n\n**Via helper script**:\n```bash\npython scripts\u002Fextract_pymupdf.py document.pdf              # Plain text\npython scripts\u002Fextract_pymupdf.py document.pdf --markdown    # Markdown\npython scripts\u002Fextract_pymupdf.py document.pdf --tables      # Tables\npython scripts\u002Fextract_pymupdf.py document.pdf --images out\u002F # Extract images\npython scripts\u002Fextract_pymupdf.py document.pdf --metadata    # Title, author, pages\npython scripts\u002Fextract_pymupdf.py document.pdf --pages 0-4   # Specific pages\n```\n\n**Inline**:\n```bash\npython3 -c \"\nimport pymupdf\ndoc = pymupdf.open('document.pdf')\nfor page in doc:\n    print(page.get_text())\n\"\n```\n\n---\n\n## marker-pdf (high-quality OCR)\n\n```bash\n# Check disk space first\npython scripts\u002Fextract_marker.py --check\n\npip install marker-pdf\n```\n\n**Via helper script**:\n```bash\npython scripts\u002Fextract_marker.py document.pdf                # Markdown\npython scripts\u002Fextract_marker.py document.pdf --json         # JSON with metadata\npython scripts\u002Fextract_marker.py document.pdf --output_dir out\u002F  # Save images\npython scripts\u002Fextract_marker.py scanned.pdf                 # Scanned PDF (OCR)\npython scripts\u002Fextract_marker.py document.pdf --use_llm      # LLM-boosted accuracy\n```\n\n**CLI** (installed with marker-pdf):\n```bash\nmarker_single document.pdf --output_dir .\u002Foutput\nmarker \u002Fpath\u002Fto\u002Ffolder --workers 4    # Batch\n```\n\n---\n\n## Arxiv Papers\n\n```\n# Abstract only (fast)\nweb_extract(urls=[\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.03300\"])\n\n# Full paper\nweb_extract(urls=[\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2402.03300\"])\n\n# Search\nweb_search(query=\"arxiv GRPO reinforcement learning 2026\")\n```\n\n## Split, Merge & Search\n\npymupdf handles these natively — use `execute_code` or inline Python:\n\n```python\n# Split: extract pages 1-5 to a new PDF\nimport pymupdf\ndoc = pymupdf.open(\"report.pdf\")\nnew = pymupdf.open()\nfor i in range(5):\n    new.insert_pdf(doc, from_page=i, to_page=i)\nnew.save(\"pages_1-5.pdf\")\n```\n\n```python\n# Merge multiple PDFs\nimport pymupdf\nresult = pymupdf.open()\nfor path in [\"a.pdf\", \"b.pdf\", \"c.pdf\"]:\n    result.insert_pdf(pymupdf.open(path))\nresult.save(\"merged.pdf\")\n```\n\n```python\n# Search for text across all pages\nimport pymupdf\ndoc = pymupdf.open(\"report.pdf\")\nfor i, page in enumerate(doc):\n    results = page.search_for(\"revenue\")\n    if results:\n        print(f\"Page {i+1}: {len(results)} match(es)\")\n        print(page.get_text(\"text\"))\n```\n\nNo extra dependencies needed — pymupdf covers split, merge, search, and text extraction in one package.\n\n---\n\n## Notes\n\n- `web_extract` is always first choice for URLs\n- pymupdf is the safe default — instant, no models, works everywhere\n- marker-pdf is for OCR, scanned docs, equations, complex layouts — install only when needed\n- Both helper scripts accept `--help` for full usage\n- marker-pdf downloads ~2.5GB of models to `~\u002F.cache\u002Fhuggingface\u002F` on first use\n- For Word docs: `pip install python-docx` (better than OCR — parses actual structure)\n- For PowerPoint: see the `powerpoint` skill (uses python-pptx)\n","# PDF & Document Extraction\n\nFor DOCX: use `python-docx` (parses actual document structure, far better than OCR).\nFor PPTX: see the `powerpoint` skill (uses `python-pptx` with full slide\u002Fnotes support).\nThis skill covers **PDFs and scanned documents**.\n\n## Step 1: Remote URL Available?\n\nIf the document has a URL, **always try `web_extract` first**:\n\n```\nweb_extract(urls=[\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2402.03300\"])\nweb_extract(urls=[\"https:\u002F\u002Fexample.com\u002Freport.pdf\"])\n```\n\nThis handles PDF-to-markdown conversion via Firecrawl with no local dependencies.\n\nOnly use local extraction when: the file is local, web_extract fails, or you need batch processing.\n\n## Step 2: Choose Local Extractor\n\n| Feature | pymupdf (~25MB) | marker-pdf (~3-5GB) |\n|---------|-----------------|---------------------|\n| **Text-based PDF** | ✅ | ✅ |\n| **Scanned PDF (OCR)** | ❌ | ✅ (90+ languages) |\n| **Tables** | ✅ (basic) | ✅ (high accuracy) |\n| **Equations \u002F LaTeX** | ❌ | ✅ |\n| **Code blocks** | ❌ | ✅ |\n| **Forms** | ❌ | ✅ |\n| **Headers\u002Ffooters removal** | ❌ | ✅ |\n| **Reading order detection** | ❌ | ✅ |\n| **Images extraction** | ✅ (embedded) | ✅ (with context) |\n| **Images → text (OCR)** | ❌ | ✅ |\n| **EPUB** | ✅ | ✅ |\n| **Markdown output** | ✅ (via pymupdf4llm) | ✅ (native, higher quality) |\n| **Install size** | ~25MB | ~3-5GB (PyTorch + models) |\n| **Speed** | Instant | ~1-14s\u002Fpage (CPU), ~0.2s\u002Fpage (GPU) |\n\n**Decision**: Use pymupdf unless you need OCR, equations, forms, or complex layout analysis.\n\nIf the user needs marker capabilities but the system lacks ~5GB free disk:\n> \"This document needs OCR\u002Fadvanced extraction (marker-pdf), which requires ~5GB for PyTorch and models. Your system has [X]GB free. Options: free up space, provide a URL so I can use web_extract, or I can try pymupdf which works for text-based PDFs but not scanned documents or equations.\"\n\n---\n\n## pymupdf (lightweight)\n\n```bash\npip install pymupdf pymupdf4llm\n```\n\n**Via helper script**:\n```bash\npython scripts\u002Fextract_pymupdf.py document.pdf              # Plain text\npython scripts\u002Fextract_pymupdf.py document.pdf --markdown    # Markdown\npython scripts\u002Fextract_pymupdf.py document.pdf --tables      # Tables\npython scripts\u002Fextract_pymupdf.py document.pdf --images out\u002F # Extract images\npython scripts\u002Fextract_pymupdf.py document.pdf --metadata    # Title, author, pages\npython scripts\u002Fextract_pymupdf.py document.pdf --pages 0-4   # Specific pages\n```\n\n**Inline**:\n```bash\npython3 -c \"\nimport pymupdf\ndoc = pymupdf.open('document.pdf')\nfor page in doc:\n    print(page.get_text())\n\"\n```\n\n---\n\n## marker-pdf (high-quality OCR)\n\n```bash\n# Check disk space first\npython scripts\u002Fextract_marker.py --check\n\npip install marker-pdf\n```\n\n**Via helper script**:\n```bash\npython scripts\u002Fextract_marker.py document.pdf                # Markdown\npython scripts\u002Fextract_marker.py document.pdf --json         # JSON with metadata\npython scripts\u002Fextract_marker.py document.pdf --output_dir out\u002F  # Save images\npython scripts\u002Fextract_marker.py scanned.pdf                 # Scanned PDF (OCR)\npython scripts\u002Fextract_marker.py document.pdf --use_llm      # LLM-boosted accuracy\n```\n\n**CLI** (installed with marker-pdf):\n```bash\nmarker_single document.pdf --output_dir .\u002Foutput\nmarker \u002Fpath\u002Fto\u002Ffolder --workers 4    # Batch\n```\n\n---\n\n## Arxiv Papers\n\n```\n# Abstract only (fast)\nweb_extract(urls=[\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.03300\"])\n\n# Full paper\nweb_extract(urls=[\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2402.03300\"])\n\n# Search\nweb_search(query=\"arxiv GRPO reinforcement learning 2026\")\n```\n\n## Split, Merge & Search\n\npymupdf handles these natively — use `execute_code` or inline Python:\n\n```python\n# Split: extract pages 1-5 to a new PDF\nimport pymupdf\ndoc = pymupdf.open(\"report.pdf\")\nnew = pymupdf.open()\nfor i in range(5):\n    new.insert_pdf(doc, from_page=i, to_page=i)\nnew.save(\"pages_1-5.pdf\")\n```\n\n```python\n# Merge multiple PDFs\nimport pymupdf\nresult = pymupdf.open()\nfor path in [\"a.pdf\", \"b.pdf\", \"c.pdf\"]:\n    result.insert_pdf(pymupdf.open(path))\nresult.save(\"merged.pdf\")\n```\n\n```python\n# Search for text across all pages\nimport pymupdf\ndoc = pymupdf.open(\"report.pdf\")\nfor i, page in enumerate(doc):\n    results = page.search_for(\"revenue\")\n    if results:\n        print(f\"Page {i+1}: {len(results)} match(es)\")\n        print(page.get_text(\"text\"))\n```\n\nNo extra dependencies needed — pymupdf covers split, merge, search, and text extraction in one package.\n\n---\n\n## Notes\n\n- `web_extract` is always first choice for URLs\n- pymupdf is the safe default — instant, no models, works everywhere\n- marker-pdf is for OCR, scanned docs, equations, complex layouts — install only when needed\n- Both helper scripts accept `--help` for full usage\n- marker-pdf downloads ~2.5GB of models to `~\u002F.cache\u002Fhuggingface\u002F` on first use\n- For Word docs: `pip install python-docx` (better than OCR — parses actual structure)\n- For PowerPoint: see the `powerpoint` skill (uses python-pptx)\n",{"name":5,"author":43,"license":14,"version":44,"metadata":45,"description":7},"Hermes Agent","2.3.0",{"hermes":46},{"tags":47,"related_skills":53},[37,48,49,50,51,52],"Documents","Research","Arxiv","Text-Extraction","OCR",[32],"main","a05c0ccfff1cda2a5d12e9ee7d02b75350ac0557","packages\u002Fskills\u002Fhermes\u002Fproductivity\u002Focr-and-documents","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit","https:\u002F\u002Fgithub.com\u002Fqubit-calculus","2026-04-07 15:16:13",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add qubit-calculus\u002FQubit --skill ocr-and-documents",{"tool":66,"command":67},"bunx","bunx skills add qubit-calculus\u002FQubit --skill ocr-and-documents",{"tool":69,"command":70},"pnpm","pnpm dlx skills add qubit-calculus\u002FQubit --skill ocr-and-documents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fproductivity\u002Focr-and-documents\u002FSKILL.md",true,[74,80,86],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"DESCRIPTION.md","REFERENCE","参考文档",147,"https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fproductivity\u002Focr-and-documents\u002FDESCRIPTION.md",{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Fextract_marker.py","SCRIPT","脚本",3034,"https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fproductivity\u002Focr-and-documents\u002Fscripts\u002Fextract_marker.py",{"path":87,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fextract_pymupdf.py",3132,"https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fproductivity\u002Focr-and-documents\u002Fscripts\u002Fextract_pymupdf.py",[91,116,136,151,165,185],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":38},"01M6NT8MKBM6Q660B4D7SHXE3F","writing-plans","Use when you have a spec or requirements for a multi-step task. Creates comprehensive implementation plans with bite-sized tasks, exact file paths, and complete code examples.","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fsoftware-development\u002Fwriting-plans\u002FSKILL.md",[],[98,99,100,101,102,103,104,105,106,107,108,109,110,29,111,112,113,114,115,22],"writing","writing plans","plans","design","review","workflow","documentation","tasks","development","code","planning","code-review","subagent","superpowers","complete","paths","test-driven-development","you",{"skillNo":117,"name":114,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":38},"01M6NT8G9H510DV7VMY4X4Q9F3","Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle with test-first approach.","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fsoftware-development\u002Ftest-driven-development\u002FSKILL.md",[],[122,123,106,124,125,98,126,107,127,110,111,128,129,130,131,100,132,133,134,135],"test","test driven development","driven","testing","debugging","refactor","red-green-refactor","cycle","green","feature","systematic","bugfix","implementing","systematic-debugging",{"skillNo":137,"name":135,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":38},"01M6NT87T34SVN9P1S3PCBWY2D","Use when encountering any bug, test failure, or unexpected behavior. 4-phase root cause investigation — NO fixes without understanding the problem first.","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[],[142,126,132,98,122,106,143,144,110,21,145,29,111,146,147,148,100,149,114,150],"systematic debugging","first","investigation","behavior","bug","root-cause","problem-solving","problem","fixes",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":38},"01M6NT83GMFJRDY84BWJHQSVQE","subagent-driven-development","Use when executing implementation plans with independent tasks. Dispatches fresh delegate_task per task with two-stage review (spec compliance then code quality).","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fsoftware-development\u002Fsubagent-driven-development\u002FSKILL.md",[],[106,158,110,124,98,102,103,159,105,107,160,109,161,162,29,111,163,100,164,114],"subagent driven development","code quality","delegation","parallel","delegate","stage","fresh",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":38},"01M6NT7YMC7H5NK632ED23WMV6","requesting-code-review","Pre-commit verification pipeline — static security scan, baseline-aware quality gates, independent reviewer subagent, and auto-fix loop. Use after code changes and before committing, pushing, or opening a PR.","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fsoftware-development\u002Frequesting-code-review\u002FSKILL.md",[],[172,102,107,173,98,174,175,109,176,177,178,179,110,180,181,182,111,114,183,184],"code review","requesting code review","security","commit","verification","security scan","pipeline","loop","reviewer","fix","auto","static","auto-fix",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":38},"01M6NT7AWK0VW1RFSJTAG92363","plan","Plan mode for Hermes — inspect context, write a markdown plan into the active workspace's `.hermes\u002Fplans\u002F` directory, and do not execute the work.","https:\u002F\u002Fgithub.com\u002Fqubit-calculus\u002FQubit\u002Fblob\u002Fmain\u002Fpackages\u002Fskills\u002Fhermes\u002Fsoftware-development\u002Fplan\u002FSKILL.md",[],[187,98,192,103,106,108,193,110,194,195,196,197,198,199,100,200,201,202,22,203],"directory","markdown","workspace","work","write","implementation","do","active","plan mode","inspect","mode","plan-mode"]