用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/HKUDS/OpenSpace --skill run-shell-fallback命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Incremental audio production with duration mismatch handling, adaptive stem extension, and pre-mix alignment verification
Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow
Incremental audio production with duration alignment handling, per-stem verification, and adaptive extension strategies
基于 SOC 职业分类
正在显示 SKILL.md
| name | run-shell-fallback |
| description | Use run_shell with inline Python as a reliable fallback when execute_code_sandbox or read_file fail |
This skill provides a reliable workaround when execute_code_sandbox or read_file fail with 'unknown error' by switching to run_shell with inline Python code.
Apply this pattern when you encounter:
execute_code_sandbox fails with "unknown error" or timeoutread_file fails to read accessible files with "unknown error"When read_file fails, use run_shell with Python or cat:
For text files:
run_shell(command="cat /path/to/file.txt")
For structured parsing (Python one-liner):
run_shell(command="python3 -c \"import json; print(json.load(open('/path/to/file.json')))\"")
For multi-line Python processing:
run_shell(command="python3 << 'EOF'
with open('/path/to/file.txt', 'r') as f:
content = f.read()
# Process content here
print(content.upper())
EOF")
When execute_code_sandbox fails, use run_shell with inline Python:
Simple one-liners:
run_shell(command="python3 -c \"print('Hello'); import os; print(os.getcwd())\"")
Multi-line scripts (heredoc):
run_shell(command="python3 << 'EOF'
import os
import json
def process_data(data):
return {k: v.upper() if isinstance(v, str) else v for k, v in data.items()}
with open('input.json') as f:
data = json.load(f)
result = process_data(data)
print(json.dumps(result, indent=2))
EOF")
With inline file write:
run_shell(command="python3 << 'EOF'
result = {'status': 'success', 'count': 42}
with open('output.json', 'w') as f:
json.dump(result, f, indent=2)
print('File written successfully')
EOF")
1. Attempt execute_code_sandbox or read_file
2. If failure with 'unknown error':
a. Determine task type (code execution vs file reading)
b. Choose inline Python approach (-c for simple, heredoc for complex)
c. Execute via run_shell
d. Parse output as needed
3. Continue with task using results from run_shell
Escape quotes properly in -c commands: Use \" for double quotes inside the command string
Use heredoc for complex scripts: When code exceeds 2-3 lines or needs multiple imports, use << 'EOF' syntax
Quote EOF marker: Use << 'EOF' (with quotes) to prevent variable expansion in the heredoc
Capture stdout: Design your inline Python to print results to stdout for easy capture
Error handling: Add try/except blocks in your inline Python to catch and report errors clearly
File paths: Use absolute paths when possible, or ensure working directory is correct
run_shell(command="python3 -c \"import json; data=json.load(open('config.json')); print(data['key'])\"")
run_shell(command="python3 << 'EOF'
import csv
with open('data.csv', 'r') as f:
reader = csv.DictReader(f)
rows = list(reader)
print(f\"Total rows: {len(rows)}\")
for row in rows[:5]:
print(row)
EOF")
run_shell(command="python3 << 'EOF'
import json
with open('input.json') as f:
data = json.load(f)
transformed = [item.upper() if isinstance(item, str) else item for item in data]
with open('output.json', 'w') as f:
json.dump(transformed, f, indent=2)
print('Transformation complete')
EOF")