mcpField
R
ruby-optimise

ruby-optimise

github.com/pproencaDevelopment218280 installsUpdated 11w ago
Repository

About ruby-optimise

A community-maintained set of Ruby performance guidelines for Ruby application and gem developers. Its 42 rules are organized into eight impact-ranked categories, from object allocation to runtime configuration.

Key features

  1. 0142 rules across eight categories
  2. 02Prioritized by performance impact
  3. 03Covers allocations and collections
  4. 04Guidance for I/O and databases
  5. 05Concurrency and runtime tuning

Use cases

  1. 01Review Ruby code for performance issues
  2. 02Optimize ActiveRecord queries
  3. 03Process large collections in batches
  4. 04Reduce memory use and GC pressure

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill ruby-optimise

After installing, type/ruby-optimisein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
README.md
assets/templates/
_template.md
references/
_sections.md
alloc-avoid-implicit-conversions.md
alloc-avoid-temp-arrays.md
alloc-avoid-unnecessary-dup.md
alloc-freeze-constants.md
alloc-lazy-initialization.md
alloc-reuse-buffers.md
conc-avoid-shared-mutable-state.md
conc-fiber-for-io.md
conc-ractor-cpu-bound.md
conc-thread-pool-sizing.md
ds-array-preallocation.md
ds-hash-default-value.md
ds-set-for-membership.md
ds-sort-by-over-sort.md
ds-struct-over-openstruct.md
enum-avoid-count-in-loops.md
enum-chunk-batch-processing.md
enum-each-with-object.md
enum-flat-map.md
enum-lazy-large-collections.md
enum-single-pass.md
io-avoid-queries-in-loops.md
io-batch-find-each.md
io-cache-expensive-queries.md
io-connection-pool-sizing.md

Details

From the project README

Community Ruby Best Practices

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.

When to Apply

Reference these guidelines when:

  • Writing new Ruby code or gems
  • Optimizing ActiveRecord queries and database access patterns
  • Processing large collections or building data pipelines
  • Reviewing code for memory bloat and GC pressure
  • Configuring Ruby runtime settings for production

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Object AllocationCRITICALalloc-
2Collection & EnumerationCRITICALenum-
3I/O & DatabaseHIGHio-
4String HandlingHIGHstr-
5Method & DispatchMEDIUM-HIGHmeth-
6Data StructuresMEDIUMds-
7ConcurrencyMEDIUMconc-
8Runtime & ConfigurationLOW-MEDIUMruntime-

Quick Reference

1. Object Allocation (CRITICAL)
2. Collection & Enumeration (CRITICAL)
3. I/O & Database (HIGH)
4. String Handling (HIGH)
5. Method & Dispatch (MEDIUM-HIGH)
6. Data Structures (MEDIUM)
7. Concurrency (MEDIUM)
8. Runtime & Configuration (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported