RA

rails-domain-architecture

Guides the design of model-centric Rails backends.

Install

mkdir -p .claude/skills/rails-domain-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13124" && unzip -o skill.zip -d .claude/skills/rails-domain-architecture && rm skill.zip

Installs to .claude/skills/rails-domain-architecture

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Design or refactor the backend side of Ruby on Rails codebases toward a model-centric architecture that keeps domain logic, associations, scopes, callbacks, state transitions, and test ownership close to the owning models. Use when planning backend file layout, deciding between models, concerns, and query objects, organizing scopes, extracting capabilities into app/models/<model>/, designing request boundaries, or building reusable backend testing strategies for rich Rails domains. Do not use this skill for React or other frontend UI work; use `frontend-architecture` instead.
582 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • →Choose the request boundary and access-scoped entry relation
  • →Keep the base model file short as the composition root
  • →Put associations, scopes, callbacks, predicates, and commands in app/models/<model>/<capability>.rb
  • →Use app/models/concerns only for behavior reused across multiple models
  • →Keep controllers thin by loading starting relation and composing named scopes
  • →Keep tests aligned with ownership at the domain or request seam

How it works

The skill applies a set of architectural rules to organize Rails domain logic, keeping models rich and controllers thin, and aligning tests with ownership.

Inputs & outputs

You give it
Ruby on Rails codebase or design problem
You get back
Proposed file placement, organized domain logic, and testing strategies

When to use rails-domain-architecture

  • →Refactoring Rails models
  • →Organizing business logic
  • →Planning backend architecture

About rails-domain-architecture

Helps organize Rails domain logic into model-specific files, keeping controllers thin. It enforces patterns for associations, scopes, and commands while strictly separating UI concerns.

Design or refactor the backend side of Ruby on Rails codebases toward a model-centric architecture that keeps domain logic, associations, scopes, callbacks, state transitions, and test ownership close to the owning models. Use when planning backend file layout, deciding between models, concerns, and

When not to use it

  • →When working on React or other frontend UI
  • →When the change is frontend UI work
  • →When the project conventions are weak or mixed legacy placement

Limitations

  • →The skill is not for React or other frontend UI work
  • →The skill recommends using app/models/concerns only for behavior reused across multiple models
  • →The skill introduces query objects only when the query becomes a first-class subsystem

How it compares

This skill provides a model-centric approach to Rails architecture, explicitly separating domain logic from UI concerns and promoting clear ownership, unlike a generic Rails development approach.

Compared to similar skills

rails-domain-architecture side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
rails-domain-architecture (this skill)05moNo flagsAdvanced
skill-rails-upgrade16moReviewIntermediate
rails-expert07moNo flagsAdvanced
rails-testing111moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry