$npx skillfedfor your agent

ruby

This skill teaches core Ruby patterns including classes, modules, inheritance, and mixins alongside functional programming with blocks, procs, and lambdas. It covers enumerable operations, lazy evaluation, and metaprogramming techniques like method_missing and dynamic method definition, plus error handling strategies and RSpec testing.

Ruby teaches programming patterns, blocks, metaprogramming, and idiomatic code for web development.

AI-generated summary based on this skill's SKILL.md

19 5 MITupdated by miles990

Decision gist · record as of 2026-01-20

Ruby teaches programming patterns, blocks, metaprogramming, and idiomatic code for web development. This skill teaches core Ruby patterns including classes, modules, inheritance, and mixins alongside functional programming with blocks, procs, and lambdas. It covers enumerable operations, lazy evaluation, and metaprogramming techniques like method_missing and dynamic method definition, plus error handling strategies and RSpec testing.

manual: git clone https://github.com/miles990/claude-software-skills → cp -r claude-software-skills/programming-languages/ruby ~/.claude/skills/ruby
programming-languages/ruby/SKILL.md · version 1cf27be4

Use it when

  • Ruby metaprogramming lets you write code that writes code.
  • Ruby lambdas and procs are both callable objects, but differ in strictness and return behavior.

Verify before relying

Read SKILL.md below before installing (4 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

miles990/claude-software-skills/ruby · repository language: TypeScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do blocks and yield work in Ruby?

Ruby blocks are anonymous code chunks passed to methods. The yield keyword executes the block within a method's context. Ruby uses blocks extensively—iterators like `each` and `map` accept blocks. Blocks can access the method's local variables and return values to the caller. Understanding blocks is fundamental to Ruby's functional programming style and idiomatic code patterns.

What are Ruby's metaprogramming techniques like method_missing?

Ruby metaprogramming lets you write code that writes code. method_missing intercepts calls to undefined methods, enabling dynamic method handling. define_method creates methods at runtime. Ruby also supports refinements for scoped monkey patching and symbol-to-proc conversion for compact functional syntax. These techniques power Rails' elegant DSLs and ActiveRecord's dynamic finders.

What's the difference between Ruby lambdas vs procs?

Ruby lambdas and procs are both callable objects, but differ in strictness and return behavior. Lambdas enforce argument count and return to their enclosing method; procs are lenient with arguments and return from the enclosing method. Lambdas are stricter and safer for most use cases. Both support closures and can be passed as block arguments using the & operator.

How do Ruby classes, modules, and inheritance work together?

Ruby classes inherit from a single parent (default: Object). Modules provide mixins—reusable behavior included into classes. Multiple modules can be mixed into one class, enabling composition. Inheritance chains methods vertically; modules add methods horizontally. Ruby's method lookup follows the inheritance chain, then included modules in reverse order. This design avoids multiple inheritance complexity while supporting flexible code reuse.

What testing approach does Ruby use with RSpec?

RSpec is Ruby's dominant testing framework using a behavior-driven development (BDD) syntax. Tests read like specifications: `describe`, `context`, and `it` blocks structure tests. Matchers like `expect(value).to eq(expected)` assert outcomes. RSpec supports mocking, stubbing, and fixtures. Combined with proper error handling and exception testing, RSpec enables comprehensive test coverage for Ruby applications.

How do Rails gems and Bundler manage Ruby dependencies?

Ruby on Rails relies on gems—packaged libraries—for functionality. Bundler manages gem dependencies via a Gemfile, resolving version conflicts and locking versions in Gemfile.lock. Rails itself is a gem providing MVC structure, ActiveRecord ORM, and routing. Bundler ensures consistent environments across development, testing, and production. Understanding gem management is essential for Rails backend development and following Ruby on Rails best practices.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Ruby

Overview

Ruby programming patterns including blocks, metaprogramming, and idiomatic Ruby code.


Core Ruby Patterns

Classes and Modules

```ruby

Class definition

class User attr_accessor :name, :email attr_reader :id attr_writer :password

# Class variable @@count = 0

# Class method def self.count @@count end

# Initialize def initialize(name, email) @id = SecureRandom.uuid @name = name @email = email @@count += 1 end

# Instance method def display_name "#{name} <#{email}>" end

# Private methods private

def validate_email email.include?('@') end end

Inheritance

class Admin < User attr_accessor :permissions

def

(truncated - see the full file via the links below)

File tree — 4 files
programming-languages/ruby/SKILL.md
programming-languages/ruby/templates/.rubocop.yml
programming-languages/ruby/templates/Gemfile
programming-languages/ruby/templates/README.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Learn Ruby programming patterns, blocks, and idiomatic code”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

ruby-patterns
by geoffjay · geoffjay/claude-plugins

Ruby Patterns equips you with creational, structural, and behavioral design patterns alongside modern Ruby idioms and metaprogramming techniques. Reference common shortcuts for conditionals, enumerables, and strings, then dive into factory, builder, decorator, strategy, and observer patterns with working examples. Use it to refactor for clarity and apply proven architectural approaches.

MITupdated Nov 2025
★ 8repo stars
Rspec Coder
by majesticlabs-dev · majesticlabs-dev/majestic-marketplace

Rspec Coder streamlines Ruby testing by automatically generating RSpec test files and cases tailored to your codebase. Skip manual test scaffolding and focus on test logic while the skill handles boilerplate creation and structure.

no license declared → metadata onlyupdated May 2026
★ 44repo stars
ruby
by el-feo · el-feo/ai-context

Master Ruby language conventions and modern features (3.x+) for writing clean, performant code. This skill covers error handling strategies, pattern matching, and Ruby idioms like guard clauses and safe navigation. Use it when writing pure Ruby, optimizing performance, or establishing team conventions—separate skills handle Rails, design patterns, testing, and style.

MITupdated Jul 2026
★ 12repo stars
ruby-patterns
by softspark · softspark/ai-toolkit

Ruby Patterns covers essential idioms and architectural approaches for Rails and Ruby development. Learn blocks, procs, lambdas, modules, metaprogramming techniques, pattern matching, and enumerable chains alongside testing strategies with RSpec, error handling patterns, and project structure conventions for gems and Rails apps.

Apache-2.0updated Jul 2026
★ 161repo stars
elixir-idioms
by oliver-kriska · oliver-kriska/claude-elixir-phoenix

A reference for writing idiomatic Elixir code aligned with BEAM architecture and OTP patterns. Covers GenServer, Supervisor, Task, Registry, pattern matching, and the core principles that make concurrent systems reliable—including eleven iron laws never to violate and decision trees for control flow, error handling, and process design.

MITfor amp, codex, opencodeupdated Jul 2026
★ 507repo stars
cpp
by miles990 · miles990/claude-software-skills

This skill covers contemporary C++ practices from C++11 onward, emphasizing memory safety through smart pointers (unique_ptr, shared_ptr, weak_ptr) and the RAII pattern for automatic resource cleanup. You'll explore move semantics and perfect forwarding to optimize performance, dive into function and class templates with specialization techniques, and learn STL containers and algorithms for efficient data manipulation.

MITupdated Jan 2026
★ 19repo stars

More skills php (MIT) · swift (MIT)

Tags
dynamic-code-generationfunctional-programmingobject-oriented-designconcurrent-executioncollection-operationsweb-frameworktesting-frameworkexception-patternscode-introspectionasync-programming