architecture-patterns

Design backend architectures with Clean Architecture, Hexagonal, and DDD patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) components.

What problem does it solve?

This Skill consolidates proven backend architecture patterns (Clean Architecture, Hexagonal, and DDD) to help you design maintainable, testable, and scalable systems.

Core Features & Use Cases

  • Clear guidance on layer boundaries and dependency direction
  • Ports and adapters to swap implementations easily
  • Domain-driven design concepts (entities, aggregates, repositories, events)
  • Framework-agnostic patterns for future-proof architectures

Quick Start

Outline a new backend with domain core, use cases, adapters, and infrastructure layers.

Frequently Asked Questions about architecture-patterns

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

FAQPage Schema
How do I design a maintainable backend architecture?

Backend architecture relies on clear separation of concerns across layers—domain logic, use cases, adapters, and infrastructure—with dependencies pointing inward. Clean Architecture and Hexagonal patterns achieve this by isolating business rules from frameworks, enabling testability and future-proofing.

What's the difference between Clean Architecture and Hexagonal Architecture?

Both enforce inward-pointing dependencies and framework independence. Hexagonal (ports and adapters) emphasizes swappable implementations at system boundaries; Clean Architecture adds explicit layer structure. Both solve the same core problem—loose coupling and maintainability—with slightly different terminology.

How do I refactor a monolith into loosely coupled services?

Start by mapping domain boundaries using Domain-Driven Design concepts: identify entities, aggregates, and repositories within your monolith. Then establish clear adapters (ports) between domains, migrate each bounded context to its own layer or service, and ensure dependencies flow only toward the core domain logic.

When should I apply Domain-Driven Design to my backend?

Apply DDD when your system has complex business logic, multiple team domains, or long-term maintainability needs. DDD clarifies domain boundaries through aggregates, entities, and repositories—reducing coupling between teams and making architecture changes safer as requirements evolve.

Can I use these architecture patterns with any framework?

Yes. Clean Architecture, Hexagonal, and DDD are framework-agnostic patterns. They specify layer boundaries and dependency direction, not technology choices. Ports and adapters decouple your domain from frameworks, so you can swap implementations—database, web server, messaging—without rewriting core logic.

What's the fastest way to outline a new backend system?

Define your domain core first: identify entities, use cases, and aggregates. Then add adapters (ports) for external dependencies—database, API clients, messaging. Finally, layer infrastructure around them. This skeleton enforces dependency direction and testability from the start, avoiding rework.