[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBW832NHAW70JRW48034TM":3,"skill-same:01M6XBW832NHAW70JRW48034TM":65},{"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":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":6,"updatedAt":44,"install":45,"resources":58},"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",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"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":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-pattern",{"tool":51,"command":52},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-pattern",{"tool":54,"command":55},"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,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},".skill_id","OTHER","其他",34,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-pattern\u002F.skill_id",[66,87,103,112,137,153],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":34},"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",[],[73,74,75,76,77,78,79,80,81,82,33,31,83,84,85,86,23,18],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","type","files","only","template",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":34},"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",[],[94,95,74,23,96,18,97,98,99,100,101,86,102,32,78,81,33],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"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":34},"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,74,78,111,33,98,86,23,18,81],"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":34},"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,76,124,125,126,127,128,81,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":34},"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,81,148,32,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":34},"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",[],[22,160,161,162,163,164,23,165,166,167],"verify directory structure","structure","verify","access","first","issues","diagnose","file access"]