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.mdsource 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
in all filesfrozen_string_literal: true - 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
with string columnsActiveRecord::Enum - Use
for authenticationhas_secure_password - Use
for background processing with Sidekiq/Solid QueueActiveJob
Models
- Use validations on every model
- Use
for reusable queriesscope - Use
for performancecounter_cache - Use
/includes
to avoid N+1 (usepreload
gem in dev)bullet - Use database-level constraints alongside model validations
- Use
for safe schema changesstrong_migrations
Controllers
- Keep controllers thin — delegate to services
- Use
for auth and setupbefore_action - Use strong parameters for every create/update
- Use
blocks for multi-format responsesrespond_to - Use Turbo Streams for real-time updates
Security
- Never interpolate user input into SQL — use parameterized queries
- Use
headersContent-Security-Policy - Use
for static security analysisbrakeman
Testing
- Use RSpec with
,factory_bot
,shoulda-matchersfaker - Use
specs for API,request
specs for E2Esystem - Use
orVCR
for external HTTP mockingwebmock - Test models, services, and requests separately