[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFQMXB1MAW7HSYCDWP4G7Q":3,"skill-same:01M6KFQMXB1MAW7HSYCDWP4G7Q":70},{"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":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":14,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6KFQMXB1MAW7HSYCDWP4G7Q","pdf-gen-fallback-dee20c",null,"Fallback workflow for document generation when code sandbox returns 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-dee20c\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],"PDF","fallback","pdf gen fallback dee20c","pdf gen fallback","sandbox","workflow","code","returns","document","generation","document generation","errors","for","2026-11-10 10:12:30",false,"---\nname: pdf-gen-fallback-dee20c\ndescription: Fallback workflow for document generation when code sandbox returns opaque errors\n---\n\n# PDF Generation Fallback Workflow\n\n## Purpose\n\nWhen `execute_code_sandbox` returns opaque or unhelpful errors during document\u002FPDF generation, use `run_shell` with direct `python -c` execution as a reliable alternative. This pattern includes library availability checks and explicit error handling.\n\n## When to Use\n\n- `execute_code_sandbox` fails with unclear error messages during document generation\n- PDF, report, or document creation tasks are failing unexpectedly\n- You need more control over the Python execution environment\n\n## Step-by-Step Instructions\n\n### 1. Check Library Availability\n\nBefore attempting generation, verify required libraries are installed:\n\n```shell\nrun_shell: python -c \"import reportlab; print('reportlab OK')\"\nrun_shell: python -c \"import fpdf; print('fpdf OK')\"\nrun_shell: python -c \"import PyPDF2; print('PyPDF2 OK')\"\n```\n\nIf a library is missing, install it:\n\n```shell\nrun_shell: pip install reportlab --quiet\n```\n\n### 2. Execute Generation via run_shell\n\nInstead of `execute_code_sandbox`, use `run_shell` with `python -c`:\n\n```shell\nrun_shell: python -c \"\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\nc = canvas.Canvas('output.pdf', pagesize=letter)\nc.drawString(100, 750, 'Document Content')\nc.save()\nprint('PDF generated successfully')\n\"\n```\n\n### 3. Handle Errors Explicitly\n\nWrap generation code with try\u002Fexcept and capture stderr:\n\n```shell\nrun_shell: python -c \"\nimport sys\ntry:\n    # Your generation code here\n    from reportlab.pdfgen import canvas\n    c = canvas.Canvas('output.pdf')\n    c.drawString(100, 750, 'Content')\n    c.save()\n    print('SUCCESS: PDF created')\n    sys.exit(0)\nexcept Exception as e:\n    print(f'ERROR: {type(e).__name__}: {e}', file=sys.stderr)\n    sys.exit(1)\n\" 2>&1\n```\n\n### 4. Verify Output File\n\nAfter generation, confirm the file was created:\n\n```shell\nrun_shell: ls -la output.pdf\nrun_shell: file output.pdf\n```\n\n### 5. Fallback Hierarchy\n\nIf the first approach fails, try alternatives in this order:\n\n1. `reportlab` - Full-featured PDF generation\n2. `fpdf` - Simpler PDF library\n3. `wkhtmltopdf` - HTML to PDF conversion\n4. Direct text\u002FMarkdown output as last resort\n\n## Example: Complete Workflow\n\n```shell\n# Step 1: Check library\nrun_shell: python -c \"import reportlab; print('OK')\"\n\n# Step 2: Generate with error handling\nrun_shell: python -c \"\nimport sys\ntry:\n    from reportlab.lib.pagesizes import letter\n    from reportlab.pdfgen import canvas\n    c = canvas.Canvas('report.pdf', pagesize=letter)\n    c.setTitle('Surveillance Report')\n    c.drawString(100, 750, 'Revised Surveillance Report')\n    c.drawString(100, 730, 'Summary: Key findings documented')\n    c.save()\n    print('SUCCESS')\nexcept Exception as e:\n    print(f'FAILED: {e}', file=sys.stderr)\n    sys.exit(1)\n\"\n\n# Step 3: Verify\nrun_shell: test -f report.pdf && echo 'File exists' || echo 'File missing'\n```\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Module not found | `pip install \u003Cmodule> --quiet` |\n| Permission denied | Check output directory permissions |\n| Font errors | Use default fonts or install font packages |\n| Encoding issues | Specify encoding explicitly in string operations |\n\n## Best Practices\n\n- Always capture both stdout and stderr for debugging\n- Exit with proper status codes (0 for success, 1 for failure)\n- Keep generation code concise when using `python -c`\n- For complex generation, write a temporary `.py` file instead\n- Test library availability before attempting generation","# PDF Generation Fallback Workflow\n\n## Purpose\n\nWhen `execute_code_sandbox` returns opaque or unhelpful errors during document\u002FPDF generation, use `run_shell` with direct `python -c` execution as a reliable alternative. This pattern includes library availability checks and explicit error handling.\n\n## When to Use\n\n- `execute_code_sandbox` fails with unclear error messages during document generation\n- PDF, report, or document creation tasks are failing unexpectedly\n- You need more control over the Python execution environment\n\n## Step-by-Step Instructions\n\n### 1. Check Library Availability\n\nBefore attempting generation, verify required libraries are installed:\n\n```shell\nrun_shell: python -c \"import reportlab; print('reportlab OK')\"\nrun_shell: python -c \"import fpdf; print('fpdf OK')\"\nrun_shell: python -c \"import PyPDF2; print('PyPDF2 OK')\"\n```\n\nIf a library is missing, install it:\n\n```shell\nrun_shell: pip install reportlab --quiet\n```\n\n### 2. Execute Generation via run_shell\n\nInstead of `execute_code_sandbox`, use `run_shell` with `python -c`:\n\n```shell\nrun_shell: python -c \"\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\nc = canvas.Canvas('output.pdf', pagesize=letter)\nc.drawString(100, 750, 'Document Content')\nc.save()\nprint('PDF generated successfully')\n\"\n```\n\n### 3. Handle Errors Explicitly\n\nWrap generation code with try\u002Fexcept and capture stderr:\n\n```shell\nrun_shell: python -c \"\nimport sys\ntry:\n    # Your generation code here\n    from reportlab.pdfgen import canvas\n    c = canvas.Canvas('output.pdf')\n    c.drawString(100, 750, 'Content')\n    c.save()\n    print('SUCCESS: PDF created')\n    sys.exit(0)\nexcept Exception as e:\n    print(f'ERROR: {type(e).__name__}: {e}', file=sys.stderr)\n    sys.exit(1)\n\" 2>&1\n```\n\n### 4. Verify Output File\n\nAfter generation, confirm the file was created:\n\n```shell\nrun_shell: ls -la output.pdf\nrun_shell: file output.pdf\n```\n\n### 5. Fallback Hierarchy\n\nIf the first approach fails, try alternatives in this order:\n\n1. `reportlab` - Full-featured PDF generation\n2. `fpdf` - Simpler PDF library\n3. `wkhtmltopdf` - HTML to PDF conversion\n4. Direct text\u002FMarkdown output as last resort\n\n## Example: Complete Workflow\n\n```shell\n# Step 1: Check library\nrun_shell: python -c \"import reportlab; print('OK')\"\n\n# Step 2: Generate with error handling\nrun_shell: python -c \"\nimport sys\ntry:\n    from reportlab.lib.pagesizes import letter\n    from reportlab.pdfgen import canvas\n    c = canvas.Canvas('report.pdf', pagesize=letter)\n    c.setTitle('Surveillance Report')\n    c.drawString(100, 750, 'Revised Surveillance Report')\n    c.drawString(100, 730, 'Summary: Key findings documented')\n    c.save()\n    print('SUCCESS')\nexcept Exception as e:\n    print(f'FAILED: {e}', file=sys.stderr)\n    sys.exit(1)\n\"\n\n# Step 3: Verify\nrun_shell: test -f report.pdf && echo 'File exists' || echo 'File missing'\n```\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Module not found | `pip install \u003Cmodule> --quiet` |\n| Permission denied | Check output directory permissions |\n| Font errors | Use default fonts or install font packages |\n| Encoding issues | Specify encoding explicitly in string operations |\n\n## Best Practices\n\n- Always capture both stdout and stderr for debugging\n- Exit with proper status codes (0 for success, 1 for failure)\n- Keep generation code concise when using `python -c`\n- For complex generation, write a temporary `.py` file instead\n- Test library availability before attempting generation",{"name":5,"description":7},"main","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fpdf-gen-fallback-dee20c","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":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-gen-fallback-dee20c",{"tool":56,"command":57},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-gen-fallback-dee20c",{"tool":59,"command":60},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-gen-fallback-dee20c","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-gen-fallback-dee20c\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},".skill_id","OTHER","其他",37,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-gen-fallback-dee20c\u002F.skill_id",[71,84,92,108,133,152],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":37},"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",[],[78,79,80,81,82,83],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":37},"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",[],[91,79,81,82,83],"zip deliverable finalization",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":37},"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",[],[99,100,101,102,103,104,105,106,83,107],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","with","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":37},"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":37},"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,104,25,144,145,146,130,128,121,147,148,149,120,150,125,151,36],"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":37},"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,104,166,130],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]