Agent skill
rollback-procedures
Use when the Production Engineer is planning rollback strategies, reverting a bad release, handling data migration reversals, managing feature flags, implementing hotfix workflows, or preparing disaster recovery procedures. Activates when discussing rollbacks, reverts, or recovery from failed deployments.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/rollback-procedures-dsivov-ai-development-team
SKILL.md
Rollback Procedures
When This Applies
Apply this guidance when:
- Planning rollback strategies before a merge
- Reverting a problematic release
- Handling failed deployments
- Managing emergency hotfixes
- Preparing disaster recovery plans
Rollback Strategy Selection
Decision Tree
Was the issue detected before push to production?
YES → git reset or revert locally
NO → Was data affected?
NO → Simple git revert
YES → Data migration reversal needed
→ Is the migration reversible?
YES → Run reverse migration + git revert
NO → Manual data fix + hotfix
Rollback Methods
| Method | When | Command | Risk |
|---|---|---|---|
| Git revert | After push, no data impact | git revert <commit> |
Low |
| Branch reset | Before push | git reset --hard <commit> |
Medium |
| Revert merge | Bad merge to main | git revert -m 1 <merge-commit> |
Medium |
| Hotfix | Partial fix needed | New hotfix branch | Low |
| Full rollback | Everything is broken | Redeploy previous version | High |
Git Revert Process
Simple Revert (single commit)
git checkout main
git revert <commit-hash>
git push origin main
Merge Revert (undo a merge)
# -m 1 means keep the main branch's parent
git checkout main
git revert -m 1 <merge-commit-hash>
git push origin main
After Reverting a Merge
If the original work needs to be re-merged later:
# First, revert the revert to restore the changes
git revert <revert-commit-hash>
# Then apply fixes
# Then merge normally
Hotfix Workflow
For urgent fixes that can't wait for the normal workflow:
- Create hotfix branch from main:
git checkout -b hotfix/NNN-description main - Apply the minimal fix
- Run ALL tests
- Notify Manager (via queue) about the emergency change
- Merge to main:
git checkout main && git merge --no-ff hotfix/NNN-description - Push:
git push origin main - Also merge to development to keep branches in sync
- Delete hotfix branch
- Document in CHANGELOG.md and create a post-incident report
Pre-Merge Rollback Planning
Before every merge to main, prepare:
- Rollback command — The exact git command to revert
- Verification steps — How to confirm the rollback worked
- Data considerations — Whether data changes need reversing
- Communication plan — Who to notify and how
- Estimated time — How long a rollback would take
Incident Response
If a production issue is discovered after merge:
- Assess severity — Is the service down? Is data corrupted? Is it cosmetic?
- Decide action — Rollback vs hotfix vs wait
- Execute — Perform the chosen action
- Verify — Confirm the issue is resolved
- Communicate — Notify all roles via queue with
criticalpriority - Document — Write incident report
Severity Guide
| Severity | Description | Response Time | Action |
|---|---|---|---|
| P0 | Service down | Immediate | Rollback now |
| P1 | Major feature broken | Within minutes | Rollback or hotfix |
| P2 | Minor feature affected | Within session | Hotfix |
| P3 | Cosmetic issue | Next sprint | Normal fix |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?