[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJVZHC7F8J2F11SBSR5DNT":3,"skill-same:01M6KJVZHC7F8J2F11SBSR5DNT":73},{"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":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":13,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6KJVZHC7F8J2F11SBSR5DNT","reliable-excel-workbook-creation",null,"Use run_shell with cd and heredoc syntax for complex Excel operations when read_file fails on XLSX or execute_code_sandbox fails on multi-step workbook creation","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\u002Freliable-excel-workbook-creation\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000004","电子表格","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"reliable excel workbook creation","workbook","creation","xlsx","operations","for","with","multi","cd","use","execute","read","syntax","shell","file","code","run","sandbox","2026-11-10 10:12:30",false,"---\nname: reliable-excel-workbook-creation\ndescription: Use run_shell with cd and heredoc syntax for complex Excel operations when read_file fails on XLSX or execute_code_sandbox fails on multi-step workbook creation\n---\n\n# Reliable Excel Workbook Creation via Shell\n\n## When to Use This Pattern\n\nUse this technique when you need to:\n- Create complex Excel workbooks with multiple sheets\n- Perform multi-step workbook operations (create, populate, format, save)\n- Work with XLSX files that `read_file` cannot handle properly\n- Avoid failures from `execute_code_sandbox` on persistent file operations\n\n**Avoid:** `read_file` for XLSX files, `execute_code_sandbox` for multi-step workbook creation\n\n## Core Pattern\n\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\n# Your Excel operations here\nwb = Workbook()\n# ... create sheets, add data, save\nwb.save('\u002Fworkspace\u002Ffilename.xlsx')\nEOF\n```\n\n## Step-by-Step Instructions\n\n### Step 1: Change to Workspace Directory\nAlways start with `cd \u002Fworkspace &&` to ensure file paths resolve correctly.\n\n### Step 2: Use Heredoc with Single-Quoted EOF\nUse `\u003C\u003C 'EOF'` (single quotes) to prevent shell variable expansion within the Python code.\n\n### Step 3: Write Complete Python Script\nInclude all imports, workbook creation, data population, and save operations in one script.\n\n### Step 4: Use Absolute Paths for Save Operations\nAlways save with full path: `\u002Fworkspace\u002Fyour_filename.xlsx`\n\n## Complete Example\n\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill\n\n# Create workbook\nwb = Workbook()\n\n# Create multiple sheets\nsheets = ['Summary', 'Data', 'Analysis', 'Settings']\nfor sheet_name in sheets:\n    wb.create_sheet(title=sheet_name)\n\n# Remove default sheet if needed\nif 'Sheet' in wb.sheetnames:\n    del wb['Sheet']\n\n# Populate data\nws = wb['Data']\nws['A1'] = 'Item'\nws['B1'] = 'Value'\nws['A2'] = 'Revenue'\nws['B2'] = 100000\n\n# Apply formatting\nheader_font = Font(bold=True)\nfor cell in ws['1:1']:\n    cell.font = header_font\n\n# Save workbook\nwb.save('\u002Fworkspace\u002Freport.xlsx')\nprint('Workbook created successfully: \u002Fworkspace\u002Freport.xlsx')\nEOF\n```\n\n## Why This Works\n\n| Approach | Problem | Solution |\n|----------|---------|----------|\n| `read_file` | Cannot parse XLSX binary format | Don't use for Excel files |\n| `execute_code_sandbox` | File persistence issues, multi-step failures | Use `run_shell` instead |\n| `run_shell` with heredoc | ✓ Reliable, full control, persistent files | **Use this pattern** |\n\n## Common Operations\n\n### Create Multi-Sheet Workbook\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nwb = Workbook()\nsheet_names = ['Sheet1', 'Sheet2', 'Sheet3']\nfor name in sheet_names:\n    wb.create_sheet(title=name)\nwb.save('\u002Fworkspace\u002Fmulti_sheet.xlsx')\nEOF\n```\n\n### Read and Modify Existing Workbook\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import load_workbook\nwb = load_workbook('\u002Fworkspace\u002Fexisting.xlsx')\nws = wb.active\nws['A1'] = 'Updated Value'\nwb.save('\u002Fworkspace\u002Fexisting.xlsx')\nEOF\n```\n\n### Add Formulas\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nwb = Workbook()\nws = wb.active\nws['A1'] = 100\nws['A2'] = 200\nws['A3'] = '=SUM(A1:A2)'\nwb.save('\u002Fworkspace\u002Fwith_formulas.xlsx')\nEOF\n```\n\n## Troubleshooting\n\n- **File not found**: Ensure you use `\u002Fworkspace\u002F` prefix in all paths\n- **Permission errors**: Verify workspace directory is writable\n- **Module not found**: openpyxl is pre-installed in the environment\n- **Heredoc issues**: Use single-quoted `'EOF'` to prevent shell interpretation\n\n## Best Practices\n\n1. **Always use absolute paths** (`\u002Fworkspace\u002Ffilename.xlsx`)\n2. **Single-quoted heredoc** (`\u003C\u003C 'EOF'`) prevents variable expansion\n3. **Complete script in one heredoc** - avoid splitting operations\n4. **Print confirmation** after save to verify success\n5. **Handle exceptions** for production scripts","# Reliable Excel Workbook Creation via Shell\n\n## When to Use This Pattern\n\nUse this technique when you need to:\n- Create complex Excel workbooks with multiple sheets\n- Perform multi-step workbook operations (create, populate, format, save)\n- Work with XLSX files that `read_file` cannot handle properly\n- Avoid failures from `execute_code_sandbox` on persistent file operations\n\n**Avoid:** `read_file` for XLSX files, `execute_code_sandbox` for multi-step workbook creation\n\n## Core Pattern\n\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\n# Your Excel operations here\nwb = Workbook()\n# ... create sheets, add data, save\nwb.save('\u002Fworkspace\u002Ffilename.xlsx')\nEOF\n```\n\n## Step-by-Step Instructions\n\n### Step 1: Change to Workspace Directory\nAlways start with `cd \u002Fworkspace &&` to ensure file paths resolve correctly.\n\n### Step 2: Use Heredoc with Single-Quoted EOF\nUse `\u003C\u003C 'EOF'` (single quotes) to prevent shell variable expansion within the Python code.\n\n### Step 3: Write Complete Python Script\nInclude all imports, workbook creation, data population, and save operations in one script.\n\n### Step 4: Use Absolute Paths for Save Operations\nAlways save with full path: `\u002Fworkspace\u002Fyour_filename.xlsx`\n\n## Complete Example\n\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, Alignment, PatternFill\n\n# Create workbook\nwb = Workbook()\n\n# Create multiple sheets\nsheets = ['Summary', 'Data', 'Analysis', 'Settings']\nfor sheet_name in sheets:\n    wb.create_sheet(title=sheet_name)\n\n# Remove default sheet if needed\nif 'Sheet' in wb.sheetnames:\n    del wb['Sheet']\n\n# Populate data\nws = wb['Data']\nws['A1'] = 'Item'\nws['B1'] = 'Value'\nws['A2'] = 'Revenue'\nws['B2'] = 100000\n\n# Apply formatting\nheader_font = Font(bold=True)\nfor cell in ws['1:1']:\n    cell.font = header_font\n\n# Save workbook\nwb.save('\u002Fworkspace\u002Freport.xlsx')\nprint('Workbook created successfully: \u002Fworkspace\u002Freport.xlsx')\nEOF\n```\n\n## Why This Works\n\n| Approach | Problem | Solution |\n|----------|---------|----------|\n| `read_file` | Cannot parse XLSX binary format | Don't use for Excel files |\n| `execute_code_sandbox` | File persistence issues, multi-step failures | Use `run_shell` instead |\n| `run_shell` with heredoc | ✓ Reliable, full control, persistent files | **Use this pattern** |\n\n## Common Operations\n\n### Create Multi-Sheet Workbook\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nwb = Workbook()\nsheet_names = ['Sheet1', 'Sheet2', 'Sheet3']\nfor name in sheet_names:\n    wb.create_sheet(title=name)\nwb.save('\u002Fworkspace\u002Fmulti_sheet.xlsx')\nEOF\n```\n\n### Read and Modify Existing Workbook\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import load_workbook\nwb = load_workbook('\u002Fworkspace\u002Fexisting.xlsx')\nws = wb.active\nws['A1'] = 'Updated Value'\nwb.save('\u002Fworkspace\u002Fexisting.xlsx')\nEOF\n```\n\n### Add Formulas\n```bash\ncd \u002Fworkspace && python3 \u003C\u003C 'EOF'\nfrom openpyxl import Workbook\nwb = Workbook()\nws = wb.active\nws['A1'] = 100\nws['A2'] = 200\nws['A3'] = '=SUM(A1:A2)'\nwb.save('\u002Fworkspace\u002Fwith_formulas.xlsx')\nEOF\n```\n\n## Troubleshooting\n\n- **File not found**: Ensure you use `\u002Fworkspace\u002F` prefix in all paths\n- **Permission errors**: Verify workspace directory is writable\n- **Module not found**: openpyxl is pre-installed in the environment\n- **Heredoc issues**: Use single-quoted `'EOF'` to prevent shell interpretation\n\n## Best Practices\n\n1. **Always use absolute paths** (`\u002Fworkspace\u002Ffilename.xlsx`)\n2. **Single-quoted heredoc** (`\u003C\u003C 'EOF'`) prevents variable expansion\n3. **Complete script in one heredoc** - avoid splitting operations\n4. **Print confirmation** after save to verify success\n5. **Handle exceptions** for production scripts",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Freliable-excel-workbook-creation","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":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add AG064\u002FOpenSpace --skill reliable-excel-workbook-creation",{"tool":59,"command":60},"bunx","bunx skills add AG064\u002FOpenSpace --skill reliable-excel-workbook-creation",{"tool":62,"command":63},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill reliable-excel-workbook-creation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Freliable-excel-workbook-creation\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},".skill_id","OTHER","其他",46,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Freliable-excel-workbook-creation\u002F.skill_id",[74,96,111,119,149,165],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":41},"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",[],[81,82,83,84,85,86,28,87,88,89,90,91,92,93,37,94,95],"write special chars ts check","check","write","filters","Existing","type-checking","errors","script","output","type","files","only","template","python","typescript",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":41},"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",[],[103,104,83,93,105,34,37,94,106,107,108,109,110,28,88,29],"readback","write special chars readback","cleanup","scripts","verification","via","post","helper",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":41},"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",[],[83,118,94,28,108,93,36,37,88],"write special chars heredoc",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":130,"publishedAt":41},"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",[125],{"categoryNo":126,"categoryName":127,"taxonomyType":128,"taxonomyTypeDesc":129},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[131,132,133,134,95,135,136,137,138,139,28,140,141,142,143,144,145,146,147,148],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":41},"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",[],[156,157,158,159,28,160,29,161,162,163,164],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":41},"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",[],[172,173,174,175,176,177,37,178,179,180],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]