[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBF0ZX535Y886ZN4NGN1NQ":3,"skill-same:01M6XBF0ZX535Y886ZN4NGN1NQ":61},{"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":17,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":13,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":40,"install":41,"resources":54},"01M6XBF0ZX535Y886ZN4NGN1NQ","debug-sandbox-execution",null,"Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs","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\u002Fdebug-sandbox-execution\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29],"sandbox","debug","execution","debug sandbox execution","python","code","functions","code execution","python code","traces","outputs","failing","2026-11-10 10:12:30",false,"---\nname: debug-sandbox-execution\ndescription: Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs\n---\n\n# Debug Sandbox Execution Failures\n\nWhen `execute_code_sandbox` fails with unknown errors or incomplete output, use this debugging pattern to identify the root cause and recover incrementally.\n\n## Problem\n\nThe `execute_code_sandbox` tool may fail silently, truncate output, or produce opaque errors. Complex scripts with multiple file outputs are especially prone to partial failures.\n\n## Solution\n\nUse a three-phase debugging approach:\n\n### Phase 1: Capture Partial Execution Traces\n\nWhen a sandbox execution fails, rerun the code using `run_shell` with output piping to capture whatever output is produced before the failure:\n\n```bash\npython your_script.py 2>&1 | head -100\n```\n\nThis reveals:\n- Which functions\u002Fsteps executed successfully\n- Where the failure occurred\n- Any error messages that were suppressed\n\n### Phase 2: Isolate Failing Functions\n\nBreak the script into smaller, testable units. Execute each function or code block independently:\n\n```python\n# Test individual components\nif __name__ == \"__main__\":\n    # Step 1: Test imports\n    import numpy as np\n    print(\"Imports OK\")\n    \n    # Step 2: Test function A in isolation\n    result_a = function_a()\n    print(f\"Function A: {result_a}\")\n    \n    # Step 3: Test function B\n    result_b = function_b(result_a)\n    print(f\"Function B: {result_b}\")\n```\n\nRun each section with `execute_code_sandbox` separately to identify which component fails.\n\n### Phase 3: Incremental Output Generation\n\nGenerate output files one at a time, verifying each before proceeding:\n\n```python\nimport numpy as np\nimport soundfile as sf\n\n# Generate and save file 1\naudio1 = np.random.randn(48000 * 10).astype(np.float32)\nsf.write('output_01.wav', audio1, 48000, subtype='FLOAT')\n\n# Verify file 1 exists and has expected properties\nimport os\nassert os.path.exists('output_01.wav'), \"File 1 not created\"\n\n# Generate and save file 2\naudio2 = np.random.randn(48000 * 10).astype(np.float32)\nsf.write('output_02.wav', audio2, 48000, subtype='FLOAT')\n\n# Verify file 2\nassert os.path.exists('output_02.wav'), \"File 2 not created\"\n```\n\n## Example Workflow\n\n1. **Initial attempt**: Run full script with `execute_code_sandbox`\n2. **On failure**: Rerun with `run_shell` and `| head -100` to see partial output\n3. **Identify breakpoint**: Find the last successful operation\n4. **Split script**: Create separate scripts for each major section\n5. **Test incrementally**: Run each section, verify outputs, proceed to next\n6. **Combine successful sections**: Once all pieces work, combine into final script\n\n## Best Practices\n\n- **Always verify file creation** immediately after writing: `assert os.path.exists(path)`\n- **Check file properties** (size, duration, format) before assuming success\n- **Use print statements liberally** to mark progress through the script\n- **Save intermediate outputs** so failures don't require restarting from scratch\n- **Test audio\u002Fvideo generation** with short samples first (1-2 seconds) before full-length content\n\n## When to Use\n\n- Complex scripts with multiple file outputs\n- Audio\u002Fvideo generation pipelines\n- Scripts with external library dependencies\n- Any `execute_code_sandbox` call that produces incomplete or no output","# Debug Sandbox Execution Failures\n\nWhen `execute_code_sandbox` fails with unknown errors or incomplete output, use this debugging pattern to identify the root cause and recover incrementally.\n\n## Problem\n\nThe `execute_code_sandbox` tool may fail silently, truncate output, or produce opaque errors. Complex scripts with multiple file outputs are especially prone to partial failures.\n\n## Solution\n\nUse a three-phase debugging approach:\n\n### Phase 1: Capture Partial Execution Traces\n\nWhen a sandbox execution fails, rerun the code using `run_shell` with output piping to capture whatever output is produced before the failure:\n\n```bash\npython your_script.py 2>&1 | head -100\n```\n\nThis reveals:\n- Which functions\u002Fsteps executed successfully\n- Where the failure occurred\n- Any error messages that were suppressed\n\n### Phase 2: Isolate Failing Functions\n\nBreak the script into smaller, testable units. Execute each function or code block independently:\n\n```python\n# Test individual components\nif __name__ == \"__main__\":\n    # Step 1: Test imports\n    import numpy as np\n    print(\"Imports OK\")\n    \n    # Step 2: Test function A in isolation\n    result_a = function_a()\n    print(f\"Function A: {result_a}\")\n    \n    # Step 3: Test function B\n    result_b = function_b(result_a)\n    print(f\"Function B: {result_b}\")\n```\n\nRun each section with `execute_code_sandbox` separately to identify which component fails.\n\n### Phase 3: Incremental Output Generation\n\nGenerate output files one at a time, verifying each before proceeding:\n\n```python\nimport numpy as np\nimport soundfile as sf\n\n# Generate and save file 1\naudio1 = np.random.randn(48000 * 10).astype(np.float32)\nsf.write('output_01.wav', audio1, 48000, subtype='FLOAT')\n\n# Verify file 1 exists and has expected properties\nimport os\nassert os.path.exists('output_01.wav'), \"File 1 not created\"\n\n# Generate and save file 2\naudio2 = np.random.randn(48000 * 10).astype(np.float32)\nsf.write('output_02.wav', audio2, 48000, subtype='FLOAT')\n\n# Verify file 2\nassert os.path.exists('output_02.wav'), \"File 2 not created\"\n```\n\n## Example Workflow\n\n1. **Initial attempt**: Run full script with `execute_code_sandbox`\n2. **On failure**: Rerun with `run_shell` and `| head -100` to see partial output\n3. **Identify breakpoint**: Find the last successful operation\n4. **Split script**: Create separate scripts for each major section\n5. **Test incrementally**: Run each section, verify outputs, proceed to next\n6. **Combine successful sections**: Once all pieces work, combine into final script\n\n## Best Practices\n\n- **Always verify file creation** immediately after writing: `assert os.path.exists(path)`\n- **Check file properties** (size, duration, format) before assuming success\n- **Use print statements liberally** to mark progress through the script\n- **Save intermediate outputs** so failures don't require restarting from scratch\n- **Test audio\u002Fvideo generation** with short samples first (1-2 seconds) before full-length content\n\n## When to Use\n\n- Complex scripts with multiple file outputs\n- Audio\u002Fvideo generation pipelines\n- Scripts with external library dependencies\n- Any `execute_code_sandbox` call that produces incomplete or no output",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fdebug-sandbox-execution","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":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill debug-sandbox-execution",{"tool":47,"command":48},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill debug-sandbox-execution",{"tool":50,"command":51},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill debug-sandbox-execution","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fdebug-sandbox-execution\u002FSKILL.md",true,[55],{"path":56,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":59,"sourceHtmlUrl":60},".skill_id","OTHER","其他",37,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fdebug-sandbox-execution\u002F.skill_id",[62,86,103,112,137,153],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":30},"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",[],[69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,22],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","file",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":30},"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",[],[93,94,70,85,95,22,96,97,98,99,100,84,101,102,74,77,79],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification","with",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":30},"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",[],[110,70,74,111,79,97,84,85,22,77],"write special chars heredoc","shell",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":30},"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",[],[119,120,121,122,123,72,124,125,126,127,128,77,129,130,131,132,133,134,135,136],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":30},"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",[],[144,145,146,147,77,148,102,149,150,151,152],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":30},"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",[],[160,161,162,163,164,165,85,166,167,168],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]