architecture-patterns

Design backend service boundaries and dependency rules for clean, hexagonal, and DDD architectures.

4|1|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/xtrm-dev/specialists --skill architecture-patterns-xtrm-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-patterns
Source: https://github.com/xtrm-dev/specialists/tree/main/.xtrm/skills/optional/architecture-design/architecture-patterns
Command: npx skills add https://github.com/xtrm-dev/specialists --skill architecture-patterns-xtrm-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you structure backend systems so business logic stays independent from frameworks, databases, and delivery concerns.

Core Features & Use Cases

  • Clean Architecture: Define entities, use cases, adapters, and infrastructure with inward-pointing dependencies.
  • Hexagonal Architecture: Model ports and adapters so implementations can change without rewriting core logic.
  • Domain-Driven Design: Shape bounded contexts, aggregates, value objects, and domain events around real business rules.
  • Use Cases: Refactor a monolith with dependency cycles, design a new microservice, or split a system into well-isolated domains with testable boundaries.

Quick Start

Ask for a backend architecture plan that organizes the service into domain, use case, adapter, and infrastructure layers with explicit ports, dependency rules, and test boundaries.

Frequently Asked Questions about architecture-patterns

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

FAQPage Schema
How do I structure a microservice to keep business logic independent from frameworks and databases?

To keep business logic independent, structure your microservice using clean architecture with inward-pointing dependencies. This isolates domain models and use cases from infrastructure, ensuring your core logic remains testable and decoupled from delivery concerns.

What is the best way to refactor a monolith with dependency cycles?

Refactoring a monolith with dependency cycles involves applying hexagonal architecture and ports and adapters. This approach enforces inward-pointing dependencies and anti-corruption boundaries, untangling imports by isolating the domain model from external implementations.

When do I need domain-driven design for my backend architecture?

You need domain-driven design when shaping complex application code into bounded contexts and aggregates. It structures backend systems around real business rules, ensuring maintainable service boundaries and isolated domains for new microservices or monolith refactors.

How does hexagonal architecture model ports and adapters for testable use cases?

Hexagonal architecture models ports and adapters by defining abstract interfaces for external interactions. Implementations can change without rewriting core logic, enforcing isolated domain models and anti-corruption boundaries that yield highly testable use cases.

Can I use clean architecture to split a system into well-isolated domains?

Yes, you can use clean architecture to split a system into well-isolated domains. By defining entities, use cases, adapters, and infrastructure with strict dependency rules, you create clear test boundaries and separated bounded contexts for complex application code.

Why does defining bounded contexts help debug layer and import cycles?

Defining bounded contexts helps debug layer and import cycles by establishing strict anti-corruption boundaries. This isolates domain models and enforces inward-pointing dependencies, preventing external infrastructure concerns from leaking into and entangling core business logic.