[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KG31CW1GWM3A81J461M4GG":3,"skill-same:01M6KG31CW1GWM3A81J461M4GG":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":14,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6KG31CW1GWM3A81J461M4GG","shell-python-fallback",null,"Use run_shell with embedded Python heredoc as reliable fallback when code execution tools fail","xyliu-cs\u002FOpenSpace-GDPval","xyliu-cs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89236536?v=4","01M6KF8Z1V4TXS86CKSH48BY8T","xy","01M6KF8Z67443W0SHXM85JEF0B",0,"MIT","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fshell-python-fallback\u002FSKILL.md",[],[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","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","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fshell-python-fallback","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs","https:\u002F\u002Fxyliu-cs.github.io","PhD Student in CS, CUHK-Shenzhen.","2026-04-06 20:32:15",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill shell-python-fallback",{"tool":51,"command":52},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill shell-python-fallback",{"tool":54,"command":55},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill shell-python-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fshell-python-fallback\u002FSKILL.md",true,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},".skill_id","OTHER","其他",35,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fshell-python-fallback\u002F.skill_id",[66,78,86,100,124,145],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":32},"01M6KG8MF1S664SWBDENYRSCK8","zip-export-deliverable","Ensures codebase deliverables are properly exported as ZIP archives through a dedicated finalization step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-export-deliverable\u002FSKILL.md",[],[73,74,75,76,77,29],"zip export deliverable","zip","export","deliverables","codebase",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":32},"01M6KG8GAZWHHEK7VNJDW0ME21","zip-deliverable-finalization","Ensure codebase deliverables are properly packaged as ZIP exports in a dedicated final step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-deliverable-finalization\u002FSKILL.md",[],[85,74,76,77,29],"zip deliverable finalization",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":32},"01M6KG8CMQQ1PYMNTSRZ9VS1MD","zero-iteration-failure-analysis","Identify and handle agent failures with 0 iterations as pre-execution system issues","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzero-iteration-failure-analysis\u002FSKILL.md",[],[93,94,95,96,97,31,98,26,29,99],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","issues","system",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":111,"publishedAt":32},"01M6KG86W3PA07FT9W58YHHERM","write-file-fallback-report","Generate professional documents using write_file when primary data sources fail, leveraging embedded domain knowledge instead of external retrieval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report\u002FSKILL.md",[106],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[21,112,113,114,115,116,117,118,119,120,28,121,122,123],"write","file","report","write file fallback report","domain","professional","sources","retrieval","generate","documents","data","knowledge",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":135,"publishedAt":32},"01M6KG82GAEY3GG77CMGCK1C2T","fallback-doc-with-delegation","Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text\u002Fmarkdown","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced\u002FSKILL.md",[130],{"categoryNo":131,"categoryName":132,"taxonomyType":133,"taxonomyTypeDesc":134},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[136,31,21,137,138,20,121,120,113,139,140,141,112,142,117,143,144],"fallback doc with delegation","doc","delegation","markdown","tool","text","simple","formats","for",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":152,"publishedAt":32},"01M6KG7WT7GX5NYCGEFHW22NV7","context-anchored-fallback-report","Generate documents with write_file when retrieval tools fail, with explicit guardrails against task context drift","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced-4bc5c2\u002FSKILL.md",[151],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},[21,114,153,154,120,113,155,25,112,156,157,119,31,158,121],"context","context anchored fallback report","Guardrails","task","drift","context drift"]