$npx -y skills add DevelopersGlobal/ai-agent-skills --skill production-deploymentZero-downtime deployments with pre-flight checks, staged rollouts, and rollback plans. Never ship to production without a verified rollback strategy.
| 1 | ## Overview |
| 2 | |
| 3 | Production is not a test environment. Every deployment is a live operation with real consequences — user impact, data integrity risks, and potential outages. This skill encodes the discipline senior engineers apply before, during, and after every production deployment. |
| 4 | |
| 5 | The core rule: **never deploy without a rollback plan you've verified can execute in under 5 minutes.** |
| 6 | |
| 7 | ## When to Use |
| 8 | |
| 9 | - Before any deployment to a production or production-equivalent environment |
| 10 | - When reviewing deployment scripts or CI/CD pipelines |
| 11 | - When adding new services or infrastructure changes |
| 12 | |
| 13 | ## Process |
| 14 | |
| 15 | ### Step 1: Pre-Deployment Checklist |
| 16 | |
| 17 | 1. **All tests pass** — CI is green on the exact commit being deployed. Not "mostly green." |
| 18 | 2. **Migrations are backward-compatible** — The old code must work with the new schema (for zero-downtime). New columns are nullable; columns aren't dropped until after full rollout. |
| 19 | 3. **Feature flags configured** — New features are behind flags, off by default. |
| 20 | 4. **Rollback plan written** — Document exactly how to rollback: which commands, which configs, estimated time. |
| 21 | 5. **Deployment window confirmed** — Low-traffic period? On-call engineer available? |
| 22 | 6. **Stakeholders notified** — Anyone affected by downtime or behavior change knows. |
| 23 | |
| 24 | **Verify:** All 6 checklist items confirmed. Do not proceed if any is blocked. |
| 25 | |
| 26 | ### Step 2: Staged Rollout |
| 27 | |
| 28 | 7. Never deploy to 100% of traffic immediately. Use a staged rollout: |
| 29 | - Canary: 1–5% of traffic |
| 30 | - Staged: 10% → 25% → 50% → 100% |
| 31 | 8. Monitor key metrics at each stage for at least 15 minutes before expanding: |
| 32 | - Error rate (baseline vs. current) |
| 33 | - Latency p50, p95, p99 |
| 34 | - Business metrics (conversion, orders, etc.) |
| 35 | 9. **Define your abort threshold before starting**: *"If error rate exceeds X% or latency p99 exceeds Y ms, rollback immediately."* |
| 36 | |
| 37 | **Verify:** Rollout stages and abort thresholds are documented before deployment begins. |
| 38 | |
| 39 | ### Step 3: Deploy |
| 40 | |
| 41 | 10. Execute the deployment using your CI/CD pipeline (not manual commands). |
| 42 | 11. Monitor dashboards in real-time during the rollout. |
| 43 | 12. Keep communication channel open with on-call engineer. |
| 44 | 13. Do not perform any other changes during a deployment (no "quick fixes"). |
| 45 | |
| 46 | **Verify:** Deployment running via CI/CD, dashboards being monitored actively. |
| 47 | |
| 48 | ### Step 4: Post-Deployment Verification |
| 49 | |
| 50 | 14. Smoke tests pass on production. |
| 51 | 15. Key user journeys manually verified. |
| 52 | 16. Error rate within normal range (15 minutes post-deploy). |
| 53 | 17. No unexpected alerts triggered. |
| 54 | 18. Run post-deploy integration tests if available. |
| 55 | |
| 56 | **Verify:** All post-deploy checks confirmed green. Deployment marked successful. |
| 57 | |
| 58 | ### Step 5: Rollback (if needed) |
| 59 | |
| 60 | 19. If any abort threshold is hit: **rollback immediately, without debate.** |
| 61 | 20. Execute the pre-written rollback plan. |
| 62 | 21. Verify rollback complete: service restored, error rate normalized. |
| 63 | 22. Write an incident report — even for near-misses. |
| 64 | |
| 65 | **Verify:** Rollback completes in under 5 minutes. Service restored. |
| 66 | |
| 67 | ## Common Rationalizations (and Rebuttals) |
| 68 | |
| 69 | | Excuse | Rebuttal | |
| 70 | |--------|----------| |
| 71 | | "It works in staging" | Staging is not production. Different data, traffic, and configuration. | |
| 72 | | "It's just a small change" | Small changes cause the majority of outages. | |
| 73 | | "We don't have time for staged rollout" | You have even less time for an incident. | |
| 74 | | "I'll watch it for a few minutes" | 15 minutes minimum. Most production failures take time to materialize under load. | |
| 75 | | "We can rollback if needed" | Do you have a written, tested rollback plan? No? Then you can't. | |
| 76 | |
| 77 | ## Red Flags |
| 78 | |
| 79 | - Deploying directly to 100% without a staged rollout |
| 80 | - No rollback plan documented before deployment |
| 81 | - Deploying breaking schema changes without backward compatibility |
| 82 | - Running deployment from a local machine, not CI/CD |
| 83 | - Deploying during high-traffic periods without approval |
| 84 | - "I'll fix any issues after we deploy" |
| 85 | |
| 86 | ## Verification |
| 87 | |
| 88 | - [ ] All tests passing on exact commit being deployed |
| 89 | - [ ] Migrations are backward-compatible |
| 90 | - [ ] Rollback plan written and executable in <5 minutes |
| 91 | - [ ] Staged rollout plan with abort thresholds defined |
| 92 | - [ ] Post-deploy smoke tests passed |
| 93 | - [ ] Dashboards clean for 15 minutes post-deploy |
| 94 | |
| 95 | ## References |
| 96 | |
| 97 | - [ci-cd-pipelines skill](../ci-cd-pipelines/SKILL.md) |
| 98 | - [observability skill](../observability/SKILL.md) |
| 99 | - [git-workflow skill](../git-workflow/SKILL.md) |
| 100 | - [references/deployment-checklist.md](../../references/deployment-checklist.md) |