Inferensys

Prompt

Domain Event Schema Design Review Prompt

A practical prompt playbook for platform engineers using AI to review domain event schemas against naming, payload, versioning, and enrichment standards before implementation.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

A design-time guardrail that critiques domain event schemas before they become runtime incidents.

Domain event schemas are contracts between bounded contexts. A poorly designed event creates coupling, breaks consumers, and hides causation. This prompt acts as a design reviewer that critiques an event schema before it reaches a schema registry or gets implemented in a producer. Use it when a platform engineer or domain architect proposes a new event type, modifies an existing event, or audits a catalog of events for consistency. The prompt assumes you have a draft schema in JSON, Avro, or Protobuf format and want a structured critique covering naming conventions, payload design, versioning strategy, enrichment decisions, and ordering assumptions.

The prompt is not a replacement for consumer-driven contract testing or schema registry compatibility checks. It is a design-time guardrail that catches fat events, missing causation identifiers, and implicit ordering dependencies before they become runtime incidents. For example, if a OrderPlaced event embeds the entire customer profile and shopping cart snapshot, the prompt will flag it as a fat event that couples consumers to producer internals. If an event lacks a correlationId or causationId, the prompt will call out the missing causation chain that makes debugging and tracing impossible in production. If the schema implies consumers must process events in a specific sequence without an explicit ordering key, the prompt will surface that hidden assumption.

Do not use this prompt for runtime schema validation, consumer compatibility testing, or performance benchmarking. It does not replace a schema registry's compatibility rules, nor does it simulate consumer behavior under load. Use it early in the design process, before implementation, and pair it with a schema registry check and at least one consumer-driven contract test before deploying to production. For high-risk domains such as finance or healthcare, always route the prompt's output through a human architect review before finalizing the schema.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Domain Event Schema Design Review Prompt delivers strong results and where it introduces risk. Use these cards to decide whether this prompt fits your current review workflow.

01

Good Fit: Pre-Implementation Schema Review

Use when: A platform engineer has drafted a new domain event schema and needs a structured critique before it reaches a schema registry or consumer teams. Guardrail: Run the review against a written schema definition, not a verbal description. The prompt needs concrete field names, types, and sample payloads to produce actionable feedback.

02

Good Fit: Event Portfolio Consistency Audit

Use when: You have multiple event schemas across bounded contexts and need to detect naming drift, payload inconsistency, or missing correlation fields. Guardrail: Provide a representative sample of schemas, not the entire catalog. The prompt works best comparing 3-8 related schemas; larger batches dilute the critique.

03

Bad Fit: Runtime Event Payload Debugging

Avoid when: You are troubleshooting a production incident caused by malformed event payloads at runtime. This prompt reviews schema design, not serialized message traces. Guardrail: Use a data extraction or log analysis prompt for runtime payload inspection. Reserve this prompt for design-time schema review.

04

Bad Fit: Consumer Contract Validation

Avoid when: You need to verify that downstream consumers can handle a schema change. This prompt critiques the schema itself, not consumer compatibility. Guardrail: Pair this prompt with a separate consumer impact analysis or contract testing workflow. Schema review alone does not replace integration testing.

05

Required Inputs

What you must provide: A written event schema definition including event name, payload fields with types, metadata fields, and any versioning or enrichment annotations. Guardrail: If you cannot articulate the event's business meaning and triggering condition, the prompt cannot assess naming or semantic clarity. Write a one-sentence event purpose statement before invoking the review.

06

Operational Risk: Over-Confidence on Versioning Advice

Risk: The model may recommend versioning strategies that conflict with your schema registry tooling or organizational policy. Guardrail: Treat versioning recommendations as discussion starters, not policy decisions. Validate any breaking-change advice against your actual registry capabilities and consumer upgrade SLAs before adopting it.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt template for reviewing domain event schema designs, ready to paste into your AI workflow.

The following prompt template is designed to be copied directly into your AI workflow. It provides a structured framework for reviewing domain event schemas, covering naming conventions, payload design, versioning strategy, and enrichment patterns. Replace each square-bracket placeholder with your specific event schema, domain context, and review constraints before running the prompt.

code
You are a domain event schema design reviewer. Your task is to critique the provided domain event schema and produce a structured review report.

## EVENT SCHEMA TO REVIEW
[EVENT_SCHEMA]

## DOMAIN CONTEXT
[DOMAIN_CONTEXT]

## REVIEW CRITERIA
Evaluate the schema against the following dimensions:

1. **Naming and Semantics**: Does the event name clearly communicate what happened in domain language? Are field names consistent with the ubiquitous language? Flag any ambiguous or technical-only naming.

2. **Payload Design**: Is the payload complete enough for consumers without being a fat event? Check for missing required fields, overly large payloads, and fields that belong in a different event or context.

3. **Versioning and Evolution**: Does the schema include a version indicator? Assess backward compatibility risks if fields are added, removed, or changed. Flag any implicit versioning assumptions.

4. **Causation and Correlation**: Does the event include causation ID, correlation ID, and event ID? Check that consumers can reconstruct causal chains and correlate related events.

5. **Enrichment Strategy**: Is the event self-contained enough for common consumers, or does it force excessive lookups? Identify fields that should be enriched at source versus fields consumers should fetch.

6. **Ordering Assumptions**: Does the schema imply or require ordering guarantees? Flag any assumptions about total ordering, exactly-once delivery, or synchronous processing.

7. **Schema Registry Compatibility**: If using a schema registry, assess compatibility with common registry formats (Avro, JSON Schema, Protobuf). Flag type choices that cause serialization problems.

## OUTPUT FORMAT
Produce a JSON review report with this structure:

{
  "overall_assessment": "PASS | NEEDS_REVISION | FAIL",
  "summary": "2-3 sentence summary of key findings",
  "findings": [
    {
      "severity": "BLOCKER | HIGH | MEDIUM | LOW",
      "dimension": "Naming | Payload | Versioning | Causation | Enrichment | Ordering | Compatibility",
      "description": "Specific finding with evidence from the schema",
      "recommendation": "Actionable fix or design change"
    }
  ],
  "risks": [
    {
      "risk": "Description of production risk if not addressed",
      "likelihood": "HIGH | MEDIUM | LOW",
      "impact": "HIGH | MEDIUM | LOW"
    }
  ],
  "versioning_notes": "Specific guidance on versioning strategy for this schema"
}

## CONSTRAINTS
- Only flag issues you can point to in the provided schema. Do not invent problems.
- If the schema is incomplete, note what is missing rather than assuming defaults.
- For [RISK_LEVEL] workflows, require human review before publishing events to production.
- If the schema appears production-ready with no significant issues, say so clearly.

Adaptation guidance: Replace [EVENT_SCHEMA] with the actual schema definition in JSON Schema, Avro, Protobuf, or a structured description. Replace [DOMAIN_CONTEXT] with a brief description of the bounded context, the event's purpose, and any known consumer requirements. Replace [RISK_LEVEL] with HIGH for financial, compliance, or safety-critical domains to enforce human review requirements. For low-risk internal events, you can remove or relax the human review constraint. If you have specific organizational standards for event schemas, add them as additional review criteria before the output format section.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder required by the Domain Event Schema Design Review Prompt, its purpose, a concrete example, and actionable validation notes for wiring into an application harness.

PlaceholderPurposeExampleValidation Notes

[EVENT_SCHEMA]

The complete domain event schema definition to be reviewed, including name, payload fields, metadata, and headers.

{"eventName": "OrderPlaced", "version": "1.2.0", "payload": {"orderId": "string", "customerId": "string", "items": "array"}, "metadata": {"correlationId": "string", "causationId": "string"}}

Must be valid JSON. Schema check: confirm presence of eventName, version, and payload keys. Reject if empty or unparseable.

[BOUNDED_CONTEXT]

The name of the bounded context that owns and emits this event, used to assess naming alignment and ownership boundaries.

OrderManagement

Must be a non-empty string. Validate against a known context registry if available. Warn if context name does not match event namespace prefix.

[UBIQUITOUS_LANGUAGE_GLOSSARY]

A dictionary of approved domain terms and their definitions, used to check if event field names and values align with the canonical language.

{"Order": "A customer request to purchase goods", "LineItem": "A single product entry within an order", "Fulfillment": "The process of preparing an order for shipment"}

Must be a valid JSON object with string keys and string values. If null or empty, the review should flag that language alignment checks are skipped and note the risk.

[CONSUMER_CONTEXTS]

A list of bounded contexts that subscribe to this event, used to evaluate payload sufficiency and fat-event risks.

["Shipping", "Billing", "NotificationService"]

Must be a JSON array of strings. If empty, the review should flag that consumer impact analysis is not possible. Each entry should match a known context identifier.

[VERSIONING_POLICY]

The organization's event versioning rules, such as backward-compatibility requirements, deprecation windows, and schema registry constraints.

All events must support backward-compatible additions for 3 minor versions. Breaking changes require a new major version and a migration plan for consumers.

Must be a non-empty string or structured policy object. If null, the review should note that versioning assessment is based on general best practices rather than organizational policy.

[SCHEMA_REGISTRY_RULES]

Constraints enforced by the schema registry, such as allowed naming patterns, required metadata fields, and compatibility checks.

{"namingPattern": "^[A-Z][a-zA-Z]+$", "requiredMetadata": ["correlationId", "causationId", "occurredAt"], "compatibilityMode": "BACKWARD"}

Must be a valid JSON object. If null, the review should skip registry-specific checks and note the absence. Validate that requiredMetadata fields are present in [EVENT_SCHEMA] metadata.

[OUTPUT_SCHEMA]

The expected structure of the review output, defining the sections and fields the model must produce.

{"sections": ["NamingReview", "PayloadDesignCritique", "VersioningAssessment", "EnrichmentStrategy", "RiskFlags"], "requiredFields": ["finding", "severity", "recommendation"]}

Must be a valid JSON schema or object describing the output contract. Parse check before prompt assembly. If null, the review output format is unconstrained and downstream parsing may fail.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Domain Event Schema Design Review Prompt into a CI pipeline or review application with validation, retries, and human approval gates.

This prompt is designed to be called programmatically as part of a schema registry CI check or an internal developer portal review workflow. The primary integration point is a pre-merge or pre-registration gate: when a team proposes a new event schema or a version bump, the application sends the schema definition, the owning bounded context, and any consumer registry metadata to the model. The model returns a structured critique that your harness can parse, log, and act on before the schema is published. Do not use this prompt for runtime event validation; it is a design-time review tool, not a production event filter.

Wire the prompt into a lightweight service or CI job that constructs the [EVENT_SCHEMA] input from your schema registry (Avro, JSON Schema, or Protobuf descriptor), populates [BOUNDED_CONTEXT] from your service catalog, and injects [CONSUMER_REGISTRY] by querying which downstream services subscribe to this event type. The harness must enforce a strict JSON output contract: parse the model response, validate it against the expected schema (fields like critique.categories, critique.severity, critique.recommendation), and retry once with a repair prompt if parsing fails. Log every review result—including model, prompt version, schema version, and parsed critique—to an audit table so you can track review quality over time. For high-risk domains (finance, healthcare, auth), add a human approval gate: if the critique contains any severity: "BLOCKER" finding, prevent automatic merge and route to a designated reviewer queue.

Model choice matters here. Use a model with strong structured output support and a large context window if your schemas include verbose Protobuf descriptors or extensive consumer metadata. Enable JSON mode or structured outputs if your provider supports it; otherwise, include a repair step that strips markdown fences and retries parsing. Avoid running this prompt on every commit if schemas haven't changed—cache the last review result keyed by schema fingerprint (hash the normalized schema content). The next step after implementation is to build an eval set: collect 20–30 real schemas with known issues (fat events, missing causation IDs, ambiguous enum values) and verify the prompt catches them consistently before you trust the automation.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, types, and validation rules for the Domain Event Schema Design Review response. Use this contract to parse, validate, and route the model output before surfacing it to a reviewer or storing it in a design repository.

Field or ElementType or FormatRequiredValidation Rule

overall_assessment

string

Must be one of: 'Pass', 'Pass with Recommendations', 'Requires Rework'. No free text.

naming_review

object

Must contain 'score' (integer 1-5), 'issues' (array of strings), and 'suggestions' (array of strings). 'issues' may be empty.

payload_review

object

Must contain 'fat_event_flags' (array of field names or empty array), 'missing_required_fields' (array of field names or empty array), and 'sensitive_data_concerns' (array of strings or empty array).

versioning_review

object

Must contain 'strategy_assessment' (string), 'breaking_change_risks' (array of strings), and 'schema_registry_compatibility' (one of: 'Compatible', 'Incompatible', 'Not Applicable').

enrichment_review

object

Must contain 'causation_trace_present' (boolean), 'ordering_assumptions' (array of strings), and 'missing_context_fields' (array of strings).

critical_findings

array

Each element must be an object with 'severity' (one of: 'Blocker', 'Major', 'Minor'), 'category' (string), and 'description' (string). Array may be empty but must be present.

recommendation_summary

string

Must be 2-5 sentences. Null or empty string not allowed. If no recommendations, use 'No recommendations. Schema meets review criteria.'

review_confidence

number

Must be a float between 0.0 and 1.0. Values below 0.7 should trigger a human review flag in the application layer.

PRACTICAL GUARDRAILS

Common Failure Modes

When reviewing domain event schemas with LLMs, these failures surface most often in production. Each card pairs a specific failure with a concrete guardrail you can implement before the prompt reaches users.

01

Fat Events That Leak Internal State

What to watch: The model approves events carrying full entity snapshots, database row projections, or internal implementation details. This creates tight coupling between services and turns events into data dumps rather than intentional contracts. Guardrail: Add an explicit constraint in the prompt: 'Flag any field that exposes internal state, persistence IDs, or data not required for consumer decision-making. Recommend removing fields that belong to the source aggregate's private state.'

02

Missing Causation and Correlation Identifiers

What to watch: The model accepts events without causationId, correlationId, or equivalent tracing fields. This makes distributed debugging impossible and breaks event lineage across context boundaries. Guardrail: Include a required field checklist in the prompt schema that explicitly demands causation and correlation identifiers. Add a validation rule: 'If no causation identifier is present, mark this as a blocking finding.'

03

Implicit Ordering Assumptions

What to watch: The model fails to detect when event consumers must process events in a specific sequence, but the schema provides no ordering guarantees (no sequence number, no timestamp precision, no idempotency key). Guardrail: Add a review dimension: 'Identify any consumer logic that would break under out-of-order delivery. Recommend adding sequence numbers, event timestamps with adequate precision, or making the consumer idempotent.'

04

Versioning Strategy Omission

What to watch: The model reviews the schema as a one-time artifact without questioning how it will evolve. Breaking changes, field deprecation, and consumer migration paths are ignored. Guardrail: Add a mandatory review section: 'Evaluate the versioning strategy. If no version field, schema registry reference, or evolution policy is documented, flag this as a critical gap. Recommend explicit versioning before first production deployment.'

05

Enrichment Without Source Grounding

What to watch: The model suggests enriching events with derived data, lookups, or computed values without specifying the source system, freshness guarantees, or staleness tolerance. This creates events that look complete but contain unverifiable data. Guardrail: Add a constraint: 'For any enrichment suggestion, require the source system, refresh cadence, and staleness tolerance to be documented. Flag enrichment without source grounding as a data quality risk.'

06

Payload Size Blindness

What to watch: The model approves large payloads without considering broker limits, serialization costs, consumer memory pressure, or network transfer time. Events that work in development fail under production throughput. Guardrail: Add a quantitative check: 'Estimate payload size for typical and worst-case instances. Flag any event exceeding [MAX_SIZE_BYTES] with a recommendation to split, reference external data, or use a slim notification pattern with a retrieval endpoint.'

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality of the Domain Event Schema Design Review output before shipping it to your team. Each criterion targets a specific failure mode common in event schema reviews.

CriterionPass StandardFailure SignalTest Method

Naming Convention Adherence

Every event and property name in the critique references a specific violation of the domain's ubiquitous language or a standard naming pattern (e.g., past-tense verbs, no technical suffixes).

Critique uses vague terms like 'bad name' or 'improve naming' without citing the specific term and the rule it breaks.

Spot-check 3 naming critiques: each must quote the original name, state the violated convention, and suggest a concrete alternative.

Fat Event Detection

Payload critique explicitly flags properties that belong to a different bounded context or aggregate, with a rationale for why they cause coupling.

Critique misses large, out-of-context payload sections or only flags 'payload too large' without identifying the specific foreign properties.

Insert a known fat event with 2 properties from a foreign context. Verify both are flagged with the correct context boundary cited.

Causation and Correlation Analysis

Output identifies whether the event schema supports causation tracking (e.g., a causationId field) and flags missing fields that would prevent root-cause analysis.

Critique only discusses event ordering but ignores the absence of a causation identifier or correlation identifier.

Provide a schema missing causationId. Confirm the critique flags the omission and explains the operational impact.

Versioning Strategy Assessment

Critique evaluates the schema's versioning approach (e.g., field in payload vs. topic version vs. schema registry) and flags breaking changes with a migration impact statement.

Critique states 'add versioning' without specifying the strategy, or fails to identify a field removal as a breaking change.

Supply a schema with a removed required field and no version indicator. Verify the output labels it as a breaking change and suggests a versioning mechanism.

Ordering Assumption Validation

Output explicitly identifies any implicit ordering assumptions (e.g., 'Event A always arrives before Event B') and flags them as risks if no ordering guarantee exists.

Critique ignores temporal coupling between events or assumes a global order without questioning the transport guarantees.

Provide two event schemas with an implicit ordering dependency. Confirm the critique flags the assumption and recommends a design change (e.g., sequence number, saga pattern).

Enrichment Strategy Review

Critique evaluates the enrichment approach (inline data vs. reference by ID) and flags data duplication that risks staleness or inconsistency.

Output fails to distinguish between reference data (stable IDs) and frequently changing data duplicated in the payload.

Insert a payload with a duplicated, mutable field (e.g., customerTier). Verify the critique recommends referencing by ID or explicitly accepts the staleness trade-off.

Schema Completeness Check

Output identifies missing metadata fields essential for production operation: event ID, timestamp, source system, and schema version.

Critique focuses only on domain properties and ignores operational metadata gaps.

Provide a schema missing eventId and timestamp. Confirm the critique flags both as required for observability and deduplication.

Actionable Recommendation Quality

Every finding includes a concrete, implementable recommendation, not just a problem statement.

Critique contains findings that end with 'needs improvement' or 'consider revising' without a specific next step.

Scan all findings. Each must contain a directive phrase like 'Add field X with type Y', 'Rename Z to W', or 'Remove property A because B'.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single event schema and lighter validation. Drop the enrichment strategy and versioning sections if you're exploring early designs. Focus on naming and payload shape only.

code
Review this domain event schema for a [DOMAIN] system:
[EVENT_SCHEMA_JSON]

Check naming, payload design, and obvious fat-event problems.

Watch for

  • Missing schema structure checks when the model skips fields
  • Overly broad feedback that doesn't point to specific fields
  • No versioning guidance, which is fine for prototypes but dangerous if carried forward
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.