[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFQYBT86MQME0FF7GZBB3F":3,"skill-same:01M6KFQYBT86MQME0FF7GZBB3F":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},"01M6KFQYBT86MQME0FF7GZBB3F","pdf-generation-troubleshooting",null,"Systematic fallback workflow for PDF generation through pandoc, reportlab, and fpdf2 with installation verification","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-generation-troubleshooting\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","troubleshooting","generation","pdf generation","pdf generation troubleshooting","workflow","verification","fallback","installation","systematic","pandoc","with","for","2026-11-10 10:12:30",false,"---\nname: pdf-generation-troubleshooting\ndescription: Systematic fallback workflow for PDF generation through pandoc, reportlab, and fpdf2 with installation verification\n---\n\n# PDF Generation Troubleshooting Workflow\n\nThis skill provides a systematic approach to generating PDFs when multiple tools may be unavailable. Follow this fallback sequence to ensure PDF generation succeeds.\n\n## Workflow Overview\n\n1. **Try pandoc first** (simplest for markdown\u002FHTML conversion)\n2. **Fallback to reportlab** (Python library for programmatic PDFs)\n3. **Fallback to fpdf2** (alternative Python PDF library)\n\nEach step includes installation verification before execution.\n\n## Step 1: Attempt pandoc Conversion\n\nUse pandoc for markdown or HTML to PDF conversion. Check availability first:\n\n```bash\n# Check if pandoc is available\nwhich pandoc || echo \"pandoc not found\"\n```\n\nIf available, convert:\n\n```bash\npandoc input.md -o output.pdf\n```\n\nIf pandoc fails or is unavailable, proceed to Step 2.\n\n## Step 2: Attempt reportlab\n\n### Check Installation\n\n```bash\npython3 -c \"import reportlab\" 2>\u002Fdev\u002Fnull && echo \"reportlab available\" || echo \"reportlab not found\"\n```\n\n### Install if Needed\n\n```bash\npip install reportlab\n```\n\n### Create PDF Script\n\nUse `write_file` to create a Python script:\n\n```python\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\ndef create_pdf(filename, content):\n    c = canvas.Canvas(filename, pagesize=letter)\n    c.drawString(100, 750, content)\n    c.save()\n\nif __name__ == \"__main__\":\n    create_pdf(\"output.pdf\", \"Your content here\")\n```\n\n### Execute Script\n\nUse `run_shell` with proper directory context:\n\n```bash\ncd \u002Fpath\u002Fto\u002Fworking\u002Fdirectory && python3 script.py\n```\n\nIf reportlab fails, proceed to Step 3.\n\n## Step 3: Attempt fpdf2\n\n### Check Installation\n\n```bash\npython3 -c \"from fpdf import FPDF\" 2>\u002Fdev\u002Fnull && echo \"fpdf2 available\" || echo \"fpdf2 not found\"\n```\n\n### Install if Needed\n\n```bash\npip install fpdf2\n```\n\n### Create PDF Script\n\n```python\nfrom fpdf import FPDF\n\ndef create_pdf(filename, text):\n    pdf = FPDF()\n    pdf.add_page()\n    pdf.set_font(\"Arial\", size=12)\n    pdf.cell(200, 10, txt=text, ln=True)\n    pdf.output(filename)\n\nif __name__ == \"__main__\":\n    create_pdf(\"output.pdf\", \"Your content here\")\n```\n\n### Execute Script\n\n```bash\ncd \u002Fpath\u002Fto\u002Fworking\u002Fdirectory && python3 script.py\n```\n\n## Decision Matrix\n\n| Tool | Best For | Limitations |\n|------|----------|-------------|\n| pandoc | Markdown\u002FHTML conversion | Requires external installation |\n| reportlab | Complex layouts, graphics | Steeper learning curve |\n| fpdf2 | Simple text PDFs | Limited formatting options |\n\n## Error Handling Pattern\n\nFor each tool attempt:\n\n1. Check availability\u002Finstallation\n2. Install if missing (`pip install \u003Cpackage>`)\n3. Create script using `write_file`\n4. Execute using `run_shell` with `cd \u003Cdir> && \u003Ccommand>`\n5. Verify output file exists\n6. If fails, move to next tool in sequence\n\n## Example Fallback Implementation\n\n```bash\n# Pseudocode for full workflow\nif command -v pandoc >\u002Fdev\u002Fnull 2>&1; then\n    pandoc input.md -o output.pdf && exit 0\nfi\n\nif python3 -c \"import reportlab\" 2>\u002Fdev\u002Fnull; then\n    # Create and run reportlab script\n    exit 0\nfi\n\n# Final fallback: fpdf2\npip install fpdf2\n# Create and run fpdf2 script\n```\n\n## Key Principles\n\n- **Always verify** tool availability before attempting use\n- **Install on-demand** when a tool is missing\n- **Use write_file** for script creation (ensures clean, versionable code)\n- **Use run_shell** with explicit directory context (`cd \u003Cdir> && \u003Ccmd>`)\n- **Progressive fallback** ensures at least one method succeeds\n- **Verify output** after each attempt before moving to next tool","# PDF Generation Troubleshooting Workflow\n\nThis skill provides a systematic approach to generating PDFs when multiple tools may be unavailable. Follow this fallback sequence to ensure PDF generation succeeds.\n\n## Workflow Overview\n\n1. **Try pandoc first** (simplest for markdown\u002FHTML conversion)\n2. **Fallback to reportlab** (Python library for programmatic PDFs)\n3. **Fallback to fpdf2** (alternative Python PDF library)\n\nEach step includes installation verification before execution.\n\n## Step 1: Attempt pandoc Conversion\n\nUse pandoc for markdown or HTML to PDF conversion. Check availability first:\n\n```bash\n# Check if pandoc is available\nwhich pandoc || echo \"pandoc not found\"\n```\n\nIf available, convert:\n\n```bash\npandoc input.md -o output.pdf\n```\n\nIf pandoc fails or is unavailable, proceed to Step 2.\n\n## Step 2: Attempt reportlab\n\n### Check Installation\n\n```bash\npython3 -c \"import reportlab\" 2>\u002Fdev\u002Fnull && echo \"reportlab available\" || echo \"reportlab not found\"\n```\n\n### Install if Needed\n\n```bash\npip install reportlab\n```\n\n### Create PDF Script\n\nUse `write_file` to create a Python script:\n\n```python\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\ndef create_pdf(filename, content):\n    c = canvas.Canvas(filename, pagesize=letter)\n    c.drawString(100, 750, content)\n    c.save()\n\nif __name__ == \"__main__\":\n    create_pdf(\"output.pdf\", \"Your content here\")\n```\n\n### Execute Script\n\nUse `run_shell` with proper directory context:\n\n```bash\ncd \u002Fpath\u002Fto\u002Fworking\u002Fdirectory && python3 script.py\n```\n\nIf reportlab fails, proceed to Step 3.\n\n## Step 3: Attempt fpdf2\n\n### Check Installation\n\n```bash\npython3 -c \"from fpdf import FPDF\" 2>\u002Fdev\u002Fnull && echo \"fpdf2 available\" || echo \"fpdf2 not found\"\n```\n\n### Install if Needed\n\n```bash\npip install fpdf2\n```\n\n### Create PDF Script\n\n```python\nfrom fpdf import FPDF\n\ndef create_pdf(filename, text):\n    pdf = FPDF()\n    pdf.add_page()\n    pdf.set_font(\"Arial\", size=12)\n    pdf.cell(200, 10, txt=text, ln=True)\n    pdf.output(filename)\n\nif __name__ == \"__main__\":\n    create_pdf(\"output.pdf\", \"Your content here\")\n```\n\n### Execute Script\n\n```bash\ncd \u002Fpath\u002Fto\u002Fworking\u002Fdirectory && python3 script.py\n```\n\n## Decision Matrix\n\n| Tool | Best For | Limitations |\n|------|----------|-------------|\n| pandoc | Markdown\u002FHTML conversion | Requires external installation |\n| reportlab | Complex layouts, graphics | Steeper learning curve |\n| fpdf2 | Simple text PDFs | Limited formatting options |\n\n## Error Handling Pattern\n\nFor each tool attempt:\n\n1. Check availability\u002Finstallation\n2. Install if missing (`pip install \u003Cpackage>`)\n3. Create script using `write_file`\n4. Execute using `run_shell` with `cd \u003Cdir> && \u003Ccommand>`\n5. Verify output file exists\n6. If fails, move to next tool in sequence\n\n## Example Fallback Implementation\n\n```bash\n# Pseudocode for full workflow\nif command -v pandoc >\u002Fdev\u002Fnull 2>&1; then\n    pandoc input.md -o output.pdf && exit 0\nfi\n\nif python3 -c \"import reportlab\" 2>\u002Fdev\u002Fnull; then\n    # Create and run reportlab script\n    exit 0\nfi\n\n# Final fallback: fpdf2\npip install fpdf2\n# Create and run fpdf2 script\n```\n\n## Key Principles\n\n- **Always verify** tool availability before attempting use\n- **Install on-demand** when a tool is missing\n- **Use write_file** for script creation (ensures clean, versionable code)\n- **Use run_shell** with explicit directory context (`cd \u003Cdir> && \u003Ccmd>`)\n- **Progressive fallback** ensures at least one method succeeds\n- **Verify output** after each attempt before moving to next tool",{"name":5,"description":7},"main","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fpdf-generation-troubleshooting","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-generation-troubleshooting",{"tool":56,"command":57},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-generation-troubleshooting",{"tool":59,"command":60},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-generation-troubleshooting","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-generation-troubleshooting\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},".skill_id","OTHER","其他",44,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-generation-troubleshooting\u002F.skill_id",[71,84,92,107,132,151],{"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,35,104,105,83,106],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","issues","execution","system",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":118,"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",[113],{"categoryNo":114,"categoryName":115,"taxonomyType":116,"taxonomyTypeDesc":117},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[31,119,120,121,122,123,124,125,126,127,128,129,130,131],"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":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",[138],{"categoryNo":139,"categoryName":140,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[142,35,31,143,144,145,129,127,120,146,147,148,119,149,124,150,36],"fallback doc with delegation","doc","delegation","shell","markdown","tool","text","simple","formats",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":158,"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",[157],{"categoryNo":114,"categoryName":115,"taxonomyType":116,"taxonomyTypeDesc":117},[31,121,159,160,127,120,161,162,119,163,164,126,35,165,129],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]