m09-domain

Community

Design robust C++ domain models

Author13eholder
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps avoid common domain-design mistakes in C++ such as confusing identity with value, accidentally enabling object slicing, exposing implementation details in headers, and allowing invalid object states through public fields.

Core Features & Use Cases

  • Clear Value vs Entity guidance: Decide when a type should be a copyable value object versus a non-copyable entity identified by an ID.
  • Ownership and Aggregates: Advice on owning children with unique_ptr or vectors and defining aggregate roots.
  • APIs and Encapsulation: Recommendations for enforcing invariants via private data and public methods, using Pimpl to reduce header coupling, and using strong typed IDs instead of raw integers.
  • Use Case: Design a User aggregate that holds Value Objects for Name and Address, uses a strong UserId, deletes copy operations on the Entity, and exposes repository interfaces for persistence.

Quick Start

Design a User type by making the ID a strong type, treating Name and Address as value objects, deleting the User copy constructor while allowing move, encapsulating invariants in private members exposed through methods, and owning child entities with unique_ptr.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: m09-domain
Download link: https://github.com/13eholder/Modern-Cpp-Skills/archive/main.zip#m09-domain

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.