# Upgrade Cleanup

> Clean up after (or abandon) a Rails upgrade. Drop NextRails.next? and NextRails.current? branches and retire dual-boot scaffolding (Gemfile.next, Gemfile.next.lock, conditional Gemfile groups), keeping either the next or the current version. Trigger when the user says they are done with the upgrade, want to clean up dual-boot, want to drop NextRails branches, want to finish the upgrade, want to a…

- **Type:** Skill
- **Install:** `agentstack add skill-ombulabs-claude-code-rails-upgrade-skill-upgrade-cleanup`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ombulabs](https://agentstack.voostack.com/s/ombulabs)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ombulabs](https://github.com/ombulabs)
- **Source:** https://github.com/ombulabs/claude-code_rails-upgrade-skill/tree/main/upgrade-cleanup/upgrade-cleanup
- **Website:** https://www.fastruby.io/blog/open-source-claude-code-skill-for-rails-upgrades.html

## Install

```sh
agentstack add skill-ombulabs-claude-code-rails-upgrade-skill-upgrade-cleanup
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Upgrade Cleanup Skill

Companion to the `rails-upgrade` plugin. Runs the cleanup pass that removes dual-boot scaffolding and aligns the codebase to the new version baseline.

When activated, follow the workflow in `workflows/upgrade-cleanup-workflow.md` end-to-end. **Before any destructive step, confirm direction with the user** (Phase 0 Step 1): are they keeping the **next** version (finishing the upgrade) or keeping the **current** version (abandoning or pausing this hop)? Every subsequent step branches on that answer. To detect the next version, read the `Gemfile` (look for the `if NextRails.next?` / `else` block; the `next?` branch holds the upgraded-to version) or `Gemfile.next.lock`. Do NOT rely on `Gemfile.lock` alone, since during dual-boot it still pins the current version.

## When to Run

Run when the user has explicitly decided to **end the dual-boot phase** in one of two directions:

- **Keep next**: upgrade is done (final hop or stopping point), drop the `else` / current branches.
- **Keep current**: abandoning or pausing this hop, drop the `if NextRails.next?` / next branches and `Gemfile.next*`.

Either way the previous parallel branch must no longer be needed (no rollback window). Deployment to production is not a hard prerequisite.

## Ownership and Delegations

This skill **owns** the cleanup. Phase 1 below is the step list to follow. The `dual-boot` skill's `workflows/cleanup-workflow.md` is older optional reading; if it drifts from this workflow, this workflow wins.

- **Dual-boot scaffolding removal**: performed here in Phase 1.
- **`load_defaults` alignment**: out of scope. The `rails-upgrade` skill handles this via its `rails-load-defaults` step before cleanup runs.

## Critical Rules

- **Do NOT leave `NextRails.next?` or `NextRails.current?` branches in the tree.** That is the failure mode this skill exists to prevent.
- **Do NOT start removing branches before confirming direction.** Keeping the wrong side throws away the work the user wants to keep. If the user has not stated next vs current, ask.

## Workflow

See `workflows/upgrade-cleanup-workflow.md` for the full process: a pre-flight check, dual-boot scaffolding removal, old-version code retirement, CI and Ruby pin alignment, final verification, and the cleanup PR.

## Reference

- [Finishing an Upgrade, FastRuby.io](https://www.fastruby.io/blog/finishing-an-upgrade.html)
- `workflows/upgrade-cleanup-workflow.md`, full workflow
- The `dual-boot` plugin's `workflows/cleanup-workflow.md`, optional reading for context. This skill's Phase 1 is the step list to follow, do not use dual-boot's version when it conflicts.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ombulabs](https://github.com/ombulabs)
- **Source:** [ombulabs/claude-code_rails-upgrade-skill](https://github.com/ombulabs/claude-code_rails-upgrade-skill)
- **License:** MIT
- **Homepage:** https://www.fastruby.io/blog/open-source-claude-code-skill-for-rails-upgrades.html

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ombulabs-claude-code-rails-upgrade-skill-upgrade-cleanup
- Seller: https://agentstack.voostack.com/s/ombulabs
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
