arch-hexagonal

Isolate domain logic from infrastructure using ports and adapters.

1|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/CybLow/pypaginate --skill arch-hexagonal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: arch-hexagonal
Source: https://github.com/CybLow/pypaginate/tree/main/.opencode/skills/arch-hexagonal
Command: npx skills add https://github.com/CybLow/pypaginate --skill arch-hexagonal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hexagonal Architecture isolates the application core from external concerns by defining ports (interfaces) and adapters (inbound/outbound) to decouple business logic from technology choices.

Core Features & Use Cases

  • Ports define contracts using Python protocols that the core relies on
  • Inbound adapters trigger use cases and orchestrate domain logic
  • Outbound adapters connect to databases, APIs, and other external systems
  • Enables easy swapping of infrastructure without touching domain code
  • Improves testability by allowing in-memory or mock adapters

Quick Start

Model your domain with ports and adapters to decouple business logic from infrastructure.

Frequently Asked Questions about arch-hexagonal

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

FAQPage Schema
How do I isolate domain logic from infrastructure using ports and adapters?

To isolate domain logic using ports and adapters, define protocol-based contracts for the core domain and use inbound and outbound adapters to connect external systems, ensuring infrastructure can be swapped without touching domain code.

When should I use hexagonal architecture for my application?

Use hexagonal architecture when an application has multiple entry points like HTTP, CLI, or messaging and requires interchangeable external resources, enabling strict separation of concerns between the core domain, use cases, and adapters.

How does dependency inversion improve testability in software design?

Dependency inversion improves testability by enforcing protocol-based contracts between the core domain and adapters, allowing you to easily substitute real databases or APIs with in-memory or mock adapters during testing.

What is the difference between inbound and outbound adapters in software architecture?

Inbound adapters trigger use cases and orchestrate domain logic from entry points like HTTP or CLI, while outbound adapters connect the core domain to external systems like databases and APIs through defined ports.

Can I swap a database in a hexagonal architecture without modifying domain code?

Yes, you can swap databases without modifying domain code because hexagonal architecture defines outbound ports as protocol-based contracts, meaning new database adapters only need to implement the existing interface.

What are the limitations of applying hexagonal architecture to a small application?

Applying hexagonal architecture to a small application introduces overhead through additional protocol-based contracts and adapter layers, which may overcomplicate separation of concerns if there are few entry points or interchangeable external resources.