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.
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.
npx skills add HKUDS/OpenSpace --skill python-heredoc-fallbackgit clone --depth 1 https://github.com/HKUDS/OpenSpaceWrote 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.
[](https://agentmods.dev/skills/hkuds/openspace/python-heredoc-fallback)<a href="https://agentmods.dev/skills/hkuds/openspace/python-heredoc-fallback"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/python-heredoc-fallback.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00018 | $0.00827 |
| Opus 5 | $0.00009 | $0.00413 |
| Sonnet 5 | $0.00004 | $0.00165 |
| Haiku 4.5 | $0.00002 | $0.00083 |
Grade A, and why
python-heredoc-fallback 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Heredoc Fallback for Code Execution
When to Use
Use this pattern when execute_code_sandbox fails with e2b initialization errors, sandbox connection issues, or other execution environment problems. This is especially reliable for file generation tasks.
Core Pattern
Instead of execute_code_sandbox, run Python code directly in the shell using a heredoc:
python3 << 'EOF'
# Your Python code here
import sys
print("Python code executing in shell")
EOF
Key Syntax Rules
- Use single-quoted EOF (
<< 'EOF') to prevent shell variable expansion within the Python code - No indentation before EOF - the closing delimiter must be at the start of the line
- Install packages first if needed, before the Python heredoc block
Common Use Cases
1. Matplotlib Graph Generation
python3 << 'EOF'
import matplotlib.pyplot as plt
import pandas as pd
# Load data
data = pd.read_excel('input.xlsx')
# Create visualization
plt.figure(figsize=(10, 6))
plt.plot(data['x'], data['y'])
plt.xlabel('X Label')
plt.ylabel('Y Label')
plt.title('Graph Title')
plt.savefig('output_graph.png', dpi=300, bbox_inches='tight')
plt.close()
print("Graph saved successfully")
EOF
2. Python-docx Document Creation
pip install python-docx -q
python3 << 'EOF'
from docx import Document
from docx.shared import Inches, Pt
from docx.enum.text import WD_ALIGN_PARAGRAPH
doc = Document()
# Add title
title = doc.add_heading('Document Title', 0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
# Add sections
doc.add_heading('Section 1', level=1)
doc.add_paragraph('Content for section 1.')
# Add table
table = doc.add_table(rows=3, cols=3)
table.style = 'Table Grid'
# Save document
doc.save('output.docx')
print("Document created successfully")
EOF
3. General File Operations
python3 << 'EOF'
import json
import os
# Read input file
with open('input.json', 'r') as f:
data = json.load(f)
# Process data
result = {'processed': True, 'items': len(data)}
# Write output
with open('output.json', 'w') as f:
json.dump(result, f, indent=2)
print(f"Processed {result['items']} items")
EOF
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.
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.
- 3d ago First seen · 130 lines · 18 tokens per session scan A 47cfc25ad614
python-heredoc-fallback is a skill published in the GitHub repository HKUDS/OpenSpace (7,510 stars, last pushed 25d ago), licensed MIT. It adds 18 tokens to every session and 827 once invoked, about $0.0001 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.
Other skills, from other repositories
excel-addin-debugging
Debug and automate Excel add-ins running in WebView2 with Office.js awareness — active range inspection, Office context detection, dialog API handling, and requirement-set probing. Use when the user mentions Office.js, Excel.run, taskpane, ribbon command, named ranges, or an add-in dialog.
bug-report-writer
Converts rough notes, casual descriptions, console errors, or quick observations into professional, complete bug reports — exported as a formatted Excel (.xlsx) file ready for Excel, Google Sheets, Jira, or Azure DevOps. Use this skill whenever the user mentions: "write a bug report", "log a bug", "report this issue"…
troubleshooting
Uses Excel WebView2 MCP and documentation to troubleshoot connection and target issues. Trigger this skill when listpages, newpage, or navigatepage fail, or when the server initialization fails.
dcf-model
Build discounted cash flow valuation workbooks in Excel.
audit-xls
Audit a spreadsheet for formula accuracy, errors, and common mistakes. Scopes to a selected range, a single sheet, or the entire model (including financial-model integrity checks like BS balance, cash tie-out, and logic sanity). Triggers on "audit this sheet", "check my formulas", "find formula errors", "QA this…
google-drive-sheets
Find, read, export, edit, and manage the user's Google Drive, Docs, Sheets, and Slides through per-user OAuth.