business-logic-entry-point-command-query-separation
No SKILL.md available for this skill.
View on GitHubMore from code-sherpas/agent-skills
neverthrow-return-types
Require `neverthrow`-based return types in TypeScript and JavaScript code whenever the surrounding technology allows it. Use when creating, refactoring, reviewing, or extending standalone functions, exported module functions, class methods, object methods, service methods, repository methods, and similar APIs that should expose explicit success and failure result types in their signatures. Prefer `Result<T, E>` for synchronous code and `ResultAsync<T, E>` for asynchronous code. Only skip a `neverthrow` return type when a framework, library, runtime interface, or externally imposed contract is incompatible and requires a different return shape.
16business-logic-typical-domain-entity-entry-points
Promote a standard set of business-logic entry points around a domain-entity type when an agent must decide which entry points to implement. Use when designing, creating, modifying, reviewing, or completing business-logic entry points for a specific domain entity. Prefer basic entity entry points such as create, update, find by id, search, and delete by id; use explicit mark-as entry points for finite-state changes such as enum or boolean status transitions; use explicit assign or add entry points for one-to-many or many-to-many associations between domain entities; and use explicit check-whether-can-be entry points when the business operation needs a boolean answer about whether an action is currently allowed.
5business-logic-ensure-business-constraints
Formalize business constraints at business-logic points using an `ensure ...` style translated into the syntax and conventions of the project language. Use when an agent needs to create, modify, review, or interpret business-rule precondition checks such as eligibility checks, availability checks, permission checks, or invariant-preserving entry checks. These constraints must return only a unit-equivalent success value such as `void`, `unit`, `undefined`, or `None`, or an error when the condition is not satisfied.
5business-logic-entry-point-cqs-handler-signatures
Enforce a signature pattern for business-logic entry points when Command-Query Separation is being followed. Use when an agent needs to create, modify, review, or interpret command handlers or query handlers at business-logic entry points. Name handlers with an infinitive plus a command-handler or query-handler suffix adapted to the language style, accept exactly one parameter named `command` or `query`, always wrap input values in a dedicated `...Command` or `...Query` type, return the project's empty equivalent for successful non-create command handlers, return a `...CommandHandlerSuccess` type for successful create command handlers, and return a `...QueryHandlerSuccess` type for successful query handlers.
5