code-runner
Skill0 starsChanged 2 months agoMITView on GitHub
This skill enables the LLM to help users execute Python scripts located in the file system by producing a strictly-formatted JSON output that describes the script to run. The JSON output is then parsed by the code_runner_execute skill to run the script via subprocess.run() and return the output. The default working directory is the current directory (./) unless the user specifies otherwise. Invoke this skill whenever the user's request implies executing a Python script. Look for phrases such as: Do…
- Reads credentials
- Deletes or force-pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- TaiMaBenJi/taima-skillstheir own version, first seen Oct 11, 2026
- fastclaw-ai/fastclawtheir own version, first seen Oct 8, 2026
- formulahendry/agent-skill-code-runnertheir own version, first seen Dec 20, 2025
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- fastclaw-ai/fastclaw★ 1.4ksame name
- formulahendry/agent-skill-code-runner★ 16same name
- TaiMaBenJi/taima-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- cmd-runnerSkill
- curlSkill
- db-accessorSkill
- file-changerSkill
- file-creatorSkill
- file-finderSkill
- file-grepSkill
- file-listSkill
- file-readerSkill
- folder-creatorSkill
- folder-finderSkill
- folder-listSkill
- scpSkill
- sshSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 24
Do NOT use this skill when the user wants to:
- Very specific: line 25
Create or modify files → use file-creator / file-changer.
- Very specific: line 26
Read files → use file-reader.
- Distinctive: line 32
When the skill is triggered, the LLM must:
- Very specific: line 90
All string values must properly escape special characters (", \, newline as \n, tab as \t).
- Very specific: line 92
Do NOT emit multiple code-runner payloads in a single response.
- Distinctive: line 93
If the user does not specify a script path, do NOT execute this skill — ask for the script path first or produce an empty action.
- Very specific: line 234
Never execute Python scripts that could harm the system (e.g., scripts containing os.remove, shutil.rmtree, subprocess calls to rm -rf /, …
- Distinctive: line 238
Always echo the JSON payload so the user can review before execution.
- Distinctive: line 239
Do not execute scripts that modify system configuration or install software without explicit user confirmation.
- Very specific: line 258
If not specified, auto-detects based on sys.platform.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
🐍 Code Runner Skill
Overview
This skill enables the LLM to help users execute Python scripts located in the file system by producing a strictly-formatted JSON output that describes the script to run. The JSON output is then parsed by the code_runner_execute skill to run the script via subprocess.run() and return the output.
The default working directory is the current directory (./) unless the user specifies otherwise.
Skill Name
code-runner
When to Use This Skill
Invoke this skill whenever the user's request implies executing a Python script. Look for phrases such as:
- "run the script ..."
- "execute ..."
- "run a Python script ..."
- "run this code ..."
- "python ..."
- "call the script ..."
Do NOT use this skill when the user wants to:
- Create or modify files → use
file-creator/file-changer. - Read files → use
file-reader. - Make HTTP requests → use
curl. - Execute a raw shell command that is not a Python script → use
cmd-runner.
What the LLM Must Do
When the skill is triggered, the LLM must:
- Extract the following from the user's request (asking clarifying questions only if truly ambiguous):
- scriptPath or fileName (required): The path (directory + filename) of the Python script to execute.
- method (optional): The execution method. Defaults to
script(running the whole script) when method is empty. Possible values:script(default),function(run a specific function). - args (optional): Command-line arguments to pass to the script (or the target function/statement name when method is
function/statement). - timeout (optional): Maximum execution time in seconds. Defaults to
30. - shelltype (optional): The type of shell used to invoke Python. Possible values: "bash" (Linux/Unix default), "maccmd" (macOS terminal), "windowsbat" (Windows Command Prompt), "windowsps" (Windows PowerShell). If not specified, auto-detect based on the OS.
- env (optional): A dictionary of environment variables to set.
- description (optional): One-line summary of the task.
- sequential (optional): If the output is needed as input for a follow-up AI task.
- prompt (optional): Follow-up prompt for all of the following tasks when
sequentialis set.
- Produce a response containing a single pure JSON object that STRICTLY follows the schema below. No code fences, no extra prose.
Required JSON Output Schema
The LLM's response MUST be a pure JSON string with no code blocks.
{
"action": "run_code_script",
"thinking": "<ai-thinking-trace>",
"sequential": {
"prompt": "Follow-up prompt for all of the following tasks."
},
"properties": [
{ "name": "scriptPath", "value": "path/to/script.py" },
{ "name": "fileName", "value": "script.py" },
{ "name": "args", "value": "" },
{ "name": "timeout", "value": "30" },
{ "name": "shelltype", "value": "one of bash, maccmd, windowsbat, windowsps according to the os" },
{ "name": "env", "value": "{}" },
{ "name": "description","value": "" }
]
}Field Rules
| Field | Type | Required | Notes |
action | string | Yes | Must be exactly "run_code_script". |
scriptPath | string | Yes | The directory portion of the script path, or full path. Must be non-empty. |
fileName | string | Yes | The Python file name including .py. May be omitted if included in scriptPath. |
method | string | No | Execution method: script (default), function |
args | string | No | Command-line arguments passed to the script, or target name for function/statement. |
timeout | string | No | Timeout in seconds as string. Default "30". Max "120". |
shelltype | string | No | Type of shell: "bash", "maccmd", "windowsbat", "windowsps". Defaults to OS-based auto-detect. |
env | string | No | JSON-encoded dictionary of environment variables. Default "{}". |
description | string | No | Human-readable purpose of the execution. |
sequential | object | No | Whether the output should feed a follow-up AI task. Default null. |
prompt | string | No | Follow-up prompt for all of following tasks when sequential is set. |
Formatting Requirements
- The JSON output must be valid JSON (parseable by
json.loads). - All string values must properly escape special characters (
",\, newline as\n, tab as\t). envmust be a valid JSON object string (e.g.,{"PATH": "/usr/bin"}).- Do NOT emit multiple
code-runnerpayloads in a single response. - If the user does not specify a script path, do NOT execute this skill — ask for the script path first or produce an empty action.
Response Pattern for the LLM
A typical assistant reply should look like the following. No other output is needed. Output must be in pure JSON format.
{ "action": "run_code_script", "thinking": "User wants to run a Python script.", "sequential": { "prompt":"Follow-up prompt for all of following tasks" }, "properties": [ { "name": "scriptPath", "value": "./scripts/" }, { "name": "fileName", "value": "hello.py" }, { "name": "args", "value": "" }, { "name": "timeout", "value": "30" }, { "name": "shelltype", "value": "bash" }, { "name": "env", "value": "{}" }, { "name": "description","value": "Run hello.py" } ] }
Decision Logic
User Prompt
|
+-- Does the request imply executing a Python script?
| |
| +-- YES --> Extract scriptPath/fileName/method/args/timeout/flags --> Emit ONE `code-runner` JSON payload
| |
| +-- NO --> Do not use this skillExamples
Example 1: Simple script run (Linux/macOS)
User: "Run scripts/hello.py."
LLM emits:
{
"action": "run_code_script",
"thinking": "User wants to run a Python script.",
"properties": [
{ "name": "scriptPath", "value": "scripts/" },
{ "name": "fileName", "value": "hello.py" },
{ "name": "method", "value": "run" },
{ "name": "args", "value": "" },
{ "name": "timeout", "value": "30" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "Run hello.py" }
]
}Example 2: Script run with arguments
User: "Run tools/parse.py with arguments --input data.txt."
LLM emits:
{
"action": "run_code_script",
"thinking": "User wants to run a Python script with command-line arguments.",
"properties": [
{ "name": "scriptPath", "value": "tools/" },
{ "name": "fileName", "value": "parse.py" },
{ "name": "args", "value": "--input data.txt" },
{ "name": "timeout", "value": "30" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "Run parse.py with arguments" }
]
}Example 3: Script run with environment variables
User: "Run env_test.py with MY_VAR=hello."
LLM emits:
{
"action": "run_code_script",
"thinking": "User wants to run a script with custom environment variables.",
"properties": [
{ "name": "scriptPath", "value": "./" },
{ "name": "fileName", "value": "env_test.py" },
{ "name": "args", "value": "" },
{ "name": "timeout", "value": "30" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{\"MY_VAR\": \"hello\"}" },
{ "name": "description", "value": "Test environment variable" }
]
}Example 4: Long-running script with timeout
User: "Run long_task.py but timeout after 10 seconds."
LLM emits:
{
"action": "run_code_script",
"thinking": "User wants a script that might take long, with a short timeout.",
"properties": [
{ "name": "scriptPath", "value": "./" },
{ "name": "fileName", "value": "long_task.py" },
{ "name": "args", "value": "" },
{ "name": "timeout", "value": "10" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "Test timeout" }
]
}Example 5: Execute a specific function
User: "Run the function main in utils.py."
LLM emits:
{
"action": "run_code_script",
"thinking": "User wants to execute a specific function in a Python script.",
"properties": [
{ "name": "scriptPath", "value": "./" },
{ "name": "fileName", "value": "utils.py" },
{ "name": "method", "value": "function" },
{ "name": "args", "value": "main" },
{ "name": "timeout", "value": "30" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "Run main() function in utils.py" }
]
}Safety Guidelines
- Never execute Python scripts that could harm the system (e.g., scripts containing
os.remove,shutil.rmtree,subprocesscalls torm -rf /,dd,format C:, fork bombs, etc.). Block such scripts. - Refuse scripts that attempt to access sensitive paths (e.g.,
C:\Windows\,/etc/shadow,~/.ssh/). - Enforce a reasonable timeout (default 30s, max 120s).
- Limit the output size to prevent excessive output (e.g., 1MB max stdout/stderr).
- Always echo the JSON payload so the user can review before execution.
- Do not execute scripts that modify system configuration or install software without explicit user confirmation.
Executable Skills
code_runner_execute
Parses a code-runner JSON payload and executes the Python script.
Parameters:
json_payload(str): The JSON string produced by the LLM.
Behavior:
- Validates the schema (including
shelltypeif provided). - Checks for dangerous script contents and refuses to execute them.
- Resolves the script path using
scriptPathandfileName. - Uses the specified
shelltypeto determine the appropriate shell executable for invoking Python:"bash"→ runs with/bin/bash(orbashon PATH)."maccmd"→ runs with/bin/zsh(macOS default)."windowsbat"→ runs withcmd.exe."windowsps"→ runs withpowershell.exe.- If not specified, auto-detects based on
sys.platform.
- Runs
python <scriptPath/fileName> <args>viasubprocess.run(). - Supports execution methods:
run(whole script),function(specific function),statement(specific statement/expression). - Sets environment variables if
envis provided. - Enforces timeout.
- Returns a JSON string containing
stdout,stderr, andreturncode. [axle] 2026-08-22 11:12:37 continue: False [axle] 2026-08-22 11:12:37 result: User Prompt | +-- Does the request imply executing a Python script? | | | +-- YES --> Extract scriptPath/fileName/method/args/timeout/flags --> Emit ONEcode-runnerJSON payload | | | +-- NO --> Do not use this skill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

