/ 目录 / 演练场 / claude-code_rails-upgrade-skill
● 社区 ombulabs ⚡ 即开即用

claude-code_rails-upgrade-skill

作者 ombulabs · ombulabs/claude-code_rails-upgrade-skill

Claude Code skill that methodically upgrades Rails — from audit through deprecation fixes to bundle update — without breaking everything.

Rails Upgrade Skill (by OmbuLabs) walks Claude through the standard Rails upgrade playbook: audit the codebase, fix deprecations, apply framework defaults, handle gem incompatibilities, and verify on the new version. Based on OmbuLabs' production experience upgrading Rails apps. Good for going N → N+1, or catching up from older versions.

为什么要用

核心特性

实时演示

实际使用效果

claude-code-rails-upgrade-skill.replay ▶ 就绪
0/0

安装

作者仓库 · Claude Skills 官方文档

使用场景

实战用法: claude-code_rails-upgrade-skill

How to plan a Rails upgrade before touching code

👤 Rails devs facing a multi-version jump ⏱ ~60 min intermediate

何时使用: You're on Rails 6.1 and need to get to 7.2. You want a plan, not a prayer.

步骤
  1. Audit current state
    Audit this Rails app: current version, Ruby version, gems, deprecation warnings from a test run.✓ 已复制
    → Baseline report
  2. Build the path
    Plan the upgrade to Rails 7.2. Go version-by-version (6.1 → 7.0 → 7.1 → 7.2), each with milestone criteria.✓ 已复制
    → Multi-stage plan
  3. Identify blockers
    Which gems don't have a 7.2-compatible version? Proposals for each (upgrade/replace/fork).✓ 已复制
    → Per-gem blocker list

结果: A realistic upgrade plan with staged milestones.

注意事项
  • Jumping two major versions at once — Skill enforces one minor/major at a time — don't override

Sweep and fix deprecation warnings

👤 Rails devs mid-upgrade ⏱ ~90 min intermediate

何时使用: You're between versions and the test run is a wall of deprecation warnings.

步骤
  1. Collect
    Run tests, collect all unique deprecation warnings.✓ 已复制
    → Deduped list with file:line occurrences
  2. Group + fix
    Group by cause. Propose minimal fixes with diffs for each group.✓ 已复制
    → Grouped fix diffs

结果: A clean test run ready for the next version bump.

Apply new framework defaults safely

👤 Rails devs navigating rails app:update ⏱ ~60 min advanced

何时使用: You've bumped the Gemfile and ran rails app:update; now you have a bunch of new initializers.

步骤
  1. Review diff
    Review the diff from rails app:update. Flag any default change that could break our app (strict_loading, zeitwerk mode, etc.).✓ 已复制
    → Per-change risk annotation
  2. Staged enable
    For each risky default, produce a staged rollout: enable behind env flag, validate on staging, then flip.✓ 已复制
    → Staged plan per default

结果: Defaults enabled without surprise regressions.

注意事项
  • Enabling all load_defaults at once — Use new_framework_defaults_X.Y.rb to ramp individually

组合

与其他 MCP 搭配,撬动十倍杠杆

claude-code-rails-upgrade-skill + claude-code-owasp-skill

Security review on the upgraded code

After upgrade to Rails 7.2, run OWASP review on the auth and params handling.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
Audit repo Start of every upgrade Claude tokens
Plan upgrade path current, target After audit Claude tokens
Gem compat check Gemfile, target Rails Before bumping Claude tokens + RubyGems API
Deprecation sweep test log Between versions Claude tokens
Framework defaults migration diff from rails app:update After rails app:update Claude tokens

成本与限制

运行它的成本

API 配额
None
每次调用 Token 数
20-80k across an upgrade
费用
Free
提示
Run deprecation sweeps on specific directories rather than the whole app at once.

安全

权限、密钥、影响范围

凭据存储: No credentials
数据出站: Code sent to Claude for inference

故障排查

常见错误与修复

rails app:update produces uncommitted binary files

These are usually system files. Gitignore them and regenerate cleanly.

Tests pass locally, fail in CI after upgrade

Likely autoloading differences or eager_load in production mode. Run with RAILS_ENV=production locally.

Gem bundle resolution fails

Skill will suggest alternative gem versions; sometimes a fork or replacement is required.

验证: bundle update --conservative

替代方案

claude-code_rails-upgrade-skill 对比其他方案

替代方案何时用它替代权衡
next_rails gemYou want a deterministic upgrade helperNo LLM-guided deprecation fixes

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills