[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XC12YYE6QGGF8Y78ZDZ6H1":3,"skill-same:01M6XC12YYE6QGGF8Y78ZDZ6H1":63},{"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":17,"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":6,"updatedAt":42,"install":43,"resources":56},"01M6XC12YYE6QGGF8Y78ZDZ6H1","shell-python-fallback",null,"Use run_shell with embedded Python heredoc as reliable fallback when code execution tools fail","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\u002Fshell-python-fallback\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31],"python","shell","fallback","shell python fallback","run","code","Tools","execution","use","embedded","as","code execution","with","when","2026-11-10 10:12:30",false,"---\nname: shell-python-fallback\ndescription: Use run_shell with embedded Python heredoc as reliable fallback when code execution tools fail\n---\n\n# Shell Python Fallback\n\n## When to Use\n\nUse this pattern when `execute_code_sandbox` or `shell_agent` tools consistently fail with \"unknown error\" for tasks such as:\n- Data processing and transformation\n- PDF generation (reportlab, etc.)\n- File parsing and manipulation\n- Any Python script execution that requires reliability\n\n## The Pattern\n\nInstead of using code execution tools, embed your Python script directly in a `run_shell` command using a heredoc:\n\n```bash\npython3 \u003C\u003C 'EOF'\n# Your Python code here\nimport sys\nprint(\"Hello from embedded Python\")\nEOF\n```\n\n## Step-by-Step Instructions\n\n1. **Identify the failure**: When `execute_code_sandbox` or `shell_agent` returns \"unknown error\" repeatedly (2+ attempts), switch to this fallback.\n\n2. **Write your Python script**: Prepare the complete Python code you need to execute.\n\n3. **Embed in run_shell**: Use `run_shell` with a heredoc syntax:\n\n```\nCommand: python3 \u003C\u003C 'EOF'\nimport json\n# Your complete script here\ndata = {\"key\": \"value\"}\nprint(json.dumps(data))\nEOF\n```\n\n4. **Handle multi-line scripts**: For longer scripts, ensure proper indentation is preserved. The heredoc preserves whitespace exactly.\n\n5. **Check output**: Parse the stdout from `run_shell` to verify success or capture errors.\n\n## Example: PDF Generation\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\nc = canvas.Canvas(\"output.pdf\", pagesize=letter)\nc.drawString(100, 750, \"Hello World\")\nc.save()\nprint(\"PDF created successfully\")\nEOF\n```\n\n## Example: Data Processing\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport csv\nimport json\n\ndata = []\nwith open('input.csv', 'r') as f:\n    reader = csv.DictReader(f)\n    for row in reader:\n        data.append(row)\n\nwith open('output.json', 'w') as f:\n    json.dump(data, f, indent=2)\n\nprint(f\"Processed {len(data)} records\")\nEOF\n```\n\n## Best Practices\n\n- **Quote the EOF delimiter** (`\u003C\u003C 'EOF'` not `\u003C\u003C EOF`) to prevent shell variable expansion in your Python code\n- **Include error handling** in your Python script with try\u002Fexcept blocks\n- **Print status messages** to stdout so you can verify execution succeeded\n- **Use absolute paths** or ensure working directory is correct\n- **Test incrementally**: Start with a minimal script, then expand\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Script doesn't run | Ensure `python3` is available in the shell environment |\n| Indentation errors | Check that heredoc preserves spaces (use spaces, not tabs) |\n| Module not found | Use `python3 -m pip install \u003Cmodule>` before running script |\n| File not found | Use absolute paths or `pwd` to verify working directory |\n\n## Why This Works\n\nThe `run_shell` tool executes commands directly in the system shell, bypassing the sandbox restrictions or internal errors that affect `execute_code_sandbox` and `shell_agent`. The heredoc approach allows multi-line Python scripts while keeping everything in a single shell command.","# Shell Python Fallback\n\n## When to Use\n\nUse this pattern when `execute_code_sandbox` or `shell_agent` tools consistently fail with \"unknown error\" for tasks such as:\n- Data processing and transformation\n- PDF generation (reportlab, etc.)\n- File parsing and manipulation\n- Any Python script execution that requires reliability\n\n## The Pattern\n\nInstead of using code execution tools, embed your Python script directly in a `run_shell` command using a heredoc:\n\n```bash\npython3 \u003C\u003C 'EOF'\n# Your Python code here\nimport sys\nprint(\"Hello from embedded Python\")\nEOF\n```\n\n## Step-by-Step Instructions\n\n1. **Identify the failure**: When `execute_code_sandbox` or `shell_agent` returns \"unknown error\" repeatedly (2+ attempts), switch to this fallback.\n\n2. **Write your Python script**: Prepare the complete Python code you need to execute.\n\n3. **Embed in run_shell**: Use `run_shell` with a heredoc syntax:\n\n```\nCommand: python3 \u003C\u003C 'EOF'\nimport json\n# Your complete script here\ndata = {\"key\": \"value\"}\nprint(json.dumps(data))\nEOF\n```\n\n4. **Handle multi-line scripts**: For longer scripts, ensure proper indentation is preserved. The heredoc preserves whitespace exactly.\n\n5. **Check output**: Parse the stdout from `run_shell` to verify success or capture errors.\n\n## Example: PDF Generation\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\nc = canvas.Canvas(\"output.pdf\", pagesize=letter)\nc.drawString(100, 750, \"Hello World\")\nc.save()\nprint(\"PDF created successfully\")\nEOF\n```\n\n## Example: Data Processing\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport csv\nimport json\n\ndata = []\nwith open('input.csv', 'r') as f:\n    reader = csv.DictReader(f)\n    for row in reader:\n        data.append(row)\n\nwith open('output.json', 'w') as f:\n    json.dump(data, f, indent=2)\n\nprint(f\"Processed {len(data)} records\")\nEOF\n```\n\n## Best Practices\n\n- **Quote the EOF delimiter** (`\u003C\u003C 'EOF'` not `\u003C\u003C EOF`) to prevent shell variable expansion in your Python code\n- **Include error handling** in your Python script with try\u002Fexcept blocks\n- **Print status messages** to stdout so you can verify execution succeeded\n- **Use absolute paths** or ensure working directory is correct\n- **Test incrementally**: Start with a minimal script, then expand\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Script doesn't run | Ensure `python3` is available in the shell environment |\n| Indentation errors | Check that heredoc preserves spaces (use spaces, not tabs) |\n| Module not found | Use `python3 -m pip install \u003Cmodule>` before running script |\n| File not found | Use absolute paths or `pwd` to verify working directory |\n\n## Why This Works\n\nThe `run_shell` tool executes commands directly in the system shell, bypassing the sandbox restrictions or internal errors that affect `execute_code_sandbox` and `shell_agent`. The heredoc approach allows multi-line Python scripts while keeping everything in a single shell command.",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fshell-python-fallback","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":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill shell-python-fallback",{"tool":49,"command":50},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill shell-python-fallback",{"tool":52,"command":53},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill shell-python-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fshell-python-fallback\u002FSKILL.md",true,[57],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},".skill_id","OTHER","其他",35,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fshell-python-fallback\u002F.skill_id",[64,88,104,112,137,153],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":32},"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",[],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,18],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","file",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":32},"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",[],[95,96,72,87,97,18,98,99,100,101,102,86,103,30,76,79,81],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":32},"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",[],[111,72,76,19,81,99,86,87,18,79],"write special chars heredoc",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":32},"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",[],[119,120,121,122,123,74,124,125,126,127,128,79,129,130,131,132,133,134,135,136],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":32},"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",[],[144,145,146,147,79,148,30,149,150,151,152],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":32},"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",[],[160,161,162,163,164,165,87,166,167,168],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]