About upgrade-engine
A skill for planning and verifying Rails engine compatibility across Ruby and Rails versions. It ties claimed support to explicit CI matrix coverage, autoload checks, and full test runs.
Key features
- 01Define Ruby and Rails support targets
- 02Check Zeitwerk autoloading
- 03Review initializer reload behavior
- 04Align gemspec bounds with tested versions
- 05Verify optional integrations by version
- 06Require CI coverage for claimed combinations
Use cases
- 01Planning a Rails engine version upgrade
- 02Checking compatibility before release
- 03Finding overbroad gemspec dependency bounds
- 04Building a multi-version CI matrix
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ igmarin/ rails-agent-skills --skill upgrade-engineAfter installing, type/upgrade-enginein Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
EXAMPLES.mdassets/ci_matrix.ymlcompatibility_matrix.mdzeitwerk_notes.mdDetails
From the project READMEUpgrade Engine
Core principle: Every claimed Rails/Ruby version must be in the CI matrix. Prefer explicit support targets over accidental compatibility.
HARD-GATE
Before claiming support for a Rails/Ruby version:
1. bundle exec rake zeitwerk:check # verify autoloading on each version
2. bundle exec rspec # full suite per matrix version
3. CI matrix must pass — not just main Rails version
DO NOT ship compatibility changes without verifying both autoloading and full suite.
Core Process
- Define supported Ruby and Rails versions — state them in gemspec and README.
- Run
bundle exec rake zeitwerk:check— file paths must match constant names exactly (e.g.my_engine/widget_policy.rb→MyEngine::WidgetPolicy). - Check initializer behavior across boot and reload — use
config.to_preparefor reload-sensitive hooks; hooks placed at load time are reload-unsafe in development. - Verify gemspec dependency bounds match tested versions:
spec.add_dependency "rails", ">= 7.0", "< 8.0"— bounds must reflect what CI actually tests. Unbounded or overclaiming constraints (>= 5.2without testing 5.2/6.x) are silent incompatibilities. - Replace
Rails.versionbranching with feature detection — version checks are brittle across patch releases:
# ❌ Bad — brittle, wrong for patch versions
if Rails.version >= "7.0"
config.active_support.cache_format_version = 7.0
end
# ✅ Good — detect the capability directly
if ActiveSupport::Cache.respond_to?(:format_version=)
config.active_support.cache_format_version = 7.0
end
- Check optional integrations (jobs, mailers, assets, routes, install generators, dummy-app mounts) per version. State the check even if an integration is absent.
- CI matrix must run against each claimed Rails/Ruby combination:
strategy:
matrix:
include:
- { ruby: "3.2", rails: "7.1" }
- { ruby: "3.3", rails: "7.2" }
Extended Resources
Output Style
- State the support matrix being targeted.
- List the most likely breakpoints.
- Make compatibility changes in isolated, testable seams.
- Recommend matrix coverage if it does not exist.
- Include an Optional integration matrix with rows for jobs, mailers, assets, routes, generators, and dummy app mount. For each row, state
present/absent, the file path checked, and the per-version verification command. - Language — Must be in English unless explicitly requested otherwise.
Integration
| Skill | When to chain |
|---|---|
| test-engine | Test matrix setup, CI configuration, multi-version tests |
| create-engine | Engine structure, host contract, namespace design |
| release-engine | Versioning, changelog, upgrade notes for compatibility changes |
Comments
Markdown supported