ruby-patterns
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.
Ruby Patterns provides design patterns, idioms, and metaprogramming techniques to write cleaner, more maintainable Ruby code.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2025-11-04
Ruby Patterns provides design patterns, idioms, and metaprogramming techniques to write cleaner, more maintainable Ruby code. 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.
Use it when
- Ruby Patterns covers metaprogramming techniques including method_missing for dynamic method handling and class macros for DSL creation.
- Ruby Patterns teaches modern idioms including guard clauses for early returns, safe navigation operators for nil-safety.
Verify before relying
Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.
Install
geoffjay/claude-plugins/ruby-patterns · repository language: Python
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
What ruby design patterns examples does Ruby Patterns cover?
Ruby Patterns teaches creational, structural, and behavioral design patterns with working examples. You'll learn factory, builder, decorator, strategy, and observer patterns alongside proven architectural approaches for better code organization and reusability.
How can I use ruby metaprogramming to write dynamic methods?
Ruby Patterns covers metaprogramming techniques including method_missing for dynamic method handling and class macros for DSL creation. These approaches let you write flexible, self-modifying code that adapts to runtime conditions while maintaining clarity.
What ruby idioms and best practices improve code clarity?
Ruby Patterns teaches modern idioms including guard clauses for early returns, safe navigation operators for nil-safety, and enumerable shortcuts for concise data transformations. These refactoring techniques make your code more readable and maintainable.
How does Ruby Patterns help with ruby memoization performance?
Ruby Patterns covers memoization and lazy evaluation strategies to optimize performance. You'll learn when and how to cache expensive computations and defer evaluation, improving speed without sacrificing code readability.
What error handling patterns does Ruby Patterns teach?
Ruby Patterns includes custom exceptions handling and result object patterns for robust error management. These approaches provide alternatives to traditional try-catch flows, enabling cleaner control flow and better error propagation.
Can Ruby Patterns help me refactor existing Ruby code?
Yes. Ruby Patterns equips you with idioms, guard clauses, safe navigation operators, and enumerable shortcuts to refactor for clarity. Apply these techniques alongside design patterns to improve architecture and maintainability of existing codebases.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Ruby Patterns Skill
Tier 1: Quick Reference - Common Idioms
Conditional Assignment
# Set if nil
value ||= default_value
# Set if falsy (nil or false)
value = value || default_value
# Safe navigation
user&.profile&.avatar&.url
Array and Hash Shortcuts
# Array creation
%w[apple banana orange] # ["apple", "banana", "orange"]
%i[name email age] # [:name, :email, :age]
# Hash creation
{ name: 'John', age: 30 } # Symbol keys
{ 'name' => 'John' } # String keys
# Hash access with default
hash.fetch(:key, default)
hash[:key] || default
Enumerable Shortcuts
# Transformation
array.map(&:upcase)
array.select(&:active?)
array.reject(&:empty?)
# Aggregation
array.sum
array.max
array.min
numbers.reduce(:+)
# Finding
array.find(&:valid?)
array.any?(&:present?)
array.all?(&:valid?)
String Operations
```ruby
Interpolation
"Hello #{name}!"
Safe interpolation
"Result: %{value}" % { value: result }
Multiline
<<~TEXT Heredoc
(truncated - see the full file via the links below)
File tree — 1 file
plugins/ruby-sinatra-advanced/skills/ruby-patterns/SKILL.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 design patterns for better code architecture”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
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.
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.
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.
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.
Learn to build reliable test suites in Python using pytest, fixtures, and mocking strategies. This skill covers unit and integration testing, test organization, async testing, and coverage measurement. Discover patterns for parametrized tests, external dependency mocking, and test-driven development workflows.
Swift Development provides language-level guidance for writing correct, performant Swift across iOS, macOS, and other Apple platforms. It covers concurrency architecture with async/await and actors, Swift 6 strict concurrency migration, memory optimization through InlineArray and Span, and code complexity standards via SwiftLint thresholds. Use it to review code for data races, actor isolation, and modern idioms.
More skills Java Idioms (MIT)