[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KK1VT3KQG1XAEPS4KS75QQ":3,"skill-same:01M6KK1VT3KQG1XAEPS4KS75QQ":63},{"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":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":13,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M6KK1VT3KQG1XAEPS4KS75QQ","shell-python-fallback",null,"Use run_shell with embedded Python heredoc as reliable fallback when code execution tools fail","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\u002Fshell-python-fallback\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30],"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","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fshell-python-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":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add AG064\u002FOpenSpace --skill shell-python-fallback",{"tool":49,"command":50},"bunx","bunx skills add AG064\u002FOpenSpace --skill shell-python-fallback",{"tool":52,"command":53},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill shell-python-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fshell-python-fallback\u002F.skill_id",[64,87,103,111,141,157],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":31},"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",[],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,18,86],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","typescript",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":31},"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",[],[94,95,73,84,96,97,85,18,98,99,100,101,102,77,79,30],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper",{"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":31},"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",[],[73,110,18,77,100,84,19,85,79],"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":31},"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,86,127,128,129,130,131,77,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":31},"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,77,152,30,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":31},"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,85,170,171,172],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]