clean-ddd-hexagonal

Enforces Clean Architecture, DDD, hexagonal patterns for backend service design.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/pau-vega/react-router-drizzle --skill clean-ddd-hexagonal-pau-vega
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-ddd-hexagonal
Source: https://github.com/pau-vega/react-router-drizzle/tree/main/.agents/skills/clean-ddd-hexagonal
Command: npx skills add https://github.com/pau-vega/react-router-drizzle --skill clean-ddd-hexagonal-pau-vega

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Backends often grow into unmanageable blobs where business rules are scattered, dependencies leak inward, and testing becomes brittle. This Skill provides a repeatable blueprint by combining Clean Architecture, Domain-Driven Design, and Hexagonal Architecture to create well-defined boundaries and resilient systems.

Core Features & Use Cases

  • Clear layering: Domain, Application, Infrastructure, and Presentation.
  • Inward dependencies only and explicit port definitions to enable easy swapping of infrastructure.
  • Support for Domain Events, bounded contexts, and both tactical and strategic DDD patterns.
  • Ready-to-adopt reference architectures that help teams bootstrap or refactor large backend services.

Quick Start

Initialize a backend project by defining domain models, ports, adapters, and a DI composition root to implement a clean, hexagonal architecture.

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 with Clean Architecture and DDD?

Structure your backend with Clean Architecture and DDD by organizing code into Domain, Application, Infrastructure, and Presentation layers. Ensure inward dependencies only and define explicit ports to isolate core domain logic from outer infrastructure adapters.

When should I use hexagonal architecture for my backend service?

Use hexagonal architecture when your backend service has multiple entry points like API, CLI, or events, and requires evolving infrastructure. It enforces domain boundaries via ports and adapters, enabling teams to replace outer layers without touching core domain logic.

What is the best way to isolate domain logic from infrastructure dependencies?

The best way to isolate domain logic is applying hexagonal architecture patterns with explicit ports and adapters. This enforces inward dependencies only, keeping business rules isolated and enabling easy swapping of infrastructure components without affecting the core domain.

How do I apply CQRS and domain events in a hexagonal architecture?

Apply CQRS and domain events within the Application layer of a hexagonal architecture by defining ports for command and query separation. Use domain events to communicate between bounded contexts while maintaining strict inward dependency rules and clear layering.

Can I refactor a monolithic backend into bounded contexts without touching core domain logic?

Yes, you can refactor a monolithic backend into bounded contexts by applying strategic DDD patterns and hexagonal architecture. Explicit ports and adapters allow replacing or modifying infrastructure and presentation layers without touching the core domain logic.

What are the limitations of combining Clean Architecture, DDD, and Hexagonal patterns?

Combining Clean Architecture, DDD, and Hexagonal patterns introduces significant structural overhead through explicit ports, adapters, and strict layering. This blueprint is suited for large, evolving backend services with multiple entry points, not for simple or small-scale applications.