clean-ddd-hexagonal

Guide backend service design with DDD tactical patterns and Hexagonal Architecture.

Updated Apr 9, 2019
One-click install
npx skills add https://github.com/Yusei-SHIRAISHI/my_dotfiles --skill clean-ddd-hexagonal-yusei-shiraishi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-ddd-hexagonal
Source: https://github.com/Yusei-SHIRAISHI/my_dotfiles/tree/main/.codex/skills/clean-ddd-hexagonal
Command: npx skills add https://github.com/Yusei-SHIRAISHI/my_dotfiles --skill clean-ddd-hexagonal-yusei-shiraishi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust framework for designing and structuring backend applications, ensuring maintainability, testability, and scalability by enforcing clear architectural boundaries and domain-driven design principles.

Core Features & Use Cases

  • Architectural Guidance: Enforces the Dependency Rule (inward dependencies only).
  • DDD Tactical Patterns: Guides the implementation of Entities, Value Objects, Aggregates, Repositories, and Domain Services.
  • Hexagonal Architecture: Promotes separation of concerns through Ports and Adapters.
  • Use Case: When designing a new e-commerce backend, use this Skill to structure the domain, application, and infrastructure layers, ensuring clean separation between business logic, use cases, and data persistence.

Quick Start

Apply the clean-ddd-hexagonal skill to structure a new backend service.

Frequently Asked Questions about clean-ddd-hexagonal

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

FAQPage Schema
How do I structure a backend service using domain-driven design and hexagonal architecture?

Structure a backend service using domain-driven design by separating domain, application, and infrastructure layers. Enforce the Dependency Rule for inward dependencies only, utilizing tactical patterns like entities, value objects, and aggregates to isolate business logic.

What is the best way to separate business logic from data persistence in a scalable backend?

The best way to separate business logic from data persistence is implementing hexagonal architecture. Define ports and adapters to isolate the core domain from infrastructure concerns, ensuring your maintainable systems remain testable and scalable.

When do I need aggregates and value objects in domain modeling?

You need aggregates and value objects in domain modeling when enforcing business invariants and encapsulating domain logic. These tactical patterns structure the domain layer, maintaining clear boundaries and ensuring consistent state transitions across your backend service.

Does hexagonal architecture require specific frameworks to implement ports and adapters?

Hexagonal architecture does not require specific frameworks. It is a structural design pattern enforcing the Dependency Rule through ports and adapters, allowing you to decouple core application logic from infrastructure tools using plain code interfaces.

How do I enforce the Dependency Rule when structuring domain and infrastructure layers?

Enforce the Dependency Rule by ensuring all dependencies point inward toward the domain layer. Infrastructure and application layers depend on the domain, never the reverse, guaranteeing that business logic remains isolated from external concerns like data persistence.

Why does my domain logic leak into infrastructure components in a clean architecture?

Domain logic leaks into infrastructure when architectural boundaries are unclear. Applying hexagonal architecture with explicit ports and adapters separates use cases from data persistence, ensuring business rules stay within the domain layer and preventing leakage.