skills/ddd-skills/ddd-event-driven/SKILL.md
Provides comprehensive guidance for event-driven architecture including domain events, event sourcing, CQRS, and event patterns. Use when the user asks about event-driven architecture, needs to implement event-driven systems, or work with domain events.
npx skillsauth add teachingai/agent-skills ddd-event-drivenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill whenever the user wants to:
public record OrderPlacedEvent(
String orderId,
String customerId,
BigDecimal totalAmount,
Instant occurredAt
) implements DomainEvent {}
public class Order extends AggregateRoot {
public void place(List<OrderItem> items) {
// Business logic...
this.status = OrderStatus.PLACED;
registerEvent(new OrderPlacedEvent(this.id, this.customerId, this.total, Instant.now()));
}
}
public class Account {
private BigDecimal balance = BigDecimal.ZERO;
private final List<DomainEvent> changes = new ArrayList<>();
public void apply(MoneyDepositedEvent event) {
this.balance = this.balance.add(event.amount());
}
public static Account reconstitute(List<DomainEvent> events) {
Account account = new Account();
events.forEach(account::apply);
return account;
}
}
Write Side: Read Side:
Command → Aggregate → Events → Event Handler → Read Model (View)
(message bus)
// Save event to outbox table in the same transaction as the aggregate
@Transactional
public void placeOrder(PlaceOrderCommand cmd) {
Order order = Order.place(cmd);
orderRepository.save(order);
outboxRepository.save(new OutboxEntry("OrderPlaced", serialize(order.events())));
}
// A separate poller publishes outbox entries to the message broker
event-driven architecture, domain events, event sourcing, CQRS, outbox pattern, message broker, Kafka, RabbitMQ, eventual consistency, idempotent consumers
development
Guidance for Next.js using the official docs at nextjs.org/docs. Use when the user needs Next.js concepts, configuration, routing, data fetching, or API reference details.
tools
Provides comprehensive guidance for Flask framework including routing, templates, forms, database integration, extensions, and deployment. Use when the user asks about Flask, needs to create web applications, implement routes, or build Python web services.
development
Provides comprehensive guidance for FastAPI framework including routing, request validation, dependency injection, async operations, OpenAPI documentation, and database integration. Use when the user asks about FastAPI, needs to create REST APIs, or build high-performance Python web services.
development
Provides comprehensive guidance for Django framework including models, views, templates, forms, admin, REST framework, and deployment. Use when the user asks about Django, needs to create web applications, implement models and views, or build Django REST APIs.