Logo di Domain Driven Design Expert

Domain Driven Design Expert

Community
roedyrustam
domain-driven-design-expert

Domain-Driven Design (DDD), aggregates, bounded contexts, and CQRS / Desain Berbasis Domain (DDD), aggregate, bounded context, dan CQRS.

Panoramica

Pubblicato daroedyrustam
Repositoryvibes-plug
Nome della skilldomain-driven-design-expert
Stelle
117
Fork
27
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da roedyrustam su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Domain Driven Design Expert in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/domain-driven-design-expert
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/domain-driven-design-expert .claude/skills/domain-driven-design-expert
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Domain Driven Design Expert in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Domain Driven Design Expert non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Domain Driven Design Expert non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Domain-Driven Design (DDD) Expert (Strategic & Tactical 2026)

English | Bahasa Indonesia


English

Orchestration & Integration

Connects and orchestrates with domain skills:

  • Architecture & Modularity: scalability-clean-code (SOLID, Hexagonal/Ports & Adapters), event-driven-architect (Domain Events, Kafka/RabbitMQ), and saas-architect (Bounded Context isolation).
  • Persistence & Mapping: database-orm-expert (Repository pattern, Data Mappers, pure domain models without ORM leakage), double-entry-ledger-fintech-expert.
  • Formal Verification & Quality: formal-spec-z3-verifier (mathematical invariant verification) and anti-slop (pure domain model hygiene, zero anemic domain models).
  • Orchestration: brainstorming and zero-to-prod-orchestrator (Phase 2 & Phase 3: Domain Discovery & Architecture).

Description

Comprehensive architectural guide for tackling core business complexity using Domain-Driven Design (DDD). Covers Strategic Design (Bounded Contexts, Context Mapping, Anti-Corruption Layers, Ubiquitous Language) and Tactical Design (immutable Value Objects, Aggregate Roots, Domain Events, Repositories, Specification pattern, and CQRS separation).

1. Strategic & Tactical DDD Pattern Matrix

DDD PatternArchitectural RoleBoundary RuleAnti-Pattern to Reject
Bounded ContextAutonomous semantic boundary (Billing, Identity, Catalog)Communicates across contexts via Domain Events or Anti-Corruption Layer (ACL)Sharing mutable ORM database models across microservice boundaries
Value ObjectImmutable domain measure (Money, Percentage, EmailAddress)Validated on construction; equality by structural value, never by IDPrimitive Obsession (passing raw number for currency or string for status)
Aggregate RootTransactional consistency boundary (OrderAggregate, InvoiceAggregate)1 transaction = 1 Aggregate Root mutated; referenced externally only by IDModifying child entities directly or spanning 5 aggregates in one lock
Anti-Corruption Layer (ACL)Translates external 3rd-party payloads (Stripe/DOKU/Legacy) into pure Domain typesLives in the Infrastructure layer (src/infrastructure/acl/)Leaking external webhook DTO shapes into core Domain Entities

2. Tactical Pattern: Immutable Value Object & Aggregate Root (TypeScript)

typescript
// src/domain/shared/value-objects/Money.ts
export type CurrencyCode = 'USD' | 'IDR' | 'EUR';

export class Money {
  public readonly amountMinor: bigint;
  public readonly currency: CurrencyCode;

  private constructor(amountMinor: bigint, currency: CurrencyCode) {
    if (amountMinor < 0n) {
      throw new Error('DOMAIN_INVARIANT_VIOLATION: Money amount cannot be negative.');
    }
    this.amountMinor = amountMinor;
    this.currency = currency;
  }

  public static fromMinorUnits(amountMinor: bigint | number, currency: CurrencyCode): Money {
    const normalized = typeof amountMinor === 'number' ? BigInt(Math.round(amountMinor)) : amountMinor;
    return new Money(normalized, currency);
  }

  public add(other: Money): Money {
    if (this.currency !== other.currency) {
      throw new Error(`CURRENCY_MISMATCH: Cannot add ${other.currency} to ${this.currency}.`);
    }
    return new Money(this.amountMinor + other.amountMinor, this.currency);
  }

  public equals(other: Money): boolean {
    return this.amountMinor === other.amountMinor && this.currency === other.currency;
  }
}

// src/domain/order/OrderAggregate.ts
export interface DomainEvent {
  readonly eventName: string;
  readonly occurredAtIso: string;
  readonly aggregateId: string;
}

export class OrderPaidEvent implements DomainEvent {
  public readonly eventName = 'order.paid.v1';
  public readonly occurredAtIso = new Date().toISOString();
  constructor(
    public readonly aggregateId: string,
    public readonly paidAmountMinor: string,
    public readonly currency: CurrencyCode
  ) {}
}

export class OrderAggregate {
  private readonly domainEvents: DomainEvent[] = [];

  constructor(
    public readonly id: string,
    public readonly tenantId: string,
    private total: Money,
    private status: 'DRAFT' | 'PAID' | 'CANCELLED' = 'DRAFT',
    private version: number = 1
  ) {}

  public getStatus(): 'DRAFT' | 'PAID' | 'CANCELLED' {
    return this.status;
  }

  public getTotal(): Money {
    return this.total;
  }

  public getVersion(): number {
    return this.version;
  }

  public markAsPaid(paymentAmount: Money): void {
    if (this.status !== 'DRAFT') {
      throw new Error(`INVALID_STATE_TRANSITION: Cannot pay order in ${this.status} state.`);
    }
    if (!this.total.equals(paymentAmount)) {
      throw new Error('PAYMENT_AMOUNT_MISMATCH: Paid amount does not match order total.');
    }
    this.status = 'PAID';
    this.version += 1;
    this.domainEvents.push(
      new OrderPaidEvent(this.id, this.total.amountMinor.toString(), this.total.currency)
    );
  }

  public pullDomainEvents(): DomainEvent[] {
    const events = [...this.domainEvents];
    this.domainEvents.length = 0;
    return events;
  }
}

3. Production Verification Checklist

  • Model Purity: Domain Entities and Value Objects in src/domain/ have zero imports from ORM (drizzle-orm, @prisma/client) or HTTP (hono, next, express) packages.
  • Access Strictly Through Aggregate Roots: Child entities are mutated exclusively via invariant-checked methods on their Aggregate Root.
  • Optimistic Concurrency Version: Every Aggregate Root tracks a monotonic version column checked during Repository.save() to prevent lost updates.
  • Anti-Corruption Layer (ACL): External API responses and webhooks are mapped through an ACL translator before entering the domain layer.

Transactional Outbox & Domain Event Dispatcher (TypeScript)
typescript
export interface DomainEventPayload {
  readonly eventId: string;
  readonly aggregateId: string;
  readonly eventType: string;
  readonly occurredAt: string;
  readonly payload: Record<string, unknown>;
}

export interface OutboxRepository {
  insertOutboxEvents(events: readonly DomainEventPayload[]): Promise<void>;
}

export abstract class AggregateRoot<TId extends string> {
  private readonly uncommittedEvents: DomainEventPayload[] = [];

  constructor(public readonly id: TId) {}

  protected recordDomainEvent(eventType: string, payload: Record<string, unknown>): void {
    this.uncommittedEvents.push({
      eventId: crypto.randomUUID(),
      aggregateId: this.id,
      eventType,
      occurredAt: new Date().toISOString(),
      payload
    });
  }

  public pullDomainEvents(): readonly DomainEventPayload[] {
    const events = [...this.uncommittedEvents];
    this.uncommittedEvents.length = 0;
    return events;
  }
}

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeMedium / High (Gemini 4 Argon, Claude Sonnet 5.5 High, Muse Wonder High, Composer 2.5 Fast)
Availability FallbackGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec domain-driven-design-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_visual_audit, vibes_ast_query, vibes_verify_gate
NFR & Anti-Slop InvariantsLCP < 1.8s, INP < 100ms, CLS < 0.05, 1px crisp borders, 3-tier radius (6px/8px/12px), tabular-nums, 5-state interactive contract; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Integrasi Orkestrasi

Terhubung dan mengorkestrasi bersama skill domain:

  • Arsitektur & Modularitas: scalability-clean-code (SOLID, Hexagonal/Ports & Adapters), event-driven-architect (Domain Events, Kafka/RabbitMQ), dan saas-architect (isolasi Bounded Context).
  • Persistensi & Pemetaan: database-orm-expert (pola Repository, Data Mapper, model domain murni tanpa kebocoran ORM), double-entry-ledger-fintech-expert.
  • Verifikasi Formal & Kualitas: formal-spec-z3-verifier (verifikasi invarian matematis) dan anti-slop (kebersihan model domain murni, anti anemic domain model).
  • Orkestrator Utama: brainstorming dan zero-to-prod-orchestrator (Fase 2 & Fase 3: Penemuan Domain & Arsitektur).

Deskripsi

Panduan arsitektur komprehensif untuk menangani kompleksitas bisnis inti menggunakan Domain-Driven Design (DDD), baik Desain Strategis (Bounded Contexts, Anti-Corruption Layer, Ubiquitous Language) maupun Desain Taktis (Value Objects imutabel, Aggregate Roots, Domain Events, dan Repositories).

Checklist Verifikasi Produksi

  • Kemurnian Model Domain: Folder src/domain/ dilarang mengimpor pustaka database/ORM atau framework HTTP; seluruh logika domain harus dapat diuji unit secara murni di memori.
  • Mutasi Melalui Aggregate Root: Seluruh perubahan state wajib melewati metode pada Aggregate Root yang memvalidasi aturan bisnis.
  • Satu Repository per Aggregate Root: Hanya buat interface Repository untuk Aggregate Root (IOrderRepository), lengkap dengan pemeriksaan versi (optimistic locking).

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierMedium / High (Gemini 4 Argon, Claude Sonnet 5.5 High, Muse Wonder High, Composer 2.5 Fast)
Invarian Fallback KetersediaanGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec domain-driven-design-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_visual_audit, vibes_ast_query, vibes_verify_gate
Invarian NFR & Anti-SlopLCP < 1.8s, INP < 100ms, CLS < 0.05, border tegas 1px, radius 3-tier (6px/8px/12px), tabular-nums, kontrak interaktif 5-state; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Domande frequenti

Cosa fa la skill IA Domain Driven Design Expert?

Domain-Driven Design (DDD), aggregates, bounded contexts, and CQRS / Desain Berbasis Domain (DDD), aggregate, bounded context, dan CQRS.

Perché usare Domain Driven Design Expert su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Domain Driven Design Expert è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Domain Driven Design Expert in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/roedyrustam/vibes-plug/tree/main/skills/domain-driven-design-expert. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Domain Driven Design Expert?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Domain Driven Design Expert?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Domain Driven Design Expert: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Domain Driven Design Expert è gratuita?

Sì. È pubblicata su GitHub da roedyrustam con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇