ecotone-aggregate

Model state-stored and event-sourced domain aggregates with Ecotone attributes.

2|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/ecotoneframework/skills --skill ecotone-aggregate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecotone-aggregate
Source: https://github.com/ecotoneframework/skills/tree/main/skills/ecotone-aggregate
Command: npx skills add https://github.com/ecotoneframework/skills --skill ecotone-aggregate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Aggregates are central to domain-driven design, but implementing both state-stored and event-sourced variants with correct identifiers, factory methods, and command wiring can be verbose and error-prone. This skill provides structured patterns and examples to accelerate and standardize aggregate development in Ecotone.

Core Features & Use Cases

  • State-stored and event-sourced aggregates with #[Aggregate] and #[EventSourcingAggregate].
  • Proper use of #[Identifier] and optional composite keys, including command mapping and event-sourcing patterns.
  • Factory methods and repository access wiring to integrate with Ecotone.

Quick Start

Define an aggregate class annotated with #[Aggregate] or #[EventSourcingAggregate], implement an Identifier, and add static creation handlers along with command handlers and event-sourcing handlers to manage state and events.

Frequently Asked Questions about ecotone-aggregate

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

FAQPage Schema
How do I implement domain aggregates in Ecotone using DDD?

Domain aggregates in Ecotone are modeled by annotating classes with #[Aggregate] or #[EventSourcingAggregate], defining an #[Identifier], and adding static factory methods alongside command handlers to manage state and business workflows.

What is the difference between state-stored and event-sourced aggregates in Ecotone?

State-stored aggregates use the #[Aggregate] attribute to persist current state directly, while event-sourced aggregates use #[EventSourcingAggregate] and #[EventSourcingHandler] to rebuild state by replaying domain events.

How do I map identifiers and command handlers when building an Ecotone aggregate?

You map identifiers using the #[Identifier] attribute, optionally supporting composite keys, and wire command handlers using #[CommandHandler] to route specific commands to the correct aggregate instance for state mutation or event generation.

Can I use event sourcing with command handlers for domain modeling in Ecotone?

Yes, you can use event sourcing with command handlers by combining #[EventSourcingAggregate], #[CommandHandler], and #[EventSourcingHandler] attributes to handle commands, produce events, and rebuild aggregate state from those events.

What's the best way to set up aggregate creation and repository access in Ecotone?

The best way to set up aggregate creation and repository access is to use static factory methods annotated with #[CommandHandler] for creation and wire repository access to integrate the aggregate into Ecotone's event-driven workflows.

When should I use event-sourced aggregates instead of state-stored aggregates in domain-driven design?

Use event-sourced aggregates when you need to rebuild state by replaying domain events for auditability, and use state-stored aggregates when you only need to persist the current state directly without event history.