Agent skill

Dynamic Consistency Boundaries

by AxonIQ in AxonIQ/AxonFramework

Explain and reason about Dynamic Consistency Boundaries (DCB) and how Axon Framework 5 and Axon Server implement them.

Apache-2.0Auto-check passedBackend & APIs

Install Dynamic Consistency Boundaries

skills CLI
$ npx skills add AxonIQ/AxonFramework --skill dynamic-consistency-boundaries -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AxonIQ/AxonFramework dynamic-consistency-boundaries --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AxonIQ/AxonFramework.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/dynamic-consistency-boundaries .claude/skills/dynamic-consistency-boundaries && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dynamic-consistency-boundaries
GitHub stars
3.6k
Token cost
~1.9k tokens
SKILL.md length
929 words
Files
5 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Explain and reason about Dynamic Consistency Boundaries (DCB) and how Axon Framework 5 and Axon Server implement them.

  • Works in 3 steps: Source the events matching a criteria… → Decide: fold those events into a… → Append the new events together with the…
  • The user asks about DCB
  • SKILL.md covers What DCB is, in one paragraph, When to use this skill, The mental model: source ->… and Terminology map: DCB <-> Axon…, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Dynamic Consistency Boundaries is an agent skill from AxonIQ/AxonFramework. Explain and reason about Dynamic Consistency Boundaries (DCB) and how Axon Framework 5 and Axon Server implement them. Use when the user asks about "DCB", "dynamic consistency boundary", "consistency boundary", "killing the aggregate", modeling consistency across multiple entities, "EventCriteria", "@EventCriteriaBuilder", "@EventTag", "@EventSourcedEntity", "Tag", tags vs streams, "AppendCondition", "SourcingCondition", "ConsistencyMarker", optimistic concurrency in the event store, how to choose a consistency…

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/axon-framework-api.md`, `references/axon-server-api.md` and `references/concepts.md`).

It sits in Backend & APIs, covering Event-driven systems and Domain-driven design. It works with Java. The repository describes itself as: Framework for Evolutionary Message-Driven Microservices on the JVM. The licence is Apache-2.0.

When your agent uses it

  • The user asks about DCB
  • Dynamic consistency boundary
  • Consistency boundary
  • Killing the aggregate

Example prompts

  • “dynamic consistency boundary”
  • “consistency boundary”
  • “killing the aggregate”
  • “/dynamic-consistency-boundaries”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Source the events matching a criteria (tags + event types). The store also returns a
  2. Decide: fold those events into a decision model (current state) and run the business rule
  3. Append the new events together with the same criteria and the marker. The store accepts

What it can do on your machine

Read from SKILL.md and the folder at commit 9117e68. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dynamic Consistency Boundaries loads about 1.9k tokens when it runs, and up to ~8.8k if it reads all its reference files. Until then it costs about 173 tokens; SKILL.md has 929 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~173
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AxonIQ/AxonFramework at commit 9117e68, republished under its Apache-2.0 licence (© AxonIQ). 929 words, ~1,911 tokens.

Download SKILL.mdSave it as .claude/skills/dynamic-consistency-boundaries/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
dynamic-consistency-boundaries
description
Explain and reason about Dynamic Consistency Boundaries (DCB) and how Axon Framework 5 and Axon Server implement them. Use when the user asks about "DCB", "dynamic consistency boundary", "consistency boundary", "killing the aggregate", modeling consistency across multiple entities, "EventCriteria", "@EventCriteriaBuilder", "@EventTag", "@EventSourcedEntity", "Tag", tags vs streams, "AppendCondition", "SourcingCondition", "ConsistencyMarker", optimistic concurrency in the event store, how to choose a consistency boundary, why an aggregate is too big or too small, or how Axon Server's DCB event store (dcb.proto) sources and appends events with criteria.

Dynamic Consistency Boundaries (DCB)

A reference skill for explaining DCB and mapping the concept onto Axon Framework 5 and the Axon Server DCB event store. Use it to answer "what / why / how" questions and to ground explanations in the real framework types and the public Axon Server gRPC API.

What DCB is, in one paragraph

Classic event sourcing fixes the consistency boundary to the aggregate: one aggregate maps to one event stream, and that stream is the unit of optimistic locking. DCB (introduced by Sara Pellegrini, "Killing the Aggregate") moves the boundary from the stream to a set of events selected by a query. Instead of "load aggregate X, append to stream X", you "source exactly the events that matter for this decision (selected by tags and event types), decide, then append on the condition that no new matching event appeared since you read." The boundary is defined per decision, dynamically, rather than baked into the storage layout.

When to use this skill

  • The user asks what DCB is, why it exists, or how it differs from aggregates/streams/sagas.
  • The user is modeling an invariant that spans more than one entity (e.g. "a course holds at most N students" AND "a student joins at most M courses") and is unsure where the boundary goes.
  • The user asks how a specific Axon Framework 5 type or annotation relates to DCB.
  • The user asks what the Axon Server DCB event store can and cannot do.

This skill is for explaining and designing. It is not a code generator; when a question is about concepts, prefer a clear explanation grounded in the references below over writing files.

The mental model: source -> decide -> append

DCB is optimistic concurrency control with a query-shaped lock:

  1. Source the events matching a criteria (tags + event types). The store also returns a consistency marker -- the position of the head at read time.
  2. Decide: fold those events into a decision model (current state) and run the business rule to produce new events.
  3. Append the new events together with the same criteria and the marker. The store accepts the append only if no event matching the criteria was stored after the marker; otherwise it rejects and the command is retried.

The criteria is both the read filter and the write conflict definition. Keep it as narrow as the invariant allows: too broad means false conflicts and contention; too narrow means a missed invariant.

Terminology map: DCB <-> Axon Framework 5 <-> Axon Server

DCB conceptAxon Framework 5Axon Server (dcb.proto)
Tag (key/value classifier on an event)Tag.of(key, value) (org.axonframework.messaging.eventstreaming.Tag); declaratively via @EventTag on event fieldsTag { bytes key; bytes value; }
Criterion (AND of tags, restricted to event types)EventCriteria.havingTags(...).andBeingOneOfTypes(...)TagsAndNamesCriterion { repeated string name; repeated Tag tag; }
Criteria (OR of criterions)EventCriteria.either(...) / .or(...)repeated Criterion
The DCB query for a decision model@EventCriteriaBuilder method on an @EventSourcedEntitycriterion list in SourceEventsRequest
Decision model / current state@EventSourcedEntity + @EventSourcingHandler evolve methods(client-side fold; not a server concept)
Read phaseSourcingCondition -> EventStoreTransaction.source(...)Source(SourceEventsRequest)
Consistency marker / headConsistencyMarker (e.g. GlobalIndexConsistencyMarker)consistency_marker / GetHead
Append phase with conflict checkAppendCondition (marker + criteria) -> EventAppender.append(...)Append(stream AppendEventsRequest) with ConsistencyCondition
Conflict rejectedappend transaction rejected -> command retriedappend fails the consistency condition
Show full SKILL.md (397 more words)Show less

How to answer a DCB question

  1. Classify the question: theory (why/what), Axon Framework usage (which type/annotation), Axon Server capability (what the API allows), or modeling ("where does the boundary go?").
  2. Load the matching reference (see below) and ground the answer in real types and method names -- do not invent API. When citing framework behavior, point at the real example files in examples/university-java/.
  3. For modeling questions, work through the source -> decide -> append loop explicitly: what events does the rule depend on, what tags select them, what is the narrowest criteria, and what is the resulting conflict surface.
  4. Verify before asserting: package names and signatures in the references reflect AF5 at write time; if a question hinges on an exact signature, open the file and confirm it still matches before stating it as fact.

References

Load the one that fits the question; do not read all of them up front.

  • references/concepts.md -- DCB theory: the problem with aggregate=stream, the three-phase optimistic-locking model, the full glossary (global sequence, head, tag, criterion, criteria, consistency marker), and the benefits/caveats. Sources: dcb.events and the "Dynamic Consistency Boundaries" article.
  • references/axon-framework-api.md -- the AF5 type map with fully-qualified names, the annotation-based flow (@EventSourcedEntity, @EventCriteriaBuilder, @EventTag, @InjectEntity, EventAppender), the lower-level contracts (EventCriteria, Tag, SourcingCondition, AppendCondition, ConsistencyMarker, EventStoreTransaction, EventStorageEngine), and how they compose.
  • references/axon-server-api.md -- the verbatim Axon Server DCB gRPC surface (services, RPCs, messages) and an explicit "what is possible / what is not" derived from it.
  • references/examples.md -- worked patterns: the course-subscription invariant (full code from the university example), plus canonical DCB.events patterns (unique username, sequential invoice number) modeled with Axon Framework criteria.

Common misconceptions to correct

  • "DCB removes consistency / is eventual consistency." No. DCB gives strong consistency for the boundary you select per decision; it just stops forcing that boundary to equal an aggregate stream.
  • "A tag is a stream." No. Events are stored in one global log; tags are classifiers used to select events at query time. One event can carry several tags and thus participate in several boundaries.
  • "The criteria filters on payload/metadata content." No. Axon Server matches only on event name (type) and tags. Anything finer (counting, ranges, content predicates) is done by folding the sourced events client-side in the decision model.
  • "Criteria semantics are all AND." Within one criterion, tags are ANDed and types are an OR-set; across criterions the criteria is ORed. See the API references for the exact rule.

© AxonIQ, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .claude/skills/dynamic-consistency-boundaries of AxonIQ/AxonFramework.

  • SKILL.md
  • references/axon-framework-api.md
  • references/axon-server-api.md
  • references/concepts.md
  • references/examples.md

Open the folder on GitHubat commit 9117e68

Compare with similar skills

Dynamic Consistency Boundaries next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dynamic Consistency Boundaries compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dynamic Consistency Boundaries this skillAxonIQ/AxonFramework3.6k—~1.9kAutomated safety check: PassApache-2.0
NestJS Modular Monolith Architecttech-leads-club/agent-skills7k—~3.9kAutomated safety check: PassCC-BY-4.0
Event Sourcingcitypaul/.dotfiles740—~7.8kAutomated safety check: PassCustom licence
123 Java Design Patternsjabrena/plinth447—~1.1kAutomated safety check: PassApache-2.0
Evolutionary Modular Architecturetech-leads-club/agent-skills7k—~3.7kAutomated safety check: PassCC-BY-4.0
Microservices ArchitectJeffallan/claude-skills12k—~1.8kAutomated safety check: PassMIT

Similar skills

  • NestJS Modular Monolith Architect

    tech-leads-club/agent-skills

    Designs scalable NestJS modular monoliths with domain-driven design, Clean Architecture layers and optional CQRS, defining bounded contexts and strict module boundaries.

    7k GitHub stars~3.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Event Sourcing

    citypaul/.dotfiles

    Event sourcing patterns for functional TypeScript — persist state as an append-only log of past events and rebuild it by folding them.

    740 GitHub stars~7.8k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • A skill your agent uses when you need to select, review, or implement Java design and integration patterns — including classic Java design patterns, REST API patterns, Kafka and event-driven…

    447 GitHub stars~1.1k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Evolutionary Modular Architecture

    tech-leads-club/agent-skills

    Guides design of modular-monolith platforms with DDD, flat-by-aggregate modules, anti-corruption layers, outbox events and resilience, plus an architecture document with SVG diagrams.

    7k GitHub stars~3.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Microservices Architect

    Jeffallan/claude-skills

    Designs distributed systems: bounded-context service boundaries, sync and async communication, data ownership, resilience, tracing and rollout strategy.

    12k GitHub stars~1.8k tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • Azure Eventgrid Java

    microsoft/skills

    Official

    Build event-driven applications with Azure Event Grid SDK for Java.

    3.1k GitHub starsUsed in 5 repos~2.3k tokens
    Backend & APIsAuto-check passed

More from AxonIQ/AxonFramework

  • Issue From Notes

    AxonIQ/AxonFramework

    Create well-structured GitHub issues from any source: meeting notes, transcriptions, conversation context, informal descriptions, or direct requests.

    3.6k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Migration Path

    AxonIQ/AxonFramework

    Create a new Axon Framework 4→5 migration path documentation page.

    3.6k GitHub stars~594 tokensUpdated today
    Auto-check passed

Works with

Questions about Dynamic Consistency Boundaries

What does Dynamic Consistency Boundaries do?

Explain and reason about Dynamic Consistency Boundaries (DCB) and how Axon Framework 5 and Axon Server implement them. Dynamic Consistency Boundaries is an agent skill from AxonIQ/AxonFramework. Explain and reason about Dynamic Consistency Boundaries (DCB) and how Axon Framework 5 and Axon Server implement them.

When should I use Dynamic Consistency Boundaries?

Dynamic Consistency Boundaries fits situations like: the user asks about DCB; dynamic consistency boundary; consistency boundary; killing the aggregate.

How do I install Dynamic Consistency Boundaries in Claude Code?

Run `npx skills add AxonIQ/AxonFramework --skill dynamic-consistency-boundaries -a claude-code`. Or copy the skill folder (.claude/skills/dynamic-consistency-boundaries in AxonIQ/AxonFramework) into .claude/skills/dynamic-consistency-boundaries in your project. Claude Code loads it when a task matches its description.

How do I install Dynamic Consistency Boundaries in Codex?

Run `npx skills add AxonIQ/AxonFramework --skill dynamic-consistency-boundaries -a codex`. Or copy the skill folder (.claude/skills/dynamic-consistency-boundaries in AxonIQ/AxonFramework) into .agents/skills/dynamic-consistency-boundaries in your project. Codex loads it when a task matches its description.

Can I use Dynamic Consistency Boundaries in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AxonIQ/AxonFramework --skill dynamic-consistency-boundaries -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dynamic-consistency-boundaries, .gemini/skills/dynamic-consistency-boundaries, .github/skills/dynamic-consistency-boundaries and .opencode/skills/dynamic-consistency-boundaries in your project.

What does Dynamic Consistency Boundaries need to run?

SKILL.md names no scripts, command-line tools or credentials: Dynamic Consistency Boundaries is instructions for the agent only.

Does Dynamic Consistency Boundaries access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dynamic Consistency Boundaries safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dynamic Consistency Boundaries use?

Dynamic Consistency Boundaries is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dynamic Consistency Boundaries use?

About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.8k tokens, read only when the agent opens those files.

What are the alternatives to Dynamic Consistency Boundaries?

Skills that share tags, products or a category with Dynamic Consistency Boundaries: NestJS Modular Monolith Architect (tech-leads-club/agent-skills, 7k stars), Event Sourcing (citypaul/.dotfiles, 740 stars), 123 Java Design Patterns (jabrena/plinth, 447 stars) and Evolutionary Modular Architecture (tech-leads-club/agent-skills, 7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dynamic Consistency Boundaries?

AxonIQ (a GitHub organization) maintains it in AxonIQ/AxonFramework, which has 3,623 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 9, 2026.

Source: AxonIQ/AxonFramework on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.