本文へスキップ
Skillpedia
APIとサーバー(バックエンド)48k · #5797

skill-rails-upgrade

できること

このツールは、Railsプロジェクトを分析して、新しいバージョンへのアップグレードを手助けします。現在のバージョンを確認し、利用可能な最新バージョンを調べ、必要な主な変更点をお知らせします。

使う場面

  • ✓Railsプロジェクトを新しいバージョンに更新したいとき。
  • ✓アップグレードにどのくらいの手間がかかるかを把握したいとき。
  • ✓Railsと一緒にJavaScriptの依存関係も更新が必要か確認したいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/skill-rails-upgrade/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/skill-rails-upgrade/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のRailsプロジェクトを分析して、最新バージョンにアップグレードする方法を教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールはまず、プロジェクトのファイルを確認して、Railsアプリケーションであることを確かめます。次に、使用中のバージョンと利用可能な最新バージョンを特定します。両者を比べて、必要な変更に関する情報を調べます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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:

Package Purpose Version Alignment
@hotwired/turbo-rails Turbo Drive/Frames/Streams Should match Rails version era
@hotwired/stimulus Stimulus JS framework Generally stable across Rails versions
@rails/actioncable WebSocket support Should match Rails version
@rails/activestorage Direct uploads Should match Rails version
@rails/actiontext Rich text editing Should match Rails version
@rails/request.js Rails UJS replacement Should 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:


…
よくある質問

Railsの最新バージョンはどうやって分かるのですか?

GitHub CLIというツールを使って、公式のRails GitHubリポジトリにある最新リリースを確認します。

「破壊的変更(breaking changes)」とは何ですか?

新しいRailsのバージョンで、現在のコードが動かなくなる可能性のある変更のことです。ツールはこうした変更を見つけて、注意を促すようにしています。

プロジェクトは自動で更新されますか?

いいえ、このツールは分析してレポートを出すだけです。実際のアップグレードは、ご自身で手動で行う必要があります。

詳細

作者による元の説明

Analyze Rails apps and provide upgrade assessments

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5797
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル