[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBW832NHAW70JRW48034TM":3,"skill-same:01M6XBW832NHAW70JRW48034TM":70},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":13,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M6XBW832NHAW70JRW48034TM","python-debug-pattern",null,"Debug Python script execution failures by capturing full output with exit codes and verifying working directory before file operations","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-pattern\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"python","debug","pattern","python debug pattern","directory","file","execution","file operations","operations","exit","python script","full","codes","output","with","script","2026-11-10 10:12:30",false,"---\nname: python-debug-pattern\ndescription: Debug Python script execution failures by capturing full output with exit codes and verifying working directory before file operations\n---\n\n# Python Debug Pattern\n\nThis skill provides a reusable pattern for debugging Python script execution failures. It ensures you capture actual tracebacks instead of opaque errors and verify the working directory before file operations.\n\n## Core Technique\n\n### 1. Execute Python Scripts with Full Error Capture\n\nWhen running Python scripts, always use this command pattern to surface actual tracebacks:\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\n**Why this works:**\n- `2>&1` redirects stderr to stdout, capturing both regular output and errors\n- `; echo Exit code: $?` displays the actual exit code after execution\n- This reveals the full Python traceback instead of opaque failure messages\n\n**Examples:**\n\n```bash\n# Good: Full error capture\npython3 process_data.py 2>&1 ; echo Exit code: $?\n\n# Bad: Opaque error (no stderr capture, no exit code)\npython3 process_data.py\n```\n\n### 2. Verify Working Directory Before File Operations\n\nBefore any file read\u002Fwrite operations in Python, verify the current working directory:\n\n```python\nimport os\n\n# At script start, log the working directory\nprint(f\"Working directory: {os.getcwd()}\")\n\n# For file operations, use absolute paths or log the resolved path\nfile_path = \"output\u002Fresult.csv\"\nabs_path = os.path.abspath(file_path)\nprint(f\"Writing to: {abs_path}\")\n```\n\n**Why this works:**\n- Many failures occur because scripts run from unexpected directories\n- Logging the working directory immediately surfaces path-related issues\n- Absolute paths prevent ambiguity in file operations\n\n**Full example script structure:**\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\nimport sys\n\ndef main():\n    # Debug: verify working directory\n    print(f\"Working directory: {os.getcwd()}\", file=sys.stderr)\n    \n    # Debug: list directory contents if dealing with files\n    print(f\"Directory contents: {os.listdir('.')}\", file=sys.stderr)\n    \n    # Your actual logic here\n    # ...\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## When to Apply This Pattern\n\n- Python script fails with an opaque error message\n- File operations (read\u002Fwrite) fail unexpectedly\n- Script works locally but fails in automated execution\n- Debugging CI\u002FCD pipeline failures\n- Investigating \"file not found\" or permission errors\n\n## Quick Checklist\n\n- [ ] Run script with `2>&1 ; echo Exit code: $?` pattern\n- [ ] Add `os.getcwd()` logging at script start\n- [ ] Use `os.path.abspath()` for file paths\n- [ ] Log directory contents with `os.listdir('.')` if relevant\n- [ ] Check for missing dependencies (capture full traceback)\n\n## Common Failure Modes This Pattern Surfaces\n\n| Symptom | Without Pattern | With Pattern |\n|---------|-----------------|--------------|\n| File not found | \"Error: failed\" | Full traceback showing exact path attempted |\n| Permission denied | Script exits silently | stderr shows permission error |\n| Missing module | Opaque exit | ImportError with module name |\n| Wrong directory | Confusing path errors | cwd logged, reveals directory mismatch |","# Python Debug Pattern\n\nThis skill provides a reusable pattern for debugging Python script execution failures. It ensures you capture actual tracebacks instead of opaque errors and verify the working directory before file operations.\n\n## Core Technique\n\n### 1. Execute Python Scripts with Full Error Capture\n\nWhen running Python scripts, always use this command pattern to surface actual tracebacks:\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\n**Why this works:**\n- `2>&1` redirects stderr to stdout, capturing both regular output and errors\n- `; echo Exit code: $?` displays the actual exit code after execution\n- This reveals the full Python traceback instead of opaque failure messages\n\n**Examples:**\n\n```bash\n# Good: Full error capture\npython3 process_data.py 2>&1 ; echo Exit code: $?\n\n# Bad: Opaque error (no stderr capture, no exit code)\npython3 process_data.py\n```\n\n### 2. Verify Working Directory Before File Operations\n\nBefore any file read\u002Fwrite operations in Python, verify the current working directory:\n\n```python\nimport os\n\n# At script start, log the working directory\nprint(f\"Working directory: {os.getcwd()}\")\n\n# For file operations, use absolute paths or log the resolved path\nfile_path = \"output\u002Fresult.csv\"\nabs_path = os.path.abspath(file_path)\nprint(f\"Writing to: {abs_path}\")\n```\n\n**Why this works:**\n- Many failures occur because scripts run from unexpected directories\n- Logging the working directory immediately surfaces path-related issues\n- Absolute paths prevent ambiguity in file operations\n\n**Full example script structure:**\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\nimport sys\n\ndef main():\n    # Debug: verify working directory\n    print(f\"Working directory: {os.getcwd()}\", file=sys.stderr)\n    \n    # Debug: list directory contents if dealing with files\n    print(f\"Directory contents: {os.listdir('.')}\", file=sys.stderr)\n    \n    # Your actual logic here\n    # ...\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## When to Apply This Pattern\n\n- Python script fails with an opaque error message\n- File operations (read\u002Fwrite) fail unexpectedly\n- Script works locally but fails in automated execution\n- Debugging CI\u002FCD pipeline failures\n- Investigating \"file not found\" or permission errors\n\n## Quick Checklist\n\n- [ ] Run script with `2>&1 ; echo Exit code: $?` pattern\n- [ ] Add `os.getcwd()` logging at script start\n- [ ] Use `os.path.abspath()` for file paths\n- [ ] Log directory contents with `os.listdir('.')` if relevant\n- [ ] Check for missing dependencies (capture full traceback)\n\n## Common Failure Modes This Pattern Surfaces\n\n| Symptom | Without Pattern | With Pattern |\n|---------|-----------------|--------------|\n| File not found | \"Error: failed\" | Full traceback showing exact path attempted |\n| Permission denied | Script exits silently | stderr shows permission error |\n| Missing module | Opaque exit | ImportError with module name |\n| Wrong directory | Confusing path errors | cwd logged, reveals directory mismatch |",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fpython-debug-pattern","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":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-pattern",{"tool":56,"command":57},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-pattern",{"tool":59,"command":60},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-pattern","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-pattern\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},".skill_id","OTHER","其他",34,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-pattern\u002F.skill_id",[71,92,108,117,145,161],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":39},"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",[],[78,79,80,81,82,83,84,85,86,87,38,36,88,89,90,91,28,23],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","type","files","only","template",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":39},"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",[],[99,100,79,28,101,23,102,103,104,105,106,91,107,37,83,86,38],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":39},"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",[],[115,79,83,116,38,103,91,28,23,86],"write special chars heredoc","shell",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":126,"publishedAt":39},"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",[123],{"categoryNo":124,"categoryName":125,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000033","数据分析师",[127,128,129,130,131,81,132,133,134,135,136,86,137,138,139,140,141,142,143,144],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":39},"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",[],[152,153,154,155,86,156,37,157,158,159,160],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":39},"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,168,169,170,171,172,28,173,174,175],"verify directory structure","structure","verify","access","first","issues","diagnose","file access"]