[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFRFZN9NPNNAE73YS732PH":3,"skill-same:01M6KFRFZN9NPNNAE73YS732PH":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6KFRFZN9NPNNAE73YS732PH","pdf-text-extraction-fallback-85d5ca",null,"Fallback workflow for extracting text from PDFs when read_file returns binary data","xyliu-cs\u002FOpenSpace-GDPval","xyliu-cs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89236536?v=4","01M6KF8Z1V4TXS86CKSH48BY8T","xy","01M6KF8Z67443W0SHXM85JEF0B",0,"MIT","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-text-extraction-fallback-85d5ca\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"PDF","extraction","text","fallback","pdf text extraction fallback 85d5ca","pdf text extraction fallback","pdf text extraction","workflow","file","data","returns","read","binary","extracting","for","2026-11-10 10:12:30",false,"---\nname: pdf-text-extraction-fallback-85d5ca\ndescription: Fallback workflow for extracting text from PDFs when read_file returns binary data\n---\n\n# PDF Text Extraction Fallback\n\nUse this skill when `read_file` returns binary data or garbled content for PDF files instead of readable text. This workflow provides a reliable fallback using command-line PDF tools.\n\n## When to Use\n\n- `read_file` with `filetype: pdf` returns binary data, unreadable characters, or errors\n- You need to extract text from a PDF to process its contents\n- Standard file reading methods fail to extract usable text\n\n## Step-by-Step Instructions\n\n### Step 1: Detect Binary\u002FUnreadable PDF Output\n\nAfter attempting to read a PDF with `read_file`, check if the output is:\n- Binary data (contains null bytes, non-printable characters)\n- Garbled text with many special characters\n- Empty or truncated content\n\n```\n# Example of problematic output from read_file\n%PDF-1.4\n1 0 obj\n\u003C\u003C \u002FType \u002FCatalog ...\n```\n\nIf the output looks like raw PDF structure or binary, proceed to Step 2.\n\n### Step 2: Use shell_agent with PDF Tools\n\nInvoke `shell_agent` to extract text using `pdftotext` (preferred) or `pdfplumber` (Python fallback):\n\n```\nTask: Extract all text content from \u003Cfilename.pdf> using pdftotext or pdfplumber.\nOutput the extracted text in readable format. If pdftotext is not available, use Python with pdfplumber library.\n```\n\n**Example shell_agent invocation:**\n```\nshell_agent task=\"Extract text from Move_Out_Inspection_Tracker.pdf using pdftotext. Save output to a .txt file and return the content.\"\n```\n\n### Step 3: Validate Extracted Content\n\nAfter extraction, validate that the content contains expected text patterns:\n\n```python\n# Validation checklist\ndef validate_pdf_extraction(text, expected_patterns=None):\n    checks = [\n        bool(text.strip()),  # Not empty\n        len(text) > 50,  # Has substantial content\n        not text.startswith('%PDF'),  # Not raw PDF structure\n    ]\n    \n    if expected_patterns:\n        for pattern in expected_patterns:\n            checks.append(pattern.lower() in text.lower())\n    \n    return all(checks)\n```\n\n**Common expected patterns to check:**\n- Document-specific keywords (e.g., \"inspection\", \"resident\", \"date\")\n- Expected data formats (dates, names, IDs)\n- Minimum word count threshold\n\n### Step 4: Handle Extraction Failures\n\nIf validation fails:\n\n1. **Try alternative tool:** If `pdftotext` failed, try `pdfplumber`:\n   ```\n   shell_agent task=\"Extract text from \u003Cfile.pdf> using Python pdfplumber library. Handle any encoding issues.\"\n   ```\n\n2. **Try OCR fallback:** For scanned PDFs:\n   ```\n   shell_agent task=\"This PDF may be scanned. Use pytesseract or similar OCR tool to extract text from \u003Cfile.pdf>.\"\n   ```\n\n3. **Report specific error:** Document what patterns were expected but not found.\n\n### Step 5: Proceed with Data Processing\n\nOnce validated text is obtained:\n- Parse the extracted text for required data\n- Store or process the content as needed\n- Continue with the original task workflow\n\n## Code Example\n\n```python\n# Complete extraction workflow\ndef extract_pdf_text_fallback(pdf_path, expected_patterns=None):\n    \"\"\"Extract text from PDF with fallback handling.\"\"\"\n    \n    # Step 1: Try read_file first\n    content = read_file(filetype=\"pdf\", file_path=pdf_path)\n    \n    # Step 2: Check if binary\u002Funreadable\n    if is_binary_or_garbled(content):\n        # Step 3: Use shell_agent fallback\n        result = shell_agent(\n            task=f\"Extract all text from {pdf_path} using pdftotext. Return the text content.\"\n        )\n        content = result.stdout\n        \n        # Step 4: Validate\n        if not validate_pdf_extraction(content, expected_patterns):\n            # Try pdfplumber as secondary fallback\n            result = shell_agent(\n                task=f\"Extract text from {pdf_path} using Python pdfplumber library.\"\n            )\n            content = result.stdout\n    \n    return content\n\ndef is_binary_or_garbled(text):\n    \"\"\"Check if text appears to be binary or unreadable.\"\"\"\n    if not text:\n        return True\n    if text.startswith('%PDF'):\n        return True\n    # Check for high ratio of non-printable characters\n    non_printable = sum(1 for c in text if ord(c) > 127 or ord(c) \u003C 32)\n    return non_printable \u002F len(text) > 0.3\n```\n\n## Tips\n\n- **pdftotext** is typically faster and pre-installed on many systems\n- **pdfplumber** handles complex layouts better but requires Python\n- For **scanned PDFs**, you'll need OCR tools (tesseract, pytesseract)\n- Always validate extracted content matches your expected data patterns\n- Save intermediate extraction results for debugging if needed","# PDF Text Extraction Fallback\n\nUse this skill when `read_file` returns binary data or garbled content for PDF files instead of readable text. This workflow provides a reliable fallback using command-line PDF tools.\n\n## When to Use\n\n- `read_file` with `filetype: pdf` returns binary data, unreadable characters, or errors\n- You need to extract text from a PDF to process its contents\n- Standard file reading methods fail to extract usable text\n\n## Step-by-Step Instructions\n\n### Step 1: Detect Binary\u002FUnreadable PDF Output\n\nAfter attempting to read a PDF with `read_file`, check if the output is:\n- Binary data (contains null bytes, non-printable characters)\n- Garbled text with many special characters\n- Empty or truncated content\n\n```\n# Example of problematic output from read_file\n%PDF-1.4\n1 0 obj\n\u003C\u003C \u002FType \u002FCatalog ...\n```\n\nIf the output looks like raw PDF structure or binary, proceed to Step 2.\n\n### Step 2: Use shell_agent with PDF Tools\n\nInvoke `shell_agent` to extract text using `pdftotext` (preferred) or `pdfplumber` (Python fallback):\n\n```\nTask: Extract all text content from \u003Cfilename.pdf> using pdftotext or pdfplumber.\nOutput the extracted text in readable format. If pdftotext is not available, use Python with pdfplumber library.\n```\n\n**Example shell_agent invocation:**\n```\nshell_agent task=\"Extract text from Move_Out_Inspection_Tracker.pdf using pdftotext. Save output to a .txt file and return the content.\"\n```\n\n### Step 3: Validate Extracted Content\n\nAfter extraction, validate that the content contains expected text patterns:\n\n```python\n# Validation checklist\ndef validate_pdf_extraction(text, expected_patterns=None):\n    checks = [\n        bool(text.strip()),  # Not empty\n        len(text) > 50,  # Has substantial content\n        not text.startswith('%PDF'),  # Not raw PDF structure\n    ]\n    \n    if expected_patterns:\n        for pattern in expected_patterns:\n            checks.append(pattern.lower() in text.lower())\n    \n    return all(checks)\n```\n\n**Common expected patterns to check:**\n- Document-specific keywords (e.g., \"inspection\", \"resident\", \"date\")\n- Expected data formats (dates, names, IDs)\n- Minimum word count threshold\n\n### Step 4: Handle Extraction Failures\n\nIf validation fails:\n\n1. **Try alternative tool:** If `pdftotext` failed, try `pdfplumber`:\n   ```\n   shell_agent task=\"Extract text from \u003Cfile.pdf> using Python pdfplumber library. Handle any encoding issues.\"\n   ```\n\n2. **Try OCR fallback:** For scanned PDFs:\n   ```\n   shell_agent task=\"This PDF may be scanned. Use pytesseract or similar OCR tool to extract text from \u003Cfile.pdf>.\"\n   ```\n\n3. **Report specific error:** Document what patterns were expected but not found.\n\n### Step 5: Proceed with Data Processing\n\nOnce validated text is obtained:\n- Parse the extracted text for required data\n- Store or process the content as needed\n- Continue with the original task workflow\n\n## Code Example\n\n```python\n# Complete extraction workflow\ndef extract_pdf_text_fallback(pdf_path, expected_patterns=None):\n    \"\"\"Extract text from PDF with fallback handling.\"\"\"\n    \n    # Step 1: Try read_file first\n    content = read_file(filetype=\"pdf\", file_path=pdf_path)\n    \n    # Step 2: Check if binary\u002Funreadable\n    if is_binary_or_garbled(content):\n        # Step 3: Use shell_agent fallback\n        result = shell_agent(\n            task=f\"Extract all text from {pdf_path} using pdftotext. Return the text content.\"\n        )\n        content = result.stdout\n        \n        # Step 4: Validate\n        if not validate_pdf_extraction(content, expected_patterns):\n            # Try pdfplumber as secondary fallback\n            result = shell_agent(\n                task=f\"Extract text from {pdf_path} using Python pdfplumber library.\"\n            )\n            content = result.stdout\n    \n    return content\n\ndef is_binary_or_garbled(text):\n    \"\"\"Check if text appears to be binary or unreadable.\"\"\"\n    if not text:\n        return True\n    if text.startswith('%PDF'):\n        return True\n    # Check for high ratio of non-printable characters\n    non_printable = sum(1 for c in text if ord(c) > 127 or ord(c) \u003C 32)\n    return non_printable \u002F len(text) > 0.3\n```\n\n## Tips\n\n- **pdftotext** is typically faster and pre-installed on many systems\n- **pdfplumber** handles complex layouts better but requires Python\n- For **scanned PDFs**, you'll need OCR tools (tesseract, pytesseract)\n- Always validate extracted content matches your expected data patterns\n- Save intermediate extraction results for debugging if needed",{"name":5,"description":7},"main","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fpdf-text-extraction-fallback-85d5ca","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs","https:\u002F\u002Fxyliu-cs.github.io","PhD Student in CS, CUHK-Shenzhen.","2026-04-06 20:32:15",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-text-extraction-fallback-85d5ca",{"tool":53,"command":54},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-text-extraction-fallback-85d5ca",{"tool":56,"command":57},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-text-extraction-fallback-85d5ca","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-text-extraction-fallback-85d5ca\u002FSKILL.md",true,[61],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},".skill_id","OTHER","其他",49,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-text-extraction-fallback-85d5ca\u002F.skill_id",[68,81,89,105,123,138],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":34},"01M6KG8MF1S664SWBDENYRSCK8","zip-export-deliverable","Ensures codebase deliverables are properly exported as ZIP archives through a dedicated finalization step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-export-deliverable\u002FSKILL.md",[],[75,76,77,78,79,80],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":34},"01M6KG8GAZWHHEK7VNJDW0ME21","zip-deliverable-finalization","Ensure codebase deliverables are properly packaged as ZIP exports in a dedicated final step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-deliverable-finalization\u002FSKILL.md",[],[88,76,78,79,80],"zip deliverable finalization",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":34},"01M6KG8CMQQ1PYMNTSRZ9VS1MD","zero-iteration-failure-analysis","Identify and handle agent failures with 0 iterations as pre-execution system issues","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzero-iteration-failure-analysis\u002FSKILL.md",[],[96,97,98,99,100,101,102,103,80,104],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","with","issues","execution","system",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":34},"01M6KG86W3PA07FT9W58YHHERM","write-file-fallback-report","Generate professional documents using write_file when primary data sources fail, leveraging embedded domain knowledge instead of external retrieval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report\u002FSKILL.md",[],[22,112,27,113,114,115,116,117,118,119,120,121,28,122],"write","report","write file fallback report","domain","professional","sources","retrieval","generate","embedded","documents","knowledge",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":34},"01M6KG82GAEY3GG77CMGCK1C2T","fallback-doc-with-delegation","Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text\u002Fmarkdown","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced\u002FSKILL.md",[],[130,101,22,131,132,133,121,119,27,134,135,21,112,136,116,137,33],"fallback doc with delegation","doc","delegation","shell","markdown","tool","simple","formats",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":34},"01M6KG7WT7GX5NYCGEFHW22NV7","context-anchored-fallback-report","Generate documents with write_file when retrieval tools fail, with explicit guardrails against task context drift","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced-4bc5c2\u002FSKILL.md",[],[22,113,145,146,119,27,147,148,112,149,150,118,101,151,121],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]