mcpField
D
ddd-tactical-patterns

ddd-tactical-patterns

github.com/sickn33Development48.7k155 installsUpdated today
Repository

About ddd-tactical-patterns

ddd-tactical-patterns is a development skill for applying tactical Domain-Driven Design when translating business rules into code. It focuses on invariants, behavior-rich domain objects, aggregate boundaries, repositories, and domain events.

Key features

  1. 01Design aggregates around invariants
  2. 02Model validated immutable value objects
  3. 03Keep behavior in domain objects
  4. 04Emit events for state transitions
  5. 05Set repository boundaries at aggregates

Use cases

  1. 01Refactor an anemic domain model
  2. 02Define aggregate boundaries and invariants
  3. 03Set repository and domain event boundaries

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/sickn33/agentic-awesome-skills --skill ddd-tactical-patterns

After installing, type/ddd-tactical-patternsin Claude Code to confirm it loaded.

Bundled filesreferences/tactical-checklist.md

Details

From the project README

DDD Tactical Patterns

Use this skill when

  • Translating domain rules into code structures.
  • Designing aggregate boundaries and invariants.
  • Refactoring an anemic model into behavior-rich domain objects.
  • Defining repository contracts and domain event boundaries.

Do not use this skill when

  • You are still defining strategic boundaries.
  • The task is only API documentation or UI layout.
  • Full DDD complexity is not justified.

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 (!Number.isInteger(itemsCount) || itemsCount <= 0) throw new Error("Order cannot be submitted empty");
    if (this.status !== "draft") throw new Error("Order already submitted");
    this.status = "submitted";
  }
}

Limitations

  • This skill does not define deployment architecture.
  • It does not choose databases or transport protocols.
  • It should be paired with testing patterns for invariant coverage.

Comments

Markdown supported