[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJBYEXT146AJ251MNJXF8D":3,"skill-same:01M6KJBYEXT146AJ251MNJXF8D":69},{"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":22,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":13,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M6KJBYEXT146AJ251MNJXF8D","pdf-gen-fallback-501bcc",null,"Fallback pattern for PDF\u002Fdocument generation when execute_code_sandbox fails with opaque errors","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\u002Fpdf-gen-fallback-501bcc\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35,36],"PDF","fallback","pdf gen fallback 501bcc","pdf gen fallback","sandbox","code","execute","document","pattern","generation","document generation","with","errors","for","2026-11-10 10:12:30",false,"---\nname: pdf-gen-fallback-501bcc\ndescription: Fallback pattern for PDF\u002Fdocument generation when execute_code_sandbox fails with opaque errors\n---\n\n# PDF Generation Fallback Pattern\n\n## When to Use\n\nApply this pattern when `execute_code_sandbox` returns opaque or unhelpful errors during PDF, DOCX, or other document generation tasks. This fallback uses `run_shell` with direct `python -c` execution for more reliable document generation.\n\n## Step-by-Step Procedure\n\n### 1. Detect Sandbox Failure\n\nIf `execute_code_sandbox` fails during document generation with errors like:\n- Opaque runtime errors\n- Missing library errors that don't resolve with import statements\n- Silent failures with no output\n\nProceed to the fallback approach.\n\n### 2. Check Library Availability\n\nBefore generating documents, verify the required Python libraries are available in the shell environment:\n\n```bash\npython -c \"import reportlab; print('OK')\" 2>&1 || echo \"reportlab missing\"\npython -c \"import fpdf; print('OK')\" 2>&1 || echo \"fpdf missing\"\npython -c \"import pypdf; print('OK')\" 2>&1 || echo \"pypdf missing\"\npython -c \"import docx; print('OK')\" 2>&1 || echo \"python-docx missing\"\n```\n\n### 3. Install Missing Libraries (If Needed)\n\nIf a library is missing, install it via pip:\n\n```bash\npip install reportlab fpdf2 pypdf python-docx\n```\n\n### 4. Execute Document Generation via run_shell\n\nUse `run_shell` with `python -c` and multi-line strings for document generation:\n\n```bash\npython -c \"\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\nc = canvas.Canvas('output.pdf', pagesize=letter)\nc.drawString(100, 750, 'Document Title')\nc.drawString(100, 700, 'Content here')\nc.save()\nprint('SUCCESS: PDF created')\n\"\n```\n\nFor DOCX files:\n\n```bash\npython -c \"\nfrom docx import Document\n\ndoc = Document()\ndoc.add_heading('Document Title', 0)\ndoc.add_paragraph('Content here')\ndoc.save('output.docx')\nprint('SUCCESS: DOCX created')\n\"\n```\n\n### 5. Include Explicit Error Handling\n\nAlways wrap generation code with try\u002Fexcept for clear error reporting:\n\n```bash\npython -c \"\ntry:\n    from reportlab.lib.pagesizes import letter\n    from reportlab.pdfgen import canvas\n    \n    c = canvas.Canvas('output.pdf', pagesize=letter)\n    c.drawString(100, 750, 'Content')\n    c.save()\n    print('SUCCESS')\nexcept ImportError as e:\n    print(f'MISSING_LIBRARY: {e}')\n    exit(1)\nexcept Exception as e:\n    print(f'GENERATION_ERROR: {e}')\n    exit(1)\n\"\n```\n\n### 6. Verify Output File\n\nAfter generation, confirm the file was created and is valid:\n\n```bash\nls -la output.pdf\nfile output.pdf\ntest -f output.pdf && echo \"File exists\" || echo \"File missing\"\n```\n\n## Complete Example Workflow\n\n```bash\n# Step 1: Check and install library\npython -c \"import reportlab\" 2>&1 || pip install reportlab\n\n# Step 2: Generate PDF with error handling\npython -c \"\ntry:\n    from reportlab.lib.pagesizes import letter\n    from reportlab.pdfgen import canvas\n    \n    c = canvas.Canvas('report.pdf', pagesize=letter)\n    c.setFont('Helvetica', 12)\n    c.drawString(100, 750, 'Surveillance Report')\n    c.drawString(100, 700, 'Generated via fallback pattern')\n    c.save()\n    print('SUCCESS: report.pdf created')\nexcept Exception as e:\n    print(f'ERROR: {e}')\n    exit(1)\n\"\n\n# Step 3: Verify\ntest -f report.pdf && echo \"Verification: PASSED\" || echo \"Verification: FAILED\"\n```\n\n## Why This Works\n\n- **Direct Execution**: `run_shell` with `python -c` bypasses sandbox limitations that may affect document generation libraries\n- **Explicit Errors**: Try\u002Fexcept blocks provide actionable error messages instead of opaque failures\n- **Environment Control**: Shell execution gives more control over the Python environment and library paths\n- **Verification**: Explicit file checks confirm success rather than assuming it\n\n## Common Libraries\n\n| Library | Purpose | Import Statement |\n|---------|---------|------------------|\n| reportlab | PDF generation | `from reportlab.pdfgen import canvas` |\n| fpdf2 | PDF generation | `from fpdf import FPDF` |\n| pypdf | PDF manipulation | `from pypdf import PdfReader` |\n| python-docx | DOCX generation | `from docx import Document` |\n| xlsxwriter | Excel files | `import xlsxwriter` |","# PDF Generation Fallback Pattern\n\n## When to Use\n\nApply this pattern when `execute_code_sandbox` returns opaque or unhelpful errors during PDF, DOCX, or other document generation tasks. This fallback uses `run_shell` with direct `python -c` execution for more reliable document generation.\n\n## Step-by-Step Procedure\n\n### 1. Detect Sandbox Failure\n\nIf `execute_code_sandbox` fails during document generation with errors like:\n- Opaque runtime errors\n- Missing library errors that don't resolve with import statements\n- Silent failures with no output\n\nProceed to the fallback approach.\n\n### 2. Check Library Availability\n\nBefore generating documents, verify the required Python libraries are available in the shell environment:\n\n```bash\npython -c \"import reportlab; print('OK')\" 2>&1 || echo \"reportlab missing\"\npython -c \"import fpdf; print('OK')\" 2>&1 || echo \"fpdf missing\"\npython -c \"import pypdf; print('OK')\" 2>&1 || echo \"pypdf missing\"\npython -c \"import docx; print('OK')\" 2>&1 || echo \"python-docx missing\"\n```\n\n### 3. Install Missing Libraries (If Needed)\n\nIf a library is missing, install it via pip:\n\n```bash\npip install reportlab fpdf2 pypdf python-docx\n```\n\n### 4. Execute Document Generation via run_shell\n\nUse `run_shell` with `python -c` and multi-line strings for document generation:\n\n```bash\npython -c \"\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\nc = canvas.Canvas('output.pdf', pagesize=letter)\nc.drawString(100, 750, 'Document Title')\nc.drawString(100, 700, 'Content here')\nc.save()\nprint('SUCCESS: PDF created')\n\"\n```\n\nFor DOCX files:\n\n```bash\npython -c \"\nfrom docx import Document\n\ndoc = Document()\ndoc.add_heading('Document Title', 0)\ndoc.add_paragraph('Content here')\ndoc.save('output.docx')\nprint('SUCCESS: DOCX created')\n\"\n```\n\n### 5. Include Explicit Error Handling\n\nAlways wrap generation code with try\u002Fexcept for clear error reporting:\n\n```bash\npython -c \"\ntry:\n    from reportlab.lib.pagesizes import letter\n    from reportlab.pdfgen import canvas\n    \n    c = canvas.Canvas('output.pdf', pagesize=letter)\n    c.drawString(100, 750, 'Content')\n    c.save()\n    print('SUCCESS')\nexcept ImportError as e:\n    print(f'MISSING_LIBRARY: {e}')\n    exit(1)\nexcept Exception as e:\n    print(f'GENERATION_ERROR: {e}')\n    exit(1)\n\"\n```\n\n### 6. Verify Output File\n\nAfter generation, confirm the file was created and is valid:\n\n```bash\nls -la output.pdf\nfile output.pdf\ntest -f output.pdf && echo \"File exists\" || echo \"File missing\"\n```\n\n## Complete Example Workflow\n\n```bash\n# Step 1: Check and install library\npython -c \"import reportlab\" 2>&1 || pip install reportlab\n\n# Step 2: Generate PDF with error handling\npython -c \"\ntry:\n    from reportlab.lib.pagesizes import letter\n    from reportlab.pdfgen import canvas\n    \n    c = canvas.Canvas('report.pdf', pagesize=letter)\n    c.setFont('Helvetica', 12)\n    c.drawString(100, 750, 'Surveillance Report')\n    c.drawString(100, 700, 'Generated via fallback pattern')\n    c.save()\n    print('SUCCESS: report.pdf created')\nexcept Exception as e:\n    print(f'ERROR: {e}')\n    exit(1)\n\"\n\n# Step 3: Verify\ntest -f report.pdf && echo \"Verification: PASSED\" || echo \"Verification: FAILED\"\n```\n\n## Why This Works\n\n- **Direct Execution**: `run_shell` with `python -c` bypasses sandbox limitations that may affect document generation libraries\n- **Explicit Errors**: Try\u002Fexcept blocks provide actionable error messages instead of opaque failures\n- **Environment Control**: Shell execution gives more control over the Python environment and library paths\n- **Verification**: Explicit file checks confirm success rather than assuming it\n\n## Common Libraries\n\n| Library | Purpose | Import Statement |\n|---------|---------|------------------|\n| reportlab | PDF generation | `from reportlab.pdfgen import canvas` |\n| fpdf2 | PDF generation | `from fpdf import FPDF` |\n| pypdf | PDF manipulation | `from pypdf import PdfReader` |\n| python-docx | DOCX generation | `from docx import Document` |\n| xlsxwriter | Excel files | `import xlsxwriter` |",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc","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":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add AG064\u002FOpenSpace --skill pdf-gen-fallback-501bcc",{"tool":55,"command":56},"bunx","bunx skills add AG064\u002FOpenSpace --skill pdf-gen-fallback-501bcc",{"tool":58,"command":59},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill pdf-gen-fallback-501bcc","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},".skill_id","OTHER","其他",37,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc\u002F.skill_id",[70,92,108,117,147,163],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":37},"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",[],[77,78,79,80,81,82,36,35,83,84,85,86,87,88,89,90,91],"write special chars ts check","check","write","filters","Existing","type-checking","script","output","type","files","only","template","file","python","typescript",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":37},"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",[],[99,100,79,88,101,102,89,90,103,104,105,106,107,36,83,34],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":37},"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",[],[79,115,90,36,105,88,116,89,83],"write special chars heredoc","shell",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":128,"publishedAt":37},"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",[123],{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[129,130,131,132,91,133,134,135,136,137,36,138,139,140,141,142,143,144,145,146],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":37},"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",[],[154,155,156,157,36,158,34,159,160,161,162],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":37},"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",[],[170,171,172,173,174,175,89,176,177,178],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]