domain-driven-design-expert
Skill75 starsChanged 38 days agoMITView on GitHub
Expert guide for Domain-Driven Design (DDD). Covers tactical patterns (Aggregates, Value Objects), strategic patterns (Bounded Contexts), event storming, and CQRS / Panduan ahli Desain Berbasis Domain (DDD).
In this repository149 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/vibes-plug-core.mdcCursor rule
- accessibility-testing-expertSkill
- adaptive-model-cascadeSkill
- affective-computing-emotion-aiSkill
- agentic-coding-workflow-expertSkill
- agentic-memory-architectSkill
- agentic-micro-economy-architectSkill
- ai-code-review-autonomousSkill
- ai-llm-integration-expertSkill
- ai-media-generation-expertSkill
- ai-prompt-engineering-expertSkill
- ai-safety-governance-expertSkill
- angular-expertSkill
- anti-slopSkill
- api-design-expertSkill
- api-gateway-proxy-expertSkill
- app-analyzer-optimizerSkill
- apple-ecosystem-expertSkill
- app-promo-media-expertSkill
- astro-framework-expertSkill
- async-queue-temporal-expertSkill
- authentication-identity-expertSkill
- autonomous-api-drift-healerSkill
- autonomous-red-teamerSkill
- autonomous-tdd-debuggerSkill
- biome-linter-formatter-expertSkill
- blockchain-web3-expertSkill
- brainstormingSkill
- browser-automation-expertSkill
- bun-runtime-expertSkill
- chatbot-messaging-expertSkill
- ci-cd-devops-architectSkill
- cloud-hosting-expertSkill
- coderabbitSkill
- compliance-gdpr-privacy-expertSkill
- composable-mach-architectSkill
- context-window-engineerSkill
- cron-scheduler-expertSkill
- database-orm-expertSkill
- data-pipeline-etl-expertSkill
- data-telemetry-expertSkill
- data-visualization-expertSkill
- deep-research-analystSkill
- dependency-upgrade-migratorSkill
- design-system-architectSkill
- desktop-electron-expertSkill
- documentation-site-expertSkill
- doku-mcp-serverSkill
- doku-payment-gatewaySkill
- e2e-testing-expertSkill
- ecommerce-expertSkill
- email-notification-expertSkill
- ephemeral-generative-ui-architectSkill
- ephemeral-wasm-sandbox-executorSkill
- error-resilience-expertSkill
- event-driven-architectSkill
- feature-flag-analytics-expertSkill
- file-upload-media-expertSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
When refactoring a massive, monolithic "Big Ball of Mud" codebase.
- Distinctive: line 22
When defining microservice boundaries (Bounded Contexts).
- Distinctive: line 23
When the user asks about "Clean Architecture", "CQRS", or "Event Sourcing".
- Distinctive: line 24
When building core business logic that is highly complex and rule-heavy (e.g., banking, logistics, SaaS billing engines).
- Very specific: line 33
Value Objects: Use immutable Value Objects for attributes (e.g., Money, Address, Email) instead of primitives (int, string).
- Distinctive: line 35
Repositories: Only create Repositories for Aggregate Roots.
- Very specific: line 38
When an Aggregate changes state in a way that other parts of the system care about, it should publish a Domain Event (e.g., …
- Distinctive: line 43
Queries: Read data directly from optimized database views or read models, bypassing the Domain Model entirely for performance.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Domain-Driven Design (DDD) Expert
English | Bahasa Indonesia
<a name="english"></a>
English
Description
A software architecture guide focused on tackling complexity in the heart of software. This skill bridges the gap between business rules and codebase structure using Domain-Driven Design (DDD). It covers Strategic Design (Bounded Contexts, Ubiquitous Language) and Tactical Design (Aggregates, Value Objects, Domain Events, Repositories).
Trigger Conditions
- When refactoring a massive, monolithic "Big Ball of Mud" codebase.
- When defining microservice boundaries (Bounded Contexts).
- When the user asks about "Clean Architecture", "CQRS", or "Event Sourcing".
- When building core business logic that is highly complex and rule-heavy (e.g., banking, logistics, SaaS billing engines).
Core Architectural Guidelines
1. Strategic Design (The Big Picture)
- Ubiquitous Language: The code must speak the language of the business. Do not use generic terms like
UserDataif the business calls it aSubscriber. - Bounded Contexts: Divide large systems into distinct contexts. A
Productin the Inventory context has different attributes than aProductin the Billing context. Do not try to create one massive, unifiedProductmodel.
2. Tactical Design (The Code)
- Value Objects: Use immutable Value Objects for attributes (e.g.,
Money,Address,Email) instead of primitives (int,string). Value Objects validate themselves upon creation. - Entities & Aggregates: Group related Entities together under a single Aggregate Root. External objects may only hold a reference to the Aggregate Root, never to its internal children.
- Repositories: Only create Repositories for Aggregate Roots.
3. Domain Events
When an Aggregate changes state in a way that other parts of the system care about, it should publish a Domain Event (e.g., OrderPlacedEvent). This decouples side-effects (like sending an email) from the core business transaction.
4. CQRS (Command Query Responsibility Segregation)
For highly scalable systems, separate the models used for writing data (Commands) from the models used for reading data (Queries).
- Commands: Modify state via the rich Domain Model.
- Queries: Read data directly from optimized database views or read models, bypassing the Domain Model entirely for performance.
Orchestration & Integration
- Extends
scalability-clean-codewith strict domain isolation patterns. - Essential for
event-driven-architectwhen defining what events flow through the message broker. - Complements
micro-frontend-architectby aligning frontend boundaries with backend Bounded Contexts.
<a name="bahasa-indonesia"></a>
Bahasa Indonesia
Deskripsi
Panduan arsitektur perangkat lunak yang berfokus pada penanganan kompleksitas bisnis. Skill ini menjembatani aturan bisnis dan struktur kode menggunakan Domain-Driven Design (DDD). Meliputi Desain Strategis (Bounded Contexts, Ubiquitous Language) dan Desain Taktis (Aggregates, Value Objects, Domain Events).
Kondisi Pemicu
- Saat melakukan refactoring codebase monolitik yang sudah berantakan (Big Ball of Mud).
- Saat mendefinisikan batas-batas layanan microservices.
- Saat membangun logika bisnis inti yang sangat kompleks (misal: mesin penagihan SaaS, sistem perbankan).
Panduan Arsitektur Inti
1. Desain Strategis
- Ubiquitous Language: Kode harus menggunakan bahasa yang sama dengan pihak bisnis. Hindari istilah teknis generik jika ada istilah bisnis yang lebih tepat.
- Bounded Contexts: Jangan mencoba membuat satu model data raksasa (misal: tabel
Userdengan 100 kolom). Pisahkan berdasarkan konteks; entitasUserdi konteks Penagihan berbeda denganUserdi konteks Pengiriman.
2. Desain Taktis (Implementasi Kode)
- Value Objects: Gunakan objek immutable (tidak dapat diubah) untuk atribut seperti
Uang,Alamat, atauEmaildaripada tipe data primitif biasa (string/int). - Aggregates: Kelompokkan entitas-entitas yang saling berhubungan ke dalam satu Aggregate Root. Interaksi dari luar hanya boleh melalui Root ini untuk menjaga konsistensi data.
- Repositories: Buat Repository hanya untuk Aggregate Root, bukan untuk setiap tabel di database.
3. Domain Events
Pisahkan efek samping (side-effects). Daripada membuat modul Pesanan memanggil modul Email secara langsung, buat modul Pesanan menerbitkan OrderPlacedEvent. Modul Email akan bereaksi terhadap event tersebut.
4. CQRS
Pisahkan model data untuk operasi Write (Command) dan Read (Query). Model baca dapat dioptimalkan secara drastis dengan melakukan bypass penuh pada logika domain.
Integrasi Orkestrasi
- Mengembangkan
scalability-clean-codedengan pola isolasi domain yang ketat. - Sangat penting bagi
event-driven-architectuntuk menentukan struktur event di message broker. - Membantu
micro-frontend-architectmenyelaraskan batas-batas frontend dengan Bounded Contexts backend.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

