Agent skill

Openpyxl Sandbox Workaround

by HKUDS in HKUDS/OpenSpace

Use runshell with inline Python as a fallback when executecodesandbox fails for openpyxl/spreadsheet operations

MITAuto-check passedDocuments & Office

Install Openpyxl Sandbox Workaround

skills CLI
$ npx skills add HKUDS/OpenSpace --skill openpyxl-sandbox-workaround -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/OpenSpace openpyxl-sandbox-workaround --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/benchmarks/gdpval/skills/openpyxl-sandbox-workaround .claude/skills/openpyxl-sandbox-workaround && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
openpyxl-sandbox-workaround
GitHub stars
7.8k
Token cost
~849 tokens
SKILL.md length
231 words
Files
2
Skills in repo
199
Repo updated
First seen
Licence
MIT

At a glance

Use runshell with inline Python as a fallback when executecodesandbox fails for openpyxl/spreadsheet operations

  • Works in 5 steps: Use heredoc syntax: The << 'EOF' pattern… → Print success messages: Always include… → Handle file paths: Use absolute paths or… → …
  • Tasks that involve Excel spreadsheets
  • SKILL.md covers When to Use, Common Failure Indicators, The Workaround Pattern and Multi-Step Spreadsheet Tasks, plus 4 more sections
  • Calls python3

What it does

Openpyxl Sandbox Workaround is an agent skill from HKUDS/OpenSpace. Use runshell with inline Python as a fallback when executecodesandbox fails for openpyxl/spreadsheet operations

Its SKILL.md is about 850 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Documents & Office, covering Excel spreadsheets. It works with openpyxl and Python. The repository describes itself as: "OpenSpace: The Skill Management Layer for AI Agents" -- https://open-space.cloud/. The licence is MIT.

When your agent uses it

  • Tasks that involve Excel spreadsheets

Example prompts

  • “/openpyxl-sandbox-workaround”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Use heredoc syntax: The << 'EOF' pattern prevents variable expansion issues
  2. Print success messages: Always include print statements to confirm completion
  3. Handle file paths: Use absolute paths or ensure you're in the correct working directory
  4. Validate output: After creation, verify the file exists and has expected content
  5. Error handling: Add try/except blocks for robustness in complex scripts

What it can do on your machine

Read from SKILL.md and the folder at commit 3827781. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Openpyxl Sandbox Workaround loads about 849 tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 231 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~849

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/OpenSpace at commit 3827781, republished under its MIT licence (© HKUDS). 231 words, ~849 tokens.

Download SKILL.mdSave it as .claude/skills/openpyxl-sandbox-workaround/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
openpyxl-sandbox-workaround
description
Use run_shell with inline Python as a fallback when execute_code_sandbox fails for openpyxl/spreadsheet operations

Openpyxl Sandbox Workaround

When to Use

Use this pattern when execute_code_sandbox repeatedly fails for openpyxl or spreadsheet manipulation tasks. The sandbox environment may have compatibility issues with certain openpyxl operations, but running Python directly via run_shell often succeeds.

Common Failure Indicators

  • execute_code_sandbox returns errors related to openpyxl imports or operations
  • Multiple retry attempts fail with similar errors
  • Errors mention workbook creation, cell writing, or file saving issues

The Workaround Pattern

Instead of using execute_code_sandbox, use run_shell with an inline Python script:

bash
python3 << 'EOF'
from openpyxl import Workbook
from openpyxl.utils import get_column_letter

# Your openpyxl code here
wb = Workbook()
ws = wb.active
ws.title = "Sheet1"

# Add data
ws['A1'] = 'Header'
ws['B1'] = 'Value'

# Save file
wb.save('output.xlsx')
print('File created successfully')
EOF

Multi-Step Spreadsheet Tasks

For complex operations involving multiple files or data processing:

bash
python3 << 'EOF'
from openpyxl import Workbook, load_workbook
import os

# Load existing workbook if needed
if os.path.exists('input.xlsx'):
    wb = load_workbook('input.xlsx')
    ws = wb.active
    # Process data...
    
# Create new workbook
wb = Workbook()
ws = wb.active

# Add data with proper formatting
for row_idx, row_data in enumerate(data, start=1):
    for col_idx, value in enumerate(row_data, start=1):
        ws.cell(row=row_idx, column=col_idx, value=value)

# Auto-adjust column widths
for column in ws.columns:
    max_length = 0
    column_letter = get_column_letter(column[0].column)
    for cell in column:
        try:
            if len(str(cell.value)) > max_length:
                max_length = len(str(cell.value))
        except:
            pass
    adjusted_width = min(max_length + 2, 50)
    ws.column_dimensions[column_letter].width = adjusted_width

wb.save('output.xlsx')
EOF

Best Practices

  1. Use heredoc syntax: The << 'EOF' pattern prevents variable expansion issues
  2. Print success messages: Always include print statements to confirm completion
  3. Handle file paths: Use absolute paths or ensure you're in the correct working directory
  4. Validate output: After creation, verify the file exists and has expected content
  5. Error handling: Add try/except blocks for robustness in complex scripts

Verification Step

After running the script, verify the file was created:

bash
ls -la *.xlsx

Or check file details:

bash
python3 << 'EOF'
from openpyxl import load_workbook
wb = load_workbook('output.xlsx')
print(f"Sheets: {wb.sheetnames}")
print(f"Active sheet: {wb.active.title}")
EOF

When to Fall Back to This Pattern

  • First execute_code_sandbox attempt fails with openpyxl errors
  • Error persists after 1-2 retries
  • Task is time-sensitive and needs a reliable solution
  • The operation is straightforward file creation/modification

Limitations

  • Output is limited to stdout/stderr (no direct artifact download from run_shell)
  • Files are created in the current working directory
  • More verbose than execute_code_sandbox for simple operations

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in benchmarks/gdpval/skills/openpyxl-sandbox-workaround of HKUDS/OpenSpace.

  • SKILL.md
  • .skill_id

Open the folder on GitHubat commit 3827781

Compare with similar skills

Openpyxl Sandbox Workaround next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Openpyxl Sandbox Workaround compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openpyxl Sandbox Workaround this skillHKUDS/OpenSpace7.8k—~849Automated safety check: PassMIT
Excel Workbook EditorTokenRhythm/opensquilla7.1k—~1.6kAutomated safety check: PassApache-2.0
Kimi XLSXthvroyal/kimi-skills238—~9.5kAutomated safety check: PassNone
Office XLSXopen-octo/octo-agent125—~1.8kAutomated safety check: NotesMIT
Cc Streaming Export Safetydoccker/cc-use-exp1.1k—~2.2kAutomated safety check: PassCustom licence
XLSXnexus-research-lab/nexus151—~501Automated safety check: PassApache-2.0

Similar skills

  • Excel Workbook Editor

    TokenRhythm/opensquilla

    Inspects, edits in place or creates Microsoft Excel .xlsx workbooks with openpyxl, treating each cell as a typed number, string, datetime or formula value.

    7.1k GitHub stars~1.6k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Kimi XLSX

    thvroyal/kimi-skills

    Specialized utility for advanced manipulation, analysis, and creation of spreadsheet files, including (but not limited to) XLSX, XLSM, CSV formats.

    238 GitHub stars~9.5k tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed
  • Office XLSX

    open-octo/octo-agent

    Create, read, and edit Excel (.xlsx) spreadsheets programmatically with openpyxl — cell values, formulas, styling (fonts/fills/borders/alignment/number formats), merged cells, multiple sheets…

    125 GitHub stars~1.8k tokensUpdated yesterday
    Documents & OfficeAuto-check: notes
  • Cc Streaming Export Safety

    doccker/cc-use-exp

    当实现用户驱动的大文件导出或批量序列化(Excel/CSV/JSON/JSONL/PDF,数据量未知或超过 1 万行/10 MB)时触发;普通小文件下载、静态资源下载、非导出 Writer/Report 类不触发。防止 OOM、临时文件残留、同步导出阻塞 HTTP 线程和表格公式注入。

    1.1k GitHub stars~2.2k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • XLSX

    nexus-research-lab/nexus

    只要电子表格文件(.xlsx、.xlsm、旧版 .xls、.csv、.tsv)是任务的主要输入或输出,或者需要 被打开、读取、创建、修改,就使用本 Skill。也适用于公式、格式、图表、数据清洗和表格格式转换。

    151 GitHub stars~501 tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Office XLSX

    singula-ai/alego

    Read, create, and modify Excel workbooks (.xlsx), including data, formulas, formatting, and pandas analysis.

    109 GitHub starsUsed in 1 repo~2.3k tokens
    Documents & OfficeAuto-check passed

More from HKUDS/OpenSpace

All 199 skills in this repo
  • Walks through producing a master audio track plus stems in Python, from checking a reference file and timing sections by BPM to effects, a zip archive and final verification.

    7.8k GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Handle cascading data retrieval tool failures by falling back to embedded knowledge generation

    7.8k GitHub stars~765 tokensUpdated 1 mo ago
    Auto-check passed
  • Gives an agent a workaround when its code-execution sandbox keeps failing: save the Python script to a file and run it through the shell instead.

    7.8k GitHub stars~588 tokensUpdated 1 mo ago
    Auto-check passed
  • A recovery routine for agents whose sandboxed code runner keeps failing: save the Python script to disk, then run it through the shell and read the output.

    7.8k GitHub stars~652 tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback ladder for failed sandboxed code runs, plus the habit of fixing the working directory first so generated files land in the right place.

    7.8k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback workflow for executing Python code when executecodesandbox fails repeatedly

    7.8k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Openpyxl Sandbox Workaround

What does Openpyxl Sandbox Workaround do?

Use runshell with inline Python as a fallback when executecodesandbox fails for openpyxl/spreadsheet operations. Openpyxl Sandbox Workaround is an agent skill from HKUDS/OpenSpace.

When should I use Openpyxl Sandbox Workaround?

Openpyxl Sandbox Workaround fits situations like: tasks that involve Excel spreadsheets.

How do I install Openpyxl Sandbox Workaround in Claude Code?

Run `npx skills add HKUDS/OpenSpace --skill openpyxl-sandbox-workaround -a claude-code`. Or copy the skill folder (benchmarks/gdpval/skills/openpyxl-sandbox-workaround in HKUDS/OpenSpace) into .claude/skills/openpyxl-sandbox-workaround in your project. Claude Code loads it when a task matches its description.

How do I install Openpyxl Sandbox Workaround in Codex?

Run `npx skills add HKUDS/OpenSpace --skill openpyxl-sandbox-workaround -a codex`. Or copy the skill folder (benchmarks/gdpval/skills/openpyxl-sandbox-workaround in HKUDS/OpenSpace) into .agents/skills/openpyxl-sandbox-workaround in your project. Codex loads it when a task matches its description.

Can I use Openpyxl Sandbox Workaround in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/OpenSpace --skill openpyxl-sandbox-workaround -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openpyxl-sandbox-workaround, .gemini/skills/openpyxl-sandbox-workaround, .github/skills/openpyxl-sandbox-workaround and .opencode/skills/openpyxl-sandbox-workaround in your project.

What does Openpyxl Sandbox Workaround need to run?

Going by SKILL.md and its folder, Openpyxl Sandbox Workaround needs the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Openpyxl Sandbox Workaround access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Openpyxl Sandbox Workaround safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Openpyxl Sandbox Workaround use?

Openpyxl Sandbox Workaround is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openpyxl Sandbox Workaround use?

About 849 tokens (SKILL.md is roughly 3.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Openpyxl Sandbox Workaround?

Skills that share tags, products or a category with Openpyxl Sandbox Workaround: Excel Workbook Editor (TokenRhythm/opensquilla, 7.1k stars), Kimi XLSX (thvroyal/kimi-skills, 238 stars), Office XLSX (open-octo/octo-agent, 125 stars) and Cc Streaming Export Safety (doccker/cc-use-exp, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openpyxl Sandbox Workaround?

HKUDS (a GitHub organization) maintains it in HKUDS/OpenSpace, which has 7,754 GitHub stars. The repository holds 199 skills in this directory. The repository was last updated on August 12, 2026.

Source: HKUDS/OpenSpace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.