This prompt is for a domain architect or technical lead who must choose an integration pattern between two or more bounded contexts and needs a structured trade-off analysis, not just a pattern name. The job-to-be-done is: given a description of the contexts, their relationship, and the non-functional requirements, produce a recommended integration pattern (e.g., Anti-Corruption Layer, Open Host Service, Published Language, Customer/Supplier, Conformist, Separate Ways, Partnership) with explicit rationale, implementation complexity estimate, and a list of risks the team must mitigate before committing. The ideal user has already completed a context map and understands the domain relationship type, but needs help translating that relationship into a concrete integration design.
Prompt
Bounded Context Integration Pattern Selection Prompt

When to Use This Prompt
Define the job, reader, and constraints for the Bounded Context Integration Pattern Selection Prompt.
Use this prompt when the team is debating between patterns, when an existing integration is causing friction and needs re-evaluation, or when a new context is being introduced and the integration contract must be defined before implementation starts. The prompt requires [CONTEXT_A_DESCRIPTION], [CONTEXT_B_DESCRIPTION], [RELATIONSHIP_TYPE], [NON_FUNCTIONAL_REQUIREMENTS], and [CURRENT_PAIN_POINTS] as inputs. It works best when the team has already classified the subdomains (Core, Supporting, Generic) and understands the organizational relationship between the teams owning each context. The prompt is designed to surface hidden coupling risks, translation overhead, and team coordination costs that are often invisible in a simple pattern diagram.
Do not use this prompt when the bounded contexts themselves are poorly defined or when the team lacks a context map. If the boundaries are still in discovery, use the Bounded Context Boundary Review Prompt first. Do not use this prompt for selecting communication protocols (REST, gRPC, messaging) in isolation—it focuses on the integration pattern, not the transport. The output is a design recommendation, not a buildable specification; downstream work will require the Anti-Corruption Layer Design Evaluation Prompt or the Domain Event Schema Design Review Prompt to turn the recommendation into implementation artifacts. If the integration involves regulated data or financial transactions, the output must be reviewed by a human architect before any implementation commitment, and the prompt's [RISK_LEVEL] placeholder should be set to 'high' to trigger additional scrutiny in the response.
Use Case Fit
Where this prompt works and where it does not. Use these cards to decide if the Bounded Context Integration Pattern Selection Prompt fits your current architecture decision.
Good Fit: Early-Stage Integration Design
Use when: You are designing a new integration between two bounded contexts and need to choose between ACL, Open Host, Published Language, Partnership, or Customer-Supplier patterns. Guardrail: Provide the context map, domain definitions, and non-functional requirements. The prompt performs best when the contexts are already identified and the integration surface is clear.
Bad Fit: Runtime Integration Debugging
Avoid when: You are troubleshooting a broken integration in production. This prompt selects architectural patterns, not root-cause analysis or incident response. Guardrail: Use an incident triage or runbook prompt for production failures. Reserve this prompt for design-time decisions before code is committed.
Required Inputs: Context Map and Quality Attributes
What you need: Bounded context definitions, relationship types, data ownership boundaries, latency requirements, consistency guarantees, and team topology. Guardrail: Missing context maps produce generic recommendations. If you cannot describe both contexts and their relationship, delay the prompt until you can.
Operational Risk: Over-Engineering Simple Integrations
What to watch: The prompt may recommend ACL or Published Language patterns for integrations that only need a simple shared kernel or conformist relationship. Guardrail: Always review the complexity estimate. If the recommendation adds translation layers to a low-change, single-team integration, question whether the pattern cost is justified.
Team Capability Dependency
What to watch: The prompt assumes the team can implement the recommended pattern. An ACL recommendation is useless if no one understands anti-corruption layer design. Guardrail: Pair the output with a team capability assessment. If the recommended pattern requires skills the team lacks, either invest in training or choose a simpler pattern with explicit trade-off documentation.
Evolution Risk: Pattern Lock-In
What to watch: The prompt recommends a pattern for the current state, but integration relationships evolve. A Customer-Supplier pattern today may need to become an Open Host tomorrow. Guardrail: Treat the output as a decision record with a review trigger. Document the conditions that would cause a pattern change and schedule a re-evaluation when those conditions shift.
Copy-Ready Prompt Template
A reusable prompt template for selecting the right integration pattern between two bounded contexts.
This prompt template is designed to be copied directly into your AI harness, IDE, or orchestration layer. It accepts two bounded context descriptions and a set of integration requirements, then produces a structured recommendation with trade-off analysis. The square-bracket placeholders represent variables your application must supply before sending the request to the model. Do not ship this prompt with unresolved placeholders in production.
textYou are a domain-driven design architect reviewing integration patterns between two bounded contexts. ## Context A [CONTEXT_A_DESCRIPTION] ## Context B [CONTEXT_B_DESCRIPTION] ## Integration Requirements - Data direction: [DATA_DIRECTION] - Consistency needs: [CONSISTENCY_REQUIREMENTS] - Latency tolerance: [LATENCY_TOLERANCE] - Team ownership: [TEAM_OWNERSHIP_MODEL] - Existing contracts: [EXISTING_CONTRACTS] - Scale and throughput: [SCALE_THROUGHPUT] ## Constraints [CONSTRAINTS] ## Output Schema Return a JSON object with this exact structure: { "recommended_pattern": "Anti-Corruption Layer | Open Host Service | Published Language | Conformist | Customer-Supplier | Separate Ways | Partnership | Shared Kernel", "confidence": "high | medium | low", "rationale": "2-3 sentence explanation of why this pattern fits the requirements", "trade_offs": [ { "dimension": "consistency | latency | autonomy | complexity | maintainability | team_velocity", "risk": "high | medium | low", "description": "specific risk for this integration" } ], "implementation_complexity": "high | medium | low", "implementation_steps": ["ordered list of 3-5 concrete implementation steps"], "alternative_patterns": [ { "pattern": "alternative pattern name", "when_to_consider": "condition that would make this pattern preferable" } ], "warning_flags": ["list of conditions that would invalidate this recommendation"] } ## Evaluation Criteria - Prefer patterns that preserve context autonomy when teams are separate. - If both contexts are owned by the same team, Shared Kernel becomes more viable. - If Context B cannot adapt to Context A's model, Anti-Corruption Layer is mandatory. - If the upstream context publishes a well-defined API, Open Host Service should be considered. - Flag Separate Ways if integration cost exceeds the value of coordination.
To adapt this template, replace each placeholder with data from your architecture review process. [CONTEXT_A_DESCRIPTION] and [CONTEXT_B_DESCRIPTION] should include the domain responsibility, team ownership, and key aggregates for each context. [DATA_DIRECTION] must specify whether data flows unidirectionally or bidirectionally. [CONSISTENCY_REQUIREMENTS] should capture whether eventual consistency is acceptable or strong consistency is required. If any input is unknown, set the value to "UNKNOWN" so the model can flag it as a risk rather than hallucinating an assumption. Before deploying, run this prompt against at least three known context pairs where you already know the correct pattern, and verify the model's recommendations match your architectural judgment.
Prompt Variables
Required and optional inputs for the Bounded Context Integration Pattern Selection Prompt. Each placeholder must be populated before the prompt can produce a reliable pattern recommendation.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SOURCE_CONTEXT] | Name and description of the upstream bounded context initiating the integration | OrderManagement (Core domain, owns order lifecycle and state transitions) | Must be a recognized context name from the team's context map. Reject generic labels like 'System A'. |
[TARGET_CONTEXT] | Name and description of the downstream bounded context receiving data or commands | Inventory (Supporting domain, tracks warehouse stock levels and reservations) | Must be a recognized context name. Validate that source and target are distinct contexts. |
[INTEGRATION_TRIGGER] | The business event or use case that requires data or behavior to cross the context boundary | When an order is confirmed, Inventory must reserve stock within 30 seconds | Must describe a concrete business scenario. Reject vague triggers like 'data sync needed'. |
[DATA_SHAPE] | The structure, fields, and semantics of the data crossing the boundary | OrderConfirmed event: {orderId, customerId, lineItems[{sku, quantity}], timestamp} | Must include field names and types. Validate that fields are defined in the source context's ubiquitous language. |
[CONSISTENCY_REQUIREMENT] | The acceptable staleness, latency, and delivery guarantees between contexts | Eventual consistency acceptable within 60 seconds. At-least-once delivery required. No two-phase commit. | Must specify latency tolerance, delivery semantics, and whether strong consistency is required. Reject 'real-time' without a number. |
[TEAM_OWNERSHIP] | Which teams own the source and target contexts and their integration responsibilities | Source: Order Team (4 engineers). Target: Inventory Team (3 engineers). Separate sprints, shared on-call. | Must identify team boundaries. If same team owns both contexts, note that as a factor in pattern selection. |
[EXISTING_INTEGRATIONS] | Current integration patterns already in use between these or related contexts | Order-to-Shipping uses Published Language via Kafka. No existing Order-to-Inventory integration. | List active patterns and technologies. Use 'None' if this is a greenfield integration. Validate against known architecture registry. |
[CONSTRAINTS] | Non-negotiable technical, organizational, or regulatory limits on the integration design | Must use existing Kafka cluster. No synchronous HTTP calls allowed per platform policy. PCI scope applies. | Each constraint must be verifiable. Reject aspirational constraints like 'should be fast'. Flag constraints that conflict with consistency requirements. |
Implementation Harness Notes
How to wire the Bounded Context Integration Pattern Selection Prompt into an architecture review workflow with validation, logging, and decision gates.
This prompt is designed to be called from an architecture review pipeline, a design decision CLI, or a pull request workflow where a team proposes a new integration between bounded contexts. The application layer is responsible for assembling the [CONTEXT_MAP], [NEW_INTEGRATION_DESCRIPTION], and [CONSTRAINTS] from existing architecture documentation, ADRs, or structured forms before invoking the model. Because integration pattern selection has long-term architectural consequences, the harness must treat the model output as a recommendation, not a final decision. The output should be persisted alongside the architecture decision record it supports, with clear attribution that the analysis was AI-assisted.
Implement a two-phase validation gate. First, validate the output schema: confirm the JSON contains the required fields (recommended_pattern, trade_off_analysis, implementation_complexity, risks, alternatives_considered) and that recommended_pattern matches one of the allowed enum values (ACL, Open Host, Published Language, Customer-Supplier, Conformist, Separate Ways, Partnership). Reject and retry once if the schema fails. Second, route the output for human review when the implementation_complexity score exceeds a threshold (e.g., 7/10) or when the risks array contains items flagged as severity: high. Log every invocation with the input context hash, model version, output pattern, and reviewer decision for auditability. For teams using an architecture knowledge base, retrieve the existing context map via RAG before calling the prompt so the model works from current, grounded information rather than stale or assumed boundaries.
Avoid wiring this prompt directly into a CI/CD gate that blocks merges. Integration pattern selection involves trade-off judgment that benefits from discussion. Instead, post the recommendation as a comment on the design document or ADR pull request, tagged for the architecture review group. If the model returns low confidence or flags contradictory constraints in the input, escalate to a synchronous review channel rather than silently accepting the best-guess output. The harness should also track pattern recommendations over time: if the same two contexts receive different pattern recommendations within a short window, surface that inconsistency for human investigation before the team commits to an implementation path.
Expected Output Contract
Defines the structure, types, and validation rules for the integration pattern recommendation output. Use this contract to parse, validate, and store the model response before presenting it to the architecture review board.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
recommended_pattern | enum: ACL | Open Host | Published Language | Customer-Supplier | Conformist | Separate Ways | Partnership | Must match one of the seven allowed enum values exactly. Reject on case mismatch or unrecognized pattern. | |
confidence_score | number (0.0-1.0) | Must be a float between 0.0 and 1.0 inclusive. Parse as float and check range. If null or out of range, trigger retry. | |
rationale_summary | string (max 500 chars) | Must be non-empty and reference at least one input constraint from [CONTEXT_BOUNDARIES] or [INTEGRATION_REQUIREMENTS]. Check for hallucinated context names. | |
trade_off_analysis | array of objects | Array must contain 2-5 objects, each with 'factor' (string), 'impact' (enum: positive | negative | neutral), and 'explanation' (string max 200 chars). Reject if array is empty or missing required sub-fields. | |
implementation_complexity | enum: low | medium | high | Must match one of three allowed values. Cross-validate against recommended_pattern: 'Separate Ways' should not be 'high' complexity. | |
anti_patterns_avoided | array of strings | Array must contain 1-4 strings, each naming a specific anti-pattern (e.g., 'Shared Kernel misuse', 'ACL bypass'). Each string must be non-empty and under 150 chars. | |
required_translation_layer | string or null | If recommended_pattern is ACL or Open Host, this field must be non-null and describe the translation mechanism. For other patterns, null is acceptable. Validate nullability against pattern. | |
migration_steps | array of strings (max 5 items) | If present, each string must be under 200 chars and describe a concrete action. Reject if steps reference tools or teams not mentioned in [TEAM_CONTEXT]. |
Common Failure Modes
What breaks first when using LLMs to select bounded context integration patterns, and how to guard against it.
Pattern Selection Without Context Map
What to watch: The model selects an integration pattern (e.g., ACL vs. Open Host) without first establishing the relationship type between the two contexts. This produces a technically valid pattern for the wrong relationship. Guardrail: Require the prompt to first classify the context relationship (Partnership, Customer-Supplier, Conformist, etc.) before pattern selection. Validate that the selected pattern matches the relationship type.
Ignoring Team and Organizational Constraints
What to watch: The model recommends patterns like Separate Ways or Open Host Service based purely on technical fit, ignoring whether the teams involved can actually collaborate, share a roadmap, or maintain the integration. Guardrail: Include team topology and organizational structure as required inputs. Add a constraint that the recommendation must be feasible given the stated team boundaries and communication paths.
Over-Engineering for Low-Volume Integrations
What to watch: The model defaults to heavy patterns (full ACL with translation layers, event-driven integration) for simple, low-volume, or stable integrations where a shared kernel or conformist approach would be more pragmatic. Guardrail: Require volume, change frequency, and complexity estimates as inputs. Add a complexity budget constraint that forces justification for any pattern above a specified threshold.
Confusing Published Language with Open Host
What to watch: The model conflates Published Language (a well-documented shared model, often used with Open Host) with Open Host Service (a protocol or API that serves multiple consumers). This leads to recommendations that lack a clear translation boundary. Guardrail: Include definitions of each pattern in the prompt context. Require the output to explicitly state whether a translation layer exists between the contexts and who owns it.
Missing Anti-Corruption Layer When It's Critical
What to watch: The model recommends direct integration (Shared Kernel, Conformist) when one context's model is legacy, poorly structured, or would corrupt the downstream domain model. This is the most expensive failure mode to fix later. Guardrail: Add a mandatory check: if either context is legacy, externally owned, or has a model known to be inconsistent, require explicit justification before omitting an ACL. Flag any recommendation that lacks this justification.
Ignoring Data Consistency and Latency Requirements
What to watch: The model recommends asynchronous, event-driven integration when the use case requires synchronous consistency, or vice versa. This produces a pattern that violates the system's non-functional requirements. Guardrail: Require consistency semantics (strong, eventual, read-your-writes) and latency budgets as explicit inputs. Validate that the recommended pattern's communication style (sync/async) matches the stated requirements.
Evaluation Rubric
Criteria for evaluating the quality of a bounded context integration pattern recommendation before approving it for an architecture decision record.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Pattern Justification | Recommendation cites at least two context characteristics (e.g., team autonomy, latency, data ownership) from the input that directly support the chosen pattern. | Recommendation is generic ('best practice') or references characteristics not present in the input context descriptions. | Manual review: trace each justification claim back to a specific input detail. |
Trade-off Completeness | Output includes at least one explicit downside or cost for the recommended pattern and at least one upside for the highest-ranked alternative. | Output presents the recommended pattern as having no downsides or dismisses alternatives without reasoning. | Schema check: confirm [TRADE_OFFS] section is non-empty and contains both pro and con statements for multiple patterns. |
Anti-Corruption Layer Trigger | If any context uses a different ubiquitous language or data model, the output either recommends ACL or explicitly justifies why ACL is not needed. | Two contexts with clearly different domain models are recommended for direct RPC or shared database without an ACL or translation layer discussion. | Keyword match: if input [CONTEXT_DESCRIPTIONS] contains differing terminology, assert output contains 'Anti-Corruption Layer' or a reasoned exclusion. |
Implementation Complexity Estimate | Output includes a complexity rating (Low/Medium/High) with at least one specific driver (e.g., 'requires new translation service', 'adds cross-team coordination'). | Complexity rating is missing, or is present but has no supporting driver from the input context. | Schema check: confirm [COMPLEXITY_ESTIMATE] field is populated and [COMPLEXITY_DRIVERS] array has at least one entry. |
Pattern Exclusion Reasoning | Output explains why at least two plausible alternative patterns were not selected, referencing specific context constraints. | Output only describes the chosen pattern without addressing why other common patterns (e.g., Open Host, Published Language) were rejected. | Count check: verify [ALTERNATIVES_CONSIDERED] contains at least two entries, each with a rejection reason tied to input constraints. |
Team Autonomy Alignment | Recommendation accounts for team boundaries: if two contexts are owned by separate teams, the pattern preserves independent deployability unless explicitly overridden. | Output recommends a shared kernel or database integration for contexts owned by different teams without acknowledging the coordination cost. | Cross-reference: if [TEAM_OWNERSHIP] shows different owners, assert output addresses deployability or coordination in [RATIONALE]. |
Output Schema Validity | Output is valid JSON matching the expected [OUTPUT_SCHEMA] with all required fields present and correctly typed. | Output is missing required fields, contains malformed JSON, or has wrong types (e.g., string where array is expected). | Automated schema validation: parse output and validate against [OUTPUT_SCHEMA] using a JSON Schema validator. |
No Spurious Pattern Invention | Recommended pattern is drawn from recognized DDD integration patterns (ACL, Open Host, Published Language, Shared Kernel, Customer/Supplier, Conformist, Separate Ways). | Output invents a pattern name not in the DDD integration pattern catalog or mislabels a standard pattern. | Enum check: confirm [RECOMMENDED_PATTERN] value is in the allowed set: ['ACL', 'Open Host', 'Published Language', 'Shared Kernel', 'Customer/Supplier', 'Conformist', 'Separate Ways']. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single bounded context pair and lighter validation. Remove the implementation complexity estimate and focus on pattern recommendation with brief trade-off notes. Accept free-text output instead of strict JSON schema.
Watch for
- Overlooking implicit coupling that isn't documented
- Recommending patterns without enough context about team maturity
- Missing anti-corruption layer signals when contexts share databases

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us