agentleFS
liutaosliutaos/ops-skills/skills/infra-ops/shell-exec/SKILL.md

shell-exec

Skill0 starsChanged 51 days agoMITView on GitHub

Execute shell commands over SSH on an authorized server. Use when: running a single or multiple commands, capturing stdout/stderr, or running background tasks; dangerous commands are auto-blocked, require a second confirmation, and are audited. Boundary: authorized servers only; never bypass confirmation.

  • Deletes or force-pushes
  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a single / multiple shell commands

    line 13
  2. Very specific:

    Every command records: ts / host / cmd / decision / reason / code (exit code) to ~/.opsctl/audit.log.

    line 34
  3. Distinctive:

    Run against unauthorized hosts

    line 42
  4. Very specific:

    Every decision (allow/confirm/block) is written to ~/.opsctl/audit.log.

    line 54

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

shell-exec — SSH command execution

Capabilities

  • Run a single / multiple shell commands
  • Capture stdout / stderr for non-interactive commands
  • Long tasks: prefer nohup ... & or tmux

Safety gate (required)

Blacklist (hard-blocked on match, --mode yes cannot override; regex is case-insensitive):

  • Recursive delete: rm -rf /, rm -rf *
  • Format / wipe disk: mkfs, mkfs.*, dd … of=/dev/*, wipefs, parted … mklabel
  • Database destruction: DROP DATABASE, TRUNCATE, FLUSHALL, FLUSHDB
  • System lockup: reboot, shutdown, fork bomb :(){ :|:& };:
  • Critical files: >/>> overwrite /etc/passwd, /etc/shadow
  • Others: find -delete, kill -9 1, chattr -i /etc/…

Second confirmation (warnlist, --mode auto denies / --mode yes or interactive allows): rm, rmi, chmod, chown, systemctl stop|restart|disable, kill, ufw disable|delete|deny 22, iptables -F|-P, docker system prune, PasswordAuthentication no, sysctl -w

Second-confirmation prompt: "About to run on {host}: {cmd}. Confirm? (yes/abort)"

Audit

Every command records: ts / host / cmd / decision / reason / code (exit code) to ~/.opsctl/audit.log.

Scenarios

  • Check load: uptime; free -h; df -h
  • List processes: ps aux --sort=-%mem | head
  • Install package: apt update && apt install -y xxx

Forbidden

  • Run against unauthorized hosts
  • Bypass the second confirmation
  • Silently run destructive commands

EXECUTION (real engine)

This skill is executed by the shell-exec subcommand of bin/opsctl.js (src/transport.js calls system ssh).

opsctl shell-exec --host web1 --cmd "uptime; free -h" --mode auto
# --mode auto       : auto-block dangerous commands; warn class needs explicit --mode yes or interactive
# --mode yes        : auto-approve warn class (trusted scripts only)
# --mode interactive: per-command stdin confirmation

Every decision (allow/confirm/block) is written to ~/.opsctl/audit.log.

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.