agentleFS
frontier-ai-nextfrontier-ai-next/mgarlbot/skills/ops_tmux_remote_deploy/SKILL.md

ops_tmux_remote_deploy

Skill17 starsChanged 4 months agoMITView on GitHub

Run remote deploy via SSH using tmux sessions (frps + app), with idempotent restart and health checks

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the user wants: "deploy on that server", "run frps and project in tmux", "keep processes alive after disconnect".

    line 11
  2. Distinctive:

    Always run commands on VPS via SSH wrapper:

    line 13
  3. Distinctive:

    Never run host-level commands locally when the task is explicitly remote.

    line 19
  4. Distinctive:

    Create and maintain two tmux sessions on the VPS:

    line 23
  5. Very specific:

    Check core tools: tmux, curl, ss (or netstat fallback).

    line 34
  6. Very specific:

    Ensure frps binary + config path are known (ask only if impossible to infer).

    line 38
  7. Distinctive:

    start detached with explicit command and logs.

    line 41
  8. Very specific:

    If repo has compose files and user asked containerized deploy: use docker compose up in project_app.

    line 44
  9. Distinctive:

    Do not claim success until all mandatory checks pass.

    line 94
  10. Distinctive:

    If checks fail, inspect tmux panes and fix one issue per iteration.

    line 95
  11. Very specific:

    Do not dump .env, private keys, or full secret-bearing configs in chat.

    line 96
  12. Distinctive:

    Avoid destructive global actions.

    line 97

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

Remote deploy via tmux (single VPS baseline)

Use this skill when the user wants: "deploy on that server", "run frps and project in tmux", "keep processes alive after disconnect".

Always run commands on VPS via SSH wrapper:

ssh -F /data/.ssh/config vps 'REMOTE_COMMAND_HERE'

Never run host-level commands locally when the task is explicitly remote.

Goal

Create and maintain two tmux sessions on the VPS:

  • frps — FRP server process.
  • project_app — project runtime process (docker compose or native command).

Both sessions must be idempotent and verifiable.

Standard sequence

  1. Preflight
    • Verify SSH connectivity.
    • Check core tools: tmux, curl, ss (or netstat fallback).
    • Install tmux if missing (non-interactive apt for Debian/Ubuntu).
  2. Prepare frps
    • Ensure frps binary + config path are known (ask only if impossible to infer).
    • Restart frps session safely:
      • tmux has-session -t frps -> kill if exists.
      • start detached with explicit command and logs.
  3. Prepare app runtime
    • If repo has compose files and user asked containerized deploy: use docker compose up in project_app.
    • Otherwise start provided app command in project_app.
    • Same idempotent session restart pattern as frps.
  4. Health checks (mandatory)
    • tmux ls contains both sessions.
    • Process check (pgrep -af frps, app process or docker compose ps).
    • Port check with ss -ltnp for expected bind ports.
    • HTTP check with curl -fsS (or status code check) for app endpoint.
  5. Operational output
    • Report only operational facts: session names, process status, listening ports, endpoint status.
    • Provide follow-up commands for logs:
      • tmux capture-pane -pt frps -S -120
      • tmux capture-pane -pt project_app -S -120

Canonical command snippets

SSH preflight:

ssh -F /data/.ssh/config vps 'set -e; uname -a; command -v tmux >/dev/null || echo "__NO_TMUX__"'

Install tmux if required:

ssh -F /data/.ssh/config vps 'set -e; if ! command -v tmux >/dev/null; then DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y tmux; fi'

Restart frps session:

ssh -F /data/.ssh/config vps 'set -e; tmux has-session -t frps 2>/dev/null && tmux kill-session -t frps || true; tmux new-session -d -s frps "cd /opt/frp && ./frps -c /opt/frp/frps.toml"'

Restart app session (compose variant):

ssh -F /data/.ssh/config vps 'set -e; tmux has-session -t project_app 2>/dev/null && tmux kill-session -t project_app || true; tmux new-session -d -s project_app "cd /srv/myapp && docker compose up --build"'

Health checks:

ssh -F /data/.ssh/config vps 'set -e; tmux ls; pgrep -af frps || true; ss -ltnp | sed -n "1,120p"; curl -sS -o /dev/null -w "%{http_code}\n" http://127.0.0.1:8080/'

Rules

  • Do not claim success until all mandatory checks pass.
  • If checks fail, inspect tmux panes and fix one issue per iteration.
  • Do not dump .env, private keys, or full secret-bearing configs in chat.
  • Avoid destructive global actions; only touch sessions/processes related to this deploy.

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.