hexagonal-clean-architecture

Structure applications using hexagonal, onion, and clean architecture with inward-pointing dependencies.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/vnovakovits/claude-skills --skill hexagonal-clean-architecture-vnovakovits
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hexagonal-clean-architecture
Source: https://github.com/vnovakovits/claude-skills/tree/main/plugins/engineering-practices/skills/hexagonal-clean-architecture
Command: npx skills add https://github.com/vnovakovits/claude-skills --skill hexagonal-clean-architecture-vnovakovits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Business logic often becomes entangled with frameworks, databases, and delivery mechanisms, making applications hard to test, resistant to infrastructure change, and fragile as frameworks evolve. This Skill guides the design of applications where the domain sits at the center and all dependencies point inward. ## Core Features & Use Cases - Layered Architecture Guidance: Defines the four layers (Entities, Use Cases, Interface Adapters, Frameworks & Drivers) and the Dependency Rule that keeps source dependencies pointing inward. - Ports and Adapters Design: Explains how to define application-owned ports (repository, email, clock interfaces) and implement technology-specific adapters, including driving vs driven port distinctions. - Testing Strategy: Maps the testing pyramid to architectural layers — pure domain unit tests, use-case tests with in-memory fakes, adapter tests against real technology, and minimal end-to-end tests. - Use Case: When building an order management service that must serve HTTP, message queue, and CLI clients, use this Skill to place business rules in a framework-free domain layer, define ports for persistence and notifications, and keep ASP.NET or Spring confined to the outer adapter layer. ## Quick Start Ask Claude to structure a new application or review an existing one against hexagonal and clean architecture principles, for example by requesting a ports-and-adapters design for a specific use case.

Frequently Asked Questions about hexagonal-clean-architecture

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

FAQPage Schema
How do I apply hexagonal architecture to a new application?▼

Place entities and business rules in an innermost domain layer, define use cases in an application layer that owns port interfaces, and implement adapters in an outer infrastructure layer. Ensure the domain compiles without any infrastructure project present.

What is the difference between hexagonal, onion, and clean architecture?▼

They are the same idea with different names: Cockburn's Hexagonal Architecture (2005), Palermo's Onion Architecture (2008), and Martin's Clean Architecture (2017). All put the domain at the center and enforce inward-pointing dependencies.

Where should repository interfaces live in clean architecture?▼

Repository interfaces are ports owned by the application or domain layer, defined in the application's vocabulary. Their implementations live in the infrastructure layer, which is the Dependency Inversion Principle in action.

When should I not use hexagonal architecture?▼

Skip it for genuinely simple CRUD over a small model, where DTOs, ports, and mappers cost more than they save. Apply it to parts of the system with non-trivial business logic and allow simpler structures elsewhere.

Why does my domain layer depend on the database framework?▼

This happens when ORM entities are used as domain entities or framework attributes decorate domain types. Map persistence models to domain types at the boundary so the domain has no framework references.