[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBW50MZV6M8K6KC6C91XPF":3,"skill-same:01M6XBW50MZV6M8K6KC6C91XPF":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},"01M6XBW50MZV6M8K6KC6C91XPF","python-debug-execution",null,"Debug Python scripts with proper error surfacing and working directory verification","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\u002Fpython-debug-execution\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[23,24,25,26,27,28,29,30,31],"python","debug","execution","python debug execution","directory","verification","scripts","error","with","2026-11-10 10:12:30",false,"---\nname: python-debug-execution\ndescription: Debug Python scripts with proper error surfacing and working directory verification\n---\n\n# Python Debug Execution Pattern\n\nWhen executing Python scripts that may fail, use this pattern to surface clear error information and diagnose issues effectively.\n\n## Core Technique\n\n### 1. Execute with Full Error Output\n\nAlways run Python scripts with stderr redirected to stdout and echo the exit code:\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\n**Why this works:**\n- `2>&1` captures both stdout and stderr, ensuring tracebacks are visible\n- `echo Exit code: $?` reveals the actual exit status for debugging\n- Avoids opaque \"command failed\" errors that hide the real cause\n\n### 2. Verify Working Directory in Script\n\nBefore any file operations in Python scripts, add working directory verification:\n\n```python\nimport os\n\n# At the start of your script or before file operations\nprint(f\"Current working directory: {os.getcwd()}\")\n\n# For debugging, also list directory contents\nprint(f\"Directory contents: {os.listdir('.')}\")\n```\n\n**Why this works:**\n- File not found errors often stem from incorrect working directory assumptions\n- Makes path-related failures immediately diagnosable\n- Confirms the execution context matches expectations\n\n## Complete Debugging Workflow\n\n### Step 1: Add Diagnostic Code to Script\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\nimport sys\n\ndef main():\n    # Diagnostic: verify execution context\n    print(f\"Working directory: {os.getcwd()}\")\n    print(f\"Python version: {sys.version}\")\n    print(f\"Directory listing: {os.listdir('.')}\")\n    \n    # Your actual logic here\n    # ...\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Step 2: Execute with Full Error Capture\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\n### Step 3: Analyze Output\n\nLook for:\n- Traceback messages (indicate code errors)\n- Exit code (0 = success, non-zero = failure)\n- Working directory confirmation\n- Missing file\u002Fdirectory errors\n\n## Common Failure Patterns\n\n| Symptom | Likely Cause | Debug Clue |\n|---------|-------------|------------|\n| FileNotFoundError | Wrong working directory | Check `os.getcwd()` output |\n| ModuleNotFoundError | Missing dependencies | Traceback shows import path |\n| PermissionError | File access issues | Traceback shows file path |\n| Silent failure (exit 0, no output) | Logic bug, not crash | Add print statements |\n\n## When to Use This Pattern\n\n- Running Python scripts in automated\u002Fagent contexts\n- Debugging scripts that interact with files\n- Troubleshooting CI\u002FCD pipeline failures\n- Any scenario where script output may be truncated or hidden","# Python Debug Execution Pattern\n\nWhen executing Python scripts that may fail, use this pattern to surface clear error information and diagnose issues effectively.\n\n## Core Technique\n\n### 1. Execute with Full Error Output\n\nAlways run Python scripts with stderr redirected to stdout and echo the exit code:\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\n**Why this works:**\n- `2>&1` captures both stdout and stderr, ensuring tracebacks are visible\n- `echo Exit code: $?` reveals the actual exit status for debugging\n- Avoids opaque \"command failed\" errors that hide the real cause\n\n### 2. Verify Working Directory in Script\n\nBefore any file operations in Python scripts, add working directory verification:\n\n```python\nimport os\n\n# At the start of your script or before file operations\nprint(f\"Current working directory: {os.getcwd()}\")\n\n# For debugging, also list directory contents\nprint(f\"Directory contents: {os.listdir('.')}\")\n```\n\n**Why this works:**\n- File not found errors often stem from incorrect working directory assumptions\n- Makes path-related failures immediately diagnosable\n- Confirms the execution context matches expectations\n\n## Complete Debugging Workflow\n\n### Step 1: Add Diagnostic Code to Script\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\nimport sys\n\ndef main():\n    # Diagnostic: verify execution context\n    print(f\"Working directory: {os.getcwd()}\")\n    print(f\"Python version: {sys.version}\")\n    print(f\"Directory listing: {os.listdir('.')}\")\n    \n    # Your actual logic here\n    # ...\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Step 2: Execute with Full Error Capture\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\n### Step 3: Analyze Output\n\nLook for:\n- Traceback messages (indicate code errors)\n- Exit code (0 = success, non-zero = failure)\n- Working directory confirmation\n- Missing file\u002Fdirectory errors\n\n## Common Failure Patterns\n\n| Symptom | Likely Cause | Debug Clue |\n|---------|-------------|------------|\n| FileNotFoundError | Wrong working directory | Check `os.getcwd()` output |\n| ModuleNotFoundError | Missing dependencies | Traceback shows import path |\n| PermissionError | File access issues | Traceback shows file path |\n| Silent failure (exit 0, no output) | Logic bug, not crash | Add print statements |\n\n## When to Use This Pattern\n\n- Running Python scripts in automated\u002Fagent contexts\n- Debugging scripts that interact with files\n- Troubleshooting CI\u002FCD pipeline failures\n- Any scenario where script output may be truncated or hidden",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fpython-debug-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":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-execution",{"tool":49,"command":50},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-execution",{"tool":52,"command":53},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-execution","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-execution\u002FSKILL.md",true,[57],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},".skill_id","OTHER","其他",36,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-execution\u002F.skill_id",[64,88,102,111,139,155],{"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,23],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","file",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"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",[],[95,96,72,87,97,23,98,99,29,100,101,86,28,31,76,79,81],"readback","write special chars readback","helper","post","via","cleanup","read",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"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",[],[109,72,76,110,81,99,86,87,23,79],"write special chars heredoc","shell",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":120,"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",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000033","数据分析师",[121,122,123,124,125,74,126,127,128,129,130,79,131,132,133,134,135,136,137,138],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"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",[],[146,147,148,149,79,150,31,151,152,153,154],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"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",[],[27,162,163,164,165,166,87,167,168,169],"verify directory structure","structure","verify","access","first","issues","diagnose","file access"]