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
In this repository12 other files it gives its agents.
- app_controlSkill
- aws_opsSkill
- code_executionSkill
- desktop_automationSkill
- docker_deploySkill
- file_operationsSkill
- gitlab_apiSkill
- gitlab_pages_ciSkill
- ops_dns_regruSkill
- ops_reverse_proxySkill
- system_infoSkill
- vps_host_sshSkill
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
- Distinctive: line 11
Use this skill when the user wants: "deploy on that server", "run frps and project in tmux", "keep processes alive after disconnect".
- Distinctive: line 13
Always run commands on VPS via SSH wrapper:
- Distinctive: line 19
Never run host-level commands locally when the task is explicitly remote.
- Distinctive: line 23
Create and maintain two tmux sessions on the VPS:
- Very specific: line 34
Check core tools: tmux, curl, ss (or netstat fallback).
- Very specific: line 38
Ensure frps binary + config path are known (ask only if impossible to infer).
- Distinctive: line 41
start detached with explicit command and logs.
- Very specific: line 44
If repo has compose files and user asked containerized deploy: use docker compose up in project_app.
- Distinctive: line 94
Do not claim success until all mandatory checks pass.
- Distinctive: line 95
If checks fail, inspect tmux panes and fix one issue per iteration.
- Very specific: line 96
Do not dump .env, private keys, or full secret-bearing configs in chat.
- Distinctive: line 97
Avoid destructive global actions.
≈ “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
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
- Preflight
- Verify SSH connectivity.
- Check core tools:
tmux,curl,ss(ornetstatfallback). - Install
tmuxif missing (non-interactive apt for Debian/Ubuntu).
- Prepare frps
- Ensure
frpsbinary + config path are known (ask only if impossible to infer). - Restart
frpssession safely:tmux has-session -t frps-> kill if exists.- start detached with explicit command and logs.
- Ensure
- Prepare app runtime
- If repo has compose files and user asked containerized deploy: use
docker compose upinproject_app. - Otherwise start provided app command in
project_app. - Same idempotent session restart pattern as
frps.
- If repo has compose files and user asked containerized deploy: use
- Health checks (mandatory)
tmux lscontains both sessions.- Process check (
pgrep -af frps, app process ordocker compose ps). - Port check with
ss -ltnpfor expected bind ports. - HTTP check with
curl -fsS(or status code check) for app endpoint.
- 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 -120tmux 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.
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.

