agentleFS
jianghailong-xyjianghailong-xy/orbit/.claude/skills/upgrade/SKILL.md

upgrade

Skill4 starsChanged 2 months agoMITView on GitHub

Upgrade the Orbit Docker Compose deployment — rebuild the apiserver and web images from the current source and recreate only the services that changed (apiserver applies DB migrations on boot); an unchanged postgres is left running. Refreshing the postgres/gateway base images is opt-in via --pull-base. Use whenever someone wants to deploy the latest code, update/upgrade the running containers, or bring a Compose deployment up to date.

  • Reads credentials

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use status, review and 2 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.
  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 6 projects that use this

  • MicrosoftSkill

    init

    Generate or update chat customization files for AI coding agents

    Also in 3 projects that use this

  • OpenAISkill

    audit

    Audit or critique a product flow, journey, workflow, funnel, onboarding path, checkout path, settings path, screen, or multi-step product experience by capturing screenshots first, then reporting UX, design, and accessibility findings inline from that evidence. Use Figma only when the user explicitly asks for a board. Use when the user asks to audit, review, critique, inspect, assess, analyze, evaluate, or give feedback on a product experience.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 2

    Distinctive

    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:

    Run the script from anywhere (it cds to the repo root itself):

    line 23
  2. Distinctive:

    Run from a checkout of the repo (the script resolves the repo root relative to its own location).

    line 85
  3. Very specific:

    If a healthcheck fails, up --wait exits non-zero — check docker compose logs <service> (commonly apiserver if a migration failed).

    line 97
  4. Distinctive:

    If an upgrade is already running, a second invocation exits immediately with a non-zero status rather than running a redundant rebuild.

    line 102

“Common” is measured: kept by at least 6 in 10 of the 9 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

Upgrade the Orbit stack

Orbit runs as a single Docker Compose stack (docker-compose.yml at the repo root) with four services: postgres, apiserver, web, and gateway. apiserver and web are built locally from source; postgres and gateway (nginx) use pinned upstream images. A routine upgrade rebuilds the locally-built images and recreates only the services that actually changed — an unchanged postgres is never restarted. Refreshing the upstream base images is opt-in via --pull-base.

Database migrations are not a separate step — the apiserver container runs prisma migrate deploy on startup (see src/apiserver/Dockerfile CMD), so recreating it applies any new migrations against the persisted orbit_pg volume.

How to use

Run the script from anywhere (it cds to the repo root itself):

.claude/skills/upgrade/upgrade.sh

It will, in order:

  1. Refuse to build from a dirty checkout. The image is built from the working tree, not from HEAD — docker compose build copies whatever is on disk — so uncommitted edits ship into production while existing in no commit. That has happened here: a hotfix that lived only in this checkout served production for hours, invisible to every branch and one clean rebuild away from silently reverting. Modified tracked files abort the upgrade; untracked files only warn (they are additive, not a silent divergence from HEAD). --allow-dirty proceeds anyway, loudly.
  2. Pull main first. On main the checkout is fast-forwarded to origin (git pull --ff-only) before anything is built. Merges also reach origin without passing through this checkout (another machine's runner, a GitHub merge), and a stale checkout rebuilds an old tree while still reporting success. Fast-forward only: a checkout that has diverged from origin stops the upgrade before any build; one that is only ahead (a local fast-forward not pushed yet) deploys as it is. Off main nothing is pulled unless you pass --pull; --no-pull skips the pull.
  3. Resolve the checked-out commit as ORBIT_SOURCE_SHA, then run docker compose build apiserver web to rebuild from that exact source revision.
  4. docker compose up -d --wait apiserver web gateway — recreate only the services whose image or config changed (the freshly built apiserver/web, and gateway only if its image or mounted nginx.conf changed), and block until they pass their healthcheck (apiserver runs migrations on boot). postgres is left running untouched — it is not in the recreate set.
  5. Print docker compose ps.

With --pull-base it instead first runs docker compose pull postgres gateway and then a full docker compose up -d --wait, so a genuinely new base image is applied — this is the only path that may recreate (restart) postgres.

Flags

  • --no-pull — skip the pull and deploy the checkout exactly as it is (a pinned or offline deploy).
  • --pull — pull even when the checkout is not on main (on main it is the default).
  • --pull-base — also refresh the pinned base images (postgres, gateway) and run a full recreate. This is the only path that may restart postgres; omit it (the default) to leave an unchanged postgres running.
  • --no-cache — rebuild the apiserver/web images without the Docker layer cache (use when a dependency change isn't being picked up).
  • --prune — docker image prune -f after a successful upgrade to reclaim space from the now-dangling old image layers.
  • --allow-dirty — build even though the checkout has uncommitted changes. Use when you deliberately want to test an uncommitted change in the deployment, and remember the change exists in no commit: the next clean rebuild reverts it.
.claude/skills/upgrade/upgrade.sh --prune

Requirements

  • Docker with the Compose v2 plugin (docker compose). The legacy docker-compose v1 binary is used as a fallback, but --wait requires v2.
  • Run from a checkout of the repo (the script resolves the repo root relative to its own location).
  • The same environment the stack normally uses (e.g. JWT_SECRET) should be present in the shell or repo-root .env.

Notes

  • The default up -d --wait apiserver web gateway only recreates services whose image or config changed, so an upgrade with no source changes is a no-op (and stays healthy). postgres is never recreated unless you pass --pull-base and its base image actually changed.
  • The orbit_pg volume is preserved across the upgrade; data is not lost.
  • If a healthcheck fails, up --wait exits non-zero — check docker compose logs <service> (commonly apiserver if a migration failed).
  • Concurrent upgrades are serialized by a lock directory (/tmp/orbit-upgrade.lock, created with mkdir so it works on macOS as well as Linux; a lock whose holding process is gone is reported and taken over). If an upgrade is already running, a second invocation exits immediately with a non-zero status rather than running a redundant rebuild.

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.