Skip to content
Back to skills

Domain Driven Design

ASecurity

Expert guidance for Domain-Driven Design architecture and implementation. Use when designing complex business systems, defining bounded contexts, structuring domain models, choosing between modular monolith vs microservices, implementing aggregates/entities/value objects, or when users mention "DDD", "domain-driven design", "bounded context", "aggregate", "domain model", "ubiquitous language", "event storming", "context mapping", "domain events", "anemic domain model", strategic design, tacti...

  • 21 stars
  • 0 votes
  • 0 copies
  • 18 views
  • Added February 8, 2026
businessgospringapidevops

Works with

  • api

Security analysis

A100/100

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

Scanned February 12, 2026

npx -y skills add joaquimscosta/arkhe-claude-plugins --skill domain-driven-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Domain Driven Design?

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

Security grade badge for Domain Driven Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/joaquimscosta-domain-driven-design/badge)](https://www.skillsdirectory.com/skills/joaquimscosta-domain-driven-design)

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: domain-driven-design
description: Expert guidance for Domain-Driven Design architecture and implementation. Use when designing complex business systems, defining bounded contexts, structuring domain models, choosing between modular monolith vs microservices, implementing aggregates/entities/value objects, or when users mention "DDD", "domain-driven design", "bounded context", "aggregate", "domain model", "ubiquitous language", "event storming", "context mapping", "domain events", "anemic domain model", strategic design, tactical patterns, or domain modeling. Helps make architectural decisions, identify subdomains, design aggregates, and avoid common DDD pitfalls.
---

# Domain-Driven Design Skill

DDD manages complexity through alignment between software and business reality. **Strategic design (boundaries, language, subdomains) provides more value than tactical patterns (aggregates, repositories).**

## When to Apply DDD

**Apply DDD when:**
- Domain has intricate business rules
- System is long-lived and high-value
- Domain experts are available
- Multiple teams/departments involved
- Software represents competitive advantage

**DDD is overkill when:**
- Simple CRUD applications
- Tight deadlines, limited budgets
- No domain experts available
- Complexity is purely technical, not business

## Core Workflow

1. **Domain Discovery** → Identify subdomains and their strategic importance
2. **Bounded Context Definition** → Draw boundaries where language changes
3. **Context Mapping** → Define integration patterns between contexts
4. **Architecture Selection** → Choose modular monolith vs microservices
5. **Tactical Implementation** → Apply patterns within core domains only

## Quick Reference

### Subdomain Types (Problem Space)

| Type | Investment | Example |
|------|-----------|---------|
| **Core** | Maximum - competitive advantage | Recommendation engine, trading logic |
| **Supporting** | Custom but quality tradeoffs OK | Inventory management |
| **Generic** | Buy/outsource | Auth, email, payments |

### Key Decision: Entity vs Value Object

- **Entity**: Has identity, tracked through time, mutable → `Customer`, `Order`
- **Value Object**: Defined by attributes, immutable, interchangeable → `Money`, `Address`, `Email`

**Default to value objects.** Only use entities when identity matters.

### Aggregate Design Rules (Vaughn Vernon)

1. Model true invariants in consistency boundaries
2. Design small aggregates (~70% should be root + value objects only)
3. Reference other aggregates by ID only
4. Use eventual consistency outside the boundary

### Architecture Decision

```
Start with modular monolith when:
├── Team < 20 developers
├── Domain boundaries unclear
├── Time-to-market critical
└── Strong consistency required

Consider microservices when:
├── Bounded contexts have distinct languages
├── Teams can own full contexts
├── Independent scaling required
└── DevOps maturity exists
```

## Detailed References

- **Strategic Patterns**: See [references/STRATEGIC-PATTERNS.md](references/STRATEGIC-PATTERNS.md) for subdomains, bounded contexts, context mapping, event storming
- **Tactical Patterns**: See [references/TACTICAL-PATTERNS.md](references/TACTICAL-PATTERNS.md) for entities, value objects, aggregates, services, repositories
- **Architecture Alignment**: See [references/ARCHITECTURE-ALIGNMENT.md](references/ARCHITECTURE-ALIGNMENT.md) for clean/hexagonal architecture, modular monolith, microservices
- **Anti-Patterns**: See [references/ANTI-PATTERNS.md](references/ANTI-PATTERNS.md) for common pitfalls and how to avoid them
- **Troubleshooting**: See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common issues and solutions

## Critical Reminders

1. **Ubiquitous language first** - Code should read like business language
2. **Strategic before tactical** - Understand boundaries before implementing patterns
3. **Apply tactical patterns selectively** - Only in core domains where complexity warrants
4. **One aggregate per transaction** - Cross-aggregate consistency via domain events
5. **Persistence ignorance** - Domain layer has no infrastructure dependencies

## Implementation Skills

For framework-specific implementation of these patterns:

- **Spring Boot data layer**: See `spring-boot-data-ddd` skill for JPA/JDBC aggregates, repositories, transactions
- **Spring Boot web layer**: See `spring-boot-web-api` skill for controllers, validation, exception handling  
- **Spring Modulith**: See `spring-boot-modulith` skill for module structure and event-driven communication

These skills provide Spring Boot 4 implementation patterns for the DDD concepts defined here.

Files in this skill

  • SKILL.md4.6 KB
  • TROUBLESHOOTING.md8.5 KB
  • references/anti-patterns.md10 KB
  • references/architecture-alignment.md10.5 KB
  • references/strategic-patterns.md7.9 KB
  • references/tactical-patterns.md11.5 KB

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.