hexagonal-architecture

Design decoupled domain logic with ports-and-adapters architecture.

138|6|Updated Jan 25, 2025
One-click install
npx skills add https://github.com/yamcodes/arkenv --skill hexagonal-architecture-yamcodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architecture
Source: https://github.com/yamcodes/arkenv/tree/main/skills/hexagonal-architecture
Command: npx skills add https://github.com/yamcodes/arkenv --skill hexagonal-architecture-yamcodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hexagonal architecture (Ports & Adapters) keeps business logic independent from frameworks, transport, and persistence details. It ensures the core domain depends only on abstract ports, while adapters implement concrete I/O and infrastructure.

Core Features & Use Cases

  • Define clear inbound and outbound ports to model use cases and dependencies.
  • Implement pure orchestration in use cases with ports injected at the edges.
  • Wire a single composition root to bind adapters to ports and enable testable architectures.

Quick Start

Define a single use-case boundary with input/output DTOs and wire inbound and outbound adapters through a composition root.

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 keep domain logic decoupled?

Hexagonal architecture, or ports-and-adapters, keeps business logic independent from frameworks and infrastructure by ensuring the core domain depends only on abstract ports, while adapters implement concrete I/O and persistence details.

How do I structure use cases and ports for a multi-language service?

Define clear inbound and outbound ports to model use cases and dependencies, implement pure orchestration in use cases with ports injected at the edges, and wire a single composition root to bind adapters to ports.

Can I apply ports-and-adapters architecture to TypeScript, Java, Kotlin, and Go services?

Yes, hexagonal architecture applies to multi-language services across TypeScript, Java, Kotlin, and Go, enabling use-case orchestration with clear boundaries and interchangeable adapters for each language ecosystem.

What's the best way to wire adapters to ports in a hexagonal architecture?

Wire a single composition root to bind adapters to ports. This approach enables testable architectures by defining inbound and outbound ports, domain models, and adapter implementations with explicit wiring and tests.

When should I not use hexagonal architecture for software design?

Hexagonal architecture adds structural overhead through defining inbound and outbound ports, a composition root, domain models, and adapter implementations with explicit wiring and tests, making it excessive for simple or prototype-level services.

Why does my domain logic depend on framework or persistence details?

Your domain logic lacks decoupled boundaries. Hexagonal architecture solves this by ensuring the core domain depends only on abstract ports, while adapters implement concrete I/O and infrastructure details independently.