Skip to content

context-map schema (v0.1)

The models/context-map.json file is validated by the normative JSON Schema published at its canonical URL:

PropertyTypeRequiredDescription
kind"context-map-file"yes
schemaVersion"0.1.0"yes
contextsContextMapContext[]yesBounded contexts — the nodes of the map.
edgesIntegrationEdge[]yesTyped integration relationships — the edges of the map.
VisualisationSetupVisualisationSetupno

A bounded context on the map.

PropertyTypeRequiredDescription
kind"context"yes
idstringyes
namestringyes
descriptionstringno
subdomain"core" | "supporting" | "generic"noOptional classification — populated by G-STRAT-01 (subdomains) later.
termIdsstring[]noLinks to Ubiquitous Dictionary terms owned by this context.
teamstringnoOptional team that owns this context (DDD Crew team mapping).
positionobjectno

A typed integration relationship between two bounded contexts.

PropertyTypeRequiredDescription
kind"integration-edge"yes
idstringyes
sourceContextIdstringyes
targetContextIdstringyes
patternIntegrationPatternyes
descriptionstringno

The nine DDD Crew context-map integration patterns.

Type: "partnership" | "shared-kernel" | "customer-supplier" | "conformist" | "anticorruption-layer" | "open-host-service" | "published-language" | "separate-ways" | "big-ball-of-mud"

INTERNAL: Context Studio canvas state only; never emitted to coding agents.

PropertyTypeRequiredDescription
nodePositionsRecord<string, object>yes
zoomLevelnumberyes
viewportobjectno
updatedAtstringno

Representative models/context-map.json files committed under samples/context-map/. Each demo shows three views — pick the one you want: Canvas (rendered through the same SvelteFlow component the IDE uses), Mermaid (a static-flowchart fallback), or Raw JSON. All assets are locally served; no GitHub redirect.

↓ download
demo-01-symmetric-patterns.context-map.json — Context Studio canvas view

Demo 1 — DDD context map with symmetrical integration patterns: Partnership (mutual dependency) and Shared Kernel (explicit shared model subset).

demo-01-symmetric-patterns.context-map.json — Demo 1 — DDD context map with symmetrical integration patterns: Partnership (mutual dependency) and Shared Kernel (explicit shared model subset). (expand for full JSON)
demo-01-symmetric-patterns.context-map.json
{
"kind": "context-map-file",
"schemaVersion": "0.1.0",
"contexts": [
{
"kind": "context",
"id": "catalog",
"name": "Catalog",
"description": "Product catalog with prices and SKUs.",
"subdomain": "core",
"team": "Catalog",
"position": {
"x": 0,
"y": 0
}
},
{
"kind": "context",
"id": "pricing",
"name": "Pricing",
"description": "Promotion and discount rules.",
"subdomain": "core",
"team": "Pricing",
"position": {
"x": 300,
"y": 0
}
},
{
"kind": "context",
"id": "checkout",
"name": "Checkout",
"description": "Cart + order placement.",
"subdomain": "core",
"team": "Checkout",
"position": {
"x": 600,
"y": 0
}
}
],
"edges": [
{
"kind": "integration-edge",
"id": "edge-catalog-pricing-partnership",
"sourceContextId": "catalog",
"targetContextId": "pricing",
"pattern": "partnership",
"description": "Mutual dependency — joint planning on price + SKU changes; both teams must agree before shipping a price-affecting change."
},
{
"kind": "integration-edge",
"id": "edge-catalog-pricing-kernel",
"sourceContextId": "catalog",
"targetContextId": "pricing",
"pattern": "shared-kernel",
"description": "Both contexts share a small Money/Price value-object kernel; managed by both teams."
}
]
}
↓ download
demo-02-asymmetric-patterns.context-map.json — Context Studio canvas view

Demo 2 — DDD context map with asymmetric integration patterns: Customer-Supplier, Conformist, Anticorruption Layer, Open Host Service, Published Language.

demo-02-asymmetric-patterns.context-map.json — Demo 2 — DDD context map with asymmetric integration patterns: Customer-Supplier, Conformist, Anticorruption Layer, Open Host Service, Published Language. (expand for full JSON)
demo-02-asymmetric-patterns.context-map.json
{
"kind": "context-map-file",
"schemaVersion": "0.1.0",
"contexts": [
{
"kind": "context",
"id": "pricing-svc",
"name": "Pricing Service",
"description": "Owns the canonical price list.",
"subdomain": "core",
"team": "Pricing",
"position": {
"x": 0,
"y": 0
}
},
{
"kind": "context",
"id": "booking-svc",
"name": "Booking Service",
"description": "Consumes prices for booking flow.",
"subdomain": "core",
"team": "Booking",
"position": {
"x": 300,
"y": 0
}
},
{
"kind": "context",
"id": "legacy-erp",
"name": "Legacy ERP",
"description": "Monolithic enterprise resource planning system.",
"subdomain": "generic",
"team": "ERP-Ops",
"position": {
"x": 0,
"y": 200
}
},
{
"kind": "context",
"id": "reporting",
"name": "Reporting",
"description": "BI dashboards.",
"subdomain": "supporting",
"team": "BI",
"position": {
"x": 600,
"y": 0
}
}
],
"edges": [
{
"kind": "integration-edge",
"id": "edge-pricing-booking",
"sourceContextId": "pricing-svc",
"targetContextId": "booking-svc",
"pattern": "customer-supplier",
"description": "Pricing is upstream supplier; Booking is downstream customer with influence on the price API."
},
{
"kind": "integration-edge",
"id": "edge-booking-reporting-ohs",
"sourceContextId": "booking-svc",
"targetContextId": "reporting",
"pattern": "open-host-service",
"description": "Booking exposes a stable public protocol that many downstream contexts consume."
},
{
"kind": "integration-edge",
"id": "edge-legacy-booking-conformist",
"sourceContextId": "legacy-erp",
"targetContextId": "booking-svc",
"pattern": "conformist",
"description": "Booking conforms to the legacy ERP's data shape; no influence back."
},
{
"kind": "integration-edge",
"id": "edge-pricing-reporting-pl",
"sourceContextId": "pricing-svc",
"targetContextId": "reporting",
"pattern": "published-language",
"description": "Pricing publishes price events in a shared interchange schema (Avro/Protobuf)."
}
]
}
↓ download
demo-03-anti-patterns.context-map.json — Context Studio canvas view

Demo 3 — DDD context map showing non-cooperation / quarantine patterns: Separate Ways (deliberate non-integration) and Big Ball of Mud (entangled legacy).

demo-03-anti-patterns.context-map.json — Demo 3 — DDD context map showing non-cooperation / quarantine patterns: Separate Ways (deliberate non-integration) and Big Ball of Mud (entangled legacy). (expand for full JSON)
demo-03-anti-patterns.context-map.json
{
"kind": "context-map-file",
"schemaVersion": "0.1.0",
"contexts": [
{
"kind": "context",
"id": "modern-booking",
"name": "Modern Booking",
"description": "Greenfield booking system with clean architecture.",
"subdomain": "core",
"team": "Booking",
"position": {
"x": 0,
"y": 0
}
},
{
"kind": "context",
"id": "legacy-crm",
"name": "Legacy CRM",
"description": "25-year-old CRM monolith.",
"subdomain": "generic",
"team": "CRM-Support",
"position": {
"x": 300,
"y": 200
}
},
{
"kind": "context",
"id": "side-experiment",
"name": "Side Experiment",
"description": "R&D spike, intentionally isolated from prod.",
"subdomain": "supporting",
"team": "R&D",
"position": {
"x": 600,
"y": 0
}
}
],
"edges": [
{
"kind": "integration-edge",
"id": "edge-modern-separate",
"sourceContextId": "modern-booking",
"targetContextId": "side-experiment",
"pattern": "separate-ways",
"description": "Deliberate non-cooperation — the experiment must not influence production data."
},
{
"kind": "integration-edge",
"id": "edge-modern-mud",
"sourceContextId": "modern-booking",
"targetContextId": "legacy-crm",
"pattern": "big-ball-of-mud",
"description": "Tangled legacy integration; strategy is to contain, not entangle."
}
]
}
↓ download
demo-04-acl-and-shared-kernel.context-map.json — Context Studio canvas view

Demo 4 — DDD context map with Anticorruption Layer (ACL) + a small Shared Kernel between two core domains. Exercises ACL translation layer and shared-kernel patterns.

demo-04-acl-and-shared-kernel.context-map.json — Demo 4 — DDD context map with Anticorruption Layer (ACL) + a small Shared Kernel between two core domains. Exercises ACL translation layer and shared-kernel patterns. (expand for full JSON)
demo-04-acl-and-shared-kernel.context-map.json
{
"kind": "context-map-file",
"schemaVersion": "0.1.0",
"contexts": [
{
"kind": "context",
"id": "external-vendor",
"name": "External Vendor API",
"description": "Third-party flight-inventory vendor with its own model.",
"subdomain": "generic",
"team": "external",
"termIds": ["vendor:FlightOffer", "vendor:FareClass"],
"position": {
"x": 0,
"y": 0
}
},
{
"kind": "context",
"id": "inventory",
"name": "Inventory",
"description": "Internal inventory context; consumes the vendor via ACL.",
"subdomain": "core",
"team": "Inventory",
"termIds": ["FlightOffer", "FareClass", "SeatMap"],
"position": {
"x": 300,
"y": 0
}
},
{
"kind": "context",
"id": "pricing",
"name": "Pricing",
"description": "Owns fares; shares the FlightOffer/FareClass value-object kernel with Inventory.",
"subdomain": "core",
"team": "Pricing",
"termIds": ["FlightOffer", "FareClass", "FareRule"],
"position": {
"x": 600,
"y": 0
}
}
],
"edges": [
{
"kind": "integration-edge",
"id": "edge-vendor-inventory-acl",
"sourceContextId": "external-vendor",
"targetContextId": "inventory",
"pattern": "anticorruption-layer",
"description": "Inventory translates vendor's domain into our internal model via an ACL; the vendor's model does not leak downstream."
},
{
"kind": "integration-edge",
"id": "edge-inventory-pricing-kernel",
"sourceContextId": "inventory",
"targetContextId": "pricing",
"pattern": "shared-kernel",
"description": "FlightOffer and FareClass are a jointly-managed value-object kernel; changes require both teams to agree."
}
]
}

The context-map model is one of the stub records — every downstream surface (CLI, MCP, docs, tests) reads from one record. The pasteable snippet below is the Door 1 anchor a downstream agent should see before touching this model.

paste into AGENTS.md / CLAUDE.md
- **Context Map v0.1.0** — `models/context-map.json`.
Produces: The strategic map itself: bounded-context boundaries + typed integration edges, queryable over MCP; brownfield import promotes hypothesis clusters into it.
Oracle: integration edges are typed per the 9-pattern grammar — an untyped edge is a validation error, not a style choice.
Downstream: `ctxbrew semantics context-map` · `ctxbrew://semantics/context-map/v0.1.0` — read the record first.

The full record (every door — anchor template, tool description hint, response annotations, behavior tripwire, and the complete produced-surface list) is served as JSON at:

  • CLI — ctxbrew semantics context-map --schema-version 0.1.0
  • MCP — ctxbrew://semantics/context-map/v0.1.0
  • HTTP — https://contextbrew.dev/schemas/context-map/v0.1/semantics.json

See the schemas overview for the versioning policy and how these files are generated and kept in sync.