Deployment Procedures — Strategy & Rollback Reference
Knowledge reference for deployment strategies (rolling, blue-green, canary, recreate) plus rollback decision criteria, pre-deploy checklists, health-check patterns, and post-deploy verification. Loaded by the /deploy-production and /deploy-staging workflows; not a workflow itself.
When to Use
- Deploying application updates to production
- Planning rollback strategies before deployment
- Verifying production health after deployment
- Investigating post-deployment issues
When NOT to Use
- Deploying to staging (use
/deploy-staging workflow)
- Making infrastructure changes (use
/infra-change workflow)
- Planning release version and changelog (use
/release workflow)
Deployment Strategies
| Strategy |
When to Use |
Risk |
Downtime |
| Rolling update |
Standard deploys, stateless services |
Low |
Zero |
| Blue-Green |
Critical services, instant rollback needed |
Low |
Zero |
| Canary |
High-risk changes, gradual validation |
Medium |
Zero |
| Recreate |
Stateful services, breaking schema changes |
High |
Brief |
Rolling Update (Default)
- Gradually replace old pods with new ones
- Health checks gate the rollout — unhealthy pods stop the rollout
- Configure
maxSurge and maxUnavailable for rollout speed
- Monitor error rates during rollout window
Canary Deployment
- Deploy new version to small subset (5–10% traffic)
- Monitor error rate, latency, and business metrics for 5–10 minutes
- If healthy → gradually increase traffic (25% → 50% → 100%)
- If degraded → route all traffic back to stable version
Blue-Green Deployment
- Deploy new version alongside current (green alongside blue)
- Run full smoke tests against green
- Switch traffic from blue to green
- Keep blue running for instant rollback (15–30 minutes)
- Decommission blue after confidence period
Feature-Flag-Coupled Deploys (Decoupled Deploy)
Decoupled deploy ships the new code path dark (flag default off), then flips the flag in a second, independent action. The deploy itself is low-risk because the new code path is gated; risk shifts to the flag flip, which is reversible in seconds.
When to use
- Behavior changes that need progressive rollout regardless of deploy strategy (rolling / blue-green / canary all benefit)
- Risky changes that need fast rollback without redeploy
- A/B tests, regional rollouts, or per-customer enablement
- Database migrations following an expand-contract sequence — flag gates the read-from-new switch
Workflow
- Deploy dark: ship the code with the flag's default value set to OFF. The deploy is low-risk; old behavior continues.
- Verify in production: run synthetics, check logs/metrics — the new code path is reachable but inert.
- Internal-only flip: enable the flag for internal users (test rule on email domain or user ID). Verify behavior.
- Ramp: 1% → 5% → 25% → 50% → 100%. Watch error rate, latency, and business metrics at each step. Pause or rollback the flag at the first regression.
- Cleanup: once the flag has been at 100% for the agreed soak period (typically 1–2 weeks), remove the flag and the old code path in a follow-up PR. Stale flags rot — every flag must have a removal date.
Platforms (vendor-neutral first, then vendor-specific)
| Platform |
SDK marker |
Notes |
| OpenFeature |
@openfeature/... packages |
Vendor-neutral standard. Pluggable provider (LD/Unleash/Flagsmith/Split). Default choice when starting fresh in 2026. |
| LaunchDarkly |
launchdarkly-*-sdk |
Mature commercial. Strong UI, good targeting rules. |
| Unleash |
unleash-client / @unleash/... |
Open-source + commercial. Good fit for self-hosted. |
| Flagsmith |
flagsmith |
Open-source + commercial. Lightweight. |
| Split.io |
@splitsoftware/splitio |
Strong experimentation focus (built-in metrics + statistical significance). |
| GrowthBook |
@growthbook/growthbook-* |
Open-source. Strong A/B-test analysis. |
Anti-patterns
- Flag-only deploys with no kill date: flags accumulate and become permanent state. Track flag age; remove on schedule.
- Reading a flag in a hot path without local cache: flag SDK call inside a per-request loop adds latency and a network failure mode. Cache flag values per request or per session.
- Combining many flags into one big flip: one big-bang flag breaks fast-rollback. One concern → one flag.
Pre-Deployment Checklist
Post-Deployment Verification
Integration
- Follows rules:
Agent(devops-engineer) (infrastructure), Agent(sre-engineer) (SLOs, monitoring)
- Used by workflows:
/deploy-production, /deploy-staging
- Companion resources:
rollback-procedure.md
1---2name: deployment-procedures3description: Use this skill when authoring or reviewing a deploy workflow that needs the strategy and rollback knowledge — the deployment strategy reference (rolling, blue-green, canary, recreate) plus rollback decision criteria, pre-deploy checklist, and post-deploy verification, loaded by the `/deploy-production` and `/deploy-staging` workflows; not a workflow itself.4---56# Deployment Procedures — Strategy & Rollback Reference78Knowledge reference for deployment strategies (rolling, blue-green, canary, recreate) plus rollback decision criteria, pre-deploy checklists, health-check patterns, and post-deploy verification. Loaded by the `/deploy-production` and `/deploy-staging` workflows; not a workflow itself.910## When to Use1112- Deploying application updates to production13- Planning rollback strategies before deployment14- Verifying production health after deployment15- Investigating post-deployment issues1617## When NOT to Use1819- Deploying to staging (use `/deploy-staging` workflow)20- Making infrastructure changes (use `/infra-change` workflow)21- Planning release version and changelog (use `/release` workflow)2223## Deployment Strategies2425| Strategy | When to Use | Risk | Downtime |26|---|---|---|---|27| **Rolling update** | Standard deploys, stateless services | Low | Zero |28| **Blue-Green** | Critical services, instant rollback needed | Low | Zero |29| **Canary** | High-risk changes, gradual validation | Medium | Zero |30| **Recreate** | Stateful services, breaking schema changes | High | Brief |3132### Rolling Update (Default)3334- Gradually replace old pods with new ones35- Health checks gate the rollout — unhealthy pods stop the rollout36- Configure `maxSurge` and `maxUnavailable` for rollout speed37- Monitor error rates during rollout window3839### Canary Deployment40411. Deploy new version to small subset (5–10% traffic)422. Monitor error rate, latency, and business metrics for 5–10 minutes433. If healthy → gradually increase traffic (25% → 50% → 100%)444. If degraded → route all traffic back to stable version4546### Blue-Green Deployment47481. Deploy new version alongside current (green alongside blue)492. Run full smoke tests against green503. Switch traffic from blue to green514. Keep blue running for instant rollback (15–30 minutes)525. Decommission blue after confidence period5354## Feature-Flag-Coupled Deploys (Decoupled Deploy)5556Decoupled deploy ships the new code path **dark** (flag default off), then flips the flag in a second, independent action. The deploy itself is low-risk because the new code path is gated; risk shifts to the flag flip, which is reversible in seconds.5758### When to use5960- Behavior changes that need progressive rollout regardless of deploy strategy (rolling / blue-green / canary all benefit)61- Risky changes that need fast rollback without redeploy62- A/B tests, regional rollouts, or per-customer enablement63- Database migrations following an [expand-contract](../migrate/references/expand-contract.md) sequence — flag gates the read-from-new switch6465### Workflow66671. **Deploy dark**: ship the code with the flag's default value set to OFF. The deploy is low-risk; old behavior continues.682. **Verify in production**: run synthetics, check logs/metrics — the new code path is reachable but inert.693. **Internal-only flip**: enable the flag for internal users (test rule on email domain or user ID). Verify behavior.704. **Ramp**: 1% → 5% → 25% → 50% → 100%. Watch error rate, latency, and business metrics at each step. Pause or rollback the flag at the first regression.715. **Cleanup**: once the flag has been at 100% for the agreed soak period (typically 1–2 weeks), remove the flag and the old code path in a follow-up PR. Stale flags rot — every flag must have a removal date.7273### Platforms (vendor-neutral first, then vendor-specific)7475| Platform | SDK marker | Notes |76|---|---|---|77| [OpenFeature](https://openfeature.dev) | `@openfeature/...` packages | Vendor-neutral standard. Pluggable provider (LD/Unleash/Flagsmith/Split). Default choice when starting fresh in 2026. |78| [LaunchDarkly](https://launchdarkly.com) | `launchdarkly-*-sdk` | Mature commercial. Strong UI, good targeting rules. |79| [Unleash](https://www.getunleash.io) | `unleash-client` / `@unleash/...` | Open-source + commercial. Good fit for self-hosted. |80| [Flagsmith](https://flagsmith.com) | `flagsmith` | Open-source + commercial. Lightweight. |81| [Split.io](https://split.io) | `@splitsoftware/splitio` | Strong experimentation focus (built-in metrics + statistical significance). |82| [GrowthBook](https://www.growthbook.io) | `@growthbook/growthbook-*` | Open-source. Strong A/B-test analysis. |8384### Anti-patterns8586- **Flag-only deploys with no kill date**: flags accumulate and become permanent state. Track flag age; remove on schedule.87- **Reading a flag in a hot path without local cache**: flag SDK call inside a per-request loop adds latency and a network failure mode. Cache flag values per request or per session.88- **Combining many flags into one big flip**: one big-bang flag breaks fast-rollback. One concern → one flag.8990## Pre-Deployment Checklist9192- [ ] All tests pass on release branch93- [ ] Staging deployment verified94- [ ] Database migrations tested (forward and rollback)95- [ ] Feature flags configured96- [ ] Monitoring dashboards ready97- [ ] On-call team notified98- [ ] Rollback plan documented and tested99- [ ] Release notes prepared100101## Post-Deployment Verification102103- [ ] Health endpoint returns 200104- [ ] Error rate ≤ pre-deploy baseline105- [ ] Latency P95 within SLO target106- [ ] No new error patterns in logs107- [ ] Key user journeys functional108- [ ] Database connections stable109- [ ] External integrations responding110- [ ] Alerts not firing111112## Integration113114- **Follows rules**: `Agent(devops-engineer)` (infrastructure), `Agent(sre-engineer)` (SLOs, monitoring)115- **Used by workflows**: `/deploy-production`, `/deploy-staging`116- **Companion resources**: `rollback-procedure.md`