Skip to content
Back to skills

Architecture Patterns

ASecurity

Implement Clean, Hexagonal (Ports & Adapters), and Domain-Driven architecture patterns. Use when designing service layers, refactoring monoliths into bounded contexts, or fixing layer dependency cycles.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 9, 2026
ai-agentsgodebuggingrefactoringdatabasebackend

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned October 9, 2026

npx -y skills add HigorAlves/orc --skill architecture-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Architecture Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Architecture Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/higoralves-architecture-patterns/badge)](https://www.skillsdirectory.com/skills/higoralves-architecture-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: architecture-patterns
description: Implement Clean, Hexagonal (Ports & Adapters), and Domain-Driven architecture patterns. Use when designing service layers, refactoring monoliths into bounded contexts, or fixing layer dependency cycles.
---

# Architecture Patterns

Master proven backend architecture patterns — Clean Architecture, Hexagonal (Ports & Adapters), and Domain-Driven Design — to build maintainable, testable, scalable systems.

**Given:** a service boundary or module to architect.
**Produces:** layered structure with clear dependency rules, interface definitions, and test boundaries.

## When to Use This Skill

- Designing new backend services or microservices from scratch
- Refactoring monolithic applications where business logic is entangled with ORM models or HTTP concerns
- Establishing bounded contexts before splitting a system into services
- Debugging dependency cycles where infrastructure code bleeds into the domain layer
- Creating testable codebases where use-case tests do not require a running database
- Implementing DDD tactical patterns (aggregates, value objects, domain events)

## Choosing a Pattern

| If you are… | Reach for | Read |
|---|---|---|
| Laying out a fresh service into layers with an inward dependency rule | Clean Architecture | `references/clean-architecture.md` |
| Wanting to swap infra (DB, payment gateway) without touching business logic | Hexagonal (Ports & Adapters) | `references/hexagonal.md` |
| Modelling a complex domain — aggregates, value objects, invariants, events | Domain-Driven Design | `references/ddd.md` |
| Splitting one model into multiple bounded contexts / multi-service trees | DDD strategic + ACL | `references/advanced-patterns.md` |
| Fighting circular imports, leaky entities, or "all logic in the controller" | Dependency rules + fixes | `references/dependency-rules.md` |

The three patterns are complementary, not exclusive: Clean Architecture gives the layering, Hexagonal names the boundary interfaces (ports/adapters), and DDD fills the inner layers with rich domain models. A typical service uses all three.

## Reference Index

Read the relevant `references/<topic>.md` file on demand when you need that detail — do not load them all up front.

| Topic | File | Contents |
|---|---|---|
| Clean Architecture | `references/clean-architecture.md` | Layer model, directory structure, the dependency rule, full entity → use case → repository → controller implementation, in-memory test adapters |
| Hexagonal Architecture | `references/hexagonal.md` | Domain core + ports + production/test adapters, Onion vs. Clean comparison, domain services |
| Domain-Driven Design | `references/ddd.md` | Strategic + tactical patterns, value objects, aggregate roots, repositories, domain events / transactional outbox, aggregate-design heuristics |
| Advanced / multi-service | `references/advanced-patterns.md` | Multi-service project tree by bounded context, Anti-Corruption Layer, context map (Open Host / Shared Kernel / Conformist) |
| Dependency rules & fixes | `references/dependency-rules.md` | Troubleshooting symptoms, DI container wiring, detecting & breaking dependency cycles |

## Related Skills

- `microservices-patterns` — Apply these architecture patterns when decomposing a monolith into services
- `cqrs-implementation` — Use Clean Architecture as the structural foundation for CQRS command/query separation
- `saga-orchestration` — Sagas require well-defined aggregate boundaries, which DDD tactical patterns provide
- `event-store-design` — Domain events produced by aggregates feed directly into an event store

Files in this skill

  • SKILL.md3.6 KB
  • references/advanced-patterns.md8.1 KB
  • references/clean-architecture.md8.6 KB
  • references/ddd.md6.9 KB
  • references/dependency-rules.md4.4 KB
  • references/hexagonal.md4.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…