hexagonal-architecture

Enforce Hexagonal Architecture rules for ports, adapters, and inward dependencies.

1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/manolakis/agents-and-skills --skill hexagonal-architecture-manolakis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architecture
Source: https://github.com/manolakis/agents-and-skills/tree/main/.github/skills/hexagonal-architecture
Command: npx skills add https://github.com/manolakis/agents-and-skills --skill hexagonal-architecture-manolakis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures your application's architecture adheres to the Hexagonal Architecture pattern, promoting maintainability, testability, and separation of concerns.

Core Features & Use Cases

  • Architectural Guidance: Provides rules and decision trees for structuring code according to Hexagonal principles.
  • Boundary Enforcement: Helps prevent infrastructure concerns from leaking into the domain and use-case layers.
  • Use Case: When designing a new feature or refactoring existing code, consult this Skill to verify that domain logic remains framework-agnostic and dependencies flow inwards.

Quick Start

Verify that the current code adheres to the hexagonal architecture principles by checking dependency directions and layer responsibilities.

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 enforce clean architecture patterns?

Hexagonal architecture is a structural pattern that isolates domain logic from infrastructure by defining ports and adapters. It enforces clean architecture by ensuring dependencies point inward, keeping use-case layers framework-agnostic and highly testable.

How do I structure code to follow the ports and adapters pattern correctly?

To structure code for the ports and adapters pattern, use decision trees for class placement to assign logic to the domain or infrastructure. Define clear boundaries for ports, ensuring outward-facing adapters interact with external systems without leaking dependencies inward.

How can I verify my domain logic remains framework-agnostic during refactoring?

Verify framework-agnostic domain logic by checking that dependencies flow strictly inwards. Use a comprehensive checklist to confirm infrastructure concerns have not leaked into the domain, ensuring use cases remain independent of specific frameworks or platforms.

How does dependency injection enforce the inward dependency direction in clean architecture?

Dependency injection enforces inward dependency direction by providing infrastructure implementations through defined ports. This mechanism prevents direct dependencies on external tools, ensuring the application core remains isolated and testable.

What are common pitfalls when applying domain-driven design with hexagonal architecture?

Common pitfalls in domain-driven design with hexagonal architecture include letting infrastructure leak into the domain layer and improperly defining boundaries. Avoid these by applying decision trees for port creation and verifying layer responsibilities.

When should I not use the hexagonal architecture pattern for my application?

Hexagonal architecture may not suit applications with minimal domain logic or simple CRUD operations, as the overhead of defining ports and adapters outweighs benefits. It is best for complex domains requiring strict separation of concerns and high maintainability.