cqrs-setup
БесплатноБез исполняемых скриптовНе проверенSets up a service on python-cqrs and picks the feature. Use when writing a command, a query, a domain event, a notification, an outbox, an inbox, a saga, a…
от vadikko2231 установка в других каталогахОб этом скилле
python-cqrs
Pick the feature with the Use when and Skip when pairs in this file. Both a command and a query are cqrs.Request. Event steps are cqrs-eda. Saga steps are cqrs-saga.
The package is already installed. Do not add an install step. Do not copy examples/ into the application. Open the linked file when the short shape is not enough.
Say which feature you picked and which neighbor you skipped, in one sentence, before writing the handler.
Files
Keep one layout. Do not add a directory per pattern.
app/commands.pyholds write models:cqrs.Request[Result]orcqrs.Request[None].app/queries.pyholds read models:cqrs.Request[Result].app/handlers.pyholdscqrs.RequestHandlerclasses. Chains, streams, and event lists live here too.app/bootstrap.pyholdscommands_mapper,queries_mapper, and one call tocqrs.bootstrap.requests.bootstrap.app/sagas.pyexists only when the saga pair is the feature you picked. Step detail iscqrs-saga.app/events.pyexists only when you picked a domain event, a notification, the outbox, or the inbox. Detail iscqrs-eda.
Outbox rows, streams, chains, and events stay in handlers.py and bootstrap.py.
Choose a feature
Read the pair that matches the change. Name the feature you will use and the neighbor that does not fit.
Command
Use when the handler changes state this service owns: create, update, delete, or a state transition.
Skip when the operation is one local SQL statement with no handler dependencies, no events, and no second caller. A function on the repository is enough.
A command with nothing to return is cqrs.Request[None]. A command that must hand back an id or a status is cqrs.Request[Result]. Record a follow-up fact on events or in the outbox. Do not invent a Command base class.
Neighbor: a read is a query. A flow that must undo a finished step in another service is a saga, not a bigger command.
Query
Use when the handler only reads and returns that read.
Skip when the same call writes, publishes, or stores an event. That call is a command.
The type is cqrs.Request[Result]. Leave events empty. Do not insert, update, delete, or publish from a query handler. There is no Query base class. The same mediator sends the query.
Neighbor: if the caller needs the write to happen, do not hide it inside the query.
Domain event
Use when a reaction stays in this process and in the same unit of work, and the command should stay short: a read-model update, an audit row, a follow-up that must finish before the caller continues.
Skip when the next step is the rest of the same function, when nothing else listens, or when the work must reach another service. Skip it for slow I/O (email, HTTP to another service). The caller of send waits for every domain handler.
Append a cqrs.DomainEvent on the handler events property. The default property returns an empty tuple, so define self._events: list[cqrs.Event] = [] in __init__ and override events to return that list. Do not call append on the default. Register each cqrs.EventHandler on domain_events_mapper. EventMap.bind appends, so one event may have many handlers. With ScopeStrategy.SEND, those handlers run one after another on the command's session.
Neighbor: another service, or a message that must not be lost, is a notification plus the outbox, not a domain event. Steps are cqrs-eda.
Notification event
Use when another service receives a fact and losing the message is acceptable: a metric, a best-effort signal, a dev broker.
Skip when nothing outside this process listens. A domain event is the in-process tool. Skip when the message must not be lost between commit and broker.send.
A cqrs.NotificationEvent sets keyword-only event_name, topic, and payload. Put it on events only for the lossy case, and pass a real message_broker into bootstrap. A missing broker becomes a broker that discards messages. The same mutable events list is required: the default property is an empty tuple.
Neighbor: a durable publish is the outbox. An in-process reaction is a domain event. Steps are cqrs-eda.
Transactional outbox
Use when a business row and a NotificationEvent commit in one session, and a separate process publishes.
Skip when nothing leaves the database transaction. Skip the outbox as a stand-in for a saga: the outbox stores one message reliably and does not compensate the next step. Skip calling the publisher from the request handler. The handler only writes the row.
repository.add(event) and the business session.add(...) share one session. await repository.commit() commits both. cqrs.EventProducer runs in another process. Register every event_name before the first read or write. A second registration of the same name raises KeyError. Leave events empty for that notification so it is not published twice.
Neighbor: a lost message is acceptable only for a notification on `
Установить cqrs-setup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл cqrs-setup?
Sets up a service on python-cqrs and picks the feature. Use when writing a command, a query, a domain event, a notification, an outbox, an inbox, a saga, a chain, or a stream.
Как установить скилл cqrs-setup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cqrs-setup запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic