[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KHWT4NWV53ATQRWTAQTF0P":3,"skill-same:01M6KHWT4NWV53ATQRWTAQTF0P":70},{"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":27,"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":48,"updatedAt":49,"install":50,"resources":63},"01M6KHWT4NWV53ATQRWTAQTF0P","code-exec-fallback-266cba",null,"Fallback workflow for reliable code execution when sandbox fails repeatedly","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\u002Fcode-exec-fallback-266cba\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[28,29,30,31,32,33,34,35,36,37],"code","fallback","exec","code exec fallback 266cba","code exec fallback","sandbox","workflow","execution","code execution","for","2026-11-10 10:12:30",false,"---\nname: code-exec-fallback-266cba\ndescription: Fallback workflow for reliable code execution when sandbox fails repeatedly\n---\n\n# Code Execution Fallback Pattern\n\n## When to Use This Skill\n\nApply this pattern when you encounter **repeated failures** with `execute_code_sandbox`:\n- 2+ consecutive failures with opaque or unknown errors\n- Timeout errors that persist across retry attempts\n- Environment-related errors that don't resolve with code fixes\n\n## The Fallback Workflow\n\n### Step 1: Detect Repeated Failures\n\nTrack execution failures. After 2 consecutive failures with `execute_code_sandbox`, switch to the fallback approach.\n\n### Step 2: Write Script to File\n\nUse `write_file` to save your Python script:\n\n```\nwrite_file(\n    path=\"\u002Fworkspace\u002Fscript_name.py\",\n    content=\"# Your Python code here\\nimport sys\\n...\"\n)\n```\n\n### Step 3: Execute via Shell\n\nUse `run_shell` to run the script:\n\n```\nrun_shell(\n    command=\"python \u002Fworkspace\u002Fscript_name.py\",\n    timeout=300\n)\n```\n\n### Step 4: Capture Output\n\nParse stdout\u002Fstderr from `run_shell` output to verify success or diagnose issues.\n\n## Complete Example\n\n```python\n# Instead of this (which may fail):\nresult = execute_code_sandbox(code=\"import pandas as pd\\n...\")\n\n# Use this fallback pattern:\nscript_content = \"\"\"\nimport pandas as pd\nimport sys\n\ntry:\n    # Your logic here\n    df = pd.DataFrame({'col': [1, 2, 3]})\n    print(df.to_csv())\n    sys.exit(0)\nexcept Exception as e:\n    print(f\"ERROR: {e}\", file=sys.stderr)\n    sys.exit(1)\n\"\"\"\n\n# Write the script\nwrite_file(path=\"\u002Fworkspace\u002Fmy_script.py\", content=script_content)\n\n# Execute via shell\nresult = run_shell(command=\"python \u002Fworkspace\u002Fmy_script.py\", timeout=300)\n```\n\n## Best Practices\n\n1. **Add error handling** in your script - use try\u002Fexcept with `sys.exit()` codes\n2. **Set appropriate timeouts** - `run_shell` default is 30s, increase for heavy operations\n3. **Clean up temporary files** after execution if needed\n4. **Log the fallback trigger** - document why you switched approaches\n5. **Verify Python availability** - Most sandboxes have Python 3.x by default\n\n## Why This Works\n\n- `write_file` is more reliable for file I\u002FO operations\n- `run_shell` gives you direct control over execution environment\n- Shell execution bypasses sandbox serialization issues\n- Better error visibility through stdout\u002Fstderr streams\n\n## When NOT to Use This Pattern\n\n- First-time execution failures (retry the sandbox first)\n- Simple one-liner code (sandbox is faster)\n- When sandbox errors are clearly code bugs (fix the code instead)\n- Security-sensitive operations requiring sandbox isolation","# Code Execution Fallback Pattern\n\n## When to Use This Skill\n\nApply this pattern when you encounter **repeated failures** with `execute_code_sandbox`:\n- 2+ consecutive failures with opaque or unknown errors\n- Timeout errors that persist across retry attempts\n- Environment-related errors that don't resolve with code fixes\n\n## The Fallback Workflow\n\n### Step 1: Detect Repeated Failures\n\nTrack execution failures. After 2 consecutive failures with `execute_code_sandbox`, switch to the fallback approach.\n\n### Step 2: Write Script to File\n\nUse `write_file` to save your Python script:\n\n```\nwrite_file(\n    path=\"\u002Fworkspace\u002Fscript_name.py\",\n    content=\"# Your Python code here\\nimport sys\\n...\"\n)\n```\n\n### Step 3: Execute via Shell\n\nUse `run_shell` to run the script:\n\n```\nrun_shell(\n    command=\"python \u002Fworkspace\u002Fscript_name.py\",\n    timeout=300\n)\n```\n\n### Step 4: Capture Output\n\nParse stdout\u002Fstderr from `run_shell` output to verify success or diagnose issues.\n\n## Complete Example\n\n```python\n# Instead of this (which may fail):\nresult = execute_code_sandbox(code=\"import pandas as pd\\n...\")\n\n# Use this fallback pattern:\nscript_content = \"\"\"\nimport pandas as pd\nimport sys\n\ntry:\n    # Your logic here\n    df = pd.DataFrame({'col': [1, 2, 3]})\n    print(df.to_csv())\n    sys.exit(0)\nexcept Exception as e:\n    print(f\"ERROR: {e}\", file=sys.stderr)\n    sys.exit(1)\n\"\"\"\n\n# Write the script\nwrite_file(path=\"\u002Fworkspace\u002Fmy_script.py\", content=script_content)\n\n# Execute via shell\nresult = run_shell(command=\"python \u002Fworkspace\u002Fmy_script.py\", timeout=300)\n```\n\n## Best Practices\n\n1. **Add error handling** in your script - use try\u002Fexcept with `sys.exit()` codes\n2. **Set appropriate timeouts** - `run_shell` default is 30s, increase for heavy operations\n3. **Clean up temporary files** after execution if needed\n4. **Log the fallback trigger** - document why you switched approaches\n5. **Verify Python availability** - Most sandboxes have Python 3.x by default\n\n## Why This Works\n\n- `write_file` is more reliable for file I\u002FO operations\n- `run_shell` gives you direct control over execution environment\n- Shell execution bypasses sandbox serialization issues\n- Better error visibility through stdout\u002Fstderr streams\n\n## When NOT to Use This Pattern\n\n- First-time execution failures (retry the sandbox first)\n- Simple one-liner code (sandbox is faster)\n- When sandbox errors are clearly code bugs (fix the code instead)\n- Security-sensitive operations requiring sandbox isolation",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fcode-exec-fallback-266cba","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":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add AG064\u002FOpenSpace --skill code-exec-fallback-266cba",{"tool":56,"command":57},"bunx","bunx skills add AG064\u002FOpenSpace --skill code-exec-fallback-266cba",{"tool":59,"command":60},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill code-exec-fallback-266cba","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fcode-exec-fallback-266cba\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},".skill_id","OTHER","其他",39,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fcode-exec-fallback-266cba\u002F.skill_id",[71,94,111,120,148,164],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":38},"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",[],[78,79,80,81,82,83,37,84,85,86,87,88,89,90,91,92,93],"write special chars ts check","check","write","filters","Existing","type-checking","errors","script","output","type","files","only","template","file","python","typescript",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":38},"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",[],[101,102,80,90,103,104,91,92,105,106,107,108,109,37,85,110],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper","with",{"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":117,"publishedAt":38},"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",[],[80,118,92,37,107,90,119,91,85],"write special chars heredoc","shell",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":129,"publishedAt":38},"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",[126],{"categoryNo":127,"categoryName":128,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000033","数据分析师",[130,131,132,133,93,134,135,136,137,138,37,139,140,141,142,143,144,145,146,147],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":38},"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",[],[155,156,157,158,37,159,110,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":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":38},"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",[],[171,172,173,174,175,176,91,177,178,179],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]