Home › Ruby on Rails › Ruby on Rails Copilot instructions
Ruby on Rails Copilot instructions
GitHub Copilot custom instructions for Rails 8 apps with Hotwire, RSpec and Rubocop.
GitHub CopilotRuby on Rails
How to use
Save this as .github/copilot-instructions.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.
.github/copilot-instructions.mdDownload # 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.