Logo von Architecture Domain Driven Design

Architecture Domain Driven Design

Community
j4flmao
architecture-domain-driven-design

Use this skill when the user says 'DDD', 'domain-driven design', 'bounded context', 'aggregate', 'aggregate root', 'ubiquitous language', 'context map', 'anti-corruption layer', 'event storming', 'value object'. Applies strategic DDD (subdomains, bounded contexts, context maps) and tactical DDD (aggregates, entities, value objects, domain events, repositories) to model complex business logic. Do NOT use for: simple CRUD apps where DDD adds ceremony, service decomposition mechanics (architecture/system-design/microservices-patterns), or layering/folder structure only (backend/universal/clean-architecture).

Übersicht

Herausgeberj4flmao
Repositoryagent-skills
Skill-Namearchitecture-domain-driven-design
Sterne
41
Forks
6
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von j4flmao auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Architecture Domain Driven Design in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/system-design/domain-driven-design
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/architecture/system-design/domain-driven-design .claude/skills/architecture-domain-driven-design
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Architecture Domain Driven Design in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Architecture Domain Driven Design automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Architecture Domain Driven Design nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Domain-Driven Design

Purpose

DDD aligns software structure with the business: a shared language inside explicit boundaries, models that enforce business invariants, and deliberate translation where contexts meet. Use it where domain complexity is the main risk (pricing, underwriting, logistics, billing). For simple CRUD, plain layered code is cheaper.

Agent Protocol

Trigger

"DDD", "bounded context", "aggregate", "aggregate root", "entity vs value object", "domain event", "context map", "anti-corruption layer", "ubiquitous language", "event storming".

Input Context

  • Business capabilities and processes; domain experts' vocabulary.
  • Current pain: tangled models, inconsistent rules, overloaded terms.
  • Team structure (contexts usually map to team ownership).
  • Persistence and integration constraints.

Output Artifact

Strategic map (subdomains, contexts, relationships) and/or tactical model (aggregates with invariants, value objects, events, repository interfaces).

Response Format

Subdomains: {core|supporting|generic}: {name}
Contexts: {name} owns {terms}; team {x}
Context map: {upstream} -> {downstream} [{pattern}]
Aggregate: {Root} invariants: {list}; references others by id
Events: {PastTenseName}(fields)

Completion Criteria

  • Each term defined per context (no global "User"/"Product" model).
  • Every aggregate lists the invariants it protects.
  • One aggregate modified per transaction; others updated via events.
  • Context relationships named with a context-map pattern.

Strategic Design

Subdomains: core (competitive advantage: invest, custom build), supporting (needed, specific: build simply), generic (commodity: buy/SaaS, e.g. auth, payments).

Bounded context: a boundary within which a model and its language are consistent. "Product" in Catalog (description, images), Inventory (SKU, quantity, location), and Pricing (price lists, discounts) are different models that share an identifier.

Context map patterns

PatternRelationship
PartnershipTwo teams coordinate releases jointly
Shared KernelSmall shared model owned by both (keep tiny)
Customer/SupplierDownstream needs influence upstream's roadmap
ConformistDownstream adopts upstream model as-is
Anti-Corruption Layer (ACL)Downstream translates upstream model into its own terms
Open Host Service + Published LanguageUpstream offers a stable, documented API/schema for many consumers
Separate WaysNo integration; duplicate where cheaper

Event Storming (Brandolini): domain experts and engineers place domain events (orange) on a timeline, then commands, actors, policies, and aggregates; clusters suggest context boundaries.

Tactical Design

Building blockIdentityMutabilityExample
EntityHas id; equality by idMutable via methodsOrder
Value objectNo id; equality by valueImmutableMoney, Address, DateRange
AggregateCluster with one root; consistency boundaryChanged only through rootOrder + OrderLine
Domain eventImmutable factImmutableOrderPlaced
RepositoryLoads/saves whole aggregatesn/aOrderRepository
Domain serviceLogic not belonging to one entityStatelessPricingService

Aggregate rules (Vernon)

  1. Protect true invariants inside the boundary.
  2. Design small aggregates.
  3. Reference other aggregates by identity only.
  4. Use eventual consistency (domain events) outside the boundary; modify one aggregate per transaction.

Example (TypeScript)

typescript
export class Money {
  private constructor(readonly cents: number, readonly currency: string) {}
  static of(cents: number, currency: string): Money {
    if (!Number.isInteger(cents) || cents < 0) throw new RangeError(`invalid amount: ${cents}`);
    return new Money(cents, currency);
  }
  add(other: Money): Money {
    if (other.currency !== this.currency) {
      throw new Error(`currency mismatch: ${this.currency} vs ${other.currency}`);
    }
    return new Money(this.cents + other.cents, this.currency);
  }
}

type OrderStatus = "draft" | "placed" | "cancelled";
export type OrderEvent =
  | { type: "OrderPlaced"; orderId: string; customerId: string; totalCents: number; at: Date };

interface OrderLine { readonly sku: string; readonly qty: number; readonly unitPrice: Money }

export class Order {
  private lines: OrderLine[] = [];
  private status: OrderStatus = "draft";
  private pending: OrderEvent[] = [];

  constructor(readonly id: string, readonly customerId: string, private readonly currency: string) {}

  addLine(sku: string, qty: number, unitPrice: Money): void {
    if (this.status !== "draft") throw new Error(`order ${this.id} is ${this.status}; cannot add lines`);
    if (qty <= 0) throw new RangeError(`qty must be positive, got ${qty}`);
    if (unitPrice.currency !== this.currency) throw new Error("line currency differs from order");
    if (this.lines.length >= 100) throw new Error("max 100 lines per order");   // invariant
    this.lines.push({ sku, qty, unitPrice });
  }

  total(): Money {
    return this.lines.reduce((sum, l) => sum.add(Money.of(l.unitPrice.cents * l.qty, this.currency)),
                             Money.of(0, this.currency));
  }

  place(now: Date): void {
    if (this.status !== "draft") throw new Error(`order ${this.id} already ${this.status}`);
    if (this.lines.length === 0) throw new Error("cannot place an empty order");
    this.status = "placed";
    this.pending.push({ type: "OrderPlaced", orderId: this.id, customerId: this.customerId,
                        totalCents: this.total().cents, at: now });
  }

  pullEvents(): OrderEvent[] {
    const events = this.pending;
    this.pending = [];
    return events;
  }
}

export interface OrderRepository {
  get(id: string): Promise<Order>;
  save(order: Order): Promise<void>;   // persists state + pulled events (outbox) in one transaction
}

Application service: load aggregate → call one method → save (state + events via outbox) in one transaction. Other contexts (Inventory, Billing) react to OrderPlaced asynchronously, translating through their own ACL.

Anti-Corruption Layer

typescript
// Shipping context translating a legacy ERP customer into its own model
export function toRecipient(erp: { CUST_NM: string; ADDR1: string; CNTRY_CD: string }): Recipient {
  if (!erp.ADDR1) throw new Error(`ERP customer ${erp.CUST_NM} has no address`);
  return { name: erp.CUST_NM.trim(), street: erp.ADDR1.trim(), country: mapCountry(erp.CNTRY_CD) };
}

The ACL keeps upstream naming, quirks, and changes from leaking into the downstream model.

Anti-Patterns

  • Anemic domain model: entities as property bags, rules spread through services.
  • Giant aggregates (Customer containing all orders): lock contention and slow loads.
  • One enterprise-wide model for core concepts.
  • Repositories per table instead of per aggregate.
  • DDD ceremony on CRUD subdomains.
  • Bounded contexts that ignore team boundaries (Conway's law will win).

Checklist

  • Subdomains classified; investment matches type.
  • Bounded contexts with glossary and owning team.
  • Context map with explicit patterns; ACL where upstream model is foreign.
  • Aggregates small, invariants listed and enforced in methods.
  • Value objects immutable with validation.
  • Domain events published via outbox; consumers idempotent.
  • Unit tests on aggregates without infrastructure.

References

  • Evans, "Domain-Driven Design" (2003); Vernon, "Implementing Domain-Driven Design" (2013) and "Effective Aggregate Design" essays.
  • Brandolini, "Introducing EventStorming"; Khononov, "Learning Domain-Driven Design" (2021).

Häufig gestellte Fragen

Was macht der KI-Skill Architecture Domain Driven Design?

Use this skill when the user says 'DDD', 'domain-driven design', 'bounded context', 'aggregate', 'aggregate root', 'ubiquitous language', 'context map', 'anti-corruption layer', 'event storming', 'value object'. Applies strategic DDD (subdomains, bounded contexts, context maps) and tactical DDD (aggregates, entities, value objects, domain events, repositories) to model complex business logic. Do NOT use for: simple CRUD apps where DDD adds ceremony, service decomposition mechanics (architecture/system-design/microservices-patterns), or layering/folder structure only (backend/universal/clean...

Warum Architecture Domain Driven Design in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Architecture Domain Driven Design besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Architecture Domain Driven Design in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/system-design/domain-driven-design ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Architecture Domain Driven Design nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Architecture Domain Driven Design verwenden?

So viele Sie möchten. In TypingMind können Sie Architecture Domain Driven Design mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Architecture Domain Driven Design kostenlos?

Ja. Der Skill wird von j4flmao auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇