hexagonal-architecture

Apply Hexagonal Architecture patterns to separate domain logic from external adapters.

1|Updated May 14, 2025
One-click install
npx skills add https://github.com/fcnatra/VibeCoding --skill hexagonal-architecture-fcnatra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architecture
Source: https://github.com/fcnatra/VibeCoding/tree/main/Copilot%20Tools/skills/hexagonal-architecture
Command: npx skills add https://github.com/fcnatra/VibeCoding --skill hexagonal-architecture-fcnatra

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers design and refactor applications using the Hexagonal Architecture (Ports and Adapters) pattern, promoting a clear separation between domain logic and external concerns like UIs, databases, and APIs.

Core Features & Use Cases

  • Architectural Guidance: Provides rules for distinguishing between core domain logic and external adapters.
  • Layer Responsibilities: Clearly defines the roles of Domain, Application, and Adapter layers.
  • Naming Conventions: Offers practical naming suggestions for different types of components and data transfer objects.
  • Anti-Pattern Identification: Highlights common mistakes to avoid when implementing Hexagonal Architecture.
  • Testing Strategy: Recommends an effective approach to testing different layers of the architecture.
  • Use Case: When starting a new project or refactoring an existing one to improve testability and maintainability, use this Skill to guide the structural design.

Quick Start

Apply the hexagonal-architecture skill to design a new application structure, focusing on separating domain logic from infrastructure concerns.

Frequently Asked Questions about hexagonal-architecture

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

FAQPage Schema
What is hexagonal architecture and how does it separate domain logic from infrastructure?

Hexagonal architecture is a structural pattern that isolates core domain logic from external infrastructure concerns like databases and UIs using ports and adapters. This separation ensures application logic remains decoupled, maintainable, and independently testable.

How do I structure a new application using ports and adapters for better testability?

To structure an application with ports and adapters, define distinct Domain, Application, and Adapter layers. Establish clear naming conventions for components and data transfer objects to enforce boundaries and ensure system maintainability.

What is the difference between hexagonal architecture and clean architecture for software design?

Both promote domain-infrastructure separation, but hexagonal architecture specifically emphasizes ports and adapters to route interactions, whereas clean architecture focuses broadly on dependency inversion across concentric layers to protect use cases.

What are common anti-patterns to avoid when implementing hexagonal architecture?

Common hexagonal architecture anti-patterns include leaking infrastructure dependencies into the domain layer and misclassifying adapter responsibilities. Identifying these mistakes early prevents tight coupling and preserves the core application structure's integrity.

When should I refactor an existing application to use a domain-driven design structure?

Refactor to a domain-driven design structure when testability and maintainability degrade due to mixed domain and infrastructure logic. Applying hexagonal architecture decouples the system, enabling isolated unit testing and clearer component boundaries.

What testing strategy should I use for applications with separated domain and adapter layers?

Test separated domain and adapter layers by mocking external ports to isolate core business logic validation. Infrastructure adapters require integration tests, ensuring the application structure remains decoupled and thoroughly covered across boundaries.