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 agentmods add skills/hkuds/openspace/shell-python-fallbacknpx skills add HKUDS/OpenSpace --skill shell-python-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/shell-python-fallback)<a href="https://agentmods.dev/skills/hkuds/openspace/shell-python-fallback"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/shell-python-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.00021 | $0.00719 |
| Opus 5 | $0.00010 | $0.00360 |
| Sonnet 5 | $0.00004 | $0.00144 |
| Haiku 4.5 | $0.00002 | $0.00072 |
Grade A, and why
shell-python-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 2d 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 — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Shell Python Fallback
When to Use
Use this pattern when execute_code_sandbox or shell_agent tools consistently fail with "unknown error" for tasks such as:
- Data processing and transformation
- PDF generation (reportlab, etc.)
- File parsing and manipulation
- Any Python script execution that requires reliability
The Pattern
Instead of using code execution tools, embed your Python script directly in a run_shell command using a heredoc:
python3 << 'EOF'
# Your Python code here
import sys
print("Hello from embedded Python")
EOF
Step-by-Step Instructions
-
Identify the failure: When
execute_code_sandboxorshell_agentreturns "unknown error" repeatedly (2+ attempts), switch to this fallback. -
Write your Python script: Prepare the complete Python code you need to execute.
-
Embed in run_shell: Use
run_shellwith a heredoc syntax:
Command: python3 << 'EOF'
import json
# Your complete script here
data = {"key": "value"}
print(json.dumps(data))
EOF
-
Handle multi-line scripts: For longer scripts, ensure proper indentation is preserved. The heredoc preserves whitespace exactly.
-
Check output: Parse the stdout from
run_shellto verify success or capture errors.
Example: PDF Generation
python3 << 'EOF'
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
c = canvas.Canvas("output.pdf", pagesize=letter)
c.drawString(100, 750, "Hello World")
c.save()
print("PDF created successfully")
EOF
Example: Data Processing
python3 << 'EOF'
import csv
import json
data = []
with open('input.csv', 'r') as f:
reader = csv.DictReader(f)
for row in reader:
data.append(row)
with open('output.json', 'w') as f:
json.dump(data, f, indent=2)
print(f"Processed {len(data)} records")
EOF
Best Practices
- Quote the EOF delimiter (
<< 'EOF'not<< EOF) to prevent shell variable expansion in your Python code - Include error handling in your Python script with try/except blocks
- Print status messages to stdout so you can verify execution succeeded
- Use absolute paths or ensure working directory is correct
- Test incrementally: Start with a minimal script, then expand
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.
- 2d ago First seen · 102 lines · 21 tokens per session scan A dc2dfba31c58
shell-python-fallback is a skill published in the GitHub repository HKUDS/OpenSpace (7,510 stars, last pushed 24d ago), licensed MIT. It adds 21 tokens to every session and 719 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
nutrient-python-sdk
Nutrient Python SDK — the nutrient-sdk PyPI package for in-process server-side PDF and document processing in Python. Brand-new (launched Q1 2026); the older third-party pspdfkit PyPI package is unrelated to Nutrient and unmaintained. No external server, no DWS dependency — runs natively inside the Python process.…
xberg
Extract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using Xberg. Use when writing code that calls Xberg APIs in Python, Node.js/TypeScript, Rust, or CLI. Covers installation, extraction (sync/async), configuration (OCR, chunking, output format)…
azure-ai-document-intelligence-ts
Extract text, tables, and structured data from documents using Azure Document Intelligence (@azure-rest/ai-document-intelligence). Use when processing invoices, receipts, IDs, forms, or building cu...
azure-ai-formrecognizer-java
Build document analysis applications with Azure Document Intelligence (Form Recognizer) SDK for Java. Use when extracting text, tables, key-value pairs from documents, receipts, invoices, or buildi...
neo4j-knowledge-graph
Use when designing, importing, querying, or modernizing Neo4j knowledge graphs from CSV, Excel, pandas, Cypher, py2neo, the official neo4j Python driver, vector indexes, or GraphRAG workflows.
md2pdf
Use when the user wants to convert one Markdown file into a publication-ready A4 PDF, especially when the source may contain Mermaid diagrams, ASCII diagrams, CJK text, tables, or pandoc/weasyprint edge cases. Works by copying the source to a pdf.md working file, converting diagrams, escaping PDF-breaking syntax…