[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBSDFW3T01ATZXWJA9Y9WN":3,"skill-same:01M6XBSDFW3T01ATZXWJA9Y9WN":63},{"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":22,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":13,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M6XBSDFW3T01ATZXWJA9Y9WN","pdf-page-verification-correction",null,"Iterative workflow to verify PDF page counts and adjust layout parameters until requirements are met","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-page-verification-correction\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31],"PDF","verification","page","pdf page verification correction","workflow","verify","requirements","layout","adjust","2026-11-10 10:12:30",false,"---\nname: pdf-page-verification-correction\ndescription: Iterative workflow to verify PDF page counts and adjust layout parameters until requirements are met\n---\n\n# PDF Page Count Verification and Correction\n\nThis skill provides a systematic approach to ensure PDFs meet target page count requirements through iterative verification and layout adjustment.\n\n## When to Use\n\n- Creating PDFs with strict page limits (e.g., reports, summaries, maps)\n- When initial PDF generation may produce variable page counts\n- When layout elements (images, tables, text) can cause unpredictable overflow\n\n## Prerequisites\n\n- Python with PyPDF2 or fitz (PyMuPDF) installed\n- PDF generation capability (ReportLab, matplotlib, etc.)\n\n## Workflow Steps\n\n### Step 1: Initial PDF Creation\n\nGenerate the PDF with your initial layout parameters:\n\n```python\ndef create_pdf(output_path, params):\n    \"\"\"Create PDF with given layout parameters\"\"\"\n    # Your PDF generation logic here\n    # params can include: image_size, table_density, font_size, margins\n    pass\n```\n\n### Step 2: Verify Page Count\n\nCheck the generated PDF's page count:\n\n```python\nimport fitz  # PyMuPDF\n\ndef verify_page_count(pdf_path):\n    \"\"\"Return the number of pages in the PDF\"\"\"\n    doc = fitz.open(pdf_path)\n    page_count = len(doc)\n    doc.close()\n    return page_count\n\n# Alternative with PyPDF2\nfrom PyPDF2 import PdfReader\n\ndef verify_page_count_pypdf2(pdf_path):\n    reader = PdfReader(pdf_path)\n    return len(reader.pages)\n```\n\n### Step 3: Compare Against Target\n\n```python\ndef check_page_requirement(actual, target_max, target_exact=None):\n    \"\"\"\n    Check if page count meets requirements\n    \n    Returns: (meets_requirement, adjustment_needed)\n    \"\"\"\n    if target_exact is not None:\n        meets = (actual == target_exact)\n        direction = \"shrink\" if actual > target_exact else \"expand\" if actual \u003C target_exact else None\n    else:\n        meets = (actual \u003C= target_max)\n        direction = \"shrink\" if actual > target_max else None\n    \n    return meets, direction\n```\n\n### Step 4: Adjust Layout Parameters\n\nIf page count exceeds target, adjust one or more parameters:\n\n```python\n# Common adjustment strategies\nADJUSTMENT_STRATEGIES = {\n    'images': {\n        'action': 'reduce_size',\n        'param': 'image_scale',\n        'step': 0.1,  # Reduce by 10%\n        'min': 0.5\n    },\n    'tables': {\n        'action': 'reduce_density',\n        'param': 'rows_per_page',\n        'step': 2,  # Reduce by 2 rows per page\n        'min': 5\n    },\n    'fonts': {\n        'action': 'reduce_size',\n        'param': 'font_size',\n        'step': 1,  # Reduce by 1pt\n        'min': 8\n    },\n    'margins': {\n        'action': 'reduce',\n        'param': 'margin_inches',\n        'step': 0.1,  # Reduce by 0.1 inches\n        'min': 0.3\n    }\n}\n\ndef adjust_params(current_params, direction, strategy='images'):\n    \"\"\"Apply adjustment to parameters\"\"\"\n    adjusted = current_params.copy()\n    strat = ADJUSTMENT_STRATEGIES[strategy]\n    \n    if direction == 'shrink':\n        param = strat['param']\n        current_val = adjusted.get(param, 1.0)\n        new_val = max(current_val - strat['step'], strat['min'])\n        adjusted[param] = new_val\n    \n    return adjusted\n```\n\n### Step 5: Iterative Correction Loop\n\n```python\ndef create_pdf_with_validation(\n    output_path, \n    initial_params, \n    target_max_pages,\n    max_iterations=5\n):\n    \"\"\"\n    Create PDF with iterative page count verification and correction\n    \n    Args:\n        output_path: Where to save the final PDF\n        initial_params: Starting layout parameters\n        target_max_pages: Maximum allowed pages\n        max_iterations: Maximum adjustment attempts\n    \n    Returns:\n        dict with 'success', 'final_page_count', 'iterations', 'final_params'\n    \"\"\"\n    params = initial_params.copy()\n    \n    for iteration in range(max_iterations):\n        # Create PDF\n        create_pdf(output_path, params)\n        \n        # Verify\n        page_count = verify_page_count(output_path)\n        \n        # Check requirements\n        meets_req, direction = check_page_requirement(\n            page_count, target_max_pages\n        )\n        \n        if meets_req:\n            print(f\"✓ PDF created successfully: {page_count} pages\")\n            return {\n                'success': True,\n                'final_page_count': page_count,\n                'iterations': iteration + 1,\n                'final_params': params\n            }\n        \n        # Adjust and retry\n        print(f\"Iteration {iteration + 1}: {page_count} pages (need ≤{target_max_pages})\")\n        params = adjust_params(params, direction)\n    \n    # Failed to converge\n    return {\n        'success': False,\n        'final_page_count': page_count,\n        'iterations': max_iterations,\n        'final_params': params,\n        'error': f\"Failed to meet page requirement after {max_iterations} iterations\"\n    }\n```\n\n## Example Usage\n\n```python\n# Initial parameters\nparams = {\n    'image_scale': 1.0,\n    'font_size': 10,\n    'margin_inches': 0.5,\n    'rows_per_page': 15\n}\n\n# Create map PDF limited to 1 page\nresult = create_pdf_with_validation(\n    output_path='property_map.pdf',\n    initial_params=params,\n    target_max_pages=1,\n    max_iterations=5\n)\n\nif not result['success']:\n    # Consider more aggressive adjustments or content reduction\n    print(f\"Warning: {result['error']}\")\n```\n\n## Tips\n\n1. **Prioritize adjustments**: Start with less intrusive changes (margins, image scale) before more significant ones (font size, content removal)\n\n2. **Track iteration history**: Log each iteration's parameters and page count to identify which adjustments are most effective\n\n3. **Set reasonable limits**: Don't reduce parameters below readable\u002Fviewable thresholds\n\n4. **Consider content-based solutions**: If layout adjustments fail, consider removing or summarizing content\n\n5. **Use multiple strategies sequentially**: Try image reduction first, then table density, then fonts\n\n## Common Adjustment Order\n\n1. Reduce margins (least visible impact)\n2. Reduce image sizes\n3. Reduce table density \u002F increase pagination\n4. Reduce font sizes\n5. Remove or summarize content (last resort)","# PDF Page Count Verification and Correction\n\nThis skill provides a systematic approach to ensure PDFs meet target page count requirements through iterative verification and layout adjustment.\n\n## When to Use\n\n- Creating PDFs with strict page limits (e.g., reports, summaries, maps)\n- When initial PDF generation may produce variable page counts\n- When layout elements (images, tables, text) can cause unpredictable overflow\n\n## Prerequisites\n\n- Python with PyPDF2 or fitz (PyMuPDF) installed\n- PDF generation capability (ReportLab, matplotlib, etc.)\n\n## Workflow Steps\n\n### Step 1: Initial PDF Creation\n\nGenerate the PDF with your initial layout parameters:\n\n```python\ndef create_pdf(output_path, params):\n    \"\"\"Create PDF with given layout parameters\"\"\"\n    # Your PDF generation logic here\n    # params can include: image_size, table_density, font_size, margins\n    pass\n```\n\n### Step 2: Verify Page Count\n\nCheck the generated PDF's page count:\n\n```python\nimport fitz  # PyMuPDF\n\ndef verify_page_count(pdf_path):\n    \"\"\"Return the number of pages in the PDF\"\"\"\n    doc = fitz.open(pdf_path)\n    page_count = len(doc)\n    doc.close()\n    return page_count\n\n# Alternative with PyPDF2\nfrom PyPDF2 import PdfReader\n\ndef verify_page_count_pypdf2(pdf_path):\n    reader = PdfReader(pdf_path)\n    return len(reader.pages)\n```\n\n### Step 3: Compare Against Target\n\n```python\ndef check_page_requirement(actual, target_max, target_exact=None):\n    \"\"\"\n    Check if page count meets requirements\n    \n    Returns: (meets_requirement, adjustment_needed)\n    \"\"\"\n    if target_exact is not None:\n        meets = (actual == target_exact)\n        direction = \"shrink\" if actual > target_exact else \"expand\" if actual \u003C target_exact else None\n    else:\n        meets = (actual \u003C= target_max)\n        direction = \"shrink\" if actual > target_max else None\n    \n    return meets, direction\n```\n\n### Step 4: Adjust Layout Parameters\n\nIf page count exceeds target, adjust one or more parameters:\n\n```python\n# Common adjustment strategies\nADJUSTMENT_STRATEGIES = {\n    'images': {\n        'action': 'reduce_size',\n        'param': 'image_scale',\n        'step': 0.1,  # Reduce by 10%\n        'min': 0.5\n    },\n    'tables': {\n        'action': 'reduce_density',\n        'param': 'rows_per_page',\n        'step': 2,  # Reduce by 2 rows per page\n        'min': 5\n    },\n    'fonts': {\n        'action': 'reduce_size',\n        'param': 'font_size',\n        'step': 1,  # Reduce by 1pt\n        'min': 8\n    },\n    'margins': {\n        'action': 'reduce',\n        'param': 'margin_inches',\n        'step': 0.1,  # Reduce by 0.1 inches\n        'min': 0.3\n    }\n}\n\ndef adjust_params(current_params, direction, strategy='images'):\n    \"\"\"Apply adjustment to parameters\"\"\"\n    adjusted = current_params.copy()\n    strat = ADJUSTMENT_STRATEGIES[strategy]\n    \n    if direction == 'shrink':\n        param = strat['param']\n        current_val = adjusted.get(param, 1.0)\n        new_val = max(current_val - strat['step'], strat['min'])\n        adjusted[param] = new_val\n    \n    return adjusted\n```\n\n### Step 5: Iterative Correction Loop\n\n```python\ndef create_pdf_with_validation(\n    output_path, \n    initial_params, \n    target_max_pages,\n    max_iterations=5\n):\n    \"\"\"\n    Create PDF with iterative page count verification and correction\n    \n    Args:\n        output_path: Where to save the final PDF\n        initial_params: Starting layout parameters\n        target_max_pages: Maximum allowed pages\n        max_iterations: Maximum adjustment attempts\n    \n    Returns:\n        dict with 'success', 'final_page_count', 'iterations', 'final_params'\n    \"\"\"\n    params = initial_params.copy()\n    \n    for iteration in range(max_iterations):\n        # Create PDF\n        create_pdf(output_path, params)\n        \n        # Verify\n        page_count = verify_page_count(output_path)\n        \n        # Check requirements\n        meets_req, direction = check_page_requirement(\n            page_count, target_max_pages\n        )\n        \n        if meets_req:\n            print(f\"✓ PDF created successfully: {page_count} pages\")\n            return {\n                'success': True,\n                'final_page_count': page_count,\n                'iterations': iteration + 1,\n                'final_params': params\n            }\n        \n        # Adjust and retry\n        print(f\"Iteration {iteration + 1}: {page_count} pages (need ≤{target_max_pages})\")\n        params = adjust_params(params, direction)\n    \n    # Failed to converge\n    return {\n        'success': False,\n        'final_page_count': page_count,\n        'iterations': max_iterations,\n        'final_params': params,\n        'error': f\"Failed to meet page requirement after {max_iterations} iterations\"\n    }\n```\n\n## Example Usage\n\n```python\n# Initial parameters\nparams = {\n    'image_scale': 1.0,\n    'font_size': 10,\n    'margin_inches': 0.5,\n    'rows_per_page': 15\n}\n\n# Create map PDF limited to 1 page\nresult = create_pdf_with_validation(\n    output_path='property_map.pdf',\n    initial_params=params,\n    target_max_pages=1,\n    max_iterations=5\n)\n\nif not result['success']:\n    # Consider more aggressive adjustments or content reduction\n    print(f\"Warning: {result['error']}\")\n```\n\n## Tips\n\n1. **Prioritize adjustments**: Start with less intrusive changes (margins, image scale) before more significant ones (font size, content removal)\n\n2. **Track iteration history**: Log each iteration's parameters and page count to identify which adjustments are most effective\n\n3. **Set reasonable limits**: Don't reduce parameters below readable\u002Fviewable thresholds\n\n4. **Consider content-based solutions**: If layout adjustments fail, consider removing or summarizing content\n\n5. **Use multiple strategies sequentially**: Try image reduction first, then table density, then fonts\n\n## Common Adjustment Order\n\n1. Reduce margins (least visible impact)\n2. Reduce image sizes\n3. Reduce table density \u002F increase pagination\n4. Reduce font sizes\n5. Remove or summarize content (last resort)",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fpdf-page-verification-correction","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":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-page-verification-correction",{"tool":49,"command":50},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-page-verification-correction",{"tool":52,"command":53},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-page-verification-correction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-page-verification-correction\u002FSKILL.md",true,[57],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},".skill_id","OTHER","其他",46,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-page-verification-correction\u002F.skill_id",[64,89,105,114,144,160],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":32},"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",[],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","python",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":32},"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",[],[96,97,72,87,98,88,99,100,101,102,103,86,24,104,76,79,81],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","with",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":32},"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",[],[112,72,76,113,81,100,86,87,88,79],"write special chars heredoc","shell",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":125,"publishedAt":32},"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",[120],{"categoryNo":121,"categoryName":122,"taxonomyType":123,"taxonomyTypeDesc":124},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[126,127,128,129,130,74,131,132,133,134,135,79,136,137,138,139,140,141,142,143],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":32},"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",[],[151,152,153,154,79,155,104,156,157,158,159],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":32},"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",[],[167,168,169,28,170,171,87,172,173,174],"directory","verify directory structure","structure","access","first","issues","diagnose","file access"]