hexagonal-architecture

Decouple core domain logic from infrastructure using ports and adapters.

20|3|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/DVNghiem/FlowDeck --skill hexagonal-architecture-dvnghiem
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architecture
Source: https://github.com/DVNghiem/FlowDeck/tree/main/src/skills/hexagonal-architecture
Command: npx skills add https://github.com/DVNghiem/FlowDeck --skill hexagonal-architecture-dvnghiem

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Decouples core domain logic from infrastructure to solve rigidity and testability challenges.

Core Features & Use Cases

  • Encourages a clean domain model that remains independent of frameworks.
  • Enables multiple inbound/outbound adapters to swap technologies without touching business rules.
  • Use Cases: Integrating with databases, messaging systems, and UI frameworks while keeping domain pure.

Quick Start

Design domain models with pure logic first, define inbound and outbound ports, implement adapters, and wire them at startup to enable swapping frameworks.

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 infrastructure to improve testability?

The hexagonal architecture solves rigidity and testability challenges by decoupling core domain logic from infrastructure, ensuring your business rules remain independent of frameworks, databases, and messaging systems while enabling interchangeable adapters.

How do I structure clean architecture with inbound and outbound ports?

You structure clean architecture by designing pure domain models first, defining inbound and outbound ports as interfaces, and implementing adapters around them to swap technologies without touching business rules.

Can I swap databases and messaging systems without rewriting business rules?

Yes, you can swap databases and messaging systems without rewriting business rules by implementing multiple interchangeable adapters around clearly defined outbound ports, ensuring the core domain model remains pure and independent of specific infrastructure technologies.

How do I wire multiple adapters using dependency injection for hexagonal architecture?

You wire adapters using dependency injection at startup to connect inbound and outbound ports with their respective technology implementations, enabling framework independence and allowing seamless swapping of databases or messaging systems.

What is the difference between clean architecture and ports-and-adapters for domain models?

Ports-and-adapters explicitly focuses on defining inbound and outbound ports to isolate the domain model, while clean architecture is a broader pattern; both achieve framework independence by decoupling core logic from infrastructure.

When should I not use hexagonal architecture for my software design?

You should avoid hexagonal architecture when your project lacks complex domain logic or requires integrating with multiple interchangeable databases, messaging systems, or UI frameworks, as the architectural overhead outweighs the testability benefits.