Skip to content

HigorAlves/orc / codex/orc/content/skills/architecture-patterns

architecture-patterns

Verified

Implement Clean, Hexagonal (Ports & Adapters), and Domain-Driven architecture patterns

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 forRead
Laying out a fresh service into layers with an inward dependency ruleClean Architecturereferences/clean-architecture.md
Wanting to swap infra (DB, payment gateway) without touching business logicHexagonal (Ports & Adapters)references/hexagonal.md
Modelling a complex domain — aggregates, value objects, invariants, eventsDomain-Driven Designreferences/ddd.md
Splitting one model into multiple bounded contexts / multi-service treesDDD strategic + ACLreferences/advanced-patterns.md
Fighting circular imports, leaky entities, or "all logic in the controller"Dependency rules + fixesreferences/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.

TopicFileContents
Clean Architecturereferences/clean-architecture.mdLayer model, directory structure, the dependency rule, full entity → use case → repository → controller implementation, in-memory test adapters
Hexagonal Architecturereferences/hexagonal.mdDomain core + ports + production/test adapters, Onion vs. Clean comparison, domain services
Domain-Driven Designreferences/ddd.mdStrategic + tactical patterns, value objects, aggregate roots, repositories, domain events / transactional outbox, aggregate-design heuristics
Advanced / multi-servicereferences/advanced-patterns.mdMulti-service project tree by bounded context, Anti-Corruption Layer, context map (Open Host / Shared Kernel / Conformist)
Dependency rules & fixesreferences/dependency-rules.mdTroubleshooting 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
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall