deploy-merlin
Skill1 starsChanged 2 months agoMITView on GitHub
Use when the user says "prep the deployment", "set up deploy", "deployment wizard", "get this ready to ship to my server", "scaffold the deploy", or is about to stand up a new app on a Linux VPS with the standard single-VPS pattern (Docker Compose + nginx + GitHub Actions, one-push deploy, maintenance gate, TLS via Let's Encrypt). NOT for non-VPS / managed-PaaS deploys, or for the actual server administration.
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- a11y-tophSkill
- audit-sherlockSkill
- build-jarvisSkill
- build-ultronSkill
- build-visionSkill
- deploy-niyojSkill
- design-arwenSkill
- designui-galadrielSkill
- grayskull-powerSkill
- handoff-cortanaSkill
- live-fridaySkill
- mergeprep-oracleSkill
- merge-smithSkill
- relay-morpheusSkill
- resume-cortanaSkill
- rules-orkoSkill
- screenshot-argusSkill
- skill-smithSkill
- spec-watsonSkill
- tasks-sentinelsSkill
- tickets-zordonSkill
- tui-tronSkill
- watch-cortanaSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 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.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Authoritative templates: if the project root (or the user) has a DEPLOYMENT_PLAYBOOK.md, treat it as the source of truth for artifact …
- Distinctive: line 46
Ask in small, grounded batches.
- Very specific: line 79
If a DEPLOYMENT_PLAYBOOK.md is present, take contents from it.
- Very specific: line 100
If a frontend: src/lib/maintenance.ts (sticky content-type poller) + MaintenanceModal.tsx (overlay, OK reloads).
- Distinctive: line 133
If the health poll fails, the deploy script dumps container logs — read those, fix, re-push.
- Very specific: line 140
Secrets are names, not values: Never ask the user to paste a password/key into chat, never write a secret into a repo file.
- Very specific: line 145
Public-safe: every deployment-specific value is prompted, never hardcoded.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
deploy-merlin — prep the standard VPS deployment
Runs as a wizard: one step at a time, confirm before moving on. It gathers the deployment-specific values, scaffolds the filled-in config/scripts, and hands the user an ordered checklist of the manual steps only a human should do.
Target pattern: a single Linux VPS where nginx is the only public-facing
service (static frontend + /api/ proxy + maintenance gate + TLS), Docker
Compose owns the app stack (api, workers, postgres, redis, object storage), and
GitHub Actions SSHes in on push main to run an idempotent deploy.sh.
Public-safe & secure by construction:
- Prompt for every specific — nothing about a real deployment is baked in.
- Never collect secret values. DB/storage passwords, SSH private keys, API
tokens are never typed into chat or written into repo files. The wizard records
their names and tells the user to place them in a server-side
.env(mode 600) or a GitHub secret — done by the user, not the wizard. - Never touch remote/DNS/credentials. The wizard prepares; the human executes every step that reaches a server, DNS provider, or secret store.
Step 0 — Orient
- Detect the project: is there a frontend (build step), a backend (health route),
a
docker-compose.yml, existingdeploy/or.github/workflows/? Note what already exists so the wizard fills gaps, not overwrites blindly. - Authoritative templates: if the project root (or the user) has a
DEPLOYMENT_PLAYBOOK.md, treat it as the source of truth for artifact contents and only substitute the wizard's answers into it. Otherwise generate artifacts from the structure in Step 2. (Never copy private values out of any playbook.) - Confirm the platform is this VPS pattern; if it's a managed PaaS (Vercel, Fly, Render, etc.), stop — this wizard is for the self-hosted VPS pattern.
Step 1 — Interview (the wizard Q&A)
Ask in small, grounded batches; use multiple-choice / sensible defaults where you can; confirm each batch. Collect these values (names only for secrets):
- Identity:
APP_SLUG(used in/opt/<slug>, filenames, keys),GITHUB_ORG,GITHUB_REPO,APP_DIR(default/opt/<APP_SLUG>). - Server / SSH:
DEPLOY_HOST(IP/host),DEPLOY_USER,DEPLOY_PORT(default 22). - Domain / TLS:
SUBDOMAIN(public hostname),CERTBOT_EMAIL(Let's Encrypt reg). - nginx / ports:
API_PORT(host port nginx proxies to, e.g.127.0.0.1:18000),CONTAINER_API_PORT(in-container app port, e.g. 8000),HEALTH_PATH(default/api/health),MAX_BODY_SIZE(nginxclient_max_body_size, e.g.2G). - Stack: which compose services (
STACK_SERVICES: api / workers / postgres / redis / object-storage). For each present:DB_NAME,DB_USER; object-storagebucket. DB_PASSWORD and storage access/secret keys are SECRET → record the variable name only, never the value. - App-specific:
CHILD_TABLES(tables for restore-append backups), any per-app localStorage keys.
State back the collected config (secrets shown as <set on server>) and get a
confirm before scaffolding.
Nobody to interview? A subagent, a batch run, or "just set it up, I'm out" —
a deployment's specifics cannot be inferred, and a scaffold built on invented ones
is worse than no scaffold: it looks configured and points at a host that isn't
theirs. Don't scaffold. Write Step 1 out as an answer sheet, filled in where the
repo actually tells you (APP_SLUG, ports, STACK_SERVICES, HEALTH_PATH) and
blank where only the user can (DEPLOY_HOST, SUBDOMAIN, CERTBOT_EMAIL, secret
names), print the Step 3 checklist beneath it, and stop there. The wizard prepares
and the human executes — with no human in the loop, preparing is the whole job.
Step 2 — Scaffold the artifacts (prep)
Generate these into the project, substituting the answers (secrets stay as
placeholders / env references — never literal values). List every file you write.
If a DEPLOYMENT_PLAYBOOK.md is present, take contents from it; otherwise follow
this structure:
.github/workflows/deploy.yml— onpush main: SSH toDEPLOY_HOST:DEPLOY_PORTasDEPLOY_USERusing secretDEPLOY_SSH_KEY, runAPP_DIR/deploy/deploy.sh.deploy/deploy.sh— idempotent first-run + update: install base pkgs,ufwallow 22/80/443, clone-or-git reset --hard origin/main, maintenance gate ON (trap clears it on EXIT/ERR),docker system prune -afthen frontendnpm ci && build, pre-deploy DB snapshot,docker compose up -d --build, pollHEALTH_PATH(≤45×2s, dump logs + fail on timeout), gate OFF,envsubstnginx template → reload.deploy/nginx.conf.template— server forSUBDOMAIN: static root,/api/→127.0.0.1:API_PORT, maintenance-flag rewrite,client_max_body_size MAX_BODY_SIZE.deploy/maintenance.html— static page, auto-refresh ~10s, served with 200. Wears the app's own brand where one exists; inventing a look falls under the shared design floorreferences/anti-slop.mdbeside the installed skills — try../references/anti-slop.mdfirst (theinstall.shlayout), then../../references/anti-slop.md(git checkout, plugin cache); neither resolves → say so in one line and stay on the system font stack.docker-compose.yml+deploy/docker-compose.prod.yml— base + prod overlay for the chosenSTACK_SERVICES; secrets referenced from.env, never inlined.- Backend health endpoint (
HEALTH_PATH→{ok:true}, no auth/DB) if missing. - If a frontend:
src/lib/maintenance.ts(sticky content-type poller) +MaintenanceModal.tsx(overlay, OK reloads). - Optional
.githooks/pre-push— best-effort DB snapshot on push (never blocks).
Then offer to run only the safe LOCAL steps with per-step confirmation: write the
files, chmod +x deploy/deploy.sh, stage them. Do NOT git push, run anything
against the server, or write any secret. Confirm before each write if overwriting.
Step 3 — Manual handoff checklist (the human-only steps)
Print an ordered, copy-pasteable checklist with the user's non-secret values filled in (secrets as placeholders). These are the steps the wizard will NOT do:
- Deploy key —
ssh-keygena deploy keypair; add the public key toDEPLOY_USER@DEPLOY_HOST:~/.ssh/authorized_keys. - GitHub secrets — add
DEPLOY_HOST,DEPLOY_USER,DEPLOY_PORT,DEPLOY_SSH_KEY(the private key) in the repo's Actions secrets. - DNS — create an A record
SUBDOMAIN → DEPLOY_HOST; wait for propagation. - First bootstrap — ensure
DEPLOY_USERhas sudo andAPP_DIRis writable (or let the firstdeploy.shcreate it). - Server
.env— place.env(mode 600) inAPP_DIRwith the app secrets +DB_PASSWORD/ storage keys. The runner holds no app secrets. - Firewall — confirm the provider firewall also allows 22/80/443.
- TLS — first issuance:
certbot --nginx -d SUBDOMAIN -m CERTBOT_EMAIL(needs live DNS + port 80 reachable); auto-renews after. - Go live —
git push main, watch the Actions run, confirm the health check andhttps://SUBDOMAINload.
Step 4 — Verify first deploy
Walk the user through the first push main → Actions → SSH → deploy.sh. The deploy
is proven only when: the Action is green, HEALTH_PATH returns ok on the box, the
maintenance flag is cleared, and https://SUBDOMAIN serves the app over valid TLS.
If the health poll fails, the deploy script dumps container logs — read those, fix,
re-push.
Rules
- Wizard discipline: one step at a time, confirm before advancing; never dump the whole thing and call it done.
- Secrets are names, not values. Never ask the user to paste a password/key into
chat, never write a secret into a repo file. They go to the server
.env/ GitHub secrets, by the user. - Prep, don't execute the risky parts. No
git push, no SSH to the server, no DNS change, no credential entry — those are the user's manual steps by design. - Public-safe: every deployment-specific value is prompted, never hardcoded. Use
example.com/203.0.113.10-style placeholders in any illustration. - Idempotent artifacts: the generated
deploy.shmust be safe to re-run (clone-or- update, prune-before-build, trap-clears-maintenance) — that's the whole point. - Overwriting an existing deploy file? Show the diff and confirm first.
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.

