clean-ddd-hexagonal

Shape backend architectures with DDD, Clean Architecture, and Hexagonal patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Proactively apply when designing APIs, microservices, or scalable backend structure. Triggers on DDD, Clean Architecture, Hexagonal, ports and adapters, entities, value objects, domain events, CQRS, event sourcing, repository pattern, use cases, onion architecture, outbox pattern, aggregate root, anti-corruption layer. Use when working with domain models, aggregates, repositories, or bounded contexts. Clean Architecture + DDD + Hexagonal patterns for backend services, language-agnostic (Go, Rust, Python, TypeScript, Java, C#).

Core Features & Use Cases

  • Proactively apply established patterns to structure system boundaries.
  • Demonstrates how to implement Domain, Application, and Infrastructure layers with ports/adapters, aggregates, and domain events.
  • Covers CQRS, Event Sourcing, and Outbox patterns for reliable workflows across bounded contexts.

Quick Start

Outline a bounded context with a simple aggregate and implement a basic hexagonal boundary around it to validate the 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 using Domain-Driven Design and Hexagonal Architecture?

Structure backends by dividing them into Domain, Application, and Infrastructure layers using Hexagonal Architecture and DDD. This enforces inward dependencies and domain-centric modeling, placing core business logic at the center, isolated from external concerns via ports and adapters.

When should I use CQRS and event sourcing in a microservices architecture?

Use CQRS and event sourcing in microservices when you need reliable workflows across bounded contexts. These patterns separate read and write operations and persist state changes as a sequence of events, ensuring scalability and auditability for complex domain models.

Can I apply Clean Architecture and ports and adapters across different programming languages?

Yes, Clean Architecture and ports and adapters patterns are language-agnostic. You can apply these architectural boundaries to design APIs and scalable systems across multiple tech stacks including Go, Rust, Python, TypeScript, Java, and C#.

What is the best way to isolate a bounded context from legacy systems?

Isolate a bounded context from legacy systems by implementing an anti-corruption layer. This pattern translates external legacy models into your clean domain model, preventing external system complexities from polluting your core domain logic.

How do aggregates and domain events improve maintainability in scalable systems?

Aggregates group related domain objects into a single transactional unit, while domain events broadcast state changes asynchronously. Together they enforce business invariants and decouple system components, significantly improving maintainability in scalable systems.