agentleFS
ClickHouseClickHouse/loom/.claude/skills/loom-deploy/SKILL.md

loom-deploy

Skill87 starsChanged 3 days agoApache-2.0View on GitHub

Operator procedure for a blue/green Loom deployment with redeploy.sh — preflight, swap, post-swap checks, rollback. Use only when an operator explicitly asks to deploy, roll back or check which build is serving.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read what the incoming commits change: new migrations (additive, applied at boot by the new colour while the old one serves), new settings …

    line 24
  2. Very specific:

    Never start throwaway containers with the deployment's names (loom-blue, loom-green, loom-proxy, loom-server, loom-workers, loom-*-workers).

    line 25

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

Deploying Loom

A deploy changes what every user of the deployment is served. Run it only on an explicit request, from the deployment's own checkout. .claude/settings.json denies an agent ./redeploy.sh, its --force and --rollback, and every docker command on the deployment's containers, reads included: print each one for the operator to run, and read its output back.

1. Preflight

./redeploy.sh --status                         # which colour serves, which build, what is idle
git status --short                              # tracked edits ship with the build: each one is a question
git fetch -q origin main && git log --oneline HEAD..origin/main   # what this deploy brings
LOOM_COLOUR=blue LOOM_COLOUR_PORT=7781 docker compose --env-file .env -f dev/docker-compose.colour.yml config -q   # a broken .env edit fails here, not mid-swap
  • Another deploy in flight (an idle colour starting, a held lease, someone else's announced cut): wait. Two swaps at once can leave the proxy on a colour that is about to stop.
  • Read what the incoming commits change: new migrations (additive, applied at boot by the new colour while the old one serves), new settings that need .env values, a re-index or a worker change the PR body announced.
  • Never start throwaway containers with the deployment's names (loom-blue, loom-green, loom-proxy, loom-server, loom-workers, loom-*-workers); a cleanup of the throwaway then stops production.

2. Swap

./redeploy.sh            # builds and boots the idle colour, waits for status=ok, readiness.ready and schema.pending=[], swaps the proxy, stops the old colour

The script refuses to swap when the new colour is unhealthy or not ready, a provider is degraded, or the embedding width does not match; read its last !!! line rather than forcing. Both colours serve on the new schema for a moment, which is safe only because every change follows the rolling-upgrade rules. The workers lease passes between colours; if the script exits before the new colour's workers take over, it restarts the old colour's.

3. After the swap

curl -s localhost:7777/v1/health | jq '{status, build_commit, ready: .readiness.ready, schema: .schema.pending, providers_degraded}'
# for the operator, with the serving colour from --status:
docker logs --since 5m loom-<colour> 2>&1 | grep -iE 'error|traceback' | tail
  • build_commit is the commit you meant to deploy. The script fetched origin/main and rebased onto it (--autostash), refused a dirty tree that was behind, and asked [y/N] before pulling commits that touch the deploy files; a dirty tree it was not behind ships as it is.
  • Watch error rate and p95 for the first minutes; a ClickHouse replica restarting at the same moment slows inserts without a code cause.

4. Rollback

./redeploy.sh --rollback

The previous colour restarts on its previous image and takes the traffic; the current colour keeps running until the operator confirms the rollback and stops it with the command the script prints (docker stop -t 75 loom-<colour>). No schema step, because migrations are additive (upgrades). Rows the new build wrote stay.

Reference

Deployment, upgrades, troubleshooting.

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.