Agent skill

Python Script Runner

by congchuanling-dot in congchuanling-dot/Cohort

Runs a Python script with checks first: confirms the interpreter version, compiles it for syntax errors, verifies imports, then explains any traceback in plain language.

MITAuto-check: notesDevelopment

Install Python Script Runner

skills CLI
$ npx skills add congchuanling-dot/Cohort --skill python-run -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install congchuanling-dot/Cohort python-run --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/congchuanling-dot/Cohort.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cohort/skills/python-run .claude/skills/python-run && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
python-run
GitHub stars
199
Token cost
~577 tokens
SKILL.md length
216 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Runs a Python script with checks first: confirms the interpreter version, compiles it for syntax errors, verifies imports, then explains any traceback in plain language.

  • Works in 4 steps: Pre-flight → Dependency check → Execute → …
  • Running a Python script and getting a clear explanation if it fails
  • SKILL.md covers Rules, Process and Examples
  • Calls python3

What it does

The skill wraps a short routine around running a .py file. It checks python3 --version, runs py_compile to catch syntax errors (stopping with the line number if that fails), scans the imports and tests each top-level module so missing packages are listed before the run, then executes the script with its arguments and captures stdout and stderr.

When a script fails, the agent identifies the error type, points to the line, explains the likely cause in plain language and proposes a fix without applying it. It never runs scripts as root or with sudo, flags anything that runs longer than 30 seconds and asks before extending, and edits a script without approval only for a trivial syntax fix.

When your agent uses it

  • Running a Python script and getting a clear explanation if it fails
  • Checking that a script's imports are installed before running it
  • Debugging a .py file that raises a traceback

Example prompts

  • “Run backup_photos.py and tell me if any packages are missing.”
  • “Execute goldbach.py with the argument 100 and show me the output.”
  • “Debug broken.py; it throws a TypeError and I can't tell why.”

Requirements

  • Python 3 available as python3
  • Pre-approved tools (allowed-tools): Bash, Read, Write

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Pre-flight
  2. Dependency check
  3. Execute
  4. Error analysis

What it can do on your machine

Read from SKILL.md and the folder at commit a0479a6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Write

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Python Script Runner loads about 577 tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 216 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~577

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Write

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from congchuanling-dot/Cohort at commit a0479a6, republished under its MIT licence (© congchuanling-dot). 216 words, ~577 tokens.

Download SKILL.mdSave it as .claude/skills/python-run/SKILL.md (or your agent's skills folder).
name
python-run
description
Run and debug Python scripts in the project. Use when the user says "run python", "execute this script", "debug this py file", or wants to run/modify a .py file. Handles dependency checks, linting, execution, and error analysis.
allowed-tools
Bash, Read, Write
user-invocable
true
argument-hint
[script.py] [args...]

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 <script>

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 <module>"

List missing modules before the user tries to run.

Step 3 — Execute
bash
python3 <script> [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`

© congchuanling-dot, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cohort/skills/python-run of congchuanling-dot/Cohort.

Open the folder on GitHubat commit a0479a6

Compare with similar skills

Python Script Runner next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Python Script Runner compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Script Runner this skillcongchuanling-dot/Cohort199—~577Automated safety check: NotesMIT
Smart File Writerforyourhealth111-pixel/Vibe-Skills3.6k—~2.6kAutomated safety check: PassApache-2.0
Code Execution Fallback and Path AnchoringHKUDS/OpenSpace7.7k—~1.1kAutomated safety check: PassMIT
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
LangBot Plugin Developmentlangbot-app/LangBot18k—~3.9kAutomated safety check: PassApache-2.0
Python Performance Optimizationwshobson/agents40k12 repos~814Automated safety check: PassMIT

Similar skills

  • Smart File Writer

    foryourhealth111-pixel/Vibe-Skills

    Diagnoses why a file write failed (permissions, disk space, path length, locks, read-only mounts) before retrying, instead of repeating the same call blindly.

    3.6k GitHub stars~2.6k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Fallback ladder for failed sandboxed code runs, plus the habit of fixing the working directory first so generated files land in the right place.

    7.7k GitHub stars~1.1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • LangBot Plugin Development

    langbot-app/LangBot

    Guides building, debugging and testing LangBot plugins: components, SDK calls, README and locale rules, SDK pitfalls and WebSocket-based testing.

    18k GitHub stars~3.9k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 12 repos~814 tokens
    DevelopmentAuto-check passed
  • Git History Bug Audit

    ben-manes/caffeine

    Audits a module by walking its git history commit by commit, tracking unresolved issues forward, and reporting the ones that survive to HEAD as findings.

    18k GitHub stars~3.3k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from congchuanling-dot/Cohort

  • Atomic Git Commit

    congchuanling-dot/Cohort

    Creates atomic git commits with Conventional Commits messages, staging specific files and adding a short prose body only when a decision needs explaining.

    199 GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check: notes

Works with

Categories

Questions about Python Script Runner

What does Python Script Runner do?

Runs a Python script with checks first: confirms the interpreter version, compiles it for syntax errors, verifies imports, then explains any traceback in plain language. py file. It checks python3 --version, runs py_compile to catch syntax errors (stopping with the line number if that fails), scans the imports and tests each top-level module so missing packages are listed before the run, then executes the script with its arguments and captures stdout and stderr.

When should I use Python Script Runner?

Python Script Runner fits situations like: running a Python script and getting a clear explanation if it fails; checking that a script's imports are installed before running it; debugging a .py file that raises a traceback.

How do I install Python Script Runner in Claude Code?

Run `npx skills add congchuanling-dot/Cohort --skill python-run -a claude-code`. Or copy the skill folder (.cohort/skills/python-run in congchuanling-dot/Cohort) into .claude/skills/python-run in your project. Claude Code loads it when a task matches its description.

How do I install Python Script Runner in Codex?

Run `npx skills add congchuanling-dot/Cohort --skill python-run -a codex`. Or copy the skill folder (.cohort/skills/python-run in congchuanling-dot/Cohort) into .agents/skills/python-run in your project. Codex loads it when a task matches its description.

Can I use Python Script Runner in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add congchuanling-dot/Cohort --skill python-run -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-run, .gemini/skills/python-run, .github/skills/python-run and .opencode/skills/python-run in your project.

What does Python Script Runner need to run?

Going by SKILL.md and its folder, Python Script Runner needs the command-line tools its instructions call (python3). Our summary lists: Python 3 available as python3. Its frontmatter pre-approves these tools: Bash, Read, Write.

Does Python Script Runner access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Python Script Runner safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Python Script Runner use?

Python Script Runner is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Python Script Runner use?

About 577 tokens (SKILL.md is roughly 2.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Python Script Runner?

Skills that share tags, products or a category with Python Script Runner: Smart File Writer (foryourhealth111-pixel/Vibe-Skills, 3.6k stars), Code Execution Fallback and Path Anchoring (HKUDS/OpenSpace, 7.7k stars), Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars) and LangBot Plugin Development (langbot-app/LangBot, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Script Runner?

congchuanling-dot (a GitHub user) maintains it in congchuanling-dot/Cohort, which has 199 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on August 15, 2026.

Source: congchuanling-dot/Cohort on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.