Skip to content
Back to skills

Ddd Tactical Patterns

ASecurity

Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.

  • 6 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 12, 2026
ai-agentstypescripttestingrefactoringapidatabasedocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 12, 2026

npx -y skills add rootcastleco/rei-skills --skill ddd-tactical-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ddd Tactical Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ddd Tactical Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rootcastleco-ddd-tactical-patterns/badge)](https://www.skillsdirectory.com/skills/rootcastleco-ddd-tactical-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ddd-tactical-patterns
description: "Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants."
risk: safe
source: rootcastle-rei
tags: [ddd, tactical, aggregates, value-objects, domain-events]
---

# 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

```typescript
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

- 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.

---

> 🏰 **Rei Skills** — Curated by [Rootcastle Engineering & Innovation](https://www.rootcastle.com) | Batuhan Ayrıbaş  
> Engineering Beyond Boundaries | admin@rootcastle.com

Files in this skill

  • SKILL.md1.8 KB
  • references/tactical-checklist.md611 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…