[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJ59JN28XK7RVTQDQW5KEG":3,"skill-same:01M6KJ59JN28XK7RVTQDQW5KEG":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":25,"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},"01M6KJ59JN28XK7RVTQDQW5KEG","fallback-python-shell",null,"Use run_shell with Python heredoc when execute_code_sandbox or read_file 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\u002Ffallback-python-shell\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000004","电子表格",[26,27,28,29,30,31,32,33,34,35,36,37],"python","shell","fallback","fallback python shell","sandbox","run","code","file","read","execute","use","with","2026-11-10 10:12:30",false,"---\nname: fallback-python-shell\ndescription: Use run_shell with Python heredoc when execute_code_sandbox or read_file fail\n---\n\n# Shell-Based Python Fallback\n\n## When to Use\n\nUse this fallback pattern when:\n- `execute_code_sandbox` returns 'unknown error'\n- `read_file` returns 'unknown error' for supported formats\n- You need to process documents, analyze data, or read files programmatically\n\n## Core Technique\n\nRun Python code through `run_shell` using a heredoc. This bypasses sandbox execution issues while maintaining Python's full capabilities for file I\u002FO and data processing.\n\n### Basic Pattern\n\n```bash\npython3 \u003C\u003C 'EOF'\n# Your Python code here\nimport json\nimport os\n\n# Example: Read and process a file\nwith open('\u002Fpath\u002Fto\u002Ffile.txt', 'r') as f:\n    content = f.read()\n    print(content)\nEOF\n```\n\n### Key Syntax Points\n\n1. Use `python3 \u003C\u003C 'EOF'` (quoted EOF prevents variable expansion in the heredoc)\n2. Indent Python code starting from column 0 (no extra indentation from shell)\n3. End with `EOF` on its own line with no leading\u002Ftrailing whitespace\n4. Print results to stdout to capture them in the tool response\n\n## Common Use Cases\n\n### Reading Files (Fallback for read_file)\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport json\n\n# Read text file\nwith open('document.txt', 'r') as f:\n    content = f.read()\n    print(content)\n\n# Read JSON file\nwith open('data.json', 'r') as f:\n    data = json.load(f)\n    print(json.dumps(data, indent=2))\nEOF\n```\n\n### Processing Excel\u002FCSV Files\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport pandas as pd\n\n# Read Excel file\ndf = pd.read_excel('data.xlsx', sheet_name='Sheet1')\nprint(df.to_string())\nprint(f\"Shape: {df.shape}\")\n\n# Read CSV\ndf = pd.read_csv('data.csv')\nprint(df.head(10))\nEOF\n```\n\n### Reading PDF Files\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport fitz  # PyMuPDF\n\ndoc = fitz.open('document.pdf')\nfor page_num in range(len(doc)):\n    page = doc[page_num]\n    text = page.get_text()\n    print(f\"=== Page {page_num + 1} ===\")\n    print(text)\ndoc.close()\nEOF\n```\n\n### Reading Word Documents\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\n\ndoc = Document('document.docx')\nfor para in doc.paragraphs:\n    print(para.text)\nEOF\n```\n\n### Data Analysis\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport pandas as pd\nimport numpy as np\n\ndf = pd.read_csv('data.csv')\n\n# Basic statistics\nprint(f\"Shape: {df.shape}\")\nprint(f\"Columns: {list(df.columns)}\")\nprint(df.describe())\n\n# Filter and aggregate\nresult = df.groupby('category').agg({'value': 'sum'})\nprint(result)\nEOF\n```\n\n## Best Practices\n\n1. **Error Handling**: Wrap file operations in try\u002Fexcept blocks\n   ```bash\n   python3 \u003C\u003C 'EOF'\n   try:\n       with open('file.txt', 'r') as f:\n           content = f.read()\n           print(content)\n   except FileNotFoundError:\n       print(\"ERROR: File not found\")\n   except Exception as e:\n       print(f\"ERROR: {e}\")\n   EOF\n   ```\n\n2. **Large Output**: For large files, process in chunks or print summaries\n   ```bash\n   python3 \u003C\u003C 'EOF'\n   with open('large_file.csv', 'r') as f:\n       for i, line in enumerate(f):\n           if i \u003C 10:\n               print(line.strip())\n           else:\n               print(\"... truncated ...\")\n               break\n   EOF\n   ```\n\n3. **Working Directory**: Remember run_shell executes in the current working directory. Use absolute paths or ensure you're in the right directory.\n\n4. **Multiple Steps**: Chain related operations in a single heredoc rather than multiple calls\n   ```bash\n   python3 \u003C\u003C 'EOF'\n   # Do all related work in one call\n   with open('input.json') as f:\n       data = json.load(f)\n   \n   processed = [transform(x) for x in data]\n   \n   with open('output.json', 'w') as f:\n       json.dump(processed, f)\n   \n   print(\"Processing complete\")\n   EOF\n   ```\n\n## Troubleshooting\n\n- **Module not found**: Some packages may not be available. Stick to standard library or commonly pre-installed packages (pandas, numpy are often available).\n- **Permission errors**: Ensure files aren't in protected directories.\n- **Character encoding**: Specify encoding explicitly: `open('file.txt', 'r', encoding='utf-8')`\n- **Very long code**: Split into multiple heredocs or write to a temporary .py file first.","# Shell-Based Python Fallback\n\n## When to Use\n\nUse this fallback pattern when:\n- `execute_code_sandbox` returns 'unknown error'\n- `read_file` returns 'unknown error' for supported formats\n- You need to process documents, analyze data, or read files programmatically\n\n## Core Technique\n\nRun Python code through `run_shell` using a heredoc. This bypasses sandbox execution issues while maintaining Python's full capabilities for file I\u002FO and data processing.\n\n### Basic Pattern\n\n```bash\npython3 \u003C\u003C 'EOF'\n# Your Python code here\nimport json\nimport os\n\n# Example: Read and process a file\nwith open('\u002Fpath\u002Fto\u002Ffile.txt', 'r') as f:\n    content = f.read()\n    print(content)\nEOF\n```\n\n### Key Syntax Points\n\n1. Use `python3 \u003C\u003C 'EOF'` (quoted EOF prevents variable expansion in the heredoc)\n2. Indent Python code starting from column 0 (no extra indentation from shell)\n3. End with `EOF` on its own line with no leading\u002Ftrailing whitespace\n4. Print results to stdout to capture them in the tool response\n\n## Common Use Cases\n\n### Reading Files (Fallback for read_file)\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport json\n\n# Read text file\nwith open('document.txt', 'r') as f:\n    content = f.read()\n    print(content)\n\n# Read JSON file\nwith open('data.json', 'r') as f:\n    data = json.load(f)\n    print(json.dumps(data, indent=2))\nEOF\n```\n\n### Processing Excel\u002FCSV Files\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport pandas as pd\n\n# Read Excel file\ndf = pd.read_excel('data.xlsx', sheet_name='Sheet1')\nprint(df.to_string())\nprint(f\"Shape: {df.shape}\")\n\n# Read CSV\ndf = pd.read_csv('data.csv')\nprint(df.head(10))\nEOF\n```\n\n### Reading PDF Files\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport fitz  # PyMuPDF\n\ndoc = fitz.open('document.pdf')\nfor page_num in range(len(doc)):\n    page = doc[page_num]\n    text = page.get_text()\n    print(f\"=== Page {page_num + 1} ===\")\n    print(text)\ndoc.close()\nEOF\n```\n\n### Reading Word Documents\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom docx import Document\n\ndoc = Document('document.docx')\nfor para in doc.paragraphs:\n    print(para.text)\nEOF\n```\n\n### Data Analysis\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport pandas as pd\nimport numpy as np\n\ndf = pd.read_csv('data.csv')\n\n# Basic statistics\nprint(f\"Shape: {df.shape}\")\nprint(f\"Columns: {list(df.columns)}\")\nprint(df.describe())\n\n# Filter and aggregate\nresult = df.groupby('category').agg({'value': 'sum'})\nprint(result)\nEOF\n```\n\n## Best Practices\n\n1. **Error Handling**: Wrap file operations in try\u002Fexcept blocks\n   ```bash\n   python3 \u003C\u003C 'EOF'\n   try:\n       with open('file.txt', 'r') as f:\n           content = f.read()\n           print(content)\n   except FileNotFoundError:\n       print(\"ERROR: File not found\")\n   except Exception as e:\n       print(f\"ERROR: {e}\")\n   EOF\n   ```\n\n2. **Large Output**: For large files, process in chunks or print summaries\n   ```bash\n   python3 \u003C\u003C 'EOF'\n   with open('large_file.csv', 'r') as f:\n       for i, line in enumerate(f):\n           if i \u003C 10:\n               print(line.strip())\n           else:\n               print(\"... truncated ...\")\n               break\n   EOF\n   ```\n\n3. **Working Directory**: Remember run_shell executes in the current working directory. Use absolute paths or ensure you're in the right directory.\n\n4. **Multiple Steps**: Chain related operations in a single heredoc rather than multiple calls\n   ```bash\n   python3 \u003C\u003C 'EOF'\n   # Do all related work in one call\n   with open('input.json') as f:\n       data = json.load(f)\n   \n   processed = [transform(x) for x in data]\n   \n   with open('output.json', 'w') as f:\n       json.dump(processed, f)\n   \n   print(\"Processing complete\")\n   EOF\n   ```\n\n## Troubleshooting\n\n- **Module not found**: Some packages may not be available. Stick to standard library or commonly pre-installed packages (pandas, numpy are often available).\n- **Permission errors**: Ensure files aren't in protected directories.\n- **Character encoding**: Specify encoding explicitly: `open('file.txt', 'r', encoding='utf-8')`\n- **Very long code**: Split into multiple heredocs or write to a temporary .py file first.",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Ffallback-python-shell","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 fallback-python-shell",{"tool":56,"command":57},"bunx","bunx skills add AG064\u002FOpenSpace --skill fallback-python-shell",{"tool":59,"command":60},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill fallback-python-shell","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Ffallback-python-shell\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},".skill_id","OTHER","其他",35,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Ffallback-python-shell\u002F.skill_id",[71,93,108,116,146,162],{"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,84,85,86,87,88,89,90,91,33,26,92],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","typescript",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"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",[],[100,101,80,91,102,34,33,26,103,104,105,106,107,84,86,37],"readback","write special chars readback","cleanup","scripts","verification","via","post","helper",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"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,115,26,84,105,91,27,33,86],"write special chars heredoc",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":127,"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",[122],{"categoryNo":123,"categoryName":124,"taxonomyType":125,"taxonomyTypeDesc":126},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[128,129,130,131,92,132,133,134,135,136,84,137,138,139,140,141,142,143,144,145],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"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",[],[153,154,155,156,84,157,37,158,159,160,161],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"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",[],[169,170,171,172,173,174,33,175,176,177],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]