rails-contexts

Use when deciding where business logic belongs in Rails: controllers, services, forms, queries, policies, serializers, and mounted Grape APIs.

slbug/claude-ruby-grape-rails2 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: rails-contexts
description: Use when deciding where business logic belongs in Rails: controllers, services, forms, queries, policies, serializers, and mounted Grape APIs.
license: MIT
---

# Rails Contexts

## Iron Laws

1. Controllers translate HTTP; they do not own business rules.
2. Model callbacks should not silently trigger external side effects.
3. Policy and authorization checks must be explicit at boundaries.
4. Service, query, and form objects should clarify ownership, not add ceremony for its own sake.

## Good Rails Boundaries

- controller or endpoint for transport concerns
- application service or command for workflow orchestration
- query object when a query grows beyond a scope or two
- policy object for authorization rules
- job only for deferred or async work

More Backend Frameworks skills

← All Backend Frameworks skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY