excel-heredoc-workaround

excel-heredoc-workaround is a skill for Claude Code, Codex from HKUDS/OpenSpace. It costs 31 tokens per session (1,533 once invoked), scanned A, original, MIT.

A workaround for creating Excel spreadsheets with the openpyxl Python library when the usual code sandbox fails. It runs an inline Python script through the shell instead.

In plain words
What is it for?
Use it to create and style Excel workbooks, including sheets, fonts, alignment, fills, and other spreadsheet formatting.
Why use it?
It provides another way to generate formatted .xlsx files when environment problems prevent openpyxl from running in the normal sandbox.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create and style Excel workbooks, including sheets, fonts, alignment, fills, and other spreadsheet formatting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hkuds/openspace/excel-heredoc-workaround
About the project

OpenSpace is a skill-management layer for AI agents that stores, retrieves, evaluates, shares, and improves reusable workflows. It is intended for people using multiple coding agents who want skills to be reused and refined based on task outcomes. The catalogue provides 200 skills for use with OpenSpace and the agents it supports.

HKUDS/OpenSpace · 8,146 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HKUDS/OpenSpace --skill excel-heredoc-workaround
Clone the repo
git clone --depth 1 https://github.com/HKUDS/OpenSpace

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for excel-heredoc-workaround

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/openspace/excel-heredoc-workaround/github.svg)](https://agentmods.dev/skills/hkuds/openspace/excel-heredoc-workaround)
Your own site
<a href="https://agentmods.dev/skills/hkuds/openspace/excel-heredoc-workaround"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/excel-heredoc-workaround/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for excel-heredoc-workaround

Your own site · 80×15
<a href="https://agentmods.dev/skills/hkuds/openspace/excel-heredoc-workaround"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/excel-heredoc-workaround.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,533 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Output Handling · line 77
    Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
    Fix: Set explicit limits on output length, generation count, and rate. Use max_tokens and truncation to prevent unbounded output.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.01533
Opus 5.5 $0.00012 $0.00613
Sonnet 5.5 $0.00006 $0.00307
Haiku 4.5 $0.00003 $0.00153

Measured 3mo ago against content hash c6e8e1398b9a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

excel-heredoc-workaround scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

benchmarks/gdpval/skills/excel-heredoc-workaround/SKILL.md · 215 lines

How it starts

The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Excel Heredoc Workaround

Purpose

When 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.

When to Use

  • You need to create .xlsx files with openpyxl
  • execute_code_sandbox fails with openpyxl-related errors
  • You need styling, formatting, or complex spreadsheet features
  • Direct shell execution with Python heredoc is available

Step-by-Step Instructions

Step 1: Attempt execute_code_sandbox First

Try creating the Excel file using execute_code_sandbox:

from openpyxl import Workbook
from openpyxl.styles import Font, Alignment, PatternFill

wb = Workbook()
ws = wb.active
ws.title = "Data"

# Add data and styling
ws['A1'] = "Header"
ws['A1'].font = Font(bold=True)

wb.save("output.xlsx")
print("ARTIFACT_PATH:output.xlsx")

Step 2: If Sandbox Fails, Use run_shell with Heredoc

When execute_code_sandbox fails, switch to run_shell with a Python heredoc:

python3 << 'EOF'
from openpyxl import Workbook
from openpyxl.styles import Font, Alignment, PatternFill, Border, Side

# Create workbook
wb = Workbook()
ws = wb.active
ws.title = "Schedule"

# Add headers with styling
headers = ["Task", "Date", "Status", "Priority"]
for col, header in enumerate(headers, 1):
    cell = ws.cell(row=1, column=col, value=header)
    cell.font = Font(bold=True, size=12)
    cell.fill = PatternFill(start_color="4472C4", end_color="4472C4", fill_type="solid")
    cell.font = Font(bold=True, color="FFFFFF")
    cell.alignment = Alignment(horizontal="center")

# Add data rows
data = [
    ["Cleanup Zone A", "2024-01-15", "Pending", "High"],
    ["Cleanup Zone B", "2024-01-16", "Complete", "Medium"],
]

for row_idx, row_data in enumerate(data, 2):
    for col_idx, value in enumerate(row_data, 1):
        cell = ws.cell(row=row_idx, column=col_idx, value=value)
        cell.alignment = Alignment(horizontal="left")

# Adjust column widths
for col in ws.columns:
    max_length = 0
    column = col[0].column_letter
    for cell in col:
        try:
            if len(str(cell.value)) > max_length:
                max_length = len(str(cell.value))
        except:
            pass
    ws.column_dimensions[column].width = max_length + 2

# Save the file
wb.save("Cleanup_Schedule.xlsx")
print("Created Cleanup_Schedule.xlsx successfully")
EOF

Read the full file on GitHub · 215 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 215 lines · 31 tokens per session scan A c6e8e1398b9a

Subscribe to this mod's changes

excel-heredoc-workaround is a skill published in the GitHub repository HKUDS/OpenSpace (8,146 stars, last pushed 18d ago), licensed MIT. It adds 31 tokens to every session and 1,533 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

excel-heredoc-workaround compared with skills from other repositories

excel-heredoc-workaround next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
excel-heredoc-workaroundHKUDS/OpenSpaceSkill8.1k18d agoMITA31Claude Code, Codex
dcf-modelNousResearch/hermes-agentSkill267ktodayMITA14Claude Code, Codex
gogopenclaw/openclawSkill395ktodayMITA20Claude Code, Codex
xlsxasgeirtj/system_prompts_leaksSkill74kyesterdayCC0-1.0A206Claude Code, Codex
artifact-template-analytics-dashboardasgeirtj/system_prompts_leaksSkill74kyesterdayCC0-1.0A47Claude Code, Codex
audit-xlsanthropics/financial-servicesSkill42k17d agoApache-2.0A104Claude Code
google-drive-sheetsyc-software/qmSkill16ktodayMITA32Claude Code, Codex