37signals-concerns

Extract repeated model and controller logic into Rails concerns with ActiveSupport::Concern.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates and refactors model and controller concerns for shared behavior following 37signals patterns. Use when extracting shared code, organizing models with horizontal concerns, DRYing up controllers, or when user mentions concerns, mixins, modules, or shared behavior.

Core Features & Use Cases

  • Self-contained concerns that drive horizontal reuse across models and controllers.
  • Modular organization: extract repeated behavior into independent concerns for clean composition.
  • Example: turning common validation and scope logic into shared Card::Closeable or Card::Assignable patterns.
  • Patterns and recommendations for organizing Rails code with ActiveSupport::Concern and concerns.

Quick Start

Identify a duplicated behavior across models and move it into a self-contained concern, then include that concern in the relevant models.

Frequently Asked Questions about 37signals-concerns

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

FAQPage Schema
How do I extract shared validations and scopes into reusable Rails concerns?

To extract shared Rails logic into concerns, identify duplicated model or controller behavior such as validations and scopes, move it into a self-contained module using ActiveSupport::Concern, and include that concern in the relevant classes for clean horizontal composition.

What is the best way to organize shared controller logic in a Rails 8 application?

Organize shared controller logic in Rails 8 by extracting repeated behavior into self-contained concerns under app/controllers/concerns, using ActiveSupport::Concern to DRY up controllers and enable clean modular composition across your application.

When should I use ActiveSupport::Concern for code organization in Rails?

Use ActiveSupport::Concern for Rails code organization when multiple models or controllers share behavior like validations, associations, scopes, and callbacks, requiring extraction into cohesive horizontal modules for clean composition and reuse.

Does this approach to extracting concerns work with both Rails models and controllers?

Yes, extracting concerns works with both Rails models and controllers, organizing shared behavior under app/models/[model]/concerns and app/controllers/concerns respectively to drive horizontal reuse across your entire Rails 8+ application.

How do I refactor duplicated Rails model callbacks into a shared mixin?

Refactor duplicated Rails model callbacks into a shared mixin by moving the repeated callback logic into an independent concern using ActiveSupport::Concern, then including that concern in relevant models to achieve clean composition and horizontal reuse.

What are the limitations of using Rails concerns for shared behavior?

Rails concerns promote horizontal reuse but require careful organization to avoid tangled dependencies; concerns should remain self-contained and cohesive, documenting clear include points in SKILL.md to prevent complex interdependencies across models and controllers.