[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJZ7CG2ES0SWEGJC477NB0":3,"skill-same:01M6KJZ7CG2ES0SWEGJC477NB0":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":13,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6KJZ7CG2ES0SWEGJC477NB0","sandbox-fallback-execution-5eda7b",null,"Fallback pattern for executing Python code when sandbox execution fails by writing scripts to disk and running via shell","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-execution-5eda7b\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"sandbox","execution","fallback","sandbox fallback execution 5eda7b","sandbox fallback execution","writing","python","code","shell","disk","pattern","scripts","via","python code","for","2026-11-10 10:12:30",false,"---\nname: sandbox-fallback-execution-5eda7b\ndescription: Fallback pattern for executing Python code when sandbox execution fails by writing scripts to disk and running via shell\n---\n\n# Sandbox Fallback Execution\n\n## Overview\n\nWhen `execute_code_sandbox` fails due to e2b initialization errors or sandbox unavailability, use this fallback pattern to execute Python code by writing it to disk and running it via `run_shell`. This approach is particularly useful for PDF generation, data processing, and other Python-intensive tasks.\n\n## When to Use\n\nUse this skill when you encounter errors like:\n- `e2b initialization error`\n- `sandbox not available`\n- `execute_code_sandbox` timeout or connection failures\n- Any sandbox execution that consistently fails\n\n## Step-by-Step Instructions\n\n### Step 1: Attempt Sandbox Execution First\n\nAlways try `execute_code_sandbox` first, as it provides isolation and artifact handling:\n\n```python\nexecute_code_sandbox(code=\"your_python_code_here\")\n```\n\n### Step 2: Detect Failure and Switch to Fallback\n\nWhen sandbox execution fails with initialization errors, switch to the fallback pattern:\n\n1. **Write the Python script to disk** using `write_file`:\n   - Choose a descriptive filename (e.g., `generate_pdf.py`, `process_data.py`)\n   - Include the complete Python code with all necessary imports\n\n2. **Execute via shell** using `run_shell`:\n   - Run the script with `python` or `python3`\n   - Capture stdout\u002Fstderr for verification\n\n### Step 3: Example Implementation\n\n```python\n# Write the script to disk\nwrite_file(\n    path=\"generate_pdf.py\",\n    content=\"\"\"\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\ncreate_pdf('output.pdf', 'Hello World')\n\"\"\"\n)\n\n# Execute the script via shell\nrun_shell(command=\"python generate_pdf.py\")\n```\n\n### Step 4: Handle Dependencies\n\nIf the script requires external packages:\n\n```python\n# Install dependencies first\nrun_shell(command=\"pip install reportlab pillow\")\n\n# Then execute the script\nrun_shell(command=\"python generate_pdf.py\")\n```\n\n### Step 5: Verify Output\n\nAfter execution, verify the output was created:\n\n```python\n# Check if file was created\nrun_shell(command=\"ls -la output.pdf\")\n\n# Optionally read the file to confirm\nread_file(file_path=\"output.pdf\", filetype=\"pdf\")\n```\n\n## Best Practices\n\n1. **Keep scripts self-contained**: Include all imports and logic in the written file\n2. **Use descriptive filenames**: Make it clear what each script does\n3. **Clean up when done**: Remove temporary scripts if not needed for debugging\n4. **Capture errors**: Always check stdout\u002Fstderr from `run_shell` for debugging\n5. **Handle paths carefully**: Use relative paths or absolute paths consistently\n\n## Complete Example Pattern\n\n```python\n# Primary: Try sandbox execution\ntry:\n    result = execute_code_sandbox(code=python_code)\nexcept Exception as e:\n    if \"e2b\" in str(e).lower() or \"sandbox\" in str(e).lower():\n        # Fallback: Write to disk and execute via shell\n        script_path = \"task_script.py\"\n        \n        write_file(\n            path=script_path,\n            content=python_code\n        )\n        \n        # Install any required dependencies\n        run_shell(command=\"pip install -q reportlab\")\n        \n        # Execute the script\n        result = run_shell(command=f\"python {script_path}\")\n        \n        # Verify output\n        run_shell(command=\"ls -la\")\n```\n\n## Applicable Use Cases\n\n- PDF generation (reportlab, fpdf, etc.)\n- Image processing (PIL, OpenCV)\n- Data analysis (pandas, numpy)\n- File manipulation tasks\n- Any Python script that doesn't require special sandbox features","# Sandbox Fallback Execution\n\n## Overview\n\nWhen `execute_code_sandbox` fails due to e2b initialization errors or sandbox unavailability, use this fallback pattern to execute Python code by writing it to disk and running it via `run_shell`. This approach is particularly useful for PDF generation, data processing, and other Python-intensive tasks.\n\n## When to Use\n\nUse this skill when you encounter errors like:\n- `e2b initialization error`\n- `sandbox not available`\n- `execute_code_sandbox` timeout or connection failures\n- Any sandbox execution that consistently fails\n\n## Step-by-Step Instructions\n\n### Step 1: Attempt Sandbox Execution First\n\nAlways try `execute_code_sandbox` first, as it provides isolation and artifact handling:\n\n```python\nexecute_code_sandbox(code=\"your_python_code_here\")\n```\n\n### Step 2: Detect Failure and Switch to Fallback\n\nWhen sandbox execution fails with initialization errors, switch to the fallback pattern:\n\n1. **Write the Python script to disk** using `write_file`:\n   - Choose a descriptive filename (e.g., `generate_pdf.py`, `process_data.py`)\n   - Include the complete Python code with all necessary imports\n\n2. **Execute via shell** using `run_shell`:\n   - Run the script with `python` or `python3`\n   - Capture stdout\u002Fstderr for verification\n\n### Step 3: Example Implementation\n\n```python\n# Write the script to disk\nwrite_file(\n    path=\"generate_pdf.py\",\n    content=\"\"\"\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\ncreate_pdf('output.pdf', 'Hello World')\n\"\"\"\n)\n\n# Execute the script via shell\nrun_shell(command=\"python generate_pdf.py\")\n```\n\n### Step 4: Handle Dependencies\n\nIf the script requires external packages:\n\n```python\n# Install dependencies first\nrun_shell(command=\"pip install reportlab pillow\")\n\n# Then execute the script\nrun_shell(command=\"python generate_pdf.py\")\n```\n\n### Step 5: Verify Output\n\nAfter execution, verify the output was created:\n\n```python\n# Check if file was created\nrun_shell(command=\"ls -la output.pdf\")\n\n# Optionally read the file to confirm\nread_file(file_path=\"output.pdf\", filetype=\"pdf\")\n```\n\n## Best Practices\n\n1. **Keep scripts self-contained**: Include all imports and logic in the written file\n2. **Use descriptive filenames**: Make it clear what each script does\n3. **Clean up when done**: Remove temporary scripts if not needed for debugging\n4. **Capture errors**: Always check stdout\u002Fstderr from `run_shell` for debugging\n5. **Handle paths carefully**: Use relative paths or absolute paths consistently\n\n## Complete Example Pattern\n\n```python\n# Primary: Try sandbox execution\ntry:\n    result = execute_code_sandbox(code=python_code)\nexcept Exception as e:\n    if \"e2b\" in str(e).lower() or \"sandbox\" in str(e).lower():\n        # Fallback: Write to disk and execute via shell\n        script_path = \"task_script.py\"\n        \n        write_file(\n            path=script_path,\n            content=python_code\n        )\n        \n        # Install any required dependencies\n        run_shell(command=\"pip install -q reportlab\")\n        \n        # Execute the script\n        result = run_shell(command=f\"python {script_path}\")\n        \n        # Verify output\n        run_shell(command=\"ls -la\")\n```\n\n## Applicable Use Cases\n\n- PDF generation (reportlab, fpdf, etc.)\n- Image processing (PIL, OpenCV)\n- Data analysis (pandas, numpy)\n- File manipulation tasks\n- Any Python script that doesn't require special sandbox features",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fsandbox-fallback-execution-5eda7b","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add AG064\u002FOpenSpace --skill sandbox-fallback-execution-5eda7b",{"tool":51,"command":52},"bunx","bunx skills add AG064\u002FOpenSpace --skill sandbox-fallback-execution-5eda7b",{"tool":54,"command":55},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill sandbox-fallback-execution-5eda7b","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-execution-5eda7b\u002FSKILL.md",true,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},".skill_id","OTHER","其他",47,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-execution-5eda7b\u002F.skill_id",[66,88,103,111,141,157],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":33},"01M6KKMPWA0B5SCCH766F8M5EA","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[73,74,75,76,77,78,32,79,80,81,82,83,84,85,86,24,87],"write special chars ts check","check","write","filters","Existing","type-checking","errors","script","output","type","files","only","template","file","typescript",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":33},"01M6KKMJXVBNVEY3TRK055F4A7","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[95,96,75,85,97,98,86,24,29,99,30,100,101,32,80,102],"readback","write special chars readback","cleanup","read","verification","post","helper","with",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":33},"01M6KKMEGX9M9NC105J0W3Q5B9","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[75,110,24,32,30,85,26,86,80],"write special chars heredoc",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":122,"publishedAt":33},"01M6KKM8EJ2AATVHZBNB916WT0","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[123,124,125,126,87,127,128,129,130,131,32,132,133,134,135,136,137,138,139,140],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":33},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[148,149,150,151,32,152,102,153,154,155,156],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":33},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[164,165,166,167,168,169,86,170,171,172],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]