Agent skill

Rails Expert

by Jeffallan in Jeffallan/claude-skills

Builds Rails 7+ apps with Hotwire Turbo Frames and Streams, Active Record tuning, Action Cable, Sidekiq jobs and RSpec specs, with migration and N+1 checks.

MITAuto-check passedBackend & APIs

Install Rails Expert

skills CLI
$ npx skills add Jeffallan/claude-skills --skill rails-expert -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Jeffallan/claude-skills rails-expert --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Jeffallan/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/rails-expert .claude/skills/rails-expert && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rails-expert
GitHub stars
12k
Token cost
~1.4k tokens
SKILL.md length
319 words
Files
6 (incl. references)
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

Builds Rails 7+ apps with Hotwire Turbo Frames and Streams, Active Record tuning, Action Cable, Sidekiq jobs and RSpec specs, with migration and N+1 checks.

  • Works in 6 steps: Analyze requirements — Identify models,… → Scaffold resources — rails generate… → Run migrations — rails db:migrate and… → …
  • Building a Rails 7 app with Turbo Frames and Turbo Streams
  • SKILL.md covers Core Workflow, Reference Guide, Common Patterns and Constraints, plus 1 more section
  • Calls rails and bundle

What it does

The agent identifies models, routes, real-time needs and background jobs, scaffolds with rails generate, runs rails db:migrate and verifies the schema, then writes controllers and models and adds Hotwire. Validation needs bundle exec rspec to pass and bundle exec rubocop for style. Failure paths are spelled out: inspect db/schema.rb and roll back a failed migration, rerun specs in documentation format, and add includes or eager_load when N+1 queries appear. A final pass audits N+1 queries, missing indexes and caching.

Reference files cover Hotwire with Turbo Frames, Streams and Stimulus, Active Record associations and performance, Sidekiq job design, RSpec model, request and system specs with factories, and API-only mode with serialization and authentication. The patterns shown are N+1 prevention, a Turbo Frame partial update, a welcome email job and strong parameters in a controller.

When your agent uses it

  • Building a Rails 7 app with Turbo Frames and Turbo Streams
  • Fixing N+1 queries with includes or eager_load
  • Adding Sidekiq background jobs for email or other slow work
  • Setting up Action Cable for real-time updates
  • Writing RSpec model, request and system specs

Example prompts

  • “Generate a Post model and controller with an author association, then fix the N+1 on the index page.”
  • “Make the comments list update in place with a Turbo Frame when a new comment is posted.”
  • “Move the welcome email into a background job and cover it with an RSpec spec.”
  • “Run rubocop and rspec and fix whatever fails.”

Requirements

  • A Rails 7+ project with RSpec and RuboCop

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Analyze requirements — Identify models, routes, real-time needs, background jobs
  2. Scaffold resources — rails generate model User name:string email:string, rails generate controller Users
  3. Run migrations — rails db:migrate and verify schema with rails db:schema:dump
  4. Implement — Write controllers, models, add Hotwire (see Reference Guide below)
  5. Validate — bundle exec rspec must pass; bundle exec rubocop for style
  6. Optimize — Audit for N+1 queries, add missing indexes, add caching

What it can do on your machine

Read from SKILL.md and the folder at commit 1be15d8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • rails
    • bundle

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • synergetic.solutions
    • jeffallan.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rails Expert loads about 1.4k tokens when it runs, and up to ~9.8k if it reads all its reference files. Until then it costs about 130 tokens; SKILL.md has 319 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~130
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Jeffallan/claude-skills at commit 1be15d8, republished under its MIT licence (© Jeffallan). 319 words, ~1,416 tokens.

Download SKILL.mdSave it as .claude/skills/rails-expert/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
rails-expert
description
Rails 7+ specialist that optimizes Active Record queries with includes/eager_load, implements Turbo Frames and Turbo Streams for partial page updates, configures Action Cable for WebSocket connections, sets up Sidekiq workers for background job processing, and writes comprehensive RSpec test suites. Use when building Rails 7+ web applications with Hotwire, real-time features, or background job processing. Invoke for Active Record optimization, Turbo Frames/Streams, Action Cable, Sidekiq, RSpec Rails.
license
MIT
metadata.author
https://github.com/Jeffallan
metadata.company
https://synergetic.solutions
metadata.version
1.1.0
metadata.domain
backend
metadata.triggers
Rails, Ruby on Rails, Hotwire, Turbo Frames, Turbo Streams, Action Cable, Active Record, Sidekiq, RSpec Rails
metadata.role
specialist
metadata.scope
implementation
metadata.output-format
code
metadata.related-skills
fullstack-guardian, database-optimizer

Rails Expert

Core Workflow

  1. Analyze requirements — Identify models, routes, real-time needs, background jobs
  2. Scaffold resources — rails generate model User name:string email:string, rails generate controller Users
  3. Run migrations — rails db:migrate and verify schema with rails db:schema:dump
    • If migration fails: inspect db/schema.rb for conflicts, rollback with rails db:rollback, fix and retry
  4. Implement — Write controllers, models, add Hotwire (see Reference Guide below)
  5. Validate — bundle exec rspec must pass; bundle exec rubocop for style
    • If specs fail: check error output, fix failing examples, re-run with --format documentation for detail
    • If N+1 queries surface during review: add includes/eager_load (see Common Patterns) and re-run specs
  6. Optimize — Audit for N+1 queries, add missing indexes, add caching

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Hotwire/Turboreferences/hotwire-turbo.mdTurbo Frames, Streams, Stimulus controllers
Active Recordreferences/active-record.mdModels, associations, queries, performance
Background Jobsreferences/background-jobs.mdSidekiq, job design, queues, error handling
Testingreferences/rspec-testing.mdModel/request/system specs, factories
API Developmentreferences/api-development.mdAPI-only mode, serialization, authentication

Common Patterns

N+1 Prevention with includes/eager_load
ruby
# 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 })
Turbo Frame Setup (partial page update)
erb
<%# app/views/posts/index.html.erb %>
<%= turbo_frame_tag "posts" do %>
  <%= render @posts %>
  <%= link_to "Load More", posts_path(page: @next_page) %>
<% end %>

<%# app/views/posts/_post.html.erb %>
<%= turbo_frame_tag dom_id(post) do %>
  <h2><%= post.title %></h2>
  <%= link_to "Edit", edit_post_path(post) %>
<% end %>
ruby
# app/controllers/posts_controller.rb
def index
  @posts = Post.includes(:author).page(params[:page])
  @next_page = @posts.next_page
end
Sidekiq Worker Template
ruby
# app/jobs/send_welcome_email_job.rb
class SendWelcomeEmailJob < ApplicationJob
  queue_as :default
  sidekiq_options retry: 3, dead: false

  def perform(user_id)
    user = User.find(user_id)
    UserMailer.welcome(user).deliver_now
  rescue ActiveRecord::RecordNotFound => e
    Rails.logger.warn("SendWelcomeEmailJob: user #{user_id} not found — #{e.message}")
    # Do not re-raise; record is gone, no point retrying
  end
end

# Enqueue from controller or model callback
SendWelcomeEmailJob.perform_later(user.id)
Strong Parameters (controller template)
ruby
# app/controllers/posts_controller.rb
class PostsController < ApplicationController
  before_action :set_post, only: %i[show edit update destroy]

  def create
    @post = Post.new(post_params)
    if @post.save
      redirect_to @post, notice: "Post created."
    else
      render :new, status: :unprocessable_entity
    end
  end

  private

  def set_post
    @post = Post.find(params[:id])
  end

  def post_params
    params.require(:post).permit(:title, :body, :published_at)
  end
end

Constraints

MUST DO
  • Prevent N+1 queries with includes/eager_load on every collection query involving associations
  • Write comprehensive specs targeting >95% coverage
  • Use service objects for complex business logic; keep controllers thin
  • Add database indexes for every column used in WHERE, ORDER BY, or JOIN
  • Offload slow operations to Sidekiq — never run them synchronously in a request cycle
MUST NOT DO
  • Skip migrations for schema changes
  • Use raw SQL without sanitization (sanitize_sql or parameterized queries only)
  • Expose internal IDs in URLs without consideration

Output Templates

When implementing Rails features, provide:

  1. Migration file (if schema changes needed)
  2. Model file with associations and validations
  3. Controller with RESTful actions and strong parameters
  4. View files or Hotwire setup
  5. Spec files for models and requests
  6. Brief explanation of architectural decisions

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

© Jeffallan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/rails-expert of Jeffallan/claude-skills.

  • SKILL.md
  • references/active-record.md
  • references/api-development.md
  • references/background-jobs.md
  • references/hotwire-turbo.md
  • references/rspec-testing.md

Open the folder on GitHubat commit 1be15d8

Compare with similar skills

Rails Expert next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rails Expert compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rails Expert this skillJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
Rails Patternsaffaan-m/ECC276k—~4.1kAutomated safety check: PassMIT
Ruby Patternssoftspark/ai-toolkit179—~2.3kAutomated safety check: PassApache-2.0
Railsericrisco/rsc-harness174—~3.1kAutomated safety check: PassMIT
Ruby Rulessoftspark/ai-toolkit179—~3.4kAutomated safety check: PassApache-2.0
Rails Idiomsirahardianto/awesome-agv157—~1.8kAutomated safety check: PassMIT

Similar skills

  • Rails Patterns

    affaan-m/ECC

    Ruby on Rails framework patterns for Rails 7.1+ and 8.x apps.

    276k GitHub stars~4.1k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Ruby Patterns

    softspark/ai-toolkit

    Ruby/Rails: blocks, metaprogramming, ActiveRecord, Sidekiq, RSpec, Sorbet, Hanami.

    179 GitHub stars~2.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Rails

    ericrisco/rsc-harness

    A skill your agent uses when building or maintaining a Ruby on Rails app — models, controllers, views, routes and migrations; ActiveRecord associations, scopes and query performance; Hotwire (Turbo…

    174 GitHub stars~3.1k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Ruby Rules

    softspark/ai-toolkit

    Ruby coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~3.4k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Rails Idioms

    irahardianto/awesome-agv

    Ruby on Rails framework patterns: ActiveRecord scopes, N+1 query prevention, model validations, RESTful routing, and RSpec/Minitest testing.

    157 GitHub stars~1.8k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Ruby

    ericrisco/rsc-harness

    A skill your agent uses when writing or refactoring plain Ruby outside Rails — scripts, CLIs, gems, libraries: Enumerable chains and blocks, module mixins and value objects, Bundler/gemspec…

    174 GitHub stars~3.2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from Jeffallan/claude-skills

All 58 skills in this repo
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Pandas Pro

    Jeffallan/claude-skills

    Handles pandas DataFrame work: cleaning, merging, groupby aggregation, pivots, time-series resampling and memory tuning, with checks on dtypes, shapes and nulls.

    12k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Apache Spark Engineer

    Jeffallan/claude-skills

    Guides writing and tuning Apache Spark jobs: DataFrame and RDD code, Spark SQL, partitioning, caching, shuffle tuning and structured streaming.

    12k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed

Categories

Questions about Rails Expert

What does Rails Expert do?

Builds Rails 7+ apps with Hotwire Turbo Frames and Streams, Active Record tuning, Action Cable, Sidekiq jobs and RSpec specs, with migration and N+1 checks. The agent identifies models, routes, real-time needs and background jobs, scaffolds with rails generate, runs rails db:migrate and verifies the schema, then writes controllers and models and adds Hotwire. Validation needs bundle exec rspec to pass and bundle exec rubocop for style.

When should I use Rails Expert?

Rails Expert fits situations like: building a Rails 7 app with Turbo Frames and Turbo Streams; fixing N+1 queries with includes or eager_load; adding Sidekiq background jobs for email or other slow work; setting up Action Cable for real-time updates.

How do I install Rails Expert in Claude Code?

Run `npx skills add Jeffallan/claude-skills --skill rails-expert -a claude-code`. Or copy the skill folder (skills/rails-expert in Jeffallan/claude-skills) into .claude/skills/rails-expert in your project. Claude Code loads it when a task matches its description.

How do I install Rails Expert in Codex?

Run `npx skills add Jeffallan/claude-skills --skill rails-expert -a codex`. Or copy the skill folder (skills/rails-expert in Jeffallan/claude-skills) into .agents/skills/rails-expert in your project. Codex loads it when a task matches its description.

Can I use Rails Expert in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Jeffallan/claude-skills --skill rails-expert -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rails-expert, .gemini/skills/rails-expert, .github/skills/rails-expert and .opencode/skills/rails-expert in your project.

What does Rails Expert need to run?

Going by SKILL.md and its folder, Rails Expert needs the command-line tools its instructions call (rails and bundle). Our summary lists: A Rails 7+ project with RSpec and RuboCop.

Does Rails Expert access the network?

SKILL.md names 3 domains. As links in the text: github.com, synergetic.solutions and jeffallan.github.io. This is read from the text; nothing was executed.

Is Rails Expert safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Rails Expert use?

Rails Expert is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rails Expert use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.4k tokens, read only when the agent opens those files.

What are the alternatives to Rails Expert?

Skills that share tags, products or a category with Rails Expert: Rails Patterns (affaan-m/ECC, 276k stars), Ruby Patterns (softspark/ai-toolkit, 179 stars), Rails (ericrisco/rsc-harness, 174 stars) and Ruby Rules (softspark/ai-toolkit, 179 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rails Expert?

Jeffallan (a GitHub user) maintains it in Jeffallan/claude-skills, which has 11,788 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 3, 2026.

Source: Jeffallan/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.