agentleFS
williamcorrea23williamcorrea23/sap-router-skill/.agents/skills/automation-pilot-executor-executescript/SKILL.md

automation-pilot-executor-executescript

Skill1 starsChanged 4 months agoMITView on GitHub

Master the ExecuteScript executor for Automation Pilot commands. Covers script execution parameters, Base64 encoding, timeout/exit code handling, stdin/parameters/environment patterns, and language-specific commands (Python, Node.js, PowerShell). Use when building commands that execute shell scripts or custom code.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use sensitive variants when the script output contains credentials, tokens, or other secrets.

    line 229

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

Script Execution Guide

SAP Automation Pilot provides dedicated commands for each script language. Choose the right command for your language — do not use ExecuteScript as a bash wrapper to run Python, Node.js, or PowerShell.

Command Overview

CommandIDUse for
ExecuteScript:1scripts-sapcp:ExecuteScript:1Bash (legacy, Base64 script)
ExecuteScript:2scripts-sapcp:ExecuteScript:2Bash (recommended, plain text)
ExecutePythonScript:1scripts-sapcp:ExecutePythonScript:1Python scripts
ExecuteNodeJsScript:1scripts-sapcp:ExecuteNodeJsScript:1Node.js scripts
ExecutePowerShellScript:1scripts-sapcp:ExecutePowerShellScript:1PowerShell scripts

Each command also has a Sensitive* variant (e.g. SensitiveExecutePythonScript:1) that marks the output as sensitive so it is never logged.


ExecuteScript (Bash)

Version Differences (CRITICAL)

Version 1 (scripts-sapcp:ExecuteScript:1): script and stdin must be Base64-encoded
Version 2 (scripts-sapcp:ExecuteScript:2): Plain text — always prefer this

ParameterTypeRequiredDefaultNotes
scriptstring✅-V1: Base64 encoded / V2: Plain text
stdinstring❌-Sensitive. V1: Base64 / V2: Plain text. Multiple values: \n separator
parametersarray❌[]Passed as $1, $2, $3... in order
environmentobject❌{}Available as shell environment variables
timeoutnumber❌30Range: 15–600s
successExitCodesarray❌["0"]Use ["x"] to accept any exit code

Output keys: exitCode (number), result (array of output lines, last 64 KB)

Example

{
  "execute": "scripts-sapcp:ExecuteScript:2",
  "input": {
    "script": "echo \"$1 $2\"",
    "parameters": "[\"Hello\", \"World\"]",
    "timeout": "30"
  },
  "alias": "runScript",
  "description": null,
  "progressMessage": null,
  "initialDelay": null,
  "pause": null,
  "when": null,
  "validate": null,
  "autoRetry": null,
  "repeat": null,
  "errorMessages": [],
  "dryRun": null
}

Stdin (Sensitive Data)

{
  "execute": "scripts-sapcp:ExecuteScript:2",
  "input": {
    "script": "read password; echo \"Received ${#password} chars\"",
    "stdin": "$(.execution.input.password)",
    "timeout": "30"
  },
  "alias": "processPassword",
  "description": null,
  "progressMessage": null,
  "initialDelay": null,
  "pause": null,
  "when": null,
  "validate": null,
  "autoRetry": null,
  "repeat": null,
  "errorMessages": [],
  "dryRun": null
}

ExecutePythonScript

scripts-sapcp:ExecutePythonScript:1 — executes a Python script directly. The script field takes plain Python source code.

ParameterTypeRequiredDefaultNotes
scriptstring✅-Plain Python source code
packagesarray❌[]pip packages installed before execution
parametersarray❌[]Passed as positional args to the script
stdinstring❌-Sensitive. Passed to script's standard input
environmentobject❌{}Environment variables
timeoutnumber❌60Range: 15–600s
successExitCodesarray❌["0"]

Output keys: exitCode (number), result (array of output lines)

Example

{
  "execute": "scripts-sapcp:ExecutePythonScript:1",
  "input": {
    "script": "import requests\nprint(requests.__version__)",
    "packages": "[\"requests\"]",
    "timeout": "60"
  },
  "alias": "runPython",
  "description": null,
  "progressMessage": null,
  "initialDelay": null,
  "pause": null,
  "when": null,
  "validate": null,
  "autoRetry": null,
  "repeat": null,
  "errorMessages": [],
  "dryRun": null
}

ExecuteNodeJsScript

scripts-sapcp:ExecuteNodeJsScript:1 — executes a Node.js script directly. The script field takes plain JavaScript source code.

ParameterTypeRequiredDefaultNotes
scriptstring✅-Plain JavaScript source code
packagesarray❌[]npm packages installed before execution
npmrcstring❌-Sensitive. .npmrc content for private registry auth
parametersarray❌[]Passed as positional args to the script
stdinstring❌-Sensitive. Passed to script's standard input
environmentobject❌{}Environment variables
timeoutnumber❌30Range: 15–600s
successExitCodesarray❌["0"]

Output keys: exitCode (number), result (array of output lines)

Example

{
  "execute": "scripts-sapcp:ExecuteNodeJsScript:1",
  "input": {
    "script": "const axios = require('axios');\nconsole.log(axios.VERSION);",
    "packages": "[\"axios\"]",
    "timeout": "30"
  },
  "alias": "runNode",
  "description": null,
  "progressMessage": null,
  "initialDelay": null,
  "pause": null,
  "when": null,
  "validate": null,
  "autoRetry": null,
  "repeat": null,
  "errorMessages": [],
  "dryRun": null
}

ExecutePowerShellScript

scripts-sapcp:ExecutePowerShellScript:1 — executes a PowerShell script directly. The script field takes plain PowerShell source code.

ParameterTypeRequiredDefaultNotes
scriptstring✅-Plain PowerShell source code
modulesarray❌[]PowerShell modules installed before execution
parametersarray❌[]Passed as positional args to the script
stdinstring❌-Sensitive. Passed to script's standard input
environmentobject❌{}Environment variables
timeoutnumber❌60Range: 15–600s
successExitCodesarray❌["0"]

Output keys: exitCode (number), result (array of output lines)

Example

{
  "execute": "scripts-sapcp:ExecutePowerShellScript:1",
  "input": {
    "script": "Write-Output 'Hello from PowerShell'",
    "timeout": "60"
  },
  "alias": "runPowerShell",
  "description": null,
  "progressMessage": null,
  "initialDelay": null,
  "pause": null,
  "when": null,
  "validate": null,
  "autoRetry": null,
  "repeat": null,
  "errorMessages": [],
  "dryRun": null
}

Sensitive Variants

Each command has a Sensitive* counterpart that marks the result output as sensitive (never logged or displayed):

StandardSensitive variant
scripts-sapcp:ExecuteScript:2scripts-sapcp:SensitiveExecuteScript:2
scripts-sapcp:ExecutePythonScript:1scripts-sapcp:SensitiveExecutePythonScript:1
scripts-sapcp:ExecuteNodeJsScript:1scripts-sapcp:SensitiveExecuteNodeJsScript:1
scripts-sapcp:ExecutePowerShellScript:1scripts-sapcp:SensitiveExecutePowerShellScript:1

Use sensitive variants when the script output contains credentials, tokens, or other secrets.


Exit Codes

CodeMeaning
0Success (default)
-1Insufficient resources/quota
137Killed by system (SIGKILL)
CustomUse successExitCodes: ["0", "1"] or ["x"] to accept any code

Note: ExecuteScript returns exit code 124 on timeout. The dedicated language commands enforce the timeout differently — they stop execution but the exit code may vary.


Common Anti-Patterns

❌ Wrong✅ Correct
Using ExecuteScript:2 with a bash wrapper to run PythonUse ExecutePythonScript:1 directly
Using ExecuteScript:2 with a bash wrapper to run Node.jsUse ExecuteNodeJsScript:1 directly
V1: plain text "script": "echo test" (not encoded)V1: hardcode literal Base64, or encode at runtime: "script": "$(.execution.input.script | toBase64)"
V2: "script": "$(.execution.input.script | toBase64)"V2: "script": "$(.execution.input.script)"
"timeout": 5 (below minimum of 15)"timeout": "30"
"successExitCodes": "0" (string, not array)"successExitCodes": "[\"0\"]"
Using output key on script resultUse result key — script commands output to result, not output
Standard command when output contains secretsUse the Sensitive* variant

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.