release-rollback
Rollback a failed release by deleting tags and reverting version changes. Use when a release fails, needs to be cancelled, or when reverting a problematic release.
When & Why to Use This Skill
The release-rollback skill automates the recovery process for failed software deployments by systematically deleting local and remote Git tags, removing GitHub releases, and reverting version changes across project files. It streamlines incident response in the CI/CD pipeline, ensuring a clean repository state and preventing versioning conflicts after a problematic release attempt.
Use Cases
- Failed Build Recovery: Quickly clean up tags and release metadata when a CI/CD pipeline fails mid-deployment, leaving the repository in an inconsistent state.
- Critical Bug Withdrawal: Immediately retract a problematic stable or beta release from GitHub and Git history if a high-severity issue is discovered post-deployment.
- Version Mismatch Correction: Revert version bumps and tags when synchronization errors occur between package.json, manifest files, and environment constants.
- Accidental Release Cancellation: Efficiently undo a release that was triggered prematurely or from the incorrect branch, ensuring users don't download unfinished code.
| name | release-rollback |
|---|---|
| description | Rollback a failed release by deleting tags and reverting version changes. Use when a release fails, needs to be cancelled, or when reverting a problematic release. |
Rollback Failed Release
Rollback a failed release by deleting the release and reverting version changes.
⚠️ This will delete the release and revert version changes.
Current Situation Check
Check recent tags:
git tag -l --sort=-version:refname | head -5
Review which version needs to be rolled back.
Rollback Process
Step 1: Verify Version to Rollback
Confirm with the user:
- What is the version to rollback?
- Is this the correct version to rollback?
Step 2: Run Rollback Script
Execute the rollback command:
npm run release:rollback <version>
Example:
npm run release:rollback 1.5.0-beta.3
Step 3: What the Script Will Do
The rollback script performs:
- Delete local git tag for specified version
- Delete remote git tag for specified version
- Delete GitHub release for specified version
- Revert version changes in all files
- Clean up RELEASE_NOTES files
- Provide next steps
Step 4: After Rollback
Post-rollback verification:
- Check GitHub to confirm release is deleted
- Verify tags are removed:
git tag -l - Fix the issues that caused the failure
- Run:
npm run release:checkto validate fixes
Step 5: Create New Release
Once issues are fixed, create new release:
- For beta: Use release-beta skill
- For stable: Use release-stable skill
Common Rollback Scenarios
Build Failed
- Fix build errors
- Run:
npm run buildto test - Run:
npm run test:smoke - Re-run validation
Linting/Type Errors
- Run:
npm run lintto auto-fix - Run:
npm run type-checkto verify - Fix reported issues
- Re-run validation
Version Mismatch
- Check all version files are synced:
- Re-run bump command
Validation Failed
- Run:
npm run release:check - Address all errors and warnings
- Fix issues systematically
- Re-run validation
Usage Example
# Rollback beta release
/release-rollback 2.0.0-beta.3
# Rollback stable release
/release-rollback 1.5.0
This requires the version number to rollback.
Important Notes
- Destructive operation: Cannot be undone easily
- Confirm version: Double-check before proceeding
- Fix root cause: Address the issue that caused failure
- Re-validate: Run all checks before creating new release
- Communication: If release was public, inform users
Rollback Checklist
Before proceeding with rollback:
- Identified the version to rollback
- Confirmed the version is correct
- Understood why the release failed
- Ready to fix the underlying issue
After rollback:
- Verified tag deletion locally and remotely
- Confirmed GitHub release deletion
- Fixed the root cause issue
- Ran validation checks
- Ready for new release attempt