cmd-runner
Skill0 starsChanged 2 months agoMITView on GitHub
This skill enables the LLM to help users execute OS shell commands by producing a strictly-formatted JSON output that describes the command to run. The JSON output is then parsed by the cmd_runner_execute skill to run the command 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 shell command. Look for phrases such as: Do NOT use this skill…
- Reads credentials
- Deletes or force-pushes
In this repository14 other files it gives its agents.
- code-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
10 rules. About 0 are common, 5 are distinctive, and 5 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.
5
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 26
Do NOT use this skill when the user wants to:
- Very specific: line 27
Create or modify files → use file-creator / file-changer.
- Very specific: line 28
Read files → use file-reader.
- Distinctive: line 33
When the skill is triggered, the LLM must:
- Very specific: line 89
All string values must properly escape special characters (", \, newline as \n, tab as \t).
- Very specific: line 91
Do NOT emit multiple cmd-runner payloads in a single response.
- Distinctive: line 92
If the user does not specify a command, do NOT execute this skill — ask for the command first or produce an empty action.
- Very specific: line 251
Never execute commands that could harm the system (e.g., rm -rf /, dd if=/dev/zero of=/dev/sda, :(){ :|:& };:, format C:, etc.).
- Distinctive: line 255
Always echo the JSON payload so the user can review before execution.
- Distinctive: line 256
Do not execute commands that modify system configuration or install software without explicit user confirmation.
≈ “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
🖥️ Command Runner Skill
Overview
This skill enables the LLM to help users execute OS shell commands by producing a strictly-formatted JSON output that describes the command to run. The JSON output is then parsed by the cmd_runner_execute skill to run the command via subprocess.run() and return the output.
The default working directory is the current directory (./) unless the user specifies otherwise.
Skill Name
cmd-runner
When to Use This Skill
Invoke this skill whenever the user's request implies executing a shell command. Look for phrases such as:
- "run the command ..."
- "execute ..."
- "run a shell command ..."
- "compile ..."
- "start ..."
- "install ..."
- "check version of ..."
- "run a Python 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.
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):
- command (required): The shell command string to execute.
- cwd (optional): The working directory for the command. Defaults to current working directory (
./). - timeout (optional): Maximum execution time in seconds. Defaults to
30. - shell (optional): Whether to run via shell. Defaults to
true. - shelltype (required): The type of shell to use. Possible values: "bash" (Linux/Unix default), "maccmd" (macOS terminal), "windowsbat" (Windows Command Prompt), "windowsps" (Windows PowerShell). If not specified, the LLM should specify the output command shell type for the skill executor to run.
- env (optional): A dictionary of environment variables to set.
- description (optional): One-line summary of the command.
- 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_command",
"thinking": "<ai-thinking-trace>",
"sequential": {
"prompt": "Follow-up prompt for all of the following tasks."
},
"properties": [
{ "name": "command", "value": "<shell-command>" },
{ "name": "cwd", "value": "./" },
{ "name": "timeout", "value": "30" },
{ "name": "shell", "value": "true" },
{ "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_command". |
command | string | Yes | The shell command to execute. Must be non-empty. |
cwd | string | No | Working directory. Defaults to ./. |
timeout | string | No | Timeout in seconds as string. Default "30". |
shell | boolean | No | Use shell to execute. Default true. |
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 command. |
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
cmd-runnerpayloads in a single response. - If the user does not specify a command, do NOT execute this skill — ask for the command 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_command", "thinking": "User wants to list files in the current directory.", "sequential": { "prompt":"Follow-up prompt for all of following tasks" }, "properties": [ { "name": "command", "value": "ls -la" }, { "name": "cwd", "value": "./" }, { "name": "timeout", "value": "30" }, { "name": "shell", "value": "true" }, { "name": "shelltype", "value": "bash" }, { "name": "env", "value": "{}" }, { "name": "description", "value": "List files with details" } ] }
Decision Logic
User Prompt
|
+-- Does the request imply executing a shell command?
| |
| +-- YES --> Extract command/cwd/timeout/flags --> Emit ONE `cmd-runner` JSON payload
| |
| +-- NO --> Do not use this skillExamples
Example 1: Simple shell command (Linux/macOS)
User: "Run ls -la in the current directory."
LLM emits:
{
"action": "run_command",
"thinking": "User wants to list files in the current directory.",
"properties": [
{ "name": "command", "value": "ls -la" },
{ "name": "cwd", "value": "./" },
{ "name": "timeout", "value": "30" },
{ "name": "shell", "value": "true" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "List directory contents" }
]
}Example 2: Simple shell command (Windows Command Prompt)
User: "Run dir /w in the current directory."
LLM emits:
{
"action": "run_command",
"thinking": "User wants to list files in the current directory using Windows Command Prompt.",
"properties": [
{ "name": "command", "value": "dir /w" },
{ "name": "cwd", "value": "./" },
{ "name": "timeout", "value": "30" },
{ "name": "shell", "value": "true" },
{ "name": "shelltype", "value": "windowsbat" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "List directory contents wide format" }
]
}Example 3: Simple shell command (Windows PowerShell)
User: "Run Get-ChildItem in the current directory."
LLM emits:
{
"action": "run_command",
"thinking": "User wants to list files using PowerShell.",
"properties": [
{ "name": "command", "value": "Get-ChildItem" },
{ "name": "cwd", "value": "./" },
{ "name": "timeout", "value": "30" },
{ "name": "shell", "value": "true" },
{ "name": "shelltype", "value": "windowsps" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "List directory contents via PowerShell" }
]
}Example 4: Command with custom working directory
User: "Run make build in the projects/myapp directory."
LLM emits:
{
"action": "run_command",
"thinking": "User wants to build the project from a specific directory.",
"properties": [
{ "name": "command", "value": "make build" },
{ "name": "cwd", "value": "projects/myapp" },
{ "name": "timeout", "value": "30" },
{ "name": "shell", "value": "true" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "Build the project" }
]
}Example 5: Command with environment variables
User: "Run echo $MY_VAR with MY_VAR=hello."
LLM emits:
{
"action": "run_command",
"thinking": "User wants to run a command with custom environment variables.",
"properties": [
{ "name": "command", "value": "echo $MY_VAR" },
{ "name": "cwd", "value": "./" },
{ "name": "timeout", "value": "30" },
{ "name": "shell", "value": "true" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{\"MY_VAR\": \"hello\"}" },
{ "name": "description", "value": "Test environment variable" }
]
}Example 6: Long-running command with timeout
User: "Run sleep 60 but timeout after 10 seconds."
LLM emits:
{
"action": "run_command",
"thinking": "User wants a command that might take long, with a short timeout.",
"properties": [
{ "name": "command", "value": "sleep 60" },
{ "name": "cwd", "value": "./" },
{ "name": "timeout", "value": "10" },
{ "name": "shell", "value": "true" },
{ "name": "shelltype", "value": "bash" },
{ "name": "env", "value": "{}" },
{ "name": "description", "value": "Test timeout" }
]
}Safety Guidelines
- Never execute commands that could harm the system (e.g.,
rm -rf /,dd if=/dev/zero of=/dev/sda,:(){ :|:& };:,format C:, etc.). Block such commands. - Refuse commands 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 commands that modify system configuration or install software without explicit user confirmation.
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.

