# Copilot instructions — Rails app

This is a Rails 8 app using Hotwire (Turbo + Stimulus), PostgreSQL, Solid Queue, and RSpec.

- Follow Rails conventions over configuration. Prefer built-in Rails features before adding gems.
- Keep controllers skinny: strong params, one model call, respond. Put business logic in models or `app/services/*` POROs.
- Use Turbo Frames/Streams for interactivity; write Stimulus controllers for small JS behavior. No React.
- Avoid N+1 queries: use `includes` and check with Bullet in development.
- Every migration must be reversible; add DB-level constraints and indexes alongside validations.
- Background work goes in Active Job classes in `app/jobs`.
- Tests: RSpec request specs for endpoints, model specs for logic, FactoryBot for data. System specs for critical flows.
- Style: Rubocop (rails-omakase). Run `bin/rubocop -a` and `bundle exec rspec` before proposing changes.
