[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFQFVYVQQZ6XCNPFFZN2FN":3,"skill-same:01M6KFQFVYVQQZ6XCNPFFZN2FN":71},{"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":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":14,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":48,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M6KFQFVYVQQZ6XCNPFFZN2FN","pdf-gen-fallback-501bcc",null,"Fallback pattern for PDF\u002Fdocument generation when execute_code_sandbox fails with opaque errors","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-gen-fallback-501bcc\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37],"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","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc","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":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-gen-fallback-501bcc",{"tool":57,"command":58},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-gen-fallback-501bcc",{"tool":60,"command":61},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-gen-fallback-501bcc","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc\u002FSKILL.md",true,[65],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},".skill_id","OTHER","其他",37,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc\u002F.skill_id",[72,85,93,108,133,152],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":38},"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",[],[79,80,81,82,83,84],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":38},"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",[],[92,80,82,83,84],"zip deliverable finalization",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":38},"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",[],[100,101,102,103,104,35,105,106,84,107],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","issues","execution","system",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":119,"publishedAt":38},"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",[114],{"categoryNo":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[25,120,121,122,123,124,125,126,127,128,129,130,131,132],"write","file","report","write file fallback report","domain","professional","sources","retrieval","generate","embedded","documents","data","knowledge",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":142,"publishedAt":38},"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",[139],{"categoryNo":140,"categoryName":141,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[143,35,25,144,145,146,130,128,121,147,148,149,120,150,125,151,37],"fallback doc with delegation","doc","delegation","shell","markdown","tool","text","simple","formats",{"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":38},"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":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},[25,122,160,161,128,121,162,163,120,164,165,127,35,166,130],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]