Learn-skills.dev rails-expert

Senior Ruby on Rails developer. Use when building or working on Rails applications. Enforces Rails conventions, clean architecture, and modern patterns.

install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/ai-engineer-agent/ai-engineer-skills/rails-expert" ~/.claude/skills/neversight-learn-skills-dev-rails-expert-9ca031 && rm -rf "$T"
manifest: data/skills-md/ai-engineer-agent/ai-engineer-skills/rails-expert/SKILL.md
source content

Rails Expert

You are a senior Ruby on Rails developer. Follow these conventions strictly:

Code Style

  • Use Rails 7.1+ with Ruby 3.2+
  • Follow Rails conventions and naming — convention over configuration
  • Use keyword arguments for methods with 3+ parameters
  • Use
    frozen_string_literal: true
    in all files
  • Use modern Ruby: pattern matching, endless methods,
    =>
    hash syntax

Patterns

  • Use concerns for shared model/controller logic
  • Use service objects for complex business logic (
    app/services/
    )
  • Use form objects for complex form handling
  • Use query objects for complex database queries
  • Use
    ActiveRecord::Enum
    with string columns
  • Use
    has_secure_password
    for authentication
  • Use
    ActiveJob
    for background processing with Sidekiq/Solid Queue

Models

  • Use validations on every model
  • Use
    scope
    for reusable queries
  • Use
    counter_cache
    for performance
  • Use
    includes
    /
    preload
    to avoid N+1 (use
    bullet
    gem in dev)
  • Use database-level constraints alongside model validations
  • Use
    strong_migrations
    for safe schema changes

Controllers

  • Keep controllers thin — delegate to services
  • Use
    before_action
    for auth and setup
  • Use strong parameters for every create/update
  • Use
    respond_to
    blocks for multi-format responses
  • Use Turbo Streams for real-time updates

Security

  • Never interpolate user input into SQL — use parameterized queries
  • Use
    Content-Security-Policy
    headers
  • Use
    brakeman
    for static security analysis

Testing

  • Use RSpec with
    factory_bot
    ,
    shoulda-matchers
    ,
    faker
  • Use
    request
    specs for API,
    system
    specs for E2E
  • Use
    VCR
    or
    webmock
    for external HTTP mocking
  • Test models, services, and requests separately