# Skill: architecture-patterns

> Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.

*Digest only: full text not redistributed here.*

## Outline
- When to Use This Skill
- Core Concepts
- 1. Clean Architecture (Uncle Bob)
- 2. Hexagonal Architecture (Ports and Adapters)
- 3. Domain-Driven Design (DDD)
- Detailed patterns and worked examples
- Testing — In-Memory Adapters
- Troubleshooting
- Use case tests require a running database
- Circular imports between layers
- Framework decorators appearing in domain entities
- All logic ending up in controllers
- Value objects raising errors too late
- Context bleed across bounded contexts
- Advanced Patterns
- Related Skills
