clean-ddd-hexagonal

Design layered backend architectures with Clean Architecture, DDD, and Hexagonal patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/raudyagdel/ai_setup_and_tips --skill clean-ddd-hexagonal-raudyagdel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-ddd-hexagonal
Source: https://github.com/raudyagdel/ai_setup_and_tips/tree/main/.agents/skills/clean-ddd-hexagonal
Command: npx skills add https://github.com/raudyagdel/ai_setup_and_tips --skill clean-ddd-hexagonal-raudyagdel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Organizations often struggle to manage complexity in large backend systems. This skill provides a blueprint for structuring software using Clean Architecture, Domain-Driven Design (DDD), and Hexagonal Architecture to create clear boundaries, testability, and maintainable codebases.

Core Features & Use Cases

  • Enforces inward-facing dependencies (Infrastructure → Application → Domain) to prevent leakage of concerns.
  • Defines layered architecture with Domain, Application, and Infrastructure layers, connected via ports and adapters.
  • Supports multiple entry points (API, CLI, events) and easy swapping of adapters for different environments.
  • Improves team onboarding and parallel development by isolating bounded contexts and clear interfaces.

Quick Start

To begin, structure the code into domain, application, and infrastructure layers, define ports for external systems, implement adapters, and start with a minimal aggregate and one use case. Then incrementally introduce domain events, read models, and integration events as your domain grows.

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 scalable backend using clean architecture and DDD?

Structure your scalable backend by dividing code into Domain, Application, and Infrastructure layers. Enforce inward-facing dependencies from Infrastructure to Domain, connecting layers via ports and adapters to prevent concern leakage and ensure maintainability.

What is the hexagonal architecture pattern for API-driven services?

Hexagonal architecture for API-driven services isolates the Domain and Application core logic from external systems. It uses ports as interfaces and adapters for implementation, allowing easy swapping of infrastructure components and supporting multiple entry points like APIs, CLIs, or events.

How do I start implementing domain-driven design in a microservices codebase?

Start implementing DDD by defining a minimal aggregate and one use case within your Domain layer. Define ports for external systems, implement infrastructure adapters, then incrementally introduce domain events, read models, and integration events as your domain grows.

Does clean architecture work for event-driven systems?

Yes, clean architecture works for event-driven systems by defining clear boundaries and supporting events as primary entry points. Ports and adapters isolate the domain logic, ensuring event processing remains testable and decoupled from infrastructure dependencies.

Best way to enforce inward dependencies in a layered backend architecture?

The best way to enforce inward dependencies is by structuring layers so Infrastructure depends on Application, which depends on Domain. This prevents outer concerns from leaking inward, ensuring the domain core remains isolated, testable, and maintainable across environments.

When should I not use hexagonal architecture for back-end development?

You should avoid hexagonal architecture for simple back-end systems with minimal complexity. The overhead of defining ports, adapters, and strict layered boundaries is best suited for large applications requiring high maintainability, parallel development, and clear bounded contexts.