arch-events
Skill4 starsChanged 5 months agoMITView on GitHub
Event-driven architecture patterns for Python including Domain Events, Commands, Message Bus, CQRS, and Bootstrap. Use for implementing event sourcing, decoupled workflows, reactive systems, microservices integration, or making decisions about event-driven design.
In this repository101 other files it gives its agents.
- ai-video-understandingSkill
- apple-foundation-modelsSkill
- arch-dddSkill
- arch-decision-recordsSkill
- arch-diagramsSkill
- arch-mvp-roadmapSkill
- arch-python-modernSkill
- aws-app-runnerSkill
- aws-cicd-patternsSkill
- aws-security-hardeningSkill
- azure-functions-python-v2Skill
- azure-identity-m2m-authSkill
- azure-service-bus-messagingSkill
- azure-workflow-execution-modelsSkill
- caddy-tls-proxySkill
- compliance-frameworksSkill
- design-system-workflowSkill
- dev-debugging-strategiesSkill
- dev-standardsSkill
- docker-python-poetrySkill
- docker-pythonSkill
- fastapi-patternsSkill
- ffmpeg-laravel-videoSkill
- formik-yup-react-nativeSkill
- frontend-accessibilitySkill
- frontend-angular-aiSkill
- frontend-angularSkill
- frontend-angular-toolingSkill
- frontend-design-systemsSkill
- frontend-material-chatSkill
- frontend-material-design-3Skill
- frontend-svelteSkill
- gcp-cicd-patternsSkill
- gcp-cloud-runSkill
- gcp-cloudsql-infrastructureSkill
- gcp-finopsSkill
- gcp-observabilitySkill
- gcp-security-hardeningSkill
- github-actions-cicdSkill
- healthkit-biofeedbackSkill
- infra-terraformSkill
- ios-app-qualitySkill
- ios-audio-hapticsSkill
- jest-nestjs-testingSkill
- langchain-azure-openai-patternsSkill
- laravel-auth-hardeningSkill
- laravel-ci-mysqlSkill
- laravel-mix-webpackSkill
- laravel-modern-patternsSkill
- laravel-pint-patternsSkill
- laravel-s3-storageSkill
- laravel-sail-dockerSkill
- mobile-app-deploymentSkill
- mobile-e2e-testingSkill
- mobile-offline-syncSkill
- mobile-push-notificationsSkill
- mobile-video-uploadSkill
- mongodb-asyncmongoclient-patternsSkill
- mongodb-atlas-patternsSkill
- nestjs-patternsSkill
- The first 60 shown.
The file
Files
Event-Driven Architecture
Patterns for building reactive, decoupled Python applications using domain events and commands.
Foundation
These patterns build on domain-driven design principles — see the arch-ddd skill for Repository, Service Layer, Unit of Work, and Aggregates.
Core Patterns
Domain Events
Facts about what happened in the business domain.
- Immutable dataclasses with past-tense naming (
OrderAllocated,OutOfStock) - Aggregates collect events during operations
- Published after transaction commits
Commands
Instructions to perform actions - requests that may fail.
- Imperative naming (
Allocate,CreateBatch) - Exactly one handler per command
- Surface failures as exceptions — a swallowed failure leaves callers unable to tell success from failure
Message Bus
Central routing for commands and events.
- Routes messages to appropriate handlers
- Handlers may emit new events (handler chaining)
- Enables reactive, decoupled systems
CQRS (Command Query Responsibility Segregation)
Separate models for reads and writes.
- Write model: Full domain logic, transactional consistency
- Read model: Denormalized views, optimized for queries
- Event handlers keep read models updated
Bootstrap Pattern
Composition root for dependency wiring.
- Single initialization point for the application
- Wire handlers with their dependencies
- Enables easy testing with fakes
Commands vs Events
| Aspect | Command | Event |
| Intent | "Please do this" | "This happened" |
| Naming | Imperative | Past tense |
| Handlers | Exactly one | Zero or more |
| Failure | Raises exception | Handler fails independently |
When to Apply
| Scenario | Pattern |
| Side effects from domain operations | Domain Events |
| Decoupled workflows | Message Bus |
| Request/response operations | Commands |
| Query performance at scale | CQRS |
| Testable dependency management | Bootstrap |
Event Flow
Command → Handler → Aggregate → Collect Events → UoW Commit → Publish Events
↓
Event HandlersSee reference.md for detailed explanations and examples.md for implementations.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

