Skill

Develop Robust Ruby on Rails Applications

Rails Developer skill provides guidelines for Ruby on Rails development using SQLite3, Hotwire (Turbo and Stimulus), Tailwind CSS, and Solid libraries

Works with railssqlite3hotwirestimulusturbo

Maintainer of this project? Claim this page to edit the listing.


79
Spark score
out of 100
Updated 7 months ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Leverage expert Ruby on Rails development skills to build efficient, maintainable, and scalable web applications. This asset adheres to best practices for code quality, performance, and security.

Outcomes

What it gets done

01

Generate idiomatic Ruby on Rails code following MVC conventions.

02

Implement dynamic UIs with Hotwire (Turbo/Stimulus) and Tailwind CSS.

03

Optimize database interactions and implement caching strategies.

04

Write comprehensive tests and ensure secure coding practices.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-rails-developer | bash

Overview

Rails Developer

Provides Ruby on Rails development guidelines covering Rails 8 conventions, SQLite3, Hotwire, Tailwind CSS, and Solid libraries For Rails projects using SQLite3, SolidQueue, SolidCable, SolidCache, and minimizing JavaScript with Turbo Streams

What it does

This skill provides guidelines for Ruby on Rails development with a focus on Rails 8 conventions and a modern stack. It covers stack preferences including SQLite3 as the database, Hotwire for dynamic interactions, Tailwind CSS for styling, and the Solid suite (SolidQueue for queues, SolidCable for WebSockets, SolidCache for caching). The guidelines emphasize minimizing unnecessary JavaScript in favor of Rails 8 Turbo Streams, writing concise idiomatic Ruby code, and following Rails conventions and best practices.

When to use - and when NOT to

Use this skill for Ruby on Rails development projects using SQLite3 as the preferred database and the Solid libraries for infrastructure concerns. The guidelines cover background job processing with SolidQueue for long tasks such as external API accessing (like Stripe API sync), real-time features via SolidCable WebSockets, and caching with SolidCache for loading potentially frequently accessed views or partials. The skill covers RESTful routing conventions, MVC structure, concerns for shared behavior, service objects for complex business logic, and background jobs for time-consuming tasks.

Do NOT use this skill if your project requires Redis, Sidekiq, or relies heavily on JavaScript - the guidelines explicitly avoid unnecessary JavaScript and prefer Rails alternatives. Do NOT use it for non-Rails Ruby projects or applications that need databases other than SQLite3 as the preferred data store.

Inputs and outputs

You provide development requirements, feature descriptions, or architectural questions for a Rails application. The guidelines cover stack preferences: SQLite3 database, Hotwire (Turbo and Stimulus), Tailwind CSS, SolidQueue for queues, SolidCable for WebSockets, and SolidCache for caching.

The guidelines specify code style conventions including snake_case for file names, method names, and variables; CamelCase for class and module names; and Rails naming conventions for models, controllers, and views. They cover ActiveRecord for database operations, ActiveModel validations in models, strong parameters in controllers, Rails view helpers and partials, and Stimulus for client-side behavior. Error handling guidelines include using exceptions for exceptional cases (not control flow), proper error logging, graceful error handling in controllers with flash messages, and security measures including authentication (rails g authentication), authorization, and protection against XSS, CSRF, and SQL injection. Performance optimization guidelines include database indexing, caching strategies (fragment caching, Russian Doll caching), eager loading to avoid N+1 queries using includes, joins, or select, service objects for complex business logic, and background jobs for time-consuming tasks.

Integrations

The skill covers Ruby on Rails (with Ruby 3.x features), SQLite3 database, Hotwire including Turbo and Stimulus, Tailwind CSS, SolidQueue for background job processing, SolidCable for WebSocket connections, and SolidCache for caching views and partials. It references the Ruby Style Guide for formatting and the official Ruby on Rails guides for best practices in routing, controllers, models, views, and other Rails components.

Who it's for

This skill serves developers working on Ruby on Rails projects who want guidelines for using SQLite3, the Solid suite of libraries, and Rails 8 conventions. It fits those adopting SQLite3 as the preferred database, migrating away from Redis and Sidekiq to Rails alternatives, and preferring to avoid unnecessary JavaScript in favor of Turbo Streams. It benefits developers seeking to follow Ruby 3.x features (pattern matching, endless methods), implement object-oriented and functional programming patterns as appropriate, and structure applications according to Rails conventions including MVC, concerns, and helpers.

Source README

You are an expert in Ruby on Rails, SQLite3, Hotwire (Turbo and Stimulus), and Tailwind CSS.

When developing Ruby on Rails apps, follow these guidelines:

Stack Preferences

  • Avoid unnecessary JavaScript, use Ruby on Rails 8 Turbo Streams
  • Preferred database is SQLite3
  • Use SolidQueue for queues, no Sidekiq or Redis
  • Use these queues for long tasks, such as external API accessing (i.e. Stripe API sync)
  • Use SolidCable for WebSockets
  • Use SolidCache for loading potentially frequently accessed views or partials

Code Style and Structure

  • Write concise, idiomatic Ruby code with accurate examples
  • Follow Rails conventions and best practices
  • Use object-oriented and functional programming patterns as appropriate
  • Prefer iteration and modularization over code duplication
  • Use descriptive variable and method names (e.g., user_signed_in?, calculate_total)
  • Structure files according to Rails conventions (MVC, concerns, helpers, etc.)

Naming Conventions

  • Use snake_case for file names, method names, and variables
  • Use CamelCase for class and module names
  • Follow Rails naming conventions for models, controllers, and views

Ruby and Rails Usage

  • Use Ruby 3.x features when appropriate (e.g., pattern matching, endless methods)
  • Leverage Rails' built-in helpers and methods
  • Use ActiveRecord effectively for database operations

Syntax and Formatting

  • Follow the Ruby Style Guide
  • Use Ruby's expressive syntax (e.g., unless, ||=, &.)
  • Prefer single quotes for strings unless interpolation is needed

Error Handling and Validation

  • Use exceptions for exceptional cases, not for control flow
  • Implement proper error logging and user-friendly messages
  • Use ActiveModel validations in models
  • Handle errors gracefully in controllers and display appropriate flash messages

UI and Styling

  • Use Hotwire (Turbo and Stimulus) for dynamic, SPA-like interactions
  • Implement responsive design with Tailwind CSS
  • Use Rails view helpers and partials to keep views DRY

Performance Optimization

  • Use database indexing effectively
  • Implement caching strategies (fragment caching, Russian Doll caching)
  • Use eager loading to avoid N+1 queries
  • Optimize database queries using includes, joins, or select

Key Conventions

  • Follow RESTful routing conventions
  • Use concerns for shared behavior across models or controllers
  • Implement service objects for complex business logic
  • Use background jobs for time-consuming tasks

Security

  • Implement proper authentication and authorization (rails g authentication)
  • Use strong parameters in controllers
  • Protect against common web vulnerabilities (XSS, CSRF, SQL injection)

Follow the official Ruby on Rails guides for best practices in routing, controllers, models, views, and other Rails components.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.