Domain Event Lifecycle Architect

    1

    Models immutable domain business facts: naming, causal lineage, minimum payloads, and context-to-integration maps.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Domain Event Lifecycle Architect

    Example session with this skill installed

    Architect immutable domain event contracts and lifecycle boundaries for our Lending and Clearing Engine.

    • Subject: FinTech Core Lending and Clearing Engine (run-id: lending-clearing-events-001) processing 14,000 TPS across Loan Origination, Treasury, and Risk.
    • Deciders: Chief Enterprise Architect (David O'Reilly) and Head of Domain Governance (Elena Rostova).
    • Scope & Scale: Establishing domain event contracts representing state transitions while separating internal domain facts from integration contracts.
    • Tension: Squads proposed publishing internal aggregate snapshots on generic topics (LoanUpdated) directly to Kafka; David O'Reilly and Elena Rostova strictly reject CRUD notifications, citing incident INC-4923 where downstream risk consumers misread draft saves as finalized disbursements, causing $2.6M in uncollateralized lending. They mandate: past-tense business fact naming, causal and correlation identity lineage, single-aggregate outbox binding, minimum semantic payloads with zero leaked entity graphs, and explicit integration event translation.

    Write the domain event architecture overview under docs/.

    • Read your context and instructions
    • Compiled the domain event lifecycle

    Wrote docs/architecture/domain-event-architect/00-overview/domain-event-architect-overview.md and docs/architecture/domain-event-architect/verification/fitness-self-check.md. Complete domain event architecture specification establishing immutable business-fact contracts, causal lineage, minimum semantic payloads, and context-to-integration translation boundaries.


    skill: domain-event-architect

    Domain Event Lifecycle Architecture: Commercial Lending & Clearing [DE-ARCH-001]

    Summary

    This specification establishes the domain event architecture, business-fact lifecycle governance, and integration event translation boundaries for the Commercial Lending & Treasury Clearing Engine under run ID lending-clearing-events-001. It governs 14,000 transaction events/second across Loan Origination, Treasury Clearing, and Credit Risk Monitoring contexts. It decisively resolves the event semantic drift and data corruption demonstrated in incident INC-4923 (where downstream risk monitoring mistook transient UI draft saves and generic LoanUpdated notifications for committed commercial disbursements, triggering $2.6M in uncollateralized loan extensions).

    The architecture establishes

    1. Strict past-tense business-fact event classification distinguishing internal domain events from public integration events, commands, and telemetry;
    2. Immutable causal and temporal lineage (event_id, occurred_at, committed_at, aggregate_version, causation_id, correlation_id);
    3. Minimum semantic payloads omitting internal entity graphs, mutable aggregate state, and sensitive credentials;
    4. Explicit Domain-to-Integration Translation (Anti-Corruption Layers and Published Language adapters) preventing internal domain model leakage to external contexts.

    Detailed Description

    Emitting raw entity mutation snapshots (EntityCreated, EntityUpdated) or re-purposing rejectable commands as events creates catastrophic coupling across microservice boundaries. When events carry mutable aggregate graphs or lack explicit causal lineage, consumers make unsafe domain assumptions or process out-of-order state transitions. Domain events must represent immutable facts accepted by an aggregate root within its transaction boundary.

    Commercial Lending Context (Aggregate: CommercialLoanFacility)
     ├── Command Handled: ApproveLoanFacilityCommand
     ├── ACID State Commit: Status -> APPROVED, Version -> 4
     └── Emits Domain Fact: `LoanFacilityApproved` [MSG-DE-01]
           │
           ▼ (Transactional Outbox Commit in Local ACID Boundary)
     [ Local Outbox Relay ]
           │
           ├──────────────────────────────┬──────────────────────────────┐
           ▼ (Internal Context Consumer)  ▼ (ACL Translation)            ▼ (Public Published Language)
     [ InterestAccrualProjection ]  [ Treasury Clearing Adapter ]  [ Integration Event Mesh ]
       ├── Read-Model Update          ├── Maps to Inbound Command    ├── `LoanFacilityMaturedIntegrationEvent`
       └── Idempotent Consumer        └── `InitiateWireDisbursement` └── Zero Leaked Internal Entities
    

    Alternatives rejected

    OptionWhy it was not takenUnder what evidence it would win
    Generic CRUD Change Data Capture (LoanUpdated)Led directly to incident INC-4923 ($2.6M uncollateralized exposure); consumers cannot deduce actual business intent or state transitions from raw table diffs.Pure low-code analytical warehousing where business domain logic and invariant checks are completely absent.
    Synchronous Two-Phase Commit Distributed TransactionsHigh latency overhead (> 180 ms), prone to heuristic commit hazards and coordinator deadlocks under 14,000 TPS.Single-datacenter monolithic application with fewer than 3 services and low throughput requirements (< 50 TPS).
    Domain-to-Integration Event Mapping (Chosen)Retains selection; isolates private domain models, enforces past-tense business facts, guarantees idempotent consumption, and provides full causal auditability.High-throughput distributed financial banking platforms requiring autonomous bounded contexts and non-repudiable audit trails.

    Contracts and Invariants

    Immutable Business Fact Invariant [INV-DE-01]
      Domain events must be named in context-specific past tense representing finalized, committed business facts.
      Emitting prospective commands, mutable status flags, or generic CRUD update labels as domain events is strictly prohibited.
    
    Minimum Semantic Payload & Encapsulation [INV-DE-02]
      Domain event payloads must contain only attributes necessary to represent the occurred fact and satisfy within-context
      policies. Leaking internal aggregate entity graphs, database schema columns, or plaintext secrets is prohibited.
    
    Causal Lineage and Ordering Scope [INV-DE-03]
      Every domain event must record `event_id`, `aggregate_id`, `aggregate_version`, `occurred_at`, `committed_at`,
      `causation_id`, and `correlation_id`. Strict monotonic sequence ordering is guaranteed per aggregate root instance.
    
    Isolated Integration Contract Boundary [INV-DE-04]
      Internal domain events must never be exposed across bounded context boundaries directly. Cross-context communication
      must transit explicitly versioned Integration Events published through an Anti-Corruption Layer.
    

    Ownership and Handoffs

    ConcernOwnerHandoff payloadBlocked until
    Domain Event Governance & CatalogsHead of Domain Governance (Elena Rostova)domain_event_catalog_specArchitecture board sign-off
    Core Aggregate State TransitionsCommercial Lending Lead (Marcus Vance)aggregate_state_transition_matrixAggregate root test approval
    Context-to-Integration Event AdaptersTreasury Clearing Lead (Sarah Chen)acl_integration_event_schemaKafka Schema Registry release
    Transactional Outbox InfrastructureData Platform Engineering Leadoutbox_cdc_infrastructure_configCDC relay pipeline provisioning

    Traceability

    ClaimClassificationSourceFreshness
    14,000 TPS across Lending, Clearing, and RiskprovidedIngestion throughput profileCurrent
    Incident INC-4923 $2.6M uncollateralized loan defectprovidedHistorical post-mortem INC-4923Historical
    Prohibition of generic EntityUpdated CDC eventsdecidedDavid O'Reilly & Elena Rostova2026-09-15
    Minimum semantic payload and zero entity leakagedecidedArchitectural invariant INV-DE-022026-09-15
    Mandatory causal and correlation lineagedecidedArchitectural invariant INV-DE-032026-09-15
    Anti-Corruption Layer for cross-context eventsdecidedArchitectural invariant INV-DE-042026-09-15

    Verification

    No validator was supplied, so no command was run.

    Reviewer self-check against domain event architecture standards:

    Fact Semantics: PASS. Every event represents an accepted past-tense business fact (LoanFacilityApproved, DisbursementSettled).

    • Identity & Causality: PASS. Causal chains, monotonic sequence versions, and aggregate keys formally mandated.
    • Encapsulation: PASS. Zero internal aggregate entity leakage; distinct integration event translation enforced.
    • Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to rule_markdown.md.

    Open Decisions

    • DEC-DE-01: Elena Rostova to determine whether Schema Registry Avro or Protobuf 3 serialization should be standard for external integration events in Q2 (Owner: Elena Rostova).

    Next steps

    1. Marcus Vance ratifies the domain event catalog schemas for LoanFacilityApproved and DisbursementSettled.
    2. Platform team provisions Kafka topics partitioned by loan_facility_id with 7-day retention.
    3. Treasury Clearing team deploys Anti-Corruption Layer translation adapters for cross-context integration events.

    skill: domain-event-architect

    Commercial Lending & Clearing Domain Events — Fitness Self-Check [DE-FIT-001]

    Summary

    This fitness self-check evaluates the domain event architecture against three critical red-capable domain failure probes: anemic model, cross-context transaction, and duplicate language. All targeted probes pass by design construction. A self-check is supporting evidence, never the authoritative gate. Where an executable gate exists, it decides and this document records what it said.

    Detailed Description

    Criterion [FIT-n]ProbeEvidenceResultLimits of the claim
    FIT-1: Anemic ModelSeed a domain model where anemic entity setters mutate state without emitting domain events, delegating event publication to an external orchestration controller.ArchUnit domain integrity probe probe_anemic_event_emission_rejection verifying build failure on controller-orchestrated event emission with diagnostic ERR_ANEMIC_EVENT_EMISSION_DETECTED.passConfirms compile-time domain encapsulation; does not inspect dynamic runtime reflection triggers.
    FIT-2: Cross-Context TransactionSeed an event handler in Credit Risk that attempts to open a distributed multi-resource transaction back into the Commercial Lending primary database.Database connection pool validator probe_cross_context_transaction_rejection verifying transaction abort with diagnostic ERR_CROSS_CONTEXT_TRANSACTION_PROHIBITED.passConfirms database user privilege isolation; does not evaluate manual DBA direct terminal commands.
    FIT-3: Duplicate LanguageSeed a generic shared event jar containing an ambiguous TransactionProcessed event shared across both Lending and Clearing contexts without contextual qualification.Classpath dependency scanner probe probe_duplicate_language_rejection verifying build failure on un-scoped shared event jars with diagnostic ERR_DUPLICATE_EVENT_LANGUAGE_DETECTED.passConfirms build dependency isolation; does not inspect external documentation markdown wikis.

    Residual Risk

    • Transient outbox CDC polling lag (up to 45 ms) under sudden 20,000 event/sec burst spikes. Accepted by Elena Rostova with downstream consumer buffer sizing.

    Traceability

    ClaimClassificationSourceFreshness
    Rejection of anemic event emissionderivedFIT-1 probe result2026-09-15
    Rejection of cross-context transactionsderivedFIT-2 probe result2026-09-15
    Rejection of duplicate event languagederivedFIT-3 probe result2026-09-15

    Verification

    No validator was supplied, so no command was run.

    Open Decisions

    None.

    Next steps

    1. Integrate synthetic probes FIT-1, FIT-2, and FIT-3 into CI pipeline pull request gates.
    2. Conduct staging load drill simulating 14,000 events/sec to verify sub-50ms outbox delivery latency.
    3. Establish monthly event schema governance reviews with Elena Rostova and context team leads.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    This skill defines immutable business-fact contracts owned by one bounded context. It identifies which accepted transitions or occurrences are meaningful to the domain, names them in context language, specifies their temporal and identity semantics, relates them to commands and aggregate state, defines payload and privacy boundaries, separates internal domain facts from public integration contracts, and governs compatibility, consumers, deprecation, and verification.

    Use it when

    • Decide whether a state transition or occurrence deserves a domain event at all
    • Distinguish command, domain event, integration event, notification, audit/security event, telemetry, and state snapshot
    • Give an event an unambiguous past-tense business meaning within a model version
    • Define occurrence time, effective time, recording/commit time, producer identity, aggregate/entity identity, sequence/version, causation, correlation, tenant/scope, and provenance
    • Choose event payload based on fact semantics, aggregate reconstruction, internal decision needs, and privacy—not downstream convenience alone
    • Define domain-event persistence/dispatch timing relative to aggregate state and commit

    For example: “Our cold-chain sensors publish TemperatureUpdated events every 5 seconds, but downstream compliance services crash because they treat these raw telemetry readings as business audit events.”

    What you get

    • architecture/domain-event-architect/README.md
    • architecture/domain-event-architect/00-overview/domain-event-architect-overview.md
    • architecture/domain-event-architect/verification/fitness-self-check.md

    Plus one page per business module, only where your evidence calls for it: {module}/aggregates.md, {module}/domain-events.md, {module}/invariants.md, {module}/policies.md.

    All paths are relative to the output folder you choose.

    What it will not do

    Do not use for EventStorming discovery, broker/topic design, generic pub/sub, audit logs, commands, event sourcing by default, or adding an event after every state change.

    How it works

    1. Check context and aggregate authority.
    2. Classify event candidates.
    3. Name the business fact.
    4. Define temporal and identity semantics.
    5. Design minimum semantic payload.
    6. Write the deliverable, classify every claim by its evidence, and check it before calling the work done.

    What's in the package

    Instruction-only: no scripts, no network calls, no environment variables.

    • LICENSE.txt
    • SKILL.md
    • agents/openai.yaml
    • assets/output-template-artifact.md
    • assets/output-template-contract.md
    • assets/output-template-decision.md
    • assets/output-template-domain.md
    • assets/output-template-fitness.md
    • assets/output-template-mechanism.md
    • references/domain-rules.md
    • references/operating-rules.md
    • references/output-contract.md

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Do not use for EventStorming discovery, broker/topic design, generic pub/sub, audit logs, commands, event sourcing by default, or adding an event after every state change.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    Read Files
    Write Files

    Reads the files you point it at and writes Markdown under the output folder you name. No network access, no environment variables, and no bundled scripts.

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill helps teams distinguish between transient telemetry and immutable business facts, ensuring that events are named in business language and contain the correct causal lineage and identity semantics for long-term consistency.

    The package is instruction-based and compatible with any advanced LLM; it specifically includes an `agents/openai.yaml` configuration to streamline deployment for OpenAI-based agents.

    You receive a comprehensive set of instruction files, architectural templates (for contracts, decisions, and domain models), and a predefined folder structure to organize your domain event deliverables.

    No, this skill is strictly instruction-only and does not require network access, environment variables, or external scripts, making it safe for secure architectural environments.

    This skill focuses on defining the business meaning and contract of an event within a Bounded Context, rather than the technical implementation of brokers, topics, or pub/sub infrastructure.

    The skill provides a 'fitness self-check' tool to verify that every event claim is backed by evidence and adheres to defined domain rules before finalizing your documentation.

    New in APIs & Backend