[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFQYBT86MQME0FF7GZBB3F":3,"skill-same:01M6KFQYBT86MQME0FF7GZBB3F":65},{"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":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":14,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"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",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"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":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-generation-troubleshooting",{"tool":51,"command":52},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill pdf-generation-troubleshooting",{"tool":54,"command":55},"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,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},".skill_id","OTHER","其他",44,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-generation-troubleshooting\u002F.skill_id",[66,79,87,102,122,138],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":32},"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",[],[73,74,75,76,77,78],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":32},"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",[],[86,74,76,77,78],"zip deliverable finalization",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":32},"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",[],[94,95,96,97,98,30,99,100,78,101],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","issues","execution","system",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":32},"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",[],[26,109,110,111,112,113,114,115,116,117,118,119,120,121],"write","file","report","write file fallback report","domain","professional","sources","retrieval","generate","embedded","documents","data","knowledge",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":32},"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",[],[129,30,26,130,131,132,119,117,110,133,134,135,109,136,114,137,31],"fallback doc with delegation","doc","delegation","shell","markdown","tool","text","simple","formats",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":32},"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",[],[26,111,145,146,117,110,147,148,109,149,150,116,30,151,119],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]