[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XBK9S2NDW9QX842ACVX1ZM":3,"skill-same:01M6XBK9S2NDW9QX842ACVX1ZM":64},{"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":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":13,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M6XBK9S2NDW9QX842ACVX1ZM","excel-heredoc-workaround",null,"Create Excel files with openpyxl by falling back to run_shell with inline Python heredoc when execute_code_sandbox fails","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\u002Fexcel-heredoc-workaround\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"xlsx","excel heredoc workaround","python","sandbox","create","run","code","shell","execute","files","back","with","openpyxl","inline","when","2026-11-10 10:12:30",false,"---\nname: excel-heredoc-workaround\ndescription: Create Excel files with openpyxl by falling back to run_shell with inline Python heredoc when execute_code_sandbox fails\n---\n\n# Excel Heredoc Workaround\n\n## Purpose\n\nWhen creating Excel files with openpyxl, `execute_code_sandbox` may fail due to environment issues. This skill provides a robust workaround: fall back to `run_shell` with inline Python heredoc scripts to create properly formatted spreadsheets with styling.\n\n## When to Use\n\n- You need to create `.xlsx` files with openpyxl\n- `execute_code_sandbox` fails with openpyxl-related errors\n- You need styling, formatting, or complex spreadsheet features\n- Direct shell execution with Python heredoc is available\n\n## Step-by-Step Instructions\n\n### Step 1: Attempt execute_code_sandbox First\n\nTry creating the Excel file using `execute_code_sandbox`:\n\n```python\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill\n\nwb = Workbook()\nws = wb.active\nws.title = \"Data\"\n\n# Add data and styling\nws['A1'] = \"Header\"\nws['A1'].font = Font(bold=True)\n\nwb.save(\"output.xlsx\")\nprint(\"ARTIFACT_PATH:output.xlsx\")\n```\n\n### Step 2: If Sandbox Fails, Use run_shell with Heredoc\n\nWhen `execute_code_sandbox` fails, switch to `run_shell` with a Python heredoc:\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill, Border, Side\n\n# Create workbook\nwb = Workbook()\nws = wb.active\nws.title = \"Schedule\"\n\n# Add headers with styling\nheaders = [\"Task\", \"Date\", \"Status\", \"Priority\"]\nfor col, header in enumerate(headers, 1):\n    cell = ws.cell(row=1, column=col, value=header)\n    cell.font = Font(bold=True, size=12)\n    cell.fill = PatternFill(start_color=\"4472C4\", end_color=\"4472C4\", fill_type=\"solid\")\n    cell.font = Font(bold=True, color=\"FFFFFF\")\n    cell.alignment = Alignment(horizontal=\"center\")\n\n# Add data rows\ndata = [\n    [\"Cleanup Zone A\", \"2024-01-15\", \"Pending\", \"High\"],\n    [\"Cleanup Zone B\", \"2024-01-16\", \"Complete\", \"Medium\"],\n]\n\nfor row_idx, row_data in enumerate(data, 2):\n    for col_idx, value in enumerate(row_data, 1):\n        cell = ws.cell(row=row_idx, column=col_idx, value=value)\n        cell.alignment = Alignment(horizontal=\"left\")\n\n# Adjust column widths\nfor col in ws.columns:\n    max_length = 0\n    column = col[0].column_letter\n    for cell in col:\n        try:\n            if len(str(cell.value)) > max_length:\n                max_length = len(str(cell.value))\n        except:\n            pass\n    ws.column_dimensions[column].width = max_length + 2\n\n# Save the file\nwb.save(\"Cleanup_Schedule.xlsx\")\nprint(\"Created Cleanup_Schedule.xlsx successfully\")\nEOF\n```\n\n### Step 3: Verify File Creation\n\nAfter running the heredoc script, verify the file was created:\n\n```bash\nls -lh *.xlsx\n```\n\n### Step 4: Optional - Read Back to Confirm\n\nUse `read_file` to confirm the Excel file is valid:\n\n```\nread_file with filetype=\"xlsx\", file_path=\"Cleanup_Schedule.xlsx\"\n```\n\n## Key Advantages\n\n| Aspect | execute_code_sandbox | run_shell heredoc |\n|--------|---------------------|-------------------|\n| Reliability | May fail with openpyxl | More stable execution |\n| Styling support | Limited | Full openpyxl support |\n| File output | Via ARTIFACT_PATH | Direct file write |\n| Debugging | Limited output | Full stdout\u002Fstderr |\n\n## Common Styling Patterns\n\n### Bold Headers with Colored Background\n\n```python\nfrom openpyxl.styles import Font, PatternFill\n\nheader_fill = PatternFill(start_color=\"4472C4\", end_color=\"4472C4\", fill_type=\"solid\")\nheader_font = Font(bold=True, color=\"FFFFFF\", size=12)\n\ncell = ws.cell(row=1, column=1, value=\"Header\")\ncell.fill = header_fill\ncell.font = header_font\n```\n\n### Alternating Row Colors\n\n```python\nfrom openpyxl.styles import PatternFill\n\ngray_fill = PatternFill(start_color=\"D9D9D9\", end_color=\"D9D9D9\", fill_type=\"solid\")\n\nfor row in range(2, ws.max_row + 1):\n    if row % 2 == 0:\n        for col in range(1, ws.max_column + 1):\n            ws.cell(row=row, column=col).fill = gray_fill\n```\n\n### Borders and Alignment\n\n```python\nfrom openpyxl.styles import Border, Side, Alignment\n\nthin_border = Border(\n    left=Side(style='thin'),\n    right=Side(style='thin'),\n    top=Side(style='thin'),\n    bottom=Side(style='thin')\n)\n\nfor row in ws.iter_rows():\n    for cell in row:\n        cell.border = thin_border\n        cell.alignment = Alignment(horizontal=\"center\", vertical=\"center\")\n```\n\n## Troubleshooting\n\n**Issue**: File not created after heredoc execution\n- **Fix**: Check stdout for Python errors; ensure working directory is correct\n\n**Issue**: openpyxl not found\n- **Fix**: Install with `pip install openpyxl` before running heredoc\n\n**Issue**: Styling not appearing\n- **Fix**: Ensure you save the workbook after applying all styles\n\n## Example Complete Workflow\n\n```bash\n# Create Excel with full styling\npython3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill, Border, Side\n\nwb = Workbook()\nws = wb.active\nws.title = \"Report\"\n\n# Header row\nheaders = [\"ID\", \"Name\", \"Value\", \"Date\"]\nfor col, h in enumerate(headers, 1):\n    cell = ws.cell(row=1, column=col, value=h)\n    cell.font = Font(bold=True, color=\"FFFFFF\")\n    cell.fill = PatternFill(start_color=\"2F5597\", fill_type=\"solid\")\n    cell.alignment = Alignment(horizontal=\"center\")\n\n# Data\nws.append([1, \"Item A\", 100, \"2024-01-01\"])\nws.append([2, \"Item B\", 200, \"2024-01-02\"])\n\n# Apply borders\nthin = Side(style='thin')\nborder = Border(left=thin, right=thin, top=thin, bottom=thin)\nfor row in ws.iter_rows():\n    for cell in row:\n        cell.border = border\n\n# Auto-width columns\nfor col in ws.columns:\n    col_letter = col[0].column_letter\n    max_len = max(len(str(cell.value)) if cell.value else 0 for cell in col)\n    ws.column_dimensions[col_letter].width = min(max_len + 2, 50)\n\nwb.save(\"Report.xlsx\")\nprint(\"Success: Report.xlsx created\")\nEOF\n```","# Excel Heredoc Workaround\n\n## Purpose\n\nWhen creating Excel files with openpyxl, `execute_code_sandbox` may fail due to environment issues. This skill provides a robust workaround: fall back to `run_shell` with inline Python heredoc scripts to create properly formatted spreadsheets with styling.\n\n## When to Use\n\n- You need to create `.xlsx` files with openpyxl\n- `execute_code_sandbox` fails with openpyxl-related errors\n- You need styling, formatting, or complex spreadsheet features\n- Direct shell execution with Python heredoc is available\n\n## Step-by-Step Instructions\n\n### Step 1: Attempt execute_code_sandbox First\n\nTry creating the Excel file using `execute_code_sandbox`:\n\n```python\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill\n\nwb = Workbook()\nws = wb.active\nws.title = \"Data\"\n\n# Add data and styling\nws['A1'] = \"Header\"\nws['A1'].font = Font(bold=True)\n\nwb.save(\"output.xlsx\")\nprint(\"ARTIFACT_PATH:output.xlsx\")\n```\n\n### Step 2: If Sandbox Fails, Use run_shell with Heredoc\n\nWhen `execute_code_sandbox` fails, switch to `run_shell` with a Python heredoc:\n\n```bash\npython3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill, Border, Side\n\n# Create workbook\nwb = Workbook()\nws = wb.active\nws.title = \"Schedule\"\n\n# Add headers with styling\nheaders = [\"Task\", \"Date\", \"Status\", \"Priority\"]\nfor col, header in enumerate(headers, 1):\n    cell = ws.cell(row=1, column=col, value=header)\n    cell.font = Font(bold=True, size=12)\n    cell.fill = PatternFill(start_color=\"4472C4\", end_color=\"4472C4\", fill_type=\"solid\")\n    cell.font = Font(bold=True, color=\"FFFFFF\")\n    cell.alignment = Alignment(horizontal=\"center\")\n\n# Add data rows\ndata = [\n    [\"Cleanup Zone A\", \"2024-01-15\", \"Pending\", \"High\"],\n    [\"Cleanup Zone B\", \"2024-01-16\", \"Complete\", \"Medium\"],\n]\n\nfor row_idx, row_data in enumerate(data, 2):\n    for col_idx, value in enumerate(row_data, 1):\n        cell = ws.cell(row=row_idx, column=col_idx, value=value)\n        cell.alignment = Alignment(horizontal=\"left\")\n\n# Adjust column widths\nfor col in ws.columns:\n    max_length = 0\n    column = col[0].column_letter\n    for cell in col:\n        try:\n            if len(str(cell.value)) > max_length:\n                max_length = len(str(cell.value))\n        except:\n            pass\n    ws.column_dimensions[column].width = max_length + 2\n\n# Save the file\nwb.save(\"Cleanup_Schedule.xlsx\")\nprint(\"Created Cleanup_Schedule.xlsx successfully\")\nEOF\n```\n\n### Step 3: Verify File Creation\n\nAfter running the heredoc script, verify the file was created:\n\n```bash\nls -lh *.xlsx\n```\n\n### Step 4: Optional - Read Back to Confirm\n\nUse `read_file` to confirm the Excel file is valid:\n\n```\nread_file with filetype=\"xlsx\", file_path=\"Cleanup_Schedule.xlsx\"\n```\n\n## Key Advantages\n\n| Aspect | execute_code_sandbox | run_shell heredoc |\n|--------|---------------------|-------------------|\n| Reliability | May fail with openpyxl | More stable execution |\n| Styling support | Limited | Full openpyxl support |\n| File output | Via ARTIFACT_PATH | Direct file write |\n| Debugging | Limited output | Full stdout\u002Fstderr |\n\n## Common Styling Patterns\n\n### Bold Headers with Colored Background\n\n```python\nfrom openpyxl.styles import Font, PatternFill\n\nheader_fill = PatternFill(start_color=\"4472C4\", end_color=\"4472C4\", fill_type=\"solid\")\nheader_font = Font(bold=True, color=\"FFFFFF\", size=12)\n\ncell = ws.cell(row=1, column=1, value=\"Header\")\ncell.fill = header_fill\ncell.font = header_font\n```\n\n### Alternating Row Colors\n\n```python\nfrom openpyxl.styles import PatternFill\n\ngray_fill = PatternFill(start_color=\"D9D9D9\", end_color=\"D9D9D9\", fill_type=\"solid\")\n\nfor row in range(2, ws.max_row + 1):\n    if row % 2 == 0:\n        for col in range(1, ws.max_column + 1):\n            ws.cell(row=row, column=col).fill = gray_fill\n```\n\n### Borders and Alignment\n\n```python\nfrom openpyxl.styles import Border, Side, Alignment\n\nthin_border = Border(\n    left=Side(style='thin'),\n    right=Side(style='thin'),\n    top=Side(style='thin'),\n    bottom=Side(style='thin')\n)\n\nfor row in ws.iter_rows():\n    for cell in row:\n        cell.border = thin_border\n        cell.alignment = Alignment(horizontal=\"center\", vertical=\"center\")\n```\n\n## Troubleshooting\n\n**Issue**: File not created after heredoc execution\n- **Fix**: Check stdout for Python errors; ensure working directory is correct\n\n**Issue**: openpyxl not found\n- **Fix**: Install with `pip install openpyxl` before running heredoc\n\n**Issue**: Styling not appearing\n- **Fix**: Ensure you save the workbook after applying all styles\n\n## Example Complete Workflow\n\n```bash\n# Create Excel with full styling\npython3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill, Border, Side\n\nwb = Workbook()\nws = wb.active\nws.title = \"Report\"\n\n# Header row\nheaders = [\"ID\", \"Name\", \"Value\", \"Date\"]\nfor col, h in enumerate(headers, 1):\n    cell = ws.cell(row=1, column=col, value=h)\n    cell.font = Font(bold=True, color=\"FFFFFF\")\n    cell.fill = PatternFill(start_color=\"2F5597\", fill_type=\"solid\")\n    cell.alignment = Alignment(horizontal=\"center\")\n\n# Data\nws.append([1, \"Item A\", 100, \"2024-01-01\"])\nws.append([2, \"Item B\", 200, \"2024-01-02\"])\n\n# Apply borders\nthin = Side(style='thin')\nborder = Border(left=thin, right=thin, top=thin, bottom=thin)\nfor row in ws.iter_rows():\n    for cell in row:\n        cell.border = border\n\n# Auto-width columns\nfor col in ws.columns:\n    col_letter = col[0].column_letter\n    max_len = max(len(str(cell.value)) if cell.value else 0 for cell in col)\n    ws.column_dimensions[col_letter].width = min(max_len + 2, 50)\n\nwb.save(\"Report.xlsx\")\nprint(\"Success: Report.xlsx created\")\nEOF\n```",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","gdpval_bench\u002Fskills\u002Fexcel-heredoc-workaround","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":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill excel-heredoc-workaround",{"tool":50,"command":51},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill excel-heredoc-workaround",{"tool":53,"command":54},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill excel-heredoc-workaround","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexcel-heredoc-workaround\u002FSKILL.md",true,[58],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},".skill_id","OTHER","其他",38,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexcel-heredoc-workaround\u002F.skill_id",[65,88,104,112,137,153],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":33},"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",[],[72,73,74,75,76,77,78,79,80,81,82,83,84,27,85,86,87,20],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","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":33},"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,73,87,97,20,98,99,100,101,102,86,103,29,77,80,82],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"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":33},"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,73,77,25,82,99,86,87,20,80],"write special chars heredoc",{"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":33},"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,75,124,125,126,127,128,80,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":33},"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,80,148,29,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":33},"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",[],[160,161,162,163,164,165,87,166,167,168],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]