100thieves-team/plady-expert-skills/ddd-aggregates

Claude Code and agent skill by 100thieves-team/plady-expert-skills

Trust tier 3
  • community
  • ext:[{"type":"context","description":"Custom context provider definitions"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Design aggregate boundaries from invariants: aggregate roots, entities, value objects, transaction boundaries, and cross-aggregate consistency strategies.

Install

npx vskill@latest install 100thieves-team/plady-expert-skills/ddd-aggregates

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as 100thieves-team/plady-expert-skills/ddd-aggregates.

DDD Aggregates

🌐 中文版本: Chinese

When to Use

  • Bounded Contexts and integration strategies are ready, and you need to design the building blocks within each context.
  • You need to answer "which objects must change together to maintain consistency."
  • When ddd-model-review reports "invariant expression rate < 60%," or ddd-domain-interactions reports "events need to carry another aggregate's private data," re-execute this skill as a backtrack target.

Input Requirements

  • Required: Event flows and command candidates (from ddd-discover), context directory and glossary (from ddd-contexts).
  • Optional: Context mapping and failure modes (from ddd-context-map).

Process

  1. Extract invariants: From commands and events, extract business rules that "must always hold true" (invariants).
  2. Cluster objects: Using invariants as the binding force, cluster objects into aggregate candidates; identify the aggregate root (the sole external entry point).
  3. Identify building blocks: Distinguish entities (with identity and lifecycle) from value objects (no identity, immutable, compared by value) within aggregates.
  4. Define boundary rules: External consumers hold only aggregate root references; cross-aggregate references use IDs; each aggregate is a transaction boundary.
  • Foreign reference re-examination: For every "foreign reference object" in the model, re-ask — do we need to manage its lifecycle (create, modify, terminate)? If yes, it should be promoted to an internal aggregate rather than remaining a mere ID reference. Typical trigger: reference data objects (port catalogs, calendars, route catalogs) maintained by our team must be listed as aggregates.
  • Specification pattern recognition: When a business rule appears in the predicate form "given X, does X satisfy Y" (e.g., isSatisfiedBy(Itinerary)), explicitly extract it as a Specification rather than burying it in if-branches inside factories or services.
  1. Command boundaries: For each aggregate, define the commands it handles, pre-validations, and side effects.
  2. Cross-aggregate consistency: Strong consistency within an aggregate; eventual consistency across aggregates — define event-driven / compensation / retry strategies.
  3. Repository interface draft: For each aggregate, produce a repository interface with semantic definitions (method name + semantics, no code implementation).

Output

ArtifactStructure Requirements
Aggregate DirectoryTable: aggregate name, aggregate root, contained entities, contained value objects, key invariants, key commands
Invariant TableTable: invariant, triggering command, validation location, behavior on violation
Entity & Value Object ListTable: name, type (Entity/VO), owning aggregate, identity strategy / equality definition
Transaction Boundary DescriptionList: default rules, exception conditions, concurrency/locking strategy
Cross-Aggregate Consistency StrategyTable: scenario, triggering event, compensation method, idempotency guarantee, retry strategy
Repository Interface DraftTable: aggregate, method, semantic description, query boundary

Validation Checklist

  • [ ] Each aggregate corresponds to at least 1 explicit invariant
  • [ ] Aggregate boundaries specify transaction boundaries; default is "one transaction modifies one aggregate"
  • [ ] Cross-aggregate consistency has event and compensation strategies
  • [ ] No "aggregates defined by foreign keys" anti-pattern (aggregates are not ORM relationship mappings)
  • [ ] Entity vs. value object distinction has clear rationale (identity vs. value semantics)
  • [ ] Aggregate size is reasonable: a single aggregate should not contain > 5 entities (justification required if exceeded)
  • [ ] Every foreign reference has been re-examined for "is its lifecycle managed by us"; those answered yes have been promoted to internal aggregates
  • [ ] "Predicate-style business rules" have been scanned and evaluated for the Specification pattern; qualifying ones are listed as first-class building blocks

Backtrack Triggers

  • Invariants span multiple contexts -> backtrack to ddd-contexts (consistency requirements are fragmented by boundaries).
  • Triggered by ddd-domain-interactions: events need to carry another aggregate's private data, indicating aggregate boundaries need adjustment.
  • Triggered by ddd-model-review: invariant expression rate < 60% (aggregates may be data containers rather than behavioral boundaries).

Example

text
@ddd-aggregates
Based on the following context definition and event flows, help me design aggregates within the Booking context:
- Context: Booking (full booking lifecycle)
- Core terms: Booking, TimeSlot, BookingPolicy, CheckIn
- Key events: BookingRequested, BookingConfirmed, BookingCancelled, CheckInRecorded
Please output aggregate directory, invariant table, entity/value object list, and transaction boundary description.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • contextCustom context provider definitions

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/100thieves-team/plady-expert-skills/ddd-aggregates/badge)](https://verified-skill.com/skills/100thieves-team/plady-expert-skills/ddd-aggregates)

Something wrong with this skill or its page? Tell us.