# Ddd Aggregate Transaction Boundary

> Use when reviewing or designing transaction boundaries that touch DDD aggregates. Detects the anti-pattern of updating multiple aggregates in one transaction and replaces it with one-aggregate transactions plus eventual consistency, domain events, sagas, or process managers. Trigger for cross-aggregate transactions, `@Transactional` use cases, one transaction one aggregate, or aggregate consistency coordination.

- Skill: `amadeus-dlc/ddd-aggregate-transaction-boundary` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add amadeus-dlc/ddd-aggregate-transaction-boundary`
- Raw SKILL.md: https://api.skillmd.com/api/skills/amadeus-dlc/ddd-aggregate-transaction-boundary/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: amadeus-dlc (https://skillmd.com/u/amadeus-dlc)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/amadeus-dlc/ddd-aggregate-transaction-boundary

---


# DDD Aggregate Transaction Boundary

One transaction should update one aggregate. If multiple aggregates must change, model coordination explicitly.

## Workflow

1. Identify every aggregate loaded or modified by the use case.

2. Mark which aggregate owns the command's true invariant.

3. Keep that aggregate in the synchronous transaction.

4. Move other aggregate updates behind domain events, an outbox, a saga, or a process manager.

5. Define compensating behavior for failures and retries.

## Checks

- A use case that saves two aggregate roots is suspect.

- Repository calls from inside aggregates are violations.

- Database foreign keys do not define aggregate consistency boundaries.

- If the business demands immediate consistency across roots, challenge whether the boundary is wrong.

## Detailed Reference

For non-trivial implementation, review, or refactoring work, read `references/details.md` before giving final guidance. It contains the detailed rules, examples, smells, and migration notes that do not belong in the short invocation body.

## Output

Return the current transaction map, the corrected command flow, events/messages, idempotency strategy, and residual consistency risk.

