[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJ4JPZ7ZRC71KMCZCWK0MJ":3,"skill-same:01M6KJ4JPZ7ZRC71KMCZCWK0MJ":64},{"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":22,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":13,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M6KJ4JPZ7ZRC71KMCZCWK0MJ","execute-code-fallback",null,"Fallback from execute_code_sandbox to run_shell when e2b sandbox is unavailable","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\u002Fexecute-code-fallback\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[23,24,25,26,27,28,29,30,31],"code","execute","fallback","execute code fallback","sandbox","run","shell","e2b sandbox","e2b","2026-11-10 10:12:30",false,"---\nname: execute-code-fallback\ndescription: Fallback from execute_code_sandbox to run_shell when e2b sandbox is unavailable\n---\n\n# Execute Code Fallback Pattern\n\nWhen `execute_code_sandbox` fails due to e2b unavailability, immediately fall back to `run_shell` with embedded Python code. This ensures task continuity when the sandbox service is down.\n\n## When to Apply\n\nUse this pattern when you observe:\n- `execute_code_sandbox` returns errors mentioning \"e2b\", \"sandbox unavailable\", or connection timeouts\n- Repeated sandbox execution failures (2+ attempts)\n- Error messages indicating the code execution environment is unreachable\n\n## Fallback Procedure\n\n### Step 1: Detect the Failure\n\nIdentify that `execute_code_sandbox` has failed. Common error indicators:\n- \"e2b service unavailable\"\n- \"Sandbox connection failed\"\n- \"Execution environment not reachable\"\n- Timeout errors during code execution\n\n### Step 2: Switch to run_shell with Embedded Python\n\nInstead of:\n```python\nexecute_code_sandbox(code=\"...\")\n```\n\nUse:\n```bash\nrun_shell(command=\"python3 -c '...your Python code...'\")\n```\n\n### Step 3: Install Dependencies First (If Needed)\n\nIf your Python code requires external packages, install them first:\n\n```bash\nrun_shell(command=\"pip install pandas requests matplotlib\")\n```\n\nThen execute your main code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\nimport requests\n\n# Your code here\nprint(\"Success\")\nEOF\n\")\n```\n\n### Step 4: Use Heredoc for Multi-line Code\n\nFor complex Python scripts, use heredoc syntax for cleaner code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'PYTHON_SCRIPT'\nimport json\nimport os\n\n# Complex logic here\ndata = {'key': 'value'}\nwith open('output.json', 'w') as f:\n    json.dump(data, f)\n\nprint('File created successfully')\nPYTHON_SCRIPT\n\")\n```\n\n## Complete Example\n\n**Scenario:** You need to process a CSV file and generate a report.\n\n**Original approach (sandbox):**\n```python\nexecute_code_sandbox(code=\"\"\"\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\n\"\"\")\n```\n\n**Fallback approach (run_shell):**\n```bash\n# First install dependencies if needed\nrun_shell(command=\"pip install pandas --quiet\")\n\n# Then execute the code\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\nEOF\n\")\n```\n\n## Important Considerations\n\n1. **State Persistence**: Unlike `execute_code_sandbox`, `run_shell` executions may not share state between calls. Save intermediate results to files if needed.\n\n2. **Working Directory**: Ensure you're operating in the correct directory. Use `pwd` to verify or include `cd \u002Fpath\u002Fto\u002Fworkdir` in your commands.\n\n3. **Python Version**: Use `python3` explicitly to avoid ambiguity. Verify with `python3 --version` if needed.\n\n4. **Error Handling**: Check the stdout\u002Fstderr from `run_shell` to confirm success. Failed Python scripts will return non-zero exit codes.\n\n5. **Security**: Be cautious when embedding user-provided data into shell commands. Escape appropriately or use file-based input.\n\n6. **Performance**: For large computations, `run_shell` may be slower than sandbox. Consider breaking into smaller steps if timeouts occur.\n\n## Quick Reference\n\n| Task | Sandbox Approach | Fallback Approach |\n|------|-----------------|-------------------|\n| Simple calculation | `execute_code_sandbox(code=\"print(2+2)\")` | `run_shell(command=\"python3 -c 'print(2+2)'\")` |\n| Install + run | `execute_code_sandbox(code=\"import pkg; ...\")` | `run_shell(command=\"pip install pkg && python3 -c '...'\")` |\n| Multi-line script | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n| File I\u002FO | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n\n## Recovery Checklist\n\n- [ ] Confirm `execute_code_sandbox` failure (not a code bug)\n- [ ] Switch to `run_shell` immediately\n- [ ] Install required packages with `pip install`\n- [ ] Use heredoc for multi-line Python\n- [ ] Verify output and handle errors\n- [ ] Save intermediate results to files if multi-step","# Execute Code Fallback Pattern\n\nWhen `execute_code_sandbox` fails due to e2b unavailability, immediately fall back to `run_shell` with embedded Python code. This ensures task continuity when the sandbox service is down.\n\n## When to Apply\n\nUse this pattern when you observe:\n- `execute_code_sandbox` returns errors mentioning \"e2b\", \"sandbox unavailable\", or connection timeouts\n- Repeated sandbox execution failures (2+ attempts)\n- Error messages indicating the code execution environment is unreachable\n\n## Fallback Procedure\n\n### Step 1: Detect the Failure\n\nIdentify that `execute_code_sandbox` has failed. Common error indicators:\n- \"e2b service unavailable\"\n- \"Sandbox connection failed\"\n- \"Execution environment not reachable\"\n- Timeout errors during code execution\n\n### Step 2: Switch to run_shell with Embedded Python\n\nInstead of:\n```python\nexecute_code_sandbox(code=\"...\")\n```\n\nUse:\n```bash\nrun_shell(command=\"python3 -c '...your Python code...'\")\n```\n\n### Step 3: Install Dependencies First (If Needed)\n\nIf your Python code requires external packages, install them first:\n\n```bash\nrun_shell(command=\"pip install pandas requests matplotlib\")\n```\n\nThen execute your main code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\nimport requests\n\n# Your code here\nprint(\"Success\")\nEOF\n\")\n```\n\n### Step 4: Use Heredoc for Multi-line Code\n\nFor complex Python scripts, use heredoc syntax for cleaner code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'PYTHON_SCRIPT'\nimport json\nimport os\n\n# Complex logic here\ndata = {'key': 'value'}\nwith open('output.json', 'w') as f:\n    json.dump(data, f)\n\nprint('File created successfully')\nPYTHON_SCRIPT\n\")\n```\n\n## Complete Example\n\n**Scenario:** You need to process a CSV file and generate a report.\n\n**Original approach (sandbox):**\n```python\nexecute_code_sandbox(code=\"\"\"\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\n\"\"\")\n```\n\n**Fallback approach (run_shell):**\n```bash\n# First install dependencies if needed\nrun_shell(command=\"pip install pandas --quiet\")\n\n# Then execute the code\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\nEOF\n\")\n```\n\n## Important Considerations\n\n1. **State Persistence**: Unlike `execute_code_sandbox`, `run_shell` executions may not share state between calls. Save intermediate results to files if needed.\n\n2. **Working Directory**: Ensure you're operating in the correct directory. Use `pwd` to verify or include `cd \u002Fpath\u002Fto\u002Fworkdir` in your commands.\n\n3. **Python Version**: Use `python3` explicitly to avoid ambiguity. Verify with `python3 --version` if needed.\n\n4. **Error Handling**: Check the stdout\u002Fstderr from `run_shell` to confirm success. Failed Python scripts will return non-zero exit codes.\n\n5. **Security**: Be cautious when embedding user-provided data into shell commands. Escape appropriately or use file-based input.\n\n6. **Performance**: For large computations, `run_shell` may be slower than sandbox. Consider breaking into smaller steps if timeouts occur.\n\n## Quick Reference\n\n| Task | Sandbox Approach | Fallback Approach |\n|------|-----------------|-------------------|\n| Simple calculation | `execute_code_sandbox(code=\"print(2+2)\")` | `run_shell(command=\"python3 -c 'print(2+2)'\")` |\n| Install + run | `execute_code_sandbox(code=\"import pkg; ...\")` | `run_shell(command=\"pip install pkg && python3 -c '...'\")` |\n| Multi-line script | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n| File I\u002FO | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n\n## Recovery Checklist\n\n- [ ] Confirm `execute_code_sandbox` failure (not a code bug)\n- [ ] Switch to `run_shell` immediately\n- [ ] Install required packages with `pip install`\n- [ ] Use heredoc for multi-line Python\n- [ ] Verify output and handle errors\n- [ ] Save intermediate results to files if multi-step",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fexecute-code-fallback","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 about 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":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add AG064\u002FOpenSpace --skill execute-code-fallback",{"tool":50,"command":51},"bunx","bunx skills add AG064\u002FOpenSpace --skill execute-code-fallback",{"tool":53,"command":54},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill execute-code-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexecute-code-fallback\u002FSKILL.md",true,[58],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},".skill_id","OTHER","其他",35,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexecute-code-fallback\u002F.skill_id",[65,89,106,114,142,158],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":32},"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",[],[72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","python","typescript",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":32},"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",[],[96,97,74,85,98,99,86,87,100,101,102,103,104,78,80,105],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper","with",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":32},"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",[],[74,113,87,78,102,85,29,86,80],"write special chars heredoc",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":123,"publishedAt":32},"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",[120],{"categoryNo":121,"categoryName":122,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000033","数据分析师",[124,125,126,127,88,128,129,130,131,132,78,133,134,135,136,137,138,139,140,141],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":32},"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",[],[149,150,151,152,78,153,105,154,155,156,157],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":32},"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",[],[165,166,167,168,169,170,86,171,172,173],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]