Skip to content

ombulabs/claude-code_rails-upgrade-skill / rails-upgrade

rails-upgrade

Verified

Analyzes 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.

FileKindSize
SKILL.mdskill md11.0 KB
detection-scripts/gem_limits.rbscript6.0 KB
detection-scripts/hop.rbscript2.2 KB
detection-scripts/patterns/rails-40-patterns.expectations.ymlconfig43.8 KB
detection-scripts/patterns/rails-40-patterns.ymlconfig96.5 KB
detection-scripts/patterns/rails-41-patterns.expectations.ymlconfig25.6 KB
detection-scripts/patterns/rails-41-patterns.ymlconfig59.8 KB
detection-scripts/patterns/rails-42-patterns.expectations.ymlconfig27.5 KB
detection-scripts/patterns/rails-42-patterns.ymlconfig48.7 KB
detection-scripts/patterns/rails-50-patterns.expectations.ymlconfig1.9 KB
detection-scripts/patterns/rails-50-patterns.ymlconfig8.1 KB
detection-scripts/patterns/rails-51-patterns.expectations.ymlconfig4.2 KB
detection-scripts/patterns/rails-51-patterns.ymlconfig15.0 KB
detection-scripts/patterns/rails-52-patterns.expectations.ymlconfig5.0 KB
detection-scripts/patterns/rails-52-patterns.ymlconfig14.7 KB
detection-scripts/patterns/rails-60-patterns.expectations.ymlconfig1007 B
detection-scripts/patterns/rails-60-patterns.ymlconfig14.2 KB
detection-scripts/patterns/rails-70-patterns.expectations.ymlconfig4.0 KB
detection-scripts/patterns/rails-70-patterns.ymlconfig11.2 KB
detection-scripts/patterns/rails-71-patterns.expectations.ymlconfig3.1 KB
detection-scripts/patterns/rails-71-patterns.ymlconfig9.5 KB
detection-scripts/patterns/rails-72-patterns.expectations.ymlconfig1.2 KB
detection-scripts/patterns/rails-72-patterns.ymlconfig6.1 KB
detection-scripts/patterns/rails-80-patterns.expectations.ymlconfig6.6 KB
detection-scripts/patterns/rails-80-patterns.ymlconfig21.2 KB
detection-scripts/patterns/rails-81-patterns.expectations.ymlconfig4.3 KB
detection-scripts/patterns/rails-81-patterns.ymlconfig13.2 KB
detection-scripts/scan_patterns.rbscript42.8 KB
examples/multi-hop-upgrade.mdmarkdown18.9 KB
examples/simple-upgrade.mdmarkdown4.0 KB
references/breaking-changes-by-version-reference.mdmarkdown3.9 KB
references/deprecation-warnings-reference.mdmarkdown10.7 KB
references/gem-compatibility-reference.mdmarkdown8.2 KB
references/js-compressor-sprockets-mismatch-reference.mdmarkdown4.7 KB
references/multi-hop-strategy-reference.mdmarkdown8.8 KB
references/next-hop-readiness-reference.mdmarkdown2.1 KB
references/no-test-suite-smoke-reference.mdmarkdown4.7 KB
references/request-patterns-reference.mdmarkdown3.7 KB
references/sequential-strategy-reference.mdmarkdown2.1 KB
references/staying-current-reference.mdmarkdown7.8 KB
references/testing-checklist-reference.mdmarkdown6.3 KB
templates/app-update-preview-template.mdmarkdown4.3 KB
templates/upgrade-report-template.mdmarkdown10.2 KB
version-guides/upgrade-3.2-to-4.0.mdmarkdown68.0 KB
version-guides/upgrade-4.0-to-4.1.mdmarkdown66.7 KB
version-guides/upgrade-4.1-to-4.2.mdmarkdown60.7 KB
version-guides/upgrade-4.2-to-5.0.mdmarkdown9.7 KB
version-guides/upgrade-5.0-to-5.1.mdmarkdown19.1 KB
version-guides/upgrade-5.1-to-5.2.mdmarkdown17.7 KB
version-guides/upgrade-5.2-to-6.0.mdmarkdown6.4 KB
version-guides/upgrade-6.0-to-6.1.mdmarkdown6.8 KB
version-guides/upgrade-6.1-to-7.0.mdmarkdown14.7 KB
version-guides/upgrade-7.0-to-7.1.mdmarkdown13.2 KB
version-guides/upgrade-7.1-to-7.2.mdmarkdown11.2 KB
version-guides/upgrade-7.2-to-8.0.mdmarkdown23.1 KB
version-guides/upgrade-8.0-to-8.1.mdmarkdown14.0 KB
workflows/00-verify-latest-patch-workflow.mdmarkdown1.7 KB
workflows/01-run-test-suite-workflow.mdmarkdown12.7 KB
workflows/02-resolve-deprecation-warnings-workflow.mdmarkdown6.3 KB
workflows/03-validate-upgrade-path-workflow.mdmarkdown1.8 KB
workflows/04-setup-next-rails-workflow.mdmarkdown1.5 KB
workflows/05-detect-breaking-changes-workflow.mdmarkdown20.0 KB
workflows/06-check-gem-compatibility-workflow.mdmarkdown11.1 KB
workflows/07-boot-smoke-test-workflow.mdmarkdown7.3 KB
workflows/08-generate-upgrade-report-workflow.mdmarkdown12.7 KB
workflows/09-generate-app-update-preview-workflow.mdmarkdown7.3 KB
workflows/10-implement-and-upgrade-workflow.mdmarkdown2.5 KB
workflows/11-sync-ci-workflow.mdmarkdown8.6 KB
workflows/12-align-load-defaults-workflow.mdmarkdown952 B
workflows/13-mention-cleanup-workflow.mdmarkdown1.3 KB

detection-scripts/patterns/rails-71-patterns.yml

View on GitHub
version: "7.1"
description: "Breaking change patterns for Rails 7.0 → 7.1 upgrade"

upgrade_findings:
  high_priority:
    - name: "cache_classes deprecated"
      kind: "deprecation"
      pattern: "cache_classes"
      exclude: ""
      search_paths:
        - "config/environments/"
      explanation: "config.cache_classes is replaced by config.enable_reloading with inverted boolean logic in Rails 7.1"
      fix: "Replace cache_classes = false with enable_reloading = true, and cache_classes = true with enable_reloading = false"
      variable_name: "CACHE_CLASSES"

    - name: "legacy_connection_handling removed"
      kind: "breaking"
      pattern: "legacy_connection_handling"
      exclude: ""
      search_paths:
        - "config/"
      explanation: "config.active_record.legacy_connection_handling was deprecated in Rails 7.0 and is completely removed in Rails 7.1. Setting it will raise an error on boot."
      fix: "Remove the line entirely. If relying on legacy behavior, migrate to connects_to/connected_to before upgrading."
      variable_name: "LEGACY_CONNECTION_HANDLING"

    - name: "preview_path singular deprecated"
      kind: "deprecation"
      pattern: "preview_path\\s*="
      exclude: "preview_paths"
      search_paths:
        - "config/"
      explanation: "config.action_mailer.preview_path (singular) is replaced by preview_paths (plural, array) in Rails 7.1"
      fix: "Change preview_path = 'path' to preview_paths = ['path']"
      variable_name: "PREVIEW_PATH"

    - name: "Force SSL default changed"
      kind: "optional"
      pattern: "force_ssl\\s*=\\s*false"
      exclude: ""
      search_paths:
        - "config/environments/production.rb"
      explanation: "config.force_ssl is now true by default in production in Rails 7.1"
      fix: "If not using SSL, explicitly set config.force_ssl = false. Otherwise remove the line."
      variable_name: "FORCE_SSL"

    - name: "lib/ autoloading changes"
      kind: "optional"
      pattern: "autoload_paths.*lib|eager_load_paths.*lib"
      exclude: "autoload_lib"
      search_paths:
        - "config/application.rb"
      explanation: "Rails 7.1 autoloads lib/ by default via autoload_lib. Manual autoload_paths additions for lib/ may conflict."
      fix: "Replace manual autoload_paths/eager_load_paths with config.autoload_lib(ignore: %w[assets tasks])"
      variable_name: "LIB_AUTOLOAD"

    - name: "Ruby below 2.7.3"
      kind: "breaking"
      pattern: "^\\s*(?:ruby\\s*\\(?\\s*[\"'](?:=\\s*|~>\\s*(?=\\d+\\.\\d+\\.\\d))?|ruby-|ruby\\s+)?(?:1\\.\\d+|2\\.[0-6])(?:\\.\\d+)*(?![\\d.])|^\\s*(?:ruby\\s*\\(?\\s*[\"'](?:=\\s*)?|ruby-|ruby\\s+)?2\\.7\\.[0-2](?![\\d.])|^\\s*ruby\\s*\\(?\\s*[\"']~>\\s*1\\.\\d+(?![\\d.])"
      exclude: ""
      search_paths:
        - "Gemfile"
        - ".ruby-version"
        - ".tool-versions"
      explanation: "Rails 7.1 needs Ruby 2.7.3 or newer, although the rails 7.1 gemspec (like 7.0) says >= 2.7.0. activerecord 7.1 defines `def method_missing(name, ...)` (attribute_methods.rb), and a leading argument before `...` is a syntax error before Ruby 2.7.3, so the app fails as soon as Active Record loads on 2.7.0 to 2.7.2. Flags a Ruby below 2.7.3 in .ruby-version or .tool-versions, and a Gemfile `ruby` line that rules it out (an exact version, or a `~>` whose upper bound is below 2.7.3); a requirement that still allows 2.7.3, such as `~> 2.7.1` or `>= 2.7.0`, is not flagged"
      fix: "Upgrade Ruby to 2.7.3 or newer (3.x recommended) while the app is still on Rails 7.0, as its own deploy. Rails 7.0 runs on it. See the \"Ruby Version Requirement\" entry in the 7.0 to 7.1 guide"
      variable_name: "RUBY_VERSION"

  medium_priority:
    - name: "ActiveRecord::Migration.check_pending! deprecated"
      kind: "deprecation"
      pattern: "Migration\\.check_pending!"
      exclude: ""
      search_paths:
        - "test/"
        - "spec/"
        - "config/"
        - "lib/"
      explanation: "ActiveRecord::Migration.check_pending! is deprecated in Rails 7.1 in favor of check_all_pending!, which loops through all database configurations. It still works but emits a deprecation warning, and is removed in Rails 7.2. Commonly found in test_helper.rb/rails_helper.rb, but also configured by healthcheck gems (e.g. rails-healthcheck) to run against a /healthcheck route."
      fix: "Replace ActiveRecord::Migration.check_pending! with ActiveRecord::Migration.check_all_pending!"
      variable_name: "MIGRATION_CHECK_PENDING"

    - name: "SQLite database in db/ directory"
      kind: "optional"
      pattern: "database:\\s*db/.*\\.sqlite3"
      exclude: ""
      search_paths:
        - "config/database.yml"
      explanation: "Rails 7.1 defaults SQLite databases to storage/ instead of db/"
      fix: "Either keep existing db/ path explicitly or move databases to storage/"
      variable_name: "SQLITE_LOCATION"

    - name: "Query log tags configuration"
      kind: "optional"
      pattern: "query_log_tags_enabled"
      exclude: ""
      search_paths:
        - "config/"
      explanation: "Rails 7.1 adds new query_log_tags_format option (:sqlcommenter or :legacy)"
      fix: "Add config.active_record.query_log_tags_format = :sqlcommenter alongside existing config"
      variable_name: "QUERY_LOG_TAGS"

    - name: "inspect output dependency"
      kind: "migration"
      pattern: "\\.inspect"
      exclude: ""
      search_paths:
        - "test/"
        - "spec/"
      explanation: "ActiveRecord inspect output now respects attributes_for_inspect configuration in Rails 7.1"
      fix: "If tests rely on inspect output, configure config.active_record.attributes_for_inspect = :all"
      variable_name: "INSPECT_OUTPUT"

    - name: "Rails.application.secrets and encrypted secrets deprecated"
      kind: "deprecation"
      pattern: "secrets\\.yml\\.enc|Rails\\.application\\.secrets\\b|read_encrypted_secrets\\s*=\\s*true"
      exclude: ""
      search_paths:
        - "config/"
        - "app/"
        - "lib/"
      explanation: "The secrets file location does not change: 7.0 and 7.1 both read config/secrets.yml and, with config.read_encrypted_secrets = true, config/secrets.yml.enc. What 7.1 deprecates is the whole secrets API: every Rails.application.secrets call warns (railties application.rb), a secret_key_base that only comes from secrets warns, and bin/rails secrets:edit / secrets:show warn; secrets:setup is gone. Rails 7.2 removes Rails.application.secrets (see rails-72-patterns.yml SECRETS_REMOVED). A plain config/secrets.yml read only through Rails.application.secrets is found by that call, not by the file"
      fix: "Move each value into credentials (bin/rails credentials:edit, or per environment with --environment production) and replace Rails.application.secrets.x with Rails.application.credentials.x. secrets.yml is keyed by environment and credentials.yml.enc is not, so drop the environment level or use per-environment credential files. Credentials exist since 5.2, so the change works on both sides of the dual boot. Then delete secrets.yml / secrets.yml.enc and the read_encrypted_secrets line"
      variable_name: "SECRETS_YML_ENC"

    - name: "Cache format version 6.1 (load_defaults below 7.0)"
      kind: "deprecation"
      pattern: "load_defaults[\\s(]+[\"']?[56]\\.\\d+\\b|format_version\\s*=\\s*6\\.1\\b"
      exclude: "\\A\\s*#"
      search_paths:
        - "config/"
      explanation: "activesupport 7.1 deprecates cache format 6.1 (cache.rb default_serializer: `Support for config.active_support.cache_format_version = 6.1 has been deprecated and will be removed in Rails 7.2`). ActiveSupport::Cache.format_version defaults to 6.1 and only load_defaults 7.0 (sets 7.0) or 7.1 (sets 7.1) changes it, so the warning fires for any app on load_defaults 5.x or 6.x that does not set the format itself, or that sets 6.1 explicitly. The load_defaults value is the proxy signal. False positive: an app on load_defaults 6.x that already sets cache_format_version = 7.0 elsewhere is still flagged. An app with no load_defaults line at all also warns and is missed"
      fix: "Set config.active_support.cache_format_version = 7.0 after load_defaults in config/application.rb. Rails 7.0 reads both the 6.1 and 7.0 formats and 7.1 reads 7.0, so this is safe on both sides of the dual boot and during a rolling deploy, no NextRails.next? branch needed. Move to 7.1 only after every server runs 7.1"
      variable_name: "CACHE_FORMAT_VERSION_61"

  low_priority:
    - name: "ContentSecurityPolicy::Middleware header constants removed"
      kind: "breaking"
      pattern: "ContentSecurityPolicy::Middleware::(?:POLICY_REPORT_ONLY|POLICY|CONTENT_TYPE)(?!\\w)"
      exclude: ""
      search_paths:
        - "app/"
        - "lib/"
        - "config/"
        - "spec/"
        - "test/"
      explanation: "actionpack 7.1 removes the CONTENT_TYPE, POLICY and POLICY_REPORT_ONLY constants from ActionDispatch::ContentSecurityPolicy::Middleware (content_security_policy.rb now uses ActionDispatch::Constants, which 7.0 does not have). Code that reads them raises NameError on 7.1. The CSP DSL itself (config.content_security_policy, policy.script_src and friends) does not change; 7.1 only adds the :unsafe_hashes source"
      fix: "Use the header name string instead, which works on both 7.0 and 7.1: \"Content-Security-Policy\" or \"Content-Security-Policy-Report-Only\""
      variable_name: "CSP_MIDDLEWARE_CONSTANTS"

dependencies:
  ruby:
    minimum: "2.7.3"
    recommended: "3.2.0"
    message: "Rails 7.1 requires Ruby 2.7.3+ (3.2 recommended): the gemspec says >= 2.7.0, but activerecord uses leading-argument forwarding"
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall
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: 108kUpdated Claude CodeCodexVerifiedInstall
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: 108kUpdated Claude CodeCodexVerifiedInstall