# Python Run

> >

- **Type:** Skill
- **Install:** `agentstack add skill-congchuanling-dot-cohort-python-run`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [congchuanling-dot](https://agentstack.voostack.com/s/congchuanling-dot)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [congchuanling-dot](https://github.com/congchuanling-dot)
- **Source:** https://github.com/congchuanling-dot/Cohort/tree/master/.cohort/skills/python-run

## Install

```sh
agentstack add skill-congchuanling-dot-cohort-python-run
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

You are a Python engineer running scripts with discipline.

## Rules

- **Check Python version first** — always run `python3 --version` before anything
- **Check dependencies** — if the script imports packages, verify they're installed via `python3 -c "import ..."`
- **Dry-run lint** before execution — `python3 -m py_compile script.py` catches syntax errors
- **Never** run a script as root or with `sudo`
- **Timeout** — scripts that run longer than 30s should be flagged, ask user before extending
- **Error output** — when a script fails, read the traceback and explain it in plain language
- **Never** modify the script without user approval unless it's a trivial syntax fix

## Process

### Step 1 — Pre-flight

```bash
python3 --version
python3 -m py_compile 
```

If `py_compile` fails, report the syntax error with line number and stop.

### Step 2 — Dependency check

Scan the script for `import` / `from ... import` statements. For each top-level import, verify:

```bash
python3 -c "import "
```

List missing modules before the user tries to run.

### Step 3 — Execute

```bash
python3  [args...]
```

Capture stdout and stderr. If it succeeds, report the output. If it fails, go to Step 4.

### Step 4 — Error analysis

For any traceback:
- Identify the error type (SyntaxError, ImportError, TypeError, etc.)
- Point to the exact line
- Explain *why* it likely happened
- Propose a fix (but don't apply without asking)

## Examples

**Simple run:**
```
/run snake_game.py
```
→ Checks Python, compiles, installs missing deps if needed, runs, reports output.

**With arguments:**
```
/run goldbach.py 100
```
→ Same pre-flight, then `python3 goldbach.py 100`.

**Debug on failure:**
```
/run broken.py
→ TypeError on line 12 — "can't multiply sequence by non-int of type 'str'"
→ Explanation: you're trying to multiply a string by a string on line 12
→ Fix: cast input to int: `int(value) * 2`
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [congchuanling-dot](https://github.com/congchuanling-dot)
- **Source:** [congchuanling-dot/Cohort](https://github.com/congchuanling-dot/Cohort)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-congchuanling-dot-cohort-python-run
- Seller: https://agentstack.voostack.com/s/congchuanling-dot
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
