Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

skill-rails-upgrade技能 Rails upgrade

Agent Skill

skill-rails-upgrade 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,994

周安装

204

GitHub Stars

35,718

下载量

1,616
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:skill-rails-upgrade(技能 Rails upgrade)
来源仓库:https://github.com/sickn33/antigravity-awesome-skills
仓库路径:skills/skill-rails-upgrade
安装命令:
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill skill-rails-upgrade
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill skill-rails-upgrade

简介

用于查找、检索和筛选相关信息,支持技术栈相关的知识获取。

  • 适合在 Rails 项目升级或技术调研中提供参考依据。
  • 通过 npx 从 GitHub 仓库安装,适用于多种 CLI 宿主环境。
  • 检索内容需结合实际项目版本进行验证。skill-rails-upgrade 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 不建议自动执行升级操作,应先评估兼容性风险。

SKILL.md

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 customizations:
config.i18n.available_locales = [:de, :en]
config.i18n.default_locale = :de
config.i18n.fallbacks = [:en]

# ADD new Rails 8.1 settings if needed:
# (usually none required - new defaults come via new_framework_defaults file)

9.5: Handle Active Storage Migrations

After file updates, run any new migrations:

bin/rails db:migrate

Check for new migrations that were added:

ls -la db/migrate/ | tail -10

9.6: Verify Upgrade

After completing the merge:

  1. Start the Rails server and check for errors: bin/dev # or bin/rails server
  2. Check the Rails console: bin/rails console
  3. Run the test suite: bin/rails test
  4. Review deprecation warnings in logs

Step 10: Finalize Framework Defaults

After verifying the app works:

  1. Review config/initializers/new_framework_defaults_X_Y.rb
  2. Enable each new default one by one, testing after each
  3. Once all defaults are enabled and tested, update config/application.rb: config.load_defaults X.Y # Update to new version
  4. Delete the new_framework_defaults_X_Y.rb file

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.

Error Handling

  • If gh CLI is not authenticated, instruct the user to run gh auth login
  • If railsdiff.org doesn't have the exact versions, try with major.minor.0 versions
  • If the app is already on the latest version, congratulate the user and note any upcoming releases
  • If local customizations would be lost, ALWAYS stop and show the user what would be overwritten before proceeding

Key Principles

  1. Never overwrite without checking - Always check for local customizations first
  2. Preserve user intent - Local customizations exist for a reason
  3. Minimal changes - Only add what's necessary for the new Rails version
  4. Transparency - Show the user exactly what will change before doing it
  5. Reversibility - User should be able to git checkout to restore if needed

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.46%
按下载量换算557

Claude

31.72%
按下载量换算513

Cursor

17.13%
按下载量换算277

Gemini CLI

9.69%
按下载量换算157

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills