Guide · Agent skill
How to use the Rails Expert agent skill: setup, triggers and examples
Updated · written with AI from the project's own documentation and checked against our catalogue data
The rails-expert skill is a bundle of Ruby on Rails 7+ guidance and code templates that an AI agent loads when you work on a Rails app. It is written for Rails developers who want the agent to follow a consistent workflow for Active Record queries, Hotwire, Action Cable, Sidekiq and RSpec. After this guide you will know what the skill changes, how to install it, how to phrase requests so it triggers, and what your project needs before you use it.
Quick start
- 1Download the ZIP. Download the rails-expert ZIP from this page.
- 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use or into your project's .claude/skills/ folder.
- 3Or upload in the Claude apps. In the Claude apps, open Settings → Capabilities → Skills and upload the ZIP.
- 4Check project requirements. Confirm you have a Rails 7+ project, Ruby, Bundler, rspec-rails and Sidekiq if you need background jobs.
- 5Ask a specific Rails task. Describe the model, page or job in plain terms and name the technology, such as Turbo Frames or Sidekiq.
- 6Review the output. Read migrations and generated code, then run bundle exec rspec and bundle exec rubocop.
What agent skills are and what rails-expert changes
An agent skill is a folder with a SKILL.md file and optional reference files that an agent can load when a task matches the skill's description. The rails-expert skill does not add a new tool to the agent. It changes how the agent writes Rails code.
The skill covers five areas: fixing slow database queries caused by N+1 problems with includes and eager_load, building partial page updates with Turbo Frames and Turbo Streams, configuring Action Cable for WebSocket connections, setting up Sidekiq workers for background jobs, and writing RSpec test suites.
- Active Record: associations, queries and performance (references/active-record.md)
- Hotwire/Turbo: Frames, Streams and Stimulus controllers (references/hotwire-turbo.md)
- Background jobs: Sidekiq setup, job design, queues and error handling (references/background-jobs.md)
- Testing: model, request and system specs, factories (references/rspec-testing.md)
- API development: API-only mode, serialization and authentication (references/api-development.md)
Install the rails-expert skill
Download the ZIP for rails-expert from this page and unzip it. You have two options for where the skill folder goes. For a personal install available to all your projects, unzip it into ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder.
If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the ZIP there.
- Personal install: ~/.claude/skills/
- Project install: .claude/skills/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Trigger the skill with natural requests
You do not need a special command. The skill's description lists the topics it covers, so ask for the task in plain Rails terms. Naming the technology helps, for example Turbo Frames, Sidekiq or RSpec Rails.
The source lists these trigger words: Rails, Ruby on Rails, Hotwire, Turbo Frames, Turbo Streams, Action Cable, Active Record, Sidekiq and RSpec Rails.
- "This index page runs one query per post to get the author. Fix the N+1 with includes."
- "Add a Turbo Frame so the comments list updates without a full page reload."
- "Set up an Action Cable channel for live notifications."
- "Move the welcome email into a Sidekiq job."
- "Write RSpec request specs for the posts controller."
Example: fixing an N+1 query
The skill's main pattern compares a query that triggers N+1 with one that eager loads the association. Use includes when you only need the associated records. Use eager_load when you filter on the association, because it forces a JOIN.
# BAD — triggers N+1
posts = Post.all
posts.each { |post| puts post.author.name }
# GOOD — eager load association
posts = Post.includes(:author).all
posts.each { |post| puts post.author.name }
# GOOD — eager_load forces a JOIN (useful when filtering on association)
posts = Post.eager_load(:author).where(authors: { verified: true })What your project needs before you start
The skill assumes a Ruby on Rails 7+ project. Commands in the workflow use bundle exec rspec and bundle exec rubocop, so you need Ruby, Bundler and the rspec-rails gem. The background job examples need Sidekiq, and the database must be one that Rails migrations support.
The skill's Core Workflow runs commands such as rails db:migrate and rails db:schema:dump, so the project must be set up to run them.
- Ruby on Rails 7+ project
- Ruby and Bundler
- rspec-rails gem
- Sidekiq for background job examples
- A database supported by Rails migrations
Safety notes: migrations, scripts and network
The workflow runs migrations and generates code. If it is pointed at the wrong environment, it can alter a live database. Review every migration and generated file before you run it against anything other than a development database, and do not treat production changes as unreviewed.
According to the skill's metadata, it runs no scripts and makes no network calls. Its bundled files are guidance and code templates.
- Review generated migrations before running rails db:migrate on a shared or live database.
- Check the target environment before running commands.
- Treat the templates as starting points and read them against your existing code.
Tips for better results
Give the agent your model names, associations and the query or page that is slow. The skill's workflow starts by identifying models, routes, real-time needs and background jobs, so the more context you give, the fewer questions it has to ask.
If specs fail, the skill's workflow says to check the error output, fix the failing examples and re-run with --format documentation for more detail.
- Name the models and associations involved.
- Say whether the change must update live without a page reload, which points the agent to Turbo or Action Cable.
- Ask for the spec files alongside the code, as the skill's output templates include them.
bundle exec rspec --format documentationWhat people use it for
- Find and fix N+1 queries on a list page by adding includes or eager_load.
- Add a Turbo Frame so one section of a page updates without a full reload.
- Set up an Action Cable channel for live updates.
- Move slow email or report work into a Sidekiq job with retries.
- Write RSpec model and request specs for an existing Rails controller.
Frequently asked questions
How do I install the rails-expert skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.
What do I need to use rails-expert?
You need a Ruby on Rails 7+ project, Ruby, Bundler and the rspec-rails gem. Sidekiq is needed for the background job examples, and the database must be supported by Rails migrations.
Is rails-expert free to use?
The skill is listed under the MIT licence in its SKILL.md. The source does not state any price, so check the licence text in the repository for the terms.
Does rails-expert work with non-Rails projects?
No. The guidance is specific to Rails 7+ and Ruby, and the source warns that it gives wrong framework advice for other projects. Use a different skill for non-Rails code.
Does the skill run scripts or access the network?
According to the listing, it runs no scripts and uses no network. It is mostly guidance and code templates that the agent loads as needed.
Can rails-expert change my production database?
It can, if pointed at the wrong environment, because its workflow runs migrations and generates code. Review every migration and run changes against development first.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use rails-expert if you build Rails 7+ apps with Hotwire, real-time features or Sidekiq jobs and want consistent, idiomatic code with RSpec coverage. Pick something else if your project is not Rails, or if you need an agent to run changes against production without review.
Download the skill