cqrs-eda
БесплатноБез исполняемых скриптовНе проверенWires a python-cqrs domain event, notification, transactional outbox, and transactional inbox, and runs independent domain handlers concurrently. Use when a…
от vadikko2322 установки в других каталогахОб этом скилле
Event-driven delivery
Read cqrs-setup before writing these types. This file builds the feature that skill already picked: a domain event, a notification, the outbox, the inbox, or parallel domain handlers.
The package is already installed. Do not add an install step.
Put the types in app/events.py. Keep the handler in app/handlers.py and the registration in app/bootstrap.py.
Steps
- A fact inside this process is a
cqrs.DomainEvent. A fact for another service is acqrs.NotificationEventwith keyword-onlyevent_name,topic, andpayload. A dataclass payload is for a message this process builds. - For a domain event, append it on the handler
eventsproperty. Register eachcqrs.EventHandlerwithdomain_events_mapperoncqrs.bootstrap.requests.bootstrap.EventMap.bindappends, so several handlers may listen. The mediator emitseventsafterhandlereturns and beforesendreturns. Keep those handlers idempotent when the command can be retried. WithScopeStrategy.SENDthey run one after another on the command session. Independent handlers are the parallel section below. - For a notification that may be lost, append the
NotificationEventoneventsand pass a realmessage_brokerto bootstrap. The default broker drops the message. Use this for a metric or a best-effort signal. - For a notification that must commit with the business row, leave
eventsempty for that notification. In the handler,session.addthe business row andrepository.addthe notification on the same session.await repository.commit()commits both when this handler is not the one an inbox worker sends. A handler the inbox worker sends must not commit. The worker commits the business rows, the outbox rows, and the inbox status together. A separate process runscqrs.EventProducer, then commits the repository so status updates stick. Registerevent_nameon anOutboxedEventMapbefore the first read or write. A second registration of the same name raisesKeyError. Prefercqrs.SqlAlchemyOutboxedEventRepositorywithpython-cqrs[sqlalchemy], orcqrs.outbox.sqlmodel.SqlModelOutboxedEventRepositorywithpython-cqrs[sqlmodel]. Use one storage extra for the process. - For an inbox, presentation calls
InboxRepository.addwith a batch of(message_id, message)and the caller commits.addreturnslist[bool].Truemeans inserted.Falsemeans(message_id, message_name)is already stored, including earlier in the same batch. An empty batch returns[]. Ack, or HTTP 202, happens after that commit. AFalseis still ack or 202. Another process constructsInboxProcessorwith the repository for that batch session, theInboxMessageMap, and the mediators.processtakes the row. It sends aRequestthroughRequestMediatoror an event throughEventMediator. The handler is the one already registered. The processor does not commit. The worker commits the business rows and the status together. Requests and domain events register under the class name. Notification events register underevent_name. - Events that arrive from a broker and must finish before ack use
cqrs.bootstrap.events.bootstrapandawait mediator.send(event)onEventMediator. That path is not the inbox. The inbox is the path that only stores the message and runs it later.
Where the calls live
The command handler writes the business row and, when the fact must leave the process, the outbox row. It does not publish. It may append a DomainEvent for an in-process reaction. It does not append the same notification it already passed to repository.add.
domain_events_mapper belongs on cqrs.bootstrap.requests.bootstrap, next to commands_mapper. Broker facts that must run to completion before ack use a separate EventMediator from cqrs.bootstrap.events.bootstrap.
The publisher process owns EventProducer. After each batch it commits the outbox repository. Rows that fail until flush_counter reaches five leave the selectable batch. Inspect those rows. The producer will not yield them again. On PostgreSQL, MySQL 8.0 or later, and MariaDB 10.6 or later, get_many holds the batch with FOR UPDATE SKIP LOCKED until that commit or a rollback.
Presentation owns add and the commit. The worker owns get_many, InboxProcessor.process, and a later commit. Do not share one session between them. open_scope is only when the presentation transaction also writes another row. A plain add does not need it.
SqlAlchemyInboxRepository needs python-cqrs[sqlalchemy]. SqlModelInboxRepository needs python-cqrs[sqlmodel]. Both are lazy on cqrs. Register message names on an InboxMessageMap instance when tests must not share the process-global map. The same rule applies to OutboxedEventMap. JSON is the default codec.
A request-handler exception in the worker rolls back only that row's savepo
Установить cqrs-eda в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл cqrs-eda?
Wires a python-cqrs domain event, notification, transactional outbox, and transactional inbox, and runs independent domain handlers concurrently. Use when a fact stays in this process, must reach another service, must survive at-least-once delivery, or when handler order does not matter.
Как установить скилл cqrs-eda?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cqrs-eda запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic