evylegzhanin/agent-with-sandbox/python-scripts
- community
Checking that the SKILL.md file is still in the repository.
Use this skill when writing Python scripts, staging them with write_python_file, running them with run_python_file, or recovering from script errors in the sandbox.
Install
npx vskill@latest install evylegzhanin/agent-with-sandbox/python-scriptsSKILL.md
Python Scripts — Checklist and Recovery
These rules apply whenever you use write_python_file or run_python_file.
Before every Python tool call
- Tool choice — always
write_python_filethenrun_python_filefor each script. Never callrun_python_filebeforewrite_python_file. - Staged file size — keep each
write_python_filecall to ≤120 lines. If you need more, split across multiple files (for examplestep1.py,step2.py) andimport step1fromstep2. - Always use `code` — every script is a plain Python string with real newlines. There is no
linesfield on Python tools. - Complete scripts — every call must send a full runnable script for the current step (or active todo). Never send imports-only stubs,
pass, or placeholders (...,# TODO). - Minimal imports — only what this script uses.
- Persist intermediates — save DataFrames under
/workspace/outas.csv(or.json/.xlsxwhen needed) and reload in later calls:
``python df.to_csv("/workspace/out/sales.csv", index=False) # later script: df = pd.read_csv("/workspace/out/sales.csv") ` Do **not** use to_parquet / read_parquet` — pyarrow and fastparquet are not installed. Check Workspace state in tool results for paths and shapes already written.
Sandbox environment
Pre-installed Python packages (no pip install):
- pandas, numpy
- openpyxl, xlsxwriter (Excel read/write)
- python-pptx (
from pptx import Presentation) - python-docx (
from docx import Document) - matplotlib, seaborn, Pillow
Not available: pyarrow, fastparquet, scipy, scikit-learn, plotly, requests, and any package not listed above. Parquet files cannot be read or written; use CSV/JSON/Excel instead.
Good example — stage then run
Then: run_python_file({"script_path": "eda_profile.py"}).
The harness validates the whole script with ast.parse (Python 3.11) and auto-formats with Black.
Do not send
- Import-only stubs — the harness rejects these.
- Scripts with
passor...as the only body. - Variable names that shadow keywords (
class,def,for, …). - Placeholder abbreviations (
...,# rest of code,# same as above). - The same rejected payload twice — change the code, or call
revise_todo_list. - Code wrapped in markdown ```python fences inside the JSON argument — use plain Python.
Recovery
| Situation | Next action | |
|---|---|---|
| Stub — imports only, no body | Send the full script with real statements after imports | |
Syntax / indent — syntax error or IndentationError | Rewrite with proper indentation and real newlines | |
keyword_identifier — class =, def =, other keyword assignments | Rename to pclass, passenger_class, fn, etc.; do not retry the same name | |
| Truncated — cut-off string or token limit | Split work via revise_todo_list or use smaller write_python_file modules | |
Runtime — KeyError, missing column, wrong sheet | Run a minimal diagnostic, then fix and retry | |
Parquet engine — ImportError mentioning pyarrow/fastparquet | Switch to to_csv / read_csv (or .json / Excel); do not retry parquet |
Tool errors include a failure class in summary. If the same class appears twice in a row, change approach or call revise_todo_list instead of repeating the same script.
After stub or syntax errors, rewrite with a complete script. Split into smaller staged files when size limits reject the payload.
Validation (harness)
The code string is normalized (markdown fences stripped, line endings normalized), then checked with ast.parse (Python 3.11) before the sandbox runs. Invalid scripts return a syntax error with recovery hints; runtime errors come from sandbox stderr.
Limits
- No shell, no network, no package installation.
- Read inputs from
/workspace/input; write persistent outputs under/workspace/out. - The harness validates syntax (Python 3.11) and auto-formats with Black.
- If
run_python_filereports script not found, callwrite_python_filefirst.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/prompts/skills/python-scripts/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/evylegzhanin/agent-with-sandbox/python-scripts)