From dual-boot
Sets up and manages dual-boot Ruby and Rails environments using the next_rails gem. Helps configure Gemfile for running two versions of Rails, Ruby, or any core dependency simultaneously, set up CI for both versions, use NextRails.next? for version-dependent code, and clean up after the upgrade is complete. Based on FastRuby.io methodology and "The Complete Guide to Upgrade Rails" ebook.
npx claudepluginhub ombulabs/claude-skills --plugin dual-bootThis skill uses the workspace's default tool permissions.
When invoked via `/dual-boot`, follow the setup workflow in `workflows/setup-workflow.md` to set up dual-boot for this project. If the user provides version arguments (e.g. `/dual-boot 7.0 7.1`), use them as the current and target versions. If no arguments are provided, detect the current version from the Gemfile and ask the user for the target version.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
When invoked via /dual-boot, follow the setup workflow in workflows/setup-workflow.md to set up dual-boot for this project. If the user provides version arguments (e.g. /dual-boot 7.0 7.1), use them as the current and target versions. If no arguments are provided, detect the current version from the Gemfile and ask the user for the target version.
next_rails gemDual-booting allows a Ruby application to maintain two sets of dependencies simultaneously. While most commonly used for Rails version upgrades, the same approach works for upgrading Ruby versions or any core dependency in your Gemfile (e.g., sidekiq, devise, pg).
This skill helps you:
next_rails gemNextRails.next?NextRails.next? — Never Use Feature DetectionWhen code would break on one version and needs a different implementation on the other, always use NextRails.next? from the next_rails gem to branch — never feature detection. Do not use respond_to?, defined?, const_defined?, or any other feature-detection pattern for version branching.
Why feature detection is problematic:
respond_to? / defined? checks pile up and become impossible to clean up because their purpose is lostWhy NextRails.next? is better:
NextRails.next? and remove all branchesReach for NextRails.next? only when the old and new APIs are genuinely two-sided — the old one raises on the next version and the new one doesn't exist on the current version. A plain deprecation warning is not a reason to branch: if the new API works on both sides, migrate the call site directly.
❌ WRONG — Do NOT use feature detection (respond_to?, defined?, etc.):
test_request =
if ActionController::TestRequest.respond_to?(:create)
ActionController::TestRequest.create
else
ActionController::TestRequest.new
end
✅ CORRECT — Use NextRails.next?:
test_request =
if NextRails.next?
ActionController::TestRequest.create
else
ActionController::TestRequest.new
end
This is a genuine two-sided case (Rails 4.2 → 5.0). On 4.2, ActionController::TestRequest.new takes an optional env; on 5.0 new requires two non-optional arguments so the 4.2 call fails. Rails 5.0 introduces TestRequest.create, which does not exist on 4.2 — so each side raises on the other.
Put the next-version branch on top so cleanup is mechanical: after the upgrade, keep the if body and drop the else. See references/code-patterns.md for more examples.
Use NextRails.next? branching for:
Not a reason to branch: plain deprecation warnings. If the new API works on both versions (e.g. config.fixture_path= → config.fixture_paths=, update_attributes → update before its removal), migrate the call site directly — do not wrap it in NextRails.next?. See references/code-patterns.md "When NOT to Branch: Deprecations".
Claude should activate this skill when user says:
See workflows/setup-workflow.md for the complete step-by-step process.
Summary:
0. Verify deprecation warnings are not silenced (see references/deprecation-tracking.md)
Check if dual-boot is already set up (look for Gemfile.next)
Add next_rails gem to Gemfile
Run bundle install
Run next_rails --init (only if Gemfile.next does NOT exist)
Configure Gemfile with next? conditionals for the dependency being upgraded
Install dependencies for both versions:
bundle installcp Gemfile.lock Gemfile.next.lock && BUNDLE_GEMFILE=Gemfile.next bundle installVerify both versions work
When proposing code changes that need to work with both dependency sets:
next_rails is set up (check for Gemfile.next)NextRails.next? for branching — never respond_to?next? branch (new version code) on topelse branch (old version code) belowSee references/code-patterns.md for examples.
See references/ci-configuration.md for CI setup with GitHub Actions, CircleCI, and Jenkins.
See workflows/cleanup-workflow.md for the complete post-upgrade cleanup process.
Summary:
NextRails.next? referencesNextRails.next? (true) branch codeelse branchesnext? method from Gemfilenext_rails gem if no longer neededGemfile.next and replace Gemfile.lock with Gemfile.next.lockSKILL.md - This file (entry point)references/deprecation-tracking.md - Detecting silenced deprecations and configuring tracking (Rails 3.0+)references/code-patterns.md - NextRails.next? usage examples in application codereferences/ci-configuration.md - CI setup for dual-boot (GitHub Actions, CircleCI, Jenkins)references/gemfile-examples.md - Gemfile configuration patterns for dual-bootworkflows/setup-workflow.md - Step-by-step dual-boot setupworkflows/cleanup-workflow.md - Post-upgrade dual-boot removalexamples/basic-setup.md - Basic dual-boot setup examplenext_rails --init if Gemfile.next exists — it will duplicate the next? methodNextRails.next? for version-dependent code — never respond_to?Gemfile for rspec-rails, parallel_tests, turbo_tests, or minitest-parallel_fork, check whether the app has spec/ or test/, and prefer wrappers like bin/test when they exist. Every bundle exec rspec in the workflows, examples, and CI reference is illustrative; substitute the detected command (e.g. bin/rails test, bundle exec parallel_rspec spec/, bin/test) and prefix with BUNDLE_GEMFILE=Gemfile.next (or the next CLI) to run it against the next dependency set.NextRails.next? branchesnext_rails at the Gemfile root level — not inside a :development or :test group| Command | Purpose |
|---|---|
next_rails --init | Initialize dual-boot (creates Gemfile.next symlink) |
next bundle install | Install gems for the next dependency set |
next bundle exec rspec | Run tests with the next dependency set |
BUNDLE_GEMFILE=Gemfile.next bundle exec rails server | Start server with next version |
BUNDLE_GEMFILE=Gemfile.next bundle exec rspec | Alternative to next command |
See CHANGELOG.md for version history and current version.