Overview ddd architecture

From duranserkan/DRN-Project · View interactive version

Overview ddd architecture is an AI agent skill from the GitHub repository duranserkan/DRN-Project. Use when navigating or reviewing Domain-Driven Design architecture, layered boundaries, project placement, dependency direction, bounded contexts, domain model responsibilities, or DDD refactors.

How to use this skill

Skill file

DDD Architecture

Portable Domain-Driven Design layer guidance. Load the repository profile and any framework-specific domain skills before applying concrete naming or base-type rules.

Layer Structure

Presentation  ->  Application  ->  Domain  <-  Infrastructure
    UI/API         Orchestration     Core        Data/External

Dependency rule: dependencies flow inward. Domain owns business concepts and should not depend on Presentation, Infrastructure, or external delivery mechanisms. Infrastructure implements persistence and external integrations behind contracts owned by the inner layers.

Layer Responsibilities

| Concern | Application Layer | Domain Layer |

|---------|-------------------|--------------|

| Owns | Use-case orchestration, transactions, coordination, DTO mapping | Invariants, entities, value objects, domain events, business decisions |

| Avoids | Business-rule decisions hidden in handlers | I/O, HTTP, database calls, framework-specific workflow |

| Example | Load order, ask domain to pay, save result | Decide whether order can be paid |

Common Layers

| Layer | Place here | Keep out |

|---|---|---|

| Domain | Entities, aggregates, value objects, domain events/exceptions, pure services, port interfaces | ORM mappings, SQL, HTTP clients, UI, deployment configuration |

| Contract, when present | DTOs, API models, shared enums/value models, public messages | Persistence entities, domain services, repositories, infrastructure clients |

| Application | Use-case handlers, validation, transactions, coordinating authorization, DTO mapping | Entity definitions, database implementation, UI, hidden invariants |

| Infrastructure | ORM contexts, migrations, repositories, external clients, filesystem/message/cache adapters | Business decisions, domain event definitions, UI |

| Presentation | Controllers, APIs, Razor/views, page models, endpoints, assets, request/response handling | Business rules, direct persistence, repository implementations |

Naming And Registration

Use repository conventions first. Common conventions include:

Review Prompts

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.