You Don't Need 5 Years of Experience to Write Production-Grade Event Sourcing Anymore

Every Developer has that list of patterns they'll learn "someday." Event Sourcing. CQRS. Sagas. What if the gap between knowing these exist and actually building with them just collapsed?

You Don't Need 5 Years of Experience to Write Production-Grade Event Sourcing Anymore

There is a moment in The Matrix that pretty much describes current situation with AI.

Neo sits in an old, worn leather chair. Tank plugs a data cable into the socket on the back of Neo’s head. Lines of code race across the screen. Neo’s body jerks a little, and his eyes blink fast. Then he says three words:

"I know Kung Fu."

Morpheus, unsurprised, nods: "Show me."

It's pure cinema. But if you strip away the leather and the green-tinted cinematography, what you're watching is actually a story about context-specific knowledge transfer. Neo didn't download the entire internet. He didn't get a general education in "fighting." He received exactly the skills he needed, precisely when he needed them, in a format his mind could immediately apply.

What if we could do that with software architecture?

Not kung fu. Not martial arts. But Domain-Driven Design. Command Query Responsibility Segregation. Event Sourcing. Sagas. Projections. The kind of patterns that separate weekend projects from production systems that handle millions of events.

This is how Agentic Skills work in Ecotone.

Part 1: Loading Knowledge Into Your Mind

Picture this: you're working on a feature. A customer needs order management with full audit history. Event sourcing would be perfect here, but there's a problem. You've read the theory. You know event sourcing means storing state changes as a sequence of events instead of current state. You understand why it matters for auditability and temporal queries.

But theory and implementation? Those are different planets.

If you don’t know fully the actual patterns the framework expects, or if you’re creating something you’ve not enough experience in, you may feel unsured whatever the path is correct. And with AI, that uncertainty multiplies, as it speeds up the way to the goal. The AI might generate code that looks sophisticated but misses crucial details. It might hallucinate solutions which combined together make no sense, or you may find that things should have been done differently long after they have landed on production.

This is the context pollution problem.

When you dump 5,000 lines of framework documentation into your AI's context window, something counter-intuitive happens. More information creates less accuracy. The AI sees everything at once: basic tutorials, advanced patterns, edge cases, migration guides, deprecated approaches. It can't distinguish what matters for your specific task from what doesn't. So it averages. It hedges. It produces code that's generically plausible instead of specifically correct.

Ecotone Skills work differently. They do follow official Agentic Skills specification.

A Skill is a modular knowledge package designed specifically for AI coding assistants. Not for humans. For AI. Think of it as structured learning compressed into exactly the format an AI model needs to generate precise, pattern-compliant code.

To install new skills, we simply follow our Coding Agent inbuilt Commands:

/plugin install ecotone-skills@ecotone
AI Integration | Ecotone - DDD, CQRS, Event Sourcing in PHP

Look on how to install Ecotone skills for different coding agents

This works because Ecotone has implemented patterns as Building Blocks — high-level abstractions with declarative configuration. You don't wire together low-level infrastructure and configurations. You declare intent through attributes like #[CommandHandler], #[EventSourcingAggregate], or #[Saga], and the framework handles the rest.

Because Ecotone's knowledge is already well organized — each Building Block representing a clear, self-contained pattern - it can be packaged into downloadable skill.

When we download Ecotone's skills, under the hood we get access to over 17 different skills including:

  • A Skill for Event Sourcing
  • A Skill for Workflows
  • A Skill for Asynchronous Processing

But downloading the skill does not meant activating it, it becomes available but yet dormant. To understand how it's being activated, we first need to understand how the structure of the Skill looks like.

Part 2: Knowledge Ready to Use

The brain now has access to the knowledge, before we will understand how we can reach for that knowledge, let's first discuss the three layered structure of Skills:

Layer 1: Metadata (name and description): This loads when you start your session. It tells Coding Agent (Claude Code, Cursor, Codex etc) that the Skill exists and when to activate it. Think of this as the chapter titles in a textbook. You see what's available without loading everything into memory.

Layer 2: Body (actual examples): This is the core knowledge: what this pattern is, when to use it, how the Building Blocks work, and canonical code examples. This loads automatically when Coding Agent detects relevant context.

Layer 3: Deep references (additional files carrying more details): These load on demand when the AI needs exact API signatures or full implementation examples. Most tasks never need this layer. When you do, it's targeted: just the specific reference that answers the specific question.

AI agents loads only Metadata of your Skills as part of the process. This is because they want to know what they know. This gives them enough context to ask for more details, when it becomes needed. Meaning if we focus on building Event Sourcing feature, it does not mean we need to now focus on communication between Services (Applications).

---
name: ecotone-asynchronous
description: >-
  Implements asynchronous message processing in Ecotone: message channels,
  #[Asynchronous] attribute, #[Poller] configuration, delayed messages,
  priority, time to live, scheduling, and dynamic channels. Use when
  running handlers in background, configuring message queues, async
  processing, delayed delivery, scheduling, priority, TTL, or dynamic
  channel routing.
---
The main idea behind skills is to keep your Context small and relevant to what you're working on.

Instead of 5,000 lines of generic documentation, your AI loads 150-300 lines of precise patterns exactly when it needs them. Instead of statistical guessing based on documentation fragments, it follows exact templates with real code examples. Instead of "this is probably how aggregates work in Ecotone," it knows: here's the attribute, here's the method signature, here's how events are applied, here's the test pattern.

Think about the parallel to Neo in that chair. He's not reading a book about kung fu. He's not watching tutorial videos. He's not learning through repetition and practice. Knowledge is being loaded directly into the exact neural pathways that can use it. Structured. Precise. Immediately actionable.

The knowledge is available, we only load the Metadata of skills to be aware of what we know, the next question when do we actually load the full details about the Skill (description and deep references).

Part 3: I know Kung Fu

So once you've downloaded the skills, they become available for activation.
When you type: "Create an event-sourced aggregate for order management."

Your Coding Agents backed up the Model will detects the keywords. If it will recognize the patterns, approaches or techniques described by one of your Skill's Metadata, it will reach for the whole skill body.

What will happen under the hood, is that ecotone-aggregate and ecotone-event-sourcing Skills will load automatically. Not the entire Ecotone documentation. Not a generic blog post about event sourcing theory. Not some random code examples that may or not be relevant. It will actually load specific patterns for building event-sourced aggregates with Ecotone's Building Blocks, as it will match your intent with Skill's metadata.

Automatic Skill loading in Claude Code

The second option is to load the Skill manually. This is especially useful if our Coding Agent have not picked specific Skill automatically, or we want to be full precise on the Skill.

Loading the Skill manually in Claude Code

And then your Event Sourcing Skill is loaded, your Coding Agent will know how to implement: Aggregate class with the right attributes, command handlers that record events, event handlers that apply state changes, proper encapsulation. That will be Production-ready code.

The Multiplication Effect

Let's combine all of those information together.

Building Blocks alone give you clear, maintainable patterns that reduce cognitive load, boilerplate, and framework learning curve.

AI alone gives you fast code generation and ability to follow on the patterns.

Building Blocks + Skills give you something neither achieves independently: AI that generates production-quality, framework-correct, tested code — on the first try.

Asks for a complete feature:

"Create an event-sourced Ticket aggregate that handles creation and closing, with a projection that tracks open ticket counts per assignee, and send async email when Ticket is created."

With Skills loaded, the AI produces:

  1. An #[EventSourcingAggregate] with TicketCreated and TicketClosed events, correct factory method, and #[EventSourcingHandler] methods for state reconstruction
  2. #[Projection] with the proper stream source, event handlers that maintain the read model, and partition configuration
  3. #[Asynchronous] Event Handler being able to send Email, when Ticket is Created
  4. Complete test coverage using EcotoneLite::bootstrapFlowTesting()

Each piece follows Ecotone conventions exactly. The aggregate uses static factory methods for creation. The projection handles idempotency. The async configuration includes proper error channel setup. The tests verify the full flow from command to read model.

The knowledge isn't simplified or dumbed down. It's the same patterns that power large-scale production systems. Skills just make that knowledge instantly accessible through the tool you're already using.

Install Ecotone. Open your AI assistant. Describe what you need. And when the code appears — correct, tested, production-ready — you'll understand exactly how Neo felt.

"I know Event Sourcing."

Show me.