agentleFS
tejastn10tejastn10/workbench/skills/deployment/rollback/SKILL.md

rollback

Skill1 starsChanged 2 months agoMITView on GitHub

Get production back to a known-good state fast and safely — flip the flag or redeploy the previous artifact, deal with migrations that can't be un-run, verify recovery, then follow up with a postmortem. Use when a deploy has caused an incident, when asked to "roll back" / "revert prod", or when the rollback trigger from a deploy fires.

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use plan, status and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 4 projects that use this

  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • AWSSkill

    ship

    Finalize dev work on an issue branch — update docs, push, and open a PR.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

Files
SKILL.md

Roll back

Speed matters, but a careless rollback can make it worse (especially with migrations). Have the plan from deployment/deploy-service; this executes it.

Decide the mechanism (fastest safe option first)

  1. Feature flag off — if the change was flagged, one flip returns to the old path instantly, no deploy. This is why risky changes get flags.
  2. Redeploy the previous artifact — the last known-good image/tag. Fast, clean, if there's no incompatible schema change.
  3. Revert commit + deploy — git revert the merge, ship it. Slower (full pipeline) but sometimes the only option.

The migration problem

  • Additive migration (new nullable column, new table) — safe to leave; the old code ignores it. Roll back code only.
  • Destructive / transforming migration already run — you usually cannot roll the schema back without data loss. Options: roll forward with a fix instead; or restore from backup (last resort, has its own data-loss window).
  • This is why migrations are additive and decoupled from the deploy — so a code rollback doesn't need a schema rollback.

Execute

  1. Announce it (incident channel): what, why, ETA.
  2. Do the rollback.
  3. Verify recovery — the error rate / latency / the affected metric returns to baseline. Not just "the deploy finished".
  4. Confirm no new problem introduced (e.g. old code + new data).
  5. Hold the fixed version out of prod until the root cause is understood — don't immediately redeploy forward.

After

  • Timeline the incident while it's fresh → incident/postmortem.
  • The bad change gets a real fix + a test before it ships again.

Anti-patterns

  • ❌ Rolling back code while a destructive migration stays applied (old code, new schema → new breakage).
  • ❌ git revert + full pipeline when a flag flip would've been instant.
  • ❌ "Recovered" declared because the deploy succeeded, not because the metric recovered.
  • ❌ Immediately redeploying the fix forward without understanding the cause.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.