[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFRZ54ZR8JMMFBYQTK8AV1":3,"skill-same:01M6KFRZ54ZR8JMMFBYQTK8AV1":68},{"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":23,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":14,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6KFRZ54ZR8JMMFBYQTK8AV1","pdf-verification-check-112b09",null,"Verify generated PDF files using PyPDF2 to check page counts and integrity","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-verification-check-112b09\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34],"PDF","verification","check","pdf verification check 112b09","pdf verification check","pdf verification","integrity","verify","page","generated","files","2026-11-10 10:12:30",false,"---\nname: pdf-verification-check-112b09\ndescription: Verify generated PDF files using PyPDF2 to check page counts and integrity\n---\n\n# PDF Verification Check\n\nAfter generating PDF files, always programmatically verify their structure and integrity before declaring task completion. This catches formatting errors, incorrect page counts, and corrupted files early.\n\n## When to Use\n\nUse this skill whenever your task involves:\n- Generating PDF documents\n- Creating PDFs with specific page count requirements\n- Producing multi-part PDF outputs (e.g., listings + maps)\n\n## Verification Steps\n\n### 1. Install PyPDF2 (if not available)\n\n```bash\npip install PyPDF2\n```\n\n### 2. Verify PDF Page Count and Integrity\n\nCreate a verification script or run inline Python:\n\n```python\nfrom PyPDF2 import PdfReader\nimport os\n\ndef verify_pdf(pdf_path, expected_pages=None):\n    \"\"\"Verify PDF file exists, is readable, and has expected page count.\"\"\"\n    try:\n        # Check file exists\n        if not os.path.exists(pdf_path):\n            return False, f\"File not found: {pdf_path}\"\n        \n        # Check file size (non-empty)\n        file_size = os.path.getsize(pdf_path)\n        if file_size == 0:\n            return False, f\"Empty file: {pdf_path}\"\n        \n        # Open and verify PDF structure\n        reader = PdfReader(pdf_path)\n        actual_pages = len(reader.pages)\n        \n        # Check page count if expected\n        if expected_pages is not None and actual_pages != expected_pages:\n            return False, f\"Expected {expected_pages} pages, got {actual_pages}\"\n        \n        return True, f\"Valid PDF with {actual_pages} page(s)\"\n        \n    except Exception as e:\n        return False, f\"PDF verification failed: {str(e)}\"\n\n# Example usage\npdf_files = [\n    (\"listings.pdf\", 2),\n    (\"map.pdf\", 1),\n]\n\nall_valid = True\nfor pdf_path, expected in pdf_files:\n    valid, message = verify_pdf(pdf_path, expected)\n    print(f\"{pdf_path}: {'✓' if valid else '✗'} {message}\")\n    if not valid:\n        all_valid = False\n\nif not all_valid:\n    raise Exception(\"PDF verification failed - review and regenerate\")\n```\n\n### 3. Use run_shell for Verification\n\nExecute the verification using `run_shell`:\n\n```bash\npython -c \"\nfrom PyPDF2 import PdfReader\nimport sys\n\npdf_path = 'output.pdf'\nexpected = 2\n\ntry:\n    reader = PdfReader(pdf_path)\n    actual = len(reader.pages)\n    if actual != expected:\n        print(f'ERROR: Expected {expected} pages, got {actual}')\n        sys.exit(1)\n    print(f'OK: {pdf_path} has {actual} page(s)')\nexcept Exception as e:\n    print(f'ERROR: {e}')\n    sys.exit(1)\n\"\n```\n\n### 4. Verify Before Completion\n\n**Critical:** Only mark your task as complete after ALL PDF verification checks pass. If verification fails:\n\n1. Examine the error message\n2. Regenerate the PDF with corrected formatting\n3. Re-run verification\n4. Repeat until all checks pass\n\n## Common Issues Caught\n\n- Wrong page counts (e.g., content spilling to extra pages)\n- Empty or corrupted PDF files\n- PDFs that fail to open properly\n- Missing expected sections due to formatting errors\n\n## Example Workflow\n\n```python\n# 1. Generate PDF\ngenerate_pdf(\"listings.pdf\", content)\n\n# 2. Verify before completion\nvalid, msg = verify_pdf(\"listings.pdf\", expected_pages=2)\nif not valid:\n    # Fix and regenerate\n    regenerate_pdf(\"listings.pdf\", corrected_content)\n    valid, msg = verify_pdf(\"listings.pdf\", expected_pages=2)\n\n# 3. Only complete if verification passes\nassert valid, f\"Cannot complete: {msg}\"\n```","# PDF Verification Check\n\nAfter generating PDF files, always programmatically verify their structure and integrity before declaring task completion. This catches formatting errors, incorrect page counts, and corrupted files early.\n\n## When to Use\n\nUse this skill whenever your task involves:\n- Generating PDF documents\n- Creating PDFs with specific page count requirements\n- Producing multi-part PDF outputs (e.g., listings + maps)\n\n## Verification Steps\n\n### 1. Install PyPDF2 (if not available)\n\n```bash\npip install PyPDF2\n```\n\n### 2. Verify PDF Page Count and Integrity\n\nCreate a verification script or run inline Python:\n\n```python\nfrom PyPDF2 import PdfReader\nimport os\n\ndef verify_pdf(pdf_path, expected_pages=None):\n    \"\"\"Verify PDF file exists, is readable, and has expected page count.\"\"\"\n    try:\n        # Check file exists\n        if not os.path.exists(pdf_path):\n            return False, f\"File not found: {pdf_path}\"\n        \n        # Check file size (non-empty)\n        file_size = os.path.getsize(pdf_path)\n        if file_size == 0:\n            return False, f\"Empty file: {pdf_path}\"\n        \n        # Open and verify PDF structure\n        reader = PdfReader(pdf_path)\n        actual_pages = len(reader.pages)\n        \n        # Check page count if expected\n        if expected_pages is not None and actual_pages != expected_pages:\n            return False, f\"Expected {expected_pages} pages, got {actual_pages}\"\n        \n        return True, f\"Valid PDF with {actual_pages} page(s)\"\n        \n    except Exception as e:\n        return False, f\"PDF verification failed: {str(e)}\"\n\n# Example usage\npdf_files = [\n    (\"listings.pdf\", 2),\n    (\"map.pdf\", 1),\n]\n\nall_valid = True\nfor pdf_path, expected in pdf_files:\n    valid, message = verify_pdf(pdf_path, expected)\n    print(f\"{pdf_path}: {'✓' if valid else '✗'} {message}\")\n    if not valid:\n        all_valid = False\n\nif not all_valid:\n    raise Exception(\"PDF verification failed - review and regenerate\")\n```\n\n### 3. Use run_shell for Verification\n\nExecute the verification using `run_shell`:\n\n```bash\npython -c \"\nfrom PyPDF2 import PdfReader\nimport sys\n\npdf_path = 'output.pdf'\nexpected = 2\n\ntry:\n    reader = PdfReader(pdf_path)\n    actual = len(reader.pages)\n    if actual != expected:\n        print(f'ERROR: Expected {expected} pages, got {actual}')\n        sys.exit(1)\n    print(f'OK: {pdf_path} has {actual} page(s)')\nexcept Exception as e:\n    print(f'ERROR: {e}')\n    sys.exit(1)\n\"\n```\n\n### 4. Verify Before Completion\n\n**Critical:** Only mark your task as complete after ALL PDF verification checks pass. If verification fails:\n\n1. Examine the error message\n2. Regenerate the PDF with corrected formatting\n3. Re-run verification\n4. Repeat until all checks pass\n\n## Common Issues Caught\n\n- Wrong page counts (e.g., content spilling to extra pages)\n- Empty or corrupted PDF files\n- PDFs that fail to open properly\n- Missing expected sections due to formatting errors\n\n## Example Workflow\n\n```python\n# 1. Generate PDF\ngenerate_pdf(\"listings.pdf\", content)\n\n# 2. Verify before completion\nvalid, msg = verify_pdf(\"listings.pdf\", expected_pages=2)\nif not valid:\n    # Fix and regenerate\n    regenerate_pdf(\"listings.pdf\", corrected_content)\n    valid, msg = verify_pdf(\"listings.pdf\", expected_pages=2)\n\n# 3. Only complete if verification passes\nassert valid, f\"Cannot complete: {msg}\"\n```",{"name":5,"description":7},"main","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fpdf-verification-check-112b09","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":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-verification-check-112b09",{"tool":54,"command":55},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-verification-check-112b09",{"tool":57,"command":58},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-verification-check-112b09","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-verification-check-112b09\u002FSKILL.md",true,[62],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},".skill_id","OTHER","其他",43,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-verification-check-112b09\u002F.skill_id",[69,82,90,106,132,152],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":35},"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",[],[76,77,78,79,80,81],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":35},"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",[],[89,77,79,80,81],"zip deliverable finalization",{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":35},"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",[],[97,98,99,100,101,102,103,104,81,105],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","with","issues","execution","system",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":117,"publishedAt":35},"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",[112],{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[118,119,120,121,122,123,124,125,126,127,128,129,130,131],"fallback","write","file","report","write file fallback report","domain","professional","sources","retrieval","generate","embedded","documents","data","knowledge",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":141,"publishedAt":35},"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",[138],{"categoryNo":139,"categoryName":140,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[142,102,118,143,144,145,129,127,120,146,147,148,119,149,124,150,151],"fallback doc with delegation","doc","delegation","shell","markdown","tool","text","simple","formats","for",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":159,"publishedAt":35},"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",[158],{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},[118,121,160,161,127,120,162,163,119,164,165,126,102,166,129],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]