ombulabs/claude-code_rails-upgrade-skill / rails-upgrade
rails-upgrade
VerifiedAnalyzes 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, querying version-specific changes, or answering what stands between the app and the next Rails version. Based on FastRuby.io methodology and "The Complete Guide to Upgrade Rails" ebook.
templates/app-update-preview-template.md
View on GitHub# app:update Preview for Rails {TO}
**Current Version:** {FROM}
**Target Version:** {TO}
**Generated:** {DATE}
---
## Overview
Running `rails app:update` will prompt you to update these files.
---
## Files Summary
| Category | Files Changed | Files Added | Files Removed |
|----------|--------------|-------------|---------------|
| Config | {CONFIG_CHANGED} | {CONFIG_ADDED} | {CONFIG_REMOVED} |
| Bin | {BIN_CHANGED} | {BIN_ADDED} | {BIN_REMOVED} |
| Other | {OTHER_CHANGED} | {OTHER_ADDED} | {OTHER_REMOVED} |
---
## Detailed File Changes
### ðī HIGH IMPACT (Review Carefully)
<!-- Files that will affect app behavior -->
#### config/application.rb
**Change:** Update load_defaults version
**BEFORE:**
```ruby
config.load_defaults {FROM_SHORT}
```
**AFTER:**
```ruby
config.load_defaults {TO_SHORT}
```
**Impact:** HIGH - Enables new framework defaults. May change behavior.
**Recommendation:** Accept this change, but enable new defaults gradually using `config/initializers/new_framework_defaults_{TO_SLUG}.rb`
---
{HIGH_IMPACT_FILES}
---
### ðĄ MEDIUM IMPACT (Usually Safe to Accept)
<!-- Files that improve functionality -->
{MEDIUM_IMPACT_FILES}
---
### ðĒ LOW IMPACT (Safe to Accept)
<!-- Files with minor changes -->
{LOW_IMPACT_FILES}
---
## New Files to Be Created
| File | Purpose | Recommendation |
|------|---------|----------------|
{NEW_FILES_TABLE}
---
## Files You Should NOT Overwrite
These files likely have custom configuration:
| File | Reason |
|------|--------|
{CUSTOM_FILES_TABLE}
---
## Recommended Approach
### Option A: Interactive (Recommended)
```bash
rails app:update
```
For each file, you'll be prompted:
- **Y** - Accept the change
- **n** - Keep your version
- **d** - View the diff
- **q** - Quit
**Follow this decision tree:**
```
Is it a new file?
â Accept (Y)
Is it config/application.rb load_defaults?
â Accept (Y)
Is it a file you've customized?
â View diff (d), then decide
Is it a bin/ script?
â Usually accept (Y)
Not sure?
â View diff (d), compare carefully
```
### Option B: Manual (For Complex Apps)
1. Generate a new Rails app with the target version
2. Compare files manually
3. Apply changes selectively
```bash
# Create comparison app
rails new temp_app_compare --skip-bundle
cd temp_app_compare
# Compare specific files
diff -u ../your_app/config/application.rb config/application.rb
```
### Option C: Accept All (Simple Apps Only)
```bash
rails app:update --force
```
â ïļ **Warning:** This overwrites all files. Only use if:
- You have version control
- Your config files are standard
- You can review changes afterward
---
## New Framework Defaults
After upgrading, Rails creates:
`config/initializers/new_framework_defaults_{TO_SLUG}.rb`
This file lets you opt-in to new behaviors gradually:
```ruby
# Don't enable all at once!
# Enable one at a time and test:
# Rails.application.config.some_new_default = true
# Rails.application.config.another_default = "value"
```
### Enable Gradually:
1. Uncomment one option
2. Run test suite
3. Test manually
4. Deploy to staging
5. Monitor for issues
6. Repeat for next option
### Once All Verified:
1. Update `config.load_defaults` to {TO_SHORT}
2. Delete the new_framework_defaults file
---
## Diff Reference
### Understanding Diffs
```diff
- This line was removed (old code)
+ This line was added (new code)
This line is unchanged (context)
```
### Key Things to Look For
1. **Settings that changed default values**
2. **New required settings**
3. **Removed/deprecated settings**
4. **Comments explaining changes**
---
## Post-Update Checklist
After running `rails app:update`:
- [ ] Review all changes in git diff
- [ ] Verify application boots: `rails server`
- [ ] Verify console works: `rails console`
- [ ] Run test suite
- [ ] Check for deprecation warnings
- [ ] Test critical paths manually
---
## Troubleshooting
### "I accidentally overwrote a file"
```bash
git checkout -- path/to/file
```
### "The app won't start after update"
Check the Rails logs:
```bash
tail -f log/development.log
```
Common issues:
- Missing gem versions
- Invalid configuration syntax
- Removed deprecated settings
### "Tests are failing after update"
1. Read the error messages carefully
2. Check for deprecated methods
3. Look for changed default behaviors
4. Consult the Rails upgrade guide
---
**Preview generated by Rails Upgrade Assistant**
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies. | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |
| meeting-notesnexu-io/open-designMeeting notes page â title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "äžčŪŪįšŠčĶ". | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |