architecture-paradigm-hexagonal

Installation
SKILL.md

The Hexagonal (Ports & Adapters) Paradigm

When To Use

  • Isolating business logic from external dependencies
  • Systems needing swappable adapters for testing

When NOT To Use

  • Small scripts or utilities without external dependencies
  • Prototypes where port/adapter abstraction adds overhead

When to Employ This Paradigm

  • When you anticipate frequent changes to databases, frameworks, or user interfaces and need the core domain logic to remain stable.
  • When testing the core application requires mocking complex or slow infrastructure components.
  • When the development team needs to provide clear inbound and outbound interfaces for third-party integrations.

Adoption Steps

  1. Define Domain Ports: Identify all interactions with the core domain. Define inbound "driver ports" for actors that initiate actions (e.g., UI, CLI, automated jobs) and outbound "driven ports" for services the application consumes (e.g., database, message bus, external APIs). Express these ports as formal interfaces.
Related skills
Installs
42
GitHub Stars
278
First Seen
Feb 27, 2026