Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

dual-boot双启动

Agent Skill

dual-boot 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

194

周安装

8

GitHub Stars

6

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dual-boot(双启动)
来源仓库:https://github.com/ombulabs/claude-code_dual-boot-skill
仓库路径:skills/dual-boot
安装命令:
npx skills add https://github.com/ombulabs/claude-code_dual-boot-skill --skill dual-boot
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ombulabs/claude-code_dual-boot-skill --skill dual-boot

简介

dual-boot 利用 next_rails gem 管理 Ruby/Rails 项目的双版本并行运行环境。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中依赖升级与兼容性测试场景。
  • 自动检测当前版本并引导设定目标版本,支持 Gemfile 级别的依赖隔离切换。
  • 遵循 FastRuby.io 升级最佳实践,确保迁移过程可回滚且不影响线上服务稳定性。
  • dual-boot 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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.

Dual-Boot Skill

  • Purpose: Set up and manage dual-boot environments for Rails, Ruby, or core Gemfile dependencies using the next_rails gem
  • Key Gem: next_rails
  • Methodology: Based on FastRuby.io upgrade best practices and "The Complete Guide to Upgrade Rails" ebook
  • Attribution: Content based on "The Complete Guide to Upgrade Rails" by FastRuby.io (OmbuLabs)

Overview

Dual-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:

  • Set up dual-boot with the next_rails gem
  • Configure the Gemfile to support two versions of Rails, Ruby, or other key dependencies
  • Branch application code using NextRails.next?
  • Configure CI to test against both dependency sets
  • Clean up dual-boot code after the upgrade is complete

CRITICAL: Always Use NextRails.next? — Never Use respond_to?

When writing code that must work with both the current and target versions, always use NextRails.next? from the next_rails gem. Never use respond_to? or other feature-detection patterns for version branching.

Why respond_to? is problematic:

  • Hard to understand: readers must know which version introduced a method to grasp the intent
  • Hard to maintain: respond_to? checks pile up and become impossible to clean up because their purpose is lost
  • Fragile: may give wrong results if gems monkey-patch methods in or out
  • Obscures intent: the code says "does this method exist?" when it means "are we on the next Rails version?"

Why NextRails.next? is better:

  • Explicit and readable: anyone reading the code immediately understands "this branch is for the next version"
  • Easy to clean up: after the upgrade, search for NextRails.next? and remove all branches
  • The standard: established dual-boot mechanism in the FastRuby.io methodology

Pattern

WRONG — Do NOT use respond_to?:

if config.respond_to?(:fixture_paths=)
  config.fixture_paths = ["#{::Rails.root}/spec/fixtures"]
else
  config.fixture_path = "#{::Rails.root}/spec/fixtures"
end

CORRECT — Use NextRails.next?:

if NextRails.next?
  config.fixture_paths = ["#{::Rails.root}/spec/fixtures"]
else
  config.fixture_path = "#{::Rails.root}/spec/fixtures"
end

When to Apply

Use NextRails.next? branching for:

  • Configuration changes (e.g., fixture_pathfixture_paths)
  • API changes (e.g., method renames, changed signatures, removed methods)
  • Gem version differences (e.g., different gem APIs across dependency versions)
  • Initializer changes (e.g., different middleware, different default settings)
  • Ruby version differences (e.g., syntax changes, stdlib removals)

Trigger Patterns

Claude should activate this skill when user says:

  • "Set up dual boot for my Rails app"
  • "Help me dual-boot Rails [x] and [y]"
  • "Dual-boot Ruby [x] and [y]"
  • "Set up dual boot for upgrading [dependency]"
  • "Add next_rails to my project"
  • "Configure dual-boot CI"
  • "Clean up dual-boot code"
  • "Remove next_rails after upgrade"
  • "How do I use NextRails.next?"
  • "Set up Gemfile for two Rails versions"
  • "Set up Gemfile for two Ruby versions"

Core Workflows

Workflow 1: Set Up Dual-Boot

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)

  1. Check if dual-boot is already set up (look for Gemfile.next)
  2. Add next_rails gem to Gemfile
  3. Run bundle install
  4. Run next_rails --init (only if Gemfile.next does NOT exist)
  5. Configure Gemfile with next? conditionals for the dependency being upgraded
  6. Install dependencies for both versions:

- Current: bundle install - Next: cp Gemfile.lock Gemfile.next.lock && BUNDLE_GEMFILE=Gemfile.next bundle install

  1. Verify both versions work

Workflow 2: Add Version-Dependent Code

When proposing code changes that need to work with both dependency sets:

  1. Verify next_rails is set up (check for Gemfile.next)
  2. Use NextRails.next? for branching — never respond_to?
  3. Keep the next? branch (new version code) on top
  4. Keep the else branch (old version code) below

See references/code-patterns.md for examples.

Workflow 3: Configure CI

See references/ci-configuration.md for CI setup with GitHub Actions, CircleCI, and Jenkins.

Workflow 4: Clean Up After Upgrade

See workflows/cleanup-workflow.md for the complete post-upgrade cleanup process.

Summary:

  1. Search for all NextRails.next? references
  2. Keep only the NextRails.next? (true) branch code
  3. Remove all else branches
  4. Remove next? method from Gemfile
  5. Remove next_rails gem if no longer needed
  6. Remove Gemfile.next and replace Gemfile.lock with Gemfile.next.lock
  7. Update CI to remove dual-boot configuration
  8. Run full test suite
  9. Commit cleanup changes

Available Resources

Core Documentation

  • SKILL.md - This file (entry point)

Reference Materials

  • references/deprecation-tracking.md - Detecting silenced deprecations and configuring tracking (Rails 3.0+)
  • references/code-patterns.md - NextRails.next? usage examples in application code
  • references/ci-configuration.md - CI setup for dual-boot (GitHub Actions, CircleCI, Jenkins)
  • references/gemfile-examples.md - Gemfile configuration patterns for dual-boot

Workflows

  • workflows/setup-workflow.md - Step-by-step dual-boot setup
  • workflows/cleanup-workflow.md - Post-upgrade dual-boot removal

Examples

  • examples/basic-setup.md - Basic dual-boot setup example

Key Principles

  1. Ensure deprecation warnings are visible — silenced deprecations mean you can't track upgrade progress
  2. Never run next_rails --init if Gemfile.next exists — it will duplicate the next? method
  3. Always use NextRails.next? for version-dependent code — never respond_to?
  4. Test both versions using the project's own test runner. Detect it before running anything: check the 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.
  5. Clean up after upgrade — search for and remove all NextRails.next? branches
  6. Add next_rails at the Gemfile root level — not inside a :development or :test group

Quick Reference

CommandPurpose
next_rails --initInitialize dual-boot (creates Gemfile.next symlink)
next bundle installInstall gems for the next dependency set
next bundle exec rspecRun tests with the next dependency set
BUNDLE_GEMFILE=Gemfile.next bundle exec rails serverStart server with next version
BUNDLE_GEMFILE=Gemfile.next bundle exec rspecAlternative to next command

See CHANGELOG.md for version history and current version.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.09%
按下载量换算21

Claude

32.33%
按下载量换算20

Cursor

17.25%
按下载量换算11

Gemini CLI

9.27%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills