agentleFS
HalemoGPAHalemoGPA/whatsapp-mcp-server/.claude/skills/deploy/SKILL.md

deploy

Skill8 starsChanged 3 months agoMITView on GitHub

Build, deploy, verify, or roll back this server on the host. Use when asked to ship a change, rebuild a container, update nginx, or diagnose why the service is down. Covers the memory-capped build, the reload-not-restart rule, and the unhealthy-container failure mode.

155 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pm-discovery, qa-phase and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ww-w-aiSkill

    pm-discovery

    PM Agent Team - Automated product discovery, strategy, and PRD generation. Runs PM analysis workflow to produce comprehensive PRD before PDCA Plan phase.

    Also in 3 projects that use this

  • ww-w-aiSkill

    qa-phase

    Run QA tests at various levels (L1-L5) for features under PDCA management. Integrates with MCP tools to execute structured test plans.

    Also in 3 projects that use this

  • +10 more from ww-w-ai

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 139 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never declare a 443 listener whose certificate is not already on disk.

    line 51
  2. Distinctive:

    If a service is wedged, check the healthcheck before the logs:

    line 79

“Common” is measured: kept by at least 6 in 10 of the 139 edited versions of this file we could read. “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

Deploying

This runs on a small VPS shared with other services. Typical free RAM is around 1.5GB. An unguarded docker compose build once OOM'd the box and took sshd down with it. Two rules follow, and both have already been learned the hard way.

Before anything heavy

free -m
cat /proc/loadavg

Build

./deploy/safebuild <service>       # mcp | bridge

safebuild preflights headroom and runs the build inside a memory-capped systemd-run cgroup. Never docker compose build directly. An earlier version of the wrapper capped the CLI rather than BuildKit, so the cap was a no-op; if you touch it, verify the cap applies to the builder, not the client.

The bridge must build with -tags sqlite_fts5 or it crash-loops on the FTS5 virtual table.

Deploy

docker compose up -d
docker compose ps
curl -fsS http://127.0.0.1:9100/health          # {"ok": true}

nginx

sudo nginx -t && sudo systemctl reload nginx

Reload, never restart. Other sites share this nginx. If nginx -t fails, remove the symlink, reload, and stop. Do not iterate on a broken config with the service down.

Never declare a 443 listener whose certificate is not already on disk. nginx will refuse to load and every site on the box goes with it.

Verify

# unauthenticated must be 401
curl -s -o /dev/null -w '%{http_code}\n' -X POST https://your-host/mcp \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

bash tests/smoke.sh

Then confirm you did not push the box over:

docker stats --no-stream     # any container near its mem_limit?
free -m                      # available dropping, swap climbing?

When it says "Up" but nothing works

Docker does not restart unhealthy containers, only exited ones. A container can sit Up and broken indefinitely; one outage ran 18 hours while docker ps looked fine. The autoheal sidecar handles this, and every container must carry autoheal: "true" for it to apply.

If a service is wedged, check the healthcheck before the logs:

docker inspect --format '{{.State.Health.Status}}' <container>

Rollback

git revert <sha> && ./deploy/safebuild <service> && docker compose up -d

Roll back rather than fixing forward when the box is degraded. A second build under memory pressure is how the first outage got worse.

Traps worth remembering

  • with sqlite3.connect(...) as c scopes a transaction, not the connection. It does not close. Use the _conn() context manager in scheduling.py. A leak here exhausted the file-descriptor limit and took the server down silently.
  • Normalise @lid to a phone-number JID on anything that came from an event. Messages from the owner's own phone arrive LID-addressed, and forgetting this breaks joins with no error, just wrong counts.
  • Any concurrency-relevant change needs 10+ parallel calls to test. A sequential probe reuses one pool thread and misses thread-bound bugs entirely.

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.