Ddd tactical patterns

From BEKO2210/Firstbrain · View interactive version

Ddd tactical patterns is an AI agent skill from the GitHub repository BEKO2210/Firstbrain. Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.

How to use this skill

Skill file

DDD Tactical Patterns

Use this skill when

Do not use this skill when

Instructions

  1. Identify invariants first and design aggregates around them.
  2. Model immutable value objects for validated concepts.
  3. Keep domain behavior in domain objects, not controllers.
  4. Emit domain events for meaningful state transitions.
  5. Keep repositories at aggregate root boundaries.

If detailed checklists are needed, open references/tactical-checklist.md.

Example

class Order {
  private status: "draft" | "submitted" = "draft";

  submit(itemsCount: number): void {
    if (itemsCount === 0) throw new Error("Order cannot be submitted empty");
    if (this.status !== "draft") throw new Error("Order already submitted");
    this.status = "submitted";
  }
}

Limitations

Connections

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.