Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Domain Modeling: Pragmatic DDD

    1

    Domain modeling is difficult to get right, often leading to a "big ball of mud" where business logic is scattered across controllers and database schemas.

    Free

    7 uses5.0 (1 review)
    Domain Modeling: Pragmatic DDD

    Domain Modeling: Pragmatic DDD

    Example session with this skill installed

    Help me model a digital library system where users can borrow books and handle late returns.

    • Read your context and instructions
    • Compiled the domain modeling

    I have analyzed the library domain, focusing on the core borrowing lifecycle and the distinction between inventory and cataloging.

    Domain Model: Digital Library

    Ubiquitous Language

    TermMeaningNot to be confused withExample
    PatronA registered user with borrowing privilegesStaff, GuestAlice (ID: 456)
    ExemplarA physical copy of a book in stockBook TitleCopy #12 of 'The Hobbit'
    LoanThe active period a Patron has an ExemplarReservationLoan #89, Due Oct 12

    Event Storming

    `Patron` ->
    
    **BorrowBook** -> `[Loan]` ->
    
    **BookBorrowed** -> `Policy: Update Inventory` ->
    
    **MarkAsUnavailable** -> `[Exemplar]` ->
    

    ExemplarUnavailable

    Bounded Contexts

    • Lending (Core): Manages loans, returns, and late fees.
    • Catalog (Supporting): Metadata about books (titles, authors).
    • Inventory (Generic): Tracks physical item locations and status.

    Aggregate: Loan

    • Root: Loan
    • Invariants: A patron cannot borrow more than 5 books; Due date must be in the future.
    • Commands: renew(), returnBook(), applyLateFee().
    • Value Objects: DateRange, Money (for fines).

    Implementation Skeleton

    // Domain Layer: Loan Aggregate
    class Loan {
      private constructor(
        private readonly id: string,
        private readonly patronId: string,
        private readonly exemplarId: string,
        private period: DateRange
      ) {}
    
      static create(patron: Patron, exemplar: Exemplar): Loan {
        if (!patron.canBorrow()) throw new Error("Borrowing limit reached");
        return new Loan(crypto.randomUUID(), patron.id, exemplar.id, DateRange.default());
      }
    
      returnBook(actualDate: Date): void {
        if (this.period.isOverdue(actualDate)) {
          // Emit LoanOverdue event
        }
      }
    }
    

    Next steps

    1. Define the FinePolicy for calculating late fees based on days overdue.
    2. Map the Loan aggregate to a single database collection to ensure atomic updates.
    3. Establish the Anti-Corruption Layer between Lending and the legacy Catalog API.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Domain modeling is difficult to get right, often leading to a "big ball of mud" where business logic is scattered across controllers and database schemas. This skill applies pragmatic Domain-Driven Design (DDD) to translate messy requirements into a structured, maintainable architecture before you write a single line of production code.

    What it does

    • Ubiquitous language construction creates a glossary to resolve synonyms and homonyms across the team.
    • Event storming maps the domain timeline from actor commands to events and subsequent policies.
    • Bounded context definition groups logic by language and ownership to prevent leaky abstractions.
    • Aggregate design identifies root entities and the specific invariants they must protect.
    • Visual modeling generates Mermaid diagrams for context maps and class relationships.
    • Code mapping provides a skeleton showing how to separate domain logic from framework and database code.

    How it works

    1. Discovery through targeted questions about actors, workflows, and business rules.
    2. Analysis of terms and events to establish the timeline and bounded contexts.
    3. Definition of aggregates, entities, and value objects with clear consistency boundaries.
    4. Implementation via a code skeleton and database strategy tailored to the model.

    Frameworks & tools

    This skill is language-agnostic but follows hexagonal or clean architecture patterns. It uses Mermaid for diagrams and provides implementation examples for any backend stack including Node.js, Go, Python, or Java.

    Why this beats prompting it yourself

    Generic prompts often produce shallow CRUD diagrams that ignore business invariants. This skill enforces strict DDD rules, such as referencing aggregates by ID and ensuring value objects are immutable, which prevents architectural technical debt.

    Use cases

    • Starting a new product module with complex business requirements.
    • Refactoring a monolithic codebase where naming is confusing and logic is duplicated.
    • Resolving conflicts between stakeholders who use the same word for different concepts.
    • Designing a microservices architecture based on logical bounded contexts.

    Known limitations

    The skill flags where full DDD is overkill and will suggest a simple CRUD approach for trivial domains. Diagrams are constrained to roughly 15 nodes for readability.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Mermaid diagrams are kept under 15 nodes for clarity. It will explicitly suggest skipping DDD for simple CRUD apps to avoid unnecessary boilerplate.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    5.0
    1 review
    5
    1
    4
    0
    3
    0
    2
    0
    1
    0

    This skill has been used 7 times.

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed7 days ago
    Updated5 days ago

    What's inside

    Frequently Asked Questions

    This skill prevents 'Big Ball of Mud' architectures by using Domain-Driven Design (DDD) to organize complex business logic into clear, isolated bounded contexts and aggregates before coding begins.

    The skill is platform-agnostic and works with any LLM-based agent that supports markdown text and Mermaid diagrams, such as ChatGPT, Claude, or custom IDE-based agents.

    You receive the core logic to perform Event Storming, a system to generate Ubiquitous Language glossaries, Mermaid visual modeling templates, and a strategy for generating DDD-compliant code skeletons.

    While it can model any system, the skill is optimized for backend architectures using Hexagonal or Clean Architecture patterns across Node.js, Go, Python, and Java.

    No, the skill includes a 'complexity check' that identifies trivial domains where standard CRUD is more efficient, ensuring you don't over-engineer simple features.

    This is a one-time purchase that includes lifetime access to the current version; major architectural methodology updates are typically released as versioned improvements to the skill.

    New in Agents & Orchestration

    Free