From majestic-rails
Safely upgrades a Ruby gem or all outdated ones: checks versions, reviews changelog and breaking changes, confirms with user, updates Gemfile, runs bundle update.
How this command is triggered — by the user, by Claude, or both
Slash command
/majestic-rails:upgrade [gem_name | --outdated]gemfile/This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Upgrade Gem Safely upgrade a Ruby gem with changelog review, breaking changes analysis, and automated testing. ## Arguments `$ARGUMENTS` - `gem_name` - Upgrade a specific gem (e.g., `rails`, `sidekiq`) - `--outdated` - Review all outdated gems and select which to upgrade ## Tasks ### 1. Check Current Status Parse output to get: - Current version installed - Latest version available - Whether it's a major, minor, or patch update ### 2. Fetch Changelog Information For the gem being upgraded: 1. **Find GitHub repository** 2. **Fetch changelog** using WebFetch: - `https://...
Safely upgrade a Ruby gem with changelog review, breaking changes analysis, and automated testing.
$ARGUMENTS
gem_name - Upgrade a specific gem (e.g., rails, sidekiq)--outdated - Review all outdated gems and select which to upgrade# For specific gem
bundle outdated [gem_name] --strict
# For all outdated
bundle outdated --strict
Parse output to get:
For the gem being upgraded:
Find GitHub repository
bundle info [gem_name] --path
# Check gemspec for homepage/source_code_uri
Fetch changelog using WebFetch:
https://github.com/[owner]/[repo]/releases - GitHub releaseshttps://github.com/[owner]/[repo]/blob/main/CHANGELOG.md - Changelog filehttps://github.com/[owner]/[repo]/blob/main/HISTORY.md - History filehttps://github.com/[owner]/[repo]/blob/main/NEWS.md - News fileExtract relevant changes between current and target version
Look for:
Present summary:
## Upgrade Analysis: sidekiq 6.5.12 → 7.2.0
### Version Jump: MAJOR (6.x → 7.x)
### Breaking Changes:
- Removed support for Redis < 6.2
- Changed default concurrency from 25 to 10
- Renamed `Sidekiq::Worker` to `Sidekiq::Job`
### Migration Required:
1. Update Redis to 6.2+
2. Replace `include Sidekiq::Worker` with `include Sidekiq::Job`
3. Review concurrency settings
### Deprecations:
- `Sidekiq.options` deprecated, use `Sidekiq.configure_*`
### New Features:
- Capsules for isolated configurations
- Improved metrics dashboard
### Compatibility:
- Requires Ruby 2.7+
- Requires Rails 6.0+
Use AskUserQuestion to present upgrade options:
Current: sidekiq 6.5.12
Latest: sidekiq 7.2.0
Options:
Based on user choice:
# Before
gem 'sidekiq', '~> 6.5.12'
# After (option 1 - latest)
gem 'sidekiq', '~> 7.2'
# After (option 2 - minor)
gem 'sidekiq', '~> 6.5'
bundle update [gem_name] --conservative
If update fails:
# Detect test framework
if [ -f "spec/spec_helper.rb" ]; then
bundle exec rspec
elif [ -f "test/test_helper.rb" ]; then
bundle exec rails test
fi
Report results:
If tests pass:
git add Gemfile Gemfile.lock
git commit -m "$(cat <<'EOF'
chore(deps): upgrade [gem_name] from X.X.X to Y.Y.Y
Breaking changes:
- [list any breaking changes]
Migration notes:
- [list any migration steps taken]
Changelog: [URL to changelog]
EOF
)"
If something goes wrong at any step:
git checkout -- Gemfile Gemfile.lock
bundle install
When using --outdated:
Run bundle outdated --strict
Group by update type:
Use AskUserQuestion to present gem selection with multi-select enabled:
Categorized by risk level:
Present as multi-select options so user can choose which gems to upgrade.
npx claudepluginhub majesticlabs-dev/majestic-marketplace --plugin majestic-rails/gem-upgradeGenerates upgrade report for a Ruby gem by checking release notes and commit diffs between versions, detailing app impact and pre/post changes needed.
/auditAudits Ruby project for breaking changes, gem incompatibilities, and deprecations before upgrading to ruby:X.Y.Z [rails:X.Y]. Auto-detects current versions; read-only, no file changes.
/dependency-upgradeSafely upgrades outdated dependencies one at a time with test verification after each. Auto-detects package manager and categorizes by risk level.
/upgradeUpgrades dependencies or frameworks with breaking change analysis. Requires upgrade_target (e.g., 'React 18 to React 19', 'all dependencies') and optional flags (--deps, --package, --dry-run).
/update-depsSafely updates npm/pip dependencies by risk category (patch/minor/major), verifies changelogs/compatibility, runs tests per batch, commits changes, and outputs summary report.
/upgrade-deep-diveAnalyzes a specific upgrade with deep-dive report: risk assessment, numbered implementation steps, affected files, test strategy, rollback plan, code previews.