$npx -y skills add ombulabs/claude-code_rails-upgrade-skill --skill rails-upgradeAnalyzes Rails applications and generates comprehensive upgrade reports with breaking changes, deprecations, and step-by-step migration guides for Rails 2.3 through 8.1. Use when upgrading Rails applications, planning multi-hop upgrades, or querying version-specific changes. Base
| 1 | # Rails Upgrade Assistant Skill |
| 2 | |
| 3 | ## Skill Identity |
| 4 | - **Name:** Rails Upgrade Assistant |
| 5 | - **Purpose:** Intelligent Rails application upgrades from 2.3 through 8.1 |
| 6 | - **Skill Type:** Modular with external workflows and examples |
| 7 | - **Upgrade Strategy:** Sequential only (no version skipping) |
| 8 | - **Methodology:** Based on FastRuby.io upgrade best practices and "The Complete Guide to Upgrade Rails" ebook |
| 9 | - **Attribution:** Content based on "The Complete Guide to Upgrade Rails" by FastRuby.io (OmbuLabs) |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | ## Dependencies |
| 14 | |
| 15 | - **dual-boot skill** ([github.com/ombulabs/claude-code_dual-boot-skill](https://github.com/ombulabs/claude-code_dual-boot-skill)) — Sets up and manages dual-boot environments using the `next_rails` gem. Covers setup, `NextRails.next?` code patterns, CI configuration, and post-upgrade cleanup. Must be installed for Step 2 of the upgrade workflow. |
| 16 | - **rails-load-defaults skill** ([github.com/ombulabs/claude-code_rails-load-defaults-skill](https://github.com/ombulabs/claude-code_rails-load-defaults-skill)) — Handles incremental `load_defaults` updates with tiered risk assessment (Tier 1: low-risk, Tier 2: needs codebase grep, Tier 3: requires human review). Used as the final step after the Rails version upgrade is complete. |
| 17 | |
| 18 | --- |
| 19 | |
| 20 | ## Core Methodology (FastRuby.io Approach) |
| 21 | |
| 22 | This skill follows the proven FastRuby.io upgrade methodology: |
| 23 | |
| 24 | 1. **Incremental Upgrades** - Always upgrade one minor/major version at a time |
| 25 | 2. **Assessment First** - Understand scope before making changes |
| 26 | 3. **Dual-Boot Testing** - Test both versions during transition using `next_rails` gem |
| 27 | 4. **Test Coverage** - Ensure adequate test coverage before upgrading (aim for 80%+) |
| 28 | 5. **Gem Compatibility** - Check gem compatibility at each step using RailsBump |
| 29 | 6. **Deprecation Warnings** - Address deprecations before upgrading |
| 30 | 7. **Backwards Compatible Changes** - Deploy small changes to production before version bump |
| 31 | |
| 32 | **Key Resources:** |
| 33 | - **DELEGATE** to the `dual-boot` skill for dual-boot setup with `next_rails` (see Dependencies) |
| 34 | - See `references/deprecation-warnings.md` for managing deprecations |
| 35 | - See `references/staying-current.md` for maintaining upgrades over time |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | ## CRITICAL: Dual-Boot Code Pattern with `NextRails.next?` |
| 40 | |
| 41 | When proposing code fixes that must work with both the current and target Rails versions (dual-boot), **always use `NextRails.next?` from the `next_rails` gem** — never use `respond_to?` or other feature-detection patterns. |
| 42 | |
| 43 | **DELEGATE** to the `dual-boot` skill for: |
| 44 | - Setup and initialization (`next_rails --init`, `Gemfile.next`) |
| 45 | - `NextRails.next?` code patterns and examples |
| 46 | - CI configuration for dual-boot testing |
| 47 | - Post-upgrade cleanup (removing dual-boot branches) |
| 48 | |
| 49 | **DEPENDENCY:** Requires the [dual-boot skill](https://github.com/ombulabs/claude-code_dual-boot-skill) |
| 50 | |
| 51 | --- |
| 52 | |
| 53 | ## Trigger Patterns |
| 54 | |
| 55 | Claude should activate this skill when user says: |
| 56 | |
| 57 | **Upgrade Requests:** |
| 58 | - "Upgrade my Rails app to [version]" |
| 59 | - "Help me upgrade from Rails [x] to [y]" |
| 60 | - "What breaking changes are in Rails [version]?" |
| 61 | - "Plan my upgrade from [x] to [y]" |
| 62 | - "What Rails version am I using?" |
| 63 | - "Analyze my Rails app for upgrade" |
| 64 | - "Find breaking changes in my code" |
| 65 | - "Check my app for Rails [version] compatibility" |
| 66 | |
| 67 | **Specific Report Requests:** |
| 68 | - "Show me the app:update changes" |
| 69 | - "Preview configuration changes for Rails [version]" |
| 70 | - "Generate the upgrade report" |
| 71 | - "What will change if I upgrade?" |
| 72 | |
| 73 | **Upgrade Cleanup Requests (delegate to the `upgrade-cleanup` plugin):** |
| 74 | - "Finish the upgrade" |
| 75 | - "Clean up after my Rails upgrade" |
| 76 | - "Remove the dual-boot setup" |
| 77 | - "Drop the NextRails branches" |
| 78 | - "We're done upgrading to Rails [version]" |
| 79 | |
| 80 | --- |
| 81 | |
| 82 | ## CRITICAL: Sequential Upgrade Strategy |
| 83 | |
| 84 | ### ⚠️ Version Skipping is NOT Allowed |
| 85 | |
| 86 | Rails upgrades MUST follow a sequential path. Examples: |
| 87 | |
| 88 | **For Rails 5.x to 8.x:** |
| 89 | ``` |
| 90 | 5.0.x → 5.1.x → 5.2.x → 6.0.x → 6.1.x → 7.0.x → 7.1.x → 7.2.x → 8.0.x → 8.1.x |
| 91 | ``` |
| 92 | |
| 93 | **You CANNOT skip versions.** Examples: |
| 94 | - ❌ 5.2 → 6.1 (skips 6.0) |
| 95 | - ❌ 6.0 → 7.0 (skips 6.1) |
| 96 | - ❌ 7.0 → 8.0 (skips 7.1 and 7.2) |
| 97 | - ✅ 5.2 → 6.0 (correct) |
| 98 | - ✅ 7.0 → 7.1 (correct) |
| 99 | - ✅ 7.2 → 8.0 (correct) |
| 100 | |
| 101 | If user requests a multi-hop upgrade (e.g., 5.2 → 8.1): |
| 102 | 1. Explain the sequential requirement |
| 103 | 2. Break it into individual hops |
| 104 | 3. Generate separate reports for each hop |
| 105 | 4. Recommend completing each hop fully before moving to next |
| 106 | |
| 107 | --- |
| 108 | |
| 109 | ## Supported Upgrade Paths |
| 110 | |
| 111 | ### Legacy Rails (2.3 - 4.2) |
| 112 | |
| 113 | | From | To | Difficulty | Key Changes | Ruby Required | |
| 114 | |------|-----|-----------|-------------|---------------| |
| 115 | | 2.3.x | 3.0.x | Very Hard | XSS protection, routes s |