agentleFS
agenticlukeagenticluke/zero-downtime-deploys-plus/skill/SKILL.md

deployment-patterns

Skill0 starsChanged 3 months agoMITView on GitHub

Plan safe deploys for Kubernetes, Docker, Vercel, and cloud hosts. Covers rolling, blue-green, and canary deploys, health checks, rollback, scaling, and updates with no downtime.

43 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use nuxt4-patterns, dart-flutter-patterns 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.
  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 11 projects that use this

  • RojiosSkill

    dart-flutter-patterns

    Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.

    Also in 8 projects that use this

  • TironFoxSkill

    agent-payment-x402

    Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.

    Also in 6 projects that use this

  • junimnjwSkill

    ralphinho-rfc-pipeline

    RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.

    Also in 12 projects that use this

  • TironFoxSkill

    openclaw-persona-forge

    为 OpenClaw AI Agent 锻造完整的龙虾灵魂方案。根据用户偏好或随机抽卡, 输出身份定位、灵魂描述(SOUL.md)、角色化底线规则、名字和头像生图提示词。 如当前环境提供已审核的生图 skill,可自动生成统一风格头像图片。 当用户需要创建、设计或定制 OpenClaw 龙虾灵魂时使用。 不适用于:微调已有 SOUL.md、非 OpenClaw 平台的角色设计、纯工具型无性格 Agent。 触发词:龙虾灵魂、虾魂、OpenClaw 灵魂、养虾灵魂、龙虾角色、龙虾定位、 龙虾剧本杀角色、龙虾游戏角色、龙虾 NPC、龙虾性格、龙虾背景故事、 lobster soul、lobster character、抽卡、随机龙虾、龙虾 SOUL、gacha。

    Also in 5 projects that use this

  • renepfSkill

    motion-advanced

    Advanced motion patterns for React / Next.js — drag & drop, gestures, text animations, SVG path drawing, custom hooks, imperative sequences (useAnimate), loaders, and the full API decision tree. Requires motion-foundations.

    Also in 5 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

36 rules. 0 are common, 35 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 41 edited versions we read keep these.

  • 35

    Distinctive

    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:

    Use this skill to plan and check safe app deploys.

    line 11
  2. Distinctive:

    Use this skill when you need to:

    line 15
  3. Distinctive:

    Update an app with no planned downtime.

    line 18
  4. Distinctive:

    Check these facts first:

    line 26
  5. Distinctive:

    Do not claim zero downtime unless the full path supports it.

    line 35
  6. Distinctive:

    Run two full sites:

    line 74
  7. Distinctive:

    Test green first. Then send users to green.

    line 79
  8. Distinctive:

    Keep blue ready until green has been stable for the set check time.

    line 95
  9. Distinctive:

    Check errors, speed, and key user tasks.

    line 104
  10. Distinctive:

    Stop the rollout if you cannot tell old and new results apart.

    line 121
  11. Distinctive:

    Stop the old app. Then start the new app.

    line 125
  12. Distinctive:

    Use it only when:

    line 127
  13. Distinctive:

    Use separate checks when the host supports them:

    line 137
  14. Distinctive:

    Test what users need.

    line 147
  15. Distinctive:

    Do not make every check call many other services.

    line 150
  16. Distinctive:

    Use changes that work with both old and new code.

    line 156
  17. Distinctive:

    Add the new table or field.

    line 160
  18. Distinctive:

    Remove old data only after rollback is no longer needed.

    line 164
  19. Distinctive:

    Do not remove or rename a field before all old app copies are gone.

    line 166
  20. Distinctive:

    Before stopping an old app copy:

    line 172
  21. Distinctive:

    Stop sending it new work.

    line 174
  22. Distinctive:

    Make sure queue workers do not take the same job twice during a deploy.

    line 180
  23. Distinctive:

    When auto scaling is used:

    line 184
  24. Distinctive:

    Keep enough copies for a rolling deploy.

    line 187
  25. Distinctive:

    Test sudden traffic growth.

    line 188
  26. Distinctive:

    Do not scale from CPU alone if queue size or wait time matters more.

    line 190
  27. Distinctive:

    Make sure new copies can start fast enough.

    line 191
  28. Distinctive:

    Write rollback rules before the deploy.

    line 197
  29. Distinctive:

    Keep the last good app image and settings until the new release is stable.

    line 209
  30. Distinctive:

    Run at least three app pods.

    line 217
  31. Distinctive:

    Add start, ready, and live checks.

    line 218
  32. Very specific:

    Use maxSurge: 1 and maxUnavailable: 0.

    line 220
  33. Distinctive:

    Start one new pod.

    line 221
  34. Distinctive:

    Wait until its ready check passes.

    line 222
  35. Distinctive:

    Stop if a set limit fails.

    line 226
  36. Distinctive:

    Keep old database fields until rollback time has passed.

    line 228

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

Deployment Patterns

This skill comes from ECC. Full credit goes to the original ECC author.

Use this skill to plan and check safe app deploys.

When to Use

Use this skill when you need to:

  • Deploy an app to Kubernetes, Docker, Vercel, or a cloud host.
  • Update an app with no planned downtime.
  • Pick a rolling, blue-green, or canary deploy.
  • Add health checks.
  • Set up auto scaling.
  • Make a rollback plan.

Before You Deploy

Check these facts first:

  • How much downtime is allowed?
  • Can the old and new app run at the same time?
  • Will the new app change the database?
  • How will you know the new app is healthy?
  • How fast must you roll back?
  • Can the host send only some users to the new app?

Do not claim zero downtime unless the full path supports it. This includes the app, database, network, and host.

Pick a Deploy Plan

1. Rolling Deploy

Replace old app copies a few at a time.

Use it when:

  • Old and new copies can run at the same time.
  • The app has more than one copy.
  • A slow update is safe.

Kubernetes example:

spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0

maxSurge: 1 lets one extra pod start.

maxUnavailable: 0 keeps all needed pods ready during the update.

Watch for:

  • One app copy is not enough for no downtime.
  • A bad health check may send work to a pod too soon.
  • Old and new code may use the database in different ways.
  • Long jobs may stop when an old pod shuts down.

2. Blue-Green Deploy

Run two full sites:

  • Blue is the live site.
  • Green is the new site.

Test green first. Then send users to green.

Use it when:

  • You need a fast switch.
  • You need a fast rollback.
  • You can pay for two full sites for a short time.

Watch for:

  • Both sites may write to the same database.
  • User sessions may break after the switch.
  • Cache data may not match.
  • Old jobs may still run after traffic moves.
  • Database changes may make rollback unsafe.

Keep blue ready until green has been stable for the set check time.

3. Canary Deploy

Send a small part of traffic to the new app first. Raise the share in steps.

A simple plan:

  1. Send 5% of traffic to the new app.
  2. Check errors, speed, and key user tasks.
  3. Raise traffic to 25%.
  4. Check again.
  5. Raise traffic to 50%.
  6. Move to 100% only if all checks pass.

Use it when:

  • Your host can split traffic.
  • You can track the new app by version.
  • A small test group is safe.

Watch for:

  • A small group may miss rare bugs.
  • Signed-in users may need to stay on one version.
  • Workers and timed jobs do not follow web traffic rules.
  • Stop the rollout if you cannot tell old and new results apart.

4. Replace All at Once

Stop the old app. Then start the new app.

Use it only when:

  • Downtime is allowed.
  • The app is small or used for tests.
  • Other plans cost too much or add too much work.

State the planned downtime before using this plan.

Health Checks

Use separate checks when the host supports them:

  • Start check: Has the app finished starting?
  • Ready check: Can the app take new work?
  • Live check: Is the app stuck and in need of a restart?

A health check should:

  • Return fast.
  • Have a short wait limit.
  • Test what users need.
  • Fail when the app cannot serve safe work.

Do not make every check call many other services. One slow service could restart healthy app copies again and again.

Give slow apps enough start time. Do not send traffic before they are ready.

Safe Database Changes

Use changes that work with both old and new code.

A safe order is:

  1. Add the new table or field.
  2. Deploy code that can use both old and new data.
  3. Move or fill old data in small parts.
  4. Deploy code that uses the new data.
  5. Remove old data only after rollback is no longer needed.

Do not remove or rename a field before all old app copies are gone.

Back up key data before a risky change. Test that the backup can be restored.

Shutdown and Long Jobs

Before stopping an old app copy:

  • Stop sending it new work.
  • Let open requests finish.
  • Save or move long jobs.
  • Set a clear shutdown time.
  • Make repeated work safe when possible.

Make sure queue workers do not take the same job twice during a deploy.

Auto Scaling

When auto scaling is used:

  • Set a safe low and high copy count.
  • Keep enough copies for a rolling deploy.
  • Test sudden traffic growth.
  • Check host limits.
  • Do not scale from CPU alone if queue size or wait time matters more.
  • Make sure new copies can start fast enough.

A deploy and a traffic spike can happen at the same time. Plan for both.

Rollback Rules

Write rollback rules before the deploy.

Roll back when:

  • Error rate rises past the set limit.
  • Requests become too slow.
  • Health checks keep failing.
  • A key user task fails.
  • Data is lost or changed in a bad way.

A code rollback may not undo a database change. Write a separate data repair plan when needed.

Keep the last good app image and settings until the new release is stable.

Concrete Example

Task: Deploy version 2.4.0 to Kubernetes with no planned downtime.

Plan:

  1. Run at least three app pods.
  2. Add start, ready, and live checks.
  3. Confirm versions 2.3.0 and 2.4.0 can use the same database.
  4. Use maxSurge: 1 and maxUnavailable: 0.
  5. Start one new pod.
  6. Wait until its ready check passes.
  7. Send it traffic.
  8. Replace the next old pod.
  9. Watch errors, speed, restarts, and key user tasks.
  10. Stop if a set limit fails.
  11. Roll back to 2.3.0 if the fault does not clear.
  12. Keep old database fields until rollback time has passed.

Success means all new pods are ready, key tasks work, and error and speed limits stay normal.

Final Check

  • The deploy plan fits the host.
  • More than one app copy runs when no downtime is needed.
  • Start, ready, and live checks work.
  • Logs show the app version.
  • Error and speed checks are ready.
  • Key user tasks are tested.
  • Old and new code can run together.
  • Database changes are safe to roll out.
  • Sessions, caches, jobs, and workers are covered.
  • Auto scaling has safe limits.
  • Stop and rollback rules are clear.
  • The last good app image is kept.
  • The plan was tested in a setup like the live site.
  • The team knows who can stop or roll back the deploy.

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.