agentleFS
yanggujunyanggujun/open-axle/skills/cmd-runner/SKILL.md

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

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
  1. Distinctive:

    Do NOT use this skill when the user wants to:

    line 26
  2. Very specific:

    Create or modify files → use file-creator / file-changer.

    line 27
  3. Very specific:

    Read files → use file-reader.

    line 28
  4. Distinctive:

    When the skill is triggered, the LLM must:

    line 33
  5. Very specific:

    All string values must properly escape special characters (", \, newline as \n, tab as \t).

    line 89
  6. Very specific:

    Do NOT emit multiple cmd-runner payloads in a single response.

    line 91
  7. Distinctive:

    If the user does not specify a command, do NOT execute this skill — ask for the command first or produce an empty action.

    line 92
  8. Very specific:

    Never execute commands that could harm the system (e.g., rm -rf /, dd if=/dev/zero of=/dev/sda, :(){ :|:& };:, format C:, etc.).

    line 251
  9. Distinctive:

    Always echo the JSON payload so the user can review before execution.

    line 255
  10. Distinctive:

    Do not execute commands that modify system configuration or install software without explicit user confirmation.

    line 256

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

🖥️ 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:

  1. 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 sequential is set.
  2. 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

FieldTypeRequiredNotes
actionstringYesMust be exactly "run_command".
commandstringYesThe shell command to execute. Must be non-empty.
cwdstringNoWorking directory. Defaults to ./.
timeoutstringNoTimeout in seconds as string. Default "30".
shellbooleanNoUse shell to execute. Default true.
shelltypestringNoType of shell: "bash", "maccmd", "windowsbat", "windowsps". Defaults to OS-based auto-detect.
envstringNoJSON-encoded dictionary of environment variables. Default "{}".
descriptionstringNoHuman-readable purpose of the command.
sequentialobjectNoWhether the output should feed a follow-up AI task. Default null.
promptstringNoFollow-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).
  • env must be a valid JSON object string (e.g., {"PATH": "/usr/bin"}).
  • Do NOT emit multiple cmd-runner payloads 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 skill

Examples

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

  1. 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.
  2. Refuse commands that attempt to access sensitive paths (e.g., C:\Windows\, /etc/shadow, ~/.ssh/).
  3. Enforce a reasonable timeout (default 30s, max 120s).
  4. Limit the output size to prevent excessive output (e.g., 1MB max stdout/stderr).
  5. Always echo the JSON payload so the user can review before execution.
  6. Do not execute commands that modify system configuration or install software without explicit user confirmation.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.