agentleFS
arjunprabhulalarjunprabhulal/agent-skills/skills/devops/deployment-strategies/SKILL.md

deployment-strategies

Skill4 starsChanged 4 months agoMITView on GitHub

Gets a change into production safely — blue-green, canary, rolling, feature flags, and the rollback that makes each of them safe. Use this whenever the user is planning a release, asks how to deploy without downtime, mentions canary or blue-green, is adding a feature flag, or is nervous about a risky change going out. For deploying an AI agent specifically, use agent-deployment; for the pipeline that runs the deploy, use ci-pipelines.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every deployment strategy is a way of buying information before you are fully committed.

    line 9
  2. Distinctive:

    Not the last. Rehearse it before the deploy that needs it.

    line 44
  3. Very specific:

    Use expand-then-contract so every intermediate state works with both versions.

    line 61
  4. Distinctive:

    Write the numbers down in advance, because judgement degrades once a deploy is in flight and "it's probably fine" becomes very persuasive.

    line 68
  5. Distinctive:

    Done when: every flag is either permanent by design or has a removal date.

    line 89

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deployment strategies

Every deployment strategy is a way of buying information before you are fully committed. They differ in what they cost and how much they tell you.

The question that decides everything: how quickly can you undo it, and what does undo not cover? A strategy without a tested rollback is not a strategy.

1. Separate deploy from release

The most useful idea here, and the one that unlocks the rest. Deploying is shipping the code; releasing is turning the behaviour on. When they are the same event, every deploy is risky and every rollback is a deploy.

Split them with a flag, and you can ship code continuously, turn a feature on for one account, and turn it off in seconds without a build.

Done when: you can change behaviour without shipping code.

2. Choose the strategy the risk warrants

StrategyBuys youCosts
RollingSimple, no extra capacityBoth versions live at once; slow rollback
Blue-greenInstant switch and instant rollbackDouble capacity during the switch
CanaryReal traffic on a small blast radiusNeeds traffic splitting and per-version metrics
Feature flagPer-user control, instant offFlag debt, and both code paths must work
ShadowZero risk, real inputsNo user-visible result; needs response comparison

Most changes need nothing more than rolling. Reserve the expensive strategies for changes that are hard to undo or hard to test, and note that the two-version overlap in rolling and canary is itself a constraint: both versions must tolerate each other's data.

Done when: the strategy matches the cost of being wrong.

3. Make rollback the first thing you test

Not the last. Rehearse it before the deploy that needs it.

  • Time it. "We can roll back" means nothing if it takes 40 minutes
  • Know what it does not undo: migrations already applied, messages already sent, caches already poisoned, data already written in the new shape. This list is the real risk
  • Keep the previous version warm where the strategy allows an instant switch
  • Roll back first, diagnose second. During an incident, understanding is not the priority. See incident-response

Done when: you have executed a rollback in a real environment and timed it.

4. Make the database change independent of the code change

The most common source of un-rollbackable deploys. If the new code requires a schema the old code cannot use, you cannot roll back — the deploy and the migration are now one atomic, irreversible event.

Use expand-then-contract so every intermediate state works with both versions. See data-migration. This is what makes everything else in this skill possible.

Done when: the old version still runs against the new schema.

5. Define promotion and abort before you start

Write the numbers down in advance, because judgement degrades once a deploy is in flight and "it's probably fine" becomes very persuasive.

  • Promote when: error rate within X of baseline for Y minutes, latency within Z, no new alert classes
  • Abort when: any of those breach, or anything irreversible fires unexpectedly
  • Compare against the old version running concurrently, not against yesterday. Canary is valuable precisely because it gives you a live control group

Done when: both thresholds are written and someone is watching them.

6. Manage flag debt deliberately

Feature flags are excellent and they accumulate. A codebase with 200 stale flags has an untestable number of possible states.

  • Every flag gets an owner and a removal date at creation
  • Remove it once the feature is fully on: the flag was scaffolding
  • Distinguish release flags (temporary, removed) from operational switches (permanent, kill switches). Different lifecycles, and conflating them is how removal never happens

Done when: every flag is either permanent by design or has a removal date.

Report

State the strategy and why, the rollback procedure and when you last tested it, the promotion and abort criteria, and what the rollback would not undo. That last item is the one people discover at the worst moment.

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.