
M09 Domain
Domain modeling guide mapping DDD concepts to Rust patterns, ownership, and invariant enforcement.
- skills.sh installs
- 3.6K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers how to choose between Entity and Value Object, and where aggregate boundaries belong
- Includes a concept-to-Rust mapping table, a three-question thinking prompt, and templates for Value Object, Entity, and Aggregate
- Enforces validated constructors and private fields so that domain invariants cannot be bypassed
- Designed for Rust developers who want domain rules expressed in types and ownership, with links to related skills
Install
$ npx -y skills add actionbook/rust-skills --skill m09-domain -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Domain Modeling
Layer 2: Design Choices
Core Question
What is this concept's role in the domain?
Before modeling in code, understand:
- Is it an Entity (identity matters) or Value Object (interchangeable)?
- What invariants must be maintained?
- Where are the aggregate boundaries?
Domain Concept → Rust Pattern
| Domain Concept | Rust Pattern | Ownership Implication |
|---|---|---|
| Entity | struct + Id | Owned, unique identity |
| Value Object | struct + Clone/Copy | Shareable, immutable |
| Aggregate Root | struct owns children | Clear ownership tree |
| Repository | trait | Abstracts persistence |
| Domain Event | enum | Captures state changes |
| Service | impl block / free fn | Stateless operations |
Thinking Prompt
Before creating a domain type:
-
What's the concept's identity?
- Needs unique identity → Entity (Id field)
- Interchangeable by value → Value Object (Clone/Copy)
-
What invariants must hold?
- Always valid → private fields + validated constructor
- Transition rules → type state pattern
Details
- Repository
- github.com/actionbook/rust-skills
- Categories
- Rust, Backend & APIs
- First seen
- May 16, 2026
More from actionbook/rust-skills
All 38- M14 Mental Model3.6K
- M13 Domain Error3.6K
- M11 Ecosystem3.6K
- Unsafe Checker3.6K
- Rust Code Navigator3.6K
- Rust Trait Explorer3.5K
- Rust Call Graph3.5K
- Rust Symbol Analyzer3.5K
- Domain Web3.5K
- Domain Cli3.5K
- Rust Learner3.4K
- Rust Skill Creator3.4K
- Rust Deps Visualizer3.3K
- Meta Cognition Parallel3.3K
- Rust Daily3.3K
- Domain Embedded3.2K
- Domain Cloud Native3.2K
- Domain Fintech3.1K
- Domain Ml3.1K
- Domain Iot3K
- Rust Router3K
- Core Agent Browser2.3K
- Core Dynamic Skills2.1K
- Core Actionbook2.1K
Similar to M09 Domain
More Rust
m05-type-drivenactionbook/rust-skills3.7K installsRust type-driven design patterns that make invalid states unrepresentable at compile time.
ddd-tactical-patternssickn33/agentic-awesome-skills143 installsConcrete guidance for modeling domain rules in code with entities, value objects, aggregates, repositories, and domain events.
domain-driven-designyonatangross/orchestkit1.3K installsTactical DDD patterns for rich domain models, with Python dataclass implementations and TypeScript alternatives.
m01-ownershipactionbook/rust-skills3.7K installsRust ownership and lifetime error guide that maps compiler codes to design questions before quick fixes.
dotnet-domain-modelingwshaddix/dotnet-skills539 installsTactical DDD patterns in C# for pure domain models, covering aggregates, value objects, and domain events.