domain-driven-design

Domain-Driven Design Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "domain-driven-design" with this command: npx skills add joaquimscosta/arkhe-claude-plugins/joaquimscosta-arkhe-claude-plugins-domain-driven-design

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

  • Domain Discovery → Identify subdomains and their strategic importance

  • Bounded Context Definition → Draw boundaries where language changes

  • Context Mapping → Define integration patterns between contexts

  • Architecture Selection → Choose modular monolith vs microservices

  • 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)

  • Model true invariants in consistency boundaries

  • Design small aggregates (~70% should be root + value objects only)

  • Reference other aggregates by ID only

  • 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 for subdomains, bounded contexts, context mapping, event storming

  • Tactical Patterns: See references/TACTICAL-PATTERNS.md for entities, value objects, aggregates, services, repositories

  • Architecture Alignment: See references/ARCHITECTURE-ALIGNMENT.md for clean/hexagonal architecture, modular monolith, microservices

  • Anti-Patterns: See references/ANTI-PATTERNS.md for common pitfalls and how to avoid them

  • Examples: See EXAMPLES.md for scenario walkthroughs applying DDD concepts

  • Troubleshooting: See TROUBLESHOOTING.md for common issues and solutions

Critical Reminders

  • Ubiquitous language first - Code should read like business language

  • Strategic before tactical - Understand boundaries before implementing patterns

  • Apply tactical patterns selectively - Only in core domains where complexity warrants

  • One aggregate per transaction - Cross-aggregate consistency via domain events

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

skill-validator

No summary provided by upstream source.

Repository SourceNeeds Review
General

generating-changelog

No summary provided by upstream source.

Repository SourceNeeds Review
General

managing-adrs

No summary provided by upstream source.

Repository SourceNeeds Review
General

creating-pr

No summary provided by upstream source.

Repository SourceNeeds Review