37signals-model

Build fat Rails models that encapsulate domain logic with concerns.

1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/joshyorko/agent-skills --skill 37signals-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 37signals-model
Source: https://github.com/joshyorko/agent-skills/tree/main/plugins/rails-37signals-patterns/skills/37signals-model
Command: npx skills add https://github.com/joshyorko/agent-skills --skill 37signals-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rails apps often end up with anemic models and scattered business logic in controllers or services. This skill guides building fat domain models that encapsulate business logic, validations, and domain behavior, organized with concerns for horizontal reuse.

Core Features & Use Cases

  • Fat models with business logic, validations, scopes, callbacks, and concerns to share behavior across models.
  • Clear patterns for associations, defaults via lambdas, and using Current for request-context data to support multi-tenant or per-user scenarios.
  • Practical structure and examples for typical domain modeling in Rails, including how to place logic where it belongs.

Quick Start

Create a new model that includes rich business logic, uses concerns to organize behavior, and defines validations, scopes, and callbacks.

Frequently Asked Questions about 37signals-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I move business logic out of Rails controllers and service objects into fat models?

Encapsulate business logic in fat Rails models by using concerns for horizontal reuse, validations, scopes, and callbacks to replace anemic models and scattered service objects.

What is the best way to organize shared behavior and domain logic across multiple Rails models?

Organize shared domain logic across Rails models using concerns, applying patterns for associations, default values via lambdas, and Current context for multi-tenant or per-user scenarios.

How do I set default values and handle request context in Rails domain models?

Set default values using lambdas and handle request context in Rails domain models by utilizing the Current object to support multi-tenant or per-user scenarios within callbacks.

When should I use fat models instead of service objects for complex Rails domain logic?

Use fat models instead of service objects when your Rails app needs complex domain logic, validations, scopes, and callbacks encapsulated directly in the model with concerns for reuse.

Does this approach to Rails domain modeling support bang methods for persistence?

Yes, building rich Rails domain models supports bang methods for persistence, enforcing fat-model patterns alongside validations, callbacks, and concerns to encapsulate business logic.