hexagonal-architecture

Enforce ports and adapters to decouple Java domain logic from frameworks.

203|35|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/rrezartprebreza/spring-boot-skills --skill hexagonal-architecture-rrezartprebreza
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architecture
Source: https://github.com/rrezartprebreza/spring-boot-skills/tree/main/skills/hexagonal-architecture
Command: npx skills add https://github.com/rrezartprebreza/spring-boot-skills --skill hexagonal-architecture-rrezartprebreza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Decouples domain logic from framework details by enforcing ports and adapters, enabling pure domain models and clear boundaries.

Core Features & Use Cases

  • Defines a pure domain layer with domain model, ports (in/out), and a dedicated application layer orchestrating use cases, while allowing Spring or other frameworks in the infrastructure layer.
  • Provides a structured package layout for domain (model, port/in, port/out, service), application (usecase), and infrastructure (persistence, web, external).
  • Enables clean testing and substitution of adapters, promoting easier maintenance and evolution of codebases.

Quick Start

Organize your Java project into domain, application, and infrastructure layers with clear ports and adapters.

Frequently Asked Questions about hexagonal-architecture

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

FAQPage Schema
How do I decouple domain logic from Spring Boot framework details in Java?

To decouple domain logic from Spring Boot, apply hexagonal architecture by enforcing a zero-Spring domain layer with well-defined driving and driven ports, allowing framework dependencies only within the infrastructure layer.

What is the best package layout for ports and adapters in a Java project?

A structured ports and adapters layout organizes a Java project into domain, application, and infrastructure layers, containing dedicated packages for model, port/in, port/out, usecase, persistence, web, and external components.

Can I use hexagonal architecture with domain-driven design for clean testing?

Hexagonal architecture supports domain-driven design by isolating pure domain models and enabling clean testing through the easy substitution of infrastructure adapters.

Do I need to remove all Spring annotations from my domain layer to apply clean architecture?

Yes, applying clean architecture enforces a zero-Spring domain layer, creating a strict boundary that keeps core business rules pure and confines all framework dependencies to the infrastructure layer.