templates/skills/ops/deploy/SKILL.md
Full deployment lifecycle including pre-checks, execution, verification, rollback, and documentation.
npx skillsauth add dwoolworth/devteam deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The deployment skill covers the full lifecycle of deploying code to production: pre-checks, execution, verification, rollback, and documentation. Every deployment follows this process. No shortcuts.
Before any deployment, verify ALL of the following:
rfp status: Only deploy tickets that have reached Ready for ProductionIf ANY item on this checklist is not satisfied, STOP. Do not deploy. Communicate the blocker in #standup and on the ticket.
docker build -t ${SERVICE_NAME}:${VERSION} -f Dockerfile .
docker tag ${SERVICE_NAME}:${VERSION} ${REGISTRY}/${SERVICE_NAME}:${VERSION}
docker tag ${SERVICE_NAME}:${VERSION} ${REGISTRY}/${SERVICE_NAME}:latest
docker push ${REGISTRY}/${SERVICE_NAME}:${VERSION}
docker push ${REGISTRY}/${SERVICE_NAME}:latest
# Pull latest images
docker compose -f docker-compose.prod.yml pull
# Deploy with zero-downtime (if configured)
docker compose -f docker-compose.prod.yml up -d --remove-orphans
# Verify containers are running
docker compose -f docker-compose.prod.yml ps
# Stop the old container
docker stop ${SERVICE_NAME} || true
docker rm ${SERVICE_NAME} || true
# Run the new container
docker run -d \
--name ${SERVICE_NAME} \
--restart unless-stopped \
--network ${NETWORK_NAME} \
-p ${HOST_PORT}:${CONTAINER_PORT} \
--env-file .env.production \
${REGISTRY}/${SERVICE_NAME}:${VERSION}
# Verify the container is healthy
docker inspect --format='{{.State.Health.Status}}' ${SERVICE_NAME}
# Apply the deployment
kubectl apply -f k8s/deployment.yaml -n ${NAMESPACE}
# Watch the rollout
kubectl rollout status deployment/${DEPLOYMENT_NAME} -n ${NAMESPACE} --timeout=300s
# Check pod status
kubectl get pods -n ${NAMESPACE} -l app=${APP_LABEL}
# Check pod logs for errors
kubectl logs -n ${NAMESPACE} -l app=${APP_LABEL} --tail=50
# Describe deployment for events
kubectl describe deployment/${DEPLOYMENT_NAME} -n ${NAMESPACE}
# Scale up/down
kubectl scale deployment/${DEPLOYMENT_NAME} -n ${NAMESPACE} --replicas=${REPLICA_COUNT}
# Verify scaling
kubectl get pods -n ${NAMESPACE} -l app=${APP_LABEL}
# Stop the current (broken) container
docker stop ${SERVICE_NAME}
docker rm ${SERVICE_NAME}
# Run the previous version
docker run -d \
--name ${SERVICE_NAME} \
--restart unless-stopped \
--network ${NETWORK_NAME} \
-p ${HOST_PORT}:${CONTAINER_PORT} \
--env-file .env.production \
${REGISTRY}/${SERVICE_NAME}:${PREVIOUS_VERSION}
# Verify rollback
docker inspect --format='{{.State.Health.Status}}' ${SERVICE_NAME}
# Revert to previous image tags in compose file, then:
docker compose -f docker-compose.prod.yml up -d --remove-orphans
docker compose -f docker-compose.prod.yml ps
# Rollback to the previous revision
kubectl rollout undo deployment/${DEPLOYMENT_NAME} -n ${NAMESPACE}
# Watch the rollback
kubectl rollout status deployment/${DEPLOYMENT_NAME} -n ${NAMESPACE} --timeout=300s
# Verify pods are healthy after rollback
kubectl get pods -n ${NAMESPACE} -l app=${APP_LABEL}
# Check rollout history
kubectl rollout history deployment/${DEPLOYMENT_NAME} -n ${NAMESPACE}
Execute a rollback immediately if any of the following occur:
Do NOT attempt to "fix forward" if the issue is unclear. Roll back first, then investigate.
After every deployment, verify ALL of the following:
# HTTP health check
curl -sf ${SERVICE_URL}/health || echo "HEALTH CHECK FAILED"
# Detailed health with dependencies
curl -s ${SERVICE_URL}/health/detailed | jq .
# Verify critical endpoints are responding
curl -sf -o /dev/null -w "%{http_code}" ${SERVICE_URL}/api/status
curl -sf -o /dev/null -w "%{http_code}" ${SERVICE_URL}/api/ping
# Check error rates (should not spike)
# Check response times (should not degrade)
# Check resource usage (should be within normal bounds)
# Check logs for new error patterns
docker logs ${SERVICE_NAME} --since 5m 2>&1 | grep -i error || echo "No errors found"
Every deployed service must have:
Every deployment gets a comment on the ticket with this structure:
## Deployment Record
**Ticket:** #[TICKET_ID]
**Deployed by:** ops
**Timestamp:** [ISO 8601 timestamp]
**Environment:** [production/staging]
**Version:** [version tag or commit hash]
**Previous Version:** [what was running before]
### Changes Deployed
[Brief description of what this deployment includes]
### Deployment Method
[Docker Compose / Kubernetes / Direct Container]
### Pre-Deployment Checks
- [x] CQ review confirmed
- [x] QA pass confirmed
- [x] Infrastructure health verified
- [x] Rollback plan prepared
- [x] Dependencies in place
### Post-Deployment Verification
- [x] Health checks passing
- [x] Smoke tests passing
- [x] Error rates nominal
- [x] Response times nominal
- [x] Monitoring dashboards green
### Rollback Plan
To rollback this deployment:
1. [Exact rollback command or steps]
2. [Verification after rollback]
3. [Notify team in #standup]
### Notes
[Any observations, warnings, or follow-up items]
development
Run Playwright browser tests and curl API tests to validate tickets against acceptance criteria.
testing
Read tickets, post test result comments, and change ticket status as part of the QA gate on the Planning Board.
testing
Post test results, ask clarifying questions, and communicate QA status on the Meeting Board.
tools
Full CRUD access to the Planning Board for creating, reading, updating, and deleting tickets.