upgrade-engine
Skill26 starsChanged 4 months agoMITView on GitHub
Use when checking a Rails engine across Rails versions (Zeitwerk, compatibility). Trigger words: Zeitwerk, Rails upgrade, cross-version, engine compatibility.
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- apply-code-conventionsSkill
- apply-stack-conventionsSkill
- code-reviewSkill
- create-engine-installerSkill
- create-engineSkill
- document-engineSkill
- extract-engineSkill
- generate-api-collectionSkill
- implement-authorizationSkill
- implement-background-jobSkill
- implement-graphqlSkill
- implement-hotwireSkill
- load-contextSkill
- optimize-performanceSkill
- plan-testsSkill
- rails-featureSkill
- rails-maintenanceSkill
- rails-reviewSkill
- refactor-codeSkill
- release-engineSkill
- review-architectureSkill
- review-engineSkill
- review-migrationSkill
- security-checkSkill
- seed-databaseSkill
- setup-environmentSkill
- test-engineSkill
- test-serviceSkill
- version-apiSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Core principle: Every claimed Rails/Ruby version must be in the CI matrix.
- Very specific: line 32
Run bundle exec rake zeitwerk:check — file paths must match constant names exactly (e.g.
- Very specific: line 33
Check initializer behavior across boot and reload — use config.to_prepare for reload-sensitive hooks.
- Very specific: line 34
Verify gemspec dependency bounds match tested versions: spec.add_dependency "rails", ">= 7.0", "< 8.0" — bounds must reflect what CI …
- Distinctive: line 47
Check optional integrations (jobs, mailers, assets, routes, install generators, dummy-app mounts) per version.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Upgrade 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
- assets/compatibility_matrix.md
- assets/zeitwerk_notes.md
- EXAMPLES.md
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 |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

