single-host-deploy

single-host-deploy is a skill for Claude Code, Codex from hxy91819/mason-skills. It costs 52 tokens per session (4,730 once invoked), scanned B, original, MIT.

A deployment setup for running one Docker Compose application stack on one Linux server. Ansible, a tool that runs repeatable server tasks over SSH, handles setup, releases, health checks, backups, database initialisation, and rollback.

In plain words
What is it for?
Use it to bootstrap a server, build and transfer Docker images, deploy a release, check status, take a backup, initialise a database, or roll back.
Why use it?
It replaces manual server commands with a repeatable process and keeps secrets out of tracked files. Failed releases leave the previous working version selected, rather than switching to an unhealthy one.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present.

Good fit Use it to bootstrap a server, build and transfer Docker images, deploy a release, check status, take a backup, initialise a database, or roll back.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hxy91819/mason-skills/single-host-deploy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hxy91819/mason-skills --skill single-host-deploy
Clone the repo
git clone --depth 1 https://github.com/hxy91819/mason-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for single-host-deploy

README.md
[![agentmods](https://agentmods.dev/badge/skills/hxy91819/mason-skills/single-host-deploy/github.svg)](https://agentmods.dev/skills/hxy91819/mason-skills/single-host-deploy)
Your own site
<a href="https://agentmods.dev/skills/hxy91819/mason-skills/single-host-deploy"><img src="https://agentmods.dev/badge/skills/hxy91819/mason-skills/single-host-deploy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for single-host-deploy

Your own site · 80×15
<a href="https://agentmods.dev/skills/hxy91819/mason-skills/single-host-deploy"><img src="https://agentmods.dev/badge/skills/hxy91819/mason-skills/single-host-deploy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,730 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.04730
Opus 5.5 $0.00021 $0.01892
Sonnet 5.5 $0.00010 $0.00946
Haiku 4.5 $0.00005 $0.00473

Measured yesterday against content hash 9d01b181c587, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

single-host-deploy scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 4 executable files (assets/infra/deploy/deploy_config.py, assets/infra/deploy/deploy.sh, assets/infra/deploy/files/backup-db.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

| `sudo: a password is required` | 部署账号必须免密 sudo;不要把 sudo 密码写进清单 |
common-skills/single-host-deploy/SKILL.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

单机部署即代码

适用范围

一台 Linux 主机(Ubuntu 24.04 或 Debian 12+,x86_64/arm64),一个 Docker Compose 栈,控制器是开发机或运维机,经 SSH 管理目标主机。目标主机不装 Ansible 代理,不在主机上编译镜像。

不覆盖:Kubernetes、多主机编排、云主机创建、DNS/云安全组、镜像仓库、密钥托管服务、跨机房容灾。这些需要另一个工具或人工流程。

不变量

  • 两样本机输入:一份环境清单、一份密钥文件,都以 .local. 结尾并被 .gitignore 忽略。仓库只跟踪 example.yml 和 example.secrets.env。
  • 密钥只在本地:清单只写键名和模式,真实值只放在未跟踪的 <env>.secrets.local.env,权限 0600。发布日志、release 记录、文档和命令示例都不含值。
  • 控制器构建:用 docker buildx 构建目标平台镜像,docker save | ssh docker load 传输,不依赖镜像仓库。
  • 不在目标机编译:目标机只需要 SSH、sudo、Docker/Compose 和 python3。
  • 发布只从干净提交:git status --short 为空才允许 release;镜像标签用当前提交的 short sha。
  • current 最后切换:所有服务健康、冒烟通过后,才把 deploy_root/current 指向本次 release 记录。任何一步失败都中止,保留旧 current。
  • .ok 标记成功:只有冒烟通过的 release 记录才写 .ok;默认回滚按 .ok 历史找上一份。
  • 清单与密钥分离:清单描述“要什么”,密钥描述“凭什么”;不要把密码写进清单、release 记录或 Compose 文件。
  • 共用网关只读:gateway.mode: external 只把站点块渲染到部署目录并打印接入提示,不修改主机上的共用网关配置。

快速开始

cp infra/deploy/environments/example.yml infra/deploy/environments/prod.local.yml
cp infra/deploy/environments/example.secrets.env infra/deploy/environments/prod.secrets.local.env
chmod 600 infra/deploy/environments/prod.secrets.local.env
$EDITOR infra/deploy/environments/prod.local.yml
$EDITOR infra/deploy/environments/prod.secrets.local.env

infra/deploy/deploy.sh prod bootstrap
infra/deploy/deploy.sh prod release
infra/deploy/deploy.sh prod status

首次使用前,控制器安装固定版本的 ansible-core、collection、Docker Engine 与 Buildx。版本和安装命令见 assets/infra/deploy/README.md。

动作清单

动作 作用 关键边界
bootstrap 写入 Docker 官方源、安装 Docker/Compose、创建部署账号与目录、安装备份 timer、按清单增补 UFW 可重复执行;第二次应为 changed=0;check 只读
release 校验密钥、构建并传输镜像、渲染配置、启动、等健康、冒烟、切换 current、写 release 记录 只从干净提交;冒烟不过不切 current
rollback [记录] 用历史 release 记录的镜像重新启动,冒烟后把 current 切回目标,并写 rollback-*.json 不重建镜像、不改数据库、不改应用密钥;不适用不可逆迁移
status 只读展示当前 release、镜像、容器状态、备份 timer 和最近备份 不写任何文件
backup-now 立即执行一次数据库备份,走 systemd oneshot service 失败给 journalctl 入口
db-init 仅 external 数据库:幂等创建角色、库、schema、连接上限和 search_path 默认不执行,不会被 bootstrap/release 自动调用
check 对 bootstrap 执行 --check --diff 只读;Docker/Compose 尚未安装时跳过版本校验
syntax-check 对所有 playbook 执行 ansible-playbook --syntax-check 用 example 清单,不连主机
lint 执行 ansible-lint 可选;提交前跑

Read the full file on GitHub · 226 lines

Files

What ships with it

30 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 226 lines · 52 tokens per session scan B 9d01b181c587

Subscribe to this mod's changes

single-host-deploy is a skill published in the GitHub repository hxy91819/mason-skills (3 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 4,730 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-07.

Related

single-host-deploy compared with skills from other repositories

single-host-deploy next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
single-host-deployhxy91819/mason-skillsSkill3todayMITB52Claude Code, Codex
deploy-akashickachofugetsu09/akashic-agentSkill519yesterdayMITA38Claude Code, Codex
releasememgraph/ai-toolkitSkill119yesterdayMITA35Claude Code, Codex
finding-latest-versionsSmirnov-Labs/claude-skillsSkill6yesterdayMITA87Claude Code, Codex
deployment-operationszhpeng24/devkitSkill33mo agoMITA57Claude Code, Codex
ferrogate-releaselianluo-esign/ferrogateSkill311mo agononeA88Claude Code, Codex
release-and-publishcyanheads/orcid-mcp-serverSkill611d agoApache-2.0A155Claude Code