This prompt is for domain architects and engineering leads who need to transform raw business capability descriptions, event storming outputs, or existing system documentation into a structured bounded context map. The job-to-be-done is not just drawing boxes on a whiteboard—it's producing a rigorous, repeatable analysis that identifies candidate contexts, their responsibility boundaries, ubiquitous language terms, and integration points. Use this when you are starting a decomposition effort, validating an existing service map against domain logic, or preparing for a Strangler Fig migration where getting the boundaries wrong upfront creates a distributed monolith that is more expensive to fix than the original system.
Prompt
Bounded Context Discovery Prompt

When to Use This Prompt
Define the job, reader, and constraints for the Bounded Context Discovery Prompt.
The ideal user has access to domain expert interviews, business process documentation, event storming artifacts, or a working knowledge of the system's core capabilities. The prompt requires a [DOMAIN_DESCRIPTION] input that can be a narrative, a list of business capabilities, or a set of domain events. You should also provide [UBIQUITOUS_LANGUAGE_TERMS] as a glossary of known domain terms to ground the analysis. The prompt works best when the domain is complex enough to have multiple candidate boundaries but not so poorly understood that no stakeholder can articulate what the system does. It is not a replacement for collaborative domain modeling with domain experts—it is a structured synthesis tool that accelerates the analysis phase and surfaces boundary conflicts before they become code.
Do not use this prompt when the domain is trivial (a single context with no meaningful decomposition), when you lack any domain documentation or expert access (the model will hallucinate plausible but wrong boundaries), or when the output will be treated as a final architecture decision without human review. The prompt produces candidate contexts that require validation against team structures, deployment constraints, and real-world coupling data. It is a discovery accelerator, not an architecture oracle. For regulated domains like healthcare or finance, always run the output through a domain expert review gate and cross-reference against compliance requirements before committing to service boundaries.
Use Case Fit
Where Bounded Context Discovery delivers value and where it introduces risk. Use these cards to decide if this prompt fits your current architecture challenge.
Good Fit: Greenfield Domain Exploration
Use when: You are starting a new product or modernizing a legacy monolith and need to identify candidate boundaries before writing code. The prompt excels at synthesizing business capabilities, terminology, and integration points from unstructured domain descriptions. Guardrail: Always validate the output against stakeholder interviews. The model can identify logical boundaries but cannot feel organizational friction or Conway's Law violations.
Bad Fit: Runtime Performance Optimization
Avoid when: You need to reduce latency, optimize database queries, or fix production throughput issues. This prompt analyzes domain structure, not runtime behavior. Guardrail: Use observability and profiling tools for performance work. Reserve this prompt for design-time boundary decisions where the cost of a wrong boundary is high coupling, not slow response times.
Required Inputs: Domain Artifacts and Business Language
Risk: Garbage in, garbage out. If you provide only technical architecture diagrams without business context, the prompt will produce technically plausible but domain-wrong boundaries. Guardrail: Feed the prompt business capability maps, user journey descriptions, stakeholder terminology glossaries, and existing process documentation. The richer the domain language input, the more accurate the context map.
Operational Risk: Over-Decomposition Bias
Risk: LLMs tend to split things apart. Without explicit constraints, the prompt may propose too many bounded contexts, creating a nano-service migration plan that increases operational complexity. Guardrail: Add a constraint in the prompt to justify why each boundary must be separate, not just why it could be. Require the model to identify merge candidates and flag contexts that could be combined without losing autonomy.
Team Dependency: Requires Domain Expert Review
Risk: The output will sound authoritative even when wrong. A plausible-sounding bounded context name with a clean responsibility statement can mask a fundamental misunderstanding of the business. Guardrail: Never ship a context map directly from the model into an architecture decision record. Run a review workshop with domain experts and engineering leads. Use the prompt output as a starting point for discussion, not a final answer.
Integration Risk: Missing Legacy Constraints
Risk: The prompt operates on described domain logic, not on the actual constraints of your existing systems. It may propose boundaries that require impossible database splits or ignore regulatory data residency requirements. Guardrail: Pair this prompt with the Distributed Monolith Risk Detection prompt after generating candidates. Cross-reference every proposed boundary against your actual data architecture, deployment topology, and compliance requirements before sequencing migration work.
Copy-Ready Prompt Template
A reusable prompt for analyzing business capabilities and identifying candidate bounded contexts with domain terminology, responsibility boundaries, and integration points.
This prompt template is designed to be copied directly into your AI harness. It uses square-bracket placeholders for all dynamic inputs, ensuring you can adapt it to different domains, systems, and organizational contexts without modifying the core instruction structure. The template expects you to provide business capability descriptions, existing system context, and output format requirements before execution.
textYou are a domain-driven design architect analyzing business capabilities to identify candidate bounded contexts. Your task is to produce a context map that defines domain terminology, responsibility boundaries, and integration points between contexts. ## INPUT [BUSINESS_CAPABILITY_DESCRIPTIONS] ## EXISTING SYSTEM CONTEXT [EXISTING_SYSTEM_CONTEXT] ## CONSTRAINTS [CONSTRAINTS] ## OUTPUT SCHEMA You must produce a JSON object with the following structure: { "bounded_contexts": [ { "name": "string", "description": "string", "core_responsibilities": ["string"], "ubiquitous_language_terms": [ { "term": "string", "definition": "string", "context_specific_meaning": "string" } ], "owning_team": "string or null", "key_aggregates": ["string"], "domain_events_published": ["string"], "domain_events_consumed": ["string"] } ], "context_relationships": [ { "upstream_context": "string", "downstream_context": "string", "relationship_type": "partnership | customer-supplier | conformist | anti-corruption-layer | open-host-service | published-language | separate-ways | shared-kernel", "integration_mechanism": "string", "translation_layer_required": true or false, "justification": "string" } ], "overlap_detection": [ { "context_a": "string", "context_b": "string", "overlapping_concept": "string", "resolution_recommendation": "string", "severity": "high | medium | low" } ], "boundary_confidence_scores": [ { "context_name": "string", "cohesion_score": 0.0 to 1.0, "coupling_score": 0.0 to 1.0, "business_alignment_score": 0.0 to 1.0, "overall_confidence": 0.0 to 1.0, "risk_factors": ["string"] } ] } ## INSTRUCTIONS 1. Analyze each business capability to identify distinct domains with separate ubiquitous languages. 2. For each candidate bounded context, define its core responsibilities and key domain terminology. 3. Identify integration points between contexts and classify each relationship using the standard DDD relationship types. 4. Detect overlapping concepts where two contexts appear to own the same responsibility or use conflicting terminology for the same concept. 5. Assign confidence scores based on cohesion within contexts, coupling between contexts, and alignment with business capabilities. 6. Flag any contexts that appear too large (low cohesion) or too small (trivial responsibility) with specific risk factors. 7. If [CONSTRAINTS] specify organizational or technical boundaries, incorporate those into your analysis. ## VALIDATION RULES - Every bounded context must have at least one core responsibility. - Every ubiquitous language term must have a context-specific meaning distinct from generic definitions. - Context relationships must reference only contexts defined in the bounded_contexts array. - Overlap detection entries must reference two distinct contexts. - Confidence scores must be between 0.0 and 1.0 inclusive. - If no overlaps are detected, return an empty overlap_detection array.
After copying this template, replace each square-bracket placeholder with your actual inputs. The [BUSINESS_CAPABILITY_DESCRIPTIONS] should contain structured descriptions of what your business does—process flows, user journeys, or capability maps. The [EXISTING_SYSTEM_CONTEXT] should describe current system boundaries, database ownership, and team structures. The [CONSTRAINTS] placeholder accepts organizational policies, regulatory requirements, or technical limitations that affect boundary decisions. If you don't have constraints, replace it with 'No specific constraints.'
Before wiring this into production, validate the output against the schema using a JSON schema validator. Run at least three test cases: a well-structured domain with clear boundaries, an ambiguous domain with overlapping responsibilities, and a domain with regulatory constraints. Compare the overlap detection results against manual domain analysis to calibrate the model's sensitivity. For high-stakes architectural decisions, always have a domain expert review the context map before committing to service boundaries.
Prompt Variables
Required inputs for the Bounded Context Discovery Prompt. Each placeholder must be populated before execution to ensure reliable domain analysis and context map generation.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DOMAIN_DESCRIPTION] | Describes the business domain under analysis, including core capabilities, stakeholders, and business goals | Online retail platform handling product catalog, inventory, order fulfillment, and customer accounts across web and mobile channels | Must contain at least 3 distinct business capabilities. Reject if input is under 50 words or lacks capability nouns |
[UBIQUITOUS_LANGUAGE_TERMS] | Lists domain-specific terminology currently in use across teams, documents, and codebases | Order, Fulfillment, Shipment, Inventory, SKU, Warehouse, PickList, Carrier, TrackingNumber, ReturnAuthorization | Must include 10+ terms. Validate that each term has a single canonical definition provided. Flag terms with conflicting definitions across teams |
[EXISTING_SYSTEM_BOUNDARIES] | Describes current service, module, or team ownership boundaries that may influence context discovery | Monolith with modules: CatalogService, OrderService, UserService, PaymentGateway, ShippingAdapter. Team A owns Catalog+Inventory, Team B owns Orders+Shipping | Must specify both technical boundaries and team ownership. Null allowed if greenfield. Validate that boundary descriptions include integration points |
[BUSINESS_PROCESS_FLOWS] | Documents end-to-end business processes that cross potential context boundaries | Customer places order -> Payment authorized -> Inventory reserved -> Warehouse picks items -> Carrier ships -> Delivery confirmed -> Payment captured | Must include at least one end-to-end flow with 5+ steps. Validate that each step references a domain concept from [UBIQUITOUS_LANGUAGE_TERMS] |
[INTEGRATION_CONSTRAINTS] | Specifies technical or organizational constraints on how bounded contexts may communicate | Must use async messaging for cross-team boundaries. No shared databases allowed. Eventual consistency acceptable for non-financial operations. Payment context requires synchronous confirmation | Must enumerate at least 3 constraints. Validate that each constraint is actionable and testable. Reject vague constraints like 'good performance' |
[STAKEHOLDER_LIST] | Identifies domain experts, product owners, and engineering leads who can validate context boundaries | Domain Expert: Sarah (fulfillment), Product Owner: James (checkout), Engineering Lead: Priya (platform), Architect: Miguel (integration) | Must include at least 2 roles with named individuals. Validate that each stakeholder maps to at least one business capability in [DOMAIN_DESCRIPTION] |
[OUTPUT_SCHEMA] | Defines the expected structure for the bounded context map output | JSON schema with fields: contextName, responsibility, coreEntities, integrationPoints, partnerContexts, antiCorruptionLayerRequired, justification | Must be a valid JSON Schema or TypeScript interface. Validate parseability before prompt execution. Reject if schema lacks responsibility and integration point fields |
[CONTEXT_OVERLAP_THRESHOLD] | Sets the acceptable level of overlapping responsibility between contexts before flagging for review | 0.15 | Must be a float between 0.0 and 1.0. Default 0.2 if not specified. Validate that threshold is numeric and within range. Lower values produce more conservative boundary splits |
Implementation Harness Notes
How to wire the Bounded Context Discovery prompt into an architecture review workflow with validation, retries, and human review gates.
The Bounded Context Discovery prompt is designed to be used as a structured analysis step within a broader architecture review workflow, not as a standalone chat interaction. It accepts a domain description, business capability inventory, and existing system context as inputs, and produces a candidate context map with terminology, boundaries, and integration points. Because the output directly influences service decomposition decisions that carry multi-year cost and complexity implications, the implementation harness must include validation checks, human review gates, and traceable rationale before any output is accepted as an architectural decision.
Wire the prompt into an application by constructing a request pipeline that assembles the three required inputs—[DOMAIN_DESCRIPTION], [BUSINESS_CAPABILITIES], and [EXISTING_SYSTEM_CONTEXT]—from structured sources such as architecture documentation, event storming outputs, or capability models. Before calling the model, validate that each input field is non-empty and contains sufficient detail (at minimum, a paragraph of domain narrative and a list of at least five distinct business capabilities). After receiving the model response, parse the output against the expected schema: a JSON object containing bounded_contexts (array of context objects with name, core_responsibilities, key_entities, ubiquitous_language_terms, and integration_points), context_map (a matrix or edge list describing relationships between contexts), and overlap_concerns (array of potential boundary conflicts). Run automated validation checks including: (1) every bounded context must have at least one distinct responsibility not fully claimed by another context, (2) integration points must reference valid context names, and (3) overlap concerns must cite specific contexts. If validation fails, retry with the error details appended to the prompt as [PREVIOUS_OUTPUT_ERRORS].
For high-stakes architecture decisions, route validated outputs to a human review queue rather than auto-applying them. The review interface should display the original inputs, the generated context map, any overlap concerns flagged by the model, and the validation results. Reviewers should confirm that contexts align with organizational team boundaries (Conway's Law check), that no critical business capability is orphaned, and that integration points reflect actual system dependencies. Log every prompt invocation with input hashes, output snapshots, validation results, reviewer identity, and final disposition (accepted, revised, rejected) to create an audit trail suitable for architecture decision records. Avoid using this prompt on domains where the business capability inventory is incomplete or where the existing system context is poorly understood—garbage-in, garbage-out applies with high consequence here.
Expected Output Contract
Defines the structure, types, and validation rules for the bounded context discovery output. Use this contract to parse, validate, and integrate the model response into downstream architecture tools.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
context_map | JSON Array | Must be a non-empty array. Each element must be a valid context object. Schema validation required before ingestion. | |
context_map[].name | String | Must be a non-empty string. Should match a recognizable business capability name. No generic labels like 'Context 1'. | |
context_map[].description | String | Must be at least 20 characters. Must describe the responsibility of the context, not just restate the name. | |
context_map[].core_domain_terms | Array of Strings | Must contain at least 3 unique terms. Each term must be a noun phrase. Duplicate terms across contexts trigger a context overlap warning. | |
context_map[].integration_points | Array of Objects | Each object must include 'target_context' (String, must match another context name or 'External') and 'relationship' (String, one of: 'Upstream', 'Downstream', 'Partnership', 'Conformist', 'Anti-Corruption Layer'). | |
context_map[].responsibility_boundary | String | Must explicitly state what this context owns and what it does not own. Parse for boundary statements containing 'owns', 'is responsible for', 'does not include'. | |
context_map[].context_overlap_warnings | Array of Strings | If present, each string must reference a specific other context name and the overlapping concern. Null or empty array is acceptable if no overlaps detected. | |
context_map[].confidence_score | Number (0.0 - 1.0) | If present, must be a float between 0.0 and 1.0. Scores below 0.7 should trigger a human review flag for that context. |
Common Failure Modes
Bounded context discovery is a socio-technical exercise. The prompt can fail by producing a technically plausible map that ignores organizational reality, invents domains, or misses implicit constraints. These cards cover the most common failure modes and how to guard against them before the context map reaches an architecture decision record.
Organizational Structure Override
What to watch: The model produces boundaries that mirror a textbook domain decomposition but ignore the actual team topology, reporting lines, and communication paths in your organization. The resulting context map looks correct on a whiteboard but is impossible to implement because no team owns the boundaries. Guardrail: Include current team ownership data and reporting structure in the input context. Add an eval check that asks: 'Does each bounded context map to an existing team or a planned team with a named owner?' Flag any context without organizational alignment.
Invented Business Capabilities
What to watch: The model hallucinates business capabilities that do not exist in the source material, especially when the input is sparse or the domain is unfamiliar. It may create plausible-sounding contexts like 'Customer Insights Engine' or 'Fraud Detection Service' that have no basis in the actual business. Guardrail: Require every bounded context to cite specific evidence from the input documents, event storming outputs, or stakeholder interviews. Add a grounding check that flags any context without at least two source references. Reject contexts that cannot be traced to a concrete business process or system.
Ubiquitous Language Contamination
What to watch: The same term appears with different meanings across bounded contexts, or different terms appear for the same concept, without the model detecting the conflict. This produces a context map that looks clean but encodes semantic ambiguity that will cause integration defects later. Guardrail: Add a terminology conflict detection pass after the initial context map is generated. For each key term, ask: 'Does this term have a single, consistent definition across all contexts where it appears?' Flag terms with divergent definitions and require explicit translation mappings between contexts.
Missing Implicit Contexts
What to watch: The model identifies explicit business domains but misses implicit bounded contexts such as authentication, authorization, audit logging, notification delivery, or file storage. These cross-cutting concerns are often omitted because they are not mentioned in domain descriptions but are critical to system architecture. Guardrail: Include a checklist of common implicit contexts in the prompt instructions and require the model to explicitly confirm or reject each one with justification. Add a review step that asks: 'What cross-cutting capabilities are required by multiple contexts but not yet assigned?'
Granularity Inconsistency
What to watch: The model produces contexts at wildly different levels of granularity within the same map. One context represents an entire department while another represents a single CRUD operation, making the map useless for service decomposition decisions. Guardrail: Define granularity constraints in the prompt, such as 'Each bounded context should represent a distinct business capability that could be owned by a single team of 5-9 people.' Add a granularity consistency check that measures the scope of each context against a reference and flags outliers for manual review.
Integration Point Blindness
What to watch: The model defines clean boundaries but fails to identify the integration points between them, producing a context map with isolated islands and no communication paths. The map looks elegant but provides no guidance on how contexts will interact, which is where most architectural risk lives. Guardrail: Require the prompt to produce an explicit integration relationship matrix alongside the context map, with relationship types (partnership, customer-supplier, conformist, anti-corruption layer, open host, published language). Add a completeness check that verifies every context has at least one integration relationship defined.
Evaluation Rubric
Criteria for evaluating the quality and correctness of a bounded context discovery output before integrating it into architecture decisions.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Domain terminology consistency | All context names use terms from the source business capability description; no invented jargon | Context names introduce new terms not present in [DOMAIN_DESCRIPTION] or contradict existing glossary entries | Diff context names against a provided [UBIQUITOUS_LANGUAGE_GLOSSARY]; flag unrecognized terms |
Responsibility boundary clarity | Each context has a single, non-overlapping core responsibility stated in one sentence | Two contexts claim ownership of the same business capability or data entity without a shared kernel justification | Parse each context's responsibility statement; check for duplicate capability keywords across contexts |
Integration point completeness | Every cross-context relationship identified in [DOMAIN_DESCRIPTION] has a corresponding integration point with a named pattern | A business flow described in the source material spans two contexts but no integration point is listed | Trace each business process from [DOMAIN_DESCRIPTION] through the context map; verify every crossing has an integration entry |
Context overlap detection | No two bounded contexts share more than one core entity without an explicit shared kernel or ACL annotation | Two contexts list the same aggregate root or transactional boundary without a documented integration pattern | Extract all entities per context; run set intersection; flag pairs with overlap above 1 entity and no shared kernel tag |
Aggregate root identification | Each context identifies at least one aggregate root that enforces consistency within its boundary | A context has no aggregate root or lists multiple roots that modify the same child entities | Check each context for an aggregate root field; verify child entities are only modified by one root per context |
Business process coverage | All business processes from [DOMAIN_DESCRIPTION] are assigned to at least one bounded context | A business process step from the source material has no owning context or falls in a gap between contexts | Map each process step from [DOMAIN_DESCRIPTION] to a context; flag unassigned steps |
Context size reasonableness | No context contains more than 8 core entities or fewer than 1; outliers have explicit justification | A context has 15+ entities with no sub-context breakdown or a context has zero entities | Count entities per context; flag contexts outside the 1-8 range that lack a justification field |
Output schema validity | Output matches the [OUTPUT_SCHEMA] exactly; all required fields present; no extra top-level keys | Output is missing required fields, contains malformed JSON, or includes fields not in the schema | Validate output against [OUTPUT_SCHEMA] using a JSON schema validator; reject on any schema violation |
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 frontier model (GPT-4o, Claude 3.5 Sonnet) and a single representative business capability document. Skip strict schema validation. Accept free-text context maps as output. Focus on getting useful boundary candidates, not production-grade consistency.
Replace the [OUTPUT_SCHEMA] placeholder with: Return a markdown document with sections for each candidate bounded context. Each section should include: name, core responsibility, key domain terms, and integration points.
Watch for
- Overlapping responsibilities between contexts that the model doesn't flag
- Missing ubiquitous language terms because the input document is too sparse
- Context maps that look plausible but don't survive a walkthrough with domain experts
- No confidence indicators on boundary decisions

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