ddd-rails-modeling

Map domain concepts to Rails structures with Rails-first modeling guidance.

22|6|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/igmarin/rails-agent-skills --skill ddd-rails-modeling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-rails-modeling
Source: https://github.com/igmarin/rails-agent-skills/tree/main/ddd-rails-modeling
Command: npx skills add https://github.com/igmarin/rails-agent-skills --skill ddd-rails-modeling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rails projects often struggle to map domain concepts to Rails structures without fighting Rails conventions or over-engineering. This skill provides a Rails-first approach to modeling entities, value objects, aggregates, domain services, and domain events in a way that respects Rails defaults while preserving clear domain boundaries.

Core Features & Use Cases

  • Rails-first mapping guidance: align domain concepts with appropriate Rails homes (models, services, policies) to keep code expressive and maintainable.
  • Invariant-driven design: prioritize domain invariants and ownership, guiding when to introduce boundary objects like services or repositories.
  • Integration planning: outlines a pragmatic sequence from domain concepts to implementation, tests, and documentation.

Quick Start

Identify the domain concepts and map them to Rails structures following the Rails-first guidance provided herein.

Frequently Asked Questions about ddd-rails-modeling

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

FAQPage Schema
How do I model domain-driven design concepts in Rails without fighting conventions?

Rails-first DDD modeling maps domain language to appropriate Rails structures like ActiveRecord models, value objects, and services. It aligns domain concepts with Rails defaults to keep code expressive while preserving clear domain boundaries.

When should I use a domain service vs an ActiveRecord model in Rails?

Use a domain service in Rails when a feature has clear domain language but modeling choices are ambiguous. Rails-first DDD modeling prioritizes domain invariants and ownership, guiding whether to introduce boundary objects like services or repositories over ActiveRecord models.

What's the best way to implement aggregates and value objects in a Rails application?

Implement aggregates and value objects by mapping domain concepts to Rails structures that respect Rails defaults. Rails-first DDD modeling enforces recommended homes for these structures, ensuring invariants are protected without over-engineering the application.

Can I apply domain-driven design boundaries in Rails without over-engineering?

Yes, Rails-first DDD modeling applies when a Rails feature has clear domain language but ambiguous modeling choices. It enforces Rails-first mapping and invariant-driven design to introduce boundaries pragmatically, avoiding unnecessary complexity.

How does Rails-first DDD modeling integrate with testing workflows?

Rails-first DDD modeling outlines a pragmatic integration sequence from domain concepts to implementation, tests, and documentation. It enforces integration with design gates and testing workflows to ensure domain boundaries are maintained throughout development.

Why does my Rails domain logic keep bleeding into controllers and models?

Domain logic bleeds when domain concepts lack clear boundaries. Rails-first DDD modeling enforces invariant-driven design and recommended homes, guiding when to use services, policies, or repositories to isolate domain ownership properly.