ddd-aggregate-modeling

ddd-aggregate-modeling is a skill for Claude Code, Codex from soulcodex/agentic. It costs 62 tokens per session (678 once invoked), scanned A, original, MIT.

A guide for designing domain models using domain-driven design, a way to structure software around the rules and concepts of a business area. It focuses on aggregate roots, child entities, value objects, invariants, and repository interfaces.

In plain words
What is it for?
It supports modeling or refactoring domain entities and aggregates, including boundaries, validation rules, snapshots, specifications, criteria, and repository contracts.
Why use it?
It helps decide which objects belong together, where business rules should be enforced, and what persistence code should expose.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/soulcodex/agentic/ddd-aggregate-modeling
Any agent
npx skills add soulcodex/agentic --skill ddd-aggregate-modeling
Clone the repo
git clone --depth 1 https://github.com/soulcodex/agentic

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ddd-aggregate-modeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/soulcodex/agentic/ddd-aggregate-modeling.svg)](https://agentmods.dev/skills/soulcodex/agentic/ddd-aggregate-modeling)
Your own site
<a href="https://agentmods.dev/skills/soulcodex/agentic/ddd-aggregate-modeling"><img src="https://agentmods.dev/badge/skills/soulcodex/agentic/ddd-aggregate-modeling.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 678 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.00678
Opus 5 $0.00031 $0.00339
Sonnet 5 $0.00012 $0.00136
Haiku 4.5 $0.00006 $0.00068

Measured 3d ago against content hash f1dfe2c3aff6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ddd-aggregate-modeling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/ddd-aggregate-modeling/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DDD Aggregate Modeling Skill

Step 1 - Define Context and Ubiquitous Language

  1. Identify the bounded context owning the behavior.
  2. Name entities, value objects, and commands using domain language.
  3. Reject generic names (Manager, Helper, Data) unless they are domain terms.

Step 2 - Choose the Aggregate Root

  1. Pick one root that owns consistency for the invariant set.
  2. Ensure external callers reference only root IDs, not child internals.
  3. Keep the aggregate small; if many transactions touch disjoint invariants, split aggregates.

Step 3 - Classify Members Correctly

Use this decision table:

Case Model as
Needs identity inside aggregate lifecycle Child Entity
Structural equality only, immutable meaning Value Object
External persistence detail Adapter DTO / Row Model (not domain)

Value object categories to model explicitly:

  • constrained strings (Email, Name, VatId)
  • bounded numbers/ranges (Lanes, Port, Quantity)
  • enumerations (Language, Role, SystemType)

Step 4 - Encode Invariants in Domain Behavior

  1. Validate on constructor/factory and on every mutating method.
  2. Keep aggregate state private; expose intent methods (Create, Update, Delete, Verify).
  3. Guard temporal ordering when needed (ignore/reject stale updates deterministically).
  4. Keep authorization outside entities; enforce in application handlers.

Step 5 - Model Snapshot/Primitives Boundaries

  1. Add explicit primitives/snapshot structures for adapter boundaries.
  2. Use ToPrimitives/Snapshot and FromPrimitives/RestoreFromSnapshot.
  3. Do not pass transport or ORM models directly into domain behavior.
  4. Keep mapping explicit; avoid reflection-based generic mappers.

Step 6 - Define Repository and Collection Contracts

  1. Define repository interfaces in domain/application, implementations in infrastructure.
  2. Split reader/writer contracts when beneficial.
  3. Return aggregates or domain collections, not adapter structs.
  4. Add domain collections when query semantics have domain meaning.

Read the full file on GitHub · 84 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 84 lines · 62 tokens per session scan A f1dfe2c3aff6

Subscribe to this mod's changes

ddd-aggregate-modeling is a skill published in the GitHub repository soulcodex/agentic (10 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 678 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

domain-modeling

DDD practical guide: Event Storming, Bounded Contexts, Aggregates and domain-driven design patterns.

camilooscargbaptista/cto-toolkit · 24 tokens

improve-codebase-architecture

Use when surfacing architectural friction inside a single EVOKORE bounded context and proposing deepening refactors (shallow modules, leaky seams, low locality) that turn shallow modules into deep ones — informed by ADR-0005 bounded contexts and the project's domain language.

mattmre/EVOKORE-MCP-PUBLIC · 61 tokens

ddd

领域驱动设计(DDD)建模与架构指导。用于创建领域模型、设计限界上下文、实现聚合根、实体、值对象、领域服务和领域事件。支持战略设计(上下文映射、子域划分)和战术设计(聚合、仓储、工厂模式)。当用户需要进行领域建模、微服务划分、复杂业务逻辑设计时使用。.

jackjin1997/ClawForge · 93 tokens

design-impact-reporting

Communicate design's contribution to business and user outcomes in stakeholder language. Use when reporting results upward. For choosing the metrics in the first place, use metrics-definition (ux-strategy).

Owl-Listener/designer-skills · 44 tokens

research-repository

Build a repository that makes findings findable, reusable, and cumulative across teams. Use when the same research keeps getting redone. For synthesising one study, use affinity-diagram.

Owl-Listener/designer-skills · 43 tokens

survey-design

Design unbiased survey instruments — question wording, scales, and sampling — to measure attitudes at scale. Use when you need quantitative breadth. For behavioural experiments, use a-b-test-design (prototyping-testing).

Owl-Listener/designer-skills · 47 tokens