From ruby-idioms
Use when writing or reviewing Ruby — Enumerable-driven, expression-oriented idioms (blocks, guard clauses, safe navigation, keyword arguments, predicate methods) and the manual loops, nil checks, and temporary variables they replace.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ruby-idioms:writing-idiomatic-rubyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Idiomatic Ruby reads like intent. Lean on Enumerable and blocks, treat almost everything as an
Idiomatic Ruby reads like intent. Lean on Enumerable and blocks, treat almost everything as an expression, and let objects answer questions about themselves.
map / select / reject / reduce / each_with_object instead of building an array with
<< inside a while/for. Use for essentially never.sum, min_by, max_by, group_by, partition, tally, flat_map — reach for the
specific method before hand-rolling.each_with_object({}) or to_h to build hashes; filter_map to map-and-compact in one pass.if/case, and let the last expression be the
return (drop explicit return except for guard clauses).if/unless and early return/next over nested
conditionals.case/when (and pattern matching case/in in 3.x) over long elsif chains.&&/||, ||=, and the safe-navigation &. over verbose nil checks.? and return booleans; bang methods (!) mutate or raise.attr_reader/attr_accessor over hand-written accessors. Symbols for identifiers/keys.tap for side effects in a chain; then/yield_self to pipe a value through a transform.# frozen_string_literal: true at the top of files.do…end for multiline blocks, {…} for one-liners.Exception — rescue StandardError (the default) or a specific class.Run RuboCop for formatting and lint — this skill is about the idioms above, not whitespace. American English in identifiers and comments.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub meaganewaller/rosetta --plugin ruby-idioms