aggregate-designer

Designs aggregate consistency boundaries through fit checks, conflict analysis, and locking strategy decisions.

Updated Nov 19, 2020
One-click install
npx skills add https://github.com/kwojtasinski-repo/ECommerceApp --skill aggregate-designer-kwojtasinski-repo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aggregate-designer
Source: https://github.com/kwojtasinski-repo/ECommerceApp/tree/main/.github/skills/aggregate-designer
Command: npx skills add https://github.com/kwojtasinski-repo/ECommerceApp --skill aggregate-designer-kwojtasinski-repo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deciding where to draw aggregate boundaries in a domain model is hard: too large and you get lock contention, too small and invariants break under concurrency. This Skill guides you through a structured, question-driven process to determine whether you need an aggregate at all, and if so, exactly what it should guard. ## Core Features & Use Cases - Fit Check Gate: Verifies the problem is genuinely a concurrency/consistency-boundary problem before any design work, stopping early for CRUD or read-only scenarios. - Command Extraction & Conflict Matrix: Classifies operations into commands, facts/events, and queries, then builds a pairwise conflict matrix surfacing self-conflicts, parameter-dependent conflicts, and time-range conflicts. - Sequencing Probe & Boundary Decision: Tests whether business processes already separate conflicting operations in time, then recommends one aggregate, multiple aggregates, a database constraint, or no aggregate. - Use Case: You are modeling a booking system where users reserve time slots. The Skill walks you through confirming concurrent write risk, extracting commands like ReserveSlot and CancelReservation, detecting time-range conflicts, and deciding whether a single aggregate or a database constraint best protects the no-double-booking invariant. ## Quick Start Ask the assistant to use the aggregate-designer skill to design consistency boundaries for your domain, providing a description of the state-changing operations and the rules that must never be broken.

Frequently Asked Questions about aggregate-designer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design aggregate boundaries in domain-driven design?

Start by extracting all state-changing commands, then build a pairwise conflict matrix to identify which commands compete for the same data. Choose the smallest boundary that protects the invariant, preferring a database constraint or no aggregate when concurrency risk is absent.

When should I use an aggregate versus a database constraint?

Use an aggregate when concurrent commands can change the data used to decide whether an operation is allowed. If the business process already separates operations in time or a simple uniqueness rule suffices, a database constraint is the simpler choice.

When should I not create an aggregate?

Skip aggregate design for read-only flows, simple CRUD, input-validation-only rules, or systems that merely record outcomes decided elsewhere. The fit check stops the process when there is no real concurrent write risk.

What is a conflict matrix in aggregate design?

A conflict matrix is a pairwise comparison of commands showing whether two operations can interfere when run concurrently. It explicitly surfaces self-conflicts, parameter-dependent conflicts, and time-range conflicts common in reservation and booking domains.

How do I handle time-range conflicts in booking systems?

Identify commands whose parameters define overlapping time ranges, then probe whether the business process already separates them in time. If real concurrent overlap exists, guard the range with an aggregate boundary or an exclusion constraint.