From aiee-skills
Tactical DDD patterns for clean Python architecture including Domain Model, Repository, Service Layer, Unit of Work, and Aggregates. Use for backend architecture decisions, implementing data access layers, separating business logic from infrastructure, or reviewing code separation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aiee-skills:arch-dddThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Architectural patterns for building maintainable Python applications with clean separation between business logic and infrastructure.
Architectural patterns for building maintainable Python applications with clean separation between business logic and infrastructure.
"Behavior should drive storage, not the reverse." Focus on what the system does, not just its data model.
The heart of your application - pure business logic, no infrastructure dependencies.
Abstraction over persistent storage with simple interface.
Orchestrates use cases and defines application boundaries.
Atomic operations and transaction lifecycle management.
Consistency boundaries - clusters of objects that must remain consistent together.
Dependencies point inward:
Entrypoints → Service Layer → Domain Model
↓ ↓
Adapters ← ← ← ← ←
| Scenario | Pattern |
|---|---|
| Complex business rules | Domain Model |
| Multiple data sources | Repository |
| Multiple entry points | Service Layer |
| Transaction management | Unit of Work |
| Complex invariants | Aggregates |
When deciding where to place new features, domain ownership typically outweighs infrastructure convenience.
Decision criteria (priority order):
Example:
| Option | Domain | Data | Infrastructure | Decision |
|---|---|---|---|---|
| gateway-service | No (real-time) | No | Yes (has DB) | Reject |
| migrations-service | No (schemas) | No | Yes (has batch) | Reject |
| analytics-service | Yes (analytics) | Yes (owns data) | No (needs new) | Accept |
Trade-off: Infrastructure setup is one-time cost; wrong service boundaries compound over time.
Splitting an aggregate root + children across two requests re-introduces the failure class the boundary prevents: failed child → orphaned parent; retry without checking → duplicate parent. Prefer the single transactional nested-create endpoint. Verify the contract exists before assuming split endpoints are required; a retry id-guard treats the symptom, not the disease.
See reference.md § "Aggregate Write Boundaries — Client Side" for failure modes and retry-guard analysis. See arch-decision-records § "API Consumption Patterns" for the client-side consumption rule.
See reference.md for detailed explanations and examples.md for implementations.
npx claudepluginhub ai-enhanced-engineer/aiee-team --plugin aiee-teamProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.