- Home
- Skills
- Jeffallan
- Claude Skills
- Rails Expert
rails-expert_skill
- HTML
110
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill jeffallan/claude-skills --skill rails-expert- SKILL.md3.6 KB
Overview
This skill is a senior Rails expert tailored for Rails 7+ applications, Hotwire/Turbo-driven UIs, real-time features, and background job processing. I guide architecture, code patterns, and implementation steps that follow Rails conventions and prioritize maintainability and developer velocity. Expect pragmatic recommendations, code templates, and test-first guidance to ship reliable features quickly.
How this skill works
I analyze requirements to identify models, routes, real-time needs, and background work, then propose a convention-driven architecture (MVC, service objects, and clear responsibilities). I supply migration, model, controller, view/Hotwire, Sidekiq job, and spec templates as needed, plus optimization steps to prevent N+1 queries and tune performance. I also provide testing strategies (RSpec, FactoryBot, system specs) and deployment-friendly practices for secure, scalable apps.
When to use it
- Building or refactoring Rails 7+ apps that use Hotwire/Turbo for reactive UIs
- Adding real-time features with Action Cable or streaming updates via Turbo Streams
- Designing and implementing background processing with Sidekiq and reliable retry/queue strategies
- Optimizing Active Record queries, fixing N+1s, and adding appropriate indexes
- Creating comprehensive RSpec suites, system tests, and deterministic factories
Best practices
- Follow Rails conventions: RESTful routes, resourceful controllers, and thin controllers with service objects
- Prevent N+1 queries via includes/eager_load and add indexes for queried columns
- Use strong parameters, validations, and proper error handling; never store sensitive data unencrypted
- Use Sidekiq for slow tasks and keep jobs idempotent; avoid synchronous operations for long work
- Write high-coverage specs (models, requests, system) and use factories and Capybara for integration tests
Example use cases
- Implementing a Turbo-ified comments section that updates via Turbo Streams when new comments are created
- Adding an Action Cable chat channel with UI driven by Stimulus controllers and Turbo Frames
- Designing a Sidekiq job pipeline for sending emails, with retry handling and dead job monitoring
- Refactoring a slow endpoint: add includes to fix N+1s, add DB indexes, and add request specs to prevent regressions
- Scaffolding a new resource with migration, model validations, controller, Hotwire views, and accompanying specs
FAQ
Yes. I provide migration, model, controller, Hotwire view or Stimulus snippets, Sidekiq job templates, and RSpec examples tailored to the feature.
How do you prevent N+1 queries?
I identify problematic associations, recommend and add includes/eager_load where appropriate, suggest counter caches or batch queries, and ensure necessary DB indexes are present.