[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJXJC7RXTK1YX40HEW2TH1":3,"skill-same:01M6KJXJC7RXTK1YX40HEW2TH1":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":13,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6KJXJC7RXTK1YX40HEW2TH1","robust-pdf-read",null,"Reliably extract text from PDFs using pdftotext when standard file reading fails.","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Frobust-pdf-read\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33],"PDF","read","pdf read","robust pdf read","file","tool","text","extract","guide","reading","pdftotext","2026-11-10 10:12:30",false,"---\nname: robust-pdf-read\ndescription: Reliably extract text from PDFs using pdftotext when standard file reading fails.\ncategory: tool_guide\n---\n\n# Robust PDF Text Extraction\n\n## Problem\nStandard file reading tools (e.g., `read_file`) often fail to extract text from PDF documents. Instead of returning parsed text, they may return:\n- Raw binary data\n- Base64 encoded images\n- Garbled characters or null bytes\n\nThis occurs because PDFs are complex binary formats, not plain text files. Attempts to parse them using general-purpose Python libraries (like PyMuPDF) in sandboxed environments may also fail due to missing dependencies or environment restrictions.\n\n## Solution\nUse the `pdftotext` command-line utility (part of `poppler-utils`) via `run_shell`. This tool is commonly pre-installed in Linux environments and reliably extracts text content from PDFs.\n\n## Procedure\n\n### 1. Detect Extraction Failure\nWhen attempting to read a PDF:\n- Check the content returned by `read_file`.\n- If the content contains null bytes (`\\x00`), appears as base64, or is clearly binary\u002Fgarbled, assume standard reading has failed.\n\n### 2. Execute pdftotext\nRun the following shell command using `run_shell`:\n\n```bash\npdftotext -layout -nopgbrk \u003Cfile_path> -\n```\n\n- `-layout`: Maintains the physical layout of the text (optional but recommended).\n- `-nopgbrk`: Prevents inserting form feed characters between pages.\n- `-`: Outputs content to stdout instead of creating a new file.\n\n### 3. Parse Output\nCapture the stdout from the shell command. This string is the extracted text.\n\n## Example Usage\n\n**Scenario:** You need to read `document.pdf`.\n\n**Step 1: Attempt standard read**\n```python\ncontent = read_file(\"document.pdf\")\nif \"\\x00\" in content or not content.strip():\n    # Fallback needed\n    pass\n```\n\n**Step 2: Fallback to shell**\n```python\nresult = run_shell(\"pdftotext -layout -nopgbrk document.pdf -\")\ntext = result.stdout\n```\n\n## Prerequisites\n- The environment must have `pdftotext` installed (usually via `poppler-utils`).\n- If `pdftotext` is not found, attempt to install it (`apt-get install poppler-utils`) if permissions allow, or notify the user.\n\n## Benefits\n- **Reliability:** Bypasses Python library dependency issues in sandboxes.\n- **Speed:** Command-line tools are often faster than loading heavy Python libraries.\n- **Compatibility:** Works consistently across most Linux-based agent environments.","# Robust PDF Text Extraction\n\n## Problem\nStandard file reading tools (e.g., `read_file`) often fail to extract text from PDF documents. Instead of returning parsed text, they may return:\n- Raw binary data\n- Base64 encoded images\n- Garbled characters or null bytes\n\nThis occurs because PDFs are complex binary formats, not plain text files. Attempts to parse them using general-purpose Python libraries (like PyMuPDF) in sandboxed environments may also fail due to missing dependencies or environment restrictions.\n\n## Solution\nUse the `pdftotext` command-line utility (part of `poppler-utils`) via `run_shell`. This tool is commonly pre-installed in Linux environments and reliably extracts text content from PDFs.\n\n## Procedure\n\n### 1. Detect Extraction Failure\nWhen attempting to read a PDF:\n- Check the content returned by `read_file`.\n- If the content contains null bytes (`\\x00`), appears as base64, or is clearly binary\u002Fgarbled, assume standard reading has failed.\n\n### 2. Execute pdftotext\nRun the following shell command using `run_shell`:\n\n```bash\npdftotext -layout -nopgbrk \u003Cfile_path> -\n```\n\n- `-layout`: Maintains the physical layout of the text (optional but recommended).\n- `-nopgbrk`: Prevents inserting form feed characters between pages.\n- `-`: Outputs content to stdout instead of creating a new file.\n\n### 3. Parse Output\nCapture the stdout from the shell command. This string is the extracted text.\n\n## Example Usage\n\n**Scenario:** You need to read `document.pdf`.\n\n**Step 1: Attempt standard read**\n```python\ncontent = read_file(\"document.pdf\")\nif \"\\x00\" in content or not content.strip():\n    # Fallback needed\n    pass\n```\n\n**Step 2: Fallback to shell**\n```python\nresult = run_shell(\"pdftotext -layout -nopgbrk document.pdf -\")\ntext = result.stdout\n```\n\n## Prerequisites\n- The environment must have `pdftotext` installed (usually via `poppler-utils`).\n- If `pdftotext` is not found, attempt to install it (`apt-get install poppler-utils`) if permissions allow, or notify the user.\n\n## Benefits\n- **Reliability:** Bypasses Python library dependency issues in sandboxes.\n- **Speed:** Command-line tools are often faster than loading heavy Python libraries.\n- **Compatibility:** Works consistently across most Linux-based agent environments.",{"name":5,"category":39,"description":7},"tool_guide","main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Frobust-pdf-read","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think about is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add AG064\u002FOpenSpace --skill robust-pdf-read",{"tool":53,"command":54},"bunx","bunx skills add AG064\u002FOpenSpace --skill robust-pdf-read",{"tool":56,"command":57},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill robust-pdf-read","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Frobust-pdf-read\u002FSKILL.md",true,[61],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},".skill_id","OTHER","其他",29,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Frobust-pdf-read\u002F.skill_id",[68,91,107,116,146,162],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":34},"01M6KKMPWA0B5SCCH766F8M5EA","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[75,76,77,78,79,80,81,82,83,84,85,86,87,88,27,89,90],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","python","typescript",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":34},"01M6KKMJXVBNVEY3TRK055F4A7","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[98,99,77,88,100,24,27,89,101,102,103,104,105,81,83,106],"readback","write special chars readback","cleanup","scripts","verification","via","post","helper","with",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":34},"01M6KKMEGX9M9NC105J0W3Q5B9","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[77,114,89,81,103,88,115,27,83],"write special chars heredoc","shell",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":127,"publishedAt":34},"01M6KKM8EJ2AATVHZBNB916WT0","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[122],{"categoryNo":123,"categoryName":124,"taxonomyType":125,"taxonomyTypeDesc":126},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[128,129,130,131,90,132,133,134,135,136,81,137,138,139,140,141,142,143,144,145],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":34},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[153,154,155,156,81,157,106,158,159,160,161],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":34},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[169,170,171,172,173,174,27,175,176,177],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]