clean-ddd-hexagonal

Installation
Summary

Language-agnostic backend architecture combining DDD, Clean Architecture, and Hexagonal patterns.

  • Enforces strict dependency rules (inward only) with clear layer separation: domain (core logic), application (use cases), and infrastructure (adapters)
  • Provides tactical DDD patterns including entities, value objects, aggregates, domain events, repositories, and domain services with concrete decision trees for placement
  • Includes anti-pattern warnings (anemic models, god aggregates, leaking infrastructure, premature CQRS) and implementation sequencing from domain discovery through adapter implementation
  • Covers aggregate boundary design, repository-per-aggregate strategy, eventual consistency via domain events, and transaction management across service boundaries
  • Language-agnostic guidance applicable to Go, Rust, Python, TypeScript, Java, and C# with reference documentation on layers, bounded contexts, CQRS, event sourcing, and testing strategies
SKILL.md

Clean Architecture + DDD + Hexagonal

Backend architecture combining DDD tactical patterns, Clean Architecture dependency rules, and Hexagonal ports/adapters for maintainable, testable systems.

This skill is an opinionated synthesis of several related architecture traditions. It is not a single canonical architecture model. Use the original source that matches the design question you are answering: DDD for domain modeling, Hexagonal Architecture for ports/adapters, Clean Architecture for dependency direction, Onion Architecture for domain-centered layering, and CQRS/Event Sourcing only for specific read/write or temporal requirements.

When to Use (and When NOT to)

Use When Skip When
Complex business domain with many rules Simple CRUD, few business rules
Long-lived system (years of maintenance) Prototype, MVP, throwaway code
Team of 5+ developers Solo developer or small team (1-2)
Multiple entry points (API, CLI, events) Single entry point, simple API
Need to swap infrastructure (DB, broker) Fixed infrastructure, unlikely to change
High test coverage required Quick scripts, internal tools

Start simple. Evolve complexity only when needed. Most systems don't need full CQRS or Event Sourcing.

Related skills

More from ccheney/robust-skills

Installs
2.7K
GitHub Stars
43
First Seen
Jan 21, 2026