ruby-rails_skill

This skill helps you develop Rails 8 and Ruby 3.2 APIs, models, and services with best practices, tests, and performance.
  • Shell

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill racar/racar_agent_skills --skill ruby-rails

  • SKILL.md13.0 KB

Overview

This skill provides practical guidance and patterns for building Ruby on Rails 8 applications using Ruby 3.2. It focuses on backend concerns: ActiveRecord models, controllers, migrations, background jobs, serializers, service objects, and RSpec testing. Use it to enforce Rails conventions, improve performance, and follow a test-and-lint workflow that includes running RSpec before RuboCop.

How this skill works

The skill inspects Rails-specific code patterns such as controllers, models, migrations, jobs, concerns, serializers, and configuration files. It recommends idiomatic implementations (thin controllers, service objects, serializers), highlights common pitfalls (N+1 queries, callback hell), and prescribes testing and linting steps to ensure quality. It also suggests Rails 8 features like Solid Queue/Cache/Cable and Propshaft where relevant.

When to use it

  • When building or refactoring Rails 8 APIs or server-rendered apps using Ruby 3.2
  • When writing ActiveRecord models, database migrations, or complex queries
  • When extracting business logic into service objects or background jobs
  • When creating serializers and API response formats for JSON endpoints
  • When writing RSpec tests and enforcing RuboCop rules before committing

Best practices

  • Keep methods short (prefer < 10 lines) and controllers thin; push logic to services or models
  • Use change in migrations when reversible; add indexes and set DB-level defaults/null constraints
  • Eager-load associations to avoid N+1 queries and add indexes for frequently queried columns
  • Run the test suite first (RSpec) and then run RuboCop; fix offenses before committing
  • Use strong parameters, database validations, and transactions for multi-step operations

Example use cases

  • Implementing a RESTful OrdersController that delegates creation to a service object
  • Writing a migration that adds a status column with default and index
  • Creating an OrderSerializer to standardize JSON payloads for an API
  • Moving a complex callback workflow into an Orders::CreateService with RSpec coverage
  • Configuring Solid Queue for background job processing and writing job specs

FAQ

Always run RSpec first. After tests pass, run RuboCop and resolve any offenses before committing.

When should I use a service object?

Use service objects for multi-model operations, complex business logic, external API calls, or workflows that require explicit steps and error handling.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
ruby-rails skill by racar/racar_agent_skills | VeilStrat