business-logic-entry-point-command-query-separation
Installation
SKILL.md
Command-Query Separation for Business Logic Entry Points
Goal
Apply Command-Query Separation at entry points to business logic.
Treat each business-logic entry point as exactly one of these:
- a command, which changes state
- a query, which returns data without changing state
Do not mix the two in the same entry point.
This skill governs CQS, not CQRS. It is a design rule for the behavior and return shape of individual business-logic entry points. It does not require separate read and write models, separate stores, separate services, or distributed architecture changes.
The only allowed exception to the no-data-return rule for commands is a create operation. A create command may return the ID of the created domain entity, or the IDs if the create operation creates more than one domain entity, so the caller can continue acting on those newly created entities.