ddd

Design software architecture using Domain-Driven Design and Hexagonal Ports & Adapters patterns.

1|Updated May 4, 2026
One-click install
npx skills add https://github.com/wesbragagt/nixos-config --skill ddd-wesbragagt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd
Source: https://github.com/wesbragagt/nixos-config/tree/main/home/skills/ddd
Command: npx skills add https://github.com/wesbragagt/nixos-config --skill ddd-wesbragagt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It guides the design of maintainable, testable software by separating pure business logic from infrastructure concerns, preventing tangled codebases where frameworks and databases leak into domain rules. ## Core Features & Use Cases - Strategic Design: Discover bounded contexts, define ubiquitous language, and map context relationships like Anti-Corruption Layers and Customer-Supplier. - Tactical Modeling: Build entities, value objects, aggregates, repositories, domain services, and domain events with clear decision guides. - Hexagonal Architecture: Structure projects with domain, ports, and adapters layers, wire dependencies in a composition root, and enforce the dependency rule with architecture fitness tests. - Use Case: When refactoring a monolithic service where business rules live in controllers and ORM models, follow the step-by-step refactoring sequence to extract a pure domain layer, define ports, and create swappable adapters. ## Quick Start Ask the AI to design the architecture for a new order management service using DDD and hexagonal architecture with bounded contexts and ports.

Frequently Asked Questions about ddd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply Domain-Driven Design to an existing project?

Refactor incrementally: extract domain models free of framework imports, define outbound port interfaces for repositories, create in-memory adapters for testability, move orchestration into application services, and wire everything in a composition root. Add architecture tests to prevent re-coupling.

What is the difference between an entity and a value object in DDD?

Entities have a distinct identity that persists through attribute changes and are compared by ID. Value objects are defined entirely by their attributes, are immutable, self-validating at construction, and compared by value, such as Money, Email, or DateRange.

How does hexagonal architecture differ from layered architecture?

Hexagonal architecture makes the domain the center with dependencies pointing only inward through port interfaces. Adapters for databases, APIs, and UIs implement those ports, so infrastructure can be swapped without touching domain code, unlike traditional top-down layers.

When should I not use DDD and hexagonal architecture?

Avoid it for simple CRUD applications, short-lived prototypes, thin database wrappers, or small teams with straightforward domains. The indirection overhead outweighs benefits when business logic is minimal; start simple and refactor toward DDD as complexity grows.

How do I test domain logic without a database?

Keep the domain layer free of infrastructure imports so unit tests run pure business rules directly. Replace outbound ports with in-memory fake repositories in service tests, and reserve real database tests for adapter integration tests with test containers.