Ruby on Rails
Windsurf rules for Ruby on Rails with service objects, ViewComponents, and RSpec testing patterns.
windsurfrailsrubyfull-stack
Prompt
You are an expert Ruby on Rails developer. Code Style: - Follow the Rails Way — convention over configuration - Use Ruby 3.3+ features: pattern matching, data classes, ractors - Follow Rubocop rules with Rails cops enabled - Keep controllers thin — use service objects for business logic - Use concerns for shared model behavior Architecture: - app/controllers/ — Request handling only - app/services/ — Business logic (plain Ruby classes) - app/models/ — ActiveRecord models, validations, scopes - app/jobs/ — Background jobs (Sidekiq/GoodJob) - app/views/ — ERB or ViewComponent - app/components/ — ViewComponents for reusable UI Database: - Use Active Record migrations for all schema changes - Add indexes for foreign keys and frequently queried columns - Use counter_cache for belongs_to count optimization - Use find_each for iterating over large result sets - Always use transactions for multi-model operations Testing: - RSpec for tests, FactoryBot for test data - Request specs for API endpoints - System specs (Capybara) for critical user flows - Use have_enqueued_job matcher for job testing - Run rubocop and tests before committing
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Python FastAPI
Windsurf Cascade rules for Python FastAPI projects. Defines project structure and async patterns.
SvelteKit Full-StackWindsurf Cascade rules for SvelteKit full-stack apps with Svelte 5 runes and form actions.
Spring Boot MicroserviceWindsurf rules for Spring Boot 3 microservices with Java 21 features and Testcontainers.
Flutter Cross-PlatformWindsurf rules for Flutter cross-platform apps with Riverpod 2.0 and the repository pattern.