Scheduled upgrade in progress. Some pages may load slowly or ask you to retry.

Ruby Patterns

Ruby development patterns including package manager detection (Bundler), project structure, and idiomatic Ruby practices. Use when writing, reviewing, or debugging Ruby code.

majiayu000 4c15a93 2 files · 2.2 KB Updated 567 repo stars

File contents

Ruby Development Patterns

Package Manager Detection (CRITICAL)

Before running ANY Ruby commands, detect the package manager:

File Package Manager Install Run
Gemfile.lock Bundler bundle install bundle exec
Gemfile (no lock) Bundler bundle install bundle exec
None gem/ruby gem install ruby

NEVER use gem install directly when Gemfile exists.

Follow the existing project's Gemfile. Always use bundle exec to run commands.

Project Structure

myproject/
├── lib/                # Source code
│   ├── myproject.rb    # Main entry point
│   └── myproject/      # Namespace directory
│       ├── cli.rb
│       └── core.rb
├── spec/               # RSpec tests (preferred)
│   ├── spec_helper.rb
│   └── myproject/
│       └── core_spec.rb
├── bin/                # Executables
├── Gemfile
├── Gemfile.lock
├── Rakefile
└── Makefile

CLI Structure

Three-layer separation (same principle as Python).

majiayu000/claude-skill-registry-data/tree/main/development/ruby-patterns-cooldaemon-dotfiles commit 4c15a9311a

Frequently asked questions

npx skillmds add majiayu000/ruby-patterns-2