A Claude Code skill that incrementally upgrades config.load_defaults in Rails applications by walking through each framework default config one at a time.
This skill automates the process of bringing a Rails app's load_defaults configuration up to match its Rails version. It handles:
- Detection: Identifies the current
load_defaultsversion and Rails version - Initializer Generation: Creates the
new_framework_defaults_X_Y.rbfile from templates - Codebase Analysis: Greps the codebase for each config to recommend the right value
- Iterative Walkthrough: Uncomments one config at a time, waits for you to test/commit
- Consolidation: Removes the initializer, updates
load_defaults, and explicitly sets overrides for configs kept at old values
From your Rails project directory, run:
mkdir -p ~/.claude/skills
git clone https://github.com/fastruby/rails-load-defaults-skill.git ~/.claude/skills/rails-load-defaultsInstalling to ~/.claude/skills/ makes it available across all your projects.
Once installed, invoke the skill with:
claude /rails-load-defaultsOr start a conversation about load_defaults and Claude will pick it up automatically:
claude "The app is on Rails 7.2 but load_defaults is at 6.1, let's upgrade"| Transition | Config Reference | Template |
|---|---|---|
| → 7.0 | configs/7_0.yml |
templates/new_framework_defaults_7_0.rb |
Each version's configs are organized into tiers:
| Tier | Risk Level | Approach |
|---|---|---|
| Tier 1 | Very low (test-only, deprecation removal) | Safe to flip with minimal checks |
| Tier 2 | Low (needs codebase grep) | Claude analyzes the codebase and recommends a value |
| Tier 3 | Medium/High (needs human review) | Flagged for manual review with detailed guidance |
Configs are processed in order from safest to riskiest.
For each config, the skill provides:
- What changed: Old behavior → new behavior
- Codebase lookup: Grep patterns to search for relevant code
- Decision tree: If X found → use value A, if Y found → use value B
- Risk level: How likely this is to break something
- Old default value: Used during consolidation if keeping old behavior
Config: action_view.button_to_generates_button_tag
New default: true
Risk: low
Searching codebase...
✓ Found 3 uses of button_to in app/views/
✓ No CSS/JS targeting input[type=submit]
Recommendation: Safe to use new default (true).
Shall I uncomment this config? [y/n]
After you confirm, Claude uncomments the config and waits for you to test and commit before moving to the next one.
When all configs are done, the skill:
- Deletes the
new_framework_defaults_X_Y.rbinitializer - Updates
config.load_defaultsinconfig/application.rb - Adds explicit overrides for any configs kept at old values
config.load_defaults 7.0
# Override: kept old behavior because CSS targets input[type=submit]
config.action_view.button_to_generates_button_tag = falserails-load-defaults/
├── SKILL.md # Workflow instructions
├── configs/
│ ├── 7_0.yml # Config reference with lookup logic
└── templates/
├── new_framework_defaults_7_0.rb # Rails initializer
└── cookie_rotator.rb # SHA1→SHA256 cookie rotation
To add support for a new Rails version (e.g., 7.2):
- Add
templates/new_framework_defaults_7_2.rb— the initializer from Rails - Add
configs/7_2.yml— config entries with tiers, lookup patterns, and decision trees - Update the version references in
SKILL.md
The workflow logic in SKILL.md is version-agnostic, so no other changes are needed.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.
This skill was created by FastRuby.io, a team specializing in Rails upgrades and technical debt remediation.
Need help with your Rails application? Contact us for a tech debt assessment!