[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBRH9AGTF1476ZH4S4S565":3,"skill-same:01M6XBRH9AGTF1476ZH4S4S565":60},{"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":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":13,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M6XBRH9AGTF1476ZH4S4S565","pdf-extraction-fallback-7db3aa",null,"Resilient multi-tier PDF extraction with sequential fallback strategies when initial reading 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\u002Fpdf-extraction-fallback-7db3aa\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28],"PDF","extraction","fallback","pdf extraction","pdf extraction fallback 7db3aa","pdf extraction fallback","strategies","multi","with","reading","when","2026-11-10 10:12:30",false,"---\nname: pdf-extraction-fallback-7db3aa\ndescription: Resilient multi-tier PDF extraction with sequential fallback strategies when initial reading fails\n---\n\n# PDF Extraction Fallback Strategy\n\n## Purpose\n\nWhen processing complex documents (tax forms, legal documents, scanned materials), PDF extraction often fails on the first attempt. This skill provides a systematic fallback approach that tries multiple extraction methods in sequence until one succeeds.\n\n## When to Use\n\n- Initial PDF reading tools return errors or empty content\n- Document appears to be scanned\u002Fimage-based rather than text-based\n- Previous extraction attempts produced incomplete or garbled output\n- Working with forms, tables, or structured documents that need reliable extraction\n\n## Fallback Sequence\n\n### Tier 1: Shell-Based Extraction (pdftotext)\n\nStart with command-line tools that often handle edge cases better:\n\n```bash\n# Extract text maintaining layout\npdftotext -layout input.pdf output.txt\n\n# Extract raw text (faster, less formatting)\npdftotext input.pdf output.txt\n\n# Extract specific page range\npdftotext -f 1 -l 3 input.pdf output.txt\n```\n\nCheck if output contains meaningful content before proceeding.\n\n### Tier 2: Python-Based Parsing\n\nIf shell tools fail, use Python libraries with different extraction approaches:\n\n```python\n# Using PyPDF2 for basic text extraction\nimport PyPDF2\nwith open('document.pdf', 'rb') as f:\n    reader = PyPDF2.PdfReader(f)\n    text = ''.join(page.extract_text() for page in reader.pages)\n\n# Using pdfplumber for tables and structured content\nimport pdfplumber\nwith pdfplumber.open('document.pdf') as pdf:\n    for page in pdf.pages:\n        text = page.extract_text()\n        tables = page.extract_tables()\n\n# Using pypdf for newer PDF features\nfrom pypdf import PdfReader\nreader = PdfReader('document.pdf')\ntext = ''.join(page.extract_text() for page in reader.pages)\n```\n\n### Tier 3: OCR Tools (for Scanned Documents)\n\nIf the PDF contains images or scanned content, use OCR:\n\n```bash\n# Using tesseract via command line\ntesseract input.pdf output --psm 6\n\n# Using Python with pytesseract\nimport pytesseract\nfrom pdf2image import convert_from_path\n\nimages = convert_from_path('document.pdf')\ntext = ''.join(pytesseract.image_to_string(img) for img in images)\n```\n\n## Implementation Pattern\n\n```python\ndef extract_pdf_resilient(pdf_path):\n    \"\"\"Try multiple extraction methods until one succeeds.\"\"\"\n    \n    # Tier 1: Shell extraction\n    result = run_shell(f'pdftotext -layout \"{pdf_path}\" -')\n    if result.stdout and len(result.stdout.strip()) > 100:\n        return result.stdout, 'pdftotext'\n    \n    # Tier 2: Python libraries\n    try:\n        import pdfplumber\n        with pdfplumber.open(pdf_path) as pdf:\n            text = ''.join(page.extract_text() or '' for page in pdf.pages)\n        if text.strip():\n            return text, 'pdfplumber'\n    except Exception:\n        pass\n    \n    # Tier 3: OCR fallback\n    try:\n        from pdf2image import convert_from_path\n        import pytesseract\n        images = convert_from_path(pdf_path)\n        text = ''.join(pytesseract.image_to_string(img) for img in images)\n        if text.strip():\n            return text, 'tesseract-ocr'\n    except Exception:\n        pass\n    \n    raise ExtractionError(\"All extraction methods failed\")\n```\n\n## Decision Criteria\n\n| Indicator | Action |\n|-----------|--------|\n| Empty output | Proceed to next tier |\n| Garbled\u002Fspecial characters | Try next tier |\n| Partial content | Accept if meets minimum threshold |\n| Tool not available | Skip to next tier |\n| Format-specific errors | Try alternative library |\n\n## Best Practices\n\n1. **Validate each attempt** - Check output length and quality before accepting\n2. **Log which method succeeded** - Track which tier worked for future reference\n3. **Set minimum content thresholds** - Don't accept trivial results (e.g., \u003C50 chars)\n4. **Combine methods if needed** - Some documents need multiple approaches for different sections\n5. **Preserve original file** - Never modify the source PDF during extraction attempts\n\n## Error Handling\n\n- Catch exceptions at each tier, don't fail immediately\n- Log detailed error messages for debugging\n- Continue to next tier even if current tier partially succeeds but produces poor quality\n- After all tiers fail, provide clear summary of what was tried\n\n## Output Quality Check\n\nBefore declaring extraction complete:\n\n```python\ndef validate_extraction(text):\n    if not text or len(text.strip()) \u003C 50:\n        return False\n    if text.count('') > len(text) * 0.1:  # Too many replacement chars\n        return False\n    if len(set(text)) \u003C 10:  # Too little character variety\n        return False\n    return True\n```","# PDF Extraction Fallback Strategy\n\n## Purpose\n\nWhen processing complex documents (tax forms, legal documents, scanned materials), PDF extraction often fails on the first attempt. This skill provides a systematic fallback approach that tries multiple extraction methods in sequence until one succeeds.\n\n## When to Use\n\n- Initial PDF reading tools return errors or empty content\n- Document appears to be scanned\u002Fimage-based rather than text-based\n- Previous extraction attempts produced incomplete or garbled output\n- Working with forms, tables, or structured documents that need reliable extraction\n\n## Fallback Sequence\n\n### Tier 1: Shell-Based Extraction (pdftotext)\n\nStart with command-line tools that often handle edge cases better:\n\n```bash\n# Extract text maintaining layout\npdftotext -layout input.pdf output.txt\n\n# Extract raw text (faster, less formatting)\npdftotext input.pdf output.txt\n\n# Extract specific page range\npdftotext -f 1 -l 3 input.pdf output.txt\n```\n\nCheck if output contains meaningful content before proceeding.\n\n### Tier 2: Python-Based Parsing\n\nIf shell tools fail, use Python libraries with different extraction approaches:\n\n```python\n# Using PyPDF2 for basic text extraction\nimport PyPDF2\nwith open('document.pdf', 'rb') as f:\n    reader = PyPDF2.PdfReader(f)\n    text = ''.join(page.extract_text() for page in reader.pages)\n\n# Using pdfplumber for tables and structured content\nimport pdfplumber\nwith pdfplumber.open('document.pdf') as pdf:\n    for page in pdf.pages:\n        text = page.extract_text()\n        tables = page.extract_tables()\n\n# Using pypdf for newer PDF features\nfrom pypdf import PdfReader\nreader = PdfReader('document.pdf')\ntext = ''.join(page.extract_text() for page in reader.pages)\n```\n\n### Tier 3: OCR Tools (for Scanned Documents)\n\nIf the PDF contains images or scanned content, use OCR:\n\n```bash\n# Using tesseract via command line\ntesseract input.pdf output --psm 6\n\n# Using Python with pytesseract\nimport pytesseract\nfrom pdf2image import convert_from_path\n\nimages = convert_from_path('document.pdf')\ntext = ''.join(pytesseract.image_to_string(img) for img in images)\n```\n\n## Implementation Pattern\n\n```python\ndef extract_pdf_resilient(pdf_path):\n    \"\"\"Try multiple extraction methods until one succeeds.\"\"\"\n    \n    # Tier 1: Shell extraction\n    result = run_shell(f'pdftotext -layout \"{pdf_path}\" -')\n    if result.stdout and len(result.stdout.strip()) > 100:\n        return result.stdout, 'pdftotext'\n    \n    # Tier 2: Python libraries\n    try:\n        import pdfplumber\n        with pdfplumber.open(pdf_path) as pdf:\n            text = ''.join(page.extract_text() or '' for page in pdf.pages)\n        if text.strip():\n            return text, 'pdfplumber'\n    except Exception:\n        pass\n    \n    # Tier 3: OCR fallback\n    try:\n        from pdf2image import convert_from_path\n        import pytesseract\n        images = convert_from_path(pdf_path)\n        text = ''.join(pytesseract.image_to_string(img) for img in images)\n        if text.strip():\n            return text, 'tesseract-ocr'\n    except Exception:\n        pass\n    \n    raise ExtractionError(\"All extraction methods failed\")\n```\n\n## Decision Criteria\n\n| Indicator | Action |\n|-----------|--------|\n| Empty output | Proceed to next tier |\n| Garbled\u002Fspecial characters | Try next tier |\n| Partial content | Accept if meets minimum threshold |\n| Tool not available | Skip to next tier |\n| Format-specific errors | Try alternative library |\n\n## Best Practices\n\n1. **Validate each attempt** - Check output length and quality before accepting\n2. **Log which method succeeded** - Track which tier worked for future reference\n3. **Set minimum content thresholds** - Don't accept trivial results (e.g., \u003C50 chars)\n4. **Combine methods if needed** - Some documents need multiple approaches for different sections\n5. **Preserve original file** - Never modify the source PDF during extraction attempts\n\n## Error Handling\n\n- Catch exceptions at each tier, don't fail immediately\n- Log detailed error messages for debugging\n- Continue to next tier even if current tier partially succeeds but produces poor quality\n- After all tiers fail, provide clear summary of what was tried\n\n## Output Quality Check\n\nBefore declaring extraction complete:\n\n```python\ndef validate_extraction(text):\n    if not text or len(text.strip()) \u003C 50:\n        return False\n    if text.count('') > len(text) * 0.1:  # Too many replacement chars\n        return False\n    if len(set(text)) \u003C 10:  # Too little character variety\n        return False\n    return True\n```",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fpdf-extraction-fallback-7db3aa","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":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-extraction-fallback-7db3aa",{"tool":46,"command":47},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-extraction-fallback-7db3aa",{"tool":49,"command":50},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-extraction-fallback-7db3aa","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-extraction-fallback-7db3aa\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},".skill_id","OTHER","其他",44,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-extraction-fallback-7db3aa\u002F.skill_id",[61,86,102,111,136,152],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":29},"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",[],[68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","python",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":29},"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",[],[93,94,69,84,95,85,96,97,98,99,100,83,101,26,73,76,78],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":29},"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",[],[109,69,73,110,78,97,83,84,85,76],"write special chars heredoc","shell",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":29},"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",[],[118,119,120,121,122,71,123,124,125,126,127,76,128,129,130,131,132,133,134,135],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":29},"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",[],[143,144,145,146,76,147,26,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":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":29},"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",[],[159,160,161,162,163,164,84,165,166,167],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]