[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBW1SP3H4R5EA8HT5Q0PCY":3,"skill-same:01M6XBW1SP3H4R5EA8HT5Q0PCY":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},"01M6XBW1SP3H4R5EA8HT5Q0PCY","python-debug-execution-911f17",null,"Debug Python script execution failures by capturing full tracebacks and verifying working directory","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-911f17\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 911f17","python debug execution","directory","python script","full","script","2026-11-10 10:12:30",false,"---\nname: python-debug-execution-911f17\ndescription: Debug Python script execution failures by capturing full tracebacks and verifying working directory\n---\n\n# Python Debug Execution\n\nThis skill provides a pattern for debugging Python script execution failures. It ensures you capture actual tracebacks instead of opaque errors and verifies the working directory before file operations.\n\n## Core Pattern\n\n### 1. Execute with Full Traceback Capture\n\nAlways run Python scripts with stderr redirected and exit code reported:\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\nThis pattern:\n- `2>&1` - Redirects stderr to stdout so all output (including tracebacks) is captured together\n- `echo Exit code: $?` - Reports the exit code to distinguish between successful runs and failures\n\n**Why this matters:** Opaque errors without tracebacks make it impossible to identify the root cause. The exit code tells you if the script succeeded (0) or failed (non-zero).\n\n### 2. Verify Working Directory Before File Operations\n\nBefore any file read\u002Fwrite operations in your Python script, add:\n\n```python\nimport os\nprint(f\"Current working directory: {os.getcwd()}\")\n```\n\nOr for debugging, add at the start of your script:\n\n```python\nimport os\nimport sys\n\n# Debug: show execution context\nprint(f\"Script path: {__file__}\")\nprint(f\"Working directory: {os.getcwd()}\")\nprint(f\"Python version: {sys.version}\")\n```\n\n**Why this matters:** File operations often fail due to incorrect assumptions about the current working directory. Verifying `os.getcwd()` helps diagnose path-related errors.\n\n## Usage Examples\n\n### Example 1: Running a Script with Debug Output\n\n```bash\n# Instead of:\npython3 analyze.py\n\n# Use:\npython3 analyze.py 2>&1 ; echo Exit code: $?\n```\n\n### Example 2: Script with Directory Verification\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\nimport pandas as pd\n\n# Verify execution context\nprint(f\"Working directory: {os.getcwd()}\")\n\n# Now safe to do file operations\ndata_path = \"data\u002Finput.csv\"\nprint(f\"Attempting to read: {data_path}\")\n\n# Check if file exists before reading\nif os.path.exists(data_path):\n    df = pd.read_csv(data_path)\n    print(f\"Successfully loaded {len(df)} rows\")\nelse:\n    print(f\"ERROR: File not found at {os.path.abspath(data_path)}\")\n    print(f\"Directory contents: {os.listdir('.')}\")\n```\n\n### Example 3: Debug-First Script Template\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Template for debuggable Python scripts.\"\"\"\n\nimport os\nimport sys\nimport traceback\n\ndef main():\n    # Debug: execution context\n    print(\"=\" * 50)\n    print(f\"Script: {__file__}\")\n    print(f\"Working directory: {os.getcwd()}\")\n    print(f\"Python: {sys.version}\")\n    print(\"=\" * 50)\n    \n    try:\n        # Your main logic here\n        pass\n    except Exception as e:\n        print(f\"ERROR: {type(e).__name__}: {e}\")\n        traceback.print_exc()\n        sys.exit(1)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Troubleshooting Checklist\n\nWhen a Python script fails:\n\n1. **Check the exit code** - Non-zero means failure\n2. **Read the full traceback** - Look for the actual error message and line number\n3. **Verify working directory** - Use `os.getcwd()` to confirm file paths are correct\n4. **Check file existence** - Use `os.path.exists()` before operations\n5. **Use absolute paths** - Consider `os.path.abspath()` for clarity\n\n## When to Apply This Pattern\n\n- Running any Python script from the command line\n- Debugging script execution failures in automated agents\n- Writing scripts that perform file I\u002FO operations\n- Creating reproducible execution environments","# Python Debug Execution\n\nThis skill provides a pattern for debugging Python script execution failures. It ensures you capture actual tracebacks instead of opaque errors and verifies the working directory before file operations.\n\n## Core Pattern\n\n### 1. Execute with Full Traceback Capture\n\nAlways run Python scripts with stderr redirected and exit code reported:\n\n```bash\npython3 script.py 2>&1 ; echo Exit code: $?\n```\n\nThis pattern:\n- `2>&1` - Redirects stderr to stdout so all output (including tracebacks) is captured together\n- `echo Exit code: $?` - Reports the exit code to distinguish between successful runs and failures\n\n**Why this matters:** Opaque errors without tracebacks make it impossible to identify the root cause. The exit code tells you if the script succeeded (0) or failed (non-zero).\n\n### 2. Verify Working Directory Before File Operations\n\nBefore any file read\u002Fwrite operations in your Python script, add:\n\n```python\nimport os\nprint(f\"Current working directory: {os.getcwd()}\")\n```\n\nOr for debugging, add at the start of your script:\n\n```python\nimport os\nimport sys\n\n# Debug: show execution context\nprint(f\"Script path: {__file__}\")\nprint(f\"Working directory: {os.getcwd()}\")\nprint(f\"Python version: {sys.version}\")\n```\n\n**Why this matters:** File operations often fail due to incorrect assumptions about the current working directory. Verifying `os.getcwd()` helps diagnose path-related errors.\n\n## Usage Examples\n\n### Example 1: Running a Script with Debug Output\n\n```bash\n# Instead of:\npython3 analyze.py\n\n# Use:\npython3 analyze.py 2>&1 ; echo Exit code: $?\n```\n\n### Example 2: Script with Directory Verification\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport os\nimport pandas as pd\n\n# Verify execution context\nprint(f\"Working directory: {os.getcwd()}\")\n\n# Now safe to do file operations\ndata_path = \"data\u002Finput.csv\"\nprint(f\"Attempting to read: {data_path}\")\n\n# Check if file exists before reading\nif os.path.exists(data_path):\n    df = pd.read_csv(data_path)\n    print(f\"Successfully loaded {len(df)} rows\")\nelse:\n    print(f\"ERROR: File not found at {os.path.abspath(data_path)}\")\n    print(f\"Directory contents: {os.listdir('.')}\")\n```\n\n### Example 3: Debug-First Script Template\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Template for debuggable Python scripts.\"\"\"\n\nimport os\nimport sys\nimport traceback\n\ndef main():\n    # Debug: execution context\n    print(\"=\" * 50)\n    print(f\"Script: {__file__}\")\n    print(f\"Working directory: {os.getcwd()}\")\n    print(f\"Python: {sys.version}\")\n    print(\"=\" * 50)\n    \n    try:\n        # Your main logic here\n        pass\n    except Exception as e:\n        print(f\"ERROR: {type(e).__name__}: {e}\")\n        traceback.print_exc()\n        sys.exit(1)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Troubleshooting Checklist\n\nWhen a Python script fails:\n\n1. **Check the exit code** - Non-zero means failure\n2. **Read the full traceback** - Look for the actual error message and line number\n3. **Verify working directory** - Use `os.getcwd()` to confirm file paths are correct\n4. **Check file existence** - Use `os.path.exists()` before operations\n5. **Use absolute paths** - Consider `os.path.abspath()` for clarity\n\n## When to Apply This Pattern\n\n- Running any Python script from the command line\n- Debugging script execution failures in automated agents\n- Writing scripts that perform file I\u002FO operations\n- Creating reproducible execution environments",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fpython-debug-execution-911f17","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-911f17",{"tool":49,"command":50},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-execution-911f17",{"tool":52,"command":53},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill python-debug-execution-911f17","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-execution-911f17\u002FSKILL.md",true,[57],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},".skill_id","OTHER","其他",43,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-execution-911f17\u002F.skill_id",[64,87,104,113,141,157],{"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,31,81,82,83,84,85,86,23],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","output","type","files","only","template","file",{"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":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",[],[94,95,72,86,96,23,97,98,99,100,101,85,102,103,76,79,31],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification","with",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"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",[],[111,72,76,112,31,98,85,86,23,79],"write special chars heredoc","shell",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":122,"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",[119],{"categoryNo":120,"categoryName":121,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000033","数据分析师",[123,124,125,126,127,74,128,129,130,131,132,79,133,134,135,136,137,138,139,140],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"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",[],[148,149,150,151,79,152,103,153,154,155,156],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"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",[],[28,164,165,166,167,168,86,169,170,171],"verify directory structure","structure","verify","access","first","issues","diagnose","file access"]