Agent skill

Rails

by ericrisco in 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…

MITAuto-check passedBackend & APIs

Install Rails

skills CLI
$ npx skills add ericrisco/rsc-harness --skill rails -a claude-code

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

GitHub CLI
$ gh skill install ericrisco/rsc-harness rails --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/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/rails .claude/skills/rails && 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
GitHub stars
167
Token cost
~3.1k tokens
SKILL.md length
1,211 words
Files
7 (incl. scripts, references)
Skills in repo
227
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Maintaining a Ruby on Rails app — models
  • SKILL.md covers Target versions, When to use, When NOT to use and The request cycle — where…, plus 6 more sections
  • Runs Shell scripts from its folder; calls rails
  • Routes and migrations

What it does

Rails is an agent skill from ericrisco/rsc-harness. Use when building or maintaining a Ruby on Rails app — models, controllers, views, routes and migrations; ActiveRecord associations, scopes and query performance; Hotwire (Turbo and Stimulus) UI; Active Job or Solid Queue background work; and Rails tests. Covers N+1 queries, migration safety on live tables, and flaky system tests around Turbo Frames. NOT plain Ruby scripts, gems or CLIs with no Rails loaded (that is ruby).

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/activerecord.md`).

It sits in Backend & APIs, covering Backend development and ORMs and data access. It works with Ruby on Rails, Ruby and Redis. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Maintaining a Ruby on Rails app — models
  • Routes and migrations
  • ActiveRecord associations
  • Scopes and query performance

Example prompts

  • “/rails”

Requirements

  • A Bash shell
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit e3d5b33. 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

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • rails

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

  • Network

    No URLs in SKILL.md.

    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 loads about 3.1k tokens when it runs, and up to ~6k if it reads all its reference files. Until then it costs about 109 tokens; SKILL.md has 1,211 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit e3d5b33, republished under its MIT licence (© ericrisco). 1,211 words, ~3,085 tokens.

Download SKILL.mdSave it as .claude/skills/rails/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
rails
description
Use when building or maintaining a Ruby on Rails app — models, controllers, views, routes and migrations; ActiveRecord associations, scopes and query performance; Hotwire (Turbo and Stimulus) UI; Active Job or Solid Queue background work; and Rails tests. Covers N+1 queries, migration safety on live tables, and flaky system tests around Turbo Frames. NOT plain Ruby scripts, gems or CLIs with no Rails loaded (that is `ruby`).
tags
rails, activerecord, hotwire, turbo, stimulus, solid-queue, minitest
recommends
ruby, postgresdb, testing-web, deployment, db-migrations
origin
risco

Build Rails the omakase way

Write Rails the way a core-adjacent senior would: fat-enough models, skinny controllers, zero N+1, strong parameters, migrations that are reversible and safe on a live table, and tests that exercise the request rather than the implementation. Lean into the Rails 8 "omakase" defaults instead of fighting them — the framework already made the boring choices for you.

This is Rails the framework: the MVC request cycle, ActiveRecord, Hotwire, Active Job, the Rails test stack. The moment code stops loading Rails — a plain script, a gem, an Enumerable refactor with no ActiveRecord in sight — it is no longer this skill. That is ruby (see ../ruby/SKILL.md).

Target versions

text
Rails        8.1   (stable line, released 2025-10-22; 8.0 shipped 2024-11-07)
Ruby         3.4+  (floor for current Rails)
Jobs/queue   Solid Queue   (default Active Job backend — database-backed, no Redis)
Cache        Solid Cache   (default cache store — database-backed)
WebSockets   Solid Cable   (default Action Cable adapter — database-backed)
Assets       Propshaft     (default; Sprockets is legacy)
JS           Importmaps    (default; no Node build step required)
Deploy       Kamal 2 + Thruster
Front-end    Hotwire = Turbo 8 + Stimulus
Auth         `rails generate authentication`  (built in; no Devise for basic auth)

A fresh Rails 8 app needs no Redis and no Node. Stop reaching for Sidekiq/Redis or a JS bundler by reflex — the Solid trifecta and Importmaps already cover the default case. Rails 8.1 adds Active Job Continuations (resumable long jobs), Structured Event Reporting, local CI via config/ci.rb, and Markdown rendering.

When to use

  • Generating/editing anything under app/ (models, controllers, views, jobs, mailers, channels), config/routes.rb, or db/migrate/.
  • ActiveRecord work: associations, scopes, validations, callbacks, includes/preload/ eager_load, query objects, migrations.
  • Hotwire UI: Turbo Frames/Streams, morphing, Stimulus controllers, broadcasts.
  • Background work via Active Job / Solid Queue; fragment caching via Solid Cache.
  • Rails testing: Minitest model/integration/system tests, fixtures, RSpec + Capybara, debugging flaky Turbo system tests.
  • Upgrading a Rails app or migrating off Redis/Sidekiq onto the Solid stack.

When NOT to use

  • Plain Ruby with no Rails loaded — scripts, gems, CLIs, Bundler packaging → ruby.
  • PHP/Laravel → laravel. Python/Django → django. (Route by the language/framework the file actually uses.)
  • Pure engine-level schema/index/locking depth not expressed as an AR migration → postgresdb / mysql / db-migrations.
  • Host/container/CI provisioning (Kamal host setup, Docker, runners) → deployment / docker / github-actions. This skill writes the Rails-side glue, then hands off.

The request cycle — where logic lives

Route → controller → model → view. Keep each layer doing one job.

  • Controllers stay skinny. A controller action finds/builds objects, calls one domain method, and renders/redirects. Why: a controller fat with business rules is untestable except through the full HTTP stack and impossible to reuse.
  • Domain logic lives on the model. Validations, scopes, state transitions, and computed attributes belong on the AR class. Why: that is where the data and its invariants already are.
  • Extract a PORO/service object only when a method spans 2+ models or does external IO (payment, email, third-party API). Don't pre-extract — a one-model method is just a model method. Why: premature service objects scatter logic that AR would hold fine.
ruby
# Good: skinny controller, domain logic on the model.
class PostsController < ApplicationController
  def create
    @post = Current.user.posts.build(post_params)
    if @post.publish   # model method owns the rule
      redirect_to @post, notice: "Published"
    else
      render :new, status: :unprocessable_entity
    end
  end

  private

  def post_params
    params.expect(post: [:title, :body])   # Rails 8 strong params
  end
end

ActiveRecord

Associations, validations, and scopes are the vocabulary — use them before writing raw SQL or manual loops.

ruby
class Post < ApplicationRecord
  belongs_to :author, class_name: "User"
  has_many :comments, dependent: :destroy

  validates :title, presence: true, length: { maximum: 120 }
  scope :published, -> { where.not(published_at: nil) }

  def publish
    update(published_at: Time.current)
  end
end

Kill N+1 with eager loading. The classic footgun is touching an association inside a loop, firing one query per row.

ruby
# Bad: 1 query for posts + 1 per post for its author (N+1).
Post.published.each { |p| puts p.author.name }

# Good: 2 queries total — posts, then all authors in one IN(...).
Post.published.includes(:author).each { |p| puts p.author.name }

Gate it: add the bullet gem in development, or mark a hot association strict_loading so an accidental lazy load raises instead of silently degrading.

Migrations must be reversible and safe on a live table. A migration that locks a large table blocks every reader and writer for its duration.

ruby
# Good: a Postgres index built without an exclusive table lock.
class AddIndexToPostsOnAuthor < ActiveRecord::Migration[8.1]
  disable_ddl_transaction!   # required — concurrent index can't run in a txn
  def change
    add_index :posts, :author_id, algorithm: :concurrently
  end
end

Rules: never add_column ..., default: on a huge legacy table without checking your Rails/Postgres version handles it without a full rewrite; backfill data in batches with find_each or update_all, not one giant UPDATE in the migration; add the strong_migrations gem so unsafe operations fail in review, not in production.

Deeper AR — query objects, strict_loading, counter caches, composite primary keys, advisory locks, per-operation safe-migration recipes (add column, rename, backfill in batches) — is in references/activerecord.md.

Hotwire

Hotwire is the default front-end: Turbo for navigation/updates, Stimulus for behavior. Reach for the lightest tool that does the job.

NeedUseWhy
Faster full-page navigation, no codeTurbo Drive (on by default)Free; intercepts links/forms
Replace one bounded region after an actionTurbo FrameScoped DOM swap, no JS
Update several elements / push from serverTurbo StreamTargeted append/replace/remove + broadcasts
Re-render a whole page and keep scroll/focusMorphing (Turbo 8)Diffs the DOM; kills most custom Stream choreography
Client behavior (toggle, copy, debounce)Stimulus controllerSprinkle, not a SPA

Default to Turbo Drive and morphing; only hand-write a Turbo Stream when you need to touch elements that morphing can't infer (e.g. prepend to a list from a broadcast).

javascript
// app/javascript/controllers/clipboard_controller.js
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  static targets = ["source"]
  static values = { successText: { type: String, default: "Copied!" } }

  copy() {
    navigator.clipboard.writeText(this.sourceTarget.value)
  }
}

Worked Frame/Stream/morph examples, model broadcasting (broadcasts_to), Stimulus values/targets/outlets, and how to system-test Turbo are in references/hotwire.md.

Show full SKILL.md (507 more words)Show less

Background jobs & caching

Use Active Job over Solid Queue (the Rails 8 default). Two non-negotiable rules:

  • Jobs take serializable arguments — pass IDs, not records. Why: a serialized AR object goes stale between enqueue and run; an ID is re-fetched fresh.
  • Jobs must be idempotent. Why: retries and at-least-once delivery mean a job can run twice; design so the second run is a no-op.
ruby
class CommentNotificationJob < ApplicationJob
  queue_as :default

  def perform(comment_id)
    comment = Comment.find_by(id: comment_id)
    return unless comment   # idempotent: nothing to do if it's gone
    CommentMailer.posted(comment).deliver_now
  end
end

For genuinely long work (large backfills, bulk exports) use Active Job Continuations (Rails 8.1) so a job can checkpoint and resume instead of restarting from zero. Cache expensive view fragments with the cache helper backed by Solid Cache:

erb
<% cache @post do %>
  <%= render @post.comments %>
<% end %>

Do not add Sidekiq/Redis to a Rails 8 app unless a real, stated throughput or latency requirement justifies the extra moving part. Solid Queue covers the default case on the database you already run.

Testing

Minitest + fixtures is the framework default; parallel execution is on by default. RSpec-rails (8.x) is the popular alternative. Pick one and exercise behavior through the request, never private methods.

Test typeBase classTests
Model / unitActiveSupport::TestCasevalidations, scopes, domain methods
IntegrationActionDispatch::IntegrationTesta request → response, status, redirects
System (browser)ApplicationSystemTestCaseend-to-end UI incl. Turbo/Stimulus
JobActiveJob::TestCaseenqueue + perform behavior

Fixtures (default) are fast and load once; reach for factories (FactoryBot) only when per-test object variation gets unwieldy. Flaky Turbo system test? It's almost always a timing race: never sleep. Use Capybara's auto-waiting matchers (assert_selector, assert_text, assert_no_selector) which retry until the DOM settles, and swap the default Selenium driver for Cuprite or Playwright to cut Turbo-timing flake.

Minitest vs RSpec layout, fixtures gotchas, driver config, parallelization, and request-spec / broadcast-testing patterns are in references/testing.md.

Anti-patterns

Anti-patternWhy it bitesDo instead
Business logic in the controllerUntestable except through HTTP; not reusablePush it onto the model; service object only for cross-model/IO
Callback soup (after_save chains for business rules)Hidden order-dependent side effects, brutal to testExplicit method called from the action; reserve callbacks for data hygiene
Touching an association in a loopN+1 — one query per row, silent in devincludes/preload/eager_load; gate with bullet/strict_loading
Blocking DDL on a big live tableLocks readers + writers for the whole migrationdisable_ddl_transaction! + algorithm: :concurrently; strong_migrations
Passing AR records into jobsStale serialized state; fails on retryPass IDs, re-find inside perform
Adding Sidekiq/Redis to a Rails 8 app by reflexA new daemon + dependency for nothingSolid Queue is the default; add Sidekiq only for a stated need
Queries or business logic in viewsN+1 + logic you can't testPrepare in controller/model; views only render
Testing private methodsLocks tests to internals; refactors break green testsTest observable behavior through the request
Hand-rolled fetch/JS for live updatesReinvents what Turbo gives freeTurbo Stream or morphing

Verify

Run scripts/verify.sh inside a Rails app for a read-only static gate: it runs RuboCop (if rubocop-rails is configured) and bin/rails zeitwerk:check, and greps for the statically-detectable anti-patterns above (Sidekiq/Redis in a default app, .all.each mass loads, a concurrent add_index missing disable_ddl_transaction!). It skips any check whose tooling is absent and exits non-zero only on a hard violation.

© ericrisco, 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 6 other files (scripts, references) in skills/rails of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/activerecord.md
  • references/hotwire.md
  • references/testing.md
  • scripts/verify.sh

Open the folder on GitHubat commit e3d5b33

Compare with similar skills

Rails 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 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rails this skillericrisco/rsc-harness167—~3.1kAutomated safety check: PassMIT
Ruby Patternssoftspark/ai-toolkit179—~2.3kAutomated safety check: PassApache-2.0
Ruby Rulessoftspark/ai-toolkit179—~3.4kAutomated safety check: PassApache-2.0
Rails ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
Rails Patternsaffaan-m/ECC275k—~4.1kAutomated safety check: PassMIT
Rails Idiomsirahardianto/awesome-agv157—~1.8kAutomated safety check: PassMIT

Similar skills

  • 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
  • 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 Expert

    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.

    12k GitHub stars~1.4k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Rails Patterns

    affaan-m/ECC

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

    275k GitHub stars~4.1k tokensUpdated 3 days ago
    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 3 days ago
    Backend & APIsAuto-check passed
  • Django Q2

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when adding, changing, testing, or debugging Django Q2 background tasks, scheduled jobs, qcluster workers, Redis broker configuration, or ORM broker fallback in Django…

    1.2k GitHub stars~1.7k tokensUpdated today
    Backend & APIsAuto-check passed

More from ericrisco/rsc-harness

All 227 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    167 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    167 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    167 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    167 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    167 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    167 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Questions about Rails

What does Rails do?

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…. Rails is an agent skill from ericrisco/rsc-harness. Use when building or maintaining a Ruby on Rails app — models, controllers, views, routes and migrations; ActiveRecord associations, scopes and query performance; Hotwire (Turbo and Stimulus) UI; Active Job or Solid Queue background work; and Rails tests.

When should I use Rails?

Rails fits situations like: maintaining a Ruby on Rails app — models; routes and migrations; activeRecord associations; scopes and query performance.

How do I install Rails in Claude Code?

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

How do I install Rails in Codex?

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

Can I use Rails 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 ericrisco/rsc-harness --skill rails -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, .gemini/skills/rails, .github/skills/rails and .opencode/skills/rails in your project.

What does Rails need to run?

Going by SKILL.md and its folder, Rails needs a shell for the scripts in its folder and the command-line tools its instructions call (rails). Our summary lists: A Bash shell; Docker.

Does Rails access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rails 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Rails use?

Rails is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rails use?

About 3.1k tokens (SKILL.md is roughly 12k 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 3k tokens, read only when the agent opens those files.

What are the alternatives to Rails?

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

Who maintains Rails?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 167 GitHub stars. The repository holds 227 skills in this directory. The repository was last updated on October 7, 2026.

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