SK

skill-rails-upgrade

Provides an automated upgrade assessment for Ruby on Rails applications.

Install

mkdir -p .claude/skills/skill-rails-upgrade && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4173" && unzip -o skill.zip -d .claude/skills/skill-rails-upgrade && rm skill.zip

Installs to .claude/skills/skill-rails-upgrade

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Analyze Rails apps and provide upgrade assessments
50 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Identifies current Rails version from Gemfile
  • Fetches latest Rails release via GitHub CLI
  • Classifies upgrades as patch, minor, or major
  • Summarizes breaking changes and deprecations
  • Analyzes JavaScript dependencies for compatibility

How it works

It inspects the local environment for Rails configuration files, compares versions against GitHub releases, and generates a selective merge plan based on railsdiff.org data.

Inputs & outputs

You give it
Path to Rails application
You get back
Upgrade assessment report and migration plan

When to use skill-rails-upgrade

  • Check if a Rails app can be updated to version 8
  • Identify the difference between current Rails version and latest
  • Get an upgrade assessment report for a legacy Rails project

About this skill

When to Use This Skill

Analyze Rails apps and provide upgrade assessments

Use this skill when working with analyze rails apps and provide upgrade assessments.

Rails Upgrade Analyzer

Analyze the current Rails application and provide a comprehensive upgrade assessment with selective file merging.

Step 1: Verify Rails Application

Check that we're in a Rails application by looking for these files:

  • Gemfile (must exist and contain 'rails')
  • config/application.rb (Rails application config)
  • config/environment.rb (Rails environment)

If any of these are missing or don't indicate a Rails app, stop and inform the user this doesn't appear to be a Rails application.

Step 2: Get Current Rails Version

Extract the current Rails version from:

  1. First, check Gemfile.lock for the exact installed version (look for rails (x.y.z))
  2. If not found, check Gemfile for the version constraint

Report the exact current version (e.g., 7.1.3).

Step 3: Find Latest Rails Version

Use the GitHub CLI to fetch the latest Rails release:

gh api repos/rails/rails/releases/latest --jq '.tag_name'

This returns the latest stable version tag (e.g., v8.0.1). Strip the 'v' prefix for comparison.

Also check recent tags to understand the release landscape:

gh api repos/rails/rails/tags --jq '.[0:10] | .[].name'

Step 4: Determine Upgrade Type

Compare current and latest versions to classify the upgrade:

  • Patch upgrade: Same major.minor, different patch (e.g., 7.1.3 → 7.1.5)
  • Minor upgrade: Same major, different minor (e.g., 7.1.3 → 7.2.0)
  • Major upgrade: Different major version (e.g., 7.1.3 → 8.0.0)

Step 5: Fetch Upgrade Guide

Use WebFetch to get the official Rails upgrade guide:

URL: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html

Look for sections relevant to the version jump. The guide is organized by target version with sections like:

  • "Upgrading from Rails X.Y to Rails X.Z"
  • Breaking changes
  • Deprecation warnings
  • Configuration changes
  • Required migrations

Extract and summarize the relevant sections for the user's specific upgrade path.

Step 6: Fetch Rails Diff

Use WebFetch to get the diff between versions from railsdiff.org:

URL: https://railsdiff.org/{current_version}/{target_version}

For example: https://railsdiff.org/7.1.3/8.0.0

This shows:

  • Changes to default configuration files
  • New files that need to be added
  • Modified initializers
  • Updated dependencies
  • Changes to bin/ scripts

Summarize the key file changes.

Step 7: Check JavaScript Dependencies

Rails applications often include JavaScript packages that should be updated alongside Rails. Check for and report on these dependencies.

7.1: Identify JS Package Manager

Check which package manager the app uses:

# Check for package.json (npm/yarn)
ls package.json 2>/dev/null

# Check for importmap (Rails 7+)
ls config/importmap.rb 2>/dev/null

7.2: Check Rails-Related JS Packages

If package.json exists, check for these Rails-related packages:

# Extract current versions of Rails-related packages
cat package.json | grep -E '"@hotwired/|"@rails/|"stimulus"|"turbo-rails"' || echo "No Rails JS packages found"

Key packages to check:

PackagePurposeVersion Alignment
@hotwired/turbo-railsTurbo Drive/Frames/StreamsShould match Rails version era
@hotwired/stimulusStimulus JS frameworkGenerally stable across Rails versions
@rails/actioncableWebSocket supportShould match Rails version
@rails/activestorageDirect uploadsShould match Rails version
@rails/actiontextRich text editingShould match Rails version
@rails/request.jsRails UJS replacementShould match Rails version era

7.3: Check for Updates

For npm/yarn projects, check for available updates:

# Using npm
npm outdated @hotwired/turbo-rails @hotwired/stimulus @rails/actioncable @rails/activestorage 2>/dev/null

# Or check latest versions directly
npm view @hotwired/turbo-rails version 2>/dev/null
npm view @rails/actioncable version 2>/dev/null

7.4: Check Importmap Pins (if applicable)

If the app uses importmap-rails, check config/importmap.rb for pinned versions:

cat config/importmap.rb | grep -E 'pin.*turbo|pin.*stimulus|pin.*@rails' || echo "No importmap pins found"

To update importmap pins:

bin/importmap pin @hotwired/turbo-rails
bin/importmap pin @hotwired/stimulus

7.5: JS Dependency Summary

Include in the upgrade summary:

### JavaScript Dependencies

**Package Manager**: [npm/yarn/importmap/none]

| Package | Current | Latest | Action |
|---------|---------|--------|--------|
| @hotwired/turbo-rails | 8.0.4 | 8.0.12 | Update recommended |
| @rails/actioncable | 7.1.0 | 8.0.0 | Update with Rails |
| ... | ... | ... | ... |

**Recommended JS Updates:**
- Run `npm update @hotwired/turbo-rails` (or yarn equivalent)
- Run `npm update @rails/actioncable @rails/activestorage` to match Rails version

Step 8: Generate Upgrade Summary

Provide a comprehensive summary including all findings from Steps 1-7:

Version Information

  • Current version: X.Y.Z
  • Latest version: A.B.C
  • Upgrade type: [Patch/Minor/Major]

Upgrade Complexity Assessment

Rate the upgrade as Small, Medium, or Large based on:

FactorSmallMediumLarge
Version jumpPatch onlyMinor versionMajor version
Breaking changesNoneFew, well-documentedMany, significant
Config changesMinimalModerateExtensive
DeprecationsNone activeSome to addressMany requiring refactoring
DependenciesCompatibleSome updates neededMajor dependency updates

Key Changes to Address

List the most important changes the user needs to handle:

  1. Configuration file updates
  2. Deprecated methods/features to update
  3. New required dependencies
  4. Database migrations needed
  5. Breaking API changes

Recommended Upgrade Steps

  1. Update test suite and ensure passing
  2. Review deprecation warnings in current version
  3. Update Gemfile with new Rails version
  4. Run bundle update rails
  5. Update JavaScript dependencies (see JS Dependencies section)
  6. DO NOT run rails app:update directly - use the selective merge process below
  7. Run database migrations
  8. Run test suite
  9. Review and update deprecated code

Resources


When to Use This Skill

Analyze Rails apps and provide upgrade assessments

Use this skill when working with analyze rails apps and provide upgrade assessments.

Step 9: Selective File Update (replaces rails app:update)

IMPORTANT: Do NOT run rails app:update as it overwrites files without considering local customizations. Instead, follow this selective merge process:

9.1: Detect Local Customizations

Before any upgrade, identify files with local customizations:

# Check for uncommitted changes
git status

# List config files that differ from a fresh Rails app
# These are the files we need to be careful with
git diff HEAD --name-only -- config/ bin/ public/

Create a mental list of files in these categories:

  • Custom config files: Files with project-specific settings (i18n, mailer, etc.)
  • Modified bin scripts: Scripts with custom behavior (bin/dev with foreman, etc.)
  • Standard files: Files that haven't been customized

9.2: Analyze Required Changes from Railsdiff

Based on the railsdiff output from Step 6, categorize each changed file:

CategoryActionExample
New filesCreate directlyconfig/initializers/new_framework_defaults_X_Y.rb
Unchanged locallySafe to overwritepublic/404.html (if not customized)
Customized locallyManual merge neededconfig/application.rb, bin/dev
Comment-only changesUsually skipMinor comment updates in config files

9.3: Create Upgrade Plan

Present the user with a clear upgrade plan:

## Upgrade Plan: Rails X.Y.Z → A.B.C

### New Files (will be created):
- config/initializers/new_framework_defaults_A_B.rb
- bin/ci (new CI script)

### Safe to Update (no local customizations):
- public/400.html
- public/404.html
- public/500.html

### Needs Manual Merge (local customizations detected):
- config/application.rb
  └─ Local: i18n configuration
  └─ Rails: [describe new Rails changes if any]

- config/environments/development.rb
  └─ Local: letter_opener mailer config
  └─ Rails: [describe new Rails changes]

- bin/dev
  └─ Local: foreman + Procfile.dev setup
  └─ Rails: changed to simple ruby script

### Skip (comment-only or irrelevant changes):
- config/puma.rb (only comment changes)

9.4: Execute Upgrade Plan

After user confirms the plan:

For New Files:

Create them directly using the content from railsdiff or by extracting from a fresh Rails app:

# Generate a temporary fresh Rails app to extract new files
cd /tmp && rails new rails_template --skip-git --skip-bundle
# Then copy needed files

Or use the Rails generator for specific files:

bin/rails app:update:configs  # Only updates config files, still interactive

For Safe Updates:

Overwrite these files as they have no local customizations.

For Manual Merges:

For each file needing merge, show the user:

  1. Current local version (their customizations)
  2. New Rails default (from railsdiff)
  3. Suggested merged version that:
    • Keeps all local customizations
    • Adds only essential new Rails functionality
    • Removes deprecated settings

Example merge for config/application.rb:

# KEEP local cus

---

*Content truncated.*

When not to use it

  • Non-Rails applications
  • Projects without a Gemfile

Prerequisites

GitHub CLI (gh)Git repository

Limitations

  • Does not automatically perform the upgrade
  • Requires manual intervention for merging customized files

How it compares

It provides a selective merge strategy instead of the destructive rails app:update command.

Compared to similar skills

skill-rails-upgrade side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
skill-rails-upgrade (this skill)13moReviewIntermediate
upgrade-dependencies04moReviewIntermediate
rails-domain-architecture02moNo flagsAdvanced
rails-expert04moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

mobile-design

sickn33

Mobile-first design and engineering doctrine for iOS and Android apps. Covers touch interaction, performance, platform conventions, offline behavior, and mobile-specific decision-making. Teaches principles and constraints, not fixed layouts. Use for React Native, Flutter, or native mobile apps.

149231

unity-developer

sickn33

Build Unity games with optimized C# scripts, efficient rendering, and proper asset management. Masters Unity 6 LTS, URP/HDRP pipelines, and cross-platform deployment. Handles gameplay systems, UI implementation, and platform optimization. Use PROACTIVELY for Unity performance issues, game mechanics, or cross-platform builds.

142357

architect-review

sickn33

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

109320

angular

sickn33

Modern Angular (v20+) expert with deep knowledge of Signals, Standalone Components, Zoneless applications, SSR/Hydration, and reactive patterns. Use PROACTIVELY for Angular development, component architecture, state management, performance optimization, and migration to modern patterns.

100129

frontend-slides

sickn33

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

95195

minecraft-bukkit-pro

sickn33

Master Minecraft server plugin development with Bukkit, Spigot, and Paper APIs. Specializes in event-driven architecture, command systems, world manipulation, player management, and performance optimization. Use PROACTIVELY for plugin architecture, gameplay mechanics, server-side features, or cross-version compatibility.

9078

You might also like

upgrade-dependencies

codenamev

Upgrade all Ruby gem dependencies to their latest versions with release note review and codebase alignment checks. Use this skill whenever the user asks to update, upgrade, or bump dependencies, gems, or packages — even casually like 'update my gems' or 'are my deps up to date?'

00

rails-domain-architecture

mohnstrudel

Design or refactor the backend side of Ruby on Rails codebases toward a model-centric architecture that keeps domain logic, associations, scopes, callbacks, state transitions, and test ownership close to the owning models. Use when planning backend file layout, deciding between models, concerns, and

00

rails-expert

Sneha-1608

Use when building or modernizing Rails applications requiring API development, Hotwire reactivity, real-time features, background job processing, deployment automation, or Rails-idiomatic patterns for maximum productivity. Version-aware: adapts to Rails 7.x and 8.x projects.

00

salesforce-development

davila7

Expert patterns for Salesforce platform development including Lightning Web Components (LWC), Apex triggers and classes, REST/Bulk APIs, Connected Apps, and Salesforce DX with scratch orgs and 2nd generation packages (2GP). Use when: salesforce, sfdc, apex, lwc, lightning web components.

1449

woocommerce-backend-dev

woocommerce

Add or modify WooCommerce backend PHP code following project conventions. Use when creating new classes, methods, hooks, or modifying existing backend code. **MUST be invoked before writing any PHP unit tests.**

724

convex-best-practices

waynesutton

Guidelines for building production-ready Convex apps covering function organization, query patterns, validation, TypeScript usage, error handling, and the Zen of Convex design philosophy

312

Search skills

Search the agent skills registry