[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJT99CCZH3W2FVEKYG0N4K":3,"skill-same:01M6KJT99CCZH3W2FVEKYG0N4K":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"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":42,"updatedAt":43,"install":44,"resources":57},"01M6KJT99CCZH3W2FVEKYG0N4K","python-debug-execution-911f17",null,"Debug Python script execution failures by capturing full tracebacks and verifying working directory","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\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","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fpython-debug-execution-911f17","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think about is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add AG064\u002FOpenSpace --skill python-debug-execution-911f17",{"tool":50,"command":51},"bunx","bunx skills add AG064\u002FOpenSpace --skill python-debug-execution-911f17",{"tool":53,"command":54},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill python-debug-execution-911f17","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-execution-911f17\u002FSKILL.md",true,[58],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},".skill_id","OTHER","其他",43,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fpython-debug-execution-911f17\u002F.skill_id",[65,87,104,113,141,157],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":32},"01M6KKMPWA0B5SCCH766F8M5EA","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[72,73,74,75,76,77,78,79,31,80,81,82,83,84,85,23,86],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","output","type","files","only","template","file","typescript",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":32},"01M6KKMJXVBNVEY3TRK055F4A7","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[94,95,74,84,96,97,85,23,98,99,100,101,102,78,31,103],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper","with",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":32},"01M6KKMEGX9M9NC105J0W3Q5B9","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[74,111,23,78,100,84,112,85,31],"write special chars heredoc","shell",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":122,"publishedAt":32},"01M6KKM8EJ2AATVHZBNB916WT0","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[119],{"categoryNo":120,"categoryName":121,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000033","数据分析师",[123,124,125,126,86,127,128,129,130,131,78,132,133,134,135,136,137,138,139,140],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":32},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[148,149,150,151,78,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":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":32},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[28,164,165,166,167,168,85,169,170,171],"verify","structure","verify directory structure","access","first","issues","diagnose","file access"]