Deploy use when you need to work with deployment and CI/CD.
This skill provides deployment automation and orchestration with comprehensive guidance and automation.
Trigger with phrases like "deploy application", "create pipeline",
or "automate deployment".
Implement and execute deployment rollback procedures for Kubernetes, ECS, Lambda, and cloud VM deployments. Detect failed deployments via health checks and error rate monitoring, then automatically or manually revert to the last known good version with minimal downtime and data integrity preservation.
Prerequisites
kubectl configured with cluster access and permission to manage deployments
Deployment history retained (Kubernetes revisionHistoryLimit, ECS task definition versions)
Monitoring system tracking error rate, latency, and health check status (Prometheus, Datadog, CloudWatch)
Previous deployment artifacts (container images, task definitions) still available in the registry
Database migration strategy that supports backward compatibility (expand-contract pattern)
Instructions
Detect deployment failure: monitor error rate, P99 latency, pod restart count, and health check responses for 5-10 minutes post-deploy
Assess rollback scope: determine if the issue is application code, configuration, or infrastructure
For Kubernetes: execute kubectl rollout undo deployment/<name> to revert to the previous revision
For ECS: update the service to use the previous task definition revision
For Lambda: point the alias back to the previous function version
Verify database compatibility: ensure the previous application version works with the current database schema (no forward-only migrations were applied)
Confirm rollback success: verify health checks pass, error rate returns to baseline, and user-facing functionality is restored
Generate a post-incident report: document what failed, when rollback was triggered, time to recovery, and root cause
Create automated rollback rules: configure Kubernetes readiness probes, Argo Rollouts analysis, or CloudWatch alarms to trigger rollback without manual intervention
Output
Rollback scripts for each deployment target (Kubernetes, ECS, Lambda)