architecture-patterns

Implements Clean Architecture, Hexagonal Architecture, and Domain-Driven Design patterns for backend systems.

Updated Jun 22, 2026
One-click install
npx skills add https://github.com/aicodepro/ai-agent-nexi --skill architecture-patterns-aicodepro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-patterns
Source: https://github.com/aicodepro/ai-agent-nexi/tree/main/agent/skills/architecture-patterns
Command: npx skills add https://github.com/aicodepro/ai-agent-nexi --skill architecture-patterns-aicodepro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Backend codebases often become tightly coupled to frameworks and databases, making them hard to test, maintain, and refactor. This Skill provides proven architecture patterns that keep business logic independent of infrastructure concerns. ## Core Features & Use Cases - Clean Architecture: Organize code into entities, use cases, interface adapters, and frameworks with dependencies pointing inward. - Hexagonal Architecture: Define ports and adapters so implementations like PostgreSQL or Stripe can be swapped or mocked for testing. - Domain-Driven Design: Model domains with entities, value objects, aggregates, repositories, and domain events using a ubiquitous language. - Use Case: When refactoring a monolithic application where business logic is tangled in controllers, apply these patterns to extract a testable domain core with thin controllers delegating to use cases. ## Quick Start Ask the assistant to design a new backend module for order processing using Clean Architecture with a repository interface and a PostgreSQL adapter.

Frequently Asked Questions about architecture-patterns

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

FAQPage Schema
How do I implement Clean Architecture in Python?

Structure the project into domain entities, use cases, adapters, and infrastructure layers with dependencies pointing inward. Define abstract repository interfaces in the domain layer and implement them in adapters, keeping business rules free of framework code.

What is the difference between Clean Architecture and Hexagonal Architecture?

Clean Architecture organizes code into concentric layers with an inward dependency rule, while Hexagonal Architecture centers the domain and connects it through ports and adapters. Both keep business logic independent of frameworks and infrastructure.

How do I make a repository testable without a database?

Define the repository as an abstract port interface in the domain layer, then inject a mock or in-memory adapter during tests. The use case depends only on the interface, so no real database connection is required.

When should I not use Clean Architecture?

Avoid full Clean Architecture for simple CRUD applications where the layering overhead outweighs the benefits. Over-engineering small services with entities, use cases, and adapters adds complexity without improving maintainability.

What is an anemic domain model and why is it a problem?

An anemic domain model contains entities with only data and no behavior, pushing business logic into services or controllers. Rich domain models place behavior alongside data, enforcing rules like order validation inside the entity itself.