Stop fighting AI in your Rails apps.
Production-tested Cursor rules that make AI finally understand Rails 8, Hotwire, and ActiveRecord. Drop into any project in 5 minutes.
// Building in public // Launching Q3 2026 // Be the first to know
---
description: Hotwire patterns for Rails 8
globs:
- app/views/**/*.turbo_stream.erb
- app/javascript/controllers/**
---
# Hotwire First, Always
Never suggest React, Vue, or fetch() for UI
interactions. Use Turbo Frames for partial
page updates, Turbo Streams for real-time
broadcasting, and Stimulus for JS sprinkles.
## Turbo Frames Pattern
<turbo-frame id="post_123">
<%= render @post %>
</turbo-frame>You know the feeling.
AI writes raw SQL
Cursor generates SELECT statements when ActiveRecord scopes would do the same in 2 lines. You rewrite, again.
N+1 queries everywhere
Every loop fetches associated records one by one. The AI doesn't know about includes/preload/eager_load. Your app crawls.
Hotwire? Never heard of her
Cursor suggests fetch() and React when Turbo Streams + Stimulus would ship in 30% of the code. You patch it manually.
What's inside the pack
Rules organized across 10 categories, covering the patterns AI gets wrong most often.
ActiveRecord & Database
- Scope composition over raw SQL
- N+1 prevention patterns
- Counter caches when needed
- Proper migration naming
Hotwire & Frontend
- Turbo Frame lazy loading
- Turbo Stream CRUD patterns
- Stimulus controller naming
- No-build JS with importmaps
Rails 8 Conventions
- Built-in auth (no Devise)
- Solid Queue for background jobs
- Solid Cache configuration
- Kamal deployment patterns
Testing & Quality
- System tests with Capybara
- Factory patterns over fixtures
- Request specs for APIs
- VCR for external services
Architecture
- Service objects when needed
- Form objects for complex forms
- Query objects for reports
- No business logic in controllers
API & JSON
- Jbuilder over to_json
- API versioning patterns
- Proper error responses
- Token auth without gems
Background Jobs
- Solid Queue best practices
- Sidekiq configuration
- GoodJob patterns
- Retry strategies & error handling
Performance
- Fragment & Russian doll caching
- Database indexing strategies
- Profiling with rack-mini-profiler
- Memory analysis patterns
Security
- CSRF protection patterns
- SQL injection prevention
- Mass assignment guards
- Secrets & credentials management
API Mode
- JSON serializers (Alba, jsonapi-serializer)
- API versioning patterns
- JWT auth with has_secure_token
- Error handling & status codes
// 10 modules, organized by .cursor/rules/*.mdc, growing as Rails evolves
Real before/after coming soon
I'm building in public — every rule comes with a real screen recording showing Cursor's output before and after. First demos shipping with the launch.
Follow along on X (@railsaipack) →
Why I'm building this
I've been writing Rails for 3 years and using Cursor every day for the past 8 months. Same frustration every day: AI writes code that looks plausible but ignores 80% of Rails conventions.
Service objects in controllers. Raw SQL instead of scopes. fetch() instead of Turbo Streams. Devise suggestions when Rails 8 has built-in auth.
So I started collecting .cursor/rules/*.mdc files for my own projects. Over time, the collection covered every painful Rails-AI gap I kept hitting.
Now I'm building it in public. Follow along on X (@railsaipack) for weekly progress updates, or join the waitlist below to get notified on launch day.
— Audrius, Vilnius
Follow build updates @railsaipackJoin the waitlist
Get notified when Rails AI Pack launches. Waitlist members get 50% off.
We'll send 1-2 emails total: launch announcement + early access link. No spam, unsubscribe anytime.
Pricing
Final pricing announced at launch.
Waitlist members get 50% off launch price + early access.
Join the waitlist →// Currently in development // No pre-orders accepted