Provides 42 community-curated Ruby performance optimization rules across object allocation, collection processing, ActiveRecord queries, string handling, concurrency, and runtime configuration.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pproenca-dot-skills-1:ruby-optimiseThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive performance optimization guide for Ruby applications, maintained by the community. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Comprehensive performance optimization guide for Ruby applications, maintained by the community. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Object Allocation | CRITICAL | alloc- |
| 2 | Collection & Enumeration | CRITICAL | enum- |
| 3 | I/O & Database | HIGH | io- |
| 4 | String Handling | HIGH | str- |
| 5 | Method & Dispatch | MEDIUM-HIGH | meth- |
| 6 | Data Structures | MEDIUM | ds- |
| 7 | Concurrency | MEDIUM | conc- |
| 8 | Runtime & Configuration | LOW-MEDIUM | runtime- |
alloc-avoid-unnecessary-dup - Avoid Unnecessary Object Duplicationalloc-freeze-constants - Freeze Constant Collectionsalloc-lazy-initialization - Use Lazy Initialization for Expensive Objectsalloc-avoid-temp-arrays - Avoid Temporary Array Creationalloc-reuse-buffers - Reuse Buffers in Loopsalloc-avoid-implicit-conversions - Avoid Repeated Computation in Hot Pathsenum-single-pass - Use Single-Pass Collection Transformsenum-lazy-large-collections - Use Lazy Enumerators for Large Collectionsenum-flat-map - Use flat_map Instead of map.flattenenum-each-with-object - Use each_with_object Over inject for Building Collectionsenum-avoid-count-in-loops - Avoid Recomputing Collection Size in Conditionsenum-chunk-batch-processing - Use each_slice for Batch Processingio-eager-load-associations - Eager Load ActiveRecord Associationsio-select-only-needed-columns - Select Only Needed Columnsio-batch-find-each - Use find_each for Large Record Setsio-avoid-queries-in-loops - Avoid Database Queries Inside Loopsio-stream-large-files - Stream Large Files Line by Lineio-connection-pool-sizing - Size Connection Pools to Match Thread Countio-cache-expensive-queries - Cache Expensive Database Resultsstr-frozen-literals - Enable Frozen String Literalsstr-shovel-over-plus - Use Shovel Operator for String Buildingstr-interpolation-over-concatenation - Use String Interpolation Over Concatenationstr-avoid-repeated-gsub - Chain gsub Calls into a Single Replacementstr-symbol-for-identifiers - Use Symbols for Identifiers and Hash Keysmeth-avoid-method-missing-hot-paths - Avoid method_missing in Hot Pathsmeth-cache-method-references - Cache Method References for Repeated Callsmeth-block-vs-proc - Pass Blocks Directly Instead of Converting to Procmeth-avoid-dynamic-send - Avoid Dynamic send in Performance-Critical Codemeth-reduce-method-chain-depth - Reduce Method Chain Depth in Hot Loopsds-set-for-membership - Use Set for Membership Testsds-struct-over-openstruct - Use Struct Over OpenStructds-sort-by-over-sort - Use sort_by Instead of sort with Blockds-array-preallocation - Preallocate Arrays When Size Is Knownds-hash-default-value - Use Hash Default Values Instead of Conditional Assignmentconc-fiber-for-io - Use Fibers for I/O-Bound Concurrencyconc-thread-pool-sizing - Size Thread Pools to Match Workloadconc-ractor-cpu-bound - Use Ractors for CPU-Bound Parallelismconc-avoid-shared-mutable-state - Avoid Shared Mutable State Between Threadsruntime-enable-yjit - Enable YJIT for Productionruntime-tune-gc-parameters - Tune GC Parameters for Your Workloadruntime-frozen-string-literal-default - Set Frozen String Literal as Project Defaultruntime-optimize-require - Optimize Require Load OrderRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin pproenca-dot-skills-1Optimizes Ruby on Rails code for performance and maintainability across controllers, models, ActiveRecord queries, caching, views, API design, security, and background jobs.
Write idiomatic Ruby code with metaprogramming, Rails patterns, and performance optimization. Specializes in Ruby on Rails, gem development, and testing frameworks.
Analyzes Rails code for performance issues like N+1 queries, missing indexes, algorithmic bottlenecks, memory usage, and scalability. Use after implementing features or addressing slowdowns.