hexagonal-architecture

Define inbound and outbound ports to isolate core domain logic from infrastructure.

1|1|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/zardusai-cyber/zardus_setup --skill hexagonal-architecture-zardusai-cyber
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architecture
Source: https://github.com/zardusai-cyber/zardus_setup/tree/main/ecc/skills/hexagonal-architecture
Command: npx skills add https://github.com/zardusai-cyber/zardus_setup --skill hexagonal-architecture-zardusai-cyber

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hexagonal architecture keeps business logic independent from frameworks, transport, and persistence details by centering the domain and using explicit ports/adapters, enabling easier testing and evolution.

Core Features & Use Cases

  • Clear domain boundaries with a pure domain model.
  • Use-case orchestration through inbound/outbound ports.
  • Edge adapters for HTTP, DB, messaging, and external services.
  • Central composition root to wire adapters and enable replaceability.
  • Strong boundary-driven testing (unit for use-cases, contract tests for ports, integration tests for adapters).

Quick Start

Define a single use-case boundary, identify outbound ports, implement adapters, and wire them in a composition root.

Frequently Asked Questions about hexagonal-architecture

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

FAQPage Schema
How does hexagonal architecture isolate domain logic from infrastructure?

Hexagonal architecture isolates domain logic by defining explicit inbound and outbound ports that act as boundaries, ensuring infrastructure details remain outside the pure core domain. This enables easy replacement and end-to-end testing.

What's the best way to structure ports and adapters for domain-driven design?

The best way to structure ports and adapters is by defining a single use-case boundary, implementing explicit port interfaces, and wiring adapters in a central composition root to enable easy replacement and testing.

How do I test use cases when business logic is decoupled from the database?

You test decoupled use cases by applying boundary-driven testing: unit tests for use cases, contract tests for port interfaces, and integration tests for adapters. This ensures domain logic is validated without infrastructure dependencies.

Can I replace an HTTP adapter with a messaging adapter without changing core logic?

Yes, you can replace an HTTP adapter with a messaging adapter without changing core logic. Explicit port interfaces allow edge adapters for transport and persistence to be swapped in the central composition root without affecting the domain.

When should I not use hexagonal architecture for my application?

You should avoid hexagonal architecture when your application lacks complex domain logic or long-term maintainability requirements. The explicit port interfaces and adapter implementations add structural overhead that may be unnecessary for simple scripts or basic CRUD applications.