# Architecture Patterns

Implement proven backend architecture patterns including Clean Architecture, Hexagonal...

- Repository: https://github.com/foryourhealth111-pixel/Vibe-Skills (3789 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add foryourhealth111-pixel/Vibe-Skills --skill architecture-patterns -g -a claude-code -y`
Codex: `npx skills add foryourhealth111-pixel/Vibe-Skills --skill architecture-patterns -g -a codex -y`
Cursor: `npx skills add foryourhealth111-pixel/Vibe-Skills --skill architecture-patterns -g -a cursor -y`
Gemini CLI: `npx skills add foryourhealth111-pixel/Vibe-Skills --skill architecture-patterns -g -a gemini-cli -y`

## Description

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Architecture Patterns

Master proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design to build maintainable, testable, and scalable systems.

## When to Use This Skill

- Designing new backend systems from scratch
- Refactoring monolithic applications for better maintainability
- Establishing architecture standards for your team
- Migrating from tightly coupled to loosely coupled architectures
- Implementing domain-driven design principles
- Creating testable and mockable codebases
- Planning microservices decomposition

## Core Concepts

### 1. Clean Architecture (Uncle Bob)

**Layers (dependency flows inward):**

- **Entities**: Core business models
- **Use Cases**: Application business rules
- **Interface Adapters**: Controllers, presenters, gateways
- **Frameworks & Drivers**: UI, database, external services

**Key Principles:**

- Dependencies point inward
- Inner layers know nothing about outer layers
- Business logic independent of frameworks
- Testable without UI, database, or external services

### 2. Hexagonal Architecture (Ports and Adapters)

**Components:**

- **Domain Core**: Business logic
- **Ports**: Interfaces defining interactions
- **Adapters**: Implementations of ports (database, REST, message queue)

**Benefits:**

- Swap implementations easily (mock for testing)
- Technology-agnostic core
- Clear separation of concerns

### 3. Domain-Driven Design (DDD)

**Strategic Patterns:**

- **Bounded Contexts**: Separate models for different domains
- **Context Mapping**: How contexts relate
- **Ubiquitous Language**: Shared terminology

**Tactical Patterns:**

- **Entities**: Objects with identity
- **Value Objects**: Immutable objects defined by attributes
- **Aggregates**: Consistency boundaries
- **Repositories**: Data access abstraction
- **Domain Events**: Things that happened

## Clean Architecture Pattern

### Directory Structure

The rest: https://github.com/foryourhealth111-pixel/Vibe-Skills/blob/HEAD/bundled/skills/architecture-patterns/SKILL.md
