rollback-strategy
Skill1 starsChanged 5 days agoMITView on GitHub
Design safe rollback plans before deploying — identify irreversible changes, classify rollback complexity, create tested undo procedures. Triggers: rollback plan, rollback strategy, how do I undo this, can we revert, what if the deploy fails, safe to deploy, feature flag rollout, blue-green, database migration rollback, irreversible change.
In this repository68 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-designSkill
- ai-evaluationSkill
- api-designSkill
- architecture-designSkill
- architecture-documentationSkill
- brainstormingSkill
- browser-verificationSkill
- bug-investigatingSkill
- build-vs-buySkill
- cicd-pipelineSkill
- code-archaeologySkill
- code-reviewingSkill
- code-slop-cleanupSkill
- compliance-privacySkill
- configuration-strategySkill
- containerizationSkill
- data-modelingSkill
- data-pipeline-designSkill
- data-qualitySkill
- dependency-impact-analysisSkill
- dependency-managementSkill
- deployment-checklistSkill
- deployment-repoSkill
- dx-auditSkill
- effort-estimationSkill
- exploratory-data-analysisSkill
- feature-planningSkill
- finops-cost-optimizationSkill
- frontend-architectureSkill
- gitops-deliverySkill
- git-workflowSkill
- incident-responseSkill
- infrastructure-as-codeSkill
- llm-app-engineeringSkill
- metrics-and-okrsSkill
- ml-experiment-trackingSkill
- ml-model-deploymentSkill
- ml-pipeline-designSkill
- mobile-architectureSkill
- mobile-releaseSkill
- notebook-to-productionSkill
- observability-designSkill
- performance-optimizationSkill
- plan-executionSkill
- prd-writingSkill
- project-documentationSkill
- project-proposalSkill
- project-reviewSkill
- refactoringSkill
- release-managementSkill
- research-methodologySkill
- resilience-engineeringSkill
- retrospectiveSkill
- security-auditSkill
- skill-routerSkill
- statistical-analysisSkill
- strategic-reviewSkill
- subagent-orchestrationSkill
- tdd-workflowSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 60
Test the "off" state in staging before deploying to production
- Distinctive: line 64
Write the reverse migration before deploying the forward migration
- Distinctive: line 65
Test both on a copy of production data
- Distinctive: line 66
If the migration is too large to reverse quickly, plan for an emergency read-only mode instead
- Distinctive: line 69
Document the previous value of every env var being changed
- Distinctive: line 74
Write the rollback plan in the deployment PR or deployment runbook:
- Distinctive: line 86
Run the rollback steps in staging before production deploy
- Distinctive: line 88
Verify application health after rollback completes
- Distinctive: line 90
Use templates/rollback-plan.md for the full plan format.
- Distinctive: line 94
KISS: Prefer feature flags over complex rollback procedures.
- Distinctive: line 95
YAGNI: Don't deploy a change you can't roll back without a documented, tested plan.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rollback Strategy
Design the undo plan before deploying — not during a production incident. A deployment without a rollback plan is a bet that nothing will go wrong.
⛔ The Iron Law
If you can't undo it, don't ship it yet.
Every change is classified by rollback complexity before deploy, and every non-Simple change has a written rollback procedure that has been tested — not just imagined. Decide rollback before the incident, never during it: the minutes you'd spend designing an undo mid-incident are the minutes users are down.
Step 1: Analyze the Deployment
List every change being deployed:
- Code changes: Which services, which endpoints, what behavior changes?
- Schema changes: New tables, columns, indexes, constraints, dropped columns?
- Data migrations: Backfills, transformations, deletes?
- Configuration changes: New env vars, feature flag states, infrastructure config?
- Dependency updates: Library upgrades, external service version changes?
For each change, ask: If this change caused a production incident 30 minutes after deploy, what would rollback look like?
When the deploy has already happened and users are affected now, this is an
active incident, not planning. Lead with the fastest safe undo — revert the deploy or
turn the flag off — as exact steps, and name incident-response as the workflow
for the rest of the incident. Keep the rollback-plan template (owner, estimated time,
staging rehearsal) out of this answer; it belongs in the post-incident review.
Step 2: Classify by Rollback Complexity
Assign each change a rollback complexity:
| Complexity | Definition | Examples |
| Simple | Revert the code deploy, no other steps | Logic change, UI change, new feature behind a flag |
| Coordinated | Code revert + one other step | New env var (remove it), new index (drop it), additive column (leave it, no harm) |
| Complex | Requires data migration reversal or multi-step coordination | Column rename (requires data migration), data backfill (must un-backfill) |
| Irreversible | Cannot be fully undone | Destructive data operations, sent emails/notifications, external API calls with side effects |
If any change is Irreversible: explicitly document what partial rollback looks like and get sign-off before deploying.
See references/rollback-patterns.md for detailed patterns per component type.
Step 3: Design the Rollback Procedure
For each non-Simple change, write the explicit rollback steps:
Database schema rollback:
- Additive columns (new nullable column): safe to leave after rollback — old code ignores them
- Non-additive changes (rename, type change, NOT NULL constraint): require a reverse migration
- Dropped columns: need to be re-added and re-populated (use
git bisectto find the data state)
Feature flag rollback:
- Define the "off" state before deploying
- Test the "off" state in staging before deploying to production
- Know which percentage to roll back to if doing a canary rollout
Data migration rollback:
- Write the reverse migration before deploying the forward migration
- Test both on a copy of production data
- If the migration is too large to reverse quickly, plan for an emergency read-only mode instead
Configuration rollback:
- Document the previous value of every env var being changed
- For secrets rotation: keep the old secret valid for 24 hours after switching
Step 4: Document and Test the Plan
Write the rollback plan in the deployment PR or deployment runbook:
Rollback Plan:
1. [Step]: [Command or action]
2. [Step]: [Command or action]
3. Verify: [How to confirm rollback succeeded]
Estimated rollback time: [X minutes]
Rollback owner: [Who executes this during an incident]Test it before you need it:
- Run the rollback steps in staging before production deploy
- Confirm the rollback takes the expected time (important during incidents)
- Verify application health after rollback completes
Use templates/rollback-plan.md for the full plan format.
Principles Applied
- KISS: Prefer feature flags over complex rollback procedures. The simplest rollback is turning a flag off.
- YAGNI: Don't deploy a change you can't roll back without a documented, tested plan. If you can't undo it, don't ship it yet.
- Defense in depth: Multiple rollback options (flag → revert → data migration reversal) provide fallbacks when the first option isn't enough.
- Fail fast: Define rollback triggers before deploying (see
deployment-checklist). Waiting until an incident to decide when to rollback wastes critical time.
Rationalizations to reject
| Excuse | Reality |
| "We'll figure out rollback if it breaks" | Designing rollback mid-incident wastes the minutes that matter most. |
| "The migration is reversible, trust me" | Reversible in theory ≠ tested. Run the reverse on production-sized data first. |
| "It's behind a flag, that's enough" | Only if the off-state was defined and tested before deploy. |
| "Rollback is unlikely, skip the plan" | A rollback plan is insurance — you write it before you need it, not after. |
| "Additive column, no rollback needed" | Confirm old code ignores it and document the no-op explicitly. |
Red flags — stop and correct course
- An Irreversible change with no documented partial-rollback and no sign-off.
- A reverse migration that has never actually been executed.
- A feature flag whose off-state was never tested in staging.
- The estimated rollback time is unknown.
Cross-Skill References
deployment-checklist— run before every deploy; rollback plan is a required gateincident-response— execute the rollback plan when an incident occursconfiguration-strategy— design feature flags as part of config strategy (reduces rollback complexity)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

