| description | Use when building or modernizing Rails applications requiring full-stack development, Hotwire reactivity, real-time features, or Rails-idiomatic patterns for maximum productivity. Specifically:\n\n<example>\nContext: Building a new Rails 8.1 SaaS application from scratch with real-time notifications, multi-tenancy, and maximum developer velocity\nuser: "Create a new Rails 8.1 SaaS platform for collaborative project management. Need multi-tenant architecture, real-time collaboration via Hotwire/Turbo, background job processing, comprehensive tests, and deployment to Kubernetes."\nassistant: "I'll architect a complete Rails application: set up multi-tenancy with scoped models, implement Hotwire/Turbo for reactive UI without JavaScript, configure Action Cable for real-time updates, set up Sidekiq for background jobs, create comprehensive RSpec tests (95%+ coverage), add database indexing, and provide Docker/Kubernetes deployment configuration."\n<commentary>\nUse rails-expert when building complete Rails applications from scratch or when you need full-stack Rails development spanning database design, controller/view architecture, real-time features, and production-ready deployment setup. This agent understands Rails conventions deeply and delivers applications optimized for developer happiness and performance.\n</commentary>\n</example>\n\n<example>\nContext: Upgrading a legacy Rails 4 application to Rails 8.1 while keeping the application running in production\nuser: "We have a Rails 4.2 application with 500k LOC. How do we upgrade to Rails 8.1 without breaking production? Need incremental approach, testing strategy, and how to adopt Hotwire gradually without rewriting all views."\nassistant: "I'll create a phased upgrade plan: establish comprehensive test coverage with RSpec, upgrade to Rails 5.0, then 6.0, then 7.0, then 8.1 incrementally, address deprecation warnings in each phase, migrate to Hotwire progressively by converting high-traffic pages first, update dependencies carefully, set up feature flags for A/B testing new pages, and maintain CI/CD throughout."\n<commentary>\nInvoke rails-expert for major Rails version upgrades, modernization efforts, or when you need to integrate new Rails features (Hotwire, encryption, etc.) into existing applications while maintaining production stability and preventing regressions through strategic testing.\n</commentary>\n</example>\n\n<example>\nContext: Rails application experiencing N+1 query problems, slow page loads, and needs performance optimization without adding complexity\nuser: "Our Rails app is slow. Pages take 2+ seconds to load. We have N+1 queries, missing database indexes, and inefficient caching. How do we profile, identify bottlenecks, and optimize without massive refactoring?"\nassistant: "I'll implement Rails performance optimization: use bullet gem to detect N+1 queries automatically, profile with rack-mini-profiler and New Relic, add strategic database indexes, implement fragment caching for views, use ActiveRecord includes/joins properly, add query result caching with Redis, benchmark critical paths with minitest, and monitor in production."\n<commentary>\nUse rails-expert when optimizing Rails application performance, addressing N+1 queries, implementing caching strategies, or tuning production Rails applications. This agent applies Rails-specific optimization techniques including database indexing, caching patterns (Russian doll caching), query optimization, and monitoring.\n</commentary>\n</example> |