architecture-patterns

Models backend architecture to separate domain, use case, and adapter layers.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/LuizEduPP/skills --skill architecture-patterns-luizedupp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-patterns
Source: https://github.com/LuizEduPP/skills/tree/main/architecture-patterns
Command: npx skills add https://github.com/LuizEduPP/skills --skill architecture-patterns-luizedupp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It keeps backend services maintainable by separating domain, use case, and infrastructure concerns to avoid dependency leaks, tangled monoliths, and untestable layers.

Core Features & Use Cases

  • Pattern Catalog: Clean Architecture, Hexagonal Architecture, and DDD tactical patterns provide layered blueprints that keep dependencies flowing inward and allow adapters to be swapped without touching core logic.
  • Port-and-adapter discipline ensures use cases import only domain interfaces while infrastructure binds concrete implementations, preventing circular imports and enabling in-memory test doubles.
  • Use Case Example: Apply this when designing a new microservice, refactoring a monolith, or defining bounded contexts and dependency rules before coding to keep each layer pure and testable.

Detailed context maps, DI wiring, and Anti-Corruption Layer examples live in references/advanced-patterns for deeper study.

Quick Start

Describe clean architecture layers and bounded contexts for designing a new order management microservice.

Frequently Asked Questions about architecture-patterns

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

FAQPage Schema
How do I separate domain logic from infrastructure when refactoring a monolith?

To separate domain logic from infrastructure during a monolith refactoring, apply clean architecture and port-and-adapter boundaries. This ensures dependencies flow inward and use cases import only domain interfaces, keeping core business logic framework-agnostic and testable.

What is the best way to design bounded contexts for new microservices?

The best way to design bounded contexts for new microservices is using Domain-Driven Design tactical artifacts. Document context maps and dependency rules early to keep each layer pure, prevent circular imports, and enable in-memory test doubles.

How does hexagonal architecture prevent dependency leaks in backend services?

Hexagonal architecture prevents dependency leaks by enforcing port-and-adapter discipline. Use cases import only domain interfaces while infrastructure binds concrete implementations, ensuring core business logic remains framework-agnostic and allowing adapters to be swapped without touching the domain.

When do I need an Anti-Corruption Layer in microservices?

You need an Anti-Corruption Layer when integrating new microservices with legacy systems to prevent domain pollution. It isolates external models by translating them into your bounded context, ensuring use case and domain layers remain pure and testable.

How do I structure clean architecture layers for an order management service?

Structure clean architecture layers for an order management service by separating domain, use case, and adapter components. Define port-and-adapter boundaries so dependencies flow inward, keeping business logic framework-agnostic and enabling in-memory test doubles for use cases.

Why should use cases import only domain interfaces in clean architecture?

Use cases should import only domain interfaces in clean architecture to enforce dependency rules and prevent circular imports. This port-and-adapter discipline allows infrastructure to bind concrete implementations and enables in-memory test doubles for isolated testing.