rollback-workflow-builder
Creates safe rollback procedures for deployments with automated workflows, rollback runbooks, version management, and incident response. Use for "rollback automation", "deployment recovery", "incident response", or "production rollback".
What this skill does
# Rollback Workflow Builder
Build safe, fast rollback mechanisms for production deployments.
## Manual Rollback Workflow
```yaml
# .github/workflows/rollback.yml
name: Rollback
on:
workflow_dispatch:
inputs:
version:
description: "Version to rollback to (e.g., v1.2.3 or previous)"
required: true
type: string
environment:
description: "Environment to rollback"
required: true
type: choice
options:
- staging
- production
reason:
description: "Reason for rollback"
required: true
type: string
jobs:
rollback:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.version }}
- name: Verify version exists
run: |
if ! git rev-parse ${{ github.event.inputs.version }} >/dev/null 2>&1; then
echo "โ Version ${{ github.event.inputs.version }} not found"
exit 1
fi
echo "โ
Version ${{ github.event.inputs.version }} exists"
- name: Get current version
id: current
run: |
CURRENT=$(git describe --tags --abbrev=0)
echo "version=$CURRENT" >> $GITHUB_OUTPUT
echo "Current version: $CURRENT"
- name: Confirm rollback
run: |
echo "๐ Rolling back from ${{ steps.current.outputs.version }} to ${{ github.event.inputs.version }}"
echo "Environment: ${{ github.event.inputs.environment }}"
echo "Reason: ${{ github.event.inputs.reason }}"
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm run build
- name: Deploy rollback
run: |
./scripts/deploy.sh ${{ github.event.inputs.environment }}
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
- name: Verify deployment
run: |
./scripts/health-check.sh ${{ github.event.inputs.environment }}
- name: Create incident issue
uses: actions/github-script@v7
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Rollback: ${context.payload.inputs.environment} to ${context.payload.inputs.version}`,
body: `## Rollback Details
**Environment:** ${context.payload.inputs.environment}
**From:** ${{ steps.current.outputs.version }}
**To:** ${context.payload.inputs.version}
**Reason:** ${context.payload.inputs.reason}
**Triggered by:** @${context.actor}
**Time:** ${new Date().toISOString()}
## Next Steps
- [ ] Verify rollback successful
- [ ] Investigate root cause
- [ ] Create fix
- [ ] Update postmortem
`,
labels: ['incident', 'rollback']
})
```
## Automated Rollback on Failure
```yaml
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy
id: deploy
run: ./scripts/deploy.sh production
continue-on-error: true
- name: Verify deployment
id: verify
if: steps.deploy.outcome == 'success'
run: ./scripts/health-check.sh production
continue-on-error: true
- name: Auto-rollback on failure
if: steps.deploy.outcome == 'failure' || steps.verify.outcome == 'failure'
run: |
echo "โ ๏ธ Deployment failed, initiating automatic rollback"
PREVIOUS_VERSION=$(git describe --tags --abbrev=0 HEAD^)
./scripts/deploy.sh production $PREVIOUS_VERSION
# Verify rollback
if ./scripts/health-check.sh production; then
echo "โ
Rollback successful"
else
echo "โ Rollback failed - manual intervention required"
exit 1
fi
```
## Kubernetes Rollback
```yaml
rollback-k8s:
runs-on: ubuntu-latest
steps:
- name: Setup kubectl
uses: azure/setup-kubectl@v3
- name: Configure kubectl
run: |
echo "${{ secrets.KUBECONFIG }}" > kubeconfig
export KUBECONFIG=kubeconfig
- name: Rollback deployment
run: |
kubectl rollout undo deployment/myapp -n production
kubectl rollout status deployment/myapp -n production --timeout=5m
- name: Get rollback revision
run: |
kubectl rollout history deployment/myapp -n production
```
## Docker Image Rollback
```yaml
- name: Rollback to previous image
run: |
# Get previous image tag
PREVIOUS_TAG=$(docker inspect myapp:latest | jq -r '.[0].ContainerConfig.Labels.previous_tag')
# Retag previous as latest
docker pull myapp:$PREVIOUS_TAG
docker tag myapp:$PREVIOUS_TAG myapp:latest
docker push myapp:latest
# Restart containers
docker-compose pull
docker-compose up -d
```
## Database Migration Rollback
```yaml
- name: Rollback database migrations
run: |
# Get migration to rollback to
CURRENT=$(npm run migrate:current)
TARGET=${{ github.event.inputs.migration }}
echo "Rolling back from $CURRENT to $TARGET"
npm run migrate:down -- --to=$TARGET
# Verify rollback
AFTER=$(npm run migrate:current)
if [ "$AFTER" != "$TARGET" ]; then
echo "โ Migration rollback failed"
exit 1
fi
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
```
## Rollback Runbook
````markdown
# Production Rollback Runbook
## When to Rollback
Rollback if:
- Critical bugs affecting >10% of users
- Data integrity issues
- Security vulnerabilities
- Performance degradation >50%
- Error rate >5%
## Before Rollback
1. **Assess impact**: Check monitoring dashboards
2. **Identify version**: Determine last known good version
3. **Notify team**: Post in #incidents Slack channel
4. **Enable maintenance mode** (if possible)
## Rollback Steps
### Automated Rollback (Preferred)
1. Go to Actions โ Rollback workflow
2. Select environment (staging/production)
3. Enter target version (e.g., v1.2.3 or "previous")
4. Enter reason for rollback
5. Click "Run workflow"
6. Monitor progress in Actions tab
### Manual Rollback (Emergency)
```bash
# 1. SSH to production server
ssh production
# 2. Check current version
docker ps | grep myapp
# 3. Pull previous version
docker pull myapp:v1.2.3
# 4. Update docker-compose
vim docker-compose.yml
# Change image: myapp:latest to myapp:v1.2.3
# 5. Deploy
docker-compose up -d
# 6. Verify
curl https://api.myapp.com/health
# 7. Check logs
docker logs myapp -f
```
````
## After Rollback
1. **Verify**: Run smoke tests
2. **Monitor**: Watch error rates for 15 minutes
3. **Notify**: Update #incidents with status
4. **Disable maintenance mode**
5. **Create incident ticket**
6. **Schedule postmortem**
## Rollback Verification
- [ ] Health check returns 200
- [ ] Error rate <1%
- [ ] Response time p95 <500ms
- [ ] Key features working (login, checkout, etc.)
- [ ] Database connectivity OK
## Communication Template
```
๐ ROLLBACK IN PROGRESS
Environment: Production
From: v1.3.0
To: v1.2.3
Reason: Critical bug in checkout flow
Status: In progress
ETA: 5 minutes
Updates: #incidents
```
## Common Issues
### Issue: Rollback Fails
**Symptom:** Deployment doesn't start
**Fix:** Check logs, verify version exists, ensure secrets are valid
### Issue: Database Incompatibility
**Symptom:** App starts but can't read data
**Fix:** May need to rollback migrations first
### Issue: Traffic Not Routing
**Symptom:** Users still see new version
**Fix:** Clear CDN cache, check load balancer config
````
## Health Check Script
```bash
#!/bin/bash
# scripts/health-check.sh
ENVIRONMENT=$1
BASE_URL="https://${ENVIRONMENT}.myapp.com"
echo "Running health checks for $ENVIRONMENT..."
# API health
if ! curl -f "$BASE_URL/api/health" > /dev/null 2>&1; then
echo "โ API health checRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.