[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBS15YB3XHD8PRQ3EKQK0Y":3,"skill-same:01M6XBS15YB3XHD8PRQ3EKQK0Y":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":13,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M6XBS15YB3XHD8PRQ3EKQK0Y","pdf-gen-fallback-501bcc",null,"Fallback pattern for PDF\u002Fdocument generation when execute_code_sandbox fails with opaque errors","UF-gzj\u002Fopenspace-claude-evolution","UF-gzj","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272393507?v=4","01M6XBCZB755P01VVYGQWPYZY3","01M6XBCZFJA5AREA17WGETA3FW",0,"MIT","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\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,37],"PDF","fallback","pdf gen fallback 501bcc","pdf gen fallback","sandbox","code","execute","document","pattern","generation","document generation","with","errors","for","when","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","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution","https:\u002F\u002Fgithub.com\u002FUF-gzj","2026-04-16 09:31:03",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-gen-fallback-501bcc",{"tool":55,"command":56},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-gen-fallback-501bcc",{"tool":58,"command":59},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill pdf-gen-fallback-501bcc","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpdf-gen-fallback-501bcc\u002F.skill_id",[70,93,109,118,148,164],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":38},"01M6XCCXD3NCM2YKR3WNGBASPC","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[77,78,79,80,81,82,83,84,36,35,85,86,87,88,89,90,91,92],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","script","output","type","files","only","template","file","python",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":38},"01M6XCCT7E3J922Q345PBGSHPN","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[100,101,78,91,102,92,103,104,105,106,107,90,108,34,82,36,85],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":38},"01M6XCCMQX1R8B6FECWB3P63T7","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[116,78,82,117,85,104,90,91,92,36],"write special chars heredoc","shell",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":129,"publishedAt":38},"01M6XCCG41M994JJEX6VN52PEP","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\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[124],{"categoryNo":125,"categoryName":126,"taxonomyType":127,"taxonomyTypeDesc":128},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[130,131,132,133,134,80,135,136,137,138,139,36,140,141,142,143,144,145,146,147],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":38},"01M6XCCCHWNKG2W4VH9E6A10HF","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[155,156,157,158,36,159,34,160,161,162,163],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":38},"01M6XCC7X8PKMR2DEW91XGHYSV","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[171,172,173,174,175,176,91,177,178,179],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]