ruby-patterns
CommunityMaster Ruby idioms, patterns, and metaprogramming.
Software Engineering#code quality#best practices#refactoring#design patterns#idioms#ruby#metaprogramming
Authorgeoffjay
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Writing clean, efficient, and maintainable Ruby code requires familiarity with common idioms, established design patterns, and powerful metaprogramming techniques. Without this knowledge, code can become verbose, inefficient, or difficult to extend.
Core Features & Use Cases
- Common Idioms: Quick reference for conditional assignment, array/hash shortcuts, enumerable methods, and string operations for concise and expressive code.
- Design Patterns: Detailed instructions for Creational (Factory, Builder, Singleton), Structural (Decorator, Adapter, Composite), and Behavioral (Strategy, Observer, Command) patterns.
- Metaprogramming Techniques: Guidance on dynamic method definition,
method_missing, class macros (DSLs), and module inclusion hooks for flexible and powerful code. - Use Case: A Ruby developer is refactoring a legacy application and wants to improve its structure, readability, and performance. This Skill provides a catalog of patterns and techniques, from simple idioms to advanced metaprogramming, to elevate the codebase to modern Ruby standards.
Quick Start
Conditional Assignment (set if nil)
value ||= default_value
Array creation shortcut
%w[apple banana orange] # => ["apple", "banana", "orange"]
Enumerable transformation
array.map(&:upcase) # => ["APPLE", "BANANA"]
Guard Clause
def process(user) return unless user&.active?
Main logic
end
Dependency Matrix
Required Modules
None requiredComponents
assetsreferences
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: ruby-patterns Download link: https://github.com/geoffjay/claude-plugins/archive/main.zip#ruby-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.