Rollback

From softspark/ai-toolkit · View interactive version

Rollback is an AI agent skill from the GitHub repository softspark/ai-toolkit. Rolls back git commit, DB migration, or deploy to known-good with safety + health checks. Triggers: rollback, revert deploy, revert migration, rollback commit, git revert.

How to use this skill

Skill file

/rollback - Safe Rollback

$ARGUMENTS

What This Command Does

Safely revert changes with appropriate safety checks and confirmation.

Rollback Types

1. Git Rollback

# Revert last commit (creates new commit)
git revert HEAD --no-edit

# Revert specific commit
git revert <commit-sha> --no-edit

# Revert to specific state (CAUTION)
git reset --soft <commit-sha>  # Keep changes staged

2. Database Migration Rollback

| Tool | Command |

|------|---------|

| Alembic | alembic downgrade -1 |

| Prisma | npx prisma migrate resolve --rolled-back <name> |

| Laravel | php artisan migrate:rollback --step=1 |

| Django | python manage.py migrate <app> <previous> |

| Flyway | flyway undo |

3. Deployment Rollback

| Platform | Command |

|----------|---------|

| Kubernetes | kubectl rollout undo deployment/<name> |

| Docker Compose | docker compose up -d --force-recreate (with previous image tag) |

| Heroku | heroku rollback |

Gather Rollback Context

Run the rollback info script to assess current state before rolling back:

python3 ${CLAUDE_SKILL_DIR}/scripts/rollback_info.py

Returns JSON with:

Safety Checks (MANDATORY)

Before any rollback:

  1. Confirm what will be reverted (show diff/plan)
  2. Check for dependent changes that may break
  3. Verify backup exists (for database rollbacks)
  4. Get explicit user confirmation

Usage Examples

/rollback                    # Interactive - asks what to rollback
/rollback git last           # Revert last git commit
/rollback migration          # Rollback last database migration
/rollback deploy             # Rollback to previous deployment

CRITICAL: Always confirm with the user before executing destructive rollback operations.

Rules

Gotchas

When NOT to Use

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.