[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJXJC7RXTK1YX40HEW2TH1":3,"skill-same:01M6KJXJC7RXTK1YX40HEW2TH1":62},{"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":17,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":13,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"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",[],[18,19,20,21,22,23,24,25,26,27,28],"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":34,"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":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add AG064\u002FOpenSpace --skill robust-pdf-read",{"tool":48,"command":49},"bunx","bunx skills add AG064\u002FOpenSpace --skill robust-pdf-read",{"tool":51,"command":52},"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,[56],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},".skill_id","OTHER","其他",29,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Frobust-pdf-read\u002F.skill_id",[63,86,102,111,136,152],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":29},"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",[],[70,71,72,73,74,75,76,77,78,79,80,81,82,83,22,84,85],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","python","typescript",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":29},"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",[],[93,94,72,83,95,19,22,84,96,97,98,99,100,76,78,101],"readback","write special chars readback","cleanup","scripts","verification","via","post","helper","with",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":29},"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",[],[72,109,84,76,98,83,110,22,78],"write special chars heredoc","shell",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":29},"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",[],[118,119,120,121,85,122,123,124,125,126,76,127,128,129,130,131,132,133,134,135],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":29},"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",[],[143,144,145,146,76,147,101,148,149,150,151],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":29},"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",[],[159,160,161,162,163,164,22,165,166,167],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]