[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJY0X1W51ZZ77SV53WAPBD":3,"skill-same:01M6KJY0X1W51ZZ77SV53WAPBD":66},{"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":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":13,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6KJY0X1W51ZZ77SV53WAPBD","run-shell-python-file-io",null,"Use run_shell with inline Python for reliable file I\u002FO when execute_code_sandbox cannot access working directory files","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\u002Frun-shell-python-file-io\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"python","run","file","shell","io","run shell python file io","directory","sandbox","code","access","execute","use","files","with","for","inline","2026-11-10 10:12:30",false,"---\nname: run-shell-python-file-io\ndescription: Use run_shell with inline Python for reliable file I\u002FO when execute_code_sandbox cannot access working directory files\n---\n\n# Run Shell Python File I\u002FO\n\n## When to Use This Skill\n\nUse this technique when `execute_code_sandbox` cannot access files in your working directory, but you need to perform file operations (read, write, transform) as part of your task execution.\n\n## The Pattern\n\nInstead of using `execute_code_sandbox`, run Python code directly through `run_shell` with explicit path handling. This provides reliable file I\u002FO capabilities within the task workspace.\n\n## How to Apply\n\n### Step 1: Identify File Access Needs\nDetermine which files you need to read from or write to in the working directory.\n\n### Step 2: Write Inline Python via run_shell\nConstruct a Python script that handles your file operations and execute it through `run_shell`:\n\n```bash\npython3 -c \"\nimport os\n\n# Get the working directory\nwork_dir = os.getcwd()\nprint(f'Working directory: {work_dir}')\n\n# Read a file\nwith open('input.txt', 'r') as f:\n    content = f.read()\n\n# Process the content\nprocessed = content.upper()\n\n# Write to output file\nwith open('output.txt', 'w') as f:\n    f.write(processed)\n\nprint('File operation complete')\n\"\n```\n\n### Step 3: Handle Complex Logic\nFor more complex operations, write a temporary Python script file first:\n\n```bash\ncat > \u002Ftmp\u002Fprocess.py \u003C\u003C 'EOF'\nimport os\nimport json\n\nwork_dir = os.getcwd()\n\n# Read input\nwith open('data.json', 'r') as f:\n    data = json.load(f)\n\n# Transform\nresult = {k: v * 2 for k, v in data.items()}\n\n# Write output\nwith open('result.json', 'w') as f:\n    json.dump(result, f, indent=2)\n\nprint(f'Processed {len(data)} items')\nEOF\n\npython3 \u002Ftmp\u002Fprocess.py\n```\n\n### Step 4: Verify File Operations\nAfter execution, verify the files were created\u002Fmodified correctly:\n\n```bash\nls -la\ncat output.txt\n```\n\n## Best Practices\n\n1. **Use Absolute or Relative Paths Explicitly**: Always specify file paths clearly; `os.getcwd()` helps confirm your working directory.\n\n2. **Handle Errors Gracefully**: Add try\u002Fexcept blocks to catch file I\u002FO errors:\n   ```python\n   try:\n       with open('file.txt', 'r') as f:\n           content = f.read()\n   except FileNotFoundError:\n       print('File not found')\n   ```\n\n3. **Use Here-Docs for Complex Scripts**: For scripts longer than a few lines, use bash here-documents to avoid escaping issues.\n\n4. **Clean Up Temporary Files**: If you create temporary scripts, consider removing them after execution.\n\n5. **Check Working Directory First**: Print `os.getcwd()` to confirm you're operating in the expected directory.\n\n## Common Use Cases\n\n- Reading configuration files from the workspace\n- Writing generated reports or outputs\n- Transforming data files (CSV, JSON, XML)\n- Batch processing multiple files\n- Generating structured documents (PDFs, spreadsheets)\n\n## Example: Processing Multiple Files\n\n```bash\npython3 -c \"\nimport os\nimport glob\n\nwork_dir = os.getcwd()\nfiles = glob.glob('*.txt')\n\nfor f in files:\n    with open(f, 'r') as file:\n        content = file.read()\n    # Process each file\n    with open(f'processed_{f}', 'w') as out:\n        out.write(content.strip().upper())\n\nprint(f'Processed {len(files)} files')\n\"\n```\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| File not found | Check `os.getcwd()` output; use absolute paths if needed |\n| Permission denied | Ensure the directory is writable; avoid protected system paths |\n| Encoding errors | Specify encoding explicitly: `open('file.txt', 'r', encoding='utf-8')` |\n| Multi-line script issues | Use here-doc (`\u003C\u003C 'EOF'`) instead of `-c` for complex scripts |","# Run Shell Python File I\u002FO\n\n## When to Use This Skill\n\nUse this technique when `execute_code_sandbox` cannot access files in your working directory, but you need to perform file operations (read, write, transform) as part of your task execution.\n\n## The Pattern\n\nInstead of using `execute_code_sandbox`, run Python code directly through `run_shell` with explicit path handling. This provides reliable file I\u002FO capabilities within the task workspace.\n\n## How to Apply\n\n### Step 1: Identify File Access Needs\nDetermine which files you need to read from or write to in the working directory.\n\n### Step 2: Write Inline Python via run_shell\nConstruct a Python script that handles your file operations and execute it through `run_shell`:\n\n```bash\npython3 -c \"\nimport os\n\n# Get the working directory\nwork_dir = os.getcwd()\nprint(f'Working directory: {work_dir}')\n\n# Read a file\nwith open('input.txt', 'r') as f:\n    content = f.read()\n\n# Process the content\nprocessed = content.upper()\n\n# Write to output file\nwith open('output.txt', 'w') as f:\n    f.write(processed)\n\nprint('File operation complete')\n\"\n```\n\n### Step 3: Handle Complex Logic\nFor more complex operations, write a temporary Python script file first:\n\n```bash\ncat > \u002Ftmp\u002Fprocess.py \u003C\u003C 'EOF'\nimport os\nimport json\n\nwork_dir = os.getcwd()\n\n# Read input\nwith open('data.json', 'r') as f:\n    data = json.load(f)\n\n# Transform\nresult = {k: v * 2 for k, v in data.items()}\n\n# Write output\nwith open('result.json', 'w') as f:\n    json.dump(result, f, indent=2)\n\nprint(f'Processed {len(data)} items')\nEOF\n\npython3 \u002Ftmp\u002Fprocess.py\n```\n\n### Step 4: Verify File Operations\nAfter execution, verify the files were created\u002Fmodified correctly:\n\n```bash\nls -la\ncat output.txt\n```\n\n## Best Practices\n\n1. **Use Absolute or Relative Paths Explicitly**: Always specify file paths clearly; `os.getcwd()` helps confirm your working directory.\n\n2. **Handle Errors Gracefully**: Add try\u002Fexcept blocks to catch file I\u002FO errors:\n   ```python\n   try:\n       with open('file.txt', 'r') as f:\n           content = f.read()\n   except FileNotFoundError:\n       print('File not found')\n   ```\n\n3. **Use Here-Docs for Complex Scripts**: For scripts longer than a few lines, use bash here-documents to avoid escaping issues.\n\n4. **Clean Up Temporary Files**: If you create temporary scripts, consider removing them after execution.\n\n5. **Check Working Directory First**: Print `os.getcwd()` to confirm you're operating in the expected directory.\n\n## Common Use Cases\n\n- Reading configuration files from the workspace\n- Writing generated reports or outputs\n- Transforming data files (CSV, JSON, XML)\n- Batch processing multiple files\n- Generating structured documents (PDFs, spreadsheets)\n\n## Example: Processing Multiple Files\n\n```bash\npython3 -c \"\nimport os\nimport glob\n\nwork_dir = os.getcwd()\nfiles = glob.glob('*.txt')\n\nfor f in files:\n    with open(f, 'r') as file:\n        content = file.read()\n    # Process each file\n    with open(f'processed_{f}', 'w') as out:\n        out.write(content.strip().upper())\n\nprint(f'Processed {len(files)} files')\n\"\n```\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| File not found | Check `os.getcwd()` output; use absolute paths if needed |\n| Permission denied | Ensure the directory is writable; avoid protected system paths |\n| Encoding errors | Specify encoding explicitly: `open('file.txt', 'r', encoding='utf-8')` |\n| Multi-line script issues | Use here-doc (`\u003C\u003C 'EOF'`) instead of `-c` for complex scripts |",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Frun-shell-python-file-io","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":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add AG064\u002FOpenSpace --skill run-shell-python-file-io",{"tool":52,"command":53},"bunx","bunx skills add AG064\u002FOpenSpace --skill run-shell-python-file-io",{"tool":55,"command":56},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill run-shell-python-file-io","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Frun-shell-python-file-io\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},".skill_id","OTHER","其他",38,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Frun-shell-python-file-io\u002F.skill_id",[67,87,103,111,136,152],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":34},"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",[],[74,75,76,77,78,79,32,80,81,82,83,30,84,85,20,18,86],"write special chars ts check","check","write","filters","Existing","type-checking","errors","script","output","type","only","template","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":34},"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,76,85,96,97,20,18,98,99,100,101,102,32,81,31],"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":34},"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",[],[76,110,18,32,100,85,21,20,81],"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":117,"publishedAt":34},"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",[],[118,119,120,121,86,122,123,124,125,126,32,127,128,129,130,131,132,133,134,135],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":34},"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",[],[143,144,145,146,32,147,31,148,149,150,151],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":34},"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",[],[24,159,160,161,27,162,20,163,164,165],"verify","structure","verify directory structure","first","issues","diagnose","file access"]