Optimizes Ruby on Rails code for performance and maintainability across controllers, models, ActiveRecord queries, caching, views, API design, security, and background jobs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pproenca-dot-skills-1:rails-devThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive performance and maintainability optimization guide for Ruby on Rails applications, maintained by Community. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Comprehensive performance and maintainability optimization guide for Ruby on Rails applications, maintained by Community. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Database & ActiveRecord | CRITICAL | db- |
| 2 | Controllers & Routing | CRITICAL | ctrl- |
| 3 | Security | HIGH | sec- |
| 4 | Models & Business Logic | HIGH | model- |
| 5 | Caching & Performance | HIGH | cache- |
| 6 | Views & Frontend | MEDIUM-HIGH | view- |
| 7 | API Design | MEDIUM | api- |
| 8 | Background Jobs & Async | LOW-MEDIUM | job- |
db-eager-load-associations - Eager load associations to eliminate N+1 queriesdb-add-database-indexes - Add database indexes on queried columnsdb-select-specific-columns - Select only needed columnsdb-batch-processing - Use find_each for large dataset iterationdb-avoid-queries-in-loops - Avoid database queries inside loopsdb-use-scopes - Define reusable query scopes on modelsdb-safe-migrations - Write reversible zero-downtime migrationsdb-exists-over-count - Use exists? instead of count for existence checksctrl-thin-controllers - Keep controllers thin by delegating to models and servicesctrl-strong-params - Always use strong parameters for mass assignmentctrl-restful-routes - Follow RESTful routing conventionsctrl-before-action-scoping - Scope before_action callbacks with only/exceptctrl-respond-to-format - Use respond_to for multi-format responsesctrl-rescue-from - Handle errors with rescue_from in controllerssec-parameterized-queries - Never interpolate user input in SQLsec-strong-params-whitelist - Whitelist permitted params, never blacklistsec-authenticate-before-authorize - Authenticate before authorize on every requestsec-csrf-protection - Enable CSRF protection for all form submissionssec-scope-queries-to-user - Scope queries to current user for authorizationmodel-validate-at-model-level - Validate data at the model levelmodel-avoid-callback-side-effects - Avoid side effects in model callbacksmodel-use-service-objects - Extract complex logic into service objectsmodel-scope-over-class-methods - Use scopes instead of class methods for query compositionmodel-use-enums - Use enums for finite state fieldsmodel-concerns-for-shared-behavior - Use concerns for shared model behaviormodel-query-objects - Extract complex queries into query objectscache-fragment-caching - Use fragment caching for expensive view partialscache-russian-doll - Use Russian doll caching for nested collectionscache-low-level - Use Rails.cache.fetch for computed datacache-counter-cache - Use counter caches for association countscache-conditional-get - Use conditional GET with stale? for HTTP cachingview-collection-rendering - Use collection rendering instead of loop partialsview-turbo-frames - Use Turbo Frames for partial page updatesview-turbo-streams - Use Turbo Streams for real-time page mutationsview-form-with - Use form_with instead of form_tag or form_forview-avoid-logic-in-views - Move display logic to helpers or presentersapi-serializers - Use serializers for consistent JSON responsesapi-pagination - Always paginate collection endpointsapi-versioning - Version APIs from day oneapi-error-responses - Return structured error responsesapi-avoid-jbuilder-hot-paths - Avoid Jbuilder on high-traffic endpointsjob-idempotent-design - Design jobs to be idempotentjob-small-payloads - Pass IDs to jobs, not serialized objectsjob-error-handling - Configure retry and error handling for jobsjob-unique-jobs - Prevent duplicate job enqueuingRead 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-1Delivers Ruby on Rails expertise: assesses projects, enforces conventions, optimizes ActiveRecord queries, implements Hotwire/Turbo/Stimulus, handles Sidekiq/Solid Queue jobs, and guides RSpec/FactoryBot testing.
Provides Ruby on Rails conventions, patterns, and best practices for ActiveRecord models, controllers, migrations, configuration, background jobs, logging, and request specs.
Applies 37signals Rails conventions: vanilla Rails, rich domain models, no service objects, Hotwire/Turbo, Solid Queue, CRUD controllers, custom auth, and Minitest.