# Design Domain Models with DDD Tactical Patterns

Domain rules often become scattered across controllers and persistence code. This skill structures them with aggregates, value objects, repositories, and domain events.

## Install

```bash
npx skillstore add sickn33/ddd-tactical-patterns
```

## Metadata

- Status: approved
- Slug: sickn33-ddd-tactical-patterns
- Skillstore revision: r2
- Version status: missing
- Tree hash: f189cd025ea62d78b9f0c5755f292d811d4f5367859e47db7d2b1a21ef3e3853
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/ddd-tactical-patterns
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 74
- Public page: https://skillstore.pages.dev/skills/sickn33-ddd-tactical-patterns
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-ddd-tactical-patterns/manifest

## Capabilities

- Identifies invariants before defining aggregate boundaries.
- Models validated concepts as immutable value objects.
- Places domain behavior inside entities and aggregate roots.
- Defines repository contracts around aggregate roots.
- Uses domain events for meaningful state transitions.
- Reviews designs with a focused tactical pattern checklist.

## Use Cases

- Model a New Business Workflow: Translate workflow rules into aggregates, value objects, methods, and domain events.
- Refactor an Anemic Domain Model: Move business rules from controllers and services into behavior-rich domain objects.
- Review Tactical DDD Boundaries: Assess aggregate consistency, repository scope, value semantics, and event payload design.

## Prompt Templates

### Identify the Core Invariants

```
Review this business rule set: [rules]. List the invariants, affected concepts, and state transitions before proposing any classes.
```

### Design an Aggregate

```
Design an aggregate for [workflow]. Define its root, entities, value objects, invariants, commands, and meaningful domain events.
```

### Refactor a Domain Model

```
Review this model: [model description]. Find anemic behavior, misplaced rules, persistence leakage, and weak boundaries. Propose a focused tactical DDD refactor.
```

### Evaluate Cross-Aggregate Consistency

```
Analyze these aggregates and transaction requirements: [details]. Separate immediate invariants from eventual consistency. Recommend repository and domain event boundaries with tradeoffs.
```

## Limitations

- Does not define bounded contexts or other strategic DDD boundaries.
- Does not select databases, transport protocols, or deployment architecture.
- Does not replace tests for aggregate invariants and event behavior.
- May introduce unnecessary complexity for simple data-oriented applications.

## Best Practices

- State invariants explicitly before selecting entities or aggregate boundaries.
- Keep transactions within one aggregate whenever business rules permit.
- Pair each modeled invariant with focused automated tests.

## Anti Patterns

- Do not place core business rules only in controllers or application services.
- Do not expose persistence models as domain entities.
- Do not require synchronous consistency across unrelated aggregates without a proven invariant.

## Security Audit

- Audited at: 2026-07-23T22:58:41.122\+00:00
- Summary: All five static findings are false positives caused by ordinary DDD prose, Markdown backticks, and a fenced TypeScript example. The skill contains no executable shell command, system reconnaissance, prompt injection, or other harmful intent.

## Stats

- Views: 101
- Downloads: 11
- Favorites: 0
- Popularity score: 0
