# DDD & Event Sourcing Patterns What LLMs get subtly wrong in event-sourced systems. Based on actual code review findings. ## Why This Exists LLMs know the textbook definitions of event sourcing and DDD. But they make subtle mistakes: - Adding `DateTime.utc_now()` in apply functions (breaks replay determinism) - Creating `OrderUpdated` events with a changes map (CRUD-in-disguise) - Treating projections as source of truth - Suggesting "fixes" to immutable events - Making aggregates too large (data grouping vs consistency boundary) - Multi-aggregate coordination in services without saga patterns This checklist catches those mistakes. ## Contents - `DDD-CHECKLIST.md` - Review prompts covering: - Replay Determinism (CRITICAL) - Event Design - Aggregate Boundaries - Projections - Idempotency - Process Managers / Sagas - Elixir/OTP Specific - Anti-patterns table ## Integration ```yaml # In your review workflow patterns-repo: rodin/ddd-patterns patterns-files: '.' ``` ## License MIT