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.

Related rules

Angular 20 Copilot instructions

Copilot instructions for Angular 20 apps using standalone components, signals, and the new control flow.

GitHub CopilotAngular

Code review Copilot instructions

Copilot instructions focused on pull request review: what to flag, severity labels, and how to word comments.

GitHub CopilotAgent workflows

C# / .NET Copilot path instructions

Path-specific Copilot instructions for C# files on .NET 10: nullable types, async, records, and logging.

GitHub Copilot.NET / ASP.NET Core

Dockerfile Copilot path instructions

Path-specific Copilot instructions for Dockerfiles and compose files: multi-stage builds, non-root, and pinned images.

GitHub CopilotDocker

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.