hexagonal-architect

Implement .NET solutions with Hexagonal Architecture separating domain, application, and infrastructure concerns.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/lcmassena/AI_Skills --skill hexagonal-architect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architect
Source: https://github.com/lcmassena/AI_Skills/tree/main/hexagonal-architect
Command: npx skills add https://github.com/lcmassena/AI_Skills --skill hexagonal-architect

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Hexagonal architecture provides a disciplined approach to building scalable .NET applications by cleanly separating core domain logic from infrastructure concerns, enabling easier testing and evolution.

Core Features & Use Cases

Core features include a structured layering across Domain, Application, Adapters, and API with CQRS, Mediator-based handlers, FluentValidation, FluentResults, and clear port contracts; it supports Azure Functions patterns, repository adapters, service bus, and storage integrations; it also codifies DevOps, infrastructure, auditing, and API testing practices.

Quick Start

Start by scaffolding a new .NET Hexagonal Architecture project following the folder structure and conventions described, then implement Domain, Application, Adapters, and API layers using the patterns shown.

Frequently Asked Questions about hexagonal-architect

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

FAQPage Schema
How do I structure a .NET application using hexagonal architecture to separate domain logic from infrastructure?

To structure a .NET app with hexagonal architecture, you separate concerns across Domain, Application, Adapters, and API layers using Ports and Adapters. This enforces strict dependency rules so core domain logic remains isolated from infrastructure changes.

How do I implement CQRS with MediatR and FluentValidation in a .NET hexagonal architecture project?

You implement CQRS by using MediatR-based handlers for command and query dispatch within the Application layer, while applying FluentValidation to enforce business rules and FluentResults to handle execution outcomes and return Result objects.

Can I use hexagonal architecture patterns with Azure Functions and service bus integrations?

Yes, hexagonal architecture supports Azure Functions patterns by wrapping them as infrastructure adapters. It includes specific sub-skills for service bus and storage integrations, ensuring cloud functions connect to core domain logic through defined ports.

What is the best way to handle errors and validation results in a .NET clean architecture solution?

The best way to handle errors in a .NET clean architecture solution is using FluentResults to return Result objects instead of throwing exceptions. This pattern propagates validation failures from FluentValidation through MediatR handlers to the API layer cleanly.

Does implementing ports and adapters in .NET require specific repository and auditing sub-skills?

Implementing ports and adapters in .NET involves supporting sub-skills for repository adapters, auditing, and infrastructure setup. These components manage data persistence and track changes while maintaining strict boundary rules between application and infrastructure layers.

When should I not use hexagonal architecture for my .NET application?

You should avoid hexagonal architecture for simple .NET applications or prototypes where strict layering, CQRS, and MediatR overhead outweigh the benefits. It is designed for scalable, complex domains requiring long-term maintainability and heavy testing.