reliable-excel-workbook-creation

reliable-excel-workbook-creation is a skill for Claude Code, Codex from HKUDS/OpenSpace. It costs 40 tokens per session (981 once invoked), scanned A, original, MIT.

A workflow for creating multi-sheet Excel workbooks with Python when ordinary file reading or sandbox execution fails. Excel workbooks are spreadsheet files that can contain multiple sheets and formatting.

In plain words
What is it for?
Building, populating, formatting, and saving XLSX files with Python.
Why use it?
It avoids unreliable execution paths during complex workbook creation and gives you a repeatable way to save the result.

Skill for Claude CodeCodex

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

Good fit Building, populating, formatting, and saving XLSX files with Python.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hkuds/openspace/reliable-excel-workbook-creation
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 · 7,534 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 reliable-excel-workbook-creation
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 reliable-excel-workbook-creation

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/openspace/reliable-excel-workbook-creation.svg)](https://agentmods.dev/skills/hkuds/openspace/reliable-excel-workbook-creation)
Your own site
<a href="https://agentmods.dev/skills/hkuds/openspace/reliable-excel-workbook-creation"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/reliable-excel-workbook-creation.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 981 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 pass 7 Sept 2026
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.00040 $0.00981
Opus 5 $0.00020 $0.00491
Sonnet 5 $0.00008 $0.00196
Haiku 4.5 $0.00004 $0.00098

Measured 4d ago against content hash d6c3cf55357e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

reliable-excel-workbook-creation 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 4d 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/reliable-excel-workbook-creation/SKILL.md · 140 lines

How it starts

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

Reliable Excel Workbook Creation via Shell

When to Use This Pattern

Use this technique when you need to:

  • Create complex Excel workbooks with multiple sheets
  • Perform multi-step workbook operations (create, populate, format, save)
  • Work with XLSX files that read_file cannot handle properly
  • Avoid failures from execute_code_sandbox on persistent file operations

Avoid: read_file for XLSX files, execute_code_sandbox for multi-step workbook creation

Core Pattern

cd /workspace && python3 << 'EOF'
from openpyxl import Workbook
# Your Excel operations here
wb = Workbook()
# ... create sheets, add data, save
wb.save('/workspace/filename.xlsx')
EOF

Step-by-Step Instructions

Step 1: Change to Workspace Directory

Always start with cd /workspace && to ensure file paths resolve correctly.

Step 2: Use Heredoc with Single-Quoted EOF

Use << 'EOF' (single quotes) to prevent shell variable expansion within the Python code.

Step 3: Write Complete Python Script

Include all imports, workbook creation, data population, and save operations in one script.

Step 4: Use Absolute Paths for Save Operations

Always save with full path: /workspace/your_filename.xlsx

Complete Example

cd /workspace && python3 << 'EOF'
from openpyxl import Workbook
from openpyxl.styles import Font, Alignment, PatternFill

# Create workbook
wb = Workbook()

# Create multiple sheets
sheets = ['Summary', 'Data', 'Analysis', 'Settings']
for sheet_name in sheets:
    wb.create_sheet(title=sheet_name)

# Remove default sheet if needed
if 'Sheet' in wb.sheetnames:
    del wb['Sheet']

# Populate data
ws = wb['Data']
ws['A1'] = 'Item'
ws['B1'] = 'Value'
ws['A2'] = 'Revenue'
ws['B2'] = 100000

# Apply formatting
header_font = Font(bold=True)
for cell in ws['1:1']:
    cell.font = header_font

# Save workbook
wb.save('/workspace/report.xlsx')
print('Workbook created successfully: /workspace/report.xlsx')
EOF

Why This Works

Approach Problem Solution
read_file Cannot parse XLSX binary format Don't use for Excel files
execute_code_sandbox File persistence issues, multi-step failures Use run_shell instead
run_shell with heredoc ✓ Reliable, full control, persistent files Use this pattern

Read the full file on GitHub · 140 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. 4d ago First seen · 140 lines · 40 tokens per session scan A d6c3cf55357e

Subscribe to this mod's changes

reliable-excel-workbook-creation is a skill published in the GitHub repository HKUDS/OpenSpace (7,534 stars, last pushed 26d ago), licensed MIT. It adds 40 tokens to every session and 981 once invoked, about $0.0002 per session on Opus 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-09-03.