[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBXBYTG22HV1K98VVSZD7K":3,"skill-same:01M6XBXBYTG22HV1K98VVSZD7K":65},{"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":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":13,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":44,"install":45,"resources":58},"01M6XBXBYTG22HV1K98VVSZD7K","reliable-pdf-extraction",null,"Use shell commands or Python libraries to extract PDF text when read_file PDF handler fails","UF-gzj\u002Fopenspace-claude-evolution","UF-gzj","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272393507?v=4","01M6XBCZB755P01VVYGQWPYZY3","01M6XBCZFJA5AREA17WGETA3FW",0,"MIT","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Freliable-pdf-extraction\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"PDF","extraction","pdf extraction","reliable pdf extraction","python","libraries","file","shell","text","read","extract","use","commands","extract pdf","handler","when","2026-11-10 10:12:30",false,"---\nname: reliable-pdf-extraction\ndescription: Use shell commands or Python libraries to extract PDF text when read_file PDF handler fails\n---\n\n# Reliable PDF Text Extraction\n\n## Problem\n\nThe `read_file` tool with `filetype='pdf'` often returns binary image data, errors, or unusable output when attempting to extract text from PDF documents. This makes it unreliable for structured data extraction tasks.\n\n## Solution\n\nUse `run_shell` with command-line tools (`pdftotext`, `pdfinfo`) or `execute_code_sandbox` with Python libraries (PyMuPDF, pdfplumber) to extract PDF text content reliably.\n\n## Methods\n\n### Method 1: pdftotext (Recommended for simple extraction)\n\n```bash\n# Extract all text to stdout\npdftotext input.pdf -\n\n# Or extract to file\npdftotext input.pdf output.txt\ncat output.txt\n```\n\n### Method 2: pdfinfo (For metadata)\n\n```bash\npdfinfo input.pdf\n```\n\n### Method 3: Python with PyMuPDF (fitz)\n\n```python\nimport fitz  # PyMuPDF\n\ndoc = fitz.open(\"input.pdf\")\ntext = \"\"\nfor page in doc:\n    text += page.get_text()\nprint(text)\ndoc.close()\n```\n\n### Method 4: Python with pdfplumber (Better for tables\u002Fstructured data)\n\n```python\nimport pdfplumber\n\nwith pdfplumber.open(\"input.pdf\") as pdf:\n    for page in pdf.pages:\n        text = page.extract_text()\n        print(text)\n        # For tables:\n        # tables = page.extract_tables()\n```\n\n## Workflow\n\n1. **Attempt** `read_file` with `filetype='pdf'` first (in case it works)\n\n2. **Check output** - If you receive:\n   - Binary\u002Fgarbage data\n   - Error messages\n   - Empty or truncated content\n   - Image data instead of text\n\n3. **Fall back** to one of the extraction methods above:\n   - Use `pdftotext` via `run_shell` for quick text extraction\n   - Use `pdfplumber` via `execute_code_sandbox` for structured data\u002Ftables\n   - Use `PyMuPDF` for complex layouts or when you need more control\n\n4. **Process** the extracted text for your task\n\n## Example Usage\n\n```python\n# Via run_shell\nresult = run_shell(command=\"pdftotext document.pdf -\")\npdf_text = result.stdout\n\n# Via execute_code_sandbox\ncode = \"\"\"\nimport pdfplumber\nwith pdfplumber.open(\"\u002Fpath\u002Fto\u002Fdocument.pdf\") as pdf:\n    for page in pdf.pages:\n        print(page.extract_text())\n\"\"\"\nresult = execute_code_sandbox(code=code)\npdf_text = result.stdout\n```\n\n## Tips\n\n- **pdftotext** is fastest and most reliable for plain text extraction\n- **pdfplumber** excels at extracting tables and preserving layout\n- **PyMuPDF** offers the most control for complex PDF structures\n- Always check if the PDF is scanned\u002Fimage-based (may need OCR tools like `tesseract`)\n- Some PDFs have copy protection that may prevent text extraction","# Reliable PDF Text Extraction\n\n## Problem\n\nThe `read_file` tool with `filetype='pdf'` often returns binary image data, errors, or unusable output when attempting to extract text from PDF documents. This makes it unreliable for structured data extraction tasks.\n\n## Solution\n\nUse `run_shell` with command-line tools (`pdftotext`, `pdfinfo`) or `execute_code_sandbox` with Python libraries (PyMuPDF, pdfplumber) to extract PDF text content reliably.\n\n## Methods\n\n### Method 1: pdftotext (Recommended for simple extraction)\n\n```bash\n# Extract all text to stdout\npdftotext input.pdf -\n\n# Or extract to file\npdftotext input.pdf output.txt\ncat output.txt\n```\n\n### Method 2: pdfinfo (For metadata)\n\n```bash\npdfinfo input.pdf\n```\n\n### Method 3: Python with PyMuPDF (fitz)\n\n```python\nimport fitz  # PyMuPDF\n\ndoc = fitz.open(\"input.pdf\")\ntext = \"\"\nfor page in doc:\n    text += page.get_text()\nprint(text)\ndoc.close()\n```\n\n### Method 4: Python with pdfplumber (Better for tables\u002Fstructured data)\n\n```python\nimport pdfplumber\n\nwith pdfplumber.open(\"input.pdf\") as pdf:\n    for page in pdf.pages:\n        text = page.extract_text()\n        print(text)\n        # For tables:\n        # tables = page.extract_tables()\n```\n\n## Workflow\n\n1. **Attempt** `read_file` with `filetype='pdf'` first (in case it works)\n\n2. **Check output** - If you receive:\n   - Binary\u002Fgarbage data\n   - Error messages\n   - Empty or truncated content\n   - Image data instead of text\n\n3. **Fall back** to one of the extraction methods above:\n   - Use `pdftotext` via `run_shell` for quick text extraction\n   - Use `pdfplumber` via `execute_code_sandbox` for structured data\u002Ftables\n   - Use `PyMuPDF` for complex layouts or when you need more control\n\n4. **Process** the extracted text for your task\n\n## Example Usage\n\n```python\n# Via run_shell\nresult = run_shell(command=\"pdftotext document.pdf -\")\npdf_text = result.stdout\n\n# Via execute_code_sandbox\ncode = \"\"\"\nimport pdfplumber\nwith pdfplumber.open(\"\u002Fpath\u002Fto\u002Fdocument.pdf\") as pdf:\n    for page in pdf.pages:\n        print(page.extract_text())\n\"\"\"\nresult = execute_code_sandbox(code=code)\npdf_text = result.stdout\n```\n\n## Tips\n\n- **pdftotext** is fastest and most reliable for plain text extraction\n- **pdfplumber** excels at extracting tables and preserving layout\n- **PyMuPDF** offers the most control for complex PDF structures\n- Always check if the PDF is scanned\u002Fimage-based (may need OCR tools like `tesseract`)\n- Some PDFs have copy protection that may prevent text extraction",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Freliable-pdf-extraction","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution","https:\u002F\u002Fgithub.com\u002FUF-gzj","2026-04-16 09:31:03",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill reliable-pdf-extraction",{"tool":51,"command":52},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill reliable-pdf-extraction",{"tool":54,"command":55},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill reliable-pdf-extraction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Freliable-pdf-extraction\u002FSKILL.md",true,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},".skill_id","OTHER","其他",37,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Freliable-pdf-extraction\u002F.skill_id",[66,89,105,113,138,154],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":34},"01M6XCCXD3NCM2YKR3WNGBASPC","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,24,22],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":34},"01M6XCCT7E3J922Q345PBGSHPN","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[96,97,74,24,98,22,99,100,101,102,27,88,103,104,78,81,83],"readback","write special chars readback","helper","post","via","scripts","cleanup","verification","with",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":34},"01M6XCCMQX1R8B6FECWB3P63T7","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[112,74,78,25,83,100,88,24,22,81],"write special chars heredoc",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":34},"01M6XCCG41M994JJEX6VN52PEP","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[],[120,121,122,123,124,76,125,126,127,128,129,81,130,131,132,133,134,135,136,137],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":34},"01M6XCCCHWNKG2W4VH9E6A10HF","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[145,146,147,148,81,149,104,150,151,152,153],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":34},"01M6XCC7X8PKMR2DEW91XGHYSV","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[161,162,163,164,165,166,24,167,168,169],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]