[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBEHAJ12B18WWEW3P7BKTE":3,"skill-same:01M6XBEHAJ12B18WWEW3P7BKTE":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":22,"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},"01M6XBEHAJ12B18WWEW3P7BKTE","code-execution-fallback",null,"Handle code execution failures with fallback strategies and anchored workspace paths","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\u002Fcode-execution-fallback\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[23,24,25,26,27,28,29,30,31],"code","execution","fallback","code execution","code execution fallback","workspace","strategies","paths","with","2026-11-10 10:12:30",false,"---\nname: code-execution-fallback\ndescription: Handle code execution failures with fallback strategies and anchored workspace paths\n---\n\n# Code Execution Fallback & Workspace Anchoring\n\nThis skill provides a robust pattern for executing code when the primary method fails, combined with proper workspace path management to prevent file location errors.\n\n## Core Techniques\n\n### 1. Workspace Path Anchoring\n\nAlways establish and verify your working directory at the start of any task:\n\n```python\n# At the beginning of any code execution\nimport os\nworkspace_path = os.getcwd()\nprint(f\"Working directory: {workspace_path}\")\n```\n\n```bash\n# In shell scripts\npwd\necho \"Current directory: $(pwd)\"\n```\n\n**Why:** Prevents files from being written to unexpected locations when agents switch between tools.\n\n### 2. Execution Fallback Ladder\n\nWhen `execute_code_sandbox` fails, follow this escalation pattern:\n\n#### Level 1: Retry with Simpler Code\n- Simplify the code structure\n- Remove complex dependencies\n- Add explicit error handling\n\n#### Level 2: Use `run_shell` with Heredoc\nWhen sandbox execution repeatedly fails, switch to shell execution:\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport os\nimport pandas as pd\n\n# Your code here\ndata = {\"col1\": [1, 2, 3], \"col2\": [\"a\", \"b\", \"c\"]}\ndf = pd.DataFrame(data)\ndf.to_csv(\"output.csv\", index=False)\nprint(\"File written successfully\")\nEOF\n```\n\n**Key points:**\n- Use `\u003C\u003C 'EOF'` (quoted) to prevent variable expansion\n- Include all imports and dependencies inline\n- Add explicit success\u002Ffailure messages\n\n#### Level 3: Delegate to `shell_agent`\nFor complex multi-step tasks with error recovery needs:\n\n```\nTask: Create a data processing pipeline that reads CSV, transforms data, and outputs Excel\nRequirements:\n- Handle missing values\n- Apply transformations\n- Write to .\u002Foutput\u002F directory\n- Retry on transient errors\n```\n\n### 3. Explicit Path Management\n\nAlways use absolute or explicitly relative paths:\n\n```python\n# BAD - relies on implicit working directory\ndf.to_csv(\"output\u002Fdata.csv\")\n\n# GOOD - explicit path anchoring\nimport os\nbase_path = os.getcwd()\noutput_dir = os.path.join(base_path, \"output\")\nos.makedirs(output_dir, exist_ok=True)\ndf.to_csv(os.path.join(output_dir, \"data.csv\"))\n```\n\n```bash\n# BAD\ncd some_dir && python script.py\n\n# GOOD\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\ncd \"$SCRIPT_DIR\"\npython script.py\n```\n\n## Decision Tree\n\n```\nexecute_code_sandbox fails?\n├── Yes, with syntax\u002Fimport errors → Fix code, retry Level 1\n├── Yes, with timeout\u002Fresource errors → Use Level 2 (run_shell heredoc)\n├── Yes, with unknown\u002Funclear errors → Use Level 3 (shell_agent)\n└── No, success → Verify output file exists at expected path\n```\n\n## Common Failure Scenarios & Solutions\n\n| Error Type | Likely Cause | Recommended Fallback |\n|------------|--------------|---------------------|\n| ModuleNotFoundError | Missing packages | run_shell with pip install first |\n| Timeout | Long-running operation | shell_agent with progress tracking |\n| PermissionError | Wrong directory | Verify workspace path, use explicit paths |\n| Unknown error | Sandbox limitations | run_shell or shell_agent |\n\n## Example: Robust File Generation\n\n```python\n# Step 1: Anchor workspace\nimport os\nworkspace = os.getcwd()\nprint(f\"Workspace: {workspace}\")\n\n# Step 2: Create output directory explicitly\noutput_path = os.path.join(workspace, \"deliverables\")\nos.makedirs(output_path, exist_ok=True)\n\n# Step 3: Generate content with error handling\ntry:\n    # Your generation logic here\n    with open(os.path.join(output_path, \"report.txt\"), \"w\") as f:\n        f.write(\"Content here\")\n    print(f\"Success: File written to {output_path}\")\nexcept Exception as e:\n    print(f\"Error: {e}\")\n    # Signal to escalate to run_shell or shell_agent\n    raise\n```\n\n## Anti-Patterns to Avoid\n\n- ❌ Assuming current directory without verification\n- ❌ Using relative paths like `..\u002Foutput\u002Ffile.txt` without context\n- ❌ Repeatedly retrying failed `execute_code_sandbox` without changing approach\n- ❌ Not checking if output files exist after generation\n- ❌ Mixing implicit and explicit path styles in same task\n\n## Verification Checklist\n\nAfter any code execution:\n- [ ] Confirm working directory was verified at start\n- [ ] Confirm output files exist at expected paths\n- [ ] Confirm file contents are non-empty and valid\n- [ ] If execution failed, escalate to next fallback level within 2 retries","# Code Execution Fallback & Workspace Anchoring\n\nThis skill provides a robust pattern for executing code when the primary method fails, combined with proper workspace path management to prevent file location errors.\n\n## Core Techniques\n\n### 1. Workspace Path Anchoring\n\nAlways establish and verify your working directory at the start of any task:\n\n```python\n# At the beginning of any code execution\nimport os\nworkspace_path = os.getcwd()\nprint(f\"Working directory: {workspace_path}\")\n```\n\n```bash\n# In shell scripts\npwd\necho \"Current directory: $(pwd)\"\n```\n\n**Why:** Prevents files from being written to unexpected locations when agents switch between tools.\n\n### 2. Execution Fallback Ladder\n\nWhen `execute_code_sandbox` fails, follow this escalation pattern:\n\n#### Level 1: Retry with Simpler Code\n- Simplify the code structure\n- Remove complex dependencies\n- Add explicit error handling\n\n#### Level 2: Use `run_shell` with Heredoc\nWhen sandbox execution repeatedly fails, switch to shell execution:\n\n```bash\npython3 \u003C\u003C 'EOF'\nimport os\nimport pandas as pd\n\n# Your code here\ndata = {\"col1\": [1, 2, 3], \"col2\": [\"a\", \"b\", \"c\"]}\ndf = pd.DataFrame(data)\ndf.to_csv(\"output.csv\", index=False)\nprint(\"File written successfully\")\nEOF\n```\n\n**Key points:**\n- Use `\u003C\u003C 'EOF'` (quoted) to prevent variable expansion\n- Include all imports and dependencies inline\n- Add explicit success\u002Ffailure messages\n\n#### Level 3: Delegate to `shell_agent`\nFor complex multi-step tasks with error recovery needs:\n\n```\nTask: Create a data processing pipeline that reads CSV, transforms data, and outputs Excel\nRequirements:\n- Handle missing values\n- Apply transformations\n- Write to .\u002Foutput\u002F directory\n- Retry on transient errors\n```\n\n### 3. Explicit Path Management\n\nAlways use absolute or explicitly relative paths:\n\n```python\n# BAD - relies on implicit working directory\ndf.to_csv(\"output\u002Fdata.csv\")\n\n# GOOD - explicit path anchoring\nimport os\nbase_path = os.getcwd()\noutput_dir = os.path.join(base_path, \"output\")\nos.makedirs(output_dir, exist_ok=True)\ndf.to_csv(os.path.join(output_dir, \"data.csv\"))\n```\n\n```bash\n# BAD\ncd some_dir && python script.py\n\n# GOOD\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\ncd \"$SCRIPT_DIR\"\npython script.py\n```\n\n## Decision Tree\n\n```\nexecute_code_sandbox fails?\n├── Yes, with syntax\u002Fimport errors → Fix code, retry Level 1\n├── Yes, with timeout\u002Fresource errors → Use Level 2 (run_shell heredoc)\n├── Yes, with unknown\u002Funclear errors → Use Level 3 (shell_agent)\n└── No, success → Verify output file exists at expected path\n```\n\n## Common Failure Scenarios & Solutions\n\n| Error Type | Likely Cause | Recommended Fallback |\n|------------|--------------|---------------------|\n| ModuleNotFoundError | Missing packages | run_shell with pip install first |\n| Timeout | Long-running operation | shell_agent with progress tracking |\n| PermissionError | Wrong directory | Verify workspace path, use explicit paths |\n| Unknown error | Sandbox limitations | run_shell or shell_agent |\n\n## Example: Robust File Generation\n\n```python\n# Step 1: Anchor workspace\nimport os\nworkspace = os.getcwd()\nprint(f\"Workspace: {workspace}\")\n\n# Step 2: Create output directory explicitly\noutput_path = os.path.join(workspace, \"deliverables\")\nos.makedirs(output_path, exist_ok=True)\n\n# Step 3: Generate content with error handling\ntry:\n    # Your generation logic here\n    with open(os.path.join(output_path, \"report.txt\"), \"w\") as f:\n        f.write(\"Content here\")\n    print(f\"Success: File written to {output_path}\")\nexcept Exception as e:\n    print(f\"Error: {e}\")\n    # Signal to escalate to run_shell or shell_agent\n    raise\n```\n\n## Anti-Patterns to Avoid\n\n- ❌ Assuming current directory without verification\n- ❌ Using relative paths like `..\u002Foutput\u002Ffile.txt` without context\n- ❌ Repeatedly retrying failed `execute_code_sandbox` without changing approach\n- ❌ Not checking if output files exist after generation\n- ❌ Mixing implicit and explicit path styles in same task\n\n## Verification Checklist\n\nAfter any code execution:\n- [ ] Confirm working directory was verified at start\n- [ ] Confirm output files exist at expected paths\n- [ ] Confirm file contents are non-empty and valid\n- [ ] If execution failed, escalate to next fallback level within 2 retries",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fcode-execution-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 code-execution-fallback",{"tool":49,"command":50},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill code-execution-fallback",{"tool":52,"command":53},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill code-execution-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fcode-execution-fallback\u002FSKILL.md",true,[57],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},".skill_id","OTHER","其他",37,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fcode-execution-fallback\u002F.skill_id",[64,89,105,114,142,158],{"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,88],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","python",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"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",[],[96,97,72,87,98,88,99,100,101,102,103,86,104,31,76,79,81],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"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",[],[112,72,76,113,81,100,86,87,88,79],"write special chars heredoc","shell",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":123,"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",[120],{"categoryNo":121,"categoryName":122,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000033","数据分析师",[124,125,126,127,128,74,129,130,131,132,133,79,134,135,136,137,138,139,140,141],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"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",[],[149,150,151,152,79,153,31,154,155,156,157],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"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",[],[165,166,167,168,169,170,87,171,172,173],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]